com.threerings.opengl.gui
Class TabbedPane

java.lang.Object
  extended by com.threerings.opengl.gui.Component
      extended by com.threerings.opengl.gui.Container
          extended by com.threerings.opengl.gui.TabbedPane
All Implemented Interfaces:
ConfigUpdateListener<ManagedConfig>, Selectable<Component>

public class TabbedPane
extends Container
implements Selectable<Component>

Displays one of a set of components (tabs) depending on which tab is selected.


Field Summary
static String SELECTION_CHANGED
          Deprecated. 
 
Fields inherited from class com.threerings.opengl.gui.Component
DEFAULT, DISABLED, HOVER
 
Fields inherited from interface com.threerings.opengl.gui.Selectable
SELECT
 
Constructor Summary
TabbedPane(GlContext ctx)
          Creates a tabbed pane with left justified buttons.
TabbedPane(GlContext ctx, GroupLayout.Justification tabAlign)
          Creates a tabbed pane.
TabbedPane(GlContext ctx, GroupLayout.Justification tabAlign, int gap)
          Creates a tabbed pane.
 
Method Summary
 void addTab(String title, Component tab)
          Adds a tab to the pane using the specified title with no close button.
 void addTab(String title, Component tab, boolean hasClose)
          Adds a tab to the pane using the specified title.
 void addTab(String title, Component tab, boolean hasClose, ConfigReference<StyleConfig> style)
          Adds a tab to the pane using the specified title.
 Component getSelected()
          Get the selected item, if any.
 int getSelectedIndex()
          Get the index of the selected item, or -1.
 Component getSelectedTab()
          Deprecated. 
 int getSelectedTabIndex()
          Deprecated. 
 Component getTab(int idx)
          Returns the tab at the specified index.
 ToggleButton getTabButton(Component tab)
          Returns a reference to the tab button for the given tab.
 ToggleButton getTabButton(int idx)
          Returns a reference to the tab button at the given index.
 int getTabCount()
          Returns the number of tabs in this pane.
 int indexOfTab(Component tab)
          Returns the index of the given tab.
 void removeAllTabs()
          Removes all tabs.
 void removeTab(Component tab)
          Removes the specified tab.
 void removeTab(int tabidx)
          Removes the tab at the specified index.
 void removeTab(int tabidx, boolean btnClose)
          Removes the tab at the specified index.
 void replaceTab(Component otab, Component ntab)
          Replaces the specified tab component.
 void replaceTab(int tabidx, Component ntab)
          Replaces the tab component at the specified index.
 void selectTab(Component tab)
          Deprecated. 
 void selectTab(int tabidx)
          Deprecated. 
 void setGap(int gap)
          Sets the gap between the tab buttons.
 void setSelected(Component tab)
          Set the selected item.
 void setSelectedIndex(int index)
          Set the index of the selected item.
 void setTabAlignment(GroupLayout.Justification tabAlign)
          Sets the justification for the tab buttons.
 
Methods inherited from class com.threerings.opengl.gui.Container
add, add, add, add, getComponent, getComponentCount, getComponentIndex, getHitComponent, getLayoutManager, remove, remove, removeAll, replace, setAlpha, setEnabled, setHoverable, setLayoutManager, validate
 
Methods inherited from class com.threerings.opengl.gui.Component
acceptsFocus, addListener, boundsToString, configUpdated, contains, createDefaultTooltipComponent, createDefaultTooltipComponent, dispatchEvent, getAbsoluteX, getAbsoluteY, getAlpha, getBackground, getBorder, getBounds, getColor, getContext, getCursor, getFocusTarget, getHeight, getInsets, getParent, getPreferredSize, getProperty, getState, getStyleConfigs, getTooltipText, getTooltipTimeout, getTooltipWindowStyle, getTransferHandler, getWidth, getX, getY, hasFocus, invalidate, isAdded, isEnabled, isHoverable, isShowing, isTooltipRelativeToMouse, isValid, isVisible, removeAllListeners, removeAllListeners, removeListener, render, requestFocus, scrollRectToVisible, setBackground, setBounds, setCursor, setLocation, setParent, setPreferredSize, setPreferredSize, setProperty, setSize, setStyleConfig, setStyleConfig, setStyleConfig, setStyleConfigs, setTooltipRelativeToMouse, setTooltipText, setTransferHandler, setVisible
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SELECTION_CHANGED

