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
Nested ClassesModifier and TypeClassDescriptionstatic classgenerates a prompt with the names of all decks already definedstatic classstatic classstatic classstatic classNested classes/interfaces inherited from class SetupStack
SetupStack.OwningBoardPrompt, SetupStack.StackConfigurer, SetupStack.ViewModifier and TypeClassDescriptionstatic classclassstatic classNested classes/interfaces inherited from interface AutoConfigurable
AutoConfigurable.Util -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected Deckstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected static final UniqueIdManagerstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected Deckstatic final Stringstatic final Stringprotected booleanstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected PropertySourcestatic final Stringstatic final Stringstatic final StringFields inherited from class 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, yConfigModifier and TypeFieldDescriptionprotected static Stringstatic final Stringprotected JButtonprotected static final intprotected static final Dimensionprotected static final intprotected static final intprotected static final intprotected Stringprotected static NewGameIndicatorprotected Stringstatic final Stringprotected Configurerprotected Mapstatic final Stringstatic final Stringprotected Stringprotected Buildableprotected Pointstatic booleanprotected SetupStack.StackConfigurerstatic final Stringprotected static Stringprotected booleanstatic final Stringprotected Configurerstatic final Stringprotected ConfigurerFields inherited from class AbstractConfigurable
changeSupport, config, localizedName, myI18nData, nameModifier and TypeFieldDescriptionprotected PropertyChangeSupportprotected Configurerprotected Stringprotected ComponentI18nDataprotected StringFields inherited from class AbstractBuildable
buildComponents, validatorFields inherited from interface Configurable
NAME_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddGlobalKeyCommand(DeckGlobalKeyCommand globalCommand) Decks can contain child Global Key Commands that only apply to cards in the Deck.voidAdds this component to its parent.addToContents(GamePiece p, boolean checkAccessibility) protected JPopupMenustatic DrawPilefindDrawPile(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(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 StringgetDeck()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()voidimportDeck(ConfigureTree tree) protected StackbooleanmakeDeck()protected booleanvoidremoveGlobalKeyCommand(DeckGlobalKeyCommand globalCommand) voidsetAttribute(String key, Object value) Sets a buildFile (XML) attribute value for this component.voidvoidsetup(boolean gameStarting) Notify the GameComponent that a game has started/endedMethods inherited from class 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, validateModifier and TypeMethodDescriptionvoidSet the owning translatable of this componentprotected voidprotected Stackstatic Stringprotected BoardgetConfigureBoard(boolean checkSelectedBoards) getId()When saving a game, each GameComponent should return aCommandthat, when executed, restores the GameComponent to its state when the game was saved If this component has no persistent state, return nullprotected PieceSlotstatic Stringprotected booleanstatic booleanprotected booleanvoidprepareConfigurer(Board board) protected intrecursiveInitializeContents(Stack s, Configurable[] c, int num) Traverses children components recursively (to support folder structure), adding any pieces found in PieceSlot objects to our stack.voidremoveFrom(Buildable parent) Remove this component from its parentstatic voidvoidvoidstatic voidsetShowOthers(boolean b) static voidprotected voidprotected voidprotected voidvoidvalidate(Buildable target, ValidationReport report) Methods inherited from class AbstractConfigurable
addPropertyChangeListener, getConfigureComponents, getI18nPrefix, getLocalizedConfigureName, getTypeName, remove, removePropertyChangeListener, setAllAttributesUntranslatable, setAttributeTranslatable, setConfigureNameModifier and TypeMethodDescriptionvoidAdd a PropertyChangeListener.protected StringReturns the name of the configurable type for display purposes.voidRemove a Buildable object from this objectvoidprotected voidSets all attributes untranslatable.protected voidsetAttributeTranslatable(String attr, boolean b) Over-ride the default attribute translatability.voidSets the name and fires a PropertyChangeEventMethods inherited from class AbstractBuildable
addImageNamesRecursively, build, buildString, getAllDescendantComponentsOf, getAncestor, getBuildables, getBuildComponents, getBuildElement, getComponents, getComponentsOf, getNonFolderAncestor, setAncestorModifier and TypeMethodDescriptionvoidAdds all images used by this component AND any subcomponents to the collectionvoidBuild this component by getting all XML attributes of the XML element and callingAbstractBuildable.setAttribute(String, Object)with the String value of the attribute<T> List<T> getAllDescendantComponentsOf(Class<T> target) Recursively descend the build tree and return aListof all components that are instances of the given classDeprecated, for removal: This API element is subject to removal in a future version.getBuildElement(Document doc) <T> Enumeration<T> getComponents(Class<T> target) Deprecated, for removal: This API element is subject to removal in a future version.UseAbstractBuildable.getComponentsOf(Class)instead.<T> List<T> getComponentsOf(Class<T> target) voidsetAncestor(Buildable ancestor) Methods inherited from class AbstractImageFinder
addLocalImageNames, getAllImageNames, getLocalImageNamesModifier and TypeMethodDescriptionvoidClasses extending AbstractImageFinder should override this method in order to add the names of any image files they use to the collection.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Auditable
getComponentName, getComponentTypeNameMethods inherited from interface Buildable
isMandatory, isMovable, isUniqueModifier and TypeMethodDescriptiondefault booleanIs this component a reqired component within its parent?default booleanIs this component allowed to be moved around the Configure Tree?default booleanisUnique()Does this component need to be unique within it's parent?
-
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:BuildableAdds 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:
addToin interfaceBuildable- Overrides:
addToin classSetupStack- Parameters:
parent- parent Buildable to add this component to as a subcomponent.
-
getDescription
- Specified by:
getDescriptionin 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:
getConfigureNamein interfaceConfigurable- Specified by:
getConfigureNamein interfaceUniqueIdManager.Identifyable- Overrides:
getConfigureNamein 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: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 interface:AutoConfigurableReturn the Class for the attributes of this object. Valid classes are: String, Integer, Double, Boolean, Image, File, Color, and KeyStroke- Specified by:
getAttributeTypesin interfaceAutoConfigurable- Overrides:
getAttributeTypesin 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
AutoConfigurerwill 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:AutoConfigurableCalled by theBuildable.getBuildElement(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 XML buildFile attribute with the given name. When initializing a module,
this String value will loaded from the XML and passed to
AbstractBuildable.setAttribute(String, Object). It is also frequently used for checking the current value of an attribute.
-
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(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(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
- Specified by:
getAllowableConfigureComponentsin interfaceConfigurable- Overrides:
getAllowableConfigureComponentsin 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
ConfigureTreewindow by right-clicking on the component and selecting the appropriate "Add" option.
-
getPosition
-
getMap
- Overrides:
getMapin classSetupStack
-
boundingBox
-
addToContents
-
addToContents
-
makeDeck
-
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 HelpFile 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
Description copied from interface:PropertySourceWhen 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:
getPropertyin interfacePropertySource- Parameters:
key- String key of property to be returned- Returns:
- Object containing value of the specified property
-
getLocalizedProperty
Description copied from interface:PropertySourceReturns a localized translation of the specified property value, if available. Otherwise returns the non-localized version.- Specified by:
getLocalizedPropertyin 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:
getPropertyNamesin interfacePropertyNameSource- Overrides:
getPropertyNamesin classAbstractBuildable- Returns:
- Default implementation of PropertyNameSource - No properties exposed
-
getExpressionList
- Specified by:
getExpressionListin interfaceSearchTarget- Overrides:
getExpressionListin classSetupStack- Returns:
- a list of the Configurables string/expression fields if any (for search)
-
getFormattedStringList
- Specified by:
getFormattedStringListin interfaceSearchTarget- Overrides:
getFormattedStringListin classAbstractConfigurable- Returns:
- a list of any Message Format strings referenced in the Configurable, if any (for search)
-
getPropertyList
- Specified by:
getPropertyListin interfaceSearchTarget- Overrides:
getPropertyListin classAbstractConfigurable- Returns:
- a list of any Property Names referenced in the Configurable, if any (for search)
-
getMenuTextList
- Specified by:
getMenuTextListin interfaceSearchTarget- Overrides:
getMenuTextListin 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:GameComponentNotify the GameComponent that a game has started/ended- Specified by:
setupin interfaceGameComponent- Overrides:
setupin classSetupStack- Parameters:
gameStarting- if true, a game is starting. If false, then a game is ending
-
getNamedKeyStrokeList
- Specified by:
getNamedKeyStrokeListin interfaceSearchTarget- Overrides:
getNamedKeyStrokeListin 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
-
AbstractBuildable.getBuildables()instead.