Class HidePiecesButton
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
VASSAL.build.module.map.HidePiecesButton
- All Implemented Interfaces:
MouseListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible,AutoConfigurable,Buildable,Configurable,GameComponent,Drawable,Translatable,ImageSearchTarget,SearchTarget
public class HidePiecesButton
extends JPanel
implements MouseListener, AutoConfigurable, GameComponent, Drawable, SearchTarget, ImageSearchTarget
This removes all game pieces from the (@link Map)
therefore providing an un-cluttered view.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classNested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategyNested classes/interfaces inherited from interface VASSAL.build.AutoConfigurable
AutoConfigurable.Util -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected Stringstatic final Stringprotected LaunchButtonstatic final Stringprotected Mapprotected ComponentI18nDataprotected booleanstatic final Stringprotected Stringstatic final StringFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface VASSAL.build.Configurable
NAME_PROPERTYFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a child component.voidAdds all images used by this component AND any children (or inner decorators/pieces) to the collection.voidClasses extendingAbstractBuildableshould override this method in order to add the names of any image files they use to the collection.voidAdd a PropertyChangeListener.voidExpects to be added to aMap.voidBuild the object from the XML representation of the BuildablevoidbooleanClass<?>[]String[]Return an array of Strings describing the attributes of this object.String[]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) Because attributes are not always applicable in all cases, this method returns an interface to determine when the controls for specifying the named attribute should be visible.getBuildElement(Document doc) The name of this Configurable Objectstatic StringWhen 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 nullvoidvoidvoidvoidvoidvoidvoidRemove a child componentvoidRemove this component from its parentvoidsetAttribute(String key, Object value) Called by theBuildable.build(org.w3c.dom.Element)method, wherevalueis the String value read by the XML attribute.protected voidsetPiecesVisible(boolean visible) voidsetup(boolean show) Notify the GameComponent that a game has started/endedMethods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface VASSAL.build.Buildable
isMandatory, isMovable, isUnique
-
Field Details
-
piecesVisible
protected boolean piecesVisible -
map
-
launch
-
showingIcon
-
myI18nData
-
DEFAULT_SHOWING_ICON
- See Also:
-
DEFAULT_HIDDEN_ICON
- See Also:
-
LAUNCH_ICON
- See Also:
-
TOOLTIP
- See Also:
-
BUTTON_TEXT
- See Also:
-
HOTKEY
- See Also:
-
HIDDEN_ICON
- See Also:
-
SHOWING_ICON
- See Also:
-
-
Constructor Details
-
HidePiecesButton
public HidePiecesButton()
-
-
Method Details
-
addTo
-
setPiecesVisible
protected void setPiecesVisible(boolean visible) -
add
Description copied from interface:BuildableAdds a child component. Both this method andBuildable.addTo(VASSAL.build.Buildable)are invoked when adding a child to a parent -
remove
Description copied from interface:ConfigurableRemove a child component- Specified by:
removein interfaceConfigurable
-
removeFrom
Description copied from interface:ConfigurableRemove this component from its parent- Specified by:
removeFromin interfaceConfigurable
-
setAttribute
Description copied from interface:AutoConfigurableCalled by theBuildable.build(org.w3c.dom.Element)method, wherevalueis the String value read by the XML attribute. Can also be called with Object value to set the attribute.- Specified by:
setAttributein interfaceAutoConfigurable- Specified by:
setAttributein interfaceTranslatable- Parameters:
key- the name of the attribute. If the implementing class extendsAbstractConfigurable, will be one of those listed inAbstractBuildable.getAttributeNames().value- If thevalueparameter is a String, it will be the value returned byTranslatable.getAttributeValueString(java.lang.String)for the samekey. If the implementing class extendsAbstractConfigurable, thenvaluecan also be an instance of the corresponding Class listed inAbstractConfigurable.getAttributeTypes()
-
build
-
getAttributeNames
- Specified by:
getAttributeNamesin interfaceAutoConfigurable- Returns:
- an array of Strings giving all attributes of this Buildable component that will be written to/read from an XML element
-
getAttributeVisibility
Description copied from interface:AutoConfigurableBecause attributes are not always applicable in all cases, this method returns an interface to determine when the controls for specifying the named attribute should be visible.- Specified by:
getAttributeVisibilityin interfaceAutoConfigurable- Parameters:
name-- Returns:
- null if the attribute controls should always be visible;
-
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- Parameters:
key- the name of the attribute. If the implementing class extendsAbstractConfigurable, 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
Translatable.setAttribute(java.lang.String, java.lang.Object).
-
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
-
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
-
draw
-
drawAboveCounters
public boolean drawAboveCounters()- Specified by:
drawAboveCountersin interfaceDrawable
-
paint
- Overrides:
paintin classJComponent
-
mousePressed
- Specified by:
mousePressedin interfaceMouseListener
-
mouseEntered
- Specified by:
mouseEnteredin interfaceMouseListener
-
mouseExited
- Specified by:
mouseExitedin interfaceMouseListener
-
mouseClicked
- Specified by:
mouseClickedin interfaceMouseListener
-
mouseReleased
- Specified by:
mouseReleasedin interfaceMouseListener
-
getToolTipText
- Overrides:
getToolTipTextin classJComponent
-
getRestoreCommand
Description copied from interface:GameComponentWhen 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 null- Specified by:
getRestoreCommandin interfaceGameComponent
-
setup
public void setup(boolean show) Description copied from interface:GameComponentNotify the GameComponent that a game has started/ended- Specified by:
setupin interfaceGameComponent- Parameters:
show- if true, a game is starting. If false, then a game is ending
-
getConfigureTypeName
-
getConfigureName
Description copied from interface:ConfigurableThe name of this Configurable Object- Specified by:
getConfigureNamein interfaceConfigurable
-
getConfigurer
- Specified by:
getConfigurerin interfaceConfigurable- Returns:
- a
Configurerobject which can be used to set the attributes of this object
-
getConfigureComponents
- Specified by:
getConfigureComponentsin interfaceConfigurable- Returns:
- an array of Configurer objects representing the Configurable children of this Configurable object
-
getAllowableConfigureComponents
- Specified by:
getAllowableConfigureComponentsin interfaceConfigurable- 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.
-
addPropertyChangeListener
Description copied from interface:ConfigurableAdd a PropertyChangeListener. A PropertyChangeEvent should be fired with property nameConfigurable.NAME_PROPERTYwhen the value returned fromConfigurable.getConfigureName()has changed- Specified by:
addPropertyChangeListenerin interfaceConfigurable- Overrides:
addPropertyChangeListenerin classContainer
-
getHelpFile
- Specified by:
getHelpFilein interfaceConfigurable- Returns:
- a HelpFile describing how to use and configure * this component
-
getBuildElement
- Specified by:
getBuildElementin interfaceBuildable- Parameters:
doc- XML file- Returns:
- an XML element from which this component can be built
-
getI18nData
- Specified by:
getI18nDatain interfaceTranslatable
-
getMenuTextList
- Specified by:
getMenuTextListin interfaceSearchTarget- Returns:
- a list of any Menu/Button/Tooltip Text strings referenced in the Configurable, if any (for search)
-
getNamedKeyStrokeList
- Specified by:
getNamedKeyStrokeListin interfaceSearchTarget- Returns:
- a list of any Named KeyStrokes referenced in the Configurable, if any (for search)
-
getExpressionList
- Specified by:
getExpressionListin interfaceSearchTarget- Returns:
- a list of the Configurables string/expression fields if any (for search)
-
getFormattedStringList
- Specified by:
getFormattedStringListin interfaceSearchTarget- Returns:
- a list of any Message Format strings referenced in the Configurable, if any (for search)
-
getPropertyList
- Specified by:
getPropertyListin interfaceSearchTarget- Returns:
- a list of any Property Names referenced in the Configurable, if any (for search)
-
getAllImageNames
- Specified by:
getAllImageNamesin interfaceImageSearchTarget- Returns:
- names of all images used by the component and any subcomponents
-
addImageNamesRecursively
Adds all images used by this component AND any children (or inner decorators/pieces) to the collection.- Specified by:
addImageNamesRecursivelyin interfaceImageSearchTarget- Parameters:
s- Collection to add image names to
-
getLocalImageNames
- Specified by:
getLocalImageNamesin interfaceImageSearchTarget- Returns:
- names of all images used by this component
-
addLocalImageNames
Classes extendingAbstractBuildableshould override this method in order to add the names of any image files they use to the collection. For "find unused images" and "search".- Specified by:
addLocalImageNamesin interfaceImageSearchTarget- Parameters:
s- Collection to add image names to
-