Fixed the Issue where removing a Control didn't set the dirty flag (made the Model Savable)
This commit is contained in:
parent
f4098ce89c
commit
2297520cf7
@ -129,6 +129,15 @@ public class JmeAnimControl extends AbstractSceneExplorerNode {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void fireSave(boolean modified) {
|
||||||
|
Node parent = getParentNode();
|
||||||
|
if (parent instanceof AbstractSceneExplorerNode) {
|
||||||
|
AbstractSceneExplorerNode par=(AbstractSceneExplorerNode)parent;
|
||||||
|
par.fireSave(modified);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canDestroy() {
|
public boolean canDestroy() {
|
||||||
return !readOnly;
|
return !readOnly;
|
||||||
@ -139,6 +148,7 @@ public class JmeAnimControl extends AbstractSceneExplorerNode {
|
|||||||
super.destroy();
|
super.destroy();
|
||||||
final Spatial spat = getParentNode().getLookup().lookup(Spatial.class);
|
final Spatial spat = getParentNode().getLookup().lookup(Spatial.class);
|
||||||
try {
|
try {
|
||||||
|
fireSave(true);
|
||||||
SceneApplication.getApplication().enqueue(new Callable<Void>() {
|
SceneApplication.getApplication().enqueue(new Callable<Void>() {
|
||||||
|
|
||||||
public Void call() throws Exception {
|
public Void call() throws Exception {
|
||||||
|
@ -42,12 +42,11 @@ import java.io.IOException;
|
|||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
import javax.swing.Action;
|
import javax.swing.Action;
|
||||||
import javax.swing.ImageIcon;
|
|
||||||
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.Sheet;
|
import org.openide.nodes.Sheet;
|
||||||
import org.openide.util.Exceptions;
|
import org.openide.util.Exceptions;
|
||||||
import org.openide.util.ImageUtilities;
|
|
||||||
import org.openide.util.actions.SystemAction;
|
import org.openide.util.actions.SystemAction;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -92,6 +91,15 @@ public class JmeCharacterControl extends AbstractSceneExplorerNode {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void fireSave(boolean modified) {
|
||||||
|
Node parent = getParentNode();
|
||||||
|
if (parent instanceof AbstractSceneExplorerNode) {
|
||||||
|
AbstractSceneExplorerNode par=(AbstractSceneExplorerNode)parent;
|
||||||
|
par.fireSave(modified);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canDestroy() {
|
public boolean canDestroy() {
|
||||||
return !readOnly;
|
return !readOnly;
|
||||||
@ -102,6 +110,7 @@ public class JmeCharacterControl extends AbstractSceneExplorerNode {
|
|||||||
super.destroy();
|
super.destroy();
|
||||||
final Spatial spat=getParentNode().getLookup().lookup(Spatial.class);
|
final Spatial spat=getParentNode().getLookup().lookup(Spatial.class);
|
||||||
try {
|
try {
|
||||||
|
fireSave(true);
|
||||||
SceneApplication.getApplication().enqueue(new Callable<Void>() {
|
SceneApplication.getApplication().enqueue(new Callable<Void>() {
|
||||||
|
|
||||||
public Void call() throws Exception {
|
public Void call() throws Exception {
|
||||||
|
@ -32,7 +32,6 @@
|
|||||||
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.gde.core.scene.SceneApplication;
|
||||||
import com.jme3.scene.Spatial;
|
import com.jme3.scene.Spatial;
|
||||||
import com.jme3.scene.control.Control;
|
import com.jme3.scene.control.Control;
|
||||||
@ -43,6 +42,7 @@ 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.Sheet;
|
import org.openide.nodes.Sheet;
|
||||||
import org.openide.util.Exceptions;
|
import org.openide.util.Exceptions;
|
||||||
import org.openide.util.actions.SystemAction;
|
import org.openide.util.actions.SystemAction;
|
||||||
@ -121,6 +121,15 @@ public class JmeGenericControl extends AbstractSceneExplorerNode {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void fireSave(boolean modified) {
|
||||||
|
Node parent = getParentNode();
|
||||||
|
if (parent instanceof AbstractSceneExplorerNode) {
|
||||||
|
AbstractSceneExplorerNode par=(AbstractSceneExplorerNode)parent;
|
||||||
|
par.fireSave(modified);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canDestroy() {
|
public boolean canDestroy() {
|
||||||
return true;
|
return true;
|
||||||
@ -131,6 +140,7 @@ public class JmeGenericControl extends AbstractSceneExplorerNode {
|
|||||||
super.destroy();
|
super.destroy();
|
||||||
final Spatial spat = getParentNode().getLookup().lookup(Spatial.class);
|
final Spatial spat = getParentNode().getLookup().lookup(Spatial.class);
|
||||||
try {
|
try {
|
||||||
|
fireSave(true);
|
||||||
SceneApplication.getApplication().enqueue(new Callable<Void>() {
|
SceneApplication.getApplication().enqueue(new Callable<Void>() {
|
||||||
public Void call() throws Exception {
|
public Void call() throws Exception {
|
||||||
spat.removeControl(control);
|
spat.removeControl(control);
|
||||||
|
@ -45,6 +45,7 @@ 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.Sheet;
|
import org.openide.nodes.Sheet;
|
||||||
import org.openide.util.Exceptions;
|
import org.openide.util.Exceptions;
|
||||||
import org.openide.util.actions.SystemAction;
|
import org.openide.util.actions.SystemAction;
|
||||||
@ -91,6 +92,15 @@ public class JmeGhostControl extends AbstractSceneExplorerNode {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void fireSave(boolean modified) {
|
||||||
|
Node parent = getParentNode();
|
||||||
|
if (parent instanceof AbstractSceneExplorerNode) {
|
||||||
|
AbstractSceneExplorerNode par=(AbstractSceneExplorerNode)parent;
|
||||||
|
par.fireSave(modified);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canDestroy() {
|
public boolean canDestroy() {
|
||||||
return !readOnly;
|
return !readOnly;
|
||||||
@ -101,6 +111,7 @@ public class JmeGhostControl extends AbstractSceneExplorerNode {
|
|||||||
super.destroy();
|
super.destroy();
|
||||||
final Spatial spat=getParentNode().getLookup().lookup(Spatial.class);
|
final Spatial spat=getParentNode().getLookup().lookup(Spatial.class);
|
||||||
try {
|
try {
|
||||||
|
fireSave(true);
|
||||||
SceneApplication.getApplication().enqueue(new Callable<Void>() {
|
SceneApplication.getApplication().enqueue(new Callable<Void>() {
|
||||||
|
|
||||||
public Void call() throws Exception {
|
public Void call() throws Exception {
|
||||||
|
@ -45,6 +45,7 @@ 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.Sheet;
|
import org.openide.nodes.Sheet;
|
||||||
import org.openide.util.Exceptions;
|
import org.openide.util.Exceptions;
|
||||||
import org.openide.util.actions.SystemAction;
|
import org.openide.util.actions.SystemAction;
|
||||||
@ -91,6 +92,15 @@ public class JmeRigidBodyControl extends AbstractSceneExplorerNode {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void fireSave(boolean modified) {
|
||||||
|
Node parent = getParentNode();
|
||||||
|
if (parent instanceof AbstractSceneExplorerNode) {
|
||||||
|
AbstractSceneExplorerNode par=(AbstractSceneExplorerNode)parent;
|
||||||
|
par.fireSave(modified);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canDestroy() {
|
public boolean canDestroy() {
|
||||||
return !readOnly;
|
return !readOnly;
|
||||||
@ -101,6 +111,7 @@ public class JmeRigidBodyControl extends AbstractSceneExplorerNode {
|
|||||||
super.destroy();
|
super.destroy();
|
||||||
final Spatial spat=getParentNode().getLookup().lookup(Spatial.class);
|
final Spatial spat=getParentNode().getLookup().lookup(Spatial.class);
|
||||||
try {
|
try {
|
||||||
|
fireSave(true);
|
||||||
SceneApplication.getApplication().enqueue(new Callable<Void>() {
|
SceneApplication.getApplication().enqueue(new Callable<Void>() {
|
||||||
|
|
||||||
public Void call() throws Exception {
|
public Void call() throws Exception {
|
||||||
|
@ -108,6 +108,15 @@ public class JmeSkeletonControl extends AbstractSceneExplorerNode {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void fireSave(boolean modified) {
|
||||||
|
Node parent = getParentNode();
|
||||||
|
if (parent instanceof AbstractSceneExplorerNode) {
|
||||||
|
AbstractSceneExplorerNode par=(AbstractSceneExplorerNode)parent;
|
||||||
|
par.fireSave(modified);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canDestroy() {
|
public boolean canDestroy() {
|
||||||
return !readOnly;
|
return !readOnly;
|
||||||
@ -118,6 +127,7 @@ public class JmeSkeletonControl extends AbstractSceneExplorerNode {
|
|||||||
super.destroy();
|
super.destroy();
|
||||||
final Spatial spat = getParentNode().getLookup().lookup(Spatial.class);
|
final Spatial spat = getParentNode().getLookup().lookup(Spatial.class);
|
||||||
try {
|
try {
|
||||||
|
fireSave(true);
|
||||||
SceneApplication.getApplication().enqueue(new Callable<Void>() {
|
SceneApplication.getApplication().enqueue(new Callable<Void>() {
|
||||||
|
|
||||||
public Void call() throws Exception {
|
public Void call() throws Exception {
|
||||||
|
@ -94,6 +94,15 @@ public class JmeTerrainLodControl extends AbstractSceneExplorerNode {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void fireSave(boolean modified) {
|
||||||
|
Node parent = getParentNode();
|
||||||
|
if (parent instanceof AbstractSceneExplorerNode) {
|
||||||
|
AbstractSceneExplorerNode par=(AbstractSceneExplorerNode)parent;
|
||||||
|
par.fireSave(modified);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canDestroy() {
|
public boolean canDestroy() {
|
||||||
return !readOnly;
|
return !readOnly;
|
||||||
@ -104,6 +113,7 @@ public class JmeTerrainLodControl extends AbstractSceneExplorerNode {
|
|||||||
super.destroy();
|
super.destroy();
|
||||||
final Spatial spat = getParentNode().getLookup().lookup(Spatial.class);
|
final Spatial spat = getParentNode().getLookup().lookup(Spatial.class);
|
||||||
try {
|
try {
|
||||||
|
fireSave(true);
|
||||||
SceneApplication.getApplication().enqueue(new Callable<Void>() {
|
SceneApplication.getApplication().enqueue(new Callable<Void>() {
|
||||||
|
|
||||||
public Void call() throws Exception {
|
public Void call() throws Exception {
|
||||||
|
@ -96,6 +96,15 @@ public class JmeVehicleControl extends AbstractSceneExplorerNode {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void fireSave(boolean modified) {
|
||||||
|
Node parent = getParentNode();
|
||||||
|
if (parent instanceof AbstractSceneExplorerNode) {
|
||||||
|
AbstractSceneExplorerNode par=(AbstractSceneExplorerNode)parent;
|
||||||
|
par.fireSave(modified);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canDestroy() {
|
public boolean canDestroy() {
|
||||||
return !readOnly;
|
return !readOnly;
|
||||||
@ -106,6 +115,7 @@ public class JmeVehicleControl extends AbstractSceneExplorerNode {
|
|||||||
super.destroy();
|
super.destroy();
|
||||||
final Spatial spat = getParentNode().getLookup().lookup(Spatial.class);
|
final Spatial spat = getParentNode().getLookup().lookup(Spatial.class);
|
||||||
try {
|
try {
|
||||||
|
fireSave(true);
|
||||||
SceneApplication.getApplication().enqueue(new Callable<Void>() {
|
SceneApplication.getApplication().enqueue(new Callable<Void>() {
|
||||||
|
|
||||||
public Void call() throws Exception {
|
public Void call() throws Exception {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user