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:
- 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
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
currentIDs
private Vector<String> currentIDs
newIDs
private Vector<String> newIDs
AssignLabelIDsEdit
public AssignLabelIDsEdit(Document document)
getNewID
private 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 CannotRedoException
- Specified by:
redo in interface UndoableEdit- Overrides:
redo in class DocumentEdit
- Throws:
CannotRedoException
canUndo
public boolean canUndo()
- Specified by:
canUndo in interface UndoableEdit- Overrides:
canUndo in class DocumentEdit
getPresentationName
public String getPresentationName()