|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.cpl.interactor.IlpAbstractInteractor
ilog.cpl.interactor.IlpDefaultViewInteractor
public class IlpDefaultViewInteractor
Provides a default implementation for IlpViewInteractor.
View interactors manage interactions with a graphic view.
They are attached to one particular controller at a time.
When an event occurs, the view interactor first determines whether a
graphic object is located at the event position.
If so, and if the graphic object has an object interactor,
the event is dispatched to the object interactor.
Otherwise, the view interactor attempts to handle the event.
To do so, it translates atomic input events into Swing action
invocations in a given context, recognizing higher-level gestures when
applicable, and invoking the associated Swing actions.
When an action is triggered by a view interactor, the action
event received by the action is a view action event IlpViewActionEvent.
A view interactor is not stateless but nevertheless, it uses an
IlpDefaultViewInteractionContext which stores information that the interactor
needs.
IlpInteractor,
IlpViewInteractionContext,
IlpViewActionEvent,
IlpObjectInteractor,
IlpGraphicController| Constructor Summary | |
|---|---|
IlpDefaultViewInteractor()
Creates a default view interactor. |
|
| Method Summary | |
|---|---|
void |
attach(IlpGraphicController controller)
Attaches this view interactor to the specified controller. |
protected ActionEvent |
createActionEvent(IlpInteractionContext ctxt,
IlpInteractionState state,
int modifiers)
Deprecated. Please use IlpActionEventFactory instead. |
protected boolean |
delegateEvent(IlpInteractionContext ctxt,
MouseEvent e)
Redefined to delegate event management to an object interactor. |
void |
detach()
Detaches this view interactor from its controller. |
IlpGraphicController |
getController()
Retrieves the controller to which this interactor is attached. |
static IlpActionEventFactory |
GetDefaultActionEventFactory()
Returns the action event factory that is used by default in this object interactor. |
protected IlpInteractionState |
getInteractionState(IlpInteractionContext ctxt)
Looks up the interaction state corresponding to the given context. |
boolean |
isUsingObjectInteractor()
Indicates whether the events that occur on an IlpGraphic
or a representation object are delegated to an IlpObjectInteractor. |
boolean |
processEvent(IlpInteractionContext ctxt,
AWTEvent event)
Processes the events applying to the view that this interactor is attached to. |
void |
setUsingObjectInteractor(boolean use)
Specifies whether the events that occur on an IlpGraphic
or a representation object should be delegated to an
IlpObjectInteractor. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface ilog.cpl.interactor.IlpInteractor |
|---|
getGestureAction, getGestureButton, getGestureModifiers, getKeyStrokeAction, getPopupMenuFactory, setGestureAction, setKeyStrokeAction, setPopupMenuFactory |
| Constructor Detail |
|---|
public IlpDefaultViewInteractor()
| Method Detail |
|---|
public static IlpActionEventFactory GetDefaultActionEventFactory()
The default action event factory creates IlpViewActionEvent
events.
IlpViewActionEventpublic void attach(IlpGraphicController controller)
attach in interface IlpViewInteractorcontroller - The controller to which this interactor is to be attached.
IllegalStateException - if this interactor is already attached to a controller.
IllegalArgumentException - if the given controller is
null.detach()public void detach()
detach in interface IlpViewInteractorattach(ilog.cpl.graphic.IlpGraphicController)public IlpGraphicController getController()
getController in interface IlpViewInteractorpublic void setUsingObjectInteractor(boolean use)
IlpGraphic
or a representation object should be delegated to an
IlpObjectInteractor.
setUsingObjectInteractor in interface IlpViewInteractoruse - Specifies whether the interactor delegates events.isUsingObjectInteractor()public boolean isUsingObjectInteractor()
IlpGraphic
or a representation object are delegated to an IlpObjectInteractor.
The default value is true.
isUsingObjectInteractor in interface IlpViewInteractorsetUsingObjectInteractor(boolean)protected IlpInteractionState getInteractionState(IlpInteractionContext ctxt)
getInteractionState in class IlpAbstractInteractorctxt - The context where the event occurred.
protected boolean delegateEvent(IlpInteractionContext ctxt,
MouseEvent e)
isUsingObjectInteractor() returns true,IlpGraphic,
delegateEvent in class IlpAbstractInteractorctxt - The interaction context used to store persistent information.e - The mouse event to be managed.
true if the given event has been handled by a
sub-interactor.isUsingObjectInteractor()
public boolean processEvent(IlpInteractionContext ctxt,
AWTEvent event)
processEvent in interface IlpInteractorprocessEvent in class IlpAbstractInteractorctxt - The view interaction context used to store information
between successive calls to this method.event - The event which occurred over the view that this interactor
is attached to.
IllegalArgumentException - if the given context is not and instance of
IlpViewInteractionContext.IlpAbstractInteractor.processKeyEvent(ilog.cpl.interactor.IlpInteractionContext, java.awt.event.KeyEvent),
IlpAbstractInteractor.delegateEvent(ilog.cpl.interactor.IlpInteractionContext, java.awt.event.MouseEvent),
IlpAbstractInteractor.displayPopupMenu(ilog.cpl.interactor.IlpInteractionContext, java.awt.event.MouseEvent),
IlpAbstractInteractor.processMouseOrFocusEvent(ilog.cpl.interactor.IlpInteractionContext, java.awt.AWTEvent),
IlpInteractionContext
protected ActionEvent createActionEvent(IlpInteractionContext ctxt,
IlpInteractionState state,
int modifiers)
IlpActionEventFactory instead.
IlpViewActionEvent instance.
createActionEvent in class IlpAbstractInteractorctxt - The context where the event occurred.state - The interaction's state.modifiers - The modifiers associated with the recognized gesture.IlpAbstractInteractor.setActionEventFactory(ilog.cpl.interactor.IlpActionEventFactory)
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||