info.bioinfweb.treegraph.document.undo.format
Class ColorsFromNodeDataEdit
java.lang.Object
info.bioinfweb.treegraph.document.undo.DocumentEdit
info.bioinfweb.treegraph.document.undo.format.NodeDataFormatEdit
info.bioinfweb.treegraph.document.undo.format.ColorsFromNodeDataEdit
- All Implemented Interfaces:
- javax.swing.undo.UndoableEdit
public class ColorsFromNodeDataEdit
- extends NodeDataFormatEdit
|
Method Summary |
java.lang.String |
getPresentationName()
|
void |
redo()
|
private void |
saveOldColors(Node root)
Saves the old branch and node line colors in two linear list (ordering is root,
child 0..n) |
private void |
setNewColors(Node root)
Sets the line colors according to the specified border colors and node data. |
private int |
setOldColors(Node root,
int index)
Assigns the previously saved line colors to the branches and nodes 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 java.awt.Color min
redFactor
double redFactor
greenFactor
double greenFactor
blueFactor
double blueFactor
changeUndefined
private boolean changeUndefined
oldBranchColors
private java.util.Vector<java.awt.Color> oldBranchColors
oldNodeColors
private java.util.Vector<java.awt.Color> oldNodeColors
ColorsFromNodeDataEdit
public ColorsFromNodeDataEdit(Document document,
NodeDataAdapter adapter,
java.awt.Color min,
java.awt.Color max,
boolean changeUndefined)
saveOldColors
private void saveOldColors(Node root)
- Saves the old branch and node line colors in two linear list (ordering is root,
child 0..n)
- Parameters:
root - the root of the subtree to be saved
setNewColors
private void setNewColors(Node root)
- Sets the line colors according to the specified border colors 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
setOldColors
private int setOldColors(Node root,
int index)
- Assigns the previously saved line colors to the branches and nodes in the subtree
under root.
- Parameters:
root - index - - the index of the value for root in the linear lists
- Returns:
- the next unused index of the linear lists
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()