public class GridUiNavigation extends java.lang.Object implements UiNavigation
UiNavigation implementation that treats all UiElements as
 placed inside a grid| Constructor and Description | 
|---|
| GridUiNavigation(int xsColumns)Constructor | 
| Modifier and Type | Method and Description | 
|---|---|
| void | add(Actionable actionable)Adds a  Actionableto end of the navigation | 
| Actionable | get(int x,
   int y) | 
| Actionable | getCursor()Returns the  Actionablehighlighted by the cursor | 
| int | getTotalColumns()Returns the total amount of columns for the current  ScreenSize | 
| int | getTotalRows()Returns the total amount of rows for the current  ScreenSize | 
| 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 | onHoverBegin(Hoverable source)Called when the mouse begins hovering a  Hoverable | 
| void | onHoverEnd(Hoverable source)Called when the mouse finishes hovering a  Hoverable | 
| void | remove(Actionable actionable)Removes a  Actionablefrom the navigation and shifts any followingActionables by 1 place | 
| void | removeAll()Removes all  Actionableinstances from the navigation | 
| Actionable | resetCursor()Resets the selection back to the first  Actionable | 
| Actionable | resetCursor(boolean triggerHoverEvent)Resets the selection back to the first  Actionable | 
| void | set(int index,
   Actionable actionable)Replace an  Actionableat a specific index | 
| void | set(int x,
   int y,
   Actionable actionable)Replaces the  Actionableat the specified grid coordinate | 
| void | setWidth(ScreenSize screenSize,
        int columns)Sets the amount columns of the grid on a specific  ScreenSize | 
| java.lang.String | toString() | 
public GridUiNavigation(int xsColumns)
xsColumns - The amount of columns of the grid on a ScreenSize.XS screenpublic void layout(ScreenSize screenSize)
UiNavigationlayout in interface UiNavigationscreenSize - The current ScreenSizepublic void add(Actionable actionable)
UiNavigationActionable to end of the navigationadd in interface UiNavigationactionable - The Actionable to addpublic void remove(Actionable actionable)
UiNavigationActionable from the navigation and shifts any following
 Actionables by 1 placeremove in interface UiNavigationactionable - The Actionable to removepublic void removeAll()
UiNavigationActionable instances from the navigationremoveAll in interface UiNavigationpublic void set(int index,
                Actionable actionable)
UiNavigationActionable at a specific indexset in interface UiNavigationindex - The index to replaceactionable - The new Actionablepublic Actionable get(int x, int y)
public void set(int x,
                int y,
                Actionable actionable)
Actionable at the specified grid coordinatex - The grid x coordinatey - The grid y coordinateactionable - The new Actionablepublic Actionable navigate(int keycode)
UiNavigationnavigate in interface UiNavigationkeycode - The key that was pressedActionablepublic Actionable getCursor()
UiNavigationActionable highlighted by the cursorgetCursor in interface UiNavigationActionablepublic Actionable resetCursor()
UiNavigationActionableresetCursor in interface UiNavigationActionablepublic Actionable resetCursor(boolean triggerHoverEvent)
UiNavigationActionableresetCursor in interface UiNavigationtriggerHoverEvent - True if a hover event should be triggered. Typically used when a controller is being used for navigation.Actionablepublic void setWidth(ScreenSize screenSize, int columns)
ScreenSizescreenSize - The ScreenSizecolumns - The amount of columns in the gridpublic int getTotalColumns()
ScreenSizepublic int getTotalRows()
ScreenSizepublic java.lang.String toString()
toString in class java.lang.Objectpublic void onHoverBegin(Hoverable source)
HoverListenerHoverableonHoverBegin in interface HoverListenersource - The Hoverable that the mouse began hoveringpublic void onHoverEnd(Hoverable source)
HoverListenerHoverableonHoverEnd in interface HoverListenersource - The Hoverable that the mouse finished hovering