com.wirefusion.player
Class PlayerEvent

java.lang.Object
  extended by java.util.EventObject
      extended by java.awt.AWTEvent
          extended by com.wirefusion.player.PlayerEvent
All Implemented Interfaces:
java.io.Serializable

public class PlayerEvent
extends java.awt.AWTEvent

This class is used for player events. To listen to these events in a Wob, override the processPlayerEvent method and enable the event type by calling enableEvents(PlayerEvent.PLAYER_EVENT_MASK).

See Also:
Serialized Form

Field Summary
static int EXTERNAL_MESSAGE_EVENT
          The "external message" event.
static int FRAME_EVENT
          The "frame" event.
static int KEY_EVENT
          The "key" event.
static long PLAYER_EVENT_MASK
          The event mask for selecting player events.
static int START_EVENT
          This PlayerEvent occurs when the presentation is started.
 
Fields inherited from class java.awt.AWTEvent
ACTION_EVENT_MASK, ADJUSTMENT_EVENT_MASK, COMPONENT_EVENT_MASK, consumed, CONTAINER_EVENT_MASK, FOCUS_EVENT_MASK, HIERARCHY_BOUNDS_EVENT_MASK, HIERARCHY_EVENT_MASK, id, INPUT_METHOD_EVENT_MASK, INVOCATION_EVENT_MASK, ITEM_EVENT_MASK, KEY_EVENT_MASK, MOUSE_EVENT_MASK, MOUSE_MOTION_EVENT_MASK, MOUSE_WHEEL_EVENT_MASK, PAINT_EVENT_MASK, RESERVED_ID_MAX, TEXT_EVENT_MASK, WINDOW_EVENT_MASK, WINDOW_FOCUS_EVENT_MASK, WINDOW_STATE_EVENT_MASK
 
Fields inherited from class java.util.EventObject
source
 
Method Summary
 java.lang.Object getArg()
          If the event is of type KEY_EVENT, this method will return an associated KeyEvent object.
 
Methods inherited from class java.awt.AWTEvent
consume, getID, isConsumed, paramString, 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

PLAYER_EVENT_MASK

public static final long PLAYER_EVENT_MASK
The event mask for selecting player events.

See Also:
Constant Field Values

FRAME_EVENT

public static final int FRAME_EVENT
The "frame" event. This PlayerEvent occurs when a new frame is about to be rendered.

See Also:
Constant Field Values

KEY_EVENT

public static final int KEY_EVENT
The "key" event. This PlayerEvent occurs when a key is pressed when the player has key focus.

See Also:
Constant Field Values

EXTERNAL_MESSAGE_EVENT

public static final int EXTERNAL_MESSAGE_EVENT
The "external message" event. This PlayerEvent occurs when an external message is sent to the Player.send(linkname, message) method (for example using JavaScript and the AppletPlayer player).

See Also:
Constant Field Values

START_EVENT

public static final int START_EVENT
This PlayerEvent occurs when the presentation is started. At the time when this event occurs, init has been called in all Wobs.

See Also:
Constant Field Values
Method Detail

getArg

public java.lang.Object getArg()

If the event is of type KEY_EVENT, this method will return an associated KeyEvent object. If the event is of another type, it will return null.

For EXTERNAL_MESSAGE_EVENT events, the link name and message of an "external message" will be returned as a String[] array, where the first element will be the link name and the second will be the message.

For FRAME_EVENT events, null is returned.

Returns:
an event argument