|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcs2110.collision.Shape
public class Shape
An instance is a collection of blocks.
Constructor Summary | |
---|---|
Shape(java.util.HashSet<Block> blocks)
Constructor: An instance containing blocks. |
Method Summary | |
---|---|
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 |
createBufferedImage()
Store in field bi a BufferedImage containing all the blocks in this Shape. |
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 |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Shape(java.util.HashSet<Block> blocks)
blocks
- A collection of blocks.Method Detail |
---|
public void createBufferedImage()
public void clear()
public void displace(Vector2D v)
v
- Displacement 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)
p
- A point.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |