X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fgui%2FOptsAndParamsPage.java;h=e0427cc1db362eae25ee395c7ed931d633288fae;hb=2e531bf4493e93059becb2cd2238d8dfabd72ea2;hp=ba575ae5abcd1152201808f7976bd82c90f838d9;hpb=6a44ba8cd68f29329876560cfe24403fe3e7a565;p=jalview.git diff --git a/src/jalview/gui/OptsAndParamsPage.java b/src/jalview/gui/OptsAndParamsPage.java index ba575ae..e0427cc 100644 --- a/src/jalview/gui/OptsAndParamsPage.java +++ b/src/jalview/gui/OptsAndParamsPage.java @@ -93,7 +93,7 @@ public class OptsAndParamsPage JLabel optlabel = new JLabel(); - JComboBox val = new JComboBox(); + JComboBox val = new JComboBox<>(); public OptionBox(OptionI opt) { @@ -127,7 +127,7 @@ public class OptsAndParamsPage } } add(enabled, BorderLayout.NORTH); - for (Object str : opt.getPossibleValues()) + for (String str : opt.getPossibleValues()) { val.addItem(str); } @@ -574,9 +574,8 @@ public class OptsAndParamsPage if (!adjusting) { float value = slider.getSliderValue(); - valueField.setText( - integ ? Integer.toString((int) value) - : Float.toString(value)); + valueField.setText(integ ? Integer.toString((int) value) + : Float.toString(value)); checkIfModified(); } } @@ -589,7 +588,7 @@ public class OptsAndParamsPage { if (choice) { - choicebox = new JComboBox(); + choicebox = new JComboBox<>(); choicebox.addActionListener(this); controlPanel.add(choicebox, BorderLayout.CENTER); } @@ -622,17 +621,20 @@ public class OptsAndParamsPage { } }); - valueField.addFocusListener(new FocusAdapter() { + valueField.addFocusListener(new FocusAdapter() + { @Override public void focusLost(FocusEvent e) { actionPerformed(null); } - + }); valueField.setPreferredSize(new Dimension(60, 25)); + valueField.setText(parm.getValue()); slider = makeSlider(parm.getValidValue()); + updateSliderFromValueField(); slider.addChangeListener(this); controlPanel.add(slider, BorderLayout.WEST); @@ -699,8 +701,7 @@ public class OptsAndParamsPage { valueField.setText(valueField.getText().trim()); iVal = Integer.valueOf(valueField.getText()); - if (minValue != null - && minValue.intValue() > iVal) + if (minValue != null && minValue.intValue() > iVal) { iVal = minValue.intValue(); // TODO: provide visual indication that hard limit was reached for @@ -731,8 +732,7 @@ public class OptsAndParamsPage { valueField.setText(valueField.getText().trim()); fVal = Float.valueOf(valueField.getText()); - if (minValue != null - && minValue.floatValue() > fVal) + if (minValue != null && minValue.floatValue() > fVal) { fVal = minValue.floatValue(); // TODO: provide visual indication that hard limit was reached for @@ -740,8 +740,7 @@ public class OptsAndParamsPage // update value field to reflect any bound checking we performed. valueField.setText("" + fVal); } - if (maxValue != null - && maxValue.floatValue() < fVal) + if (maxValue != null && maxValue.floatValue() < fVal) { fVal = maxValue.floatValue(); // TODO: provide visual indication that hard limit was reached for