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 classGlobalOptions.PlayerIdFormatConfigstatic classGlobalOptions.Promptstatic classGlobalOptions.PromptOnOffNested classes/interfaces inherited from interface VASSAL.build.AutoConfigurable
AutoConfigurable.Util -
Field Summary
Fields Modifier and Type Field Description static StringALWAYSstatic StringAUTO_REPORTstatic StringBUG_10295static StringCENTER_ON_MOVEstatic StringCHATTER_HTML_SUPPORTstatic StringCLASSIC_MFDstatic StringDRAG_THRESHOLDstatic booleanFORCE_MAC_LEGACYstatic StringINITIAL_HEAPstatic StringMAC_LEGACYstatic StringMARK_MOVEDstatic StringMAXIMUM_HEAPstatic StringNEVERstatic StringNON_OWNER_UNMASKABLEstatic StringPLAYER_IDstatic StringPLAYER_ID_ALTstatic StringPLAYER_ID_FORMATstatic StringPLAYER_NAMEstatic StringPLAYER_NAME_ALTstatic StringPLAYER_SIDEstatic StringPLAYER_SIDE_ALTstatic StringPROMPTstatic StringPROMPT_STRINGstatic StringSINGLE_WINDOWFields inherited from class VASSAL.build.AbstractConfigurable
changeSupport, config, localizedName, myI18nData, nameFields inherited from class VASSAL.build.AbstractBuildable
buildComponents, validatorFields inherited from interface VASSAL.build.Configurable
NAME_PROPERTY -
Constructor Summary
Constructors Constructor Description GlobalOptions() -
Method Summary
Modifier and Type Method Description voidaddOption(Configurer option)Components may use GlobalOptions to store generic global attributes.voidaddTo(Buildable parent)Adds this component to its parent.booleanautoReportEnabled()voidbuild(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 attributebooleancenterOnOpponentsMove()booleanchatterHTMLSupport()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.StringgetAttributeValueString(String key)Called by theBuildable.getBuildElement(org.w3c.dom.Document)method to write the attributes into an XML elementElementgetBuildElement(Document doc)ConfigurergetConfigurer()static StringgetConfigureTypeName()intgetDragThreshold()HelpFilegetHelpFile()static GlobalOptionsgetInstance()StringgetPlayerId()List<String>getPropertyNames()Implement PropertyNameSource - Expose our preference namesbooleanisAveragedScaling()Deprecated, for removal: This API element is subject to removal in a future version.No replacementbooleanisMarkMoveEnabled()booleanisUseClassicMoveFixedDistance()booleanisUseSingleWindow()voidremoveFrom(Buildable parent)Remove this component from its parentvoidsetAttribute(String key, Object value)Sets a buildFile (XML) attribute value for this component.voidsetPrefMacLegacy(boolean b)voidsetUseClassicMoveFixedDistance(boolean b)Methods inherited from class VASSAL.build.AbstractConfigurable
add, addPropertyChangeListener, getAttributeVisibility, getConfigureComponents, getConfigureName, getI18nData, getI18nPrefix, getLocalizedConfigureName, remove, removePropertyChangeListener, setAllAttributesUntranslatable, setAttributeTranslatable, setConfigureNameMethods 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:BuildableAdds 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:ConfigurableReturn 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:AutoConfigurableReturn 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:
getAttributeDescriptionsin interfaceAutoConfigurable- Specified by:
getAttributeDescriptionsin 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:AbstractBuildableLists 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:
getAttributeNamesin interfaceAutoConfigurable- Specified by:
getAttributeNamesin classAbstractBuildable- Returns:
- a list of all buildFile (XML) attribute names for this component
-
getAttributeTypes
Description copied from class:AbstractConfigurableReturn 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 ofAutoConfigurerwill 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:
getAttributeTypesin interfaceAutoConfigurable- Specified by:
getAttributeTypesin 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:AbstractBuildableBuild 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:
buildin interfaceBuildable- Overrides:
buildin classAbstractBuildable- Parameters:
e- the XML element containing the object data
-
getBuildElement
- Specified by:
getBuildElementin interfaceBuildable- Overrides:
getBuildElementin classAbstractBuildable- Returns:
- an XML element from which this component can be built
-
getConfigurer
Description copied from class:AbstractConfigurable- Specified by:
getConfigurerin interfaceConfigurable- Overrides:
getConfigurerin classAbstractConfigurable- Returns:
- Configurer for this component
-
getAttributeValueString
Description copied from interface:AutoConfigurableCalled by theBuildable.getBuildElement(org.w3c.dom.Document)method to write the attributes into an XML element- Specified by:
getAttributeValueStringin interfaceAutoConfigurable- Specified by:
getAttributeValueStringin interfaceTranslatable- Specified by:
getAttributeValueStringin 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:ConfigurableRemove this component from its parent -
setAttribute
Description copied from class:AbstractBuildableSets a buildFile (XML) attribute value for this component. Thekeyparameter will be one of those listed inAbstractBuildable.getAttributeNames(). If thevalueparameter is a String, it will be the value returned byAbstractBuildable.getAttributeValueString(java.lang.String)for the samekey. If the implementing class extendsAbstractConfigurable, thenvaluewill be an instance of the corresponding Class listed inAbstractConfigurable.getAttributeTypes()- Specified by:
setAttributein interfaceAutoConfigurable- Specified by:
setAttributein interfaceTranslatable- Specified by:
setAttributein classAbstractBuildable- Parameters:
key- the name of the attribute. Will be one of those listed inAbstractBuildable.getAttributeNames()value- If thevalueparameter is a String, it will be the value returned byAbstractBuildable.getAttributeValueString(java.lang.String)for the samekey. If the implementing class extendsAbstractConfigurable, thenvaluecan 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:
getPropertyNamesin interfacePropertyNameSource- Overrides:
getPropertyNamesin classAbstractBuildable- Returns:
- Default implementation of PropertyNameSource - No properties exposed
-