Vector<Transition> transitions = treeDiff.getTransitions(beforeRootBox, afterRootBox); // Done once!
for (int frame=initialFrameNumber; frame<animationEnd+END_NUMBER; frame++) {
g2D.setColor(COLOUR_SCHEME.getBackgroundColour());
g2D.fillRect(0, 0, WIDTH, HEIGHT);
if (frame<animationStart) { // Draw the 'before' box.
beforeRootBox.paintAt(g2D, topLeft, COLOUR_SCHEME);
} else if (frame>=animationEnd) { // Draw the 'after' box.
afterRootBox.paintAt(g2D, topLeft, COLOUR_SCHEME);
} else { // Animate between 'before' and 'after' boxes.
double fractionalTime = frame-animationStart;
fractionalTime /= animationEnd - animationStart - 1.0;