|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rit.compbio.phyl.TreeDrawing
public class TreeDrawing
Class TreeDrawing provides an object that draws a picture of a phylogenetic tree. The tree is specified either as a DnaSequenceTree object or as a string in a subset of Newick Standard format.
Note: Class TreeDrawing is not multiple thread safe.
Newick Standard format. The subset of Newick Standard format class TreeDrawing supports is described by this BNF syntax. Nonterminal symbols are in italic font, terminal symbols are in typewriter font, | designates alternatives.
tree ::= node ;
node ::= ( childList ) nameLength
childList ::= child | child , childList
child ::= tip | node
tip ::= nameLength
nameLength ::= empty | name | : length | name : length
name ::= Any sequence of non-whitespace characters except ( ) , : ;
length ::= Floating point number, as in the Double.valueOf() method
This subset only supports non-quoted names with no whitespace; however, any underscore character _ in a name is replaced with a space character. The full Newick Standard format supports quoted names including whitespace. For further information about Newick Standard format, see:
Here is an example tree:
"(Gibbon:10,(Orangutan:8,(Gorilla:6,(Chimp:4,Human:4)))apes)primates;"
Here is the resulting drawing:
| Nested Class Summary | |
|---|---|
static class |
TreeDrawing.SyntaxException
Class TreeDrawing.SyntaxException is an exception thrown if there was a syntax error in a tree string. |
| Constructor Summary | |
|---|---|
TreeDrawing()
Construct a new tree drawing object. |
|
| Method Summary | |
|---|---|
void |
draw(DnaSequenceTree tree)
Draw a picture of the given tree. |
void |
draw(DnaSequenceTree tree,
Drawing dwg)
Draw a picture of the given tree. |
void |
draw(DnaSequenceTree tree,
Group group)
Draw a picture of the given tree. |
void |
draw(String tree)
Draw a picture of the given tree string. |
void |
draw(String tree,
Drawing dwg)
Draw a picture of the given tree string. |
void |
draw(String tree,
Group group)
Draw a picture of the given tree string. |
void |
setBranchLengthFormat(String format)
Specify the format with which to draw branch lengths. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TreeDrawing()
| Method Detail |
|---|
public void setBranchLengthFormat(String format)
format - Format string.public void draw(DnaSequenceTree tree)
tree - DNA sequence tree.
public void draw(DnaSequenceTree tree,
Drawing dwg)
tree - DNA sequence tree.dwg - Drawing object.
public void draw(DnaSequenceTree tree,
Group group)
tree - DNA sequence tree.group - Drawing group object.
public void draw(String tree)
throws TreeDrawing.SyntaxException
tree - Tree as a string in Newick Standard format.
TreeDrawing.SyntaxException - Thrown if there was a syntax error in tree.
public void draw(String tree,
Drawing dwg)
throws TreeDrawing.SyntaxException
tree - Tree as a string in Newick Standard format.dwg - Drawing object.
TreeDrawing.SyntaxException - Thrown if there was a syntax error in tree.
public void draw(String tree,
Group group)
throws TreeDrawing.SyntaxException
tree - Tree as a string in Newick Standard format.group - Drawing group object.
TreeDrawing.SyntaxException - Thrown if there was a syntax error in tree.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||