Blackjack

com.amoebacode.blackjack.display.button
Class HandButton

java.lang.Object
  |
  +--com.amoebacode.blackjack.display.DisplayElement
        |
        +--com.amoebacode.blackjack.display.button.ButtonBase
              |
              +--com.amoebacode.blackjack.display.button.HandButton
Direct Known Subclasses:
DoubleDownButton, HitButton, InsuranceButton, NoInsuranceButton, SplitButton, StandButton, SurrenderButton

abstract class HandButton
extends ButtonBase

HandButton is the base class for all hand buttons (hit, stand, etc.)

Version:
0.9
Author:
Jason Gurney

Field Summary
private  PlayerHandDisplay playerHand
          The hand controled by this button
 
Fields inherited from class com.amoebacode.blackjack.display.button.ButtonBase
button, buttonListener, HEIGHT, WIDTH
 
Fields inherited from class com.amoebacode.blackjack.display.DisplayElement
parent
 
Constructor Summary
protected HandButton(PlayerHandDisplay playerHand)
          Default protected constructor.
 
Method Summary
protected  void actionPreamble(java.awt.event.ActionEvent ae)
          Performs the preamble to the specified action event.
protected  PlayerHandDisplay getPlayerHand()
          Returns the player hand corresponding to this button.
protected  int getXPos()
          Returns the horizontal position of the button.
protected abstract  int getYOffset()
          Returns the vertical distance between this button and the player hand.
protected  int getYPos()
          Returns the vertical position of the button.
abstract  void performAction()
          Performs the action associated with the button (called when it is clicked by the user).
protected  void setupButton()
          Creates the button component and adds it to the violator layer of the primary layered pane.
 
Methods inherited from class com.amoebacode.blackjack.display.button.ButtonBase
activate, clear, disable, displayDisable, getButtonListener, getButtonText, getHeight, getToolTipText, getWidth, hide, setMouseEnteredBackground, setMouseExitedBackground
 
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

playerHand

private PlayerHandDisplay playerHand
The hand controled by this button
Constructor Detail

HandButton

protected HandButton(PlayerHandDisplay playerHand)
Default protected constructor.
Parameters:
playerHand - the parent PlayerHandDisplay
Method Detail

getYOffset

protected abstract int getYOffset()
Returns the vertical distance between this button and the player hand.
Returns:
the vertical difference in pixels

actionPreamble

protected void actionPreamble(java.awt.event.ActionEvent ae)
Description copied from class: ButtonBase
Performs the preamble to the specified action event.
Overrides:
actionPreamble in class ButtonBase
See Also:
ButtonBase.actionPreamble(ActionEvent)

performAction

public abstract void performAction()
Performs the action associated with the button (called when it is clicked by the user).

setupButton

protected void setupButton()
Description copied from class: ButtonBase
Creates the button component and adds it to the violator layer of the primary layered pane.
Overrides:
setupButton in class ButtonBase
See Also:
ButtonBase.setupButton()

getXPos

protected int getXPos()
Description copied from class: ButtonBase
Returns the horizontal position of the button.
Overrides:
getXPos in class ButtonBase
See Also:
ButtonBase.getXPos()

getYPos

protected int getYPos()
Description copied from class: ButtonBase
Returns the vertical position of the button.
Overrides:
getYPos in class ButtonBase
See Also:
ButtonBase.getYPos()

getPlayerHand

protected PlayerHandDisplay getPlayerHand()
Returns the player hand corresponding to this button.
Returns:
the PlayerHandDisplay parent of this button

Blackjack

Copyright © 2002 amoebacode.com.