| 
 | JavaTM 2 Platform Standard Ed. 6 | |||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjava.awt.event.MouseAdapter
javax.swing.ToolTipManager
public class ToolTipManager
管理系統中的所有 ToolTips。
 
ToolTipManager 套件含眾多屬性,用於配置該工具提示需要多長時間顯示出來,需要多長時間隱藏。考慮一個在不同的鼠標位置(如 JTree)有不同工具提示的元件。在鼠標移動到 JTree 中和具有有效工具提示的區域上時,該工具提示將在 initialDelay 毫秒後顯示出來。在 dismissDelay 毫秒後,將隱藏該工具提示。如果鼠標在具有有效工具提示的區域上,並且當前能看到該工具提示,則在鼠標移動到沒有有效工具提示的區域時,將隱藏該工具提示。如果鼠標接下來在 reshowDelay 毫秒內移回具有有效工具提示的區域,則將立即顯示該工具提示,否則在 initialDelay 毫秒後將再次顯示該工具提示。
JComponent.createToolTip()| 巢狀類別摘要 | |
|---|---|
| protected  class | ToolTipManager.insideTimerAction | 
| protected  class | ToolTipManager.outsideTimerAction | 
| protected  class | ToolTipManager.stillInsideTimerAction | 
| 欄位摘要 | |
|---|---|
| protected  boolean | heavyWeightPopupEnabled | 
| protected  boolean | lightWeightPopupEnabled | 
| 方法摘要 | |
|---|---|
|  int | getDismissDelay()返回取消工具提示的延遲值。 | 
|  int | getInitialDelay()返回初始延遲值。 | 
|  int | getReshowDelay()返回重新顯示延遲屬性。 | 
|  boolean | isEnabled()如果啟用該物件,則返回 true。 | 
|  boolean | isLightWeightPopupEnabled()如果使用輕量級(所有 Java) Tooltips,則返回 true;如果使用重量級(本機同位體)Tooltips,則返回 false。 | 
|  void | mouseDragged(MouseEvent event)按下和拖動鼠標時調用。 | 
|  void | mouseEntered(MouseEvent event)鼠標進入元件區域時調用。 | 
|  void | mouseExited(MouseEvent event)鼠標退出元件區域時調用。 | 
|  void | mouseMoved(MouseEvent event)移動鼠標時調用。 | 
|  void | mousePressed(MouseEvent event)當按下鼠標時調用。 | 
|  void | registerComponent(JComponent component)註冊一個工具提示管理元件。 | 
|  void | setDismissDelay(int milliseconds)指定取消工具提示的延遲值。 | 
|  void | setEnabled(boolean flag)啟用或禁用工具提示。 | 
|  void | setInitialDelay(int milliseconds)指定初始延遲值。 | 
|  void | setLightWeightPopupEnabled(boolean aFlag)顯示 JToolTip時,該ToolTipManager會選擇使用一個輕量級JPanel(如果合適)。 | 
|  void | setReshowDelay(int milliseconds)在顯示工具提示之前,用於指定使用者必須等待 initialDelay毫秒之前的時間。 | 
| static ToolTipManager | sharedInstance()返回共享的 ToolTipManager實例。 | 
|  void | unregisterComponent(JComponent component)從工具提示控制元件中移除一個元件。 | 
| 從類別 java.awt.event.MouseAdapter 繼承的方法 | 
|---|
| mouseClicked, mouseReleased, mouseWheelMoved | 
| 從類別 java.lang.Object 繼承的方法 | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| 欄位詳細資訊 | 
|---|
protected boolean lightWeightPopupEnabled
protected boolean heavyWeightPopupEnabled
| 方法詳細資訊 | 
|---|
public void setEnabled(boolean flag)
flag - 要啟用提示則為 true,否則為 falsepublic boolean isEnabled()
public void setLightWeightPopupEnabled(boolean aFlag)
JToolTip 時,該 ToolTipManager 會選擇使用一個輕量級 JPanel(如果合適)。此方法允許您禁用該功能。如果應用程序混合輕量級元件和重量級元件,則必須真正禁用此功能。
aFlag - 如果需要輕量級面板,則為 true,否則為 falsepublic boolean isLightWeightPopupEnabled()
Tooltips,則返回 true;如果使用重量級(本機同位體)Tooltips,則返回 false。
ToolTipspublic void setInitialDelay(int milliseconds)
milliseconds - (鼠標暫停之後)顯示工具提示之前要延遲的毫秒數getInitialDelay()public int getInitialDelay()
setInitialDelay(int)public void setDismissDelay(int milliseconds)
milliseconds - 取消工具提示之前要延遲的毫秒數getDismissDelay()public int getDismissDelay()
setDismissDelay(int)public void setReshowDelay(int milliseconds)
initialDelay 毫秒之前的時間。也就是說,如果隱藏工具提示,且使用者在 milliseconds 毫秒內移動到同一個具有有效工具提示的元件,則立即顯示該工具提示。否則,如果使用者在 milliseconds 毫秒之後移動到具有有效工具提示的區域,則使用者必須在再次顯示該工具提示之前再等待 initialDelay 毫秒。
milliseconds - 以毫秒為單位的時間getReshowDelay()public int getReshowDelay()
setReshowDelay(int)public static ToolTipManager sharedInstance()
ToolTipManager 實例。
ToolTipManager 物件public void registerComponent(JComponent component)
這將註冊鍵綁定,以在僅當 component 具有焦點綁定時顯示和隱藏工具提示文本。執行此操作,以使通常不是焦點遍歷的元件(如 JLabel)不會因為調用此方法而進行焦點遍歷。
component - 要添加的 JComponent 物件Component.isFocusTraversable()public void unregisterComponent(JComponent component)
component - 要移除的 JComponent 物件public void mouseEntered(MouseEvent event)
MouseListener 中的 mouseEnteredMouseAdapter 中的 mouseEnteredevent - 相關事件public void mouseExited(MouseEvent event)
MouseListener 中的 mouseExitedMouseAdapter 中的 mouseExitedevent - 相關事件public void mousePressed(MouseEvent event)
MouseListener 中的 mousePressedMouseAdapter 中的 mousePressedevent - 相關事件public void mouseDragged(MouseEvent event)
MouseMotionListener 中的 mouseDraggedMouseAdapter 中的 mouseDraggedevent - 相關事件public void mouseMoved(MouseEvent event)
MouseMotionListener 中的 mouseMovedMouseAdapter 中的 mouseMovedevent - 相關事件| 
 | JavaTM 2 Platform Standard Ed. 6 | |||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。