JAL-3167 end cell editing on cancel in colour chooser
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 3 Dec 2018 10:41:37 +0000 (10:41 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 3 Dec 2018 10:41:37 +0000 (10:41 +0000)
src/jalview/gui/FeatureSettings.java

index 3cd6c21..b82cf86 100644 (file)
@@ -1739,13 +1739,20 @@ public class FeatureSettings extends JPanel
            * simple colour chooser
            */
           String ttl = MessageManager.getString("label.select_colour");
-          ColourChooserListener listener = new ColourChooserListener() {
+          ColourChooserListener listener = new ColourChooserListener() 
+          {
             @Override
             public void colourSelected(Color c)
             {
               currentColor = new FeatureColour(c);
               me.table.setValueAt(currentColor, rowSelected, COLOUR_COLUMN);
+              fireEditingStopped();
             }
+                       @Override
+                       public void cancel() 
+                       {
+                 fireEditingStopped();
+                       }
           };
           JalviewColourChooser.showColourChooser(button,  ttl,  currentColor.getColour(), listener);
         }
@@ -1761,7 +1768,6 @@ public class FeatureSettings extends JPanel
             chooser.requestFocus();
           }
           chooser.addActionListener(this);
-          // Make the renderer reappear.
           fireEditingStopped();
         }
       }