Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distribution input fields are broken log normal - fix 2100284 #195

Merged
merged 2 commits into from
Mar 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ private void initComponents() {
distributionParam1Field = new JTextField(5);
distributionParam2Field = new JTextField(5);
distributionParam3Field = new JTextField(5);

meanLabel = new JLabel();
meanValueLabel = new JLabel();
SwingHelper.setPreferredWidth(distributionParam1Field, 100);
Expand All @@ -86,7 +87,7 @@ public void display() {
SMCDistribution distrib = parseDistribution();
if (distrib.getMean() != null && !(distrib instanceof SMCNormalDistribution)) {
meanLabel.setText("Mean :");
meanValueLabel.setText(String.valueOf(distrib.getMean()));
meanValueLabel.setText(String.format("%.3f", distrib.getMean()));
} else {
meanLabel.setText("");
meanValueLabel.setText("");
Expand Down Expand Up @@ -145,7 +146,7 @@ public void display() {
paramPanel.add(distributionParam3Field, gbc);
gbc = GridBagHelper.as(3 ,0, GridBagHelper.Anchor.WEST, new Insets(3, 3, 3, 3));
gbc.fill = GridBagConstraints.HORIZONTAL;
paramPanel.setPreferredSize(new Dimension(350, paramPanel.getPreferredSize().height));
paramPanel.setPreferredSize(new Dimension(450, paramPanel.getPreferredSize().height));
add(paramPanel, gbc);

gbc.fill = GridBagConstraints.NONE;
Expand Down Expand Up @@ -287,7 +288,7 @@ public void displayDistributionFields(SMCDistribution distribution) {

if (distribution.getMean() != null && !(distribution instanceof SMCNormalDistribution)) {
meanLabel.setText("Mean :");
meanValueLabel.setText(String.valueOf(distribution.getMean()));
meanValueLabel.setText(String.format("%.3f", distribution.getMean()));
} else {
meanLabel.setText("");
meanValueLabel.setText("");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ private void initComponents() {
gridBagConstraints = GridBagHelper.as(2, 1, Anchor.WEST, new Insets(3, 3, 3, 3));
transitionEditorPanel.add(sharedCheckBox, gridBagConstraints);


makeSharedButton = new JButton();
makeSharedButton.setText("Make shared");
makeSharedButton.setMaximumSize(new java.awt.Dimension(110, 25));
Expand Down