|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DrawableInterface
DrawableInterface describes the methods available for manipulating any graphical object placed on a DrawingCanvas.
Method Summary | |
---|---|
abstract void |
addToCanvas(DrawingCanvas c)
Places an existing object on a specified DrawingCanvas. |
abstract boolean |
contains(Location point)
Determines if a particular position on the DrawingCanvas is contained within the object. |
abstract DrawingCanvas |
getCanvas()
Determine which (if any) DrawingCanvas this object is positioned on |
abstract Color |
getColor()
Retrieves the color of the object. |
abstract void |
hide()
Temporarily hides an object on a DrawingCanvas from view. |
abstract boolean |
isHidden()
Determine whether an object is currently visible on its canvas |
abstract void |
move(double dx,
double dy)
Moves the object within the canvas in the x and y direction by the amounts specified as parameters. |
abstract void |
moveTo(double x,
double y)
Moves the object within the canvas to the x and y coordinates provided. |
abstract void |
moveTo(Location point)
Moves the object within the canvas to the specified Location |
abstract void |
removeFromCanvas()
Permanently removes the object from the canvas it is currently on. |
abstract void |
sendBackward()
Sends the object backward. |
abstract void |
sendForward()
Sends the object forward. |
abstract void |
sendToBack()
Sends the object to the back. |
abstract void |
sendToFront()
Sends the object to the front. |
abstract void |
setColor(Color c)
Sets the color of the object. |
abstract void |
show()
Shows the object if it has been hidden. |
Method Detail |
---|
void addToCanvas(DrawingCanvas c)
removeFromCanvas()
followed
by addToCanvas. This method can also be invoked to place a Drawable object on a
DrawingCanvas after the object is loaded from a file or other stream.
c
- the canvas on which the object should be drawnboolean contains(Location point)
point
- the position on the canvas.
DrawingCanvas getCanvas()
Color getColor()
void hide()
show()
method.
If the goal is to remove an object from the display permanently, the
removeFromCanvas()
method should be used instead.
boolean isHidden()
void move(double dx, double dy)
dx
- the amount to move in the x-direction.dy
- the amount to move in the y-direction.void moveTo(double x, double y)
x
- horizontal coordinate of destination.y
- horizontal coordinate of destination.void moveTo(Location point)
point
- the destination for moving the object.void removeFromCanvas()
hide()
instead.
void sendBackward()
void sendForward()
void sendToBack()
void sendToFront()
void setColor(Color c)
c
- the color.void show()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |