JavaTM 2 Platform
Standard Ed. 6

javax.swing.plaf.basic
類別 BasicToolTipUI

java.lang.Object
  繼承者 javax.swing.plaf.ComponentUI
      繼承者 javax.swing.plaf.ToolTipUI
          繼承者 javax.swing.plaf.basic.BasicToolTipUI
直接已知子類別:
MetalToolTipUI

public class BasicToolTipUI
extends ToolTipUI

標準工具提示 L&F。


建構子摘要
BasicToolTipUI()
           
 
方法摘要
static ComponentUI createUI(JComponent c)
           
 Dimension getMaximumSize(JComponent c)
          返回指定元件的適合外觀的最大大小。
 Dimension getMinimumSize(JComponent c)
          返回指定元件的適合外觀的最小大小。
 Dimension getPreferredSize(JComponent c)
          返回指定元件的適合外觀的首選大小。
protected  void installDefaults(JComponent c)
           
protected  void installListeners(JComponent c)
           
 void installUI(JComponent c)
          配置指定元件,使其適合外觀。
 void paint(Graphics g, JComponent c)
          繪製指定元件,使其適合外觀。
protected  void uninstallDefaults(JComponent c)
           
protected  void uninstallListeners(JComponent c)
           
 void uninstallUI(JComponent c)
          在 installUI 期間,在指定元件上反向執行的配置操作。
 
從類別 javax.swing.plaf.ComponentUI 繼承的方法
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, update
 
從類別 java.lang.Object 繼承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

建構子詳細資訊

BasicToolTipUI

public BasicToolTipUI()
方法詳細資訊

createUI

public static ComponentUI createUI(JComponent c)

installUI

public void installUI(JComponent c)
從類別 ComponentUI 複製的描述
配置指定元件,使其適合外觀。當 ComponentUI 實例將作為 UI 委託安裝在指定元件上時,可調用此方法。此方法應該為外觀完整地配置元件,包括以下方面:
  1. 在元件上安裝用於顏色、字體、邊框、圖標、不透明性等方面的所有預設屬性值。只要有可能,就 應該覆寫由客戶端程序初始化的屬性值。
  2. 如有必要,可在元件上安裝一個 LayoutManager
  3. 將所需的所有子元件創建/添加到元件中。
  4. 在元件上創建/安裝事件偵聽器。
  5. 為了檢測和適當回應元件屬性更改,可在元件上創建/安裝一個 PropertyChangeListener
  6. 在元件上安裝鍵盤 UI(助記符、遍歷等等)。
  7. 初始化任何適當的實例資料。

覆寫:
類別 ComponentUI 中的 installUI
參數:
c - 將安裝此 UI 委託的元件
另請參見:
ComponentUI.uninstallUI(javax.swing.JComponent), JComponent.setUI(javax.swing.plaf.ComponentUI), JComponent.updateUI()

uninstallUI

public void uninstallUI(JComponent c)
從類別 ComponentUI 複製的描述
installUI 期間,在指定元件上反向執行的配置操作。當此 UIComponent 實例將作為 UI 委託從指定元件上移除時,可調用此方法。此方法應該取消在 installUI 中執行的配置操作,非常小心地使 JComponent 實例處於某種潔淨狀態(沒有額外的偵聽器、沒有特定於外觀的屬性物件等等)。配置內容應該套件括以下方面:
  1. 從元件中移除所有 UI 設置的邊框。
  2. 從元件上移除所有 UI 設置的佈局管理器。
  3. 從元件中移除所有 UI 添加的子元件。
  4. 從元件中移除所有 UI 添加的事件/屬性偵聽器。
  5. 從元件中移除所有 UI 安裝的鍵盤 UI。
  6. 使所有已分派的實例資料物件無效,從而允許進行 GC 操作。

覆寫:
類別 ComponentUI 中的 uninstallUI
參數:
c - 從中移除此 UI 委託的元件;此參數常被忽略,但如果 UI 物件是無狀態的並由多個元件共享,則可以使用該參數
另請參見:
ComponentUI.installUI(javax.swing.JComponent), JComponent.updateUI()

installDefaults

protected void installDefaults(JComponent c)

uninstallDefaults

protected void uninstallDefaults(JComponent c)

installListeners

protected void installListeners(JComponent c)

uninstallListeners

protected void uninstallListeners(JComponent c)

paint

public void paint(Graphics g,
                  JComponent c)
從類別 ComponentUI 複製的描述
繪製指定元件,使其適合外觀。在將要繪製指定元件時,從 ComponentUI.update 方法中調用此方法。子類別應該覆寫此方法並使用指定 Graphics 物件來呈現元件的內容。

覆寫:
類別 ComponentUI 中的 paint
參數:
g - 將在其中進行繪製的 Graphics 上下文
c - 將繪製的元件;此參數常被忽略,但如果 UI 物件是無狀態的並由多個元件共享,則可以使用該參數
另請參見:
ComponentUI.update(java.awt.Graphics, javax.swing.JComponent)

getPreferredSize

public Dimension getPreferredSize(JComponent c)
從類別 ComponentUI 複製的描述
返回指定元件的適合外觀的首選大小。如果返回 null,則首選大小將由元件的佈局管理器計算(對於安裝了特定佈局管理器的元件而言,這是首選方法)。此方法的預設實作返回 null

覆寫:
類別 ComponentUI 中的 getPreferredSize
參數:
c - 將查詢其首選大小的元件;此參數常被忽略,但如果 UI 物件是無狀態的並由多個元件共享,則可以使用該參數
另請參見:
JComponent.getPreferredSize(), LayoutManager.preferredLayoutSize(java.awt.Container)

getMinimumSize

public Dimension getMinimumSize(JComponent c)
從類別 ComponentUI 複製的描述
返回指定元件的適合外觀的最小大小。如果返回 null,則最小大小將由元件的佈局管理器計算(對於安裝了特定佈局管理器的元件而言,這是首選方法)。此方法的預設實作調用 getPreferredSize 並返回該值。

覆寫:
類別 ComponentUI 中的 getMinimumSize
參數:
c - 將查詢其最小大小的元件;此參數常被忽略,但如果 UI 物件是無狀態的並由多個元件共享,則可以使用該參數
返回:
一個 Dimension 物件或 null
另請參見:
JComponent.getMinimumSize(), LayoutManager.minimumLayoutSize(java.awt.Container), ComponentUI.getPreferredSize(javax.swing.JComponent)

getMaximumSize

public Dimension getMaximumSize(JComponent c)
從類別 ComponentUI 複製的描述
返回指定元件的適合外觀的最大大小。如果返回 null,則最大大小將由元件的佈局管理器計算(對於安裝了特定佈局管理器的元件而言,這是首選方法)。此方法的預設實作調用 getPreferredSize 並返回該值。

覆寫:
類別 ComponentUI 中的 getMaximumSize
參數:
c - 將查詢其最大大小的元件;此參數常被忽略,但如果 UI 物件是無狀態的並由多個元件共享,則可以使用該參數
返回:
一個 Dimension 物件或 null
另請參見:
JComponent.getMaximumSize(), LayoutManager2.maximumLayoutSize(java.awt.Container)

JavaTM 2 Platform
Standard Ed. 6

提交錯誤或意見

版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only