net.sf.freecol.client
Class ClientOptions

java.lang.Object
  extended by net.sf.freecol.common.option.AbstractOption
      extended by net.sf.freecol.common.option.OptionGroup
          extended by net.sf.freecol.common.option.OptionMap
              extended by net.sf.freecol.client.ClientOptions
All Implemented Interfaces:
Option

public class ClientOptions
extends OptionMap

Keeps track of the available client options.

New options should be added to addDefaultOptions() and each option should be given an unique identifier (defined as a constant in this class).


Field Summary
static java.lang.String ALWAYS_CENTER
          Selected tiles always gets centered if this option is enabled (even if the tile is GUI.onScreen(Map.Position)).
static java.lang.String AUTOSAVE_PERIOD
          Option for setting the period of autosaves.
static java.lang.String COLONY_COMPARATOR
          Used by GUI to sort colonies.
static int COLONY_COMPARATOR_AGE
           
static int COLONY_COMPARATOR_NAME
           
static int COLONY_COMPARATOR_POSITION
           
static int COLONY_COMPARATOR_SIZE
           
static int COLONY_COMPARATOR_SOL
           
static java.lang.String COPYRIGHT
           
static java.lang.String CUSTOM_STOCK
          The Stock the custom house should keep when selling goods.
static java.lang.String DISPLAY_FOG_OF_WAR
          Option for setting wether or not the fog of war should be displayed.
static java.lang.String HIGH_LEVEL
          Generate warning of stock exceeds this percentage of capacity.
static java.lang.String LICENSE
           
static java.lang.String LOW_LEVEL
          Generate warning of stock drops below this percentage of capacity.
static java.lang.String MAP_SCROLL_ON_DRAG
          Option for activating autoscroll when dragging units on the mapboard.
static java.lang.String MAX_NUMBER_OF_GOODS_IMAGES
          Used by GUI, this is the most repetitions drawn of a goods image for a single goods grouping.
static java.lang.String MESSAGES_GROUP_BY
          Used by GUI, this defines the grouping of ModelMessages.
static int MESSAGES_GROUP_BY_NOTHING
           
static int MESSAGES_GROUP_BY_SOURCE
           
static int MESSAGES_GROUP_BY_TYPE
           
static java.lang.String MIN_NUMBER_FOR_DISPLAYING_GOODS_COUNT
          Used by GUI, the number will be displayed when a group of goods are higher than this number.
static java.lang.String REVISION
           
static java.lang.String SHOW_BUILDING_COMPLETED
           
static java.lang.String SHOW_COLONY_WARNINGS
           
static java.lang.String SHOW_FOREIGN_DIPLOMACY
           
static java.lang.String SHOW_GOVERNMENT_EFFICIENCY
           
static java.lang.String SHOW_LOST_CITY_RUMOURS
           
static java.lang.String SHOW_MARKET_PRICES
           
static java.lang.String SHOW_MISSING_GOODS
           
static java.lang.String SHOW_PRECOMBAT
           
static java.lang.String SHOW_SAVEGAME_SETTINGS
          Use default values for savegames instead of displaying a dialog.
static int SHOW_SAVEGAME_SETTINGS_ALWAYS
          A possible value for the SelectOption: SHOW_SAVEGAME_SETTINGS.
static int SHOW_SAVEGAME_SETTINGS_MULTIPLAYER
          A possible value for the SelectOption: SHOW_SAVEGAME_SETTINGS.
static int SHOW_SAVEGAME_SETTINGS_NEVER
          A possible value for the SelectOption: SHOW_SAVEGAME_SETTINGS.
static java.lang.String SHOW_SONS_OF_LIBERTY
          Used by GUI, this defines whether SoL messages will be displayed.
static java.lang.String SHOW_UNIT_ADDED
           
static java.lang.String SHOW_UNIT_DEMOTED
           
static java.lang.String SHOW_UNIT_IMPROVED
           
static java.lang.String SHOW_UNIT_LOST
           
static java.lang.String SHOW_WAREHOUSE_CAPACITY
           
static java.lang.String SHOW_WARNING
           
 
Fields inherited from class net.sf.freecol.common.option.AbstractOption
NO_ID
 
Constructor Summary
ClientOptions()
          Creates a new ClientOptions.
ClientOptions(org.w3c.dom.Element element)
          Creates a ClientOptions from an XML representation.
 
Method Summary
protected  void addDefaultOptions()
          Adds the options to this GameOptions.
 BooleanOption getBooleanOption(ModelMessage message)
          Returns the boolean option associated with a ModelMessage.
 java.util.Comparator<Colony> getColonyComparator()
          Return the client's preferred comparator for colonies.
 java.util.Comparator<ModelMessage> getModelMessageComparator()
          Return the client's preferred comparator for ModelMessages.
static java.lang.String getXMLElementTagName()
          Gets the tag name of the root element representing this object.
 
Methods inherited from class net.sf.freecol.common.option.OptionMap
addToMap, getBoolean, getInteger, getObject, readFromXMLImpl, toXML
 
Methods inherited from class net.sf.freecol.common.option.OptionGroup
add, iterator, removeAll, toXMLImpl
 
Methods inherited from class net.sf.freecol.common.option.AbstractOption
addPropertyChangeListener, firePropertyChange, getId, getName, getShortDescription, readFromXML, readFromXMLElement, removePropertyChangeListener, toString, toXMLElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

LICENSE

public static final java.lang.String LICENSE
See Also:
Constant Field Values

REVISION

public static final java.lang.String REVISION
See Also:
Constant Field Values

ALWAYS_CENTER

public static final java.lang.String ALWAYS_CENTER
Selected tiles always gets centered if this option is enabled (even if the tile is GUI.onScreen(Map.Position)).

See Also:
GUI, Constant Field Values

MIN_NUMBER_FOR_DISPLAYING_GOODS_COUNT

public static final java.lang.String MIN_NUMBER_FOR_DISPLAYING_GOODS_COUNT
Used by GUI, the number will be displayed when a group of goods are higher than this number.

See Also:
GUI, Constant Field Values

MAX_NUMBER_OF_GOODS_IMAGES

public static final java.lang.String MAX_NUMBER_OF_GOODS_IMAGES
Used by GUI, this is the most repetitions drawn of a goods image for a single goods grouping.

See Also:
GUI, Constant Field Values

MESSAGES_GROUP_BY

public static final java.lang.String MESSAGES_GROUP_BY
Used by GUI, this defines the grouping of ModelMessages. Possible values include nothing, type and source.

See Also:
GUI, ModelMessage, Constant Field Values

MESSAGES_GROUP_BY_NOTHING

public static final int MESSAGES_GROUP_BY_NOTHING
See Also:
Constant Field Values

MESSAGES_GROUP_BY_TYPE

public static final int MESSAGES_GROUP_BY_TYPE
See Also:
Constant Field Values

MESSAGES_GROUP_BY_SOURCE

public static final int MESSAGES_GROUP_BY_SOURCE
See Also:
Constant Field Values

SHOW_SONS_OF_LIBERTY

public static final java.lang.String SHOW_SONS_OF_LIBERTY
Used by GUI, this defines whether SoL messages will be displayed.

See Also:
GUI, Constant Field Values

SHOW_WARNING

public static final java.lang.String SHOW_WARNING
See Also:
Constant Field Values

SHOW_GOVERNMENT_EFFICIENCY

public static final java.lang.String SHOW_GOVERNMENT_EFFICIENCY
See Also:
Constant Field Values

SHOW_WAREHOUSE_CAPACITY

public static final java.lang.String SHOW_WAREHOUSE_CAPACITY
See Also:
Constant Field Values

SHOW_UNIT_IMPROVED

public static final java.lang.String SHOW_UNIT_IMPROVED
See Also:
Constant Field Values

SHOW_UNIT_DEMOTED

public static final java.lang.String SHOW_UNIT_DEMOTED
See Also:
Constant Field Values

SHOW_UNIT_ADDED

public static final java.lang.String SHOW_UNIT_ADDED
See Also:
Constant Field Values

SHOW_UNIT_LOST

public static final java.lang.String SHOW_UNIT_LOST
See Also:
Constant Field Values

SHOW_BUILDING_COMPLETED

public static final java.lang.String SHOW_BUILDING_COMPLETED
See Also:
Constant Field Values

SHOW_FOREIGN_DIPLOMACY

public static final java.lang.String SHOW_FOREIGN_DIPLOMACY
See Also:
Constant Field Values

SHOW_MARKET_PRICES

public static final java.lang.String SHOW_MARKET_PRICES
See Also:
Constant Field Values

SHOW_LOST_CITY_RUMOURS

public static final java.lang.String SHOW_LOST_CITY_RUMOURS
See Also:
Constant Field Values

SHOW_MISSING_GOODS

public static final java.lang.String SHOW_MISSING_GOODS
See Also:
Constant Field Values

SHOW_COLONY_WARNINGS

public static final java.lang.String SHOW_COLONY_WARNINGS
See Also:
Constant Field Values

SHOW_PRECOMBAT

public static final java.lang.String SHOW_PRECOMBAT
See Also:
Constant Field Values

SHOW_SAVEGAME_SETTINGS

public static final java.lang.String SHOW_SAVEGAME_SETTINGS
Use default values for savegames instead of displaying a dialog.

Possible values for this option are:
  1. SHOW_SAVEGAME_SETTINGS_NEVER
  2. SHOW_SAVEGAME_SETTINGS_MULTIPLAYER
  3. SHOW_SAVEGAME_SETTINGS_ALWAYS

See Also:
Constant Field Values

SHOW_SAVEGAME_SETTINGS_NEVER

public static final int SHOW_SAVEGAME_SETTINGS_NEVER
A possible value for the SelectOption: SHOW_SAVEGAME_SETTINGS. Specifies that the dialog should never be enabled.

See Also:
Constant Field Values

SHOW_SAVEGAME_SETTINGS_MULTIPLAYER

public static final int SHOW_SAVEGAME_SETTINGS_MULTIPLAYER
A possible value for the SelectOption: SHOW_SAVEGAME_SETTINGS. Specifies that the dialog should only be enabled when loading savegames being marked as multiplayer..

See Also:
Constant Field Values

SHOW_SAVEGAME_SETTINGS_ALWAYS

public static final int SHOW_SAVEGAME_SETTINGS_ALWAYS
A possible value for the SelectOption: SHOW_SAVEGAME_SETTINGS. Specifies that the dialog should always be enabled.

See Also:
Constant Field Values

AUTOSAVE_PERIOD

public static final java.lang.String AUTOSAVE_PERIOD
Option for setting the period of autosaves. The value 0 signals that autosaving is disabled.

See Also:
Constant Field Values

DISPLAY_FOG_OF_WAR

public static final java.lang.String DISPLAY_FOG_OF_WAR
Option for setting wether or not the fog of war should be displayed.

See Also:
Constant Field Values

MAP_SCROLL_ON_DRAG

public static final java.lang.String MAP_SCROLL_ON_DRAG
Option for activating autoscroll when dragging units on the mapboard.

See Also:
Constant Field Values

CUSTOM_STOCK

public static final java.lang.String CUSTOM_STOCK
The Stock the custom house should keep when selling goods.

See Also:
Constant Field Values

LOW_LEVEL

public static final java.lang.String LOW_LEVEL
Generate warning of stock drops below this percentage of capacity.

See Also:
Constant Field Values

HIGH_LEVEL

public static final java.lang.String HIGH_LEVEL
Generate warning of stock exceeds this percentage of capacity.

See Also:
Constant Field Values

COLONY_COMPARATOR

public static final java.lang.String COLONY_COMPARATOR
Used by GUI to sort colonies.

See Also:
Constant Field Values

COLONY_COMPARATOR_NAME

public static final int COLONY_COMPARATOR_NAME
See Also:
Constant Field Values

COLONY_COMPARATOR_AGE

public static final int COLONY_COMPARATOR_AGE
See Also:
Constant Field Values

COLONY_COMPARATOR_POSITION

public static final int COLONY_COMPARATOR_POSITION
See Also:
Constant Field Values

COLONY_COMPARATOR_SIZE

public static final int COLONY_COMPARATOR_SIZE
See Also:
Constant Field Values

COLONY_COMPARATOR_SOL

public static final int COLONY_COMPARATOR_SOL
See Also:
Constant Field Values
Constructor Detail

ClientOptions

public ClientOptions()
Creates a new ClientOptions.


ClientOptions

public ClientOptions(org.w3c.dom.Element element)
Creates a ClientOptions from an XML representation.

Parameters:
element - The XML Element from which this object should be constructed.
Method Detail

addDefaultOptions

protected void addDefaultOptions()
Adds the options to this GameOptions.

Specified by:
addDefaultOptions in class OptionMap

getColonyComparator

public java.util.Comparator<Colony> getColonyComparator()
Return the client's preferred comparator for colonies.

Returns:
a Comparator value

getModelMessageComparator

public java.util.Comparator<ModelMessage> getModelMessageComparator()
Return the client's preferred comparator for ModelMessages.

Returns:
a Comparator value

getBooleanOption

public BooleanOption getBooleanOption(ModelMessage message)
Returns the boolean option associated with a ModelMessage.

Parameters:
message - a ModelMessage value
Returns:
a BooleanOption value

getXMLElementTagName

public static java.lang.String getXMLElementTagName()
Gets the tag name of the root element representing this object.

Returns:
"clientOptions".