Home / Development / Documentation / 2.0.44 / ScaleBranchLengthsEdit
TreeGraph 2
 


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

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

public class ScaleBranchLengthsEdit
extends DocumentEdit


Field Summary
private  float newScale
           
private  float oldScale
           
 
Fields inherited from class info.bioinfweb.treegraph.document.undo.DocumentEdit
document
 
Constructor Summary
ScaleBranchLengthsEdit(Document document, float length)
           
 
Method Summary
static float calculateScaleByLength(Tree tree, float pathLength)
          Returns the branch length scale necessary for the specified tree so that the longest path to a leaf of this tree has the specified length.
 String getPresentationName()
           
 void redo()
           
 void undo()
           
 
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

oldScale

private float oldScale

newScale

private float newScale
Constructor Detail

ScaleBranchLengthsEdit

public ScaleBranchLengthsEdit(Document document,
                              float length)
Parameters:
document -
length - the desired length of the longest path throught the tree im millimeters
Method Detail

calculateScaleByLength

public static float calculateScaleByLength(Tree tree,
                                           float pathLength)
Returns the branch length scale necessary for the specified tree so that the longest path to a leaf of this tree has the specified length.

Parameters:
tree -
pathLength - the desired length of the longest path throught the tree im millimeters
Returns:

redo

public void redo()
          throws CannotRedoException
Specified by:
redo in interface UndoableEdit
Overrides:
redo in class DocumentEdit
Throws:
CannotRedoException

undo

public void undo()
          throws CannotUndoException
Specified by:
undo in interface UndoableEdit
Overrides:
undo in class DocumentEdit
Throws:
CannotUndoException

getPresentationName

public String getPresentationName()