Package VASSAL.configure
Class Configurer
java.lang.Object
VASSAL.configure.Configurer
- Direct Known Subclasses:
AddressBookServerConfigurer
,AutoConfigurer
,BooleanConfigurer
,ColorConfigurer
,ColorSwatchConfigurer
,DynamicKeyCommandConfigurer
,DynamicKeyCommandListConfigurer
,DynamicProperty.DynamicKeyCommandConfigurer
,FileConfigurer
,FontConfigurer
,FontConfigurer
,FontStyleConfigurer
,GlobalCommandTargetConfigurer
,HotKeyConfigurer
,IconConfigurer
,ImageSelector
,InstanceConfigurer
,JavaNameConfigurer
,KeyModifiersConfigurer
,KeyStrokeArrayConfigurer
,LayoutConfigurer
,ListConfigurer
,LocaleConfigurer
,MassKeyCommand.DeckPolicyConfig
,NamedHotKeyConfigurer
,NamedKeyStrokeArrayConfigurer
,NewColorConfigurer
,PieceAccessConfigurer
,PositionOption
,PropertyChangerConfigurer
,PrototypeDefinition.Config
,ServerConfigurer
,SimpleConfigurer
,SoundConfigurer
,StringArrayConfigurer
,StringConfigurer
,StringEnumConfigurer
,StringEnumConfigurer
,TableConfigurer
,TextConfigurer
,ToggleablePasswordConfigurer
,TranslatingStringEnumConfigurer
,Zone.Editor
,ZoneHighlight.PercentageConfigurer
,Zoomer.LevelConfigurer
A property editor class. Wraps an Object value and provides
methods for saving and restoring the Object from a String. Also
includes a
Component
that can be placed into a
property editing window, allowing the user to change the value
interactively.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected PropertyChangeSupport
protected boolean
When frozen is true, setting the value programmatically will not result in a PropertyChangeEvent being firedprotected String
A Hint to be displayed in an empty fieldprotected String
A String the uniquely identifies this propertystatic Color
Default Highlight Color for Configurable Listsprotected String
A String that provides a short description of the property to the userstatic String
protected boolean
When noUpdate is true, setting the value programmatically will not result in an update of the GUI Componentprotected Object
The value -
Constructor Summary
ConstructorsConstructorDescriptionConfigurer(String key, String name)
Configurer(String key, String name, Object val)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addFocusListener(FocusListener listener)
Add a FocusListener to the Swing Components that make up this Configurer.void
Add a listener to be notified when the Object state changesvoid
Fire a PropertyChangeEvent as if the value had been set from nullabstract Component
GUI interface for setting the option in an editing windowgetHint()
Return the current hint StringgetKey()
Unique identifiergetName()
Plain English description of the Objectprotected Dimension
Return 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 initializedabstract String
boolean
isFrozen()
boolean
Return the current highlighted statusvoid
removeFocusListener(FocusListener listener)
Remove a FocusListener from the Swing Components that make up this Configurer.void
protected void
repack()
Repack the current configurerprotected void
Repack a dialog or windowvoid
Move the cursor to the first input field of this Configurervoid
setFrozen(boolean val)
If true, then don't fire PropertyChangeEvents when the value is resetvoid
setHighlighted(boolean highlighted)
Set the highlighted status of this configurer.void
Set the Hint Stringvoid
setHintKey(String hintKey)
Set the Hint String via a I18n keyvoid
setLabelVisibile(boolean visible)
Show/Hide the internal label maintained by this Configurer.void
void
Set the Object valueabstract void
Set the Object value from a String
-
Field Details
-
NAME_PROPERTY
- See Also:
- Constant Field Values
-
key
A String the uniquely identifies this property -
name
A String that provides a short description of the property to the user -
value
The value -
changeSupport
-
noUpdate
protected boolean noUpdateWhen noUpdate is true, setting the value programmatically will not result in an update of the GUI Component -
frozen
protected boolean frozenWhen frozen is true, setting the value programmatically will not result in a PropertyChangeEvent being fired -
hint
A Hint to be displayed in an empty field -
LIST_ENTRY_HIGHLIGHT_COLOR
Default Highlight Color for Configurable Lists
-
-
Constructor Details
-
Configurer
-
Configurer
-
-
Method Details
-
getKey
Unique identifier -
getName
Plain English description of the Object -
setName
-
getValue
The Object value May be null if the Object has not been initialized -
getValueString
- Returns:
- a String representation of the Object value
-
setValue
Set the Object value -
setFrozen
public void setFrozen(boolean val)If true, then don't fire PropertyChangeEvents when the value is reset -
isFrozen
public boolean isFrozen() -
fireUpdate
public void fireUpdate()Fire a PropertyChangeEvent as if the value had been set from null -
setValue
Set the Object value from a String -
getControls
GUI interface for setting the option in an editing window -
addPropertyChangeListener
Add a listener to be notified when the Object state changes -
removePropertyChangeListener
-
repack
protected void repack()Repack the current configurer -
repack
Repack a dialog or window -
getScreenSize
Return the current screen size for use by List type configurers to allow them to take up maximum screen real estate if needed. The headless check is required in case any Configurers try to initialize during tests.- Returns:
- Screen Size.
-
getHint
Return the current hint String- Returns:
- Current Hint String
-
setHint
Set the Hint String- Parameters:
hint
- New Hint string
-
setHintKey
Set the Hint String via a I18n key- Parameters:
hintKey
- I18n key for the hint
-
setLabelVisibile
public void setLabelVisibile(boolean visible)Show/Hide the internal label maintained by this Configurer. It is up to individual Configurers to track and hide the label (if they can). This method is currently only utilized by the Preference configsPrefsEditor.addOption(String, Configurer)
to extract an existing label in a configurer, display correctly aligned and suppress the original label. This keeps compatibility with custom module code setting up preferences. This method only needs to be implemented in Configurers that are added as preferences.- Parameters:
visible
- Hide label if true
-
setHighlighted
public void setHighlighted(boolean highlighted)Set the highlighted status of this configurer. It is up to individual Configurers to over-ride this method and implement a suitable visual highlighting scheme Note: Cannot make this abstract as it will break custom code.- Parameters:
highlighted
- New Highlighted status
-
isHighlighted
public boolean isHighlighted()Return the current highlighted status- Returns:
- Highlight status
-
addFocusListener
Add a FocusListener to the Swing Components that make up this Configurer.- Parameters:
listener
- Focus Listener
-
removeFocusListener
Remove a FocusListener from the Swing Components that make up this Configurer.- Parameters:
listener
- Focus Listener
-
requestFocus
public void requestFocus()Move the cursor to the first input field of this Configurer
-