public class DefaultTooltipStrategy extends Object implements TooltipStrategy
TooltipStrategy
calls the methods of the Component
under the mouse whenever possible.Constructor and Description |
---|
DefaultTooltipStrategy() |
Modifier and Type | Method and Description |
---|---|
JToolTip |
createTooltip(Component component,
TooltipStrategyCallback callback)
Asks this strategy to create a new tooltip, this tooltip will be shown as soon as the current
event of the
EDT is over. |
void |
install(GlassedPane pane)
Called if a
GlassedPane starts using this strategy. |
void |
setTooltipText(Component component,
MouseEvent event,
boolean overNewComponent,
TooltipStrategyCallback callback)
Asks this strategy to find the tooltip of
component , after the event is
dispatched. |
void |
uninstall(GlassedPane pane)
Called if a
GlassedPane is no longer using this strategy. |
public void install(GlassedPane pane)
TooltipStrategy
GlassedPane
starts using this strategy.install
in interface TooltipStrategy
pane
- the pane using this strategypublic void uninstall(GlassedPane pane)
TooltipStrategy
GlassedPane
is no longer using this strategy.uninstall
in interface TooltipStrategy
pane
- the pane that is no longer using this strategypublic void setTooltipText(Component component, MouseEvent event, boolean overNewComponent, TooltipStrategyCallback callback)
TooltipStrategy
component
, after the event
is
dispatched.setTooltipText
in interface TooltipStrategy
component
- the current component, can be null
event
- the event that is dispatched, can be null
overNewComponent
- whether the component under the mouse changed since the last call of this methodcallback
- the caller, this method can call TooltipStrategyCallback.setToolTipText(String)
to set a new tooltippublic JToolTip createTooltip(Component component, TooltipStrategyCallback callback)
TooltipStrategy
EDT
is over.createTooltip
in interface TooltipStrategy
component
- the component over which the mouse currently hovers, can be null
callback
- the caller of this methodnull