OptionI option;
- JComboBox<String> val;
+ JComboBox<Object> val;
/**
* Constructs and adds labels and controls to the panel for one Option
{
option = opt;
setLayout(new FlowLayout(FlowLayout.LEFT));
- enabled = new JCheckBox(opt.getName());
+ enabled = new JCheckBox(opt.getLabel());
enabled.setSelected(opt.isRequired());
/*
if (opt.isRequired() && !(opt instanceof JabaOption))
{
finfo = null;
- add(new JLabel(opt.getName()));
+ add(new JLabel(opt.getLabel()));
}
else
{
/*
* drop-down list of choice options (if applicable)
*/
- JComboBox<String> choicebox;
+ JComboBox<Object> choicebox;
/*
* radio buttons as an alternative to combo box
return valueField.getText().trim();
}
+ if (validator.getMin() == null || validator.getMax() == null)
+ {
+ slider.setVisible(false);
+ }
+
valueField.setText(valueField.getText().trim());
/*
{
slider.setVisible(false);
}
- return new Integer(iVal);
+ return Integer.valueOf(iVal);
}
if (isLogarithmicParameter)
try
{
double eValue = Double.valueOf(valueField.getText());
- dVal = Math.log(eValue) * sliderScaleFactor;
+ dVal = Math.log(eValue);
} catch (Exception e)
{
// shouldn't be possible here
* 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;
{
slider.setVisible(false);
}
- return new Float(fVal);
+ return Float.valueOf(fVal);
}
}
* @param opt
* @return
*/
- protected static JComboBox<String> buildComboBox(OptionI opt)
+ protected static JComboBox<Object> buildComboBox(OptionI opt)
{
- JComboBox<String> cb = null;
+ JComboBox<Object> cb = null;
List<String> displayNames = opt.getDisplayNames();
if (displayNames != null)
{
- cb = JvSwingUtils.buildComboWithTooltips(displayNames,
+ List<Object> displayNamesObjects = new ArrayList<>();
+ displayNamesObjects.addAll(displayNames);
+ cb = JvSwingUtils.buildComboWithTooltips(displayNamesObjects,
opt.getPossibleValues());
}
else