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
-
ACTION_EVENT
- User installed methodRef for an action event
-
GOT_FOCUS
- User installed methodRef for a got focus event
-
KEY_ACTION
- User installed methodRef for a key action event
-
KEY_ACTION_RELEASE
- User installed methodRef for a key action release event
-
KEY_PRESS
- User installed methodRef for a key press event
-
KEY_RELEASE
- User installed methodRef for a key release event
-
LIST_DESELECT
- User installed methodRef for a list deselect event
-
LIST_SELECT
- User installed methodRef for a list select event
-
LOAD_FILE
- User installed methodRef for a load file event
-
LOST_FOCUS
- User installed methodRef for a lost focus event
-
MOUSE_DOWN
- User installed methodRef for a mouse down event
-
MOUSE_DRAG
- User installed methodRef for a mouse drag event
-
MOUSE_ENTER
- User installed methodRef for a mouse enter event
-
MOUSE_EXIT
- User installed methodRef for a mouse exit event
-
MOUSE_MOVE
- User installed methodRef for a mouse move event
-
MOUSE_UP
- User installed methodRef for a mouse up event
-
SAVE_FILE
- User installed methodRef for a save file event
-
SCROLL_ABSOLUTE
- User installed methodRef for an scroll absolute event
-
SCROLL_LINE_DOWN
- User installed methodRef for a scroll line down event
-
SCROLL_LINE_UP
- User installed methodRef for a scroll line up event
-
SCROLL_PAGE_DOWN
- User installed methodRef for a scroll page down event
-
SCROLL_PAGE_UP
- User installed methodRef for a scroll page down event
-
USE_DEFAULT_WINDOW_DESTROY
- Controls attachment of default window destroy event handler
Set to true by default.
-
WINDOW_DEICONIFY
- User installed methodRef for a window deiconify event
-
WINDOW_DESTROY
- User installed methodRef for a window destroy event
-
WINDOW_EXPOSE
- User installed methodRef for a window expose event
-
WINDOW_ICONIFY
- User installed methodRef for a window iconify event
-
WINDOW_MOVED
- User installed methodRef for a window moved event
-
container
- Container of this EventDispatch object.
-
EventDispatch(Object)
- Constructor of an EventDispatch object for an awtExt object.
-
defaultWindowDestroy(CallbackInfo)
- The default window destroy callback method.
-
handle(Event)
- Dispatches an event to a user defined event handling method.
ACTION_EVENT
public methodRef ACTION_EVENT
- User installed methodRef for an action event
- See Also:
- ACTION_EVENT
GOT_FOCUS
public methodRef GOT_FOCUS
- User installed methodRef for a got focus event
- See Also:
- GOT_FOCUS
KEY_ACTION
public methodRef KEY_ACTION
- User installed methodRef for a key action event
- See Also:
- KEY_ACTION
KEY_ACTION_RELEASE
public methodRef KEY_ACTION_RELEASE
- User installed methodRef for a key action release event
- See Also:
- KEY_ACTION_RELEASE
KEY_PRESS
public methodRef KEY_PRESS
- User installed methodRef for a key press event
- See Also:
- KEY_PRESS
KEY_RELEASE
public methodRef KEY_RELEASE
- User installed methodRef for a key release event
- See Also:
- KEY_RELEASE
LIST_DESELECT
public methodRef LIST_DESELECT
- User installed methodRef for a list deselect event
- See Also:
- LIST_DESELECT
LIST_SELECT
public methodRef LIST_SELECT
- User installed methodRef for a list select event
- See Also:
- LIST_DESELECT
LOAD_FILE
public methodRef LOAD_FILE
- User installed methodRef for a load file event
- See Also:
- LOAD_FILE
LOST_FOCUS
public methodRef LOST_FOCUS
- User installed methodRef for a lost focus event
- See Also:
- LOST_FOCUS
MOUSE_DOWN
public methodRef MOUSE_DOWN
- User installed methodRef for a mouse down event
- See Also:
- MOUSE_DOWN
MOUSE_DRAG
public methodRef MOUSE_DRAG
- User installed methodRef for a mouse drag event
- See Also:
- MOUSE_DRAG
MOUSE_ENTER
public methodRef MOUSE_ENTER
- User installed methodRef for a mouse enter event
- See Also:
- MOUSE_ENTER
MOUSE_EXIT
public methodRef MOUSE_EXIT
- User installed methodRef for a mouse exit event
- See Also:
- MOUSE_EXIT
MOUSE_MOVE
public methodRef MOUSE_MOVE
- User installed methodRef for a mouse move event
- See Also:
- MOUSE_MOVE
MOUSE_UP
public methodRef MOUSE_UP
- User installed methodRef for a mouse up event
- See Also:
- MOUSE_UP
SAVE_FILE
public methodRef SAVE_FILE
- User installed methodRef for a save file event
- See Also:
- SAVE_FILE
SCROLL_ABSOLUTE
public methodRef SCROLL_ABSOLUTE
- User installed methodRef for an scroll absolute event
- See Also:
- SCROLL_ABSOLUTE
SCROLL_LINE_DOWN
public methodRef SCROLL_LINE_DOWN
- User installed methodRef for a scroll line down event
- See Also:
- SCROLL_LINE_DOWN
SCROLL_LINE_UP
public methodRef SCROLL_LINE_UP
- User installed methodRef for a scroll line up event
- See Also:
- SCROLL_LINE_UP
SCROLL_PAGE_DOWN
public methodRef SCROLL_PAGE_DOWN
- User installed methodRef for a scroll page down event
- See Also:
- SCROLL_PAGE_DOWN
SCROLL_PAGE_UP
public methodRef SCROLL_PAGE_UP
- User installed methodRef for a scroll page down event
- See Also:
- SCROLL_PAGE_UP
WINDOW_DESTROY
public methodRef WINDOW_DESTROY
- User installed methodRef for a window destroy event
- See Also:
- WINDOW_DESTROY
WINDOW_ICONIFY
public methodRef WINDOW_ICONIFY
- User installed methodRef for a window iconify event
- See Also:
- WINDOW_ICONIFY
WINDOW_DEICONIFY
public methodRef WINDOW_DEICONIFY
- User installed methodRef for a window deiconify event
- See Also:
- WINDOW_DEICONIFY
WINDOW_EXPOSE
public methodRef WINDOW_EXPOSE
- User installed methodRef for a window expose event
- See Also:
- WINDOW_EXPOSE
WINDOW_MOVED
public methodRef WINDOW_MOVED
- User installed methodRef for a window moved event
- See Also:
- WINDOW_MOVED
container
public Object container
- Container of this EventDispatch object. Passed to each
user defined event handling method via the CallbackInfo parameter
- See Also:
- thisAwtObj
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
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
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
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