public class IlpGestureAction extends IlpInteractorAction
A gesture action is defined by the following attributes:
IlpGesture
) that is
recognized by the interactor.
Note that in the modifiers argument,
InputEvent.ALT_DOWN_MASK
should be used instead of
InputEvent.ALT_MASK
, and InputEvent.META_DOWN_MASK
should be used instead of InputEvent.META_MASK
,
because the values of ALT_MASK/BUTTON2_MASK
and
META_MASK/BUTTON3_MASK
overlap.
Action
) that specifies the operation
to be performed once the gesture is recognized.
This class can be used to configure interactors via the CSS. The following example illustrates how this configuration can be accomplished:
Interactor { viewInteractor: @+viewInt; } Subobject#viewInt { class: 'ilog.cpl.interactor.IlpDefaultViewInteractor'; action[0]: @+keyAction0; } Subobject#keyAction0 { class: 'ilog.cpl.interactor.IlpGestureAction'; gesture: BUTTON1_CLICKED; modifiers: shift; action: @+action0; } Subobject#action0 { class: 'mypackage.myActionClass'; }
Constructor and Description |
---|
IlpGestureAction()
Default constructor.
|
IlpGestureAction(IlpGesture g,
int m,
Action a)
Creates a new interactor action with the given configuration.
|
Modifier and Type | Method and Description |
---|---|
IlpGesture |
getGesture()
Returns the gesture that is recognized by the
interactor to trigger an action.
|
int |
getModifiers()
Returns the modifiers applied to the gesture in order to
trigger an action.
|
int |
getModifiersEx()
Returns the modifiers as defined since JDK 1.4 using XXX_DOWN_MASK
elements.
|
void |
setGesture(IlpGesture g)
Defines the gesture that is recognized by the
interactor to trigger an action.
|
void |
setModifiers(int modifiers)
Defines modifiers that are used together with the gesture
to define when an action should be triggered.
|
getAction, setAction
public IlpGestureAction()
public IlpGestureAction(IlpGesture g, int m, Action a)
g
- Gesture that triggers the action.m
- Gesture modifiers.a
- Action that is triggered.
Note: In the modifiers argument, InputEvent.ALT_DOWN_MASK
should be used instead of InputEvent.ALT_MASK
, and
InputEvent.META_DOWN_MASK
should be used instead of InputEvent.META_MASK
,
because the values of ALT_MASK/BUTTON2_MASK
and
META_MASK/BUTTON3_MASK
overlap.
public void setGesture(IlpGesture g)
g
- Gesture information.IlpGesture
public IlpGesture getGesture()
IlpGesture
public void setModifiers(int modifiers)
Note: In the modifiers argument, InputEvent.ALT_DOWN_MASK
should be used instead of InputEvent.ALT_MASK
, and
InputEvent.META_DOWN_MASK
should be used instead of InputEvent.META_MASK
,
because the values of ALT_MASK/BUTTON2_MASK
and
META_MASK/BUTTON3_MASK
overlap.
The following modifiers are accepted by gesture actions:
modifiers
- Gesture modifiers.public int getModifiers()
public int getModifiersEx()
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.