Crossfire JXClient, Trunk
com.realtime.crossfire.jxclient.gui.misc.GUISpinner Class Reference

A GUIElement that displays a spinner. More...

+ Inheritance diagram for com.realtime.crossfire.jxclient.gui.misc.GUISpinner:
+ Collaboration diagram for com.realtime.crossfire.jxclient.gui.misc.GUISpinner:

Public Member Functions

void dispose ()
 Releases all allocated resources. More...
 
void execute ()
 Executes the actions associated with this GUI element. More...
 
Dimension getMinimumSize ()
 
Dimension getPreferredSize ()
 
TooltipText getTooltip ()
 Returns the current tooltip text. More...
 
 GUISpinner (@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, @NotNull final NewcharStat stat, @NotNull final NewCharModel newCharModel, @NotNull final GuiFactory guiFactory)
 Creates a new instance. More...
 
boolean keyPressed (@NotNull final KeyEvent2 e)
 Invoked when a key has been pressed. More...
 
void notifyOpen ()
 Called each time the enclosing dialog is opened (or raised). More...
 
void setBounds (final int x, final int y, final int width, final int height)
 
- 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
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 mouseClicked (@NotNull final MouseEvent e)
 Will be called when the user has clicked (pressed+released) this element. 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 activeChanged ()
 Will be called whenever the active state has changed. 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 Member Functions

void updateSelectedItem ()
 Called whenever the selected item has changed. More...
 

Private Attributes

final Border border
 The default border of spinner. More...
 
final ChangeListener changeListener = e -> updateSelectedItem()
 The ChangeListener for spinner. More...
 
final NewCharModel newCharModel
 The shown model. More...
 
final JSpinner spinner
 The Swing component that implements the combo box. More...
 
final SpinnerNumberModel spinnerModel
 The model for spinner. More...
 
final NewcharStat stat
 The shown stat. More...
 
int value
 The value currently being entered. More...
 

Static Private Attributes

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

Detailed Description

A GUIElement that displays a spinner.

Author
Andreas Kirschbaum

Definition at line 53 of file GUISpinner.java.

Constructor & Destructor Documentation

◆ GUISpinner()

com.realtime.crossfire.jxclient.gui.misc.GUISpinner.GUISpinner ( @NotNull final TooltipManager  tooltipManager,
@NotNull final GUIElementListener  elementListener,
@NotNull final String  name,
@NotNull final NewcharStat  stat,
@NotNull final NewCharModel  newCharModel,
@NotNull final GuiFactory  guiFactory 
)

Member Function Documentation

◆ activeChanged()

◆ dispose()

void com.realtime.crossfire.jxclient.gui.misc.GUISpinner.dispose ( )

◆ execute()

void com.realtime.crossfire.jxclient.gui.misc.GUISpinner.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 199 of file GUISpinner.java.

◆ getMinimumSize()

Dimension com.realtime.crossfire.jxclient.gui.misc.GUISpinner.getMinimumSize ( )

◆ getPreferredSize()

Dimension com.realtime.crossfire.jxclient.gui.misc.GUISpinner.getPreferredSize ( )

◆ getTooltip()

TooltipText com.realtime.crossfire.jxclient.gui.misc.GUISpinner.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 135 of file GUISpinner.java.

◆ keyPressed()

◆ notifyOpen()

◆ setBounds()

void com.realtime.crossfire.jxclient.gui.misc.GUISpinner.setBounds ( final int  x,
final int  y,
final int  width,
final int  height 
)

◆ updateSelectedItem()

void com.realtime.crossfire.jxclient.gui.misc.GUISpinner.updateSelectedItem ( )
private

Member Data Documentation

◆ border

final Border com.realtime.crossfire.jxclient.gui.misc.GUISpinner.border
private

◆ changeListener

final ChangeListener com.realtime.crossfire.jxclient.gui.misc.GUISpinner.changeListener = e -> updateSelectedItem()
private

◆ newCharModel

◆ serialVersionUID

final long com.realtime.crossfire.jxclient.gui.misc.GUISpinner.serialVersionUID = 1
staticprivate

The serial version UID.

Definition at line 58 of file GUISpinner.java.

◆ spinner

◆ spinnerModel

final SpinnerNumberModel com.realtime.crossfire.jxclient.gui.misc.GUISpinner.spinnerModel
private

◆ stat

final NewcharStat com.realtime.crossfire.jxclient.gui.misc.GUISpinner.stat
private

◆ value

int com.realtime.crossfire.jxclient.gui.misc.GUISpinner.value
private

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