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 TabViewRenderNode |
renderNode |
protected java.util.List<Tab> |
tabs |
asyncAddQueue, asyncRemoveAll, asyncRemoveQueue, childreneffects, styleId, visibility, zIndex| Constructor and Description |
|---|
TabView()
Constructor.
|
TabView(java.lang.String id)
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 |
attach(ParentRenderNode<?,?> parentRenderNode)
Attaches a
RenderNode for this element to a parent
RenderNode |
boolean |
containsTab(Tab tab)
|
protected ParentRenderNode<?,?> |
createRenderNode(ParentRenderNode<?,?> parent)
Creates the
ParentRenderNode for this UiElement |
void |
detach(ParentRenderNode<?,?> parentRenderNode)
Detaches this element's
RenderNode from a parent
RenderNode |
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. |
java.lang.String |
getLayout()
Returns the current layout
|
UiNavigation |
getNavigation()
Returns the
UiNavigation currently being navigated |
TabButton |
getNextTabButton() |
TabButton |
getPreviousTabButton() |
Tab |
getTab(int index)
Returns the
Tab at a specific index |
int |
getTotalTabs()
Returns the total number of tabs in this
TabView |
ActionableRenderNode |
hotkey(ControllerButton button)
Returns the corresponding
ActionableRenderNode mapped to a ControllerButton 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(ControllerButton button,
Actionable actionable)
Maps a
ControllerButton to a Actionable |
void |
setHotkey(int keycode,
Actionable actionable)
Maps a keyboard button to a
Actionable |
void |
setLayout(java.lang.String layout)
Sets the current layout
|
void |
setNextTabButtonLayout(java.lang.String layout) |
void |
setNextTabHotkey(ControllerButton button)
Sets a
ControllerButton 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 layout) |
void |
setPreviousTabHotkey(ControllerButton button)
Sets a
ControllerButton 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 layout) |
void |
setVisibility(Visibility visibility)
Sets the current
Visibility of this UiElement |
void |
setZIndex(int zIndex)
Sets the Z index of this
UiElement. |
void |
syncWithRenderNode()
Syncs data between the
UiElement and RenderNode |
void |
unsetHotkey(ControllerButton button)
Unmaps a
ControllerButton hotkey |
void |
unsetHotkey(int keycode)
Unmaps a keyboard hotkey
|
void |
unsetNextTabHotkey(ControllerButton button)
Unets a
ControllerButton 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(ControllerButton button)
Unets a
ControllerButton 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, addAsync, getFlexDirection, getTotalChildren, remove, removeAll, removeAllAsync, removeAsync, setFlexDirectionaddEffectListener, addHoverListener, applyEffect, equals, getId, getStyleId, getVisibility, getZIndex, hashCode, isDebugEnabled, notifyEffectListenersOnFinished, notifyHoverListenersOnBeginHover, notifyHoverListenersOnEndHover, removeEffectListener, removeHoverListener, setDebugEnabledclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetIdprotected TabViewRenderNode renderNode
protected final java.util.List<Tab> tabs
public TabView()
TabViewpublic TabView(java.lang.String id)
id - The unique ID of this TabViewpublic 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 syncWithRenderNode()
UiElementUiElement and RenderNodesyncWithRenderNode in class ParentUiElementprotected ParentRenderNode<?,?> createRenderNode(ParentRenderNode<?,?> parent)
ParentUiElementParentRenderNode for this UiElementcreateRenderNode in class ParentUiElementparent - The parent of this nodeParentRenderNodepublic void attach(ParentRenderNode<?,?> parentRenderNode)
UiElementRenderNode for this element to a parent
RenderNodeattach in class ParentUiElementparentRenderNode - The parent RenderNode to attach topublic void detach(ParentRenderNode<?,?> parentRenderNode)
UiElementRenderNode from a parent
RenderNodedetach in class ParentUiElementparentRenderNode - The parent RenderNode to detach frompublic 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 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(ControllerButton button)
NavigatableActionableRenderNode mapped to a ControllerButton hotkeyhotkey in interface Navigatablebutton - The ControllerButton that is the hotkeypublic UiNavigation getNavigation()
NavigatableUiNavigation currently being navigatedgetNavigation in interface Navigatablepublic void setPreviousTabHotkey(int keycode)
keycode - The Input.Keys keycodepublic void setPreviousTabHotkey(ControllerButton button)
ControllerButton as the hotkey for changing to the previous tabbutton - The ControllerButtonpublic void setNextTabHotkey(int keycode)
keycode - The Input.Keys keycodepublic void setNextTabHotkey(ControllerButton button)
ControllerButton as the hotkey for changing to the next tabbutton - The ControllerButtonpublic void unsetPreviousTabHotkey(int keycode)
keycode - The Input.Keys keycodepublic void unsetPreviousTabHotkey(ControllerButton button)
ControllerButton as the hotkey for changing to the previous tabbutton - The ControllerButtonpublic void unsetNextTabHotkey(int keycode)
keycode - The Input.Keys keycodepublic void unsetNextTabHotkey(ControllerButton button)
ControllerButton as the hotkey for changing to the next tabbutton - The ControllerButtonpublic void setHotkey(ControllerButton button, Actionable actionable)
NavigatableControllerButton to a ActionablesetHotkey in interface Navigatablebutton - The ControllerButton 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(ControllerButton button)
NavigatableControllerButton hotkeyunsetHotkey in interface Navigatablebutton - The ControllerButton that is the hotkeypublic void unsetHotkey(int keycode)
NavigatableunsetHotkey in interface Navigatablekeycode - The Input.Keys keycode that is the hotkeypublic java.lang.String getLayout()
ParentUiElementgetLayout in class ParentUiElementpublic void setLayout(java.lang.String layout)
ParentUiElementsetLayout in class ParentUiElementpublic void setPreviousTabButtonLayout(java.lang.String layout)
public void setNextTabButtonLayout(java.lang.String layout)
public void setTabButtonLayout(java.lang.String layout)
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