Then your type of spatial is not in the tree.. This technique is used for all current Spatial types.
Ok normen, now i did a test, i created a class called JmePhysicsNodeTest, very similar with "JmePhysicsNode" with you created ;) , but called "JmePhysicsNodeTest" at name and display name. see yourself:
[java]/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.glaucomardano.mylibraly.jme.collisionshape;
import com.jme3.bullet.nodes.PhysicsNode;
import com.jme3.gde.core.sceneexplorer.nodes.JmePhysicsCollisionObject;
import com.jme3.gde.core.sceneexplorer.nodes.SceneExplorerChildren;
import com.jme3.gde.core.sceneexplorer.nodes.SceneExplorerNode;
import com.jme3.math.Vector3f;
import java.awt.Image;
import org.openide.loaders.DataObject;
import org.openide.nodes.Sheet;
import org.openide.util.ImageUtilities;
/**
*
* @author Glauco
*/
@org.openide.util.lookup.ServiceProvider(service=SceneExplorerNode.class)
public class JmePhysicsNodeTest extends JmePhysicsCollisionObject {
private static Image smallImage =
ImageUtilities.loadImage("org/glaucomardamo/mylibraly/jme/collisionshape/shape.gif");
private PhysicsNode spatial;
public JmePhysicsNodeTest() {
}
public JmePhysicsNodeTest(PhysicsNode spatial, SceneExplorerChildren children) {
super(spatial, children);
getLookupContents().add(spatial);
this.spatial = spatial;
}
@Override
public Image getIcon(int type) {
return smallImage;
}
@Override
public Image getOpenedIcon(int type) {
return smallImage;
}
@Override
protected Sheet createSheet() {
Sheet sheet = super.createSheet();
Sheet.Set set = Sheet.createPropertiesSet();
set.setDisplayName("PhysicsNodeTest");
set.setName("PhysicsNodeTest");
PhysicsNode obj = spatial;//getLookup().lookup(Spatial.class);
if (obj == null) {
return sheet;
}
set.put(makeProperty(obj, float.class, "getFriction", "setFriction", "Friction"));
set.put(makeProperty(obj, float.class, "getMass", "setMass", "Mass"));
set.put(makeProperty(obj, boolean.class, "isKinematic", "setKinematic", "Kinematic"));
set.put(makeProperty(obj, Vector3f.class, "getGravity", "setGravity", "Gravity"));
set.put(makeProperty(obj, float.class, "getLinearDamping", "setLinearDamping", "Linear Damping"));
set.put(makeProperty(obj, float.class, "getAngularDamping", "setAngularDamping", "Angular Damping"));
set.put(makeProperty(obj, float.class, "getRestitution", "setRestitution", "Restitution"));
set.put(makeProperty(obj, float.class, "getLinearSleepingThreshold", "setLinearSleepingThreshold", "Linear Sleeping Threshold"));
set.put(makeProperty(obj, float.class, "getAngularSleepingThreshold", "setAngularSleepingThreshold", "Angular Sleeping Threshold"));
sheet.put(set);
return sheet;
}
@Override
public Class getExplorerObjectClass() {
return PhysicsNode.class;
}
@Override
public Class getExplorerNodeClass() {
return JmePhysicsNodeTest.class;
}
@Override
public org.openide.nodes.Node[] createNodes(Object key, DataObject key2, boolean cookie) {
SceneExplorerChildren children=new SceneExplorerChildren((com.jme3.scene.Spatial)key);
children.setReadOnly(cookie);
children.setDataObject(key2);
return new org.openide.nodes.Node[]{new JmePhysicsNodeTest((PhysicsNode) key, children).setReadOnly(cookie)};
}
}
[/java]
Then i execute my module, and i open my scene with a PhysicsNode included (already created with the button "create/update PhysicsNode") . In the SceneExplorer Window's tree i can't see the JmePhysicsNodeTest spatial, i can see just the JmePhysicsNode spatial. See ( forget what i painted at image ) :
i didn't get it :( .
Without to forget that in the OutPut window appears it :
Warning: org.glaucomardano.mylibraly lacks a unit test dependency on org.netbeans.libs.junit4; using default dependencies for compatibility
and it :
java.io.FileNotFoundException: C:UsersGlauco.jmonkeyplatformlwjgl.dll < --- ( i ignored)
But i already did it.
Is needed to configurate the bundler.properties or the layer.xml ???
I'll study the Nodes API now :) , so i'll discover what i'm doing wrong.
Thinking better, i'll study the Essencial Netbeans Plataform complete tutorial :) .