}\r
}\r
\r
+ /**\r
+ * DOCUMENT ME!\r
+ *\r
+ * @param e DOCUMENT ME!\r
+ */\r
protected void undoMenuItem_actionPerformed()\r
{\r
CommandI command = (CommandI)viewport.historyList.pop();\r
viewport.redoList.push(command);\r
command.undoCommand();\r
\r
- viewport.hasHiddenColumns = viewport.colSel.getHiddenColumns() != null;\r
+ AlignViewport originalSource = getOriginatingSource(command);\r
+\r
+ originalSource.hasHiddenColumns = viewport.colSel.getHiddenColumns() != null;\r
updateEditMenuBar();\r
- viewport.firePropertyChange("alignment", null,\r
- viewport.getAlignment().getSequences());\r
+ originalSource.firePropertyChange("alignment", null,null);\r
}\r
\r
+ /**\r
+ * DOCUMENT ME!\r
+ *\r
+ * @param e DOCUMENT ME!\r
+ */\r
protected void redoMenuItem_actionPerformed()\r
{\r
CommandI command = (CommandI) viewport.redoList.pop();\r
viewport.historyList.push(command);\r
command.doCommand();\r
- viewport.hasHiddenColumns = viewport.colSel.getHiddenColumns()!=null;\r
+\r
+ AlignViewport originalSource = getOriginatingSource(command);\r
+ originalSource.hasHiddenColumns = viewport.colSel.getHiddenColumns()!=null;\r
\r
updateEditMenuBar();\r
- viewport.firePropertyChange("alignment", null, viewport.getAlignment().getSequences());\r
+ originalSource.firePropertyChange("alignment", null, null);\r
}\r
\r
+ AlignViewport getOriginatingSource(CommandI command)\r
+ {\r
+ AlignViewport originalSource = viewport;\r
+ //For sequence removal and addition, we need to fire\r
+ //the property change event FROM the viewport where the\r
+ //original alignment was altered\r
+ if (command instanceof EditCommand)\r
+ {\r
+ EditCommand editCommand = (EditCommand) command;\r
+ AlignmentI al = editCommand.getAlignment();\r
+ Vector comps = (Vector) PaintRefresher.components\r
+ .get(viewport.getSequenceSetId());\r
+ for (int i = 0; i < comps.size(); i++)\r
+ {\r
+ if (comps.elementAt(i) instanceof AlignmentPanel)\r
+ {\r
+ if (al == ( (AlignmentPanel) comps.elementAt(i)).av.alignment)\r
+ {\r
+ originalSource = ( (AlignmentPanel) comps.elementAt(i)).av;\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ return originalSource;\r
+ }\r
\r
public void moveSelectedSequences(boolean up)\r
{\r
viewport.redoList.push(command);
command.undoCommand();
+ AlignViewport originalSource = getOriginatingSource(command);
- viewport.hasHiddenColumns = viewport.colSel.getHiddenColumns() != null;
+ originalSource.hasHiddenColumns = viewport.colSel.getHiddenColumns() != null;
updateEditMenuBar();
- viewport.firePropertyChange("alignment", null,null);
+ originalSource.firePropertyChange("alignment", null,null);
}
/**
CommandI command = (CommandI) viewport.redoList.pop();
viewport.historyList.push(command);
command.doCommand();
- viewport.hasHiddenColumns = viewport.colSel.getHiddenColumns()!=null;
+
+ AlignViewport originalSource = getOriginatingSource(command);
+ originalSource.hasHiddenColumns = viewport.colSel.getHiddenColumns()!=null;
updateEditMenuBar();
- viewport.firePropertyChange("alignment", null, null);
+ originalSource.firePropertyChange("alignment", null, null);
}
+ AlignViewport getOriginatingSource(CommandI command)
+ {
+ AlignViewport originalSource = viewport;
+ //For sequence removal and addition, we need to fire
+ //the property change event FROM the viewport where the
+ //original alignment was altered
+ if (command instanceof EditCommand)
+ {
+ EditCommand editCommand = (EditCommand) command;
+ AlignmentI al = editCommand.getAlignment();
+ Vector comps = (Vector) PaintRefresher.components
+ .get(viewport.getSequenceSetId());
+ for (int i = 0; i < comps.size(); i++)
+ {
+ if (comps.elementAt(i) instanceof AlignmentPanel)
+ {
+ if (al == ( (AlignmentPanel) comps.elementAt(i)).av.alignment)
+ {
+ originalSource = ( (AlignmentPanel) comps.elementAt(i)).av;
+ break;
+ }
+ }
+ }
+ }
+ return originalSource;
+ }
/**
* DOCUMENT ME!