Crossfire JXClient, Trunk
com.realtime.crossfire.jxclient.gui.textinput.GUITextField Class Reference

A text input field which executes a CommandList when ENTER is pressed. More...

+ Inheritance diagram for com.realtime.crossfire.jxclient.gui.textinput.GUITextField:
+ Collaboration diagram for com.realtime.crossfire.jxclient.gui.textinput.GUITextField:

Public Member Functions

void execute ()
 Executes the actions associated with this GUI element. More...
 
TooltipText getTooltip ()
 Returns the current tooltip text. More...
 
 GUITextField (@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 CommandList commandList, @NotNull final GuiFactory guiFactory)
 Creates a new instance. More...
 
void notifyOpen ()
 Called each time the enclosing dialog is opened (or raised). More...
 
- Public Member Functions inherited from com.realtime.crossfire.jxclient.gui.textinput.GUIText
Dimension getMaximumSize ()
 
Dimension getMinimumSize ()
 
Dimension getPreferredSize ()
 
String getText ()
 Returns the entered text. More...
 
boolean keyPressed (@NotNull final KeyEvent2 e)
 Invoked when a key has been pressed. More...
 
void mouseClicked (@NotNull final MouseEvent e)
 Will be called when the user has clicked (pressed+released) this element. More...
 
void paintComponent (@NotNull final Graphics g)
 
void setHideInput (final boolean hideInput)
 Enables or disables hidden text. More...
 
void setText (@NotNull final String text)
 Sets the entered text. More...
 
- Public Member Functions inherited from com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement
void activateNextElement ()
 Activates the following element. More...
 
void activatePrevElement ()
 Activates the previous element. More...
 
boolean isActive ()
 Returns whether a GUI element is active. More...
 
void mousePressed (@NotNull final MouseEvent e)
 Will be called when the user has pressed the mouse inside this element. More...
 
void setActive (final boolean active)
 Sets the active state of a GUI element. More...
 
void setNextActive (@NotNull final ActivatableGUIElement next)
 Sets the next activatable GUI element in the same dialog. More...
 
void setPrevActive (@NotNull final ActivatableGUIElement prev)
 Sets the previous activatable GUI element in the same dialog. More...
 
- Public Member Functions inherited from com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement
void dispose ()
 Releases all allocated resources. More...
 
int getDialogBorderBottom ()
 Returns the size of the dialog's bottom border. More...
 
int getDialogBorderLeft ()
 Returns the size of the dialog's left border. More...
 
int getDialogBorderRight ()
 Returns the size of the dialog's right border. More...
 
int getDialogBorderTop ()
 Returns the size of the dialog's top border. More...
 
String getName ()
 Returns the internal name of this gui element. More...
 
void inhibitListeners ()
 Prevents change listeners to be notified. More...
 
boolean isDefault ()
 Returns whether this element is the default element. More...
 
boolean isIgnore ()
 Returns whether this gui element is to be ignored for user interaction. More...
 
void mouseDragged (@NotNull final MouseEvent e)
 Will be called when the mouse moves within this component while the button is pressed. More...
 
void mouseEntered (@NotNull final MouseEvent e)
 Will be called when the mouse has entered the bounding box of this element. More...
 
void mouseExited (@NotNull final MouseEvent e)
 Will be called when the mouse has left the bounding box of this element. More...
 
void mouseMoved (@NotNull final MouseEvent e)
 Will be called when the mouse moves within this component. More...
 
void mouseReleased (@NotNull final MouseEvent e)
 Will be called when the user has released the mouse. More...
 
void mouseWheelMoved (final int wheelRotation)
 Will be called when the mouse wheel has been moved. More...
 
void setChanged ()
 Records that the contents have changed and must be repainted. More...
 
void setChangedListener (@Nullable final GUIElementChangedListener changedListener)
 Sets the GUIElementChangedListener to be notified. More...
 
void setDefault (final boolean isDefault)
 Sets whether this element is the default element. More...
 
void setIgnore ()
 Marks this gui element to be ignored for user interaction. More...
 
String toString ()
 

Protected Member Functions

void execute (@NotNull final String command)
 Will be called to execute the entered command. More...
 
- Protected Member Functions inherited from com.realtime.crossfire.jxclient.gui.textinput.GUIText
void activeChanged ()
 Will be called whenever the active state has changed. More...
 
 GUIText (@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 GuiFactory guiFactory)
 Creates a new instance. More...
 
- Protected Member Functions inherited from com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement
 ActivatableGUIElement (@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, final boolean opaque, @NotNull final GuiFactory guiFactory)
 Creates a new instance. More...
 
void markInactivePending ()
 Marks this GUI element as pending inactive. More...
 
