Package de.themoep.inventorygui
Class GuiStateElement.State.ChangeHandler
java.lang.Object
de.themoep.inventorygui.GuiStateElement.State.ChangeHandler
- All Implemented Interfaces:
GuiStateElement.State.Change
- Enclosing class:
GuiStateElement.State
public static class GuiStateElement.State.ChangeHandler
extends Object
implements GuiStateElement.State.Change
A simple implementation of the
GuiStateElement.State.Change
interface that allows for lambda expressions for the state enter and leave methods-
Constructor Summary
ConstructorsConstructorDescriptionChangeHandler
(Consumer<GuiElement.Click> onStateEnter, Consumer<GuiElement.Click> onStateLeave) A simple implementation of theGuiStateElement.State.Change
interface that allows for lambda expressions for the state enter and leave methods -
Method Summary
Modifier and TypeMethodDescriptionvoid
onChange
(GuiElement.Click click) What should happen when the element's state changes to this statevoid
onLeave
(GuiElement.Click click) What should happen when the element's state changes away from this state
-
Constructor Details
-
ChangeHandler
public ChangeHandler(Consumer<GuiElement.Click> onStateEnter, Consumer<GuiElement.Click> onStateLeave) A simple implementation of theGuiStateElement.State.Change
interface that allows for lambda expressions for the state enter and leave methods- Parameters:
onStateEnter
- The action to run when the state changes to this stateonStateLeave
- The action to run when the state changes away from this state
-
-
Method Details
-
onChange
Description copied from interface:GuiStateElement.State.Change
What should happen when the element's state changes to this state- Specified by:
onChange
in interfaceGuiStateElement.State.Change
- Parameters:
click
- The click that triggered this change
-
onLeave
Description copied from interface:GuiStateElement.State.Change
What should happen when the element's state changes away from this state- Specified by:
onLeave
in interfaceGuiStateElement.State.Change
- Parameters:
click
- The click that triggered this change
-