Address oldCursor = mathCollection.getUndo().getAddress();
Ket.out.println("old cursor = " + oldCursor);
Argument before = mathCollection.getUndo().getLastRoot();
Argument after = mathCollection.getCursor().getCurrent();
if (before!=null) {
Painter painter = new Painter(before, after, imageName, imageNumber);
imageNumber += Painter.FRAME_NUMBER;
painter.start();
}
} else {
// Save a single frame.
Equation currentEquation = mathCollection.getCursor().getEquation();
saveAsImage(currentEquation);