Features file has startgroup, endgroup
authoramwaterhouse <Andrew Waterhouse>
Wed, 15 Feb 2006 15:17:29 +0000 (15:17 +0000)
committeramwaterhouse <Andrew Waterhouse>
Wed, 15 Feb 2006 15:17:29 +0000 (15:17 +0000)
src/jalview/appletgui/AlignFrame.java

index 96dc64b..6d70bf7 100755 (executable)
@@ -153,6 +153,7 @@ public class AlignFrame extends Frame implements ActionListener,
       SequenceFeature sf;\r
       FeatureRenderer fr = alignPanel.seqPanel.seqCanvas.getFeatureRenderer();\r
       int lineNo = 0;\r
+      String featureGroup = null;\r
       while ( (line = in.readLine()) != null)\r
       {\r
         lineNo++;\r
@@ -160,8 +161,22 @@ public class AlignFrame extends Frame implements ActionListener,
         if (st.countTokens() == 2)\r
         {\r
           type = st.nextToken();\r
-          UserColourScheme ucs = new UserColourScheme(st.nextToken());\r
-          fr.setColour(type, ucs.findColour("A"));\r
+          if(type.equalsIgnoreCase("startgroup"))\r
+          {\r
+            featureGroup = st.nextToken();\r
+          }\r
+          else if(type.equalsIgnoreCase("endgroup"))\r
+          {\r
+            //We should check whether this is the current group,\r
+            //but at present theres no way of showing more than 1 group\r
+            st.nextToken();\r
+            featureGroup = null;\r
+          }\r
+          else\r
+          {\r
+            UserColourScheme ucs = new UserColourScheme(st.nextToken());\r
+            fr.setColour(type, ucs.findColour("A"));\r
+          }\r
           continue;\r
         }\r
 \r
@@ -195,6 +210,7 @@ public class AlignFrame extends Frame implements ActionListener,
           }\r
 \r
           sf = new SequenceFeature(type, desc, "", start, end);\r
+          sf.setFeatureGroup(featureGroup);\r
 \r
           seq.addSequenceFeature(sf);\r
         }\r