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:
- javax.swing.undo.UndoableEdit
public class ScaleBranchLengthsEdit
- extends DocumentEdit
|
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. |
java.lang.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
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 javax.swing.undo.CannotRedoException
- Specified by:
redo in interface javax.swing.undo.UndoableEdit- Overrides:
redo in class DocumentEdit
- Throws:
javax.swing.undo.CannotRedoException
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()