Merge branch 'master' into experimental
This commit is contained in:
commit
655457ab6a
@ -139,11 +139,7 @@ public final class Bone implements Savable {
|
|||||||
/**
|
/**
|
||||||
* Special-purpose copy constructor.
|
* Special-purpose copy constructor.
|
||||||
* <p>
|
* <p>
|
||||||
* Only copies the name and bind pose from the original.
|
* Only copies the name, user control state and bind pose transforms from the original.
|
||||||
* <p>
|
|
||||||
* WARNING: Local bind pose and world inverse bind pose transforms shallow
|
|
||||||
* copied. Modifying that data on the original bone will cause it to
|
|
||||||
* be recomputed on any cloned bones.
|
|
||||||
* <p>
|
* <p>
|
||||||
* The rest of the data is <em>NOT</em> copied, as it will be
|
* The rest of the data is <em>NOT</em> copied, as it will be
|
||||||
* generated automatically when the bone is animated.
|
* generated automatically when the bone is animated.
|
||||||
@ -155,13 +151,13 @@ public final class Bone implements Savable {
|
|||||||
|
|
||||||
userControl = source.userControl;
|
userControl = source.userControl;
|
||||||
|
|
||||||
bindPos = source.bindPos;
|
bindPos = source.bindPos.clone();
|
||||||
bindRot = source.bindRot;
|
bindRot = source.bindRot.clone();
|
||||||
bindScale = source.bindScale;
|
bindScale = source.bindScale.clone();
|
||||||
|
|
||||||
modelBindInversePos = source.modelBindInversePos;
|
modelBindInversePos = source.modelBindInversePos.clone();
|
||||||
modelBindInverseRot = source.modelBindInverseRot;
|
modelBindInverseRot = source.modelBindInverseRot.clone();
|
||||||
modelBindInverseScale = source.modelBindInverseScale;
|
modelBindInverseScale = source.modelBindInverseScale.clone();
|
||||||
|
|
||||||
// parent and children will be assigned manually..
|
// parent and children will be assigned manually..
|
||||||
}
|
}
|
||||||
|
@ -116,7 +116,7 @@ public class BatchNode extends GeometryGroupNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onGeoemtryUnassociated(Geometry geom) {
|
public void onGeometryUnassociated(Geometry geom) {
|
||||||
setNeedsFullRebatch(true);
|
setNeedsFullRebatch(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -344,7 +344,7 @@ public class Geometry extends Spatial {
|
|||||||
if (groupNode != null) {
|
if (groupNode != null) {
|
||||||
// Once the geometry is removed
|
// Once the geometry is removed
|
||||||
// from the parent, the group node needs to be updated.
|
// from the parent, the group node needs to be updated.
|
||||||
groupNode.onGeoemtryUnassociated(this);
|
groupNode.onGeometryUnassociated(this);
|
||||||
groupNode = null;
|
groupNode = null;
|
||||||
|
|
||||||
// change the default to -1 to make error detection easier
|
// change the default to -1 to make error detection easier
|
||||||
|
@ -83,5 +83,5 @@ public abstract class GeometryGroupNode extends Node {
|
|||||||
*
|
*
|
||||||
* @param geom The Geometry which is being unassociated.
|
* @param geom The Geometry which is being unassociated.
|
||||||
*/
|
*/
|
||||||
public abstract void onGeoemtryUnassociated(Geometry geom);
|
public abstract void onGeometryUnassociated(Geometry geom);
|
||||||
}
|
}
|
||||||
|
@ -329,7 +329,7 @@ public class InstancedNode extends GeometryGroupNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onGeoemtryUnassociated(Geometry geom) {
|
public void onGeometryUnassociated(Geometry geom) {
|
||||||
removeFromInstancedGeometry(geom);
|
removeFromInstancedGeometry(geom);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -211,7 +211,7 @@ public class Cylinder extends Mesh {
|
|||||||
*/
|
*/
|
||||||
public void updateGeometry(int axisSamples, int radialSamples,
|
public void updateGeometry(int axisSamples, int radialSamples,
|
||||||
float radius, float radius2, float height, boolean closed, boolean inverted) {
|
float radius, float radius2, float height, boolean closed, boolean inverted) {
|
||||||
this.axisSamples = axisSamples + (closed ? 2 : 0);
|
this.axisSamples = axisSamples;
|
||||||
this.radialSamples = radialSamples;
|
this.radialSamples = radialSamples;
|
||||||
this.radius = radius;
|
this.radius = radius;
|
||||||
this.radius2 = radius2;
|
this.radius2 = radius2;
|
||||||
@ -222,6 +222,7 @@ public class Cylinder extends Mesh {
|
|||||||
// VertexBuffer pvb = getBuffer(Type.Position);
|
// VertexBuffer pvb = getBuffer(Type.Position);
|
||||||
// VertexBuffer nvb = getBuffer(Type.Normal);
|
// VertexBuffer nvb = getBuffer(Type.Normal);
|
||||||
// VertexBuffer tvb = getBuffer(Type.TexCoord);
|
// VertexBuffer tvb = getBuffer(Type.TexCoord);
|
||||||
|
axisSamples += (closed ? 2 : 0);
|
||||||
|
|
||||||
// Vertices
|
// Vertices
|
||||||
int vertCount = axisSamples * (radialSamples + 1) + (closed ? 2 : 0);
|
int vertCount = axisSamples * (radialSamples + 1) + (closed ? 2 : 0);
|
||||||
|
@ -51,7 +51,6 @@ import java.nio.IntBuffer;
|
|||||||
import java.nio.LongBuffer;
|
import java.nio.LongBuffer;
|
||||||
import java.nio.ShortBuffer;
|
import java.nio.ShortBuffer;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
@ -1268,7 +1267,6 @@ public final class BufferUtils {
|
|||||||
System.out.println(store.toString());
|
System.out.println(store.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private static final AtomicBoolean loadedMethods = new AtomicBoolean(false);
|
|
||||||
private static Method cleanerMethod = null;
|
private static Method cleanerMethod = null;
|
||||||
private static Method cleanMethod = null;
|
private static Method cleanMethod = null;
|
||||||
private static Method viewedBufferMethod = null;
|
private static Method viewedBufferMethod = null;
|
||||||
@ -1288,14 +1286,7 @@ public final class BufferUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void loadCleanerMethods() {
|
static {
|
||||||
// If its already true, exit, if not, set it to true.
|
|
||||||
if (BufferUtils.loadedMethods.getAndSet(true)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// This could potentially be called many times if used from multiple
|
|
||||||
// threads
|
|
||||||
synchronized (BufferUtils.loadedMethods) {
|
|
||||||
// Oracle JRE / OpenJDK
|
// Oracle JRE / OpenJDK
|
||||||
cleanerMethod = loadMethod("sun.nio.ch.DirectBuffer", "cleaner");
|
cleanerMethod = loadMethod("sun.nio.ch.DirectBuffer", "cleaner");
|
||||||
cleanMethod = loadMethod("sun.misc.Cleaner", "clean");
|
cleanMethod = loadMethod("sun.misc.Cleaner", "clean");
|
||||||
@ -1314,7 +1305,6 @@ public final class BufferUtils {
|
|||||||
} catch (SecurityException ex) {
|
} catch (SecurityException ex) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Direct buffers are garbage collected by using a phantom reference and a
|
* Direct buffers are garbage collected by using a phantom reference and a
|
||||||
@ -1333,8 +1323,6 @@ public final class BufferUtils {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
BufferUtils.loadCleanerMethods();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (freeMethod != null) {
|
if (freeMethod != null) {
|
||||||
freeMethod.invoke(toBeDestroyed);
|
freeMethod.invoke(toBeDestroyed);
|
||||||
|
@ -19,6 +19,6 @@ void main(void)
|
|||||||
#ifdef NUM_BONES
|
#ifdef NUM_BONES
|
||||||
Skinning_Compute(modelSpacePos,modelSpaceNormals);
|
Skinning_Compute(modelSpacePos,modelSpaceNormals);
|
||||||
#endif
|
#endif
|
||||||
normal = normalize(g_NormalMatrix * modelSpaceNormals);
|
normal = normalize(TransformNormal(modelSpaceNormals));
|
||||||
gl_Position = g_WorldViewProjectionMatrix * modelSpacePos;
|
gl_Position = g_WorldViewProjectionMatrix * modelSpacePos;
|
||||||
}
|
}
|
@ -75,8 +75,6 @@ public class FilterPostProcessorNode extends AbstractNode {
|
|||||||
getLookup().lookup(FilterIndexSupport.class).setFilterPostProcessorNode(this);
|
getLookup().lookup(FilterIndexSupport.class).setFilterPostProcessorNode(this);
|
||||||
((FilterChildren) getChildren()).setFilterPostProcessorNode(this);
|
((FilterChildren) getChildren()).setFilterPostProcessorNode(this);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -221,15 +219,10 @@ public class FilterPostProcessorNode extends AbstractNode {
|
|||||||
@Override
|
@Override
|
||||||
protected Node[] createNodes(Object t) {
|
protected Node[] createNodes(Object t) {
|
||||||
Filter filter = (Filter) t;
|
Filter filter = (Filter) t;
|
||||||
for (FilterNode di : Lookup.getDefault().lookupAll(FilterNode.class)) {
|
//get JmeFilter, the only FilterNode spi
|
||||||
if (di.getExplorerObjectClass().getName().equals(filter.getClass().getName())) {
|
FilterNode di = Lookup.getDefault().lookup(FilterNode.class);
|
||||||
Node[] ret = di.createNodes(filter, dataObject, readOnly);
|
Node[] ret = di.createNodes(filter, dataObject, readOnly);
|
||||||
if (ret != null) {
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return new Node[]{};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,87 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2009-2010 jMonkeyEngine
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions are
|
|
||||||
* met:
|
|
||||||
*
|
|
||||||
* * Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* * Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
*
|
|
||||||
* * Neither the name of 'jMonkeyEngine' nor the names of its contributors
|
|
||||||
* may be used to endorse or promote products derived from this software
|
|
||||||
* without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
||||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
||||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
||||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
package com.jme3.gde.core.filters.impl;
|
|
||||||
|
|
||||||
import com.jme3.gde.core.filters.AbstractFilterNode;
|
|
||||||
import com.jme3.gde.core.filters.FilterNode;
|
|
||||||
import com.jme3.post.filters.BloomFilter;
|
|
||||||
import org.openide.loaders.DataObject;
|
|
||||||
import org.openide.nodes.Node;
|
|
||||||
import org.openide.nodes.Sheet;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author normenhansen
|
|
||||||
*/
|
|
||||||
@org.openide.util.lookup.ServiceProvider(service = FilterNode.class)
|
|
||||||
public class JmeBloomFilter extends AbstractFilterNode {
|
|
||||||
|
|
||||||
public JmeBloomFilter() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public JmeBloomFilter(BloomFilter filter, DataObject object, boolean readOnly) {
|
|
||||||
super(filter);
|
|
||||||
this.dataObject = object;
|
|
||||||
this.readOnly = readOnly;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Sheet createSheet() {
|
|
||||||
Sheet sheet = super.createSheet();
|
|
||||||
Sheet.Set set = Sheet.createPropertiesSet();
|
|
||||||
set.setDisplayName("Bloom");
|
|
||||||
set.setName(Node.class.getName());
|
|
||||||
BloomFilter obj = (BloomFilter) filter;
|
|
||||||
if (obj == null) {
|
|
||||||
return sheet;
|
|
||||||
}
|
|
||||||
// set.put(makeProperty(obj, float.class, "getBloomIntensity", "setBloomIntensity", "Intensity"));
|
|
||||||
// set.put(makeProperty(obj, float.class, "getBlurScale", "setBlurScale", "Blur Scale"));
|
|
||||||
// set.put(makeProperty(obj, float.class, "getDownSamplingFactor", "setDownSamplingFactor", "Downsampling Factor"));
|
|
||||||
// set.put(makeProperty(obj, float.class, "getExposureCutOff", "setExposureCutOff", "Exposure Cutoff"));
|
|
||||||
// set.put(makeProperty(obj, float.class, "getExposurePower", "setExposurePower", "Exposure Power"));
|
|
||||||
createFields(BloomFilter.class, set, obj);
|
|
||||||
sheet.put(set);
|
|
||||||
return sheet;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Class<?> getExplorerObjectClass() {
|
|
||||||
return BloomFilter.class;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Node[] createNodes(Object key, DataObject dataObject, boolean readOnly) {
|
|
||||||
return new Node[]{new JmeBloomFilter((BloomFilter) key, dataObject, readOnly)};
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,89 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2009-2010 jMonkeyEngine
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions are
|
|
||||||
* met:
|
|
||||||
*
|
|
||||||
* * Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* * Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
*
|
|
||||||
* * Neither the name of 'jMonkeyEngine' nor the names of its contributors
|
|
||||||
* may be used to endorse or promote products derived from this software
|
|
||||||
* without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
||||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
||||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
||||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
package com.jme3.gde.core.filters.impl;
|
|
||||||
|
|
||||||
import com.jme3.gde.core.filters.AbstractFilterNode;
|
|
||||||
import com.jme3.gde.core.filters.FilterNode;
|
|
||||||
import com.jme3.post.filters.CartoonEdgeFilter;
|
|
||||||
import org.openide.loaders.DataObject;
|
|
||||||
import org.openide.nodes.Node;
|
|
||||||
import org.openide.nodes.Sheet;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author normenhansen
|
|
||||||
*/
|
|
||||||
@org.openide.util.lookup.ServiceProvider(service = FilterNode.class)
|
|
||||||
public class JmeCartoonEdgeFilter extends AbstractFilterNode {
|
|
||||||
|
|
||||||
public JmeCartoonEdgeFilter() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public JmeCartoonEdgeFilter(CartoonEdgeFilter filter, DataObject object, boolean readOnly) {
|
|
||||||
super(filter);
|
|
||||||
this.dataObject = object;
|
|
||||||
this.readOnly = readOnly;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Sheet createSheet() {
|
|
||||||
Sheet sheet = super.createSheet();
|
|
||||||
Sheet.Set set = Sheet.createPropertiesSet();
|
|
||||||
set.setDisplayName("CartoonEdge");
|
|
||||||
set.setName(Node.class.getName());
|
|
||||||
CartoonEdgeFilter obj = (CartoonEdgeFilter) filter;
|
|
||||||
if (obj == null) {
|
|
||||||
return sheet;
|
|
||||||
}
|
|
||||||
// set.put(makeProperty(obj, float.class, "getDepthSensitivity", "setDepthSensitivity", "Depth Sensitivity"));
|
|
||||||
// set.put(makeProperty(obj, float.class, "getDepthThreshold", "setDepthThreshold", "Depth Threshold"));
|
|
||||||
// set.put(makeProperty(obj, ColorRGBA.class, "getEdgeColor", "setEdgeColor", "Edge Color"));
|
|
||||||
// set.put(makeProperty(obj, float.class, "getEdgeIntensity", "setEdgeIntensity", "Edge Intensity"));
|
|
||||||
// set.put(makeProperty(obj, float.class, "getEdgeWidth", "setEdgeWidth", "Edge Width"));
|
|
||||||
// set.put(makeProperty(obj, float.class, "getNormalSensitivity", "setNormalSensitivity", "Normal Sensitivity"));
|
|
||||||
// set.put(makeProperty(obj, float.class, "getNormalThreshold", "setNormalThreshold", "Normal Threshold"));
|
|
||||||
createFields(CartoonEdgeFilter.class, set, obj);
|
|
||||||
sheet.put(set);
|
|
||||||
return sheet;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Class<?> getExplorerObjectClass() {
|
|
||||||
return CartoonEdgeFilter.class;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Node[] createNodes(Object key, DataObject dataObject, boolean readOnly) {
|
|
||||||
return new Node[]{new JmeCartoonEdgeFilter((CartoonEdgeFilter) key, dataObject, readOnly)};
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,83 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2009-2010 jMonkeyEngine
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions are
|
|
||||||
* met:
|
|
||||||
*
|
|
||||||
* * Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* * Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
*
|
|
||||||
* * Neither the name of 'jMonkeyEngine' nor the names of its contributors
|
|
||||||
* may be used to endorse or promote products derived from this software
|
|
||||||
* without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
||||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
||||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
||||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
package com.jme3.gde.core.filters.impl;
|
|
||||||
|
|
||||||
import com.jme3.gde.core.filters.AbstractFilterNode;
|
|
||||||
import com.jme3.gde.core.filters.FilterNode;
|
|
||||||
import com.jme3.post.filters.ColorOverlayFilter;
|
|
||||||
import org.openide.loaders.DataObject;
|
|
||||||
import org.openide.nodes.Node;
|
|
||||||
import org.openide.nodes.Sheet;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author normenhansen
|
|
||||||
*/
|
|
||||||
@org.openide.util.lookup.ServiceProvider(service = FilterNode.class)
|
|
||||||
public class JmeColorOverlayFilter extends AbstractFilterNode {
|
|
||||||
|
|
||||||
public JmeColorOverlayFilter() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public JmeColorOverlayFilter(ColorOverlayFilter filter, DataObject object, boolean readOnly) {
|
|
||||||
super(filter);
|
|
||||||
this.dataObject = object;
|
|
||||||
this.readOnly = readOnly;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Sheet createSheet() {
|
|
||||||
Sheet sheet = super.createSheet();
|
|
||||||
Sheet.Set set = Sheet.createPropertiesSet();
|
|
||||||
set.setDisplayName("ColorOverlay");
|
|
||||||
set.setName(Node.class.getName());
|
|
||||||
ColorOverlayFilter obj = (ColorOverlayFilter) filter;
|
|
||||||
if (obj == null) {
|
|
||||||
return sheet;
|
|
||||||
}
|
|
||||||
//set.put(makeProperty(obj, ColorRGBA.class, "getColor", "setColor", "Color"));
|
|
||||||
createFields(ColorOverlayFilter.class, set, obj);
|
|
||||||
sheet.put(set);
|
|
||||||
return sheet;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Class<?> getExplorerObjectClass() {
|
|
||||||
return ColorOverlayFilter.class;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Node[] createNodes(Object key, DataObject dataObject, boolean readOnly) {
|
|
||||||
return new Node[]{new JmeColorOverlayFilter((ColorOverlayFilter) key, dataObject, readOnly)};
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,89 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2009-2010 jMonkeyEngine
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions are
|
|
||||||
* met:
|
|
||||||
*
|
|
||||||
* * Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* * Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
*
|
|
||||||
* * Neither the name of 'jMonkeyEngine' nor the names of its contributors
|
|
||||||
* may be used to endorse or promote products derived from this software
|
|
||||||
* without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
||||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
||||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
||||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
package com.jme3.gde.core.filters.impl;
|
|
||||||
|
|
||||||
import com.jme3.gde.core.filters.AbstractFilterNode;
|
|
||||||
import com.jme3.gde.core.filters.FilterNode;
|
|
||||||
import com.jme3.post.filters.CrossHatchFilter;
|
|
||||||
import org.openide.loaders.DataObject;
|
|
||||||
import org.openide.nodes.Node;
|
|
||||||
import org.openide.nodes.Sheet;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author normenhansen
|
|
||||||
*/
|
|
||||||
@org.openide.util.lookup.ServiceProvider(service = FilterNode.class)
|
|
||||||
public class JmeCrossHatchFilter extends AbstractFilterNode {
|
|
||||||
|
|
||||||
public JmeCrossHatchFilter() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public JmeCrossHatchFilter(CrossHatchFilter filter, DataObject object, boolean readOnly) {
|
|
||||||
super(filter);
|
|
||||||
this.dataObject = object;
|
|
||||||
this.readOnly = readOnly;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Sheet createSheet() {
|
|
||||||
Sheet sheet = super.createSheet();
|
|
||||||
Sheet.Set set = Sheet.createPropertiesSet();
|
|
||||||
set.setDisplayName("CrossHatch");
|
|
||||||
set.setName(Node.class.getName());
|
|
||||||
CrossHatchFilter obj = (CrossHatchFilter) filter;
|
|
||||||
if (obj == null) {
|
|
||||||
return sheet;
|
|
||||||
}
|
|
||||||
// set.put(makeProperty(obj, float.class, "getColorInfluenceLine", "setColorInfluenceLine", "Color Influence Line"));
|
|
||||||
// set.put(makeProperty(obj, float.class, "getColorInfluencePaper", "setColorInfluencePaper", "Color Influence Paper"));
|
|
||||||
// set.put(makeProperty(obj, float.class, "getFillValue", "setFillValue", "Fill Value"));
|
|
||||||
// set.put(makeProperty(obj, ColorRGBA.class, "getPaperColor", "setPaperColor", "Paper Color"));
|
|
||||||
// set.put(makeProperty(obj, ColorRGBA.class, "getLineColor", "setLineColor", "Line Color"));
|
|
||||||
// set.put(makeProperty(obj, float.class, "getLineDistance", "setLineDistance", "Line Distance"));
|
|
||||||
// set.put(makeProperty(obj, float.class, "getLineThickness", "setLineThickness", "Line Thickness"));
|
|
||||||
createFields(CrossHatchFilter.class, set, obj);
|
|
||||||
sheet.put(set);
|
|
||||||
return sheet;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Class<?> getExplorerObjectClass() {
|
|
||||||
return CrossHatchFilter.class;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Node[] createNodes(Object key, DataObject dataObject, boolean readOnly) {
|
|
||||||
return new Node[]{new JmeCrossHatchFilter((CrossHatchFilter) key, dataObject, readOnly)};
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,85 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2009-2010 jMonkeyEngine
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions are
|
|
||||||
* met:
|
|
||||||
*
|
|
||||||
* * Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* * Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
*
|
|
||||||
* * Neither the name of 'jMonkeyEngine' nor the names of its contributors
|
|
||||||
* may be used to endorse or promote products derived from this software
|
|
||||||
* without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
||||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
||||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
||||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
package com.jme3.gde.core.filters.impl;
|
|
||||||
|
|
||||||
import com.jme3.gde.core.filters.AbstractFilterNode;
|
|
||||||
import com.jme3.gde.core.filters.FilterNode;
|
|
||||||
import com.jme3.post.filters.DepthOfFieldFilter;
|
|
||||||
import org.openide.loaders.DataObject;
|
|
||||||
import org.openide.nodes.Node;
|
|
||||||
import org.openide.nodes.Sheet;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author normenhansen
|
|
||||||
*/
|
|
||||||
@org.openide.util.lookup.ServiceProvider(service = FilterNode.class)
|
|
||||||
public class JmeDepthOfFieldFilter extends AbstractFilterNode {
|
|
||||||
|
|
||||||
public JmeDepthOfFieldFilter() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public JmeDepthOfFieldFilter(DepthOfFieldFilter filter, DataObject object, boolean readOnly) {
|
|
||||||
super(filter);
|
|
||||||
this.dataObject = object;
|
|
||||||
this.readOnly = readOnly;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Sheet createSheet() {
|
|
||||||
Sheet sheet = super.createSheet();
|
|
||||||
Sheet.Set set = Sheet.createPropertiesSet();
|
|
||||||
set.setDisplayName("DepthOfField");
|
|
||||||
set.setName(Node.class.getName());
|
|
||||||
DepthOfFieldFilter obj = (DepthOfFieldFilter) filter;
|
|
||||||
if (obj == null) {
|
|
||||||
return sheet;
|
|
||||||
}
|
|
||||||
// set.put(makeProperty(obj, float.class, "getBlurScale", "setBlurScale", "Blur Scale"));
|
|
||||||
// set.put(makeProperty(obj, float.class, "getFocusDistance", "setFocusDistance", "Focus Distance"));
|
|
||||||
// set.put(makeProperty(obj, float.class, "getFocusRange", "setFocusRange", "Focus Range"));
|
|
||||||
createFields(DepthOfFieldFilter.class, set, obj);
|
|
||||||
sheet.put(set);
|
|
||||||
return sheet;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Class<?> getExplorerObjectClass() {
|
|
||||||
return DepthOfFieldFilter.class;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Node[] createNodes(Object key, DataObject dataObject, boolean readOnly) {
|
|
||||||
return new Node[]{new JmeDepthOfFieldFilter((DepthOfFieldFilter) key, dataObject, readOnly)};
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,86 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2009-2010 jMonkeyEngine
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions are
|
|
||||||
* met:
|
|
||||||
*
|
|
||||||
* * Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* * Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
*
|
|
||||||
* * Neither the name of 'jMonkeyEngine' nor the names of its contributors
|
|
||||||
* may be used to endorse or promote products derived from this software
|
|
||||||
* without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
||||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
||||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
||||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
package com.jme3.gde.core.filters.impl;
|
|
||||||
|
|
||||||
import com.jme3.gde.core.filters.AbstractFilterNode;
|
|
||||||
import com.jme3.gde.core.filters.FilterNode;
|
|
||||||
import com.jme3.post.filters.FXAAFilter;
|
|
||||||
import org.openide.loaders.DataObject;
|
|
||||||
import org.openide.nodes.Node;
|
|
||||||
import org.openide.nodes.Sheet;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author Rémy Bouquet
|
|
||||||
*/
|
|
||||||
@org.openide.util.lookup.ServiceProvider(service = FilterNode.class)
|
|
||||||
public class JmeFXAAFilter extends AbstractFilterNode {
|
|
||||||
|
|
||||||
public JmeFXAAFilter() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public JmeFXAAFilter(FXAAFilter filter, DataObject object, boolean readOnly) {
|
|
||||||
super(filter);
|
|
||||||
this.dataObject = object;
|
|
||||||
this.readOnly = readOnly;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Sheet createSheet() {
|
|
||||||
Sheet sheet = super.createSheet();
|
|
||||||
|
|
||||||
Sheet.Set set = Sheet.createPropertiesSet();
|
|
||||||
set.setDisplayName("FXAA");
|
|
||||||
set.setName("FXAA");
|
|
||||||
FXAAFilter obj = (FXAAFilter) filter;
|
|
||||||
|
|
||||||
if (obj == null) {
|
|
||||||
return sheet;
|
|
||||||
}
|
|
||||||
|
|
||||||
createFields(FXAAFilter.class, set, obj);
|
|
||||||
|
|
||||||
sheet.put(set);
|
|
||||||
return sheet;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Class<?> getExplorerObjectClass() {
|
|
||||||
return FXAAFilter.class;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Node[] createNodes(Object key, DataObject dataObject, boolean readOnly) {
|
|
||||||
return new Node[]{new JmeFXAAFilter((FXAAFilter) key, dataObject, readOnly)};
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2010 jMonkeyEngine
|
* Copyright (c) 2009-2016 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -33,22 +33,24 @@ package com.jme3.gde.core.filters.impl;
|
|||||||
|
|
||||||
import com.jme3.gde.core.filters.AbstractFilterNode;
|
import com.jme3.gde.core.filters.AbstractFilterNode;
|
||||||
import com.jme3.gde.core.filters.FilterNode;
|
import com.jme3.gde.core.filters.FilterNode;
|
||||||
import com.jme3.post.ssao.SSAOFilter;
|
import com.jme3.post.Filter;
|
||||||
import org.openide.loaders.DataObject;
|
import org.openide.loaders.DataObject;
|
||||||
import org.openide.nodes.Node;
|
import org.openide.nodes.Node;
|
||||||
import org.openide.nodes.Sheet;
|
import org.openide.nodes.Sheet;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Rémy Bouquet
|
* @author dokthar
|
||||||
*/
|
*/
|
||||||
@org.openide.util.lookup.ServiceProvider(service = FilterNode.class)
|
@org.openide.util.lookup.ServiceProvider(service = FilterNode.class)
|
||||||
public class JmeSSAOFilter extends AbstractFilterNode {
|
public class JmeFilter extends AbstractFilterNode {
|
||||||
|
|
||||||
public JmeSSAOFilter() {
|
|
||||||
|
public JmeFilter() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public JmeSSAOFilter(SSAOFilter filter, DataObject object, boolean readOnly) {
|
public JmeFilter(Filter filter, DataObject object, boolean readOnly) {
|
||||||
super(filter);
|
super(filter);
|
||||||
this.dataObject = object;
|
this.dataObject = object;
|
||||||
this.readOnly = readOnly;
|
this.readOnly = readOnly;
|
||||||
@ -57,18 +59,16 @@ public class JmeSSAOFilter extends AbstractFilterNode {
|
|||||||
@Override
|
@Override
|
||||||
protected Sheet createSheet() {
|
protected Sheet createSheet() {
|
||||||
Sheet sheet = super.createSheet();
|
Sheet sheet = super.createSheet();
|
||||||
|
|
||||||
Sheet.Set set = Sheet.createPropertiesSet();
|
Sheet.Set set = Sheet.createPropertiesSet();
|
||||||
set.setDisplayName("SSAO");
|
set.setDisplayName(filter.getName());
|
||||||
set.setName("SSAO");
|
set.setName(Node.class.getName());
|
||||||
SSAOFilter obj = (SSAOFilter) filter;
|
|
||||||
|
|
||||||
|
Filter obj = filter;
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
return sheet;
|
return sheet;
|
||||||
}
|
}
|
||||||
|
|
||||||
createFields(SSAOFilter.class, set, obj);
|
createFields(filter.getClass(), set, obj);
|
||||||
|
|
||||||
sheet.put(set);
|
sheet.put(set);
|
||||||
return sheet;
|
return sheet;
|
||||||
|
|
||||||
@ -76,11 +76,12 @@ public class JmeSSAOFilter extends AbstractFilterNode {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<?> getExplorerObjectClass() {
|
public Class<?> getExplorerObjectClass() {
|
||||||
return SSAOFilter.class;
|
return filter.getClass();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Node[] createNodes(Object key, DataObject dataObject, boolean readOnly) {
|
public Node[] createNodes(Object key, DataObject dataObject, boolean readOnly) {
|
||||||
return new Node[]{new JmeSSAOFilter((SSAOFilter) key, dataObject, readOnly)};
|
return new Node[]{new JmeFilter((Filter) key, dataObject, readOnly)};
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -1,85 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2009-2010 jMonkeyEngine
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions are
|
|
||||||
* met:
|
|
||||||
*
|
|
||||||
* * Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* * Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
*
|
|
||||||
* * Neither the name of 'jMonkeyEngine' nor the names of its contributors
|
|
||||||
* may be used to endorse or promote products derived from this software
|
|
||||||
* without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
||||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
||||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
||||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
package com.jme3.gde.core.filters.impl;
|
|
||||||
|
|
||||||
import com.jme3.gde.core.filters.AbstractFilterNode;
|
|
||||||
import com.jme3.gde.core.filters.FilterNode;
|
|
||||||
import com.jme3.post.filters.FogFilter;
|
|
||||||
import org.openide.loaders.DataObject;
|
|
||||||
import org.openide.nodes.Node;
|
|
||||||
import org.openide.nodes.Sheet;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author normenhansen
|
|
||||||
*/
|
|
||||||
@org.openide.util.lookup.ServiceProvider(service = FilterNode.class)
|
|
||||||
public class JmeFogFilter extends AbstractFilterNode {
|
|
||||||
|
|
||||||
public JmeFogFilter() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public JmeFogFilter(FogFilter filter, DataObject object, boolean readOnly) {
|
|
||||||
super(filter);
|
|
||||||
this.dataObject = object;
|
|
||||||
this.readOnly = readOnly;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Sheet createSheet() {
|
|
||||||
Sheet sheet = super.createSheet();
|
|
||||||
Sheet.Set set = Sheet.createPropertiesSet();
|
|
||||||
set.setDisplayName("Fog");
|
|
||||||
set.setName(Node.class.getName());
|
|
||||||
FogFilter obj = (FogFilter) filter;
|
|
||||||
if (obj == null) {
|
|
||||||
return sheet;
|
|
||||||
}
|
|
||||||
// set.put(makeProperty(obj, float.class, "getFogDistance", "setFogDistance", "Distance"));
|
|
||||||
// set.put(makeProperty(obj, float.class, "getFogDensity", "setFogDensity", "Density"));
|
|
||||||
// set.put(makeProperty(obj, ColorRGBA.class, "getFogColor", "setFogColor", "Color"));
|
|
||||||
createFields(FogFilter.class, set, obj);
|
|
||||||
sheet.put(set);
|
|
||||||
return sheet;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Class<?> getExplorerObjectClass() {
|
|
||||||
return FogFilter.class;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Node[] createNodes(Object key, DataObject dataObject, boolean readOnly) {
|
|
||||||
return new Node[]{new JmeFogFilter((FogFilter) key, dataObject, readOnly)};
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,88 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2009-2010 jMonkeyEngine
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions are
|
|
||||||
* met:
|
|
||||||
*
|
|
||||||
* * Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* * Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
*
|
|
||||||
* * Neither the name of 'jMonkeyEngine' nor the names of its contributors
|
|
||||||
* may be used to endorse or promote products derived from this software
|
|
||||||
* without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
||||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
||||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
||||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
package com.jme3.gde.core.filters.impl;
|
|
||||||
|
|
||||||
import com.jme3.gde.core.filters.AbstractFilterNode;
|
|
||||||
import com.jme3.gde.core.filters.FilterNode;
|
|
||||||
import com.jme3.post.filters.LightScatteringFilter;
|
|
||||||
import org.openide.loaders.DataObject;
|
|
||||||
import org.openide.nodes.Node;
|
|
||||||
import org.openide.nodes.Sheet;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author normenhansen
|
|
||||||
*/
|
|
||||||
@org.openide.util.lookup.ServiceProvider(service = FilterNode.class)
|
|
||||||
public class JmeLightScatteringFilter extends AbstractFilterNode {
|
|
||||||
|
|
||||||
public JmeLightScatteringFilter() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public JmeLightScatteringFilter(LightScatteringFilter filter, DataObject object, boolean readOnly) {
|
|
||||||
super(filter);
|
|
||||||
this.dataObject = object;
|
|
||||||
this.readOnly = readOnly;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Sheet createSheet() {
|
|
||||||
Sheet sheet = super.createSheet();
|
|
||||||
Sheet.Set set = Sheet.createPropertiesSet();
|
|
||||||
set.setDisplayName("Blur");
|
|
||||||
set.setName(Node.class.getName());
|
|
||||||
LightScatteringFilter obj = (LightScatteringFilter) filter;
|
|
||||||
if (obj == null) {
|
|
||||||
return sheet;
|
|
||||||
}
|
|
||||||
// set.put(makeProperty(obj, float.class, "getBlurStart", "setBlurStart", "Blur Start"));
|
|
||||||
// set.put(makeProperty(obj, float.class, "getBlurWidth", "setBlurWidth", "Blur Width"));
|
|
||||||
// set.put(makeProperty(obj, float.class, "getLightDensity", "setLightDensity", "Light Density"));
|
|
||||||
// set.put(makeProperty(obj, Vector3f.class, "getLightPosition", "setLightPosition", "Light Position"));
|
|
||||||
// set.put(makeProperty(obj, int.class, "getNbSamples", "setNbSamples", "Sample Number"));
|
|
||||||
|
|
||||||
createFields(LightScatteringFilter.class, set, obj);
|
|
||||||
sheet.put(set);
|
|
||||||
return sheet;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Class<?> getExplorerObjectClass() {
|
|
||||||
return LightScatteringFilter.class;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Node[] createNodes(Object key, DataObject dataObject, boolean readOnly) {
|
|
||||||
return new Node[]{new JmeLightScatteringFilter((LightScatteringFilter) key, dataObject, readOnly)};
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,85 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2009-2010 jMonkeyEngine
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions are
|
|
||||||
* met:
|
|
||||||
*
|
|
||||||
* * Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* * Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
*
|
|
||||||
* * Neither the name of 'jMonkeyEngine' nor the names of its contributors
|
|
||||||
* may be used to endorse or promote products derived from this software
|
|
||||||
* without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
||||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
||||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
||||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
package com.jme3.gde.core.filters.impl;
|
|
||||||
|
|
||||||
import com.jme3.gde.core.filters.AbstractFilterNode;
|
|
||||||
import com.jme3.gde.core.filters.FilterNode;
|
|
||||||
import com.jme3.post.filters.PosterizationFilter;
|
|
||||||
import org.openide.loaders.DataObject;
|
|
||||||
import org.openide.nodes.Node;
|
|
||||||
import org.openide.nodes.Sheet;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author normenhansen
|
|
||||||
*/
|
|
||||||
@org.openide.util.lookup.ServiceProvider(service = FilterNode.class)
|
|
||||||
public class JmePosterizationFilter extends AbstractFilterNode {
|
|
||||||
|
|
||||||
public JmePosterizationFilter() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public JmePosterizationFilter(PosterizationFilter filter, DataObject object, boolean readOnly) {
|
|
||||||
super(filter);
|
|
||||||
this.dataObject = object;
|
|
||||||
this.readOnly = readOnly;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Sheet createSheet() {
|
|
||||||
Sheet sheet = super.createSheet();
|
|
||||||
Sheet.Set set = Sheet.createPropertiesSet();
|
|
||||||
set.setDisplayName("Posterization");
|
|
||||||
set.setName(Node.class.getName());
|
|
||||||
PosterizationFilter obj = (PosterizationFilter) filter;
|
|
||||||
if (obj == null) {
|
|
||||||
return sheet;
|
|
||||||
}
|
|
||||||
// set.put(makeProperty(obj, float.class, "getGamma", "setGamma", "Gamma"));
|
|
||||||
// set.put(makeProperty(obj, int.class, "getNumColors", "setNumColors", "Color Number"));
|
|
||||||
// set.put(makeProperty(obj, float.class, "getStrength", "setStrength", "Strength"));
|
|
||||||
createFields(PosterizationFilter.class, set, obj);
|
|
||||||
sheet.put(set);
|
|
||||||
return sheet;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Class<?> getExplorerObjectClass() {
|
|
||||||
return PosterizationFilter.class;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Node[] createNodes(Object key, DataObject dataObject, boolean readOnly) {
|
|
||||||
return new Node[]{new JmePosterizationFilter((PosterizationFilter) key, dataObject, readOnly)};
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,86 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2009-2010 jMonkeyEngine
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions are
|
|
||||||
* met:
|
|
||||||
*
|
|
||||||
* * Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
*
|
|
||||||
* * Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
*
|
|
||||||
* * Neither the name of 'jMonkeyEngine' nor the names of its contributors
|
|
||||||
* may be used to endorse or promote products derived from this software
|
|
||||||
* without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
||||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
||||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
||||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
||||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
package com.jme3.gde.core.filters.impl;
|
|
||||||
|
|
||||||
import com.jme3.gde.core.filters.AbstractFilterNode;
|
|
||||||
import com.jme3.gde.core.filters.FilterNode;
|
|
||||||
import com.jme3.water.WaterFilter;
|
|
||||||
import org.openide.loaders.DataObject;
|
|
||||||
import org.openide.nodes.Node;
|
|
||||||
import org.openide.nodes.Sheet;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author Rémy Bouquet
|
|
||||||
*/
|
|
||||||
@org.openide.util.lookup.ServiceProvider(service = FilterNode.class)
|
|
||||||
public class JmeWaterFilter extends AbstractFilterNode {
|
|
||||||
|
|
||||||
public JmeWaterFilter() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public JmeWaterFilter(WaterFilter filter, DataObject object, boolean readOnly) {
|
|
||||||
super(filter);
|
|
||||||
this.dataObject = object;
|
|
||||||
this.readOnly = readOnly;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Sheet createSheet() {
|
|
||||||
Sheet sheet = super.createSheet();
|
|
||||||
|
|
||||||
Sheet.Set set = Sheet.createPropertiesSet();
|
|
||||||
set.setDisplayName("Water");
|
|
||||||
set.setName("Water");
|
|
||||||
WaterFilter obj = (WaterFilter) filter;
|
|
||||||
|
|
||||||
if (obj == null) {
|
|
||||||
return sheet;
|
|
||||||
}
|
|
||||||
|
|
||||||
createFields(WaterFilter.class, set, obj);
|
|
||||||
|
|
||||||
sheet.put(set);
|
|
||||||
return sheet;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Class<?> getExplorerObjectClass() {
|
|
||||||
return WaterFilter.class;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Node[] createNodes(Object key, DataObject dataObject, boolean readOnly) {
|
|
||||||
return new Node[]{new JmeWaterFilter((WaterFilter) key, dataObject, readOnly)};
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2010 jMonkeyEngine
|
* Copyright (c) 2009-2016 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -34,19 +34,13 @@ package com.jme3.gde.core.sceneexplorer.nodes;
|
|||||||
import com.jme3.animation.AnimControl;
|
import com.jme3.animation.AnimControl;
|
||||||
import com.jme3.gde.core.icons.IconList;
|
import com.jme3.gde.core.icons.IconList;
|
||||||
import com.jme3.gde.core.properties.AnimationProperty;
|
import com.jme3.gde.core.properties.AnimationProperty;
|
||||||
import com.jme3.gde.core.scene.SceneApplication;
|
|
||||||
import com.jme3.gde.core.sceneexplorer.nodes.actions.TrackVisibilityPopup;
|
import com.jme3.gde.core.sceneexplorer.nodes.actions.TrackVisibilityPopup;
|
||||||
import com.jme3.scene.Spatial;
|
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.concurrent.Callable;
|
|
||||||
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.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.HelpCtx;
|
import org.openide.util.HelpCtx;
|
||||||
import org.openide.util.actions.BooleanStateAction;
|
import org.openide.util.actions.BooleanStateAction;
|
||||||
import org.openide.util.actions.SystemAction;
|
import org.openide.util.actions.SystemAction;
|
||||||
@ -57,7 +51,7 @@ import org.openide.util.actions.SystemAction;
|
|||||||
*/
|
*/
|
||||||
@org.openide.util.lookup.ServiceProvider(service = SceneExplorerNode.class)
|
@org.openide.util.lookup.ServiceProvider(service = SceneExplorerNode.class)
|
||||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||||
public class JmeAnimControl extends AbstractSceneExplorerNode {
|
public class JmeAnimControl extends JmeControl {
|
||||||
|
|
||||||
private AnimControl animControl;
|
private AnimControl animControl;
|
||||||
private JmeAnimation playingAnimation = null;
|
private JmeAnimation playingAnimation = null;
|
||||||
@ -78,6 +72,7 @@ public class JmeAnimControl extends AbstractSceneExplorerNode {
|
|||||||
lookupContents.add(animControl);
|
lookupContents.add(animControl);
|
||||||
setName("AnimControl");
|
setName("AnimControl");
|
||||||
children.setAnimControl(this);
|
children.setAnimControl(this);
|
||||||
|
control = animControl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -130,30 +125,6 @@ public class JmeAnimControl extends AbstractSceneExplorerNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canDestroy() {
|
|
||||||
return !readOnly;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void destroy() throws IOException {
|
|
||||||
super.destroy();
|
|
||||||
final Spatial spat = getParentNode().getLookup().lookup(Spatial.class);
|
|
||||||
try {
|
|
||||||
SceneApplication.getApplication().enqueue(new Callable<Void>() {
|
|
||||||
|
|
||||||
public Void call() throws Exception {
|
|
||||||
spat.removeControl(animControl);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}).get();
|
|
||||||
((AbstractSceneExplorerNode) getParentNode()).refresh(true);
|
|
||||||
} catch (InterruptedException ex) {
|
|
||||||
Exceptions.printStackTrace(ex);
|
|
||||||
} catch (ExecutionException ex) {
|
|
||||||
Exceptions.printStackTrace(ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Class getExplorerObjectClass() {
|
public Class getExplorerObjectClass() {
|
||||||
return AnimControl.class;
|
return AnimControl.class;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2010 jMonkeyEngine
|
* Copyright (c) 2009-2016 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -34,21 +34,10 @@ package com.jme3.gde.core.sceneexplorer.nodes;
|
|||||||
import com.jme3.bullet.collision.shapes.CollisionShape;
|
import com.jme3.bullet.collision.shapes.CollisionShape;
|
||||||
import com.jme3.bullet.control.CharacterControl;
|
import com.jme3.bullet.control.CharacterControl;
|
||||||
import com.jme3.gde.core.icons.IconList;
|
import com.jme3.gde.core.icons.IconList;
|
||||||
import com.jme3.gde.core.scene.SceneApplication;
|
|
||||||
import com.jme3.math.Vector3f;
|
import com.jme3.math.Vector3f;
|
||||||
import com.jme3.scene.Spatial;
|
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.concurrent.Callable;
|
|
||||||
import java.util.concurrent.ExecutionException;
|
|
||||||
import javax.swing.Action;
|
|
||||||
import javax.swing.ImageIcon;
|
|
||||||
import org.openide.actions.DeleteAction;
|
|
||||||
import org.openide.loaders.DataObject;
|
import org.openide.loaders.DataObject;
|
||||||
import org.openide.nodes.Sheet;
|
import org.openide.nodes.Sheet;
|
||||||
import org.openide.util.Exceptions;
|
|
||||||
import org.openide.util.ImageUtilities;
|
|
||||||
import org.openide.util.actions.SystemAction;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -56,7 +45,7 @@ import org.openide.util.actions.SystemAction;
|
|||||||
*/
|
*/
|
||||||
@org.openide.util.lookup.ServiceProvider(service=SceneExplorerNode.class)
|
@org.openide.util.lookup.ServiceProvider(service=SceneExplorerNode.class)
|
||||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||||
public class JmeCharacterControl extends AbstractSceneExplorerNode {
|
public class JmeCharacterControl extends JmeControl {
|
||||||
|
|
||||||
private static Image smallImage = IconList.player.getImage();
|
private static Image smallImage = IconList.player.getImage();
|
||||||
private CharacterControl geom;
|
private CharacterControl geom;
|
||||||
@ -69,6 +58,7 @@ public class JmeCharacterControl extends AbstractSceneExplorerNode {
|
|||||||
getLookupContents().add(this);
|
getLookupContents().add(this);
|
||||||
getLookupContents().add(spatial);
|
getLookupContents().add(spatial);
|
||||||
this.geom = spatial;
|
this.geom = spatial;
|
||||||
|
control = spatial;
|
||||||
setName("CharacterControl");
|
setName("CharacterControl");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,41 +72,6 @@ public class JmeCharacterControl extends AbstractSceneExplorerNode {
|
|||||||
return smallImage;
|
return smallImage;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Action[] getActions(boolean context) {
|
|
||||||
return new SystemAction[]{
|
|
||||||
// SystemAction.get(CopyAction.class),
|
|
||||||
// SystemAction.get(CutAction.class),
|
|
||||||
// SystemAction.get(PasteAction.class),
|
|
||||||
SystemAction.get(DeleteAction.class)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canDestroy() {
|
|
||||||
return !readOnly;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void destroy() throws IOException {
|
|
||||||
super.destroy();
|
|
||||||
final Spatial spat=getParentNode().getLookup().lookup(Spatial.class);
|
|
||||||
try {
|
|
||||||
SceneApplication.getApplication().enqueue(new Callable<Void>() {
|
|
||||||
|
|
||||||
public Void call() throws Exception {
|
|
||||||
spat.removeControl(geom);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}).get();
|
|
||||||
((AbstractSceneExplorerNode)getParentNode()).refresh(true);
|
|
||||||
} catch (InterruptedException ex) {
|
|
||||||
Exceptions.printStackTrace(ex);
|
|
||||||
} catch (ExecutionException ex) {
|
|
||||||
Exceptions.printStackTrace(ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Sheet createSheet() {
|
protected Sheet createSheet() {
|
||||||
Sheet sheet = super.createSheet();
|
Sheet sheet = super.createSheet();
|
||||||
@ -145,6 +100,7 @@ public class JmeCharacterControl extends AbstractSceneExplorerNode {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Class getExplorerObjectClass() {
|
public Class getExplorerObjectClass() {
|
||||||
return CharacterControl.class;
|
return CharacterControl.class;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,123 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2009-2016 jMonkeyEngine
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are
|
||||||
|
* met:
|
||||||
|
*
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* * Neither the name of 'jMonkeyEngine' nor the names of its contributors
|
||||||
|
* may be used to endorse or promote products derived from this software
|
||||||
|
* without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||||
|
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||||
|
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||||
|
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||||
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
package com.jme3.gde.core.sceneexplorer.nodes;
|
||||||
|
|
||||||
|
import com.jme3.gde.core.scene.SceneApplication;
|
||||||
|
import com.jme3.scene.Spatial;
|
||||||
|
import com.jme3.scene.control.Control;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.concurrent.Callable;
|
||||||
|
import java.util.concurrent.ExecutionException;
|
||||||
|
import javax.swing.Action;
|
||||||
|
import org.openide.actions.DeleteAction;
|
||||||
|
import org.openide.loaders.DataObject;
|
||||||
|
import org.openide.nodes.Children;
|
||||||
|
import org.openide.nodes.Node;
|
||||||
|
import org.openide.util.Exceptions;
|
||||||
|
import org.openide.util.actions.SystemAction;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The JmeControl implements the Base Behavior of each Control-Node
|
||||||
|
* @author MeFisto94
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
public abstract class JmeControl extends AbstractSceneExplorerNode {
|
||||||
|
|
||||||
|
protected Control control;
|
||||||
|
public JmeControl() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public JmeControl(Children children, DataObject dataObject) {
|
||||||
|
super(children, dataObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
public JmeControl(DataObject dataObject) {
|
||||||
|
super(dataObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
public JmeControl(Children children) {
|
||||||
|
super(children);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Action[] getActions(boolean context) {
|
||||||
|
return new SystemAction[]{
|
||||||
|
// SystemAction.get(CopyAction.class),
|
||||||
|
// SystemAction.get(CutAction.class),
|
||||||
|
// SystemAction.get(PasteAction.class),
|
||||||
|
SystemAction.get(DeleteAction.class)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canDestroy() {
|
||||||
|
return !readOnly;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void destroy() throws IOException {
|
||||||
|
super.destroy();
|
||||||
|
|
||||||
|
if (control == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
final Spatial spat = getParentNode().getLookup().lookup(Spatial.class);
|
||||||
|
try {
|
||||||
|
fireSave(true);
|
||||||
|
SceneApplication.getApplication().enqueue(new Callable<Void>() {
|
||||||
|
|
||||||
|
public Void call() throws Exception {
|
||||||
|
spat.removeControl(control);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}).get();
|
||||||
|
((AbstractSceneExplorerNode) getParentNode()).refresh(true);
|
||||||
|
} catch (InterruptedException ex) {
|
||||||
|
Exceptions.printStackTrace(ex);
|
||||||
|
} catch (ExecutionException ex) {
|
||||||
|
Exceptions.printStackTrace(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Controls have a parental node containing them */
|
||||||
|
@Override
|
||||||
|
protected void fireSave(boolean modified) {
|
||||||
|
super.fireSave(true);
|
||||||
|
Node parent = getParentNode();
|
||||||
|
if (parent instanceof AbstractSceneExplorerNode) {
|
||||||
|
AbstractSceneExplorerNode par=(AbstractSceneExplorerNode)parent;
|
||||||
|
par.fireSave(modified);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2010 jMonkeyEngine
|
* Copyright (c) 2009-2016 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -32,29 +32,18 @@
|
|||||||
package com.jme3.gde.core.sceneexplorer.nodes;
|
package com.jme3.gde.core.sceneexplorer.nodes;
|
||||||
|
|
||||||
import com.jme3.gde.core.icons.IconList;
|
import com.jme3.gde.core.icons.IconList;
|
||||||
import com.jme3.gde.core.properties.ScenePropertyChangeListener;
|
|
||||||
import com.jme3.gde.core.scene.SceneApplication;
|
|
||||||
import com.jme3.scene.Spatial;
|
|
||||||
import com.jme3.scene.control.Control;
|
import com.jme3.scene.control.Control;
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.concurrent.Callable;
|
|
||||||
import java.util.concurrent.ExecutionException;
|
|
||||||
import javax.swing.Action;
|
|
||||||
import org.openide.actions.DeleteAction;
|
|
||||||
import org.openide.loaders.DataObject;
|
import org.openide.loaders.DataObject;
|
||||||
import org.openide.nodes.Sheet;
|
import org.openide.nodes.Sheet;
|
||||||
import org.openide.util.Exceptions;
|
|
||||||
import org.openide.util.actions.SystemAction;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author normenhansen
|
* @author normenhansen
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||||
public class JmeGenericControl extends AbstractSceneExplorerNode {
|
public class JmeGenericControl extends JmeControl {
|
||||||
|
|
||||||
private final Control control;
|
|
||||||
private static final Image smallImage = IconList.wheel.getImage();
|
private static final Image smallImage = IconList.wheel.getImage();
|
||||||
|
|
||||||
public JmeGenericControl(Control control, DataObject dataObject) {
|
public JmeGenericControl(Control control, DataObject dataObject) {
|
||||||
@ -63,6 +52,7 @@ public class JmeGenericControl extends AbstractSceneExplorerNode {
|
|||||||
this.control = control;
|
this.control = control;
|
||||||
addToLookup(this);
|
addToLookup(this);
|
||||||
addToLookup(control);
|
addToLookup(control);
|
||||||
|
this.control = control;
|
||||||
setName(control.getClass().getSimpleName());
|
setName(control.getClass().getSimpleName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,40 +101,12 @@ public class JmeGenericControl extends AbstractSceneExplorerNode {
|
|||||||
sheet.put(set);
|
sheet.put(set);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Action[] getActions(boolean context) {
|
|
||||||
return new SystemAction[]{
|
|
||||||
// SystemAction.get(CopyAction.class),
|
|
||||||
// SystemAction.get(CutAction.class),
|
|
||||||
// SystemAction.get(PasteAction.class),
|
|
||||||
SystemAction.get(DeleteAction.class)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canDestroy() {
|
public boolean canDestroy() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void destroy() throws IOException {
|
|
||||||
super.destroy();
|
|
||||||
final Spatial spat = getParentNode().getLookup().lookup(Spatial.class);
|
|
||||||
try {
|
|
||||||
SceneApplication.getApplication().enqueue(new Callable<Void>() {
|
|
||||||
public Void call() throws Exception {
|
|
||||||
spat.removeControl(control);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}).get();
|
|
||||||
((AbstractSceneExplorerNode) getParentNode()).refresh(true);
|
|
||||||
} catch (InterruptedException ex) {
|
|
||||||
Exceptions.printStackTrace(ex);
|
|
||||||
} catch (ExecutionException ex) {
|
|
||||||
Exceptions.printStackTrace(ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Class getExplorerObjectClass() {
|
public Class getExplorerObjectClass() {
|
||||||
return control.getClass();
|
return control.getClass();
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2010 jMonkeyEngine
|
* Copyright (c) 2009-2016 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -34,20 +34,11 @@ package com.jme3.gde.core.sceneexplorer.nodes;
|
|||||||
import com.jme3.bullet.collision.shapes.CollisionShape;
|
import com.jme3.bullet.collision.shapes.CollisionShape;
|
||||||
import com.jme3.bullet.control.GhostControl;
|
import com.jme3.bullet.control.GhostControl;
|
||||||
import com.jme3.gde.core.icons.IconList;
|
import com.jme3.gde.core.icons.IconList;
|
||||||
import com.jme3.gde.core.scene.SceneApplication;
|
|
||||||
import com.jme3.math.Quaternion;
|
import com.jme3.math.Quaternion;
|
||||||
import com.jme3.math.Vector3f;
|
import com.jme3.math.Vector3f;
|
||||||
import com.jme3.scene.Spatial;
|
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.concurrent.Callable;
|
|
||||||
import java.util.concurrent.ExecutionException;
|
|
||||||
import javax.swing.Action;
|
|
||||||
import org.openide.actions.DeleteAction;
|
|
||||||
import org.openide.loaders.DataObject;
|
import org.openide.loaders.DataObject;
|
||||||
import org.openide.nodes.Sheet;
|
import org.openide.nodes.Sheet;
|
||||||
import org.openide.util.Exceptions;
|
|
||||||
import org.openide.util.actions.SystemAction;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -55,7 +46,7 @@ import org.openide.util.actions.SystemAction;
|
|||||||
*/
|
*/
|
||||||
@org.openide.util.lookup.ServiceProvider(service=SceneExplorerNode.class)
|
@org.openide.util.lookup.ServiceProvider(service=SceneExplorerNode.class)
|
||||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||||
public class JmeGhostControl extends AbstractSceneExplorerNode {
|
public class JmeGhostControl extends JmeControl {
|
||||||
|
|
||||||
private static Image smallImage = IconList.ghostControl.getImage();
|
private static Image smallImage = IconList.ghostControl.getImage();
|
||||||
private GhostControl geom;
|
private GhostControl geom;
|
||||||
@ -68,6 +59,7 @@ public class JmeGhostControl extends AbstractSceneExplorerNode {
|
|||||||
getLookupContents().add(this);
|
getLookupContents().add(this);
|
||||||
getLookupContents().add(spatial);
|
getLookupContents().add(spatial);
|
||||||
this.geom = spatial;
|
this.geom = spatial;
|
||||||
|
control = spatial;
|
||||||
setName("GhostControl");
|
setName("GhostControl");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,41 +73,6 @@ public class JmeGhostControl extends AbstractSceneExplorerNode {
|
|||||||
return smallImage;
|
return smallImage;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Action[] getActions(boolean context) {
|
|
||||||
return new SystemAction[]{
|
|
||||||
// SystemAction.get(CopyAction.class),
|
|
||||||
// SystemAction.get(CutAction.class),
|
|
||||||
// SystemAction.get(PasteAction.class),
|
|
||||||
SystemAction.get(DeleteAction.class)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canDestroy() {
|
|
||||||
return !readOnly;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void destroy() throws IOException {
|
|
||||||
super.destroy();
|
|
||||||
final Spatial spat=getParentNode().getLookup().lookup(Spatial.class);
|
|
||||||
try {
|
|
||||||
SceneApplication.getApplication().enqueue(new Callable<Void>() {
|
|
||||||
|
|
||||||
public Void call() throws Exception {
|
|
||||||
spat.removeControl(geom);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}).get();
|
|
||||||
((AbstractSceneExplorerNode)getParentNode()).refresh(true);
|
|
||||||
} catch (InterruptedException ex) {
|
|
||||||
Exceptions.printStackTrace(ex);
|
|
||||||
} catch (ExecutionException ex) {
|
|
||||||
Exceptions.printStackTrace(ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Sheet createSheet() {
|
protected Sheet createSheet() {
|
||||||
Sheet sheet = super.createSheet();
|
Sheet sheet = super.createSheet();
|
||||||
@ -139,6 +96,7 @@ public class JmeGhostControl extends AbstractSceneExplorerNode {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Class getExplorerObjectClass() {
|
public Class getExplorerObjectClass() {
|
||||||
return GhostControl.class;
|
return GhostControl.class;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2010 jMonkeyEngine
|
* Copyright (c) 2009-2016 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -34,20 +34,11 @@ package com.jme3.gde.core.sceneexplorer.nodes;
|
|||||||
import com.jme3.bullet.collision.shapes.CollisionShape;
|
import com.jme3.bullet.collision.shapes.CollisionShape;
|
||||||
import com.jme3.bullet.control.RigidBodyControl;
|
import com.jme3.bullet.control.RigidBodyControl;
|
||||||
import com.jme3.gde.core.icons.IconList;
|
import com.jme3.gde.core.icons.IconList;
|
||||||
import com.jme3.gde.core.scene.SceneApplication;
|
|
||||||
import com.jme3.math.Quaternion;
|
import com.jme3.math.Quaternion;
|
||||||
import com.jme3.math.Vector3f;
|
import com.jme3.math.Vector3f;
|
||||||
import com.jme3.scene.Spatial;
|
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.concurrent.Callable;
|
|
||||||
import java.util.concurrent.ExecutionException;
|
|
||||||
import javax.swing.Action;
|
|
||||||
import org.openide.actions.DeleteAction;
|
|
||||||
import org.openide.loaders.DataObject;
|
import org.openide.loaders.DataObject;
|
||||||
import org.openide.nodes.Sheet;
|
import org.openide.nodes.Sheet;
|
||||||
import org.openide.util.Exceptions;
|
|
||||||
import org.openide.util.actions.SystemAction;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -55,7 +46,7 @@ import org.openide.util.actions.SystemAction;
|
|||||||
*/
|
*/
|
||||||
@org.openide.util.lookup.ServiceProvider(service=SceneExplorerNode.class)
|
@org.openide.util.lookup.ServiceProvider(service=SceneExplorerNode.class)
|
||||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||||
public class JmeRigidBodyControl extends AbstractSceneExplorerNode {
|
public class JmeRigidBodyControl extends JmeControl {
|
||||||
|
|
||||||
private static Image smallImage = IconList.physicsControl.getImage();
|
private static Image smallImage = IconList.physicsControl.getImage();
|
||||||
private RigidBodyControl geom;
|
private RigidBodyControl geom;
|
||||||
@ -68,6 +59,7 @@ public class JmeRigidBodyControl extends AbstractSceneExplorerNode {
|
|||||||
getLookupContents().add(spatial);
|
getLookupContents().add(spatial);
|
||||||
getLookupContents().add(this);
|
getLookupContents().add(this);
|
||||||
this.geom = spatial;
|
this.geom = spatial;
|
||||||
|
control = spatial;
|
||||||
setName("PhysicsControl");
|
setName("PhysicsControl");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,41 +73,6 @@ public class JmeRigidBodyControl extends AbstractSceneExplorerNode {
|
|||||||
return smallImage;
|
return smallImage;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Action[] getActions(boolean context) {
|
|
||||||
return new SystemAction[]{
|
|
||||||
// SystemAction.get(CopyAction.class),
|
|
||||||
// SystemAction.get(CutAction.class),
|
|
||||||
// SystemAction.get(PasteAction.class),
|
|
||||||
SystemAction.get(DeleteAction.class)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canDestroy() {
|
|
||||||
return !readOnly;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void destroy() throws IOException {
|
|
||||||
super.destroy();
|
|
||||||
final Spatial spat=getParentNode().getLookup().lookup(Spatial.class);
|
|
||||||
try {
|
|
||||||
SceneApplication.getApplication().enqueue(new Callable<Void>() {
|
|
||||||
|
|
||||||
public Void call() throws Exception {
|
|
||||||
spat.removeControl(geom);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}).get();
|
|
||||||
((AbstractSceneExplorerNode)getParentNode()).refresh(true);
|
|
||||||
} catch (InterruptedException ex) {
|
|
||||||
Exceptions.printStackTrace(ex);
|
|
||||||
} catch (ExecutionException ex) {
|
|
||||||
Exceptions.printStackTrace(ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Sheet createSheet() {
|
protected Sheet createSheet() {
|
||||||
Sheet sheet = super.createSheet();
|
Sheet sheet = super.createSheet();
|
||||||
@ -150,6 +107,7 @@ public class JmeRigidBodyControl extends AbstractSceneExplorerNode {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Class getExplorerObjectClass() {
|
public Class getExplorerObjectClass() {
|
||||||
return RigidBodyControl.class;
|
return RigidBodyControl.class;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2010 jMonkeyEngine
|
* Copyright (c) 2009-2016 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -33,19 +33,10 @@ package com.jme3.gde.core.sceneexplorer.nodes;
|
|||||||
|
|
||||||
import com.jme3.animation.SkeletonControl;
|
import com.jme3.animation.SkeletonControl;
|
||||||
import com.jme3.gde.core.icons.IconList;
|
import com.jme3.gde.core.icons.IconList;
|
||||||
import com.jme3.gde.core.scene.SceneApplication;
|
|
||||||
import com.jme3.scene.Spatial;
|
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.concurrent.Callable;
|
|
||||||
import java.util.concurrent.ExecutionException;
|
|
||||||
import javax.swing.Action;
|
|
||||||
import org.openide.actions.DeleteAction;
|
|
||||||
import org.openide.loaders.DataObject;
|
import org.openide.loaders.DataObject;
|
||||||
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.actions.SystemAction;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -53,7 +44,7 @@ import org.openide.util.actions.SystemAction;
|
|||||||
*/
|
*/
|
||||||
@org.openide.util.lookup.ServiceProvider(service = SceneExplorerNode.class)
|
@org.openide.util.lookup.ServiceProvider(service = SceneExplorerNode.class)
|
||||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||||
public class JmeSkeletonControl extends AbstractSceneExplorerNode {
|
public class JmeSkeletonControl extends JmeControl {
|
||||||
|
|
||||||
private SkeletonControl skeletonControl;
|
private SkeletonControl skeletonControl;
|
||||||
private static Image smallImage = IconList.skeletonControl.getImage();
|
private static Image smallImage = IconList.skeletonControl.getImage();
|
||||||
@ -64,6 +55,7 @@ public class JmeSkeletonControl extends AbstractSceneExplorerNode {
|
|||||||
public JmeSkeletonControl(SkeletonControl skeletonControl, JmeBoneChildren children) {
|
public JmeSkeletonControl(SkeletonControl skeletonControl, JmeBoneChildren children) {
|
||||||
super(children);
|
super(children);
|
||||||
this.skeletonControl = skeletonControl;
|
this.skeletonControl = skeletonControl;
|
||||||
|
control = skeletonControl;
|
||||||
lookupContents.add(this);
|
lookupContents.add(this);
|
||||||
lookupContents.add(skeletonControl);
|
lookupContents.add(skeletonControl);
|
||||||
setName("SkeletonControl");
|
setName("SkeletonControl");
|
||||||
@ -99,40 +91,6 @@ public class JmeSkeletonControl extends AbstractSceneExplorerNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Action[] getActions(boolean context) {
|
|
||||||
return new SystemAction[]{
|
|
||||||
// SystemAction.get(CopyAction.class),
|
|
||||||
// SystemAction.get(CutAction.class),
|
|
||||||
// SystemAction.get(PasteAction.class),
|
|
||||||
SystemAction.get(DeleteAction.class)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canDestroy() {
|
|
||||||
return !readOnly;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void destroy() throws IOException {
|
|
||||||
super.destroy();
|
|
||||||
final Spatial spat = getParentNode().getLookup().lookup(Spatial.class);
|
|
||||||
try {
|
|
||||||
SceneApplication.getApplication().enqueue(new Callable<Void>() {
|
|
||||||
|
|
||||||
public Void call() throws Exception {
|
|
||||||
spat.removeControl(skeletonControl);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}).get();
|
|
||||||
((AbstractSceneExplorerNode) getParentNode()).refresh(true);
|
|
||||||
} catch (InterruptedException ex) {
|
|
||||||
Exceptions.printStackTrace(ex);
|
|
||||||
} catch (ExecutionException ex) {
|
|
||||||
Exceptions.printStackTrace(ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Class getExplorerObjectClass() {
|
public Class getExplorerObjectClass() {
|
||||||
return SkeletonControl.class;
|
return SkeletonControl.class;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2010 jMonkeyEngine
|
* Copyright (c) 2009-2016 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -34,12 +34,10 @@ package com.jme3.gde.core.sceneexplorer.nodes;
|
|||||||
|
|
||||||
import com.jme3.gde.core.icons.IconList;
|
import com.jme3.gde.core.icons.IconList;
|
||||||
import com.jme3.gde.core.scene.SceneApplication;
|
import com.jme3.gde.core.scene.SceneApplication;
|
||||||
import com.jme3.scene.Spatial;
|
|
||||||
import com.jme3.terrain.geomipmap.TerrainLodControl;
|
import com.jme3.terrain.geomipmap.TerrainLodControl;
|
||||||
import com.jme3.terrain.geomipmap.lodcalc.DistanceLodCalculator;
|
import com.jme3.terrain.geomipmap.lodcalc.DistanceLodCalculator;
|
||||||
import com.jme3.terrain.geomipmap.lodcalc.PerspectiveLodCalculator;
|
import com.jme3.terrain.geomipmap.lodcalc.PerspectiveLodCalculator;
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
@ -58,7 +56,7 @@ import org.openide.util.actions.SystemAction;
|
|||||||
*/
|
*/
|
||||||
@org.openide.util.lookup.ServiceProvider(service=SceneExplorerNode.class)
|
@org.openide.util.lookup.ServiceProvider(service=SceneExplorerNode.class)
|
||||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||||
public class JmeTerrainLodControl extends AbstractSceneExplorerNode {
|
public class JmeTerrainLodControl extends JmeControl {
|
||||||
|
|
||||||
private static Image smallImage = IconList.wheel.getImage();
|
private static Image smallImage = IconList.wheel.getImage();
|
||||||
private TerrainLodControl terrainLodControl;
|
private TerrainLodControl terrainLodControl;
|
||||||
@ -71,6 +69,7 @@ public class JmeTerrainLodControl extends AbstractSceneExplorerNode {
|
|||||||
getLookupContents().add(control);
|
getLookupContents().add(control);
|
||||||
getLookupContents().add(this);
|
getLookupContents().add(this);
|
||||||
this.terrainLodControl = control;
|
this.terrainLodControl = control;
|
||||||
|
this.control = control;
|
||||||
setName("TerrainLodControl");
|
setName("TerrainLodControl");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,31 +93,6 @@ public class JmeTerrainLodControl extends AbstractSceneExplorerNode {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canDestroy() {
|
|
||||||
return !readOnly;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void destroy() throws IOException {
|
|
||||||
super.destroy();
|
|
||||||
final Spatial spat = getParentNode().getLookup().lookup(Spatial.class);
|
|
||||||
try {
|
|
||||||
SceneApplication.getApplication().enqueue(new Callable<Void>() {
|
|
||||||
|
|
||||||
public Void call() throws Exception {
|
|
||||||
spat.removeControl(terrainLodControl);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}).get();
|
|
||||||
((AbstractSceneExplorerNode) getParentNode()).refresh(true);
|
|
||||||
} catch (InterruptedException ex) {
|
|
||||||
Exceptions.printStackTrace(ex);
|
|
||||||
} catch (ExecutionException ex) {
|
|
||||||
Exceptions.printStackTrace(ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Sheet createSheet() {
|
protected Sheet createSheet() {
|
||||||
Sheet sheet = super.createSheet();
|
Sheet sheet = super.createSheet();
|
||||||
@ -137,6 +111,7 @@ public class JmeTerrainLodControl extends AbstractSceneExplorerNode {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Class getExplorerObjectClass() {
|
public Class getExplorerObjectClass() {
|
||||||
return TerrainLodControl.class;
|
return TerrainLodControl.class;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009-2010 jMonkeyEngine
|
* Copyright (c) 2009-2016 jMonkeyEngine
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -38,9 +38,7 @@ import com.jme3.gde.core.icons.IconList;
|
|||||||
import com.jme3.gde.core.scene.SceneApplication;
|
import com.jme3.gde.core.scene.SceneApplication;
|
||||||
import com.jme3.math.Quaternion;
|
import com.jme3.math.Quaternion;
|
||||||
import com.jme3.math.Vector3f;
|
import com.jme3.math.Vector3f;
|
||||||
import com.jme3.scene.Spatial;
|
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
import java.io.IOException;
|
|
||||||
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;
|
||||||
@ -60,7 +58,7 @@ import org.openide.util.actions.SystemAction;
|
|||||||
*/
|
*/
|
||||||
@org.openide.util.lookup.ServiceProvider(service = SceneExplorerNode.class)
|
@org.openide.util.lookup.ServiceProvider(service = SceneExplorerNode.class)
|
||||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||||
public class JmeVehicleControl extends AbstractSceneExplorerNode {
|
public class JmeVehicleControl extends JmeControl {
|
||||||
|
|
||||||
private static Image smallImage = IconList.vehicle.getImage();
|
private static Image smallImage = IconList.vehicle.getImage();
|
||||||
private VehicleControl vehicle;
|
private VehicleControl vehicle;
|
||||||
@ -73,6 +71,7 @@ public class JmeVehicleControl extends AbstractSceneExplorerNode {
|
|||||||
getLookupContents().add(vehicle);
|
getLookupContents().add(vehicle);
|
||||||
getLookupContents().add(this);
|
getLookupContents().add(this);
|
||||||
this.vehicle = vehicle;
|
this.vehicle = vehicle;
|
||||||
|
control = vehicle;
|
||||||
setName("VehicleControl");
|
setName("VehicleControl");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,41 +85,6 @@ public class JmeVehicleControl extends AbstractSceneExplorerNode {
|
|||||||
return smallImage;
|
return smallImage;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Action[] getActions(boolean context) {
|
|
||||||
return new SystemAction[]{
|
|
||||||
// SystemAction.get(CopyAction.class),
|
|
||||||
// SystemAction.get(CutAction.class),
|
|
||||||
// SystemAction.get(PasteAction.class),
|
|
||||||
SystemAction.get(DeleteAction.class)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canDestroy() {
|
|
||||||
return !readOnly;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void destroy() throws IOException {
|
|
||||||
super.destroy();
|
|
||||||
final Spatial spat = getParentNode().getLookup().lookup(Spatial.class);
|
|
||||||
try {
|
|
||||||
SceneApplication.getApplication().enqueue(new Callable<Void>() {
|
|
||||||
|
|
||||||
public Void call() throws Exception {
|
|
||||||
spat.removeControl(vehicle);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}).get();
|
|
||||||
((AbstractSceneExplorerNode) getParentNode()).refresh(true);
|
|
||||||
} catch (InterruptedException ex) {
|
|
||||||
Exceptions.printStackTrace(ex);
|
|
||||||
} catch (ExecutionException ex) {
|
|
||||||
Exceptions.printStackTrace(ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Sheet createSheet() {
|
protected Sheet createSheet() {
|
||||||
Sheet sheet = super.createSheet();
|
Sheet sheet = super.createSheet();
|
||||||
@ -162,6 +126,7 @@ public class JmeVehicleControl extends AbstractSceneExplorerNode {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Class getExplorerObjectClass() {
|
public Class getExplorerObjectClass() {
|
||||||
return VehicleControl.class;
|
return VehicleControl.class;
|
||||||
}
|
}
|
||||||
|
@ -272,6 +272,11 @@ public final class MatDefEditorlElement extends JPanel implements MultiViewEleme
|
|||||||
|
|
||||||
protected void selectionChanged(Selectable selectable) {
|
protected void selectionChanged(Selectable selectable) {
|
||||||
MatDefNavigatorPanel nav = obj.getLookup().lookup(MatDefNavigatorPanel.class);
|
MatDefNavigatorPanel nav = obj.getLookup().lookup(MatDefNavigatorPanel.class);
|
||||||
|
//It's possible that the navigator is null if it's collapsed in the ui.
|
||||||
|
//In that case we early return to avoid further issues
|
||||||
|
if(nav == null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
Node n = findNode(nav.getExplorerManager().getRootContext(), selectable.getKey());
|
Node n = findNode(nav.getExplorerManager().getRootContext(), selectable.getKey());
|
||||||
if (n == null) {
|
if (n == null) {
|
||||||
|
@ -38,7 +38,7 @@ persistenceType = TopComponent.PERSISTENCE_ALWAYS)
|
|||||||
@ActionID(category = "Window", id = "com.jme3.gde.welcome.WelcomeScreenTopComponent")
|
@ActionID(category = "Window", id = "com.jme3.gde.welcome.WelcomeScreenTopComponent")
|
||||||
@ActionReference(path = "Menu/Window" /*, position = 333 */)
|
@ActionReference(path = "Menu/Window" /*, position = 333 */)
|
||||||
@TopComponent.OpenActionRegistration(
|
@TopComponent.OpenActionRegistration(
|
||||||
displayName = "#CTL_WelcomeScreenAction",
|
displayName = "CTL_WelcomeScreenAction", /* No # since it's not part of the Bundles.properties. See http://bits.netbeans.org/dev/javadoc/org-openide-awt/org/openide/awt/ActionRegistration.html#displayName-- */
|
||||||
preferredID = "WelcomeScreenTopComponent")
|
preferredID = "WelcomeScreenTopComponent")
|
||||||
@Messages({
|
@Messages({
|
||||||
"CTL_WelcomeScreenAction=Info Screen",
|
"CTL_WelcomeScreenAction=Info Screen",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user