\r
public void showSequence(int index)\r
{\r
- alignment.getHiddenSequences().showSequence(index);\r
+ Vector tmp = alignment.getHiddenSequences().showSequence(index);\r
+ if (tmp.size() > 0)\r
+ {\r
+ if (selectionGroup == null)\r
+ {\r
+ selectionGroup = new SequenceGroup();\r
+ selectionGroup.setEndRes(alignment.getWidth() - 1);\r
+ }\r
\r
- if(alignment.getHiddenSequences().getSize()<1)\r
+ for (int t = 0; t < tmp.size(); t++)\r
+ {\r
+ selectionGroup.addSequence(\r
+ (SequenceI) tmp.elementAt(t), false\r
+ );\r
+ }\r
+ }\r
+ if (alignment.getHiddenSequences().getSize() < 1)\r
hasHiddenRows = false;\r
}\r
\r
{\r
if(alignment.getHiddenSequences().getSize()>0)\r
{\r
- alignment.getHiddenSequences().showAll();\r
+ if(selectionGroup==null)\r
+ {\r
+ selectionGroup = new SequenceGroup();\r
+ selectionGroup.setEndRes(alignment.getWidth()-1);\r
+ }\r
+ Vector tmp = alignment.getHiddenSequences().showAll();\r
+ for(int t=0; t<tmp.size(); t++)\r
+ {\r
+ selectionGroup.addSequence(\r
+ (SequenceI)tmp.elementAt(t), false\r
+ );\r
+ }\r
hasHiddenRows = false;\r
- }\r
+ }\r
}\r
\r
public int adjustForHiddenSeqs(int alignmentIndex)\r
alignment.deleteSequence(sequence);\r
}\r
\r
- public void showAll()\r
+ public Vector showAll()\r
{\r
+ Vector revealedSeqs = new Vector();\r
for(int i=0; i<alignment.getHeight()+hiddenSequences.size(); i++)\r
- showSequence(i);\r
+ {\r
+ Vector tmp = showSequence(i);\r
+ for(int t=0; t<tmp.size(); t++)\r
+ revealedSeqs.addElement(tmp.elementAt(t));\r
+ }\r
+ return revealedSeqs;\r
}\r
\r
- public void showSequence(int alignmentIndex)\r
+ public Vector showSequence(int alignmentIndex)\r
{\r
+ Vector revealedSeqs = new Vector();\r
SequenceI repSequence = alignment.getSequenceAt(alignmentIndex);\r
if(repSequence!=null\r
&& repSequence.getHiddenSequences()==null\r
SequenceI seq = (SequenceI)hiddenSequences.remove(new Integer(\r
index));\r
\r
+\r
if(seq!=null)\r
{\r
+ revealedSeqs.addElement(seq);\r
alignment.getSequences().insertElementAt(seq, alignmentIndex);\r
if(repSequence!=null)\r
{\r
}\r
}\r
}\r
+\r
+ return revealedSeqs;\r
}\r
\r
public Hashtable getHiddenSequences()\r
\r
public void showSequence(int index)\r
{\r
- alignment.getHiddenSequences().showSequence(index);\r
+ Vector tmp = alignment.getHiddenSequences().showSequence(index);\r
+ if(tmp.size()>0)\r
+ {\r
+ if(selectionGroup==null)\r
+ {\r
+ selectionGroup = new SequenceGroup();\r
+ selectionGroup.setEndRes(alignment.getWidth()-1);\r
+ }\r
\r
+ for (int t = 0; t < tmp.size(); t++)\r
+ {\r
+ selectionGroup.addSequence(\r
+ (SequenceI) tmp.elementAt(t), false\r
+ );\r
+ }\r
+ }\r
if(alignment.getHiddenSequences().getSize()<1)\r
hasHiddenRows = false;\r
}\r
{\r
if(alignment.getHiddenSequences().getSize()>0)\r
{\r
- alignment.getHiddenSequences().showAll();\r
+ if(selectionGroup==null)\r
+ {\r
+ selectionGroup = new SequenceGroup();\r
+ selectionGroup.setEndRes(alignment.getWidth()-1);\r
+ }\r
+ Vector tmp = alignment.getHiddenSequences().showAll();\r
+ for(int t=0; t<tmp.size(); t++)\r
+ {\r
+ selectionGroup.addSequence(\r
+ (SequenceI)tmp.elementAt(t), false\r
+ );\r
+ }\r
hasHiddenRows = false;\r
}\r
}\r