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

Public Member Functions

void button1Clicked (final int modifiers)
 
void button2Clicked (final int modifiers)
 
void button3Clicked (final int modifiers)
 
boolean canScroll (final int distance)
 
void dispose ()
 
Dimension getMinimumSize ()
 
Dimension getPreferredSize ()
 
TooltipText getTooltip ()
 
 GUIItemShortcut (@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, @Nullable final Color activateColor, @Nullable final Image activateImage, @Nullable final Color immediateColor, @Nullable final Image immediateImage, @NotNull final ShortcutSlot shortcutSlot, @NotNull final FacesManager facesManager, @NotNull final CommandExecutor commandExecutor, @NotNull final Shortcuts shortcuts, @NotNull final Font font, @NotNull final GuiFactory guiFactory)
 
void notifyOpen ()
 
void paintComponent (@NotNull final Graphics g)
 
void resetScroll ()
 
void scroll (final int distance)
 
- Public Member Functions inherited from com.realtime.crossfire.jxclient.gui.item.GUIItem
void activeChanged ()
 
void execute ()
 
void mouseClicked (@NotNull final MouseEvent e)
 
void setVisible (final boolean aFlag)
 
- Public Member Functions inherited from com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement
void activateNextElement ()
 
void activatePrevElement ()
 
boolean isActive ()
 
void mousePressed (@NotNull final MouseEvent e)
 
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 mouseExited (@NotNull final MouseEvent e)
 
void mouseMoved (@NotNull final MouseEvent e)
 
