Package VASSAL.build.module
Class GlobalOptions
java.lang.Object
VASSAL.build.AbstractBuildable
VASSAL.build.AbstractConfigurable
VASSAL.build.module.GlobalOptions
- All Implemented Interfaces:
AutoConfigurable
,Buildable
,Configurable
,PropertyNameSource
,ValidityChecker
,Translatable
public class GlobalOptions extends AbstractConfigurable
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GlobalOptions.PlayerIdFormatConfig
static class
GlobalOptions.Prompt
static class
GlobalOptions.PromptOnOff
Nested classes/interfaces inherited from interface VASSAL.build.AutoConfigurable
AutoConfigurable.Util
-
Field Summary
Fields Modifier and Type Field Description static String
ALWAYS
static String
AUTO_REPORT
static String
BUG_10295
static String
CENTER_ON_MOVE
static String
CHATTER_HTML_SUPPORT
static String
CLASSIC_MFD
static String
DRAG_THRESHOLD
static boolean
FORCE_MAC_LEGACY
static String
INITIAL_HEAP
static String
MAC_LEGACY
static String
MARK_MOVED
static String
MAXIMUM_HEAP
static String
NEVER
static String
NON_OWNER_UNMASKABLE
static String
PLAYER_ID
static String
PLAYER_ID_ALT
static String
PLAYER_ID_FORMAT
static String
PLAYER_NAME
static String
PLAYER_NAME_ALT
static String
PLAYER_SIDE
static String
PLAYER_SIDE_ALT
static String
PROMPT
static String
PROMPT_STRING
static String
SINGLE_WINDOW
Fields inherited from class VASSAL.build.AbstractConfigurable
changeSupport, config, localizedName, myI18nData, name
Fields inherited from class VASSAL.build.AbstractBuildable
buildComponents, validator
Fields inherited from interface VASSAL.build.Configurable
NAME_PROPERTY
-
Constructor Summary
Constructors Constructor Description GlobalOptions()
-
Method Summary
Modifier and Type Method Description void
addOption(Configurer option)
Components may use GlobalOptions to store generic global attributes.void
addTo(Buildable parent)
Adds this component to its parent.boolean
autoReportEnabled()
void
build(Element e)
Build this component by getting all XML attributes of the XML element and callingAbstractBuildable.setAttribute(java.lang.String, java.lang.Object)
with the String value of the attributeboolean
centerOnOpponentsMove()
boolean
chatterHTMLSupport()
Class<?>[]
getAllowableConfigureComponents()
Return a list of valid sub-component Classes.String[]
getAttributeDescriptions()
Return an array of Strings describing the attributes of this object.String[]
getAttributeNames()
Lists all the buildFile (XML) attribute names for this component.Class<?>[]
getAttributeTypes()
Return the Class for the buildFile (XML) attributes of this component.String
getAttributeValueString(String key)
Called by theBuildable.getBuildElement(org.w3c.dom.Document)
method to write the attributes into an XML elementElement
getBuildElement(Document doc)
Configurer
getConfigurer()
static String
getConfigureTypeName()
int
getDragThreshold()
HelpFile
getHelpFile()
static GlobalOptions
getInstance()
String
getPlayerId()
List<String>
getPropertyNames()
Implement PropertyNameSource - Expose our preference namesboolean
isAveragedScaling()
Deprecated, for removal: This API element is subject to removal in a future version.No replacementboolean
isMarkMoveEnabled()
boolean
isUseClassicMoveFixedDistance()
boolean
isUseSingleWindow()
void
removeFrom(Buildable parent)
Remove this component from its parentvoid
setAttribute(String key, Object value)
Sets a buildFile (XML) attribute value for this component.void
setPrefMacLegacy(boolean b)
void
setUseClassicMoveFixedDistance(boolean b)
Methods inherited from class VASSAL.build.AbstractConfigurable
add, addPropertyChangeListener, getAttributeVisibility, getConfigureComponents, getConfigureName, getI18nData, getI18nPrefix, getLocalizedConfigureName, remove, removePropertyChangeListener, setAllAttributesUntranslatable, setAttributeTranslatable, setConfigureName
Methods inherited from class VASSAL.build.AbstractBuildable
getAllDescendantComponents, getAllDescendantComponentsOf, getBuildables, getBuildComponents, getComponents, getComponentsOf, validate
-
Field Details
-
NON_OWNER_UNMASKABLE
- See Also:
- Constant Field Values
-
PROMPT_STRING
- See Also:
- Constant Field Values
-
CENTER_ON_MOVE
- See Also:
- Constant Field Values
-
MARK_MOVED
- See Also:
- Constant Field Values
-
AUTO_REPORT
- See Also:
- Constant Field Values
-
CHATTER_HTML_SUPPORT
- See Also:
- Constant Field Values
-
ALWAYS
- See Also:
- Constant Field Values
-
NEVER
- See Also:
- Constant Field Values
-
PROMPT
- See Also:
- Constant Field Values
-
SINGLE_WINDOW
- See Also:
- Constant Field Values
-
MAXIMUM_HEAP
- See Also:
- Constant Field Values
-
INITIAL_HEAP
- See Also:
- Constant Field Values
-
BUG_10295
- See Also:
- Constant Field Values
-
CLASSIC_MFD
- See Also:
- Constant Field Values
-
DRAG_THRESHOLD
- See Also:
- Constant Field Values
-
MAC_LEGACY
- See Also:
- Constant Field Values
-
PLAYER_NAME
- See Also:
- Constant Field Values
-
PLAYER_NAME_ALT
- See Also:
- Constant Field Values
-
PLAYER_SIDE
- See Also:
- Constant Field Values
-
PLAYER_SIDE_ALT
- See Also:
- Constant Field Values
-
PLAYER_ID
- See Also:
- Constant Field Values
-
PLAYER_ID_ALT
- See Also:
- Constant Field Values
-
PLAYER_ID_FORMAT
- See Also:
- Constant Field Values
-
FORCE_MAC_LEGACY
public static final boolean FORCE_MAC_LEGACY- See Also:
- Constant Field Values
-
-
Constructor Details
-
GlobalOptions
public GlobalOptions()
-
-
Method Details
-
addTo
Description copied from interface:Buildable
Adds this component to its parent. In order to make Buildable objects extensible, the child is reponsible for adding itself to the parent. That way, Buildable subcomponents can be defined in an extension package without needing to modify the containing class. -
getInstance
-
isUseSingleWindow
public boolean isUseSingleWindow() -
isUseClassicMoveFixedDistance
public boolean isUseClassicMoveFixedDistance() -
setUseClassicMoveFixedDistance
public void setUseClassicMoveFixedDistance(boolean b) -
isAveragedScaling
Deprecated, for removal: This API element is subject to removal in a future version.No replacement -
setPrefMacLegacy
public void setPrefMacLegacy(boolean b) -
getConfigureTypeName
-
getAllowableConfigureComponents
Description copied from interface:Configurable
Return a list of valid sub-component Classes. If a Class appears in this list, then instances of that class may be added to this component from the Configuration Window. -
getAttributeDescriptions
Description copied from interface:AutoConfigurable
Return an array of Strings describing the attributes of this object. These strings are used as prompts in the Properties window for this object.- Specified by:
getAttributeDescriptions
in interfaceAutoConfigurable
- Specified by:
getAttributeDescriptions
in classAbstractConfigurable
- Returns:
- an array of Strings describing the buildFile (XML) attributes of this component. These strings are used as prompts in the
Properties window for this object, when the component is configured in the Editor. The order of descriptions should
be the same as the order of names in
AbstractBuildable.getAttributeNames()
-
getAttributeNames
Description copied from class:AbstractBuildable
Lists all the buildFile (XML) attribute names for this component. If this component is ALSO anAbstractConfigurable
, then this list of attributes determines the appropriate attribute order forAbstractConfigurable.getAttributeDescriptions()
andAbstractConfigurable.getAttributeTypes()
.- Specified by:
getAttributeNames
in interfaceAutoConfigurable
- Specified by:
getAttributeNames
in classAbstractBuildable
- Returns:
- a list of all buildFile (XML) attribute names for this component
-
getAttributeTypes
Description copied from class:AbstractConfigurable
Return the Class for the buildFile (XML) attributes of this component. Valid classes include: String, Integer, Double, Boolean, Image, Color, and KeyStroke, along with any class for which a Configurer exists in VASSAL.configure. The class determines, among other things, which type ofAutoConfigurer
will be used to configure the attribute when the object is configured in the Editor. The order of classes should be the same as the order of names inAbstractBuildable.getAttributeNames()
- Specified by:
getAttributeTypes
in interfaceAutoConfigurable
- Specified by:
getAttributeTypes
in classAbstractConfigurable
-
addOption
Components may use GlobalOptions to store generic global attributes. This method registers the given key as an attribute of the GlobalOptions with the given type. -
build
Description copied from class:AbstractBuildable
Build this component by getting all XML attributes of the XML element and callingAbstractBuildable.setAttribute(java.lang.String, java.lang.Object)
with the String value of the attribute- Specified by:
build
in interfaceBuildable
- Overrides:
build
in classAbstractBuildable
- Parameters:
e
- the XML element containing the object data
-
getBuildElement
- Specified by:
getBuildElement
in interfaceBuildable
- Overrides:
getBuildElement
in classAbstractBuildable
- Returns:
- an XML element from which this component can be built
-
getConfigurer
Description copied from class:AbstractConfigurable
- Specified by:
getConfigurer
in interfaceConfigurable
- Overrides:
getConfigurer
in classAbstractConfigurable
- Returns:
- Configurer for this component
-
getAttributeValueString
Description copied from interface:AutoConfigurable
Called by theBuildable.getBuildElement(org.w3c.dom.Document)
method to write the attributes into an XML element- Specified by:
getAttributeValueString
in interfaceAutoConfigurable
- Specified by:
getAttributeValueString
in interfaceTranslatable
- Specified by:
getAttributeValueString
in classAbstractBuildable
- Parameters:
key
- the name of the attribute. Will be one of those listed inAbstractBuildable.getAttributeNames()
- Returns:
- a String representation of the attribute with the given name. When initializing a module, this String value will be passed to
AbstractBuildable.setAttribute(java.lang.String, java.lang.Object)
.
-
getHelpFile
- Returns:
- a HelpFilte describing how to use and configure this component
-
removeFrom
Description copied from interface:Configurable
Remove this component from its parent -
setAttribute
Description copied from class:AbstractBuildable
Sets a buildFile (XML) attribute value for this component. Thekey
parameter will be one of those listed inAbstractBuildable.getAttributeNames()
. If thevalue
parameter is a String, it will be the value returned byAbstractBuildable.getAttributeValueString(java.lang.String)
for the samekey
. If the implementing class extendsAbstractConfigurable
, thenvalue
will be an instance of the corresponding Class listed inAbstractConfigurable.getAttributeTypes()
- Specified by:
setAttribute
in interfaceAutoConfigurable
- Specified by:
setAttribute
in interfaceTranslatable
- Specified by:
setAttribute
in classAbstractBuildable
- Parameters:
key
- the name of the attribute. Will be one of those listed inAbstractBuildable.getAttributeNames()
value
- If thevalue
parameter is a String, it will be the value returned byAbstractBuildable.getAttributeValueString(java.lang.String)
for the samekey
. If the implementing class extendsAbstractConfigurable
, thenvalue
can also be an instance of the corresponding Class listed inAbstractConfigurable.getAttributeTypes()
-
autoReportEnabled
public boolean autoReportEnabled() -
centerOnOpponentsMove
public boolean centerOnOpponentsMove() -
chatterHTMLSupport
public boolean chatterHTMLSupport() -
isMarkMoveEnabled
public boolean isMarkMoveEnabled() -
getDragThreshold
public int getDragThreshold() -
getPlayerId
-
getPropertyNames
Implement PropertyNameSource - Expose our preference names- Specified by:
getPropertyNames
in interfacePropertyNameSource
- Overrides:
getPropertyNames
in classAbstractBuildable
- Returns:
- Default implementation of PropertyNameSource - No properties exposed
-