net.bluebones.boggle
Class Theme

java.lang.Object
  extended by net.bluebones.boggle.Theme
All Implemented Interfaces:
Cloneable

public class Theme
extends Object
implements Cloneable

Represents a set of appearance settings for Boggle. Also provides methods of storing and retrieving the current Theme.

Version:
0.3 $Revision: 1.3 $
Author:
Thomas David Baker

Constructor Summary
Theme(String name, int diceSize, Color textColor, Color diceColor, Font font)
          Initializes a new Theme.
 
Method Summary
 Object clone()
          Creates and returns a copy of this object.
 Color diceColor()
          Gets the color of the dice in this theme.
 int diceSize()
          Gets the size of the dice (in pixels) in this theme.
 Font font()
          Gets the font of this Theme.
static Theme getCurrentTheme()
          Gets the current saved default theme.
static Theme getTheme(String name)
          Gets the Theme specified by name/
 String name()
          Gets the name of this theme.
static void saveCurrentTheme(Theme theme)
          Saves the specified theme in this computer's preferences as the current theme.
static void saveTheme(Theme theme)
          Saves theme to this computer's preferences.
 void setDiceColor(Color color)
          Sets the dice color.
 void setDiceSize(int diceSize)
          Sets the dice size.
 void setFont(Font font)
          Set the font of this Theme.
 void setName(String name)
          Sets the name of this theme.
 void setTextColor(Color color)
          Sets the text color.
 Color textColor()
          Gets the color of the text in this theme.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Theme

public Theme(String name,
             int diceSize,
             Color textColor,
             Color diceColor,
             Font font)
Initializes a new Theme.

Parameters:
name - Name of the theme.
diceSize - Size of dice in pixels.
textColor - Color of dice text.
diceColor - Color of dice background.
font - Font of dice text.
Method Detail

getTheme

public static Theme getTheme(String name)
Gets the Theme specified by name/

Returns:
Theme with that name.
Throws:
IllegalArgumentException - If the specified theme is not in preferences on this computer.

saveTheme

public static void saveTheme(Theme theme)
Saves theme to this computer's preferences.

Parameters:
theme - Theme to save.

getCurrentTheme

public static Theme getCurrentTheme()
Gets the current saved default theme.

Returns:
Current Theme.

saveCurrentTheme

public static void saveCurrentTheme(Theme theme)
Saves the specified theme in this computer's preferences as the current theme.

Parameters:
theme - Theme to save.

name

public String name()
Gets the name of this theme.

Returns:
String theme name.

diceSize

public int diceSize()
Gets the size of the dice (in pixels) in this theme.

Returns:
Size of dice in pixels.

textColor

public Color textColor()
Gets the color of the text in this theme.

Returns:
Color of text.

diceColor

public Color diceColor()
Gets the color of the dice in this theme.

Returns:
Color of dice.

font

public Font font()
Gets the font of this Theme.

Returns:
Font used in this Theme.

setName

public void setName(String name)
Sets the name of this theme.

Parameters:
name - String name of theme.

setDiceSize

public void setDiceSize(int diceSize)
Sets the dice size.

Parameters:
diceSize - int size in pixels.

setTextColor

public void setTextColor(Color color)
Sets the text color.

Parameters:
color - Color to set.

setDiceColor

public void setDiceColor(Color color)
Sets the dice color.

Parameters:
color - Color to set.

setFont

public void setFont(Font font)
Set the font of this Theme.

Parameters:
font - Font to set.

clone

public Object clone()
             throws CloneNotSupportedException
Creates and returns a copy of this object.

Overrides:
clone in class Object
Returns:
A clone of this instance.
Throws:
CloneNotSupportedException - If something goes really weird.