diva.util.java2d
Class PaintedList

java.lang.Object
  extended by diva.util.java2d.PaintedList
All Implemented Interfaces:
PaintedObject

public class PaintedList
extends java.lang.Object
implements PaintedObject

A class that collects a number of PaintedObjects. This is a low-level utility class intended for constructing graphical objects from some kind of external list.

Version:
$Id: PaintedList.java 38834 2005-07-11 17:15:51Z cxh $
Author:
John Reekie

Field Summary
 java.util.ArrayList paintedObjects
          The list of PaintedObjects
 
Constructor Summary
PaintedList()
           
 
Method Summary
 void add(PaintedObject po)
          Add a new element to the list.
 java.awt.geom.Rectangle2D getBounds()
          Get the bounding box of the list of painted objects.
 void paint(java.awt.Graphics2D g)
          Paint the list of objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

paintedObjects

public java.util.ArrayList paintedObjects
The list of PaintedObjects

Constructor Detail

PaintedList

public PaintedList()
Method Detail

add

public void add(PaintedObject po)
Add a new element to the list. The element is added to the back of the list, and so will be painted over the top of the elements already in the list.


getBounds

public java.awt.geom.Rectangle2D getBounds()
Get the bounding box of the list of painted objects. Clients should cache the bounding box if performance is important.

Specified by:
getBounds in interface PaintedObject

paint

public void paint(java.awt.Graphics2D g)
Paint the list of objects. Objects are painted from the front of the list backwards.

Specified by:
paint in interface PaintedObject