Class BasicModule
- All Implemented Interfaces:
AutoConfigurable, Buildable, Configurable, GpIdSupport, MutablePropertiesContainer, PropertyNameSource, PropertySource, TranslatableStringContainer, CommandEncoder, ValidityChecker, Translatable, Auditable, ImageSearchTarget, SearchTarget, ToolBarComponent
Deprecated, for removal: This API element is subject to removal in a future version.
-
Nested Class Summary
Nested classes/interfaces inherited from class GameModule
GameModule.GameFileModeModifier and TypeClassDescriptionstatic enumLast type of game save/load for our current gameNested classes/interfaces inherited from interface AutoConfigurable
AutoConfigurable.UtilNested classes/interfaces inherited from interface MutablePropertiesContainer
MutablePropertiesContainer.ImplModifier and TypeInterfaceDescriptionstatic classSimple implementation ofMutablePropertiesContainerNested classes/interfaces inherited from interface TranslatableStringContainer
TranslatableStringContainer.ImplModifier and TypeInterfaceDescriptionstatic classSimple implementation ofTranslatableStringContainer -
Field Summary
Fields inherited from class GameModule
BUILDFILE, BUILDFILE_OLD, DESCRIPTION, DRAWING_MOUSEOVER_INDEX_PROPERTY, DRAWING_MOUSEOVER_PROPERTY, IS_VISIBLE, MODULE_CURRENT_LOCALE, MODULE_CURRENT_LOCALE_NAME, MODULE_DESCRIPTION_PROPERTY, MODULE_NAME, MODULE_NAME_PROPERTY, MODULE_OTHER1_PROPERTY, MODULE_OTHER2_PROPERTY, MODULE_VASSAL_VERSION_CREATED_PROPERTY, MODULE_VASSAL_VERSION_RUNNING_PROPERTY, MODULE_VERSION, MODULE_VERSION_PROPERTY, NEXT_PIECESLOT_ID, PERSONAL_INFO, REAL_NAME, RECENT_GAMES, SECRET_NAME, UI_PIECE_COUNT, UI_PIECE_INDEX, VASSAL_VERSION_CREATED, VASSAL_VERSION_RUNNINGModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringThePrefskey for the user's personal infostatic final StringThePrefskey for the user's real namestatic final Stringstatic final StringThePrefskey for the user's secret namestatic final Stringstatic final Stringstatic final Stringstatic final StringThe System property of this name will return a version identifier for the version of VASSAL being runFields inherited from class AbstractConfigurable
changeSupport, config, localizedName, myI18nData, nameModifier and TypeFieldDescriptionprotected PropertyChangeSupportprotected Configurerprotected Stringprotected ComponentI18nDataprotected StringFields inherited from class AbstractBuildable
buildComponents, validatorFields inherited from interface Configurable
NAME_PROPERTY -
Constructor Summary
ConstructorsConstructorDescriptionBasicModule(DataArchive archive) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Methods inherited from class GameModule
addCommandEncoder, addIdChangeListener, addKeyStrokeListener, addKeyStrokeSource, addMutableProperty, addSideChangeListenerToPlayerRoster, addTo, addTranslatableString, appendToTitle, build, clearPausedCommands, clearTempUserId, createPiece, createPiece, decode, encode, finalizeUiPieceProcessing, fireKeyStroke, generateGpId, getActiveUserId, getAllowableConfigureComponents, getArchiveWriter, getAttributeDescriptions, getAttributeNames, getAttributeTypes, getAttributeValueString, getBasicLogger, getChatter, getCombinedCrc, getCombinedCrc, getConfigureTypeName, getConsole, getControlPanel, getCrc, getCrc, getDataArchive, getDebugControls, getDeckManager, getEditorImageChooser, getEditorSoundChooser, getExpressionList, getFileChooser, getFrame, getGameFile, getGameFileMode, getGameModule, getGameName, getGameState, getGameVersion, getGpIdSupport, getHelpFile, getI18nData, getI18nPrefix, getImageTileSource, getIndexManager, getLocalizedGameName, getLocalizedProperty, getLocationKeyCommand, getLogger, getModuleOther1, getModuleOther2, getMutablePropertiesContainerId, getMutableProperty, getNextGpId, getPasswordConfigurer, getPieceWindow, getPlayerRoster, getPlayerWindow, getPrefs, getProperty, getPropertyNames, getResourcePathFinder, getRNG, getServer, getServerControls, getTempUserId, getTitleString, getToolBar, getTranslatableString, getTranslatableStringContainerId, getUiPieceCount, getUiPieceIndex, getUserId, getWindowTitleString, getWindowTitleString, getWizardSupport, init, initFrameTitle, initializeUiPieceProcessing, isEditorOpen, isErrorLogToChat, isLoadingContinuationSemaphore, isLoadOverSemaphore, isLocalizationEnabled, isMatSupport, isMultiPlayer, isMultiplayerConnected, isMutableButtonLabelSupport, isNonBlankPassword, isRealName, isRefreshingSemaphore, isReplayingOrLogging, isSuppressAutoCenterUpdate, isSuppressSounds, isTranslatableSupport, isTrueMovedSupport, pauseLogging, processNextUiPiece, quit, refreshKeyStrokeListeners, refreshVisibleMaps, removeCommandEncoder, removeFrom, removeIdChangeListener, removeKeyStrokeListener, removeMutableProperty, removeSideChangeListenerFromPlayerRoster, removeTranslatableString, resetSourcesAndListeners, resumeLogging, save, saveAs, sendAndLog, setAttribute, setChatter, setDirty, setErrorLogToChat, setGameFile, setGameFileMode, setGpIdSupport, setLoadingContinuationSemaphore, setLoadOverSemaphore, setLocationKeyCommand, setMatSupport, setMutableButtonSupport, setNextGpId, setPieceWindow, setPrefs, setRefreshingSemaphore, setSuppressAutoCenterUpdate, setSuppressSounds, setTempUserId, setTrueMovedSupport, setUserId, shutDown, toString, updateLastSave, updateMutableButtonLabels, updateTitleBar, warnModifier and TypeMethodDescriptionvoidGameModule holds the master list of CommandEncoders, and invokes them as appropriate when commands are sent and received.voidCurrently used to listen for changes to player namesvoidThe GameModule acts as the mediator for hotkey events.voidThe GameModule acts as the mediator for hotkey events.voidaddMutableProperty(String key, MutableProperty p) Adds a new mutable (changeable) "Global Property" to the Module.voidAdds listener for players changing sidesvoidGame Module is normally at the root of the hierarchy, so it doesn't expect to get added to anything.voidAdd a property under the given keyvoidDeprecated, for removal: This API element is subject to removal in a future version.voidBuilds the module's component hierarchy from a given XML element, or a null one is given initializes a brand new default "new module" hierarchy.voidClear outstanding Commands Use where the calling level handles the sending of outstanding commandsstatic voidcreatePiece(String type) Central location to create any type of GamePiece from within VASSALcreatePiece(String type, GamePiece inner) Central location to create any type of GamePiece Trait (Decorator) from within VASSALDecodes our inboundCommandtraffic -- incoming player commands ready to be executed.Encodes our outboundCommandtraffic -- outgoing player commands to be sent to other players' clients via either online (server) or logfile (PBEM).final voidRecord the end of a multi-piece UI gesturevoidfireKeyStroke(NamedKeyStroke stroke) Invokes aNamedKeyStroketo all of our listeners.Allocates the next available GamePiece ID and returns it.static StringClass<?>[]List of subcomponents which can be added to a GameModule.VASSAL modules are stored in ".vmod" files, which are actually simple ".zip" files with a unique extension.String[]Return an array of Strings describing the attributes of this object.String[]Lists all the buildFile (XML) attribute names for this component.Class<?>[]Return the Class for the attributes of this object.Called by theBuildable.getBuildElement(Document)method to write the attributes into an XML elementlonglonggetCombinedCrc(boolean forceRegenerate) static StringGets the generic name for this type of class across all instances of it.longgetCrc()longgetCrc(boolean forceRegenerate) VASSAL modules are stored in ".vmod" files, which are actually simple ".zip" files with a unique extension.getFrame()Deprecated.static GameModuleReturn the object responsible for tracking the state of a game.Returns a localized translation of the specified property value, if available.Return a unique Id for the containergetMutableProperty(String name) Gets the value of a mutable (changeable) "Global Property".intAccessors to check and update the next GpId if necessary."Player" in this context meaning the VASSAL Player, i.e. the main module window, as opposed to any individual player meaning participant-in-a-boardgame.getPrefs()getProperty(Object key) Gets the value of a module level global property -- this includes identification information for the local player as well as the contents of any Global Property objects defined at module level in the Module.Override this method to provide a list of properties to be exposed for use by expressions in the module.getRNG()static StringReturns an appropriate Title Bar string for the main module window, based on the module name, the last read/written game file, and the manner of interaction with it.Provides access to the Game Module's toolbar.getTranslatableString(String name) Find an object with the given nameReturn a unique Id for the containerintReturn number of pieces to be processed by the current multi-piece UI gestureintReturn the index of the current piece being processed by the current multi-piece UI gesturestatic StringgetWindowTitleString(String key, String name) getWindowTitleString(String key, String name, boolean moduleVersion) Returns an appropriate Title Bar string for a window, based on the module name, the last read/written game file, and the manner of interaction with it.static voidinit(GameModule module) Loads a module object into the player window.voidSets the proper name for module window's title barfinal voidinitializeUiPieceProcessing(int pieceCount) A multi-piece UI gesture is starting.booleanIs an editor window currently openstatic booleanbooleanbooleanbooleanIs the module being translated into the user's Locale?booleanbooleanbooleanbooleanbooleanReturns true if user has supplied a real password for current GameModule.booleanReturns true if user has supplied a real name Test's whether GameModule.REAL_NAME is non-empty and not "newbie"booleanbooleanbooleanbooleanbooleanbooleanbooleanPause logging and return true if successful.final voidThe next piece in a multi-piece UI gesture is about to be processed.voidquit()Exit the application, prompting user to save if necessaryvoidIf our keyboard mapping paradigm changes (example: Mac Legacy preference checked/unchecked), we need to reregister all of our KeyStrokeListenersfinal voidRefresh the visible portions of all currently showing maps.voidThis method removes aCommandEncoderfrom the list of objects that will attempt to decode/encode a commandvoidremoveFrom(Buildable parent) Since we aren't expecting to beGameModule.addTo(Buildable)'ed to a parent, we likewise don't need to do much about being "removeFrom'ed" one.voidCurrently used to listen for changes to player namesvoidRemoves a mutable property from the Global Properties list.voidRemoves listener for players changing sidesRemove the property with the given keyvoidRestart logging and return any outstanding commandsvoidsave()If the module is being edited, write the module data to the current filenamevoidsaveAs()If the module is being edited, write the module data after prompting for a new filename.voidWhen the local player has taken any action that would change the game state (or otherwise needs to be sent to any other players' clients), the action should be encapsulated into aCommandand sent here.voidsetAttribute(String name, Object value) Sets a buildFile (XML) attribute value for this component.voidAllows the Chat Log window to register itself to the Module.voidsetDirty(boolean touchThis) static voidsetErrorLogToChat(boolean errorLogToChat) voidsetGameFile(String gameFile, GameModule.GameFileMode mode) Sets the most recent .VSAV / .VLOG file saved, loaded, or logged to, along with the type of action taken with that file.voidSets the type of interaction we most recently had with saving/loading/replaying/logging, for managing title bars of windows.voidRegisters a GamePiece ID support object for us to manage a namespace for unique GamePiece objects.voidsetLoadingContinuationSemaphore(boolean state) voidsetLoadOverSemaphore(boolean state) voidvoidsetMatSupport(boolean matSupport) voidsetMutableButtonSupport(boolean support) voidsetNextGpId(int id) Sets the next available GamePiece IDvoidsetPieceWindow(PieceWindow pieceWindow) Allows a PieceWindow that wants to be our docked PieceWindow to register itself.voidvoidsetRefreshingSemaphore(boolean state) voidsetSuppressAutoCenterUpdate(boolean suppressAutoCenterUpdate) voidsetSuppressSounds(boolean suppressSounds) static voidsetTempUserId(String id) voidsetTrueMovedSupport(boolean trueMovedSupport) static voidSet the identifier for the userbooleanshutDown()Prompt user to save open game and modules/extensions being editedtoString()voidSave the current buildString for comparison when we try and quit.voidA property has changed somewhere, so we need to redraw all the toolbar buttons that use propertiesvoidUpdates the title bar of the main module window, and all map windowsvoidDisplay the given text in the control window's status line.Methods inherited from class AbstractConfigurable
add, addPropertyChangeListener, getAttributeVisibility, getConfigureComponents, getConfigureName, getConfigurer, getFormattedStringList, getLocalizedConfigureName, getMenuTextList, getNamedKeyStrokeList, getPropertyList, getTypeName, remove, removePropertyChangeListener, setAllAttributesUntranslatable, setAttributeTranslatable, setConfigureNameModifier and TypeMethodDescriptionvoidSet the owning translatable of this componentvoidAdd a PropertyChangeListener.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.Returns the name of the configurable type for display purposes.voidRemove a Buildable object from this objectvoidprotected voidSets all attributes untranslatable.protected voidsetAttributeTranslatable(String attr, boolean b) Over-ride the default attribute translatability.voidSets the name and fires a PropertyChangeEventMethods inherited from class AbstractBuildable
addImageNamesRecursively, buildString, getAllDescendantComponentsOf, getAncestor, getBuildables, getBuildComponents, getBuildElement, getComponents, getComponentsOf, getNonFolderAncestor, setAncestor, validateModifier and TypeMethodDescriptionvoidAdds all images used by this component AND any subcomponents to the collection<T> List<T> getAllDescendantComponentsOf(Class<T> target) Recursively descend the build tree and return aListof all components that are instances of the given classDeprecated, for removal: This API element is subject to removal in a future version.UseAbstractBuildable.getBuildables()instead.getBuildElement(Document doc) <T> Enumeration<T> getComponents(Class<T> target) Deprecated, for removal: This API element is subject to removal in a future version.UseAbstractBuildable.getComponentsOf(Class)instead.<T> List<T> getComponentsOf(Class<T> target) voidsetAncestor(Buildable ancestor) voidvalidate(Buildable target, ValidationReport report) Methods inherited from class AbstractImageFinder
addLocalImageNames, getAllImageNames, getLocalImageNamesModifier and TypeMethodDescriptionvoidClasses extending AbstractImageFinder should override this method in order to add the names of any image files they use to the collection.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Auditable
getComponentName, getComponentTypeNameMethods inherited from interface Buildable
isMandatory, isMovable, isUniqueModifier and TypeMethodDescriptiondefault booleanIs this component a reqired component within its parent?default booleanIs this component allowed to be moved around the Configure Tree?default booleanisUnique()Does this component need to be unique within it's parent?Methods inherited from interface ToolBarComponent
updateToolbarButtonsModifier and TypeMethodDescriptiondefault voidUpdate the text labels in the toolbar's component buttons (for mutable button label support)
-
Constructor Details
-
BasicModule
Deprecated, for removal: This API element is subject to removal in a future version.
-
GameModule.updateTitleBar()