Package VASSAL.build.module.map
Class DrawPile
java.lang.Object
VASSAL.build.AbstractBuildable
VASSAL.build.AbstractConfigurable
VASSAL.build.module.map.SetupStack
VASSAL.build.module.map.DrawPile
- All Implemented Interfaces:
AutoConfigurable,Buildable,Configurable,GameComponent,PropertyNameSource,PropertySource,ValidityChecker,Translatable,UniqueIdManager.Identifyable
public class DrawPile extends SetupStack implements PropertySource, PropertyNameSource
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDrawPile.AssignedDeckPromptgenerates a prompt with the names of all decks already definedstatic classDrawPile.FormattedStringConfigstatic classDrawPile.PiecePropertyConfigstatic classDrawPile.PromptNested classes/interfaces inherited from class VASSAL.build.module.map.SetupStack
SetupStack.OwningBoardPrompt, SetupStack.StackConfigurer, SetupStack.ViewNested classes/interfaces inherited from interface VASSAL.build.AutoConfigurable
AutoConfigurable.Util -
Field Summary
Fields inherited from class VASSAL.build.module.map.SetupStack
COMMAND_PREFIX, configureButton, DEFAULT_DUMMY_SIZE, DEFAULT_SIZE, DELTA, FAST, FASTER, id, indicator, location, LOCATION, locationConfig, map, NAME, OWNING_BOARD, owningBoardName, pos, stackConfigurer, USE_GRID_LOCATION, useGridLocation, X_POSITION, xConfig, Y_POSITION, yConfigFields 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 Constructor Description DrawPile() -
Method Summary
Modifier and Type Method Description voidaddGlobalKeyCommand(DeckGlobalKeyCommand globalCommand)Decks can contain child Global Key Commands that only apply to cards in the Deck.voidaddTo(Buildable parent)Adds this component to its parent.CommandaddToContents(GamePiece p)RectangleboundingBox()protected JPopupMenubuildPopup()static DrawPilefindDrawPile(String id)Return the DrawPile instance with the matching id or nameClass<?>[]getAllowableConfigureComponents()Return a list of valid sub-component Classes.String[]getAttributeDescriptions()Return an array of Strings describing the attributes of this object.String[]getAttributeNames()Lists all the buildFile (XML) attribute names for this component.Class<?>[]getAttributeTypes()Return the Class for the buildFile (XML) attributes of this component.StringgetAttributeValueString(String key)Called by theBuildable.getBuildElement(org.w3c.dom.Document)method to write the attributes into an XML elementVisibilityConditiongetAttributeVisibility(String name)By default, all attributes are visiblestatic StringgetConfigureTypeName()DeckgetDeck()protected StringgetDeckType()HelpFilegetHelpFile()ComponentI18nDatagetI18nData()ObjectgetLocalizedProperty(Object key)MapgetMap()PointgetPosition()ObjectgetProperty(Object key)List<String>getPropertyNames()Implement PropertyNameSource - Expose the numPieces property and any counting properties.DimensiongetSize()protected StackinitializeContents()protected booleanplaceNonStackingSeparately()voidremoveGlobalKeyCommand(DeckGlobalKeyCommand globalCommand)voidsetAttribute(String key, Object value)Sets a buildFile (XML) attribute value for this component.voidsetDeck(Deck deck)Methods inherited from class VASSAL.build.module.map.SetupStack
add, configureStack, createStack, getConfigureBoard, getConfigureBoard, getConfigurer, getId, getRestoreCommand, getTopPiece, isOwningBoardActive, isUseGridLocation, removeFrom, setId, setup, updateConfigureButton, updateLocation, updatePosition, validateMethods inherited from class VASSAL.build.AbstractConfigurable
addPropertyChangeListener, getConfigureComponents, getConfigureName, getI18nPrefix, getLocalizedConfigureName, remove, removePropertyChangeListener, setAllAttributesUntranslatable, setAttributeTranslatable, setConfigureNameMethods inherited from class VASSAL.build.AbstractBuildable
build, getAllDescendantComponents, getAllDescendantComponentsOf, getBuildables, getBuildComponents, getBuildElement, getComponents, getComponentsOfMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface VASSAL.build.Buildable
build, getBuildElementMethods inherited from interface VASSAL.tools.UniqueIdManager.Identifyable
getConfigureName
-
Field Details
-
dummy
-
reshufflable
protected boolean reshufflable -
myDeck
-
source
-
idMgr
-
WIDTH
- See Also:
- Constant Field Values
-
HEIGHT
- See Also:
- Constant Field Values
-
ALLOW_MULTIPLE
- See Also:
- Constant Field Values
-
ALLOW_SELECT
- See Also:
- Constant Field Values
-
SELECT_DISPLAY_PROPERTY
- See Also:
- Constant Field Values
-
SELECT_SORT_PROPERTY
- See Also:
- Constant Field Values
-
FACE_DOWN
- See Also:
- Constant Field Values
-
DRAW_FACE_UP
- See Also:
- Constant Field Values
-
FACE_DOWN_REPORT_FORMAT
- See Also:
- Constant Field Values
-
FACE_DOWN_HOTKEY
- See Also:
- Constant Field Values
-
SHUFFLE
- See Also:
- Constant Field Values
-
SHUFFLE_REPORT_FORMAT
- See Also:
- Constant Field Values
-
SHUFFLE_HOTKEY
- See Also:
- Constant Field Values
-
SHUFFLE_COMMAND
- See Also:
- Constant Field Values
-
REVERSIBLE
- See Also:
- Constant Field Values
-
REVERSE_REPORT_FORMAT
- See Also:
- Constant Field Values
-
REVERSE_HOTKEY
- See Also:
- Constant Field Values
-
REVERSE_COMMAND
- See Also:
- Constant Field Values
-
DRAW
- See Also:
- Constant Field Values
-
COLOR
- See Also:
- Constant Field Values
-
MAXSTACK
- See Also:
- Constant Field Values
-
EXPRESSIONCOUNTING
- See Also:
- Constant Field Values
-
COUNTEXPRESSIONS
- See Also:
- Constant Field Values
-
RESHUFFLABLE
- See Also:
- Constant Field Values
-
RESHUFFLE_COMMAND
- See Also:
- Constant Field Values
-
RESHUFFLE_TARGET
- See Also:
- Constant Field Values
-
RESHUFFLE_MESSAGE
- See Also:
- Constant Field Values
-
RESHUFFLE_HOTKEY
- See Also:
- Constant Field Values
-
REPORT_FORMAT
- See Also:
- Constant Field Values
-
CAN_SAVE
- See Also:
- Constant Field Values
-
HOTKEY_ON_EMPTY
- See Also:
- Constant Field Values
-
EMPTY_HOTKEY
- See Also:
- Constant Field Values
-
RESTRICT_OPTION
- See Also:
- Constant Field Values
-
RESTRICT_EXPRESSION
- See Also:
- Constant Field Values
-
ALWAYS
- See Also:
- Constant Field Values
-
NEVER
- See Also:
- Constant Field Values
-
USE_MENU
- See Also:
- Constant Field Values
-
COMMAND_NAME
- See Also:
- Constant Field Values
-
DECK_NAME
- See Also:
- Constant Field Values
-
-
Constructor Details
-
DrawPile
public DrawPile()
-
-
Method Details
-
addTo
Description copied from interface:BuildableAdds this component to its parent. In order to make Buildable objects extensible, the child is reponsible for adding itself to the parent. That way, Buildable subcomponents can be defined in an extension package without needing to modify the containing class.- Specified by:
addToin interfaceBuildable- Overrides:
addToin classSetupStack
-
buildPopup
-
addGlobalKeyCommand
Decks can contain child Global Key Commands that only apply to cards in the Deck. Pass these to the dummy Deck component -
removeGlobalKeyCommand
-
findDrawPile
Return the DrawPile instance with the matching id or name- Parameters:
id- the Id or ConfigureName of the target DrawPile- Returns:
- the matching
DrawPile, or null if none found - See Also:
SetupStack.getId(),AbstractConfigurable.getConfigureName()
-
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- Overrides:
getAttributeNamesin classSetupStack- 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- Overrides:
getAttributeDescriptionsin classSetupStack- 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()
-
getAttributeTypes
Description copied from class:AbstractConfigurableReturn 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 ofAutoConfigurerwill 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()- Specified by:
getAttributeTypesin interfaceAutoConfigurable- Overrides:
getAttributeTypesin classSetupStack
-
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- Overrides:
getAttributeValueStringin classSetupStack- Parameters:
key- the name of the attribute. Will be one of those listed inAbstractBuildable.getAttributeNames()- Returns:
- a String representation of the attribute with the given name. When initializing a module, this String value will be passed to
AbstractBuildable.setAttribute(java.lang.String, java.lang.Object).
-
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- Overrides:
setAttributein classSetupStack- Parameters:
key- the name of the attribute. Will be one of those listed inAbstractBuildable.getAttributeNames()value- 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()
-
getAttributeVisibility
Description copied from class:AbstractConfigurableBy default, all attributes are visible- Specified by:
getAttributeVisibilityin interfaceAutoConfigurable- Overrides:
getAttributeVisibilityin classSetupStack- Parameters:
name- Name (key) of one of this component's attributes- Returns:
- a
VisibilityConditionfor this attribute, or null if attribute should always be visible.
-
getAllowableConfigureComponents
Description copied from interface:ConfigurableReturn 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 Configuration Window.- Specified by:
getAllowableConfigureComponentsin interfaceConfigurable- Overrides:
getAllowableConfigureComponentsin classSetupStack
-
getPosition
-
getMap
-
boundingBox
-
addToContents
-
initializeContents
- Overrides:
initializeContentsin classSetupStack
-
setDeck
-
getDeck
-
placeNonStackingSeparately
protected boolean placeNonStackingSeparately()- Overrides:
placeNonStackingSeparatelyin classSetupStack
-
getDeckType
-
getSize
-
getHelpFile
- Specified by:
getHelpFilein interfaceConfigurable- Overrides:
getHelpFilein classSetupStack- Returns:
- a HelpFilte describing how to use and configure this component
-
getConfigureTypeName
-
getI18nData
- Specified by:
getI18nDatain interfaceTranslatable- Overrides:
getI18nDatain classSetupStack- Returns:
- the i18n data for this component
-
getProperty
- Specified by:
getPropertyin interfacePropertySource
-
getLocalizedProperty
- Specified by:
getLocalizedPropertyin interfacePropertySource
-
getPropertyNames
Implement PropertyNameSource - Expose the numPieces property and any counting properties.- Specified by:
getPropertyNamesin interfacePropertyNameSource- Overrides:
getPropertyNamesin classAbstractBuildable- Returns:
- Default implementation of PropertyNameSource - No properties exposed
-