|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The Shape
interface provides definitions for objects that represent
some form of geometric shape in the screens integer coordinate space.
Every Shape
stores a name to identify the element.
are meant to be static and should not be changed
after creation.
Shape
s
Method Summary | |
boolean |
contains(int x,
int y)
Tests if a given coordinate is inside the boundary of the Shape. |
boolean |
contains(int x,
int y,
int w,
int h)
Tests if the interior of the Shape entirely contains the specified rectangular area. |
boolean |
contains(java.awt.Point p)
Tests if a specified Point is inside the boundary
of the Shape. |
void |
draw(java.awt.Graphics g)
Strokes the outline of the Shape using the settings of the Graphics context. |
void |
fill(java.awt.Graphics g)
Fills the interior of the Shape using the settings of the Graphics context. |
RectangleShape |
getBoundShape()
Return the bounding box of the Shape. |
java.awt.Point |
getCenter()
Returns the center point of the framing rectangle of the Shape. |
int |
getCenterX()
Returns the X coordinate of the center of the framing rectangle of the Shape. |
int |
getCenterY()
Returns the Y coordinate of the center of the framing rectangle of the Shape. |
boolean |
intersects(int x,
int y,
int w,
int h)
Tests if the interior of the Shape intersects the interior of a specified rectangular area. |
void |
setLocation(int x,
int y)
Moves the this Shape to the specified location. |
void |
translate(int dx,
int dy)
Translates this Shape by the vector (x,y) . |
Methods inherited from interface java.awt.Shape |
contains, contains, contains, contains, getBounds, getBounds2D, getPathIterator, getPathIterator, intersects, intersects |
Methods inherited from interface gishur.core.Cloneable |
clone |
Method Detail |
public boolean contains(int x, int y)
x
- x-coordinate of the pointy
- y-coordinate of the pointtrue
if the specified point is
inside the boundary of the Shape;
false
otherwise.public boolean contains(java.awt.Point p)
Point
is inside the boundary
of the Shape.p
- a specified pointtrue
if the specified point is
inside the boundary of the Shape;
false
otherwise.public boolean intersects(int x, int y, int w, int h)
x, y
- the coordinates of the specified rectangular areaw
- the width of the specified rectangular areah
- the height of the specified rectangular areatrue
if the interior of the Shape and
the interior of the rectangular area intersect;
false
otherwise.public boolean contains(int x, int y, int w, int h)
x, y
- the coordinates of the specified rectangular areaw
- the width of the specified rectangular areah
- the height of the specified rectangular areatrue
if the interior of the Shape
entirely contains the specified rectangular area;
false
otherwise.intersects(int, int, int, int)
public RectangleShape getBoundShape()
public int getCenterX()
public int getCenterY()
public java.awt.Point getCenter()
public void translate(int dx, int dy)
this
Shape by the vector (x,y)
.dx
- x coordinate of the translation vectordy
- y coordinate of the translation vectorpublic void setLocation(int x, int y)
this
Shape to the specified location.dx
- x coordinate of point to move tody
- y coordinate of point to move topublic void draw(java.awt.Graphics g)
Graphics
context. This does nothing, if the Shape
is not visible (see #visible
).g
- Graphics contextpublic void fill(java.awt.Graphics g)
Graphics
context. This does nothing, if the Shape
is not visible (see #visible
).g
- Graphics context
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |