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.Changeinterface that allows for lambda expressions for the state enter and leave methods -
Method Summary
Modifier and TypeMethodDescriptionvoidonChange(GuiElement.Click click) What should happen when the element's state changes to this statevoidonLeave(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.Changeinterface 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.ChangeWhat should happen when the element's state changes to this state- Specified by:
onChangein interfaceGuiStateElement.State.Change- Parameters:
click- The click that triggered this change
-
onLeave
Description copied from interface:GuiStateElement.State.ChangeWhat should happen when the element's state changes away from this state- Specified by:
onLeavein interfaceGuiStateElement.State.Change- Parameters:
click- The click that triggered this change
-