ColourSchemeI oldColourScheme;\r
Frame frame;\r
MCview.AppletPDBCanvas pdbcanvas;\r
- FeatureSettings featureSettings;\r
- String feature;\r
- Color originalFeatureCol;\r
+\r
+ Component caller;\r
+ String originalLabel;\r
+ Color originalColour;\r
\r
int R = 0, G = 0, B = 0;\r
\r
init();\r
}\r
\r
- public UserDefinedColours(FeatureSettings featureSettings,\r
- String feature,\r
- Color col)\r
+ public UserDefinedColours(Component caller,\r
+ String label,\r
+ Color colour)\r
{\r
- this.featureSettings = featureSettings;\r
- this.feature = feature;\r
+ this.caller = caller;\r
+ originalColour = colour;\r
+ originalLabel = label;\r
init();\r
remove(buttonPanel);\r
- originalFeatureCol = col;\r
- setTargetColour(col);\r
+\r
+ setTargetColour(colour);\r
\r
okcancelPanel.setBounds(new Rectangle(0, 113, 400, 35));\r
- frame.setTitle("User Defined Colours - "+feature);\r
+ frame.setTitle("User Defined Colours - "+label);\r
frame.setSize(420, 200);\r
}\r
\r
\r
protected void applyButton_actionPerformed()\r
{\r
- if (featureSettings != null)\r
+ if (caller != null)\r
{\r
- featureSettings.setUserColour(feature, new Color(R,G,B));\r
+ if(caller instanceof FeatureSettings)\r
+ ((FeatureSettings)caller).setUserColour\r
+ (originalLabel, new Color(R,G,B));\r
+ else if(caller instanceof AnnotationColourChooser)\r
+ {\r
+ if (originalLabel.equals("Min Colour"))\r
+ ( (AnnotationColourChooser) caller).minColour_actionPerformed\r
+ (new Color(R, G, B));\r
+ else\r
+ ( (AnnotationColourChooser) caller).maxColour_actionPerformed\r
+ (new Color(R, G, B));\r
+ }\r
return;\r
}\r
\r
+\r
Color[] newColours = new Color[24];\r
for (int i = 0; i < 24; i++)\r
{\r
\r
protected void cancelButton_actionPerformed()\r
{\r
- if(featureSettings!=null)\r
+ if (caller != null)\r
{\r
- featureSettings.setUserColour(feature, originalFeatureCol);\r
+ if(caller instanceof FeatureSettings)\r
+ ((FeatureSettings)caller).setUserColour\r
+ (originalLabel, originalColour);\r
+ else if (caller instanceof AnnotationColourChooser)\r
+ {\r
+ if (originalLabel.equals("Min Colour"))\r
+ ( (AnnotationColourChooser) caller).minColour_actionPerformed\r
+ (originalColour);\r
+ else\r
+ ( (AnnotationColourChooser) caller).maxColour_actionPerformed\r
+ (originalColour);\r
+ }\r
frame.setVisible(false);\r
return;\r
}\r