|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.views.IlvObjectInteractor
ilog.views.objectinteractor.IlvButtonInteractor
public class IlvButtonInteractor
This object interactor makes a graphic object act like a standard
interface button. When this object interactor is installed for a
given graphic object, clicking on or activating the graphic object
produce an action event.
The action listeners of the graphic object receive three different kinds
of action event: The ARM action event,
when the object is clicked on,
the DISARM action event when
the mouse button is released,
and the ACTIVATE action event when
the mouse button is released over the object.
The ARM and DISARM action events let
you perform a specific graphic operation on the object
(changing its color, for example) to indicate
that an action is about to be
performed. The ACTIVATE action event carries out the
action associated with the button.
You may code a listener as below:
graphic.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
if (event.getID() == IlvButtonInteractor.ARM) {
graphic.setBackgound(Color.red);
graphic.reDraw();
}
else if (event.getID() == IlvButtonInteractor.DISARM) {
graphic.setBackground(Color.gray);
graphic.reDraw();
}
else // ACTIVATE
performMyAction();
}
})
IlvGraphic.addActionListener(java.awt.event.ActionListener),
Serialized Form| Field Summary | |
|---|---|
static int |
ACTIVATE
The Activate event type |
static int |
ARM
The Arm event type |
static int |
DISARM
The Disarm event type |
| Constructor Summary | |
|---|---|
IlvButtonInteractor()
Creates a new IlvButtonInteractor. |
|
| Method Summary | |
|---|---|
boolean |
processEvent(IlvGraphic obj,
AWTEvent event,
IlvObjectInteractorContext context)
Processes the events. |
| Methods inherited from class ilog.views.IlvObjectInteractor |
|---|
Get, handleExpose, onEnter, onExit, Put |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int ARM
public static final int DISARM
public static final int ACTIVATE
| Constructor Detail |
|---|
public IlvButtonInteractor()
IlvButtonInteractor.
You should not use the constructor to create an instance,
you may share instances of this interactor
by using the IlvObjectInteractor.Get method.
IlvObjectInteractor.Get(java.lang.String)| Method Detail |
|---|
public boolean processEvent(IlvGraphic obj,
AWTEvent event,
IlvObjectInteractorContext context)
processEvent in class IlvObjectInteractorobj - The graphic object.event - The event to process.context - The context in which the event occurred.
true if the event was handled
by this processEvent invocation,
false otherwise.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||