Formatting changes
[jalview.git] / src / jalview / schemes / UserColourScheme.java
index bc5e8ea..7bd61c1 100755 (executable)
@@ -1,5 +1,6 @@
-/* Jalview - a java multiple alignment editor\r
- * Copyright (C) 1998  Michele Clamp\r
+/*\r
+ * Jalview - A Sequence Alignment Editor and Viewer\r
+ * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
  *\r
  * This program is free software; you can redistribute it and/or\r
  * modify it under the terms of the GNU General Public License\r
  *\r
  * You should have received a copy of the GNU General Public License\r
  * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.\r
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA\r
  */\r
-\r
 package jalview.schemes;\r
 \r
 import java.awt.*;\r
 \r
-public class UserColourScheme extends ResidueColourScheme\r
+public class UserColourScheme\r
+    extends ResidueColourScheme\r
 {\r
-  public void setColourScheme(Color [] newColors)\r
+  public UserColourScheme(String colour)\r
+  {\r
+    Color col = null;\r
+    try{\r
+      int value = Integer.parseInt(colour, 16);\r
+      col = new Color(value);\r
+    }\r
+    catch(NumberFormatException ex){}\r
+\r
+    if(col==null)\r
+      col = ColourSchemeProperty.getAWTColorFromName(colour);\r
+\r
+    if(col==null)\r
+    {\r
+      System.out.println("Unknown colour!! "+colour);\r
+    }\r
+\r
+    colors = new Color[24];\r
+    for(int i=0; i<24; i++)\r
+      colors[i] = col;\r
+  }\r
+\r
+  public UserColourScheme(Color[] newColors)\r
   {\r
     colors = newColors;\r
   }\r
+\r
+  public Color[] getColours()\r
+  {\r
+    return colors;\r
+  }\r
 }\r