Package VASSAL.build.module.map
Class DrawPile
java.lang.Object
VASSAL.search.AbstractImageFinder
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
,ComponentDescription
,ValidityChecker
,Translatable
,Auditable
,ImageSearchTarget
,SearchTarget
,UniqueIdManager.Identifyable
public class DrawPile
extends SetupStack
implements PropertySource, PropertyNameSource, ComponentDescription
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
generates a prompt with the names of all decks already definedstatic class
static class
static class
static class
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
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
protected String
static final String
static final String
static final String
static final String
static final String
protected Deck
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
protected static final UniqueIdManager
static final String
static final String
static final String
static final String
protected Deck
static final String
static final String
protected boolean
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
protected PropertySource
static final String
static final String
static final String
Fields inherited from class VASSAL.build.module.map.SetupStack
cachedBoard, COMMAND_PREFIX, configureButton, DEFAULT_DUMMY_SIZE, DEFAULT_SIZE, DELTA, FAST, FASTER, id, indicator, location, LOCATION, locationConfig, map, NAME, OWNING_BOARD, owningBoardName, parent, pos, showOthers, stackConfigurer, USE_GRID_LOCATION, usedBoardWildcard, 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addGlobalKeyCommand
(DeckGlobalKeyCommand globalCommand) Decks can contain child Global Key Commands that only apply to cards in the Deck.void
Adds this component to its parent.addToContents
(GamePiece p, boolean checkAccessibility) protected JPopupMenu
static DrawPile
findDrawPile
(String id) Return the DrawPile instance with the matching id or nameClass<?>[]
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 visibleDeck doesn't join in any SetupStack reindeer games.static String
getDeck()
Retrieve all child DeckKeyCommandsReturns a localized translation of the specified property value, if available.getMap()
getProperty
(Object key) When using this interface a piece's own properties are preferred to those of "Global Properties", and those in turn are searched Zone-first then Map, then Module.Implement PropertyNameSource - Expose the numPieces property and any counting properties.getSize()
void
importDeck
(ConfigureTree tree) protected Stack
boolean
makeDeck()
protected boolean
void
removeGlobalKeyCommand
(DeckGlobalKeyCommand globalCommand) void
setAttribute
(String key, Object value) Sets a buildFile (XML) attribute value for this component.void
void
setup
(boolean gameStarting) Notify the GameComponent that a game has started/endedMethods inherited from class VASSAL.build.module.map.SetupStack
add, configureStack, createStack, getCachedBoard, getConfigureBoard, getConfigureBoard, getConfigurer, getId, getOwningBoardName, getRestoreCommand, getTopPiece, getUsedBoardWildcard, getValidOwningBoards, isOwningBoardActive, isShowOthers, isUseGridLocation, prepareConfigurer, recursiveInitializeContents, removeFrom, setCachedBoard, setId, setOwningBoardName, setShowOthers, setUsedBoardWildcard, updateConfigureButton, updateLocation, updatePosition, validate
Methods inherited from class VASSAL.build.AbstractConfigurable
addPropertyChangeListener, getConfigureComponents, getI18nPrefix, getLocalizedConfigureName, getTypeName, remove, removePropertyChangeListener, setAllAttributesUntranslatable, setAttributeTranslatable, setConfigureName
Methods inherited from class VASSAL.build.AbstractBuildable
addImageNamesRecursively, build, buildString, getAllDescendantComponentsOf, getAncestor, getBuildables, getBuildComponents, getBuildElement, getComponents, getComponentsOf, getNonFolderAncestor, setAncestor
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, isMandatory, isMovable, isUnique
-
Field Details
-
DESCRIPTION
- See Also:
-
dummy
-
reshufflable
protected boolean reshufflable -
myDeck
-
source
-
description
-
idMgr
-
WIDTH
- See Also:
-
HEIGHT
- See Also:
-
ALLOW_MULTIPLE
- See Also:
-
ALLOW_SELECT
- See Also:
-
SELECT_DISPLAY_PROPERTY
- See Also:
-
SELECT_SORT_PROPERTY
- See Also:
-
FACE_DOWN
- See Also:
-
DRAW_FACE_UP
- See Also:
-
FACE_DOWN_REPORT_FORMAT
- See Also:
-
SHUFFLE
- See Also:
-
SHUFFLE_REPORT_FORMAT
- See Also:
-
SHUFFLE_HOTKEY
- See Also:
-
SHUFFLE_COMMAND
- See Also:
-
REVERSIBLE
- See Also:
-
REVERSE_REPORT_FORMAT
- See Also:
-
REVERSE_HOTKEY
- See Also:
-
REVERSE_COMMAND
- See Also:
-
DRAW
- See Also:
-
COLOR
- See Also:
-
MAXSTACK
- See Also:
-
EXPRESSIONCOUNTING
- See Also:
-
COUNTEXPRESSIONS
- See Also:
-
RESHUFFLABLE
- See Also:
-
RESHUFFLE_COMMAND
- See Also:
-
RESHUFFLE_TARGET
- See Also:
-
RESHUFFLE_MESSAGE
- See Also:
-
RESHUFFLE_HOTKEY
- See Also:
-
REPORT_FORMAT
- See Also:
-
CAN_SAVE
- See Also:
-
HOTKEY_ON_EMPTY
- See Also:
-
EMPTY_HOTKEY
- See Also:
-
RESTRICT_OPTION
- See Also:
-
RESTRICT_EXPRESSION
- See Also:
-
ALWAYS
- See Also:
-
NEVER
- See Also:
-
USE_MENU
- See Also:
-
USE_MENU_UP
- See Also:
-
COMMAND_NAME
- See Also:
-
DECK_NAME
- See Also:
-
DRAW_MULTIPLE_MESSAGE
- See Also:
-
DRAW_SPECIFIC_MESSAGE
- See Also:
-
FACE_UP_MESSAGE
- See Also:
-
FACE_DOWN_MESSAGE
- See Also:
-
FACE_UP_HOTKEY
- See Also:
-
FACE_DOWN_HOTKEY
- See Also:
-
FACE_FLIP_HOTKEY
- See Also:
-
FACE_UP_REPORT_FORMAT
- See Also:
-
SAVE_MESSAGE
- See Also:
-
LOAD_MESSAGE
- See Also:
-
SAVE_HOTKEY
- See Also:
-
LOAD_HOTKEY
- See Also:
-
SAVE_REPORT_FORMAT
- See Also:
-
LOAD_REPORT_FORMAT
- See Also:
-
DECK_RESTRICT_ACCESS
- See Also:
-
DECK_OWNERS
- See Also:
-
-
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 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.- Specified by:
addTo
in interfaceBuildable
- Overrides:
addTo
in classSetupStack
- Parameters:
parent
- parent Buildable to add this component to as a subcomponent.
-
getDescription
- Specified by:
getDescription
in interfaceComponentDescription
- Returns:
- Description to be displayed next to component type/name in the main Editor window. Or null or "" to not display anything.
-
getConfigureName
Deck doesn't join in any SetupStack reindeer games.- Specified by:
getConfigureName
in interfaceConfigurable
- Specified by:
getConfigureName
in interfaceUniqueIdManager.Identifyable
- Overrides:
getConfigureName
in classSetupStack
- Returns:
- configure name for deck
-
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
-
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 interface:AutoConfigurable
Return the Class for the attributes of this object. Valid classes are: String, Integer, Double, Boolean, Image, File, Color, and KeyStroke- Specified by:
getAttributeTypes
in interfaceAutoConfigurable
- Overrides:
getAttributeTypes
in classSetupStack
- 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
AutoConfigurer
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()
-
isReshufflable
public boolean isReshufflable() -
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 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: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
- Specified by:
getAllowableConfigureComponents
in interfaceConfigurable
- Overrides:
getAllowableConfigureComponents
in classSetupStack
- 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
ConfigureTree
window by right-clicking on the component and selecting the appropriate "Add" option.
-
getPosition
-
getMap
- Overrides:
getMap
in classSetupStack
-
boundingBox
-
addToContents
-
addToContents
-
makeDeck
-
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 HelpFile 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
Description copied from interface:PropertySource
When using this interface a piece's own properties are preferred to those of "Global Properties", and those in turn are searched Zone-first then Map, then Module.- Specified by:
getProperty
in interfacePropertySource
- Parameters:
key
- String key of property to be returned- Returns:
- Object containing value of the specified property
-
getLocalizedProperty
Description copied from interface:PropertySource
Returns a localized translation of the specified property value, if available. Otherwise returns the non-localized version.- Specified by:
getLocalizedProperty
in interfacePropertySource
- Parameters:
key
- String key of property to be returned- Returns:
- Object containing localized text of the specified property, if available, otherwise non-localized value
-
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
-
getExpressionList
- Specified by:
getExpressionList
in interfaceSearchTarget
- Overrides:
getExpressionList
in classSetupStack
- Returns:
- a list of the Configurables string/expression fields if any (for search)
-
getFormattedStringList
- Specified by:
getFormattedStringList
in interfaceSearchTarget
- Overrides:
getFormattedStringList
in classAbstractConfigurable
- Returns:
- a list of any Message Format strings referenced in the Configurable, if any (for search)
-
getPropertyList
- Specified by:
getPropertyList
in interfaceSearchTarget
- Overrides:
getPropertyList
in classAbstractConfigurable
- Returns:
- a list of any Property Names referenced in the Configurable, if any (for search)
-
getMenuTextList
- Specified by:
getMenuTextList
in interfaceSearchTarget
- Overrides:
getMenuTextList
in classAbstractConfigurable
- Returns:
- a list of any Menu/Button/Tooltip Text strings referenced in the Configurable, if any (for search)
-
setup
public void setup(boolean gameStarting) Description copied from interface:GameComponent
Notify the GameComponent that a game has started/ended- Specified by:
setup
in interfaceGameComponent
- Overrides:
setup
in classSetupStack
- Parameters:
gameStarting
- if true, a game is starting. If false, then a game is ending
-
getNamedKeyStrokeList
- Specified by:
getNamedKeyStrokeList
in interfaceSearchTarget
- Overrides:
getNamedKeyStrokeList
in classAbstractConfigurable
- Returns:
- a list of any Named KeyStrokes referenced in the Configurable, if any (for search)
-
getDeckKeyCommands
Retrieve all child DeckKeyCommands- Returns:
- List of DeckKeyCommands
-
importDeck
-