< prev index next >

modules/javafx.graphics/src/main/java/javafx/application/Platform.java

Print this page
rev 10897 : 8199357: Remove references to applets and Java Web Start from FX
Reviewed-by:
   1 /*
   2  * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 175      * Returns true if the calling thread is the JavaFX Application Thread.
 176      * Use this call the ensure that a given task is being executed
 177      * (or not being executed) on the JavaFX Application Thread.
 178      *
 179      * @return true if running on the JavaFX Application Thread
 180      */
 181     public static boolean isFxApplicationThread() {
 182         return PlatformImpl.isFxApplicationThread();
 183     }
 184 
 185     /**
 186      * Causes the JavaFX application to terminate. If this method is called
 187      * after the Application start method is called, then the JavaFX launcher
 188      * will call the Application stop method and terminate the JavaFX
 189      * application thread. The launcher thread will then shutdown. If there
 190      * are no other non-daemon threads that are running, the Java VM will exit.
 191      * If this method is called from the Preloader or the Application init
 192      * method, then the Application stop method may not be called.
 193      *
 194      * <p>This method may be called from any thread.</p>
 195      *
 196      * <p>Note: if the application is embedded in a browser, then this method
 197      * may have no effect.
 198      */
 199     public static void exit() {
 200         PlatformImpl.exit();
 201     }
 202 
 203     /**
 204      * Sets the implicitExit attribute to the specified value. If this
 205      * attribute is true, the JavaFX runtime will implicitly shutdown
 206      * when the last window is closed; the JavaFX launcher will call the
 207      * {@link Application#stop} method and terminate the JavaFX
 208      * application thread.
 209      * If this attribute is false, the application will continue to
 210      * run normally even after the last window is closed, until the
 211      * application calls {@link #exit}.
 212      * The default value is true.
 213      *
 214      * <p>This method may be called from any thread.</p>
 215      *
 216      * @param implicitExit a flag indicating whether or not to implicitly exit
 217      * when the last window is closed.


   1 /*
   2  * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 175      * Returns true if the calling thread is the JavaFX Application Thread.
 176      * Use this call the ensure that a given task is being executed
 177      * (or not being executed) on the JavaFX Application Thread.
 178      *
 179      * @return true if running on the JavaFX Application Thread
 180      */
 181     public static boolean isFxApplicationThread() {
 182         return PlatformImpl.isFxApplicationThread();
 183     }
 184 
 185     /**
 186      * Causes the JavaFX application to terminate. If this method is called
 187      * after the Application start method is called, then the JavaFX launcher
 188      * will call the Application stop method and terminate the JavaFX
 189      * application thread. The launcher thread will then shutdown. If there
 190      * are no other non-daemon threads that are running, the Java VM will exit.
 191      * If this method is called from the Preloader or the Application init
 192      * method, then the Application stop method may not be called.
 193      *
 194      * <p>This method may be called from any thread.</p>



 195      */
 196     public static void exit() {
 197         PlatformImpl.exit();
 198     }
 199 
 200     /**
 201      * Sets the implicitExit attribute to the specified value. If this
 202      * attribute is true, the JavaFX runtime will implicitly shutdown
 203      * when the last window is closed; the JavaFX launcher will call the
 204      * {@link Application#stop} method and terminate the JavaFX
 205      * application thread.
 206      * If this attribute is false, the application will continue to
 207      * run normally even after the last window is closed, until the
 208      * application calls {@link #exit}.
 209      * The default value is true.
 210      *
 211      * <p>This method may be called from any thread.</p>
 212      *
 213      * @param implicitExit a flag indicating whether or not to implicitly exit
 214      * when the last window is closed.


< prev index next >