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.
-
BOTTOM
- Position constant indicating tabs are to be put at the bottom of this panel.
-
curIndex
- Zero-relative index of currently shown tab.
-
ROUNDED
- Style constant indicating tabs are to have rounded corners.
-
SQUARE
- Style constant indicating tabs are to have square corners.
-
TOP
- Position constant indicating tabs are to be put at the top of this panel.
-
BaseTabbedPanel()
- Constructs a BaseTabbedPanel with tabs on top and rounded.
-
BaseTabbedPanel(boolean)
- Obsolete.
-
BaseTabbedPanel(int, int)
- Constructs a BaseTabbedPanel with the desired tab position
and corner style.
-
add(Component)
- Takes no action, use addTab().
-
add(Component, int)
- Takes no action, use addTab().
-
add(String, Component)
- Takes no action, use addTab().
-
addTab(String, boolean)
- Appends a new tab and sets whether it is enabled.
-
currentTabIndex()
- Determine the currently shown tab.
-
enableTab(boolean, int)
- Conditionally enables the tab at the specified index.
-
getLabel(int)
- Gets the label of the tab at the specified index.
-
getTabsPosition()
- Gets the current tabs position, TOP or BOTTOM.
-
getTabsStyle()
- Gets the current tab style, ROUNDED or SQUARE.
-
handleEvent(Event)
- Processes events for this component.
-
insets()
- Returns the amount of space used by the current border.
-
layout()
- Handles the laying out of components within this component.
-
minimumSize()
- Returns the minimum dimensions to properly display this component.
-
paint(Graphics)
- Paints this component using the given graphics context.
-
preferredSize()
- Returns the recommended dimensions to properly display this component.
-
remove(Component)
- Removes the specified component from this container.
-
removeAll()
- Removes all the components from this container.
-
removeAllTabs()
- Removes all tabs.
-
removeTab(int)
- Removes the tab at the specified index.
-
setEnabled(boolean, int)
- Conditionally enables the tab at the specified index.
-
setLabel(String, int)
- Changes the label of the tab at the specified index.
-
setLayout(LayoutManager)
- Takes no action.
-
setPanel(Component)
- Adds the panel to the base panel and shows it.
-
setTab(String, boolean, int)
- Labels and conditionally enables the tab at the specified index.
-
setTabsInfo(int, int)
- Sets the position and style of all the tabs.
-
setTabsPosition(int)
- Sets the position of the all tabs to the top or bottom of this panel.
-
setTabsStyle(int)
- Sets the style of the tabs to ROUNDED or SQUARE.
-
showPanel(Component)
- Adds the panel to the base panel and shows it.
-
showTab(int)
- Shows the tab at the specified index.
-
tabIsEnabled(int)
- Determines whether or not the tab at the index is enabled.
TOP
public final static int TOP
- Position constant indicating tabs are to be put at the top of this panel.
BOTTOM
public final static int BOTTOM
- Position constant indicating tabs are to be put at the bottom of this panel.
ROUNDED
public final static int ROUNDED
- Style constant indicating tabs are to have rounded corners.
SQUARE
public final static int SQUARE
- Style constant indicating tabs are to have square corners.
curIndex
protected int curIndex
- Zero-relative index of currently shown tab. -1 if no tabs exist or are shown.
BaseTabbedPanel
public BaseTabbedPanel()
- Constructs a BaseTabbedPanel with tabs on top and rounded.
BaseTabbedPanel
public BaseTabbedPanel(boolean bTabsOnTop)
- Obsolete. Use public BaseTabbedPanel(int tabsPostion, int tabsStyle).
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
currentTabIndex
public int currentTabIndex()
- Determine the currently shown tab.
- Returns:
- zero-relative index of the currently shown tab
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
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
removeAllTabs
public void removeAllTabs()
- Removes all tabs.
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
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
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
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
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
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
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
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
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
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
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
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