Quits/stops/exits the program. Programs without a draw() function exit automatically after the last line has run, but programs with draw() run continuously until the program is manually stopped or exit() is run. Rather than terminating immediately, exit() wil
()
| 3360 | * @webBrief Quits/stops/exits the program |
| 3361 | */ |
| 3362 | public void exit() { |
| 3363 | if (surface.isStopped()) { |
| 3364 | // exit immediately, dispose() has already been called, |
| 3365 | // meaning that the main thread has long since exited |
| 3366 | exitActual(); |
| 3367 | |
| 3368 | } else if (looping) { |
| 3369 | // dispose() will be called as the thread exits |
| 3370 | finished = true; |
| 3371 | // tell the code to call exitActual() to do a System.exit() |
| 3372 | // once the next draw() has completed |
| 3373 | exitCalled = true; |
| 3374 | |
| 3375 | } else { // !looping |
| 3376 | // if not looping, shut down things explicitly, |
| 3377 | // because the main thread will be sleeping |
| 3378 | dispose(); |
| 3379 | |
| 3380 | // now get out |
| 3381 | exitActual(); |
| 3382 | } |
| 3383 | } |
| 3384 | |
| 3385 | |
| 3386 | public boolean exitCalled() { |
no test coverage detected