public class RectComponent extends RectangularComponent
height, width, x, y
clickAction, hidden, id, interaction
Constructor and Description |
---|
RectComponent(String id,
Action clickAction,
boolean hidden,
Interaction interaction,
int x,
int y,
int width,
int height,
Color color)
Instantiates a new RectComponent
(same as
RectComponent(String, Action, boolean, Interaction, int, int, int, int, Color) with 0 border radius) |
RectComponent(String id,
Action clickAction,
boolean hidden,
Interaction interaction,
int x,
int y,
int width,
int height,
Color color,
int radius)
Instantiates a new RectComponent.
|
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.
|
RectComponent |
clone(Interaction interaction)
Clone the component with the new interaction.
|
Color |
getColor()
Gets the color.
|
String |
getState(org.bukkit.entity.Player player,
GuiPoint cursor)
Gets the current state of the component for the given parameters.
|
RectComponent |
locateOn(Interaction interaction)
Locate the same component on a different interaction.
|
void |
setColor(Color color)
Sets the color.
|
void |
setHeight(int height)
Sets the height.
|
void |
setWidth(int width)
Sets the width.
|
void |
setX(int x)
Sets the x position.
|
void |
setY(int y)
Sets the y position.
|
getHeight, getWidth, getX, getY, isInBounds
dispose, getClickAction, getId, getInteraction, isHidden, locate, locate, onClick, setClickAction, setHidden
public RectComponent(String id, Action clickAction, boolean hidden, Interaction interaction, int x, int y, int width, int height, Color color)
RectComponent(String, Action, boolean, Interaction, int, int, int, int, Color)
with 0 border radius)public RectComponent(String id, Action clickAction, boolean hidden, Interaction interaction, int x, int y, int width, int height, Color color, int radius)
id
- the component idclickAction
- the click actionshidden
- the hiddeninteraction
- the interactionx
- the xy
- the ywidth
- the widthheight
- the heightcolor
- the colorradius
- the border radius used to round the cornerspublic void apply(Graphics graphic, org.bukkit.entity.Player player, GuiPoint cursor)
Component
public 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 RectComponent clone(Interaction interaction)
Component
public RectComponent locateOn(Interaction interaction)
Component
interaction.getComponentTree().locate(component.getId())
public Color getColor()
public void setColor(Color color)
color
- the colorpublic void setX(int x)
x
- the x positionpublic void setY(int y)
y
- the y positionpublic void setWidth(int width)
width
- the widthpublic void setHeight(int height)
height
- the heightCopyright © 2021. All rights reserved.