Package VASSAL.build.module.map
Class GlobalMap
java.lang.Object
VASSAL.build.module.map.GlobalMap
- All Implemented Interfaces:
AutoConfigurable
,Buildable
,Configurable
,GameComponent
,Drawable
,Translatable
,ImageSearchTarget
,SearchTarget
public class GlobalMap
extends Object
implements AutoConfigurable, GameComponent, Drawable, SearchTarget, ImageSearchTarget
This is scaled version of a
Map
that gives an overview.
Users can navigate around the Map by clicking on the GlobalMap, which
draws a rectangular region of interest (ROI) indicating the current
viewable area in the map window.-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
protected class
The scroll pane in which the mapGlobalMap.View
is displayed.static class
protected class
The Map view that appears inside the ScrollPaneNested classes/interfaces inherited from interface VASSAL.build.AutoConfigurable
AutoConfigurable.Util
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected final LaunchButton
protected Map
protected CounterDetailViewer
protected ComponentI18nData
protected Color
protected double
protected static final String
protected final ScrollPane
protected static final String
protected final GlobalMap.View
Fields inherited from interface VASSAL.build.Configurable
NAME_PROPERTY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a child component.void
Adds all images used by this component AND any children (or inner decorators/pieces) to the collection.void
Classes extendingAbstractBuildable
should override this method in order to add the names of any image files they use to the collection.void
Add a PropertyChangeListener.void
Expects to be added to aMap
.void
Build the object from the XML representation of the Buildablevoid
boolean
Class<?>[]
String[]
Return an array of Strings describing the attributes of this object.String[]
Class<?>[]
Return the Class for the attributes of this object.Called by theBuildable.getBuildElement(org.w3c.dom.Document)
method to write the attributes into an XML elementgetAttributeVisibility
(String name) Because attributes are not always applicable in all cases, this method returns an interface to determine when the controls for specifying the named attribute should be visible.getBuildElement
(Document doc) The name of this Configurable Objectstatic String
When saving a game, each GameComponent should return aCommand
that, when executed, restores the GameComponent to its state when the game was saved If this component has no persistent state, return nullmapToDrawing
(Point p, double os_scale) mapToDrawing
(Rectangle r, double os_scale) void
Remove a child componentvoid
Remove this component from its parentvoid
setAttribute
(String key, Object value) Called by theBuildable.build(org.w3c.dom.Element)
method, wherevalue
is the String value read by the XML attribute.void
setup
(boolean show) Notify the GameComponent that a game has started/endedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface VASSAL.build.Buildable
isMandatory, isMovable, isUnique
-
Field Details
-
map
-
scale
protected double scale -
rectColor
-
launch
-
mouseOverViewer
-
scroll
-
view
-
myI18nData
-
SCALE
- See Also:
-
COLOR
- See Also:
-
HOTKEY
- See Also:
-
ICON_NAME
- See Also:
-
TOOLTIP
- See Also:
-
BUTTON_TEXT
- See Also:
-
DEFAULT_ICON
- See Also:
-
-
Constructor Details
-
GlobalMap
public GlobalMap()
-
-
Method Details
-
addTo
-
add
Description copied from interface:Buildable
Adds a child component. Both this method andBuildable.addTo(VASSAL.build.Buildable)
are invoked when adding a child to a parent -
remove
Description copied from interface:Configurable
Remove a child component- Specified by:
remove
in interfaceConfigurable
-
removeFrom
Description copied from interface:Configurable
Remove this component from its parent- Specified by:
removeFrom
in interfaceConfigurable
-
build
-
getAttributeNames
- Specified by:
getAttributeNames
in interfaceAutoConfigurable
- Returns:
- an array of Strings giving all attributes of this Buildable component that will be written to/read from an XML element
-
getAttributeVisibility
Description copied from interface:AutoConfigurable
Because attributes are not always applicable in all cases, this method returns an interface to determine when the controls for specifying the named attribute should be visible.- Specified by:
getAttributeVisibility
in interfaceAutoConfigurable
- Parameters:
name
-- Returns:
- null if the attribute controls should always be visible;
-
setAttribute
Description copied from interface:AutoConfigurable
Called by theBuildable.build(org.w3c.dom.Element)
method, wherevalue
is the String value read by the XML attribute. Can also be called with Object value to set the attribute.- Specified by:
setAttribute
in interfaceAutoConfigurable
- Specified by:
setAttribute
in interfaceTranslatable
- Parameters:
key
- the name of the attribute. If the implementing class extendsAbstractConfigurable
, will be one of those listed inAbstractBuildable.getAttributeNames()
.value
- If thevalue
parameter is a String, it will be the value returned byTranslatable.getAttributeValueString(java.lang.String)
for the samekey
. If the implementing class extendsAbstractConfigurable
, thenvalue
can also be an instance of the corresponding Class listed inAbstractConfigurable.getAttributeTypes()
-
getAttributeValueString
Description copied from interface:AutoConfigurable
Called by theBuildable.getBuildElement(org.w3c.dom.Document)
method to write the attributes into an XML element- Specified by:
getAttributeValueString
in interfaceAutoConfigurable
- Specified by:
getAttributeValueString
in interfaceTranslatable
- Parameters:
key
- the name of the attribute. If the implementing class extendsAbstractConfigurable
, will be one of those listed inAbstractBuildable.getAttributeNames()
.- Returns:
- a String representation of the attribute with the given name. When initializing a module, this String value will be passed to
Translatable.setAttribute(java.lang.String, java.lang.Object)
.
-
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
-
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
-
draw
-
drawAboveCounters
public boolean drawAboveCounters()- Specified by:
drawAboveCounters
in interfaceDrawable
-
componentToMap
-
mapToComponent
-
mapToDrawing
-
mapToDrawing
-
getToolTipText
-
getRestoreCommand
Description copied from interface:GameComponent
When saving a game, each GameComponent should return aCommand
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 interfaceGameComponent
-
setup
public void setup(boolean show) Description copied from interface:GameComponent
Notify the GameComponent that a game has started/ended- Specified by:
setup
in interfaceGameComponent
- Parameters:
show
- if true, a game is starting. If false, then a game is ending
-
getConfigureTypeName
-
getConfigureName
Description copied from interface:Configurable
The name of this Configurable Object- Specified by:
getConfigureName
in interfaceConfigurable
-
getConfigurer
- Specified by:
getConfigurer
in interfaceConfigurable
- Returns:
- a
Configurer
object which can be used to set the attributes of this object
-
getConfigureComponents
- Specified by:
getConfigureComponents
in interfaceConfigurable
- Returns:
- an array of Configurer objects representing the Configurable children of this Configurable object
-
getAllowableConfigureComponents
- Specified by:
getAllowableConfigureComponents
in interfaceConfigurable
- Returns:
- a list of valid sub-component Classes. If a Class
appears in this list, then instances of that class may be added
to this component from the Editor's
ConfigureTree
window by right-clicking on the component and selecting the appropriate "Add" option.
-
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
-
getHelpFile
- Specified by:
getHelpFile
in interfaceConfigurable
- Returns:
- a HelpFile describing how to use and configure * this component
-
getBuildElement
- Specified by:
getBuildElement
in interfaceBuildable
- Parameters:
doc
- XML file- Returns:
- an XML element from which this component can be built
-
getI18nData
- Specified by:
getI18nData
in interfaceTranslatable
-
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)
-
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)
-
getPropertyList
- Specified by:
getPropertyList
in interfaceSearchTarget
- Returns:
- a list of any Property Names referenced in the Configurable, if any (for search)
-
getAllImageNames
- Specified by:
getAllImageNames
in interfaceImageSearchTarget
- Returns:
- names of all images used by the component and any subcomponents
-
addImageNamesRecursively
Adds all images used by this component AND any children (or inner decorators/pieces) to the collection.- Specified by:
addImageNamesRecursively
in interfaceImageSearchTarget
- Parameters:
s
- Collection to add image names to
-
getLocalImageNames
- Specified by:
getLocalImageNames
in interfaceImageSearchTarget
- Returns:
- names of all images used by this component
-
addLocalImageNames
Classes extendingAbstractBuildable
should override this method in order to add the names of any image files they use to the collection. For "find unused images" and "search".- Specified by:
addLocalImageNames
in interfaceImageSearchTarget
- Parameters:
s
- Collection to add image names to
-