Bean Builder

com.adventnet.beans.panels
Class CardPanel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--com.adventnet.beans.panels.CardPanel

public class CardPanel
extends javax.swing.JPanel

The CardPanel bean takes in an array of card names and the class names given to it and displays the component of a specified card name.

Drop a panel in a Screen1 with some components in it. Now, create a Screen2 with a CardPanel and set the following property

 CardPanel1.setCardAndClassNames();
 

If the property is set using Property sheet of the bean then set the following codes


 screen = screen1. (In the property of Card and Card Names[]).
 

Then the class Screen1 can be called by the following code snippet


 CardPanel1.showCard("screen");
 
On Compiling both the Screens and running the Screen2 , Screen1 along with its components is displayed.

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
CardPanel()
           
CardPanel(java.applet.Applet appletArg)
           
 
Method Summary
 java.awt.Component getCard(java.lang.String cardNameArg)
          Returns the component for a specified card name
 java.awt.Component getCard(java.lang.String cardNameArg, java.lang.Object[] initParamsArg)
          Returns the component for a specified card name and also initializes the values, that are specified for that component as the second parameter
 java.lang.String[] getCardAndClassNames()
          Returns an array of card Names and Classnames.
 java.awt.Component getCardIfAlreadyCreated(java.lang.String cardNameArg)
          Returns a component if the card is already created for the given String
 java.lang.String[] getCardNames()
          Returns the card names in the form of String array
 java.lang.String[] getClassNames()
          Returns the class names used in the form of an String array
 java.lang.String getFirstCardName()
          Returns the First card Name in the list and returns Null if there are no cards.
 java.lang.String getNextCardName()
          Returns the Next card Name to that of the currently selected card.
 java.lang.String getPreviousCardName()
          Returns the Previous card Name to that of the currently selected card.
 java.awt.Component getSelectedCard()
          Returns the selected component in the card panel
 java.lang.String getSelectedCardName()
          Returns the selected card name
 void setCardAndClassNames(java.lang.String[] cardAndClassNamesArg)
          USAGE : cardName = ClassName This takes in an array of card Names and their corresponding ClassNames The card names and the class names are separated by "=".
 void showCard(java.lang.String cardNameArg)
          Shows the component for a specified card name
 void showCard(java.lang.String cardNameArg, java.lang.Object[] showParamsArg)
          Shows the component for a specified card name and also passes the values that are specified for that component as the second parameter
 void showCard(java.lang.String cardNameArg, java.lang.Object[] showParamsArg, java.lang.Object[] initParamsArg)
          Shows the component for a specified card name and also passes the values that are specified for that component as the second parameter and the third parameter is to initialize the values for that component
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, paramString, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, processComponentKeyEvent, processFocusEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setCursor, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CardPanel

public CardPanel()

CardPanel

public CardPanel(java.applet.Applet appletArg)
Method Detail

getClassNames

public java.lang.String[] getClassNames()
Returns the class names used in the form of an String array
Returns:
a String[] value

getCardNames

public java.lang.String[] getCardNames()
Returns the card names in the form of String array
Returns:
a String[] value

setCardAndClassNames

public void setCardAndClassNames(java.lang.String[] cardAndClassNamesArg)
USAGE : cardName = ClassName This takes in an array of card Names and their corresponding ClassNames The card names and the class names are separated by "=".

getCardAndClassNames

public java.lang.String[] getCardAndClassNames()
Returns an array of card Names and Classnames. The array has values in the form "cardName = ClassName" The corresponding card names and class names are mapped by "=".

getSelectedCardName

public java.lang.String getSelectedCardName()
Returns the selected card name

getSelectedCard

public java.awt.Component getSelectedCard()
Returns the selected component in the card panel

getCard

public java.awt.Component getCard(java.lang.String cardNameArg)
Returns the component for a specified card name

getCard

public java.awt.Component getCard(java.lang.String cardNameArg,
                                  java.lang.Object[] initParamsArg)
Returns the component for a specified card name and also initializes the values, that are specified for that component as the second parameter

getCardIfAlreadyCreated

public java.awt.Component getCardIfAlreadyCreated(java.lang.String cardNameArg)
Returns a component if the card is already created for the given String
Parameters:
cardNameArg - a String value
Returns:
a Component value

showCard

public void showCard(java.lang.String cardNameArg)
Shows the component for a specified card name

showCard

public void showCard(java.lang.String cardNameArg,
                     java.lang.Object[] showParamsArg)
Shows the component for a specified card name and also passes the values that are specified for that component as the second parameter

showCard

public void showCard(java.lang.String cardNameArg,
                     java.lang.Object[] showParamsArg,
                     java.lang.Object[] initParamsArg)
Shows the component for a specified card name and also passes the values that are specified for that component as the second parameter and the third parameter is to initialize the values for that component

getFirstCardName

public java.lang.String getFirstCardName()
Returns the First card Name in the list and returns Null if there are no cards.

getNextCardName

public java.lang.String getNextCardName()
Returns the Next card Name to that of the currently selected card. It returns the First card Name, if there are cards but no card has been currently selected. 'Null', if there are no cards. 'Null' if it is the first card.

getPreviousCardName

public java.lang.String getPreviousCardName()
Returns the Previous card Name to that of the currently selected card. 'Null' if there are cards but no card has been currently selected, 'Null' if there are no cards, 'Null' if it is the current selected card is the first card.

Bean Builder

© 2001 - 2002 AdventNet Inc. Visit us at: http://www.adventnet.com