public class VerticalUiNavigation extends java.lang.Object implements UiNavigation
UiNavigation
implementation that treats all UiElement
s as
stacked verticallyConstructor and Description |
---|
VerticalUiNavigation() |
Modifier and Type | Method and Description |
---|---|
void |
add(Actionable actionable)
Adds a
Actionable to end of the navigation |
Actionable |
getCursor()
Returns the
Actionable highlighted by the cursor |
void |
layout(ScreenSize screenSize)
Re-orders elements based on screen size if necessary
|
Actionable |
navigate(int keycode)
Update (if required) navigation from key input
|
void |
remove(Actionable actionable)
Removes a
Actionable from the navigation and shifts any following
Actionable s by 1 place |
void |
removeAll()
Removes all
Actionable instances from the navigation |
Actionable |
resetCursor()
Resets the selection back to the first
Actionable |
void |
set(int index,
Actionable actionable)
Replace an
Actionable at a specific index |
public void add(Actionable actionable)
UiNavigation
Actionable
to end of the navigationadd
in interface UiNavigation
actionable
- The Actionable
to addpublic void remove(Actionable actionable)
UiNavigation
Actionable
from the navigation and shifts any following
Actionable
s by 1 placeremove
in interface UiNavigation
actionable
- The Actionable
to removepublic void removeAll()
UiNavigation
Actionable
instances from the navigationremoveAll
in interface UiNavigation
public void set(int index, Actionable actionable)
UiNavigation
Actionable
at a specific indexset
in interface UiNavigation
index
- The index to replaceactionable
- The new Actionable
public Actionable navigate(int keycode)
UiNavigation
navigate
in interface UiNavigation
keycode
- The key that was pressedActionable
public Actionable resetCursor()
UiNavigation
Actionable
resetCursor
in interface UiNavigation
Actionable
public Actionable getCursor()
UiNavigation
Actionable
highlighted by the cursorgetCursor
in interface UiNavigation
Actionable
public void layout(ScreenSize screenSize)
UiNavigation
layout
in interface UiNavigation
screenSize
- The current ScreenSize