TreeElement<E> implements a generalized tree element in BRIDGES and is inherited from Element<E>



How does the TreeElement<E> work?

TreeElement<E> is a superclass for tree structures and can represent tree structures with arbitrary number of children at each node. The top node of the tree is referred to as the "root".



In the example above, root node has 3 children, while its children has 2, 1 and 0 children respectively. The childrent of a node is accessed by by set/getChild() methods, with an index k, referring to its k'th child.


See also

This tutorial gives an introduction to the usage of trees. You can find the complete documentation of the features in the Doxygen documentation of the following classes and functions:

  1. TreeElement [Java] [C++] [Python]
  2. Element [Java] [C++] [Python]
  3. ElementVisualizer [Java] [C++] [Python]
  4. LinkVisualizer [Java] [C++] [Python]
  5. Color [Java] [C++] [Python]

TreeElement - BRIDGES Example

Example Details

Here is a basic example code

Java
C++
Python
	  
	  
	  

Bridges Visualization

Styling trees in BRIDGES

You can style the nodes of the trees, and and links of trees in BRIDGES. This uses the ElementVisualizer and the LinkVisualizer classes. These classes enable you to set the color, size, and labels on the nodes and links of the tree.

Here is the same example with some visual attributes set.

Here is the final code:

Java
C++
Python
	  
	  
	  

Bridges Visualization

Well done! You’ve just created your Bridges Tree project!