public Canvas getCanvas() {
return canvas;
}
public void setCanvas(Canvas canvas) {
Canvas previousCanvas = this.canvas;
if (previousCanvas != canvas) {
this.canvas = canvas;
if (previousCanvas != null) {
previousCanvas.getCanvasListeners().remove(canvasListener);
}
if (canvas != null) {
canvas.getCanvasListeners().add(canvasListener);
}