public static synchronized TimerSingleton getInstance() { if (inst == null) { inst = new TimerSingleton(); } return inst; }
/** * Prints the message to stdout and then exits with errorcode 1. * * @param message * the message to be displayed. */ private static void displayMessageAndExit(String message, String methodName) { MegaMek.displayMessage(message, methodName); TimerSingleton.getInstance().killTimer(); System.exit(1); }
/** * this should only be called once!! this will cause a timer to schedule * constant screen updates every 20 milliseconds! */ protected TimerTask scheduleRedrawTimer() { final TimerTask redraw = new TimerTask() { @Override public void run() { try { SwingUtilities.invokeLater(redrawWorker); } catch (Exception ie) { System.err.print("Error scheduleRedrawTimer "); //$NON-NLS-1$ System.err.print(ie.getMessage()); System.err.print(": "); //$NON-NLS-1$ System.err.println("ignoring"); } } }; TimerSingleton.getInstance().schedule(redraw, 20, 20); return redraw; }
chatlounge.die(); TimerSingleton.getInstance().killTimer();
chatlounge.die(); TimerSingleton.getInstance().killTimer();