32 /**
33 * Manages all the <code>ToolTips</code> in the system.
34 * <p>
35 * ToolTipManager contains numerous properties for configuring how long it
36 * will take for the tooltips to become visible, and how long till they
37 * hide. Consider a component that has a different tooltip based on where
38 * the mouse is, such as JTree. When the mouse moves into the JTree and
39 * over a region that has a valid tooltip, the tooltip will become
40 * visible after <code>initialDelay</code> milliseconds. After
41 * <code>dismissDelay</code> milliseconds the tooltip will be hidden. If
42 * the mouse is over a region that has a valid tooltip, and the tooltip
43 * is currently visible, when the mouse moves to a region that doesn't have
44 * a valid tooltip the tooltip will be hidden. If the mouse then moves back
45 * into a region that has a valid tooltip within <code>reshowDelay</code>
46 * milliseconds, the tooltip will immediately be shown, otherwise the
47 * tooltip will be shown again after <code>initialDelay</code> milliseconds.
48 *
49 * @see JComponent#createToolTip
50 * @author Dave Moore
51 * @author Rich Schiavi
52 */
53 public class ToolTipManager extends MouseAdapter implements MouseMotionListener {
54 Timer enterTimer, exitTimer, insideTimer;
55 String toolTipText;
56 Point preferredLocation;
57 JComponent insideComponent;
58 MouseEvent mouseEvent;
59 boolean showImmediately;
60 private static final Object TOOL_TIP_MANAGER_KEY = new Object();
61 transient Popup tipWindow;
62 /** The Window tip is being displayed in. This will be non-null if
63 * the Window tip is in differs from that of insideComponent's Window.
64 */
65 private Window window;
66 JToolTip tip;
67
68 private Rectangle popupRect = null;
69 private Rectangle popupFrameRect = null;
70
71 boolean enabled = true;
|
32 /**
33 * Manages all the <code>ToolTips</code> in the system.
34 * <p>
35 * ToolTipManager contains numerous properties for configuring how long it
36 * will take for the tooltips to become visible, and how long till they
37 * hide. Consider a component that has a different tooltip based on where
38 * the mouse is, such as JTree. When the mouse moves into the JTree and
39 * over a region that has a valid tooltip, the tooltip will become
40 * visible after <code>initialDelay</code> milliseconds. After
41 * <code>dismissDelay</code> milliseconds the tooltip will be hidden. If
42 * the mouse is over a region that has a valid tooltip, and the tooltip
43 * is currently visible, when the mouse moves to a region that doesn't have
44 * a valid tooltip the tooltip will be hidden. If the mouse then moves back
45 * into a region that has a valid tooltip within <code>reshowDelay</code>
46 * milliseconds, the tooltip will immediately be shown, otherwise the
47 * tooltip will be shown again after <code>initialDelay</code> milliseconds.
48 *
49 * @see JComponent#createToolTip
50 * @author Dave Moore
51 * @author Rich Schiavi
52 * @since 1.2
53 */
54 public class ToolTipManager extends MouseAdapter implements MouseMotionListener {
55 Timer enterTimer, exitTimer, insideTimer;
56 String toolTipText;
57 Point preferredLocation;
58 JComponent insideComponent;
59 MouseEvent mouseEvent;
60 boolean showImmediately;
61 private static final Object TOOL_TIP_MANAGER_KEY = new Object();
62 transient Popup tipWindow;
63 /** The Window tip is being displayed in. This will be non-null if
64 * the Window tip is in differs from that of insideComponent's Window.
65 */
66 private Window window;
67 JToolTip tip;
68
69 private Rectangle popupRect = null;
70 private Rectangle popupFrameRect = null;
71
72 boolean enabled = true;
|