public class TreeModelEvent
extends java.lang.Object
| Constructor and Description |
|---|
TreeModelEvent(java.lang.Object source,
java.lang.Object[] path)
Used to create an event when nodes have been changed, inserted, or
removed, identifying the path to the parent of the modified items as
a TreePath object.
|
TreeModelEvent(java.lang.Object source,
java.lang.Object[] path,
int[] childIndices,
java.lang.Object[] children)
Used to create an event when nodes have been changed, inserted, or
removed, identifying the path to the parent of the modified items as
an array of Objects.
|
TreeModelEvent(java.lang.Object source,
TreePath path)
Used to create an event when nodes have been changed, inserted, or
removed, identifying the path to the parent of the modified items as
a TreePath object.
|
TreeModelEvent(java.lang.Object source,
TreePath path,
int[] childIndices,
java.lang.Object[] children)
Used to create an event when nodes have been changed, inserted, or
removed, identifying the path to the parent of the modified items as
a TreePath object.
|
| Modifier and Type | Method and Description |
|---|---|
int[] |
getChildIndices()
Returns the values of the child indexes.
|
java.lang.Object[] |
getChildren()
Return the objects that are children of the node identified by
the path of this event at the locations specified by
getChildIndices. |
java.lang.Object |
getSource()
Answer the source of this event
|
TreePath |
getTreePath()
For all events, except treeStructureChanged,
returns the parent of the changed nodes.
|
java.lang.String |
toString()
Returns a string that displays and identifies this object's
properties.
|
public TreeModelEvent(java.lang.Object source,
java.lang.Object[] path,
int[] childIndices,
java.lang.Object[] children)
int. The indexes in that array
must be in order, from lowest to highest.source - the Object responsible for generating the eventpath - an array of Object identifying the path to the parent of the modified item(s)childIndices - array that specifies the
index values of the removed items. The indices must be in sorted order, from lowest to highestchildren - an array containing the inserted, removed, or changed objectspublic TreeModelEvent(java.lang.Object source,
TreePath path,
int[] childIndices,
java.lang.Object[] children)
source - the Object responsible for generating the eventpath - a TreePath object that identifies the path to the parent of the modified item(s)childIndices - array that specifies the index values of the modified itemschildren - an array containing the inserted, removed, or changed objectsTreeModelEvent(Object,Object[],int[],Object[])public TreeModelEvent(java.lang.Object source,
java.lang.Object[] path)
source - the Object responsible for generating the eventpath - an array of Object identifying the path to the parent of the modified item(s)public TreeModelEvent(java.lang.Object source,
TreePath path)
source - the Object responsible for generating the eventpath - a TreePath object that identifies the path to the parent of the modified item(s)public java.lang.Object getSource()
public TreePath getTreePath()
getChildIndices are used to get a list of the effected
nodes.
The one exception to this is a treeNodesChanged event that is to
identify the root, in which case this will return the root
and getChildIndices will return null.public java.lang.Object[] getChildren()
getChildIndices. If this is a removal event the
returned objects are no longer children of the parent node.public int[] getChildIndices()
public java.lang.String toString()
toString in class java.lang.Object