Interface Composition
- All Superinterfaces:
Composable,ComposableLike,Configurable<Composition>
A composition is a collection of multiple components, composed by relative coordinates.
See more in Flare docs: Composition
See more in Flare docs: Composition
-
Nested Class Summary
Nested classes/interfaces inherited from interface space.maxus.flare.ui.compose.Configurable
Configurable.Configurator<S> -
Method Summary
Modifier and TypeMethodDescriptionchildren()Returns all composable elements inside this compositiondefault voidclick(@NotNull org.bukkit.event.inventory.InventoryClickEvent e) Called each time this item is clicked, no matter if it is a right click, left click, middle click, etc.default booleandrag(@NotNull Map<Slot, org.bukkit.inventory.ItemStack> newItems, @NotNull org.bukkit.event.inventory.InventoryDragEvent e) Called when items are dragged across this composable inside interface.fitIn(ComposableSpace space) default @NotNull PackedComposableinside(@NotNull ComposableSpace space) Fits this composable inside the provided space, essentially returning a pair of this component and the space in the form of aPackedComposable.default booleanleftClick(@NotNull org.bukkit.event.inventory.InventoryClickEvent e) Called when this component is left clicked inside interfacestatic @NotNull Compositionof(PackedComposable... comps) Constructs a composition out of an array of packed composablesdefault booleanrightClick(@NotNull org.bukkit.event.inventory.InventoryClickEvent e) Called when this component is right clicked inside interfacedefault booleanshiftFrom(@NotNull org.bukkit.event.inventory.InventoryClickEvent e) Called when this component is shift clicked inside interfacedefault booleanshiftInto(@NotNull org.bukkit.inventory.ItemStack stack, @NotNull org.bukkit.event.inventory.InventoryClickEvent e) Called when this component is attempted to put items into by shift click.Methods inherited from interface space.maxus.flare.ui.Composable
asComposable, bind, context, contextOrNull, destroy, injectRoot, into, markDirty, renderAt, restore, root, viewerMethods inherited from interface space.maxus.flare.ui.compose.Configurable
configure, configureTyped
-
Method Details
-
of
Constructs a composition out of an array of packed composables- Parameters:
comps- Composable elements to be included- Returns:
- A new composition
- See Also:
-
fitIn
-
children
List<PackedComposable> children()Returns all composable elements inside this composition- Returns:
- All composable elements inside this composition
-
rightClick
default boolean rightClick(@NotNull @NotNull org.bukkit.event.inventory.InventoryClickEvent e) Description copied from interface:ComposableCalled when this component is right clicked inside interface- Specified by:
rightClickin interfaceComposable- Parameters:
e- The click event- Returns:
- True if the event should be cancelled, false otherwise
-
leftClick
default boolean leftClick(@NotNull @NotNull org.bukkit.event.inventory.InventoryClickEvent e) Description copied from interface:ComposableCalled when this component is left clicked inside interface- Specified by:
leftClickin interfaceComposable- Parameters:
e- The click event- Returns:
- True if the event should be cancelled, false otherwise
-
click
default void click(@NotNull @NotNull org.bukkit.event.inventory.InventoryClickEvent e) Description copied from interface:ComposableCalled each time this item is clicked, no matter if it is a right click, left click, middle click, etc.- Specified by:
clickin interfaceComposable- Parameters:
e- The click event
-
shiftFrom
default boolean shiftFrom(@NotNull @NotNull org.bukkit.event.inventory.InventoryClickEvent e) Description copied from interface:ComposableCalled when this component is shift clicked inside interface- Specified by:
shiftFromin interfaceComposable- Parameters:
e- The click event- Returns:
- True if the event should be cancelled, false otherwise
-
shiftInto
default boolean shiftInto(@NotNull @NotNull org.bukkit.inventory.ItemStack stack, @NotNull @NotNull org.bukkit.event.inventory.InventoryClickEvent e) Description copied from interface:ComposableCalled when this component is attempted to put items into by shift click. This means that a player clicked on an item inside their inventory, and Flare attempts to fit item inside this composable.- Specified by:
shiftIntoin interfaceComposable- Parameters:
stack- Stack that is attempted to be moved.e- The click event- Returns:
- True if the event should be cancelled, false otherwise
-
drag
default boolean drag(@NotNull @NotNull Map<Slot, org.bukkit.inventory.ItemStack> newItems, @NotNull @NotNull org.bukkit.event.inventory.InventoryDragEvent e) Description copied from interface:ComposableCalled when items are dragged across this composable inside interface. This method is currently experimental and may not work correctly- Specified by:
dragin interfaceComposable- Parameters:
newItems- Items that are dragged inside this composable's spacee- The drag event- Returns:
- True if the event should be cancelled, false otherwise.
-
inside
Description copied from interface:ComposableFits this composable inside the provided space, essentially returning a pair of this component and the space in the form of aPackedComposable.- Specified by:
insidein interfaceComposable- Specified by:
insidein interfaceComposableLike- Parameters:
space- Space to fit inside- Returns:
- A pair of this component and the space in the form of a
PackedComposable
-