public class ImageComponent extends RectangularComponent
height, width, x, y
clickAction, hidden, id, interaction
Constructor and Description |
---|
ImageComponent(String id,
Action clickAction,
boolean hidden,
Interaction interaction,
int x,
int y,
BufferedImage image)
Instantiates a new ImageComponent.
|
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.
|
ImageComponent |
clone(Interaction interaction)
Clone the component with the new interaction.
|
Image |
getImage()
Gets the image.
|
String |
getState(org.bukkit.entity.Player player,
GuiPoint cursor)
Gets the current state of the component for the given parameters.
|
ImageComponent |
locateOn(Interaction interaction)
Locate the same component on a different interaction.
|
void |
setImage(BufferedImage image)
Sets the image.
|
getHeight, getWidth, getX, getY, isInBounds
dispose, getClickAction, getId, getInteraction, isHidden, locate, locate, onClick, setClickAction, setHidden
public ImageComponent(String id, Action clickAction, boolean hidden, Interaction interaction, int x, int y, BufferedImage image)
id
- the component idclickAction
- the click actionshidden
- the hiddeninteraction
- the interactionx
- the xy
- the yimage
- the imagepublic 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 ImageComponent clone(Interaction interaction)
Component
public ImageComponent locateOn(Interaction interaction)
Component
interaction.getComponentTree().locate(component.getId())
public Image getImage()
public void setImage(BufferedImage image)
image
- the imageCopyright © 2021. All rights reserved.