l.add(c); repaintThread = new RepaintThread(time, l);
/** * The thread main method. */ public void run() { for (;;) { try { synchronized (updateRunnable) { if (!updateRunnable.inEventQueue) EventQueue.invokeLater(updateRunnable); updateRunnable.inEventQueue = true; } sleep(timeout); synchronized(this) { while (suspended) { wait(); } } } catch (InterruptedException e) {} } }
l.add(c); repaintThread = new RepaintThread(time, l);
/** * The thread main method. */ public void run() { for (;;) { try { synchronized (updateRunnable) { if (!updateRunnable.inEventQueue) EventQueue.invokeLater(updateRunnable); updateRunnable.inEventQueue = true; } sleep(timeout); synchronized(this) { while (suspended) { wait(); } } } catch (InterruptedException e) {} } }
public void windowClosing(WindowEvent ev) { panel.getRepaintThread().safeSuspend(); } public void windowDeiconified(WindowEvent e) {
public void windowIconified(WindowEvent e) { panel.getRepaintThread().safeSuspend(); } });
public void windowClosing(WindowEvent ev) { panel.getRepaintThread().safeSuspend(); } public void windowDeiconified(WindowEvent e) {
public void windowDeiconified(WindowEvent e) { panel.getRepaintThread().safeResume(); } public void windowIconified(WindowEvent e) {
public void windowDeiconified(WindowEvent e) { panel.getRepaintThread().safeResume(); } public void windowIconified(WindowEvent e) {
public void windowIconified(WindowEvent e) { panel.getRepaintThread().safeSuspend(); } });
public void actionPerformed(ActionEvent e) { panel.getRepaintThread().safeSuspend(); dispose(); } }
/** * Creates a new Thread. * @param timeout The time between two repaint in ms. * @param components The components to repaint. */ public RepaintThread(long timeout, List components) { this.timeout = timeout; this.components = components; this.updateRunnable = createUpdateRunnable(); setPriority(Thread.MIN_PRIORITY); }
public void actionPerformed(ActionEvent e) { panel.getRepaintThread().safeSuspend(); dispose(); } }
public void windowActivated(WindowEvent e) { RepaintThread t = panel.getRepaintThread(); if (!t.isAlive()) { t.start(); } else { t.safeResume(); } } public void windowClosing(WindowEvent ev) {
public void windowActivated(WindowEvent e) { RepaintThread t = panel.getRepaintThread(); if (!t.isAlive()) { t.start(); } else { t.safeResume(); } } public void windowClosing(WindowEvent ev) {
/** * Creates a new Thread. * @param timeout The time between two repaint in ms. * @param components The components to repaint. */ public RepaintThread(long timeout, List components) { this.timeout = timeout; this.components = components; this.updateRunnable = createUpdateRunnable(); setPriority(Thread.MIN_PRIORITY); }