jebl.gui.trees.treeviewer.treelayouts
Class AbstractTreeLayout

java.lang.Object
  extended by jebl.gui.trees.treeviewer.treelayouts.AbstractTreeLayout
All Implemented Interfaces:
TreeLayout, ControlsProvider
Direct Known Subclasses:
PolarTreeLayout, RadialTreeLayout, RectilinearTreeLayout

public abstract class AbstractTreeLayout
extends Object
implements TreeLayout

Author:
Andrew Rambaut

Nested Class Summary
 
Nested classes/interfaces inherited from interface jebl.gui.trees.treeviewer.treelayouts.TreeLayout
TreeLayout.AxisType
 
Field Summary
protected  Map<Node,Line2D> branchLabelPaths
           
protected  Map<Node,Shape> branchPaths
           
protected  Map<Node,Shape> calloutPaths
           
protected  Map<Node,Line2D> nodeLabelPaths
           
protected  Map<Node,Point2D> nodePoints
           
protected  Map<Node,Line2D> taxonLabelPaths
           
protected  RootedTree tree
           
 
Constructor Summary
AbstractTreeLayout()
           
 
Method Summary
 void addTreeLayoutListener(TreeLayoutListener listener)
          Add a listener for this layout
protected  void fireTreeLayoutChanged()
           
 Line2D getBranchLabelPath(Node node)
           
 Shape getBranchPath(Node node)
          Return the shape that represents the given branch
 Shape getCalloutPath(Node node)
           
 Line2D getNodeLabelPath(Node node)
           
 Point2D getNodePoint(Node node)
          Return the point in 2d space of the given node
 Line2D getTaxonLabelPath(Node node)
           
 void invalidate()
          Force the layout to re-layout all its components
 void removeTreeLayoutListener(TreeLayoutListener listener)
          Remove a listener from this layout
 void setTree(Tree tree)
          Set the tree for the layout0
protected abstract  void validate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jebl.gui.trees.treeviewer.treelayouts.TreeLayout
getHeightArea, getHeightLine, getHeightOfPoint, getXAxisType, getYAxisType, maintainAspectRatio
 
Methods inherited from interface org.virion.jam.controlpanels.ControlsProvider
getControls, getSettings, setControlPalette, setSettings
 

Field Detail

tree

protected RootedTree tree

nodePoints

protected Map<Node,Point2D> nodePoints

branchPaths

protected Map<Node,Shape> branchPaths

taxonLabelPaths

protected Map<Node,Line2D> taxonLabelPaths

branchLabelPaths

protected Map<Node,Line2D> branchLabelPaths

nodeLabelPaths

protected Map<Node,Line2D> nodeLabelPaths

calloutPaths

protected Map<Node,Shape> calloutPaths
Constructor Detail

AbstractTreeLayout

public AbstractTreeLayout()
Method Detail

setTree

public void setTree(Tree tree)
Description copied from interface: TreeLayout
Set the tree for the layout0

Specified by:
setTree in interface TreeLayout

invalidate

public void invalidate()
Description copied from interface: TreeLayout
Force the layout to re-layout all its components

Specified by:
invalidate in interface TreeLayout

getNodePoint

public Point2D getNodePoint(Node node)
Description copied from interface: TreeLayout
Return the point in 2d space of the given node

Specified by:
getNodePoint in interface TreeLayout
Returns:
the point

getBranchPath

public Shape getBranchPath(Node node)
Description copied from interface: TreeLayout
Return the shape that represents the given branch

Specified by:
getBranchPath in interface TreeLayout
Returns:
the branch shape

getTaxonLabelPath

public Line2D getTaxonLabelPath(Node node)
Specified by:
getTaxonLabelPath in interface TreeLayout

getBranchLabelPath

public Line2D getBranchLabelPath(Node node)
Specified by:
getBranchLabelPath in interface TreeLayout

getNodeLabelPath

public Line2D getNodeLabelPath(Node node)
Specified by:
getNodeLabelPath in interface TreeLayout

getCalloutPath

public Shape getCalloutPath(Node node)
Specified by:
getCalloutPath in interface TreeLayout

addTreeLayoutListener

public void addTreeLayoutListener(TreeLayoutListener listener)
Description copied from interface: TreeLayout
Add a listener for this layout

Specified by:
addTreeLayoutListener in interface TreeLayout

removeTreeLayoutListener

public void removeTreeLayoutListener(TreeLayoutListener listener)
Description copied from interface: TreeLayout
Remove a listener from this layout

Specified by:
removeTreeLayoutListener in interface TreeLayout

fireTreeLayoutChanged

protected void fireTreeLayoutChanged()

validate

protected abstract void validate()