Browse Source

reverting refactored file. formatting

rickard 3 years ago
parent
commit
5170141c0b

+ 26 - 26
jme3-scenecomposer/src/com/jme3/gde/scenecomposer/SceneEditorController.java

@@ -61,7 +61,7 @@ import org.openide.util.Lookup;
 public class SceneEditorController implements NodeListener {
 
     private final JmeSpatial jmeRootNode;
-    private Spatial selectedSpatial;
+    private Spatial selectedSpat;
     private AbstractSceneExplorerNode selectedExplorerNode;
 
     private DataObject currentFileObject;
@@ -83,7 +83,7 @@ public class SceneEditorController implements NodeListener {
     }
 
     public Spatial getSelectedSpat() {
-        return selectedSpatial;
+        return selectedSpat;
     }
 
     public void setSelectedExplorerNode(AbstractSceneExplorerNode node) {
@@ -102,7 +102,7 @@ public class SceneEditorController implements NodeListener {
     }
 
     public void setSelectedSpat(Spatial selectedSpat) {
-        this.selectedSpatial = selectedSpat;
+        this.selectedSpat = selectedSpat;
 
     }
 
@@ -149,11 +149,11 @@ public class SceneEditorController implements NodeListener {
     }
 
     public void moveSelectedSpatial(final Vector3f point) {
-        if (selectedSpatial == null) {
+        if (selectedSpat == null) {
             return;
         }
         try {
-            final Spatial node = selectedSpatial;
+            final Spatial node = selectedSpat;
             if (node != null) {
                 setNeedsSave(true);
                 SceneApplication.getApplication().enqueue(new Callable() {
@@ -209,11 +209,11 @@ public class SceneEditorController implements NodeListener {
     }
 
     public void nudgeSelectedSpatial(final Vector3f amount) {
-        if (selectedSpatial == null) {
+        if (selectedSpat == null) {
             return;
         }
         try {
-            final Spatial node = selectedSpatial;
+            final Spatial node = selectedSpat;
             if (node != null) {
                 setNeedsSave(true);
                 SceneApplication.getApplication().enqueue(new Callable() {
@@ -259,11 +259,11 @@ public class SceneEditorController implements NodeListener {
     }
 
     public void rotateSelectedSpatial(final Quaternion amount) {
-        if (selectedSpatial == null) {
+        if (selectedSpat == null) {
             return;
         }
         try {
-            final Spatial node = selectedSpatial;
+            final Spatial node = selectedSpat;
             if (node != null) {
                 setNeedsSave(true);
                 SceneApplication.getApplication().enqueue(new Callable() {
@@ -309,11 +309,11 @@ public class SceneEditorController implements NodeListener {
     }
 
     public void createTangentsForSelectedSpatial() {
-        if (selectedSpatial == null) {
+        if (selectedSpat == null) {
             return;
         }
         try {
-            final Spatial node = selectedSpatial;
+            final Spatial node = selectedSpat;
             if (node != null) {
                 setNeedsSave(true);
                 SceneApplication.getApplication().enqueue(new Callable() {
@@ -361,11 +361,11 @@ public class SceneEditorController implements NodeListener {
     }
 
     public void createPhysicsMeshForSelectedSpatial() {
-        if (selectedSpatial == null) {
+        if (selectedSpat == null) {
             return;
         }
         try {
-            final Spatial node = selectedSpatial;
+            final Spatial node = selectedSpat;
             setNeedsSave(true);
             if (node != null) {
                 SceneApplication.getApplication().enqueue(new Callable() {
@@ -401,11 +401,11 @@ public class SceneEditorController implements NodeListener {
     }
 
     public void createDynamicPhysicsMeshForSelectedSpatial(final float weight) {
-        if (selectedSpatial == null) {
+        if (selectedSpat == null) {
             return;
         }
         try {
-            final Spatial node = selectedSpatial;
+            final Spatial node = selectedSpat;
             setNeedsSave(true);
             if (node != null) {
                 SceneApplication.getApplication().enqueue(new Callable() {
@@ -441,11 +441,11 @@ public class SceneEditorController implements NodeListener {
     }
 
     public void createCharacterControlForSelectedSpatial(final boolean auto, final float radius, final float height) {
-        if (selectedSpatial == null) {
+        if (selectedSpat == null) {
             return;
         }
         try {
-            final Spatial node = selectedSpatial;
+            final Spatial node = selectedSpat;
             setNeedsSave(true);
             if (node != null) {
                 SceneApplication.getApplication().enqueue(new Callable() {
@@ -519,11 +519,11 @@ public class SceneEditorController implements NodeListener {
     }
 
     public void addModel(final SpatialAssetDataObject file, final Vector3f location) {
-        if (selectedSpatial == null) {
+        if (selectedSpat == null) {
             return;
         }
-        if (selectedSpatial instanceof Node) {
-            final Node selected = (Node) selectedSpatial;
+        if (selectedSpat instanceof Node) {
+            final Node selected = (Node) selectedSpat;
             ProjectAssetManager manager = file.getLookup().lookup(ProjectAssetManager.class);
             if (manager != null) {
                 manager.clearCache();
@@ -569,11 +569,11 @@ public class SceneEditorController implements NodeListener {
     }
 
     public void linkModel(final AssetManager manager, final String assetName, final Vector3f location) {
-        if (selectedSpatial == null) {
+        if (selectedSpat == null) {
             return;
         }
-        if (selectedSpatial instanceof Node) {
-            final Node selected = (Node) ((selectedSpatial instanceof AssetLinkNode) ? selectedSpatial.getParent() : selectedSpatial);
+        if (selectedSpat instanceof Node) {
+            final Node selected = (Node) ((selectedSpat instanceof AssetLinkNode) ? selectedSpat.getParent() : selectedSpat);
             setNeedsSave(true);
             SceneApplication.getApplication().enqueue(new Callable<Object>() {
 
@@ -624,11 +624,11 @@ public class SceneEditorController implements NodeListener {
     }
 
     public void addModel(final Spatial file, final Vector3f location) {
-        if (selectedSpatial == null) {
+        if (selectedSpat == null) {
             return;
         }
-        if (selectedSpatial instanceof Node) {
-            final Node selected = (Node) selectedSpatial;
+        if (selectedSpat instanceof Node) {
+            final Node selected = (Node) selectedSpat;
             setNeedsSave(true);
             SceneApplication.getApplication().enqueue(new Callable<Object>() {
 

+ 5 - 5
jme3-scenecomposer/src/com/jme3/gde/scenecomposer/tools/MoveTool.java

@@ -146,10 +146,10 @@ public class MoveTool extends SceneEditTool {
                 position = startPosition.add(diff);
             }
 
-            if(toolController.isSnapToScene()){
+            if (toolController.isSnapToScene()) {
                 position = snapToScene(position);
             }
-            if(toolController.isSnapToGrid()){
+            if (toolController.isSnapToGrid()) {
                 position = new Vector3f(FastMath.floor(position.x), FastMath.floor(position.y), FastMath.floor(position.z));
             }
             lastPosition = position;
@@ -176,13 +176,13 @@ public class MoveTool extends SceneEditTool {
         }
     }
 
-    private Vector3f snapToScene(Vector3f position){
+    private Vector3f snapToScene(Vector3f position) {
         Ray ray = new Ray(position, Vector3f.UNIT_Y.negate());
         CollisionResults collisionResults = new CollisionResults();
         Node root = toolController.getRootNode().getLookup().lookup(Node.class);
         root.collideWith(ray, collisionResults);
-        for(CollisionResult r : collisionResults){
-            if(r.getGeometry() != toolController.getSelectedSpatial()){
+        for (CollisionResult r : collisionResults) {
+            if (r.getGeometry() != toolController.getSelectedSpatial()) {
                 position.y = r.getContactPoint().y;
                 break;
             }