info.bioinfweb.treegraph.document.undo.format
Class ScaleBranchLengthsEdit
java.lang.Object
info.bioinfweb.treegraph.document.undo.DocumentEdit
info.bioinfweb.treegraph.document.undo.format.ScaleBranchLengthsEdit
- All Implemented Interfaces:
- UndoableEdit
public class ScaleBranchLengthsEdit
- extends DocumentEdit
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
oldScale
private float oldScale
newScale
private float newScale
ScaleBranchLengthsEdit
public ScaleBranchLengthsEdit(Document document,
float length)
- Parameters:
document
- length
- the desired length of the longest path throught the tree im millimeters
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()