All Implemented Interfaces:
Toggleable, KeyEventListener
Direct Known Subclasses:
ClosingButton

public abstract class Button
extends ActiveItem
A clickable button
  • Constructor Details

    • Button

      protected Button​(Dialog parent, CursorPosition initCoord, java.lang.String text)
      Default constructor

      Creates a new Button object, using its default properties

      Parameters:
      parent - the button container
      initCoord - the initial coordinates, relative to the container
      text - the button text
    • Button

      protected Button​(Dialog parent, CursorPosition initCoord, int width, int height, java.lang.String text)
      Custom constructor

      Creates a new Button object, using custom settings

      Parameters:
      parent - the button container
      initCoord - the initial coordinates, relative to the container
      width - the button width
      height - the button height
      text - the button text
  • Method Details

    • drawText

      protected void drawText()
      Draws the button text
    • show

      public void show()
      Shows the button on the screen
      Overrides:
      show in class WindowItem
    • onSelect

      public void onSelect()
      Highlights the button, drawing its shadows
      Specified by:
      onSelect in class ActiveItem
    • onRelease

      public void onRelease()
      Releases the button, removing the shadow highlighting the selection
      Specified by:
      onRelease in class ActiveItem