void mouseReleased (@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 ()
 

Private Member Functions

Shortcut getShortcut ()
 
void setShortcut (@Nullable final Shortcut shortcut)
 

Static Private Member Functions

static Dimension getMinimumSizeInt ()
 

Private Attributes

final Color activateColor
 
final Image activateImage
 
final CommandExecutor commandExecutor
 
final FacesManager facesManager
 
final FacesManagerListener facesManagerListener
 
final Font font
 
final Color immediateColor
 
final Image immediateImage
 
Shortcut shortcut
 
final ShortcutListener shortcutListener
 
final Shortcuts shortcuts
 
final ShortcutsListener shortcutsListener
 
final ShortcutSlot shortcutSlot
 
final Object sync = new Object()
 

Static Private Attributes

static final Color BACKGROUND_COLOR = new Color(0, 0, 0, 0.0f)
 
static final String DEFAULT_TOOLTIP_TEXT = "(empty)"
 
static final long serialVersionUID = 1
 

Additional Inherited Members

- Protected Member Functions inherited from com.realtime.crossfire.jxclient.gui.item.GUIItem
 GUIItem (@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, @NotNull final GuiFactory guiFactory)
 
- 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 ()
 

Detailed Description

Displays a shortcut command.

Author
Andreas Kirschbaum

Definition at line 52 of file GUIItemShortcut.java.

Constructor & Destructor Documentation

◆ GUIItemShortcut()

com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.GUIItemShortcut ( @NotNull final TooltipManager  tooltipManager,
@NotNull final GUIElementListener  elementListener,
@NotNull final String  name,
@Nullable final Color  activateColor,
@Nullable final Image  activateImage,
@Nullable final Color  immediateColor,
@Nullable final Image  immediateImage,
@NotNull final ShortcutSlot  shortcutSlot,
@NotNull final FacesManager  facesManager,
@NotNull final CommandExecutor  commandExecutor,
@NotNull final Shortcuts  shortcuts,
@NotNull final Font  font,
@NotNull final GuiFactory  guiFactory 
)

Creates a new instance.

Parameters
tooltipManagerthe tooltip manager to update
elementListenerthe element listener to notify
namethe name of this element
activateColorthe background color for shortcuts that activate the command
activateImagethe overlay image for shortcuts that activate the command
immediateColorthe background color for shortcuts that immediately execute the command
immediateImagethe overlay image for shortcuts that immediately execute the command
shortcutSlotthe shortcut slot
facesManagerthe faces manager instance for looking up faces
commandExecutorthe command executor for executing commands
shortcutsthe shortcuts instance for looking up shortcuts
fontthe font for displaying the key that activates the shortcut
guiFactorythe global GUI factory instance

Definition at line 204 of file GUIItemShortcut.java.

References com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.activateColor, com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.activateImage, com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.commandExecutor, com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement.elementListener, com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.facesManager, com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.facesManagerListener, com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.font, com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.guiFactory, com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.immediateColor, com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.immediateImage, com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.name, com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.shortcuts, com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.shortcutsListener, com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.shortcutSlot, and com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.tooltipManager.

Member Function Documentation

◆ button1Clicked()

void com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.button1Clicked ( final int  modifiers)

◆ button2Clicked()

void com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.button2Clicked ( final int  modifiers)

◆ button3Clicked()

void com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.button3Clicked ( final int  modifiers)

Called when the right mouse button was pressed.

Parameters
modifiersthe input event modifiers

Reimplemented from com.realtime.crossfire.jxclient.gui.item.GUIItem.

Definition at line 304 of file GUIItemShortcut.java.

◆ canScroll()

boolean com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.canScroll ( final int  distance)

Returns whether scrolling is possible.

Parameters
distancethe distance to scroll
Returns
whether scrolling is possible

Implements com.realtime.crossfire.jxclient.gui.scrollable.GUIScrollable.

Definition at line 361 of file GUIItemShortcut.java.

◆ dispose()

void com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.dispose ( )

◆ getMinimumSize()

Dimension com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.getMinimumSize ( )

Definition at line 347 of file GUIItemShortcut.java.

References com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.getMinimumSizeInt().

Here is the call graph for this function:

◆ getMinimumSizeInt()

static Dimension com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.getMinimumSizeInt ( )
staticprivate

Returns the minimal size to display this component.

Returns
the minimal size

Definition at line 356 of file GUIItemShortcut.java.

Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.getMinimumSize(), and com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.getPreferredSize().

Here is the caller graph for this function:

◆ getPreferredSize()

Dimension com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.getPreferredSize ( )

Definition at line 340 of file GUIItemShortcut.java.

References com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.getMinimumSizeInt().

Here is the call graph for this function:

◆ getShortcut()

Shortcut com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.getShortcut ( )
private

◆ getTooltip()

TooltipText com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.getTooltip ( )

◆ notifyOpen()

void com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.notifyOpen ( )

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

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

Definition at line 246 of file GUIItemShortcut.java.

◆ paintComponent()

void com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.paintComponent ( @NotNull final Graphics  g)

◆ resetScroll()

void com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.resetScroll ( )

Resets the scroll index to the default value.

Implements com.realtime.crossfire.jxclient.gui.scrollable.GUIScrollable.

Definition at line 370 of file GUIItemShortcut.java.

◆ scroll()

void com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.scroll ( final int  distance)

Scrolls the element.

Parameters
distancethe distance to scroll

Implements com.realtime.crossfire.jxclient.gui.scrollable.GUIScrollable.

Definition at line 366 of file GUIItemShortcut.java.

◆ setShortcut()

void com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.setShortcut ( @Nullable final Shortcut  shortcut)
private

Member Data Documentation

◆ activateColor

final Color com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.activateColor
private

The background color for shortcuts that activate the command.

Definition at line 94 of file GUIItemShortcut.java.

Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.GUIItemShortcut(), and com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.paintComponent().

◆ activateImage

final Image com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.activateImage
private

◆ BACKGROUND_COLOR

final Color com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.BACKGROUND_COLOR = new Color(0, 0, 0, 0.0f)
staticprivate

The background color of this item.

Definition at line 63 of file GUIItemShortcut.java.

Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.paintComponent().

◆ commandExecutor

final CommandExecutor com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.commandExecutor
private

◆ DEFAULT_TOOLTIP_TEXT

final String com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.DEFAULT_TOOLTIP_TEXT = "(empty)"
staticprivate

The default tooltip text for empty slots.

Definition at line 69 of file GUIItemShortcut.java.

Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.getTooltip().

◆ facesManager

final FacesManager com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.facesManager
private

◆ facesManagerListener

final FacesManagerListener com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.facesManagerListener
private
Initial value:
= new FacesManagerListener() {
@Override
public void faceUpdated(@NotNull final Face face) {
final Shortcut shortcut = getShortcut();
if (shortcut != null && shortcut.displaysFace(face)) {
}
}
}

The FacesManagerListener registered to detect updated faces.

Definition at line 173 of file GUIItemShortcut.java.

Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.dispose(), and com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.GUIItemShortcut().

◆ font

final Font com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.font
private

◆ immediateColor

final Color com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.immediateColor
private

The background color for shortcuts that immediately execute the command.

Definition at line 106 of file GUIItemShortcut.java.

Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.GUIItemShortcut(), and com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.paintComponent().

◆ immediateImage

final Image com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.immediateImage
private

The overlay image for shortcuts that immediately execute the command.

Definition at line 112 of file GUIItemShortcut.java.

Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.GUIItemShortcut(), and com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.paintComponent().

◆ serialVersionUID

final long com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.serialVersionUID = 1
staticprivate

The serial version UID.

Definition at line 57 of file GUIItemShortcut.java.

◆ shortcut

Shortcut com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.shortcut
private

◆ shortcutListener

final ShortcutListener com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.shortcutListener
private
Initial value:
= () -> {
}

The ShortcutListener attached to shortcut.

Definition at line 164 of file GUIItemShortcut.java.

Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.setShortcut().

◆ shortcuts

final Shortcuts com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.shortcuts
private

◆ shortcutsListener

final ShortcutsListener com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.shortcutsListener
private
Initial value:
= new ShortcutsListener() {
@Override
public void shortcutAdded(@NotNull final ShortcutSlot shortcutSlot, @NotNull final Shortcut shortcut) {
if (shortcutSlot == GUIItemShortcut.this.shortcutSlot) {
}
}
@Override
public void shortcutRemoved(@NotNull final ShortcutSlot shortcutSlot, @NotNull final Shortcut shortcut) {
if (shortcutSlot == GUIItemShortcut.this.shortcutSlot) {
setShortcut(null);
}
}
}

The ShortcutsListener attached to shortcuts.

Definition at line 143 of file GUIItemShortcut.java.

Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.dispose(), and com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.GUIItemShortcut().

◆ shortcutSlot

final ShortcutSlot com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.shortcutSlot
private

◆ sync

final Object com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.sync = new Object()
private

The documentation for this class was generated from the following file:
com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.GUIItemShortcut
GUIItemShortcut(@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, @Nullable final Color activateColor, @Nullable final Image activateImage, @Nullable final Color immediateColor, @Nullable final Image immediateImage, @NotNull final ShortcutSlot shortcutSlot, @NotNull final FacesManager facesManager, @NotNull final CommandExecutor commandExecutor, @NotNull final Shortcuts shortcuts, @NotNull final Font font, @NotNull final GuiFactory guiFactory)
Definition: GUIItemShortcut.java:204
com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.tooltipChanged
void tooltipChanged()
Definition: AbstractGUIElement.java:265
com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.shortcutSlot
final ShortcutSlot shortcutSlot
Definition: GUIItemShortcut.java:124
com.realtime.crossfire.jxclient.shortcuts.Shortcut.displaysFace
boolean displaysFace(@NotNull final Face face)
Definition: Shortcut.java:141
com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.setShortcut
void setShortcut(@Nullable final Shortcut shortcut)
Definition: GUIItemShortcut.java:254
com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.setChanged
void setChanged()
Definition: AbstractGUIElement.java:223
com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.getShortcut
Shortcut getShortcut()
Definition: GUIItemShortcut.java:232
com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.shortcut
Shortcut shortcut
Definition: GUIItemShortcut.java:137