Documentation of 'edu.rit.compbio.phyl.TreeDrawing' Java class
TreeDrawing
edu.rit.compbio.phyl

Class TreeDrawing



  • public class TreeDrawing
    extends java.lang.Object
    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

      Nested Classes 
      Modifier and Type Class and Description
      static class  TreeDrawing.SyntaxException
      Class TreeDrawing.SyntaxException is an exception thrown if there was a syntax error in a tree string.
    • Constructor Summary

      Constructors 
      Constructor and Description
      TreeDrawing()
      Construct a new tree drawing object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      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(java.lang.String tree)
      Draw a picture of the given tree string.
      void draw(java.lang.String tree, Drawing dwg)
      Draw a picture of the given tree string.
      void draw(java.lang.String tree, Group group)
      Draw a picture of the given tree string.
      void setBranchLengthFormat(java.lang.String format)
      Specify the format with which to draw branch lengths.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TreeDrawing

        public TreeDrawing()
        Construct a new tree drawing object.
    • Method Detail

      • setBranchLengthFormat

        public void setBranchLengthFormat(java.lang.String format)
        Specify the format with which to draw branch lengths. The format string is used to construct a java.text.DecimalFormat object. If not specified, the default format string is "0.00".
        Parameters:
        format - Format string.
      • draw

        public void draw(DnaSequenceTree tree)
        Draw a picture of the given tree. The picture is added to the default Drawing object.
        Parameters:
        tree - DNA sequence tree.
      • draw

        public void draw(DnaSequenceTree tree,
                         Drawing dwg)
        Draw a picture of the given tree. The picture is added to the given Drawing object.
        Parameters:
        tree - DNA sequence tree.
        dwg - Drawing object.
      • draw

        public void draw(DnaSequenceTree tree,
                         Group group)
        Draw a picture of the given tree. The picture is added to the given Group object.
        Parameters:
        tree - DNA sequence tree.
        group - Drawing group object.
      • draw

        public void draw(java.lang.String tree)
                  throws TreeDrawing.SyntaxException
        Draw a picture of the given tree string. The picture is added to the default Drawing object.
        Parameters:
        tree - Tree as a string in Newick Standard format.
        Throws:
        TreeDrawing.SyntaxException - Thrown if there was a syntax error in tree.
      • draw

        public void draw(java.lang.String tree,
                         Drawing dwg)
                  throws TreeDrawing.SyntaxException
        Draw a picture of the given tree string. The picture is added to the given Drawing object.
        Parameters:
        tree - Tree as a string in Newick Standard format.
        dwg - Drawing object.
        Throws:
        TreeDrawing.SyntaxException - Thrown if there was a syntax error in tree.
      • draw

        public void draw(java.lang.String tree,
                         Group group)
                  throws TreeDrawing.SyntaxException
        Draw a picture of the given tree string. The picture is added to the given Group object.
        Parameters:
        tree - Tree as a string in Newick Standard format.
        group - Drawing group object.
        Throws:
        TreeDrawing.SyntaxException - Thrown if there was a syntax error in tree.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.