|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.EventObject
java.awt.AWTEvent
java.awt.event.ItemEvent
public class ItemEvent
This event is generated when a selection item changes state. This is an abstraction that distills a large number of individual mouse or keyboard events into a simpler "item selected" and "item deselected" events.
ItemSelectable
,
ItemListener
,
Serialized FormField Summary | |
---|---|
static int |
DESELECTED
This type indicates that the item was deselected. |
static int |
ITEM_FIRST
This is the first id in the event id range used by this class. |
static int |
ITEM_LAST
This is the last id in the event id range used by this class. |
static int |
ITEM_STATE_CHANGED
This event id indicates a state change occurred. |
static int |
SELECTED
This type indicates that the item was selected. |
Fields inherited from class java.util.EventObject |
---|
source |
Constructor Summary | |
---|---|
ItemEvent(ItemSelectable source,
int id,
Object item,
int stateChange)
Initializes a new instance of ItemEvent with the specified
source, id, and state change constant. |
Method Summary | |
---|---|
Object |
getItem()
Returns the item affected by this state change. |
ItemSelectable |
getItemSelectable()
This method returns the event source as an ItemSelectable . |
int |
getStateChange()
Returns the type of state change, either SELECTED or
DESELECTED . |
String |
paramString()
Returns a string identifying this event. |
Methods inherited from class java.awt.AWTEvent |
---|
consume, getID, isConsumed, setSource, toString |
Methods inherited from class java.util.EventObject |
---|
getSource |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int ITEM_FIRST
public static final int ITEM_LAST
public static final int ITEM_STATE_CHANGED
public static final int SELECTED
public static final int DESELECTED
Constructor Detail |
---|
public ItemEvent(ItemSelectable source, int id, Object item, int stateChange)
ItemEvent
with the specified
source, id, and state change constant. Note that an invalid id leads to
unspecified results.
source
- the source of the eventid
- the event iditem
- the item affected by the state changestateChange
- one of SELECTED
or DESELECTED
Method Detail |
---|
public ItemSelectable getItemSelectable()
ItemSelectable
.
ItemSelected
ClassCastException
- if source is changed to a non-ItemSelectablepublic Object getItem()
public int getStateChange()
SELECTED
or
DESELECTED
.
public String paramString()
"ITEM_STATE_CHANGED,item=" + item + ",stateChange="
+ (getStateChange() == DESELECTED ? "DESELECTED" : "SELECTED")
.
paramString
in class AWTEvent
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |