## Class Shape

- java.lang.Object
- - Shape

-     public class Shape
      extends java.lang.Object

  An instance is a collection of blocks.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Shape(java.util.HashSet<Block> blocks)` Constructor: An instance containing blocks.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()` "Clear" the shape from displacement and turned on flags.
    `void` | `click()` Toggle the clickedOn flag.
    `boolean` | `contains(Vector2D p)` Return true iff this shape contains point p.
    `void` | `displace(Vector2D v)` (Further) displace this shape by displacement vector v.
    `void` | `paint(java.awt.Graphics g, double scale)` Paint using g, using scale to scale the image.

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

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

- - ### Constructor Detail

    - #### Shape

          public Shape(java.util.HashSet<Block> blocks)

      Constructor: An instance containing blocks. Precondition: blocks is not empty.

  - ### Method Detail

    - #### clear

          public void clear()

      "Clear" the shape from displacement and turned on flags.

    - #### displace

          public void displace(Vector2D v)

      (Further) displace this shape by displacement vector v.

    - #### paint

          public void paint(java.awt.Graphics g,
                   double scale)

      Paint using g, using scale to scale the image.
      Parameters:
        `g` - A Graphics2D object.
        `scale` - The scale from image coordinates to canvas coordinates.

    - #### click

          public void click()

      Toggle the clickedOn flag.

    - #### contains

          public boolean contains(Vector2D p)

      Return true iff this shape contains point p.