Home / Development / Documentation / 2.0.44 / ColorsByNodeBranchDataEdit
TreeGraph 2
 


info.bioinfweb.treegraph.document.undo.format
Class ColorsByNodeBranchDataEdit

java.lang.Object
  extended by info.bioinfweb.treegraph.document.undo.DocumentEdit
      extended by info.bioinfweb.treegraph.document.undo.format.NodeBranchDataFormatEdit
          extended by info.bioinfweb.treegraph.document.undo.format.ColorsByNodeBranchDataEdit
All Implemented Interfaces:
UndoableEdit

public class ColorsByNodeBranchDataEdit
extends NodeBranchDataFormatEdit


Field Summary
(package private)  double blueFactor
           
private  boolean changeUndefined
           
(package private)  double greenFactor
           
private  boolean inheritToTerminals
           
private  Color min
           
private  Vector<Color>[] oldColors
           
(package private)  double redFactor
           
private  NodeBranchDataAdapter sourceAdapter
           
private  ColorAdapter[] targetAdapters
           
 
Fields inherited from class info.bioinfweb.treegraph.document.undo.DocumentEdit
document
 
Constructor Summary
ColorsByNodeBranchDataEdit(Document document, NodeBranchDataAdapter sourceAdapter, Color min, Color max, boolean changeUndefined, boolean inheritToTerminals, ColorAdapter[] targetAdapters)
           
 
Method Summary
 String getPresentationName()
           
 void redo()
           
private  void saveOldColors()
           
private  void saveOldSubtreeColors(Node root)
          Saves the old colors.
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 colors in the subtree under root.
 void undo()
           
 
Methods inherited from class info.bioinfweb.treegraph.document.undo.format.NodeBranchDataFormatEdit
calculateMaxNodeData
 
Methods inherited from class info.bioinfweb.treegraph.document.undo.DocumentEdit
addEdit, canRedo, canUndo, die, getIsSubedit, getRedoPresentationName, getUndoPresentationName, isSignificant, replaceEdit, setIsSubedit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

ColorsByNodeBranchDataEdit

public ColorsByNodeBranchDataEdit(Document document,
                                  NodeBranchDataAdapter sourceAdapter,
                                  Color min,
                                  Color max,
                                  boolean changeUndefined,
                                  boolean inheritToTerminals,
                                  ColorAdapter[] targetAdapters)
Method Detail

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()