com.sun.lwuit.events
Class ActionEvent

java.lang.Object
  extended by com.sun.lwuit.events.ActionEvent

public class ActionEvent
extends java.lang.Object

Event object delivered when an ActionListener callback is invoked


Constructor Summary
ActionEvent(Command source, Component sourceComponent, int x, int y)
          Creates a new instance of ActionEvent for a command
ActionEvent(java.lang.Object source)
          Creates a new instance of ActionEvent
ActionEvent(java.lang.Object source, int keyEvent)
          Creates a new instance of ActionEvent
ActionEvent(java.lang.Object source, int x, int y)
          Creates a new instance of ActionEvent as a pointer event
 
Method Summary
 void consume()
          Consume the event indicating that it was handled thus preventing other action listeners from handling/receiving the event
 Command getCommand()
          If this event was sent as a result of a command action this method returns that command
 Component getComponent()
          Returns the source component object
 int getKeyEvent()
          If this event was triggered by a key press this method will return the appropriate keycode
 java.lang.Object getSource()
          The element that triggered the action event, useful for decoupling event handling code
 int getX()
          The X position if this is a pointer event otherwise undefined
 int getY()
          The Y position if this is a pointer event otherwise undefined
 boolean isConsumed()
          Returns true if the event was consumed thus indicating that it was handled.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionEvent

public ActionEvent(java.lang.Object source)
Creates a new instance of ActionEvent

Parameters:
source - element for the action event

ActionEvent

public ActionEvent(java.lang.Object source,
                   int keyEvent)
Creates a new instance of ActionEvent

Parameters:
source - element for the action event
keyEvent - the key that triggered the event

ActionEvent

public ActionEvent(java.lang.Object source,
                   int x,
                   int y)
Creates a new instance of ActionEvent as a pointer event

Parameters:
source - element for the pointer event
x - the x position of the pointer event
y - the y position of the pointer event

ActionEvent

public ActionEvent(Command source,
                   Component sourceComponent,
                   int x,
                   int y)
Creates a new instance of ActionEvent for a command

Parameters:
source - element command
sourceComponent - the triggering component
x - the x position of the pointer event
y - the y position of the pointer event
Method Detail

getSource

public java.lang.Object getSource()
The element that triggered the action event, useful for decoupling event handling code

Returns:
the element that triggered the action event

getKeyEvent

public int getKeyEvent()
If this event was triggered by a key press this method will return the appropriate keycode

Returns:
the key that triggered the event

getCommand

public Command getCommand()
If this event was sent as a result of a command action this method returns that command

Returns:
the command action that triggered the action event

getComponent

public Component getComponent()
Returns the source component object

Returns:
a component

consume

public void consume()
Consume the event indicating that it was handled thus preventing other action listeners from handling/receiving the event


isConsumed

public boolean isConsumed()
Returns true if the event was consumed thus indicating that it was handled. This prevents other action listeners from handling/receiving the event

Returns:
true if the event was consumed

getX

public int getX()
The X position if this is a pointer event otherwise undefined

Returns:
x position

getY

public int getY()
The Y position if this is a pointer event otherwise undefined

Returns:
y position