From 7db575b815f21c6e023f6482fe258c39e84b436e Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Wed, 15 Feb 2006 15:17:29 +0000 Subject: [PATCH] Features file has startgroup, endgroup --- src/jalview/appletgui/AlignFrame.java | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/jalview/appletgui/AlignFrame.java b/src/jalview/appletgui/AlignFrame.java index 96dc64b..6d70bf7 100755 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@ -153,6 +153,7 @@ public class AlignFrame extends Frame implements ActionListener, SequenceFeature sf; FeatureRenderer fr = alignPanel.seqPanel.seqCanvas.getFeatureRenderer(); int lineNo = 0; + String featureGroup = null; while ( (line = in.readLine()) != null) { lineNo++; @@ -160,8 +161,22 @@ public class AlignFrame extends Frame implements ActionListener, if (st.countTokens() == 2) { type = st.nextToken(); - UserColourScheme ucs = new UserColourScheme(st.nextToken()); - fr.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()); + fr.setColour(type, ucs.findColour("A")); + } continue; } @@ -195,6 +210,7 @@ public class AlignFrame extends Frame implements ActionListener, } sf = new SequenceFeature(type, desc, "", start, end); + sf.setFeatureGroup(featureGroup); seq.addSequenceFeature(sf); } -- 1.7.10.2