A concrete behavior implementation should do the following:
populateSkinInputMap() method, in which map control's function tags to
the behavior methods, map key bindings to the function tags, add additional event handlers, using
registerFunction(FunctionTag, Runnable),
registerKey(KeyBinding, FunctionTag),
registerKey(KeyCode, FunctionTag),
and
addHandler() methods correspondingly.
@Override
public void install() {
super.install();
setSkinInputMap(behavior.getSkinInputMap());
}
| Modifier and Type | Field and Description |
|---|---|
| private final C | |
| private SkinInputMap. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected final < the actual event type T extends Event> void | addHandler(EventType<T>
the event type type, EventHandler<T> the event handler handler)Adds an event handler for the specified event type, in the context of this Behavior. |
| protected final < the actual event type T extends Event> void | addHandler(EventCriteria<T>
the matching criteria criteria, EventHandler<T> the event handler handler)Adds an event handler for the specific event criteria, in the context of this Behavior. |
| protected final void | duplicateMapping(KeyBinding
the existing key binding existing, KeyBinding the new key binding newk)This convenience method registers a copy of the behavior-specific mappings from one key binding to another. |
| protected final C | |
| public final SkinInputMap. | |
| protected final boolean | Returns: true on a Linux platformReturns true if this method is invoked on a Linux platform. |
| protected final boolean | Returns: true on a Mac OS platformReturns true if this method is invoked on a Mac OS platform. |
| protected final boolean | Returns: true on a Windows platformReturns true if this method is invoked on a Windows platform. |
| protected abstract void | populateSkinInputMap()
In this method, which is called by |
| protected final void | register(FunctionTag
the function tag tag, KeyBinding the key binding k, Runnable the function func)This convenience method maps the function tag to the specified function, and at the same time maps the specified key binding to that function tag. |
| protected final void | register(FunctionTag
the function tag tag, KeyBinding the key binding k, BooleanSupplier the function func)This convenience method maps the function tag to the specified function, and at the same time maps the specified key binding to that function tag. |
| protected final void | register(FunctionTag
the function tag tag, KeyCode the key code code, Runnable the function func)This convenience method maps the function tag to the specified function, and at the same time maps the specified key binding to that function tag. |
| protected final void | registerFunction(FunctionTag
the function tag tag, Runnable the function function)Maps a function to the specified function tag. |
| protected final void | registerFunction(FunctionTag
the function tag tag, BooleanSupplier the function function)Maps a function to the specified function tag. |
| protected final void | registerKey(KeyBinding
the key binding k, FunctionTag the function tag tag)Maps a key binding to the specified function tag. |
| protected final void | registerKey(KeyCode
the key code to construct a code, FunctionTag KeyBindingthe function tag tag)Maps a key binding to the specified function tag. |
| private void | traverse(TraversalDirection
The direction to traverse dir)Called by any of the BehaviorBase traverse methods to actually effect a traversal of the focus. |
| public final void | traverseDown()
Calls the focus traversal engine and indicates that traversal should go the next focusTraversable Node below the current one. |
| public final void | traverseLeft()
Calls the focus traversal engine and indicates that traversal should go the next focusTraversable Node left of the current one. |
| public final void | traverseNext()
Calls the focus traversal engine and indicates that traversal should go the next focusTraversable Node in the focus traversal cycle. |
| public final void | traversePrevious()
Calls the focus traversal engine and indicates that traversal should go the previous focusTraversable Node in the focus traversal cycle. |
| public final void | traverseRight()
Calls the focus traversal engine and indicates that traversal should go the next focusTraversable Node right of the current one. |
| public final void | traverseUp()
Calls the focus traversal engine and indicates that traversal should go the next focusTraversable Node above the current one. |
| control | back to summary |
|---|---|
| private final C control | |
| skinInputMap | back to summary |
|---|---|
| private SkinInputMap. | |
| BehaviorBase | back to summary |
|---|---|
| public BehaviorBase(C c) The constructor.
| |
| addHandler | back to summary |
|---|---|
| protected final <T extends Event> void addHandler(EventType<T> type, EventHandler<T> handler) Adds an event handler for the specified event type, in the context of this Behavior.
| |
| addHandler | back to summary |
|---|---|
| protected final <T extends Event> void addHandler(EventCriteria<T> criteria, EventHandler<T> handler) Adds an event handler for the specific event criteria, in the context of this Behavior.
This is a more specific version of
| |
| duplicateMapping | back to summary |
|---|---|
| protected final void duplicateMapping(KeyBinding existing, KeyBinding newk) This convenience method registers a copy of the behavior-specific mappings from one key binding to another. The method does nothing if no behavior specific mapping can be found.
| |
| getControl | back to summary |
|---|---|
| protected final C getControl() Returns the associated Control instance.
| |
| getSkinInputMap | back to summary |
|---|---|
| public final SkinInputMap. Returns the skin input map associated with this behavior.
| |
| isLinux | back to summary |
|---|---|
| protected final boolean isLinux() Returns true if this method is invoked on a Linux platform.
| |
| isMac | back to summary |
|---|---|
| protected final boolean isMac() Returns true if this method is invoked on a Mac OS platform.
| |
| isWindows | back to summary |
|---|---|
| protected final boolean isWindows() Returns true if this method is invoked on a Windows platform.
| |
| populateSkinInputMap | back to summary |
|---|---|
| protected abstract void populateSkinInputMap() In this method, which is called by If a subclass overrides this method, it is important to call the superclass implementation. | |
| register | back to summary |
|---|---|
| protected final void register(FunctionTag tag, KeyBinding k, Runnable func) This convenience method maps the function tag to the specified function, and at the same time maps the specified key binding to that function tag.
| |
| register | back to summary |
|---|---|
| protected final void register(FunctionTag tag, KeyBinding k, BooleanSupplier func) This convenience method maps the function tag to the specified function, and at the same time maps the specified key binding to that function tag.
The event which triggered execution of the function will be consumed if the function returns
| |
| register | back to summary |
|---|---|
| protected final void register(FunctionTag tag, KeyCode code, Runnable func) This convenience method maps the function tag to the specified function, and at the same time maps the specified key binding to that function tag.
| |
| registerFunction | back to summary |
|---|---|
| protected final void registerFunction(FunctionTag tag, Runnable function) Maps a function to the specified function tag.
| |
| registerFunction | back to summary |
|---|---|
| protected final void registerFunction(FunctionTag tag, BooleanSupplier function) Maps a function to the specified function tag.
The event which triggered execution of the function will be consumed if the function returns
| |
| registerKey | back to summary |
|---|---|
| protected final void registerKey(KeyBinding k, FunctionTag tag) Maps a key binding to the specified function tag. A null key binding will result in no change to this input map. This method will not override a user mapping.
| |
| registerKey | back to summary |
|---|---|
| protected final void registerKey(KeyCode code, FunctionTag tag) Maps a key binding to the specified function tag.
This method will not override a user mapping added by
| |
| traverse | back to summary |
|---|---|
| private void traverse(TraversalDirection dir) Called by any of the BehaviorBase traverse methods to actually effect a traversal of the focus. The default behavior of this method is to simply traverse on the given node, passing the given direction. A subclass may override this method.
| |
| traverseDown | back to summary |
|---|---|
| public final void traverseDown() Calls the focus traversal engine and indicates that traversal should go the next focusTraversable Node below the current one. | |
| traverseLeft | back to summary |
|---|---|
| public final void traverseLeft() Calls the focus traversal engine and indicates that traversal should go the next focusTraversable Node left of the current one. | |
| traverseNext | back to summary |
|---|---|
| public final void traverseNext() Calls the focus traversal engine and indicates that traversal should go the next focusTraversable Node in the focus traversal cycle. | |
| traversePrevious | back to summary |
|---|---|
| public final void traversePrevious() Calls the focus traversal engine and indicates that traversal should go the previous focusTraversable Node in the focus traversal cycle. | |
| traverseRight | back to summary |
|---|---|
| public final void traverseRight() Calls the focus traversal engine and indicates that traversal should go the next focusTraversable Node right of the current one. | |
| traverseUp | back to summary |
|---|---|
| public final void traverseUp() Calls the focus traversal engine and indicates that traversal should go the next focusTraversable Node above the current one. | |