From: amwaterhouse Date: Wed, 25 Oct 2006 14:03:43 +0000 (+0000) Subject: viewport.hasHiddenColumns updated after undo/redo performed X-Git-Tag: Release_2_2~233 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=75c30f2d281938dd7b78bbf5dd28bef31fd19a70;p=jalview.git viewport.hasHiddenColumns updated after undo/redo performed --- diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 260085d..4687b3c 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -857,6 +857,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener historyList.push(command); redoList.clear(); updateEditMenuBar(); + + viewport.hasHiddenColumns = viewport.colSel.getHiddenColumns()!=null; } @@ -878,6 +880,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener // if (hi.alColumnChanges!=null) // nh.alColumnChanges = hi.alColumnChanges.getInverse(); // restoreHistoryItem(hi); + viewport.hasHiddenColumns = viewport.colSel.getHiddenColumns()!=null; updateEditMenuBar(); viewport.firePropertyChange("alignment", null, viewport.getAlignment().getSequences()); } @@ -892,6 +895,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener CommandI command = (CommandI) redoList.pop(); historyList.push(command); command.doCommand(); + viewport.hasHiddenColumns = viewport.colSel.getHiddenColumns()!=null; // HistoryItem nh,hi = (HistoryItem) redoList.pop(); // historyList.push(nh=new HistoryItem(hi.getDescription(), viewport.alignment, @@ -1461,7 +1465,6 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener TrimRegionCommand trimRegion; - if(trimLeft) { trimRegion = new TrimRegionCommand("Remove Left", @@ -1469,30 +1472,18 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener seqs, column, viewport.alignment, - viewport.colSel); - - colSel.compensateForEdit(0, column); - - //AW edit.addShift(0,min); - if (viewport.getSelectionGroup() != null) - { - viewport.getSelectionGroup().adjustForRemoveLeft(column); - } + viewport.colSel, + viewport.selectionGroup); } else { - trimRegion = new TrimRegionCommand("Remove Left", + trimRegion = new TrimRegionCommand("Remove Right", TrimRegionCommand.TRIM_RIGHT, seqs, column, viewport.alignment, - viewport.colSel); - // TODO: delete hidden column entries in colSel to right of max - // TODO: record hidden columns in history for undo. - if (viewport.getSelectionGroup() != null) - { - viewport.getSelectionGroup().adjustForRemoveRight(column); - } + viewport.colSel, + viewport.selectionGroup); } addHistoryItem(trimRegion); @@ -2602,7 +2593,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener AlignmentSorter.sortByTree(viewport.getAlignment(), treePanel.getTree()); - addHistoryItem(new OrderCommand("Tree Sort", oldOrder, viewport.alignment)); + addHistoryItem(new OrderCommand("Tree Sort", + oldOrder, + viewport.alignment)); alignPanel.repaint();