is new.
java.lang.Objectjava.awt.event.MouseAdapter
javax.swing.ToolTipManager
,
MouseWheelListener
,
EventListener
public class ToolTipManager
Manages all the ToolTips in the system.
ToolTipManager contains numerous properties for configuring how long it will take for the tooltips to become visible, and how long till they hide. Consider a component that has a different tooltip based on where the mouse is, such as JTree. When the mouse moves into the JTree and over a region that has a valid tooltip, the tooltip will become visibile after initialDelay milliseconds. After dismissDelay milliseconds the tooltip will be hidden. If the mouse is over a region that has a valid tooltip, and the tooltip is currently visible, when the mouse moves to a region that doesn't have a valid tooltip the tooltip will be hidden. If the mouse then moves back into a region that has a valid tooltip within reshowDelay milliseconds, the tooltip will immediately be shown, otherwise the tooltip will be shown again after initialDelay milliseconds.
| Nested Class Summary | |
|---|---|
| protected class |
ToolTipManager.insideTimerAction
|
| protected class |
ToolTipManager.outsideTimerAction
|
| protected class |
ToolTipManager.stillInsideTimerAction
|
| Field Summary | |
|---|---|
| protected boolean |
heavyWeightPopupEnabled
|
| protected boolean |
lightWeightPopupEnabled
|
| Method Summary | |
|---|---|
| int |
getDismissDelay
() Returns the dismissal delay value. |
| int |
getInitialDelay
() Returns the initial delay value. |
| int |
getReshowDelay
() Returns the reshow delay property. |
| boolean |
isEnabled
() Returns true if this object is enabled. |
| boolean |
isLightWeightPopupEnabled
() Returns true if lightweight (all-Java) Tooltips are in use, or false if heavyweight (native peer) Tooltips are being used. |
| void |
mouseDragged
(
MouseEvent
event) Called when the mouse is pressed and dragged. |
| void |
mouseEntered
(
MouseEvent
event) Called when the mouse enters the region of a component. |
| void |
mouseExited
(
MouseEvent
event) Called when the mouse exits the region of a component. |
| void |
mouseMoved
(
MouseEvent
event) Called when the mouse is moved. |
| void |
mousePressed
(
MouseEvent
event) Called when the mouse is pressed. |
| void |
registerComponent
(
JComponent
component) Registers a component for tooltip management. |
| void |
setDismissDelay
(int milliseconds) Specifies the dismissal delay value. |
| void |
setEnabled
(boolean flag) Enables or disables the tooltip. |
| void |
setInitialDelay
(int milliseconds) Specifies the initial delay value. |
| void |
setLightWeightPopupEnabled
(boolean aFlag) When displaying the JToolTip, the ToolTipManager chooses to use a lightweight JPanel if it fits. |
| void |
setReshowDelay
(int milliseconds) Used to specify the amount of time before the user has to wait initialDelay milliseconds before a tooltip will be shown. |
| static ToolTipManager |
sharedInstance
() Returns a shared ToolTipManager instance. |
| void |
unregisterComponent
(
JComponent
component) Removes a component from tooltip control. |
| Methods inherited from class java.awt.event. MouseAdapter |
|---|
mouseClicked
,
mouseReleased
,
mouseWheelMoved
|
| Methods inherited from class java.lang. Object |
|---|
| clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
| Field Detail |
|---|
protected boolean lightWeightPopupEnabled
protected boolean heavyWeightPopupEnabled
| Method Detail |
|---|
public void setEnabled(boolean flag)
public boolean isEnabled()
public void setLightWeightPopupEnabled(boolean aFlag)
public boolean isLightWeightPopupEnabled()
public void setInitialDelay(int milliseconds)
public int getInitialDelay()
public void setDismissDelay(int milliseconds)
public int getDismissDelay()
public void setReshowDelay(int milliseconds)
public int getReshowDelay()
public static ToolTipManager sharedInstance()
public void registerComponent(JComponent component)
This will register key bindings to show and hide the tooltip text only if component has focus bindings. This is done so that components that are not normally focus traversable, such as JLabel, are not made focus traversable as a result of invoking this method.
public void unregisterComponent(JComponent component)
public void mouseEntered(MouseEvent event)
public void mouseExited(MouseEvent event)
public void mousePressed(MouseEvent event)
public void mouseDragged(MouseEvent event)
Overrides:
mouseDragged
in class
MouseAdapter
public void mouseMoved(MouseEvent event)
Overrides:
mouseMoved
in class
MouseAdapter