AccordionTreeDrawer
Class TreeEdge

java.lang.Object
  |
  +--AccordionTreeDrawer.TreeEdge
All Implemented Interfaces:
CellGeom

public class TreeEdge
extends java.lang.Object
implements CellGeom

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

Version:
Author:
Tamara Munzner, Serdar Tasiran, Li Zhang, Yunhong Zhou
See Also:
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
 TreeNode node
           
 GridCell start
          The GridCell that one endpoint (the "start" node) of the TreeEdge is attached to
 
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).
 GridCell getCell()
           
 AccordionTreeDrawer getDrawer()
           
 int getKey()
           
 int getMax()
           
 int getMin()
           
 java.lang.String getName()
           
 int[] getXInterval()
           
 int[] getYInterval()
           
 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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

node

public TreeNode node

start

public GridCell start
The GridCell that one endpoint (the "start" node) of the TreeEdge is attached to


end

public GridCell end
The GridCell the other endpoint (the "end" node) of the TreeEdge is attached to


encloses

public GridCell encloses
The GridCell that this TreeEdge is attached to


horiz

public boolean horiz
Whether this TreeEdge is horizontal

Constructor Detail

TreeEdge

public TreeEdge(TreeNode n,
                GridCell startCell,
                GridCell endCell)
Method Detail

getDrawer

public AccordionTreeDrawer getDrawer()

close

public void close()
clean the tree edge

See Also:
TreeNode.close

getKey

public int getKey()
Specified by:
getKey in interface CellGeom

getName

public java.lang.String getName()
Specified by:
getName in interface CellGeom

setCell

public void setCell(GridCell gc)
Specified by:
setCell in interface CellGeom

getCell

public GridCell getCell()
Specified by:
getCell in interface CellGeom

getMin

public int getMin()
Specified by:
getMin in interface CellGeom

getMax

public int getMax()
Specified by:
getMax in interface CellGeom

setLabel

public void setLabel(java.lang.String label)

getXInterval

public int[] getXInterval()

getYInterval

public int[] getYInterval()

drawInCell

public 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. Find font size to use for drawing the label, by checking for occlusions. Don't draw it all if it's occluded even at the smallest size.

Specified by:
drawInCell in interface CellGeom
Parameters:
col - The color to draw this node in
plane - Z depth at which to draw label
See Also:
GridCell

drawLabelBig

public void drawLabelBig(int x,
                         int y)
Draw label of this TreeEdge at maximum size (intended for mouseover highlighting).


pick

public 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.

Specified by:
pick in interface CellGeom
See Also:
GridCell, AccordionDrawer.AccordionTreeDrawer