X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FOptsAndParamsPage.java;h=046eb819f35281049b82c7b7597e9e7347c60a44;hb=71c5a29a58e5505aaf7d63a8c9f1bea3ae93d629;hp=00c5a926fc7fb7f73298d2394022cf5b66a02604;hpb=85ef061623b5d90777dbf04febaac30f28c0075a;p=jalview.git diff --git a/src/jalview/gui/OptsAndParamsPage.java b/src/jalview/gui/OptsAndParamsPage.java index 00c5a92..046eb81 100644 --- a/src/jalview/gui/OptsAndParamsPage.java +++ b/src/jalview/gui/OptsAndParamsPage.java @@ -126,7 +126,7 @@ public class OptsAndParamsPage OptionI option; - JComboBox val; + JComboBox val; /** * Constructs and adds labels and controls to the panel for one Option @@ -137,7 +137,7 @@ public class OptsAndParamsPage { option = opt; setLayout(new FlowLayout(FlowLayout.LEFT)); - enabled = new JCheckBox(opt.getName()); + enabled = new JCheckBox(opt.getLabel()); enabled.setSelected(opt.isRequired()); /* @@ -147,7 +147,7 @@ public class OptsAndParamsPage if (opt.isRequired() && !(opt instanceof JabaOption)) { finfo = null; - add(new JLabel(opt.getName())); + add(new JLabel(opt.getLabel())); } else { @@ -357,7 +357,7 @@ public class OptsAndParamsPage /* * drop-down list of choice options (if applicable) */ - JComboBox choicebox; + JComboBox choicebox; /* * radio buttons as an alternative to combo box @@ -903,6 +903,11 @@ public class OptsAndParamsPage return valueField.getText().trim(); } + if (validator.getMin() == null || validator.getMax() == null) + { + slider.setVisible(false); + } + valueField.setText(valueField.getText().trim()); /* @@ -951,7 +956,7 @@ public class OptsAndParamsPage { slider.setVisible(false); } - return new Integer(iVal); + return Integer.valueOf(iVal); } if (isLogarithmicParameter) @@ -960,7 +965,7 @@ public class OptsAndParamsPage try { double eValue = Double.valueOf(valueField.getText()); - dVal = Math.log(eValue) * sliderScaleFactor; + dVal = Math.log(eValue); } catch (Exception e) { // shouldn't be possible here @@ -973,14 +978,15 @@ public class OptsAndParamsPage * sliderScaleFactor; double scaleMax = Math.log(validator.getMax().doubleValue()) * sliderScaleFactor; - slider.getModel().setRangeProperties((int) (dVal), 1, + slider.getModel().setRangeProperties( + (int) (sliderScaleFactor * dVal), 1, (int) scaleMin, 1 + (int) scaleMax, true); } else { slider.setVisible(false); } - return new Double(dVal); + return Double.valueOf(dVal); } float fVal = 0f; @@ -1005,7 +1011,7 @@ public class OptsAndParamsPage { slider.setVisible(false); } - return new Float(fVal); + return Float.valueOf(fVal); } } @@ -1172,13 +1178,15 @@ public class OptsAndParamsPage * @param opt * @return */ - protected static JComboBox buildComboBox(OptionI opt) + protected static JComboBox buildComboBox(OptionI opt) { - JComboBox cb = null; + JComboBox cb = null; List displayNames = opt.getDisplayNames(); if (displayNames != null) { - cb = JvSwingUtils.buildComboWithTooltips(displayNames, + List displayNamesObjects = new ArrayList<>(); + displayNamesObjects.addAll(displayNames); + cb = JvSwingUtils.buildComboWithTooltips(displayNamesObjects, opt.getPossibleValues()); } else