kiwi.ui
Class ToolTipManager

java.lang.Object
  extended bykiwi.ui.ToolTipManager

public class ToolTipManager
extends java.lang.Object

A tool tip manager for use with heavyweight as well as lightweight AWT and JFC components.

Author:
Mark Lindner, PING Software Group

Field Summary
private  java.awt.Color bgcolor
           
private  int delay
           
private  java.awt.Color fgcolor
           
private  java.awt.Font font
           
private static ToolTipManager manager
           
private  java.lang.Thread thread
           
private  java.util.Vector tips
           
 
Constructor Summary
private ToolTipManager()
           
 
Method Summary
private  void _run()
           
 void addToolTip(java.awt.Component c, java.lang.String tip)
          Add a tool tip.
 void dispose()
          Dispose of this object.
static ToolTipManager getToolTipManager()
          Get a reference to the tool tip manager singleton.
 void removeToolTip(java.awt.Component c)
          Remove a tool tip.
 void setBackground(java.awt.Color bgcolor)
          Set the tool tip background color.
 void setDelay(int seconds)
          Set the tool tip display delay.
 void setFont(java.awt.Font font)
          Set the tool tip font.The default font is 8 point Dialog.
 void setForeground(java.awt.Color fgcolor)
          Set the tool tip foreground color.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tips

private java.util.Vector tips

thread

private java.lang.Thread thread

delay

private int delay

bgcolor

private java.awt.Color bgcolor

fgcolor

private java.awt.Color fgcolor

font

private java.awt.Font font

manager

private static ToolTipManager manager
Constructor Detail

ToolTipManager

private ToolTipManager()
Method Detail

getToolTipManager

public static ToolTipManager getToolTipManager()
Get a reference to the tool tip manager singleton.


setFont

public void setFont(java.awt.Font font)
Set the tool tip font.The default font is 8 point Dialog.

Parameters:
font - The new font to use.

setBackground

public void setBackground(java.awt.Color bgcolor)
Set the tool tip background color. The default background color is a light blue.

Parameters:
bgcolor - The new background color.

setForeground

public void setForeground(java.awt.Color fgcolor)
Set the tool tip foreground color. The default foreground color is black.

Parameters:
fgcolor - The new foreground color.

setDelay

public void setDelay(int seconds)
              throws java.lang.IllegalArgumentException
Set the tool tip display delay. A tool tip will appear seconds seconds after the mouse pointer has remained motionless within the bounds of the associated component. The default delay is 2 seconds.

Throws:
java.lang.IllegalArgumentException - If seconds is not in the range 1 to 20, inclusive.

addToolTip

public void addToolTip(java.awt.Component c,
                       java.lang.String tip)
                throws java.lang.IllegalArgumentException
Add a tool tip. Registers the component c and tool tip text tip with the tool tip manager.

Throws:
java.lang.IllegalArgumentException
See Also:
removeToolTip(java.awt.Component)

removeToolTip

public void removeToolTip(java.awt.Component c)
                   throws java.util.NoSuchElementException
Remove a tool tip. Unregisters the component c from the tool tip manager.

Throws:
java.util.NoSuchElementException
See Also:
addToolTip(java.awt.Component, java.lang.String)

_run

private void _run()

dispose

public void dispose()
Dispose of this object. Disassociates this ToolTipManager as a listener from all of the components it is managing, and releases all references to those components.