|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjavax.swing.tree.DefaultTreeModel
com.wordpress.tipsforjava.swing.tree.ComponentTreeModel
public class ComponentTreeModel extends DefaultTreeModel
A tree data model that reproduces the structure of a GUI to reveal the
hierarchical placement of components in containers. Also provides a
static method to facilitate adding such a hierarchy at a specified node
in an existing DefaultTreeModel.
Extends DefaultTreeModel.
| Constructor Summary | |
ComponentTreeModel(JComponent container)
Creates a new tree model with a specified |
|
ComponentTreeModel(JComponent container, boolean nested)
Creates a new tree model with a specified |
|
private ComponentTreeModel(JComponent container, DefaultMutableTreeNode root, boolean nested)
private constructor for aligning the public constructors with the static method getComponentTreeModel |
|
| Method Summary | |
|---|---|
private static void
|
addNodes(JComponent container, DefaultTreeModel model, DefaultMutableTreeNode root, boolean nested)
private method to obtain the hierarchy devolving from the root container and add nodes to the tree accordingly. |
static DefaultTreeModel
|
getComponentTreeModel(JComponent container, DefaultTreeModel model, DefaultMutableTreeNode root, boolean nested)
Invoked to create a new model or to add a |
| Methods inherited from class Object | |
|---|---|
| wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
| Constructor Detail |
|---|
public ComponentTreeModel(JComponent container)
JComponent
as the root, including nested components at all levels.
container - the JComponent to be placed at the root
of the tree
public ComponentTreeModel(JComponent container, boolean nested)
JComponent
as the root, optionally including nested components.
container - the JComponent to be placed at the root
of the treenested - true to include nested components,
false otherwise
private ComponentTreeModel(JComponent container, DefaultMutableTreeNode root, boolean nested)
| Method Detail |
|---|
private static void addNodes(JComponent container, DefaultTreeModel model, DefaultMutableTreeNode root, boolean nested)
public static DefaultTreeModel getComponentTreeModel(JComponent container, DefaultTreeModel model, DefaultMutableTreeNode root, boolean nested)
JComponent's
hierarchy to an existing DefaultTreeModel.
container - the JComponent to be placed at the root
of the tree or added at a node of an existing treemodel - a DefaultTreeModel to which the
container's GUI hierarchy will be added, or
null to create a new modelroot - the node on the model to which the containerand its
hierarchy will be added, or null for a model that has the container as
its rootnested - true to include nested components,
false otherwisemodel, or a new DefaultTreeModel
if the model parameter is null
Groovy Documentation