![]() |
Crossfire JXClient, Trunk
|
A GUIElement that displays a spinner. More...
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) |
![]() | |
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... | |
![]() | |
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... | |
![]() | |
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... | |
![]() | |
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... | |
A GUIElement that displays a spinner.
Definition at line 53 of file GUISpinner.java.
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 | ||
) |
Creates a new instance.
tooltipManager | the tooltip manager to update |
elementListener | the element listener to notify |
name | the name of this element |
stat | the stat to show |
newCharModel | the model to display |
guiFactory | the global GUI factory instance |
Definition at line 110 of file GUISpinner.java.
References com.realtime.crossfire.jxclient.gui.misc.GUISpinner.border, com.realtime.crossfire.jxclient.gui.misc.GUISpinner.changeListener, com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement.elementListener, com.realtime.crossfire.jxclient.character.NewCharInfo.getMaxValue(), com.realtime.crossfire.jxclient.character.NewCharInfo.getMinValue(), com.realtime.crossfire.jxclient.gui.label.NewCharModel.getNewCharacterInformation(), com.realtime.crossfire.jxclient.character.NewCharacterInformation.getNewCharInfo(), com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.guiFactory, com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.name, com.realtime.crossfire.jxclient.gui.misc.GUISpinner.newCharModel, com.realtime.crossfire.jxclient.gui.misc.GUISpinner.spinner, com.realtime.crossfire.jxclient.gui.misc.GUISpinner.spinnerModel, com.realtime.crossfire.jxclient.gui.misc.GUISpinner.stat, and com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.tooltipManager.
|
protected |
Will be called whenever the active state has changed.
Reimplemented from com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement.
Definition at line 184 of file GUISpinner.java.
References com.realtime.crossfire.jxclient.gui.misc.GUISpinner.border, com.realtime.crossfire.jxclient.character.NewCharInfo.getMaxValue(), com.realtime.crossfire.jxclient.character.NewCharInfo.getMinValue(), com.realtime.crossfire.jxclient.gui.label.NewCharModel.getNewCharacterInformation(), com.realtime.crossfire.jxclient.character.NewCharacterInformation.getNewCharInfo(), com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement.isActive(), com.realtime.crossfire.jxclient.gui.misc.GUISpinner.newCharModel, com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.setChanged(), com.realtime.crossfire.jxclient.gui.misc.GUISpinner.spinner, and com.realtime.crossfire.jxclient.gui.misc.GUISpinner.value.
void com.realtime.crossfire.jxclient.gui.misc.GUISpinner.dispose | ( | ) |
Releases all allocated resources.
Reimplemented from com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.
Definition at line 128 of file GUISpinner.java.
References com.realtime.crossfire.jxclient.gui.misc.GUISpinner.changeListener, and com.realtime.crossfire.jxclient.gui.misc.GUISpinner.spinner.
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.
Dimension com.realtime.crossfire.jxclient.gui.misc.GUISpinner.getMinimumSize | ( | ) |
Definition at line 165 of file GUISpinner.java.
References com.realtime.crossfire.jxclient.gui.misc.GUISpinner.spinner.
Dimension com.realtime.crossfire.jxclient.gui.misc.GUISpinner.getPreferredSize | ( | ) |
Definition at line 159 of file GUISpinner.java.
References com.realtime.crossfire.jxclient.gui.misc.GUISpinner.spinner.
TooltipText com.realtime.crossfire.jxclient.gui.misc.GUISpinner.getTooltip | ( | ) |
Returns the current tooltip text.
Reimplemented from com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.
Definition at line 135 of file GUISpinner.java.
boolean com.realtime.crossfire.jxclient.gui.misc.GUISpinner.keyPressed | ( | @NotNull final KeyEvent2 | e | ) |
Invoked when a key has been pressed.
e | the key event for the key |
Implements com.realtime.crossfire.jxclient.gui.gui.KeyPressedHandler.
Definition at line 203 of file GUISpinner.java.
References com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement.activateNextElement(), com.realtime.crossfire.jxclient.gui.misc.GUISpinner.border, com.realtime.crossfire.jxclient.character.NewCharInfo.getMaxValue(), com.realtime.crossfire.jxclient.character.NewCharInfo.getMinValue(), com.realtime.crossfire.jxclient.gui.label.NewCharModel.getNewCharacterInformation(), com.realtime.crossfire.jxclient.character.NewCharacterInformation.getNewCharInfo(), com.realtime.crossfire.jxclient.gui.misc.GUISpinner.newCharModel, com.realtime.crossfire.jxclient.gui.misc.GUISpinner.spinner, and com.realtime.crossfire.jxclient.gui.misc.GUISpinner.value.
void com.realtime.crossfire.jxclient.gui.misc.GUISpinner.notifyOpen | ( | ) |
Called each time the enclosing dialog is opened (or raised).
Implements com.realtime.crossfire.jxclient.gui.gui.GUIElement.
Definition at line 140 of file GUISpinner.java.
References com.realtime.crossfire.jxclient.character.NewCharInfo.getMaxValue(), com.realtime.crossfire.jxclient.character.NewCharInfo.getMinValue(), com.realtime.crossfire.jxclient.gui.label.NewCharModel.getNewCharacterInformation(), com.realtime.crossfire.jxclient.character.NewCharacterInformation.getNewCharInfo(), com.realtime.crossfire.jxclient.gui.misc.GUISpinner.newCharModel, com.realtime.crossfire.jxclient.gui.misc.GUISpinner.spinnerModel, com.realtime.crossfire.jxclient.gui.misc.GUISpinner.updateSelectedItem(), and com.realtime.crossfire.jxclient.gui.misc.GUISpinner.value.
void com.realtime.crossfire.jxclient.gui.misc.GUISpinner.setBounds | ( | final int | x, |
final int | y, | ||
final int | width, | ||
final int | height | ||
) |
Definition at line 171 of file GUISpinner.java.
References com.realtime.crossfire.jxclient.gui.misc.GUISpinner.spinner.
|
private |
Called whenever the selected item has changed.
Definition at line 179 of file GUISpinner.java.
References com.realtime.crossfire.jxclient.gui.misc.GUISpinner.newCharModel, com.realtime.crossfire.jxclient.gui.label.NewCharModel.setValue(), com.realtime.crossfire.jxclient.gui.misc.GUISpinner.spinnerModel, and com.realtime.crossfire.jxclient.gui.misc.GUISpinner.stat.
Referenced by com.realtime.crossfire.jxclient.gui.misc.GUISpinner.notifyOpen().
|
private |
The default border of spinner.
Definition at line 94 of file GUISpinner.java.
Referenced by com.realtime.crossfire.jxclient.gui.misc.GUISpinner.activeChanged(), com.realtime.crossfire.jxclient.gui.misc.GUISpinner.GUISpinner(), and com.realtime.crossfire.jxclient.gui.misc.GUISpinner.keyPressed().
|
private |
The ChangeListener for spinner.
Definition at line 88 of file GUISpinner.java.
Referenced by com.realtime.crossfire.jxclient.gui.misc.GUISpinner.dispose(), and com.realtime.crossfire.jxclient.gui.misc.GUISpinner.GUISpinner().
|
private |
The shown model.
Definition at line 70 of file GUISpinner.java.
Referenced by com.realtime.crossfire.jxclient.gui.misc.GUISpinner.activeChanged(), com.realtime.crossfire.jxclient.gui.misc.GUISpinner.GUISpinner(), com.realtime.crossfire.jxclient.gui.misc.GUISpinner.keyPressed(), com.realtime.crossfire.jxclient.gui.misc.GUISpinner.notifyOpen(), and com.realtime.crossfire.jxclient.gui.misc.GUISpinner.updateSelectedItem().
|
staticprivate |
The serial version UID.
Definition at line 58 of file GUISpinner.java.
|
private |
The Swing component that implements the combo box.
Definition at line 82 of file GUISpinner.java.
Referenced by com.realtime.crossfire.jxclient.gui.misc.GUISpinner.activeChanged(), com.realtime.crossfire.jxclient.gui.misc.GUISpinner.dispose(), com.realtime.crossfire.jxclient.gui.misc.GUISpinner.getMinimumSize(), com.realtime.crossfire.jxclient.gui.misc.GUISpinner.getPreferredSize(), com.realtime.crossfire.jxclient.gui.misc.GUISpinner.GUISpinner(), com.realtime.crossfire.jxclient.gui.misc.GUISpinner.keyPressed(), and com.realtime.crossfire.jxclient.gui.misc.GUISpinner.setBounds().
|
private |
The model for spinner.
Definition at line 76 of file GUISpinner.java.
Referenced by com.realtime.crossfire.jxclient.gui.misc.GUISpinner.GUISpinner(), com.realtime.crossfire.jxclient.gui.misc.GUISpinner.notifyOpen(), and com.realtime.crossfire.jxclient.gui.misc.GUISpinner.updateSelectedItem().
|
private |
The shown stat.
Definition at line 64 of file GUISpinner.java.
Referenced by com.realtime.crossfire.jxclient.gui.misc.GUISpinner.GUISpinner(), and com.realtime.crossfire.jxclient.gui.misc.GUISpinner.updateSelectedItem().
|
private |
The value currently being entered.
Set to 0 if none is being entered.
Definition at line 99 of file GUISpinner.java.
Referenced by com.realtime.crossfire.jxclient.gui.misc.GUISpinner.activeChanged(), com.realtime.crossfire.jxclient.gui.misc.GUISpinner.keyPressed(), and com.realtime.crossfire.jxclient.gui.misc.GUISpinner.notifyOpen().