public abstract class CardPanel extends com.threerings.media.VirtualMediaPanel implements CardCodes
| Modifier and Type | Class and Description |
|---|---|
static interface |
CardPanel.CardSelectionObserver
A listener for card selection/deselection.
|
com.threerings.media.MediaPanel.ObscurerJComponent.AccessibleJComponentComponent.BaselineResizeBehavior| Modifier and Type | Field and Description |
|---|---|
static int |
MULTIPLE
The selection mode in which the user can select multiple cards.
|
static int |
NONE
The selection mode in which cards are not selectable.
|
static int |
SINGLE
The selection mode in which the user can select a single card.
|
CENTER_ON_PATHABLE, ENCLOSE_PATHABLE, TRACK_PATHABLETOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTACE, BLACK_JOKER, CLUBS, DIAMONDS, HEARTS, JACK, KING, QUEEN, RED_JOKER, SPADESACCESS_DENIED, E_ACCESS_DENIED, E_INTERNAL_ERROR, GLOBAL_GROUP, INTERNAL_ERRORABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
CardPanel(com.threerings.media.FrameManager frameManager)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addHandSelectionObserver(CardPanel.CardSelectionObserver obs)
Adds an object to the list of observers to notify when cards in the hand are
selected/deselected.
|
void |
addToBoard(Card card,
Point dest)
Adds a card to the board immediately.
|
void |
clearBoard()
Clears all cards from the board.
|
void |
clearHand()
Clears all cards from the hand.
|
void |
clearHandSelection()
Clears any existing hand sprite selection.
|
void |
deselectHandSprite(CardSprite sprite)
Programmatically deselects a sprite in the hand.
|
void |
flyAcross(Card[] cards,
Point src,
Point dest,
long flightDuration,
long cardDelay,
float fadePortion)
Flies a set of cards from the ether into the ether.
|
void |
flyAcross(int number,
Point src,
Point dest,
long flightDuration,
long cardDelay,
float fadePortion)
Flies a set of cards from the ether into the ether face-down.
|
void |
flyFromBoard(CardSprite[] cards,
Point dest,
long flightDuration,
float fadePortion)
Flies a set of cards from the board into the ether.
|
void |
flyFromBoard(CardSprite[] cards,
Point dest1,
Point dest2,
long flightDuration,
float fadePortion)
Flies a set of cards from the board into the ether through an intermediate point.
|
void |
flyFromHand(CardSprite[] cards,
Point dest,
long flightDuration,
float fadePortion)
Flies a set of cards from the hand into the ether.
|
void |
flyFromHandToBoard(CardSprite card,
Point dest,
long flightDuration)
Flies a card from the hand onto the board.
|
void |
flyIntoHand(Card[] cards,
Point src,
long flightDuration,
long pauseDuration,
long dropDuration,
float fadePortion)
Flies a set of cards from the ether into the hand.
|
void |
flyToBoard(Card card,
Point src,
Point dest,
long flightDuration,
float fadePortion)
Flies a card from the ether onto the board.
|
abstract com.threerings.media.image.Mirage |
getCardBackImage()
Returns the full-sized image for the back of a playing card.
|
abstract com.threerings.media.image.Mirage |
getCardImage(Card card)
Returns the full-sized image for the front of the specified card.
|
CardSprite |
getHandSprite(Card card)
Returns the first sprite in the hand that corresponds to the specified card, or null if the
card is not in the hand.
|
abstract com.threerings.media.image.Mirage |
getMicroCardBackImage()
Returns the small-sized image for the back of a playing card.
|
abstract com.threerings.media.image.Mirage |
getMicroCardImage(Card card)
Returns the small-sized image for the front of the specified card.
|
CardSprite |
getSelectedHandSprite()
Returns the currently selected hand sprite (null if no sprites are selected, the first
sprite if multiple sprites are selected).
|
CardSprite[] |
getSelectedHandSprites()
Returns an array containing the currently selected hand sprites (returns an empty array if
no sprites are selected).
|
void |
removeHandSelectionObserver(CardPanel.CardSelectionObserver obs)
Removes an object from the hand selection observer list.
|
void |
selectHandSprite(CardSprite sprite)
Programmatically selects a sprite in the hand.
|
void |
setHand(Hand hand,
long fadeDuration)
Fades a hand of cards in.
|
void |
setHand(int size,
long fadeDuration)
Fades a hand of cards in face-down.
|
void |
setHandLocation(int x,
int y)
Sets the location of the hand (the location of the center of the hand's upper edge).
|
void |
setHandSelectionMode(int mode)
Sets the selection mode for the hand (NONE, PLAY_SINGLE, SINGLE, or MULTIPLE).
|
void |
setHandSelectionPredicate(Predicate<CardSprite> pred)
Sets the selection predicate that determines which cards from the hand may be selected (if
null, all cards may be selected).
|
void |
setHandSpacing(int spacing)
Sets the horizontal spacing between cards in the hand.
|
void |
setSelectableCardOffset(int offset)
Sets the vertical distance to offset cards that are selectable or playable.
|
void |
setSelectedCardOffset(int offset)
Sets the vertical distance to offset cards that are selected.
|
void |
showHand(Hand hand)
Shows a hand that was previous set face-down.
|
addViewTracker, clearPathable, doLayout, getViewBounds, removeViewTracker, setBackground, setBounds, setFollowsPathable, setViewLocationabortAnimation, addAnimation, addObscurer, addSprite, clearAnimations, clearSprites, createGraphics, getAnimationManager, getComponent, getRegionManager, getSpriteManager, getTimeStamp, isManaged, isManaged, needsPaint, paint, removeObscurer, removeSprite, repaint, setOpaque, setPaused, tickaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUIadd, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validateaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic static final int NONE
public static final int SINGLE
public static final int MULTIPLE
public CardPanel(com.threerings.media.FrameManager frameManager)
frameManager - the frame managerpublic abstract com.threerings.media.image.Mirage getCardBackImage()
public abstract com.threerings.media.image.Mirage getCardImage(Card card)
public abstract com.threerings.media.image.Mirage getMicroCardBackImage()
public abstract com.threerings.media.image.Mirage getMicroCardImage(Card card)
public void setHandLocation(int x,
int y)
public void setHandSpacing(int spacing)
public void setSelectableCardOffset(int offset)
public void setSelectedCardOffset(int offset)
public void setHandSelectionMode(int mode)
public void setHandSelectionPredicate(Predicate<CardSprite> pred)
public CardSprite getSelectedHandSprite()
public CardSprite[] getSelectedHandSprites()
public void selectHandSprite(CardSprite sprite)
public void deselectHandSprite(CardSprite sprite)
public void clearHandSelection()
public void addHandSelectionObserver(CardPanel.CardSelectionObserver obs)
public void removeHandSelectionObserver(CardPanel.CardSelectionObserver obs)
public void setHand(Hand hand, long fadeDuration)
hand - the hand of cardsfadeDuration - the amount of time to spend fading in the entire handpublic void setHand(int size,
long fadeDuration)
size - the size of the handfadeDuration - the amount of time to spend fading in each cardpublic void showHand(Hand hand)
hand - the hand of cardspublic CardSprite getHandSprite(Card card)
public void clearHand()
public void clearBoard()
public void flyFromHand(CardSprite[] cards, Point dest, long flightDuration, float fadePortion)
cards - the card sprites to remove from the handdest - the point to fly the cards toflightDuration - the duration of the cards' flightfadePortion - the amount of time to spend fading out as a proportion of the flight
durationpublic void flyIntoHand(Card[] cards, Point src, long flightDuration, long pauseDuration, long dropDuration, float fadePortion)
cards - the cards to add to the handsrc - the point to fly the cards fromflightDuration - the duration of the cards' flightpauseDuration - the duration of the pause before dropping into the handdropDuration - the duration of the cards' drop into the handfadePortion - the amount of time to spend fading in as a proportion of the flight
durationpublic void flyAcross(Card[] cards, Point src, Point dest, long flightDuration, long cardDelay, float fadePortion)
cards - the cards to fly acrosssrc - the point to fly the cards fromdest - the point to fly the cards toflightDuration - the duration of the cards' flightcardDelay - the amount of time to wait between cardsfadePortion - the amount of time to spend fading in and out as a proportion of the
flight durationpublic void flyAcross(int number,
Point src,
Point dest,
long flightDuration,
long cardDelay,
float fadePortion)
number - the number of cards to fly acrosssrc - the point to fly the cards fromdest - the point to fly the cards toflightDuration - the duration of the cards' flightcardDelay - the amount of time to wait between cardsfadePortion - the amount of time to spend fading in and out as a proportion of the
flight durationpublic void flyFromHandToBoard(CardSprite card, Point dest, long flightDuration)
card - the sprite to remove from the handdest - the point to fly the card toflightDuration - the duration of the card's flightpublic void flyToBoard(Card card, Point src, Point dest, long flightDuration, float fadePortion)
card - the card to add to the boardsrc - the point to fly the card fromdest - the point to fly the card toflightDuration - the duration of the card's flightfadePortion - the amount of time to spend fading in as a proportion of the flight
durationpublic void addToBoard(Card card, Point dest)
card - the card to add to the boarddest - the point at which to add the cardpublic void flyFromBoard(CardSprite[] cards, Point dest, long flightDuration, float fadePortion)
cards - the cards to remove from the boarddest - the point to fly the cards toflightDuration - the duration of the cards' flightfadePortion - the amount of time to spend fading out as a proportion of the flight
durationpublic void flyFromBoard(CardSprite[] cards, Point dest1, Point dest2, long flightDuration, float fadePortion)
cards - the cards to remove from the boarddest1 - the first point to fly the cards todest2 - the final destination of the cardsflightDuration - the duration of the cards' flightfadePortion - the amount of time to spend fading out as a proportion of the flight
durationCopyright © 2015. All rights reserved.