public class ToolTip extends BorderedPanelGuiImpl
| Modifier and Type | Class and Description |
|---|---|
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 FontDetails |
fd
Font Details
|
private GuiDriver |
gd
Screen driver.
|
private WidgetId |
id
Tooltip id
|
private static ToolTip |
instance
The ToolTip singleton.
|
private static java.util.regex.Pattern |
LINE_BREAK_PATTERN
Line break pattern
|
private static int |
ORIGIN_SHIFT
The distance from mouse pointer coordinate to draw tooltip.
|
private OverlayWindow |
overlayWindow
Overlay Window
|
private NativeRectangle |
rect
The rect where the tooltip will be placed.
|
private static boolean |
sessionTooltips
Tooltips enabled by default for GUI.
|
private java.lang.String |
text
Tooltip text
|
borderlisteners, location, mousePtr, nativeInsets, physicalLocation| 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,
java.awt.event.MouseEvent evt)
Activates a tooltip.
|
void |
activate(Widget<?> widget,
java.lang.String text,
java.awt.event.MouseEvent evt)
Activates a tooltip.
|
void |
deactivate()
Stop the lifetime of the current tooltip, if any.
|
void |
draw()
Draw tooltip.
|
ToolTip.TooltipWorker |
getClock()
Get the clock that times tooltip events (show and hide).
|
WidgetId |
getId()
Widget ID.
|
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.
|
boolean |
isClockActive()
Checks if the clock is still active.
|
protected int[] |
mouseActions()
Specifies the mouse actions that are relevant for this tooltip.
|
void |
mouseMoved(java.awt.event.MouseEvent e)
Handles the mouse moved event.
|
private java.lang.String |
processLine(java.lang.String line)
Process the original tooltip line in order to divide it if there's no space
to suffice the view of the entire tolltip line.
|
private java.lang.String |
processTooltipText(java.lang.String originalText)
Process the original tooltip text in order to add extra new lines if needed.
|
static void |
setSessionTooltips(boolean tooltips)
Sets the SESSION:TOOLTIPS attribute for this session.
|
drawPanel, is3DBorder, isRMBEntrySupported, set3DBorder, setColorResolver, setCustomDraw, setId, setOptionalDrawborder, insets, isTransparent, setBorder, setTransparentadd, add, add, addContainerStateListener, addDirectly, belongsTo, checkWidget, childrenLocation, clipping, clipRectangle, copyState, currentFocus, currentFocus, cycleFocus, defaultFocus, deregisterSelectedWidget, destroy, detach, dimension, doLayout, dumpCurrentWidgets, dumpWidgets, endSizeChange, findMouseSource, firstFocus, focus, focusTraversable, focusWorker, formatDump, get, getAllSelectedWidgets, getClipRect, getEffectiveScrollableSize, getFocusInt, getIgnoreFocus, getLayout, getScrollableSize, getTabItemList, hasFocusable, height, lastFocus, minimumSize, moveAfterTabItem, moveBeforeTabItem, moveToBottom, moveToBottomInClass, moveToTop, moveToTopInClass, moveToZpos, nextFocus, normalizeZOrder, onWidgetAdded, onWidgetRemoved, paintOnTop, parentOf, prepareWidgets, prevFocus, processKeyEvent, reflectAncestorChange, reflectLocationChanged, registerSelectedWidget, remove, removeContainerStateListener, repaint, replace, requestFocus, requestFocus, setFocus, setFocusInt, setHeight, setIgnoreFocus, setInsets, setLayout, setPhysicalDimensionInt, setSize, setSize, setTabItemList, setWidth, startSizeChange, swap, triggerContainerStateRedrawEnabled, unrealize, updateSizeWorker, widgets, widgetsAsList, widgetStateChanged, width_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, config, copyColors, createMouseHoverAction, deactivateDirectManipulation, debug, disable, disableTooltip, displayPhysicalLocation, drawCaret, enable, enableTooltip, enclosingFrame, forceCursorOnFocus, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCachedScreenLocation, getCachedScreenPhysicalLocation, getCustomMousePointer, getDefaultEvent, getEffectiveMousePointer, getLoadedMousePointer, getMenuMouse, getMouseActions, getMousePosition, getPortableMouseEventCoordinates, getSelectedText, getState, getTextHeight, getTextHeightNative, getTextHeightNative, getTextWidth, getTextWidth, getTextWidthNative, getTextWidthNative, getVisiblePart, getZOrderClass, hasFocus, hasTooltip, hidden, hide, highlighted, ignoreAction, initialHeight, initialWidth, isCurrent, isDirectManipulationActive, isDirectManipulationActiveOrInUIB, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isEnabled, isFocusable, isHeader, isMouseDrag, isRealized, isRepaintDisabled, isScreenLocationCached, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, manageSystemActions, mouseClicked, mouseDragged, mouseEntered, mouseExited, mousePressed, mouseReleased, mouseWheelMoved, moveToBottom, moveToTop, name, navigable, oleDoDrop, oleDrag, oleDragging, oleStartDragging, onOleDragging, onOleDropEnd, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, prepParentLocation, preventFocusWhenMouseDownEventDefined, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyEventForSelectableWidget, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, reflectSizeChanged, refresh, registerWidgetListener, repaint, repaint, requestSync, resetBitmap, resizeTo, resolveFont, resolvePopupMenuId, resolveTitleFont, screen, screenDimension, screenHeight, screenLocation, screenPhysicalLocation, screenWidth, setBitmap, setCachedScreenLocation, setCachedScreenPhysicalLocation, setDirectManipulationActive, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setMousePointer, setParent, setPhysicalLocation, setSensitiveForUIB, setState, setVisible, setWindow, show, showPopupMenu, supportsCustomMousePointer, sync, topLevelWindow, toString, translate, triggerLocationChanged, unregisterWidgetListener, updateSystemParent, widgetRealized, windowclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitwidgetsAsListacceptsEscAsAnyKey, acceptTrigger, addFocusListener, addKeyListener, ancestor, ancestorId, bounds, canMovetoTop, clearWidget, completeTrigger, config, defaultMousePtr, displayPhysicalLocation, drawCaret, enclosingFrame, enforceDefaultMousePtr, forceCursorOnFocus, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getIdForTrigger, getLegacyWidget, getLoadedMousePointer, getMenuMouse, getMouseActions, getMousePosition, getSelectedText, getState, getTriggerWidget, getTriggerWidget, getVisiblePart, getZOrderClass, hasFocus, hasFocus, hasTooltip, hidden, hide, highlighted, ignoreEnable, initialHeight, initialWidth, isCurrent, isCurrent, isDirectManipulable, isDirectManipulationActive, isDirectManipulationActiveOrInUIB, isDisplayed, isDroppable, isEnabled, isFocusable, isHeader, isInitialValueLayout, isLegacyFocus, isProcessProgressEvent, isRealized, isRepaintDisabled, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, maySwitchFocus, moveToBottom, moveToTop, name, navigable, oleDrag, parent, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, preventFocusWhenMouseDownEventDefined, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyListeners, processMnemonic, raiseLegacyMouseEvents, refreshWidget, registerWidgetListener, repaint, repaint, requestFocus, requestSync, resizeTo, resolvePopupMenuId, screen, screenLocation, screenPhysicalLocation, setDirectManipulationActive, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setMousePointer, setParent, setPhysicalLocation, setSensitiveForUIB, setState, setVisible, setWindow, show, startTrigger, supportsCustomMousePointer, systemFocusGrabbed, topLevelWindow, unregisterWidgetListener, validateDisplayValue, windowprivate static final int ORIGIN_SHIFT
private static final int DELAY_MS
private static final int DURATION_MS
private static final java.util.regex.Pattern LINE_BREAK_PATTERN
private static boolean sessionTooltips
private static ToolTip instance
private GuiDriver gd
private ToolTip.TooltipWorker clock
private OverlayWindow overlayWindow
private FontDetails fd
private java.lang.String text
private NativeRectangle rect
private WidgetId id
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 WidgetId getId()
getId in interface Widget<GuiOutputManager>getId in class BorderedPanelGuiImplpublic void activate(Widget<?> widget, java.awt.event.MouseEvent evt)
widget - The widget's reference for tooltip.evt - The mouse event.protected int[] mouseActions()
mouseActions in class AbstractWidget<GuiOutputManager>MouseEvent.MOUSE_MOVED event,
indicating that the tooltip responds to mouse movement.public void activate(Widget<?> widget, java.lang.String text, java.awt.event.MouseEvent evt)
widget - The widget's reference for tooltip.text - Optional tooltip text. When null, the text will be read from BaseConfig.tooltip
from the config instance of the supplied widget.evt - The mouse event.public void deactivate()
public void draw()
draw in interface Widget<GuiOutputManager>draw in class BorderedPanelGuiImplpublic ToolTip.TooltipWorker getClock()
public boolean isClockActive()
true if the clock is currently active, otherwise false.public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenermouseMoved in class AbstractWidget<GuiOutputManager>e - The mouse event.private java.lang.String processTooltipText(java.lang.String originalText)
originalText - The original tooltip text.private java.lang.String processLine(java.lang.String line)
line - Tooltip content line.