From ba86f4f86b87511a9852e60088dd5327adf547eb Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Wed, 26 Oct 2005 16:23:18 +0000 Subject: [PATCH] Groups file is now feature file --- src/jalview/gui/AlignFrame.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 7fbd14f..f2d0b69 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -175,7 +175,7 @@ public class AlignFrame BufferedReader in = new BufferedReader(new FileReader(file)); SequenceI seq = null; String line, type, desc, token; - UserColourScheme ucs; + int index, start, end; StringTokenizer st; SequenceFeature sf; @@ -185,17 +185,16 @@ public class AlignFrame { lineNo++; st = new StringTokenizer(line, "\t"); - if (st.countTokens() != 7) + if (st.countTokens() == 2) { - System.out.println("Groups file " + file + - " is invalid. Read help file.\nLine: \n" - +lineNo +": "+line); - break; + type = st.nextToken(); + UserColourScheme ucs = new UserColourScheme(st.nextToken()); + fr.setColour(type, ucs.findColour("A")); + continue; } while (st.hasMoreElements()) { - type = st.nextToken(); desc = st.nextToken(); token = st.nextToken(); if (!token.equals("ID_NOT_SPECIFIED")) @@ -211,14 +210,14 @@ public class AlignFrame start = Integer.parseInt(st.nextToken()); end = Integer.parseInt(st.nextToken()); - ucs = new UserColourScheme(st.nextToken()); seq = viewport.alignment.getSequenceAt(index); start = seq.findIndex(start) - 1; end = seq.findIndex(end) - 1; + type = st.nextToken(); + sf = new SequenceFeature(type, desc, "", start, end); - fr.setColour(type, ucs.findColour("A")); seq.addSequenceFeature(sf); -- 1.7.10.2