public class CheckComponent extends Component
clickAction, hidden, id, interaction
Constructor and Description |
---|
CheckComponent(String id,
Action clickAction,
boolean hidden,
Interaction interaction,
Check check,
Component positive,
Component negative)
Instantiates a new CheckComponent.
|
Modifier and Type | Method and Description |
---|---|
void |
apply(Graphics graphic,
org.bukkit.entity.Player player,
GuiPoint cursor)
Render the component on the provided graphic context.
|
CheckComponent |
clone(Interaction interaction)
Clone the component with the new interaction.
|
Check |
getCheck()
Gets the check used by the component.
|
String |
getState(org.bukkit.entity.Player player,
GuiPoint cursor)
Gets the current state of the component for the given parameters.
|
boolean |
isInBounds(org.bukkit.entity.Player player,
GuiPoint cursor)
Checks whether the cursor is in bounds of the component.
|
Component |
locate(String componentId)
Locate the component with the given id.
|
CheckComponent |
locateOn(Interaction interaction)
Locate the same component on a different interaction.
|
void |
onClick(org.bukkit.entity.Player player,
GuiPoint cursor,
boolean isPrimary)
Called when a player clicks on the component.
|
void |
setCheck(Check check)
Sets the check used by the component.
|
dispose, getClickAction, getId, getInteraction, isHidden, locate, setClickAction, setHidden
public CheckComponent(String id, Action clickAction, boolean hidden, Interaction interaction, Check check, Component positive, Component negative)
id
- the component idclickAction
- the click actionhidden
- the hiddeninteraction
- the interactioncheck
- the checkpositive
- the positivenegative
- the negativepublic void apply(Graphics graphic, org.bukkit.entity.Player player, GuiPoint cursor)
Component
public boolean isInBounds(org.bukkit.entity.Player player, GuiPoint cursor)
Component
isInBounds
in class Component
player
- the playercursor
- the cursorpublic String getState(org.bukkit.entity.Player player, GuiPoint cursor)
Component
Component.apply(Graphics, Player, GuiPoint)
renders different content, then the this method should
return different strings. If it renders the same the return value should be the same.
RectComponent
returns
x+"*"+y+"*"+width+"*"+height+"*"+color.getRGB()
)public Component locate(String componentId)
Component
public CheckComponent clone(Interaction interaction)
Component
public CheckComponent locateOn(Interaction interaction)
Component
interaction.getComponentTree().locate(component.getId())
public void onClick(org.bukkit.entity.Player player, GuiPoint cursor, boolean isPrimary)
Component
public Check getCheck()
public void setCheck(Check check)
check
- the checkCopyright © 2021. All rights reserved.