public class Canvas
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
delay(int millis)
Pauses by a given delay so that the user can see the canvas before it is transformed.
|
static Canvas |
getInstance()
Gets the unique instance of this class.
|
Shape[] |
getShapes()
Gets all shapes in this canvas.
|
static void |
pause()
Pauses so that the user can see the canvas before it is transformed.
|
void |
remove(Shape s)
Removes a shape from this canvas.
|
void |
repaint()
Repaints this canvas.
|
void |
saveToDisk(java.lang.String fileName)
Saves this canvas to an image file.
|
void |
show(Shape s)
Adds a shape to this canvas.
|
static void |
snapshot()
Takes a snapshot of the canvas, fades it, and sets it as the background.
|
public static Canvas getInstance()
public void show(Shape s)
s
- the shape to showpublic void remove(Shape s)
s
- the shape to removepublic void repaint()
public static void pause()
public static void delay(int millis)
millis
- the length of the delay in millisecondspublic static void snapshot()
public void saveToDisk(java.lang.String fileName)
fileName
- the name of the filepublic Shape[] getShapes()