}
@Override
public void initialize() {
add(new Label("This demo does not work under IE."));
Surface originalCanvas = new Surface(300, 300);
Circle smallCircle = new Circle(150, 150, 140);
Circle bigCircle = new Circle(150, 150, 150);
Shape smallCircleShape = new ShapeBuilder().drawCircle(smallCircle).build();
Shape bigCircleShape = new ShapeBuilder().drawCircle(bigCircle).build();
Gradient radialGradient = new RadialGradient(new Circle(150, 150, 0), smallCircle)
.addColorStop(0, KnownColor.RED)
.addColorStop(1, KnownColor.GREEN);
originalCanvas.setFillStyle(KnownColor.BLACK)
.fillShape(bigCircleShape)
.setFillStyle(radialGradient)
.fillShape(smallCircleShape);
add(new Label("Original Canvas"));
add(originalCanvas);
add(new Label("Canvas with the original canvas drawn on top of it."));
add(getPrimarySurface());
getPrimarySurface().clear()
.fillBackground(KnownColor.GRAY)
.drawImage(originalCanvas.getCanvas(), 0, 0)
.drawImage(originalCanvas.getCanvas(), 300, 0)
.drawImage(originalCanvas.getCanvas(), 0, 300)
.drawImage(originalCanvas.getCanvas(), 300, 300)
.drawImage(originalCanvas.getCanvas(), 150, 150);
}