Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.EventObject | +--com.sun.java.swing.event.TreeModelEvent
Warning: serialized objects of this class will not be compatible with future swing releases. The current serialization support is appropriate for short term storage or RMI between Swing1.0 applications. It will not be possible to load serialized Swing1.0 objects with future releases of Swing. The JDK1.2 release of Swing will be the compatibility baseline for the serialized form of Swing objects.
Field Summary | |
int[] | childIndices
Indices identifying the position of where the children were. |
java.lang.Object[] | children
Children that have been removed. |
TreePath | path
Path to the parent of the nodes that have changed. |
Fields inherited from class java.util.EventObject | |
source |
Constructor Summary | |
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,
int[] childIndices,
java.lang.Object[] children)
Used to create an event when nodes have been removed, identifying the path to the parent of the removed items as a TreePath object. |
|
TreeModelEvent(java.lang.Object source,
java.lang.Object[] path)
Used to create an event when nodes have been inserted, a node has changed, or the node structure has changed in some way, identifying the path to the change as an array of Objects. |
|
TreeModelEvent(java.lang.Object source,
TreePath path)
Used to create an event when nodes have been inserted, a node has changed, or the node structure has changed in some way, identifying the path to the change as a TreePath object. |
Method Summary | |
int[] | getChildIndices()
Returns the values of the child indexes. |
java.lang.Object[] | getChildren()
Returns the objects that are children of the node identified by getPath at the locations specified by getChildIndices .
|
java.lang.Object[] | getPath()
Convenience method to get the array of objects from the TreePath instance that this event wraps. |
TreePath | getTreePath()
Returns the TreePath object identifying the changed node. |
java.lang.String | toString()
Returns a string that displays and identifies this object's properties. |
Methods inherited from class java.util.EventObject | |
getSource, toString |
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Field Detail |
protected TreePath path
protected int[] childIndices
protected java.lang.Object[] children
Constructor Detail |
public TreeModelEvent(java.lang.Object source, java.lang.Object[] path, int[] childIndices, java.lang.Object[] children)
source
- the Object responsible for generating the event (typically
the creator of the event object passes this
for its value)
path
- an array of Object identifying the path to the
parent of the removed item(s), where the first element
of the array is the Object stored at the root node and
the last element is the Object stored at the parent node
childIndices
- an array of int
that specifies the
index values of the removed items
children
- an array of Object the orphaned child objectspublic TreeModelEvent(java.lang.Object source, TreePath path, int[] childIndices, java.lang.Object[] children)
source
- the Object responsible for generating the event (typically
the creator of the event object passes this
for its value)
path
- a TreePath object that identifies the path to the
parent of the removed item(s). In the DefaultTreeModel,
this object contains an array of user-data objects,
but a subclass of TreePath could use some totally
different mechanism -- for example, a node ID number
childIndices
- an array of int
that specifies the
index values of the removed items
children
- an array of Object the orphaned child objectspublic TreeModelEvent(java.lang.Object source, java.lang.Object[] path)
When the object data at a node has changed, the path points to the changed item. When nodes have been inserted or the tree's structure has changed, the path points to the parent of the changes. A "structure change" might involve nodes swapping position, for example, or it might encapsulate multiple inserts and deletes (without identifying which nodes have been removed).
source
- the Object responsible for generating the event (typically
the creator of the event object passes this
for its value)
path
- an array of Object identifying the path to the
change, where the first element of the array is the
object stored at the root node and the last element
is the object stored at the changed nodepublic TreeModelEvent(java.lang.Object source, TreePath path)
When the object data at a node has changed, the path points to the changed item. When nodes have been inserted or the tree's structure has changed, the path points to the parent of the changes. A "structure change" might involve nodes swapping position, for example, or it might encapsulate multiple inserts and deletes (without identifying which nodes have been removed).
source
- the Object responsible for generating the event (typically
the creator of the event object passes this
for its value)
path
- a TreePath object that identifies the path to the
change. In the DefaultTreeModel,
this object contains an array of user-data objects,
but a subclass of TreePath could use some totally
different mechanism -- for example, a node ID numberMethod Detail |
public TreePath getTreePath()
getLastPathComponent
on that object to
get the data stored at that node.public java.lang.Object[] getPath()
public java.lang.Object[] getChildren()
getPath
at the locations specified by getChildIndices
.
If this is a removal event the returned objects are no longer
children of the parent node.public int[] getChildIndices()
int
containing index locations for
the children specified by the eventpublic java.lang.String toString()
Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |