    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.

##

CardPanel(String, Component)
  Construct the CardPanel.

##

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

##

CardPanel

      public CardPanel(String name,
                       Component comp)

  Construct the CardPanel.

##

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.

mouseDown

      public boolean mouseDown(Event evt,
                               int x,
                               int y)

Overrides:
  mouseDown in class Component

paint

      public void paint(Graphics g)

Overrides:
  paint in class Component

removeCard

      public void removeCard(String name)

  Remove the component by input its label.
  Parameters:
    name - label of the component to be removed

removeCard

      public void removeCard(Component cmp)

  Remove the component by input its reference.
  Parameters:
    cmp - reference of the component to be removed

show

      public void show(Component comp)

  Make this component visible among all the components
  Parameters:
    reference - of the component to be showed.

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