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 class
DrawPile.AssignedDeckPrompt
generates a prompt with the names of all decks already definedstatic class
DrawPile.FormattedStringConfig
static class
DrawPile.PiecePropertyConfig
static class
DrawPile.Prompt
Nested classes/interfaces inherited from class VASSAL.build.module.map.SetupStack
SetupStack.OwningBoardPrompt, SetupStack.StackConfigurer, SetupStack.View
Nested 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, yConfig
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
Constructors Constructor Description DrawPile()
-
Method Summary
Modifier and Type Method Description void
addGlobalKeyCommand(DeckGlobalKeyCommand globalCommand)
Decks can contain child Global Key Commands that only apply to cards in the Deck.void
addTo(Buildable parent)
Adds this component to its parent.Command
addToContents(GamePiece p)
Rectangle
boundingBox()
protected JPopupMenu
buildPopup()
static DrawPile
findDrawPile(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.String
getAttributeValueString(String key)
Called by theBuildable.getBuildElement(org.w3c.dom.Document)
method to write the attributes into an XML elementVisibilityCondition
getAttributeVisibility(String name)
By default, all attributes are visiblestatic String
getConfigureTypeName()
Deck
getDeck()
protected String
getDeckType()
HelpFile
getHelpFile()
ComponentI18nData
getI18nData()
Object
getLocalizedProperty(Object key)
Map
getMap()
Point
getPosition()
Object
getProperty(Object key)
List<String>
getPropertyNames()
Implement PropertyNameSource - Expose the numPieces property and any counting properties.Dimension
getSize()
protected Stack
initializeContents()
protected boolean
placeNonStackingSeparately()
void
removeGlobalKeyCommand(DeckGlobalKeyCommand globalCommand)
void
setAttribute(String key, Object value)
Sets a buildFile (XML) attribute value for this component.void
setDeck(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, validate
Methods inherited from class VASSAL.build.AbstractConfigurable
addPropertyChangeListener, getConfigureComponents, getConfigureName, getI18nPrefix, getLocalizedConfigureName, remove, removePropertyChangeListener, setAllAttributesUntranslatable, setAttributeTranslatable, setConfigureName
Methods inherited from class VASSAL.build.AbstractBuildable
build, getAllDescendantComponents, getAllDescendantComponentsOf, getBuildables, getBuildComponents, getBuildElement, getComponents, getComponentsOf
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface VASSAL.build.Buildable
build, getBuildElement
Methods 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:Buildable
Adds 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:
addTo
in interfaceBuildable
- Overrides:
addTo
in 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:AbstractBuildable
Lists 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:
getAttributeNames
in interfaceAutoConfigurable
- Overrides:
getAttributeNames
in classSetupStack
- Returns:
- a list of all buildFile (XML) attribute names for this component
-
getAttributeDescriptions
Description copied from interface:AutoConfigurable
Return 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:
getAttributeDescriptions
in interfaceAutoConfigurable
- Overrides:
getAttributeDescriptions
in 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:AbstractConfigurable
Return 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 ofAutoConfigurer
will 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:
getAttributeTypes
in interfaceAutoConfigurable
- Overrides:
getAttributeTypes
in classSetupStack
-
getAttributeValueString
Description copied from interface:AutoConfigurable
Called by theBuildable.getBuildElement(org.w3c.dom.Document)
method to write the attributes into an XML element- Specified by:
getAttributeValueString
in interfaceAutoConfigurable
- Specified by:
getAttributeValueString
in interfaceTranslatable
- Overrides:
getAttributeValueString
in 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:AbstractBuildable
Sets a buildFile (XML) attribute value for this component. Thekey
parameter will be one of those listed inAbstractBuildable.getAttributeNames()
. If thevalue
parameter is a String, it will be the value returned byAbstractBuildable.getAttributeValueString(java.lang.String)
for the samekey
. If the implementing class extendsAbstractConfigurable
, thenvalue
will be an instance of the corresponding Class listed inAbstractConfigurable.getAttributeTypes()
- Specified by:
setAttribute
in interfaceAutoConfigurable
- Specified by:
setAttribute
in interfaceTranslatable
- Overrides:
setAttribute
in classSetupStack
- Parameters:
key
- the name of the attribute. Will be one of those listed inAbstractBuildable.getAttributeNames()
value
- If thevalue
parameter is a String, it will be the value returned byAbstractBuildable.getAttributeValueString(java.lang.String)
for the samekey
. If the implementing class extendsAbstractConfigurable
, thenvalue
can also be an instance of the corresponding Class listed inAbstractConfigurable.getAttributeTypes()
-
getAttributeVisibility
Description copied from class:AbstractConfigurable
By default, all attributes are visible- Specified by:
getAttributeVisibility
in interfaceAutoConfigurable
- Overrides:
getAttributeVisibility
in classSetupStack
- Parameters:
name
- Name (key) of one of this component's attributes- Returns:
- a
VisibilityCondition
for this attribute, or null if attribute should always be visible.
-
getAllowableConfigureComponents
Description copied from interface:Configurable
Return 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:
getAllowableConfigureComponents
in interfaceConfigurable
- Overrides:
getAllowableConfigureComponents
in classSetupStack
-
getPosition
-
getMap
-
boundingBox
-
addToContents
-
initializeContents
- Overrides:
initializeContents
in classSetupStack
-
setDeck
-
getDeck
-
placeNonStackingSeparately
protected boolean placeNonStackingSeparately()- Overrides:
placeNonStackingSeparately
in classSetupStack
-
getDeckType
-
getSize
-
getHelpFile
- Specified by:
getHelpFile
in interfaceConfigurable
- Overrides:
getHelpFile
in classSetupStack
- Returns:
- a HelpFilte describing how to use and configure this component
-
getConfigureTypeName
-
getI18nData
- Specified by:
getI18nData
in interfaceTranslatable
- Overrides:
getI18nData
in classSetupStack
- Returns:
- the i18n data for this component
-
getProperty
- Specified by:
getProperty
in interfacePropertySource
-
getLocalizedProperty
- Specified by:
getLocalizedProperty
in interfacePropertySource
-
getPropertyNames
Implement PropertyNameSource - Expose the numPieces property and any counting properties.- Specified by:
getPropertyNames
in interfacePropertyNameSource
- Overrides:
getPropertyNames
in classAbstractBuildable
- Returns:
- Default implementation of PropertyNameSource - No properties exposed
-