exe
Class GAIGSphylogenetic_forest

java.lang.Object
  extended by exe.GAIGSphylogenetic_forest
All Implemented Interfaces:
GAIGSdatastr

public class GAIGSphylogenetic_forest
extends java.lang.Object
implements GAIGSdatastr

GAIGSphylogenetic_forest.java provides an GAIGS-renderable data structure for a forest of GAIGSphylogenetic trees. Essentially the forest is a vector of such trees with the layout of individual trees scattered semi-intelligently via setting the bounds of the individual trees.

Version:
10/20/2007
Author:
Tom Naps

Field Summary
protected  double font_size
          Holds the minimum font size for this forest when drawn in the new GAIGS XML format.
 
Fields inherited from interface exe.GAIGSdatastr
DEFAULT_COLOR, DEFAULT_FONT_SIZE, DEFAULT_NAME, DEFAULT_X1, DEFAULT_X2, DEFAULT_Y1, DEFAULT_Y2
 
Constructor Summary
GAIGSphylogenetic_forest()
          Construct a forest using all the default values.
GAIGSphylogenetic_forest(java.lang.String name, java.lang.String color, double x1, double y1, double x2, double y2, double fontSize)
          Set all instance variables.
 
Method Summary
 boolean addElement(GAIGSphylogenetic_tree t)
           
 void colorRoot(int treeIndex, java.lang.String color)
           
 GAIGSphylogenetic_tree elementAt(int index)
           
 java.lang.String getName()
          Get the value of the name.
 void prepareForRefinedTrees()
           
 boolean remove(GAIGSphylogenetic_tree t)
           
 void setBounds(double x1, double y1, double x2, double y2)
          Sets the bounds in which this forest is to be drawn.
 void setFontSize(double size)
          Sets the minimum font size to keep the fonts in this GAIGSphylogenetic_forest readable.
 void setLeaves(int leafCount)
           
 void setName(java.lang.String name)
          Set the value of the name to be displayed.
 void setTreeBounds()
          x/y gaps not right.
 java.lang.String toXML()
          Creates and returns GAIGS XML code for the current state of the forest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

font_size

protected double font_size
Holds the minimum font size for this forest when drawn in the new GAIGS XML format. Used to specify a font size that will be readable when this the forest is drawn in a smaller portion of the screen.

Constructor Detail

GAIGSphylogenetic_forest

public GAIGSphylogenetic_forest()
Construct a forest using all the default values.


GAIGSphylogenetic_forest

public GAIGSphylogenetic_forest(java.lang.String name,
                                java.lang.String color,
                                double x1,
                                double y1,
                                double x2,
                                double y2,
                                double fontSize)
Set all instance variables.

Parameters:
name - Display name of this structure.
color - Color for items unless locally overridden.
x1 - Left display bound.
y1 - Bottom display bound.
x2 - Top display bound.
y2 - Right display bound.
fontSize - Font size for display.
Method Detail

setLeaves

public void setLeaves(int leafCount)

setName

public void setName(java.lang.String name)
Set the value of the name to be displayed.

Specified by:
setName in interface GAIGSdatastr
Parameters:
name - The display name.

getName

public java.lang.String getName()
Get the value of the name.

Specified by:
getName in interface GAIGSdatastr
Returns:
The display name.

setBounds

public void setBounds(double x1,
                      double y1,
                      double x2,
                      double y2)
Sets the bounds in which this forest is to be drawn. These bounds specify the area within the normalized [0,1] space within which this forest should appear in the snapshot. Used to draw this forest in a portion of the viewing window so that multiple structures can appear in a snapshot in the new GAIGS XML format.

Parameters:
x1 - Sets the left-most bound on the horizontal axis.
y1 - Sets the lower bound on the vertical axis.
x2 - Sets the right-most bound on the horizontal axis.
y2 - Sets the upper bound on the vertical axis.

setFontSize

public void setFontSize(double size)
Sets the minimum font size to keep the fonts in this GAIGSphylogenetic_forest readable. Used to upsize the font when drawing this GAIGSphylogenetic_forest in a portion of the viewing window in the new GAIGS XML format.

Parameters:
size - Indicates the minimum font size for the fonts in this GAIGSphylogenetic_forest.

remove

public boolean remove(GAIGSphylogenetic_tree t)
Parameters:
t - a tree to be removed from the forest
Returns:
true if t could be removed, false otherwise

addElement

public boolean addElement(GAIGSphylogenetic_tree t)
Parameters:
t - a tree to be added to the forest. Since the forest is a vector of trees, the addition of t to the forest will occur as the last element of the underlying vector.
Returns:
true if t could be added, false otherwise

elementAt

public GAIGSphylogenetic_tree elementAt(int index)
Parameters:
index - an index in the underlying vector of phylogenetic trees
Returns:
the tree at that index

setTreeBounds

public void setTreeBounds()
x/y gaps not right. x gap is gap between each node. -uses the total leaves. y gap scales y values for trees to prevent vertical skewing. cl


colorRoot

public void colorRoot(int treeIndex,
                      java.lang.String color)

prepareForRefinedTrees

public void prepareForRefinedTrees()

toXML

public java.lang.String toXML()
Creates and returns GAIGS XML code for the current state of the forest

Specified by:
toXML in interface GAIGSdatastr
Returns:
A String containing GAIGS XML code for the tree