All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jclass.bwt.JCTabManager

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----jclass.bwt.JCContainer
                                   |
                                   +----jclass.bwt.JCTabManager

public class JCTabManager
extends JCContainer
JCTabManager is a container which organizes its children into pages to simulate a sequence of file folders. A row of tab buttons allows users to select a page. The page components are defined as children of the Tab Manager; a property is then used to associated a page with a particular tab button. Page components can be of any class (including any container). Because AWT components must be rectangular, the tab buttons are not actual buttons, but are simulated.

Properties

Name Method
Alignment setAlignment
Background setBackground
CurrentTabFont setCurrentTabFont
FirstVisibleTab setFirstVisibleTab
Font setFont
Foreground setForeground
Insets setInsets
PreferredSize setPreferredSize
TabColorPolicy setTabColorPolicy
TabLabels setTabLabels
TabResize setTabResize
TabShape setTabShape
TabSide setTabSide
TabSpacing setTabSpacing
TabStretch setTabStretch
UserData setUserData

Events

Class Listener Description
JCTabManagerEvent addTabManagerListener Posted when the page changes


Variable Index

 o BOTTOM
 o BOTTOMCENTER
 o BOTTOMLEFT
 o BOTTOMRIGHT
 o CENTER
 o COLOR_INHERIT
 o COLOR_PAGE
 o LEFT
 o listeners
List of JCTabManagerEvent listeners
 o MIDDLE
 o MIDDLECENTER
 o MIDDLELEFT
 o MIDDLERIGHT
 o page_area
The container which holds the pages.
 o RECTANGLE
 o RIGHT
 o SLANTED
 o tab_panel
The container which holds the tab buttons.
 o TOP
 o TOPCENTER
 o TOPLEFT
 o TOPRIGHT

Constructor Index

 o JCTabManager()
Creates an empty TabManager.
 o JCTabManager(Applet, String)
Creates a TabManager which reads parameters from the applet's HTML file.

Method Index

 o add(Component)
Adds the specified component as a page.
 o addPage(Object, Component)
Adds a page and creates a tab for it.
 o addTabManagerListener(JCTabManagerListener)
Adds the specified JCTabManagerEvent listener to receive value change events.
 o getAlignment()
Gets the default tab alignment.
 o getCurrentPage()
Gets the current page.
 o getCurrentTab()
Gets the current tab.
 o getCurrentTabFont()
Gets the CurrentTabFont value.
 o getFirstVisibleTab()
Gets the first visible tab.
 o getPages()
Gets a list of all the pages.
 o getParameters()
Reads the parameter values from the HTML page using the component's applet.
 o getTab(int)
Gets the tab at the specified position.
 o getTab(JCTabButton)
Gets the position of the specified tab.
 o getTabColorPolicy()
Gets the TabColorPolicy value.
 o getTabLabels()
Gets the tab labels as a list of Strings.
 o getTabResize()
Gets the TabResize value.
 o getTabs()
Gets a list of all the tabs.
 o getTabShape()
Gets the tab shape.
 o getTabSide()
Gets the TabSide value.
 o getTabSpacing()
Gets the TabSpacing value.
 o getTabStretch()
Gets the TabStretch value.
 o makeTabVisible(int)
Scrolls the tabs if necessary so that the tab is fully visible.
 o removeTab(int, boolean)
Removes a tab and optionally its page.
 o removeTabManagerListener(JCTabManagerListener)
Removes the specified listener so it no longer receives JCTabManagerEvents.
 o reshape(int, int, int, int)
Reshapes the Container to the specified bounding box.
 o setAlignment(int)
Sets the default position of the tab's label within its shadows.
 o setCurrentPage(Component)
Sets the current page.
 o setCurrentTab(int, boolean)
Sets the current tab, and posts a JCTabMangerEvent.
 o setCurrentTabFont(Font)
Sets the current tab's font (default: bold version of default font).

HTML param name/value: "CurrentTabFont"/Font

 o setFirstVisibleTab(int)
Sets the first tab currently visible.
 o setLayout(LayoutManager)
Sets the layout manager for this container.
 o setTabColorPolicy(int)
Sets the policy for the tab's colors:
 COLOR_PAGE        Sets the tab's color to the page's color (default)
 COLOR_INHERIT     Sets the tab's color to the tab manager's color
 
HTML param name/value: "TabColorPolicy"/enum
 o setTabLabels(String[])
Sets the tab's labels.

HTML param name/value: "TabLabels"/string list

 o setTabPage(int, Object, Component)
Sets the page associated with a tab.
 o setTabResize(boolean)
Sets whether all tabs should be resized to the width or height of the largest tab in the same row, depending on the value of the TabSide value.
 o setTabShape(int)
Sets the tab's shape: RECTANGLE (default), or SLANTED.

HTML param name/value: "TabShape"/enum

 o setTabSide(int)
Sets the side on which tabs are to be displayed: TOP (default), or BOTTOM.

HTML param name/value: "TabSide"/enum

 o setTabSpacing(int)
Sets the spacing between tabs in pixels (default: 0).
 o setTabStretch(boolean)
Sets whether all tabs should be stretched if necessary to fill the entire side (default: false).

HTML param name/value: "TabStretch"/boolean

Variables

 o TOPLEFT
 public static final int TOPLEFT
 o LEFT
 public static final int LEFT
 o TOPCENTER
 public static final int TOPCENTER
 o CENTER
 public static final int CENTER
 o TOPRIGHT
 public static final int TOPRIGHT
 o RIGHT
 public static final int RIGHT
 o MIDDLELEFT
 public static final int MIDDLELEFT
 o MIDDLECENTER
 public static final int MIDDLECENTER
 o MIDDLE
 public static final int MIDDLE
 o MIDDLERIGHT
 public static final int MIDDLERIGHT
 o BOTTOMLEFT
 public static final int BOTTOMLEFT
 o BOTTOMCENTER
 public static final int BOTTOMCENTER
 o BOTTOMRIGHT
 public static final int BOTTOMRIGHT
 o COLOR_PAGE
 public static final int COLOR_PAGE
 o COLOR_INHERIT
 public static final int COLOR_INHERIT
 o RECTANGLE
 public static final int RECTANGLE
 o SLANTED
 public static final int SLANTED
 o TOP
 public static final int TOP
 o BOTTOM
 public static final int BOTTOM
 o tab_panel
 protected TabPanel tab_panel
The container which holds the tab buttons.

 o page_area
 protected TabPageArea page_area
The container which holds the pages.

 o listeners
 protected JCVector listeners
List of JCTabManagerEvent listeners

Constructors

 o JCTabManager
 public JCTabManager()
Creates an empty TabManager. No parameters are read from an HTML file.

 o JCTabManager
 public JCTabManager(Applet applet,
                     String name)
Creates a TabManager which reads parameters from the applet's HTML file.

Parameters:
applet - the applet whose PARAM tags are to be read
name - if this is not null, only parameters preceded by this name are read
See Also:
getParameter

Methods

 o getParameters
 protected void getParameters()
Reads the parameter values from the HTML page using the component's applet. The values will override those previously set.

Overrides:
getParameters in class JCContainer
 o addTabManagerListener
 public void addTabManagerListener(JCTabManagerListener l)
Adds the specified JCTabManagerEvent listener to receive value change events.

See Also:
JCTabManagerEvent
 o removeTabManagerListener
 public void removeTabManagerListener(JCTabManagerListener l)
Removes the specified listener so it no longer receives JCTabManagerEvents.

See Also:
addTabManagerListener
 o getPages
 public Component[] getPages()
Gets a list of all the pages.

See Also:
setPage, addPage
 o getTabs
 public JCTabButton[] getTabs()
Gets a list of all the tabs.

See Also:
setPage, addPage
 o getTab
 public int getTab(JCTabButton tab)
Gets the position of the specified tab.

Returns:
BWTEnum.NOTFOUND if the tab is not a child
 o getTab
 public JCTabButton getTab(int pos)
Gets the tab at the specified position.

Returns:
null if the position is invalid
 o getAlignment
 public int getAlignment()
Gets the default tab alignment.

See Also:
setAlignment
 o setAlignment
 public synchronized void setAlignment(int align)
Sets the default position of the tab's label within its shadows.

Parameters:
align - one of TOPLEFT, TOPCENTER, TOPRIGHT, MIDDLELEFT, MIDDLECENTER (default), MIDDLERIGHT, BOTTOMLEFT, BOTTOMCENTER and BOTTOMRIGHT
Throws: IllegalArgumentException
If an invalid value is set
 o getTabColorPolicy
 public int getTabColorPolicy()
Gets the TabColorPolicy value.

See Also:
setTabColorPolicy
 o setTabColorPolicy
 public synchronized void setTabColorPolicy(int v)
Sets the policy for the tab's colors:
 COLOR_PAGE        Sets the tab's color to the page's color (default)
 COLOR_INHERIT     Sets the tab's color to the tab manager's color
 
HTML param name/value: "TabColorPolicy"/enum

Throws: IllegalArgumentException
If an invalid value is set
 o getTabSpacing
 public int getTabSpacing()
Gets the TabSpacing value.

See Also:
setTabSpacing
 o setTabSpacing
 public void setTabSpacing(int v)
Sets the spacing between tabs in pixels (default: 0). When set to a negative value, the tabs overlap.

HTML param name/value: "TabSpacing"/int

 o getCurrentTab
 public int getCurrentTab()
Gets the current tab.

See Also:
setCurrentTab
 o setCurrentTab
 public synchronized void setCurrentTab(int tab_pos,
                                        boolean show_page)
Sets the current tab, and posts a JCTabMangerEvent.

Parameters:
tab_pos - the tab position
show_page - if true, the tab's page is displayed - a blank page is displayed if the tab is non-existent; if show_page is false, the current page is not changed
See Also:
addTabManagerListener
 o getCurrentTabFont
 public Font getCurrentTabFont()
Gets the CurrentTabFont value.

See Also:
setCurrentTabFont
 o setCurrentTabFont
 public synchronized void setCurrentTabFont(Font font)
Sets the current tab's font (default: bold version of default font).

HTML param name/value: "CurrentTabFont"/Font

See Also:
toFont
 o getCurrentPage
 public Component getCurrentPage()
Gets the current page.

See Also:
setCurrentPage
 o setCurrentPage
 public synchronized void setCurrentPage(Component page)
Sets the current page. The current tab is not changed - call setCurrentTab to set a tab and its page as current.

Parameters:
page - if null, a blank page is displayed
See Also:
setCurrentTab
 o getTabShape
 public int getTabShape()
Gets the tab shape.

See Also:
setTabShape
 o setTabShape
 public synchronized void setTabShape(int v)
Sets the tab's shape: RECTANGLE (default), or SLANTED.

HTML param name/value: "TabShape"/enum

Throws: IllegalArgumentException
If an invalid value is set
 o getTabLabels
 public String[] getTabLabels()
Gets the tab labels as a list of Strings.

See Also:
setTabLabels
 o setTabLabels
 public synchronized void setTabLabels(String v[])
Sets the tab's labels.

HTML param name/value: "TabLabels"/string list

See Also:
addPage
 o getFirstVisibleTab
 public int getFirstVisibleTab()
Gets the first visible tab.

See Also:
setFirstVisibleTab
 o setFirstVisibleTab
 public synchronized void setFirstVisibleTab(int tab_pos)
Sets the first tab currently visible. Setting this value causes the tabs to scroll if necessary so that the tab is fully visible.

HTML param name/value: "FirstVisibleTab"/int

 o makeTabVisible
 public synchronized void makeTabVisible(int tab_pos)
Scrolls the tabs if necessary so that the tab is fully visible.

See Also:
setFirstVisibleTab
 o getTabResize
 public boolean getTabResize()
Gets the TabResize value.

See Also:
setTabResize
 o setTabResize
 public synchronized void setTabResize(boolean v)
Sets whether all tabs should be resized to the width or height of the largest tab in the same row, depending on the value of the TabSide value. If true (default), this property is processed before TabStretch.

HTML param name/value: "TabResize"/boolean

See Also:
setTabStretch
 o getTabSide
 public int getTabSide()
Gets the TabSide value.

See Also:
setTabSide
 o setTabSide
 public synchronized void setTabSide(int v)
Sets the side on which tabs are to be displayed: TOP (default), or BOTTOM.

HTML param name/value: "TabSide"/enum

Throws: IllegalArgumentException
If an invalid value is set
 o getTabStretch
 public boolean getTabStretch()
Gets the TabStretch value.

See Also:
setTabStretch
 o setTabStretch
 public synchronized void setTabStretch(boolean v)
Sets whether all tabs should be stretched if necessary to fill the entire side (default: false).

HTML param name/value: "TabStretch"/boolean

See Also:
setTabResize
 o setTabPage
 public synchronized int setTabPage(int tab_pos,
                                    Object label,
                                    Component page)
Sets the page associated with a tab. Several tabs may share a common page.

Parameters:
tab_pos - the position of the tab to be set; if this is greater than the current number of tabs, a new tab will be created
label - the tab's label; this may be a String, Image, JCString, or any object (in which case the object's toString() method is called to obtain a string) If null, any tab label set previously using setTabLabels will be used.
page - may be null if no page is to be associated with the tab; a page may be set later using JCTabButton.setPage
Returns:
the position of the tab that was set (which may be a new tab)
See Also:
getTab, setTabLabels, setPage, JCString
 o addPage
 public synchronized int addPage(Object label,
                                 Component page)
Adds a page and creates a tab for it.

Parameters:
label - the tab's label; this may be a String, Image, JCString or any object (in which case the object's toString() method is called to obtain a string). If null, any tab label set previously using setTabLabels will be used.
page - may be null if no page is to be associated with the tab; a page may be set later using JCTabButton.setPage
Returns:
the position of the new tab
See Also:
getTab, setTabLabels, setPage, JCString
 o removeTab
 public synchronized void removeTab(int tab_pos,
                                    boolean remove_page)
Removes a tab and optionally its page.

Parameters:
tab_pos - the position of the tab to be removed
See Also:
getTab
 o add
 public Component add(Component page)
Adds the specified component as a page.

Overrides:
add in class JCContainer
See Also:
addPage
 o setLayout
 public final void setLayout(LayoutManager mgr)
Sets the layout manager for this container. This method is overridden to prevent the layout mgr from being set.

Overrides:
setLayout in class Container
 o reshape
 public synchronized void reshape(int x,
                                  int y,
                                  int width,
                                  int height)
Reshapes the Container to the specified bounding box.

Overrides:
reshape in class JCContainer

All Packages  Class Hierarchy  This Package  Previous  Next  Index