JAL-2592 distinguish "User Defined" (scheme name) from "User Defined..." bug/JAL-2592userDefinedScheme
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 9 Jun 2017 12:18:00 +0000 (13:18 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 9 Jun 2017 12:18:00 +0000 (13:18 +0100)
menu item id

src/jalview/gui/AlignFrame.java
src/jalview/gui/ColourMenuHelper.java
src/jalview/schemes/ResidueColourScheme.java
src/jalview/schemes/UserColourScheme.java

index a9a970f..060d7b1 100644 (file)
@@ -3344,7 +3344,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
      * 'User Defined' opens a panel to configure or load a
      * user-defined colour scheme
      */
-    if (ResidueColourScheme.USER_DEFINED.equals(name))
+    if (ResidueColourScheme.USER_DEFINED_MENU.equals(name))
     {
       new UserDefinedColours(alignPanel);
       return;
index b2b9574..8ffc070 100644 (file)
@@ -177,13 +177,13 @@ public class ColourMenuHelper
       final String label = MessageManager.getString("action.user_defined");
       JRadioButtonMenuItem userDefinedColour = new JRadioButtonMenuItem(
               label);
-      userDefinedColour.setName(ResidueColourScheme.USER_DEFINED);
+      userDefinedColour.setName(ResidueColourScheme.USER_DEFINED_MENU);
       userDefinedColour.addActionListener(new ActionListener()
       {
         @Override
         public void actionPerformed(ActionEvent e)
         {
-          client.changeColour_actionPerformed(ResidueColourScheme.USER_DEFINED);
+          client.changeColour_actionPerformed(ResidueColourScheme.USER_DEFINED_MENU);
         }
       });
       colourMenu.add(userDefinedColour);
@@ -230,7 +230,7 @@ public class ColourMenuHelper
         {
           none = radioButton;
         }
-        if (ResidueColourScheme.USER_DEFINED.equals(buttonName))
+        if (ResidueColourScheme.USER_DEFINED_MENU.equals(buttonName))
         {
           userDefined = radioButton;
         }
index b47b82e..6aa798e 100755 (executable)
@@ -35,9 +35,17 @@ public abstract class ResidueColourScheme implements ColourSchemeI
 {
   public static final String NONE = "None";
 
+  /*
+   * default display name for a user defined colour scheme
+   */
   public static final String USER_DEFINED = "User Defined";
 
   /*
+   * name for (new) "User Defined.." colour scheme menu item
+   */
+  public static final String USER_DEFINED_MENU = "*User Defined*";
+
+  /*
    * lookup up by character value e.g. 'G' to the colors array index
    * e.g. if symbolIndex['K'] = 11 then colors[11] is the colour for K
    */
index 8e58c20..256862d 100755 (executable)
@@ -273,7 +273,7 @@ public class UserColourScheme extends ResidueColourScheme
     {
       return schemeName;
     }
-    return "User Defined";
+    return ResidueColourScheme.USER_DEFINED;
   }
 
   /**