bibliothek.gui.dock.security
Class DefaultTooltipStrategy

java.lang.Object
  extended by bibliothek.gui.dock.security.DefaultTooltipStrategy
All Implemented Interfaces:
TooltipStrategy

public class DefaultTooltipStrategy
extends Object
implements TooltipStrategy

The default implementation of TooltipStrategy calls the methods of the Component under the mouse whenever possible.

Author:
Benjamin Sigg

Constructor Summary
DefaultTooltipStrategy()
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultTooltipStrategy

public DefaultTooltipStrategy()
Method Detail

install

public void install(GlassedPane pane)
Description copied from interface: TooltipStrategy
Called if a GlassedPane starts using this strategy.

Specified by:
install in interface TooltipStrategy
Parameters:
pane - the pane using this strategy

uninstall

public void uninstall(GlassedPane pane)
Description copied from interface: TooltipStrategy
Called if a GlassedPane is no longer using this strategy.

Specified by:
uninstall in interface TooltipStrategy
Parameters:
pane - the pane that is no longer using this strategy

setTooltipText

public void setTooltipText(Component component,
                           MouseEvent event,
                           boolean overNewComponent,
                           TooltipStrategyCallback callback)
Description copied from interface: TooltipStrategy
Asks this strategy to find the tooltip of component, after the event is dispatched.

Specified by:
setTooltipText in interface TooltipStrategy
Parameters:
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 method
callback - the caller, this method can call TooltipStrategyCallback.setToolTipText(String) to set a new tooltip

createTooltip

public JToolTip createTooltip(Component component,
                              TooltipStrategyCallback callback)
Description copied from interface: TooltipStrategy
Asks this strategy to create a new tooltip, this tooltip will be shown as soon as the current event of the EDT is over.

Specified by:
createTooltip in interface TooltipStrategy
Parameters:
component - the component over which the mouse currently hovers, can be null
callback - the caller of this method
Returns:
the new tooltip, must not be null