SDK : MatDefEditor: fixed compilation warnings

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10483 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
rem..om 12 years ago
parent 5fd4687080
commit 8cf44e7e3e
  1. 16
      sdk/jme3-materialeditor/build.xml
  2. 3
      sdk/jme3-materialeditor/manifest.mf
  3. 4
      sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/EditableMatDefFile.java
  4. 2
      sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/MatDefEditorlElement.java
  5. 12
      sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/navigator/MatDefNavigatorPanel.java

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
<!-- for some information on what you could do (e.g. targets to override). -->
<!-- If you delete this file and reopen the project it will be recreated. -->
<project name="com.jme3.gde.materials" default="netbeans" basedir=".">
<description>Builds, tests, and runs the project com.jme3.gde.materials.</description>
<import file="nbproject/build-impl.xml"/>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
<!-- for some information on what you could do (e.g. targets to override). -->
<!-- If you delete this file and reopen the project it will be recreated. -->
<project name="com.jme3.gde.materials" default="netbeans" basedir=".">
<description>Builds, tests, and runs the project com.jme3.gde.materials.</description>
<import file="nbproject/build-impl.xml"/>
</project>

@ -3,4 +3,5 @@ OpenIDE-Module: com.jme3.gde.materials/1
OpenIDE-Module-Implementation-Version: 0
OpenIDE-Module-Layer: com/jme3/gde/materials/layer.xml
OpenIDE-Module-Localizing-Bundle: com/jme3/gde/materials/Bundle.properties
OpenIDE-Module-Requires: org.openide.windows.WindowManager

@ -97,7 +97,7 @@ public class EditableMatDefFile {
lock = matDefFile.lock();
List<Statement> sta = BlockLanguageParser.parse(obj.getPrimaryFile().getInputStream());
matDefStructure = new MatDefBlock(sta.get(0));
AssetKey matDefKey = new AssetKey(assetManager.getRelativeAssetPath(assetManager.getRelativeAssetPath(matDefFile.getPath())));
AssetKey<MaterialDef> matDefKey = new AssetKey<MaterialDef>(assetManager.getRelativeAssetPath(assetManager.getRelativeAssetPath(matDefFile.getPath())));
assetManager.deleteFromCache(matDefKey);
materialDef = (MaterialDef) assetManager.loadAsset(assetManager.getRelativeAssetPath(matDefFile.getPath()));
lock.releaseLock();
@ -293,7 +293,7 @@ public class EditableMatDefFile {
private void applyChange() {
try {
EditorCookie ec = (EditorCookie) lookup.lookup(EditorCookie.class);
EditorCookie ec = lookup.lookup(EditorCookie.class);
final StyledDocument doc = ec.getDocument();
final BadLocationException[] exc = new BadLocationException[]{null};
NbDocument.runAtomicAsUser(ec.getDocument(), new Runnable() {

@ -210,7 +210,7 @@ public final class MatDefEditorlElement extends JPanel implements MultiViewEleme
final Lookup.Result<Material> resMat = obj.getLookup().lookupResult(Material.class);
resMat.addLookupListener(new LookupListener() {
public void resultChanged(LookupEvent ev) {
Collection<Material> col = (Collection<Material>) resMat.allInstances();
Collection<? extends Material> col = (Collection<? extends Material>) resMat.allInstances();
if (!col.isEmpty()) {
Material material = col.iterator().next();
diagram1.refreshPreviews(material);

@ -27,12 +27,12 @@ public class MatDefNavigatorPanel extends JPanel implements NavigatorPanel, Expl
/**
* template for finding data in given context.
*/
private static final Lookup.Template MY_DATA = new Lookup.Template(MatDefDataObject.class);
private static final Lookup.Template<MatDefDataObject> MY_DATA = new Lookup.Template<MatDefDataObject>(MatDefDataObject.class);
/**
* current context to work on
*/
private Lookup.Result curContext;
private Lookup.Result<MatDefDataObject> curContext;
private Lookup lookup;
/**
* listener to context changes
@ -68,7 +68,7 @@ public class MatDefNavigatorPanel extends JPanel implements NavigatorPanel, Expl
//lookup = context;
curContext.addLookupListener(getContextListener());
// get actual data and recompute content
Collection data = curContext.allInstances();
Collection<? extends MatDefDataObject> data = curContext.allInstances();
setNewContent(data);
// ExplorerUtils.activateActions(mgr, true);
@ -76,7 +76,7 @@ public class MatDefNavigatorPanel extends JPanel implements NavigatorPanel, Expl
}
public void panelDeactivated() {
Collection data = curContext.allInstances();
Collection<? extends MatDefDataObject> data = curContext.allInstances();
if (!data.isEmpty()) {
MatDefDataObject obj = (MatDefDataObject) data.iterator().next();
obj.getLookupContents().remove(this);
@ -95,7 +95,7 @@ public class MatDefNavigatorPanel extends JPanel implements NavigatorPanel, Expl
/**
* *********** non - public part ***********
*/
private void setNewContent(Collection newData) {
private void setNewContent(Collection<? extends MatDefDataObject> newData) {
if (!newData.isEmpty()) {
MatDefDataObject data = (MatDefDataObject) newData.iterator().next();
data.getLookupContents().add(this);
@ -135,7 +135,7 @@ public class MatDefNavigatorPanel extends JPanel implements NavigatorPanel, Expl
private class ContextListener implements LookupListener {
public void resultChanged(LookupEvent ev) {
Collection data = ((Lookup.Result) ev.getSource()).allInstances();
Collection<? extends MatDefDataObject> data = (Collection<? extends MatDefDataObject>)((Lookup.Result<?> ) ev.getSource()).allInstances();
setNewContent(data);
}
} // end of ContextListener

Loading…
Cancel
Save