Class ncsa.horizon.awt.CardPanel
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ncsa.horizon.awt.CardPanel

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----ncsa.horizon.awt.CardPanel

public class CardPanel
extends Panel
This is a special panel to CardLayout Components with tab-like CardButtons. Card means the Component and its label. There are tabs to select which Panel is visible.

A Component is added with a name by call addCard method. The name then is used as the component's tab label. A component can be removed with the name or component's reference. CardPanel will reorgornized the tab layouts dynamically.


Constructor Index

 o CardPanel(String, Component)
Construct the CardPanel.

Method Index

 o addCard(String, Component)
Add in a component.
 o mouseDown(Event, int, int)
 o paint(Graphics)
 o removeCard(Component)
Remove the component by input its reference.
 o removeCard(String)
Remove the component by input its label.
 o show(Component)
Make this component visible among all the components
 o show(String)
Make the component with this name to be visible among all the Components.

Constructors

 o CardPanel
  public CardPanel(String name,
                   Component comp)
Construct the CardPanel.

Methods

 o addCard
  public void addCard(String name,
                      Component comp)
Add in a component. It becomes the current visible card.
Parameters:
name - name of the component, it will be used as tab label
comp - the component to be added.
 o mouseDown
  public boolean mouseDown(Event evt,
                           int x,
                           int y)
Overrides:
mouseDown in class Component
 o paint
  public void paint(Graphics g)
Overrides:
paint in class Component
 o removeCard
  public void removeCard(String name)
Remove the component by input its label.
Parameters:
name - label of the component to be removed
 o removeCard
  public void removeCard(Component cmp)
Remove the component by input its reference.
Parameters:
cmp - reference of the component to be removed
 o show
  public void show(Component comp)
Make this component visible among all the components
Parameters:
reference - of the component to be showed.
 o show
  public void show(String name)
Make the component with this name to be visible among all the Components.
Parameters:
name - of the component to be showed.

All Packages  Class Hierarchy  This Package  Previous  Next  Index