22 package com.realtime.crossfire.jxclient.gui.gui;
24 import java.awt.event.MouseEvent;
25 import org.jetbrains.annotations.NotNull;
59 super(tooltipManager, elementListener, name, transparency);
81 pendingInactive =
true;
88 if (pendingInactive) {
98 pendingInactive =
false;
107 return elementListener.
isActive(
this);
114 public abstract void execute();
Listener for GUIElement related events.
final TooltipManager tooltipManager
The TooltipManager to update.
ActivatableGUIElement(@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, final int transparency)
Creates a new instance.
final GUIElementListener elementListener
The GUIElementListener to notify.
void setActive(final boolean active)
Sets the active state of a GUI element.
final String name
The name of this element.
void markInactivePending()
Marks this GUI element as pending inactive.
A GUIElement that can be set to active or inactive.
boolean isActive(@NotNull ActivatableGUIElement element)
Returns whether an ActivatableGUIElement is active.
static final long serialVersionUID
The serial version UID.
void setInactiveIfPending()
Unsets the active state of this GUI element if is is pending.
void mousePressed(@NotNull final MouseEvent e)
Will be called when the user has pressed the mouse inside this element.
void activeChanged(@NotNull ActivatableGUIElement element, boolean active)
The active state of an AbstractGUIElement has changed.
Abstract base class for GUI elements to be shown in Guis.
abstract void activeChanged()
Will be called whenever the active state has changed.
boolean pendingInactive
Set if the next call to setInactiveIfPending() will deactivate this GUI element.
abstract void execute()
Executes the actions associated with this GUI element.
boolean isActive()
Returns whether a GUI element is active.