This pages gives a short description on how TreeGraph 2 is implemented. A detailed description of all packages and classes can be found in the Javadoc.
All classes of TreeGraph 2 are contained in the info.bioinfweb.treegraph package, which also contains its main class (info.bioinfweb.treegraph.Main). The application is divided into the following main subpackages:
undo-package to manipulate the data structure and classes to read and write a document from and to different formats (
A TreeGraph 2 document is represented by the Document class which acts as the model in the MVC paradigm used in the implementation. Each instance of Document owns a Tree objects which owns and manages the actual classes representing the single document elements.
A Tree objects contains the paintStart pointer which points at a Node object representing the root node of the document. (Unrooted documents are also represented rooted internally but the afferent branch of the root node is not painted. See here for details.) Each Node object can be linked to several subnodes with a composition, which represents the topology of a tree document. Branches that link nodes are modeled as objects owned by the Node object they lead to. The branches on the other hand own a list of labels. Both nodes and branches own a HiddenDataMap object that stores the hidden node or branch data.
All document elements (which are painted with Graphics2D to represent the tree) implement PaintableElement. Depending on their character they additionally implement...
Note that some elements (e.g. legends) can be both text and line elements.