Home /
Development /
Documentation /
2.0.44 /
ColorsByNodeBranchDataEdit
info.bioinfweb.treegraph.document.undo.format
Class ColorsByNodeBranchDataEdit
java.lang.Object
info.bioinfweb.treegraph.document.undo.DocumentEdit
info.bioinfweb.treegraph.document.undo.format.NodeBranchDataFormatEdit
info.bioinfweb.treegraph.document.undo.format.ColorsByNodeBranchDataEdit
- All Implemented Interfaces:
- UndoableEdit
public class ColorsByNodeBranchDataEdit
- extends NodeBranchDataFormatEdit
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
sourceAdapter
private NodeBranchDataAdapter sourceAdapter
min
private Color min
redFactor
double redFactor
greenFactor
double greenFactor
blueFactor
double blueFactor
changeUndefined
private boolean changeUndefined
inheritToTerminals
private boolean inheritToTerminals
targetAdapters
private ColorAdapter[] targetAdapters
oldColors
private Vector<Color>[] oldColors
ColorsByNodeBranchDataEdit
public ColorsByNodeBranchDataEdit(Document document,
NodeBranchDataAdapter sourceAdapter,
Color min,
Color max,
boolean changeUndefined,
boolean inheritToTerminals,
ColorAdapter[] targetAdapters)
saveOldColors
private void saveOldColors()
saveOldSubtreeColors
private void saveOldSubtreeColors(Node root)
- Saves the old colors. (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 CannotRedoException
- Specified by:
redo
in interface UndoableEdit
- Overrides:
redo
in class DocumentEdit
- Throws:
CannotRedoException
setOldColors
private int setOldColors(Node root,
int index)
- Assigns the previously saved colors 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 CannotUndoException
- Specified by:
undo
in interface UndoableEdit
- Overrides:
undo
in class DocumentEdit
- Throws:
CannotUndoException
getPresentationName
public String getPresentationName()