Blackjack

com.amoebacode.blackjack.display
Class PreferencesDisplay

java.lang.Object
  |
  +--com.amoebacode.blackjack.display.DisplayElement
        |
        +--com.amoebacode.blackjack.display.PreferencesDisplay

public class PreferencesDisplay
extends DisplayElement

PreferencesDisplay displays and manages the game preferences and the display preferences.

Version:
0.9
Author:
Jason Gurney

Field Summary
private  PreferencesComboBox animationComboBox
          The animation selection box
private  PreferencesComboBox audioComboBox
          The audio selection box
private  DisplayPreferences displayPrefs
          The display preferences
static java.lang.String FAST_ANIMATION
          The fast animation option
private  IPreferences preferences
          The game preferences
static java.lang.String SLOW_ANIMATION
          The slow animation option
private  PreferencesComboBox strategyComboBox
          The strategy tutor selection box
 
Fields inherited from class com.amoebacode.blackjack.display.DisplayElement
parent
 
Constructor Summary
protected PreferencesDisplay(GameDisplay parent)
          Default protected constructor
 
Method Summary
 void closePreferences()
          Hides the preferences select boxes and associated button.
 void hidePreferences()
          Hides the preferences select boxes.
 boolean isFastAnimationDelay()
          Indicates whether the current animation delay is fast.
 boolean isPlayAudio()
          Indicates whether sound clips should be played.
 boolean isSlowAnimationDelay()
          Indicates whether the current animation delay is slow.
 boolean isStrategyTutor()
          Indicates whether the basic strategy tutor is on.
 void setAnimationDelay(java.lang.String delay)
          Sets the animation delay to slow or fast.
protected  void setDisplayPreferences(DisplayPreferences displayPrefs)
          Sets the display preferences for this display object.
 void setFastAnimation()
          Sets the animation delay to fast animation.
 void setPlayAudio(boolean playAudio)
          Turns the audio on or off.
protected  void setPreferences(IPreferences preferences)
          Sets the game preferences for this display object.
 void setSlowAnimation()
          Sets the animation delay to slow animation.
 void setStrategyTutor(boolean strategyTutor)
          Turns the basic strategy tutor on or off.
 void showPreferences()
          Unhides the preferences select boxes.
private  void showPreferences(boolean display)
          Displays or hides the preferences select boxes.
 
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

SLOW_ANIMATION

public static final java.lang.String SLOW_ANIMATION
The slow animation option

FAST_ANIMATION

public static final java.lang.String FAST_ANIMATION
The fast animation option

animationComboBox

private PreferencesComboBox animationComboBox
The animation selection box

strategyComboBox

private PreferencesComboBox strategyComboBox
The strategy tutor selection box

audioComboBox

private PreferencesComboBox audioComboBox
The audio selection box

preferences

private IPreferences preferences
The game preferences

displayPrefs

private DisplayPreferences displayPrefs
The display preferences
Constructor Detail

PreferencesDisplay

protected PreferencesDisplay(GameDisplay parent)
Default protected constructor
Parameters:
parent - the GameDisplay parent
Method Detail

setPreferences

protected void setPreferences(IPreferences preferences)
Sets the game preferences for this display object.
Parameters:
preferences - the game IPreferences

setDisplayPreferences

protected void setDisplayPreferences(DisplayPreferences displayPrefs)
Sets the display preferences for this display object.
Parameters:
displayPrefs - the DisplayPreferences

showPreferences

public void showPreferences()
Unhides the preferences select boxes.

showPreferences

private void showPreferences(boolean display)
Displays or hides the preferences select boxes.
Parameters:
display - the new visibility attribute

closePreferences

public void closePreferences()
Hides the preferences select boxes and associated button.

hidePreferences

public void hidePreferences()
Hides the preferences select boxes.

setSlowAnimation

public void setSlowAnimation()
Sets the animation delay to slow animation.

setFastAnimation

public void setFastAnimation()
Sets the animation delay to fast animation.

isStrategyTutor

public boolean isStrategyTutor()
Indicates whether the basic strategy tutor is on.
Returns:
true if the basic strategy tutor is on

setStrategyTutor

public void setStrategyTutor(boolean strategyTutor)
Turns the basic strategy tutor on or off.
Parameters:
strategyTutor - the new basic strategy tutor setting

setPlayAudio

public void setPlayAudio(boolean playAudio)
Turns the audio on or off.
Parameters:
strategyTutor - the new audio setting

setAnimationDelay

public void setAnimationDelay(java.lang.String delay)
Sets the animation delay to slow or fast.
Parameters:
delay - a String representing slow or fast animation

isSlowAnimationDelay

public boolean isSlowAnimationDelay()
Indicates whether the current animation delay is slow.
Returns:
true if using slow animation

isFastAnimationDelay

public boolean isFastAnimationDelay()
Indicates whether the current animation delay is fast.
Returns:
true if using fast animation

isPlayAudio

public boolean isPlayAudio()
Indicates whether sound clips should be played.
Returns:
true if audio is on

Blackjack

Copyright © 2002 amoebacode.com.