com.sun.lwuit
Class TabbedPane

java.lang.Object
  extended by com.sun.lwuit.Component
      extended by com.sun.lwuit.Container
          extended by com.sun.lwuit.TabbedPane
All Implemented Interfaces:
Animation, StyleListener

Deprecated. see Tabs.java

public class TabbedPane
extends Container

A component that lets the user switch between a group of components by clicking on a tab with a given title and/or icon.

Tabs/components are added to a TabbedPane object by using the addTab and insertTab methods. A tab is represented by an index corresponding to the position it was added in, where the first tab has an index equal to 0 and the last tab has an index equal to the tab count minus 1.

The TabbedPane uses a SingleSelectionModel to represent the set of tab indices and the currently selected index. If the tab count is greater than 0, then there will always be a selected index, which by default will be initialized to the first tab. If the tab count is 0, then the selected index will be -1.


Field Summary
 
Fields inherited from class com.sun.lwuit.Component
BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, LEFT, RIGHT, TOP
 
Constructor Summary
TabbedPane()
          Deprecated. Creates an empty TabbedPane with a default tab placement of Component.TOP.
TabbedPane(int tabPlacement)
          Deprecated. Creates an empty TabbedPane with the specified tab placement of either: Component.TOP, Component.BOTTOM, Component.LEFT, or Component.RIGHT.
 
Method Summary
 void addTab(java.lang.String title, Component component)
          Deprecated. Adds a component represented by a title and no icon.
 void addTab(java.lang.String title, Image icon, Component component)
          Deprecated. Adds a component represented by a title and/or icon, either of which can be null.
 void addTabsListener(SelectionListener listener)
          Deprecated. This method adds a listener to the tabs.
 boolean animate()
          Deprecated. Allows the animation to reduce "repaint" calls when it returns false.
protected  Dimension calcPreferredSize()
          Deprecated. Calculates the preferred size based on component content.
 int getSelectedIndex()
          Deprecated. Returns the currently selected index for this tabbedpane.
 int getTabbedPaneBorderWidth()
          Deprecated. The TabbedPane surrounded border width
 Component getTabComponentAt(int index)
          Deprecated. Returns the tab at index.
 int getTabCount()
          Deprecated. Returns the number of tabs in this tabbedpane.
 int getTabPlacement()
          Deprecated. Returns the placement of the tabs for this tabbedpane.
 Transition getTransitionLeft()
          Deprecated. Indicates the transition to use when switching between tabs from right to left.
 Transition getTransitionRight()
          Deprecated. Indicates the transition to use when switching between tabs from left to right.
 boolean hasFocus()
          Deprecated. Returns true if the component has focus
 int indexOfComponent(Component component)
          Deprecated. Returns the index of the tab for the specified component.
 void insertTab(java.lang.String title, Image icon, Component component, int index)
          Deprecated. Inserts a component, at index, represented by a title and/or icon, either of which may be null.
 void paint(Graphics g)
          Deprecated. This method paints the Component on the screen, it should be overriden by subclasses to perform custom drawing or invoke the UI API's to let the PLAF perform the rendering.
 void refreshTheme()
          Deprecated. Makes sure the component is up to date with the current style object
 void removeTabAt(int index)
          Deprecated. Removes the tab at index.
 void requestFocus()
          Deprecated. Changes the current component to the focused component, will work only for a component that belongs to a parent form.
 void setContentPaneSelectedStyle(Style style)
          Deprecated. Sets the content pane selected style
 void setContentPaneUnselectedStyle(Style unselectedStyle)
          Deprecated. Sets the content pane un selected style
 void setFocus(boolean b)
          Deprecated. This flag doesn't really give focus, its a state that determines what colors from the Style should be used when painting the component.
 void setFocusable(boolean b)
          Deprecated. A simple setter to determine if this Component can get focused
 void setPadding(int orientation, int gap)
          Deprecated.  
 void setPadding(int top, int bottom, int left, int right)
          Deprecated.  
 void setSelectedIndex(int index)
          Deprecated. Sets the selected index for this tabbedpane.
 void setTabbedPaneBorderWidth(int tabbedPaneBorderWidth)
          Deprecated. Setting the TabbedPane surrounded border width
 void setTabPlacement(int tabPlacement)
          Deprecated. Sets the tab placement for this tabbedpane.
 void setTabsSelectedStyle(Style style)
          Deprecated. Sets the tabs selected style
 void setTabsUnselectedStyle(Style unselectedStyle)
          Deprecated. Sets the tabs un selected style
 void setTabTitle(java.lang.String title, Image icon, int index)
          Deprecated. Updates the information about the tab details
 void setTabTitlePrototype(java.lang.String title)
          Deprecated. The prototype is optionally used in calculating the size of an individual tab and is recommended for performance reasons.
 void setTransitionLeft(Transition transitionLeft)
          Deprecated. Indicates the transition to use when switching between tabs from right to left.
 void setTransitionRight(Transition transitionRight)
          Deprecated. Indicates the transition to use when switching between tabs from left to right.
 java.lang.String toString()
          Deprecated. Overriden to return a useful value for debugging purposes
 
