info.bioinfweb.treegraph.document.undo.edit
Class AssignLabelIDsEdit
java.lang.Object
info.bioinfweb.treegraph.document.undo.DocumentEdit
info.bioinfweb.treegraph.document.undo.edit.AssignLabelIDsEdit
- All Implemented Interfaces:
- javax.swing.undo.UndoableEdit
public class AssignLabelIDsEdit
- extends DocumentEdit
This edit assigns label IDs to all labels in the tree which do not have an ID.
- Author:
- BenStoever
|
Field Summary |
private java.util.Vector<java.lang.String> |
currentIDs
|
private java.util.Vector<java.lang.String> |
newIDs
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
currentIDs
private java.util.Vector<java.lang.String> currentIDs
newIDs
private java.util.Vector<java.lang.String> newIDs
AssignLabelIDsEdit
public AssignLabelIDsEdit(Document document)
getNewID
private java.lang.String getNewID(int pos)
assignIDsToLabelBlock
private int assignIDsToLabelBlock(Labels labels,
boolean above,
int pos)
- Assigns a new label ID to each label in this label block currently without an ID.
- Parameters:
labels - - the Labels-object containing the label block.above - - whether the above label block is usedpos - - the start position in the list of new label IDs
- Returns:
- the position in the list of new label IDs
assignIDsToSubtree
private void assignIDsToSubtree(Node root)
redo
public void redo()
throws javax.swing.undo.CannotRedoException
- Specified by:
redo in interface javax.swing.undo.UndoableEdit- Overrides:
redo in class DocumentEdit
- Throws:
javax.swing.undo.CannotRedoException
canUndo
public boolean canUndo()
- Specified by:
canUndo in interface javax.swing.undo.UndoableEdit- Overrides:
canUndo in class DocumentEdit
getPresentationName
public java.lang.String getPresentationName()