de.caff.vic

## Class PaintableGroup

- java.lang.Object
- - de.caff.vic.PaintableGroup

- All Implemented Interfaces:
    Paintable, PaintableCollector, java.lang.Iterable<Paintable>

      public class PaintableGroup
      extends java.lang.Object
      implements Paintable, PaintableCollector, java.lang.Iterable<Paintable>

  A paintable group opens a new context for its children.
  Since:
    December 23, 2017
  Author:
    Rammi

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PaintableGroup()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `accept(PaintableVisitor visitor)` Accept a visitor.
    `void` | `addPaintable(Paintable paintable)` Add a paintable to this group.
    `java.util.List<Paintable>` | `getChildren()` Get the children paintables.
    `java.util.Iterator<Paintable>` | `iterator()`
    `void` | `paintTo(java.awt.Graphics2D g2, Context context)` Paint this object to the given graphics context.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface java.lang.Iterable

      `forEach, spliterator`

- - ### Constructor Detail

    - #### PaintableGroup

          public PaintableGroup()

  - ### Method Detail

    - #### paintTo

          public void paintTo(@NotNull
                              java.awt.Graphics2D g2,
                              @NotNull
                              Context context)

      Description copied from interface: `Paintable`
      Paint this object to the given graphics context.
      Specified by:
        `paintTo` in interface `Paintable`
      Parameters:
        `g2` - graphics
        `context` - drawing context

    - #### accept

          public void accept(@NotNull
                             PaintableVisitor visitor)

      Description copied from interface: `Paintable`
      Accept a visitor. This is one half of the visitor pattern.
      Specified by:
        `accept` in interface `Paintable`
      Parameters:
        `visitor` - visitor for this paintable

    - #### addPaintable

          public void addPaintable(@NotNull
                                   Paintable paintable)

      Add a paintable to this group.
      Specified by:
        `addPaintable` in interface `PaintableCollector`
      Parameters:
        `paintable` - paintable to add

    - #### getChildren

          @NotNull
          public java.util.List<Paintable> getChildren()

      Get the children paintables.
      Returns:
        child paintables

    - #### iterator

          @NotNull
          public java.util.Iterator<Paintable> iterator()

      Specified by:
        `iterator` in interface `java.lang.Iterable<Paintable>`