Package VASSAL.build.module.map
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, upKeyFields 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 TypeMethodDescriptionvoidDifferent instances of StackMetrics may render aStackin different ways.voidDraw 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 voidnextPosition(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, setAttributeMethods inherited from class VASSAL.build.AbstractConfigurable
add, addPropertyChangeListener, getConfigureComponents, getConfigurer, getExpressionList, getFormattedStringList, getI18nData, getI18nPrefix, getLocalizedConfigureName, getMenuTextList, getNamedKeyStrokeList, getPropertyList, getTypeName, remove, removePropertyChangeListener, setAllAttributesUntranslatable, setAttributeTranslatable, setConfigureNameMethods inherited from class VASSAL.build.AbstractBuildable
addImageNamesRecursively, build, buildString, getAllDescendantComponentsOf, getAncestor, getBuildables, getBuildComponents, getBuildElement, getComponents, getComponentsOf, getNonFolderAncestor, getPropertyNames, setAncestor, validateMethods inherited from class VASSAL.search.AbstractImageFinder
addLocalImageNames, getAllImageNames, getLocalImageNamesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface VASSAL.script.expression.Auditable
getComponentName, getComponentTypeNameMethods inherited from interface VASSAL.build.Buildable
build, getBuildElement, isMovable
-
Constructor Details
-
HandMetrics
public HandMetrics()
-
-
Method Details
-
draw
Description copied from class:StackMetricsDifferent instances of StackMetrics may render aStackin 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:
drawin classStackMetrics
-
draw
public void draw(Stack stack, Point location, Graphics g, Map map, double zoom, Rectangle visibleRect) Description copied from class:StackMetricsDraw 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:
drawin 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:
nextPositionin classStackMetrics
-
merge
Description copied from class:StackMetricsPlace a GamePiece on top of another GamePiece Create/remove stacks as necessary, even if stacking is disabled for this instance- Overrides:
mergein 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
-