- fix some warnings and deprecations

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7744 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 14 years ago
parent 09ef641d09
commit fc04902c30
  1. 12
      sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/AssetPackLoader.java
  2. 1
      sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/project/actions/ConvertOgreBinaryMeshesAction.java
  3. 1
      sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/project/actions/ImportAssetAction.java
  4. 1
      sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/project/actions/PublishAssetPackAction.java
  5. 2
      sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/LinkSceneComposer.java
  6. 2
      sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/OpenSceneComposer.java
  7. 3
      sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/SceneComposerTopComponent.java
  8. 4
      sdk/jme3-scenecomposer/src/com/jme3/gde/scenecomposer/SceneEditorController.java

@ -171,19 +171,19 @@ public class AssetPackLoader {
String path = fileElem.getAttribute("path"); String path = fileElem.getAttribute("path");
if ("material".equals(type) && (materialName == null || materialName.equals(path))) { if ("material".equals(type) && (materialName == null || materialName.equals(path))) {
if (hasExtension(path, "j3m")) { if (hasExtension(path, "j3m")) {
mat = pm.getManager().loadMaterial(path); mat = pm.loadMaterial(path);
} else if (hasExtension(path, "material")) { } else if (hasExtension(path, "material")) {
if (matList == null) { if (matList == null) {
Logger.getLogger(AssetPackLoader.class.getName()).log(Level.INFO, "Load Ogre Material"); Logger.getLogger(AssetPackLoader.class.getName()).log(Level.INFO, "Load Ogre Material");
OgreMaterialKey matKey = new OgreMaterialKey(path); OgreMaterialKey matKey = new OgreMaterialKey(path);
matKey.setMaterialExtensionSet(matExts); matKey.setMaterialExtensionSet(matExts);
matList = pm.getManager().loadAsset(matKey); matList = pm.loadAsset(matKey);
key = new OgreMeshKey(name, matList); key = new OgreMeshKey(name, matList);
} else { } else {
Logger.getLogger(AssetPackLoader.class.getName()).log(Level.INFO, "Add Ogre Material"); Logger.getLogger(AssetPackLoader.class.getName()).log(Level.INFO, "Add Ogre Material");
OgreMaterialKey matKey = new OgreMaterialKey(path); OgreMaterialKey matKey = new OgreMaterialKey(path);
matKey.setMaterialExtensionSet(matExts); matKey.setMaterialExtensionSet(matExts);
MaterialList newMatList = pm.getManager().loadAsset(matKey); MaterialList newMatList = pm.loadAsset(matKey);
matList.putAll(newMatList); matList.putAll(newMatList);
} }
} }
@ -196,7 +196,7 @@ public class AssetPackLoader {
String path = fileElem.getAttribute("path"); String path = fileElem.getAttribute("path");
if ("material".equals(type) && (materialName == null || materialName.equals(path))) { if ("material".equals(type) && (materialName == null || materialName.equals(path))) {
if (hasExtension(path, "j3m")) { if (hasExtension(path, "j3m")) {
mat = pm.getManager().loadMaterial(path); mat = pm.loadMaterial(path);
} }
} }
} }
@ -207,9 +207,9 @@ public class AssetPackLoader {
Logger.getLogger(AddAssetAction.class.getName()).log(Level.WARNING, "j3m and ogre material defined for asset {0}.", name); Logger.getLogger(AddAssetAction.class.getName()).log(Level.WARNING, "j3m and ogre material defined for asset {0}.", name);
} }
if (key != null) { if (key != null) {
model = pm.getManager().loadAsset(key); model = pm.loadAsset(key);
} else { } else {
model = pm.getManager().loadModel(name); model = pm.loadModel(name);
} }
if (model == null) { if (model == null) {
Logger.getLogger(AddAssetAction.class.getName()).log(Level.SEVERE, "Could not load model {0}!", name); Logger.getLogger(AddAssetAction.class.getName()).log(Level.SEVERE, "Could not load model {0}!", name);

@ -26,6 +26,7 @@ import org.openide.WizardDescriptor;
import org.openide.filesystems.FileObject; import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileUtil; import org.openide.filesystems.FileUtil;
@SuppressWarnings("unchecked")
public final class ConvertOgreBinaryMeshesAction implements Action { public final class ConvertOgreBinaryMeshesAction implements Action {
private final Project context; private final Project context;

@ -24,6 +24,7 @@ import org.openide.WizardDescriptor;
import org.openide.filesystems.FileUtil; import org.openide.filesystems.FileUtil;
import org.w3c.dom.Element; import org.w3c.dom.Element;
@SuppressWarnings("unchecked")
public final class ImportAssetAction implements Action { public final class ImportAssetAction implements Action {
private final AssetPackProject context; private final AssetPackProject context;

@ -33,6 +33,7 @@ import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileUtil; import org.openide.filesystems.FileUtil;
import org.openide.util.NbPreferences; import org.openide.util.NbPreferences;
@SuppressWarnings("unchecked")
public final class PublishAssetPackAction implements Action { public final class PublishAssetPackAction implements Action {
private final Project context; private final Project context;

@ -30,7 +30,7 @@ public final class LinkSceneComposer implements ActionListener {
FileObject file = spatialAssetDataObject.getPrimaryFile(); FileObject file = spatialAssetDataObject.getPrimaryFile();
String assetName = manager.getRelativeAssetPath(file.getPath()); String assetName = manager.getRelativeAssetPath(file.getPath());
SceneComposerTopComponent composer = SceneComposerTopComponent.findInstance(); SceneComposerTopComponent composer = SceneComposerTopComponent.findInstance();
composer.linkModel(manager.getManager(), assetName); composer.linkModel(manager, assetName);
} }
} }
} }

@ -47,7 +47,7 @@ public final class OpenSceneComposer implements ActionListener {
java.awt.EventQueue.invokeLater(new Runnable() { java.awt.EventQueue.invokeLater(new Runnable() {
public void run() { public void run() {
((DesktopAssetManager) manager.getManager()).clearCache(); manager.clearCache();
SceneComposerTopComponent composer = SceneComposerTopComponent.findInstance(); SceneComposerTopComponent composer = SceneComposerTopComponent.findInstance();
composer.openScene(asset, context, manager); composer.openScene(asset, context, manager);
} }

@ -46,6 +46,7 @@ import org.openide.util.Utilities;
*/ */
@ConvertAsProperties(dtd = "-//com.jme3.gde.scenecomposer//SceneComposer//EN", @ConvertAsProperties(dtd = "-//com.jme3.gde.scenecomposer//SceneComposer//EN",
autostore = false) autostore = false)
@SuppressWarnings("unchecked")
public final class SceneComposerTopComponent extends TopComponent implements SceneListener, LookupListener { public final class SceneComposerTopComponent extends TopComponent implements SceneListener, LookupListener {
private static SceneComposerTopComponent instance; private static SceneComposerTopComponent instance;
@ -810,7 +811,7 @@ public final class SceneComposerTopComponent extends TopComponent implements Sce
if (toolController != null) { if (toolController != null) {
toolController.cleanup(); toolController.cleanup();
} }
toolController = new SceneToolController(currentRequest.getToolNode(), currentRequest.getManager().getManager()); toolController = new SceneToolController(currentRequest.getToolNode(), currentRequest.getManager());
camController = new ComposerCameraController(SceneApplication.getApplication().getCamera(), request.getJmeNode()); camController = new ComposerCameraController(SceneApplication.getApplication().getCamera(), request.getJmeNode());
camController.setMaster(this); camController.setMaster(this);
camController.enable(); camController.enable();

@ -698,7 +698,7 @@ public class SceneEditorController implements PropertyChangeListener, NodeListen
final Node selected = selectedSpat.getLookup().lookup(Node.class); final Node selected = selectedSpat.getLookup().lookup(Node.class);
ProjectAssetManager manager = file.getLookup().lookup(ProjectAssetManager.class); ProjectAssetManager manager = file.getLookup().lookup(ProjectAssetManager.class);
if (manager != null) { if (manager != null) {
((DesktopAssetManager) manager.getManager()).clearCache(); manager.clearCache();
} }
if (selected != null) { if (selected != null) {
setNeedsSave(true); setNeedsSave(true);
@ -716,7 +716,7 @@ public class SceneEditorController implements PropertyChangeListener, NodeListen
ProgressHandle progressHandle = ProgressHandleFactory.createHandle("Adding Model.."); ProgressHandle progressHandle = ProgressHandleFactory.createHandle("Adding Model..");
progressHandle.start(); progressHandle.start();
try { try {
Spatial linkNode = (Spatial) file.loadAsset(); Spatial linkNode = file.loadAsset();
if (linkNode != null) { if (linkNode != null) {
selected.attachChild(linkNode); selected.attachChild(linkNode);
if (location != null) { if (location != null) {

Loading…
Cancel
Save