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