void delay(long millis) {
		long timeBegin = System.currentTimeMillis();
		refresh();
		millis -= System.currentTimeMillis() - timeBegin;
		int seconds = (int) millis / 1000;
		millis -= seconds * 1000;
		if (millis <= 0)
			millis = 1;
		while (seconds >= 0 && millis > 0 && !interruptExecution.booleanValue()
				&& currentThread == Thread.currentThread()) {
			viewer.popHoldRepaint();
			try {
				Thread.sleep((seconds--) > 0 ? 1000 : millis);
			}
			catch (InterruptedException e) {
			}
			viewer.pushHoldRepaint();
		}
	}