@Deprecated
public static final String SELECTION_CHANGED
Deprecated. 
See Also:
Constant Field Values
Constructor Detail

TabbedPane

public TabbedPane(GlContext ctx)
Creates a tabbed pane with left justified buttons.


TabbedPane

public TabbedPane(GlContext ctx,
                  GroupLayout.Justification tabAlign)
Creates a tabbed pane.

Parameters:
tabAlign - the justification for the tab buttons.

TabbedPane

public TabbedPane(GlContext ctx,
                  GroupLayout.Justification tabAlign,
                  int gap)
Creates a tabbed pane.

Parameters:
tabAlign - the justification for the tab buttons.
gap - the number of pixels space between each tab button.
Method Detail

setTabAlignment

public void setTabAlignment(GroupLayout.Justification tabAlign)
Sets the justification for the tab buttons.


setGap

public void setGap(int gap)
Sets the gap between the tab buttons.


addTab

public void addTab(String title,
                   Component tab)
Adds a tab to the pane using the specified title with no close button.


addTab

public void addTab(String title,
                   Component tab,
                   boolean hasClose)
Adds a tab to the pane using the specified title.


addTab

public void addTab(String title,
                   Component tab,
                   boolean hasClose,
                   ConfigReference<StyleConfig> style)
Adds a tab to the pane using the specified title.


replaceTab

public void replaceTab(Component otab,
                       Component ntab)
Replaces the specified tab component.


replaceTab

public void replaceTab(int tabidx,
                       Component ntab)
Replaces the tab component at the specified index.


removeTab

public void removeTab(Component tab)
Removes the specified tab.


removeTab

public void removeTab(int tabidx)
Removes the tab at the specified index.


removeTab

public void removeTab(int tabidx,
                      boolean btnClose)
Removes the tab at the specified index.

Parameters:
btnClose - set to true if the tab was removed by the close button

removeAllTabs

public void removeAllTabs()
Removes all tabs.


getTabCount

public int getTabCount()
Returns the number of tabs in this pane.


getSelected

public Component getSelected()
Description copied from interface: Selectable
Get the selected item, if any.

Specified by:
getSelected in interface Selectable<Component>

setSelected

public void setSelected(Component tab)
Description copied from interface: Selectable
Set the selected item.

Specified by:
setSelected in interface Selectable<Component>

getSelectedIndex

public int getSelectedIndex()
Description copied from interface: Selectable
Get the index of the selected item, or -1.

Specified by:
getSelectedIndex in interface Selectable<Component>

setSelectedIndex

public void setSelectedIndex(int index)
Description copied from interface: Selectable
Set the index of the selected item.

Specified by:
setSelectedIndex in interface Selectable<Component>

selectTab

@Deprecated
public void selectTab(Component tab)
Deprecated. 


selectTab

@Deprecated
public void selectTab(int tabidx)
Deprecated. 


getSelectedTab

@Deprecated
public Component getSelectedTab()
Deprecated. 


getSelectedTabIndex

@Deprecated
public int getSelectedTabIndex()
Deprecated. 


getTabButton

public ToggleButton getTabButton(Component tab)
Returns a reference to the tab button for the given tab.


getTabButton

public ToggleButton getTabButton(int idx)
Returns a reference to the tab button at the given index.


getTab

public Component getTab(int idx)
Returns the tab at the specified index.


indexOfTab

public int indexOfTab(Component tab)
Returns the index of the given tab.



Copyright © 2011. All Rights Reserved.