public class ImageComponent extends RectangularComponent
height, width, x, yclickAction, 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, isInBoundsdispose, getClickAction, getId, getInteraction, isHidden, locate, locate, onClick, setClickAction, setHiddenpublic 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)
Componentpublic String getState(org.bukkit.entity.Player player, GuiPoint cursor)
ComponentComponent.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)
Componentpublic ImageComponent locateOn(Interaction interaction)
Componentinteraction.getComponentTree().locate(component.getId())public Image getImage()
public void setImage(BufferedImage image)
image - the imageCopyright © 2021. All rights reserved.