Crossfire JXClient, Trunk
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
com.realtime.crossfire.jxclient.gui.button.AbstractButton Class Referenceabstract
Inheritance diagram for com.realtime.crossfire.jxclient.gui.button.AbstractButton:
Inheritance graph
Collaboration diagram for com.realtime.crossfire.jxclient.gui.button.AbstractButton:
Collaboration graph

Public Member Functions

void dispose ()
 
void execute ()
 
Dimension getMinimumSize ()
 
Dimension getPreferredSize ()
 
boolean keyPressed (@NotNull final KeyEvent2 e)
 
void mouseClicked (@NotNull final MouseEvent e)
 
void mouseExited (@NotNull final MouseEvent e)
 
void mousePressed (@NotNull final MouseEvent e)
 
void mouseReleased (@NotNull final MouseEvent e)
 
- Public Member Functions inherited from com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement
void activateNextElement ()
 
void activatePrevElement ()
 
boolean isActive ()
 
void setActive (final boolean active)
 
void setNextActive (@NotNull final ActivatableGUIElement next)
 
void setPrevActive (@NotNull final ActivatableGUIElement prev)
 
- Public Member Functions inherited from com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement
int getDialogBorderBottom ()
 
int getDialogBorderLeft ()
 
int getDialogBorderRight ()
 
int getDialogBorderTop ()
 
String getName ()
 
abstract TooltipText getTooltip ()
 
void inhibitListeners ()
 
boolean isDefault ()
 
boolean isIgnore ()
 
void mouseDragged (@NotNull final MouseEvent e)
 
void mouseEntered (@NotNull final MouseEvent e)
 
void mouseMoved (@NotNull final MouseEvent e)
 
void mouseWheelMoved (final int wheelRotation)
 
void setChanged ()
 
void setChangedListener (@Nullable final GUIElementChangedListener changedListener)
 
void setDefault (final boolean isDefault)
 
void setIgnore ()
 
String toString ()
 
- Public Member Functions inherited from com.realtime.crossfire.jxclient.gui.gui.GUIElement
void notifyOpen ()
 

Protected Member Functions

 AbstractButton (@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, final boolean opaque, final boolean autoRepeat, @NotNull final CommandList commandList, @NotNull final GuiFactory guiFactory, @NotNull final NewCharModel newCharModel)
 
abstract Dimension getMinimumSizeInt ()
 
- 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)
 
abstract void activeChanged ()
 
void markInactivePending ()
 
void setInactiveIfPending ()
 
- 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)
 
TooltipText newTooltipText (@Nullable final String tooltipText)
 
void tooltipChanged ()
 

Private Member Functions

void updateEnabled ()
 

Private Attributes

final boolean autoRepeat
 
final CommandList commandList
 
final NewCharModelListener listener = this::updateEnabled
 
final NewCharModel newCharModel
 
final ActionListener timeoutEvent = e -> execute()
 
final Timer timer = new Timer(TIMEOUT_FIRST, timeoutEvent)
 

Static Private Attributes

static final long serialVersionUID = 1
 
static final int TIMEOUT_FIRST = 350
 
static final int TIMEOUT_SECOND = 80
 

Detailed Description

Abstract base class for button classes.

Author
Andreas Kirschbaum

Definition at line 47 of file AbstractButton.java.

Constructor & Destructor Documentation

◆ AbstractButton()

com.realtime.crossfire.jxclient.gui.button.AbstractButton.AbstractButton ( @NotNull final TooltipManager  tooltipManager,
@NotNull final GUIElementListener  elementListener,
@NotNull final String  name,
final boolean  opaque,
final boolean  autoRepeat,
@NotNull final CommandList  commandList,
@NotNull final GuiFactory  guiFactory,
@NotNull final NewCharModel  newCharModel 
)
protected

Member Function Documentation

◆ dispose()

void com.realtime.crossfire.jxclient.gui.button.AbstractButton.dispose ( )

◆ execute()

void com.realtime.crossfire.jxclient.gui.button.AbstractButton.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 223 of file AbstractButton.java.

References com.realtime.crossfire.jxclient.gui.button.AbstractButton.commandList, and com.realtime.crossfire.jxclient.gui.commandlist.CommandList.execute().

Referenced by com.realtime.crossfire.jxclient.gui.button.AbstractButton.keyPressed(), com.realtime.crossfire.jxclient.gui.button.AbstractButton.mouseClicked(), and com.realtime.crossfire.jxclient.gui.button.AbstractButton.mousePressed().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMinimumSize()

Dimension com.realtime.crossfire.jxclient.gui.button.AbstractButton.getMinimumSize ( )

Definition at line 239 of file AbstractButton.java.

References com.realtime.crossfire.jxclient.gui.button.AbstractButton.getMinimumSizeInt().

Here is the call graph for this function:

◆ getMinimumSizeInt()

abstract Dimension com.realtime.crossfire.jxclient.gui.button.AbstractButton.getMinimumSizeInt ( )
abstractprotected

◆ getPreferredSize()

Dimension com.realtime.crossfire.jxclient.gui.button.AbstractButton.getPreferredSize ( )

Definition at line 232 of file AbstractButton.java.

References com.realtime.crossfire.jxclient.gui.button.AbstractButton.getMinimumSizeInt().

