Package VASSAL.build.module
Class PieceWindow
java.lang.Object
VASSAL.search.AbstractImageFinder
VASSAL.build.AbstractBuildable
VASSAL.build.AbstractConfigurable
VASSAL.build.Widget
VASSAL.build.module.PieceWindow
- All Implemented Interfaces:
AutoConfigurable,Buildable,Configurable,PropertyNameSource,ComponentDescription,ValidityChecker,Translatable,Auditable,ImageSearchTarget,SearchTarget,UniqueIdManager.Identifyable
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class VASSAL.build.Widget
Widget.MyCellRendererNested classes/interfaces inherited from interface VASSAL.build.AutoConfigurable
AutoConfigurable.Util -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringprotected intstatic final Stringprotected booleanstatic final Stringstatic final Stringstatic final Stringprotected Stringprotected static final UniqueIdManagerprotected LaunchButtonprotected ComponentSplitter.SplitPaneDeprecated, for removal: This API element is subject to removal in a future version.static final Stringprotected JComponentprotected doublestatic final Stringprotected SplitPaneprotected Stringstatic final StringFields inherited from class VASSAL.build.Widget
buildElement, description, DESCRIPTION, HEIGHT, parent, WIDTHFields 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 -
Method Summary
Modifier and TypeMethodDescriptionvoidSet the owning translatable of this componentvoidClasses extending AbstractImageFinder should override this method in order to add the names of any image files they use to the collection.voidExpects to be added to aGameModule.voidFor memory efficiency reasons, a Widget is initialized lazily.voiddockMe()Docks us into the main window -- needs to be called AFTER Chatter has docked.Class<?>[]A PieceWindow may contain aTabWidget, aPanelWidget, aBoxWidget, aListWidget-- but not a lone piece slotString[]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 elementClass<?>[]Children of PieceWindow may contain aTabWidget, aPanelWidget, aBoxWidget, aListWidget, or aPieceSlotstatic StringgetId()Each instanceof PieceWindow has a unique String identifierdoublegetScale()booleanhasScale()voidvoidRemove a Buildable object from this objectvoidremoveFrom(Buildable parent) Remove this component from its parentvoidsetAttribute(String name, Object value) Sets a buildFile (XML) attribute value for this component.voidEach instanceof PieceWindow has a unique String identifierbooleanMethods inherited from class VASSAL.build.Widget
getBuildElement, getConfigureComponents, getDescription, getParent, hasScalablePieces, rebuildMethods inherited from class VASSAL.build.AbstractConfigurable
addPropertyChangeListener, getAttributeVisibility, getConfigureName, getConfigurer, getExpressionList, getFormattedStringList, getI18nData, getI18nPrefix, getLocalizedConfigureName, getPropertyList, getTypeName, removePropertyChangeListener, setAllAttributesUntranslatable, setAttributeTranslatable, setConfigureNameMethods inherited from class VASSAL.build.AbstractBuildable
addImageNamesRecursively, buildString, getAllDescendantComponentsOf, getAncestor, getBuildables, getBuildComponents, getComponents, getComponentsOf, getNonFolderAncestor, getPropertyNames, setAncestor, validateMethods inherited from class VASSAL.search.AbstractImageFinder
getAllImageNames, getLocalImageNamesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface VASSAL.script.expression.Auditable
getComponentName, getComponentTypeNameMethods inherited from interface VASSAL.build.Buildable
isMandatory, isMovable, isUniqueMethods inherited from interface VASSAL.tools.UniqueIdManager.Identifyable
getConfigureName
-
Field Details
-
id
-
launch
-
DEPRECATED_NAME
- See Also:
-
NAME
- See Also:
-
BUTTON_TEXT
- See Also:
-
TOOLTIP
- See Also:
-
ICON
- See Also:
-
HOTKEY
- See Also:
-
HIDDEN
- See Also:
-
SCALE
- See Also:
-
DEFAULT_DOCKED_WIDTH
- See Also:
-
idMgr
-
root
-
tooltip
-
scale
protected double scale -
defaultDockedWidth
protected int defaultDockedWidth -
mainWindowDock
@Deprecated(since="2020-11-15", forRemoval=true) protected ComponentSplitter.SplitPane mainWindowDockDeprecated, for removal: This API element is subject to removal in a future version. -
splitPane
-
-
Constructor Details
-
PieceWindow
public PieceWindow()
-
-
Method Details
-
hasScale
-
getScale
-
launchButtonPressed
public void launchButtonPressed() -
getHelpFile
- Specified by:
getHelpFilein interfaceConfigurable- Overrides:
getHelpFilein classWidget- Returns:
- a HelpFile describing how to use and configure * this component
-
build
Description copied from class:WidgetFor memory efficiency reasons, a Widget is initialized lazily. This method only stores the element from which the build the Widget. The Widget is built from the stored element by invokingWidget.rebuild(). Subclasses should invokeWidget.rebuild()before invokingWidget.getComponent() -
shouldDockIntoMainWindow
public boolean shouldDockIntoMainWindow() -
getComponent
- Specified by:
getComponentin classWidget- Returns:
- the Component for this widget. For efficiency, the
Component may be initialized lazily instead of being created
in the
Buildable.build(org.w3c.dom.Element)method
-
getConfigureTypeName
-
getChildAllowableConfigureComponents
Children of PieceWindow may contain aTabWidget, aPanelWidget, aBoxWidget, aListWidget, or aPieceSlot- Overrides:
getChildAllowableConfigureComponentsin classWidget- Returns:
- configure components allowed for children of this class
-
getAllowableConfigureComponents
A PieceWindow may contain aTabWidget, aPanelWidget, aBoxWidget, aListWidget-- but not a lone piece slot- Specified by:
getAllowableConfigureComponentsin interfaceConfigurable- Overrides:
getAllowableConfigureComponentsin classWidget- 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.
-
add
Description copied from class:AbstractConfigurableSet the owning translatable of this component- Specified by:
addin interfaceBuildable- Overrides:
addin classAbstractConfigurable- Parameters:
b- Child to attach to this buildable as a subcomponent
-
remove
Description copied from class:AbstractConfigurableRemove a Buildable object from this object- Specified by:
removein interfaceConfigurable- Overrides:
removein classAbstractConfigurable
-
getId
Each instanceof PieceWindow has a unique String identifier- Specified by:
getIdin interfaceUniqueIdManager.Identifyable- Returns:
- the identifier for this PieceWindow
-
setId
Each instanceof PieceWindow has a unique String identifier- Specified by:
setIdin interfaceUniqueIdManager.Identifyable
-
dockMe
public void dockMe()Docks us into the main window -- needs to be called AFTER Chatter has docked. -
addTo
-
removeFrom
Description copied from interface:ConfigurableRemove this component from its parent- Specified by:
removeFromin interfaceConfigurable- Overrides:
removeFromin classWidget
-
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- Specified by:
getAttributeDescriptionsin classAbstractConfigurable- 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- Specified by:
getAttributeTypesin classAbstractConfigurable- 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()
-
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- Specified by:
getAttributeNamesin classAbstractBuildable- Returns:
- a list of all buildFile (XML) attribute names for this component
-
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- Specified by:
setAttributein classAbstractBuildable- Parameters:
name- 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()
-
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- Specified by:
getAttributeValueStringin classAbstractBuildable- Parameters:
name- 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.
-
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)
-
getNamedKeyStrokeList
- Specified by:
getNamedKeyStrokeListin interfaceSearchTarget- Overrides:
getNamedKeyStrokeListin classAbstractConfigurable- Returns:
- a list of any Named KeyStrokes referenced in the Configurable, if any (for search)
-
addLocalImageNames
Description copied from class:AbstractImageFinderClasses extending AbstractImageFinder should override this method in order to add the names of any image files they use to the collection.- Specified by:
addLocalImageNamesin interfaceImageSearchTarget- Overrides:
addLocalImageNamesin classAbstractImageFinder- Parameters:
s- Collection to add image names to
-