public class Shape
extends java.lang.Object
Constructor and Description |
---|
Shape(java.util.HashSet<Block> blocks)
Constructor: An instance containing blocks.
|
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.
|
public Shape(java.util.HashSet<Block> blocks)
public void clear()
public void displace(Vector2D v)
public void paint(java.awt.Graphics g, double scale)
g
- A Graphics2D object.scale
- The scale from image coordinates to canvas coordinates.public void click()
public boolean contains(Vector2D p)