Package VASSAL.build.module
Class PrivateMap
java.lang.Object
VASSAL.build.AbstractBuildable
VASSAL.build.AbstractConfigurable
VASSAL.build.module.Map
VASSAL.build.module.PrivateMap
- All Implemented Interfaces:
DropTargetListener,MouseListener,MouseMotionListener,EventListener,AutoConfigurable,Buildable,Configurable,GameComponent,PlayerRoster.SideChangeListener,MutablePropertiesContainer,PropertyNameSource,PropertySource,ValidityChecker,Translatable,ToolBarComponent,UniqueIdManager.Identifyable
- Direct Known Subclasses:
PlayerHand
public class PrivateMap extends Map
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 Modifier and Type Class Description static classPrivateMap.ViewNested classes/interfaces inherited from class VASSAL.build.module.Map
Map.ChangeFormatConfig, Map.CreateFormatConfig, Map.IconConfig, Map.InsetLayout, Map.Merger, Map.MoveToFormatConfig, Map.MoveWithinFormatConfig, Map.UnmovedIconConfigNested classes/interfaces inherited from interface VASSAL.build.AutoConfigurable
AutoConfigurable.UtilNested classes/interfaces inherited from interface VASSAL.build.module.properties.MutablePropertiesContainer
MutablePropertiesContainer.Impl -
Field Summary
Fields Modifier and Type Field Description protected String[]ownersstatic StringSIDEprotected Mapsurrogatestatic StringUSE_BOARDSstatic StringVISIBLEprotected booleanvisibleToAllFields 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, dragGestureListener, drawComponents, dx, dy, EDGE_HEIGHT, EDGE_WIDTH, edgeBuffer, hideCounters, HIGHLIGHT_COLOR, HIGHLIGHT_THICKNESS, highlighter, highlighters, HOTKEY, ICON, idMgr, launchButton, layeredPane, LOCATION, MAIN_WINDOW_HEIGHT, mainWindowDock, MAP_NAME, mapID, mapName, MARK_MOVED, MARK_UNMOVED_ICON, MARK_UNMOVED_TEXT, MARK_UNMOVED_TOOLTIP, markMovedOption, markUnmovedIcon, 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, picker, PIECE_NAME, pieceMover, pieceOpacity, pieces, PREFERRED_EDGE_DELAY, PREFERRED_EDGE_SCROLL_DELAY, propsContainer, repaintOnPropertyChange, saveKeyListeners, scroll, SCROLL_ZONE, scroller, SUPPRESS_AUTO, sx, sy, theMap, toolBar, tooltip, TOOLTIP, USE_LAUNCH_BUTTON, useLaunchButton, useLaunchButtonEdit, visibilityCondition, zoomFields inherited from class VASSAL.build.AbstractConfigurable
changeSupport, config, localizedName, myI18nData, nameFields inherited from class VASSAL.build.AbstractBuildable
buildComponents, validatorFields inherited from interface VASSAL.build.Configurable
NAME_PROPERTY -
Constructor Summary
Constructors Constructor Description PrivateMap() -
Method Summary
Modifier and Type Method Description voidbuild(Element el)Build this component by getting all XML attributes of the XML element and callingAbstractBuildable.setAttribute(java.lang.String, java.lang.Object)with the String value of the attributeprotected WindowcreateParentFrame()String[]getAttributeDescriptions()Return an array of Strings describing the attributes of this object.String[]getAttributeNames()Lists all the buildFile (XML) attribute names for this component.Class<?>[]getAttributeTypes()Return the Class for the buildFile (XML) attributes of this component.StringgetAttributeValueString(String key)Called by theBuildable.getBuildElement(org.w3c.dom.Document)method to write the attributes into an XML elementstatic StringgetConfigureTypeName()HelpFilegetHelpFile()JComponentgetView()booleanisAccessibleTo(String playerSide)Return true if the player playing the given side can access this mapbooleanisVisibleTo(String playerSide)voidsetAttribute(String key, Object value)Sets a buildFile (XML) attribute value for this component.voidsetBoards(Collection<Board> c)Set the boards for this map.voidsetBoards(Enumeration<Board> boardList)Deprecated, for removal: This API element is subject to removal in a future version.voidsetup(boolean show)When a game is started, create a top-level window, if none exists.booleanshouldDockIntoMainWindow()voidsideChanged(String oldSide, String newSide)Methods inherited from class VASSAL.build.module.Map
addDrawComponent, addHighlighter, 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, getAllBoards, getAllMaps, getAllowableConfigureComponents, getAllPieces, getAttributeVisibility, getBoardByName, getBoardCount, getBoardPicker, getBoards, getChangeFormat, getComponent, getCreateFormat, getDeckNameAt, getDeckNameContaining, getDefaultWindowTitle, getDragGestureListener, getEdgeBuffer, getHighlighter, getHighlighters, getId, getIdentifier, getLayeredPane, getLocalizedDeckNameAt, getLocalizedMapName, getLocalizedProperty, getLocation, getLocation, getMapById, getMapList, getMapName, getMoveKey, getMoveToFormat, getMoveWithinFormat, getMutablePropertiesContainerId, getMutableProperty, getPieceCollection, getPieceOpacity, getPieces, getPreferredSize, getProperty, getRestoreCommand, getStackMetrics, getToolBar, getZoom, getZoomer, indexOf, isChangeReportingEnabled, isLocationRestricted, 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, positionOf, pushMouseListener, removeDrawComponent, removeFrom, removeHighlighter, removeLocalMouseListener, removeMutableProperty, removePiece, repaint, repaint, repaint, reposition, scale, scale, scale, scroll, scrollAtEdge, selectionBoundsOf, setActiveMap, setBoardBoundaries, setBoardPicker, setChangeReportingEnabled, setDragGestureListener, setHighlighter, setId, setMapName, setPieceCollection, setPieceMover, setPieceOpacity, setPiecesVisible, setStackMetrics, setZoomer, snapTo, translateEventMethods inherited from class VASSAL.build.AbstractConfigurable
add, addPropertyChangeListener, getConfigureComponents, getConfigureName, getConfigurer, getI18nData, getI18nPrefix, getLocalizedConfigureName, remove, removePropertyChangeListener, setAllAttributesUntranslatable, setAttributeTranslatable, setConfigureNameMethods inherited from class VASSAL.build.AbstractBuildable
getAllDescendantComponents, getAllDescendantComponentsOf, getBuildables, getBuildComponents, getBuildElement, getComponents, getComponentsOf, getPropertyNames, validateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface VASSAL.build.Buildable
add, getBuildElementMethods inherited from interface VASSAL.build.Configurable
addPropertyChangeListener, getConfigureComponents, getConfigureName, getConfigurer, removeMethods inherited from interface VASSAL.i18n.Translatable
getI18nDataMethods inherited from interface VASSAL.tools.UniqueIdManager.Identifyable
getConfigureName
-
Field Details
-
owners
-
visibleToAll
protected boolean visibleToAll -
surrogate
-
VISIBLE
- See Also:
- Constant Field Values
-
SIDE
- See Also:
- Constant Field Values
-
USE_BOARDS
- See Also:
- Constant Field Values
-
-
Constructor Details
-
PrivateMap
public PrivateMap()
-
-
Method Details
-
getAttributeNames
Description copied from class:AbstractBuildableLists 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:
getAttributeNamesin interfaceAutoConfigurable- Overrides:
getAttributeNamesin classMap- Returns:
- a list of all buildFile (XML) attribute names for this component
-
getAttributeDescriptions
Description copied from interface:AutoConfigurableReturn 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:
getAttributeDescriptionsin interfaceAutoConfigurable- Overrides:
getAttributeDescriptionsin 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()
-
getAttributeTypes
Description copied from class:AbstractConfigurableReturn 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 ofAutoConfigurerwill 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()- Specified by:
getAttributeTypesin interfaceAutoConfigurable- Overrides:
getAttributeTypesin classMap
-
setAttribute
Description copied from class:AbstractBuildableSets a buildFile (XML) attribute value for this component. Thekeyparameter will be one of those listed inAbstractBuildable.getAttributeNames(). If thevalueparameter is a String, it will be the value returned byAbstractBuildable.getAttributeValueString(java.lang.String)for the samekey. If the implementing class extendsAbstractConfigurable, thenvaluewill be an instance of the corresponding Class listed inAbstractConfigurable.getAttributeTypes()- Specified by:
setAttributein interfaceAutoConfigurable- Specified by:
setAttributein interfaceTranslatable- Overrides:
setAttributein classMap- Parameters:
key- the name of the attribute. Will be one of those listed inAbstractBuildable.getAttributeNames()value- If thevalueparameter is a String, it will be the value returned byAbstractBuildable.getAttributeValueString(java.lang.String)for the samekey. If the implementing class extendsAbstractConfigurable, thenvaluecan also be an instance of the corresponding Class listed inAbstractConfigurable.getAttributeTypes()
-
getAttributeValueString
Description copied from interface:AutoConfigurableCalled by theBuildable.getBuildElement(org.w3c.dom.Document)method to write the attributes into an XML element- Specified by:
getAttributeValueStringin interfaceAutoConfigurable- Specified by:
getAttributeValueStringin interfaceTranslatable- Overrides:
getAttributeValueStringin classMap- Parameters:
key- the name of the attribute. 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
AbstractBuildable.setAttribute(java.lang.String, java.lang.Object).
-
getView
-
createParentFrame
- Overrides:
createParentFramein classMap- Returns:
- the top-level window containing this map
-
sideChanged
- Specified by:
sideChangedin interfacePlayerRoster.SideChangeListener- Overrides:
sideChangedin classMap
-
shouldDockIntoMainWindow
public boolean shouldDockIntoMainWindow()- Overrides:
shouldDockIntoMainWindowin classMap
-
isAccessibleTo
Return true if the player playing the given side can access this map- See Also:
PlayerRoster
-
isVisibleTo
-
setup
public void setup(boolean show)Description copied from class:MapWhen 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:
setupin interfaceGameComponent- Overrides:
setupin classMap- Parameters:
show- if true, a game is starting. If false, then a game is ending- See Also:
GameComponent
-
setBoards
Description copied from class:MapSet the boards for this map. Each map may contain more than oneBoard. -
setBoards
@Deprecated(since="2020-08-06", forRemoval=true) public void setBoards(Enumeration<Board> boardList)Deprecated, for removal: This API element is subject to removal in a future version.UsesetBoards(Collection)instead.Description copied from class:MapSet the boards for this map. Each map may contain more than oneBoard. -
getConfigureTypeName
-
getHelpFile
- Specified by:
getHelpFilein interfaceConfigurable- Overrides:
getHelpFilein classMap- Returns:
- a HelpFilte describing how to use and configure this component
-
build
Description copied from class:AbstractBuildableBuild this component by getting all XML attributes of the XML element and callingAbstractBuildable.setAttribute(java.lang.String, java.lang.Object)with the String value of the attribute
-
setBoards(Collection)instead.