net.curre.prefcount.bean
Class Settings

java.lang.Object
  extended by net.curre.prefcount.bean.Settings
All Implemented Interfaces:
java.io.Serializable

public class Settings
extends java.lang.Object
implements java.io.Serializable

Object of this class represents a bean for storing application settings (window size, theme, default locale, etc.).

Created date: Jun 10, 2007

Author:
Yevgeny Nyden
See Also:
Serialized Form

Field Summary
static Place DEFAULT_ADJ_PLAYER
          Default player for the "Divisible by N" mount adjustment.
static int DEFAULT_DIALOG_FRAME_HEIGHT
          Default value for the dialog window frame height.
static int DEFAULT_DIALOG_FRAME_WIDTH
          Default value for the dialog window frame width.
static java.lang.String DEFAULT_DIVISIBLE_BY
          Default divisible by option.
static java.lang.String DEFAULT_LAF_SKIN_ID
          Default value for the Look and Feel theme/skin ID.
static int DEFAULT_MAIN_FRAME_HEIGHT
          Default value for the main window frame height.
static int DEFAULT_MAIN_FRAME_WIDTH
          Default value for the main window frame width.
static java.lang.String DEFAULT_PLAYERS_NUMBER
          Default number of players option.
static java.lang.String DEFAULT_PREF_TYPE
          Default preferance type option.
 
Constructor Summary
Settings()
          Default constructor that initializes all properties to the default values.
 
Method Summary
 int getDialogFrameHeight()
          Getter for the dialog window frame height.
 int getDialogFrameWidth()
          Getter for the dialog window frame width.
 java.lang.String getDivisibleBy()
          Getter for the Divisible By option (a WindowComponent enum name).
 java.lang.String getLafSkinId()
          Getter for the Look and Feel theme/skin ID (resource key).
 java.lang.String getLocaleId()
          Getter for the locale identifier (case insensitive language name).
 int getMainFrameHeight()
          Getter for the main window frame height.
 int getMainFrameWidth()
          Getter for the main window frame width.
 java.lang.String getPlayersNumber()
          Getter for the Number of players option.
 java.lang.String getPrefType()
          Getter for the the Preferance type option.
 void reset()
          Method to reset the settings to default values.
 void setDialogFrameHeight(int dialogFrameHeight)
          Setter for the dialog window frame height.
 void setDialogFrameWidth(int dialogFrameWidth)
          Setter for the dialog window frame width.
 void setDivisibleBy(java.lang.String divisibleBy)
          Setter for property 'divisibleBy'.
 void setLafSkinId(java.lang.String lafSkinId)
          Setter for the Look and Feel theme/skin ID (resource key).
 void setLocaleId(java.lang.String localeId)
          Setter for the locale identifier (case insensitive language name).
 void setMainFrameHeight(int mainFrameHeight)
          Setter for the main window frame height.
 void setMainFrameWidth(int mainFrameWidth)
          Setter for the main window frame width.
 void setPlayersNumber(java.lang.String playersNumber)
          Setter for property 'playersNumber'.
 void setPrefType(java.lang.String prefType)
          Setter for property 'prefType'.
 void testSettings()
          Tests if settings values are null and sets them to the default values if they are null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MAIN_FRAME_WIDTH

public static final int DEFAULT_MAIN_FRAME_WIDTH
Default value for the main window frame width.

See Also:
Constant Field Values

DEFAULT_MAIN_FRAME_HEIGHT

public static final int DEFAULT_MAIN_FRAME_HEIGHT
Default value for the main window frame height.

See Also:
Constant Field Values

DEFAULT_DIALOG_FRAME_WIDTH

public static final int DEFAULT_DIALOG_FRAME_WIDTH
Default value for the dialog window frame width.

See Also:
Constant Field Values

DEFAULT_DIALOG_FRAME_HEIGHT

public static final int DEFAULT_DIALOG_FRAME_HEIGHT
Default value for the dialog window frame height.

See Also:
Constant Field Values

DEFAULT_LAF_SKIN_ID

public static final java.lang.String DEFAULT_LAF_SKIN_ID
Default value for the Look and Feel theme/skin ID.

