Package com.simsilica.lemur.core
Class FocusTraversalAdapter
java.lang.Object
com.simsilica.lemur.core.FocusTraversalAdapter
- All Implemented Interfaces:
FocusTraversal
Wraps a standard GuiLayout to provide basic default focus
navigation support. Essentially, things like Left, Right, Up, Down
are directly wired to Next, Previous and the GuiLayout's child
list is used for ordering.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.simsilica.lemur.focus.FocusTraversal
FocusTraversal.TraversalDirection
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the focusable element that should receive focus when first entering this container level.protected Spatial
getFirst()
protected Spatial
getLast()
protected Spatial
protected Spatial
getPrevious
(Spatial from) getRelativeFocus
(Spatial from, FocusTraversal.TraversalDirection direction) Returns the relative focusable element from the specified element in the specified direction as defined by this focus container's implementation of that direction's policy.boolean
Returns true if this is the root of a focus container hierarchy and navigation should not be permitted out of the container.void
setFocusRoot
(boolean b) void
-
Constructor Details
-
FocusTraversalAdapter
-
-
Method Details
-
setLayout
-
getLayout
-
getDefaultFocus
Description copied from interface:FocusTraversal
Returns the focusable element that should receive focus when first entering this container level.- Specified by:
getDefaultFocus
in interfaceFocusTraversal
-
getRelativeFocus
Description copied from interface:FocusTraversal
Returns the relative focusable element from the specified element in the specified direction as defined by this focus container's implementation of that direction's policy.- Specified by:
getRelativeFocus
in interfaceFocusTraversal
-
setFocusRoot
public void setFocusRoot(boolean b) -
isFocusRoot
public boolean isFocusRoot()Description copied from interface:FocusTraversal
Returns true if this is the root of a focus container hierarchy and navigation should not be permitted out of the container. This is commonly used for root-level windows are any container where the user must initiate a specific action to change contexts.- Specified by:
isFocusRoot
in interfaceFocusTraversal
-
getFirst
-
getLast
-
getNext
-
getPrevious
-