javax.swing
Class CellRendererPane

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.CellRendererPane
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class CellRendererPane
extends Container
implements Accessible

Paints the cells of JList, JTable and JTree. It intercepts the usual paint tree, so that we don't walk up and repaint everything.

See Also:
Serialized Form

Nested Class Summary
protected  class CellRendererPane.AccessibleCellRendererPane
          Provides accessibility support for CellRendererPanes.
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  AccessibleContext accessibleContext
          accessibleContext
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
CellRendererPane()
          Constructs a new CellRendererPane.
 
Method Summary
protected  void addImpl(Component c, Object constraints, int index)
          Overridden to check if a component is already a child of this Container.
 AccessibleContext getAccessibleContext()
          getAccessibleContext TODO
 void invalidate()
          Despite normal behaviour this does not cause the container to be invalidated.
 void paint(Graphics graphics)
          Should not be called.
 void paintComponent(Graphics graphics, Component c, Container p, int x, int y, int w, int h)
          Paints the specified component c on the Graphics context graphics.
 void paintComponent(Graphics graphics, Component c, Container p, int x, int y, int w, int h, boolean shouldValidate)
          Paints the specified component c on the Graphics context graphics.
 void paintComponent(Graphics graphics, Component c, Container p, Rectangle r)
          Paints the specified component c on the Graphics context g.
 void update(Graphics graphics)
          Should not be called.
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

accessibleContext

protected AccessibleContext accessibleContext
accessibleContext

Constructor Detail

CellRendererPane

public CellRendererPane()
Constructs a new CellRendererPane.

Method Detail

update

public void update(Graphics graphics)
Should not be called.

Overrides:
update in class Container
Parameters:
graphics - not used here
See Also:
Component.paint(Graphics), Component.repaint()

invalidate

public void invalidate()
Despite normal behaviour this does not cause the container to be invalidated. This prevents propagating up the paint tree.

Overrides:
invalidate in class Container

paint

public void paint(Graphics graphics)
Should not be called.

Overrides:
paint in class Container
Parameters:
graphics - not used here
See Also:
Component.update(Graphics)

addImpl

protected void addImpl(Component c,
                       Object constraints,
                       int index)
Overridden to check if a component is already a child of this Container. If it's already a child, nothing is done. Otherwise we pass this to super.addImpl().

Overrides:
addImpl in class Container
Parameters:
c - the component to add
constraints - not used here
index - not used here

paintComponent

public void paintComponent(Graphics graphics,
                           Component c,
                           Container p,
                           int x,
                           int y,
                           int w,
                           int h,
                           boolean shouldValidate)
Paints the specified component c on the Graphics context graphics. The Graphics context is tranlated to (x,y) and the components bounds are set to (w,h). If shouldValidate is set to true, then the component is validated before painting.

Parameters:
graphics - the graphics context to paint on
c - the component to be painted
p - the parent of the component
x - the X coordinate of the upper left corner where c should be painted
y - the Y coordinate of the upper left corner where c should be painted
w - the width of the components drawing area
h - the height of the components drawing area
shouldValidate - if c should be validated before painting

paintComponent

public void paintComponent(Graphics graphics,
                           Component c,
                           Container p,
                           int x,
                           int y,
                           int w,
                           int h)
Paints the specified component c on the Graphics context graphics. The Graphics context is tranlated to (x,y) and the components bounds are set to (w,h). The component is not validated before painting.

Parameters:
graphics - the graphics context to paint on
c - the component to be painted
p - the parent of the component
x - the X coordinate of the upper left corner where c should be painted
y - the Y coordinate of the upper left corner where c should be painted
w - the width of the components drawing area
h - the height of the components drawing area

paintComponent

public void paintComponent(Graphics graphics,
                           Component c,
                           Container p,
                           Rectangle r)
Paints the specified component c on the Graphics context g. The Graphics context is tranlated to (r.x,r.y) and the components bounds are set to (r.width,r.height). The component is not validated before painting.

Parameters:
graphics - the graphics context to paint on
c - the component to be painted
p - the component on which we paint
r - the bounding rectangle of c

getAccessibleContext

public AccessibleContext getAccessibleContext()
getAccessibleContext TODO

Specified by:
getAccessibleContext in interface Accessible
Overrides:
getAccessibleContext in class Component
Returns:
AccessibleContext