de.caff.vic

## Class PaintableShape

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

- All Implemented Interfaces:
    Paintable

      public class PaintableShape
      extends java.lang.Object
      implements Paintable

  A paintable shape. It knows of its geometry, colors and paint.
  Author:
    Rammi

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PaintableShape(java.awt.Shape shape, java.awt.Paint fillPaint)` Constructor.
    `PaintableShape(java.awt.Shape shape, java.awt.Stroke drawStroke, java.awt.Paint drawPaint)` Constructor.
    `PaintableShape(java.awt.Shape shape, java.awt.Stroke drawStroke, java.awt.Paint drawPaint, java.awt.Paint fillPaint)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `accept(PaintableVisitor visitor)` Accept a visitor.
    `java.awt.Paint` | `getDrawPaint()` Get the draw paint.
    `java.awt.Stroke` | `getDrawStroke()` Get the draw stroke.
    `java.awt.Paint` | `getFillPaint()` Get the fill paint.
    `java.awt.Shape` | `getShape()` Get the shape.
    `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`

- - ### Constructor Detail

    - #### PaintableShape

          public PaintableShape(@NotNull
                                java.awt.Shape shape,
                                @Nullable
                                java.awt.Stroke drawStroke,
                                @Nullable
                                java.awt.Paint drawPaint,
                                @Nullable
                                java.awt.Paint fillPaint)

      Constructor.
      Parameters:
        `shape` - shape to draw
        `drawStroke` - stroke for drawing the shape, if `null` the shape isn't drawn
        `drawPaint` - paint for drawing, if `null` the shape isn't drawn
        `fillPaint` - paint for filling, if `null` the shape isn't filled

    - #### PaintableShape

          public PaintableShape(@NotNull
                                java.awt.Shape shape,
                                @Nullable
                                java.awt.Stroke drawStroke,
                                @Nullable
                                java.awt.Paint drawPaint)

      Constructor. This creates an unfilled shape.
      Parameters:
        `shape` - shape to draw
        `drawStroke` - stroke for drawing the shape, if `null` the shape isn't drawn
        `drawPaint` - paint for drawing, if `null` the shape isn't drawn

    - #### PaintableShape

          public PaintableShape(@NotNull
                                java.awt.Shape shape,
                                @Nullable
                                java.awt.Paint fillPaint)

      Constructor. This creates an undrawn shape.
      Parameters:
        `shape` - shape to draw
        `fillPaint` - paint for filling, if `null` the shape isn't filled

  - ### 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)

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

    - #### getShape

          @NotNull
          public java.awt.Shape getShape()

      Get the shape.
      Returns:
        the shape

    - #### getDrawStroke

          @Nullable
          public java.awt.Stroke getDrawStroke()

      Get the draw stroke.
      Returns:
        draw stroke (possibly `null`)

    - #### getDrawPaint

          @Nullable
          public java.awt.Paint getDrawPaint()

      Get the draw paint.
      Returns:
        draw paint (possibly `null`)

    - #### getFillPaint

          @Nullable
          public java.awt.Paint getFillPaint()

      Get the fill paint.
      Returns:
        fill paint (possibly `null`)