For consistency, this patch renames setActive()/isActive() to setEnabled()/isEnabled()
http://hub.jmonkeyengine.org/groups/development-discussion-jme3/forum/topic/setactive-vs-setenabled/
[patch]
Index: src/core/com/jme3/cinematic/Cinematic.java
===================================================================
— src/core/com/jme3/cinematic/Cinematic.java (revision 7141)
+++ src/core/com/jme3/cinematic/Cinematic.java (working copy)
@@ -198,16 +198,33 @@
return initialized;
}
- /**
-
* Use setEnabled() instead<br />
-
*/<br />
-
@Deprecated
public void setActive(boolean active) {
-
if (active) {<br />
-
play();<br />
-
}<br />
-
setEnabled(active);<br />
}
- /**
-
* Use isEnabled() instead<br />
-
*/<br />
-
@Deprecated
public boolean isActive() {
-
return isEnabled();<br />
- }
+
- public void setEnabled(boolean enabled) {
-
if (enabled) {<br />
-
play();<br />
-
}<br />
- }
+
- public boolean isEnabled() {
return playState == PlayState.Playing;
}
+
public void stateAttached(AppStateManager stateManager) {
}
Index: src/core/com/jme3/app/state/AppState.java
===================================================================
— src/core/com/jme3/app/state/AppState.java (revision 7141)
+++ src/core/com/jme3/app/state/AppState.java (working copy)
@@ -64,22 +64,41 @@
public boolean isInitialized();
/**
-
* Use setEnabled() instead.<br />
- Activate or deactivate the functionality of the <code>AppState</code>.
- The effect of this call depends on implementation. An
- <code>AppState</code> starts as being active by default.
*
-
@param active activate the AppState or not.
*/
-
@Deprecated
public void setActive(boolean active);
/**
-
* Use isEnabled() instead.<br />
-
@return True if the <code>AppState</code> is active, false otherwise.
*
-
@see AppState#setActive(boolean)
*/
-
@Deprecated
public boolean isActive();
/**
-
* Enable or disable the functionality of the <code>AppState</code>.<br />
-
* The effect of this call depends on implementation. An<br />
-
* <code>AppState</code> starts as being enabled by default.<br />
-
*<br />
-
* @param active activate the AppState or not.<br />
-
*/<br />
- public void setEnabled(boolean active);
+
- /**
-
* @return True if the <code>AppState</code> is enabled, false otherwise.<br />
-
*<br />
-
* @see AppState#setEnabled(boolean)<br />
-
*/<br />
- public boolean isEnabled();
- /**
- Called when the state was attached.
*
-
@param stateManager State manager to which the state was attached to.
Index: src/core/com/jme3/app/state/AbstractAppState.java
===================================================================
— src/core/com/jme3/app/state/AbstractAppState.java (revision 7141)
+++ src/core/com/jme3/app/state/AbstractAppState.java (working copy)
@@ -49,7 +49,7 @@
- is set back to false.
*/
protected boolean initialized = false;
- private boolean active = true;
- private boolean enabled = true;
public void initialize(AppStateManager stateManager, Application app) {
initialized = true;
@@ -59,12 +59,28 @@
return initialized;
}
- /**
-
* Use setEnabled() instead<br />
-
*/<br />
-
@Deprecated
public void setActive(boolean active) {
-
this.active = active;<br />
-
setEnabled(active);<br />
}
- /**
-
* Use isEnabled() instead<br />
-
*/<br />
-
@Deprecated
public boolean isActive() {
-
return active;<br />
-
return isEnabled();<br />
- }
+
- public void setEnabled(boolean enabled) {
-
this.enabled = enabled;<br />
- }
+
- public boolean isEnabled() {
-
return enabled;<br />
}
public void stateAttached(AppStateManager stateManager) {
Index: src/core/com/jme3/app/state/AppStateManager.java
===================================================================
— src/core/com/jme3/app/state/AppStateManager.java (revision 7141)
+++ src/core/com/jme3/app/state/AppStateManager.java (working copy)
@@ -139,7 +139,7 @@
if (!state.isInitialized())
state.initialize(this, app);
-
if (state.isActive()) {<br />
-
if (state.isEnabled()) {<br />
state.update(tpf);
}
}
@@ -158,7 +158,7 @@
if (!state.isInitialized())
state.initialize(this, app);
-
if (state.isActive()) {<br />
-
if (state.isEnabled()) {<br />
state.render(rm);
}
}
@@ -177,7 +177,7 @@
if (!state.isInitialized())
state.initialize(this, app);
-
if (state.isActive()) {<br />
-
if (state.isEnabled()) {<br />
state.postRender();
}
}
Index: src/test/jme3test/animation/TestCameraMotionPath.java
===================================================================
— src/test/jme3test/animation/TestCameraMotionPath.java (revision 7141)
+++ src/test/jme3test/animation/TestCameraMotionPath.java (working copy)
@@ -60,7 +60,7 @@
private MotionTrack cameraMotionControl;
private ChaseCamera chaser;
private CameraNode camNode;
-
+
public static void main(String[] args) {
TestCameraMotionPath app = new TestCameraMotionPath();
app.start();
Index: src/jbullet/com/jme3/bullet/BulletAppState.java
===================================================================
— src/jbullet/com/jme3/bullet/BulletAppState.java (revision 7141)
+++ src/jbullet/com/jme3/bullet/BulletAppState.java (working copy)
@@ -149,11 +149,27 @@
return initialized;
}
- /**
-
* Use setEnabled() instead<br />
-
*/<br />
-
@Deprecated
public void setActive(boolean active) {
-
this.active = active;<br />
-
setEnabled(active);<br />
}
- /**
-
* Use isEnabled() instead<br />
-
*/<br />
-
@Deprecated
public boolean isActive() {
-
return isEnabled();<br />
- }
+
- public void setEnabled(boolean enabled) {
-
this.active = enabled;<br />
- }
+
- public boolean isEnabled() {
return active;
}
[/patch]