public interface GUIElement
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Releases all allocated resources.
|
java.lang.String |
getName()
Returns the internal name of this gui element.
|
boolean |
hasTooltipText()
Returns whether the tooltip is enabled.
|
boolean |
isDefault()
Returns whether this element is the default element.
|
boolean |
isIgnore()
Returns whether this gui element is to be ignored for user interaction.
|
void |
mouseClicked(java.awt.event.MouseEvent e)
Will be called when the user has clicked (pressed+released) this element.
|
void |
mouseDragged(java.awt.event.MouseEvent e)
Will be called when the mouse moves within this component while the
button is pressed.
|
void |
mouseEntered(java.awt.event.MouseEvent e,
boolean debugGui)
Will be called when the mouse has entered the bounding box of this
element.
|
void |
mouseExited(java.awt.event.MouseEvent e)
Will be called when the mouse has left the bounding box of this element.
|
void |
mouseMoved(java.awt.event.MouseEvent e)
Will be called when the mouse moves within this component.
|
void |
mousePressed(java.awt.event.MouseEvent e)
Will be called when the user has pressed the mouse inside this element.
|
void |
mouseReleased(java.awt.event.MouseEvent e)
Will be called when the user has released the mouse.
|
void |
setChanged()
Records that the contents have changed and must be repainted.
|
void |
setChangedListener(GUIElementChangedListener changedListener)
Sets the
GUIElementChangedListener to be notified. |
void |
setDefault(boolean isDefault)
Sets whether this element is the default element.
|
void |
setIgnore()
Marks this gui element to be ignored for user interaction.
|
void |
setTooltipText(java.lang.String tooltipText)
Sets the tooltip text to show when the mouse is inside this element.
|
void |
setTooltipText(java.lang.String tooltipText,
int x,
int y,
int w,
int h)
Sets the tooltip text to show when the mouse is inside this element.
|
void dispose()
@NotNull java.lang.String getName()
boolean hasTooltipText()
boolean isDefault()
boolean isIgnore()
void mouseClicked(@NotNull java.awt.event.MouseEvent e)
mouseReleased(MouseEvent)
.e
- the mouse event relative to this elementvoid mouseDragged(@NotNull java.awt.event.MouseEvent e)
mouseMoved(MouseEvent)
.
Note: if the mouse leaves this element's bounding box while the mouse
button is still pressed, further mouseDragged
(but no mouseMoved
) events will be generated.
e
- the mouse event relative to this elementvoid mouseEntered(@NotNull java.awt.event.MouseEvent e, boolean debugGui)
e
- the mouse event relative to this elementdebugGui
- whether --debug-gui is activevoid mouseExited(@NotNull java.awt.event.MouseEvent e)
mouseEntered(MouseEvent,
boolean)
has been called before.e
- the mouse event relative to this elementvoid mouseMoved(@NotNull java.awt.event.MouseEvent e)
e
- the mouse event relative to this elementvoid mousePressed(@NotNull java.awt.event.MouseEvent e)
e
- the mouse event relative to this elementvoid mouseReleased(@NotNull java.awt.event.MouseEvent e)
mousePressed(MouseEvent)
has been
delivered before.e
- the mouse event relative to this elementvoid setChanged()
void setChangedListener(@Nullable GUIElementChangedListener changedListener)
GUIElementChangedListener
to be notified. Note that at
most one such listener may be set per gui element.changedListener
- the listener or null
to unsetvoid setDefault(boolean isDefault)
isDefault
- whether this element is the default elementvoid setIgnore()
void setTooltipText(@Nullable java.lang.String tooltipText)
tooltipText
- the text to show or null
to disable the
tooltip for this elementvoid setTooltipText(@Nullable java.lang.String tooltipText, int x, int y, int w, int h)
tooltipText
- the text to show, or null
to disable the
tooltip for this elementx
- the x coordinatey
- the y coordinatew
- the widthh
- the height