JavaTM 2 Platform
Std. Ed. v1.3

javax.swing
クラス CellRendererPane

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.CellRendererPane
すべての実装インタフェース:
Accessible, ImageObserver, MenuContainer, Serializable

public class CellRendererPane
extends Container
implements Accessible

セルレンダリングとそれを使うコンポーネントの間に挿入されます。これは 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
          このクラスは CellRendererPane クラス用のユーザ補助機能のサポートを実装しています。
 
クラス java.awt.Container から継承した内部クラス
Container.AccessibleAWTContainer
 
クラス java.awt.Component から継承した内部クラス
Component.AccessibleAWTComponent
 
フィールドの概要
protected  AccessibleContext accessibleContext
           
 
クラス java.awt.Component から継承したフィールド
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
インタフェース java.awt.image.ImageObserver から継承したフィールド
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
コンストラクタの概要
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.awt.Container から継承したメソッド
add, add, add, add, add, addContainerListener, addNotify, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, setLayout, validate, validateTree
 
クラス java.awt.Component から継承したメソッド
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

フィールドの詳細

accessibleContext

protected AccessibleContext accessibleContext
コンストラクタの詳細

CellRendererPane

public CellRendererPane()
CellRendererPane オブジェクトを構築します。
メソッドの詳細

invalidate

public void invalidate()
セルレンダリングの子が設定されるときに、無効なツリーが送られるのを避けるためにオーバーライドされます。
オーバーライド:
クラス Container 内の invalidate
クラス java.awt.Container からコピーされたタグ:
関連項目:
Container.validate(), Container.layout(), LayoutManager

paint

public void paint(Graphics g)
呼び出してはなりません。
オーバーライド:
クラス Container 内の paint
クラス java.awt.Container からコピーされたタグ:
パラメータ:
g - 指定された Graphics ウィンドウ
関連項目:
Component.update(java.awt.Graphics)

update

public void update(Graphics g)
呼び出してはなりません。
オーバーライド:
クラス Container 内の update
クラス java.awt.Container からコピーされたタグ:
パラメータ:
g - 指定された Graphics ウィンドウ
関連項目:
Component.update(java.awt.Graphics)

addImpl

protected void addImpl(Component x,
                       Object constraints,
                       int index)
指定したコンポーネントがすでにこれの子の場合、あえて何かをすることはありません。重なり順はセルレンダリングコンポーネントにとって問題になりません (CellRendererPane はいずれにしてもペイントしない)。
オーバーライド:
クラス Container 内の addImpl
クラス java.awt.Container からコピーされたタグ:
パラメータ:
comp - 追加されるコンポーネント
constraints - このコンポーネントの配置条件を表現するオブジェクト
index - コンポーネントを挿入するコンテナのリスト内での位置。-1 は最後に挿入することを意味する
関連項目:
Container.add(java.awt.Component), Container.add(java.awt.Component, int), Container.add(java.awt.Component, java.lang.Object), LayoutManager

paintComponent

public void paintComponent(Graphics g,
                           Component c,
                           Container p,
                           int x,
                           int y,
                           int w,
                           int h,
                           boolean shouldValidate)
セルレンダリングコンポーネント c をグラフィックスオブジェクト g にペイントします。コンポーネントが描画される前に、(必要に応じて) これに親が設定され、その境界は w と h に設定され、グラフィックスオブジェクトは (有効に) x、y に変換されます。これが JComponent の場合、ダブルバッファリングは一時的にオフに設定されます。コンポーネントのペイント後には、その境界は -w、-h、0、0 にリセットされるので、それがペイントされた最後のレンダリングコンポーネントの場合には、入力の消費を開始しません。コンテナ p はここで実際に描画の対象になっているコンポーネントで、一般的に this.getParent() に等しくなります。shouldValidate が true の場合、コンポーネント c はペイント前に検証されます。

paintComponent

public 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) を呼び出します。

paintComponent

public void paintComponent(Graphics g,
                           Component c,
                           Container p,
                           Rectangle r)
矩形の x、y、幅、高さの各フィールドを使って this.paintComponent() を呼び出します。

getAccessibleContext

public AccessibleContext getAccessibleContext()
この CellRendererPane に関連した AccessibleContext を返します。CellRendererPanes の場合、AccessibleContext は AccessibleCellRendererPane の形式を取ります。必要に応じて新規の AccessibleCellRendererPane インスタンスが作成されます。
定義:
インタフェース Accessible 内の getAccessibleContext
オーバーライド:
クラス Component 内の getAccessibleContext
戻り値:
この CellRendererPane の AccessibleContext として機能する AccessibleCellRendererPane

JavaTM 2 Platform
Std. Ed. v1.3

バグや機能要求の報告
さらに詳しい API リファレンスおよび開発者ドキュメントについては、 Java 2 SDK SE Developer Documentation を参照してください。このドキュメントには、概念、用語の定義、回避策、 実用的なコード例など、開発者を対象にした詳細な解説が掲載されています。

Java、Java 2D、JDBC は、米国およびその他の国における米国 Sun Microsystems, Inc. の商標もしくは登録商標です。
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.