Diamond Control Suite 3.0

diamondedge.swing
Class DsTreeModel

java.lang.Object
  extended by javax.swing.tree.DefaultTreeModel
      extended by diamondedge.swing.DsTreeModel
All Implemented Interfaces:
Serializable, TreeModel

public class DsTreeModel
extends DefaultTreeModel

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.tree.DefaultTreeModel
asksAllowsChildren, listenerList, root
 
Constructor Summary
DsTreeModel(DsTreeNode root)
           
 
Method Summary
 DsTreeNode add()
           
 DsTreeNode add(DsTreeNode node, DsTreeNode relative, int relationship)
          Adds a DsTreeNode object to a Nodes collection and returns a reference to the created object.
 DsTreeNode add(DsTreeNode relative, int relationship, String key, String text, int image, int selectedImage)
           
 DsTreeNode add(DsTreeNode relative, int relationship, String key, String text, Object image, Object selectedImage)
          Adds a DsTreeNode object to a Nodes collection and returns a reference to the created object.
 DsTreeNode add(int relative, int relationship, String key, String text, int image, int selectedImage)
           
 DsTreeNode add(int relative, int relationship, String key, String text, Object image, Object selectedImage)
           
 DsTreeNode add(String text)
           
 DsTreeNode add(String text, int index)
           
 DsTreeNode add(String relative, int relationship, String key, String text, int image, int selectedImage)
           
 DsTreeNode add(String relative, int relationship, String key, String text, Object image, Object selectedImage)
           
 DsTreeNode add(String text, String key)
           
 void changeKey(String key, String newkey)
           
 void clear()
          Removes all objects in a collection.
 int getCount()
          Returns the number of objects in a collection.
 int getIndent(int nodeIndex)
           
 int getIndex(String key)
           
 DsTreeNode getNode(int index)
          Returns a specific DsTreeNode in the Collection by position.
 DsTreeNode getNode(String key)
          Returns a specific DsTreeNode in the Collection by key.
 DsTreeNode getRootNode()
          Returns a reference to the root DsTreeNode object of a DsTree control.
 boolean isLeaf(Object node)
           
 void remove(int index)
          Removes a specific member from a collection.
 void remove(String key)
          Removes a specific member from a collection.
 void setIndent(int nodeIndex, int indentLevel)
           
 
Methods inherited from class javax.swing.tree.DefaultTreeModel
addTreeModelListener, asksAllowsChildren, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getChild, getChildCount, getIndexOfChild, getListeners, getPathToRoot, getPathToRoot, getRoot, getTreeModelListeners, insertNodeInto, nodeChanged, nodesChanged, nodeStructureChanged, nodesWereInserted, nodesWereRemoved, reload, reload, removeNodeFromParent, removeTreeModelListener, setAsksAllowsChildren, setRoot, valueForPathChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DsTreeModel

public DsTreeModel(DsTreeNode root)
Method Detail

getCount

public int getCount()
Returns the number of objects in a collection.


getRootNode

public DsTreeNode getRootNode()
Returns a reference to the root DsTreeNode object of a DsTree control. This is the same as getRoot() cast to a DsTreeNode.


getNode

public DsTreeNode getNode(String key)
Returns a specific DsTreeNode in the Collection by key.


getNode

public DsTreeNode getNode(int index)
Returns a specific DsTreeNode in the Collection by position.


getIndex

public int getIndex(String key)

add

public DsTreeNode add(DsTreeNode node,
                      DsTreeNode relative,
                      int relationship)
Adds a DsTreeNode object to a Nodes collection and returns a reference to the created object. Any optional argument can be null.

Parameters:
node - Required. The DsTreeNode to add.
relative - Optional. A DsTreeNode or an index number or key of a pre-existing DsTreeNode object. The relationship between the new node and this pre-existing node is found in the next argument, relationship.
relationship - Optional. Specifies the relative placement of the DsTreeNode object, as described in Settings.

add

public DsTreeNode add(DsTreeNode relative,
                      int relationship,
                      String key,
                      String text,
                      Object image,
                      Object selectedImage)
Adds a DsTreeNode object to a Nodes collection and returns a reference to the created object. Any optional argument can be null.

Parameters:
relative - Optional. A DsTreeNode or an index number or key of a pre-existing DsTreeNode object. The relationship between the new node and this pre-existing node is found in the next argument, relationship.
relationship - Optional. Specifies the relative placement of the DsTreeNode object, as described in Settings.
key - Optional. A unique string that can be used to retrieve the DsTreeNode with the Item method.
text - Required. The string that appears in the DsTreeNode.
image - Optional. The index of an image in an associated IconList control.
selectedImage - Optional. The index of an image in an associated IconList control that is shown when the DsTreeNode is selected.

add

public DsTreeNode add(String relative,
                      int relationship,
                      String key,
                      String text,
                      Object image,
                      Object selectedImage)

add

public DsTreeNode add(int relative,
                      int relationship,
                      String key,
                      String text,
                      Object image,
                      Object selectedImage)

add

public DsTreeNode add(int relative,
                      int relationship,
                      String key,
                      String text,
                      int image,
                      int selectedImage)

add

public DsTreeNode add(String relative,
                      int relationship,
                      String key,
                      String text,
                      int image,
                      int selectedImage)

add

public DsTreeNode add(DsTreeNode relative,
                      int relationship,
                      String key,
                      String text,
                      int image,
                      int selectedImage)

add

public DsTreeNode add(String text,
                      String key)

add

public DsTreeNode add(String text,
                      int index)

add

public DsTreeNode add(String text)

add

public DsTreeNode add()

changeKey

public void changeKey(String key,
                      String newkey)

clear

public void clear()
Removes all objects in a collection.


remove

public void remove(int index)
Removes a specific member from a collection.


remove

public void remove(String key)
Removes a specific member from a collection.


isLeaf

public boolean isLeaf(Object node)
Specified by:
isLeaf in interface TreeModel
Overrides:
isLeaf in class DefaultTreeModel

getIndent

public int getIndent(int nodeIndex)

setIndent

public void setIndent(int nodeIndex,
                      int indentLevel)

Diamond Control Suite 3.0

Diamond Edge and Diamond Control Suite are trademarks or registered trademarks of Diamond Edge, Inc. Copyright 1999-2005 Diamond Edge, Inc. All Rights Reserved.