Package VASSAL.build.module
Class GlobalOptions
java.lang.Object
VASSAL.search.AbstractImageFinder
VASSAL.build.AbstractBuildable
VASSAL.build.AbstractConfigurable
VASSAL.build.module.GlobalOptions
- All Implemented Interfaces:
AutoConfigurable,Buildable,Configurable,PropertyNameSource,ComponentDescription,ValidityChecker,Translatable,Auditable,ImageSearchTarget,SearchTarget
GlobalOptions is a junction point for several flavors of "preferences"-related categories. It also configures the
toolbar buttons basic VASSAL functions: Undo, Step Forward, and show/hide Servers. Global Options is a Singleton.
(1) Its attributes, set in the Editor, control the module-designer-set "hybrid preference" categories (Allowing non-owners to unmask pieces, Enabling HTML chat, format of player ID in reports), determining whether the preference in question is forced on or off, or whether a player preference is used.
(2) Its sub-components allow the module designer to "create custom preferences" which appear in their own tab.
(3) Many of its fields, configured mostly in the
(1) Its attributes, set in the Editor, control the module-designer-set "hybrid preference" categories (Allowing non-owners to unmask pieces, Enabling HTML chat, format of player ID in reports), determining whether the preference in question is forced on or off, or whether a player preference is used.
(2) Its sub-components allow the module designer to "create custom preferences" which appear in their own tab.
(3) Many of its fields, configured mostly in the
addTo(VASSAL.build.Buildable) method, supply the majority of the
preferences shown on the "General" tab, though some of that tab's preferences are also set elsewhere -- see:
Prefs - reading/writing the preference file, maintaining lists of configurers for tabs
Prefs.initSharedGlobalPrefs() - disable d3d pipeline, wizard support
BasicLogger - configurers for Undo and Step Forward. Adds logging-related preferences to pane
AdjustableSpeedScrollPane - scroll increment-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classConfigurer for the Player's IDstatic classThe Prompt class allows certain attribute settings to be configured by the module designer: ALWAYS = the "preference" is forced on NEVER = the "preference" is forced off PROMPT = the player actually receives a preference on the General tab to control this behaviorstatic classThe PromptOnOff class allows certain attribute settings to be configured by the module designer: ALWAYS = the "preference" is forced on NEVER = the "preference" is forced offNested classes/interfaces inherited from interface VASSAL.build.AutoConfigurable
AutoConfigurable.Util -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected Stringstatic final Stringstatic final Stringstatic final Stringstatic final booleanstatic final Stringstatic final StringDeprecated, for removal: This API element is subject to removal in a future version.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields 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 -
Method Summary
Modifier and TypeMethodDescriptionvoidOur Option Configurers (undo button, server button, step-forward button) potentially have icons to add the references forvoidaddOption(Configurer option) Components may use GlobalOptions to store generic global attributes.voidGlobalOptions are added to theGameModule.booleanvoidBuilds our component from the buildFile.booleandoublebooleanClass<?>[]String[]Return an array of Strings describing the attributes of this object.String[]Lists all the buildFile (XML) attribute names for this component.Class<?>[]Return the Class for the attributes of this object.Returns current setting of an attribute in String formgetBuildElement(Document doc) Packages any "custom preferences" back up into XML for the buildFilestatic Stringintstatic GlobalOptionsbooleanImplement PropertyNameSource - Expose our preference namesbooleanbooleanbooleanbooleanbooleanIs this component a reqired component within its parent?booleanbooleanbooleanbooleanbooleanbooleanbooleanisUnique()Does this component need to be unique within it's parent?booleanbooleanbooleanvoidremoveFrom(Buildable parent) Removes us from our parent componentvoidsetAttribute(String key, Object value) Sets a new value for one of our attributes.voidsetPrefMacLegacy(boolean b) voidvoidvoidsetUseClassicMoveFixedDistance(boolean b) voidsetWarnOldContinuation(boolean b) Methods inherited from class VASSAL.build.AbstractConfigurable
add, addPropertyChangeListener, getAttributeVisibility, getConfigureComponents, getConfigureName, getExpressionList, getI18nData, getI18nPrefix, getLocalizedConfigureName, getMenuTextList, getTypeName, remove, removePropertyChangeListener, setAllAttributesUntranslatable, setAttributeTranslatable, setConfigureNameMethods inherited from class VASSAL.build.AbstractBuildable
buildString, getAllDescendantComponentsOf, getAncestor, getBuildables, getBuildComponents, getComponents, getComponentsOf, getNonFolderAncestor, setAncestor, validateMethods inherited from class VASSAL.search.AbstractImageFinder
addLocalImageNames, getAllImageNames, getLocalImageNamesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface VASSAL.script.expression.Auditable
getComponentName, getComponentTypeName
-
Field Details
-
DESCRIPTION
- See Also:
-
NON_OWNER_UNMASKABLE
- See Also:
-
PROMPT_STRING
- See Also:
-
MARK_MOVED
- See Also:
-
AUTO_REPORT
- See Also:
-
CHATTER_HTML_SUPPORT
- See Also:
-
HOTKEYS_ON_CLOSED_WINDOWS
- See Also:
-
TRANSLATABLE_SUPPORT
- See Also:
-
INVENTORY_VISIBLE_TO_ALL
- See Also:
-
SEND_TO_LOCATION_MOVE_TRAILS
- See Also:
-
STORE_LEADING_ZERO_INTEGERS_AS_STRINGS
- See Also:
-
PURGE_BLANK_PROPERTY_PROMPTS
- See Also:
-
DISABLE_PIECE_INDEXING
- See Also:
-
ALWAYS
- See Also:
-
NEVER
- See Also:
-
PROMPT
- See Also:
-
CENTER_ON_MOVE
- See Also:
-
CENTER_ON_MOVE_SENSITIVITY
- See Also:
-
SINGLE_WINDOW
- See Also:
-
MAXIMUM_HEAP
- See Also:
-
DRAG_THRESHOLD
- See Also:
-
STACK_VIEWER_ORDER
- See Also:
-
SHOW_MARK_MOVED
- See Also:
-
BUG_10295
- See Also:
-
CLASSIC_MFD
- See Also:
-
MAC_LEGACY
- See Also:
-
OLD_CONTINUATION
- See Also:
-
SEND_TO_LOCATION_MOVEMENT_TRAILS
- See Also:
-
SOUND_GLOBAL_MUTE
- See Also:
-
SOUND_WAKEUP_MUTE
- See Also:
-
PLAYER_NAME
- See Also:
-
PLAYER_NAME_ALT
- See Also:
-
PLAYER_SIDE
- See Also:
-
PLAYER_SIDE_ALT
- See Also:
-
PLAYER_ID
- See Also:
-
PLAYER_ID_ALT
- See Also:
-
PLAYER_ID_FORMAT
- See Also:
-
FORCE_MAC_LEGACY
public static final boolean FORCE_MAC_LEGACY- See Also:
-
INITIAL_HEAP
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
description
-
-
Constructor Details
-
GlobalOptions
public GlobalOptions()
-
-
Method Details
-
getInstance
- Returns:
- our singleton instance
-
getDescription
- Specified by:
getDescriptionin interfaceComponentDescription- Returns:
- Description to be displayed next to component type/name in the main Editor window. Or null or "" to not display anything.
-
addTo
GlobalOptions are added to theGameModule. This method creates the configurers for the "General" tab of the preference dialog, and some for the "Compatibility" tab. -
isForceNonNativeDrag
public boolean isForceNonNativeDrag()- Returns:
- true if we're forcing use of non-native drag and drop cursor
-
isUseSingleWindow
public boolean isUseSingleWindow()- Returns:
- true if preference to dock first map window to main module window with Chatter is selected
-
isUseClassicMoveFixedDistance
public boolean isUseClassicMoveFixedDistance()- Returns:
- true if compatibility version of Move Fixed Distance is selected
-
setUseClassicMoveFixedDistance
public void setUseClassicMoveFixedDistance(boolean b) - Parameters:
b- sets the compatibility Move Fixed Distance preference
-
setPrefMacLegacy
public void setPrefMacLegacy(boolean b) - Parameters:
b- sets the Mac Legacy compatibility preference
-
getPrefMacLegacy
public boolean getPrefMacLegacy()- Returns:
- the Mac Legacy compatibility preference
-
setWarnOldContinuation
public void setWarnOldContinuation(boolean b) - Parameters:
b- sets the warnOldContinuation compatibility preference
-
isWarnOldContinuation
public boolean isWarnOldContinuation()- Returns:
- the warnOldContinuation compatibility preference
-
setSoundGlobalMute
- Parameters:
b- sets the global sound mute preference
-
isSoundGlobalMute
- Returns:
- true if sounds should be muted globally
-
setSoundWakeupMute
- Parameters:
b- sets the mute for the wake-up sound
-
isSoundWakeupMute
- Returns:
- true if the wake-up sound should be muted
-
getConfigureTypeName
- Returns:
- component name to be displayed in the editor, e.g. [Global Options]
-
getAllowableConfigureComponents
- Specified by:
getAllowableConfigureComponentsin interfaceConfigurable- Returns:
- classes allowed to be added as subcomponents (in this case, custom preferences)
-
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:
- Display strings describing attributes available for configuration
-
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:
- Attribute keys for XML buildFile
-
getAttributeTypes
Description copied from interface:AutoConfigurableReturn the Class for the attributes of this object. Valid classes are: String, Integer, Double, Boolean, Image, File, Color, and KeyStroke- Specified by:
getAttributeTypesin interfaceAutoConfigurable- Specified by:
getAttributeTypesin classAbstractConfigurable- Returns:
- configurer classes for our attributes
-
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.- Parameters:
option- - configurer to add
-
build
Builds our component from the buildFile. In our case it mainly involves checkout for subcomponents which represent "custom preferences" and appropriately creating configurers and a preferences tab for them.- Specified by:
buildin interfaceBuildable- Overrides:
buildin classAbstractBuildable- Parameters:
e- our XML element from the buildFile
-
getBuildElement
Packages any "custom preferences" back up into XML for the buildFile- Specified by:
getBuildElementin interfaceBuildable- Overrides:
getBuildElementin classAbstractBuildable- Parameters:
doc- the XML document we are writing to- Returns:
- XML Element
-
getConfigurer
Description copied from class:AbstractConfigurable- Specified by:
getConfigurerin interfaceConfigurable- Overrides:
getConfigurerin classAbstractConfigurable- Returns:
- a configurer including all custom preferences
-
getAttributeValueString
Returns current setting of an attribute in String form- 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 ingetAttributeNames()- Returns:
- String value of attribute
-
getHelpFile
- Specified by:
getHelpFilein interfaceConfigurable- Returns:
- Help file to be used on this component's configuration dialog
-
removeFrom
Removes us from our parent component- Specified by:
removeFromin interfaceConfigurable- Parameters:
parent- our parent (GameModule)
-
setAttribute
Sets a new value for one of our attributes. Some special attention is needed when one of the designer-controlled attributes changes, as it may necessitate the showing/hiding of a new user preference checkbox configurer- 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 ingetAttributeNames()value- If thevalueparameter is a String, it will be the value returned bygetAttributeValueString(java.lang.String)for the samekey. If the implementing class extendsAbstractConfigurable, thenvaluecan also be an instance of
-
autoReportEnabled
public boolean autoReportEnabled()- Returns:
- true if auto-reporting moves is enabled (designer-setting or user-pref, depending)
-
centerOnOpponentsMove
public boolean centerOnOpponentsMove()- Returns:
- true if center-on-opponents-move user pref is selected (no longer a designer setting)
-
isReverseStackViewerOrder
public boolean isReverseStackViewerOrder()- Returns:
- true if stack viewer should reverse left-to-right order
-
isShowMarkMoved
public boolean isShowMarkMoved() -
centerOnOpponentsMoveSensitivity
public double centerOnOpponentsMoveSensitivity()- Returns:
- percent-distance-from-center sensitivity for centering on opponent's move
-
chatterHTMLSetting
- Returns:
- designer's setting for enabling HTML chat
-
chatterHTMLSupport
public boolean chatterHTMLSupport()- Returns:
- true if chat is enabled in HTML (uses designer setting only)
-
isHotKeysOnClosedWindows
public boolean isHotKeysOnClosedWindows()- Returns:
- designer's setting for allowing hotkeys on closed windows
-
isSendToLocationMoveTrails
public boolean isSendToLocationMoveTrails()- Returns:
- designer's setting for whether send-to-location generates movement trails
-
isInventoryVisibleToAll
public boolean isInventoryVisibleToAll()- Returns:
- designer's setting for whether inventory can see units on private windows that current player doesn't have access to
-
isMarkMoveEnabled
public boolean isMarkMoveEnabled()- Returns:
- - NO LONGER USED
-
getDragThreshold
public int getDragThreshold()- Returns:
- drag threshold - pixels of movement required to distinguish drag from click
-
getPlayerId
- Returns:
- player ID for current player using the designer-configured format
-
isStoreLeadingZeroIntegersAsStrings
public boolean isStoreLeadingZeroIntegersAsStrings() -
isPurgeBlankPropertyPrompts
public boolean isPurgeBlankPropertyPrompts() -
isDisableUsePieceIndexes
public boolean isDisableUsePieceIndexes() -
getPropertyNames
Implement PropertyNameSource - Expose our preference names- Specified by:
getPropertyNamesin interfacePropertyNameSource- Overrides:
getPropertyNamesin classAbstractBuildable- Returns:
- property names for custom preferences
-
getPropertyList
- Specified by:
getPropertyListin interfaceSearchTarget- Overrides:
getPropertyListin classAbstractConfigurable- Returns:
- a list of any properties referenced in the configurer (for search)
-
getFormattedStringList
- Specified by:
getFormattedStringListin interfaceSearchTarget- Overrides:
getFormattedStringListin classAbstractConfigurable- Returns:
- a list of any Message Format strings referenced in the Configurable, if any (for search)
-
getNamedKeyStrokeList
- Specified by:
getNamedKeyStrokeListin interfaceSearchTarget- Overrides:
getNamedKeyStrokeListin classAbstractConfigurable- Returns:
- a list of any Named KeyStrokes referenced in the Configurable, if any (for search)
-
addImageNamesRecursively
Our Option Configurers (undo button, server button, step-forward button) potentially have icons to add the references for- Specified by:
addImageNamesRecursivelyin interfaceImageSearchTarget- Overrides:
addImageNamesRecursivelyin classAbstractBuildable- Parameters:
s- Collection to add image names to
-
isMandatory
public boolean isMandatory()Description copied from interface:BuildableIs this component a reqired component within its parent?- Specified by:
isMandatoryin interfaceBuildable- Returns:
- true if component is mandatory
-
isUnique
-