Blackjack

com.amoebacode.blackjack.display
Class DeckDisplay

java.lang.Object
  |
  +--com.amoebacode.blackjack.display.DisplayElement
        |
        +--com.amoebacode.blackjack.display.DeckDisplay
All Implemented Interfaces:
BlackjackEventListener, DeckEventListener, java.util.EventListener

public class DeckDisplay
extends DisplayElement
implements DeckEventListener

DeckDisplay displays the shoe of cards and the number of decks left.

Version:
0.9
Author:
Jason Gurney

Field Summary
private  javax.swing.JLabel cardsLabel
          The deck blank card label
private  LabelWrapper decksLabel
          The label tracking the number of decks remaining
 
Fields inherited from class com.amoebacode.blackjack.display.DisplayElement
parent
 
Constructor Summary
protected DeckDisplay(GameDisplay game)
          Default protected constructor.
 
Method Summary
 void drawDeck(IDeck deck)
          Draws the deck, including the blank card and the decks remaining label.
 int getXPos()
          Returns the horizontal position of this deck.
 int getYPos()
          Returns the vertical position of this deck.
 void updateDecksLabel(BlackjackEvent event)
          Updates the remaining decks label with the current number of decks remaining.
private  void updateDecksLabel(IDeck deck)
          Updates the label indicating the number of decks left.
 
Methods inherited from class com.amoebacode.blackjack.display.DisplayElement
executeGameCommand, getDisplayManager, getGameDisplay, getParent, hasParent, playGameClip, queueAction, resumeQueue
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

decksLabel

private LabelWrapper decksLabel
The label tracking the number of decks remaining

cardsLabel

private javax.swing.JLabel cardsLabel
The deck blank card label
Constructor Detail

DeckDisplay

protected DeckDisplay(GameDisplay game)
Default protected constructor.
Parameters:
game - the GameDisplay parent
Method Detail

drawDeck

public void drawDeck(IDeck deck)
Draws the deck, including the blank card and the decks remaining label.

updateDecksLabel

public void updateDecksLabel(BlackjackEvent event)
Description copied from interface: DeckEventListener
Updates the remaining decks label with the current number of decks remaining.
Specified by:
updateDecksLabel in interface DeckEventListener
See Also:
DeckEventListener.updateDecksLabel(BlackjackEvent)

updateDecksLabel

private void updateDecksLabel(IDeck deck)
Updates the label indicating the number of decks left.
Parameters:
deck - the IDeck being displayed

getXPos

public int getXPos()
Returns the horizontal position of this deck.
Returns:
this deck's horizontal position

getYPos

public int getYPos()
Returns the vertical position of this deck.
Returns:
this deck's vertical position

Blackjack

Copyright © 2002 amoebacode.com.