public interface InteractableContainer
| Modifier and Type | Method and Description |
|---|---|
void |
addShortcut(char character,
boolean withCtrl,
boolean withAlt,
Action action)
Adds a keyboard shortcut to be invoked when the
Interactable component in focus
within this container didn't handle the keyboard event and the event matches the supplied
character and control key status. |
void |
addShortcut(Key.Kind key,
Action action)
Adds a keyboard shortcut to be invoked when the
Interactable component in focus
within this container didn't handle the keyboard event and the event matches the supplied
Key.Kind. |
boolean |
hasInteractable(Interactable interactable)
Returns true if this container contains the
interactable passed in as the parameter |
Interactable |
nextFocus(Interactable fromThis)
Given an interactable, find the next one in line to receive focus.
|
Interactable |
previousFocus(Interactable fromThis)
Given an interactable, find the previous one in line to receive focus.
|
boolean |
triggerShortcut(Key key)
Looks for a shortcut that matches this
key and, if one is found, executes it. |
boolean hasInteractable(Interactable interactable)
interactable passed in as the parameterinteractable - interactable to look fortrue if the container has interactable, otherwise falseInteractable nextFocus(Interactable fromThis)
fromThis - Component from which to get the next interactable, or if
null, pick the first available interactableInteractable previousFocus(Interactable fromThis)
fromThis - Component from which to get the previous interactable,
or if null, pick the last interactable in the listvoid addShortcut(Key.Kind key, Action action)
Interactable component in focus
within this container didn't handle the keyboard event and the event matches the supplied
Key.Kind. Please note that calling addShortcut with
Key.Kind.NormalKey will throw IllegalArgumentException; if you want to add
a keyboard shortcut for a non-special key, please use
addShortcut(char, boolean, boolean, Action).key - Kind of key to trigger the shortcutaction - Action to run, on the event thread, when the shortcut is triggeredvoid addShortcut(char character,
boolean withCtrl,
boolean withAlt,
Action action)
Interactable component in focus
within this container didn't handle the keyboard event and the event matches the supplied
character and control key status. If you want to add a keyboard shortcut for a special keys,
please use addShortcut(Key.Kind, Action).character - Character types on the keyboard to trigger the shortcutwithCtrl - If true, ctrl key must be down when the key is typed to trigger;
if false the ctrl key must be up to triggerwithAlt - If true, alt key must be down when the key is typed to trigger;
if false the alt key must be up to triggeraction - Action to run, on the event thread, when the shortcut is triggeredboolean triggerShortcut(Key key)
key and, if one is found, executes it.key - Key to check for matching shortcutstrue if a shortcut was triggered and executed, false otherwise.Copyright © 2015. All Rights Reserved.