Here is the call graph for this function:

◆ keyPressed()

boolean com.realtime.crossfire.jxclient.gui.button.AbstractButton.keyPressed ( @NotNull final KeyEvent2  e)

Invoked when a key has been pressed.

Parameters
ethe key event for the key
Returns
whether the key event has been consumed

Implements com.realtime.crossfire.jxclient.gui.gui.KeyPressedHandler.

Definition at line 251 of file AbstractButton.java.

References com.realtime.crossfire.jxclient.gui.button.AbstractButton.execute().

Here is the call graph for this function:

◆ mouseClicked()

void com.realtime.crossfire.jxclient.gui.button.AbstractButton.mouseClicked ( @NotNull final MouseEvent  e)

Will be called when the user has clicked (pressed+released) this element. This event will be delivered after mouseReleased(MouseEvent).

Parameters
ethe mouse event relative to this element

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

Definition at line 134 of file AbstractButton.java.

References com.realtime.crossfire.jxclient.gui.button.AbstractButton.autoRepeat, com.realtime.crossfire.jxclient.gui.button.AbstractButton.execute(), and com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement.setActive().

Here is the call graph for this function:

◆ mouseExited()

void com.realtime.crossfire.jxclient.gui.button.AbstractButton.mouseExited ( @NotNull final MouseEvent  e)

Will be called when the mouse has left the bounding box of this element. This function will not be called unless mouseEntered(MouseEvent) has been called before.

Parameters
ethe mouse event relative to this element

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

Definition at line 209 of file AbstractButton.java.

References com.realtime.crossfire.jxclient.gui.button.AbstractButton.autoRepeat, com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement.setActive(), and com.realtime.crossfire.jxclient.gui.button.AbstractButton.timer.

Here is the call graph for this function:

◆ mousePressed()

void com.realtime.crossfire.jxclient.gui.button.AbstractButton.mousePressed ( @NotNull final MouseEvent  e)

Will be called when the user has pressed the mouse inside this element.

Parameters
ethe mouse event relative to this element

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

Definition at line 184 of file AbstractButton.java.

References com.realtime.crossfire.jxclient.gui.button.AbstractButton.autoRepeat, com.realtime.crossfire.jxclient.gui.button.AbstractButton.execute(), and com.realtime.crossfire.jxclient.gui.button.AbstractButton.timer.

Here is the call graph for this function:

◆ mouseReleased()

void com.realtime.crossfire.jxclient.gui.button.AbstractButton.mouseReleased ( @NotNull final MouseEvent  e)

Will be called when the user has released the mouse. This event may be delivered even if no previous mousePressed(MouseEvent) has been delivered before.

Parameters
ethe mouse event relative to this element

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

Definition at line 159 of file AbstractButton.java.

References com.realtime.crossfire.jxclient.gui.button.AbstractButton.autoRepeat, com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement.setActive(), and com.realtime.crossfire.jxclient.gui.button.AbstractButton.timer.

Here is the call graph for this function:

◆ updateEnabled()

void com.realtime.crossfire.jxclient.gui.button.AbstractButton.updateEnabled ( )
private

Updates the enabled state.

Definition at line 269 of file AbstractButton.java.

References com.realtime.crossfire.jxclient.gui.label.NewCharModel.hasNonServerFailureErrorText(), and com.realtime.crossfire.jxclient.gui.button.AbstractButton.newCharModel.

Referenced by com.realtime.crossfire.jxclient.gui.button.AbstractButton.AbstractButton().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ autoRepeat

final boolean com.realtime.crossfire.jxclient.gui.button.AbstractButton.autoRepeat
private

◆ commandList

final CommandList com.realtime.crossfire.jxclient.gui.button.AbstractButton.commandList
private

◆ listener

final NewCharModelListener com.realtime.crossfire.jxclient.gui.button.AbstractButton.listener = this::updateEnabled
private

◆ newCharModel

final NewCharModel com.realtime.crossfire.jxclient.gui.button.AbstractButton.newCharModel
private

◆ serialVersionUID

final long com.realtime.crossfire.jxclient.gui.button.AbstractButton.serialVersionUID = 1
staticprivate

The serial version UID.

Definition at line 52 of file AbstractButton.java.

◆ TIMEOUT_FIRST

final int com.realtime.crossfire.jxclient.gui.button.AbstractButton.TIMEOUT_FIRST = 350
staticprivate

The autorepeat delay initially.

Definition at line 57 of file AbstractButton.java.

◆ TIMEOUT_SECOND

final int com.realtime.crossfire.jxclient.gui.button.AbstractButton.TIMEOUT_SECOND = 80
staticprivate

The autorepeat delay for further repeats.

Definition at line 62 of file AbstractButton.java.

Referenced by com.realtime.crossfire.jxclient.gui.button.AbstractButton.AbstractButton().

◆ timeoutEvent

final ActionListener com.realtime.crossfire.jxclient.gui.button.AbstractButton.timeoutEvent = e -> execute()
private

The ActionListener for generating autorepeat events.

Definition at line 85 of file AbstractButton.java.

◆ timer

final Timer com.realtime.crossfire.jxclient.gui.button.AbstractButton.timer = new Timer(TIMEOUT_FIRST, timeoutEvent)
private

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