@Override public final void setEnabled( boolean enabled ) { if( this.enabled == enabled ) return; this.enabled = enabled; if( !isInitialized() ) return; if( enabled ) { log.log(Level.FINEST, "onEnable():{0}", this); onEnable(); } else { log.log(Level.FINEST, "onDisable():{0}", this); onDisable(); } }
/** * Do not call directly: Called by the state manager to terminate this * state post-detachment or during state manager termination. * This implementation calls onDisable() if the state is enabled and * then cleanup(app). */ @Override public final void cleanup() { log.log(Level.FINEST, "cleanup():{0}", this); if( isEnabled() ) { log.log(Level.FINEST, "onDisable():{0}", this); onDisable(); } cleanup(app); initialized = false; } }
@Override public final void setEnabled( boolean enabled ) { if( this.enabled == enabled ) return; this.enabled = enabled; if( !isInitialized() ) return; if( enabled ) { log.log(Level.FINEST, "onEnable():{0}", this); onEnable(); } else { log.log(Level.FINEST, "onDisable():{0}", this); onDisable(); } }
/** * Do not call directly: Called by the state manager to terminate this * state post-detachment or during state manager termination. * This implementation calls onDisable() if the state is enabled and * then cleanup(app). */ @Override public final void cleanup() { log.log(Level.FINEST, "cleanup():{0}", this); if( isEnabled() ) { log.log(Level.FINEST, "onDisable():{0}", this); onDisable(); } cleanup(app); initialized = false; } }