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. 1
      sdk/jme3-materialeditor/manifest.mf
  2. 4
      sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/EditableMatDefFile.java
  3. 2
      sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/MatDefEditorlElement.java
  4. 12
      sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/navigator/MatDefNavigatorPanel.java

@ -3,4 +3,5 @@ OpenIDE-Module: com.jme3.gde.materials/1
OpenIDE-Module-Implementation-Version: 0 OpenIDE-Module-Implementation-Version: 0
OpenIDE-Module-Layer: com/jme3/gde/materials/layer.xml OpenIDE-Module-Layer: com/jme3/gde/materials/layer.xml
OpenIDE-Module-Localizing-Bundle: com/jme3/gde/materials/Bundle.properties 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(); lock = matDefFile.lock();
List<Statement> sta = BlockLanguageParser.parse(obj.getPrimaryFile().getInputStream()); List<Statement> sta = BlockLanguageParser.parse(obj.getPrimaryFile().getInputStream());
matDefStructure = new MatDefBlock(sta.get(0)); 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); assetManager.deleteFromCache(matDefKey);
materialDef = (MaterialDef) assetManager.loadAsset(assetManager.getRelativeAssetPath(matDefFile.getPath())); materialDef = (MaterialDef) assetManager.loadAsset(assetManager.getRelativeAssetPath(matDefFile.getPath()));
lock.releaseLock(); lock.releaseLock();
@ -293,7 +293,7 @@ public class EditableMatDefFile {
private void applyChange() { private void applyChange() {
try { try {
EditorCookie ec = (EditorCookie) lookup.lookup(EditorCookie.class); EditorCookie ec = lookup.lookup(EditorCookie.class);
final StyledDocument doc = ec.getDocument(); final StyledDocument doc = ec.getDocument();
final BadLocationException[] exc = new BadLocationException[]{null}; final BadLocationException[] exc = new BadLocationException[]{null};
NbDocument.runAtomicAsUser(ec.getDocument(), new Runnable() { 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); final Lookup.Result<Material> resMat = obj.getLookup().lookupResult(Material.class);
resMat.addLookupListener(new LookupListener() { resMat.addLookupListener(new LookupListener() {
public void resultChanged(LookupEvent ev) { public void resultChanged(LookupEvent ev) {
Collection<Material> col = (Collection<Material>) resMat.allInstances(); Collection<? extends Material> col = (Collection<? extends Material>) resMat.allInstances();
if (!col.isEmpty()) { if (!col.isEmpty()) {
Material material = col.iterator().next(); Material material = col.iterator().next();
diagram1.refreshPreviews(material); diagram1.refreshPreviews(material);

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

Loading…
Cancel
Save