org.zaval.data.event
Class TreeEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--org.zaval.util.event.EvObject
              |
              +--org.zaval.data.event.TreeEvent
All Implemented Interfaces:
java.io.Serializable

public class TreeEvent
extends EvObject

This class describes event that is performed by TreeModel class implementation. Using the event class the tree model notifies listeners about the structure changes.

See Also:
Serialized Form

Field Summary
static int INSERTED
          The item inserted event type.
static int MODIFIED
          The item modified event type.
static int REMOVED
          The item removed event type.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
TreeEvent(java.lang.Object src, int id, Item item)
          Constructs a new tree model event with the given source, event id and item.
 
Method Summary
protected  boolean checkID(int id)
          The method returns true if the specified id is valid for the event, otherwise returns false.
 Item getItem()
          Gets the item that has been modified, inserted or added.
 
Methods inherited from class org.zaval.util.event.EvObject
getID
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INSERTED

public static final int INSERTED
The item inserted event type.

REMOVED

public static final int REMOVED
The item removed event type.

MODIFIED

public static final int MODIFIED
The item modified event type.
Constructor Detail

TreeEvent

public TreeEvent(java.lang.Object src,
                 int id,
                 Item item)
Constructs a new tree model event with the given source, event id and item. The event id defines type of the event and the item is an item that has been inserted, modified or removed.
Parameters:
src - the source of the event.
id - the type of the event.
item - the item.
Method Detail

getItem

public Item getItem()
Gets the item that has been modified, inserted or added.
Returns:
an item.

checkID

protected boolean checkID(int id)
Description copied from class: EvObject
The method returns true if the specified id is valid for the event, otherwise returns false. The method is called with the event constructor to test if the event id is valid and if the event is not valid the IllegalArgumentException will be thrown.
Overrides:
checkID in class EvObject
Following copied from class: org.zaval.util.event.EvObject
Parameters:
id - the specified id.


Copyright © Zaval Creative Engineering Group, 2000-2005.
http://www.zaval.org