if (!started) {
display = Display.getDisplay(this);
form = new Form("Animation");
rateGauge = new Gauge("Frame rate", true, 10, FRAME_RATE);
blockGauge = new Gauge("Blocks", true, 4, BLOCK_COUNT);
form.append(rateGauge);
form.append(blockGauge);
form.setItemStateListener(this);
canvas = createAnimationCanvas();
exitCommand = new Command("Exit", Command.EXIT, 0);
setupCommand = new Command("Setup", Command.SCREEN, 0);
runCommand = new Command("Run", Command.SCREEN, 0);
canvas.addCommand(exitCommand);
canvas.addCommand(setupCommand);
form.addCommand(exitCommand);
form.addCommand(runCommand);
form.setCommandListener(this);
canvas.setCommandListener(this);
display.setCurrent(form);
started = true;
}