347 private boolean terminateWhenLastWindowClosed = true;
348 public final boolean shouldTerminateWhenLastWindowClosed() {
349 checkEventThread();
350 return terminateWhenLastWindowClosed;
351 }
352 public final void setTerminateWhenLastWindowClosed(boolean b) {
353 checkEventThread();
354 terminateWhenLastWindowClosed = b;
355 }
356
357 public boolean shouldUpdateWindow() {
358 checkEventThread();
359 return false; // overridden in platform application class
360 }
361
362 public boolean hasWindowManager() {
363 //checkEventThread(); // Prism (Mac)
364 return true; // overridden in platform application class
365 }
366
367 public void terminate() {
368 checkEventThread();
369 try {
370 final List<Window> windows = new LinkedList<>(Window.getWindows());
371 for (Window window : windows) {
372 // first make windows invisible
373 window.setVisible(false);
374 }
375 for (Window window : windows) {
376 // now we can close windows
377 window.close();
378 }
379 } catch (Throwable t) {
380 t.printStackTrace();
381 } finally {
382 finishTerminating();
383 }
384 }
385
386 // May be called on any thread
|
347 private boolean terminateWhenLastWindowClosed = true;
348 public final boolean shouldTerminateWhenLastWindowClosed() {
349 checkEventThread();
350 return terminateWhenLastWindowClosed;
351 }
352 public final void setTerminateWhenLastWindowClosed(boolean b) {
353 checkEventThread();
354 terminateWhenLastWindowClosed = b;
355 }
356
357 public boolean shouldUpdateWindow() {
358 checkEventThread();
359 return false; // overridden in platform application class
360 }
361
362 public boolean hasWindowManager() {
363 //checkEventThread(); // Prism (Mac)
364 return true; // overridden in platform application class
365 }
366
367 /**
368 * Gets a Runnable object to be called on the application thread to
369 * notify that rendering has completed. Systems that require notification
370 * of rendering completion should override this method.
371 *
372 * @return a Runnable to be called on the application thread when rendering
373 * has completed, or null if no notification is needed.
374 */
375 public Runnable getRenderEndNotifier() {
376 return null;
377 }
378
379 public void terminate() {
380 checkEventThread();
381 try {
382 final List<Window> windows = new LinkedList<>(Window.getWindows());
383 for (Window window : windows) {
384 // first make windows invisible
385 window.setVisible(false);
386 }
387 for (Window window : windows) {
388 // now we can close windows
389 window.close();
390 }
391 } catch (Throwable t) {
392 t.printStackTrace();
393 } finally {
394 finishTerminating();
395 }
396 }
397
398 // May be called on any thread
|