Commit ea899eff by Roman Kennke Committed by Michael Koch

CellRendererPane.java: implemented all methods of this class.

2005-04-19  Roman Kennke  <roman@ontographics.com>

	* javax/swing/CellRendererPane.java:
	implemented all methods of this class.
	reformatted all wrong formatted code.

From-SVN: r98379
parent f8bf4f42
2005-04-19 Roman Kennke <roman@ontographics.com>
* javax/swing/CellRendererPane.java:
implemented all methods of this class.
reformatted all wrong formatted code.
2005-04-19 Roman Kennke <roman@kennke.org> 2005-04-19 Roman Kennke <roman@kennke.org>
* javax/swing/BoxLayout.java: * javax/swing/BoxLayout.java:
......
...@@ -50,11 +50,16 @@ import javax.accessibility.AccessibleContext; ...@@ -50,11 +50,16 @@ import javax.accessibility.AccessibleContext;
import javax.accessibility.AccessibleRole; import javax.accessibility.AccessibleRole;
/** /**
* CellRendererPane * The CellRendererPane's purpose is to paint the cells of JList, JTable and
* JTree. It intercepts the usual paint tree, so that we don't walk up and
* repaint everything.
*
* @author Andrew Selkirk * @author Andrew Selkirk
* @version 1.0 * @version 1.0
*/ */
public class CellRendererPane extends Container implements Accessible public class CellRendererPane
extends Container
implements Accessible
{ {
private static final long serialVersionUID = -7642183829532984273L; private static final long serialVersionUID = -7642183829532984273L;
...@@ -83,116 +88,162 @@ public class CellRendererPane extends Container implements Accessible ...@@ -83,116 +88,162 @@ public class CellRendererPane extends Container implements Accessible
} }
} }
/** /**
* accessibleContext * accessibleContext
*/ */
protected AccessibleContext accessibleContext = null; protected AccessibleContext accessibleContext = null;
//------------------------------------------------------------- //-------------------------------------------------------------
// Initialization --------------------------------------------- // Initialization ---------------------------------------------
//------------------------------------------------------------- //-------------------------------------------------------------
/** /**
* Constructor CellRendererPane * Constructs a new CellRendererPane.
*/ */
public CellRendererPane() { public CellRendererPane()
// TODO {
} // CellRendererPane() } // CellRendererPane()
//------------------------------------------------------------- //-------------------------------------------------------------
// Methods ---------------------------------------------------- // Methods ----------------------------------------------------
//------------------------------------------------------------- //-------------------------------------------------------------
/** /**
* writeObject * Should not be called.
* @param stream TODO *
* @exception IOException TODO * @param graphics not used here
*/ */
private void writeObject(ObjectOutputStream stream) throws IOException { public void update(Graphics graphics)
// TODO {
} // writeObject() } // update()
/** /**
* update * Despite normal behaviour this does <em>not</em> cause the container
* @param graphics TODO * to be invalidated. This prevents propagating up the paint tree.
*/ */
public void update(Graphics graphics) { public void invalidate()
// TODO {
} // update() } // invalidate()
/** /**
* invalidate * Should not be called.
*/ *
public void invalidate() { * @param graphics not used here
// TODO */
} // invalidate() public void paint(Graphics graphics)
{
/** }
* paint
* @param graphics TODO /**
*/ * Overridden to check if a component is already a child of this Container.
public void paint(Graphics graphics) { * If it's already a child, nothing is done. Otherwise we pass this to
// TODO * <code>super.addImpl()</code>.
} // paint() *
* @param c the component to add
/** * @param constraints not used here
* addImpl * @param index not used here
* @param c TODO */
* @param constraints TODO protected void addImpl(Component c, Object constraints, int index)
* @param index TODO {
*/ if (!isAncestorOf(c))
protected void addImpl(Component c, Object constraints, int index) { {
// TODO super.addImpl(c, constraints, index);
} // addImpl() }
} // addImpl()
/**
* paintComponent /**
* @param graphics TODO * Paints the specified component <code>c</code> on the {@link Graphics}
* @param c TODO * context <code>graphics</code>. The Graphics context is tranlated to
* @param p TODO * (x,y) and the components bounds are set to (w,h). If
* @param x TODO * <code>shouldValidate</code>
* @param y TODO * is set to true, then the component is validated before painting.
* @param w TODO *
* @param h TODO * @param graphics the graphics context to paint on
* @param shouldValidate TODO * @param c the component to be painted
*/ * @param p the parent of the component
public void paintComponent(Graphics graphics, Component c, * @param x the X coordinate of the upper left corner where c should
Container p, int x, int y, int w, int h, be painted
boolean shouldValidate) { * @param y the Y coordinate of the upper left corner where c should
// TODO be painted
} // paintComponent() * @param w the width of the components drawing area
* @param h the height of the components drawing area
/** * @param shouldValidate if <code>c</code> should be validated before
* paintComponent * painting
* @param graphics TODO */
* @param c TODO public void paintComponent(Graphics graphics, Component c,
* @param p TODO Container p, int x, int y, int w, int h,
* @param x TODO boolean shouldValidate)
* @param y TODO {
* @param w TODO // reparent c
* @param h TODO addImpl(c, null, 0);
*/
public void paintComponent(Graphics graphics, Component c, // translate to (x,y)
Container p, int x, int y, int w, int h) { graphics.translate(x, y);
// TODO
} // paintComponent() // set bounds of c
c.setBounds(0, 0, w, h);
/**
* paintComponent // validate if necessary
* @param graphics TODO if (shouldValidate)
* @param c TODO {
* @param p TODO c.validate();
* @param r TODO }
*/
public void paintComponent(Graphics graphics, Component c, // paint component
Container p, Rectangle r) { c.paint(graphics);
// TODO
} // paintComponent() // untranslate g
graphics.translate(-x, -y);
} // paintComponent()
/**
* Paints the specified component <code>c</code> on the {@link Graphics}
* context <code>graphics</code>. The Graphics context is tranlated to (x,y)
* and the components bounds are set to (w,h). The component is <em>not</em>
* validated before painting.
*
* @param graphics the graphics context to paint on
* @param c the component to be painted
* @param p the parent of the component
* @param x the X coordinate of the upper left corner where c should
be painted
* @param y the Y coordinate of the upper left corner where c should
be painted
* @param w the width of the components drawing area
* @param h the height of the components drawing area
*/
public void paintComponent(Graphics graphics, Component c,
Container p, int x, int y, int w, int h) {
paintComponent(graphics, c, p, x, y, w, h, false);
} // paintComponent()
/**
* Paints the specified component <code>c</code> on the {@link Graphics}
* context <code>g</code>. The Graphics context is tranlated to (r.x,r.y) and
* the components bounds are set to (r.width,r.height).
* The component is <em>not</em>
* validated before painting.
*
* @param graphics the graphics context to paint on
* @param c the component to be painted
* @param p the component on which we paint
* @param r the bounding rectangle of c
*/
public void paintComponent(Graphics graphics, Component c,
Container p, Rectangle r)
{
paintComponent(graphics, c, p, r.x, r.y, r.width, r.height);
} // paintComponent()
/** /**
* getAccessibleContext * getAccessibleContext <em>TODO</em>
* @return AccessibleContext * @return AccessibleContext
*/ */
public AccessibleContext getAccessibleContext() public AccessibleContext getAccessibleContext()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment