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

Public Member Functions

void reset ()
 
void setElement (@NotNull final AbstractGUIElement guiElement)
 
void setScreenSize (final int windowWidth, final int windowHeight)
 
void setTooltip (@Nullable final AbstractLabel tooltip)
 
void tooltipTextChanged (@NotNull final GUIElement element)
 
void unsetElement (@NotNull final AbstractGUIElement guiElement)
 

Private Member Functions

void addTooltip ()
 
void removeTooltip ()
 

Private Attributes

AbstractGUIElement activeGuiElement
 
final Object activeGuiElementSync = new Object()
 
final Runnable resetRunnable
 
AbstractLabel tooltip
 
int windowHeight
 
int windowWidth
 

Static Private Attributes

static final int TOOLTIP_DISTANCE = 8
 

Detailed Description

Manages the tooltip display. An AbstractLabel is moved/resized to display a tooltip text for an "active" GUI element.

Author
Andreas Kirschbaum

Definition at line 38 of file TooltipManagerImpl.java.

Member Function Documentation

◆ addTooltip()

void com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.addTooltip ( )
private

◆ removeTooltip()

void com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.removeTooltip ( )
private

◆ reset()

void com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.reset ( )

◆ setElement()

void com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.setElement ( @NotNull final AbstractGUIElement  guiElement)

◆ setScreenSize()

void com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.setScreenSize ( final int  windowWidth,
final int  windowHeight 
)

Updates the current window size.

Parameters
windowWidththe window width
windowHeightthe window height

Definition at line 97 of file TooltipManagerImpl.java.

References com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.activeGuiElementSync, com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.windowHeight, and com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.windowWidth.

Referenced by com.realtime.crossfire.jxclient.window.GuiManager.updateWindowSize().

Here is the caller graph for this function:

◆ setTooltip()

void com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.setTooltip ( @Nullable final AbstractLabel  tooltip)

◆ tooltipTextChanged()

void com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.tooltipTextChanged ( @NotNull final GUIElement  element)

Reports a possibly changed tooltip text.

Parameters
elementthe GUI element that may have changed

Implements com.realtime.crossfire.jxclient.gui.gui.TooltipManager.

Definition at line 150 of file TooltipManagerImpl.java.

References com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.activeGuiElement, com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.activeGuiElementSync, and com.realtime.crossfire.jxclient.util.SwingUtilities2.invokeLater().

Here is the call graph for this function:

◆ unsetElement()

void com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.unsetElement ( @NotNull final AbstractGUIElement  guiElement)

Removes the tooltip of a GUI element. Does nothing if the given GUI element is not active.

Parameters
guiElementthe gui element to remove the tooltip of

Implements com.realtime.crossfire.jxclient.gui.gui.TooltipManager.

Definition at line 138 of file TooltipManagerImpl.java.

References com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.activeGuiElement, com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.activeGuiElementSync, com.realtime.crossfire.jxclient.util.SwingUtilities2.invokeAndWait(), and com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.removeTooltip().

Here is the call graph for this function:

Member Data Documentation

◆ activeGuiElement

AbstractGUIElement com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.activeGuiElement
private

◆ activeGuiElementSync

final Object com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.activeGuiElementSync = new Object()
private

◆ resetRunnable

final Runnable com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.resetRunnable
private
Initial value:
= new Runnable() {
@Override
public void run() {
synchronized (activeGuiElementSync) {
}
}
}

The Runnable that implements the functionality of reset().

Definition at line 80 of file TooltipManagerImpl.java.

Referenced by com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.reset().

◆ tooltip

AbstractLabel com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.tooltip
private

◆ TOOLTIP_DISTANCE

final int com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.TOOLTIP_DISTANCE = 8
staticprivate

Distance of tooltip from its associated GUI element.

Definition at line 43 of file TooltipManagerImpl.java.

Referenced by com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.addTooltip().

◆ windowHeight

int com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.windowHeight
private

◆ windowWidth

int com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.windowWidth
private

The documentation for this class was generated from the following file:
com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.activeGuiElement
AbstractGUIElement activeGuiElement
Definition: TooltipManagerImpl.java:67
com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.activeGuiElementSync
final Object activeGuiElementSync
Definition: TooltipManagerImpl.java:73
com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.removeTooltip
void removeTooltip()
Definition: TooltipManagerImpl.java:203