@Override public final synchronized boolean stop() { if ( !isStarted() ) { return false; } stopIssued = true; return finishLifecycleAction(waitForStoppedCondition, 0); } private final Condition waitForStoppedCondition = new Condition() {
@Override public final synchronized boolean stop() { if ( !isStarted() ) { return false; } stopIssued2 = true; return finishLifecycleAction(waitForStoppedCondition, 0); } private final Condition waitForStoppedCondition = new Condition() {
@Override public final synchronized boolean pause() { if ( !isStarted() || pauseIssued ) { return false; } pauseIssued = true; return finishLifecycleAction(waitForPausedCondition, 0); } private final Condition waitForPausedCondition = new Condition() {
@Override public final synchronized boolean pause() { if ( !isStarted() || pauseIssued2 ) { return false; } pauseIssued2 = true; return finishLifecycleAction(waitForPausedCondition, 0); } private final Condition waitForPausedCondition = new Condition() {
@Override public final synchronized boolean pause() { if ( !isStarted() || pauseIssued ) { return false; } pauseIssued = true; return finishLifecycleAction(waitForPausedCondition, 0); } private final Condition waitForPausedCondition = new Condition() {
@Override public final synchronized boolean resume() { if ( !isStarted() || !pauseIssued2 ) { return false; } pauseIssued2 = false; return finishLifecycleAction(waitForResumeCondition, 0); } private final Condition waitForResumeCondition = new Condition() {
@Override public final synchronized boolean stop() { if ( !isStarted() ) { return false; } stopIssued = true; return finishLifecycleAction(waitForStoppedCondition, 0); } private final Condition waitForStoppedCondition = new Condition() {
@Override public final synchronized boolean resume() { if ( !isStarted() || !pauseIssued ) { return false; } pauseIssued = false; return finishLifecycleAction(waitForResumeCondition, 0); } private final Condition waitForResumeCondition = new Condition() {
@Override public final synchronized boolean resume() { if ( !isStarted() || !pauseIssued ) { return false; } pauseIssued = false; return finishLifecycleAction(waitForResumeCondition, 0); } private final Condition waitForResumeCondition = new Condition() {
@Override public final synchronized boolean start() { if ( isStarted() ) { return false; } if (runnable == null) { runnable = new MainLoop(); } fpsCounter.resetFPSCounter(); final String threadName = getThreadName()+"-"+baseName; Thread thread; if(null==threadGroup2) { thread = new Thread(runnable, threadName); } else { thread = new Thread(threadGroup2, runnable, threadName); } thread.setDaemon(false); // force to be non daemon, regardless of parent thread if(DEBUG) { final Thread ct = Thread.currentThread(); System.err.println("Animator "+ct.getName()+"[daemon "+ct.isDaemon()+"]: starting "+thread.getName()+"[daemon "+thread.isDaemon()+"]"); } thread.start(); return finishLifecycleAction(waitForStartedCondition, 0); } private final Condition waitForStartedCondition = new Condition() {
@Override public final synchronized boolean start() { if ( isStarted() ) { return false; } if (runnable == null) { runnable = new MainLoop(); } fpsCounter.resetFPSCounter(); final Thread thread = new InterruptSource.Thread(threadGroup, runnable, getThreadName()+"-"+baseName); thread.setDaemon(false); // force to be non daemon, regardless of parent thread if(DEBUG) { final Thread ct = Thread.currentThread(); System.err.println("Animator "+ct.getName()+"[daemon "+ct.isDaemon()+"]: starting "+thread.getName()+"[daemon "+thread.isDaemon()+"]"); } thread.start(); return finishLifecycleAction(waitForStartedCondition, 0); } private final Condition waitForStartedCondition = new Condition() {
@Override public final synchronized boolean start() { if ( isStarted() ) { return false; } if (runnable == null) { runnable = new MainLoop(); } fpsCounter.resetFPSCounter(); final Thread thread = new InterruptSource.Thread(threadGroup, runnable, getThreadName()+"-"+baseName); thread.setDaemon(false); // force to be non daemon, regardless of parent thread if(DEBUG) { final Thread ct = Thread.currentThread(); System.err.println("Animator "+ct.getName()+"[daemon "+ct.isDaemon()+"]: starting "+thread.getName()+"[daemon "+thread.isDaemon()+"]"); } thread.start(); return finishLifecycleAction(waitForStartedCondition, 0); } private final Condition waitForStartedCondition = new Condition() {