package visual.statik.described;

import java.awt.*;
import java.util.Iterator;


/**
 * A simple collection of Content objects
 *
 * This class is less flexible than the CompositeContent class
 * but is simpler for some purposes.
 *
 * @author  Prof. David Bernstein, James Madison University
 * @version 1.0
 */
public class      AggregateContent 
       extends    visual.statik.AbstractAggregateContent<Content>
       implements TransformableContent
{
    /**
     * Default Constructor
     */
    public AggregateContent()
    {
       super();       
    }
    


    /**
     * Set the Color to use for stroking
     *
     * @param color The Color to use (or null to prevent stroking)
     */
    public void setColor(Color color)
    {
       Iterator<Content>  i;
       
       i = iterator();
       while (i.hasNext())
       {
          i.next().setColor(color);          
       }
    }
    


    /**
     * Set the Paint to use for filling
     *
     * @param paint  The Paint to use (or null to prevent filling)
     */
    public void setPaint(Paint paint)
    {
       Iterator<Content>  i;
       
       i = iterator();
       while (i.hasNext())
       {
          i.next().setPaint(paint);          
       }
    }
    


    /**
     * Set the Stroke to use
     *
     * @param stroke  The Stroke to use (or null to use the default)
     */
    public void setStroke(Stroke stroke)
    {
       Iterator<Content>  i;
       
       i = iterator();
       while (i.hasNext())
       {
          i.next().setStroke(stroke);          
       }
    }

}
