SDK : MatDefEditor: fixed compilation warnings
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10483 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
5fd4687080
commit
8cf44e7e3e
@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
|
<!-- 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). -->
|
<!-- 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. -->
|
<!-- If you delete this file and reopen the project it will be recreated. -->
|
||||||
<project name="com.jme3.gde.materials" default="netbeans" basedir=".">
|
<project name="com.jme3.gde.materials" default="netbeans" basedir=".">
|
||||||
<description>Builds, tests, and runs the project com.jme3.gde.materials.</description>
|
<description>Builds, tests, and runs the project com.jme3.gde.materials.</description>
|
||||||
<import file="nbproject/build-impl.xml"/>
|
<import file="nbproject/build-impl.xml"/>
|
||||||
</project>
|
</project>
|
||||||
|
@ -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…
x
Reference in New Issue
Block a user