Class Board
java.lang.Object
VASSAL.search.AbstractImageFinder
VASSAL.build.AbstractBuildable
VASSAL.build.AbstractConfigurable
VASSAL.build.module.map.boardPicker.Board
- All Implemented Interfaces:
AutoConfigurable,Buildable,Configurable,GridContainer,PropertyNameSource,ValidityChecker,Translatable,ImageSearchTarget,SearchTarget
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDeprecated, for removal: This API element is subject to removal in a future version.Nested classes/interfaces inherited from interface VASSAL.build.AutoConfigurable
AutoConfigurable.Util -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ImageDeprecated, for removal: This API element is subject to removal in a future version.protected SourceOpprotected StringDeprecated, for removal: This API element is subject to removal in a future version.protected Rectangleprotected booleanprotected Colorstatic Stringprotected booleanprotected MapGridstatic Stringstatic Stringprotected Stringprotected doubleprotected Mapstatic StringA Board is a piece of a Map.protected Pointprotected booleanprotected booleanstatic Stringprotected ScaleOpstatic StringFields 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 -
Method Summary
Modifier and TypeMethodDescriptionvoidClasses extending AbstractImageFinder should override this method in order to add the names of any image files they use to the collection.voidAdds this component to its parent.bounds()voidcleanUp()Deprecated, for removal: This API element is subject to removal in a future version.Board images are removed automatically now, when under memory pressure.booleancopy()voidvoiddrawRegion(Graphics g, Point location, Rectangle visibleRect, double zoom, Component obs)protected voiddrawTile(Graphics g, Future<BufferedImage> fim, int tx, int ty, Component obs)fileName()protected voidDeprecated, for removal: This API element is subject to removal in a future version.Bounds are now fixed automagically byImageOps.voidfixImage()Deprecated, for removal: This API element is subject to removal in a future version.Images are now fixed automagically usingImageOps.voidDeprecated, for removal: This API element is subject to removal in a future version.Images are now fixed automagically usingImageOps.Class<?>[]String[]Return an array of Strings describing the attributes of this object.String[]Lists all the buildFile (XML) attribute names for this component.Class<?>[]Return the Class for the attributes of this object.Called by theBuildable.getBuildElement(org.w3c.dom.Document)method to write the attributes into an XML elementgetAttributeVisibility(String name)By default, all attributes are visiblegetBoard()static StringgetGrid()doublegetMap()getName()getScaledImage(double zoom, Component obs)Deprecated, for removal: This API element is subject to removal in a future version.getSize()If this board is reversed, return the location in reversed coordinatesbooleanbooleanIf this board is reversed, return the location in un-reversed coordinateslocationName(Point p)voidremoveFrom(Buildable b)Remove this component from its parentvoidremoveGrid(MapGrid grid)voidsetAttribute(String key, Object val)Sets a buildFile (XML) attribute value for this component.voidsetCacheGrid(boolean cg)voidvoidsetLocation(int x, int y)Set the location of this boardvoidsetMagnification(double magnification)voidvoidsetReversed(boolean val)voidtranslate(int x, int y)Translate the location of the board by the given number of pixelsMethods inherited from class VASSAL.build.AbstractConfigurable
add, addPropertyChangeListener, getConfigureComponents, getConfigureName, getConfigurer, getExpressionList, getFormattedStringList, getI18nData, getI18nPrefix, getLocalizedConfigureName, getMenuTextList, getNamedKeyStrokeList, getPropertyList, remove, removePropertyChangeListener, setAllAttributesUntranslatable, setAttributeTranslatable, setConfigureNameMethods inherited from class VASSAL.build.AbstractBuildable
addImageNamesRecursively, build, getAllDescendantComponents, getAllDescendantComponentsOf, getBuildables, getBuildComponents, getBuildElement, getComponents, getComponentsOf, getPropertyNames, validateMethods inherited from class VASSAL.search.AbstractImageFinder
getAllImageNames, getLocalImageNamesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface VASSAL.build.Buildable
build, getBuildElement
-
Field Details
-
NAME
A Board is a piece of a Map. A Map can cantain a set of boards layed out in a rectangular grid.- See Also:
- Constant Field Values
-
IMAGE
- See Also:
- Constant Field Values
-
WIDTH
- See Also:
- Constant Field Values
-
HEIGHT
- See Also:
- Constant Field Values
-
COLOR
- See Also:
- Constant Field Values
-
REVERSIBLE
- See Also:
- Constant Field Values
-
pos
-
boundaries
-
imageFile
-
reversible
protected boolean reversible -
reversed
protected boolean reversed -
fixedBoundaries
protected boolean fixedBoundaries -
color
-
grid
-
map
-
magnification
protected double magnification -
cacheGrid
protected boolean cacheGrid -
boardName
Deprecated, for removal: This API element is subject to removal in a future version. -
boardImage
Deprecated, for removal: This API element is subject to removal in a future version. -
boardImageOp
-
scaledImageOp
-
-
Constructor Details
-
Board
public Board()
-
-
Method Details
-
getMap
- Returns:
- this
Board'sMap. Until a game is started that is using this board, the map will be null.
-
setCacheGrid
public void setCacheGrid(boolean cg) -
setMap
-
getLocalizedName
-
getName
-
addTo
Description copied from interface:BuildableAdds this component to its parent. In order to make Buildable objects extensible, the child is responsible for adding itself to the parent. That way, Buildable subcomponents can be defined in an extension package without needing to modify the containing class. -
removeFrom
Description copied from interface:ConfigurableRemove this component from its parent- Specified by:
removeFromin interfaceConfigurable
-
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- Specified by:
getAttributeNamesin classAbstractBuildable- 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- Specified by:
getAttributeDescriptionsin classAbstractConfigurable- 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()
-
getConfigureTypeName
-
getAttributeTypes
Description copied from interface:AutoConfigurableReturn the Class for the attributes of this object. Valid classes are: String, Integer, Double, Boolean, Image, File, Color, and KeyStroke- Specified by:
getAttributeTypesin interfaceAutoConfigurable- Specified by:
getAttributeTypesin classAbstractConfigurable- 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
AutoConfigurerwill 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()
-
getAttributeVisibility
Description copied from class:AbstractConfigurableBy default, all attributes are visible- Specified by:
getAttributeVisibilityin interfaceAutoConfigurable- Overrides:
getAttributeVisibilityin classAbstractConfigurable- Parameters:
name- Name (key) of one of this component's attributes- Returns:
- a
VisibilityConditionfor this attribute, or null if attribute should always be visible.
-
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- Specified by:
getAttributeValueStringin classAbstractBuildable- Parameters:
key- the name of the attribute. Will be one of those listed inAbstractBuildable.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
AbstractBuildable.setAttribute(java.lang.String, java.lang.Object). It is also frequently used for checking the current value of an attribute.
-
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- Specified by:
setAttributein classAbstractBuildable- Parameters:
key- the name of the attribute. Will be one of those listed inAbstractBuildable.getAttributeNames()val- 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()
-
getAllowableConfigureComponents
- Specified by:
getAllowableConfigureComponentsin interfaceConfigurable- Returns:
- a list of valid sub-component Classes. If a Class
appears in this list, then instances of that class may be added
to this component from the Editor's
ConfigureTreewindow by right-clicking on the component and selecting the appropriate "Add" option.
-
draw
-
drawTile
-
drawRegion
-
getScaledImage
@Deprecated(since="2020-08-06", forRemoval=true) public Image getScaledImage(double zoom, Component obs)Deprecated, for removal: This API element is subject to removal in a future version. -
setReversed
public void setReversed(boolean val) -
isReversed
public boolean isReversed() -
localCoordinates
If this board is reversed, return the location in un-reversed coordinates -
globalCoordinates
If this board is reversed, return the location in reversed coordinates -
setGrid
- Specified by:
setGridin interfaceGridContainer
-
removeGrid
- Specified by:
removeGridin interfaceGridContainer
-
getBoard
- Specified by:
getBoardin interfaceGridContainer
-
getSize
- Specified by:
getSizein interfaceGridContainer
-
contains
- Specified by:
containsin interfaceGridContainer
-
getGrid
-
copy
-
fixImage
Deprecated, for removal: This API element is subject to removal in a future version.Images are now fixed automagically usingImageOps. -
fixImage
Deprecated, for removal: This API element is subject to removal in a future version.Images are now fixed automagically usingImageOps. -
locationName
-
localizedLocationName
-
snapTo
-
isLocationRestricted
- Returns:
- true if the given point may not be a local location. I.e., if this grid will attempt to snap it to the nearest grid location.
-
fileName
-
relativePosition
- Returns:
- Position of this board relative to the other boards (0,0) is the upper left, (0,1) is to the right, etc.
-
bounds
- Returns:
- The (read-only) boundaries of this Board within the overall Map
-
fixBounds
Deprecated, for removal: This API element is subject to removal in a future version.Bounds are now fixed automagically byImageOps. -
translate
public void translate(int x, int y)Translate the location of the board by the given number of pixels- See Also:
bounds()
-
setLocation
public void setLocation(int x, int y)Set the location of this board- See Also:
bounds()
-
getHelpFile
- Specified by:
getHelpFilein interfaceConfigurable- Returns:
- a HelpFile describing how to use and configure * this component
-
cleanUp
Deprecated, for removal: This API element is subject to removal in a future version.Board images are removed automatically now, when under memory pressure.Removes board images from theDataArchivecache -
getMagnification
public double getMagnification() -
setMagnification
public void setMagnification(double magnification) -
addLocalImageNames
Description copied from class:AbstractImageFinderClasses extending AbstractImageFinder should override this method in order to add the names of any image files they use to the collection.- Specified by:
addLocalImageNamesin interfaceImageSearchTarget- Overrides:
addLocalImageNamesin classAbstractImageFinder- Parameters:
s- Collection to add image names to
-
Boardimages, which is now handled automatically by the cache.