jebl.gui.trees.treeviewer_dev.treelayouts
Class AbstractTreeLayout

java.lang.Object
  extended by jebl.gui.trees.treeviewer_dev.treelayouts.AbstractTreeLayout
All Implemented Interfaces:
TreeLayout
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_dev.treelayouts.TreeLayout
TreeLayout.AxisType
 
Field Summary
protected  String branchColouringAttribute
           
protected  Map<Node,Line2D> branchLabelPaths
           
protected  Map<Node,Shape> branchPaths
           
protected  Map<Node,Shape> calloutPaths
           
protected  String collapseAttributeName
           
protected  Map<Node,Shape> collapsedShapes
           
protected  Map<Node,Line2D> nodeBarPaths
           
protected  Map<Node,Line2D> nodeLabelPaths
           
protected  Map<Node,Point2D> nodePoints
           
protected  boolean showingCollapsedTipLabels
           
protected  Map<Node,Line2D> tipLabelPaths
           
protected  RootedTree tree
           
 
Constructor Summary
AbstractTreeLayout()
           
 
Method Summary
 void addTreeLayoutListener(TreeLayoutListener listener)
          Add a listener for this layout
protected  void fireTreeLayoutChanged()
           
 String getBranchColouringAttribute()
           
 Line2D getBranchLabelPath(Node node)
           
 Map<Node,Line2D> getBranchLabelPathMap()
           
 Shape getBranchPath(Node node)
          Return the shape that represents the given branch
 Map<Node,Shape> getBranchPathMap()
           
 Shape getCalloutPath(Node node)
           
 Map<Node,Shape> getCalloutPathMap()
           
 String getCollapseAttributeName()
           
 Shape getCollapsedShape(Node node)
          Return the shape that represents this node when collapsed
 Map<Node,Shape> getCollapsedShapeMap()
           
 Line2D getNodeBarPath(Node node)
           
 Map<Node,Line2D> getNodeBarPathMap()
           
 Line2D getNodeLabelPath(Node node)
           
 Map<Node,Line2D> getNodeLabelPathMap()
           
 Point2D getNodePoint(Node node)
          Return the point in 2d space of the given node
 Line2D getTipLabelPath(Node node)
           
 Map<Node,Line2D> getTipLabelPathMap()
           
 void invalidate()
          Force the layout to re-layout all its components
 boolean isShowingCollapsedTipLabels()
           
 boolean isShowingColouring()
          Return whether this layout is showing a branch colouring
 void removeTreeLayoutListener(TreeLayoutListener listener)
          Remove a listener from this layout
 void setBranchColouringAttribute(String branchColouringAttribute)
           
 void setCollapseAttributeName(String collapseAttributeName)
           
 void setShowingCollapsedTipLabels(boolean showingCollapsedTipLabels)
           
 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_dev.treelayouts.TreeLayout
getHeightArea, getHeightLine, getHeightOfPoint, getXAxisType, getYAxisType, isShowingRootBranch, maintainAspectRatio
 

Field Detail

tree

protected RootedTree tree

nodePoints

protected Map<Node,Point2D> nodePoints

branchPaths

protected Map<Node,Shape> branchPaths

collapsedShapes

protected Map<Node,Shape> collapsedShapes

tipLabelPaths

protected Map<Node,Line2D> tipLabelPaths

branchLabelPaths

protected Map<Node,Line2D> branchLabelPaths

nodeLabelPaths

protected Map<Node,Line2D> nodeLabelPaths

nodeBarPaths

protected Map<Node,Line2D> nodeBarPaths

calloutPaths

protected Map<Node,Shape> calloutPaths

branchColouringAttribute

protected String branchColouringAttribute

collapseAttributeName

protected String collapseAttributeName

showingCollapsedTipLabels

protected boolean showingCollapsedTipLabels
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

getBranchPathMap

public Map<Node,Shape> getBranchPathMap()
Specified by:
getBranchPathMap in interface TreeLayout

getCollapsedShape

public Shape getCollapsedShape(Node node)
Description copied from interface: TreeLayout
Return the shape that represents this node when collapsed

Specified by:
getCollapsedShape in interface TreeLayout
Returns:
the shape

getCollapsedShapeMap

public Map<Node,Shape> getCollapsedShapeMap()
Specified by:
getCollapsedShapeMap in interface TreeLayout

getTipLabelPath

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

getTipLabelPathMap

public Map<Node,Line2D> getTipLabelPathMap()
Specified by:
getTipLabelPathMap in interface TreeLayout

getBranchLabelPath

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

getBranchLabelPathMap

public Map<Node,Line2D> getBranchLabelPathMap()
Specified by:
getBranchLabelPathMap in interface TreeLayout

getNodeLabelPath

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

getNodeLabelPathMap

public Map<Node,Line2D> getNodeLabelPathMap()
Specified by:
getNodeLabelPathMap in interface TreeLayout

getNodeBarPath

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

getNodeBarPathMap

public Map<Node,Line2D> getNodeBarPathMap()
Specified by:
getNodeBarPathMap in interface TreeLayout

getCalloutPath

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

getCalloutPathMap

public Map<Node,Shape> getCalloutPathMap()
Specified by:
getCalloutPathMap 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()

getBranchColouringAttribute

public String getBranchColouringAttribute()
Specified by:
getBranchColouringAttribute in interface TreeLayout

setBranchColouringAttribute

public void setBranchColouringAttribute(String branchColouringAttribute)
Specified by:
setBranchColouringAttribute in interface TreeLayout

isShowingColouring

public boolean isShowingColouring()
Description copied from interface: TreeLayout
Return whether this layout is showing a branch colouring

Specified by:
isShowingColouring in interface TreeLayout
Returns:
showing colouring?

getCollapseAttributeName

public String getCollapseAttributeName()

setCollapseAttributeName

public void setCollapseAttributeName(String collapseAttributeName)
Specified by:
setCollapseAttributeName in interface TreeLayout

isShowingCollapsedTipLabels

public boolean isShowingCollapsedTipLabels()

setShowingCollapsedTipLabels

public void setShowingCollapsedTipLabels(boolean showingCollapsedTipLabels)