ilog.cpl.interactor
Class IlpDefaultObjectInteractor

java.lang.Object
  extended by ilog.cpl.interactor.IlpAbstractInteractor
      extended by ilog.cpl.interactor.IlpDefaultObjectInteractor
All Implemented Interfaces:
IlpInteractor, IlpObjectInteractor

public class IlpDefaultObjectInteractor
extends IlpAbstractInteractor
implements IlpObjectInteractor

Provides a default implementation of IlpObjectInteractor.

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 an object interactor, the action event received by the action is an object action event IlpObjectActionEvent.

Note: The object interactor is stateless. It uses an IlpObjectInteractionContext to store information about an object. This interaction context must be given when calling processEvent(ilog.cpl.interactor.IlpInteractionContext, java.awt.AWTEvent).

Since:
JTGO 3.0
See Also:
IlpObjectInteractor, IlpAbstractInteractor, IlpObjectInteractionContext, IlpObjectActionEvent

Constructor Summary
IlpDefaultObjectInteractor()
          Creates a default object interactor.
 
Method Summary
protected  ActionEvent createActionEvent(IlpInteractionContext ctxt, IlpInteractionState state, int modifiers)
          Deprecated. Please use IlpActionEventFactory instead.
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 processEvent(IlpInteractionContext ctxt, AWTEvent event)
          Processes the events applying to the object this interactor is attached to.
 
Methods inherited from class ilog.cpl.interactor.IlpAbstractInteractor
createActionEvent, delegateEvent, displayPopupMenu, getAction, getAction, getActionEventFactory, getGestureAction, getGestureAction, getGestureButton, getGestureModifiers, getKeyStrokeAction, getPopupMenuFactory, manageSelection, processGesture, processKeyEvent, processMouseOrFocusEvent, setAction, setAction, setActionEventFactory, setGestureAction, setGestureAction, setKeyStrokeAction, setPopupMenuFactory
 
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

IlpDefaultObjectInteractor

public IlpDefaultObjectInteractor()
Creates a default object interactor.

Method Detail

GetDefaultActionEventFactory

public static IlpActionEventFactory GetDefaultActionEventFactory()
Returns the action event factory that is used by default in this object interactor.

The default action event factory creates IlpObjectActionEvent events.

Since:
JTGO 4.0
See Also:
IlpObjectActionEvent

getInteractionState

protected IlpInteractionState getInteractionState(IlpInteractionContext ctxt)
Looks up the interaction state corresponding to the given context. For object interactors, the interaction state is stored in the controller.

Specified by:
getInteractionState in class IlpAbstractInteractor
Parameters:
ctxt - The context where the event occurred.

processEvent

public boolean processEvent(IlpInteractionContext ctxt,
                            AWTEvent event)
Processes the events applying to the object this interactor is attached to.

Specified by:
processEvent in interface IlpInteractor
Overrides:
processEvent in class IlpAbstractInteractor
Parameters:
ctxt - The object interaction context used to store information about a particular object between successive calls to this method.
event - The event which occurred over the object this interactor is attached to.
Throws:
IllegalArgumentException - if the given context is not instance of IlpObjectInteractionContext.
See Also:
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

createActionEvent

protected ActionEvent createActionEvent(IlpInteractionContext ctxt,
                                        IlpInteractionState state,
                                        int modifiers)
Deprecated. Please use IlpActionEventFactory instead.

Returns a new ActionEvent. Redefined to provide an IlpObjectActionEvent instance.

Overrides:
createActionEvent in class IlpAbstractInteractor
Parameters:
ctxt - The context where the event occurred.
state - The interaction's state.
modifiers - The modifiers associated with the recognized gesture.
See Also:
IlpAbstractInteractor.setActionEventFactory(ilog.cpl.interactor.IlpActionEventFactory)
Deprecated Since:
JTGO 4.0


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.