void setInactiveIfPending ()
 Unsets the active state of this GUI element if it is pending. More...
 
- Protected Member Functions inherited from com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement
 AbstractGUIElement (@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, final boolean opaque, @NotNull final GuiFactory guiFactory)
 Creates a new instance. More...
 
TooltipText newTooltipText (@Nullable final String tooltipText)
 Creates a TooltipText instance relative to this instance. More...
 
void tooltipChanged ()
 Must be called whenever the tooltip may have changed. More...
 

Private Attributes

final CommandList commandList
 The CommandList for executing commands. More...
 

Static Private Attributes

static final long serialVersionUID = 1
 The serial version UID. More...
 

Detailed Description

A text input field which executes a CommandList when ENTER is pressed.

Author
Andreas Kirschbaum

Definition at line 43 of file GUITextField.java.

Constructor & Destructor Documentation

◆ GUITextField()

com.realtime.crossfire.jxclient.gui.textinput.GUITextField.GUITextField ( @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 CommandList  commandList,
@NotNull final GuiFactory  guiFactory 
)

Creates a new instance.

Parameters
commandCallbackthe command callback to use
commandHistorythe command history to use or
null
to disable command history access
tooltipManagerthe tooltip manager to update
elementListenerthe element listener to notify
namethe name of this element
newCharModelthe new char model to show
activeImagethe element's background image when it is active
inactiveImagethe element's background image when it is inactive
fontthe font for rendering displayed text
inactiveColorthe color for rendering displayed text when the element is active; also cursor color
activeColorthe color for rendering displayed text when the element is active
marginthe left margin in pixels
textthe initially entered text
commandListthe command list for executing commands
guiFactorythe global GUI factory instance

Definition at line 77 of file GUITextField.java.

References com.realtime.crossfire.jxclient.gui.textinput.GUIText.activeColor, com.realtime.crossfire.jxclient.gui.textinput.GUIText.activeImage, com.realtime.crossfire.jxclient.gui.textinput.GUIText.commandCallback, com.realtime.crossfire.jxclient.gui.textinput.GUIText.commandHistory, com.realtime.crossfire.jxclient.gui.textinput.GUITextField.commandList, com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement.elementListener, com.realtime.crossfire.jxclient.gui.textinput.GUIText.font, com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.guiFactory, com.realtime.crossfire.jxclient.gui.textinput.GUIText.inactiveColor, com.realtime.crossfire.jxclient.gui.textinput.GUIText.inactiveImage, com.realtime.crossfire.jxclient.gui.textinput.GUIText.margin, com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.name, com.realtime.crossfire.jxclient.gui.textinput.GUIText.newCharModel, com.realtime.crossfire.jxclient.gui.textinput.GUIText.text, and com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.tooltipManager.

Member Function Documentation

◆ execute() [1/2]

void com.realtime.crossfire.jxclient.gui.textinput.GUITextField.execute ( )

Executes the actions associated with this GUI element.

Does nothing if this element has no associated actions.

Reimplemented from com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement.

Definition at line 98 of file GUITextField.java.

◆ execute() [2/2]

void com.realtime.crossfire.jxclient.gui.textinput.GUITextField.execute ( @NotNull final String  command)
protected

Will be called to execute the entered command.

Parameters
commandthe entered command

Reimplemented from com.realtime.crossfire.jxclient.gui.textinput.GUIText.

Definition at line 83 of file GUITextField.java.

References com.realtime.crossfire.jxclient.gui.textinput.GUITextField.commandList, and com.realtime.crossfire.jxclient.gui.commandlist.CommandList.execute().

+ Here is the call graph for this function:

◆ getTooltip()

TooltipText com.realtime.crossfire.jxclient.gui.textinput.GUITextField.getTooltip ( )

Returns the current tooltip text.

Returns
the tooltip text or
null
to not show a tooltip

Reimplemented from com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.

Definition at line 93 of file GUITextField.java.

◆ notifyOpen()

void com.realtime.crossfire.jxclient.gui.textinput.GUITextField.notifyOpen ( )

Called each time the enclosing dialog is opened (or raised).

Implements com.realtime.crossfire.jxclient.gui.gui.GUIElement.

Definition at line 88 of file GUITextField.java.

Member Data Documentation

◆ commandList

final CommandList com.realtime.crossfire.jxclient.gui.textinput.GUITextField.commandList
private

◆ serialVersionUID

final long com.realtime.crossfire.jxclient.gui.textinput.GUITextField.serialVersionUID = 1
staticprivate

The serial version UID.

Definition at line 48 of file GUITextField.java.


The documentation for this class was generated from the following file: