 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.gui.misc;
31 import java.awt.Color;
33 import java.awt.Point;
34 import java.awt.event.MouseEvent;
35 import javax.swing.JComponent;
36 import org.jetbrains.annotations.NotNull;
37 import org.jetbrains.annotations.Nullable;
82 super(
tooltipManager,
elementListener,
name,
null,
textFont,
textColor,
textColor,
backgroundColor,
Alignment.
LEFT, title,
guiFactory);
89 super.mousePressed(e);
101 final Point point = e.getLocationOnScreen();
107 super.mouseReleased(e);
116 super.mouseDragged(e);
126 private void moveTo(@NotNull
final MouseEvent e) {
127 final Point tmpOffset =
offset;
128 if (tmpOffset ==
null) {
138 final Point point = e.getLocationOnScreen();
boolean isAutoSize()
Returns whether this dialog is an auto-size dialog.
final Color textColor
The text color when not highlighted.
Combines a list of GUIElements to for a gui.
Gui getGui(@NotNull final AbstractGUIElement element)
Returns the Gui an element is part of.
final Color backgroundColor
If set, the opaque background color.
static final long serialVersionUID
The serial version UID.
final JXCWindowRenderer windowRenderer
The JXCWindowRenderer this element belongs to.
A dialog title that allows to move the dialog.
final GUIElementListener elementListener
The GUIElementListener to notify.
int getWindowHeight()
Returns the height of the client area.
int getWindowWidth()
Returns the width of the client area.
void mouseDragged(@NotNull final MouseEvent e)
Will be called when the mouse moves within this component while the button is pressed.
Point offset
Set to the distance of the dialog coordinates relative to the mouse position while dragging start.
Renders a Gui instance into a Frame.
void setBounds(final int x, final int y, final int width, final int height, final int windowWidth, final int windowHeight)
Sets the position and size of this dialog.
JComponent getComponent()
Returns the JComponent for this instance.
Factory for creating Gui instances.
final String name
The name of this element.
final GuiFactory guiFactory
The global GuiFactory instance.
void moveTo(@NotNull final MouseEvent e)
Moves the dialog the given point.
void mouseReleased(@NotNull final MouseEvent e)
Will be called when the user has released the mouse.
final TooltipManager tooltipManager
The TooltipManager to update.
A AbstractLabel that renders the text as a plain string.
void mousePressed(@NotNull final MouseEvent e)
Will be called when the user has pressed the mouse inside this element.
final Font textFont
The font for rendering the label text.
GUIDialogTitle(@NotNull final TooltipManager tooltipManager, @NotNull final JXCWindowRenderer windowRenderer, @NotNull final GUIElementListener elementListener, @NotNull final String name, @NotNull final Font textFont, @NotNull final Color textColor, @Nullable final Color backgroundColor, @NotNull final String title, @NotNull final GuiFactory guiFactory)
Creates a new instance.
Listener for GUIElement related events.