public class TabView extends ParentUiElement implements Navigatable
UiElement of tabs that can be switched between by the player| Modifier and Type | Field and Description |
|---|---|
protected org.mini2Dx.gdx.utils.Array<Tab> |
tabs |
asyncRemoveAll, children, renderNodedeferredLayout, deferredRender, deferredUpdate, effects, height, styleId, visibility, width, x, y, zIndex| Constructor and Description |
|---|
TabView()
Constructor.
|
TabView(java.lang.String id)
Constructor
|
TabView(java.lang.String id,
float x,
float y,
float width,
float height)
Constructor
|
TabView(java.lang.String id,
float x,
float y,
float width,
float height,
TabButton previousTabButton,
TabButton nextTabButton)
Constructor
|
TabView(java.lang.String id,
TabButton previousTabButton,
TabButton nextTabButton)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
Tab tab)
|
void |
add(Tab tab)
|
void |
clearGamePadHotkeys()
Unmaps all gamepad hotkeys
|
void |
clearHotkeys()
Unmaps all hotkeys
|
void |
clearKeyboardHotkeys()
Unmaps all keyboard hotkeys
|
boolean |
containsTab(Tab tab)
|
protected ParentRenderNode<?,?> |
createRenderNode(ParentRenderNode<?,?> parent)
Creates the
ParentRenderNode for this UiElement |
Tab |
getCurrentTab()
Returns the currently visible
Tab |
int |
getCurrentTabIndex()
Returns the index of the currently visible
Tab |
UiElement |
getElementById(java.lang.String id)
Searches the UI for a
UiElement with a given id. |
UiNavigation |
getNavigation()
Returns the
UiNavigation currently being navigated |
TabButton |
getNextTabButton() |
TabButton |
getPreviousTabButton() |
StyleRule |
getStyleRule() |
Tab |
getTab(int index)
Returns the
Tab at a specific index |
int |
getTotalTabs()
Returns the total number of tabs in this
TabView |
ActionableRenderNode |
hotkey(GamePadButton button)
Returns the corresponding
ActionableRenderNode mapped to a GamePadButton hotkey |
ActionableRenderNode |
hotkey(int keycode)
Returns the corresponding
ActionableRenderNode mapped to a keyboard hotkey |
ActionableRenderNode |
navigate(int keycode)
Triggers a navigation and returns the newly highlighted
ActionableRenderNode |
void |
nextTab()
Navigates to the next
Tab. |
void |
previousTab()
Navigates to the previous
Tab. |
Tab |
remove(int index)
|
boolean |
remove(Tab tab)
|
void |
setCurrentTab(Tab tab)
Sets the currently visible
Tab |
void |
setCurrentTabIndex(int currentTabIndex)
Sets the currently visible
Tab |
void |
setHotkey(GamePadButton button,
Actionable actionable)
Maps a
GamePadButton to a Actionable |
void |
setHotkey(int keycode,
Actionable actionable)
Maps a keyboard button to a
Actionable |
void |
setNextTabButtonLayout(java.lang.String flexLayout) |
void |
setNextTabHotkey(GamePadButton button)
Sets a
GamePadButton as the hotkey for changing to the next tab |
void |
setNextTabHotkey(int keycode)
Sets a keyboard key as the hotkey for changing to the next tab
|
void |
setPreviousTabButtonLayout(java.lang.String flexLayout) |
void |
setPreviousTabHotkey(GamePadButton button)
Sets a
GamePadButton as the hotkey for changing to the previous tab |
void |
setPreviousTabHotkey(int keycode)
Sets a keyboard key as the hotkey for changing to the previous tab
|
void |
setStyleId(java.lang.String styleId)
Sets the style if for this
UiElement |
void |
setTabButtonLayout(java.lang.String flexLayout) |
void |
setVisibility(Visibility visibility)
Sets the current
Visibility of this UiElement |
void |
setZIndex(int zIndex)
Sets the Z index of this
UiElement. |
void |
syncWithLayout(UiContainerRenderTree rootNode)
Syncs data between the
UiElement and RenderNode during UI layout |
void |
syncWithUpdate(UiContainerRenderTree rootNode)
Syncs data between the
UiElement and RenderNode during update |
void |
unsetHotkey(GamePadButton button)
Unmaps a
GamePadButton hotkey |
void |
unsetHotkey(int keycode)
Unmaps a keyboard hotkey
|
void |
unsetNextTabHotkey(GamePadButton button)
Unets a
GamePadButton as the hotkey for changing to the next tab |
void |
unsetNextTabHotkey(int keycode)
Unsets a keyboard key as the hotkey for changing to the next tab
|
void |
unsetPreviousTabHotkey(GamePadButton button)
Unets a
GamePadButton as the hotkey for changing to the previous tab |
void |
unsetPreviousTabHotkey(int keycode)
Unsets a keyboard key as the hotkey for changing to the previous tab
|
add, add, attach, detach, get, getChild, getFlexLayout, getRenderHeight, getRenderWidth, getRenderX, getRenderY, getTotalChildren, invokeBeginHover, invokeEndHover, isFlexLayout, isInitialLayoutOccurred, isInitialUpdateOccurred, isOverflowClipped, isRenderNodeDirty, remove, removeAll, removeAllAsync, setFlex, setFlexLayout, setHeightFlex, setOverflowClipped, setRenderNodeDirty, setWidthFlex, setXFlex, setXYFlex, setYFlex, shrinkToContents, shrinkToContentsaddEffectListener, addHoverListener, addNodeStateListener, alignAbove, alignBelow, alignEdgeToEdge, alignLeftOf, alignRightOf, applyEffect, deferUntilLayout, deferUntilLayout, deferUntilRender, deferUntilRender, deferUntilUpdate, deferUntilUpdate, deferUntilUpdate, deferUntilUpdate, equals, getContentHeight, getContentWidth, getHeight, getId, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getStyleId, getVisibility, getWidth, getX, getY, getZIndex, hashCode, isDebugEnabled, isInitialised, notifyEffectListenersOnFinished, notifyHoverListenersOnBeginHover, notifyHoverListenersOnEndHover, notifyNodeStateListeners, removeEffectListener, removeHoverListener, removeNodeStateListener, set, setContentHeight, setContentWidth, setDebugEnabled, setHeight, setHeightToContentHeightOf, setHeightToHeightOf, setWidth, setWidthToContentWidthOf, setWidthToWidthOf, setX, setXY, setY, snapTo, snapTo, syncWithRenderclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetIdprotected final org.mini2Dx.gdx.utils.Array<Tab> tabs
public TabView()
TabViewpublic TabView(java.lang.String id)
id - The unique ID of this TabViewpublic TabView(java.lang.String id,
float x,
float y,
float width,
float height)
id - The unique ID for this element (if null an ID will be generated)x - The x coordinate of this element relative to its parenty - The y coordinate of this element relative to its parentwidth - The width of this elementheight - The height of this elementpublic TabView(java.lang.String id,
TabButton previousTabButton,
TabButton nextTabButton)
public TabView(java.lang.String id,
float x,
float y,
float width,
float height,
TabButton previousTabButton,
TabButton nextTabButton)
id - The unique ID of this TabViewx - The x coordinate of this element relative to its parenty - The y coordinate of this element relative to its parentwidth - The width of this elementheight - The height of this elementpreviousTabButton - The TabButton to use for changing to the previous tabnextTabButton - The TabButton to use for changing to the next tabpublic void add(int index,
Tab tab)
index - The index to insert attab - The Tab to insertpublic boolean remove(Tab tab)
public Tab remove(int index)
remove in class ParentUiElementindex - The index to removeTab that was removedpublic boolean containsTab(Tab tab)
public int getTotalTabs()
TabViewTabs have been addedpublic void syncWithLayout(UiContainerRenderTree rootNode)
UiElementUiElement and RenderNode during UI layoutsyncWithLayout in class UiElementpublic void syncWithUpdate(UiContainerRenderTree rootNode)
UiElementUiElement and RenderNode during updatesyncWithUpdate in class ParentUiElementprotected ParentRenderNode<?,?> createRenderNode(ParentRenderNode<?,?> parent)
ParentUiElementParentRenderNode for this UiElementcreateRenderNode in class ParentUiElementparent - The parent of this nodeParentRenderNodepublic void setVisibility(Visibility visibility)
UiElementVisibility of this UiElementsetVisibility in class ParentUiElementvisibility - The Visibility to setpublic void setStyleId(java.lang.String styleId)
UiElementUiElementsetStyleId in class ParentUiElementstyleId - The style id to setpublic void setZIndex(int zIndex)
UiElementUiElement. Elements will be rendered on
different Z layers in ascending Z order (negatives values first, positive values last)setZIndex in class ParentUiElementzIndex - The Z indexpublic StyleRule getStyleRule()
getStyleRule in class UiElementpublic Tab getCurrentTab()
TabTab is visiblepublic int getCurrentTabIndex()
Tabpublic void setCurrentTabIndex(int currentTabIndex)
TabcurrentTabIndex - The index of the Tabpublic void nextTab()
Tab. If the current tab is the last tab,
this will loop back to the first tab.public void previousTab()
Tab. If the current tab is the first
tab, this will loop to the last tab.public ActionableRenderNode navigate(int keycode)
NavigatableActionableRenderNodenavigate in interface Navigatablekeycode - The navigation Input.Keys valueUiNavigation is availablepublic ActionableRenderNode hotkey(int keycode)
NavigatableActionableRenderNode mapped to a keyboard hotkeyhotkey in interface Navigatablekeycode - The Input.Keys keycode that is the hotkeypublic ActionableRenderNode hotkey(GamePadButton button)
NavigatableActionableRenderNode mapped to a GamePadButton hotkeyhotkey in interface Navigatablebutton - The GamePadButton that is the hotkeypublic UiNavigation getNavigation()
NavigatableUiNavigation currently being navigatedgetNavigation in interface Navigatablepublic void setPreviousTabHotkey(int keycode)
keycode - The Input.Keys keycodepublic void setPreviousTabHotkey(GamePadButton button)
GamePadButton as the hotkey for changing to the previous tabbutton - The GamePadButtonpublic void setNextTabHotkey(int keycode)
keycode - The Input.Keys keycodepublic void setNextTabHotkey(GamePadButton button)
GamePadButton as the hotkey for changing to the next tabbutton - The GamePadButtonpublic void unsetPreviousTabHotkey(int keycode)
keycode - The Input.Keys keycodepublic void unsetPreviousTabHotkey(GamePadButton button)
GamePadButton as the hotkey for changing to the previous tabbutton - The GamePadButtonpublic void unsetNextTabHotkey(int keycode)
keycode - The Input.Keys keycodepublic void unsetNextTabHotkey(GamePadButton button)
GamePadButton as the hotkey for changing to the next tabbutton - The GamePadButtonpublic void setHotkey(GamePadButton button, Actionable actionable)
NavigatableGamePadButton to a ActionablesetHotkey in interface Navigatablebutton - The GamePadButton that is the hotkeyactionable - The Actionable to trigger when the hotkey is pressedpublic void setHotkey(int keycode,
Actionable actionable)
NavigatableActionablesetHotkey in interface Navigatablekeycode - The Input.Keys keycode that is the hotkeyactionable - The Actionable to trigger when the key is pressedpublic void unsetHotkey(GamePadButton button)
NavigatableGamePadButton hotkeyunsetHotkey in interface Navigatablebutton - The GamePadButton that is the hotkeypublic void unsetHotkey(int keycode)
NavigatableunsetHotkey in interface Navigatablekeycode - The Input.Keys keycode that is the hotkeypublic void clearGamePadHotkeys()
NavigatableclearGamePadHotkeys in interface Navigatablepublic void clearKeyboardHotkeys()
NavigatableclearKeyboardHotkeys in interface Navigatablepublic void clearHotkeys()
NavigatableclearHotkeys in interface Navigatablepublic void setPreviousTabButtonLayout(java.lang.String flexLayout)
public void setNextTabButtonLayout(java.lang.String flexLayout)
public void setTabButtonLayout(java.lang.String flexLayout)
public TabButton getPreviousTabButton()
public TabButton getNextTabButton()
public UiElement getElementById(java.lang.String id)
UiElementUiElement with a given id. Warning: This
can be an expensive operation for complex UIs. It is recommended you
cache results.getElementById in class ParentUiElementid - The UiElement identifier to search forUiElement with the given id