annotation file format updated to take idColour and specify single colour groups...
[jalview.git] / src / jalview / io / AnnotationFile.java
index 6285cf1..d5039de 100755 (executable)
@@ -312,6 +312,10 @@ public class AnnotationFile
       {\r
         text.append("textColThreshold=" + sg.thresholdTextColour);\r
       }\r
+      if (sg.idColour!=null)\r
+      {\r
+        text.append("idColour="+jalview.util.Format.getHexString(sg.idColour)+"\t");\r
+      }\r
 \r
       text.append("\n\n");\r
 \r
@@ -816,6 +820,8 @@ public class AnnotationFile
     if (sg != null)\r
     {\r
       String keyValue, key, value;\r
+      ColourSchemeI def = sg.cs;\r
+      sg.cs = null;\r
       while (st.hasMoreTokens())\r
       {\r
         keyValue = st.nextToken();\r
@@ -878,9 +884,16 @@ public class AnnotationFile
         {\r
           sg.thresholdTextColour = Integer.parseInt(value);\r
         }\r
-\r
+        else if (key.equalsIgnoreCase("idColour"))\r
+        {\r
+          sg.setIdColour((def = new UserColourScheme(value)).findColour('A'));\r
+        }\r
         sg.recalcConservation();\r
       }\r
+      if (sg.cs==null)\r
+      {\r
+        sg.cs = def;\r
+      }\r
     }\r
   }\r
 \r