Package VASSAL.build.module.map
Class CounterDetailViewer
java.lang.Object
VASSAL.build.AbstractBuildable
VASSAL.build.AbstractConfigurable
VASSAL.build.module.map.CounterDetailViewer
- All Implemented Interfaces:
DragSourceMotionListener,KeyListener,MouseListener,MouseMotionListener,EventListener,AutoConfigurable,Buildable,Configurable,Drawable,PropertyNameSource,ValidityChecker,Translatable
- Direct Known Subclasses:
GlobalMap.CounterViewer
public class CounterDetailViewer extends AbstractConfigurable implements Drawable, DragSourceMotionListener, MouseMotionListener, MouseListener, KeyListener
This is a
Drawable class that draws the counters horizontally when
the mouse is held over a stack with the control key down.- Version:
- 1.0
- Author:
- David Sullivan
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCounterDetailViewer.CounterFormatConfigstatic classCounterDetailViewer.DisplayConfigstatic classCounterDetailViewer.EmptyFormatConfigprotected classCounterDetailViewer.FilterUtility class to select the pieces we wish to view.static classCounterDetailViewer.MinConfigstatic classCounterDetailViewer.ReportFormatConfigprotected static classCounterDetailViewer.VisitorNested classes/interfaces inherited from interface VASSAL.build.AutoConfigurable
AutoConfigurable.Util -
Field Summary
Fields inherited from class VASSAL.build.AbstractConfigurable
changeSupport, config, localizedName, myI18nData, name -
Constructor Summary
Constructors Constructor Description CounterDetailViewer() -
Method Summary
Modifier and Type Method Description voidaddTo(Buildable b)Adds this component to its parent.voiddragMouseMoved(DragSourceDragEvent e)voiddraw(Graphics g, Point pt, JComponent comp)voiddraw(Graphics g, Map map)booleandrawAboveCounters()protected voiddrawGraphics(Graphics g, Point pt, JComponent comp, List<GamePiece> pieces)protected voiddrawLabel(Graphics g, Point pt, String label, int hAlign, int vAlign)protected voiddrawText(Graphics g, Point pt, JComponent comp, List<GamePiece> pieces)protected voidfixBounds(List<GamePiece> pieces)Set the bounds field large enough to accommodate the given set of piecesClass<?>[]getAllowableConfigureComponents()Return a list of valid sub-component Classes.String[]getAttributeDescriptions()Return an array of Strings describing the attributes of this object.String[]getAttributeNames()Class<?>[]getAttributeTypes()Return the Class for the attributes of this object.StringgetAttributeValueString(String name)Return a String representation of the attribute with the given name.VisibilityConditiongetAttributeVisibility(String name)By default, all attributes are visibleprotected RectanglegetBounds(GamePiece piece)ConfigurergetConfigurer()static StringgetConfigureTypeName()protected List<GamePiece>getDisplayablePieces()Build an ArrayList of pieces to be displayed in order from bottom up, based on selection criteria setup in config.HelpFilegetHelpFile()protected intgetPreferredDelay()protected doublegetZoom()protected voidhideDetails()protected booleanisTextUnderCounters()voidkeyPressed(KeyEvent e)voidkeyReleased(KeyEvent e)voidkeyTyped(KeyEvent e)voidmouseClicked(MouseEvent e)voidmouseDragged(MouseEvent e)voidmouseEntered(MouseEvent e)voidmouseExited(MouseEvent e)voidmouseMoved(MouseEvent e)voidmousePressed(MouseEvent e)voidmouseReleased(MouseEvent e)voidremoveFrom(Buildable parent)Remove this component from its parentvoidsetAttribute(String name, Object value)Sets an attribute value for this component.protected voidshowDetails()protected voidupgrade()Methods inherited from class VASSAL.build.AbstractConfigurable
add, addPropertyChangeListener, getConfigureComponents, getConfigureName, getI18nData, getI18nPrefix, getLocalizedConfigureName, remove, removePropertyChangeListener, setAllAttributesUntranslatable, setAttributeTranslatable, setConfigureNameMethods inherited from class VASSAL.build.AbstractBuildable
build, getAllDescendantComponentsOf, getBuildables, getBuildComponents, getBuildElement, getComponentsOf, getPropertyNames, validate
-
Field Details
-
LATEST_VERSION
- See Also:
- Constant Field Values
-
USE_KEYBOARD
- See Also:
- Constant Field Values
-
PREFERRED_DELAY
- See Also:
- Constant Field Values
-
DELAY
- See Also:
- Constant Field Values
-
ALWAYS_SHOW_LOC
- See Also:
- Constant Field Values
-
DRAW_PIECES
- See Also:
- Constant Field Values
-
GRAPH_SINGLE_DEPRECATED
- See Also:
- Constant Field Values
-
MINIMUM_DISPLAYABLE
- See Also:
- Constant Field Values
-
HOTKEY
- See Also:
- Constant Field Values
-
SHOW_TEXT
- See Also:
- Constant Field Values
-
SHOW_TEXT_SINGLE_DEPRECATED
- See Also:
- Constant Field Values
-
ZOOM_LEVEL
- See Also:
- Constant Field Values
-
DRAW_PIECES_AT_ZOOM
- See Also:
- Constant Field Values
-
BORDER_WIDTH
- See Also:
- Constant Field Values
-
SHOW_NOSTACK
- See Also:
- Constant Field Values
-
SHOW_MOVE_SELECTED
- See Also:
- Constant Field Values
-
SHOW_NON_MOVABLE
- See Also:
- Constant Field Values
-
SHOW_DECK
- See Also:
- Constant Field Values
-
UNROTATE_PIECES
- See Also:
- Constant Field Values
-
DISPLAY
- See Also:
- Constant Field Values
-
LAYER_LIST
- See Also:
- Constant Field Values
-
SUMMARY_REPORT_FORMAT
- See Also:
- Constant Field Values
-
COUNTER_REPORT_FORMAT
- See Also:
- Constant Field Values
-
EMPTY_HEX_REPORT_FORMAT
- See Also:
- Constant Field Values
-
VERSION
- See Also:
- Constant Field Values
-
FG_COLOR
- See Also:
- Constant Field Values
-
BG_COLOR
- See Also:
- Constant Field Values
-
FONT_SIZE
- See Also:
- Constant Field Values
-
PROPERTY_FILTER
- See Also:
- Constant Field Values
-
TOP_LAYER
- See Also:
- Constant Field Values
-
ALL_LAYERS
- See Also:
- Constant Field Values
-
INC_LAYERS
- See Also:
- Constant Field Values
-
EXC_LAYERS
- See Also:
- Constant Field Values
-
FILTER
- See Also:
- Constant Field Values
-
SUM
- See Also:
- Constant Field Values
-
hotkey
-
map
-
delay
protected int delay -
delayTimer
-
graphicsVisible
protected boolean graphicsVisible -
textVisible
protected boolean textVisible -
currentMousePosition
-
minimumDisplayablePieces
protected int minimumDisplayablePieces -
alwaysShowLoc
protected boolean alwaysShowLoc -
drawPieces
protected boolean drawPieces -
drawSingleDeprecated
protected boolean drawSingleDeprecated -
showText
protected boolean showText -
showTextSingleDeprecated
protected boolean showTextSingleDeprecated -
unrotatePieces
protected boolean unrotatePieces -
showDeck
protected boolean showDeck -
zoomLevel
protected double zoomLevel -
graphicsZoomLevel
protected double graphicsZoomLevel -
borderWidth
protected int borderWidth -
showNoStack
protected boolean showNoStack -
showMoveSelected
protected boolean showMoveSelected -
showNonMovable
protected boolean showNonMovable -
displayWhat
-
displayLayers
-
summaryReportFormat
-
counterReportFormat
-
emptyHexReportFormat
-
version
-
fgColor
-
bgColor
-
fontSize
protected int fontSize -
font
-
propertyFilter
-
bounds
-
mouseInView
protected boolean mouseInView -
displayablePieces
-
view
the JComponent which is repainted when the detail viewer changes
-
-
Constructor Details
-
CounterDetailViewer
public CounterDetailViewer()
-
-
Method Details
-
addTo
Description copied from interface:BuildableAdds this component to its parent. In order to make Buildable objects extensible, the child is reponsible for adding itself to the parent. That way, Buildable subcomponents can be defined in an extension package without needing to modify the containing class. -
draw
-
drawAboveCounters
public boolean drawAboveCounters()- Specified by:
drawAboveCountersin interfaceDrawable
-
draw
-
drawGraphics
-
fixBounds
Set the bounds field large enough to accommodate the given set of pieces -
getBounds
-
isTextUnderCounters
protected boolean isTextUnderCounters() -
drawText
-
drawLabel
-
showDetails
protected void showDetails() -
getZoom
protected double getZoom() -
getDisplayablePieces
Build an ArrayList of pieces to be displayed in order from bottom up, based on selection criteria setup in config. -
mouseMoved
- Specified by:
mouseMovedin interfaceMouseMotionListener
-
getPreferredDelay
protected int getPreferredDelay() -
mouseDragged
- Specified by:
mouseDraggedin interfaceMouseMotionListener
-
mouseClicked
- Specified by:
mouseClickedin interfaceMouseListener
-
mouseEntered
- Specified by:
mouseEnteredin interfaceMouseListener
-
mouseExited
- Specified by:
mouseExitedin interfaceMouseListener
-
mousePressed
- Specified by:
mousePressedin interfaceMouseListener
-
mouseReleased
- Specified by:
mouseReleasedin interfaceMouseListener
-
dragMouseMoved
- Specified by:
dragMouseMovedin interfaceDragSourceMotionListener
-
keyTyped
- Specified by:
keyTypedin interfaceKeyListener
-
keyPressed
- Specified by:
keyPressedin interfaceKeyListener
-
keyReleased
- Specified by:
keyReleasedin interfaceKeyListener
-
hideDetails
protected void hideDetails() -
getConfigurer
Description copied from class:AbstractConfigurable- Specified by:
getConfigurerin interfaceConfigurable- Overrides:
getConfigurerin classAbstractConfigurable
-
upgrade
protected void upgrade() -
getAttributeNames
- Specified by:
getAttributeNamesin interfaceAutoConfigurable- Specified by:
getAttributeNamesin classAbstractBuildable- Returns:
- a list of all attribute names for this component
-
getAttributeDescriptions
Description copied from class:AbstractConfigurableReturn an array of Strings describing the attributes of this object. These strings are used as prompts in the Properties window for this object. The order of descriptions should be the same as the order of names inAbstractBuildable.getAttributeNames()- Specified by:
getAttributeDescriptionsin interfaceAutoConfigurable- Specified by:
getAttributeDescriptionsin classAbstractConfigurable
-
getAttributeTypes
Description copied from class:AbstractConfigurableReturn the Class for the attributes of this object. Valid classes are: String, Integer, Double, Boolean, Image, Color, and KeyStroke The order of classes should be the same as the order of names inAbstractBuildable.getAttributeNames()- Specified by:
getAttributeTypesin interfaceAutoConfigurable- Specified by:
getAttributeTypesin classAbstractConfigurable
-
getAllowableConfigureComponents
Description copied from interface:ConfigurableReturn 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 Configuration Window.- Specified by:
getAllowableConfigureComponentsin interfaceConfigurable
-
getHelpFile
- Specified by:
getHelpFilein interfaceConfigurable- Returns:
- a HelpFilte describing how to use and configure this component
-
removeFrom
Description copied from interface:ConfigurableRemove this component from its parent- Specified by:
removeFromin interfaceConfigurable
-
setAttribute
Description copied from class:AbstractBuildableSets an 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()
-
getAttributeValueString
Description copied from class:AbstractBuildableReturn a String representation of the attribute with the given name. When initializing a module, this String value will be passed toAbstractBuildable.setAttribute(java.lang.String, java.lang.Object).- 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()
-
getConfigureTypeName
-
getAttributeVisibility
Description copied from class:AbstractConfigurableBy default, all attributes are visible- Specified by:
getAttributeVisibilityin interfaceAutoConfigurable- Overrides:
getAttributeVisibilityin classAbstractConfigurable- Returns:
- null if the attribute controls should always be visible;
-