 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.gui.gui;
27 import java.awt.event.MouseEvent;
28 import javax.swing.JComponent;
29 import org.jetbrains.annotations.NotNull;
30 import org.jetbrains.annotations.Nullable;
112 if (parent !=
null) {
132 setDoubleBuffered(
false);
146 @SuppressWarnings(
"MethodDoesntCallSuperMethod")
173 @SuppressWarnings(
"MethodDoesntCallSuperMethod")
248 if (tooltipText ==
null) {
Utility class for Swing related functions.
boolean pendingChange
Used to avoid refreshing items all the time.
void tooltipChanged()
Must be called whenever the tooltip may have changed.
Combines a list of GUIElements to for a gui.
Gui getGui(@NotNull final AbstractGUIElement element)
Returns the Gui an element is part of.
boolean inhibitListeners
If set, change listeners will not be notified.
void setChanged()
Records that the contents have changed and must be repainted.
void setChangedListener(@Nullable final GUIElementChangedListener changedListener)
Sets the GUIElementChangedListener to be notified.
Abstract base class for GUI elements to be shown in Guis.
static void invokeLater(@NotNull final Runnable runnable)
Calls SwingUtilities#invokeLater(Runnable) if not on the EDT or calls the Runnable directly if on the...
final GUIElementListener elementListener
The GUIElementListener to notify.
boolean isDefault()
Returns whether this element is the default element.
void notifyChanged()
Called whenever the changed flag was set while a GUIElement was visible.
abstract TooltipText getTooltip()
Returns the current tooltip text.
void inhibitListeners()
Prevents change listeners to be notified.
void mouseMoved(@NotNull final MouseEvent e)
Will be called when the mouse moves within this component.
Interface defining an abstract GUI element.
void raiseDialog(@NotNull AbstractGUIElement component)
The Gui of a Component should be raised.
boolean isDefault
Whether this element is the default element.
boolean isIgnore()
Returns whether this gui element is to be ignored for user interaction.
GUIElementChangedListener changedListener
The GUIElementChangedListener to be notified whenever this element has changed.
void mouseDragged(@NotNull final MouseEvent e)
Will be called when the mouse moves within this component while the button is pressed.
int getDialogBorderTop()
Returns the size of the dialog's top border.
int getDialogBorderBottom()
Returns the size of the dialog's bottom border.
int getDialogBorderLeft()
Returns the size of the dialog's left border.
int getDialogBorderRight()
Returns the size of the dialog's right border.
final GuiFactory guiFactory
The global GuiFactory instance.
TooltipText newTooltipText(@Nullable final String tooltipText)
Creates a TooltipText instance relative to this instance.
void mouseReleased(@NotNull final MouseEvent e)
Will be called when the user has released the mouse.
JComponent getComponent()
Returns the JComponent for this instance.
Interface for listeners interested in the changed flag of GUIElement instances.
String getName()
Returns the internal name of this gui element.
Information for displaying tooltips.
Factory for creating Gui instances.
static final long serialVersionUID
The serial version UID.
final String name
The name of this element.
boolean ignore
Whether this gui element should be ignored for user interaction.
void mouseWheelMoved(final int wheelRotation)
Will be called when the mouse wheel has been moved.
void setDefault(final boolean isDefault)
Sets whether this element is the default element.
void mouseExited(@NotNull final MouseEvent e)
Will be called when the mouse has left the bounding box of this element.
void mouseClicked(@NotNull final MouseEvent e)
Will be called when the user has clicked (pressed+released) this element.
void repaint()
Repaints this component.
final Runnable setChangedRunnable
The Runnable that implements the code of setChanged() which must run on the EDT.
final TooltipManager tooltipManager
The TooltipManager to update.
void mouseEntered(@NotNull final MouseEvent e)
Will be called when the mouse has entered the bounding box of this element.
AbstractGUIElement(@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, final boolean opaque, @NotNull final GuiFactory guiFactory)
Creates a new instance.
void setIgnore()
Marks this gui element to be ignored for user interaction.
void dispose()
Releases all allocated resources.
Listener for GUIElement related events.
void mousePressed(@NotNull final MouseEvent e)
Will be called when the user has pressed the mouse inside this element.