JavaTM Platform
Standard Ed. 6

javax.swing.plaf.basic
クラス BasicTableUI

java.lang.Object
  上位を拡張 javax.swing.plaf.ComponentUI
      上位を拡張 javax.swing.plaf.TableUI
          上位を拡張 javax.swing.plaf.basic.BasicTableUI

public class BasicTableUI
extends TableUI

BasicTableUI の実装です。


入れ子のクラスの概要
 class BasicTableUI.FocusHandler
          この内部クラスは「public」とマークされますが、これはコンパイラのバグが原因です。
 class BasicTableUI.KeyHandler
          この内部クラスは「public」とマークされますが、これはコンパイラのバグが原因です。
 class BasicTableUI.MouseInputHandler
          この内部クラスは「public」とマークされますが、これはコンパイラのバグが原因です。
 
フィールドの概要
protected  FocusListener focusListener
           
protected  KeyListener keyListener
           
protected  MouseInputListener mouseInputListener
           
protected  CellRendererPane rendererPane
           
protected  JTable table
           
 
コンストラクタの概要
BasicTableUI()
           
 
メソッドの概要
protected  FocusListener createFocusListener()
          JTable でキーボードナビゲーションを処理するためのフォーカスリスナーを作成します。
protected  KeyListener createKeyListener()
          JTable でキーボードナビゲーションを処理するためのキーリスナーを作成します。
protected  MouseInputListener createMouseInputListener()
          JTable のマウスリスナーを作成します。
static ComponentUI createUI(JComponent c)
           
 int getBaseline(JComponent c, int width, int height)
          ベースラインを返します。
 Component.BaselineResizeBehavior getBaselineResizeBehavior(JComponent c)
          サイズの変化に合わせてコンポーネントのベースラインがどのように変化するかを示す列挙を返します。
 Dimension getMaximumSize(JComponent c)
          テーブルの最大サイズを返します。
 Dimension getMinimumSize(JComponent c)
          テーブルの最小サイズを返します。
 Dimension getPreferredSize(JComponent c)
          テーブルの適切なサイズを返します。
protected  void installDefaults()
          フォント、フォアグラウンド、バックグラウンドなどの JTable プロパティーを初期化します。
protected  void installKeyboardActions()
          JTable ですべてのキーボードアクションを登録します。
protected  void installListeners()
          JTable にリスナーを接続します。
 void installUI(JComponent c)
          Look & Feel に適した、指定されたコンポーネントを構成します。
 void paint(Graphics g, JComponent c)
          installUI() により設定された table のインスタンス表現をペイントします。
protected  void uninstallDefaults()
           
protected  void uninstallKeyboardActions()
           
protected  void uninstallListeners()
           
 void uninstallUI(JComponent c)
          installUI 時に、指定されたコンポーネントで構成された内容を取り消します。
 
クラス javax.swing.plaf.ComponentUI から継承されたメソッド
contains, getAccessibleChild, getAccessibleChildrenCount, update
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

table

protected JTable table

rendererPane

protected CellRendererPane rendererPane

keyListener

protected KeyListener keyListener

focusListener

protected FocusListener focusListener

mouseInputListener

protected MouseInputListener mouseInputListener
コンストラクタの詳細

BasicTableUI

public BasicTableUI()
メソッドの詳細

createKeyListener

protected KeyListener createKeyListener()
JTable でキーボードナビゲーションを処理するためのキーリスナーを作成します。


createFocusListener

protected FocusListener createFocusListener()
JTable でキーボードナビゲーションを処理するためのフォーカスリスナーを作成します。


createMouseInputListener

protected MouseInputListener createMouseInputListener()
JTable のマウスリスナーを作成します。


createUI

public static ComponentUI createUI(JComponent c)

installUI

public void installUI(JComponent c)
クラス ComponentUI の記述:
Look & Feel に適した、指定されたコンポーネントを構成します。このメソッドは、ComponentUI インスタンスが、指定されたコンポーネントの UI 委譲としてインストールされているときに呼び出されます。このメソッドは、以下を含む Look & Feel 用のコンポーネントを完全に構成する必要があります。
  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()

installDefaults

protected void installDefaults()
フォント、フォアグラウンド、バックグラウンドなどの JTable プロパティーを初期化します。フォント、フォアグラウンド、バックグラウンドのプロパティーは現在の値が null または UIResource の場合にだけ設定され、ほかのプロパティーは現在の値が null の場合に設定されます。

関連項目:
installUI(javax.swing.JComponent)

installListeners

protected void installListeners()
JTable にリスナーを接続します。


installKeyboardActions

protected void installKeyboardActions()
JTable ですべてのキーボードアクションを登録します。


uninstallUI

public void uninstallUI(JComponent c)
クラス ComponentUI の記述:
installUI 時に、指定されたコンポーネントで構成された内容を取り消します。このメソッドは、指定されたコンポーネントの UI 委譲としての UIComponent インスタンスが削除されているときに呼び出されます。このメソッドは、installUI によって実行された構成を元に戻す必要があります。この場合、JComponent インスタンスをクリーンな状態 (余分なリスナーや、Look & Feel 固有のプロパティーオブジェクトが残らないように) にするよう十分注意してください。手順には次のものがあります。
  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()

uninstallDefaults

protected void uninstallDefaults()

uninstallListeners

protected void uninstallListeners()

uninstallKeyboardActions

protected void uninstallKeyboardActions()

getBaseline

public int getBaseline(JComponent c,
                       int width,
                       int height)
ベースラインを返します。

オーバーライド:
クラス ComponentUI 内の getBaseline
パラメータ:
c - 要求される JComponent ベースライン
width - ベースラインを取得する幅
height - ベースラインを取得する高さ
戻り値:
ベースラインまたは 0 より小さい値 (適切なベースラインが 存在しない)
例外:
NullPointerException - cnull の場合
IllegalArgumentException - 幅または高さが 0 より小さい場合
導入されたバージョン:
1.6
関連項目:
JComponent.getBaseline(int, int)

getBaselineResizeBehavior

public Component.BaselineResizeBehavior getBaselineResizeBehavior(JComponent c)
サイズの変化に合わせてコンポーネントのベースラインがどのように変化するかを示す列挙を返します。

オーバーライド:
クラス ComponentUI 内の getBaselineResizeBehavior
パラメータ:
c - ベースラインのサイズ変更の動作を返す JComponent
戻り値:
コンポーネントのサイズ変更に伴うベースラインの変化を示す 列挙型の値
例外:
NullPointerException - cnull の場合
導入されたバージョン:
1.6
関連項目:
JComponent.getBaseline(int, int)

getMinimumSize

public Dimension getMinimumSize(JComponent c)
テーブルの最小サイズを返します。最小の高さは、行の高さに行数を掛けた値です。最小幅は、各列の最小幅の合計です。

オーバーライド:
クラス ComponentUI 内の getMinimumSize
パラメータ:
c - 最小サイズを照会されるコンポーネント。 この引数は通常無視されるが、 UI オブジェクトに状態がなく、複数のコンポーネントに共有されている場合は 使用されることがある
戻り値:
Dimension オブジェクト、または null
関連項目:
JComponent.getMinimumSize(), LayoutManager.minimumLayoutSize(java.awt.Container), ComponentUI.getPreferredSize(javax.swing.JComponent)

getPreferredSize

public Dimension getPreferredSize(JComponent c)
テーブルの適切なサイズを返します。適切な高さは、行の高さに行数を掛けた値です。適切な幅は、各列の適切な幅の合計です。

オーバーライド:
クラス ComponentUI 内の getPreferredSize
パラメータ:
c - 適切なサイズを照会されるコンポーネント。 この引数は通常無視されるが、 UI オブジェクトに状態がなく、複数のコンポーネントに共有されている場合は 使用されることがある
関連項目:
JComponent.getPreferredSize(), LayoutManager.preferredLayoutSize(java.awt.Container)

getMaximumSize

public Dimension getMaximumSize(JComponent c)
テーブルの最大サイズを返します。最大の高さは、行の高さに行数を掛けた値です。最大幅は、各列の最大幅の合計です。

オーバーライド:
クラス ComponentUI 内の getMaximumSize
パラメータ:
c - 最大サイズを照会されるコンポーネント。 この引数は通常無視されるが、 UI オブジェクトに状態がなく、複数のコンポーネントに共有されている場合は 使用されることがある
戻り値:
Dimension オブジェクト、または null
関連項目:
JComponent.getMaximumSize(), LayoutManager2.maximumLayoutSize(java.awt.Container)

paint

public void paint(Graphics g,
                  JComponent c)
installUI() により設定された table のインスタンス表現をペイントします。

オーバーライド:
クラス ComponentUI 内の paint
パラメータ:
g - ペイント対象の Graphics コンテキスト
c - ペイントされるコンポーネント。 この引数は通常無視されるが、 UI オブジェクトに状態がなく、複数のコンポーネントに共有されている場合は 使用されることがある
関連項目:
ComponentUI.update(java.awt.Graphics, javax.swing.JComponent)

JavaTM Platform
Standard Ed. 6

バグの報告と機能のリクエスト
さらに詳しい API リファレンスおよび開発者ドキュメントについては、Java SE 開発者用ドキュメントを参照してください。開発者向けの詳細な解説、概念の概要、用語の定義、バグの回避策、およびコード実例が含まれています。

Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。