All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class att.grappa.ElementTipper

java.lang.Object
   |
   +----att.grappa.ElementTipper

public class ElementTipper
extends Object
implements Runnable, MouseListener, MouseMotionListener
The ElementTipper provides what is commonly called a ToolTip. When the cursor remains motionless for a brief time over an element in a pane and that element has an attribute called "tip", then the value of the "tip" attribute is briefly displayed at the cursor location.

Version:
1.1, 30 Sep 1999; Copyright 1996 - 1999 by AT&T Corp.
Author:
John Mocenigo, Research @ AT&T Labs

Constructor Index

 o ElementTipper(DrawPane, int)
Construct an ElementTipper for the given pane using the given timeout value.

Method Index

 o finalize()
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
 o getGC()
Get the graphic context used for drawing the tip.
 o mouseClicked(MouseEvent)
When the mouse is clicked, clear the tip (if showing).
 o mouseDragged(MouseEvent)
Behave as with mouseMoved
 o mouseEntered(MouseEvent)
When the mouse is enters the canvas, behave as if the mouse moved and either resume or start the thread as needed.
 o mouseExited(MouseEvent)
When the mouse is leaves the canvas, suspend the thread and clear the tip.
 o mouseMoved(MouseEvent)
Whenever the mouse moves, reset the wake-up time, reset set the current point and clear the tip.
 o mousePressed(MouseEvent)
When the mouse is pressed, clear the tip (if showing) and disarm the tip display mechanism.
 o mouseReleased(MouseEvent)
When the mouse is released, re-arm the tip display mechanism and reset the wake-up time.
 o run()
The run method for the ElementTipper thread.
 o setTipTime(int)
Set the delay time before tip is searched for and displayed.

Constructors

 o ElementTipper
 public ElementTipper(DrawPane pane,
                      int time)
Construct an ElementTipper for the given pane using the given timeout value.

Parameters:
pane - the DrawPane where the tipper is to be active
time - the minimum time in milliseconds that the cursor needs to remain motionless for the tip to appear

Methods

 o finalize
 public void finalize()
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

Overrides:
finalize in class Object
 o getGC
 public GraphicContext getGC()
Get the graphic context used for drawing the tip.

Returns:
the graphic context for this tip
 o run
 public void run()
The run method for the ElementTipper thread. Mostly, this thread sleeps. However, after at most time milliseconds, it will wake up, clear any currently displayed tip text, check if it has moved since the last time it displayed a tip. If not, it goes back to sleep, otherwise it checks if it has been at least time milliseconds since the cursor was last moved. If the cursor has not moved for that time, then it checks if the current point is within a graph element. If it is, then it checks if the element has a tip attribute and if so displays it. Then it goes back to sleep for time milliseconds.

 o mouseClicked
 public void mouseClicked(MouseEvent evt)
When the mouse is clicked, clear the tip (if showing).

Parameters:
evt - the mouse event that caused this method to be called
 o mousePressed
 public void mousePressed(MouseEvent evt)
When the mouse is pressed, clear the tip (if showing) and disarm the tip display mechanism.

Parameters:
evt - the mouse event that caused this method to be called
 o mouseReleased
 public void mouseReleased(MouseEvent evt)
When the mouse is released, re-arm the tip display mechanism and reset the wake-up time.

Parameters:
evt - the mouse event that caused this method to be called
 o mouseEntered
 public void mouseEntered(MouseEvent evt)
When the mouse is enters the canvas, behave as if the mouse moved and either resume or start the thread as needed.

Parameters:
evt - the mouse event that caused this method to be called
See Also:
mouseMoved
 o mouseExited
 public void mouseExited(MouseEvent evt)
When the mouse is leaves the canvas, suspend the thread and clear the tip.

Parameters:
evt - the mouse event that caused this method to be called
 o mouseMoved
 public void mouseMoved(MouseEvent evt)
Whenever the mouse moves, reset the wake-up time, reset set the current point and clear the tip.

Parameters:
evt - the mouse event that caused this method to be called
 o mouseDragged
 public void mouseDragged(MouseEvent evt)
Behave as with mouseMoved

Parameters:
evt - the mouse event that caused this method to be called
See Also:
mouseMoved
 o setTipTime
 public int setTipTime(int time)
Set the delay time before tip is searched for and displayed.

Parameters:
time - the minimum time in milliseconds that the cursor needs to remain motionless for the tip to appear
Returns:
the previous delay time

All Packages  Class Hierarchy  This Package  Previous  Next  Index