public class TreeFigure
extends java.lang.Object
Constructor and Description |
---|
TreeFigure(Tree t)
Constructor
|
Modifier and Type | Method and Description |
---|---|
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 colour of branches.
|
void |
setLeafColor(java.util.Map<java.lang.String,java.lang.String> colors)
Sets the colour 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 colour of the root branch.
|
void |
setVerticalSpacing(int spacing)
Sets the spacing (in co-ordinate terms) between the horizontal lines
|
public TreeFigure(Tree t) throws TreeException
t
- The tree to visualiseTreeException
- If the tree does not have branch lengthspublic void setBranchColors(java.util.Map<Branch,java.lang.String> colors)
colors
- Map from branch to colourpublic void setLeafColor(java.util.Map<java.lang.String,java.lang.String> colors)
colors
- Map from leaf name to colour. Colours should be defined as
in a SVG file.public void setRootBranchColor(java.lang.String color)
color
- The colour of the branch. Colour 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 outputjava.io.IOException
- Thrown if there is a problem writing the fileTreeException
- Thrown if there is a problem with the tree