jebl.gui.trees.treeviewer_dev.treelayouts
Class AbstractTreeLayout
java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
AbstractTreeLayout
public AbstractTreeLayout()
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)