From: amwaterhouse Date: Thu, 16 Feb 2006 15:51:07 +0000 (+0000) Subject: Read startgroup and endgroup in features file X-Git-Tag: Root_VamJalview_2_07b+~115 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=9a4258bfc6277f67d677ce0e62f6ffd6bcc3d436;p=jalview.git Read startgroup and endgroup in features file --- diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 9bcb759..a70adfc 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -205,8 +205,6 @@ public class AlignFrame { new SequenceFetcher(this); } - - /** * DOCUMENT ME! * @@ -1329,24 +1327,32 @@ public class AlignFrame alignPanel.repaint(); } - /** - * DOCUMENT ME! - * - * @param evt DOCUMENT ME! - */ - public void sequenceFeatures_actionPerformed(ActionEvent evt) + public void fetchSeqFeatures_actionPerformed(ActionEvent e) { - viewport.showSequenceFeatures(sequenceFeatures.isSelected()); - - if (viewport.showSequenceFeatures && !viewport.alignment.isNucleotide()) + if (!viewport.alignment.isNucleotide()) { new SequenceFeatureFetcher(viewport. - alignment, - alignPanel); + alignment, + alignPanel); + viewport.showSequenceFeatures(true); + showSeqFeatures.setSelected(true); } + } - featureSettings.setEnabled(true); + public void featureSettings_actionPerformed(ActionEvent e) + { + new FeatureSettings(viewport, alignPanel); + } + + /** + * DOCUMENT ME! + * + * @param evt DOCUMENT ME! + */ + public void showSeqFeatures_actionPerformed(ActionEvent evt) + { + viewport.showSequenceFeatures(showSeqFeatures.isSelected()); alignPanel.repaint(); } @@ -2425,10 +2431,7 @@ public class AlignFrame } }*/ - public void featureSettings_actionPerformed(ActionEvent e) - { - new FeatureSettings(viewport, alignPanel); - } + @@ -2556,6 +2559,7 @@ public boolean parseGroupsFile(String file) StringTokenizer st; SequenceFeature sf; int lineNo = 0; + String featureGroup = null; while ( (line = in.readLine()) != null) { lineNo++; @@ -2563,8 +2567,23 @@ public boolean parseGroupsFile(String file) if (st.countTokens() == 2) { type = st.nextToken(); - UserColourScheme ucs = new UserColourScheme(st.nextToken()); - alignPanel.seqPanel.seqCanvas.getFeatureRenderer().setColour(type, ucs.findColour("A")); + if (type.equalsIgnoreCase("startgroup")) + { + featureGroup = st.nextToken(); + } + else if (type.equalsIgnoreCase("endgroup")) + { + //We should check whether this is the current group, + //but at present theres no way of showing more than 1 group + st.nextToken(); + featureGroup = null; + } + else + { + UserColourScheme ucs = new UserColourScheme(st.nextToken()); + alignPanel.seqPanel.seqCanvas.getFeatureRenderer().setColour(type, + ucs.findColour("A")); + } continue; } @@ -2597,6 +2616,7 @@ public boolean parseGroupsFile(String file) } sf = new SequenceFeature(type, desc, "", start, end); + sf.setFeatureGroup(featureGroup); seq.getDatasetSequence().addSequenceFeature(sf); }