( begin auto-generated from exit.xml ) 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 te
()
| 3773 | * @webref structure |
| 3774 | */ |
| 3775 | public void exit() { |
| 3776 | if (surface.isStopped()) { |
| 3777 | // exit immediately, dispose() has already been called, |
| 3778 | // meaning that the main thread has long since exited |
| 3779 | exitActual(); |
| 3780 | |
| 3781 | } else if (looping) { |
| 3782 | // dispose() will be called as the thread exits |
| 3783 | finished = true; |
| 3784 | // tell the code to call exitActual() to do a System.exit() |
| 3785 | // once the next draw() has completed |
| 3786 | exitCalled = true; |
| 3787 | |
| 3788 | } else if (!looping) { |
| 3789 | // if not looping, shut down things explicitly, |
| 3790 | // because the main thread will be sleeping |
| 3791 | dispose(); |
| 3792 | |
| 3793 | // now get out |
| 3794 | exitActual(); |
| 3795 | } |
| 3796 | } |
| 3797 | |
| 3798 | |
| 3799 | public boolean exitCalled() { |
no test coverage detected