Class awtExt.EventDispatch
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class awtExt.EventDispatch

java.lang.Object
   |
   +----awtExt.EventDispatch

public final class EventDispatch
extends Object
Dispatches an event to a user defined method when that event occurs. To attach a callbackable method to an event, simply assign a methodRef object to the variable with the same name as the event. For a given awtExt GUI object, provides an easily configurable event handling method dispatcher. For example, to process KEY_PRESS events in an awtExt.TextField object:
	awtExt.TextField aField = new awtExt.TextField(...);
	aField.eventDispatch.KEY_PRESS = Callback.newRef( myObj, "myMethod" );
When a KEY_PRESS event occurs,
 myObj.myMethod( cbi ) 
will be dispatched.
 myMethod() 
can then control the event's propagation as well as modify its state.

Note: a default event handler is installed for the WINDOW_DESTROY
event. This will cause the Java application to exit. If it's an applet,
the window will be hidden and disposed. To deactivate it, set the
class variable USE_DEFAULT_WINDOW_DESTROY to false.
See Also:
Event, Callback, processed, CallbackInfo, methodRef, USE_DEFAULT_WINDOW_DESTROY

Variable Index

 o ACTION_EVENT
User installed methodRef for an action event
 o GOT_FOCUS
User installed methodRef for a got focus event
 o KEY_ACTION
User installed methodRef for a key action event
 o KEY_ACTION_RELEASE
User installed methodRef for a key action release event
 o KEY_PRESS
User installed methodRef for a key press event
 o KEY_RELEASE
User installed methodRef for a key release event
 o LIST_DESELECT
User installed methodRef for a list deselect event
 o LIST_SELECT
User installed methodRef for a list select event
 o LOAD_FILE
User installed methodRef for a load file event
 o LOST_FOCUS
User installed methodRef for a lost focus event
 o MOUSE_DOWN
User installed methodRef for a mouse down event
 o MOUSE_DRAG
User installed methodRef for a mouse drag event
 o MOUSE_ENTER
User installed methodRef for a mouse enter event
 o MOUSE_EXIT
User installed methodRef for a mouse exit event
 o MOUSE_MOVE
User installed methodRef for a mouse move event
 o MOUSE_UP
User installed methodRef for a mouse up event
 o SAVE_FILE
User installed methodRef for a save file event
 o SCROLL_ABSOLUTE
User installed methodRef for an scroll absolute event
 o SCROLL_LINE_DOWN
User installed methodRef for a scroll line down event
 o SCROLL_LINE_UP
User installed methodRef for a scroll line up event
 o SCROLL_PAGE_DOWN
User installed methodRef for a scroll page down event
 o SCROLL_PAGE_UP
User installed methodRef for a scroll page down event
 o USE_DEFAULT_WINDOW_DESTROY
Controls attachment of default window destroy event handler Set to true by default.
 o WINDOW_DEICONIFY
User installed methodRef for a window deiconify event
 o WINDOW_DESTROY
User installed methodRef for a window destroy event
 o WINDOW_EXPOSE
User installed methodRef for a window expose event
 o WINDOW_ICONIFY
User installed methodRef for a window iconify event
 o WINDOW_MOVED
User installed methodRef for a window moved event
 o container
Container of this EventDispatch object.

Constructor Index

 o EventDispatch(Object)
Constructor of an EventDispatch object for an awtExt object.

Method Index

 o defaultWindowDestroy(CallbackInfo)
The default window destroy callback method.
 o handle(Event)
Dispatches an event to a user defined event handling method.

Variables

 o ACTION_EVENT
  public methodRef ACTION_EVENT
User installed methodRef for an action event
See Also:
ACTION_EVENT
 o GOT_FOCUS
  public methodRef GOT_FOCUS
User installed methodRef for a got focus event
See Also:
GOT_FOCUS
 o KEY_ACTION
  public methodRef KEY_ACTION
User installed methodRef for a key action event
See Also:
KEY_ACTION
 o KEY_ACTION_RELEASE
  public methodRef KEY_ACTION_RELEASE
User installed methodRef for a key action release event
See Also:
KEY_ACTION_RELEASE
 o KEY_PRESS
  public methodRef KEY_PRESS
User installed methodRef for a key press event
See Also:
KEY_PRESS
 o KEY_RELEASE
  public methodRef KEY_RELEASE
User installed methodRef for a key release event
See Also:
KEY_RELEASE
 o LIST_DESELECT
  public methodRef LIST_DESELECT
User installed methodRef for a list deselect event
See Also:
LIST_DESELECT
 o LIST_SELECT
  public methodRef LIST_SELECT
User installed methodRef for a list select event
See Also:
LIST_DESELECT
 o LOAD_FILE
  public methodRef LOAD_FILE
User installed methodRef for a load file event
See Also:
LOAD_FILE
 o LOST_FOCUS
  public methodRef LOST_FOCUS
User installed methodRef for a lost focus event
See Also:
LOST_FOCUS
 o MOUSE_DOWN
  public methodRef MOUSE_DOWN
User installed methodRef for a mouse down event
See Also:
MOUSE_DOWN
 o MOUSE_DRAG
  public methodRef MOUSE_DRAG
User installed methodRef for a mouse drag event
See Also:
MOUSE_DRAG
 o MOUSE_ENTER
  public methodRef MOUSE_ENTER
User installed methodRef for a mouse enter event
See Also:
MOUSE_ENTER
 o MOUSE_EXIT
  public methodRef MOUSE_EXIT
User installed methodRef for a mouse exit event
See Also:
MOUSE_EXIT
 o MOUSE_MOVE
  public methodRef MOUSE_MOVE
User installed methodRef for a mouse move event
See Also:
MOUSE_MOVE
 o MOUSE_UP
  public methodRef MOUSE_UP
User installed methodRef for a mouse up event
See Also:
MOUSE_UP
 o SAVE_FILE
  public methodRef SAVE_FILE
User installed methodRef for a save file event
See Also:
SAVE_FILE
 o SCROLL_ABSOLUTE
  public methodRef SCROLL_ABSOLUTE
User installed methodRef for an scroll absolute event
See Also:
SCROLL_ABSOLUTE
 o SCROLL_LINE_DOWN
  public methodRef SCROLL_LINE_DOWN
User installed methodRef for a scroll line down event
See Also:
SCROLL_LINE_DOWN
 o SCROLL_LINE_UP
  public methodRef SCROLL_LINE_UP
User installed methodRef for a scroll line up event
See Also:
SCROLL_LINE_UP
 o SCROLL_PAGE_DOWN
  public methodRef SCROLL_PAGE_DOWN
User installed methodRef for a scroll page down event
See Also:
SCROLL_PAGE_DOWN
 o SCROLL_PAGE_UP
  public methodRef SCROLL_PAGE_UP
User installed methodRef for a scroll page down event
See Also:
SCROLL_PAGE_UP
 o WINDOW_DESTROY
  public methodRef WINDOW_DESTROY
User installed methodRef for a window destroy event
See Also:
WINDOW_DESTROY
 o WINDOW_ICONIFY
  public methodRef WINDOW_ICONIFY
User installed methodRef for a window iconify event
See Also:
WINDOW_ICONIFY
 o WINDOW_DEICONIFY
  public methodRef WINDOW_DEICONIFY
User installed methodRef for a window deiconify event
See Also:
WINDOW_DEICONIFY
 o WINDOW_EXPOSE
  public methodRef WINDOW_EXPOSE
User installed methodRef for a window expose event
See Also:
WINDOW_EXPOSE
 o WINDOW_MOVED
  public methodRef WINDOW_MOVED
User installed methodRef for a window moved event
See Also:
WINDOW_MOVED
 o container
  public Object container
Container of this EventDispatch object. Passed to each user defined event handling method via the CallbackInfo parameter
See Also:
thisAwtObj
 o USE_DEFAULT_WINDOW_DESTROY
  public static boolean USE_DEFAULT_WINDOW_DESTROY
Controls attachment of default window destroy event handler Set to true by default. Set this to false if you don't want a default window destroy handler

Constructors

 o EventDispatch
  public EventDispatch(Object aContainer)
Constructor of an EventDispatch object for an awtExt object. a reference to the awtExt object is passed as a parameter to this constructor. Also attempts to install a default WINDOW_DESTROY event handler method. This behaviour can be turned off by setting the USE_DEFAULT_WINDOW_DESTROY class variable to false.
Parameters:
aContainer - The awtExt object that events are being dispatched for.
See Also:
USE_DEFAULT_WINDOW_DESTROY

Methods

 o handle
  public final boolean handle(Event evt)
Dispatches an event to a user defined event handling method. For a given event, checks to see if the corresponding event handling methodRef is set and if so, dispatches the event to it.
Parameters:
evt - The current event.
Returns:
event processed status.
See Also:
CallbackInfo, Event
 o defaultWindowDestroy
  public void defaultWindowDestroy(CallbackInfo cbi)
The default window destroy callback method. This handler method is installed as the default, if the USE_DEFAULT_WINDOW_DESTROY class variable is set to true. Its behaviour is to hide and dispose of the frame. In addition, if it's an application it will perform a System.exit(0)

All Packages  Class Hierarchy  This Package  Previous  Next  Index