else if(source == revealAll)\r
{\r
ap.av.showAllHiddenSeqs();\r
- ap.repaint();\r
}\r
\r
else if(source==copy)\r
}\r
\r
ap.av.setSelectionGroup(null);\r
- ap.repaint();\r
- refresh();\r
}\r
\r
}\r
case KeyEvent.VK_H:\r
{\r
SequenceGroup sg = viewport.getSelectionGroup();\r
+ boolean hide = false;\r
if (sg != null && sg.getSize(false) != viewport.alignment.getHeight())\r
{\r
- hideSelectedSeqs();\r
+ hide = true;\r
+ viewport.hideAllSelectedSeqs();\r
}\r
- else\r
+ else if (viewport.colSel.getSelected().size() < 1)\r
viewport.showAllHiddenSeqs();\r
\r
if (viewport.colSel.getSelected().size() > 0)\r
- {\r
viewport.hideSelectedColumns();\r
- }\r
- else\r
- {\r
- viewport.showAllHiddenColumns();\r
- }\r
+ else if (!hide)\r
+ viewport.showAllHiddenColumns();\r
+\r
alignPanel.repaint();\r
break;\r
}\r
}\r
else if(source==showSeqs)\r
{\r
- viewport.showAllHiddenSeqs(); alignPanel.repaint();\r
+ viewport.showAllHiddenSeqs();\r
}\r
else if(source == hideColumns)\r
{\r
}\r
else if(source == hideSequences && viewport.getSelectionGroup()!=null)\r
{\r
- hideSelectedSeqs();\r
+ viewport.hideAllSelectedSeqs();\r
}\r
else if(source==featureSettings)\r
featureSettings_actionPerformed();\r
alignPanel.repaint();\r
}\r
\r
- void hideSelectedSeqs()\r
- {\r
- SequenceI[] seqs = viewport.getSelectionGroup().getSequencesInOrder(\r
- viewport.alignment\r
- );\r
-\r
- for (int i = 0; i < seqs.length; i++)\r
- {\r
- viewport.hideSequence(seqs[i]);\r
- }\r
-\r
- alignPanel.repaint();\r
- }\r
\r
protected void scaleAbove_actionPerformed()\r
{\r
{\r
alignment.getHiddenSequences().hideSequence(seq);\r
hasHiddenRows = true;\r
+ firePropertyChange("alignment", null, alignment.getSequences());\r
}\r
}\r
\r
- public void showSequence(int index)\r
+ public void hideAllSelectedSeqs()\r
{\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
+ if (selectionGroup == null)\r
+ return;\r
\r
- for (int t = 0; t < tmp.size(); t++)\r
- {\r
- selectionGroup.addSequence(\r
- (SequenceI) tmp.elementAt(t), false\r
- );\r
- }\r
+ SequenceI[] seqs = selectionGroup.getSequencesInOrder(alignment);\r
+\r
+ for (int i = 0; i < seqs.length; i++)\r
+ {\r
+ alignment.getHiddenSequences().hideSequence(seqs[i]);\r
}\r
- if (alignment.getHiddenSequences().getSize() < 1)\r
- hasHiddenRows = false;\r
+ firePropertyChange("alignment", null, alignment.getSequences());\r
+ hasHiddenRows = true;\r
+ setSelectionGroup(null);\r
}\r
\r
public void showColumn(int col)\r
(SequenceI)tmp.elementAt(t), false\r
);\r
}\r
+ firePropertyChange("alignment", null, alignment.getSequences());\r
hasHiddenRows = false;\r
- }\r
+ }\r
}\r
\r
public int adjustForHiddenSeqs(int alignmentIndex)\r
viewport.updateConsensus();\r
viewport.updateConservation();\r
}\r
+\r
resetAllColourSchemes();\r
if(alignPanel.overviewPanel!=null)\r
alignPanel.overviewPanel.updateOverviewImage();\r
\r
viewport.alignment.adjustSequenceAnnotations();\r
\r
+ if(alignPanel.overviewPanel!=null)\r
+ alignPanel.overviewPanel.updateOverviewImage();\r
+\r
alignPanel.repaint();\r
}\r
\r
public void showAllSeqs_actionPerformed(ActionEvent e)\r
{\r
viewport.showAllHiddenSeqs();\r
- repaint();\r
}\r
\r
public void showAllColumns_actionPerformed(ActionEvent e)\r
{\r
viewport.showAllHiddenColumns();\r
+ repaint();\r
}\r
\r
public void hideSelSequences_actionPerformed(ActionEvent e)\r
{\r
- if(viewport.getSelectionGroup()==null)\r
- return;\r
-\r
- SequenceI [] seqs = viewport.getSelectionGroup().getSequencesInOrder(\r
- viewport.alignment\r
- );\r
-\r
- for(int i=0; i<seqs.length; i++)\r
- {\r
- viewport.hideSequence(seqs[i]);\r
- }\r
-\r
- viewport.setSelectionGroup(null);\r
-\r
- alignPanel.repaint();\r
+ viewport.hideAllSelectedSeqs();\r
}\r
\r
public void hideSelColumns_actionPerformed(ActionEvent e)\r
hasHiddenColumns = true;\r
}\r
\r
+ public void hideAllSelectedSeqs()\r
+ {\r
+ if (selectionGroup == null)\r
+ return;\r
+\r
+ SequenceI[] seqs = selectionGroup.getSequencesInOrder(alignment);\r
+\r
+ for (int i = 0; i < seqs.length; i++)\r
+ {\r
+ alignment.getHiddenSequences().hideSequence(seqs[i]);\r
+ }\r
+ firePropertyChange("alignment", null, alignment.getSequences());\r
+ hasHiddenRows = true;\r
+ setSelectionGroup(null);\r
+ }\r
+\r
public void hideSequence(SequenceI seq)\r
{\r
if(seq!=null)\r
{\r
alignment.getHiddenSequences().hideSequence(seq);\r
hasHiddenRows = true;\r
+ firePropertyChange("alignment", null, alignment.getSequences());\r
}\r
}\r
\r
(SequenceI) tmp.elementAt(t), false\r
);\r
}\r
+ firePropertyChange("alignment", null, alignment.getSequences());\r
}\r
+\r
if(alignment.getHiddenSequences().getSize()<1)\r
hasHiddenRows = false;\r
}\r
(SequenceI)tmp.elementAt(t), false\r
);\r
}\r
+ firePropertyChange("alignment", null, alignment.getSequences());\r
hasHiddenRows = false;\r
}\r
}\r
case KeyEvent.VK_H:\r
{\r
SequenceGroup sg = av.getSelectionGroup();\r
+ boolean hide = false;\r
if(sg!=null && sg.getSize(false)!=av.alignment.getHeight())\r
{\r
+ hide = true;\r
alignFrame.hideSelSequences_actionPerformed(null);\r
}\r
- else\r
+ else if(av.colSel.getSelected().size()<1)\r
alignFrame.showAllSeqs_actionPerformed(null);\r
\r
if(av.colSel.getSelected().size()>0)\r
alignFrame.hideSelColumns_actionPerformed(null);\r
- else\r
+ else if(!hide)\r
alignFrame.showAllColumns_actionPerformed(null);\r
\r
break;\r
public void actionPerformed(ActionEvent e)\r
{\r
ap.av.showSequence(index);\r
- ap.repaint();\r
if (ap.overviewPanel != null)\r
ap.overviewPanel.updateOverviewImage();\r
}\r
public void actionPerformed(ActionEvent e)\r
{\r
ap.av.showAllHiddenSeqs();\r
- ap.repaint();\r
if (ap.overviewPanel != null)\r
ap.overviewPanel.updateOverviewImage();\r
- }\r
+ }\r
});\r
\r
add(menuItem);\r
}\r
\r
ap.av.setSelectionGroup(null);\r
- ap.repaint();\r
- refresh();\r
}\r
\r
public void copy_actionPerformed(ActionEvent e)\r