 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.gui.textinput;
34 import java.awt.Color;
36 import java.awt.Image;
37 import org.jetbrains.annotations.NotNull;
38 import org.jetbrains.annotations.Nullable;
86 public GUICommandText(@NotNull
final CommandCallback commandCallback, @Nullable
final CommandHistory commandHistory, @NotNull
final TooltipManager tooltipManager, @NotNull
final GUIElementListener elementListener, @NotNull
final String
name, @NotNull
final NewCharModel newCharModel, @NotNull
final Image
activeImage, @NotNull
final Image
inactiveImage, @NotNull
final Font
font, @NotNull
final Color
inactiveColor, @NotNull
final Color
activeColor,
final int margin, @NotNull
final String
text, @NotNull
final CommandExecutor commandExecutor, @NotNull
final GuiFactory guiFactory, @NotNull
final CrossfireServerConnection crossfireServerConnection) {
87 super(
commandCallback,
commandHistory,
tooltipManager,
elementListener,
name,
newCharModel,
activeImage,
inactiveImage,
font,
inactiveColor,
activeColor,
margin,
text,
guiFactory);
93 protected void execute(@NotNull
final String command) {
94 if (!command.isEmpty()) {
Abstract base class for text input fields.
void execute()
Executes the actions associated with this GUI element.
Interface for listeners interested in drawinfo messages received from the Crossfire server.
static final int MSG_TYPE_JXCLIENT
Internally used drawextinfo message type: a message has been generated by the client.
final int margin
The left margin in pixels.
Adds encoding/decoding of crossfire protocol packets to a ServerConnection.
static final long serialVersionUID
The serial version UID.
Encapsulates the message type numbers for drawextinfo messages.
GUICommandText(@NotNull final CommandCallback commandCallback, @Nullable final CommandHistory commandHistory, @NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, @NotNull final NewCharModel newCharModel, @NotNull final Image activeImage, @NotNull final Image inactiveImage, @NotNull final Font font, @NotNull final Color inactiveColor, @NotNull final Color activeColor, final int margin, @NotNull final String text, @NotNull final CommandExecutor commandExecutor, @NotNull final GuiFactory guiFactory, @NotNull final CrossfireServerConnection crossfireServerConnection)
Creates a new instance.
void execute(@NotNull final String command)
Will be called to execute the entered command.
final CommandExecutor commandExecutor
The CommandExecutor for executing entered commands.
final Color inactiveColor
The color for rendering displayed text when the element is inactive.
void notifyOpen()
Called each time the enclosing dialog is opened (or raised).
A GUIText element that executes the entered text as a command.
void drawextinfo(int color, int type, int subtype, String message)
Pretends that a drawextinfo message has been received.
final CommandHistory commandHistory
The CommandHistory for this text field.
final Font font
The font for rendering displayed text.
final CrossfireServerConnection crossfireServerConnection
The connection instance.
General information for creating new characters.
final GuiFactory guiFactory
The global GuiFactory instance.
final Image activeImage
The element's background image when it is active.
final GUIElementListener elementListener
The GUIElementListener to notify.
void executeCommand(@NotNull final CharSequence commandLine)
Executes a command or a list of commands.
Information for displaying tooltips.
TooltipText getTooltip()
Returns the current tooltip text.
Factory for creating Gui instances.
final Color activeColor
The color for rendering displayed text when the element is active.
final String name
The name of this element.
final Image inactiveImage
The element's background image when it is inactive.
static final int MSG_SUBTYPE_JXCLIENT_COMMAND
A command that has been sent to the server.
Interface that defines callback functions needed by commands.
void setText(@NotNull final String text)
Sets the entered text.
final NewCharModel newCharModel
The NewCharModel that is shown.
Manages a list of previously entered commands.
final CommandCallback commandCallback
The CommandCallback to use.
final TooltipManager tooltipManager
The TooltipManager to update.
int NDI_GREEN
A message color.
final StringBuilder text
The entered text.
Listener for GUIElement related events.