import jalview.datamodel.*;\r
import java.util.Vector;\r
\r
-public class SequenceGroup{\r
- String groupName;\r
- boolean isSelected;\r
- boolean displayBoxes;\r
- boolean displayText;\r
- boolean colourText;\r
- boolean display;\r
- Conservation conserve;\r
- Vector aaFrequency;\r
- boolean aaFrequencyValid = false;\r
- public Vector sequences = new Vector();\r
- int width = -1;\r
- public ColourSchemeI cs;\r
-\r
-\r
- public SequenceGroup() {\r
+public class SequenceGroup\r
+{\r
+ String groupName;\r
+ boolean isSelected;\r
+ boolean displayBoxes;\r
+ boolean displayText;\r
+ boolean colourText;\r
+ boolean display;\r
+ Conservation conserve;\r
+ Vector aaFrequency;\r
+ boolean aaFrequencyValid = false;\r
+ public Vector sequences = new Vector();\r
+ int width = -1;\r
+ public ColourSchemeI cs;\r
+ int startRes = 20;\r
+ int endRes = 35;\r
+\r
+ public SequenceGroup()\r
+ {\r
groupName = "Group";\r
this.isSelected = false;\r
this.displayBoxes = true;\r
this.displayText = true;\r
this.colourText = false;\r
this.display = true;\r
- cs = new ZappoColourScheme();\r
+ cs = null;\r
}\r
\r
- public SequenceGroup( String groupName, ColourSchemeI scheme, boolean isSelected,\r
- boolean displayBoxes, boolean displayText,\r
- boolean colourText,\r
- boolean display) {\r
+ public SequenceGroup(String groupName, ColourSchemeI scheme,\r
+ boolean isSelected,\r
+ boolean displayBoxes, boolean displayText,\r
+ boolean colourText,\r
+ boolean display)\r
+ {\r
\r
this.groupName = groupName;\r
this.isSelected = isSelected;\r
{\r
groupName = name;\r
}\r
- public Conservation getConservation() {\r
- return conserve;\r
+\r
+ public Conservation getConservation()\r
+ {\r
+ return conserve;\r
}\r
+\r
public void setConservation(Conservation c)\r
- { conserve = c; }\r
+ {\r
+ conserve = c;\r
+ }\r
\r
- public void addSequence(SequenceI s) {\r
+ public void addSequence(SequenceI s)\r
+ {\r
sequences.addElement(s);\r
}\r
\r
- public void deleteSequence(SequenceI s) {\r
+ public void deleteSequence(SequenceI s)\r
+ {\r
sequences.removeElement(s);\r
}\r
\r
- public void setColourText(boolean state) {\r
+ public void setColourText(boolean state)\r
+ {\r
colourText = state;\r
}\r
- public boolean getColourText() {\r
+\r
+ public boolean getColourText()\r
+ {\r
return colourText;\r
}\r
\r
- public void setDisplayText(boolean state) {\r
+ public void setDisplayText(boolean state)\r
+ {\r
displayText = state;\r
}\r
\r
- public boolean getDisplayText() {\r
+ public boolean getDisplayText()\r
+ {\r
return displayText;\r
}\r
\r
- public void setDisplayBoxes(boolean state) {\r
+ public void setDisplayBoxes(boolean state)\r
+ {\r
displayBoxes = state;\r
}\r
\r
- public boolean getDisplayBoxes() {\r
+ public boolean getDisplayBoxes()\r
+ {\r
return displayBoxes;\r
}\r
\r
- public int getSize() {\r
- return sequences.size();\r
- }\r
- public SequenceI getSequenceAt(int i) {\r
- return (SequenceI)sequences.elementAt(i);\r
- }\r
+ public int getStartRes()\r
+ {\r
+ return startRes;\r
+ }\r
+\r
+ public int getEndRes()\r
+ {\r
+ return endRes;\r
+ }\r
+\r
+ public void setStartRes(int i)\r
+ {\r
+ startRes = i;\r
+ }\r
+\r
+ public void setEndRes(int i)\r
+ {\r
+ endRes = i;\r
+ }\r
+\r
+ public int getSize()\r
+ {\r
+ return sequences.size();\r
+ }\r
\r
- public Vector getAAFrequency() {\r
- if (aaFrequency == null || aaFrequencyValid == false) {\r
- aaFrequency = AAFrequency.calculate(sequences,0,getWidth());\r
- aaFrequencyValid = true;\r
- }\r
- return aaFrequency;\r
+ public SequenceI getSequenceAt(int i)\r
+ {\r
+ return (SequenceI) sequences.elementAt(i);\r
+ }\r
+\r
+ public Vector getAAFrequency()\r
+ {\r
+ if (aaFrequency == null || aaFrequencyValid == false)\r
+ {\r
+ aaFrequency = AAFrequency.calculate(sequences, 0, getWidth());\r
+ aaFrequencyValid = true;\r
}\r
+ return aaFrequency;\r
+ }\r
\r
- public int getWidth()\r
+ public int getWidth()\r
+ {\r
+ System.out.println("it is called");\r
+ // MC This needs to get reset when characters are inserted and deleted\r
+ for (int i = 0; i < sequences.size(); i++)\r
{\r
- // MC This needs to get reset when characters are inserted and deleted\r
- for (int i = 0; i < sequences.size(); i++)\r
- {\r
- SequenceI seq = (SequenceI) sequences.elementAt(i);\r
- if (seq.getLength() > width)\r
- width = seq.getLength();\r
- }\r
- return width;\r
+ SequenceI seq = (SequenceI) sequences.elementAt(i);\r
+ if (seq.getLength() > width)\r
+ width = seq.getLength();\r
}\r
+ return width;\r
+ }\r
}\r
-\r
-\r