~ubuntu-branches/ubuntu/utopic/figtree/utopic

« back to all changes in this revision

Viewing changes to src/figtree/treeviewer/treelayouts/TreeLayout.java

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Tille
  • Date: 2011-02-21 08:17:38 UTC
  • Revision ID: james.westby@ubuntu.com-20110221081738-80pe2ulo8rg7up10
Tags: upstream-1.3.1
ImportĀ upstreamĀ versionĀ 1.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package figtree.treeviewer.treelayouts;
 
2
 
 
3
import jebl.evolution.trees.RootedTree;
 
4
 
 
5
import java.awt.*;
 
6
import java.awt.geom.Point2D;
 
7
 
 
8
/**
 
9
 * @author Andrew Rambaut
 
10
 * @version $Id: TreeLayout.java 819 2007-10-22 14:42:58Z rambaut $
 
11
 */
 
12
public interface TreeLayout {
 
13
 
 
14
    public enum AxisType {
 
15
        CONTINUOUS,
 
16
        DISCRETE
 
17
    }
 
18
 
 
19
    void layout(RootedTree tree, TreeLayoutCache cache);
 
20
 
 
21
    /**
 
22
     * Add a listener for this layout
 
23
     *
 
24
     * @param listener
 
25
     */
 
26
    void addTreeLayoutListener(TreeLayoutListener listener);
 
27
 
 
28
    /**
 
29
     * Remove a listener from this layout
 
30
     *
 
31
     * @param listener
 
32
     */
 
33
    void removeTreeLayoutListener(TreeLayoutListener listener);
 
34
 
 
35
    /**
 
36
     * Return whether the x axis is continuous or discrete
 
37
     *
 
38
     * @return the axis type
 
39
     */
 
40
    AxisType getXAxisType();
 
41
 
 
42
    /**
 
43
     * Return whether the y axis is continuous or discrete
 
44
     *
 
45
     * @return the axis type
 
46
     */
 
47
    AxisType getYAxisType();
 
48
 
 
49
    /**
 
50
     * Return whether this layout displays a root branch
 
51
     * @return showing root branch?
 
52
     */
 
53
    boolean isShowingRootBranch();
 
54
 
 
55
    double getRootLength();
 
56
 
 
57
    void setRootLength(double rootLength);
 
58
 
 
59
    boolean isAxisReversed();
 
60
 
 
61
    void setAxisReversed(final boolean axisReversed);
 
62
 
 
63
 
 
64
    /**
 
65
     * Return whether this layout is showing a branch colouring
 
66
     * @return showing colouring?
 
67
     */
 
68
    boolean isShowingColouring();
 
69
 
 
70
    void setFishEye(double fishEye);
 
71
 
 
72
    void setPointOfInterest(double x, double y);
 
73
 
 
74
    /**
 
75
     * Return whether the two axis scales should be maintained
 
76
     * relative to each other
 
77
     *
 
78
     * @return a boolean
 
79
     */
 
80
    boolean maintainAspectRatio();
 
81
 
 
82
    double getHeightOfPoint(Point2D point);
 
83
 
 
84
    /**
 
85
     * Return a line that defines a particular height. Some layouts
 
86
     * won't be able to produce this and may throw an UnsupportedOperationException.
 
87
     *
 
88
     * @param height
 
89
     * @return the line
 
90
     */
 
91
    Shape getAxisLine(double height);
 
92
 
 
93
    /**
 
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.
 
96
     *
 
97
     * @param height1
 
98
     * @param height2
 
99
     * @return the area
 
100
     */
 
101
    Shape getHeightArea(double height1, double height2);
 
102
 
 
103
    String getBranchColouringAttributeName();
 
104
 
 
105
    void setBranchColouringAttributeName(String colouringAttributeName);
 
106
 
 
107
    String getCartoonAttributeName();
 
108
 
 
109
    void setCartoonAttributeName(String cartoonAttributeName);
 
110
 
 
111
    String getCollapsedAttributeName();
 
112
 
 
113
    void setCollapsedAttributeName(String collapsedAttributeName);
 
114
 
 
115
    String getHilightAttributeName();
 
116
 
 
117
    void setHilightAttributeName(String hilightAttributeName);
 
118
}