See Also:
Constant Field Values

DEFAULT_PREF_TYPE

public static final java.lang.String DEFAULT_PREF_TYPE
Default preferance type option.


DEFAULT_PLAYERS_NUMBER

public static final java.lang.String DEFAULT_PLAYERS_NUMBER
Default number of players option.


DEFAULT_DIVISIBLE_BY

public static final java.lang.String DEFAULT_DIVISIBLE_BY
Default divisible by option.


DEFAULT_ADJ_PLAYER

public static final Place DEFAULT_ADJ_PLAYER
Default player for the "Divisible by N" mount adjustment.

Constructor Detail

Settings

public Settings()
Default constructor that initializes all properties to the default values.

Method Detail

getMainFrameWidth

public int getMainFrameWidth()
Getter for the main window frame width.

Returns:
The main window frame width.

setMainFrameWidth

public void setMainFrameWidth(int mainFrameWidth)
Setter for the main window frame width.

Parameters:
mainFrameWidth - Main window frame width.

getMainFrameHeight

public int getMainFrameHeight()
Getter for the main window frame height.

Returns:
The main window frame height.

setMainFrameHeight

public void setMainFrameHeight(int mainFrameHeight)
Setter for the main window frame height.

Parameters:
mainFrameHeight - Main window frame height.

getDialogFrameWidth

public int getDialogFrameWidth()
Getter for the dialog window frame width.

Returns:
The dialog window frame width.

setDialogFrameWidth

public void setDialogFrameWidth(int dialogFrameWidth)
Setter for the dialog window frame width.

Parameters:
dialogFrameWidth - Dialog window frame width.

getDialogFrameHeight

public int getDialogFrameHeight()
Getter for the dialog window frame height.

Returns:
The dialog window frame height.

setDialogFrameHeight

public void setDialogFrameHeight(int dialogFrameHeight)
Setter for the dialog window frame height.

Parameters:
dialogFrameHeight - Dialog window frame height.

getLafSkinId

public java.lang.String getLafSkinId()
Getter for the Look and Feel theme/skin ID (resource key).

Returns:
The Look and Feel theme/skin ID (resource key).

setLafSkinId

public void setLafSkinId(java.lang.String lafSkinId)
Setter for the Look and Feel theme/skin ID (resource key).

Parameters:
lafSkinId - The Look and Feel theme/skin ID (resource key).

getLocaleId

public java.lang.String getLocaleId()
Getter for the locale identifier (case insensitive language name).

Returns:
The locale identifier (language name).

setLocaleId

public void setLocaleId(java.lang.String localeId)
Setter for the locale identifier (case insensitive language name).

Parameters:
localeId - Locale identifier (case insensitive language name).

getPrefType

public java.lang.String getPrefType()
Getter for the the Preferance type option.

Returns:
WindowComponent enum name that represents the Preferance type option.

setPrefType

public void setPrefType(java.lang.String prefType)
Setter for property 'prefType'.

Parameters:
prefType - WindowComponent enum name that represents the Preferance type option.

getPlayersNumber

public java.lang.String getPlayersNumber()
Getter for the Number of players option.

Returns:
WindowComponent enum name that represents the Number of players option.

setPlayersNumber

public void setPlayersNumber(java.lang.String playersNumber)
Setter for property 'playersNumber'.

Parameters:
playersNumber - WindowComponent enum name that represents the Number of players option.

getDivisibleBy

public java.lang.String getDivisibleBy()
Getter for the Divisible By option (a WindowComponent enum name).

Returns:
WindowComponent enum name that represents the Divisible By option.

setDivisibleBy

public void setDivisibleBy(java.lang.String divisibleBy)
Setter for property 'divisibleBy'.

Parameters:
divisibleBy - WindowComponent enum name that represents the Divisible By option.

reset

public void reset()
Method to reset the settings to default values.


testSettings

public void testSettings()
Tests if settings values are null and sets them to the default values if they are null. This is crucial when a newer application uses an older version of serialized settings object.



Copyright © 2008. All Rights Reserved.