|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
Base interface for all figures implemented in the grafic editor. Every Figure-type has to implement this interface.
| Method Summary | |
void |
addFigureListener(jdraw.framework.FigureListener listener)
Adds the specified figure listener to receive figure events from this figure. |
java.lang.Object |
clone()
Returns a Clone of this figure |
boolean |
contains(int x,
int y)
Tests whether the mouse coordinates are contained in the figure. |
void |
draw(java.awt.Graphics g)
draw is called when the figure has to be drawn. |
java.awt.Rectangle |
getBounds()
Returns the bounds of a figure. |
java.awt.Point |
getCenter()
Returns the center of a figure. |
java.util.List |
getHandles()
Returns a list of handles. |
boolean |
isEmpty()
Tests whether the figure is empty. |
void |
move(int dx,
int dy)
Moves the figure. |
void |
removeFigureListener(jdraw.framework.FigureListener listener)
Removes the specified figure listener so that it no longer receives figure events from this figure. |
void |
setBounds(java.awt.Point origin,
java.awt.Point corner)
Changes the bounds of the figure. |
| Method Detail |
public void setBounds(java.awt.Point origin,
java.awt.Point corner)
origin - the new origincorner - the new corneraddFigureListener(jdraw.framework.FigureListener)public void draw(java.awt.Graphics g)
g - Graphics object on which figure has to be drawn.Graphics
public void move(int dx,
int dy)
dx - move distance in x direction (argument in pixels)dy - move distance in y direction (argument in pixels)addFigureListener(jdraw.framework.FigureListener)
public boolean contains(int x,
int y)
x - x-coordinate of mouse positiony - y-coordinate of mouse position
public java.awt.Rectangle getBounds()
public java.awt.Point getCenter()
public java.util.List getHandles()
Handlepublic boolean isEmpty()
DrawToolpublic void addFigureListener(jdraw.framework.FigureListener listener)
listener - the figure listener.FigureListenerpublic void removeFigureListener(jdraw.framework.FigureListener listener)
listener - the figure listener.FigureListenerpublic java.lang.Object clone()
clone in class java.lang.Object
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||