Class gjt.ImageButtonEvent
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class gjt.ImageButtonEvent

java.lang.Object
   |
   +----java.awt.Event
           |
           +----gjt.ImageButtonEvent

public class ImageButtonEvent
extends Event
An extension of java.awt.Event, specifically designed for ImageButton events.

ImageButtonEvents are constructed with 3 arguments:

ImageButton in which the event occurred
The AWT event that triggered the image button event
The id of the event.
An ImageButtonEvent's id (the constructor's 3rd argument), must be one of the following:
ImageButtonEvent.ARM
ImageButtonEvent.DISARM
ImageButtonEvent.ACTIVATE
ImageButtonEvent has only a constructor and a paramString() method. Containers that contain ImageButtons should check for ImageButtonEvents like so:

     // handleEvent(Event) method of a container that
     // contains ImageButtons.
     public boolean handleEvent(Event event) {
             if(event instanceof ImageButtonEvent) {
                 ImageButtonEvent ibevent = 
                 (ImageButtonEvent)event;
                 if(ibevent.isArmed()) {
                     // do something for arming
                 }
                 if(ibevent.isDisarmed()) {
                     // do something for disarming
                 }
                 if(ibevent.isActivated()) {
                     // do something for activation
                 }
             }
     }
ImageButtonController is the only GJT class that creates ImageButtonEvents.
See Also:
ImageButton, ImageButtonController, SpringyImageButtonController, StickyImageButtonController, ImageButtonTest

Variable Index

 o ACTIVATE
 o ARM
 o DISARM

Constructor Index

 o ImageButtonEvent(ImageButton, Event, int)

Method Index

 o isActivated()
 o isArmed()
 o isDisarmed()
 o paramString()

Variables

 o ARM
  public final static int ARM
 o DISARM
  public final static int DISARM
 o ACTIVATE
  public final static int ACTIVATE

Constructors

 o ImageButtonEvent
  public ImageButtonEvent(ImageButton button,
                          Event event,
                          int type)

Methods

 o isArmed
  public boolean isArmed()
 o isDisarmed
  public boolean isDisarmed()
 o isActivated
  public boolean isActivated()
 o paramString
  protected String paramString()
Overrides:
paramString in class Event

All Packages  Class Hierarchy  This Package  Previous  Next  Index