Methods inherited from class com.sun.lwuit.Container
addComponent, addComponent, addComponent, addComponent, animateLayout, animateLayoutAndWait, applyRTL, contains, dragInitiated, drop, findFirstFocusable, flushReplace, getBottomGap, getComponentAt, getComponentAt, getComponentCount, getComponentIndex, getGridPosX, getGridPosY, getLayout, getLayoutHeight, getLayoutWidth, getLeadComponent, getLeadParent, getScrollIncrement, getSideGap, invalidate, isEnabled, isScrollableX, isScrollableY, keyPressed, keyReleased, layoutContainer, paintBackground, paintGlass, paramString, pointerHover, pointerPressed, removeAll, removeComponent, replace, replace, replaceAndWait, replaceAndWait, replaceAndWait, revalidate, scrollComponentToVisible, setCellRenderer, setEnabled, setLayout, setLeadComponent, setScrollable, setScrollableX, setScrollableY, setScrollIncrement, setShouldCalcPreferredSize, setShouldLayout
 
Methods inherited from class com.sun.lwuit.Component
addFocusListener, calcScrollSize, contains, deinitialize, deinitializeCustomStyle, dragEnter, dragExit, draggingOver, drawDraggedImage, fireClicked, focusGained, focusLost, getAbsoluteX, getAbsoluteY, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentForm, getDirtyRegion, getDisabledStyle, getDragImage, getHeight, getLabelForComponent, getName, getNextFocusDown, getNextFocusLeft, getNextFocusRight, getNextFocusUp, getParent, getPreferredH, getPreferredSize, getPreferredW, getPressedStyle, getPropertyNames, getPropertyTypes, getPropertyValue, getScrollAnimationSpeed, getScrollDimension, getScrollOpacity, getScrollOpacityChangeSpeed, getScrollX, getScrollY, getSelectCommandText, getSelectedRect, getSelectedStyle, getStyle, getTensileLength, getUIID, getUnselectedStyle, getWidth, getVisibleBounds, getX, getY, growShrink, handlesInput, initComponent, initCustomStyle, installDefaultPainter, isAlwaysTensile, isDragActivated, isDragAndDropOperation, isDraggable, isDropTarget, isFlatten, isFocusable, isGrabsPointerEvents, isHideInPortrait, isInitialized, isRTL, isScrollable, isScrollVisible, isSelectableInteraction, isSmoothScrolling, isSnapToGrid, isTactileTouch, isTactileTouch, isTensileDragEnabled, isVisible, keyRepeated, laidOut, longKeyPress, longPointerPress, paintBackgrounds, paintBorder, paintComponent, paintComponent, paintLock, paintLockRelease, paintScrollbars, paintScrollbarX, paintScrollbarY, pointerDragged, pointerDragged, pointerHoverPressed, pointerHoverReleased, pointerPressed, pointerReleased, pointerReleased, putClientProperty, refreshTheme, removeFocusListener, repaint, repaint, scrollRectToVisible, scrollRectToVisible, setAlwaysTensile, setDirtyRegion, setDisabledStyle, setDraggable, setDropTarget, setFlatten, setGrabsPointerEvents, setHandlesInput, setHeight, setHideInPortrait, setInitialized, setIsScrollVisible, setLabelForComponent, setName, setNextFocusDown, setNextFocusLeft, setNextFocusRight, setNextFocusUp, setPreferredH, setPreferredSize, setPreferredW, setPressedStyle, setPropertyValue, setRTL, setScrollAnimationSpeed, setScrollOpacityChangeSpeed, setScrollSize, setScrollVisible, setScrollX, setScrollY, setSelectCommandText, setSelectedStyle, setSize, setSmoothScrolling, setSnapToGrid, setTactileTouch, setTensileDragEnabled, setTensileLength, setUIID, setUnselectedStyle, setWidth, setVisible, setX, setY, styleChanged
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TabbedPane

public TabbedPane()
Deprecated. 
Creates an empty TabbedPane with a default tab placement of Component.TOP.


TabbedPane

public TabbedPane(int tabPlacement)
Deprecated. 
Creates an empty TabbedPane with the specified tab placement of either: Component.TOP, Component.BOTTOM, Component.LEFT, or Component.RIGHT.

Parameters:
tabPlacement - the placement for the tabs relative to the content
Method Detail

