}\r
public void actionPerformed(ActionEvent evt)\r
{\r
- if(evt.getSource()==inputText)\r
+ Object source = evt.getSource();\r
+\r
+ if(source==inputText)\r
inputText_actionPerformed();\r
- else if(evt.getSource()==loadTree)\r
+ else if(source==loadTree)\r
loadTree_actionPerformed();\r
- else if(evt.getSource()==loadApplication)\r
+ else if(source==loadApplication)\r
launchFullApplication();\r
- else if(evt.getSource()==closeMenuItem)\r
+ else if(source==closeMenuItem)\r
closeMenuItem_actionPerformed();\r
- else if(evt.getSource()==copy)\r
+ else if(source==copy)\r
copy_actionPerformed();\r
- else if(evt.getSource()==undoMenuItem)\r
+ else if(source==undoMenuItem)\r
undoMenuItem_actionPerformed();\r
- else if(evt.getSource()==redoMenuItem)\r
+ else if(source==redoMenuItem)\r
redoMenuItem_actionPerformed();\r
- else if(evt.getSource()==inputText)\r
+ else if(source==inputText)\r
inputText_actionPerformed();\r
- else if(evt.getSource()==closeMenuItem)\r
+ else if(source==closeMenuItem)\r
closeMenuItem_actionPerformed();\r
- else if(evt.getSource()==undoMenuItem)\r
+ else if(source==undoMenuItem)\r
undoMenuItem_actionPerformed();\r
- else if(evt.getSource()==redoMenuItem)\r
+ else if(source==redoMenuItem)\r
redoMenuItem_actionPerformed();\r
- else if(evt.getSource()==copy)\r
+ else if(source==copy)\r
copy_actionPerformed();\r
- else if(evt.getSource()==pasteNew)\r
+ else if(source==pasteNew)\r
pasteNew_actionPerformed();\r
- else if(evt.getSource()==pasteThis)\r
+ else if(source==pasteThis)\r
pasteThis_actionPerformed();\r
- else if(evt.getSource()==cut)\r
+ else if(source==cut)\r
cut_actionPerformed();\r
- else if(evt.getSource()==delete)\r
+ else if(source==delete)\r
delete_actionPerformed();\r
- else if(evt.getSource()==deleteGroups)\r
+ else if(source==deleteGroups)\r
deleteGroups_actionPerformed();\r
- else if(evt.getSource()==selectAllSequenceMenuItem)\r
+ else if(source==selectAllSequenceMenuItem)\r
selectAllSequenceMenuItem_actionPerformed();\r
- else if(evt.getSource()==deselectAllSequenceMenuItem)\r
+ else if(source==deselectAllSequenceMenuItem)\r
deselectAllSequenceMenuItem_actionPerformed();\r
- else if(evt.getSource()==invertSequenceMenuItem)\r
+ else if(source==invertSequenceMenuItem)\r
invertSequenceMenuItem_actionPerformed();\r
- else if(evt.getSource()==remove2LeftMenuItem)\r
+ else if(source==invertColSel)\r
+ { viewport.invertColumnSelection(); repaint(); }\r
+ else if(source==remove2LeftMenuItem)\r
remove2LeftMenuItem_actionPerformed();\r
- else if(evt.getSource()==remove2RightMenuItem)\r
+ else if(source==remove2RightMenuItem)\r
remove2RightMenuItem_actionPerformed();\r
- else if(evt.getSource()==removeGappedColumnMenuItem)\r
+ else if(source==removeGappedColumnMenuItem)\r
removeGappedColumnMenuItem_actionPerformed();\r
- else if(evt.getSource()==removeAllGapsMenuItem)\r
+ else if(source==removeAllGapsMenuItem)\r
removeAllGapsMenuItem_actionPerformed();\r
- else if(evt.getSource()==findMenuItem)\r
+ else if(source==findMenuItem)\r
findMenuItem_actionPerformed();\r
- else if(evt.getSource()==font)\r
+ else if(source==font)\r
font_actionPerformed();\r
- else if(evt.getSource()==featureSettings)\r
+ else if(source==showColumns)\r
+ {\r
+ viewport.showAllHiddenColumns(); repaint();\r
+ }\r
+ else if(source==showSeqs)\r
+ {\r
+ viewport.showAllHiddenSeqs(); repaint();\r
+ }\r
+ else if(source == hideColumns)\r
+ {\r
+ viewport.hideSelectedColumns(); repaint();\r
+ }\r
+ else if(source == hideSequences && viewport.getSelectionGroup()!=null)\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
+ else if(source==featureSettings)\r
featureSettings_actionPerformed();\r
- else if(evt.getSource()==overviewMenuItem)\r
+ else if(source==overviewMenuItem)\r
overviewMenuItem_actionPerformed();\r
- else if(evt.getSource()==noColourmenuItem)\r
+ else if(source==noColourmenuItem)\r
noColourmenuItem_actionPerformed();\r
- else if(evt.getSource()==clustalColour)\r
+ else if(source==clustalColour)\r
clustalColour_actionPerformed();\r
- else if(evt.getSource()==zappoColour)\r
+ else if(source==zappoColour)\r
zappoColour_actionPerformed();\r
- else if(evt.getSource()==taylorColour)\r
+ else if(source==taylorColour)\r
taylorColour_actionPerformed();\r
- else if(evt.getSource()==hydrophobicityColour)\r
+ else if(source==hydrophobicityColour)\r
hydrophobicityColour_actionPerformed();\r
- else if(evt.getSource()==helixColour)\r
+ else if(source==helixColour)\r
helixColour_actionPerformed();\r
- else if(evt.getSource()==strandColour)\r
+ else if(source==strandColour)\r
strandColour_actionPerformed();\r
- else if(evt.getSource()==turnColour)\r
+ else if(source==turnColour)\r
turnColour_actionPerformed();\r
- else if(evt.getSource()==buriedColour)\r
+ else if(source==buriedColour)\r
buriedColour_actionPerformed();\r
- else if(evt.getSource()==nucleotideColour)\r
+ else if(source==nucleotideColour)\r
nucleotideColour_actionPerformed();\r
- else if(evt.getSource()==modifyPID)\r
+ else if(source==modifyPID)\r
modifyPID_actionPerformed();\r
- else if(evt.getSource()==modifyConservation)\r
+ else if(source==modifyConservation)\r
modifyConservation_actionPerformed();\r
- else if(evt.getSource()==userDefinedColour)\r
+ else if(source==userDefinedColour)\r
userDefinedColour_actionPerformed();\r
- else if(evt.getSource()==PIDColour)\r
+ else if(source==PIDColour)\r
PIDColour_actionPerformed();\r
- else if(evt.getSource()==BLOSUM62Colour)\r
+ else if(source==BLOSUM62Colour)\r
BLOSUM62Colour_actionPerformed();\r
- else if(evt.getSource()==annotationColour)\r
+ else if(source==annotationColour)\r
new AnnotationColourChooser(viewport, alignPanel);\r
- else if(evt.getSource()==sortPairwiseMenuItem)\r
+ else if(source==sortPairwiseMenuItem)\r
sortPairwiseMenuItem_actionPerformed();\r
- else if(evt.getSource()==sortIDMenuItem)\r
+ else if(source==sortIDMenuItem)\r
sortIDMenuItem_actionPerformed();\r
- else if(evt.getSource()==sortGroupMenuItem)\r
+ else if(source==sortGroupMenuItem)\r
sortGroupMenuItem_actionPerformed();\r
- else if(evt.getSource()==removeRedundancyMenuItem)\r
+ else if(source==removeRedundancyMenuItem)\r
removeRedundancyMenuItem_actionPerformed();\r
- else if(evt.getSource()==pairwiseAlignmentMenuItem)\r
+ else if(source==pairwiseAlignmentMenuItem)\r
pairwiseAlignmentMenuItem_actionPerformed();\r
- else if(evt.getSource()==PCAMenuItem)\r
+ else if(source==PCAMenuItem)\r
PCAMenuItem_actionPerformed();\r
- else if(evt.getSource()==averageDistanceTreeMenuItem)\r
+ else if(source==averageDistanceTreeMenuItem)\r
averageDistanceTreeMenuItem_actionPerformed();\r
- else if(evt.getSource()==neighbourTreeMenuItem)\r
+ else if(source==neighbourTreeMenuItem)\r
neighbourTreeMenuItem_actionPerformed();\r
- else if(evt.getSource()==njTreeBlosumMenuItem)\r
+ else if(source==njTreeBlosumMenuItem)\r
njTreeBlosumMenuItem_actionPerformed();\r
- else if(evt.getSource()==avDistanceTreeBlosumMenuItem)\r
+ else if(source==avDistanceTreeBlosumMenuItem)\r
avTreeBlosumMenuItem_actionPerformed();\r
- else if(evt.getSource()==documentation)\r
+ else if(source==documentation)\r
documentation_actionPerformed();\r
- else if(evt.getSource()==about)\r
+ else if(source==about)\r
about_actionPerformed();\r
\r
}\r
sequenceFeatures.setState(false);\r
annotationColour.setLabel("by Annotation...");\r
annotationColour.addActionListener(this);\r
+ invertSequenceMenuItem.setLabel("Invert Sequence Selection");\r
+ invertColSel.setLabel("Invert Column Selection");\r
+ menu1.setLabel("Show");\r
+ showColumns.setLabel("All Columns ");\r
+ showSeqs.setLabel("All Sequences");\r
+ menu2.setLabel("Hide");\r
+ hideColumns.setLabel("Selected Columns");\r
+ hideSequences.setLabel("Selected Sequences");\r
+ invertColSel.addActionListener(this);\r
+ showColumns.addActionListener(this);\r
+ showSeqs.addActionListener(this);\r
+ hideColumns.addActionListener(this);\r
+ hideSequences.addActionListener(this);\r
+\r
\r
alignFrameMenuBar.add(fileMenu);\r
alignFrameMenuBar.add(editMenu);\r
editMenu.add(selectAllSequenceMenuItem);\r
editMenu.add(deselectAllSequenceMenuItem);\r
editMenu.add(invertSequenceMenuItem);\r
- editMenu.add(deleteGroups);\r
+ editMenu.add(invertColSel);\r
+ editMenu.add(deleteGroups);\r
editMenu.addSeparator();\r
editMenu.add(remove2LeftMenuItem);\r
editMenu.add(remove2RightMenuItem);\r
searchMenu.add(findMenuItem);\r
viewMenu.add(font);\r
viewMenu.addSeparator();\r
- viewMenu.add(seqLimits);\r
- viewMenu.addSeparator();\r
+ viewMenu.add(menu1);\r
+ viewMenu.add(menu2);\r
+ viewMenu.addSeparator();\r
viewMenu.add(wrapMenuItem);\r
viewMenu.add(scaleAbove);\r
viewMenu.add(scaleLeft);\r
viewMenu.add(scaleRight);\r
viewMenu.addSeparator();\r
+ viewMenu.add(seqLimits);\r
viewMenu.add(viewBoxesMenuItem);\r
viewMenu.add(viewTextMenuItem);\r
viewMenu.add(colourTextMenuItem);\r
calculate.add(njTreeBlosumMenuItem);\r
helpMenu.add(documentation);\r
helpMenu.add(about);\r
+ menu1.add(showColumns);\r
+ menu1.add(showSeqs);\r
+ menu2.add(hideColumns);\r
+ menu2.add(hideSequences);\r
}\r
\r
public void setEmbedded()\r
MenuItem featureSettings = new MenuItem();\r
CheckboxMenuItem sequenceFeatures = new CheckboxMenuItem();\r
MenuItem annotationColour = new MenuItem();\r
+ MenuItem invertColSel = new MenuItem();\r
+ Menu menu1 = new Menu();\r
+ MenuItem showColumns = new MenuItem();\r
+ MenuItem showSeqs = new MenuItem();\r
+ Menu menu2 = new Menu();\r
+ MenuItem hideColumns = new MenuItem();\r
+ MenuItem hideSequences = new MenuItem();\r
\r
public void mousePressed(MouseEvent evt)\r
{\r