1
package figtree.treeviewer.treelayouts;
3
import jebl.evolution.trees.RootedTree;
6
import java.awt.geom.Point2D;
9
* @author Andrew Rambaut
10
* @version $Id: TreeLayout.java 819 2007-10-22 14:42:58Z rambaut $
12
public interface TreeLayout {
14
public enum AxisType {
19
void layout(RootedTree tree, TreeLayoutCache cache);
22
* Add a listener for this layout
26
void addTreeLayoutListener(TreeLayoutListener listener);
29
* Remove a listener from this layout
33
void removeTreeLayoutListener(TreeLayoutListener listener);
36
* Return whether the x axis is continuous or discrete
38
* @return the axis type
40
AxisType getXAxisType();
43
* Return whether the y axis is continuous or discrete
45
* @return the axis type
47
AxisType getYAxisType();
50
* Return whether this layout displays a root branch
51
* @return showing root branch?
53
boolean isShowingRootBranch();
55
double getRootLength();
57
void setRootLength(double rootLength);
59
boolean isAxisReversed();
61
void setAxisReversed(final boolean axisReversed);
65
* Return whether this layout is showing a branch colouring
66
* @return showing colouring?
68
boolean isShowingColouring();
70
void setFishEye(double fishEye);
72
void setPointOfInterest(double x, double y);
75
* Return whether the two axis scales should be maintained
76
* relative to each other
80
boolean maintainAspectRatio();
82
double getHeightOfPoint(Point2D point);
85
* Return a line that defines a particular height. Some layouts
86
* won't be able to produce this and may throw an UnsupportedOperationException.
91
Shape getAxisLine(double height);
94
* Return a shape that defines a particular height interval. Some layouts
95
* won't be able to produce this and may throw an UnsupportedOperationException.
101
Shape getHeightArea(double height1, double height2);
103
String getBranchColouringAttributeName();
105
void setBranchColouringAttributeName(String colouringAttributeName);
107
String getCartoonAttributeName();
109
void setCartoonAttributeName(String cartoonAttributeName);
111
String getCollapsedAttributeName();
113
void setCollapsedAttributeName(String collapsedAttributeName);
115
String getHilightAttributeName();
117
void setHilightAttributeName(String hilightAttributeName);