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
-
DESELECT
-
-
SELECT
-
-
SelectionEvent(Object, Event, int)
-
-
isSelected()
-
-
paramString()
-
SELECT
public final static int SELECT
DESELECT
public final static int DESELECT
SelectionEvent
public SelectionEvent(Object target,
Event event,
int type)
isSelected
public boolean isSelected()
paramString
protected String paramString()
- Overrides:
- paramString in class Event
All Packages Class Hierarchy This Package Previous Next Index