+ int start = (Integer.parseInt(st3.nextToken()));\r
+ int end = (Integer.parseInt(st3.nextToken()));\r
+\r
+ if (end > start)\r
+ for (int i = start; i <= end; i++)\r
+ sg.addSequence(al.getSequenceAt(i-1), false);\r
+ }\r
+ else\r
+ {\r
+ sg.addSequence(al.getSequenceAt(Integer.parseInt(tmp)-1 ), false);\r
+ }\r
+ }\r
+ }\r
+\r
+ if(refSeq!=null)\r
+ {\r
+ sg.setStartRes( refSeq.findIndex( sg.getStartRes()+1 )-1 );\r
+ sg.setEndRes( refSeq.findIndex( sg.getEndRes() +1) -1 );\r
+ }\r
+\r
+\r
+ al.addGroup(sg);\r
+ annotationsHash.put(sg.getName(), sg);\r
+ }\r
+\r
+ void addProperties(AlignmentI al, StringTokenizer st)\r
+ {\r
+\r
+ //So far we have only added groups to the annotationHash,\r
+ //the idea is in the future properties can be added to\r
+ //alignments, other annotations etc\r
+ SequenceGroup sg = (SequenceGroup)annotationsHash.get(st.nextToken());\r
+\r
+ if(sg!=null)\r
+ {\r
+ String keyValue, key, value;\r
+ while(st.hasMoreTokens())\r
+ {\r
+ keyValue = st.nextToken();\r
+ key = keyValue.substring(0,keyValue.indexOf("="));\r
+ value=keyValue.substring(keyValue.indexOf("=")+1);\r
+\r
+ if(key.equalsIgnoreCase("description"))\r
+ sg.setDescription(value);\r
+ else if(key.equalsIgnoreCase("colour"))\r
+ sg.cs = ColourSchemeProperty.getColour(al, value);\r
+ else if (key.equalsIgnoreCase("pidThreshold"))\r
+ sg.cs.setThreshold(Integer.parseInt(value), false);//\r
+ else if (key.equalsIgnoreCase("outlineColour"))\r
+ {\r
+ sg.setOutlineColour(new UserColourScheme(value).findColour('A'));\r
+ }\r
+\r
+ //Boolean.valueOf(string).booleanValue();\r
+ else if (key.equalsIgnoreCase("displayBoxes"))\r
+ sg.setDisplayBoxes( Boolean.valueOf(value).booleanValue() );\r
+ else if (key.equalsIgnoreCase("displayText"))\r
+ sg.setDisplayText( Boolean.valueOf(value).booleanValue() );\r
+ else if (key.equalsIgnoreCase("colourText"))\r
+ sg.setColourText( Boolean.valueOf(value).booleanValue() );\r
+ else if (key.equalsIgnoreCase("textCol1"))\r
+ {\r
+ sg.textColour = new UserColourScheme(value).findColour('A');\r
+ }\r
+ else if (key.equalsIgnoreCase("textCol2"))\r
+ {\r
+ sg.textColour2 = new UserColourScheme(value).findColour('A');\r
+ }\r
+ else if (key.equalsIgnoreCase("textColThreshold"))\r
+ sg.thresholdTextColour = Integer.parseInt(value);\r
+\r
+ }\r
+ }\r