java.lang.Object com.realtime.crossfire.jxclient.gui.gui.TooltipManager
public class TooltipManager
Manages the tooltip display. An AbstractLabel
is moved/resized to
display a tooltip text for an "active" GUI element.
Field Summary | |
---|---|
private GUIElement |
activeGuiElement
The last known active gui element. |
private java.lang.Object |
activeGuiElementSync
Synchronizes accesses to activeGuiElement . |
private AbstractLabel |
tooltip
The tooltip label. |
private static int |
TOOLTIP_DISTANCE
Distance of tooltip from its associated GUI element. |
private int |
windowHeight
The current window height. |
private int |
windowWidth
The current window width. |
Constructor Summary | |
---|---|
TooltipManager()
|
Method Summary | |
---|---|
private void |
addTooltip()
Adds or updates the tooltip (text and location) for the activeGuiElement . |
private void |
removeTooltip()
Removes the tooltip label. |
void |
reset()
Removes the tooltip. |
void |
setElement(GUIElement guiElement)
Displays the tooltip for a GUI element. |
void |
setScreenSize(int windowWidth,
int windowHeight)
Updates the current window size. |
void |
setTooltip(AbstractLabel tooltip)
Sets the tooltip label. |
void |
unsetElement(GUIElement guiElement)
Removes the tooltip of a GUI element. |
void |
updateElement(GUIElement guiElement)
Updates the tooltip text of a GUI element. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
@Nullable private GUIElement activeGuiElement
@NotNull private final java.lang.Object activeGuiElementSync
activeGuiElement
.
@Nullable private AbstractLabel tooltip
null
if the skin does not use
tooltips.
private static final int TOOLTIP_DISTANCE
private int windowHeight
private int windowWidth
Constructor Detail |
---|
public TooltipManager()
Method Detail |
---|
private void addTooltip()
activeGuiElement
.
private void removeTooltip()
public void reset()
public void setElement(@NotNull GUIElement guiElement)
guiElement
- the GUI element to show the tooltip ofpublic void setScreenSize(int windowWidth, int windowHeight)
windowWidth
- the window widthwindowHeight
- the window heightpublic void setTooltip(@Nullable AbstractLabel tooltip)
tooltip
- the tooltip label, or null
public void unsetElement(@NotNull GUIElement guiElement)
guiElement
- the gui element to remove the tooltip ofpublic void updateElement(@NotNull GUIElement guiElement)
guiElement
- the gui element to process