|
|||||||||
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.AbstractButton | +--javax.swing.JButton | +--de.kosi.gui.view.game.CardComponent
The graphical representation of a card.
Inner classes inherited from class javax.swing.JButton |
javax.swing.JButton.AccessibleJButton |
Inner classes inherited from class javax.swing.AbstractButton |
javax.swing.AbstractButton.AccessibleAbstractButton, javax.swing.AbstractButton.ButtonChangeListener |
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 | |
protected CCard |
card
The card shown by this component. |
int |
cardHandCount
Layout information. |
int |
cardHandIndex
Layout information. |
int |
cardSuitCount
Layout information. |
int |
cardSuitIndex
Layout information. |
protected boolean |
focus
A flag indicating whether this card component has the focus or not. |
int |
layer
Layout information. |
protected int |
orientation
The orientation of this component. |
protected boolean |
pressed
A flag indicating whether this card component is pressed or not. |
protected boolean |
rollover
A flag indicating whether this card component in roll over state or not. |
int |
suitCount
Layout information. |
int |
suitIndex
Layout information. |
Fields inherited from class javax.swing.AbstractButton |
actionListener, BORDER_PAINTED_CHANGED_PROPERTY, changeEvent, changeListener, CONTENT_AREA_FILLED_CHANGED_PROPERTY, DISABLED_ICON_CHANGED_PROPERTY, DISABLED_SELECTED_ICON_CHANGED_PROPERTY, FOCUS_PAINTED_CHANGED_PROPERTY, HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, ICON_CHANGED_PROPERTY, itemListener, MARGIN_CHANGED_PROPERTY, MNEMONIC_CHANGED_PROPERTY, model, MODEL_CHANGED_PROPERTY, PRESSED_ICON_CHANGED_PROPERTY, ROLLOVER_ENABLED_CHANGED_PROPERTY, ROLLOVER_ICON_CHANGED_PROPERTY, ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY, SELECTED_ICON_CHANGED_PROPERTY, TEXT_CHANGED_PROPERTY, VERTICAL_ALIGNMENT_CHANGED_PROPERTY, VERTICAL_TEXT_POSITION_CHANGED_PROPERTY |
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 javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NORTH, NORTH_EAST, NORTH_WEST, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
CardComponent()
Creates a new card component. |
Method Summary | |
void |
focusGained(java.awt.event.FocusEvent event)
Informs this component that it received the focus. |
void |
focusLost(java.awt.event.FocusEvent event)
Informs this component that it lost the focus. |
CCard |
getCard()
Gets the card this component shows. |
int |
getOrientation()
Returns the orientation of the card component. |
int |
getSuit()
Gets this card components suit. |
int |
getValue()
Gets this card components value. |
boolean |
hasFocus()
Returns true if this component has got the focus. |
boolean |
isPressed()
Gets the pressed state of this card component. |
boolean |
isRollover()
Gets the highlit state of this card component. |
void |
paintComponent(java.awt.Graphics graphics)
Paints this component. |
void |
resourceBundleChanged(CResourceBundle resourceBundle)
Informs this card component that the resource bundle has been changed. |
void |
setCard(CCard card)
Sets the card which this component displays. |
void |
setEnabled(boolean enabled)
Disables or enabled this component. |
static void |
setEnabled(java.util.Collection cardComponents,
boolean enabled)
Sets the enabled state of all cards in the specified collection to the given enabled state. |
void |
setFocus(boolean focus)
Sets this components focus flag. |
void |
setOrientation(int orientation)
Sets the orientation of the card component. |
void |
setPressed(boolean pressed)
Sets this components pressed state. |
void |
setRollover(boolean rollover)
Sets this components roll over state. |
static void |
setVisible(java.util.Collection cardComponents,
boolean visible)
Shows or hides the specified card components. |
Methods inherited from class javax.swing.JButton |
configurePropertiesFromAction, getAccessibleContext, getUIClassID, isDefaultButton, isDefaultCapable, paramString, removeNotify, setDefaultCapable, updateUI |
Methods inherited from class javax.swing.AbstractButton |
addActionListener, addChangeListener, addItemListener, checkHorizontalKey, checkVerticalKey, createActionListener, createActionPropertyChangeListener, createChangeListener, createItemListener, doClick, doClick, fireActionPerformed, fireItemStateChanged, fireStateChanged, getAction, getActionCommand, getDisabledIcon, getDisabledSelectedIcon, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getLabel, getMargin, getMnemonic, getModel, getPressedIcon, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getSelectedObjects, getText, getUI, getVerticalAlignment, getVerticalTextPosition, imageUpdate, init, isBorderPainted, isContentAreaFilled, isFocusPainted, isFocusTraversable, isRolloverEnabled, isSelected, paintBorder, removeActionListener, removeChangeListener, removeItemListener, setAction, setActionCommand, setBorderPainted, setContentAreaFilled, setDisabledIcon, setDisabledSelectedIcon, setFocusPainted, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setLabel, setMargin, setMnemonic, setMnemonic, setModel, setPressedIcon, setRolloverEnabled, setRolloverIcon, setRolloverSelectedIcon, setSelected, setSelectedIcon, setText, setUI, setVerticalAlignment, setVerticalTextPosition |
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, hide, isDoubleBuffered, isFocusCycleRoot, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, 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, 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, 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 |
Field Detail |
protected CCard card
protected int orientation
public int cardHandIndex
public int cardHandCount
public int cardSuitIndex
public int cardSuitCount
public int suitCount
public int suitIndex
public int layer
protected boolean focus
protected boolean pressed
protected boolean rollover
Constructor Detail |
public CardComponent()
Method Detail |
public void resourceBundleChanged(CResourceBundle resourceBundle)
resourceBundleChanged
in interface ResourceBundleChangeListener
resourceBundle
- the new resource bundle.public void setCard(CCard card)
null
is not allowed.
Use CCard.getBack()
instead, which tells this
component to show the back side of a card.card
- the card to display.public CCard getCard()
card
field.public int getSuit()
public int getValue()
public void setOrientation(int orientation)
orientation
- one of CConstants.ORIENTATION_TOP
,
CConstants.ORIENTATION_RIGHT
, ...public int getOrientation()
CConstants.ORIENTATION_
X constants.public void paintComponent(java.awt.Graphics graphics)
paintComponent
in class javax.swing.JComponent
graphics
- the graphics context.public void focusGained(java.awt.event.FocusEvent event)
event
- the event that caused the focus change.public void focusLost(java.awt.event.FocusEvent event)
event
- the event that caused the focus change.public void setEnabled(boolean enabled)
setEnabled
in class javax.swing.AbstractButton
enabled
- if true
this component becomes enabled.public void setPressed(boolean pressed)
pressed
- the new pressed state.public void setRollover(boolean rollover)
rollover
- the new roll over state.public void setFocus(boolean focus)
focus
- the new focus state.public boolean isRollover()
true
if this card component is in roll over state.public boolean isPressed()
true
if this card component is pressed.public boolean hasFocus()
true
if this component has got the focus.hasFocus
in class javax.swing.JComponent
true
if this component has got the focus.public static void setEnabled(java.util.Collection cardComponents, boolean enabled)
cardComponents
- the card components to set the enabled state of.enabled
- the enabled state all card components become set to.public static void setVisible(java.util.Collection cardComponents, boolean visible)
cardComponents
- the card components.visible
- the new visible state of the card components.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |