1
package figtree.treeviewer.treelayouts;
3
import java.util.HashSet;
7
* @author Andrew Rambaut
8
* @version $Id: AbstractTreeLayout.java 819 2007-10-22 14:42:58Z rambaut $
10
public abstract class AbstractTreeLayout implements TreeLayout {
11
private double rootLength = 0.0;
12
private boolean isAxisReversed;
14
public boolean isAxisReversed() {
15
return isAxisReversed;
18
public void setAxisReversed(final boolean axisReversed) {
19
isAxisReversed = axisReversed;
22
public double getRootLength() {
26
public void setRootLength(double rootLength) {
27
this.rootLength = rootLength;
28
fireTreeLayoutChanged();
31
public void addTreeLayoutListener(TreeLayoutListener listener) {
32
listeners.add(listener);
35
public void removeTreeLayoutListener(TreeLayoutListener listener) {
36
listeners.remove(listener);
39
protected void fireTreeLayoutChanged() {
40
for (TreeLayoutListener listener : listeners) {
41
listener.treeLayoutChanged();
45
public String getBranchColouringAttributeName() {
46
return branchColouringAttribute;
49
public void setBranchColouringAttributeName(String branchColouringAttribute) {
50
this.branchColouringAttribute = branchColouringAttribute;
51
fireTreeLayoutChanged();
54
public String getCartoonAttributeName() {
55
return cartoonAttributeName;
58
public void setCartoonAttributeName(String cartoonAttributeName) {
59
this.cartoonAttributeName = cartoonAttributeName;
60
fireTreeLayoutChanged();
63
public boolean isShowingCartoonTipLabels() {
64
return showingCartoonTipLabels;
67
public void setShowingCartoonTipLabels(boolean showingCartoonTipLabels) {
68
this.showingCartoonTipLabels = showingCartoonTipLabels;
69
fireTreeLayoutChanged();
72
public String getCollapsedAttributeName() {
73
return collapsedAttributeName;
76
public void setCollapsedAttributeName(String collapsedAttributeName) {
77
this.collapsedAttributeName = collapsedAttributeName;
78
fireTreeLayoutChanged();
81
public String getHilightAttributeName() {
82
return hilightAttributeName;
85
public void setHilightAttributeName(String hilightAttributeName) {
86
this.hilightAttributeName = hilightAttributeName;
87
fireTreeLayoutChanged();
90
private Set<TreeLayoutListener> listeners = new HashSet<TreeLayoutListener>();
91
protected String branchColouringAttribute = null;
92
protected String cartoonAttributeName = null;
93
protected boolean showingCartoonTipLabels = true;
95
protected String collapsedAttributeName = null;
97
protected String hilightAttributeName = null;