Class TLspKeyActionController
java.lang.Object
com.luciad.view.lightspeed.controller.ALspController
com.luciad.view.lightspeed.controller.ALspActionController
com.luciad.view.lightspeed.controller.TLspKeyActionController
- All Implemented Interfaces:
ILcdAWTEventListener,ILspController
A chainable controller that performs certain actions based on keyboard interaction.
To use this controller in a TLspFXView, use the
JavaFX-based constructor.
Note: Only the first pressed event will trigger an action. All other pressed events will have no effect until a released event is received.
- Since:
- 2012.0
-
Constructor Summary
ConstructorsConstructorDescriptionTLspKeyActionController(ILcdAction aAction, int aKeyCode) Constructor for aTLspKeyActionControllerthat will execute the passed action when a key identified by the passed key code is pressed.TLspKeyActionController(ILcdAction aAction, int aKeyCode, int aModifiers) Constructor for aTLspKeyActionControllerthat will execute the passed action when a key identified by the passed key code is pressed in combination with the specified modifiers.TLspKeyActionController(ILcdAction aPressedAction, ILcdAction aReleasedAction, int aKeyCode) Constructor for aTLspKeyActionController.TLspKeyActionController(ILcdAction aPressedAction, ILcdAction aReleasedAction, KeyCodeCombination aKeyCodeCombination) JavaFX-based constructor for aTLspKeyActionController. -
Method Summary
Modifier and TypeMethodDescriptionhandleAWTEventImpl(AWTEvent aAWTEvent) Called byhandleAWTEvent.handleFXEventImpl(Event aEvent) Called byhandleFXEvent.protected voidstartInteractionImpl(ILspView aView) The specific implementation ofstartInteractionfor this controller.protected voidterminateInteractionImpl(ILspView aView) The specific implementation ofterminateInteractionfor this controller.Methods inherited from class com.luciad.view.lightspeed.controller.ALspActionController
createActionEvent, performActionMethods 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, paint, paintImpl, registerViewPropertyNameForReset, removePropertyChangeListener, removeStatusListener, setAWTFilter, setCursor, setFXCursor, setFXFilter, setIcon, setName, setShortDescription, startInteraction, terminateInteraction
-
Constructor Details
-
TLspKeyActionController
Constructor for aTLspKeyActionControllerthat will execute the passed action when a key identified by the passed key code is pressed. No action will be executed when the key is released. The default modifiers are used, none. The "virtual key" constants defined inKeyEvent(KeyEvent.VK_*)can be used to specify the key code.- Parameters:
aAction- an action that will be called when the key corresponding toaKeyCodeis released.aKeyCode- the key code identifying the key this controller will interact with.
-
TLspKeyActionController
Constructor for aTLspKeyActionControllerthat will execute the passed action when a key identified by the passed key code is pressed in combination with the specified modifiers. No action will be executed when the key is released. The "virtual key" constants defined inKeyEvent(KeyEvent.VK_*)can be used to specify the key code. The modifiers can consist of any combination of:java.awt.event.InputEvent.SHIFT_DOWN_MASKjava.awt.event.InputEvent.CTRL_DOWN_MASKjava.awt.event.InputEvent.META_DOWN_MASKjava.awt.event.InputEvent.ALT_DOWN_MASKjava.awt.event.InputEvent.ALT_GRAPH_DOWN_MASK
0to indicate no modifiers.- Parameters:
aAction- an action that will be called when the key corresponding toaKeyCodeis released.aKeyCode- the key code identifying the key this controller will interact with.aModifiers- the modifiers that have to be present for the action to be triggered.
-
TLspKeyActionController
Constructor for aTLspKeyActionController. The pressed action will be executed when the specified key is pressed, the release action when the specified key is released. A typical use case is starting and stopping an animation. The default modifiers are used, none. The "virtual key" constants defined inKeyEvent(KeyEvent.VK_*)can be used to specify the key code.- Parameters:
aPressedAction- an action that will be called when the key corresponding toaKeyCodeis pressed.aReleasedAction- an action that will be called when the key corresponding toaKeyCodeis released.aKeyCode- the key code identifying the key this controller will interact with.
-
TLspKeyActionController
public TLspKeyActionController(ILcdAction aPressedAction, ILcdAction aReleasedAction, KeyCodeCombination aKeyCodeCombination) JavaFX-based constructor for aTLspKeyActionController. The pressed action will be executed when the specified key is pressed in combination with the specified modifiers, the release action when the specified key is released in combination with the specified modifiers. A typical use case is starting and stopping an animation.- Parameters:
aPressedAction- an action that will be called when the key corresponding toaKeyCodeCombinationis pressed.aReleasedAction- an action that will be called when the key corresponding toaKeyCodeCombinationis released.aKeyCodeCombination- the key code and modifier combination that will trigger this controller's actions- Since:
- 2020.0
-
-
Method Details
-
startInteractionImpl
Description copied from class:ALspControllerThe specific implementation ofstartInteractionfor this controller.- Overrides:
startInteractionImplin classALspController- Parameters:
aView- the view to start interaction with.
-
terminateInteractionImpl
Description copied from class:ALspControllerThe specific implementation ofterminateInteractionfor this controller.- Overrides:
terminateInteractionImplin classALspController- Parameters:
aView- the view to terminate interaction with.
-
handleAWTEventImpl
Description copied from class:ALspControllerCalled byhandleAWTEvent. Returnsnullwhen the controller consumed the event or a partially consumed event when the controller partially consumed the event (which could happen withTLcdTouchEvents). When the controller did not use the given event, it is returned unaltered.- Specified by:
handleAWTEventImplin classALspController- Parameters:
aAWTEvent- the event to be handled.- Returns:
nullwhen the input event was consumed, the (possibly modified) input event when it was (partially) consumed.
-
handleFXEventImpl
Description copied from class:ALspControllerCalled byhandleFXEvent. Returnsnullwhen the controller consumed the event. When the controller did not use the given event, it is returned unaltered.- Overrides:
handleFXEventImplin classALspController- Parameters:
aEvent- the event to be handled.- Returns:
nullwhen the input event was consumed, the (possibly modified) input event when it was (partially) consumed.
-