Package VASSAL.tools.imports.adc2
Class MapBoard
java.lang.Object
VASSAL.tools.imports.Importer
VASSAL.tools.imports.adc2.MapBoard
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
A layout consisting of squares in a checkerboard pattern (i.e. each square has four neighbours).protected class
A layout consisting of squares in which every second column is shifted downward by one half width.protected class
A layout consisting of squares in which every second row is shifted to the right by one half-width.protected class
Mapboard element based on terrain symbol fromSymbolSet
.protected class
A line from a hex edge to the centre as in the spoke of a wheel.protected class
The edges of a hex or square.protected class
Hexes aligned along rows.protected class
A layout in which every second row is offset by one-half hex or square.protected class
How the hexes or squares are organized on the map board.protected class
A drawable line such as a river, border, or road.protected static class
Line styles for hex sides and hex lines.protected static enum
line patter such as dashed or dotted or solidprotected class
Symbol that is placed in every hex.protected class
Anything that can be drawn on the map and is associated with a particular hex.protected class
protected class
Defines the numbering system for an ADC2 mapboard.protected class
Place name element which includes not only the name itself, but the font and style that it should be drawn with.protected static enum
protected class
Hexes in columns.protected class
A layout in which every second column is offset--either hexes or squares. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static Font
getDefaultFont
(int size, int font) Get a font based on size and font index.protected MapBoard.Layout
protected MapBoard.LineDefinition
getLineDefinition
(int index) Returns the LineDefinition object corresponding to the given index.boolean
Determine whether the file is valid for the given importer.protected void
The method that actually loads the file and creates the classes containing information needed for the archive.protected void
Attributes are tertiary symbols, any number of which can be attached to a specific hex.protected void
Read primary and secondary symbol information.protected void
Hex lines are like spokes of the hex and are typically used for things like roads or other elements that traverse from hex to hex.protected void
Read in information on hex sheets which define the hex numbering systems.protected void
Information about hex sides which are used for things like rivers, etc. is read in.protected void
Information about the width, colour and style of hex sides and hex lines is read in.protected void
Read what order to draw the lines in.protected void
Read symbol that is drawn on all hexes.protected void
Block of flags to indicate which elements are actually displayed.protected void
Read and set the order of the drawn element types.protected void
Read information on hex numbering.protected void
Optional labels that can be added to hexes.protected void
Many maps are actually just scanned images held in a separate file.protected void
The colour to fill before any elements are drawn.protected void
Crude version information.protected void
writePlaceNames
(GameModule module) Write out place name information as non-stackable pieces which can be searched via the piece inventory.void
Create the VASSAL module based on the classes created byload
.Methods inherited from class VASSAL.tools.imports.Importer
forceExtension, getExtension, getFileName, getLayeredPieceCollection, getMainMap, getUniqueImageFileName, getUniqueImageFileName, importFile, insertComponent, readNullTerminatedString, readNullTerminatedString, readWindowsFileName, stripExtension
-
Constructor Details
-
MapBoard
public MapBoard()
-
-
Method Details
-
getDefaultFont
Get a font based on size and font index. If this font has not already been created, then it will be generated. Can be reused later if the same font was already created.- Parameters:
size
- Font size.font
- Font index. See MapBoard.java for format.
-
readScannedMapLayoutFile
Many maps are actually just scanned images held in a separate file. The images are often broken up into sections. An extra file describes how the images are pasted together. This function pieces the images together using theGraphics2D
objectg
.- Throws:
IOException
-
readMapBoardOverlaySymbolBlock
Read symbol that is drawn on all hexes.- Throws:
IOException
-
readMapItemDrawFlagBlock
Block of flags to indicate which elements are actually displayed.- Throws:
IOException
-
readAttributeBlock
Attributes are tertiary symbols, any number of which can be attached to a specific hex. Otherwise, they function the same as primary or secondary hex symbols.- Throws:
IOException
-
readHexDataBlock
Read primary and secondary symbol information. Each hex may only have one of each. Additional symbols must be tertiary attributes.- Throws:
IOException
-
readHexLineBlock
Hex lines are like spokes of the hex and are typically used for things like roads or other elements that traverse from hex to hex. The direction of each spoke is encoded as bit flags, and while ADC2 could encode each hex with only one record, modules typically have a separate record for every spoke resulting in data inflation.- Throws:
IOException
-
readHexSideBlock
Information about hex sides which are used for things like rivers, etc. is read in.- Throws:
IOException
-
readLineDefinitionBlock
Information about the width, colour and style of hex sides and hex lines is read in.- Throws:
IOException
-
readLineDrawPriorityBlock
Read what order to draw the lines in.- Throws:
IOException
-
readMapSheetBlock
Read information on hex numbering.- Throws:
IOException
-
readHexNumberingBlock
Read in information on hex sheets which define the hex numbering systems. This represents supplemental information--some map sheet info occurs earlier in the file. Only the coordinates of the top-left corner are read in here.- Throws:
IOException
-
readMapItemDrawingOrderBlock
Read and set the order of the drawn element types.- Throws:
IOException
-
readVersionBlock
Crude version information. Comes near the end of the file! Actually it's just a flag to indicate whether the version is less than 2.08. In version 2.08, the hexes are abutted slightly differently.- Throws:
IOException
-
readTableColorBlock
The colour to fill before any elements are drawn. The fast-scroll flag is also read.- Throws:
IOException
-
readPlaceNameBlock
Optional labels that can be added to hexes. Can also include a symbol that can be added with the label.- Throws:
IOException
-
getLayout
- Returns:
- The Layout object corresponding to this imported map.
-
getLineDefinition
Returns the LineDefinition object corresponding to the given index. -
load
Description copied from class:Importer
The method that actually loads the file and creates the classes containing information needed for the archive. The archive is written inwriteToArchive
.- Overrides:
load
in classImporter
- Parameters:
f
- The base file to be imported.- Throws:
IOException
- oops
-
writeToArchive
Description copied from class:Importer
Create the VASSAL module based on the classes created byload
. This should not be called directly but ratherimportFile
.- Specified by:
writeToArchive
in classImporter
- Throws:
IOException
- oops
-
writePlaceNames
Write out place name information as non-stackable pieces which can be searched via the piece inventory.- Parameters:
module
- - Game module to write to.
-
isValidImportFile
Description copied from class:Importer
Determine whether the file is valid for the given importer.- Specified by:
isValidImportFile
in classImporter
- Parameters:
f
- File- Returns:
true
iff
is a valid file for this type.- Throws:
IOException
- oops
-