From aff93619ba53584f9b01970832558331951d9dbf Mon Sep 17 00:00:00 2001 From: jprocter Date: Thu, 29 Apr 2010 11:13:01 +0000 Subject: [PATCH] hide/show selected region menu entries and key bindings --- help/html/keys.html | 489 +++++++++++++++++---------------- help/html/menus/alignmentMenu.html | 14 +- help/html/menus/alwview.html | 8 +- help/html/releases.html | 4 + src/jalview/appletgui/AlignFrame.java | 139 +++++++--- src/jalview/gui/AlignFrame.java | 158 ++++++----- src/jalview/jbgui/GAlignFrame.java | 59 ++++ 7 files changed, 523 insertions(+), 348 deletions(-) diff --git a/help/html/keys.html b/help/html/keys.html index 61c55cc..4ecce1d 100755 --- a/help/html/keys.html +++ b/help/html/keys.html @@ -1,242 +1,247 @@ - -Key Strokes - -

Key Strokes

-

-Jalview has two distinct modes of keyboard operation - in 'Normal' - mode, single keystrokes (including those shown next to menu items) - provide short cuts to common commands. In 'Cursor' mode (enabled by - F2), some of these are disabled and more complex 'Compound - Keystrokes' can be entered to perform precise navigation, selection - and editing operations. -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
KeyWhich ModeAction
EscapeNormalClears the current selection region, highlighted columns and highlghted - residues.
EscapeCursorAs in normal mode, but also cancels any partially entered commands
F1BothShow Help Documentation
F2Toggle Cursor mode on / off
Control 'Z'BothUndoes the last sequence edit
Control 'Y'BothRedo the last sequence edit undone.
Up ArrowNormalMoves selected sequence(s) up the alignment
Down ArrowNormalMoves selected sequence(s) down the alignment.
Left ArrowNormal Slides selected sequence(s) left. Press Alt key to slide in cursor mode
Right ArrowNormalSlides selected sequence(s) right. Press Alt key to slide in cursor mode
Cursor Keys
- (Arrow Keys)
CursorMove cursor around alignment
Page UpBothScroll up the alignment view
Page DownBothScroll down the alignment view
Control 'A'BothSelects all sequences in the alignment
Control 'I'Both Invert sequence selection.
Control Alt 'I'Both Invert column selection.
Control 'C'BothCopies the selected region into the clipboard as a Fasta format file
- nb. not available in applet, as no clipboard is available
Control 'V'Both Paste the contents of the clipboard to the current alignment window. - (Alignment Window->Edit->Paste->Add to this Alignment)
nb. if the - paste is from a Jalview alignment, any sequence and alignment annotations - will also be copied over.
Control Shift 'V'BothPaste the contents of the clipboard to a new alignment window. (Alignment - Window->Edit->Paste->To New Alignment)
Control 'X'BothCuts the (fully) selected sequences from the alignment. - -
Control 'F'BothLaunches the search window
HBothHides / Reveals selected columns and sequences
Control 'H'BothHides / Reveals selected columns
Shift 'H'BothHides / Reveals selected sequences
Control 'O'BothInput new alignment from file
Control 'S'BothSave alignment with current filename and format
Control Shift 'S'BothSave alignment as a new file or with a different format
Control 'P'BothOpens the print dialog box to print the current view
Control 'W'BothCloses the current view or the current alignment
BackspaceNormalDelete the currently selected rows or columns from the alignment.
Control 'L'LeftRemove columns to left of left-most column marker.
Control 'R'BothRemove columns to right of right-most column marker.
Control 'E'BothRemove gapped columns
Control Shift 'E'BothRemove all gaps
Control 'D'BothOpen the 'Remove redundancy' Dialog box.
Normal
-

The compound commands available in the Cursor mode are summarised -below. Single letter commands can be prefixed by digits to specify a repetition -number, and some more complex commands take one or more numeric -parameters (prefixing the command key and separated by commas).

