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
|
Method Summary |
static float |
calculateScale(Tree tree,
float length)
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 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
calculateScale
public static float calculateScale(Tree tree,
float length)
- 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 - length - - 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()