Package VASSAL.counters
Class ActionButton.ButtonPusher
java.lang.Object
VASSAL.counters.ActionButton.ButtonPusher
- Enclosing class:
- ActionButton
protected static class ActionButton.ButtonPusher extends Object
Registers mouse listeners with Maps and other components. Clicking the
mouse checks for pieces with an ActionButton trait and invokes them if the
click falls within the button's boundaries
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classActionButton.ButtonPusher.ComponentMouseListenerDeprecated, for removal: This API element is subject to removal in a future version.protected classActionButton.ButtonPusher.MapMouseListener -
Constructor Summary
Constructors Modifier Constructor Description protectedButtonPusher() -
Method Summary
Modifier and Type Method Description voiddoClick(GamePiece p, Point point)Handle a mouse click on the given GamePiece at the given location (where 0,0 is the center of the piece).voidregister(Component obs, GamePiece piece, int x, int y)Deprecated, for removal: This API element is subject to removal in a future version.voidregister(Map map)
-
Constructor Details
-
ButtonPusher
protected ButtonPusher()
-
-
Method Details
-
register
-
register
@Deprecated(since="2020-10-26", forRemoval=true) public void register(Component obs, GamePiece piece, int x, int y)Deprecated, for removal: This API element is subject to removal in a future version. -
doClick
Handle a mouse click on the given GamePiece at the given location (where 0,0 is the center of the piece). Activate all Action Buttons in sequence that are not Masked or Hidden- Parameters:
p-x-y-Offset- A function to determine the offset of the target piece. This callback is done for efficiency reasons, since computing the offset may be expensive (as in the case of a piece in an expanded stack on a map) and is only needed if the piece has the ActionButton trait
-