The Tree Model example

The Tree Model example displays the contents of a Swing JTree object as a graph. The nodes of the graph are the items in the tree (also called tree nodes), and the links of the graph represent the parent-child relationships between the items., see the following figure.
Diagram
of the tree model demo. The JTree node at the center of the diagram
has links to the colors, food, and sports nodes. These nodes branch
out as follows: sports to football, basketbqll, soccer, and hockey;
food to bananas, pizza, hot dogs, and ravioli; and colors to red,
blue, violet, and yellow.
The Tree Model example: Swing JTree
This example uses the base class IlvAbstractSDMModel and implements nodes and links using the IlvSDMNode and IlvSDMLink interfaces, for the following reasons:
  • The nodes to be represented (the tree nodes) are existing Java™ objects, but they are not JavaBeans™ .
  • The links do not exist as Java objects; you need to create them.
The example is supplied with Rogue Wave® JViews Diagrammer in the directory <installdir>/jviews-diagrammer89/codefragments/datamodel/treemodel .