jcckit.graphic
Class GraphicalComposite

java.lang.Object
  extended byjcckit.graphic.GraphicalComposite
All Implemented Interfaces:
GraphicalElement

public class GraphicalComposite
extends java.lang.Object
implements GraphicalElement

Container for GraphicalElements.

Author:
Franz-Josef Elmer

Constructor Summary
GraphicalComposite(ClippingShape clippingShape)
          Creates an instance with the specified clipping shape.
 
Method Summary
 void addElement(GraphicalElement element)
          Adds the specified element at the end of the list of elements.
 ClippingShape getClippingShape()
          Returns the clipping shape.
 void removeAllElements()
          Remove all elements.
 void renderWith(Renderer renderer)
          Renders all GraphicalElements in the sequence they have been added.
 void replaceElementAt(int index, GraphicalElement element)
          Replaces the specified element at the specified index of the list of elements.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphicalComposite

public GraphicalComposite(ClippingShape clippingShape)
Creates an instance with the specified clipping shape.

Parameters:
clippingShape - Clipping shape or null if no clipping.
Method Detail

getClippingShape

public ClippingShape getClippingShape()
Returns the clipping shape.

Returns:
null if no clipping should be applied.

addElement

public void addElement(GraphicalElement element)
Adds the specified element at the end of the list of elements.

Parameters:
element - Element to be added. null is not allowed.
Throws:
java.lang.NullPointerException - if element == null

removeAllElements

public void removeAllElements()
Remove all elements.


replaceElementAt

public void replaceElementAt(int index,
                             GraphicalElement element)
Replaces the specified element at the specified index of the list of elements.

Parameters:
element - New element. null is not allowed.
Throws:
java.lang.NullPointerException - if element == null

renderWith

public void renderWith(Renderer renderer)
Renders all GraphicalElements in the sequence they have been added.

Specified by:
renderWith in interface GraphicalElement
Parameters:
renderer - Renderer which implements all renderer interfaces necessary to render the child elements.
Throws:
java.lang.IllegalArgumentException - if renderer is not an instance of GraphicalCompositeRenderer.