JAL-3058 missed refactoring of JColorChooser
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 5 Jul 2018 08:52:24 +0000 (09:52 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 5 Jul 2018 08:52:24 +0000 (09:52 +0100)
src/jalview/gui/StructureViewerBase.java

index 2d3b3b5..2cd7f56 100644 (file)
@@ -36,7 +36,6 @@ import jalview.io.JalviewFileView;
 import jalview.jbgui.GStructureViewer;
 import jalview.schemes.ColourSchemeI;
 import jalview.schemes.ColourSchemes;
-import jalview.schemes.FeatureColour;
 import jalview.structure.StructureMapping;
 import jalview.structures.models.AAStructureBindingModel;
 import jalview.util.MessageManager;
@@ -59,8 +58,6 @@ import java.util.Vector;
 
 import javax.swing.ButtonGroup;
 import javax.swing.JCheckBoxMenuItem;
-import javax.swing.JColorChooser;
-import javax.swing.JDialog;
 import javax.swing.JMenu;
 import javax.swing.JMenuItem;
 import javax.swing.JRadioButtonMenuItem;
@@ -812,11 +809,14 @@ public abstract class StructureViewerBase extends GStructureViewer
     return reply;
   }
 
+  /**
+   * Opens a colour chooser dialog, and applies the chosen colour to the
+   * background of the structure viewer
+   */
   @Override
   public void background_actionPerformed(ActionEvent actionEvent)
   {
-    String ttl = MessageManager
-            .getString("label.select_background_colour");
+    String ttl = MessageManager.getString("label.select_background_colour");
     ColourChooserListener listener = new ColourChooserListener()
     {
       @Override
@@ -825,6 +825,7 @@ public abstract class StructureViewerBase extends GStructureViewer
         getBinding().setBackgroundColour(c);
       }
     };
+    JalviewColourChooser.showColourChooser(this, ttl, null, listener);
   }
 
   @Override