Package VASSAL.build
Class AbstractConfigurable
java.lang.Object
VASSAL.search.AbstractImageFinder
VASSAL.build.AbstractBuildable
VASSAL.build.AbstractConfigurable
- All Implemented Interfaces:
AutoConfigurable
,Buildable
,Configurable
,PropertyNameSource
,ValidityChecker
,Translatable
,Auditable
,ImageSearchTarget
,SearchTarget
- Direct Known Subclasses:
AboutScreen
,AbstractDeckKeyCommand
,AbstractFolder
,AbstractScript
,AbstractToolbarItem
,BasicPreference
,Board
,BrowserPDFFile
,ChessClock
,ChessClockControl
,ColorManager
,ColorSwatch
,CounterDetailViewer
,DieManager
,Documentation
,Flare
,FontManager
,FontStyle
,GameModule
,GamePieceImage
,GamePieceImageDefinitions
,GamePieceLayout
,GamePieceLayoutsContainer
,GlobalOptions
,GlobalProperties
,GlobalProperty
,GlobalTranslatableMessage
,GlobalTranslatableMessages
,HelpFile
,HexGrid
,HighlightLastMoved
,IconFamily
,Item
,ItemInstance
,Language
,LayeredPieceCollection
,Plugin
,PredefinedSetup
,PrototypeDefinition
,PrototypesContainer
,Region
,RegionGrid
,RegularGridNumbering
,ScenarioPropertiesOptionTab
,ScriptContainer
,SelectionHighlighter
,SelectionHighlighters
,SetupStack
,SpecialDie
,SpecialDieFace
,SquareGrid
,StackMetrics
,TranslatableMarker
,Translation
,TurnComponent
,TurnGlobalHotkey
,Tutorial
,Widget
,Zone
,ZonedGrid
,ZonedGridHighlighter
,ZoneHighlight
,Zoomer
public abstract class AbstractConfigurable
extends AbstractBuildable
implements AutoConfigurable, SearchTarget
An abstract implementation of the
Configurable
interface. To make a component which is both buildable from the buildFile (XML)
and whose XML attributes are then editable/configurable with a dialog in the Editor, extend this class. Takes care of most of
the Configurable functionality. Provides the basis for a component to have a configuration dialog in the Editor, allowing various
attributes to be edited, retained, and saved/loaded from the module's buildFile (XML).-
Nested Class Summary
Nested classes/interfaces inherited from interface VASSAL.build.AutoConfigurable
AutoConfigurable.Util
-
Field Summary
Modifier and TypeFieldDescriptionprotected PropertyChangeSupport
protected Configurer
protected String
protected ComponentI18nData
protected String
Fields inherited from class VASSAL.build.AbstractBuildable
buildComponents, validator
Fields inherited from interface VASSAL.build.Configurable
NAME_PROPERTY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Set the owning translatable of this componentvoid
Add a PropertyChangeListener.abstract String[]
Return an array of Strings describing the attributes of this object.abstract Class<?>[]
Return the Class for the attributes of this object.getAttributeVisibility
(String name) By default, all attributes are visibleConfigureName is used, in particular, by the Editor to track the names of components, and is preferred byUniqueIdManager
.protected String
Returns the name of the configurable type for display purposes.void
Remove a Buildable object from this objectvoid
protected void
Sets all attributes untranslatable.protected void
setAttributeTranslatable
(String attr, boolean b) Over-ride the default attribute translatability.void
Sets the name and fires a PropertyChangeEventMethods inherited from class VASSAL.build.AbstractBuildable
addImageNamesRecursively, build, buildString, getAllDescendantComponentsOf, getAncestor, getAttributeNames, getAttributeValueString, getBuildables, getBuildComponents, getBuildElement, getComponents, getComponentsOf, getNonFolderAncestor, getPropertyNames, setAncestor, setAttribute, validate
Methods inherited from class VASSAL.search.AbstractImageFinder
addLocalImageNames, getAllImageNames, getLocalImageNames
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface VASSAL.script.expression.Auditable
getComponentName, getComponentTypeName
Methods inherited from interface VASSAL.build.AutoConfigurable
getAttributeNames, getAttributeValueString, setAttribute
Methods inherited from interface VASSAL.build.Buildable
addTo, build, getBuildElement, isMandatory, isMovable, isUnique
Methods inherited from interface VASSAL.build.Configurable
getAllowableConfigureComponents, getHelpFile, removeFrom
-
Field Details
-
changeSupport
-
name
-
localizedName
-
config
-
myI18nData
-
-
Constructor Details
-
AbstractConfigurable
public AbstractConfigurable()
-
-
Method Details
-
remove
Remove a Buildable object from this object- Specified by:
remove
in interfaceConfigurable
-
getConfigureName
ConfigureName is used, in particular, by the Editor to track the names of components, and is preferred byUniqueIdManager
.- Specified by:
getConfigureName
in interfaceConfigurable
- Returns:
- The language-independent name of this component used for programmatic identification (including within Modules by e.g. Traits and module components)
-
getLocalizedConfigureName
- Returns:
- The localized name for on-screen display
-
setConfigureName
Sets the name and fires a PropertyChangeEvent -
getAttributeDescriptions
Description copied from interface:AutoConfigurable
Return 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:
getAttributeDescriptions
in interfaceAutoConfigurable
- 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()
-
getAttributeTypes
Description copied from interface:AutoConfigurable
Return the Class for the attributes of this object. Valid classes are: String, Integer, Double, Boolean, Image, File, Color, and KeyStroke- Specified by:
getAttributeTypes
in interfaceAutoConfigurable
- Returns:
- 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 of
AutoConfigurer
will 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()
-
getAttributeVisibility
By default, all attributes are visible- Specified by:
getAttributeVisibility
in interfaceAutoConfigurable
- Parameters:
name
- Name (key) of one of this component's attributes- Returns:
- a
VisibilityCondition
for this attribute, or null if attribute should always be visible.
-
getI18nData
- Specified by:
getI18nData
in interfaceTranslatable
- Returns:
- the i18n data for this component
-
getI18nPrefix
- Returns:
- Generate a standard prefix for i18n keys for attributes of this component - Classname.attributeName
-
setAttributeTranslatable
Over-ride the default attribute translatability. This is called by individual components to force specific attributes to be translatable or not translatable- Parameters:
attr
- Attribute name/keyb
- true if translatable, false if not
-
setAllAttributesUntranslatable
protected void setAllAttributesUntranslatable()Sets all attributes untranslatable. -
add
Set the owning translatable of this component- Specified by:
add
in interfaceBuildable
- Overrides:
add
in classAbstractBuildable
- Parameters:
b
- Child to attach to this buildable as a subcomponent
-
addPropertyChangeListener
Description copied from interface:Configurable
Add a PropertyChangeListener. A PropertyChangeEvent should be fired with property nameConfigurable.NAME_PROPERTY
when the value returned fromConfigurable.getConfigureName()
has changed- Specified by:
addPropertyChangeListener
in interfaceConfigurable
-
removePropertyChangeListener
-
getConfigureComponents
- Specified by:
getConfigureComponents
in interfaceConfigurable
- Returns:
- A list of all child components (i.e. subcomponents) of this component that are configurable.
-
getConfigurer
- Specified by:
getConfigurer
in interfaceConfigurable
- Returns:
- Configurer for this component
-
getExpressionList
- Specified by:
getExpressionList
in interfaceSearchTarget
- Returns:
- a list of the Configurables string/expression fields if any (for search)
-
getFormattedStringList
- Specified by:
getFormattedStringList
in interfaceSearchTarget
- Returns:
- a list of any Message Format strings referenced in the Configurable, if any (for search)
-
getMenuTextList
- Specified by:
getMenuTextList
in interfaceSearchTarget
- Returns:
- a list of any Menu/Button/Tooltip Text strings referenced in the Configurable, if any (for search)
-
getNamedKeyStrokeList
- Specified by:
getNamedKeyStrokeList
in interfaceSearchTarget
- Returns:
- a list of any Named KeyStrokes referenced in the Configurable, if any (for search)
-
getPropertyList
- Specified by:
getPropertyList
in interfaceSearchTarget
- Returns:
- a list of any Property Names referenced in the Configurable, if any (for search)
-
getTypeName
Returns the name of the configurable type for display purposes. Reflection is used to callgetConfigureTypeName()
, which should be a static method if it exists in the given class. (This is necessary because static methods are not permitted in interfaces.)- Returns:
- the configure name of the class
-