Update spike branch to latest
[jalview.git] / src / jalview / gui / OptsAndParamsPage.java
index 298057f..4cac990 100644 (file)
@@ -574,23 +574,13 @@ public class OptsAndParamsPage
      */
     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
@@ -734,6 +724,7 @@ public class OptsAndParamsPage
         if (isChoiceParameter)
         {
           choicebox = buildComboBox(parm);
+          choicebox.addActionListener(this);
           controlsPanel.add(choicebox, BorderLayout.CENTER);
         }
         else
@@ -765,9 +756,17 @@ public class OptsAndParamsPage
         }
       }
 
-      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;