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

Public Member Functions

TooltipText getTooltip ()
 
 GUISelectableButton (@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, @NotNull final BufferedImage imageUp, @NotNull final BufferedImage imageDown, @NotNull final String tooltipText, final boolean autoRepeat, @NotNull final CommandList commandList, @NotNull final GuiFactory guiFactory, @NotNull final NewCharModel newCharModel)
 
void notifyOpen ()
 
void select (final boolean selected)
 
- Public Member Functions inherited from com.realtime.crossfire.jxclient.gui.button.AbstractButton2
Dimension getMaximumSize ()
 
void paintComponent (@NotNull final Graphics g)
 
- Public Member Functions inherited from com.realtime.crossfire.jxclient.gui.button.AbstractButton
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 ()
 
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 ()
 

Protected Member Functions

void activeChanged ()
 
boolean isSelected ()
 
- Protected Member Functions inherited from com.realtime.crossfire.jxclient.gui.button.AbstractButton2
 AbstractButton2 (@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, @NotNull final BufferedImage imageUp, @NotNull final BufferedImage imageDown, @Nullable final String text, @Nullable final Font font, @Nullable final Color color, final int textX, final int textY, final boolean autoRepeat, @NotNull final CommandList commandList, @NotNull final GuiFactory guiFactory, @NotNull final NewCharModel newCharModel)
 
Dimension getMinimumSizeInt ()
 
- Protected Member Functions inherited from 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 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)
 
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 Attributes

boolean selected
 
final String tooltipText
 

Static Private Attributes

static final long serialVersionUID = 1
 

Detailed Description

A GUIElement that implements a button. The button shows an image and optionally overlays a text string.

Author
Lauwenmark
Andreas Kirschbaum

Definition at line 42 of file GUISelectableButton.java.

Constructor & Destructor Documentation

◆ GUISelectableButton()

com.realtime.crossfire.jxclient.gui.button.GUISelectableButton.GUISelectableButton ( @NotNull final TooltipManager  tooltipManager,
@NotNull final GUIElementListener  elementListener,
@NotNull final String  name,
@NotNull final BufferedImage  imageUp,
@NotNull final BufferedImage  imageDown,
@NotNull final String  tooltipText,
final boolean  autoRepeat,
@NotNull final CommandList  commandList,
@NotNull final GuiFactory  guiFactory,
@NotNull final NewCharModel  newCharModel 
)

Creates a new instance. Both

and

must have the same size. The x/y coordinates specify the baseline of the first character of the overlay text.

Parameters
tooltipManagerthe tooltip manager to update
elementListenerthe element listener to notify
namethe name of this element
imageUpthe image in unselected state
imageDownthe image in selected state
tooltipTextthe tooltip text
autoRepeatwhether the button should autorepeat while being pressed
commandListthe commands to execute when the button is elected
guiFactorythe global GUI factory instance
newCharModelthe global new char model instance

Definition at line 76 of file GUISelectableButton.java.

References com.realtime.crossfire.jxclient.gui.button.AbstractButton.autoRepeat, com.realtime.crossfire.jxclient.gui.button.AbstractButton.commandList, com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement.elementListener, com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.guiFactory, com.realtime.crossfire.jxclient.gui.button.AbstractButton2.imageDown, com.realtime.crossfire.jxclient.gui.button.AbstractButton2.imageUp, com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.name, com.realtime.crossfire.jxclient.gui.button.AbstractButton.newCharModel, com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.tooltipManager, and com.realtime.crossfire.jxclient.gui.button.GUISelectableButton.tooltipText.

Member Function Documentation

◆ activeChanged()

void com.realtime.crossfire.jxclient.gui.button.GUISelectableButton.activeChanged ( )
protected

Will be called whenever the active state has changed.

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

Definition at line 93 of file GUISelectableButton.java.

◆ getTooltip()

TooltipText com.realtime.crossfire.jxclient.gui.button.GUISelectableButton.getTooltip ( )

Returns the current tooltip text.

Returns
the tooltip text or
null
to not show a tooltip

Reimplemented from com.realtime.crossfire.jxclient.gui.button.AbstractButton2.

Definition at line 99 of file GUISelectableButton.java.

References com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.newTooltipText(), and com.realtime.crossfire.jxclient.gui.button.GUISelectableButton.tooltipText.

Here is the call graph for this function:

◆ isSelected()

boolean com.realtime.crossfire.jxclient.gui.button.GUISelectableButton.isSelected ( )
protected

Returns which image should be shown.

Returns
false=show "up" image, true=show "down" image

Reimplemented from com.realtime.crossfire.jxclient.gui.button.AbstractButton2.

Definition at line 82 of file GUISelectableButton.java.

References com.realtime.crossfire.jxclient.gui.button.GUISelectableButton.selected.

◆ notifyOpen()

void com.realtime.crossfire.jxclient.gui.button.GUISelectableButton.notifyOpen ( )

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

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

Definition at line 104 of file GUISelectableButton.java.

◆ select()

void com.realtime.crossfire.jxclient.gui.button.GUISelectableButton.select ( final boolean  selected)

Selects or deselects the element.

Parameters
selectedwhether the element should be selected

Implements com.realtime.crossfire.jxclient.gui.button.GUISelectable.

Definition at line 87 of file GUISelectableButton.java.

References com.realtime.crossfire.jxclient.gui.button.GUISelectableButton.selected, and com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.setChanged().

Here is the call graph for this function:

Member Data Documentation

◆ selected

boolean com.realtime.crossfire.jxclient.gui.button.GUISelectableButton.selected
private

◆ serialVersionUID

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

The serial version UID.

Definition at line 47 of file GUISelectableButton.java.

◆ tooltipText

final String com.realtime.crossfire.jxclient.gui.button.GUISelectableButton.tooltipText
private

The documentation for this class was generated from the following file:
com.realtime.crossfire.jxclient.gui.button.AbstractButton2.imageDown
final Image imageDown
Definition: AbstractButton2.java:64
com.realtime.crossfire.jxclient.gui.button.AbstractButton2.imageUp
final Image imageUp
Definition: AbstractButton2.java:58