All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class symantec.itools.awt.BaseTabbedPanel

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----symantec.itools.awt.BaseTabbedPanel

public class BaseTabbedPanel
extends Panel
BaseTabbedPanel is a Panel extension which provides for a tabbed dialog effect. It provides the visual aspect of tabs and allows the programmer to decide what action to take when a tab is activated. It can be used directly or extended. When extending from BaseTabbedPanel be sure to super() during construction and to super.handleEvent(evt) from handleEvent if you override it.

To add a new tab to the panel use the addTab() method. To update an existing tab use the setLabel() or setTab() method. To remove tabs use the removeTab() or removeAllTabs() method.

To enable or disable a tab use the setEnabled() method.

To show (activate) a tab use the showTab() method.


Variable Index

 o BOTTOM
Position constant indicating tabs are to be put at the bottom of this panel.
 o curIndex
Zero-relative index of currently shown tab.
 o ROUNDED
Style constant indicating tabs are to have rounded corners.
 o SQUARE
Style constant indicating tabs are to have square corners.
 o TOP
Position constant indicating tabs are to be put at the top of this panel.

Constructor Index

 o BaseTabbedPanel()
Constructs a BaseTabbedPanel with tabs on top and rounded.
 o BaseTabbedPanel(boolean)
Obsolete.
 o BaseTabbedPanel(int, int)
Constructs a BaseTabbedPanel with the desired tab position and corner style.

Method Index

 o add(Component)
Takes no action, use addTab().
 o add(Component, int)
Takes no action, use addTab().
 o add(String, Component)
Takes no action, use addTab().
 o addTab(String, boolean)
Appends a new tab and sets whether it is enabled.
 o currentTabIndex()
Determine the currently shown tab.
 o enableTab(boolean, int)
Conditionally enables the tab at the specified index.
 o getLabel(int)
Gets the label of the tab at the specified index.
 o getTabsPosition()
Gets the current tabs position, TOP or BOTTOM.
 o getTabsStyle()
Gets the current tab style, ROUNDED or SQUARE.
 o handleEvent(Event)
Processes events for this component.
 o insets()
Returns the amount of space used by the current border.
 o layout()
Handles the laying out of components within this component.
 o minimumSize()
Returns the minimum dimensions to properly display this component.
 o paint(Graphics)
Paints this component using the given graphics context.
 o preferredSize()
Returns the recommended dimensions to properly display this component.
 o remove(Component)
Removes the specified component from this container.
 o removeAll()
Removes all the components from this container.
 o removeAllTabs()
Removes all tabs.
 o removeTab(int)
Removes the tab at the specified index.
 o setEnabled(boolean, int)
Conditionally enables the tab at the specified index.
 o setLabel(String, int)
Changes the label of the tab at the specified index.
 o setLayout(LayoutManager)
Takes no action.
 o setPanel(Component)
Adds the panel to the base panel and shows it.
 o setTab(String, boolean, int)
Labels and conditionally enables the tab at the specified index.
 o setTabsInfo(int, int)
Sets the position and style of all the tabs.
 o setTabsPosition(int)
Sets the position of the all tabs to the top or bottom of this panel.
 o setTabsStyle(int)
Sets the style of the tabs to ROUNDED or SQUARE.
 o showPanel(Component)
Adds the panel to the base panel and shows it.
 o showTab(int)
Shows the tab at the specified index.
 o tabIsEnabled(int)
Determines whether or not the tab at the index is enabled.

Variables

 o TOP
  public final static int TOP
Position constant indicating tabs are to be put at the top of this panel.

 o BOTTOM
  public final static int BOTTOM
Position constant indicating tabs are to be put at the bottom of this panel.

 o ROUNDED
  public final static int ROUNDED
Style constant indicating tabs are to have rounded corners.

 o SQUARE
  public final static int SQUARE
Style constant indicating tabs are to have square corners.

 o curIndex
  protected int curIndex
Zero-relative index of currently shown tab. -1 if no tabs exist or are shown.

Constructors

 o BaseTabbedPanel
  public BaseTabbedPanel()
Constructs a BaseTabbedPanel with tabs on top and rounded.

 o BaseTabbedPanel
  public BaseTabbedPanel(boolean bTabsOnTop)
Obsolete. Use public BaseTabbedPanel(int tabsPostion, int tabsStyle).

 o BaseTabbedPanel
  public BaseTabbedPanel(int tabsPostion,
                         int tabsStyle)
Constructs a BaseTabbedPanel with the desired tab position and corner style.

Parameters:
tabsPostion - a constant indicating TOP or BOTTOM tab location
tabsStyle - a constant indicating ROUNDED or SQUARE tabs

Methods

 o setTabsPosition
  public void setTabsPosition(int tabsPosition)
Sets the position of the all tabs to the top or bottom of this panel. Note that if the tabs are on top they are always rounded.

Parameters:
tabsPosition - constant indicating TOP or BOTTOM
See Also:
getTabsPosition, TOP, BOTTOM
 o getTabsPosition
  public int getTabsPosition()
Gets the current tabs position, TOP or BOTTOM.

Returns:
the position constant TOP or BOTTOM, indicating the current tabs position
See Also:
setTabsPosition, TOP, BOTTOM
 o setTabsStyle
  public void setTabsStyle(int tabsStyle)
Sets the style of the tabs to ROUNDED or SQUARE. Note that if the tabs are on top they are always rounded.

Parameters:
tabsStyle - a constant indicating ROUNDED or SQUARE
See Also:
getTabsStyle, ROUNDED, SQUARE
 o getTabsStyle
  public int getTabsStyle()
Gets the current tab style, ROUNDED or SQUARE.

Returns:
the style constant ROUNDED or SQUARE, indicating the current tab style
See Also:
setTabsStyle, ROUNDED, SQUARE
 o setTabsInfo
  public void setTabsInfo(int tabsPosition,
                          int tabsStyle)
Sets the position and style of all the tabs. Note that if the tabs are on top they are always rounded.

Parameters:
a - tabsPosition constant indicating TOP or BOTTOM
a - tabsStyle constant indicating ROUNDED or SQUARE
See Also:
getTabsPosition, getTabsStyle, TOP, BOTTOM, ROUNDED, SQUARE
 o setPanel
  public void setPanel(Component p)
Adds the panel to the base panel and shows it. Removes all other previous panels from base panel.

Parameters:
p - the panel to add and show
 o showPanel
  public void showPanel(Component p)
Adds the panel to the base panel and shows it. Hides all other previous panels instead of removing them.

Parameters:
p - the Panel to add and show
 o addTab
  public int addTab(String sLabel,
                    boolean bEnabled)
Appends a new tab and sets whether it is enabled.

Parameters:
sLabel - the tab label
bEnabled - enable the tab or not
Returns:
the zero-relative index of the newly added tab
See Also:
setTab, setLabel
 o setTab
  public synchronized void setTab(String sLabel,
                                  boolean bEnabled,
                                  int index)
Labels and conditionally enables the tab at the specified index.

Parameters:
sLabel - the tab label
bEnabled - enable the tab or not
index - zero-relative index of the tab
See Also:
addTab, setLabel
 o setLabel
  public synchronized void setLabel(String sLabel,
                                    int index)
Changes the label of the tab at the specified index.

Parameters:
sLabel - the new label for the specified tab
index - the zero-relative index of the tab
See Also:
getLabel, addTab, setTab
 o getLabel
  public synchronized String getLabel(int index)
Gets the label of the tab at the specified index.

Parameters:
index - the zero-relative index of the tab
Returns:
the tab label
See Also:
getLabel
 o setEnabled
  public synchronized void setEnabled(boolean bEnabled,
                                      int index)
Conditionally enables the tab at the specified index. The currently active tab cannot be disabled. This performs the same action as enableTab().

Parameters:
bEnable - true to enable, false to disable
index - the zero-relative index of the tab
 o showTab
  public void showTab(int index)
Shows the tab at the specified index. The tab must be enabled for it to be shown.

Parameters:
index - the zero-relative index of the tab to show
 o tabIsEnabled
  public boolean tabIsEnabled(int index)
Determines whether or not the tab at the index is enabled.

Parameters:
index - the zero-relative index of the tab
Returns:
true if the tab at the index is enabled
 o currentTabIndex
  public int currentTabIndex()
Determine the currently shown tab.

Returns:
zero-relative index of the currently shown tab
 o enableTab
  public void enableTab(boolean bEnable,
                        int index)
Conditionally enables the tab at the specified index. The currently active tab cannot be disabled. This performs the same action as setEnabled().

Parameters:
bEnable - true to enable, false to disable
index - the zero-relative index of the tab
 o removeTab
  public void removeTab(int index)
Removes the tab at the specified index. The currently shown tab cannot be removed.

Parameters:
index - the zero-relative index of the tab to remove
 o removeAllTabs
  public void removeAllTabs()
Removes all tabs.

 o layout
  public void layout()
Handles the laying out of components within this component. This is a standard Java AWT method which gets called by the AWT when this component is validated with the validate() method.

Overrides:
layout in class Container
See Also:
validate
 o paint
  public synchronized void paint(Graphics g)
Paints this component using the given graphics context. This is a standard Java AWT method which typically gets called by the AWT to handle painting this component. It paints this component using the given graphics context. The graphics context clipping region is set to the bounding rectangle of this component and its <0,0> coordinate is this component's top-left corner.

Parameters:
g - the graphics context used for painting
Overrides:
paint in class Container
See Also:
repaint, update
 o handleEvent
  public boolean handleEvent(Event evt)
Processes events for this component. This is a standard Java AWT method which gets called by the AWT to handle this component's events. The default handler for components dispatches to one of the following methods as needed: action(), gotFocus(), lostFocus(), keyDown(), keyUp(), mouseEnter(), mouseExit(), mouseMove(), mouseDrag(), mouseDown(), or mouseUp().

Parameters:
evt - the event to handle
Returns:
true if the event was handled and no further action is needed, false to pass the event to this component's parent
Overrides:
handleEvent in class Component
See Also:
action, gotFocus, lostFocus, keyDown, keyUp, mouseEnter, mouseExit, mouseMove, mouseDrag, mouseDown, mouseUp
 o add
  public Component add(Component comp)
Takes no action, use addTab(). This is a standard Java AWT method which gets called to add a component to a container. It is overridden here to do nothing, so the user cannot change the way this container works. Use setPanel, showPanel, addTab, and setTab instead.

Parameters:
comp - the component to add (IGNORED)
Returns:
the component parameter
Overrides:
add in class Container
See Also:
setPanel, showPanel, addTab, setTab, remove
 o add
  public synchronized Component add(Component comp,
                                    int pos)
Takes no action, use addTab(). This is a standard Java AWT method which gets called to add a component to a container. It is overridden here to do nothing, so the user cannot change the way this container works. Use setPanel, showPanel, addTab, and setTab instead.

Parameters:
comp - the component to add (IGNORED)
pos - the zero-relative index at which to add the component or -1 for end (IGNORED)
Returns:
the component parameter
Overrides:
add in class Container
See Also:
setPanel, showPanel, addTab, setTab, remove
 o add
  public synchronized Component add(String name,
                                    Component comp)
Takes no action, use addTab(). This is a standard Java AWT method which gets called to add a component to a container. It is overridden here to do nothing, so the user cannot change the way this container works. Use setPanel, showPanel, addTab, and setTab instead.

Parameters:
name - the positioning directive for the layout manager (IGNORED)
comp - the component to add (IGNORED)
Returns:
the component parameter
Overrides:
add in class Container
See Also:
setPanel, showPanel, addTab, setTab, remove
 o remove
  public synchronized void remove(Component comp)
Removes the specified component from this container. This is a standard Java AWT method which gets called to remove a component from a container. When this happens the component's removeNotify() will also get called to indicate component removal.

Parameters:
comp - the component to remove
Overrides:
remove in class Container
See Also:
removeAll, addTab
 o removeAll
  public synchronized void removeAll()
Removes all the components from this container. This is a standard Java AWT method which gets called to remove all the components from a container. When this happens each component's removeNotify() will also get called to indicate component removal.

Overrides:
removeAll in class Container
See Also:
remove, addTab
 o setLayout
  public void setLayout(LayoutManager mgr)
Takes no action. This is a standard Java AWT method which gets called to specify which layout manager should be used to layout the components in standard containers. Since layout managers CANNOT BE USED with this container the standard setLayout has been OVERRIDDEN for this container and does nothing.

Parameters:
l - the layout manager to use to layout this container's components (IGNORED)
Overrides:
setLayout in class Container
See Also:
getLayout
 o insets
  public Insets insets()
Returns the amount of space used by the current border. This is a standard Java AWT method which gets called to determine the size of the current border. The returned value is the width of each border side in pixels.

Returns:
the current border insets
Overrides:
insets in class Container
 o preferredSize
  public Dimension preferredSize()
Returns the recommended dimensions to properly display this component. This is a standard Java AWT method which gets called to determine the recommended size of this component.

Overrides:
preferredSize in class Container
See Also:
minimumSize
 o minimumSize
  public Dimension minimumSize()
Returns the minimum dimensions to properly display this component. This is a standard Java AWT method which gets called to determine the minimum size of this component.

Overrides:
minimumSize in class Container
See Also:
preferredSize

All Packages  Class Hierarchy  This Package  Previous  Next  Index