javax.swing

Class CellRendererPane

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.
Nested Class Summary
protected classCellRendererPane.AccessibleCellRendererPane
Provides accessibility support for CellRendererPanes.
Field Summary
protected AccessibleContextaccessibleContext
accessibleContext
Constructor Summary
CellRendererPane()
Constructs a new CellRendererPane.
Method Summary
protected voidaddImpl(Component c, Object constraints, int index)
Overridden to check if a component is already a child of this Container.
AccessibleContextgetAccessibleContext()
getAccessibleContext TODO
voidinvalidate()
Despite normal behaviour this does not cause the container to be invalidated.
voidpaint(Graphics graphics)
Should not be called.
voidpaintComponent(Graphics graphics, Component c, Container p, int x, int y, int w, int h, boolean shouldValidate)
Paints the specified component c on the {@link Graphics} context graphics.
voidpaintComponent(Graphics graphics, Component c, Container p, int x, int y, int w, int h)
Paints the specified component c on the {@link Graphics} context graphics.
voidpaintComponent(Graphics graphics, Component c, Container p, Rectangle r)
Paints the specified component c on the {@link Graphics} context g.
voidupdate(Graphics graphics)
Should not be called.

Field Detail

accessibleContext

protected AccessibleContext accessibleContext
accessibleContext

Constructor Detail

CellRendererPane

public CellRendererPane()
Constructs a new CellRendererPane.

Method Detail

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().

Parameters: c the component to add constraints not used here index not used here

getAccessibleContext

public AccessibleContext getAccessibleContext()
getAccessibleContext TODO

Returns: AccessibleContext

invalidate

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

paint

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

Parameters: graphics 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 {@link 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 {@link 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 {@link 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

update

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

Parameters: graphics not used here