Package tripleplay.ui

Class ImageButton

All Implemented Interfaces:
Clickable<ImageButton>

public class ImageButton extends Widget<ImageButton> implements Clickable<ImageButton>
A button that uses images for its different states.
  • Constructor Details

    • ImageButton

      public ImageButton(TileSource up)
      Creates a button with the supplied image for use in up and down states.
    • ImageButton

      public ImageButton(TileSource up, TileSource down)
      Creates a button with the supplied up and down images.
  • Method Details

    • setUp

      public ImageButton setUp(TileSource up)
      Configures the image used in our up state.
    • setDown

      public ImageButton setDown(TileSource down)
      Configures the image used in our down state.
    • click

      public void click()
      Programmatically triggers a click of this button. This triggers the action sound, but does not cause any change in the button's visualization. Note: this does not check the button's enabled state, so the caller must handle that if appropriate.
      Specified by:
      click in interface Clickable<ImageButton>
    • onClick

      public ImageButton onClick(react.SignalView.Listener<? super ImageButton> onClick)
      A convenience method for registering a click handler. Assumes you don't need the result of SignalView.connect(react.SignalView.Listener<? super T>), because it throws it away.
    • clicked

      public react.SignalView<ImageButton> clicked()
      Description copied from interface: Clickable
      A signal that is emitted when this element is clicked.
      Specified by:
      clicked in interface Clickable<ImageButton>
    • toString

      public String toString()
      Overrides:
      toString in class Object