visual.statik
Class AbstractAggregateContent<C extends TransformableContent>

java.lang.Object
  extended by visual.statik.AbstractTransformableContent
      extended by visual.statik.AbstractAggregateContent<C>
All Implemented Interfaces:
SimpleContent, TransformableContent
Direct Known Subclasses:
AggregateContent, AggregateContent, CompositeContent, CompositeContent, CompositeContent

public abstract class AbstractAggregateContent<C extends TransformableContent>
extends AbstractTransformableContent

A generic piece of static visual content that is a composition of many component parts Note: The bounds are not stored in attributes to make this class easier to understand. To do so would require: (1) Use of the isTransformationRequired() method in the parent; and (2) Changes to the add() and remove() methods in this class.

See Also:
"The Design and Implementation of Multimedia Software © 2011"

Field Summary
protected  java.util.LinkedList<C> components
           
 
Fields inherited from class visual.statik.AbstractTransformableContent
angle, relocated, rerotated, rescaled, x, xRotation, xScale, y, yRotation, yScale
 
Constructor Summary
AbstractAggregateContent()
          Default Constructor
 
Method Summary
 void add(C component)
          Add a TransformableContent
 java.awt.geom.Rectangle2D getBounds2D(boolean ofTransformed)
          Returns a high precision bounding box of the Content either before or after it is transformed
 java.util.Iterator<C> iterator()
          Return an Iterator containing all of the TransformableContent objects
 void remove(C component)
          Remove a TransformableContent
 void render(java.awt.Graphics g)
          Render this AbstractAggregateContent (required by TransformableContent)
 
Methods inherited from class visual.statik.AbstractTransformableContent
getAffineTransform, getBounds2D, isTransformationRequired, setLocation, setRotation, setScale, setScale, setTransformationRequired
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

components

protected java.util.LinkedList<C extends TransformableContent> components
Constructor Detail

AbstractAggregateContent

public AbstractAggregateContent()
Default Constructor

Method Detail

add

public void add(C component)
Add a TransformableContent

Parameters:
component - The TransformableContent to add

getBounds2D

public java.awt.geom.Rectangle2D getBounds2D(boolean ofTransformed)
Returns a high precision bounding box of the Content either before or after it is transformed

Specified by:
getBounds2D in interface TransformableContent
Specified by:
getBounds2D in class AbstractTransformableContent
Parameters:
ofTransformed - true to get the BB of the transformed content
Returns:
The bounding box

iterator

public java.util.Iterator<C> iterator()
Return an Iterator containing all of the TransformableContent objects

Returns:
The Iterator

remove

public void remove(C component)
Remove a TransformableContent

Parameters:
component - The TransformableContent to remove

render

public void render(java.awt.Graphics g)
Render this AbstractAggregateContent (required by TransformableContent)

Parameters:
g - The rendering engine to use


Design and Implementation of Multimedia Software, Jones and Bartlett Publishers