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
,ValidityChecker
,Translatable
,ImageSearchTarget
,SearchTarget
,UniqueIdManager.Identifyable
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
generates a prompt with the names of all decks already definedstatic 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 String
static String
static String
static String
static String
static String
static String
static String
static String
static String
protected Deck
static String
static String
static String
static String
static String
static String
static String
protected static UniqueIdManager
static String
protected Deck
static String
static String
protected boolean
static String
static String
static String
static String
static String
static String
static String
static String
static String
static String
static String
static String
static String
static String
static String
static String
static String
protected PropertySource
static String
static String
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
-
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.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 visiblestatic String
getDeck()
protected String
getLocalizedProperty(Object key)
Returns 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()
protected Stack
boolean
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, getConfigureBoard, getConfigureBoard, getConfigurer, getId, getRestoreCommand, getTopPiece, isOwningBoardActive, isUseGridLocation, removeFrom, setId, 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
addImageNamesRecursively, build, getAllDescendantComponents, getAllDescendantComponentsOf, getBuildables, getBuildComponents, getBuildElement, getComponents, getComponentsOf
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.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 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.
-
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 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
-
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 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)
-