|
Java プラットフォーム 1.2 |
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.CellRendererPane
セルレンダリングとそれを使うコンポーネントの間に挿入されます。これは repaint() メソッドと invalidate() メソッドを妨害するためだけに存在しています。これらのメソッドは妨害を受けなければ、レンダリングが設定されたときにツリーを送ります。このクラスは、JTable、JTree、および JList の実装によって使われます。JList の各行をペイントするコード内での CellRendererPane の使用例を次に示します。
cellRendererPane = new CellRendererPane(); ... Component rendererComponent = renderer.getListCellRendererComponent(); renderer.configureListCellRenderer(dataModel.getElementAt(row), row); cellRendererPane.paintComponent(g, rendererComponent, this, x, y, w, h);
レンダリングコンポーネントは、正しく機能するために、isShowing() をオーバーライドして無条件に true を返さなければなりません。これは、Swing のペイントは isShowing が false ではコンポーネントに対して何もしないからです。
警告: このクラスの直列化されたオブジェクトは、今後の Swing リリースと互換ではなくなる予定です。現在の直列化のサポートは、短期間の運用や、同じバージョンの Swing を実行するアプリケーション間の RMI に適しています。今後の Swing リリースでは、長期間の持続性をサポートする予定です。
内部クラスの概要 | |
protected class |
CellRendererPane.AccessibleCellRendererPane
|
フィールドの概要 | |
protected AccessibleContext |
accessibleContext
|
クラス java.awt.Component から継承したフィールド |
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
コンストラクタの概要 | |
CellRendererPane()
CellRendererPane オブジェクトを構築します。 |
メソッドの概要 | |
protected void |
addImpl(Component x,
Object constraints,
int index)
指定したコンポーネントがすでにこれの子の場合、あえて何かをすることはありません。 |
AccessibleContext |
getAccessibleContext()
CellRendererPane に関連付けられている AccessibleContext を取得します。 |
void |
invalidate()
セルレンダリングの子が設定されるときに、無効なツリーが送られるのを避けるためにオーバーライドされます。 |
void |
paint(Graphics g)
呼び出してはなりません。 |
void |
paintComponent(Graphics g,
Component c,
Container p,
int x,
int y,
int w,
int h)
this.paintComponent(g, c, p, x, y, w, h, false) を呼び出します。 |
void |
paintComponent(Graphics g,
Component c,
Container p,
int x,
int y,
int w,
int h,
boolean shouldValidate)
セルレンダリングコンポーネント c をグラフィックスオブジェクト g にペイントします。 |
void |
paintComponent(Graphics g,
Component c,
Container p,
Rectangle r)
矩形の x、y、幅、高さの各フィールドを使って this.paintComponent() を呼び出します。 |
void |
update(Graphics g)
呼び出してはなりません。 |
クラス java.lang.Object から継承したメソッド |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
フィールドの詳細 |
protected AccessibleContext accessibleContext
コンストラクタの詳細 |
public CellRendererPane()
メソッドの詳細 |
public void invalidate()
public void paint(Graphics g)
public void update(Graphics g)
protected void addImpl(Component x, Object constraints, int index)
public void paintComponent(Graphics g, Component c, Container p, int x, int y, int w, int h, boolean shouldValidate)
public void paintComponent(Graphics g, Component c, Container p, int x, int y, int w, int h)
public void paintComponent(Graphics g, Component c, Container p, Rectangle r)
public AccessibleContext getAccessibleContext()
|
Java プラットフォーム 1.2 |
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |