Browse Source

- fix some warnings and deprecations

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7744 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
nor..67 14 năm trước cách đây
mục cha
commit
81bea1474d

+ 6 - 6
jme3-assetpack-support/src/com/jme3/gde/assetpack/AssetPackLoader.java

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

+ 1 - 0
jme3-assetpack-support/src/com/jme3/gde/assetpack/project/actions/ConvertOgreBinaryMeshesAction.java

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

+ 1 - 0
jme3-assetpack-support/src/com/jme3/gde/assetpack/project/actions/ImportAssetAction.java

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

+ 1 - 0
jme3-assetpack-support/src/com/jme3/gde/assetpack/project/actions/PublishAssetPackAction.java

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

+ 1 - 1
jme3-scenecomposer/src/com/jme3/gde/scenecomposer/LinkSceneComposer.java

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

+ 1 - 1
jme3-scenecomposer/src/com/jme3/gde/scenecomposer/OpenSceneComposer.java

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

+ 2 - 1
jme3-scenecomposer/src/com/jme3/gde/scenecomposer/SceneComposerTopComponent.java

@@ -46,6 +46,7 @@ import org.openide.util.Utilities;
  */
 @ConvertAsProperties(dtd = "-//com.jme3.gde.scenecomposer//SceneComposer//EN",
 autostore = false)
+@SuppressWarnings("unchecked")
 public final class SceneComposerTopComponent extends TopComponent implements SceneListener, LookupListener {
 
     private static SceneComposerTopComponent instance;
@@ -810,7 +811,7 @@ public final class SceneComposerTopComponent extends TopComponent implements Sce
             if (toolController != null) {
                 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.setMaster(this);
             camController.enable();

+ 2 - 2
jme3-scenecomposer/src/com/jme3/gde/scenecomposer/SceneEditorController.java

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