public class RemoteImageComponent extends Component implements org.bukkit.event.Listener
clickAction, hidden, id, interaction
Constructor and Description |
---|
RemoteImageComponent(String id,
Action clickAction,
boolean hidden,
Interaction interaction,
String imageUrl,
Component loading,
int x,
int y,
int width,
int height,
boolean dithering)
Instantiates a new Remote image component.
|
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.
|
RemoteImageComponent |
clone(Interaction interaction)
Clone the component with the new interaction.
|
RemoteImageComponent |
copyWith(String id,
String newImageUrl)
Create a copy of this component with a new image url
|
void |
dispose()
Dispose the component.
|
String |
getImageUrl()
Gets image url.
|
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.
|
RemoteImageComponent |
locateOn(Interaction interaction)
Locate the same component on a different interaction.
|
void |
onQuit(org.bukkit.event.player.PlayerQuitEvent event) |
getClickAction, getId, getInteraction, isHidden, locate, locate, onClick, setClickAction, setHidden
public RemoteImageComponent(String id, Action clickAction, boolean hidden, Interaction interaction, String imageUrl, Component loading, int x, int y, int width, int height, boolean dithering)
id
- the idclickAction
- the click actionhidden
- the hiddeninteraction
- the interactionimageUrl
- the image urlloading
- the loadingx
- the xy
- the ywidth
- the widthheight
- the heightdithering
- the ditheringpublic 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 RemoteImageComponent clone(Interaction interaction)
Component
public RemoteImageComponent locateOn(Interaction interaction)
Component
interaction.getComponentTree().locate(component.getId())
public void dispose()
Component
public void onQuit(org.bukkit.event.player.PlayerQuitEvent event)
public String getImageUrl()
public RemoteImageComponent copyWith(String id, String newImageUrl)
id
- the id of the copynewImageUrl
- the new image urlCopyright © 2021. All rights reserved.