From: gmungoc Date: Fri, 9 Jun 2017 12:18:00 +0000 (+0100) Subject: JAL-2592 distinguish "User Defined" (scheme name) from "User Defined..." X-Git-Tag: Release_2_10_3b1~132^2~11^2^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=11b2e9b16c3bb93d8788c2bc5d5654f6163402e6;p=jalview.git JAL-2592 distinguish "User Defined" (scheme name) from "User Defined..." menu item id --- diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index a9a970f..060d7b1 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -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; diff --git a/src/jalview/gui/ColourMenuHelper.java b/src/jalview/gui/ColourMenuHelper.java index b2b9574..8ffc070 100644 --- a/src/jalview/gui/ColourMenuHelper.java +++ b/src/jalview/gui/ColourMenuHelper.java @@ -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; } diff --git a/src/jalview/schemes/ResidueColourScheme.java b/src/jalview/schemes/ResidueColourScheme.java index b47b82e..6aa798e 100755 --- a/src/jalview/schemes/ResidueColourScheme.java +++ b/src/jalview/schemes/ResidueColourScheme.java @@ -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 */ diff --git a/src/jalview/schemes/UserColourScheme.java b/src/jalview/schemes/UserColourScheme.java index 8e58c20..256862d 100755 --- a/src/jalview/schemes/UserColourScheme.java +++ b/src/jalview/schemes/UserColourScheme.java @@ -273,7 +273,7 @@ public class UserColourScheme extends ResidueColourScheme { return schemeName; } - return "User Defined"; + return ResidueColourScheme.USER_DEFINED; } /**