|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
DrawableInterface is an interface for objects being placed on a DrawingCanvas.
Method Summary | |
void |
addToCanvas(DrawingCanvas c)
Sets the drawing canvas for the object. |
boolean |
contains(Location point)
Determines if a point is contained in the object. |
void |
draw(java.awt.Graphics g)
Draws the object. |
java.awt.Color |
getColor()
Retrieves the color of the object. |
void |
hide()
Hides the object. |
boolean |
isHidden()
|
void |
move(double dx,
double dy)
Moves the object within the canvas in the x and y direction the amount specified by the parameters. |
void |
moveTo(double x,
double y)
Moves the object within the canvas to the x and y coordinates provided. |
void |
moveTo(Location point)
Moves the object within the canvas to the specified Location |
void |
removeFromCanvas()
Permanently removes the object from the canvas it is currently on. |
void |
sendBackward()
Sends the object backward. |
void |
sendForward()
Sends the object forward. |
void |
sendToBack()
Sends the object to the back. |
void |
sendToFront()
Sends the object to the front. |
void |
setColor(java.awt.Color c)
Sets the color of the object. |
void |
show()
Shows the object if it has been hidden. |
Method Detail |
public void draw(java.awt.Graphics g)
g
- the graphics context into which the object is drawn.public void hide()
public void show()
public boolean isHidden()
public void moveTo(Location point)
point
- the destination for moving the object.public void moveTo(double x, double y)
x
- horizontal coordinate of destination.y
- horizontal coordinate of destination.public void move(double dx, double dy)
dx
- the amount to move in the x-direction.dy
- the amount to move in the y-direction.public void setColor(java.awt.Color c)
c
- the color.public java.awt.Color getColor()
public void sendForward()
public void sendBackward()
public void sendToFront()
public void sendToBack()
public boolean contains(Location point)
point
- the point.public void addToCanvas(DrawingCanvas c)
c
- the canvas on which the object will be drawnpublic void removeFromCanvas()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |