SDK : Various import fix and code formatting
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9602 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
25efcd4f7b
commit
2868741bbb
@ -21,7 +21,6 @@ import com.jme3.effect.ParticleEmitter;
|
|||||||
import com.jme3.gde.core.scene.SceneApplication;
|
import com.jme3.gde.core.scene.SceneApplication;
|
||||||
import com.jme3.material.Material;
|
import com.jme3.material.Material;
|
||||||
import com.jme3.math.ColorRGBA;
|
import com.jme3.math.ColorRGBA;
|
||||||
import com.jme3.math.Transform;
|
|
||||||
import com.jme3.math.Vector3f;
|
import com.jme3.math.Vector3f;
|
||||||
import com.jme3.renderer.RenderManager;
|
import com.jme3.renderer.RenderManager;
|
||||||
import com.jme3.scene.Geometry;
|
import com.jme3.scene.Geometry;
|
||||||
@ -31,8 +30,6 @@ import com.jme3.scene.Spatial;
|
|||||||
import com.jme3.scene.debug.Arrow;
|
import com.jme3.scene.debug.Arrow;
|
||||||
import com.jme3.scene.debug.Grid;
|
import com.jme3.scene.debug.Grid;
|
||||||
import com.jme3.scene.debug.WireBox;
|
import com.jme3.scene.debug.WireBox;
|
||||||
import com.jme3.scene.shape.Box;
|
|
||||||
import com.jme3.util.TempVars;
|
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -145,13 +142,13 @@ public class SceneToolController implements AppState {
|
|||||||
public void rebuildSelectionBox() {
|
public void rebuildSelectionBox() {
|
||||||
if (SceneApplication.getApplication().isAwt()) {
|
if (SceneApplication.getApplication().isAwt()) {
|
||||||
SceneApplication.getApplication().enqueue(new Callable<Object>() {
|
SceneApplication.getApplication().enqueue(new Callable<Object>() {
|
||||||
|
|
||||||
public Object call() throws Exception {
|
public Object call() throws Exception {
|
||||||
doUpdateSelection(selected);
|
doUpdateSelection(selected);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (selected != null) {
|
if (selected != null) {
|
||||||
attachSelectionShape(selected);
|
attachSelectionShape(selected);
|
||||||
}
|
}
|
||||||
@ -248,13 +245,13 @@ public class SceneToolController implements AppState {
|
|||||||
wireBox.fromBoundingBox(bbox);
|
wireBox.fromBoundingBox(bbox);
|
||||||
final Geometry selectionGeometry = new Geometry("selection_geometry_sceneviewer", wireBox);
|
final Geometry selectionGeometry = new Geometry("selection_geometry_sceneviewer", wireBox);
|
||||||
selectionGeometry.setMaterial(blueMat);
|
selectionGeometry.setMaterial(blueMat);
|
||||||
selectionGeometry.setLocalTranslation( bbox.getCenter().subtract(geom.getWorldTranslation()) );
|
selectionGeometry.setLocalTranslation(bbox.getCenter().subtract(geom.getWorldTranslation()));
|
||||||
//Vector3f scale = new Vector3f(1,1,1);
|
//Vector3f scale = new Vector3f(1,1,1);
|
||||||
//scale.x = 1/geom.getWorldScale().x;
|
//scale.x = 1/geom.getWorldScale().x;
|
||||||
//scale.y = 1/geom.getWorldScale().y;
|
//scale.y = 1/geom.getWorldScale().y;
|
||||||
//scale.z = 1/geom.getWorldScale().z;
|
//scale.z = 1/geom.getWorldScale().z;
|
||||||
selectionShape = new Node("SelectionParent");
|
selectionShape = new Node("SelectionParent");
|
||||||
((Node)selectionShape).attachChild(selectionGeometry);
|
((Node) selectionShape).attachChild(selectionGeometry);
|
||||||
//selectionShape.setLocalTransform(geom.getWorldTransform());
|
//selectionShape.setLocalTransform(geom.getWorldTransform());
|
||||||
//selectionShape.setLocalTranslation(geom.getWorldTranslation());
|
//selectionShape.setLocalTranslation(geom.getWorldTranslation());
|
||||||
//selectionGeometry.setLocalScale(scale);
|
//selectionGeometry.setLocalScale(scale);
|
||||||
|
@ -32,9 +32,7 @@
|
|||||||
package com.jme3.gde.core.sceneexplorer.nodes;
|
package com.jme3.gde.core.sceneexplorer.nodes;
|
||||||
|
|
||||||
import com.jme3.animation.Bone;
|
import com.jme3.animation.Bone;
|
||||||
import com.jme3.animation.SkeletonControl;
|
|
||||||
import com.jme3.gde.core.scene.SceneApplication;
|
import com.jme3.gde.core.scene.SceneApplication;
|
||||||
import com.jme3.gde.core.sceneexplorer.SceneExplorerTopComponent;
|
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
import java.awt.datatransfer.DataFlavor;
|
import java.awt.datatransfer.DataFlavor;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
@ -62,10 +60,9 @@ public class JmeBone extends AbstractSceneExplorerNode {
|
|||||||
protected final DataFlavor BONE_FLAVOR = new DataFlavor(ClipboardSpatial.class, "Bone");
|
protected final DataFlavor BONE_FLAVOR = new DataFlavor(ClipboardSpatial.class, "Bone");
|
||||||
|
|
||||||
public JmeBone() {
|
public JmeBone() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public JmeBone(JmeSkeletonControl jmeSkeletonControl,Bone bone, JmeBoneChildren children) {
|
public JmeBone(JmeSkeletonControl jmeSkeletonControl, Bone bone, JmeBoneChildren children) {
|
||||||
super(children);
|
super(children);
|
||||||
this.jmeChildren = children;
|
this.jmeChildren = children;
|
||||||
this.jmeSkeletonControl = jmeSkeletonControl;
|
this.jmeSkeletonControl = jmeSkeletonControl;
|
||||||
@ -100,75 +97,16 @@ public class JmeBone extends AbstractSceneExplorerNode {
|
|||||||
return sheet;
|
return sheet;
|
||||||
|
|
||||||
}
|
}
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public PasteType getDropType(final Transferable t, int action, int index) {
|
|
||||||
// Object data = null;
|
|
||||||
// try {
|
|
||||||
// data = t.getTransferData(BONE_FLAVOR);
|
|
||||||
// } catch (Exception ex) {
|
|
||||||
//// Exceptions.printStackTrace(ex);
|
|
||||||
// }
|
|
||||||
// if (data == null) {
|
|
||||||
// return null;
|
|
||||||
// }
|
|
||||||
// if (data instanceof ClipboardSpatial) {
|
|
||||||
// final Spatial spat = ((ClipboardSpatial) data).createSpatial();
|
|
||||||
// return new PasteType() {
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public Transferable paste() throws IOException {
|
|
||||||
// try {
|
|
||||||
// fireSave(true);
|
|
||||||
// SceneApplication.getApplication().enqueue(new Callable<Void>() {
|
|
||||||
//
|
|
||||||
// public Void call() throws Exception {
|
|
||||||
// skeletonControl.getAttachmentsNode(bone.getName()).attachChild(spat);
|
|
||||||
// return null;
|
|
||||||
// }
|
|
||||||
// }).get();
|
|
||||||
// refresh(false);
|
|
||||||
// return t;
|
|
||||||
// } catch (InterruptedException ex) {
|
|
||||||
// Exceptions.printStackTrace(ex);
|
|
||||||
// } catch (ExecutionException ex) {
|
|
||||||
// Exceptions.printStackTrace(ex);
|
|
||||||
// }
|
|
||||||
// return null;
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
// return null;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// protected void createPasteTypes(Transferable t, List<PasteType> s) {
|
|
||||||
// super.createPasteTypes(t, s);
|
|
||||||
// PasteType paste = getDropType(t, DnDConstants.ACTION_COPY_OR_MOVE, -1);
|
|
||||||
// if (null != paste) {
|
|
||||||
// s.add(paste);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Action[] getActions(boolean context) {
|
public Action[] getActions(boolean context) {
|
||||||
// return super.getActions(context);
|
|
||||||
|
|
||||||
return new Action[]{
|
return new Action[]{
|
||||||
Actions.alwaysEnabled(new AttachementNodeActionListener(), "Get attachement Node", "", false),
|
Actions.alwaysEnabled(new AttachementNodeActionListener(), "Get attachement Node", "", false),};
|
||||||
};
|
|
||||||
// if (((JmeBoneChildren) jmeChildren).readOnly) {
|
|
||||||
// return new Action[]{
|
|
||||||
// Actions.alwaysEnabled(new AttachementNodeActionListener(), "Get attachement Node", "", false),
|
|
||||||
// };
|
|
||||||
// } else {
|
|
||||||
// return new Action[]{
|
|
||||||
// Actions.alwaysEnabled(new AttachementNodeActionListener(), "Get attachement Node", "", false),
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class AttachementNodeActionListener implements ActionListener{
|
private class AttachementNodeActionListener implements ActionListener {
|
||||||
|
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
fireSave(true);
|
fireSave(true);
|
||||||
try {
|
try {
|
||||||
@ -178,9 +116,8 @@ public class JmeBone extends AbstractSceneExplorerNode {
|
|||||||
jmeSkeletonControl.getSkeletonControl().getAttachmentsNode(bone.getName());
|
jmeSkeletonControl.getSkeletonControl().getAttachmentsNode(bone.getName());
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}).get();
|
}).get();
|
||||||
((AbstractSceneExplorerNode)jmeSkeletonControl.getParentNode()).refresh(false);
|
((AbstractSceneExplorerNode) jmeSkeletonControl.getParentNode()).refresh(false);
|
||||||
} catch (InterruptedException ex) {
|
} catch (InterruptedException ex) {
|
||||||
Exceptions.printStackTrace(ex);
|
Exceptions.printStackTrace(ex);
|
||||||
} catch (ExecutionException ex) {
|
} catch (ExecutionException ex) {
|
||||||
@ -199,9 +136,9 @@ public class JmeBone 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) {
|
||||||
JmeBoneChildren children = new JmeBoneChildren(jmeSkeletonControl,(Bone) key);
|
JmeBoneChildren children = new JmeBoneChildren(jmeSkeletonControl, (Bone) key);
|
||||||
children.setReadOnly(cookie);
|
children.setReadOnly(cookie);
|
||||||
children.setDataObject(key2);
|
children.setDataObject(key2);
|
||||||
return new org.openide.nodes.Node[]{new JmeBone(jmeSkeletonControl,(Bone) key, children).setReadOnly(cookie)};
|
return new org.openide.nodes.Node[]{new JmeBone(jmeSkeletonControl, (Bone) key, children).setReadOnly(cookie)};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,27 +32,17 @@
|
|||||||
package com.jme3.gde.core.sceneexplorer.nodes;
|
package com.jme3.gde.core.sceneexplorer.nodes;
|
||||||
|
|
||||||
import com.jme3.animation.Bone;
|
import com.jme3.animation.Bone;
|
||||||
import com.jme3.animation.SkeletonControl;
|
|
||||||
import com.jme3.gde.core.scene.SceneApplication;
|
import com.jme3.gde.core.scene.SceneApplication;
|
||||||
import com.jme3.light.AmbientLight;
|
|
||||||
import com.jme3.light.DirectionalLight;
|
|
||||||
import com.jme3.light.PointLight;
|
|
||||||
import com.jme3.light.SpotLight;
|
|
||||||
import com.jme3.scene.Spatial;
|
|
||||||
import com.jme3.scene.control.Control;
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
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 java.util.logging.Logger;
|
|
||||||
import org.openide.loaders.DataObject;
|
import org.openide.loaders.DataObject;
|
||||||
import org.openide.nodes.Children;
|
import org.openide.nodes.Children;
|
||||||
import org.openide.nodes.Node;
|
import org.openide.nodes.Node;
|
||||||
import org.openide.util.Exceptions;
|
import org.openide.util.Exceptions;
|
||||||
import org.openide.util.Lookup;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -100,24 +90,7 @@ public class JmeBoneChildren extends Children.Keys<Object> {
|
|||||||
} else {
|
} else {
|
||||||
keys.addAll(Arrays.asList(jmeSkeletonControl.getSkeletonControl().getSkeleton().getRoots()));
|
keys.addAll(Arrays.asList(jmeSkeletonControl.getSkeletonControl().getSkeleton().getRoots()));
|
||||||
}
|
}
|
||||||
// if (spatial instanceof Geometry) {
|
|
||||||
// Geometry geom = (Geometry) spatial;
|
|
||||||
// Mesh mesh = geom.getMesh();
|
|
||||||
// if (mesh != null) {
|
|
||||||
// keys.add(new MeshGeometryPair(mesh, geom));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// LightList lights = spatial.getLocalLightList();
|
|
||||||
// for (int i = 0; i < lights.size(); i++) {
|
|
||||||
// Light light = lights.get(i);
|
|
||||||
// if (light != null) {
|
|
||||||
// keys.add(new LightSpatialPair(light, spatial));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// for (int i = 0; i < spatial.getNumControls(); i++) {
|
|
||||||
// Control control = spatial.getControl(i);
|
|
||||||
// keys.add(control);
|
|
||||||
// }
|
|
||||||
return keys;
|
return keys;
|
||||||
}
|
}
|
||||||
}).get();
|
}).get();
|
||||||
|
@ -31,10 +31,8 @@
|
|||||||
*/
|
*/
|
||||||
package com.jme3.gde.core.sceneexplorer.nodes;
|
package com.jme3.gde.core.sceneexplorer.nodes;
|
||||||
|
|
||||||
import com.jme3.animation.AnimControl;
|
|
||||||
import com.jme3.animation.SkeletonControl;
|
import com.jme3.animation.SkeletonControl;
|
||||||
import com.jme3.gde.core.scene.SceneApplication;
|
import com.jme3.gde.core.scene.SceneApplication;
|
||||||
import com.jme3.gde.core.properties.AnimationProperty;
|
|
||||||
import com.jme3.scene.Spatial;
|
import com.jme3.scene.Spatial;
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -43,7 +41,6 @@ import java.util.concurrent.ExecutionException;
|
|||||||
import javax.swing.Action;
|
import javax.swing.Action;
|
||||||
import org.openide.actions.DeleteAction;
|
import org.openide.actions.DeleteAction;
|
||||||
import org.openide.loaders.DataObject;
|
import org.openide.loaders.DataObject;
|
||||||
import org.openide.nodes.Children;
|
|
||||||
import org.openide.nodes.Node;
|
import org.openide.nodes.Node;
|
||||||
import org.openide.nodes.Sheet;
|
import org.openide.nodes.Sheet;
|
||||||
import org.openide.util.Exceptions;
|
import org.openide.util.Exceptions;
|
||||||
@ -62,7 +59,6 @@ public class JmeSkeletonControl extends AbstractSceneExplorerNode {
|
|||||||
ImageUtilities.loadImage("com/jme3/gde/core/sceneexplorer/nodes/icons/skeletonControl.gif");
|
ImageUtilities.loadImage("com/jme3/gde/core/sceneexplorer/nodes/icons/skeletonControl.gif");
|
||||||
|
|
||||||
public JmeSkeletonControl() {
|
public JmeSkeletonControl() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public JmeSkeletonControl(SkeletonControl skeletonControl, JmeBoneChildren children) {
|
public JmeSkeletonControl(SkeletonControl skeletonControl, JmeBoneChildren children) {
|
||||||
@ -150,8 +146,6 @@ public class JmeSkeletonControl extends AbstractSceneExplorerNode {
|
|||||||
return skeletonControl;
|
return skeletonControl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Node[] createNodes(Object key, DataObject key2, boolean cookie) {
|
public Node[] createNodes(Object key, DataObject key2, boolean cookie) {
|
||||||
JmeBoneChildren children = new JmeBoneChildren(null, null);
|
JmeBoneChildren children = new JmeBoneChildren(null, null);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user