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:
AutoConfigurable, Buildable, Configurable, java.util.EventListener, java.awt.event.FocusListener, GameComponent, java.awt.event.MouseListener, java.awt.event.MouseMotionListener
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
static class PrivateMap.View
           
 
Nested classes inherited from class VASSAL.build.module.Map
 
Nested classes inherited from class VASSAL.build.AutoConfigurable
AutoConfigurable.Util
 
Field Summary
static java.lang.String SIDE
           
static java.lang.String USE_BOARDS
           
static java.lang.String VISIBLE
           
 
Fields inherited from class VASSAL.build.module.Map
ALLOW_MULTIPLE, boards, BUTTON_NAME, EDGE_HEIGHT, EDGE_WIDTH, edgeBuffer, HIGHLIGHT_COLOR, HIGHLIGHT_THICKNESS, highlighter, HOTKEY, launchButton, MARK_MOVED, markMovedOption, maxStacks, metrics, moreStacks, mouseListenerStack, multicaster, NAME, nstacks, picker, scroll, stack, theMap, toolBar, topWindow, USE_LAUNCH_BUTTON, useLaunchButton, zoom
 
Fields inherited from class VASSAL.build.AbstractConfigurable
changeSupport, config, name
 
Fields inherited from class VASSAL.build.AbstractBuildable
buildComponents
 
Fields inherited from interface VASSAL.build.Configurable
NAME_PROPERTY
 
Constructor Summary
PrivateMap()
           
 
Method Summary
 void addTo(Buildable b)
          Expects to be added to a GameModule.
 void build(org.w3c.dom.Element el)
          Build the object
 java.lang.String[] getAttributeDescriptions()
          Return an array of Strings describing the attributes of this object.
 java.lang.String[] getAttributeNames()
           
 java.lang.Class[] getAttributeTypes()
          Return the Class for the attributes of this object.
 java.lang.String getAttributeValueString(java.lang.String key)
          Called by the AbstractBuildable.getBuildElement(org.w3c.dom.Document) method to write the attributes into an XML element
static java.lang.String getConfigureTypeName()
           
 HelpFile getHelpFile()
           
 java.awt.Window getParentFrame()
           
 javax.swing.JComponent getView()
          Return the AWT component representing the map
 boolean isAccessibleTo(java.lang.String playerSide)
          Return true if the player playing the given side can access this map
 void setAttribute(java.lang.String key, java.lang.Object value)
          Called by the build(org.w3c.dom.Element) method, where value is the String value read by the XML attribute.
 void setBoards(java.util.Enumeration boardList)
          Set the boards for this map.
 void setup(boolean show)
          When a game is started, create a top-level window, if none exists.
 
Methods inherited from class VASSAL.build.module.Map
addDrawComponent, addLocalMouseListener, addPiece, appendToTitle, boundingBoxOf, centerAt, centerAt, clearMapBorder, componentCoordinates, componentRectangle, drawBoards, drawBoardsInRegion, drawDrawable, drawPieces, drawPiecesInRegion, ensureVisible, findBoard, findPiece, focusGained, focusLost, getAllBoards, getAllowableConfigureComponents, getAttributeVisibility, getBoardPicker, getEdgeBuffer, getHighlighter, getId, getMapName, getPieces, getPreferredSize, getRestoreCommand, getStackMetrics, getToolBar, getZoom, getZoomer, indexOf, isPiecesVisible, locationName, mapCoordinates, mapRectangle, mapSize, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, paint, paint, paintRegion, placeAt, placeOrMerge, popMouseListener, pushMouseListener, removeDrawComponent, removeFrom, removeLocalMouseListener, removePiece, repaint, repaint, repaint, reposition, scroll, selectionBoundsOf, setBoardBoundaries, setBoardPicker, setHighlighter, setID, setMapName, setPiecesVisible, setStackMetrics, setZoomer, snapTo
 
Methods inherited from class VASSAL.build.AbstractConfigurable
addPropertyChangeListener, getConfigureComponents, getConfigureName, getConfigurer, remove, setConfigureName
 
Methods inherited from class VASSAL.build.AbstractBuildable
add, getBuildComponents, getBuildElement, getComponents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface VASSAL.build.Configurable
addPropertyChangeListener, getConfigureComponents, getConfigureName, getConfigurer, remove
 
Methods inherited from interface VASSAL.build.Buildable
add, getBuildElement
 

Field Detail

VISIBLE

public static final java.lang.String VISIBLE
See Also:
Constant Field Values

SIDE

public static final java.lang.String SIDE
See Also:
Constant Field Values

USE_BOARDS

public static final java.lang.String USE_BOARDS
See Also:
Constant Field Values
Constructor Detail

PrivateMap

public PrivateMap()
Method Detail

getAttributeNames

public java.lang.String[] getAttributeNames()
Specified by:
getAttributeNames in interface AutoConfigurable
Overrides:
getAttributeNames in class Map
Returns:
an array of Strings giving all attributes of this Buildable component that will be written to/read from an XML element

getAttributeDescriptions

public java.lang.String[] getAttributeDescriptions()
Description copied from class: AbstractConfigurable
Return an array of Strings describing the attributes of this object. These strings are used as prompts in the Properties window for this object. The order of descriptions should be the same as the order of names in AbstractBuildable.getAttributeNames()

Specified by:
getAttributeDescriptions in interface AutoConfigurable
Overrides:
getAttributeDescriptions in class Map

getAttributeTypes

public java.lang.Class[] getAttributeTypes()
Description copied from class: AbstractConfigurable
Return the Class for the attributes of this object. Valid classes are: String, Integer, Double, Boolean, Image, Color, and KeyStroke The order of classes should be the same as the order of names in AbstractBuildable.getAttributeNames()

Specified by:
getAttributeTypes in interface AutoConfigurable
Overrides:
getAttributeTypes in class Map

setAttribute

public void setAttribute(java.lang.String key,
                         java.lang.Object value)
Description copied from interface: AutoConfigurable
Called by the Buildable.build(org.w3c.dom.Element) method, where value is the String value read by the XML attribute. Can also be called with Object value to set the attribute.

Specified by:
setAttribute in interface AutoConfigurable
Overrides:
setAttribute in class Map
Parameters:
key - the name of the attribute. Will be one of those listed in AbstractBuildable.getAttributeNames()

getAttributeValueString

public java.lang.String getAttributeValueString(java.lang.String key)
Description copied from interface: AutoConfigurable
Called by the Buildable.getBuildElement(org.w3c.dom.Document) method to write the attributes into an XML element

Specified by:
getAttributeValueString in interface AutoConfigurable
Overrides:
getAttributeValueString in class Map
Parameters:
key - the name of the attribute. Will be one of those listed in AbstractBuildable.getAttributeNames()

getParentFrame

public java.awt.Window getParentFrame()
Overrides:
getParentFrame in class Map
Returns:
the top-level window containing this map

isAccessibleTo

public boolean isAccessibleTo(java.lang.String playerSide)
Return true if the player playing the given side can access this map

See Also:
PlayerRoster

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 interface GameComponent
Overrides:
setup in class Map
See Also:
GameComponent

setBoards

public void setBoards(java.util.Enumeration boardList)
Description copied from class: Map
Set the boards for this map. Each map may contain more than one Board

Overrides:
setBoards in class Map

getView

public javax.swing.JComponent getView()
Description copied from class: Map
Return the AWT component representing the map

Overrides:
getView in class Map

getConfigureTypeName

public static java.lang.String getConfigureTypeName()

getHelpFile

public HelpFile getHelpFile()
Specified by:
getHelpFile in interface Configurable
Overrides:
getHelpFile in class Map
Returns:
a HelpFilte describing how to use and configure this component

build

public void build(org.w3c.dom.Element el)
Description copied from interface: Buildable
Build the object

Specified by:
build in interface Buildable
Overrides:
build in class Map
Parameters:
el - the XML element containing the object data

addTo

public void addTo(Buildable b)
Description copied from class: Map
Expects to be added to a GameModule. Determines a unique id for this map. Registers itself as KeyStrokeSource. Registers itself as a GameComponent. Registers itself as a drop target and drag source

Specified by:
addTo in interface Buildable
Overrides:
addTo in class Map
See Also:
Map.getId(), DragBuffer