*/
private void checkIfModified()
{
- if (!adjusting)
+ Object newValue = updateSliderFromValueField();
+ boolean modified = true;
+ if (newValue.getClass() == lastVal.getClass())
{
- try
- {
- adjusting = true;
- Object newValue = updateSliderFromValueField();
- boolean modified = true;
- if (newValue.getClass() == lastVal.getClass())
- {
- modified = !newValue.equals(lastVal);
- }
- pmdialogbox.argSetModified(this, modified);
- } finally
- {
- adjusting = false;
- }
+ modified = !newValue.equals(lastVal);
}
+ pmdialogbox.argSetModified(this, modified);
}
@Override
if (isChoiceParameter)
{
choicebox = buildComboBox(parm);
+ choicebox.addActionListener(this);
controlsPanel.add(choicebox, BorderLayout.CENTER);
}
else
}
}
- if (!isChoiceParameter && parm != null)
+ String value = parm.getValue();
+ if (value != null)
{
- valueField.setText(parm.getValue());
+ if (isChoiceParameter)
+ {
+ choicebox.setSelectedItem(value);
+ }
+ else
+ {
+ valueField.setText(value);
+ }
}
lastVal = updateSliderFromValueField();
adjusting = false;