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

« back to all changes in this revision

Viewing changes to src/figtree/treeviewer/treelayouts/AbstractTreeLayout.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 java.util.HashSet;
 
4
import java.util.Set;
 
5
 
 
6
/**
 
7
 * @author Andrew Rambaut
 
8
 * @version $Id: AbstractTreeLayout.java 819 2007-10-22 14:42:58Z rambaut $
 
9
 */
 
10
public abstract class AbstractTreeLayout implements TreeLayout {
 
11
        private double rootLength = 0.0;
 
12
    private boolean isAxisReversed;
 
13
 
 
14
    public boolean isAxisReversed() {
 
15
        return isAxisReversed;
 
16
    }
 
17
 
 
18
    public void setAxisReversed(final boolean axisReversed) {
 
19
        isAxisReversed = axisReversed;
 
20
    }
 
21
 
 
22
    public double getRootLength() {
 
23
                return rootLength;
 
24
        }
 
25
 
 
26
        public void setRootLength(double rootLength) {
 
27
                this.rootLength = rootLength;
 
28
                fireTreeLayoutChanged();
 
29
        }
 
30
 
 
31
        public void addTreeLayoutListener(TreeLayoutListener listener) {
 
32
        listeners.add(listener);
 
33
    }
 
34
 
 
35
    public void removeTreeLayoutListener(TreeLayoutListener listener) {
 
36
        listeners.remove(listener);
 
37
    }
 
38
 
 
39
        protected void fireTreeLayoutChanged() {
 
40
        for (TreeLayoutListener listener : listeners) {
 
41
            listener.treeLayoutChanged();
 
42
        }
 
43
    }
 
44
 
 
45
    public String getBranchColouringAttributeName() {
 
46
        return branchColouringAttribute;
 
47
    }
 
48
 
 
49
    public void setBranchColouringAttributeName(String branchColouringAttribute) {
 
50
        this.branchColouringAttribute = branchColouringAttribute;
 
51
        fireTreeLayoutChanged();
 
52
    }
 
53
 
 
54
    public String getCartoonAttributeName() {
 
55
        return cartoonAttributeName;
 
56
    }
 
57
 
 
58
    public void setCartoonAttributeName(String cartoonAttributeName) {
 
59
        this.cartoonAttributeName = cartoonAttributeName;
 
60
        fireTreeLayoutChanged();
 
61
    }
 
62
 
 
63
    public boolean isShowingCartoonTipLabels() {
 
64
        return showingCartoonTipLabels;
 
65
    }
 
66
 
 
67
    public void setShowingCartoonTipLabels(boolean showingCartoonTipLabels) {
 
68
        this.showingCartoonTipLabels = showingCartoonTipLabels;
 
69
        fireTreeLayoutChanged();
 
70
    }
 
71
 
 
72
        public String getCollapsedAttributeName() {
 
73
                return collapsedAttributeName;
 
74
        }
 
75
 
 
76
        public void setCollapsedAttributeName(String collapsedAttributeName) {
 
77
                this.collapsedAttributeName = collapsedAttributeName;
 
78
                fireTreeLayoutChanged();
 
79
        }
 
80
 
 
81
        public String getHilightAttributeName() {
 
82
                return hilightAttributeName;
 
83
        }
 
84
 
 
85
        public void setHilightAttributeName(String hilightAttributeName) {
 
86
                this.hilightAttributeName = hilightAttributeName;
 
87
                fireTreeLayoutChanged();
 
88
        }
 
89
 
 
90
    private Set<TreeLayoutListener> listeners = new HashSet<TreeLayoutListener>();
 
91
    protected String branchColouringAttribute = null;
 
92
    protected String cartoonAttributeName = null;
 
93
    protected boolean showingCartoonTipLabels = true;
 
94
 
 
95
        protected String collapsedAttributeName = null;
 
96
 
 
97
        protected String hilightAttributeName = null;
 
98
}