Crossfire JXClient, Trunk
|
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 |
Manages the tooltip display. An AbstractLabel is moved/resized to display a tooltip text for an "active" GUI element.
Definition at line 38 of file TooltipManagerImpl.java.
|
private |
Adds or updates the tooltip (text and location) for the activeGuiElement.
Definition at line 164 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.gui.gui.TooltipText.getH(), com.realtime.crossfire.jxclient.gui.gui.TooltipText.getText(), com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.getTooltip(), com.realtime.crossfire.jxclient.gui.gui.TooltipText.getW(), com.realtime.crossfire.jxclient.gui.gui.TooltipText.getX(), com.realtime.crossfire.jxclient.gui.gui.TooltipText.getY(), com.realtime.crossfire.jxclient.gui.label.AbstractLabel.setText(), com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.tooltip, com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.TOOLTIP_DISTANCE, com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.windowHeight, and com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.windowWidth.
Referenced by com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.setElement().
|
private |
Removes the tooltip label. Does nothing if no tooltip is active.
Definition at line 203 of file TooltipManagerImpl.java.
References com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.activeGuiElementSync, and com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.tooltip.
Referenced by com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.setElement(), and com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.unsetElement().
void com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.reset | ( | ) |
Removes the tooltip. Does nothing if no tooltip is active.
Definition at line 117 of file TooltipManagerImpl.java.
References com.realtime.crossfire.jxclient.util.SwingUtilities2.invokeAndWait(), and com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.resetRunnable.
Referenced by com.realtime.crossfire.jxclient.window.GuiManager.showGUIMain(), com.realtime.crossfire.jxclient.window.GuiManager.showGUIMeta(), and com.realtime.crossfire.jxclient.window.GuiManager.showGUIStart().
void com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.setElement | ( | @NotNull final AbstractGUIElement | guiElement | ) |
Displays the tooltip for a GUI element.
guiElement | the GUI element to show the tooltip of |
Implements com.realtime.crossfire.jxclient.gui.gui.TooltipManager.
Definition at line 122 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.gui.label.TooltipManagerImpl.addTooltip(), com.realtime.crossfire.jxclient.util.SwingUtilities2.invokeAndWait(), and com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.removeTooltip().
void com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.setScreenSize | ( | final int | windowWidth, |
final int | windowHeight | ||
) |
Updates the current window size.
windowWidth | the window width |
windowHeight | the 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().
void com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.setTooltip | ( | @Nullable final AbstractLabel | tooltip | ) |
Sets the tooltip label.
tooltip | the tooltip label, or null
|
Definition at line 108 of file TooltipManagerImpl.java.
References com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.activeGuiElementSync, and com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.tooltip.
Referenced by com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.attach(), and com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.detach().
void com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.tooltipTextChanged | ( | @NotNull final GUIElement | element | ) |
Reports a possibly changed tooltip text.
element | the 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().
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.
guiElement | the 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().
|
private |
The last known active gui element. It is used to suppress unnecessary change events to the tooltip label.
Definition at line 67 of file TooltipManagerImpl.java.
Referenced by com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.addTooltip(), com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.setElement(), com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.tooltipTextChanged(), and com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.unsetElement().
|
private |
Synchronizes accesses to activeGuiElement.
Definition at line 73 of file TooltipManagerImpl.java.
Referenced by com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.addTooltip(), com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.removeTooltip(), com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.setElement(), com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.setScreenSize(), com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.setTooltip(), com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.tooltipTextChanged(), and com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.unsetElement().
|
private |
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().
|
private |
The tooltip label. Set to
if the skin does not use tooltips.
Definition at line 60 of file TooltipManagerImpl.java.
Referenced by com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.addTooltip(), com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.removeTooltip(), and com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.setTooltip().
|
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().
|
private |
The current window height.
Definition at line 53 of file TooltipManagerImpl.java.
Referenced by com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.addTooltip(), and com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.setScreenSize().
|
private |
The current window width.
Definition at line 48 of file TooltipManagerImpl.java.
Referenced by com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.addTooltip(), and com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.setScreenSize().