|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectCanvas
public class Canvas
Canvas is a class to allow for simple graphical drawing on a canvas. This is a modification of the general purpose Canvas, specially made for the BlueJ "shapes" example.
Method Summary | |
---|---|
void |
draw(Object referenceObject,
String color,
Shape shape)
Draw a given shape onto the canvas. |
void |
erase(Object referenceObject)
Erase a given shape's from the screen. |
static Canvas |
getCanvas()
Factory method to get the canvas singleton object. |
void |
setForegroundColor(String colorString)
Set the foreground colour of the Canvas. |
void |
setVisible(boolean visible)
Set the canvas visibility and brings canvas to the front of screen when made visible. |
void |
wait(int milliseconds)
Wait for a specified number of milliseconds before finishing. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void draw(Object referenceObject, String color, Shape shape)
referenceObject
- an object to define identity for this shapecolor
- the color of the shapeshape
- the shape object to be drawn on the canvaspublic void erase(Object referenceObject)
referenceObject
- the shape object to be erasedpublic static Canvas getCanvas()
public void setForegroundColor(String colorString)
newColour
- the new colour for the foreground of the Canvaspublic void setVisible(boolean visible)
visible
- boolean value representing the desired visibility of
the canvas (true or false)public void wait(int milliseconds)
milliseconds
- the number
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |