|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jdraw.graphicobjects.GraphicObject
The abstract parent class of all graphic objects.
Field Summary | |
private Color |
color
The color of this object. |
private int |
x
The abscissa of this object. |
private int |
y
The ordinate of this object. |
Constructor Summary | |
protected |
GraphicObject(int x,
int y,
Color color)
Creates a new GraphicObject with specified position and color. |
Method Summary | |
abstract Rectangle |
getBoundingBox()
Returns the bounding box of this object. |
Color |
getColor()
Returns the color of this object. |
abstract Cursor |
getCursor()
Returns the mouse cursor for this object. |
int |
getDistance(Point point)
Returns the minimal distance between this object and the specified point. |
static int |
getDistanceSq(double x1,
double y1,
double x2,
double y2)
Returns the square of the distance between two points, stated by their coordinates (doubles). |
static int |
getDistanceSq(int x1,
int y1,
int x2,
int y2)
Returns the square of the distance between two points, stated by their coordinates (integers). |
abstract int |
getDistanceSq(Point point)
Returns the square of the minimal distance between this object and the specified point. |
abstract String |
getFriendlyName()
Returns the friendly name of this object. |
int |
getX()
Returns the abscissa of this object. |
int |
getY()
Returns the ordinate of this object. |
abstract void |
paint(Graphics g)
Paints this object. |
void |
updateCachedData()
Invoked when cached data have to be updated. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private int x
private int y
private Color color
Constructor Detail |
protected GraphicObject(int x, int y, Color color)
GraphicObject
with specified position and color.
Method Detail |
public abstract Rectangle getBoundingBox()
public abstract Cursor getCursor()
public abstract String getFriendlyName()
public abstract void paint(Graphics g)
public int getDistance(Point point)
public abstract int getDistanceSq(Point point)
public static int getDistanceSq(int x1, int y1, int x2, int y2)
x1
- the abscissa of the first pointy1
- the ordinate of the first pointx2
- the abscissa of the second pointy2
- the ordinate of the second pointpublic static int getDistanceSq(double x1, double y1, double x2, double y2)
x1
- the abscissa of the first pointy1
- the ordinate of the first pointx2
- the abscissa of the second pointy2
- the ordinate of the second pointpublic int getX()
public int getY()
public Color getColor()
public void updateCachedData()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |