VASSAL.build.module
Class ModuleExtension
java.lang.Object
|
+--VASSAL.build.AbstractBuildable
|
+--VASSAL.build.module.ModuleExtension
- All Implemented Interfaces:
- Buildable, GameComponent
- public class ModuleExtension
- extends AbstractBuildable
- implements GameComponent
An optional extension to a GameModule
Like a GameModule, it is built from scratch from a 'buildFile' in a DataArchive
The components described in the buildFile are appended to components in the base DataArchive
|
Inner Class Summary |
static class |
ModuleExtension.RegCmd
A command that verifies that a certain extension has been loaded |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BASE_MODULE_NAME
public static final java.lang.String BASE_MODULE_NAME
BASE_MODULE_VERSION
public static final java.lang.String BASE_MODULE_VERSION
VERSION
public static final java.lang.String VERSION
VASSAL_VERSION_CREATED
public static final java.lang.String VASSAL_VERSION_CREATED
ModuleExtension
public ModuleExtension(DataArchive archive)
getVersion
public java.lang.String getVersion()
getDataArchive
public DataArchive getDataArchive()
build
public void build()
getRestoreCommand
public Command getRestoreCommand()
- Description copied from interface:
GameComponent
- When saving a game, each GameComponent should return a
Command that, when executed, restores the GameComponent to its
state when the game was saved
If this component has no persistent state, return null
- Specified by:
getRestoreCommand in interface GameComponent
setup
public void setup(boolean gameStarting)
- Description copied from interface:
GameComponent
- Notify the GameComponent that a game has started/ended
- Specified by:
setup in interface GameComponent
- Following copied from interface:
VASSAL.build.module.GameComponent
- Parameters:
gameStarting - if true, a game is starting. If false, then a game is ending
getAttributeNames
public java.lang.String[] getAttributeNames()
- Overrides:
getAttributeNames in class AbstractBuildable
- Following copied from class:
VASSAL.build.AbstractBuildable
- Returns:
- a list of all attribute names for this component
getAllowableConfigureComponents
public java.lang.Class[] getAllowableConfigureComponents()
getHelpFile
public HelpFile getHelpFile()
removeFrom
public void removeFrom(Buildable parent)
confirmExit
public boolean confirmExit()
getAttributeValueString
public java.lang.String getAttributeValueString(java.lang.String key)
- Description copied from class:
AbstractBuildable
- Return a String representation of the attribute with the given name.
When initializing a module, this String value will be passed to
AbstractBuildable.setAttribute(java.lang.String, java.lang.Object).
- Overrides:
getAttributeValueString in class AbstractBuildable
- Following copied from class:
VASSAL.build.AbstractBuildable
- Parameters:
key - the name of the attribute. Will be one of those
listed in AbstractBuildable.getAttributeNames()
setAttribute
public void setAttribute(java.lang.String key,
java.lang.Object value)
- Description copied from class:
AbstractBuildable
- Sets an attribute value for this component. The
key
parameter will be one of those listed in AbstractBuildable.getAttributeNames().
If the value parameter is a String, it will be the
value returned by AbstractBuildable.getAttributeValueString(java.lang.String) for the same
key. If the implementing class extends
AbstractConfigurable, then value will be
an instance of the corresponding Class listed in
AbstractConfigurable.getAttributeTypes()
- Overrides:
setAttribute in class AbstractBuildable
- Following copied from class:
VASSAL.build.AbstractBuildable
- Parameters:
key - the name of the attribute. Will be one of those
listed in AbstractBuildable.getAttributeNames()
addTo
public void addTo(Buildable parent)
- Description copied from interface:
Buildable
- Adds this component to its parent.
In order to make Buildable objects extensible, the child
is reponsible for adding itself to the parent. That way,
Buildable subcomponents can be defined in an extension package
without needing to modify the containing class.
getName
public java.lang.String getName()
buildString
public java.lang.String buildString()
save
public void save()
throws java.io.IOException
saveAs
public void saveAs()
throws java.io.IOException
remove
public void remove(ExtensionElement el)
getEditAction
public javax.swing.Action getEditAction(javax.swing.JDialog d)