X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fgui%2FAlignFrame.java;h=db9e75eeda6b2321f42b3ae7beeb3ab9b08b37ba;hb=ce0eac6587e6cc8d62318b003d0dbb41d8252659;hp=4687b3c48748e117eb1b4cd7275d9b7baf447fd9;hpb=75c30f2d281938dd7b78bbf5dd28bef31fd19a70;p=jalview.git diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 4687b3c..db9e75e 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -106,6 +106,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener { viewport = ap.av; alignPanel = ap; + alignPanel.alignFrame = this; addAlignmentPanel(ap); init(); } @@ -824,10 +825,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener */ void updateEditMenuBar() { + if (historyList.size() > 0) { undoMenuItem.setEnabled(true); - CommandI command = (CommandI) historyList.peek(); undoMenuItem.setText("Undo " + command.getDescription()); } @@ -874,12 +875,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener redoList.push(command); command.undoCommand(); - // HistoryItem nh,hi = (HistoryItem) historyList.pop(); - // redoList.push(nh=new HistoryItem(hi.getDescription(), viewport.alignment, - // HistoryItem.HIDE)); - // 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()); @@ -894,15 +890,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener { CommandI command = (CommandI) redoList.pop(); historyList.push(command); + 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, - // HistoryItem.HIDE)); - // if (hi.alColumnChanges!=null) - // nh.alColumnChanges=hi.alColumnChanges.getInverse(); - // restoreHistoryItem(hi); updateEditMenuBar(); viewport.firePropertyChange("alignment", null, viewport.getAlignment().getSequences()); } @@ -1512,7 +1503,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener */ public void removeGappedColumnMenuItem_actionPerformed(ActionEvent e) { - int start = 0, end = viewport.alignment.getWidth(); + int start = 0, end = viewport.alignment.getWidth()-1; SequenceI[] seqs; if (viewport.getSelectionGroup() != null) @@ -1551,7 +1542,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener */ public void removeAllGapsMenuItem_actionPerformed(ActionEvent e) { - int start = 0, end = viewport.alignment.getWidth(); + int start = 0, end = viewport.alignment.getWidth()-1; SequenceI[] seqs; if (viewport.getSelectionGroup() != null)