|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--de.kosi.gui.view.game.CardContainer
The CardContainer class displays the cards and name of a player.
ChangeLog:
$Log: CardContainer.java,v $ Revision 1.15 2001/07/13 10:49:06 jiriki Started fix for Bugs 440155 and 440333. Revision 1.14 2001/06/27 11:58:50 jiriki Re-added LandF menu. Some code cleanup Revision 1.13 2001/06/20 12:44:34 jiriki Added Background Revision 1.12 2001/06/15 15:01:13 jiriki Cards are displayed after game Revision 1.11 2001/06/15 13:42:30 jiriki Tricks are displayed during the game. Revision 1.10 2001/06/14 14:41:01 jiriki Code maintanance (Updated docs, removed unused code, improved code style)
Inner classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
Field Summary | |
static int[][] |
SUIT_ORDER
Order of suits, for a given trump suit. |
static int |
UNKNOWN_SUIT
Index of cards, for which the suit is unknown. |
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 |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
CardContainer(int orientation,
CardDimension cardDimension,
java.awt.event.ActionListener listener)
Creates a new CardContainer. |
Method Summary | |
void |
clear()
Removes all cards from this container. |
void |
disableCards()
Disables all cards. |
void |
enableCards(int suitToFollow)
Enable cards for the given suit to follow. |
java.util.Collection |
getCardsAllowedToPlay(int suitToFollow)
Returns all card components the user is allowed to play. |
void |
init()
Initializes the component with Card.NUM_CARDS_PER_PLAYER unknown cards. |
CardComponent |
playCard(Card card)
Plays a card. |
void |
resourceBundleChanged(CResourceBundle resourceBundle)
Invoked when the resource bundle has been changed. |
void |
setCards(java.util.List cards)
Sets the cards in this cardContainer. |
void |
setDummy(boolean isDummy)
Sets wether this cardContainer displays the dummy cards. |
void |
setName(java.lang.String name)
Set the name of the player. |
void |
setNumberOfCards(int number)
|
void |
setTrumpSuit(int trumpSuit)
Sets the current trump suit. |
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, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, 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, setLayout, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, 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, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setSize, setSize, show, show, size, toString, transferFocus |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int UNKNOWN_SUIT
public static final int[][] SUIT_ORDER
Constructor Detail |
public CardContainer(int orientation, CardDimension cardDimension, java.awt.event.ActionListener listener)
orientation
- The orientation for the cardContainer.
This determines the layout of the cards. It has
to be the value of oone of the CConstant.ORIENTATION_*
contants.cardDimension
- Contains the dimensions for the cards.listener
- Listener that is called, when a card is to be played.Method Detail |
public void enableCards(int suitToFollow)
suitToFollow
- Suit to follow.public java.util.Collection getCardsAllowedToPlay(int suitToFollow)
suitToFollow
- Suit that has to be followed.public void disableCards()
public void setCards(java.util.List cards)
cards
- List containing de.kosi.model.game.Card
objects.public void setNumberOfCards(int number)
public void init()
Card.NUM_CARDS_PER_PLAYER
unknown cards.public void clear()
public CardComponent playCard(Card card)
card
- To be played.public void setTrumpSuit(int trumpSuit)
trumpSuit
- The new trump suit.public void setDummy(boolean isDummy)
isDummy
- wether this cardContainer displays the dummy cards.public void setName(java.lang.String name)
setName
in class java.awt.Component
name
- Name of the player.public void resourceBundleChanged(CResourceBundle resourceBundle)
ResourceBundleChangeListener
resourceBundleChanged
in interface ResourceBundleChangeListener
de.kosi.gui.util.ResourceBundleChangeListener
resource
- bundle the new resource bundle.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |