- fix some warnings and deprecations

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7744 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
nor..67 2011-06-26 12:43:48 +00:00
parent 09ef641d09
commit fc04902c30
8 changed files with 15 additions and 11 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);
}
}
}

View File

@ -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);
}

View File

@ -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();

View File

@ -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) {