X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FAlignFrame.java;h=e5f00530d905b8cc0785d54e4a4b83a5a675984e;hb=a6b324e3f5edac3df0b968f0037b1cc8b651598e;hp=84e9087c7c67d24fa863aeadb564e6e6a64194d1;hpb=e0401a6563eb1fb58b2f4b6d594b4b3826135950;p=jalview.git diff --git a/src/jalview/appletgui/AlignFrame.java b/src/jalview/appletgui/AlignFrame.java index 84e9087..e5f0053 100644 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@ -752,6 +752,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, { viewport.showAllHiddenColumns(); } + viewport.sendSelection(); } } @@ -923,12 +924,15 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, { boolean showForAlignment = showAlignmentAnnotations.getState(); boolean showForSequences = showSequenceAnnotations.getState(); - for (AlignmentAnnotation aa : alignPanel.getAlignment() + if (alignPanel.getAlignment().getAlignmentAnnotation() != null) + { + for (AlignmentAnnotation aa : alignPanel.getAlignment() .getAlignmentAnnotation()) { boolean visible = (aa.sequenceRef == null ? showForAlignment : showForSequences); aa.visible = visible; + } } alignPanel.validateAnnotationDimensions(true); validate(); @@ -1070,11 +1074,14 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, else if (source == invertSequenceMenuItem) { invertSequenceMenuItem_actionPerformed(); + // uncomment to slave sequence selections in split frame + // viewport.sendSelection(); } else if (source == invertColSel) { viewport.invertColumnSelection(); alignPanel.paintAlignment(true); + viewport.sendSelection(); } else if (source == remove2LeftMenuItem) { @@ -1108,27 +1115,34 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, { viewport.showAllHiddenColumns(); alignPanel.paintAlignment(true); + viewport.sendSelection(); } else if (source == showSeqs) { viewport.showAllHiddenSeqs(); alignPanel.paintAlignment(true); + // uncomment if we want to slave sequence selections in split frame + // viewport.sendSelection(); } else if (source == hideColumns) { viewport.hideSelectedColumns(); alignPanel.paintAlignment(true); + viewport.sendSelection(); } else if (source == hideSequences && viewport.getSelectionGroup() != null) { viewport.hideAllSelectedSeqs(); alignPanel.paintAlignment(true); + // uncomment if we want to slave sequence selections in split frame + // viewport.sendSelection(); } else if (source == hideAllButSelection) { toggleHiddenRegions(false, false); alignPanel.paintAlignment(true); + viewport.sendSelection(); } else if (source == hideAllSelection) { @@ -1137,12 +1151,14 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, viewport.hideAllSelectedSeqs(); viewport.hideSelectedColumns(); alignPanel.paintAlignment(true); + viewport.sendSelection(); } else if (source == showAllHidden) { viewport.showAllHiddenColumns(); viewport.showAllHiddenSeqs(); alignPanel.paintAlignment(true); + viewport.sendSelection(); } else if (source == showGroupConsensus) { @@ -2263,7 +2279,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ColumnSelection colSel = viewport.getColumnSelection(); int column; - if (colSel.size() > 0) + if (!colSel.isEmpty()) { if (trimLeft) { @@ -2288,18 +2304,14 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, TrimRegionCommand trimRegion; if (trimLeft) { - trimRegion = new TrimRegionCommand("Remove Left", - TrimRegionCommand.TRIM_LEFT, seqs, column, - viewport.getAlignment(), viewport.getColumnSelection(), - viewport.getSelectionGroup()); + trimRegion = new TrimRegionCommand("Remove Left", true, seqs, + column, viewport.getAlignment()); viewport.setStartRes(0); } else { - trimRegion = new TrimRegionCommand("Remove Right", - TrimRegionCommand.TRIM_RIGHT, seqs, column, - viewport.getAlignment(), viewport.getColumnSelection(), - viewport.getSelectionGroup()); + trimRegion = new TrimRegionCommand("Remove Right", false, seqs, + column, viewport.getAlignment()); } statusBar.setText(MessageManager.formatMessage(