|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--AccordionTreeDrawer.TreeEdge
A class representing an edge of a (phylognenetic) tree A TreeEdge represents a horizontal or vertical line segment used in drawing a tree.
a--- firstChild
|
|
--- .
n | .
o---|c .
d ---
e |
|
b--- lastChild
In this figure (node,c), (a,b), (firstChild,a) and (lastChild,b) are line segments
Each of them is represented by a TreeEdge
(node,c) corresponds to a horizontal TreeEdge associated with TreeNode node
(a,b) corresponds to a vertical TreeEdge associated with TreeNode node
AccordionDrawer.Tree,
AccordionDrawer.TreeNode,
GridCell| Field Summary | |
GridCell |
encloses
The GridCell that this TreeEdge is attached to |
GridCell |
end
The GridCell the other endpoint (the "end" node) of the TreeEdge is attached to |
boolean |
horiz
Whether this TreeEdge is horizontal |
private java.lang.String |
label
|
private LabelBox |
lb
|
TreeNode |
node
|
(package private) float[] |
posEnd
|
(package private) float[] |
posStart
The starting and ending points of an edge. |
GridCell |
start
The GridCell that one endpoint (the "start" node) of the TreeEdge is attached to |
(package private) int[] |
xInterval
|
(package private) int[] |
yInterval
|
| Constructor Summary | |
TreeEdge(TreeNode n,
GridCell startCell,
GridCell endCell)
|
|
| Method Summary | |
void |
close()
clean the tree edge |
void |
drawInCell(java.awt.Color col,
float plane,
AccordionDrawer d)
Draws this TreeEdge inside the GridCell to which it is attached, and its label if appropriate. |
void |
drawLabelBig(int x,
int y)
Draw label of this TreeEdge at maximum size (intended for mouseover highlighting). |
private void |
drawLabelBox(LabelBox lb,
int fontheight,
boolean drawBig)
Draw a LabelBox. |
private void |
drawLabelBoxDown(AccordionTreeDrawer d,
gl4java.GLFunc gl,
LabelBox lb,
int fontheight,
boolean drawBig)
|
private void |
drawLabelBoxLR(AccordionTreeDrawer d,
gl4java.GLFunc gl,
LabelBox lb,
int fontheight,
boolean drawBig)
draw label box in left or right direction |
private void |
drawLabelBoxUp(AccordionTreeDrawer d,
gl4java.GLFunc gl,
LabelBox lb,
int fontheight,
boolean drawBig)
draw label box in vertical direction |
protected void |
finalize()
|
(package private) void |
findPos()
Computes the start- and end-point coordinates of this TreeEdge in window coordinates. |
GridCell |
getCell()
|
AccordionTreeDrawer |
getDrawer()
|
int |
getKey()
|
int |
getMax()
|
int |
getMin()
|
java.lang.String |
getName()
|
int[] |
getXInterval()
|
int[] |
getYInterval()
|
private boolean |
intersectLabelBox(LabelBox lb)
Occlusion check of LabelBox against array of all drawn labels. |
protected LabelBox |
makeLabelBox(int fontheight,
int x,
int y)
Create a LabelBox for the given fontheight |
private LabelBox |
makeLabelBoxDown(int fontheight,
int x,
int y)
make label box in vertical direction |
private LabelBox |
makeLabelBoxHor(int fontheight,
int x,
int y)
make label box in horizontal direction |
private LabelBox |
makeLabelBoxUp(int fontheight,
int x,
int y)
make label box in vertical direction |
boolean |
pick(int x,
int y)
Determines whether the window coordinates (x,y) fall on this TreeEdge There is a "snap" factor, determined by the pickFuzz field of the enclosing cell. |
void |
setCell(GridCell gc)
|
void |
setLabel(java.lang.String label)
|
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public TreeNode node
public GridCell start
public GridCell end
public GridCell encloses
public boolean horiz
float[] posStart
float[] posEnd
private LabelBox lb
private java.lang.String label
int[] xInterval
int[] yInterval
| Constructor Detail |
public TreeEdge(TreeNode n,
GridCell startCell,
GridCell endCell)
| Method Detail |
public AccordionTreeDrawer getDrawer()
public void close()
TreeNode.close
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwablepublic int getKey()
getKey in interface CellGeompublic java.lang.String getName()
getName in interface CellGeompublic void setCell(GridCell gc)
setCell in interface CellGeompublic GridCell getCell()
getCell in interface CellGeompublic int getMin()
getMin in interface CellGeompublic int getMax()
getMax in interface CellGeompublic void setLabel(java.lang.String label)
public int[] getXInterval()
public int[] getYInterval()
public void drawInCell(java.awt.Color col,
float plane,
AccordionDrawer d)
drawInCell in interface CellGeomcol - The color to draw this node inplane - Z depth at which to draw labelGridCell
public void drawLabelBig(int x,
int y)
protected LabelBox makeLabelBox(int fontheight,
int x,
int y)
x - horizontal base location in screen/pixel coordinatesy - vertical base location in screen/pixel coordinatesLabelBox
private LabelBox makeLabelBoxHor(int fontheight,
int x,
int y)
fontheight - x - y -
private LabelBox makeLabelBoxUp(int fontheight,
int x,
int y)
fontheight - x - y -
private LabelBox makeLabelBoxDown(int fontheight,
int x,
int y)
fontheight - x - y -
private boolean intersectLabelBox(LabelBox lb)
AccordionDrawer.drawnArray is sorted in y -
the skinny direction, to avoid work. We do a binary search to
check for occlusions, so it's log in the number of pixels (with
a very small constant).
LabelBox
private void drawLabelBox(LabelBox lb,
int fontheight,
boolean drawBig)
lb - LabelBox to usefontheight - Size of font to use, in points/pixels.drawBig - whether to draw maximum size ignoring occlusions
private void drawLabelBoxLR(AccordionTreeDrawer d,
gl4java.GLFunc gl,
LabelBox lb,
int fontheight,
boolean drawBig)
lb - fontheight - drawBig -
private void drawLabelBoxUp(AccordionTreeDrawer d,
gl4java.GLFunc gl,
LabelBox lb,
int fontheight,
boolean drawBig)
d - gl - lb - fontheight - drawBig -
private void drawLabelBoxDown(AccordionTreeDrawer d,
gl4java.GLFunc gl,
LabelBox lb,
int fontheight,
boolean drawBig)
public boolean pick(int x,
int y)
pick in interface CellGeomGridCell,
AccordionDrawer.AccordionTreeDrawervoid findPos()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||