org.zaval.lw
Class LwTooltipMan

java.lang.Object
  |
  +--org.zaval.lw.LwTooltipMan
All Implemented Interfaces:
java.util.EventListener, LwManager, LwMouseListener, LwMouseMotionListener, java.lang.Runnable

public class LwTooltipMan
extends java.lang.Object
implements LwManager, LwMouseListener, LwMouseMotionListener, java.lang.Runnable

This manager is used to support tooltip for a light weight components. As the tooltip can be used any light weight component. The tooltip component is shown whenever the mouse cursor certain time immobile inside the tooltip owner component (and no mouse buttons have been pressed). There are two ways to work with the tooltip:


Field Summary
static java.awt.Color tooltipBack
          The tooltip background color definition.
 
Constructor Summary
LwTooltipMan()
           
 
Method Summary
static LwComponent createTooltip(java.lang.String text)
          Creates and returns a tooltip component by the given label.
 void dispose()
           
 void endDragged(LwMouseMotionEvent e)
          Invoked when the mouse ends dragged.
 void mouseClicked(LwMouseEvent e)
          Invoked when the mouse button has been clicked on a light weight component.
 void mouseDragged(LwMouseMotionEvent e)
          Invoked when a mouse button is pressed on a component and then dragged.
 void mouseEntered(LwMouseEvent e)
          Invoked when the mouse enters a light weight component.
 void mouseExited(LwMouseEvent e)
          Invoked when the mouse exits a light weight component.
 void mouseMoved(LwMouseMotionEvent e)
          Invoked when the mouse pointer has been moved on a light weight component (with no buttons no down).
 void mousePressed(LwMouseEvent e)
          Invoked when the mouse button has been pressed on a light weight component.
 void mouseReleased(LwMouseEvent e)
          Invoked when the mouse button has been released on a light weight component.
 void removeTooltipInfo(LwComponent c)
          Removes a tooltip info interface for the given component, so it no longer show tooltips.
 void run()
           
 void setTick(int t)
          Sets the specified tick (milliseconds) that defines interval between "frozen" mouse state and starting the tooltip showing.
 void setTooltipInfo(LwComponent c, TooltipInfo t)
          Sets the specified tooltip info interface for the given component.
 void startDragged(LwMouseMotionEvent e)
          Invoked when the mouse starts dragged.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tooltipBack

public static final java.awt.Color tooltipBack
The tooltip background color definition.
Constructor Detail

LwTooltipMan

public LwTooltipMan()
Method Detail

setTick

public void setTick(int t)
Sets the specified tick (milliseconds) that defines interval between "frozen" mouse state and starting the tooltip showing.
Parameters:
t - the specified tick.

removeTooltipInfo

public void removeTooltipInfo(LwComponent c)
Removes a tooltip info interface for the given component, so it no longer show tooltips.
Parameters:
c - the component.

setTooltipInfo

public void setTooltipInfo(LwComponent c,
                           TooltipInfo t)
Sets the specified tooltip info interface for the given component.
Parameters:
c - the component.
t - the specified tooltip info interface.

mouseEntered

public void mouseEntered(LwMouseEvent e)
Description copied from interface: LwMouseListener
Invoked when the mouse enters a light weight component.
Specified by:
mouseEntered in interface LwMouseListener
Following copied from interface: org.zaval.lw.event.LwMouseListener
Parameters:
e - the specified mouse event.

mouseExited

public void mouseExited(LwMouseEvent e)
Description copied from interface: LwMouseListener
Invoked when the mouse exits a light weight component.
Specified by:
mouseExited in interface LwMouseListener
Following copied from interface: org.zaval.lw.event.LwMouseListener
Parameters:
e - the specified mouse event.

mouseClicked

public void mouseClicked(LwMouseEvent e)
Description copied from interface: LwMouseListener
Invoked when the mouse button has been clicked on a light weight component.
Specified by:
mouseClicked in interface LwMouseListener
Following copied from interface: org.zaval.lw.event.LwMouseListener
Parameters:
e - the specified mouse event.

mousePressed

public void mousePressed(LwMouseEvent e)
Description copied from interface: LwMouseListener
Invoked when the mouse button has been pressed on a light weight component.
Specified by:
mousePressed in interface LwMouseListener
Following copied from interface: org.zaval.lw.event.LwMouseListener
Parameters:
e - the specified mouse event.

mouseReleased

public void mouseReleased(LwMouseEvent e)
Description copied from interface: LwMouseListener
Invoked when the mouse button has been released on a light weight component.
Specified by:
mouseReleased in interface LwMouseListener
Following copied from interface: org.zaval.lw.event.LwMouseListener
Parameters:
e - the specified mouse event.

startDragged

public void startDragged(LwMouseMotionEvent e)
Description copied from interface: LwMouseMotionListener
Invoked when the mouse starts dragged.
Specified by:
startDragged in interface LwMouseMotionListener
Following copied from interface: org.zaval.lw.event.LwMouseMotionListener
Parameters:
e - the specified mouse motion event.

endDragged

public void endDragged(LwMouseMotionEvent e)
Description copied from interface: LwMouseMotionListener
Invoked when the mouse ends dragged.
Specified by:
endDragged in interface LwMouseMotionListener
Following copied from interface: org.zaval.lw.event.LwMouseMotionListener
Parameters:
e - the specified mouse motion event.

mouseDragged

public void mouseDragged(LwMouseMotionEvent e)
Description copied from interface: LwMouseMotionListener
Invoked when a mouse button is pressed on a component and then dragged. Mouse drag events will continue to be delivered to the component where the first originated until the mouse button is released (regardless of whether the mouse position is within the bounds of the component).
Specified by:
mouseDragged in interface LwMouseMotionListener
Following copied from interface: org.zaval.lw.event.LwMouseMotionListener
Parameters:
e - the specified mouse motion event.

mouseMoved

public void mouseMoved(LwMouseMotionEvent e)
Description copied from interface: LwMouseMotionListener
Invoked when the mouse pointer has been moved on a light weight component (with no buttons no down).
Specified by:
mouseMoved in interface LwMouseMotionListener
Following copied from interface: org.zaval.lw.event.LwMouseMotionListener
Parameters:
e - the specified mouse motion event.

run

public void run()
Specified by:
run in interface java.lang.Runnable

dispose

public void dispose()
Specified by:
dispose in interface LwManager

createTooltip

public static LwComponent createTooltip(java.lang.String text)
Creates and returns a tooltip component by the given label. The method can be used to create standard tooltip component for light weight applications.
Parameters:
text - the specified text.
Returns:
the tooltip component.


Copyright © Zaval Creative Engineering Group, 2000-2005.
http://www.zaval.org