public class CarShape extends SelectableShape
Constructor and Description |
---|
CarShape(int x,
int y,
int width)
Constructs a car shape.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(java.awt.geom.Point2D p)
Tests whether this item contains a given point.
|
void |
draw(java.awt.Graphics2D g2)
Draws this item.
|
void |
drawSelection(java.awt.Graphics2D g2)
Draws the selection adornment of this item.
|
void |
translate(int dx,
int dy)
Translates this item by a given amount.
|
isSelected, setSelected
public CarShape(int x, int y, int width)
x
- the left of the bounding rectangley
- the top of the bounding rectanglewidth
- the width of the bounding rectanglepublic void draw(java.awt.Graphics2D g2)
SceneShape
g2
- the graphics contextpublic void drawSelection(java.awt.Graphics2D g2)
SceneShape
g2
- the graphics contextpublic boolean contains(java.awt.geom.Point2D p)
SceneShape
p
- a pointpublic void translate(int dx, int dy)
SceneShape
dx
- the amount to translate in x-directiondy
- the amount to translate in y-direction