Class Map

java.lang.Object
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:
PrivateMap, WidgetMap

The Map is the main component for displaying and containing GamePieces during play. Pieces are displayed on the map's Board(s) and moved by clicking and dragging. Keyboard events are forwarded to selected pieces. Multiple map windows are supported in a single game, with dragging between windows allowed. To a map's Board subcomponent(s), various forms of grid can be added: (ZonedGrid (aka Multi-zone Grid), HexGrid, SquareGrid (aka Rectangular Grid), and RegionGrid (aka Irregular Grid). These can be used to determine where pieces are allowed to move, and also for filling properties (e.g. LocationName, CurrentZone, CurrentBoard, CurrentMap) to allow the module to keep track of pieces and react to their movements. A Map may contain many different Buildable subcomponents. Components which are addable uniquely to a Map are contained in the VASSAL.build.module.map package. Some of the most common Map subcomponents include Zoomer for Zoom Capability, CounterDetailViewer aka Mouse-over Stack Viewer, HidePiecesButton, and SelectionHighlighters. Map also contain several critical subcomponents which are automatically added and are not configurable at the module level. These include PieceMover which handles dragging and dropping of pieces, KeyBufferer which tracks which pieces are currently "selected" and forwards key commands to them, MenuDisplayer which listens for "right clicks" and provides "context menu" services, and StackMetrics which handles the "stacking" of game pieces.