Read startgroup and endgroup in features file
authoramwaterhouse <Andrew Waterhouse>
Thu, 16 Feb 2006 15:51:07 +0000 (15:51 +0000)
committeramwaterhouse <Andrew Waterhouse>
Thu, 16 Feb 2006 15:51:07 +0000 (15:51 +0000)
src/jalview/gui/AlignFrame.java

index 9bcb759..a70adfc 100755 (executable)
@@ -205,8 +205,6 @@ public class AlignFrame
   {\r
     new SequenceFetcher(this);\r
   }\r
-\r
-\r
   /**\r
    * DOCUMENT ME!\r
    *\r
@@ -1329,24 +1327,32 @@ public class AlignFrame
     alignPanel.repaint();\r
   }\r
 \r
-  /**\r
-   * DOCUMENT ME!\r
-   *\r
-   * @param evt DOCUMENT ME!\r
-   */\r
-  public void sequenceFeatures_actionPerformed(ActionEvent evt)\r
+  public void fetchSeqFeatures_actionPerformed(ActionEvent e)\r
   {\r
-    viewport.showSequenceFeatures(sequenceFeatures.isSelected());\r
-\r
-    if (viewport.showSequenceFeatures && !viewport.alignment.isNucleotide())\r
+    if (!viewport.alignment.isNucleotide())\r
     {\r
       new SequenceFeatureFetcher(viewport.\r
-         alignment,\r
-          alignPanel);\r
+                                 alignment,\r
+                                 alignPanel);\r
+      viewport.showSequenceFeatures(true);\r
+      showSeqFeatures.setSelected(true);\r
     }\r
+  }\r
 \r
-    featureSettings.setEnabled(true);\r
 \r
+  public void featureSettings_actionPerformed(ActionEvent e)\r
+  {\r
+    new FeatureSettings(viewport, alignPanel);\r
+  }\r
+\r
+  /**\r
+   * DOCUMENT ME!\r
+   *\r
+   * @param evt DOCUMENT ME!\r
+   */\r
+  public void showSeqFeatures_actionPerformed(ActionEvent evt)\r
+  {\r
+    viewport.showSequenceFeatures(showSeqFeatures.isSelected());\r
     alignPanel.repaint();\r
   }\r
 \r
@@ -2425,10 +2431,7 @@ public class AlignFrame
     }\r
   }*/\r
 \r
-  public void featureSettings_actionPerformed(ActionEvent e)\r
-  {\r
-    new FeatureSettings(viewport, alignPanel);\r
-  }\r
+\r
 \r
 \r
 \r
@@ -2556,6 +2559,7 @@ public boolean parseGroupsFile(String file)
       StringTokenizer st;\r
       SequenceFeature sf;\r
       int lineNo = 0;\r
+      String featureGroup = null;\r
       while ( (line = in.readLine()) != null)\r
       {\r
         lineNo++;\r
@@ -2563,8 +2567,23 @@ public boolean parseGroupsFile(String file)
         if (st.countTokens() == 2)\r
         {\r
           type = st.nextToken();\r
-          UserColourScheme ucs = new UserColourScheme(st.nextToken());\r
-          alignPanel.seqPanel.seqCanvas.getFeatureRenderer().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
+            alignPanel.seqPanel.seqCanvas.getFeatureRenderer().setColour(type,\r
+                ucs.findColour("A"));\r
+          }\r
           continue;\r
         }\r
 \r
@@ -2597,6 +2616,7 @@ public boolean parseGroupsFile(String file)
           }\r
 \r
           sf = new SequenceFeature(type, desc, "", start, end);\r
+          sf.setFeatureGroup(featureGroup);\r
 \r
           seq.getDatasetSequence().addSequenceFeature(sf);\r
         }\r