public class ToolTip
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) class |
ToolTip.TooltipWorker
Worker class for tooltips.
|
Modifier and Type | Field and Description |
---|---|
private ToolTip.TooltipWorker |
clock
Clock that times tooltip events (show and hide).
|
private static int |
DELAY_MS
The delay between mouse enter widget and draw tooltip, ms.
|
private static int |
DURATION_MS
The time the tooltip is shown without any action, ms.
|
private GuiDriver |
gd
Screen driver.
|
private static ToolTip |
instance
The ToolTip singleton.
|
private static int |
ORIGIN_SHIFT
The distance from mouse pointer coordinate to draw tooltip.
|
private static boolean |
sessionTooltips
Tooltips enabled by default for GUI.
|
Modifier | Constructor and Description |
---|---|
private |
ToolTip()
This constructor creates a tooltip object for given screen driver.
|
Modifier and Type | Method and Description |
---|---|
void |
activate(Widget<?> widget,
int fnt,
NativePoint orig)
Activates a tooltip.
|
void |
deactivate()
Stop the lifetime of the current tooltip, if any.
|
static ToolTip |
getInstance()
Obtain the singleton for this class.
|
static boolean |
getSessionTooltips()
Accesses the SESSION:TOOLTIPS attribute for this session.
|
static boolean |
isActive(java.lang.String tooltipTxt)
Checks if the given tooltip engine should be activated in a current conditions.
|
static void |
setSessionTooltips(boolean tooltips)
Sets the SESSION:TOOLTIPS attribute for this session.
|
private static final int ORIGIN_SHIFT
private static final int DELAY_MS
private static final int DURATION_MS
private static boolean sessionTooltips
private static ToolTip instance
private GuiDriver gd
private ToolTip.TooltipWorker clock
private ToolTip()
public static ToolTip getInstance()
ToolTip
singleton.public static boolean isActive(java.lang.String tooltipTxt)
false
or text does not exist, empty or unknown
value the tooltip will not be drawn.tooltipTxt
- Tooltip string to check.true
if the tooltip needs to be used, false
otherwise.public static void setSessionTooltips(boolean tooltips)
tooltips
- The new value for session related TOOLTIPS attribute.public static boolean getSessionTooltips()
true
if tooltips are available for this session false
otherwise.public void activate(Widget<?> widget, int fnt, NativePoint orig)
widget
- The widget's reference for tooltip.fnt
- The font to use to draw the tooltip.orig
- The origin of the mouse event that fired this activation.public void deactivate()