Class HandMetrics
java.lang.Object
VASSAL.search.AbstractImageFinder
VASSAL.build.AbstractBuildable
VASSAL.build.AbstractConfigurable
VASSAL.build.module.map.StackMetrics
VASSAL.build.module.map.HandMetrics
- All Implemented Interfaces:
AutoConfigurable
,Buildable
,Configurable
,PropertyNameSource
,ValidityChecker
,Translatable
,Auditable
,ImageSearchTarget
,SearchTarget
Handles the drawing of cards in a
PlayerHand
.
Lays out the cards horizontally with no overlap and even spacing.-
Nested Class Summary
Nested classes/interfaces inherited from interface VASSAL.build.AutoConfigurable
AutoConfigurable.Util
-
Field Summary
Fields inherited from class VASSAL.build.module.map.StackMetrics
blankColor, BOTTOM_KEY, bottomKey, COLOR, DEFAULT_EXSEP_X, DEFAULT_EXSEP_Y, DEFAULT_UNEXSEP_X, DEFAULT_UNEXSEP_Y, disabled, DISABLED, DOWN_KEY, downKey, EXSEP_X, EXSEP_Y, exSepX, exSepY, map, selectedVisible, TOP_KEY, topKey, UNEXSEP_X, UNEXSEP_Y, unexSepX, unexSepY, unselectedVisible, UP_KEY, upKey
Fields inherited from class VASSAL.build.AbstractConfigurable
changeSupport, config, localizedName, myI18nData, name
Fields inherited from class VASSAL.build.AbstractBuildable
buildComponents, validator
Fields inherited from interface VASSAL.build.Configurable
NAME_PROPERTY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Different instances of StackMetrics may render aStack
in different ways.void
Draw only those pieces in the target stack whose boundingBoxes fall within the given visibleRect This method is considerably faster than the other draw method.Place a GamePiece on top of another GamePiece Create/remove stacks as necessary, even if stacking is disabled for this instanceprotected void
nextPosition
(Point currentPos, Rectangle currentBounds, Point nextPos, Rectangle nextBounds, int dx, int dy) Methods inherited from class VASSAL.build.module.map.StackMetrics
addTo, createStack, createStack, drawUnexpanded, getAllowableConfigureComponents, getAttributeDescriptions, getAttributeNames, getAttributeTypes, getAttributeValueString, getAttributeVisibility, getBlankColor, getConfigureName, getConfigureTypeName, getContents, getHelpFile, getMoveBottomKey, getMoveDownKey, getMoveTopKey, getMoveUpKey, isMandatory, isStackingEnabled, isUnique, placeOrMerge, relativePosition, removeFrom, setAttribute
Methods inherited from class VASSAL.build.AbstractConfigurable
add, addPropertyChangeListener, getConfigureComponents, getConfigurer, getExpressionList, getFormattedStringList, getI18nData, getI18nPrefix, getLocalizedConfigureName, getMenuTextList, getNamedKeyStrokeList, getPropertyList, getTypeName, remove, removePropertyChangeListener, setAllAttributesUntranslatable, setAttributeTranslatable, setConfigureName
Methods inherited from class VASSAL.build.AbstractBuildable
addImageNamesRecursively, build, buildString, getAllDescendantComponentsOf, getAncestor, getBuildables, getBuildComponents, getBuildElement, getComponents, getComponentsOf, getNonFolderAncestor, getPropertyNames, setAncestor, validate
Methods inherited from class VASSAL.search.AbstractImageFinder
addLocalImageNames, getAllImageNames, getLocalImageNames
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface VASSAL.script.expression.Auditable
getComponentName, getComponentTypeName
Methods inherited from interface VASSAL.build.Buildable
build, getBuildElement, isMovable
-
Constructor Details
-
HandMetrics
public HandMetrics()
-
-
Method Details
-
draw
Description copied from class:StackMetrics
Different instances of StackMetrics may render aStack
in different ways. The default algorithm is: If not expanded, all but the top visible GamePiece is drawn as a white square with size given byGamePiece.getShape()
. The separation between GamePieces is given byStackMetrics.relativePosition(VASSAL.counters.Stack, VASSAL.counters.GamePiece)
If expanded, all GamePieces are drawn with separation given byStackMetrics.relativePosition(VASSAL.counters.Stack, VASSAL.counters.GamePiece)
. GamePiece that are selected are drawn in front of other GamePieces, even those above them in the stack.- Overrides:
draw
in classStackMetrics
-
draw
public void draw(Stack stack, Point location, Graphics g, Map map, double zoom, Rectangle visibleRect) Description copied from class:StackMetrics
Draw only those pieces in the target stack whose boundingBoxes fall within the given visibleRect This method is considerably faster than the other draw method.- Overrides:
draw
in classStackMetrics
- Parameters:
stack
-location
- the location of the stack in component coordinatesg
-zoom
-visibleRect
- the visible rectangle in component coordinates
-
nextPosition
protected void nextPosition(Point currentPos, Rectangle currentBounds, Point nextPos, Rectangle nextBounds, int dx, int dy) - Overrides:
nextPosition
in classStackMetrics
-
merge
Description copied from class:StackMetrics
Place a GamePiece on top of another GamePiece Create/remove stacks as necessary, even if stacking is disabled for this instance- Overrides:
merge
in classStackMetrics
- Parameters:
fixed
- the GamePiece defining the location and contents of the existing stackmoving
- the GamePiece that will be merged into the stack- Returns:
- a Command that accomplishes this task
-