Class PrivateMap
- All Implemented Interfaces:
DropTargetListener
,MouseListener
,MouseMotionListener
,PropertyChangeListener
,EventListener
,AutoConfigurable
,Buildable
,Configurable
,GameComponent
,PlayerRoster.SideChangeListener
,MutablePropertiesContainer
,PropertyNameSource
,PropertySource
,ComponentDescription
,ValidityChecker
,Translatable
,Auditable
,ImageSearchTarget
,SearchTarget
,ToolBarComponent
,UniqueIdManager.Identifyable
- Direct Known Subclasses:
PlayerHand
A Map that may be configured to be visible only a particular side.
If visible to all, the map will respond to key/mouse events
only from the player playing the assigned side
-
Nested Class Summary
Nested classes/interfaces inherited from class VASSAL.build.module.Map
Map.ChangeFormatConfig, Map.CreateFormatConfig, Map.IconConfig, Map.InsetLayout, Map.Merger, Map.MoveToFormatConfig, Map.MoveWithinFormatConfig, Map.UnmovedIconConfig, Map.UnmovedReportConfig
Nested classes/interfaces inherited from class VASSAL.build.AbstractToolbarItem
AbstractToolbarItem.FormattedStringConfig
Nested classes/interfaces inherited from interface VASSAL.build.AutoConfigurable
AutoConfigurable.Util
Nested classes/interfaces inherited from interface VASSAL.build.module.properties.MutablePropertiesContainer
MutablePropertiesContainer.Impl
-
Field Summary
Modifier and TypeFieldDescriptionprotected String[]
static final String
protected Map
static final String
static final String
protected boolean
Fields inherited from class VASSAL.build.module.Map
activeMap, ALLOW_MULTIPLE, allowMultiple, BACKGROUND_COLOR, bgColor, boardHeights, boards, boardWidths, BUTTON_NAME, CHANGE_FORMAT, changeFormat, changeReportingEnabled, clearFirst, CREATE_FORMAT, createFormat, DEFAULT_EDGE_SCROLL_DELAY_PROPERTY, DEFAULT_EDGE_SCROLL_RATE_PROPERTY, DEFAULT_EDGE_SCROLL_ZONE_PROPERTY, description, DESCRIPTION, dragGestureListener, drawComponents, dx, dy, EDGE_HEIGHT, EDGE_SCROLL_RATE, EDGE_WIDTH, edgeBuffer, HIDE_KEY, hideCounters, hideKeyListener, HIGHLIGHT_COLOR, HIGHLIGHT_THICKNESS, highlighter, highlighters, HOTKEY, ICON, idMgr, keyBufferer, launchButton, layeredPane, LOCATION, mainWindowDock, MAP_NAME, mapID, mapName, MARK_MOVED, MARK_UNMOVED_HOTKEY, MARK_UNMOVED_ICON, MARK_UNMOVED_REPORT, MARK_UNMOVED_TEXT, MARK_UNMOVED_TOOLTIP, markMovedOption, markUnmovedHotkey, markUnmovedIcon, markUnmovedReport, markUnmovedText, markUnmovedTooltip, MESSAGE, metrics, mouseListenerStack, MOVE_KEY, MOVE_TO_FORMAT, MOVE_WITHIN_FORMAT, moveKey, moveToFormat, moveWithinFormat, MOVING_STACKS_PICKUP_UNITS, multicaster, NAME, OLD_LOCATION, OLD_MAP, ONLY_REPORT_CHANGED_LOCATION, onlyReportChangedLocation, picker, PIECE_NAME, pieceMover, pieceOpacity, pieces, PREFERRED_EDGE_DELAY, PREFERRED_EDGE_SCROLL_DELAY, PREFERRED_EDGE_SCROLL_RATE, PREFERRED_EDGE_SCROLL_RATE_STANDARD_DEFAULT, PREFERRED_EDGE_SCROLL_ZONE_STANDARD_DEFAULT, PREFERRED_SCROLL_ZONE, preferredCenter, propsContainer, repaintOnPropertyChange, saveKeyListeners, scroll, SCROLL_ZONE, scroller, SHOW_KEY, showKeyListener, splitPane, SUPPRESS_AUTO, sx, sy, theMap, toolBar, tooltip, TOOLTIP, USE_LAUNCH_BUTTON, useLaunchButton, useLaunchButtonEdit, visibilityCondition, zoom
Fields inherited from class VASSAL.build.AbstractToolbarItem
BUTTON_TEXT, CAN_DISABLE, canDisable, DISABLED_ICON, disabledIconConfig, HIDE_WHEN_DISABLED, hideWhenDisabled, launch, property, PROPERTY_GATE, propertyGate, showDisabledOptions
Fields inherited from class VASSAL.build.AbstractConfigurable
changeSupport, config, localizedName, myI18nData, name
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
Builds the map's component hierarchy from a given XML element, or a null one is given initializes a brand new default "new map" hierarchy.protected Window
Creates the top-level window for this map.String[]
This getAttributeDescriptions() will return the items specific to the Toolbar Button - classes extending this should add their own items as well.String[]
Lists all the buildFile (XML) attribute names for this component.Class<?>[]
This getAttributeTypes() will return the items specific to the Toolbar Button - classes extending this should add their own items as well.Classes extending AbstractToolbarItem can call this as a super() method after checking for their own keys, to avoid needing to deal with the nitty gritty of the toolbar button.static String
getView()
Yes this LOOKS exactly the same as the method it overrides, but confusingly Map and PrivateMap each have *different* View classes sharing the same name.boolean
isAccessibleTo
(String playerSide) Return true if the player playing the given side can access this mapboolean
isVisibleTo
(String playerSide) void
setAttribute
(String key, Object value) Sets a buildFile (XML) attribute value for this component.void
setBoards
(Collection<Board> c) Set the boards for this map.void
setup
(boolean show) When a game is started, create a top-level window, if none exists.boolean
If this map shows with its own special button, it does not dock into the main window.void
sideChanged
(String oldSide, String newSide) Takes action when the local player has switched sides.Methods inherited from class VASSAL.build.module.Map
addDrawComponent, addHighlighter, addLocalImageNames, addLocalMouseListener, addLocalMouseListenerFirst, addMutableProperty, addPiece, addTo, appendToTitle, apply, boundingBoxOf, centerAt, centerAt, clearActiveMap, clearMapBorder, componentCoordinates, componentRectangle, componentToDrawing, componentToDrawing, componentToDrawing, componentToMap, componentToMap, componentToMap, disableKeyListeners, dragEnter, dragExit, dragOver, drawBoards, drawBoardsInRegion, drawBoardsInRegion, drawDrawable, drawingToComponent, drawingToComponent, drawingToComponent, drawingToMap, drawingToMap, drawingToMap, drawPieces, drawPiecesInRegion, drawPiecesInRegion, drop, dropActionChanged, enableKeyListeners, ensureVisible, findAnyPiece, findBoard, findPiece, findRegion, findZone, findZone, getAllowableConfigureComponents, getAllPieces, getAttributeVisibility, getBoardByName, getBoardCount, getBoardPicker, getBoards, getCenter, getChangeFormat, getChangeFormat, getComponent, getCreateFormat, getDeckNameAt, getDeckNameContaining, getDefaultWindowTitle, getDescription, getDragGestureListener, getEdgeBuffer, getFormattedStringList, getHighlighter, getHighlighters, getId, getIdentifier, getKeyBufferer, getLayeredPane, getLocalizedDeckNameAt, getLocalizedMapName, getLocalizedProperty, getLocation, getLocation, getLocation2D, getLocation2D, getMapById, getMapList, getMapName, getMaxPixelsPerRangeUnit, getMenuTextList, getMoveKey, getMoveToFormat, getMoveWithinFormat, getMutablePropertiesContainerId, getMutableProperty, getNamedKeyStrokeList, getPieceCollection, getPieceMover, getPieceOpacity, getPieces, getPreferredCenter, getPreferredSize, getProperty, getPropertyNames, getRestoreCommand, getStackMetrics, getToolBar, getVisibleRect, getZoom, getZoomer, hideMap, indexOf, isAnyMouseoverDrawn, isChangeReportingEnabled, isDrawingMouseOver, isFirstMap, isLocationRestricted, isMarkMoved, isNotPieceDrag, isOnlyReportChangedLocation, isPiecesVisible, isVisibleToAll, localizedLocationName, locationName, mapCoordinates, mapRectangle, mapSize, mapToComponent, mapToComponent, mapToComponent, mapToDrawing, mapToDrawing, mapToDrawing, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, paintRegion, paintRegion, placeAt, placeOrMerge, popMouseListener, popMouseListener, positionOf, pushMouseListener, removeDrawComponent, removeFrom, removeHighlighter, removeLocalMouseListener, removeMutableProperty, removePiece, repaint, repaint, repaint, scale, scale, scale, scroll, scrollAtEdge, selectionBoundsOf, setActiveMap, setAnyMouseoverDrawn, setBoardBoundaries, setBoardPicker, setChangeReportingEnabled, setDragGestureListener, setDrawingMouseOver, setHighlighter, setId, setKeyBufferer, setMapName, setPieceCollection, setPieceMover, setPieceOpacity, setPiecesVisible, setStackMetrics, setUpView, setZoomer, showMap, snapTo, snapTo, snapTo, translateEvent, updateCenter, updateTitleBar
Methods inherited from class VASSAL.build.AbstractToolbarItem
addPropertyGateListener, addPropertyGateListener, checkDisabled, disableIfTrue, getLaunchButton, getNameKey, getPropertyList, isShowDisabledOptions, makeLaunchButton, propertyChange, removePropertyGateListener, setButtonTextKey, setHotKeyKey, setIconKey, setLaunchButton, setNameKey, setNamePrompt, setShowDisabledOptions, setTooltipKey
Methods inherited from class VASSAL.build.AbstractConfigurable
add, addPropertyChangeListener, getConfigureComponents, getConfigureName, getConfigurer, getExpressionList, getI18nData, getI18nPrefix, getLocalizedConfigureName, getTypeName, remove, removePropertyChangeListener, setAllAttributesUntranslatable, setAttributeTranslatable, setConfigureName
Methods inherited from class VASSAL.build.AbstractBuildable
addImageNamesRecursively, buildString, getAllDescendantComponentsOf, getAncestor, getBuildables, getBuildComponents, getBuildElement, getComponents, getComponentsOf, getNonFolderAncestor, setAncestor, validate
Methods inherited from class VASSAL.search.AbstractImageFinder
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.Buildable
add, getBuildElement, isMandatory, isMovable, isUnique
Methods inherited from interface VASSAL.build.Configurable
addPropertyChangeListener, getConfigureComponents, getConfigureName, getConfigurer, remove
Methods inherited from interface VASSAL.tools.ToolBarComponent
updateToolbarButtons
Methods inherited from interface VASSAL.i18n.Translatable
getI18nData
Methods inherited from interface VASSAL.tools.UniqueIdManager.Identifyable
getConfigureName
-
Field Details
-
owners
-
visibleToAll
protected boolean visibleToAll -
surrogate
-
VISIBLE
- See Also:
-
SIDE
- See Also:
-
USE_BOARDS
- See Also:
-
-
Constructor Details
-
PrivateMap
public PrivateMap()
-
-
Method Details
-
getAttributeNames
Description copied from class:Map
Lists all the buildFile (XML) attribute names for this component. If this component is ALSO anAbstractConfigurable
, then this list of attributes determines the appropriate attribute order forAbstractConfigurable.getAttributeDescriptions()
andAbstractConfigurable.getAttributeTypes()
.- Specified by:
getAttributeNames
in interfaceAutoConfigurable
- Overrides:
getAttributeNames
in classMap
- Returns:
- a list of all buildFile (XML) attribute names for this component
- See Also:
-
getAttributeDescriptions
Description copied from class:AbstractToolbarItem
This getAttributeDescriptions() will return the items specific to the Toolbar Button - classes extending this should add their own items as well. If the "nameKey" is blank, then no "name" configure entry will be generated. Extending classes can use ArrayUtils.addAll(super.getAttributeDescriptions(), key1, ..., keyN), or supply their own order from scratch.- Specified by:
getAttributeDescriptions
in interfaceAutoConfigurable
- Overrides:
getAttributeDescriptions
in classMap
- 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()
- See Also:
-
getAttributeTypes
Description copied from class:AbstractToolbarItem
This getAttributeTypes() will return the items specific to the Toolbar Button - classes extending this should add their own items as well. If the "nameKey" is blank, then no "name" configure entry will be generated. Extending classes can use ArrayUtils.addAll(super.getAttributeTypes(), key1, ..., keyN), or supply their own order from scratch.- Specified by:
getAttributeTypes
in interfaceAutoConfigurable
- Overrides:
getAttributeTypes
in classMap
- 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()
- See Also:
-
setAttribute
Description copied from class:Map
Sets a buildFile (XML) attribute value for this component.- Specified by:
setAttribute
in interfaceAutoConfigurable
- Specified by:
setAttribute
in interfaceTranslatable
- Overrides:
setAttribute
in classMap
- Parameters:
key
- the name of the attribute. Will be one of those listed inMap.getAttributeNames()
value
- If thevalue
parameter is a String, it will be the value returned byMap.getAttributeValueString(java.lang.String)
for the samekey
. Since Map extendsAbstractConfigurable
, thenvalue
can also be an instance of the corresponding Class listed inMap.getAttributeTypes()
.
-
getAttributeValueString
Description copied from class:AbstractToolbarItem
Classes extending AbstractToolbarItem can call this as a super() method after checking for their own keys, to avoid needing to deal with the nitty gritty of the toolbar button.- Specified by:
getAttributeValueString
in interfaceAutoConfigurable
- Specified by:
getAttributeValueString
in interfaceTranslatable
- Overrides:
getAttributeValueString
in classMap
- Parameters:
key
- the name of the attribute. Will be one of those listed inMap.getAttributeNames()
- Returns:
- a String representation of the XML buildFile attribute with the given name. When initializing a module,
this String value will loaded from the XML and passed to
Map.setAttribute(java.lang.String, java.lang.Object)
. It is also frequently used for checking the current value of an attribute.
-
getView
Yes this LOOKS exactly the same as the method it overrides, but confusingly Map and PrivateMap each have *different* View classes sharing the same name. -
createParentFrame
Description copied from class:Map
Creates the top-level window for this map. Could be a JDialog or a JFrame depending on whether we are set to use a single window or have our own window.- Overrides:
createParentFrame
in classMap
- Returns:
- the top-level window containing this map
-
sideChanged
Description copied from class:Map
Takes action when the local player has switched sides. Because Map implementsPlayerRoster.SideChangeListener
, this method will automatically be called whenever the local player switches sides.- Specified by:
sideChanged
in interfacePlayerRoster.SideChangeListener
- Overrides:
sideChanged
in classMap
- Parameters:
oldSide
- side the local player is switching away fromnewSide
- side the local player is switching to
-
shouldDockIntoMainWindow
public boolean shouldDockIntoMainWindow()Description copied from class:Map
If this map shows with its own special button, it does not dock into the main window. Likewise if we have no combined window setting. Otherwise the *first* non-button-launched map we find will be the one we dock.- Overrides:
shouldDockIntoMainWindow
in classMap
- Returns:
- whether this map should dock into the main window
-
isAccessibleTo
Return true if the player playing the given side can access this map- See Also:
-
isVisibleTo
-
setup
public void setup(boolean show) Description copied from class:Map
When a game is started, create a top-level window, if none exists. When a game is ended, remove all boards from the map.- Specified by:
setup
in interfaceGameComponent
- Overrides:
setup
in classMap
- Parameters:
show
- true if a game is starting, false if a game is ending- See Also:
-
setBoards
-
getConfigureTypeName
-
getHelpFile
- Specified by:
getHelpFile
in interfaceConfigurable
- Overrides:
getHelpFile
in classMap
- Returns:
- a HelpFile describing how to use and configure this component
-
build
Description copied from class:Map
Builds the map's component hierarchy from a given XML element, or a null one is given initializes a brand new default "new map" hierarchy.
-