public class TLspClickActionController extends ALspActionController
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.
Constructor and Description |
---|
TLspClickActionController(ILcdAction aAction,
int aClickCount)
Constructor for
TLspClickActionController . |
Modifier and Type | Method and Description |
---|---|
ILcdAction |
getAction()
Returns the action that will be triggered once the configured click count is reached.
|
AWTEvent |
handleAWTEventImpl(AWTEvent aAWTEvent)
Called by
handleAWTEvent . |
void |
setAction(ILcdAction aAction)
Sets the action that wil be triggered once the configured click count is reached.
|
createActionEvent, performAction
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
public TLspClickActionController(ILcdAction aAction, int aClickCount)
TLspClickActionController
. The passed action will be triggered after
a number of mouse clicks corresponding to the passed click count.aAction
- The action to trigger.aClickCount
- How many clicks it takes to trigger the action.public ILcdAction getAction()
public void setAction(ILcdAction aAction)
aAction
- the action to trigger.public AWTEvent handleAWTEventImpl(AWTEvent aAWTEvent)
ALspController
handleAWTEvent
.
Returns null
when the controller consumed the event or a partially consumed event
when the controller partially consumed the event (which could happen with
TLcdTouchEvent
s). When the controller did not use the given event, it is returned
unaltered.handleAWTEventImpl
in class ALspController
aAWTEvent
- the event to be handled.null
when the input event was consumed, the (possibly modified) input
event when it was (partially) consumed.