Revision: 2022
Author:
abhishek...@wishtreetech.com
Date: Wed Nov 27 07:02:37 2013 UTC
Log: Animation Synchronization Issue Fix and Client Hang Issue Fix.
http://code.google.com/p/openwonderland-modules/source/detail?r=2022
Modified:
/trunk/0.5/unstable/EZScript/nbproject/nb.properties
/trunk/0.5/unstable/EZScript/nbproject/private/private.xml
/trunk/0.5/unstable/EZScript/nbproject/project.xml
/trunk/0.5/unstable/EZScript/src/classes/org/jdesktop/wonderland/modules/ezscript/client/EZScriptComponent.java
/trunk/0.5/unstable/EZScript/src/classes/org/jdesktop/wonderland/modules/ezscript/client/ScriptedObjectDataSource.java
/trunk/0.5/unstable/EZScript/src/classes/org/jdesktop/wonderland/modules/ezscript/client/methods/AnimateMoveMethod.java
/trunk/0.5/unstable/EZScript/src/classes/org/jdesktop/wonderland/modules/ezscript/client/methods/AnimateScaleMethod.java
/trunk/0.5/unstable/EZScript/src/classes/org/jdesktop/wonderland/modules/ezscript/client/processors/SpinXProcessor.java
/trunk/0.5/unstable/EZScript/src/classes/org/jdesktop/wonderland/modules/ezscript/client/processors/SpinYProcessor.java
/trunk/0.5/unstable/EZScript/src/classes/org/jdesktop/wonderland/modules/ezscript/client/processors/SpinZProcessor.java
=======================================
--- /trunk/0.5/unstable/EZScript/nbproject/nb.properties Tue Jan 18
05:52:39 2011 UTC
+++ /trunk/0.5/unstable/EZScript/nbproject/nb.properties Wed Nov 27
07:02:37 2013 UTC
@@ -1,5 +1,5 @@
-wonderland.ostype=macosx
-wonderland.arch=i386
-wonderland.system.type=macos-x86
+wonderland.ostype=win32
+wonderland.arch=i686
+wonderland.system.type=windows-x86
=======================================
--- /trunk/0.5/unstable/EZScript/nbproject/project.xml Sun Apr 15 20:54:26
2012 UTC
+++ /trunk/0.5/unstable/EZScript/nbproject/project.xml Wed Nov 27 07:02:37
2013 UTC
@@ -88,6 +88,10 @@
<ide-action name="rebuild"/>
<ide-action name="clean"/>
<ide-action name="test"/>
+ <action>
+ <label>Deploy Module</label>
+ <target>deploy</target>
+ </action>
</context-menu>
</view>
<subprojects/>
@@ -95,7 +99,7 @@
<java-data
xmlns="
http://www.netbeans.org/ns/freeform-project-java/2">
<compilation-unit>
<package-root>src/classes</package-root>
- <classpath
mode="compile">../../../wonderland/core/build/lib/wonderland-client.jar:../../../wonderland/core/build/lib/wonderland-common.jar:../../../wonderland/core/build/lib/wonderland-server.jar:../../../wonderland/core/ext/jme20/target/jme.jar:../../../wonderland/modules/foundation/content-repository/build/client/contentrepo-client.jar:../../../wonderland/core/ext/common/swing-layout-1.0.jar:../../../wonderland/core/ext/common/mtgame.jar:../../../wonderland/core/ext/sgs/sgs-server-dist-0.9.10/lib/sgs-server-api-0.9.10.jar:../../../wonderland/modules/foundation/sharedstate/build/client/sharedstate-client.jar:../../../wonderland/modules/foundation/sharedstate/build/server/sharedstate-server.jar:../../../unstable/iSocial/AVPS-Cell/build/client/AVPS-client.jar:../../../unstable/iSocial/AVPS-Cell/build/server/AVPS-server.jar:../../../wonderland/modules/world/containercell/build/lib/client/container-cell-client.jar:../../../Desktop/jbullet-20101010/dist/jbullet.jar:../../../wonderland/modules/world/avatarbase/build/client/avatarbase-client.jar:../../../wonderland/modules/world/avatarbase/lib/avatars.jar:../../../wonderland/modules/tools/security-group/build/lib/client/securitygroups-client.jar:../../../wonderland/modules/foundation/security/build/lib/client/security-client.jar:../../../wonderland/core/ext/common/TimingFramework.jar:../../../wonderland/modules/foundation/animationbase/lib/trident.jar:lib/javacpp.jar:lib/javacv.jar:../../../wonderland/modules/tools/xapps-config/build/client/xapps-config-client.jar:../../stable/videoplayer/build/client/videoplayer-client.jar:../../../wonderland/modules/foundation/appbase/build/client/appbase-client-cell.jar:../../../wonderland/modules/foundation/appbase/build/client/appbase-client.jar:../../stable/pdfviewer/build/client/pdfviewer-client.jar:../../../wonderland/modules/tools/text-chat/build/client/textchat-client.jar</classpath>
+ <classpath
mode="compile">../../../wonderland/core/build/lib/wonderland-client.jar;../../../wonderland/core/build/lib/wonderland-common.jar;../../../wonderland/core/build/lib/wonderland-server.jar;../../../wonderland/core/ext/jme20/target/jme.jar;../../../wonderland/modules/foundation/content-repository/build/client/contentrepo-client.jar;../../../wonderland/core/ext/common/swing-layout-1.0.jar;../../../wonderland/core/ext/common/mtgame.jar;../../../wonderland/core/ext/sgs/sgs-server-dist-0.9.10/lib/sgs-server-api-0.9.10.jar;../../../wonderland/modules/foundation/sharedstate/build/client/sharedstate-client.jar;../../../wonderland/modules/foundation/sharedstate/build/server/sharedstate-server.jar;../../../unstable/iSocial/AVPS-Cell/build/client/AVPS-client.jar;../../../unstable/iSocial/AVPS-Cell/build/server/AVPS-server.jar;../../../wonderland/modules/world/containercell/build/lib/client/container-cell-client.jar;../../../Desktop/jbullet-20101010/dist/jbullet.jar;../../../wonderland/modules/world/avatarbase/build/client/avatarbase-client.jar;../../../wonderland/modules/world/avatarbase/lib/avatars.jar;../../../wonderland/modules/tools/security-group/build/lib/client/securitygroups-client.jar;../../../wonderland/modules/foundation/security/build/lib/client/security-client.jar;../../../wonderland/core/ext/common/TimingFramework.jar;../../../wonderland/modules/foundation/animationbase/lib/trident.jar;lib/javacpp.jar;lib/javacv.jar;../../../wonderland/modules/tools/xapps-config/build/client/xapps-config-client.jar;../../stable/videoplayer/build/client/videoplayer-client.jar;../../../wonderland/modules/foundation/appbase/build/client/appbase-client-cell.jar;../../../wonderland/modules/foundation/appbase/build/client/appbase-client.jar;../../stable/pdfviewer/build/client/pdfviewer-client.jar;../../../wonderland/modules/tools/text-chat/build/client/textchat-client.jar;D:\WB\wonderland\modules\world\cell-editor\build\client\celleditor-client.jar</classpath>
<source-level>1.5</source-level>
</compilation-unit>
<compilation-unit>
=======================================
---
/trunk/0.5/unstable/EZScript/src/classes/org/jdesktop/wonderland/modules/ezscript/client/EZScriptComponent.java
Fri Jul 19 11:30:48 2013 UTC
+++
/trunk/0.5/unstable/EZScript/src/classes/org/jdesktop/wonderland/modules/ezscript/client/EZScriptComponent.java
Wed Nov 27 07:02:37 2013 UTC
@@ -1162,32 +1162,6 @@
}
}
}
-
- public void executeScript(final String script) {
- try {
- //execute script typed in Scripting Editor
- System.out.println("executing script externally...");
- //scriptEngine.eval(script.getValue(), scriptBindings);
- //Need to add this script to the script editor panel.
- clearCallbacks();
-
- executor.submit(new Runnable() {
- public void run() {
-// evaluateScript(script);
- synchronized (scriptEngine) {
- try {
- scriptEngine.eval(script, scriptBindings);
- } catch (Exception e) {
- processException(e);
- }
- }
- }
- });
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
class ProximityListenerImpl implements ProximityListener {
=======================================
---
/trunk/0.5/unstable/EZScript/src/classes/org/jdesktop/wonderland/modules/ezscript/client/ScriptedObjectDataSource.java
Fri Jul 19 11:30:48 2013 UTC
+++
/trunk/0.5/unstable/EZScript/src/classes/org/jdesktop/wonderland/modules/ezscript/client/ScriptedObjectDataSource.java
Wed Nov 27 07:02:37 2013 UTC
@@ -12,6 +12,7 @@
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
+import javax.swing.SwingUtilities;
import org.jdesktop.wonderland.client.cell.registry.annotation.CellFactory;
import org.jdesktop.wonderland.client.cell.registry.spi.CellFactorySPI;
import org.jdesktop.wonderland.client.login.LoginManager;
=======================================
---
/trunk/0.5/unstable/EZScript/src/classes/org/jdesktop/wonderland/modules/ezscript/client/methods/AnimateMoveMethod.java
Fri Jun 22 14:35:34 2012 UTC
+++
/trunk/0.5/unstable/EZScript/src/classes/org/jdesktop/wonderland/modules/ezscript/client/methods/AnimateMoveMethod.java
Wed Nov 27 07:02:37 2013 UTC
@@ -22,6 +22,7 @@
import org.jdesktop.wonderland.client.jme.SceneWorker;
import org.jdesktop.wonderland.client.jme.cellrenderer.BasicRenderer;
import org.jdesktop.wonderland.common.ExperimentalAPI;
+import org.jdesktop.wonderland.common.cell.CellStatus;
import org.jdesktop.wonderland.common.cell.CellTransform;
import
org.jdesktop.wonderland.common.cell.messages.CellServerComponentMessage;
import org.jdesktop.wonderland.common.messages.ErrorMessage;
@@ -47,7 +48,7 @@
private float z;
private float seconds;
private Semaphore lock;
-
+
private static Logger logger =
Logger.getLogger(AnimateMoveMethod.class.getName());
public String getFunctionName() {
@@ -128,6 +129,55 @@
return cell.getComponent(MovableComponent.class);
}
}
+
+ private AnotherMovableComponent amc;
+ public AnotherMovableComponent getAnotherMovable(final Cell cell) {
+ if (cell.getComponent(AnotherMovableComponent.class) != null) {
+ return cell.getComponent(AnotherMovableComponent.class);
+ }
+
+ final Semaphore movableLock = new Semaphore(0);
+ //<editor-fold defaultstate="collapsed" desc="legacy">
+// new Thread(new Runnable() {
+//
+// public void run() {
+// //try and add MovableComponent manually
+// String className
= "org.jdesktop.wonderland.modules.ezscript.server.cell.AnotherMovableComponentMO";
+// CellServerComponentMessage cscm =
+// CellServerComponentMessage.newAddMessage(
+// cell.getCellID(), className);
+// logger.warning("Requesting AnotherMovableComponent...");
+//
+// ResponseMessage response =
cell.sendCellMessageAndWait(cscm);
+// if (response instanceof ErrorMessage) {
+// logger.log(Level.WARNING, "Unable to add movable
component "
+// + "for Cell " + cell.getName() + " with ID "
+// + cell.getCellID(),
+// ((ErrorMessage) response).getErrorCause());
+//
+// logger.warning("AnotherMovableComponent request
failed!");
+// movableLock.release();
+//
+// } else {
+// logger.warning("returning AnotherMovableComponent");
+// movableLock.release();
+// amc =
cell.getComponent(AnotherMovableComponent.class);
+// }
+// }
+// }).start();
+ //</editor-fold>
+
+ try {
+ logger.warning("Acquiring lock in getMovable()!");
+ if(!cell.getStatus().equals(CellStatus.DISK)) {
+ movableLock.acquire();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ } finally {
+ return amc;
+ }
+ }
class TranslationProcessor extends ProcessorComponent {
@@ -208,7 +258,7 @@
}
transform.setTranslation(translate);
- getMovable(cell).localMoveRequest(transform);
+ getAnotherMovable(cell).localMoveRequest(transform,false);
//cell.setLocalTransform(transform, ChangeSource.LOCAL);
}
}
=======================================
---
/trunk/0.5/unstable/EZScript/src/classes/org/jdesktop/wonderland/modules/ezscript/client/methods/AnimateScaleMethod.java
Fri Jun 22 14:35:34 2012 UTC
+++
/trunk/0.5/unstable/EZScript/src/classes/org/jdesktop/wonderland/modules/ezscript/client/methods/AnimateScaleMethod.java
Wed Nov 27 07:02:37 2013 UTC
@@ -8,6 +8,7 @@
import com.jme.math.Quaternion;
import com.jme.scene.Node;
import java.util.concurrent.Semaphore;
+import java.util.logging.Logger;
import org.jdesktop.mtgame.NewFrameCondition;
import org.jdesktop.mtgame.ProcessorArmingCollection;
import org.jdesktop.mtgame.ProcessorComponent;
@@ -18,9 +19,11 @@
import org.jdesktop.wonderland.client.jme.ClientContextJME;
import org.jdesktop.wonderland.client.jme.SceneWorker;
import org.jdesktop.wonderland.client.jme.cellrenderer.BasicRenderer;
+import org.jdesktop.wonderland.common.cell.CellStatus;
import org.jdesktop.wonderland.common.cell.CellTransform;
import org.jdesktop.wonderland.modules.ezscript.client.SPI.ScriptMethodSPI;
import
org.jdesktop.wonderland.modules.ezscript.client.annotation.ScriptMethod;
+import
org.jdesktop.wonderland.modules.ezscript.client.cell.AnotherMovableComponent;
/**
* Usage: animateScale(cell, scale, seconds);
*/
@@ -86,6 +89,55 @@
}
return null;
}
+
+ private AnotherMovableComponent amc;
+ public AnotherMovableComponent getAnotherMovable(final Cell cell) {
+ if (cell.getComponent(AnotherMovableComponent.class) != null) {
+ return cell.getComponent(AnotherMovableComponent.class);
+ }
+
+ final Semaphore movableLock = new Semaphore(0);
+ //<editor-fold defaultstate="collapsed" desc="legacy">
+// new Thread(new Runnable() {
+//
+// public void run() {
+// //try and add MovableComponent manually
+// String className
= "org.jdesktop.wonderland.modules.ezscript.server.cell.AnotherMovableComponentMO";
+// CellServerComponentMessage cscm =
+// CellServerComponentMessage.newAddMessage(
+// cell.getCellID(), className);
+// logger.warning("Requesting AnotherMovableComponent...");
+//
+// ResponseMessage response =
cell.sendCellMessageAndWait(cscm);
+// if (response instanceof ErrorMessage) {
+// logger.log(Level.WARNING, "Unable to add movable
component "
+// + "for Cell " + cell.getName() + " with ID "
+// + cell.getCellID(),
+// ((ErrorMessage) response).getErrorCause());
+//
+// logger.warning("AnotherMovableComponent request
failed!");
+// movableLock.release();
+//
+// } else {
+// logger.warning("returning AnotherMovableComponent");
+// movableLock.release();
+// amc =
cell.getComponent(AnotherMovableComponent.class);
+// }
+// }
+// }).start();
+ //</editor-fold>
+
+ try {
+ //Logger.warning("Acquiring lock in getMovable()!");
+ if(!cell.getStatus().equals(CellStatus.DISK)) {
+ movableLock.acquire();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ } finally {
+ return amc;
+ }
+ }
class ScaleProcessor extends ProcessorComponent {
@@ -157,7 +209,7 @@
lock.release();
}
transform.setScaling(currentScale);
- getMovable(cell).localMoveRequest(transform);
+ getAnotherMovable(cell).localMoveRequest(transform);
}
}
=======================================
---
/trunk/0.5/unstable/EZScript/src/classes/org/jdesktop/wonderland/modules/ezscript/client/processors/SpinXProcessor.java
Tue Jun 5 15:07:40 2012 UTC
+++
/trunk/0.5/unstable/EZScript/src/classes/org/jdesktop/wonderland/modules/ezscript/client/processors/SpinXProcessor.java
Wed Nov 27 07:02:37 2013 UTC
@@ -15,6 +15,7 @@
import org.jdesktop.mtgame.ProcessorArmingCollection;
import org.jdesktop.mtgame.ProcessorComponent;
import org.jdesktop.wonderland.client.cell.Cell;
+import org.jdesktop.wonderland.common.cell.CellStatus;
import org.jdesktop.wonderland.common.cell.CellTransform;
import
org.jdesktop.wonderland.common.cell.messages.CellServerComponentMessage;
import org.jdesktop.wonderland.common.messages.ErrorMessage;
@@ -83,7 +84,7 @@
angles[0] += increment;
//1 revolution = (3.14 * 2) ~ 6.28
//
- System.out.println("current (X) radians: " + angles[0]);
+ //
logger.info("current (X) radians: " + angles[0]);
//quaternion.fromAngles(0.0f, increment, 0.0f);
quaternion = new Quaternion(new float[]{angles[0], angles[1],
angles[2]});
frameIndex += 1;
@@ -105,15 +106,17 @@
* confusing.
*/
- getMovable(cell).localMoveRequest(transform, true);
-
+ AnotherMovableComponent amc = getMovable(cell);
+ if(amc!=null) {
+ amc.localMoveRequest(transform, false);
+ }
}
public AnotherMovableComponent getMovable(final Cell cell) {
if (cell.getComponent(AnotherMovableComponent.class) != null) {
return cell.getComponent(AnotherMovableComponent.class);
}
-
+
final Semaphore movableLock = new Semaphore(0);
//<editor-fold defaultstate="collapsed" desc="legacy">
// new Thread(new Runnable() {
@@ -145,9 +148,13 @@
// }).start();
//</editor-fold>
+
try {
logger.warning("Acquiring lock in getMovable()!");
- movableLock.acquire();
+ System.out.println("cell.getStatus() : "+cell.getStatus());
+ if(!cell.getStatus().equals(CellStatus.DISK)) {
+ movableLock.acquire();
+ }
} catch (Exception e) {
e.printStackTrace();
} finally {
=======================================
---
/trunk/0.5/unstable/EZScript/src/classes/org/jdesktop/wonderland/modules/ezscript/client/processors/SpinYProcessor.java
Tue Jun 5 15:07:40 2012 UTC
+++
/trunk/0.5/unstable/EZScript/src/classes/org/jdesktop/wonderland/modules/ezscript/client/processors/SpinYProcessor.java
Wed Nov 27 07:02:37 2013 UTC
@@ -40,7 +40,7 @@
angles[1] += increment;
//1 revolution = (3.14 * 2) ~ 6.28
- logger.warning("CURRENT (Y) radians:" + angles[1]);
+ //
logger.info("CURRENT (Y) radians:" + angles[1]);
//quaternion.fromAngles(0.0f, increment, 0.0f);
quaternion = new Quaternion(new float[]{angles[0], angles[1],
angles[2]});
frameIndex += 1;
=======================================
---
/trunk/0.5/unstable/EZScript/src/classes/org/jdesktop/wonderland/modules/ezscript/client/processors/SpinZProcessor.java
Thu Jul 14 16:46:41 2011 UTC
+++
/trunk/0.5/unstable/EZScript/src/classes/org/jdesktop/wonderland/modules/ezscript/client/processors/SpinZProcessor.java
Wed Nov 27 07:02:37 2013 UTC
@@ -7,6 +7,7 @@
import com.jme.math.Quaternion;
import java.util.concurrent.Semaphore;
+import java.util.logging.Logger;
import org.jdesktop.mtgame.ProcessorArmingCollection;
import org.jdesktop.wonderland.client.cell.Cell;
@@ -15,6 +16,10 @@
* @author JagWire
*/
public class SpinZProcessor extends SpinXProcessor {
+
+ private static final Logger logger =
+ Logger.getLogger(SpinZProcessor.class.getName());
+
public SpinZProcessor(String name,
Cell cell,
float time,
@@ -33,7 +38,7 @@
angles[2] += increment;
//1 revolution = (3.14 * 2) ~ 6.28
//
- System.out.println("current (Z) radians: " + angles[2]);
+ //
logger.info("current (Z) radians: " + angles[2]);
//quaternion.fromAngles(0.0f, increment, 0.0f);
quaternion = new Quaternion(new float[]{angles[0], angles[1],
angles[2]});
frameIndex += 1;