Browse Source

Just some Formatting

MeFisto94 9 years ago
parent
commit
9f26362cec

+ 31 - 27
jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/JmeMotionEvent.java

@@ -34,7 +34,6 @@ package com.jme3.gde.core.sceneexplorer.nodes;
 import com.jme3.cinematic.events.AbstractCinematicEvent;
 import com.jme3.cinematic.events.AbstractCinematicEvent;
 import com.jme3.cinematic.events.MotionEvent;
 import com.jme3.cinematic.events.MotionEvent;
 import com.jme3.gde.core.icons.IconList;
 import com.jme3.gde.core.icons.IconList;
-import com.jme3.gde.core.scene.SceneApplication;
 import java.awt.Image;
 import java.awt.Image;
 import java.io.IOException;
 import java.io.IOException;
 import org.openide.loaders.DataObject;
 import org.openide.loaders.DataObject;
@@ -44,12 +43,13 @@ import org.openide.nodes.Sheet;
 
 
 /**
 /**
  * This is the SceneExplorer Node (Display Component Class) for Motion Events
  * This is the SceneExplorer Node (Display Component Class) for Motion Events
+ *
  * @author MeFisto94
  * @author MeFisto94
  */
  */
-
 @org.openide.util.lookup.ServiceProvider(service = SceneExplorerNode.class)
 @org.openide.util.lookup.ServiceProvider(service = SceneExplorerNode.class)
 @SuppressWarnings({"unchecked", "rawtypes", "LeakingThisInConstructor"})
 @SuppressWarnings({"unchecked", "rawtypes", "LeakingThisInConstructor"})
 public class JmeMotionEvent extends JmeControl {
 public class JmeMotionEvent extends JmeControl {
+
     private MotionEvent motionEvent;
     private MotionEvent motionEvent;
     private static Image smallImage = IconList.motionEvent.getImage();
     private static Image smallImage = IconList.motionEvent.getImage();
 
 
@@ -61,7 +61,7 @@ public class JmeMotionEvent extends JmeControl {
         super(children, dataObject);
         super(children, dataObject);
         this.motionEvent = motionEvent;
         this.motionEvent = motionEvent;
         control = motionEvent; // to have JmeControl work
         control = motionEvent; // to have JmeControl work
-        
+
         lookupContents.add(this);
         lookupContents.add(this);
         lookupContents.add(control);
         lookupContents.add(control);
         lookupContents.add(children);
         lookupContents.add(children);
@@ -81,45 +81,48 @@ public class JmeMotionEvent extends JmeControl {
     }
     }
 
 
     /**
     /**
-     * This method creates the Property Sheet (i.e. the Contents for the Properties Editor)
-     * See {@link AbstractNode#createSheet() } for more information
-     * @return 
+     * This method creates the Property Sheet (i.e. the Contents for the
+     * Properties Editor).<br>See {@link AbstractNode#createSheet() } for more
+     * information
+     *
+     * @return The created Property Sheet
      */
      */
     @Override
     @Override
     protected Sheet createSheet() {
     protected Sheet createSheet() {
         Sheet sheet = new Sheet(); // Sheet.createDefault(); // Create a sheet with an empty set.
         Sheet sheet = new Sheet(); // Sheet.createDefault(); // Create a sheet with an empty set.
-        
+
         Sheet.Set abstractSet = Sheet.createPropertiesSet();
         Sheet.Set abstractSet = Sheet.createPropertiesSet();
         abstractSet.setName("AbstractCinematicEvent");
         abstractSet.setName("AbstractCinematicEvent");
         abstractSet.setDisplayName("Abstract Cinematic Event (Superclass)");
         abstractSet.setDisplayName("Abstract Cinematic Event (Superclass)");
         abstractSet.setShortDescription("This is the Superclass of MotionEvent: The Abstract Cinematic Event");
         abstractSet.setShortDescription("This is the Superclass of MotionEvent: The Abstract Cinematic Event");
-        
+
         createFields(AbstractCinematicEvent.class, abstractSet, motionEvent);
         createFields(AbstractCinematicEvent.class, abstractSet, motionEvent);
         sheet.put(abstractSet);
         sheet.put(abstractSet);
-        
+
         Sheet.Set set = Sheet.createPropertiesSet(); // Create a Properties "Set"/Entry for that Sheet. (A category so to say)
         Sheet.Set set = Sheet.createPropertiesSet(); // Create a Properties "Set"/Entry for that Sheet. (A category so to say)
         set.setDisplayName("Motion Event");
         set.setDisplayName("Motion Event");
         set.setShortDescription("These are the Properties of this Motion Event");
         set.setShortDescription("These are the Properties of this Motion Event");
         set.setName(MotionEvent.class.getName());
         set.setName(MotionEvent.class.getName());
-        
+
         MotionEvent obj = motionEvent;
         MotionEvent obj = motionEvent;
         if (obj == null) {
         if (obj == null) {
             return sheet;
             return sheet;
         }
         }
-        
+
         createFields(MotionEvent.class, set, obj);
         createFields(MotionEvent.class, set, obj);
         set.remove("Spatial"); // since we're a Control we don't set that value, we just belong to it.
         set.remove("Spatial"); // since we're a Control we don't set that value, we just belong to it.
         set.remove("Path");
         set.remove("Path");
-        
+
         sheet.put(set);
         sheet.put(set);
-        
+
         return sheet;
         return sheet;
 
 
     }
     }
 
 
     /**
     /**
-     * Returns the class of the underlying Object of this Node.
-     * This is how we are related to things found in the SceneGraph
+     * Returns the class of the underlying Object of this Node.<br>This is how we
+     * are related to things found in the SceneGraph
+     *
      * @return {@link Class}
      * @return {@link Class}
      */
      */
     @Override
     @Override
@@ -129,6 +132,7 @@ public class JmeMotionEvent extends JmeControl {
 
 
     /**
     /**
      * Returns the class of this Node
      * Returns the class of this Node
+     *
      * @return {@link Class}
      * @return {@link Class}
      */
      */
     @Override
     @Override
@@ -139,16 +143,16 @@ public class JmeMotionEvent extends JmeControl {
     public MotionEvent getMotionEvent() {
     public MotionEvent getMotionEvent() {
         return motionEvent;
         return motionEvent;
     }
     }
-            
+
     @Override
     @Override
     public org.openide.nodes.Node[] createNodes(Object key, DataObject key2, boolean cookie) {
     public org.openide.nodes.Node[] createNodes(Object key, DataObject key2, boolean cookie) {
         JmeMotionPathChildren children = new JmeMotionPathChildren();
         JmeMotionPathChildren children = new JmeMotionPathChildren();
         children.setReadOnly(cookie);
         children.setReadOnly(cookie);
-        return new org.openide.nodes.Node[] { new JmeMotionEvent((MotionEvent) key, key2, children).setReadOnly(cookie) }; // If we would return null here, we would have the JmeControl default (i.e. auto-exposure of properties, no icon but also no createSheet method)
+        return new org.openide.nodes.Node[]{new JmeMotionEvent((MotionEvent) key, key2, children).setReadOnly(cookie)}; // If we would return null here, we would have the JmeControl default (i.e. auto-exposure of properties, no icon but also no createSheet method)
     }
     }
-    
+
     public void refreshChildren() {
     public void refreshChildren() {
-        ((JmeMotionPathChildren)this.jmeChildren).refreshChildren(true);
+        ((JmeMotionPathChildren) this.jmeChildren).refreshChildren(true);
         for (Object node : getChildren().getNodes()) {
         for (Object node : getChildren().getNodes()) {
             JmeMotionPath mPath = (JmeMotionPath) node;
             JmeMotionPath mPath = (JmeMotionPath) node;
             ((JmeVector3fChildren) mPath.getChildren()).refreshChildren(true);
             ((JmeVector3fChildren) mPath.getChildren()).refreshChildren(true);
@@ -157,13 +161,12 @@ public class JmeMotionEvent extends JmeControl {
 
 
     @Override
     @Override
     public void destroy() throws IOException {
     public void destroy() throws IOException {
-        for (Node n: getChildren().getNodes()) {
-            ((JmeMotionPath)n).destroy();
+        for (Node n : getChildren().getNodes()) {
+            ((JmeMotionPath) n).destroy();
         }
         }
         super.destroy();
         super.destroy();
     }
     }
-    
-    
+
     public void setModified(boolean immediate) {
     public void setModified(boolean immediate) {
         dataObject.setModified(immediate);
         dataObject.setModified(immediate);
     }
     }
@@ -175,17 +178,18 @@ public class JmeMotionEvent extends JmeControl {
 
 
     @Override
     @Override
     public boolean isEnabled() {
     public boolean isEnabled() {
-        if (motionEvent == null)
+        if (motionEvent == null) {
             return false;
             return false;
-        else
+        } else {
             return motionEvent.isEnabled();
             return motionEvent.isEnabled();
+        }
     }
     }
 
 
     @Override
     @Override
     public boolean setEnabled(boolean enabled) {
     public boolean setEnabled(boolean enabled) {
-        if (motionEvent == null)
+        if (motionEvent == null) {
             return false;
             return false;
-        else {
+        } else {
             motionEvent.setEnabled(enabled);
             motionEvent.setEnabled(enabled);
             return true;
             return true;
         }
         }

+ 64 - 58
jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/JmeMotionPath.java

@@ -57,6 +57,7 @@ import org.openide.util.actions.SystemAction;
 /**
 /**
  * This Class actually represents the MotionPath in the SceneComposer.<br>
  * This Class actually represents the MotionPath in the SceneComposer.<br>
  * It is added and managed by {@link JmeMotionPathChildren }
  * It is added and managed by {@link JmeMotionPathChildren }
+ *
  * @author MeFisto94
  * @author MeFisto94
  */
  */
 @org.openide.util.lookup.ServiceProvider(service = SceneExplorerNode.class)
 @org.openide.util.lookup.ServiceProvider(service = SceneExplorerNode.class)
@@ -68,13 +69,13 @@ public class JmeMotionPath extends AbstractSceneExplorerNode {
     private JmeMotionEvent motionEvent;
     private JmeMotionEvent motionEvent;
     private float debugBoxExtents = 0.5f;
     private float debugBoxExtents = 0.5f;
     private Spatial spatial;
     private Spatial spatial;
-    
+
     public JmeMotionPath() {
     public JmeMotionPath() {
     }
     }
 
 
     public JmeMotionPath(MotionPath motionPath, JmeMotionEvent parent, JmeVector3fChildren children) {
     public JmeMotionPath(MotionPath motionPath, JmeMotionEvent parent, JmeVector3fChildren children) {
         super(children);
         super(children);
-        
+
         this.motionPath = motionPath;
         this.motionPath = motionPath;
         getLookupContents().add(motionPath);
         getLookupContents().add(motionPath);
         getLookupContents().add(this);
         getLookupContents().add(this);
@@ -83,20 +84,21 @@ public class JmeMotionPath extends AbstractSceneExplorerNode {
         super.setDisplayName("Motion Path");
         super.setDisplayName("Motion Path");
         children.setJmeMotionPath(this);
         children.setJmeMotionPath(this);
         motionEvent = parent;
         motionEvent = parent;
-        
+
         updateSpline(false);
         updateSpline(false);
     }
     }
 
 
-    //<editor-fold defaultstate="collapsed" desc="Some boring Overrides">
+    //<editor-fold desc="Some Overrides for the Node">
     @Override
     @Override
     public Image getIcon(int type) {
     public Image getIcon(int type) {
         return smallImage;
         return smallImage;
     }
     }
+
     @Override
     @Override
     public Image getOpenedIcon(int type) {
     public Image getOpenedIcon(int type) {
         return smallImage;
         return smallImage;
     }
     }
-    
+
     @Override
     @Override
     public Action[] getActions(boolean context) {
     public Action[] getActions(boolean context) {
         MotionPathPopup m = new MotionPathPopup(this);
         MotionPathPopup m = new MotionPathPopup(this);
@@ -107,8 +109,8 @@ public class JmeMotionPath extends AbstractSceneExplorerNode {
             SystemAction.get(DeleteAction.class)
             SystemAction.get(DeleteAction.class)
         };
         };
     }
     }
-//</editor-fold>
-    
+    //</editor-fold>
+
     @Override
     @Override
     protected Sheet createSheet() {
     protected Sheet createSheet() {
         Sheet sheet = super.createSheet();
         Sheet sheet = super.createSheet();
@@ -116,77 +118,77 @@ public class JmeMotionPath extends AbstractSceneExplorerNode {
         set.setDisplayName("Motion Path");
         set.setDisplayName("Motion Path");
         set.setName(MotionPath.class.getName());
         set.setName(MotionPath.class.getName());
         set.setShortDescription("These are the Properties of the Motion Event's Motion Path");
         set.setShortDescription("These are the Properties of the Motion Event's Motion Path");
-       
+
         if (motionPath == null) {
         if (motionPath == null) {
             return sheet;
             return sheet;
         }
         }
-        
+
         Property<?> prop = makeEmbedProperty(this, getExplorerNodeClass(), motionPath.getPathSplineType().getClass(), "getPathSplineType", "setPathSplineType", "PathSplineType");
         Property<?> prop = makeEmbedProperty(this, getExplorerNodeClass(), motionPath.getPathSplineType().getClass(), "getPathSplineType", "setPathSplineType", "PathSplineType");
         prop.setShortDescription("Sets the Type of the Paths' Spline. This will define how the single waypoints are interpolated (linear, curvy)");
         prop.setShortDescription("Sets the Type of the Paths' Spline. This will define how the single waypoints are interpolated (linear, curvy)");
         set.put(prop);
         set.put(prop);
-        
+
         prop = makeEmbedProperty(this, getExplorerNodeClass(), float.class, "getCurveTension", "setCurveTension", "Curve Tension");
         prop = makeEmbedProperty(this, getExplorerNodeClass(), float.class, "getCurveTension", "setCurveTension", "Curve Tension");
         prop.setShortDescription("Sets the Curves' Tension. This defines how \"Curvy\" a curve will be. A tension of 0 would be completely linear.");
         prop.setShortDescription("Sets the Curves' Tension. This defines how \"Curvy\" a curve will be. A tension of 0 would be completely linear.");
         set.put(prop);
         set.put(prop);
-        
+
         prop = makeProperty(motionPath, boolean.class, "isCycle", "setCycle", "Cycle?");
         prop = makeProperty(motionPath, boolean.class, "isCycle", "setCycle", "Cycle?");
         prop.setShortDescription("Should the Path be a Cycle? This essentially means it will be looped. (Starting from the beginning after we're finished)");
         prop.setShortDescription("Should the Path be a Cycle? This essentially means it will be looped. (Starting from the beginning after we're finished)");
         set.put(prop);
         set.put(prop);
-        
+
         prop = makeProperty(motionPath, int.class, "getLength", null, "Path Length");
         prop = makeProperty(motionPath, int.class, "getLength", null, "Path Length");
         prop.setShortDescription("This is the total length this path has");
         prop.setShortDescription("This is the total length this path has");
         set.put(prop);
         set.put(prop);
-        
+
         prop = makeEmbedProperty(motionPath, motionPath.getClass(), int.class, "getNbWayPoints", null, "Number of Waypoints");
         prop = makeEmbedProperty(motionPath, motionPath.getClass(), int.class, "getNbWayPoints", null, "Number of Waypoints");
         prop.setShortDescription("Shows the Number of Waypoints this Path consists of");
         prop.setShortDescription("Shows the Number of Waypoints this Path consists of");
         set.put(prop);
         set.put(prop);
-        
+
         sheet.put(set);
         sheet.put(set);
-        
+
         set = Sheet.createPropertiesSet();
         set = Sheet.createPropertiesSet();
         set.setDisplayName("Motion Path SDK");
         set.setDisplayName("Motion Path SDK");
         set.setName("MotionPathSDK");
         set.setName("MotionPathSDK");
         set.setShortDescription("These are SDK-dependent Settings which have nothing to do with MotionEvent or MotionPath in the first place.");
         set.setShortDescription("These are SDK-dependent Settings which have nothing to do with MotionEvent or MotionPath in the first place.");
-        
+
         prop = makeEmbedProperty(this, JmeMotionPath.class, float.class, "getDebugBoxExtents", "setDebugBoxExtents", "DebugBox Extents");
         prop = makeEmbedProperty(this, JmeMotionPath.class, float.class, "getDebugBoxExtents", "setDebugBoxExtents", "DebugBox Extents");
         prop.setShortDescription("The DebugBox Extents defines how big the Debug Boxes (i.e. the Boxes you see for each Waypoint) are. Note: The BoxSize is 2 * extents");
         prop.setShortDescription("The DebugBox Extents defines how big the Debug Boxes (i.e. the Boxes you see for each Waypoint) are. Note: The BoxSize is 2 * extents");
         set.put(prop);
         set.put(prop);
         sheet.put(set);
         sheet.put(set);
-        
+
         return sheet;
         return sheet;
     }
     }
-    
+
     public MotionPath getMotionPath() {
     public MotionPath getMotionPath() {
         return motionPath;
         return motionPath;
     }
     }
-    
+
     public JmeMotionEvent getMotionEvent() {
     public JmeMotionEvent getMotionEvent() {
         return motionEvent;
         return motionEvent;
     }
     }
-    
-    //<editor-fold defaultstate="collapsed" desc="Properties Getter/Setter">
+
+    //<editor-fold desc="Properties Getter/Setter">
     public float getDebugBoxExtents() {
     public float getDebugBoxExtents() {
         return debugBoxExtents;
         return debugBoxExtents;
     }
     }
-    
+
     public void setDebugBoxExtents(float extents) {
     public void setDebugBoxExtents(float extents) {
         debugBoxExtents = extents;
         debugBoxExtents = extents;
-        
+
         if (getChildren() != null) {
         if (getChildren() != null) {
             for (Node n : getChildren().getNodes()) {
             for (Node n : getChildren().getNodes()) {
                 if (n instanceof JmeVector3f) {
                 if (n instanceof JmeVector3f) {
-                    ((JmeVector3f)n).updateBox();
+                    ((JmeVector3f) n).updateBox();
                 } else {
                 } else {
                     Logger.getLogger(JmeMotionPath.class.getName()).log(Level.WARNING, "JmeMotionPath has some unknown Children...");
                     Logger.getLogger(JmeMotionPath.class.getName()).log(Level.WARNING, "JmeMotionPath has some unknown Children...");
                 }
                 }
             }
             }
         }
         }
     }
     }
-    
+
     public Spline.SplineType getPathSplineType() {
     public Spline.SplineType getPathSplineType() {
         return motionPath.getPathSplineType();
         return motionPath.getPathSplineType();
     }
     }
-    
+
     public void setPathSplineType(Spline.SplineType sType) {
     public void setPathSplineType(Spline.SplineType sType) {
         if (sType == Spline.SplineType.Nurb) {
         if (sType == Spline.SplineType.Nurb) {
             Logger.getLogger(JmeMotionPath.class.getName()).log(Level.SEVERE, "Nurb Curves aren't possible at the moment (they require additional helper points). Reverting to Catmull..");
             Logger.getLogger(JmeMotionPath.class.getName()).log(Level.SEVERE, "Nurb Curves aren't possible at the moment (they require additional helper points). Reverting to Catmull..");
@@ -197,20 +199,20 @@ public class JmeMotionPath extends AbstractSceneExplorerNode {
             setPathSplineType(Spline.SplineType.CatmullRom);
             setPathSplineType(Spline.SplineType.CatmullRom);
             return;
             return;
         }
         }
-        
+
         motionPath.setPathSplineType(sType);
         motionPath.setPathSplineType(sType);
         updateSpline(true);
         updateSpline(true);
     }
     }
-    
+
     public float getCurveTension() {
     public float getCurveTension() {
         return motionPath.getCurveTension();
         return motionPath.getCurveTension();
     }
     }
-    
+
     public void setCurveTension(float f) {
     public void setCurveTension(float f) {
         motionPath.setCurveTension(f);
         motionPath.setCurveTension(f);
         updateSpline(true);
         updateSpline(true);
     }
     }
-//</editor-fold>
+    //</editor-fold>
 
 
     @Override
     @Override
     public Class getExplorerObjectClass() {
     public Class getExplorerObjectClass() {
@@ -226,38 +228,38 @@ public class JmeMotionPath extends AbstractSceneExplorerNode {
     public org.openide.nodes.Node[] createNodes(Object key, DataObject key2, boolean cookie) {
     public org.openide.nodes.Node[] createNodes(Object key, DataObject key2, boolean cookie) {
         return null;
         return null;
     }
     }
-    
+
     public void refreshChildren() {
     public void refreshChildren() {
-        ((JmeVector3fChildren)this.jmeChildren).refreshChildren(true);
+        ((JmeVector3fChildren) this.jmeChildren).refreshChildren(true);
         updateSpline(false);
         updateSpline(false);
     }
     }
-    
+
     @Override
     @Override
     public void destroy() throws IOException {
     public void destroy() throws IOException {
-        for (Node n: getChildren().getNodes()) {
-            ((JmeVector3f)n).destroy();
+        for (Node n : getChildren().getNodes()) {
+            ((JmeVector3f) n).destroy();
         }
         }
         super.destroy();
         super.destroy();
         ((AbstractSceneExplorerNode) getParentNode()).refresh(true);
         ((AbstractSceneExplorerNode) getParentNode()).refresh(true);
     }
     }
-    
+
     public void enableDebugShapes() {
     public void enableDebugShapes() {
         for (Node n : getChildren().getNodes()) {
         for (Node n : getChildren().getNodes()) {
             if (n instanceof JmeVector3f) {
             if (n instanceof JmeVector3f) {
-                ((JmeVector3f)n).attachBox(((JmeVector3f)n).spatial, this);
+                ((JmeVector3f) n).attachBox(((JmeVector3f) n).spatial, this);
             }
             }
         }
         }
-        
+
         updateSpline(false);
         updateSpline(false);
     }
     }
-    
+
     public void disableDebugShapes() {
     public void disableDebugShapes() {
         for (Node n : getChildren().getNodes()) {
         for (Node n : getChildren().getNodes()) {
             if (n instanceof JmeVector3f) {
             if (n instanceof JmeVector3f) {
-                ((JmeVector3f)n).detachBox(((JmeVector3f)n).spatial);
+                ((JmeVector3f) n).detachBox(((JmeVector3f) n).spatial);
             }
             }
         }
         }
-        
+
         if (spatial != null) {
         if (spatial != null) {
             final Spatial spat = spatial;
             final Spatial spat = spatial;
             SceneApplication.getApplication().enqueue(new Callable<Void>() {
             SceneApplication.getApplication().enqueue(new Callable<Void>() {
@@ -268,11 +270,15 @@ public class JmeMotionPath extends AbstractSceneExplorerNode {
                 }
                 }
             });
             });
         }
         }
-        
+
     }
     }
+
     /**
     /**
      * Call this to update the visual Spline.
      * Call this to update the visual Spline.
-     * @param wasModified If the Spatial was Modified and hence the dirty-safe flag should be triggered (only false for the Constructors first initiation)
+     *
+     * @param wasModified If the Spatial was Modified and hence the dirty-safe
+     * flag should be triggered (only false for the Constructors first
+     * initiation)
      */
      */
     public void updateSpline(boolean wasModified) {
     public void updateSpline(boolean wasModified) {
         if (spatial != null) {
         if (spatial != null) {
@@ -285,42 +291,42 @@ public class JmeMotionPath extends AbstractSceneExplorerNode {
                 }
                 }
             });
             });
         }
         }
-        
+
         Material m = new Material(SceneApplication.getApplication().getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
         Material m = new Material(SceneApplication.getApplication().getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
         m.setColor("Color", ColorRGBA.Red);
         m.setColor("Color", ColorRGBA.Red);
-        m.getAdditionalRenderState().setLineWidth(4f); // Brand new feature ;)
-        
-        switch (motionPath.getPathSplineType())
-        {
+        m.getAdditionalRenderState().setLineWidth(4f);
+
+        switch (motionPath.getPathSplineType()) {
             case CatmullRom:
             case CatmullRom:
                 Geometry geo = new Geometry("Curve", new Curve(motionPath.getSpline(), 10));
                 Geometry geo = new Geometry("Curve", new Curve(motionPath.getSpline(), 10));
                 geo.setMaterial(m);
                 geo.setMaterial(m);
                 spatial = geo;
                 spatial = geo;
                 break;
                 break;
-                
+
             case Linear:
             case Linear:
                 geo = new Geometry("Curve", new Curve(motionPath.getSpline(), 0));
                 geo = new Geometry("Curve", new Curve(motionPath.getSpline(), 0));
                 geo.setMaterial(m);
                 geo.setMaterial(m);
                 spatial = geo;
                 spatial = geo;
                 break;
                 break;
-                
+
             default:
             default:
                 geo = new Geometry("Curve", new Curve(motionPath.getSpline(), 10));
                 geo = new Geometry("Curve", new Curve(motionPath.getSpline(), 10));
                 geo.setMaterial(m);
                 geo.setMaterial(m);
                 spatial = geo;
                 spatial = geo;
                 break;
                 break;
         }
         }
-        
+
         final Spatial spat = spatial;
         final Spatial spat = spatial;
         SceneApplication.getApplication().enqueue(new Callable<Void>() {
         SceneApplication.getApplication().enqueue(new Callable<Void>() {
-                @Override
-                public Void call() throws Exception {
-                    SceneApplication.getApplication().getRootNode().attachChild(spat);
-                    return null;
-                }
+            @Override
+            public Void call() throws Exception {
+                SceneApplication.getApplication().getRootNode().attachChild(spat);
+                return null;
+            }
         });
         });
-        
-        if (wasModified)
+
+        if (wasModified) {
             motionEvent.setModified(true);
             motionEvent.setModified(true);
+        }
     }
     }
 }
 }

+ 9 - 4
jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/JmeMotionPathChildren.java

@@ -45,10 +45,14 @@ import org.openide.nodes.Node;
 import org.openide.util.Exceptions;
 import org.openide.util.Exceptions;
 
 
 /**
 /**
- * This Class is responsible for the management of all underlying MotionPaths as Nodes<br>
- * (In fact we currently only have one possible MotionPath but we keep this to be consistent with JmeBoneChildren).<br>
- * You have to ensure that you set the appropriate JmeMotionEvent for this class (this happens when JmeMotionEvent is creating it's Nodes)<br>
+ * This Class is responsible for the management of all underlying MotionPaths as
+ * Nodes<br>
+ * (In fact we currently only have one possible MotionPath but we keep this to
+ * be consistent with JmeBoneChildren).<br>
+ * You have to ensure that you set the appropriate JmeMotionEvent for this class
+ * (this happens when JmeMotionEvent is creating it's Nodes)<br>
  * It will use this class as Children (which are JmeMotionPaths)<br>
  * It will use this class as Children (which are JmeMotionPaths)<br>
+ *
  * @author MeFisto94
  * @author MeFisto94
  */
  */
 public class JmeMotionPathChildren extends Children.Keys<Object> {
 public class JmeMotionPathChildren extends Children.Keys<Object> {
@@ -86,12 +90,13 @@ public class JmeMotionPathChildren extends Children.Keys<Object> {
         try {
         try {
             return SceneApplication.getApplication().enqueue(new Callable<List<Object>>() {
             return SceneApplication.getApplication().enqueue(new Callable<List<Object>>() {
 
 
+                @Override
                 public List<Object> call() throws Exception {
                 public List<Object> call() throws Exception {
                     List<Object> keys = new LinkedList<Object>();
                     List<Object> keys = new LinkedList<Object>();
                     if (path != null) {
                     if (path != null) {
                         keys.add(path);
                         keys.add(path);
                     } else {
                     } else {
-                        keys.add(((MotionEvent)jmeMotionEvent.control).getPath());
+                        keys.add(((MotionEvent) jmeMotionEvent.control).getPath());
                     }
                     }
 
 
                     return keys;
                     return keys;

+ 85 - 67
jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/JmeVector3f.java

@@ -52,8 +52,11 @@ import org.openide.nodes.Sheet;
 import org.openide.util.actions.SystemAction;
 import org.openide.util.actions.SystemAction;
 
 
 /**
 /**
- * This Class actually represents the MotionPaths Waypoints in the SceneComposer.<br>
- * It is added and managed by {@link JmeVector3fChildren } but it could also be used for any other Waypointish Thing
+ * This Class actually represents the MotionPaths Waypoints in the
+ * SceneComposer.<br>
+ * It is added and managed by {@link JmeVector3fChildren } but it could also be
+ * used for any other Waypointish Thing
+ *
  * @author MeFisto94
  * @author MeFisto94
  */
  */
 @SuppressWarnings({"unchecked", "rawtypes", "OverridableMethodCallInConstructor", "LeakingThisInConstructor"})
 @SuppressWarnings({"unchecked", "rawtypes", "OverridableMethodCallInConstructor", "LeakingThisInConstructor"})
@@ -64,63 +67,70 @@ public class JmeVector3f extends JmeSpatial {
     private JmeMotionPath jmeMotionPath;
     private JmeMotionPath jmeMotionPath;
     private Vector3f v;
     private Vector3f v;
     private float extents;
     private float extents;
-    
+
     public JmeVector3f() {
     public JmeVector3f() {
         super();
         super();
     }
     }
-    
+
     public JmeVector3f(JmeVector3fChildren parent, JmeMotionPath jmeMotionPath, Vector3f vec) {
     public JmeVector3f(JmeVector3fChildren parent, JmeMotionPath jmeMotionPath, Vector3f vec) {
         super();
         super();
-        
+
         v = vec;
         v = vec;
         this.parent = parent;
         this.parent = parent;
         this.jmeMotionPath = jmeMotionPath;
         this.jmeMotionPath = jmeMotionPath;
         spatial = generateBox();
         spatial = generateBox();
-        
+
         getLookupContents().add(spatial);
         getLookupContents().add(spatial);
         getLookupContents().add(vec);
         getLookupContents().add(vec);
         getLookupContents().add(this);
         getLookupContents().add(this);
-        
+
         super.setDisplayName("Waypoint");
         super.setDisplayName("Waypoint");
         super.setName(spatial.getName());
         super.setName(spatial.getName());
-        
+
         attachBox(spatial, jmeMotionPath);
         attachBox(spatial, jmeMotionPath);
     }
     }
-    
+
     /**
     /**
      * GenerateBox will simply generate our {@link DebugBoxGeometry }
      * GenerateBox will simply generate our {@link DebugBoxGeometry }
-     * @return 
+     *
+     * @return the generated DebugBoxGeometry
      */
      */
     private Geometry generateBox() {
     private Geometry generateBox() {
         extents = jmeMotionPath.getDebugBoxExtents();
         extents = jmeMotionPath.getDebugBoxExtents();
         DebugBoxGeometry geom = new DebugBoxGeometry("Waypoint", extents, this);
         DebugBoxGeometry geom = new DebugBoxGeometry("Waypoint", extents, this);
-        
+
         Material mat = new Material(SceneApplication.getApplication().getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
         Material mat = new Material(SceneApplication.getApplication().getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
         mat.setColor("Color", ColorRGBA.Cyan);
         mat.setColor("Color", ColorRGBA.Cyan);
         geom.setMaterial(mat);
         geom.setMaterial(mat);
         geom.setInternalLocalTranslation(v);
         geom.setInternalLocalTranslation(v);
-        
+
         return geom;
         return geom;
-    } 
+    }
+
     /**
     /**
-     * AttachBox is the internal method simply used to attach the DebugBox to the Scene Graph.
+     * AttachBox is the internal method simply used to attach the DebugBox to
+     * the Scene Graph.
+     *
      * @param s The Spatial to attach
      * @param s The Spatial to attach
      * @param jmeMotionPath The Parental Node to refresh.
      * @param jmeMotionPath The Parental Node to refresh.
      */
      */
     protected void attachBox(final Spatial s, final JmeMotionPath jmeMotionPath) {
     protected void attachBox(final Spatial s, final JmeMotionPath jmeMotionPath) {
         SceneApplication.getApplication().enqueue(new Callable<Void>() {
         SceneApplication.getApplication().enqueue(new Callable<Void>() {
-                @Override
-                public Void call() throws Exception {
-                    SceneApplication.getApplication().getRootNode().attachChild(s);
-                    jmeMotionPath.refresh(true);
-                    return null;
-                }
+            @Override
+            public Void call() throws Exception {
+                SceneApplication.getApplication().getRootNode().attachChild(s);
+                jmeMotionPath.refresh(true);
+                return null;
+            }
         });
         });
     }
     }
+
     /**
     /**
-     * This detaches the DebugBox from the SceneGraph but also waits for this to happen.
-     * This is because we want to reattach a new box and it's just better this way :P
-     * @param s
+     * This detaches the DebugBox from the SceneGraph but also waits for this to
+     * happen.<br>This is because we want to reattach a new box and it's just
+     * better this way :P
+     *
+     * @param s The Spatial to detach
      */
      */
     protected void detachBox(final Spatial s) {
     protected void detachBox(final Spatial s) {
         SceneApplication.getApplication().enqueue(new Callable<Void>() {
         SceneApplication.getApplication().enqueue(new Callable<Void>() {
@@ -131,10 +141,11 @@ public class JmeVector3f extends JmeSpatial {
             }
             }
         });
         });
     }
     }
+
     /**
     /**
-     * This will trigger a rebuild of the whole Box.
-     * It is used internally if the box dimensions have changed ({@link JmeMotionPath#setDebugBoxExtents(float) })
-     * Moving the Boxes around does NOT need a rebuild.
+     * This will trigger a rebuild of the whole Box.<br>It is used internally if
+     * the box dimensions have changed ({@link JmeMotionPath#setDebugBoxExtents(float)
+     * }).<br>Moving the Boxes around does NOT need a rebuild.
      */
      */
     public void updateBox() {
     public void updateBox() {
         getLookupContents().remove(spatial);
         getLookupContents().remove(spatial);
@@ -143,21 +154,23 @@ public class JmeVector3f extends JmeSpatial {
         getLookupContents().add(spatial);
         getLookupContents().add(spatial);
         attachBox(spatial, jmeMotionPath);
         attachBox(spatial, jmeMotionPath);
     }
     }
+
     /**
     /**
-     * This is called when the Vector v has been moved (without the setVector3f which is our callback).
-     * This means it was moved by the Properties Dialog (see setXYZ())
+     * This is called when the Vector v has been moved (without the setVector3f
+     * which is our callback).<br>This means it was moved by the Properties
+     * Dialog (see setXYZ())
      */
      */
     public void moveBox() {
     public void moveBox() {
         SceneApplication.getApplication().enqueue(new Runnable() {
         SceneApplication.getApplication().enqueue(new Runnable() {
             @Override
             @Override
             public void run() {
             public void run() {
                 spatial.setLocalTranslation(v); // It's a bit redundant since it will call #setVector3f() but there's no other way.
                 spatial.setLocalTranslation(v); // It's a bit redundant since it will call #setVector3f() but there's no other way.
-                                                // Plus it will invoke updateSpline() for us.
+                // Plus it will invoke updateSpline() for us.
             }
             }
         });
         });
     }
     }
-    
-    // <editor-fold defaultstate="collapsed" desc="Just some boring Overrides ">
+
+    // <editor-fold desc="Just some Overrides for Node">
     @Override
     @Override
     public Image getIcon(int type) {
     public Image getIcon(int type) {
         return smallImage;
         return smallImage;
@@ -167,7 +180,7 @@ public class JmeVector3f extends JmeSpatial {
     public Image getOpenedIcon(int type) {
     public Image getOpenedIcon(int type) {
         return smallImage;
         return smallImage;
     }
     }
-    
+
     @Override
     @Override
     public Action[] getActions(boolean context) {
     public Action[] getActions(boolean context) {
         return new Action[]{
         return new Action[]{
@@ -176,22 +189,22 @@ public class JmeVector3f extends JmeSpatial {
             SystemAction.get(MoveDownAction.class)
             SystemAction.get(MoveDownAction.class)
         };
         };
     }
     }
-    
+
     @Override
     @Override
     public boolean canRename() {
     public boolean canRename() {
         return true;
         return true;
     }
     }
-    
+
     @Override
     @Override
     public boolean canDestroy() {
     public boolean canDestroy() {
         return true;
         return true;
     }
     }
-    
+
     @Override
     @Override
     public boolean canCut() {
     public boolean canCut() {
         return false;
         return false;
     }
     }
-    
+
     @Override
     @Override
     public boolean canCopy() {
     public boolean canCopy() {
         return false;
         return false;
@@ -200,26 +213,25 @@ public class JmeVector3f extends JmeSpatial {
     @Override
     @Override
     public void destroy() throws IOException {
     public void destroy() throws IOException {
         detachBox(spatial);
         detachBox(spatial);
-        
+
         /* These are mandatory:
         /* These are mandatory:
          * Without them the Node looks like it's undeletable
          * Without them the Node looks like it's undeletable
          * (since it stays in the Motion Path and gets readded everytime)
          * (since it stays in the Motion Path and gets readded everytime)
          */
          */
-        parent.remove(new Node[] { this });
+        parent.remove(new Node[]{this});
         parent.refreshChildren(true);
         parent.refreshChildren(true);
         jmeMotionPath.updateSpline(true);
         jmeMotionPath.updateSpline(true);
         super.destroy();
         super.destroy();
     }
     }
+    // </editor-fold>
 
 
-// </editor-fold>
-    
     /* For Properties */
     /* For Properties */
     public int getChildIndex() {
     public int getChildIndex() {
         int idx = parent.indexOf(this);
         int idx = parent.indexOf(this);
         setDisplayName("Waypoint " + idx);
         setDisplayName("Waypoint " + idx);
         return idx;
         return idx;
     }
     }
-    
+
     @Override
     @Override
     protected Sheet createSheet() {
     protected Sheet createSheet() {
         Sheet sheet = Sheet.createDefault();
         Sheet sheet = Sheet.createDefault();
@@ -227,104 +239,109 @@ public class JmeVector3f extends JmeSpatial {
         set.setDisplayName("Vector3f");
         set.setDisplayName("Vector3f");
         set.setName(Vector3f.class.getName());
         set.setName(Vector3f.class.getName());
         set.setShortDescription("These are the Properties of the Motion Paths's Waypoint (Vector3f). Feel free to either edit the floats seperately or use the [x, y, z] way. Make sure that you defocus and focus this Node again in order to have the Properties be reloaded");
         set.setShortDescription("These are the Properties of the Motion Paths's Waypoint (Vector3f). Feel free to either edit the floats seperately or use the [x, y, z] way. Make sure that you defocus and focus this Node again in order to have the Properties be reloaded");
-       
+
         if (v == null) {
         if (v == null) {
             return sheet;
             return sheet;
         }
         }
-        
+
         Property p = makeEmbedProperty(this, getExplorerNodeClass(), float.class, "getX", "setX", "X");
         Property p = makeEmbedProperty(this, getExplorerNodeClass(), float.class, "getX", "setX", "X");
         p.setShortDescription("The Vector3f's X-Value");
         p.setShortDescription("The Vector3f's X-Value");
         set.put(p);
         set.put(p);
-        
+
         p = makeEmbedProperty(this, getExplorerNodeClass(), float.class, "getY", "setY", "Y");
         p = makeEmbedProperty(this, getExplorerNodeClass(), float.class, "getY", "setY", "Y");
         p.setShortDescription("The Vector3f's Y-Value");
         p.setShortDescription("The Vector3f's Y-Value");
         set.put(p);
         set.put(p);
-        
+
         p = makeEmbedProperty(this, getExplorerNodeClass(), float.class, "getZ", "setZ", "Z");
         p = makeEmbedProperty(this, getExplorerNodeClass(), float.class, "getZ", "setZ", "Z");
         p.setShortDescription("The Vector3f's Z-Value");
         p.setShortDescription("The Vector3f's Z-Value");
         set.put(p);
         set.put(p);
-        
+
         p = makeEmbedProperty(this, getExplorerNodeClass(), int.class, "getChildIndex", null, "Child Index");
         p = makeEmbedProperty(this, getExplorerNodeClass(), int.class, "getChildIndex", null, "Child Index");
         p.setShortDescription("The Index of this Node inside of the MotionPath's Children");
         p.setShortDescription("The Index of this Node inside of the MotionPath's Children");
         set.put(p);
         set.put(p);
-        
+
         createFields(Vector3f.class, set, v);
         createFields(Vector3f.class, set, v);
-        
+
         sheet.put(set);
         sheet.put(set);
         return sheet;
         return sheet;
     }
     }
-    
+
     /**
     /**
      * This is a conveniance method to access the internal Vector3f.
      * This is a conveniance method to access the internal Vector3f.
-     * Currently it's even unused.
+     *
      * @return The Vector3f representated by this Node
      * @return The Vector3f representated by this Node
      */
      */
     public Vector3f getVector3f() {
     public Vector3f getVector3f() {
         return v;
         return v;
     }
     }
+
     /**
     /**
-     * This is the callback which will be called by the Geometry.
-     * It is used to update the DataStructure with the Debug Box Position
-     * @param to 
+     * This is the callback which will be called by the Geometry. It is used to
+     * update the DataStructure with the Debug Box Position
+     *
+     * @param to
      */
      */
     public void setVector3f(Vector3f to) {
     public void setVector3f(Vector3f to) {
         v.set(to);
         v.set(to);
     }
     }
-    
+
     /* The following 6 methods are just so we know when the user typed in some properties.
     /* The following 6 methods are just so we know when the user typed in some properties.
      * Note: A PropertyChangeListener would also be appropriate and even less code.
      * Note: A PropertyChangeListener would also be appropriate and even less code.
      */
      */
-    //<editor-fold defaultstate="collapsed" desc="The Setters for the Properties Panel">
+    //<editor-fold desc="The Setters for the Properties Panel">
     public void setX(float x) {
     public void setX(float x) {
         //v.x = x;
         //v.x = x;
         v.setX(x);
         v.setX(x);
         moveBox();
         moveBox();
     }
     }
-    
+
     public void setY(float y) {
     public void setY(float y) {
         v.y = y;
         v.y = y;
         moveBox();
         moveBox();
     }
     }
-    
+
     public void setZ(float z) {
     public void setZ(float z) {
         v.z = z;
         v.z = z;
         moveBox();
         moveBox();
     }
     }
-    
+
     public float getX() {
     public float getX() {
         return v.x;
         return v.x;
     }
     }
-    
+
     public float getY() {
     public float getY() {
         return v.y;
         return v.y;
     }
     }
-    
+
     public float getZ() {
     public float getZ() {
         return v.z;
         return v.z;
     }
     }
 //</editor-fold>
 //</editor-fold>
-    
+
     @Override
     @Override
     public Class getExplorerObjectClass() {
     public Class getExplorerObjectClass() {
         return Vector3f.class;
         return Vector3f.class;
     }
     }
+
     @Override
     @Override
     public Class getExplorerNodeClass() {
     public Class getExplorerNodeClass() {
         return JmeVector3f.class;
         return JmeVector3f.class;
     }
     }
+
     @Override
     @Override
     public org.openide.nodes.Node[] createNodes(Object key, DataObject key2, boolean cookie) {
     public org.openide.nodes.Node[] createNodes(Object key, DataObject key2, boolean cookie) {
         return null;
         return null;
     }
     }
-    
+
     private class DebugBoxGeometry extends Geometry {
     private class DebugBoxGeometry extends Geometry {
+
         JmeVector3f self;
         JmeVector3f self;
-        
+
         public DebugBoxGeometry(String s, float extents, JmeVector3f jme) {
         public DebugBoxGeometry(String s, float extents, JmeVector3f jme) {
             super(s, new Box(extents, extents, extents));
             super(s, new Box(extents, extents, extents));
             self = jme;
             self = jme;
         }
         }
-        
+
         @Override
         @Override
         public void setLocalTranslation(float x, float y, float z) {
         public void setLocalTranslation(float x, float y, float z) {
             this.setLocalTranslation(new Vector3f(x, y, z));
             this.setLocalTranslation(new Vector3f(x, y, z));
@@ -338,9 +355,10 @@ public class JmeVector3f extends JmeSpatial {
         }
         }
 
 
         /**
         /**
-         * Since the usual translation updates the spline and hence triggers setModified,
-         * we need an internal method (e.g. for the Constructor)
-         * @param localTranslation the translation to set. 
+         * Since the usual translation updates the spline and hence triggers
+         * setModified, we need an internal method (e.g. for the Constructor)
+         *
+         * @param localTranslation the translation to set.
          */
          */
         public void setInternalLocalTranslation(Vector3f localTranslation) {
         public void setInternalLocalTranslation(Vector3f localTranslation) {
             super.setLocalTranslation(localTranslation);
             super.setLocalTranslation(localTranslation);

+ 54 - 45
jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/JmeVector3fChildren.java

@@ -34,23 +34,25 @@ package com.jme3.gde.core.sceneexplorer.nodes;
 import com.jme3.gde.core.scene.SceneApplication;
 import com.jme3.gde.core.scene.SceneApplication;
 import com.jme3.math.Spline;
 import com.jme3.math.Spline;
 import com.jme3.math.Vector3f;
 import com.jme3.math.Vector3f;
-import java.util.logging.Logger;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.LinkedList;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.List;
 import java.util.concurrent.Callable;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutionException;
-import java.util.logging.Level;
 import org.openide.loaders.DataObject;
 import org.openide.loaders.DataObject;
 import org.openide.nodes.Index;
 import org.openide.nodes.Index;
 import org.openide.nodes.Node;
 import org.openide.nodes.Node;
 import org.openide.util.Exceptions;
 import org.openide.util.Exceptions;
 
 
 /**
 /**
- * This Class is responsible for the management of all underlying Vector3fs as Nodes<br>
- * (In fact we currently only have one possible MotionPath but we keep this to be consistent with JmeBoneChildren).<br>
- * You have to ensure that you set the appropriate JmeMotionEvent for this class (this happens when JmeMotionEvent is creating it's Nodes)<br>
+ * This Class is responsible for the management of all underlying Vector3fs as
+ * Nodes<br>
+ * (In fact we currently only have one possible MotionPath but we keep this to
+ * be consistent with JmeBoneChildren).<br>
+ * You have to ensure that you set the appropriate JmeMotionEvent for this class
+ * (this happens when JmeMotionEvent is creating it's Nodes)<br>
  * It will use this class as Children (which are JmeMotionPaths)<br>
  * It will use this class as Children (which are JmeMotionPaths)<br>
+ *
  * @author MeFisto94
  * @author MeFisto94
  */
  */
 public class JmeVector3fChildren extends Index.ArrayChildren {
 public class JmeVector3fChildren extends Index.ArrayChildren {
@@ -85,11 +87,11 @@ public class JmeVector3fChildren extends Index.ArrayChildren {
                 public List<Vector3f> call() throws Exception {
                 public List<Vector3f> call() throws Exception {
                     List<Vector3f> keys = new LinkedList<Vector3f>();
                     List<Vector3f> keys = new LinkedList<Vector3f>();
                     if (jmeMotionPath.getMotionPath() != null) {
                     if (jmeMotionPath.getMotionPath() != null) {
-                        for (int i = 0; i <jmeMotionPath.getMotionPath().getNbWayPoints(); i++) {
+                        for (int i = 0; i < jmeMotionPath.getMotionPath().getNbWayPoints(); i++) {
                             keys.add(jmeMotionPath.getMotionPath().getWayPoint(i));
                             keys.add(jmeMotionPath.getMotionPath().getWayPoint(i));
                         }
                         }
                     }
                     }
-                    
+
                     return keys;
                     return keys;
                 }
                 }
             }).get();
             }).get();
@@ -100,51 +102,51 @@ public class JmeVector3fChildren extends Index.ArrayChildren {
         }
         }
         return null;
         return null;
     }
     }
-   
+
     /**
     /**
-     * This is called when Index.ArrayChildren initiates it's list.
-     * It's similar to createNodes and createKeys.
-     * @return 
+     * This is called when Index.ArrayChildren initiates it's list. It's similar
+     * to createNodes and createKeys.
+     *
+     * @return
      */
      */
     @Override
     @Override
     protected List<Node> initCollection() {
     protected List<Node> initCollection() {
         List<Vector3f> keyList = createKeys();
         List<Vector3f> keyList = createKeys();
         ArrayList<Node> nodeList = new ArrayList<Node>(keyList.size());
         ArrayList<Node> nodeList = new ArrayList<Node>(keyList.size());
         int i = 0;
         int i = 0;
-        
-        for (Vector3f v: keyList) {
+
+        for (Vector3f v : keyList) {
             Node n = new JmeVector3f(this, jmeMotionPath, v).setReadOnly(readOnly);
             Node n = new JmeVector3f(this, jmeMotionPath, v).setReadOnly(readOnly);
             n.setDisplayName("Waypoint " + i);
             n.setDisplayName("Waypoint " + i);
             nodeList.add(n);
             nodeList.add(n);
             i++;
             i++;
         }
         }
-        
+
         return nodeList;
         return nodeList;
     }
     }
 
 
     @Override
     @Override
     public boolean remove(Node[] arr) {
     public boolean remove(Node[] arr) {
         for (Node n : arr) {
         for (Node n : arr) {
-            jmeMotionPath.getMotionPath().removeWayPoint(((JmeVector3f)n).getVector3f());
+            jmeMotionPath.getMotionPath().removeWayPoint(((JmeVector3f) n).getVector3f());
         }
         }
-        
+
         return super.remove(arr);
         return super.remove(arr);
     }
     }
 
 
     @Override
     @Override
     public boolean add(Node[] arr) {
     public boolean add(Node[] arr) {
-        for (Node n: arr) {
+        for (Node n : arr) {
             //DON'T USE THIS -> jmeMotionPath.getMotionPath().addWayPoint(v);
             //DON'T USE THIS -> jmeMotionPath.getMotionPath().addWayPoint(v);
-            // It will clone v and as such we're not able to change it anymore.
+            //It will clone v and as such we're not able to change it anymore.
             //jmeMotionPath.getMotionPath().getSpline().getControlPoints().add(((JmeVector3f)n).getVector3f());
             //jmeMotionPath.getMotionPath().getSpline().getControlPoints().add(((JmeVector3f)n).getVector3f());
-            addControlPoint(jmeMotionPath.getMotionPath().getSpline(), ((JmeVector3f)n).getVector3f());
-            // Alternative could be nodes = initCollection()
+            addControlPoint(jmeMotionPath.getMotionPath().getSpline(), ((JmeVector3f) n).getVector3f());
         }
         }
-        
+
         return super.add(arr);
         return super.add(arr);
     }
     }
-    
-    /* Code taken from Spline.java, except the clone part */
+
+    /* Code taken from Spline.java, removed the .clone() part */
     private void addControlPoint(Spline spline, Vector3f controlPoint) {
     private void addControlPoint(Spline spline, Vector3f controlPoint) {
         List<Vector3f> controlPoints = spline.getControlPoints();
         List<Vector3f> controlPoints = spline.getControlPoints();
         if (controlPoints.size() > 2 && spline.isCycle()) {
         if (controlPoints.size() > 2 && spline.isCycle()) {
@@ -155,14 +157,16 @@ public class JmeVector3fChildren extends Index.ArrayChildren {
             controlPoints.add(controlPoints.get(0).clone());
             controlPoints.add(controlPoints.get(0).clone());
         }
         }
         if (controlPoints.size() > 1) {
         if (controlPoints.size() > 1) {
-            // spline.computeTotalLength();
-            spline.setCurveTension(spline.getCurveTension());
+            spline.setCurveTension(spline.getCurveTension()); // this calls spline.computeTotalLength();
         }
         }
     }
     }
-    
+
     /**
     /**
-     * This Method is used because before createNodes takes place we are called by the default constructor and have to pass things...
-     * @param jmeMotionPath The JmeMotionPath instance which is this nodes parent. 
+     * This Method is used because before createNodes takes place we are called
+     * by the default constructor and have to pass things...
+     *
+     * @param jmeMotionPath The JmeMotionPath instance which is this nodes
+     * parent.
      */
      */
     public void setJmeMotionPath(JmeMotionPath jmeMotionPath) {
     public void setJmeMotionPath(JmeMotionPath jmeMotionPath) {
         this.jmeMotionPath = jmeMotionPath;
         this.jmeMotionPath = jmeMotionPath;
@@ -171,60 +175,65 @@ public class JmeVector3fChildren extends Index.ArrayChildren {
     public DataObject getDataObject() {
     public DataObject getDataObject() {
         return dataObject;
         return dataObject;
     }
     }
+
     public void setDataObject(DataObject dataObject) {
     public void setDataObject(DataObject dataObject) {
         this.dataObject = dataObject;
         this.dataObject = dataObject;
     }
     }
 
 
-    /* Basically we should override everything from Index.ArrayChildren, but it's no fun and since we don't support dragging them (which could need exchange()
-     * we just stick with this way :P
+    /**
+     * Basically we should override everything from Index.ArrayChildren, but
+     * it's no fun and since we don't support dragging them (which could need
+     * exchange() we just stick with this way.
      */
      */
-    
     /**
     /**
      * Move an element up
      * Move an element up
+     *
      * @param i index of element to move up
      * @param i index of element to move up
      */
      */
     @Override
     @Override
     public void moveUp(int i) {
     public void moveUp(int i) {
         super.moveUp(i);
         super.moveUp(i);
-        
+
         List<Vector3f> controlPoints = jmeMotionPath.getMotionPath().getSpline().getControlPoints();
         List<Vector3f> controlPoints = jmeMotionPath.getMotionPath().getSpline().getControlPoints();
-        
-        if (i < 1 || i > controlPoints.size())
+
+        if (i < 1 || i > controlPoints.size()) {
             throw new IndexOutOfBoundsException();
             throw new IndexOutOfBoundsException();
-        
+        }
+
         Vector3f element = controlPoints.get(i);
         Vector3f element = controlPoints.get(i);
         Vector3f over_element = controlPoints.get(i - 1);
         Vector3f over_element = controlPoints.get(i - 1);
-        
+
         controlPoints.set(i - 1, element);
         controlPoints.set(i - 1, element);
         controlPoints.set(i, over_element);
         controlPoints.set(i, over_element);
-        
+
         jmeMotionPath.getMotionPath().getSpline().setType(jmeMotionPath.getMotionPath().getSpline().getType()); // retrigger some internal computations
         jmeMotionPath.getMotionPath().getSpline().setType(jmeMotionPath.getMotionPath().getSpline().getType()); // retrigger some internal computations
-        
+
         refreshChildren(true);
         refreshChildren(true);
         jmeMotionPath.updateSpline(true);
         jmeMotionPath.updateSpline(true);
     }
     }
 
 
     /**
     /**
      * Move an element down
      * Move an element down
+     *
      * @param i index of element to move down
      * @param i index of element to move down
      */
      */
     @Override
     @Override
     public void moveDown(int i) {
     public void moveDown(int i) {
         super.moveDown(i);
         super.moveDown(i);
         List<Vector3f> controlPoints = jmeMotionPath.getMotionPath().getSpline().getControlPoints();
         List<Vector3f> controlPoints = jmeMotionPath.getMotionPath().getSpline().getControlPoints();
-        
-        if (i < 0 || i >= controlPoints.size())
+
+        if (i < 0 || i >= controlPoints.size()) {
             throw new IndexOutOfBoundsException();
             throw new IndexOutOfBoundsException();
-        
+        }
+
         Vector3f element = controlPoints.get(i);
         Vector3f element = controlPoints.get(i);
         Vector3f under_element = controlPoints.get(i + 1);
         Vector3f under_element = controlPoints.get(i + 1);
-        
+
         controlPoints.set(i + 1, element);
         controlPoints.set(i + 1, element);
         controlPoints.set(i, under_element);
         controlPoints.set(i, under_element);
-        
+
         jmeMotionPath.getMotionPath().getSpline().setType(jmeMotionPath.getMotionPath().getSpline().getType()); // retrigger some internal computations
         jmeMotionPath.getMotionPath().getSpline().setType(jmeMotionPath.getMotionPath().getSpline().getType()); // retrigger some internal computations
-        
-        
+
         refreshChildren(true);
         refreshChildren(true);
         jmeMotionPath.updateSpline(true);
         jmeMotionPath.updateSpline(true);
     }
     }