public interface Component extends VirtualView
more items within a VirtualView.| Modifier and Type | Method and Description |
|---|---|
void |
clear(@NotNull IFContext context)
Clears this component from the given context.
|
void |
forceUpdate()
Forces this component to be updated.
|
InteractionHandler |
getInteractionHandler()
The interaction handler for this component.
|
java.lang.String |
getKey()
This is an internal inventory-framework API that should not be used from outside of
this library.
|
int |
getPosition()
The current position of this component relative to its root view.
|
Ref<Component> |
getReference()
Returns the reference assigned to this component.
|
@NotNull VirtualView |
getRoot()
The root of this component.
|
@UnmodifiableView java.util.Set<State<?>> |
getWatchingStates()
An unmodifiable set of all states that this component is watching.
|
void |
hide()
Hides this component.
|
boolean |
intersects(@NotNull Component other)
If this component are intersects with other component.
|
static boolean |
intersects(@NotNull Component component,
@NotNull Component other)
Checks if two components area intersects with each other.
|
boolean |
isContainedWithin(int position)
Checks if this component is in a specific position.
|
boolean |
isManagedExternally()
This is an internal inventory-framework API that should not be used from outside of
this library.
|
boolean |
isVisible()
If this component can be seen, it is used in interaction treatments to ensure that the viewer
does not interact with hidden components.
|
void |
render(@NotNull IFSlotRenderContext context)
Renders this component to the given context.
|
void |
setVisible(boolean visible)
Sets the visibility state of this component.
|
boolean |
shouldRender(IFContext context) |
void |
show()
Shows this component.
|
void |
update()
Updates this component.
|
void |
updated(@NotNull IFSlotRenderContext context)
Called when this component is updated in the given context.
|
@ApiStatus.Internal java.lang.String getKey()
@NotNull @NotNull VirtualView getRoot()
int getPosition()
boolean isContainedWithin(int position)
position - The position.boolean intersects(@NotNull
@NotNull Component other)
other - The other component.InteractionHandler getInteractionHandler()
void render(@NotNull
@NotNull IFSlotRenderContext context)
context - The context that this component will be rendered on.void updated(@NotNull
@NotNull IFSlotRenderContext context)
context - The update context.void clear(@NotNull
@NotNull IFContext context)
context - The context that this component will be cleared from.@UnmodifiableView java.util.Set<State<?>> getWatchingStates()
boolean isVisible()
@ApiStatus.Internal void setVisible(boolean visible)
This is an internal inventory-framework API that should not be used from outside of this library. No compatibility guarantees are provided.
visible - If this component is visible.@ApiStatus.Internal boolean isManagedExternally()
This is an internal inventory-framework API that should not be used from outside of this library. No compatibility guarantees are provided.
boolean shouldRender(IFContext context)
void update()
static boolean intersects(@NotNull
@NotNull Component component,
@NotNull
@NotNull Component other)
component - The component A.other - The component B.@ApiStatus.Experimental Ref<Component> getReference()
This API is experimental and is not subject to the general compatibility guarantees such API may be changed or may be removed completely in any further release.
@ApiStatus.Experimental void forceUpdate()
This API is experimental and is not subject to the general compatibility guarantees such API may be changed or may be removed completely in any further release.
@ApiStatus.Experimental void show()
This API is experimental and is not subject to the general compatibility guarantees such API may be changed or may be removed completely in any further release.
@ApiStatus.Experimental void hide()
This API is experimental and is not subject to the general compatibility guarantees such API may be changed or may be removed completely in any further release.