Class PropertyChangerConfigurer
java.lang.Object
VASSAL.configure.Configurer
VASSAL.build.module.properties.PropertyChangerConfigurer
Configurer instance that allows a module editor to specify a
PropertyChanger, i.e. the way in which a dynamic property will be
updated by a player during a game
- Author:
- rkinney
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class Configurer
Configurer.ContextLevelModifier and TypeClassDescriptionstatic enumThe ContextLevel of a Configurer defines the level that it is defined at. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JPanelprotected JPanelprotected PropertyChangerConfigurer.Constraintsprotected JPanelprotected static final charprotected static final charprotected FormattedExpressionConfigurerprotected static final Stringprotected JLabelprotected static final charprotected static final Stringprotected static final charprotected static final Stringprotected StringConfigurerprotected JLabelprotected static final Stringprotected TranslatingStringEnumConfigurerprotected JLabelprotected static final Map<Class<? extends PropertyChanger>, Character> protected static final Map<Class<? extends PropertyChanger>, String> protected StringArrayConfigurerprotected FormattedExpressionConfigurerprotected JLabelFields inherited from class Configurer
changeSupport, context, contextLevel, frozen, hint, key, LIST_ENTRY_HIGHLIGHT_COLOR, name, NAME_PROPERTY, noUpdate, valueModifier and TypeFieldDescriptionprotected PropertyChangeSupportprotected AbstractBuildableprotected Configurer.ContextLevelprotected booleanWhen frozen is true, setting the value programmatically will not result in a PropertyChangeEvent being firedprotected StringA Hint to be displayed in an empty fieldprotected StringA String the uniquely identifies this propertystatic final ColorDefault Highlight Color for Configurable Listsprotected StringA String that provides a short description of the property to the userstatic final Stringprotected booleanWhen noUpdate is true, setting the value programmatically will not result in an update of the GUI Componentprotected ObjectThe value -
Constructor Summary
ConstructorsConstructorDescriptionPropertyChangerConfigurer(String key, String name, PropertyChangerConfigurer.Constraints constraints) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFocusListener(FocusListener listener) Add a FocusListener to the Swing Components that make up this Configurer.GUI interface for setting the option in an editing windowbooleanvoidremoveFocusListener(FocusListener listener) Remove a FocusListener from the Swing Components that make up this Configurer.voidsetContext(AbstractBuildable context) Set the Context for this Configurer to the first ancestor that is of type GameModule or Map NOTE: The ContextLevel may already have been preset by the ConfigureFactory when the Configurer was created.voidsetHighlighted(boolean highlighted) Set the highlighted status of this configurer.voidSet the Object value from a Stringprotected voidprotected voidMethods inherited from class Configurer
addPropertyChangeListener, fireUpdate, getContext, getContextLevel, getHint, getKey, getName, getScreenSize, getValue, initCustomControls, isFrozen, isHighlighted, isPieceContext, removePropertyChangeListener, repack, repack, requestFocus, setContext, setContext, setContextLevel, setEnabled, setFrozen, setHint, setHintKey, setLabelVisibile, setLabelVisible, setName, setValueModifier and TypeMethodDescriptionvoidAdd a listener to be notified when the Object state changesvoidFire a PropertyChangeEvent as if the value had been set from nullGet the Context for this ConfigurergetHint()Return the current hint StringgetKey()Unique identifiergetName()Plain English description of the Objectprotected DimensionReturn the current screen size for use by List type configurers to allow them to take up maximum screen real estate if needed.getValue()The Object value May be null if the Object has not been initializedvoidinitCustomControls(JDialog d, Configurable target) Initialize any custom controls / keystrokesbooleanisFrozen()booleanReturn the current highlighted statusbooleanvoidprotected voidrepack()Repack the current configurerprotected voidRepack a dialog or windowvoidMove the cursor to the first input field of this ConfigurervoidsetContext(Buildable context) voidsetContext(Configurable context) voidsetContextLevel(Configurer.ContextLevel contextLevel) voidsetEnabled(boolean enabled) Enable or Disable the action of this configurer/voidsetFrozen(boolean val) If true, then don't fire PropertyChangeEvents when the value is resetvoidSet the Hint StringvoidsetHintKey(String hintKey) Set the Hint String via a I18n keyvoidsetLabelVisibile(boolean visible) Deprecated, for removal: This API element is subject to removal in a future version.voidsetLabelVisible(boolean visible) Show/Hide the internal label maintained by this Configurer.voidvoidSet the Object value
-
Field Details
-
PLAIN_TYPE
- See Also:
-
INCREMENT_TYPE
- See Also:
-
PROMPT_TYPE
- See Also:
-
SELECT_TYPE
- See Also:
-
PLAIN_CODE
protected static final char PLAIN_CODE- See Also:
-
PROMPT_CODE
protected static final char PROMPT_CODE- See Also:
-
ENUM_CODE
protected static final char ENUM_CODE- See Also:
-
INCR_CODE
protected static final char INCR_CODE- See Also:
-
typeToCode
-
typeToDescription
-
descriptionToCode
-
constraints
-
controls
-
typeLabel
-
typeConfig
-
valueLabel
-
valueConfig
-
promptLabel
-
promptConfig
-
incrLabel
-
incrConfig
-
validValuesConfig
-
changerLabelControls
-
changerControls
-
-
Constructor Details
-
PropertyChangerConfigurer
public PropertyChangerConfigurer(String key, String name, PropertyChangerConfigurer.Constraints constraints)
-
-
Method Details
-
getControls
Description copied from class:ConfigurerGUI interface for setting the option in an editing window- Specified by:
getControlsin classConfigurer
-
getTypeLabel
-
getTypeControls
-
getChangerLabel
-
getChangerControls
-
getValuesControls
-
updateControls
protected void updateControls() -
updateValue
protected void updateValue() -
getValueString
- Specified by:
getValueStringin classConfigurer- Returns:
- a String representation of the Object value
-
isEnumType
public boolean isEnumType() -
getPropertyChanger
-
setValue
Description copied from class:ConfigurerSet the Object value from a String- Specified by:
setValuein classConfigurer
-
setHighlighted
public void setHighlighted(boolean highlighted) Description copied from class:ConfigurerSet the highlighted status of this configurer. It is up to individual Configurers to override this method and implement a suitable visual highlighting scheme Note: Cannot make this abstract as it will break custom code.- Overrides:
setHighlightedin classConfigurer- Parameters:
highlighted- New Highlighted status
-
addFocusListener
Description copied from class:ConfigurerAdd a FocusListener to the Swing Components that make up this Configurer.- Overrides:
addFocusListenerin classConfigurer- Parameters:
listener- Focus Listener
-
removeFocusListener
Description copied from class:ConfigurerRemove a FocusListener from the Swing Components that make up this Configurer.- Overrides:
removeFocusListenerin classConfigurer- Parameters:
listener- Focus Listener
-
setContext
Description copied from class:ConfigurerSet the Context for this Configurer to the first ancestor that is of type GameModule or Map NOTE: The ContextLevel may already have been preset by the ConfigureFactory when the Configurer was created. Don't let the AutoConfigurer over-write this- Overrides:
setContextin classConfigurer- Parameters:
context- Owning Configurable
-
Configurer.setLabelVisible(boolean)instead.