animate

public boolean animate()
Deprecated. 
Description copied from interface: Animation
Allows the animation to reduce "repaint" calls when it returns false. It is called once for every frame. Frames are defined by the Display class.

Specified by:
animate in interface Animation
Overrides:
animate in class Component
Returns:
true if a repaint is desired or false if no repaint is necessary

setTransitionLeft

public void setTransitionLeft(Transition transitionLeft)
Deprecated. 
Indicates the transition to use when switching between tabs from right to left.

Parameters:
transitionLeft - transition to use when switching tabs or null to avoid transition

getTransitionLeft

public Transition getTransitionLeft()
Deprecated. 
Indicates the transition to use when switching between tabs from right to left.

Returns:
the transition towards the left direction

setTransitionRight

public void setTransitionRight(Transition transitionRight)
Deprecated. 
Indicates the transition to use when switching between tabs from left to right.

Parameters:
transitionRight - transition to use when switching tabs or null to avoid transition

getTransitionRight

public Transition getTransitionRight()
Deprecated. 
Indicates the transition to use when switching between tabs from left to right.

Returns:
the transition towards the right direction

setFocusable

public void setFocusable(boolean b)
Deprecated. 
Description copied from class: Component
A simple setter to determine if this Component can get focused

Overrides:
setFocusable in class Component
Parameters:
b - indicate whether this component can get focused

setFocus

public void setFocus(boolean b)
Deprecated. 
Description copied from class: Component
This flag doesn't really give focus, its a state that determines what colors from the Style should be used when painting the component. Actual focus is determined by the parent form

Overrides:
setFocus in class Component
Parameters:
b - sets the state that determines what colors from the Style should be used when painting a focused component
See Also:
Component.requestFocus()

hasFocus

public boolean hasFocus()
Deprecated. 
Description copied from class: Component
Returns true if the component has focus

Overrides:
hasFocus in class Component
Returns:
true if the component has focus; otherwise false
See Also:
Component.setFocus(boolean)

addTabsListener

public void addTabsListener(SelectionListener listener)
Deprecated. 
This method adds a listener to the tabs.

Parameters:
listener - a selection listener to gets the selection events

requestFocus

public void requestFocus()
Deprecated. 
Description copied from class: Component
Changes the current component to the focused component, will work only for a component that belongs to a parent form.

Overrides:
requestFocus in class Component

calcPreferredSize

protected Dimension calcPreferredSize()
Deprecated. 
Description copied from class: Component
Calculates the preferred size based on component content. This method is invoked lazily by getPreferred size.

Overrides:
calcPreferredSize in class Container
Returns:
the calculated preferred size based on component content

setTabPlacement

public void setTabPlacement(int tabPlacement)
Deprecated. 
Sets the tab placement for this tabbedpane. Possible values are: The default value, if not set, is Component.TOP.

Parameters:
tabPlacement - the placement for the tabs relative to the content

addTab

public void addTab(java.lang.String title,
                   Image icon,
                   Component component)
Deprecated. 
Adds a component represented by a title and/or icon, either of which can be null. Cover method for insertTab.

Parameters:
title - the title to be displayed in this tab
icon - the icon to be displayed in this tab
component - the component to be displayed when this tab is clicked
See Also:
insertTab(java.lang.String, com.sun.lwuit.Image, com.sun.lwuit.Component, int), removeTabAt(int)

addTab

public void addTab(java.lang.String title,
                   Component component)
Deprecated. 
Adds a component represented by a title and no icon. Cover method for insertTab.

Parameters:
title - the title to be displayed in this tab
component - the component to be displayed when this tab is clicked
See Also:
insertTab(java.lang.String, com.sun.lwuit.Image, com.sun.lwuit.Component, int), removeTabAt(int)

insertTab

public void insertTab(java.lang.String title,
                      Image icon,
                      Component component,
                      int index)
Deprecated. 
Inserts a component, at index, represented by a title and/or icon, either of which may be null. Uses java.util.Vector internally, see insertElementAt for details of insertion conventions.

Parameters:
title - the title to be displayed in this tab
icon - the icon to be displayed in this tab
component - The component to be displayed when this tab is clicked.
index - the position to insert this new tab
See Also:
addTab(java.lang.String, com.sun.lwuit.Image, com.sun.lwuit.Component), removeTabAt(int)

setTabTitle

public void setTabTitle(java.lang.String title,
                        Image icon,
                        int index)
Deprecated. 
Updates the information about the tab details

Parameters:
title - the title to be displayed in this tab
icon - the icon to be displayed in this tab
index - the position to insert this new tab

removeTabAt

public void removeTabAt(int index)
Deprecated. 
Removes the tab at index. After the component associated with index is removed, its visibility is reset to true to ensure it will be visible if added to other containers.

Parameters:
index - the index of the tab to be removed
Throws:
java.lang.IndexOutOfBoundsException - if index is out of range (index < 0 || index >= tab count)
See Also:
addTab(java.lang.String, com.sun.lwuit.Image, com.sun.lwuit.Component), insertTab(java.lang.String, com.sun.lwuit.Image, com.sun.lwuit.Component, int)

getTabComponentAt

public Component getTabComponentAt(int index)
Deprecated. 
Returns the tab at index.

Parameters:
index - the index of the tab to be removed
Returns:
the component at the given tab location
Throws:
java.lang.IndexOutOfBoundsException - if index is out of range (index < 0 || index >= tab count)
See Also:
addTab(java.lang.String, com.sun.lwuit.Image, com.sun.lwuit.Component), insertTab(java.lang.String, com.sun.lwuit.Image, com.sun.lwuit.Component, int)

indexOfComponent

public int indexOfComponent(Component component)
Deprecated. 
Returns the index of the tab for the specified component. Returns -1 if there is no tab for this component.

Parameters:
component - the component for the tab
Returns:
the first tab which matches this component, or -1 if there is no tab for this component

getTabCount

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

Returns:
an integer specifying the number of tabbed pages

getSelectedIndex

public int getSelectedIndex()
Deprecated. 
Returns the currently selected index for this tabbedpane. Returns -1 if there is no currently selected tab.

Returns:
the index of the selected tab

setTabTitlePrototype

public void setTabTitlePrototype(java.lang.String title)
Deprecated. 
The prototype is optionally used in calculating the size of an individual tab and is recommended for performance reasons. You should invoke it with a String representing the width/height which will be used to calculate the size required for each element in the list.\

This operation is not essential and if it isn't invoked the size of the first few tabs is used to determine the overall size of a tab.

This allows the size calculations to work across look and feels and allows developers to predetermin size for the tabs.

e.g. For tabs which you would like to always be 5 characters wide you can use a prototype "XXXXX" which would use the preferred size of the XXXXX String to determine the size of the tabs..

Parameters:
title - a string to determine the size.

toString

public java.lang.String toString()
Deprecated. 
Description copied from class: Component
Overriden to return a useful value for debugging purposes

Overrides:
toString in class Component
Returns:
a string representation of this component

paint

public void paint(Graphics g)
Deprecated. 
Description copied from class: Component
This method paints the Component on the screen, it should be overriden by subclasses to perform custom drawing or invoke the UI API's to let the PLAF perform the rendering.

Specified by:
paint in interface Animation
Overrides:
paint in class Container
Parameters:
g - the component graphics

setTabsSelectedStyle

public void setTabsSelectedStyle(Style style)
Deprecated. 
Sets the tabs selected style

Parameters:
style -

setTabsUnselectedStyle

public void setTabsUnselectedStyle(Style unselectedStyle)
Deprecated. 
Sets the tabs un selected style

Parameters:
unselectedStyle - the style

setContentPaneSelectedStyle

public void setContentPaneSelectedStyle(Style style)
Deprecated. 
Sets the content pane selected style

Parameters:
style -

setContentPaneUnselectedStyle

public void setContentPaneUnselectedStyle(Style unselectedStyle)
Deprecated. 
Sets the content pane un selected style

Parameters:
unselectedStyle - the style

refreshTheme

public void refreshTheme()
Deprecated. 
Description copied from class: Component
Makes sure the component is up to date with the current style object

Overrides:
refreshTheme in class Container

getTabPlacement

public int getTabPlacement()
Deprecated. 
Returns the placement of the tabs for this tabbedpane.

Returns:
the tab placement value
See Also:
setTabPlacement(int)

getTabbedPaneBorderWidth

public int getTabbedPaneBorderWidth()
Deprecated. 
The TabbedPane surrounded border width

Returns:
The TabbedPane surrounded border width

setTabbedPaneBorderWidth

public void setTabbedPaneBorderWidth(int tabbedPaneBorderWidth)
Deprecated. 
Setting the TabbedPane surrounded border width

Parameters:
tabbedPaneBorderWidth - TabbedPane surrounded border width

setPadding

public void setPadding(int top,
                       int bottom,
                       int left,
                       int right)
Deprecated. 

setPadding

public void setPadding(int orientation,
                       int gap)
Deprecated. 

setSelectedIndex

public void setSelectedIndex(int index)
Deprecated. 
Sets the selected index for this tabbedpane. The index must be a valid tab index.

Parameters:
index - the index to be selected
Throws:
java.lang.IndexOutOfBoundsException - if index is out of range (index < 0 || index >= tab count)