Groups file is now feature file
authoramwaterhouse <Andrew Waterhouse>
Wed, 26 Oct 2005 16:23:18 +0000 (16:23 +0000)
committeramwaterhouse <Andrew Waterhouse>
Wed, 26 Oct 2005 16:23:18 +0000 (16:23 +0000)
src/jalview/gui/AlignFrame.java

index 7fbd14f..f2d0b69 100755 (executable)
@@ -175,7 +175,7 @@ public class AlignFrame
       BufferedReader in = new BufferedReader(new FileReader(file));\r
       SequenceI seq = null;\r
       String line, type, desc, token;\r
-      UserColourScheme ucs;\r
+\r
       int index, start, end;\r
       StringTokenizer st;\r
       SequenceFeature sf;\r
@@ -185,17 +185,16 @@ public class AlignFrame
       {\r
         lineNo++;\r
         st = new StringTokenizer(line, "\t");\r
-        if (st.countTokens() != 7)\r
+        if (st.countTokens() == 2)\r
         {\r
-          System.out.println("Groups file " + file +\r
-                             " is invalid. Read help file.\nLine: \n"\r
-              +lineNo +": "+line);\r
-          break;\r
+          type = st.nextToken();\r
+          UserColourScheme ucs = new UserColourScheme(st.nextToken());\r
+          fr.setColour(type, ucs.findColour("A"));\r
+          continue;\r
         }\r
 \r
         while (st.hasMoreElements())\r
         {\r
-          type = st.nextToken();\r
           desc = st.nextToken();\r
           token = st.nextToken();\r
           if (!token.equals("ID_NOT_SPECIFIED"))\r
@@ -211,14 +210,14 @@ public class AlignFrame
 \r
           start = Integer.parseInt(st.nextToken());\r
           end = Integer.parseInt(st.nextToken());\r
-          ucs = new UserColourScheme(st.nextToken());\r
 \r
           seq = viewport.alignment.getSequenceAt(index);\r
           start = seq.findIndex(start) - 1;\r
           end = seq.findIndex(end) - 1;\r
 \r
+          type = st.nextToken();\r
+\r
           sf = new SequenceFeature(type, desc, "", start, end);\r
-          fr.setColour(type, ucs.findColour("A"));\r
 \r
           seq.addSequenceFeature(sf);\r
 \r