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
  • Constructor Details

    • ButtonPusher

      protected ButtonPusher()
  • Method Details

    • register

      public void register(Map map)
    • 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

      public void doClick(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). Activate all Action Buttons in sequence that are not Masked or Hidden
      Parameters:
      p - 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