public class TabView extends UiElement implements Navigatable
UiElement
of tabs that can be switched between by the playereffects, 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)
|
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 |
java.lang.String |
getLayout() |
UiNavigation |
getNavigation()
Returns the
UiNavigation currently being navigated |
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) |
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
|
addEffectListener, addHoverListener, applyEffect, equals, getElementById, getId, getStyleId, getVisibility, getZIndex, hashCode, isDebugEnabled, notifyEffectListenersOnFinished, notifyHoverListenersOnBeginHover, notifyHoverListenersOnEndHover, removeEffectListener, removeHoverListener, setDebugEnabled
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getId
public TabView()
TabView
public TabView(java.lang.String id)
id
- The unique ID of this TabView
public 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)
index
- The index to removeTab
that was removedpublic boolean containsTab(Tab tab)
public int getTotalTabs()
TabView
Tab
s have been addedpublic void syncWithRenderNode()
UiElement
UiElement
and RenderNode
syncWithRenderNode
in class UiElement
public void attach(ParentRenderNode<?,?> parentRenderNode)
UiElement
RenderNode
for this element to a parent
RenderNode
attach
in class UiElement
parentRenderNode
- The parent RenderNode
to attach topublic void detach(ParentRenderNode<?,?> parentRenderNode)
UiElement
RenderNode
from a parent
RenderNode
detach
in class UiElement
parentRenderNode
- The parent RenderNode
to detach frompublic void setVisibility(Visibility visibility)
UiElement
Visibility
of this UiElement
setVisibility
in class UiElement
visibility
- The Visibility
to setpublic void setStyleId(java.lang.String styleId)
UiElement
UiElement
setStyleId
in class UiElement
styleId
- The style id to setpublic void setZIndex(int zIndex)
UiElement
UiElement
. Elements will be rendered on
different Z layers in ascending Z order (negatives values first, positive values last)public Tab getCurrentTab()
Tab
Tab
is visiblepublic int getCurrentTabIndex()
Tab
public void setCurrentTabIndex(int currentTabIndex)
Tab
currentTabIndex
- The index of the Tab
public 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)
Navigatable
ActionableRenderNode
navigate
in interface Navigatable
keycode
- The navigation Input.Keys
valueUiNavigation
is availablepublic ActionableRenderNode hotkey(int keycode)
Navigatable
ActionableRenderNode
mapped to a keyboard hotkeyhotkey
in interface Navigatable
keycode
- The Input.Keys
keycode that is the hotkeypublic ActionableRenderNode hotkey(ControllerButton button)
Navigatable
ActionableRenderNode
mapped to a ControllerButton
hotkeyhotkey
in interface Navigatable
button
- The ControllerButton
that is the hotkeypublic UiNavigation getNavigation()
Navigatable
UiNavigation
currently being navigatedgetNavigation
in interface Navigatable
public void setPreviousTabHotkey(int keycode)
keycode
- The Input.Keys
keycodepublic void setPreviousTabHotkey(ControllerButton button)
ControllerButton
as the hotkey for changing to the previous tabbutton
- The ControllerButton
public void setNextTabHotkey(int keycode)
keycode
- The Input.Keys
keycodepublic void setNextTabHotkey(ControllerButton button)
ControllerButton
as the hotkey for changing to the next tabbutton
- The ControllerButton
public void unsetPreviousTabHotkey(int keycode)
keycode
- The Input.Keys
keycodepublic void unsetPreviousTabHotkey(ControllerButton button)
ControllerButton
as the hotkey for changing to the previous tabbutton
- The ControllerButton
public void unsetNextTabHotkey(int keycode)
keycode
- The Input.Keys
keycodepublic void unsetNextTabHotkey(ControllerButton button)
ControllerButton
as the hotkey for changing to the next tabbutton
- The ControllerButton
public void setHotkey(ControllerButton button, Actionable actionable)
Navigatable
ControllerButton
to a Actionable
setHotkey
in interface Navigatable
button
- The ControllerButton
that is the hotkeyactionable
- The Actionable
to trigger when the hotkey is pressedpublic void setHotkey(int keycode, Actionable actionable)
Navigatable
Actionable
setHotkey
in interface Navigatable
keycode
- The Input.Keys
keycode that is the hotkeyactionable
- The Actionable
to trigger when the key is pressedpublic void unsetHotkey(ControllerButton button)
Navigatable
ControllerButton
hotkeyunsetHotkey
in interface Navigatable
button
- The ControllerButton
that is the hotkeypublic void unsetHotkey(int keycode)
Navigatable
unsetHotkey
in interface Navigatable
keycode
- The Input.Keys
keycode that is the hotkeypublic java.lang.String getLayout()
public void setLayout(java.lang.String layout)
public void setPreviousTabButtonLayout(java.lang.String layout)
public void setNextTabButtonLayout(java.lang.String layout)
public void setTabButtonLayout(java.lang.String layout)