|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectTrees.TreeFigure
public class TreeFigure
Class for visualising trees. Produces a SVG file.
Note this class is still being developed. It works but may not have all
appropiate error checking nor have all needed methods been written.
I make no guarantees that future versions will have the same methods.
Constructor Summary | |
---|---|
TreeFigure(Tree t)
Constructor |
Method Summary | |
---|---|
void |
printSVG(java.io.File f,
boolean showLengths)
Prints the tree to the given file |
void |
setBranchColors(java.util.Map<Branch,java.lang.String> colors)
Sets the color of branches. |
void |
setLeafColor(java.util.Map<java.lang.String,java.lang.String> colors)
Sets the color of the leaf text. |
void |
setLeavesText(java.util.Map<java.lang.String,java.lang.String> names)
Overwrites the default leaf text (the taxa names). |
void |
setRootBranchColor(java.lang.String color)
Sets the color of the root branch. |
void |
setVerticalSpacing(int spacing)
Sets the spacing (in co-ordinate terms) between the horizontal lines |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TreeFigure(Tree t) throws TreeException
t
- The tree to visualize
TreeException
- If the tree does not have branch lengthsMethod Detail |
---|
public void setBranchColors(java.util.Map<Branch,java.lang.String> colors)
colors
- Map from branch to colorpublic void setLeafColor(java.util.Map<java.lang.String,java.lang.String> colors)
colors
- Map from leaf name to color. Colors should be defined as
in a SVG file.public void setRootBranchColor(java.lang.String color)
color
- The color of the branch. Color should be defined as
in a SVG file.public void setLeavesText(java.util.Map<java.lang.String,java.lang.String> names)
names
- Map from taxa name to string where the string is the new text
for each leaf. Should include new text for every leaf.public void setVerticalSpacing(int spacing)
spacing
- The spacing to usepublic void printSVG(java.io.File f, boolean showLengths) throws java.io.IOException, TreeException
f
- The file to print toshowLengths
- Display branch lengths on output
java.io.IOException
- Thrown if there is a problem writing the file
TreeException
- Thrown if there is a problem with the tree
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |