Class TLspClickActionController
- All Implemented Interfaces:
ILcdAWTEventListener
,ILspController
This controller will execute a given action based on MOUSE_CLICKED
events. Only when
the number of clicks reaches the chosen click count, will the action be executed. There will be a slight
delay to make sure no further click is received. As soon as is apparent that the required number of clicks
is not going to be reached or is going to be exceeded, all relevant events (MOUSE_PRESSED
,
MOUSE_RELEASED
, MOUSE_CLICKED
)are passed to the next controller
in the chain. Note that the value of the AWT toolkit property "awt.multiClickInterval" is used
to check the exact number of clicks. Increasing this value might make it easier to pull off multi-clicks.
Note: This controller only handles MouseEvent
s. All other events are immediately passed
to the next controller in the chain.
Note: If you append more then one controller of this kind, to avoid consecutive multi click delays, append them in order of click count, for instance first the double click controller, then the triple click controller.
Warning: This controller will only behave correctly if it receives all relevant mouse events.
For instance if it gets a MOUSE_PRESSED
, it needs to receive all MOUSE_DRAGGED
,
MOUSE_RELEASED
and MOUSE_CLICKED
events that correspond with it. This means you have
be careful when applying filters, or when appending this controller after other chainable controllers which
might consume some of these events.
- Since:
- 2012.0
-
Constructor Summary
ConstructorDescriptionTLspClickActionController
(ILcdAction aAction, int aClickCount) Constructor forTLspClickActionController
. -
Method Summary
Modifier and TypeMethodDescriptionReturns the action that will be triggered once the configured click count is reached.handleAWTEventImpl
(AWTEvent aAWTEvent) Called byhandleAWTEvent
.void
setAction
(ILcdAction aAction) Sets the action that wil be triggered once the configured click count is reached.Methods inherited from class com.luciad.view.lightspeed.controller.ALspActionController
createActionEvent, performAction
Methods inherited from class com.luciad.view.lightspeed.controller.ALspController
addPropertyChangeListener, addStatusListener, appendController, firePropertyChange, fireStatusEvent, getAWTFilter, getCursor, getFXCursor, getFXFilter, getIcon, getLayered, getName, getNextController, getShortDescription, getView, handleAWTEvent, handleFXEvent, handleFXEventImpl, paint, paintImpl, registerViewPropertyNameForReset, removePropertyChangeListener, removeStatusListener, setAWTFilter, setCursor, setFXCursor, setFXFilter, setIcon, setName, setShortDescription, startInteraction, startInteractionImpl, terminateInteraction, terminateInteractionImpl
-
Constructor Details
-
TLspClickActionController
Constructor forTLspClickActionController
. The passed action will be triggered after a number of mouse clicks corresponding to the passed click count.- Parameters:
aAction
- The action to trigger.aClickCount
- How many clicks it takes to trigger the action.
-
-
Method Details
-
getAction
Returns the action that will be triggered once the configured click count is reached.- Returns:
- the action to trigger.
-
setAction
Sets the action that wil be triggered once the configured click count is reached.- Parameters:
aAction
- the action to trigger.
-
handleAWTEventImpl
Description copied from class:ALspController
Called byhandleAWTEvent
. Returnsnull
when the controller consumed the event or a partially consumed event when the controller partially consumed the event (which could happen withTLcdTouchEvent
s). When the controller did not use the given event, it is returned unaltered.- Specified by:
handleAWTEventImpl
in classALspController
- Parameters:
aAWTEvent
- the event to be handled.- Returns:
null
when the input event was consumed, the (possibly modified) input event when it was (partially) consumed.
-