jcckit.graphic
Interface GraphicalElement

All Known Implementing Classes:
BasicGraphicalElement, GraphicalComposite

public interface GraphicalElement

Interface all graphical elements have to implement. Together with the marker interface Renderer it realizes the Anticyclic Visitor Pattern, a variant of the GoF Visitor Pattern. This allows not only to extend JCCKit with new renderers but also with new types of GraphicalElements without touching existing code.

Author:
Franz-Josef Elmer

Method Summary
 void renderWith(Renderer renderer)
          Renders this element according to the type of renderer.
 

Method Detail

renderWith

public void renderWith(Renderer renderer)
Renders this element according to the type of renderer. Concrete GraphicalElements who are not instances of GraphicalComposite dynamically cast renderer. If it does not implement the type of renderer specific for the concrete GraphicalElement it should throw an IllegalArgumentException.