public interface Shape
Method Summary | |
---|---|
boolean |
contains(Point p)
Tells whether the shape encloses a given point. |
void |
draw(java.awt.Graphics gfx)
Draws the shape, using the current graphics context's color. |
void |
drawLabels(java.awt.Graphics gfx)
Draws the shape's associated labels, using the graphics context's color. |
void |
drawPoints(java.awt.Graphics gfx)
Draws the shape's defining points, using the graphics context's color. |
java.lang.String |
getLabel()
Returns the text label associated to this shape. |
java.util.List |
getPoints()
Returns a list containing copies of the shape's defining points. |
void |
setLabel(java.lang.String label)
Associates this shape with a given text label. |
void |
translate(int dx,
int dy)
Translates the shape by the given amount. |
Method Detail |
---|
boolean contains(Point p)
p
- the point we test for encloseness.
void draw(java.awt.Graphics gfx)
gfx
- the graphics context where this shape has to be drawn.void drawLabels(java.awt.Graphics gfx)
gfx
- the graphics context where this shape's labels have
to be drawn.void drawPoints(java.awt.Graphics gfx)
gfx
- the graphics context where this shape's points have
to be drawn.java.lang.String getLabel()
java.util.List getPoints()
void setLabel(java.lang.String label)
label
- the shape's new label.void translate(int dx, int dy)
dx
- the amount to translate along the X-axisdx
- the amount to translate along the Y-axis