|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.bioinfweb.treegraph.graphics.positionpaint.RectangularCladogramPositioner
public class RectangularCladogramPositioner
Field Summary | |
---|---|
protected Document |
document
|
private static RectangularCladogramPositioner |
firstInstance
|
private float |
maxLeafWidth
|
protected float |
rescalingFactorX
|
protected PositionPaintType |
type
|
Constructor Summary | |
---|---|
protected |
RectangularCladogramPositioner()
|
Method Summary | |
---|---|
private float |
alignToOtherLegends(Legends legends,
int start,
int end,
float minLeft,
float top,
float bottom)
|
protected float |
calculateCornerRadiusShift(Node node,
float y)
Returns the space between the right of the node and the real position of the node line dependant of the y position. |
private void |
calculateLabelBlockDimensions(Labels labels,
boolean above)
|
protected void |
calculatePaintDimension(float overallWidth,
float overallHeight)
|
private DistanceDimension |
calculateTaxonDimension(Node taxon)
|
private DistanceDimension |
calculateTextDimension(TextElement textElement)
Calculates the Dimensions of this text element. |
private float |
calculateWidthsHeights(Node root)
|
ConcretePaintableElement |
elementToPosition(Document document,
float x,
float y,
float margin)
Determines the element to a position defined by x- and y-coordinates (e.g. to select an element by mouse). |
static RectangularCladogramPositioner |
getInstance()
|
private float |
getLegendBottom(LegendFormats f)
|
private float |
getLegendStartX(LegendFormats f,
float treeRight)
|
private float |
getLegendTop(LegendFormats f)
|
private float |
labelBlockHeight(Labels labels,
boolean above)
Returns the overall height of all rows of labels above or below the branch. |
private float |
labelBlockWidth(Labels labels)
Returns the maximum width of all lines of labels above and below the branch. |
private float |
labelLineHeight(Labels labels,
boolean above,
int lineNo)
|
private float |
labelLineWidth(Labels labels,
boolean above,
int lineNo)
|
private void |
moveAll(float dX,
float dY)
|
private float |
moveForLegends()
Moves the tree down by the legends overlay on the top and calculates the new document height including the possible overlay of the legends. |
private void |
moveLabels(Labels labels,
boolean above,
float dX,
float dY)
|
private void |
movePosition(PositionData pd,
float dX,
float dY)
|
private void |
moveSubtree(Node root,
float dX,
float dY)
|
void |
positionAll(Document document,
float rescalingFactorX)
|
private float |
positionElements(Node root,
float overallWidth,
float y0)
Positions the subtree under root. |
private void |
positionLabelBlockX(Branch branch,
boolean above)
|
private void |
positionLabelBlockY(Branch branch)
|
private float |
positionLegends(float startX)
Positions all legends rigths if startX . |
private float |
positionScaleBar(float treeWidth,
float maxTreeY)
Positions the scale bar. |
protected float |
rescaleBranchWidth(Branch branch,
float width)
This methode can be overwritten by extending classes to define a different rescaling process. |
protected float |
rescaleNodeWidth(Node node,
float width)
This methode can be overwritten by extending classes to define a different rescaling process. |
private float |
rescaleSubtree(Node root,
float shift)
Rescales the subtree under root. |
private ConcretePaintableElement |
searchElementToPosition(Node root,
float x,
float y,
float margin)
|
private ConcretePaintableElement |
searchLabelBlock(Branch branch,
float x,
float y,
float margin)
|
protected boolean |
xToHigh(float x,
PositionData pd)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static RectangularCladogramPositioner firstInstance
protected PositionPaintType type
protected Document document
private float maxLeafWidth
protected float rescalingFactorX
Constructor Detail |
---|
protected RectangularCladogramPositioner()
Method Detail |
---|
public static RectangularCladogramPositioner getInstance()
private DistanceDimension calculateTextDimension(TextElement textElement)
text
- the text of the element which dimensions shall be calculatedformats
- the text formats of the element
private DistanceDimension calculateTaxonDimension(Node taxon)
private void calculateLabelBlockDimensions(Labels labels, boolean above)
private float labelLineHeight(Labels labels, boolean above, int lineNo)
private float labelBlockHeight(Labels labels, boolean above)
private float labelLineWidth(Labels labels, boolean above, int lineNo)
private float labelBlockWidth(Labels labels)
private float calculateWidthsHeights(Node root)
private void positionLabelBlockX(Branch branch, boolean above)
private void positionLabelBlockY(Branch branch)
protected float calculateCornerRadiusShift(Node node, float y)
node
- y
- the absolute y position (not relative to the top of the node)
private float positionElements(Node root, float overallWidth, float y0)
root
- the root of the subtree to positionoverallWidth
- y0
- the start of the subtree on y
protected void calculatePaintDimension(float overallWidth, float overallHeight)
protected float rescaleNodeWidth(Node node, float width)
node
- the node to be rescaledwidth
- the old width of the node in millimeters
protected float rescaleBranchWidth(Branch branch, float width)
branch
- the branch to be rescaledwidth
- the old width of the branch in millimeters
private float rescaleSubtree(Node root, float shift)
root
- shift
-
private float getLegendStartX(LegendFormats f, float treeRight)
private float alignToOtherLegends(Legends legends, int start, int end, float minLeft, float top, float bottom)
private float getLegendTop(LegendFormats f)
private float getLegendBottom(LegendFormats f)
private float positionLegends(float startX)
startX
.
startX
- the left border of the legends sector in the document
private float positionScaleBar(float treeWidth, float maxTreeY)
treeWidth
- the width of the tree positioned abovemaxTreeY
- the end of the tree positioned above on y
private void movePosition(PositionData pd, float dX, float dY)
private void moveLabels(Labels labels, boolean above, float dX, float dY)
private void moveSubtree(Node root, float dX, float dY)
private void moveAll(float dX, float dY)
private float moveForLegends()
public void positionAll(Document document, float rescalingFactorX)
positionAll
in interface TreePositioner
private ConcretePaintableElement searchLabelBlock(Branch branch, float x, float y, float margin)
protected boolean xToHigh(float x, PositionData pd)
private ConcretePaintableElement searchElementToPosition(Node root, float x, float y, float margin)
public ConcretePaintableElement elementToPosition(Document document, float x, float y, float margin)
elementToPosition
in interface TreePositioner
document
- the document where the position should be dertermined.x
- the x-position in mmy
- the y-position in mm
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |