VASSAL.configure
Class Configurer

java.lang.Object
  |
  +--VASSAL.configure.Configurer
Direct Known Subclasses:
AutoConfigurer, BooleanConfigurer, ColorConfigurer, FileConfigurer, FontConfigurer, HotKeyConfigurer, PositionOption, SimpleConfigurer, SoundConfigurer, StringArrayConfigurer, StringConfigurer, StringEnumConfigurer, TextConfigurer

public abstract class Configurer
extends java.lang.Object

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
protected  java.beans.PropertyChangeSupport changeSupport
           
protected  boolean frozen
          When frozen is true, setting the value programmatically will not result in a PropertyChangeEvent being fired
protected  java.lang.String key
          A String the uniquely identifies this property
protected  java.lang.String name
          A String that provides a short description of the property to the user
static java.lang.String NAME_PROPERTY
           
protected  boolean noUpdate
          When noUpdate is true, setting the value programmatically will not result in an update of the GUI Component
protected  java.lang.Object value
          The value
 
Constructor Summary
Configurer(java.lang.String key, java.lang.String name)
           
Configurer(java.lang.String key, java.lang.String name, java.lang.Object val)
           
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          Add a listener to be notified when the Object state changes
 void fireUpdate()
          Fire a PropertyChangeEvent as if the value had been set from null
abstract  java.awt.Component getControls()
          GUI interface for setting the option in an editing window
 java.lang.String getKey()
          Unique identifier
 java.lang.String getName()
          Plain English description of the Object
 java.lang.Object getValue()
          The Object value May be null if the Object has not been initialized
abstract  java.lang.String getValueString()
           
 boolean isFrozen()
           
 void setFrozen(boolean val)
          If true, then don't fire PropertyChangeEvents when the value is reset
 void setName(java.lang.String s)
           
 void setValue(java.lang.Object o)
          Set the Object value
abstract  void setValue(java.lang.String s)
          Set the Object value from a String
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME_PROPERTY

public static final java.lang.String NAME_PROPERTY

key

protected java.lang.String key
A String the uniquely identifies this property

name

protected java.lang.String name
A String that provides a short description of the property to the user

value

protected java.lang.Object value
The value

changeSupport

protected java.beans.PropertyChangeSupport changeSupport

noUpdate

protected boolean noUpdate
When noUpdate is true, setting the value programmatically will not result in an update of the GUI Component

frozen

protected boolean frozen
When frozen is true, setting the value programmatically will not result in a PropertyChangeEvent being fired
Constructor Detail

Configurer

public Configurer(java.lang.String key,
                  java.lang.String name)

Configurer

public Configurer(java.lang.String key,
                  java.lang.String name,
                  java.lang.Object val)
Method Detail

getKey

public java.lang.String getKey()
Unique identifier

getName

public java.lang.String getName()
Plain English description of the Object

setName

public void setName(java.lang.String s)

getValue

public java.lang.Object getValue()
The Object value May be null if the Object has not been initialized

getValueString

public abstract java.lang.String getValueString()
Returns:
a String representation of the Object value

setValue

public void setValue(java.lang.Object o)
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

public abstract void setValue(java.lang.String s)
Set the Object value from a String

getControls

public abstract java.awt.Component getControls()
GUI interface for setting the option in an editing window

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Add a listener to be notified when the Object state changes