Displaying Source Code(s)
|
|
Is it possible to change delays that affect appearing, keeping
and disappearing of tooltip?
--------------------------------------------------------------------------------
The ToolTipManager is a service class that maintains a shared
instance registered with AppContext. We
can access the ToolTipManager directly by calling its static
sharedInstance() method:
ToolTipManager toolTipManager = ToolTipManager.sharedInstance();
Internally this class uses three non-repeating Timers with delay
times defaulting to 750, 500, and 4000.
ToolTipManager uses these Timer’s in coordination with mouse
listeners to determine if and when to
display a JToolTip with a component’s specified tooltip text.
When the mouse enters a components
bounds ToolTipManager
will detect this and wait 750ms until displaying a JToolTip for
that component. This is referred to as the
initial delay time.
A JToolTip will stay visible for 4000ms or until we move the
mouse outside of that component’s bounds,
whichever comes first. This is referred to as the dismiss delay
time. The 500ms Timer represents the
reshow delay time which specifies how soon the JToolTip we have
just seen will appear again when this
component is re-entered.
Each of these delay times can be set using ToolTipManager’s
setDismissDelay(), setInitialDelay(), and
setReshowDelay() methods.
ToolTipManager is a very nice service to have implemented for
us, but it does have significant
limitations. When we construct our polygonal buttons we will
find that it is not robust enough to support non-rectangular
components.
|
|
|