Home / Development / Documentation / 2.0.44 / ScaleValue
TreeGraph 2
 


info.bioinfweb.treegraph.document.format
Class ScaleValue

java.lang.Object
  extended by info.bioinfweb.treegraph.document.format.ScaleValue

public class ScaleValue
extends Object

Stores the length of a branch length scale bar. In can be stored in the units of the branch lengths or in millimeters.

Author:
Ben Stöver

Field Summary
private  DistanceValue distanceValue
           
private  boolean inScaleUnits
           
 
Constructor Summary
ScaleValue()
           
ScaleValue(float inMillimeters)
           
 
Method Summary
 void assign(ScaleValue other)
           
static float branchLengthToDistance(float units, float branchLengthScale)
           
 float getInMillimeters(float branchLengthScale)
           
 float getInPixels(float pixelsPerMillimeter, float branchLengthScale)
           
 float getInPoints(float mmPerBranchLength)
           
 float getInUnits(float branchLengthScale)
           
 int getRoundedInPixels(float pixelsPerMillimeter, float branchLengthScale)
           
 float getStoredValue()
          Returns the stored value in millimeters or in branch length units.
 boolean isInScaleUnits()
           
static float millimetersToUnits(float mm, float branchLengthScale)
           
static float pointsToUnits(float points, float mmPerBranchLength)
           
 void setInMillimeters(float value)
           
 void setInPixels(float value, float pixelsPerMillimeter)
           
 void setInPoints(float value)
           
 void setInUnits(float units)
           
static float unitsToMillimeters(float units, float mmPerBranchLength)
           
static float unitsToPixels(float units, float pixelsPerMillimeter, float mmPerBranchLength)
           
static float unitsToPoints(float units, float mmPerBranch)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inScaleUnits

private boolean inScaleUnits

distanceValue

private DistanceValue distanceValue
Constructor Detail

ScaleValue

public ScaleValue()

ScaleValue

public ScaleValue(float inMillimeters)
Method Detail

isInScaleUnits

public boolean isInScaleUnits()

setInUnits

public void setInUnits(float units)

getInUnits

public float getInUnits(float branchLengthScale)

setInMillimeters

public void setInMillimeters(float value)

getInMillimeters

public float getInMillimeters(float branchLengthScale)

setInPixels

public void setInPixels(float value,
                        float pixelsPerMillimeter)

getInPixels

public float getInPixels(float pixelsPerMillimeter,
                         float branchLengthScale)

getRoundedInPixels

public int getRoundedInPixels(float pixelsPerMillimeter,
                              float branchLengthScale)

setInPoints

public void setInPoints(float value)

getInPoints

public float getInPoints(float mmPerBranchLength)

getStoredValue

public float getStoredValue()
Returns the stored value in millimeters or in branch length units.

Returns:
the stored value
See Also:
info.webinsel.treegraph.document.format.ScaleValue.isInScaleUnits()

unitsToMillimeters

public static float unitsToMillimeters(float units,
                                       float mmPerBranchLength)

millimetersToUnits

public static float millimetersToUnits(float mm,
                                       float branchLengthScale)

unitsToPoints

public static float unitsToPoints(float units,
                                  float mmPerBranch)

pointsToUnits

public static float pointsToUnits(float points,
                                  float mmPerBranchLength)

unitsToPixels

public static float unitsToPixels(float units,
                                  float pixelsPerMillimeter,
                                  float mmPerBranchLength)

branchLengthToDistance

public static float branchLengthToDistance(float units,
                                           float branchLengthScale)
Parameters:
units -
branchLengthScale - e.g. millimeters per branch length if the result should be in millimeters or points per branch length if the result should be in points
Returns:

assign

public void assign(ScaleValue other)