info.bioinfweb.treegraph.document.undo.format
Class BranchWidthsFromNodeDataEdit
java.lang.Object
info.bioinfweb.treegraph.document.undo.DocumentEdit
info.bioinfweb.treegraph.document.undo.format.NodeDataFormatEdit
info.bioinfweb.treegraph.document.undo.format.BranchWidthsFromNodeDataEdit
- All Implemented Interfaces:
- javax.swing.undo.UndoableEdit
public class BranchWidthsFromNodeDataEdit
- extends NodeDataFormatEdit
|
Method Summary |
java.lang.String |
getPresentationName()
|
void |
redo()
|
private void |
saveOldWidths(Node root)
Saves the old widths in a linear list (ordering is root, child 0..n) |
private void |
setNewWidths(Node root)
Sets the branch widths according to the specified range and node data. |
private int |
setOldWidths(Node root,
int index)
Assigns the previously saved line widths to the branches in the subtree under
root. |
void |
undo()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
adapter
private NodeDataAdapter adapter
min
private double min
factor
private double factor
changeUndefined
private boolean changeUndefined
oldWidths
private java.util.Vector<java.lang.Float> oldWidths
BranchWidthsFromNodeDataEdit
public BranchWidthsFromNodeDataEdit(Document document,
NodeDataAdapter adapter,
double min,
double max,
boolean changeUndefined)
saveOldWidths
private void saveOldWidths(Node root)
- Saves the old widths in a linear list (ordering is root, child 0..n)
- Parameters:
root -
setNewWidths
private void setNewWidths(Node root)
- Sets the branch widths according to the specified range and node data.
- Parameters:
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
setOldWidths
private int setOldWidths(Node root,
int index)
- Assigns the previously saved line widths to the branches in the subtree under
root.
- Parameters:
root - index - - the index of the value for root in oldWidths
- Returns:
- the next unused index of
oldWidths
undo
public void undo()
throws javax.swing.undo.CannotUndoException
- Specified by:
undo in interface javax.swing.undo.UndoableEdit- Overrides:
undo in class DocumentEdit
- Throws:
javax.swing.undo.CannotUndoException
getPresentationName
public java.lang.String getPresentationName()