Panel which contains the JTree representation of the XModel. The JTree is
contained within a scrollpane. The model is updated as data items are added
from the XLib editor. Whenever a component is seleted the setActiveComponents
fuction is called with a Vector of type XComponentSizer so that the data node
for the component can be selected. Double clicking a node will cause the
currently selected components data property to be set.
Copyright (c) Xoetrope Ltd., 2001-2006, This software is licensed under
the GNU Public License (GPL), please see license.txt for more details. If
you make commercial use of this software you must purchase a commercial
license from Xoetrope.
addNode(XModel model, DefaultMutableTreeNode parentNode) Create a new child node to be added to the parentNode parameter.
Parameters: model - the XModel whose name will appear in the new treenode.
public void
createTreeComp(String selected) If the tree already exists remove it from the panel.
Create a new child node to be added to the parentNode parameter.
Parameters: model - the XModel whose name will appear in the new treenode. ThisXModel's children is in turn passed to this function recursively buildingup the tree Parameters: parentNode - the tree node which is to be the parent of the newTreenode
If the tree already exists remove it from the panel. Get a reference to the
XModel base node. Contruct a new JTree and call the createTree function
with the selected parameter.
Parameters: selected - the path to the seleted XModel node
Reconstruct the tree. This is called when the model has been updated from
the editor
setActiveComponents
public void setActiveComponents(Vector comps)(Code)
Called whenever the components selection within the editor changes. We
assign the passed vector to an object variable so that we can update the
component when the tree is double clicked. First we need to cast the helper
referenced by the XComponentSizer into the relevant type depending on the
type of the selected component. We need then to find the property which
corresponds to the 'data' property. When found we call setSelectedModel
with the path to the XModel.
Parameters: comps - Vector of type XComponentSizer. We can only work on thisvector if it contains a single component.
Set the selected treenode of the datatree. If the parameter is null set the
selectionPath to null. Otherwise create a new vector of treenodes and set
the selectedpath to the vector.
Parameters: model - the XModel which we want to select