\r
protected Vector sequences;\r
protected Vector groups = new Vector();\r
- protected char gapCharacter = '-';\r
+ protected ArrayList superGroup = new ArrayList();\r
+ protected char gapCharacter = '-';\r
\r
/** Make an alignment from an array of Sequences.\r
*\r
for (int i = 0; i < this.groups.size();i++)\r
{\r
SequenceGroup sg = (SequenceGroup)groups.elementAt(i);\r
+\r
if (sg.sequences.contains(s))\r
temp.add(sg);\r
}\r
}\r
}\r
\r
+ public void addSuperGroup(SuperGroup sg)\r
+ {\r
+ superGroup.add(sg);\r
+ }\r
+\r
+ public void removeSuperGroup(SuperGroup sg)\r
+ {\r
+ superGroup.remove(sg);\r
+ }\r
+\r
+ public SuperGroup getSuperGroup(SequenceGroup sg)\r
+ {\r
+ for (int i = 0; i < this.superGroup.size(); i++)\r
+ {\r
+ SuperGroup temp = (SuperGroup) superGroup.get(i);\r
+ if (temp.sequenceGroups.contains(sg))\r
+ return temp;\r
+ }\r
+ return null;\r
+ }\r
+\r
/** */\r
public void addGroup(SequenceGroup sg) {\r
if(!groups.contains(sg))\r
groups.addElement(sg);\r
}\r
\r
- /** */\r
- public SequenceGroup addGroup() {\r
- SequenceGroup sg = new SequenceGroup();\r
- groups.addElement(sg);\r
- return sg;\r
+ public void deleteAllGroups()\r
+ {\r
+ groups.clear();\r
+ superGroup.clear();\r
}\r
\r
/** */\r
public void insertColumns(SequenceI[] seqs, int pos) ;\r
\r
public SequenceI findName(String name) ;\r
- public SequenceI findbyDisplayId(String name);\r
+ public SequenceI findbyDisplayId(String name);\r
\r
public int findIndex(SequenceI s) ;\r
\r
public void addToGroup(SequenceGroup g, SequenceI s) ;\r
public void removeFromGroup(SequenceGroup g,SequenceI s) ;\r
public void addGroup(SequenceGroup sg) ;\r
- public SequenceGroup addGroup() ;\r
public void deleteGroup(SequenceGroup g) ;\r
public Vector getGroups();\r
+ public void deleteAllGroups();\r
+\r
+ public void addSuperGroup(SuperGroup sg);\r
+ public void removeSuperGroup(SuperGroup sg);\r
+ public SuperGroup getSuperGroup(SequenceGroup sg);\r
\r
// Sorting\r
public void sortGroups() ;\r
public class SequenceGroup\r
{\r
String groupName;\r
- boolean isSelected;\r
+ Conservation conserve;\r
+ Vector aaFrequency;\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 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 = null;\r
}\r
\r
public SequenceGroup(String groupName, ColourSchemeI scheme,\r
- boolean isSelected,\r
boolean displayBoxes, boolean displayText,\r
boolean colourText,\r
- boolean display,\r
int start,\r
int end)\r
{\r
\r
this.groupName = groupName;\r
- this.isSelected = isSelected;\r
this.displayBoxes = displayBoxes;\r
this.displayText = displayText;\r
this.colourText = colourText;\r
- this.display = display;\r
this.cs = scheme;\r
startRes = start;\r
endRes = end;\r
sequences.removeElement(s);\r
}\r
\r
- public void setColourText(boolean state)\r
+\r
+ public int getStartRes()\r
{\r
- colourText = state;\r
+ return startRes;\r
}\r
\r
- public boolean getColourText()\r
+ public int getEndRes()\r
{\r
- return colourText;\r
+ return endRes;\r
}\r
\r
- public void setDisplayText(boolean state)\r
+ public void setStartRes(int i)\r
{\r
- displayText = state;\r
+ startRes = i;\r
}\r
\r
- public boolean getDisplayText()\r
+ public void setEndRes(int i)\r
{\r
- return displayText;\r
+ endRes = i;\r
}\r
\r
- public void setDisplayBoxes(boolean state)\r
+ public int getSize()\r
{\r
- displayBoxes = state;\r
+ return sequences.size();\r
}\r
\r
- public boolean getDisplayBoxes()\r
+ public SequenceI getSequenceAt(int i)\r
{\r
- return displayBoxes;\r
+ return (SequenceI) sequences.elementAt(i);\r
}\r
\r
- public int getStartRes()\r
+ public void setColourText(boolean state)\r
{\r
- return startRes;\r
+ colourText = state;\r
}\r
\r
- public int getEndRes()\r
+ public boolean getColourText()\r
{\r
- return endRes;\r
+ return colourText;\r
}\r
\r
- public void setStartRes(int i)\r
+ public void setDisplayText(boolean state)\r
{\r
- startRes = i;\r
+ displayText = state;\r
}\r
\r
- public void setEndRes(int i)\r
+ public boolean getDisplayText()\r
{\r
- endRes = i;\r
+ return displayText;\r
}\r
\r
- public int getSize()\r
+ public void setDisplayBoxes(boolean state)\r
{\r
- return sequences.size();\r
+ displayBoxes = state;\r
}\r
\r
- public SequenceI getSequenceAt(int i)\r
+ public boolean getDisplayBoxes()\r
{\r
- return (SequenceI) sequences.elementAt(i);\r
+ return displayBoxes;\r
}\r
\r
public Vector getAAFrequency()\r
--- /dev/null
+package jalview.datamodel;\r
+\r
+import jalview.schemes.*;\r
+import jalview.analysis.*;\r
+import jalview.datamodel.*;\r
+import java.util.*;\r
+\r
+public class SuperGroup\r
+{\r
+ String groupName;\r
+ boolean displayBoxes;\r
+ boolean displayText;\r
+ boolean colourText;\r
+ public ColourSchemeI cs;\r
+ ArrayList sequenceGroups = new ArrayList();\r
+\r
+ public SuperGroup()\r
+ {\r
+ groupName = "Super group";\r
+ this.displayBoxes = true;\r
+ this.displayText = true;\r
+ this.colourText = false;\r
+ cs = null;\r
+ }\r
+\r
+\r
+ public SuperGroup(String groupName, ColourSchemeI scheme,\r
+ boolean displayBoxes, boolean displayText,\r
+ boolean colourText)\r
+ {\r
+ this.groupName = groupName;\r
+ this.displayBoxes = displayBoxes;\r
+ this.displayText = displayText;\r
+ this.colourText = colourText;\r
+ this.cs = scheme;\r
+ }\r
+\r
+ public String getName()\r
+ {\r
+ return groupName;\r
+ }\r
+\r
+ public void setName(String name)\r
+ {\r
+ groupName = name;\r
+ }\r
+\r
+\r
+ public void addGroup(SequenceGroup sg)\r
+ {\r
+ if(!sequenceGroups.contains(sg))\r
+ sequenceGroups.add(sg);\r
+ }\r
+\r
+ public void addOrRemove(SequenceGroup sg)\r
+ {\r
+ if(sequenceGroups.contains(sg))\r
+ deleteGroup(sg);\r
+ else\r
+ addGroup(sg);\r
+ }\r
+\r
+ public void deleteGroup(SequenceGroup sg)\r
+ {\r
+ sequenceGroups.remove(sg);\r
+ }\r
+\r
+ public void setSuperGroupProperties(SequenceGroup sg)\r
+ {\r
+ cs = sg.cs;\r
+ colourText = sg.colourText;\r
+ displayText = sg.displayText;\r
+ displayBoxes = sg.displayBoxes;\r
+\r
+ for(int i=0; i<sequenceGroups.size(); i++)\r
+ {\r
+ SequenceGroup temp = (SequenceGroup)sequenceGroups.get(i);\r
+ temp.cs = sg.cs;\r
+ temp.colourText = sg.colourText;\r
+ temp.displayText = sg.displayText;\r
+ temp.displayBoxes = sg.displayBoxes;\r
+ }\r
+ }\r
+\r
+\r
+ public int getSize()\r
+ {\r
+ return sequenceGroups.size();\r
+ }\r
+\r
+ public SequenceGroup getGroupeAt(int i)\r
+ {\r
+ return (SequenceGroup) sequenceGroups.get(i);\r
+ }\r
+}\r
frame.setResizable(false);\r
}\r
\r
+ protected void deleteGroups_actionPerformed(ActionEvent e)\r
+ {\r
+ viewport.alignment.deleteAllGroups();\r
+ alignPanel.RefreshPanels();\r
+ }\r
+\r
+\r
\r
public void selectAllSequenceMenuItem_actionPerformed(ActionEvent e)\r
{\r
JOptionPane op = new JOptionPane();\r
JInternalFrame frame = op.createInternalFrame(this, "Find");\r
Finder finder = new Finder(viewport, alignPanel, frame);\r
+ frame.setClosable(true);\r
frame.setContentPane(finder);\r
- frame.setSize(300,110);\r
+ frame.setSize(340,110);\r
frame.setVisible(true);\r
}\r
\r
changeColour();\r
}\r
\r
+ public void nucleotideColour_actionPerformed(ActionEvent e)\r
+ {\r
+ viewport.setGlobalColourScheme( new NucleotideColourScheme() );\r
+ changeColour();\r
+ }\r
+\r
+\r
void changeColour()\r
{\r
if(abovePIDThreshold.isSelected())\r