Class ButtonStateMachine<T,ST>
java.lang.Object
io.github.astrapi69.design.pattern.state.button.ButtonStateMachine<T,ST>
- Type Parameters:
T
- the type parameter for the buttonST
- the type parameter for the state
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
setEnabled
(boolean enabled) Sets the enabled state of the button.protected abstract void
Updates the state of the button.
-
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
-