Interface GraphicalElement

All Known Implementing Classes:
BasicGraphicalElement, GraphicalComposite, Oval, Polygon, Rectangle, Text

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.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    renderWith(Renderer renderer)
    Renders this element according to the type of renderer.
  • Method Details

    • renderWith

      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.