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

Class gjt.SelectionEvent

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

public class SelectionEvent
extends Event
An extension of java.awt.Event, specifically designed for selection events.

SelectionEvents are constructed with arguments:

The AWT event that triggered the image button event
The id of the event.
An SelectionEvent's id (the constructor's 3rd argument), must be one of the following:

SelectionEvent.SELECT
SelectionEvent.DESELECT
SelectionEvent has only a constructor and a paramString() method. Containers that contain objects which are capable of generating SelectionEvents should check the events like so:
     // handleEvent(Event) method of a container that
     // contain objects that generate SelectionEvents
     public boolean handleEvent(Event event) {
             if(event instanceof SelectionEvent) {
                 SelectionEvent sevent = 
                 (SelectionEvent)event;
                 if(sevent.isSelected()) {
                     // do something for selection
                 }
                 else {
                     // do something for deselection
                 }
             }
     }
See Also:
LabelCanvas, ImageButtonEvent, LabelCanvasTest

Variable Index

 o DESELECT
 o SELECT

Constructor Index

 o SelectionEvent(Object, Event, int)

Method Index

 o isSelected()
 o paramString()

Variables

 o SELECT
  public final static int SELECT
 o DESELECT
  public final static int DESELECT

Constructors

 o SelectionEvent
  public SelectionEvent(Object target,
                        Event event,
                        int type)

Methods

 o isSelected
  public boolean isSelected()
 o paramString
  protected String paramString()
Overrides:
paramString in class Event

All Packages  Class Hierarchy  This Package  Previous  Next  Index