java.lang.Object
io.github.astrapi69.design.pattern.state.button.ButtonStateMachine<T,ST>
Type Parameters:
T - the type parameter for the button
ST - the type parameter for the state
All Implemented Interfaces:
ButtonState<ST>

public abstract class ButtonStateMachine<T,ST> extends Object implements ButtonState<ST>
The abstract class ButtonStateMachine can provide states on buttons. It manages the current state of a button and defines abstract methods for updating the button state and enabling/disabling the button. For an example, see the unit tests.
  • Constructor Details

    • ButtonStateMachine

      public ButtonStateMachine()
  • Method Details

    • updateButtonState

      protected abstract void updateButtonState()
      Updates the state of the button.
    • setEnabled

      protected abstract void setEnabled(boolean enabled)
      Sets the enabled state of the button.
      Parameters:
      enabled - the new enabled state