JLabel optlabel = new JLabel();
- JComboBox val = new JComboBox();
+ JComboBox<String> val = new JComboBox<>();
public OptionBox(OptionI opt)
{
}
}
add(enabled, BorderLayout.NORTH);
- for (Object str : opt.getPossibleValues())
+ for (String str : opt.getPossibleValues())
{
val.addItem(str);
}
boolean integ = false;
- Object lastVal;
+ String lastVal;
ParameterI parameter;
Slider slider = null;
- /*
- * true minimum corresponding to 0 (minimum) of the slider
- */
- int sliderZeroValue;
-
JTextArea string = new JTextArea();
ValueConstrainI validator = null;
*
* @return
*/
- private Object getCurrentValue()
+ private String getCurrentValue()
{
- return choice ? choicebox.getSelectedItem() : valueField.getText();
+ return choice ? (String) choicebox.getSelectedItem()
+ : valueField.getText();
}
@Override
{
if (choice)
{
- choicebox = new JComboBox();
+ choicebox = new JComboBox<>();
choicebox.addActionListener(this);
controlPanel.add(choicebox, BorderLayout.CENTER);
}
}
});
valueField.setPreferredSize(new Dimension(60, 25));
+ valueField.setText(parm.getValue());
slider = makeSlider(parm.getValidValue());
+ updateSliderFromValueField();
slider.addChangeListener(this);
controlPanel.add(slider, BorderLayout.WEST);