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:
- javax.swing.undo.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 java.awt.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 java.util.Vector<java.awt.Color>[] oldColors
ColorsByNodeBranchDataEdit
public ColorsByNodeBranchDataEdit(Document document,
NodeBranchDataAdapter sourceAdapter,
java.awt.Color min,
java.awt.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 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 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 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()