- - - - - - - - - - - -
Compound -CommandModeAction (and parameter description)
0-9CursorBegin entering a -numeric parameter (p) or repetition number for a cursor movement or edit -command.
,CursorSeparates one or -more numeric parameters (e.g. p1,p2) for a command.
p1,p2
Return
CursorMove cursor to a particular column (p1) and row (p2) in the alignment.
e.g. '5,6<Return>' moves the cursor to the 5th column in the 6th sequence.
pSCursorJump to the p'th sequence in the alignment.
pPCursorJump to p'th amino acid in current sequence.
pCCursorJump to p'th column in the alignment.
QCursorMarks the top left corner of the selection area
MCursorMarks the bottom right corner of the selection area
[p]
Space
CursorInserts -one (or optionally p) gaps at the current position.
Hold down Control or Shift to insert gaps over a sequence group
[p]
Delete
CursorRemoves -one (or optionally p) gaps at the cursor position.
Hold down Control or Shift to insert gaps over a sequence group
[p]
Backspace
CursorRemoves -one (or optionally p) gaps at the cursor position.
Hold down Control or Shift to insert gaps over a sequence group
-

 

-

 

- - + +Key Strokes + +

Key Strokes

+

+Jalview has two distinct modes of keyboard operation - in 'Normal' + mode, single keystrokes (including those shown next to menu items) + provide short cuts to common commands. In 'Cursor' mode (enabled by + F2), some of these are disabled and more complex 'Compound + Keystrokes' can be entered to perform precise navigation, selection + and editing operations. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeyWhich ModeAction
EscapeNormalClears the current selection region, highlighted columns and highlghted + residues.
EscapeCursorAs in normal mode, but also cancels any partially entered commands
F1BothShow Help Documentation
F2Toggle Cursor mode on / off
Control 'Z'BothUndoes the last sequence edit
Control 'Y'BothRedo the last sequence edit undone.
Up ArrowNormalMoves selected sequence(s) up the alignment
Down ArrowNormalMoves selected sequence(s) down the alignment.
Left ArrowNormal Slides selected sequence(s) left. Press Alt key to slide in cursor mode
Right ArrowNormalSlides selected sequence(s) right. Press Alt key to slide in cursor mode
Cursor Keys
+ (Arrow Keys)
CursorMove cursor around alignment
Page UpBothScroll up the alignment view
Page DownBothScroll down the alignment view
Control 'A'BothSelects all sequences in the alignment
Control 'I'Both Invert sequence selection.
Control Alt 'I'Both Invert column selection.
Control 'C'BothCopies the selected region into the clipboard as a Fasta format file
+ nb. not available in applet, as no clipboard is available
Control 'V'Both Paste the contents of the clipboard to the current alignment window. + (Alignment Window->Edit->Paste->Add to this Alignment)
nb. if the + paste is from a Jalview alignment, any sequence and alignment annotations + will also be copied over.
Control Shift 'V'BothPaste the contents of the clipboard to a new alignment window. (Alignment + Window->Edit->Paste->To New Alignment)
Control 'X'BothCuts the (fully) selected sequences from the alignment. + +
Control 'F'BothLaunches the search window
HBothHides / Reveals selected columns and sequences
Control 'H'BothHides / Reveals selected columns
Shift 'H'BothHides / Reveals selected sequences
Control + Shift 'H'BothHides everything but the current selection
Control 'O'BothInput new alignment from file
Control 'S'BothSave alignment with current filename and format
Control Shift 'S'BothSave alignment as a new file or with a different format
Control 'P'BothOpens the print dialog box to print the current view
Control 'W'BothCloses the current view or the current alignment
BackspaceNormalDelete the currently selected rows or columns from the alignment.
Control 'L'LeftRemove columns to left of left-most column marker.
Control 'R'BothRemove columns to right of right-most column marker.
Control 'E'BothRemove gapped columns
Control Shift 'E'BothRemove all gaps
Control 'D'BothOpen the 'Remove redundancy' Dialog box.
Normal
+

The compound commands available in the Cursor mode are summarised +below. Single letter commands can be prefixed by digits to specify a repetition +number, and some more complex commands take one or more numeric +parameters (prefixing the command key and separated by commas).

+ + + + + + + + + + + +
Compound +CommandModeAction (and parameter description)
0-9CursorBegin entering a +numeric parameter (p) or repetition number for a cursor movement or edit +command.
,CursorSeparates one or +more numeric parameters (e.g. p1,p2) for a command.
p1,p2
Return
CursorMove cursor to a particular column (p1) and row (p2) in the alignment.
e.g. '5,6<Return>' moves the cursor to the 5th column in the 6th sequence.
pSCursorJump to the p'th sequence in the alignment.
pPCursorJump to p'th amino acid in current sequence.
pCCursorJump to p'th column in the alignment.
QCursorMarks the top left corner of the selection area
MCursorMarks the bottom right corner of the selection area
[p]
Space
CursorInserts +one (or optionally p) gaps at the current position.
Hold down Control or Shift to insert gaps over a sequence group
[p]
Delete
CursorRemoves +one (or optionally p) gaps at the cursor position.
Hold down Control or Shift to insert gaps over a sequence group
[p]
Backspace
CursorRemoves +one (or optionally p) gaps at the cursor position.
Hold down Control or Shift to insert gaps over a sequence group
+

 

+

 

+ + diff --git a/help/html/menus/alignmentMenu.html b/help/html/menus/alignmentMenu.html index b368235..aceabce 100755 --- a/help/html/menus/alignmentMenu.html +++ b/help/html/menus/alignmentMenu.html @@ -193,6 +193,12 @@
  • Undefine Groups (Control U)
    The alignment will be reset with no defined groups.
    WARNING: This cannot be undone.
  • +
  • Make Groups
    + The currently selected groups of the alignment will be + subdivided according to the contents of the currently selected region. +
    Use this to subdivide an alignment based on the + different combinations of residues observed at specific + positions. (new in jalview 2.5)
  • View @@ -205,10 +211,10 @@
  • Gather Views (G)
    Each view associated with the alignment will be displayed within its own tab on the current alignment window.
  • -
  • Show→(all Columns / Sequences)
    - All hidden Columns / Sequences will be revealed.
  • -
  • Hide→(all Columns / Sequences)
    - Hides the all the currently selected Columns / Sequences
  • +
  • Show→(all Columns / Sequences / Sequences and Columns)
    + All hidden Columns / Sequences / Sequences and Columns will be revealed.
  • +
  • Hide→(all Columns / Sequences / Selected Region / All but Selected Region )
    + Hides the all the currently selected Columns / Sequences / Region or everything but the selected Region.
  • Show Annotations
    If this is selected the "Annotation Panel" will be displayed below the alignment. The default setting is to display the diff --git a/help/html/menus/alwview.html b/help/html/menus/alwview.html index 10ab511..85ffe36 100755 --- a/help/html/menus/alwview.html +++ b/help/html/menus/alwview.html @@ -14,10 +14,10 @@
  • Gather Views (G)
    Each view associated with the alignment will be displayed within its own tab on the current alignment window.
  • -
  • Show→(all Columns / Sequences)
    - All hidden Columns / Sequences will be revealed.
  • -
  • Hide→(all Columns / Sequences)
    - Hides the currently selected Columns / Sequences
  • +
  • Show→(all Columns / Sequences / Sequences and Columns )
    + All hidden Columns / Sequences / Sequences and Columns will be revealed.
  • +
  • Hide→(all Columns / Sequences / Selected Region / All but Selected Region)
    + Hides the currently selected Columns / Sequences / Region or everything but the selected Region.
  • Show Annotations
    If this is selected the "Annotation Panel" will be displayed below the alignment. The default setting is to display the conservation diff --git a/help/html/releases.html b/help/html/releases.html index e7ab682..a81997e 100755 --- a/help/html/releases.html +++ b/help/html/releases.html @@ -33,6 +33,8 @@
  • Order an alignment in order of average feature score or total feature count
  • Shading features by score or associated description
  • +
  • Subdivide alignment and groups based on identity of selected subsequence (Make Groups from Selection).
  • +
  • New hide/show options including Shift+Control+H to hide everything but the currently selected region.
  • Vamsas Capabilities @@ -104,6 +106,7 @@
  • AMSA files only contain first column of multi-character column annotation labels
  • Jalview Annotation File generation/parsing consistent with documentation (e.g. Stockholm annotation can be exported and re-imported)
  • PDB files without embedded PDB IDs given a friendly name
  • +
  • Find incrementally searches ID string matches as well as subsequence matches, and correctly reports total number of both.
  • Applet:
    • @@ -120,6 +123,7 @@ sources
    • Ensured that command line das feature retrieval completes before alignment figures are generated.
    • +
    • Reduced time taken when opening file browser for first time.
  • diff --git a/src/jalview/appletgui/AlignFrame.java b/src/jalview/appletgui/AlignFrame.java index 74f12ef..1330cf6 100755 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@ -341,37 +341,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, { boolean toggleSeqs = !evt.isControlDown(); boolean toggleCols = !evt.isShiftDown(); - boolean hide = false; - SequenceGroup sg = viewport.getSelectionGroup(); - - if (toggleSeqs) - { - if (sg != null && sg.getSize() != viewport.alignment.getHeight()) - { - hide = true; - viewport.hideAllSelectedSeqs(); - } - else if (!(toggleCols && viewport.colSel.getSelected().size() > 0)) - { - viewport.showAllHiddenSeqs(); - } - } - - if (toggleCols) - { - if (viewport.colSel.getSelected().size() > 0) - { - viewport.hideSelectedColumns(); - if (!toggleSeqs) - { - viewport.selectionGroup = sg; - } - } - else if (!hide) - { - viewport.showAllHiddenColumns(); - } - } + toggleHiddenRegions(toggleSeqs, toggleCols); break; } @@ -445,11 +415,11 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, { if (evt.isAltDown()) { - viewport.invertColumnSelection(); + invertColSel_actionPerformed(); } else { - this.invertSequenceMenuItem_actionPerformed(); + invertSequenceMenuItem_actionPerformed(); } } break; @@ -471,7 +441,73 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, } alignPanel.paintAlignment(true); } + /** + * called by key handler and the hide all/show all menu items + * @param toggleSeqs + * @param toggleCols + */ + private void toggleHiddenRegions(boolean toggleSeqs, + boolean toggleCols) + { + boolean hide = false; + SequenceGroup sg = viewport.getSelectionGroup(); + if (!toggleSeqs && !toggleCols) + { + // Hide everything by the current selection - this is a hack - we do the + // invert and then hide + // first check that there will be visible columns after the invert. + if ((viewport.colSel != null + && viewport.colSel.getSelected() != null && viewport.colSel + .getSelected().size() > 0) + || (sg != null && sg.getSize() > 0 && sg.getStartRes() <= sg + .getEndRes())) + { + // now invert the sequence set, if required - empty selection implies + // that no hiding is required. + if (sg != null) + { + invertSequenceMenuItem_actionPerformed(); + sg = viewport.getSelectionGroup(); + toggleSeqs = true; + + } + viewport.expandColSelection(sg, true); + // finally invert the column selection and get the new sequence + // selection and indicate it should be hidden. + invertColSel_actionPerformed(); + toggleCols = true; + } + } + + if (toggleSeqs) + { + if (sg != null && sg.getSize() != viewport.alignment.getHeight()) + { + hide = true; + viewport.hideAllSelectedSeqs(); + } + else if (!(toggleCols && viewport.colSel.getSelected().size() > 0)) + { + viewport.showAllHiddenSeqs(); + } + } + if (toggleCols) + { + if (viewport.colSel.getSelected().size() > 0) + { + viewport.hideSelectedColumns(); + if (!toggleSeqs) + { + viewport.selectionGroup = sg; + } + } + else if (!hide) + { + viewport.showAllHiddenColumns(); + } + } + } public void keyReleased(KeyEvent evt) { } @@ -712,6 +748,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, else if (source == showSeqs) { viewport.showAllHiddenSeqs(); + alignPanel.paintAlignment(true); } else if (source == hideColumns) { @@ -722,6 +759,23 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, && viewport.getSelectionGroup() != null) { viewport.hideAllSelectedSeqs(); + alignPanel.paintAlignment(true); + } + else if (source == hideAllButSelection) { + toggleHiddenRegions(false,false); + alignPanel.paintAlignment(true); + } + else if (source == hideAllSelection) { + SequenceGroup sg = viewport.getSelectionGroup(); + viewport.expandColSelection(sg, false); + viewport.hideAllSelectedSeqs(); + viewport.hideSelectedColumns(); + alignPanel.paintAlignment(true); + } + else if (source == showAllHidden) { + viewport.showAllHiddenColumns(); + viewport.showAllHiddenSeqs(); + alignPanel.paintAlignment(true); } else if (source == featureSettings) { @@ -1677,6 +1731,12 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, PaintRefresher.Refresh(alignPanel, viewport.getSequenceSetId()); } + public void invertColSel_actionPerformed() + { + viewport.invertColumnSelection(); + alignPanel.paintAlignment(true); + PaintRefresher.Refresh(alignPanel, viewport.getSequenceSetId()); + } void trimAlignment(boolean trimLeft) { @@ -2848,11 +2908,17 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, menu2.setLabel("Hide"); hideColumns.setLabel("Selected Columns"); hideSequences.setLabel("Selected Sequences"); + hideAllButSelection.setLabel("All but Selected Region (Shift+Ctrl+H)"); + hideAllSelection.setLabel("Selected Region"); + showAllHidden.setLabel("All Sequences and Columns"); invertColSel.addActionListener(this); showColumns.addActionListener(this); showSeqs.addActionListener(this); hideColumns.addActionListener(this); hideSequences.addActionListener(this); + hideAllButSelection.addActionListener(this); + hideAllSelection.addActionListener(this); + showAllHidden.addActionListener(this); formatMenu.setLabel("Format"); selectMenu.setLabel("Select"); newView.setLabel("New View"); @@ -2951,8 +3017,11 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, helpMenu.add(about); menu1.add(showColumns); menu1.add(showSeqs); + menu1.add(showAllHidden); menu2.add(hideColumns); menu2.add(hideSequences); + menu2.add(hideAllSelection); + menu2.add(hideAllButSelection); formatMenu.add(font); formatMenu.add(seqLimits); formatMenu.add(wrapMenuItem); @@ -2996,6 +3065,10 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, MenuItem hideSequences = new MenuItem(); + MenuItem hideAllButSelection = new MenuItem(); + MenuItem hideAllSelection = new MenuItem(); + MenuItem showAllHidden = new MenuItem(); + Menu formatMenu = new Menu(); Menu selectMenu = new Menu(); diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 679d736..3e57430 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -406,71 +406,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { boolean toggleSeqs = !evt.isControlDown(); boolean toggleCols = !evt.isShiftDown(); - - boolean hide = false; - SequenceGroup sg = viewport.getSelectionGroup(); - // TODO: document ctrl-shift-h for show visible selected area and fix hack so columns for the current selected region get transferred. - if (!toggleSeqs && !toggleCols) - { - // Hide everything by the current selection - this is a hack - we do the invert and then hide - // first check that there will be visible columns after the invert. - if ((viewport.colSel!=null && viewport.colSel.getSelected()!=null && viewport.colSel.getSelected().size()>0) || (sg!=null && sg.getSize()>0 && sg.getStartRes()<=sg.getEndRes())) - { - // now invert the sequence set, if required - empty selection implies that no hiding is required. - if (sg!=null) { - invertSequenceMenuItem_actionPerformed(null); - sg = viewport.getSelectionGroup(); - toggleSeqs = true; - - } - - if (sg!=null && sg.getStartRes()>=0 && sg.getStartRes()<=sg.getEndRes()&& (viewport.colSel==null || viewport.colSel.getSelected()==null || viewport.colSel.getSelected().size()==0)) - { - // synthesize a column selection if none exists. this happens if a single region has been selected rather than whole columns. - if (viewport.colSel==null) - { - viewport.colSel = new ColumnSelection(); - } - for (int cspos = sg.getStartRes(); cspos<=sg.getEndRes(); cspos++) { - viewport.colSel.addElement(cspos); - } - } - // finally invert the column selection and get the new sequence selection. - invertColSel_actionPerformed(null); - toggleCols = true; - } - } - - if (toggleSeqs) - { - if (sg != null - && sg.getSize() != viewport.alignment.getHeight()) - { - hideSelSequences_actionPerformed(null); - hide = true; - } - else if (!(toggleCols && viewport.colSel.getSelected().size() > 0)) - { - showAllSeqs_actionPerformed(null); - } - } - - if (toggleCols) - { - if (viewport.colSel.getSelected().size() > 0) - { - hideSelColumns_actionPerformed(null); - if (!toggleSeqs) - { - viewport.selectionGroup = sg; - } - } - else if (!hide) - { - showAllColumns_actionPerformed(null); - } - } - break; + toggleHiddenRegions(toggleSeqs,toggleCols); + break; } case KeyEvent.VK_PAGE_UP: if (viewport.wrapAlignment) @@ -2417,6 +2354,97 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, viewport.hideAllSelectedSeqs(); alignPanel.paintAlignment(true); } + /** + * called by key handler and the hide all/show all menu items + * @param toggleSeqs + * @param toggleCols + */ + private void toggleHiddenRegions(boolean toggleSeqs, + boolean toggleCols) + { + + boolean hide = false; + SequenceGroup sg = viewport.getSelectionGroup(); + if (!toggleSeqs && !toggleCols) + { + // Hide everything by the current selection - this is a hack - we do the invert and then hide + // first check that there will be visible columns after the invert. + if ((viewport.colSel!=null && viewport.colSel.getSelected()!=null && viewport.colSel.getSelected().size()>0) || (sg!=null && sg.getSize()>0 && sg.getStartRes()<=sg.getEndRes())) + { + // now invert the sequence set, if required - empty selection implies that no hiding is required. + if (sg!=null) { + invertSequenceMenuItem_actionPerformed(null); + sg = viewport.getSelectionGroup(); + toggleSeqs = true; + + } + viewport.expandColSelection(sg,true); + // finally invert the column selection and get the new sequence selection. + invertColSel_actionPerformed(null); + toggleCols = true; + } + } + + if (toggleSeqs) + { + if (sg != null + && sg.getSize() != viewport.alignment.getHeight()) + { + hideSelSequences_actionPerformed(null); + hide = true; + } + else if (!(toggleCols && viewport.colSel.getSelected().size() > 0)) + { + showAllSeqs_actionPerformed(null); + } + } + + if (toggleCols) + { + if (viewport.colSel.getSelected().size() > 0) + { + hideSelColumns_actionPerformed(null); + if (!toggleSeqs) + { + viewport.selectionGroup = sg; + } + } + else if (!hide) + { + showAllColumns_actionPerformed(null); + } + } + } + + /* (non-Javadoc) + * @see jalview.jbgui.GAlignFrame#hideAllButSelection_actionPerformed(java.awt.event.ActionEvent) + */ + public void hideAllButSelection_actionPerformed(ActionEvent e) + { + toggleHiddenRegions(false, false); + } + + /* (non-Javadoc) + * @see jalview.jbgui.GAlignFrame#hideAllSelection_actionPerformed(java.awt.event.ActionEvent) + */ + public void hideAllSelection_actionPerformed(ActionEvent e) + { + SequenceGroup sg = viewport.getSelectionGroup(); + viewport.expandColSelection(sg,false); + viewport.hideAllSelectedSeqs(); + viewport.hideSelectedColumns(); + alignPanel.paintAlignment(true); + } + + /* (non-Javadoc) + * @see jalview.jbgui.GAlignFrame#showAllhidden_actionPerformed(java.awt.event.ActionEvent) + */ + public void showAllhidden_actionPerformed(ActionEvent e) + { + viewport.showAllHiddenColumns(); + viewport.showAllHiddenSeqs(); + alignPanel.paintAlignment(true); + } public void hideSelColumns_actionPerformed(ActionEvent e) { diff --git a/src/jalview/jbgui/GAlignFrame.java b/src/jalview/jbgui/GAlignFrame.java index 7de11e1..2325de1 100755 --- a/src/jalview/jbgui/GAlignFrame.java +++ b/src/jalview/jbgui/GAlignFrame.java @@ -247,6 +247,12 @@ public class GAlignFrame extends JInternalFrame JMenuItem hideSelColumns = new JMenuItem(); + JMenuItem hideAllButSelection = new JMenuItem(); + + JMenuItem hideAllSelection = new JMenuItem(); + + JMenuItem showAllhidden = new JMenuItem(); + protected JCheckBoxMenuItem hiddenMarkers = new JCheckBoxMenuItem(); JMenuItem invertColSel = new JMenuItem(); @@ -1431,6 +1437,7 @@ public class GAlignFrame extends JInternalFrame statusPanel.setLayout(gridLayout1); jMenu3.setText("Show"); showAllSeqs.setText("All Sequences"); + showAllSeqs.setToolTipText("Shift+H toggles sequence visiblity."); showAllSeqs.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) @@ -1439,6 +1446,7 @@ public class GAlignFrame extends JInternalFrame } }); showAllColumns.setText("All Columns"); + showAllColumns.setToolTipText("Ctrl+H toggles column visiblity."); showAllColumns.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) @@ -1448,6 +1456,7 @@ public class GAlignFrame extends JInternalFrame }); hideMenu.setText("Hide"); hideSelSequences.setText("Selected Sequences"); + hideSelSequences.setToolTipText("Shift+H toggles sequence visiblity."); hideSelSequences.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) @@ -1456,6 +1465,7 @@ public class GAlignFrame extends JInternalFrame } }); hideSelColumns.setText("Selected Columns"); + hideSelColumns.setToolTipText("Ctrl+H toggles column visiblity."); hideSelColumns.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) @@ -1463,6 +1473,33 @@ public class GAlignFrame extends JInternalFrame hideSelColumns_actionPerformed(e); } }); + hideAllSelection.setText("Selected Region"); + hideAllSelection.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + hideAllSelection_actionPerformed(e); + } + }); + // TODO: should be hidden if no selection exists. + hideAllButSelection.setText("All but Selected Rregion (Shift+Ctrl+H)"); + hideAllButSelection.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + hideAllButSelection_actionPerformed(e); + } + }); + showAllhidden.setText("All Sequences and Columns"); + showAllhidden.setToolTipText("H toggles visibility of hidden or selected regions."); + showAllhidden.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + showAllhidden_actionPerformed(e); + } + }); + hiddenMarkers.setText("Show Hidden Markers"); hiddenMarkers.addActionListener(new ActionListener() { @@ -1727,8 +1764,12 @@ public class GAlignFrame extends JInternalFrame this.getContentPane().add(tabbedPane, java.awt.BorderLayout.CENTER); jMenu3.add(showAllColumns); jMenu3.add(showAllSeqs); + jMenu3.add(showAllhidden); hideMenu.add(hideSelColumns); hideMenu.add(hideSelSequences); + hideMenu.add(hideAllSelection); + hideMenu.add(hideAllButSelection); + formatMenu.add(font); formatMenu.addSeparator(); formatMenu.add(wrapMenuItem); @@ -1754,6 +1795,24 @@ public class GAlignFrame extends JInternalFrame selectMenu.add(grpsFromSelection); } + protected void showAllhidden_actionPerformed(ActionEvent e) + { + // TODO Auto-generated method stub + + } + + protected void hideAllButSelection_actionPerformed(ActionEvent e) + { + // TODO Auto-generated method stub + + } + + protected void hideAllSelection_actionPerformed(ActionEvent e) + { + // TODO Auto-generated method stub + + } + protected void applyAutoAnnotationSettings_actionPerformed(ActionEvent e) { // TODO Auto-generated method stub -- 1.7.10.2