SDK:
- Material Editor now shows all j3md files on the classpath (thanks to @H) git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9832 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
f5622ffc1e
commit
6bf538d87b
@ -85,7 +85,6 @@ public class ProjectAssetManager extends DesktopAssetManager {
|
|||||||
}
|
}
|
||||||
addFolderLocator(folderName);
|
addFolderLocator(folderName);
|
||||||
ProjectManager.mutex().postWriteRequest(new Runnable() {
|
ProjectManager.mutex().postWriteRequest(new Runnable() {
|
||||||
|
|
||||||
public void run() {
|
public void run() {
|
||||||
updateClassLoader();
|
updateClassLoader();
|
||||||
}
|
}
|
||||||
@ -144,7 +143,6 @@ public class ProjectAssetManager extends DesktopAssetManager {
|
|||||||
for (FileObject fileObject : roots) {
|
for (FileObject fileObject : roots) {
|
||||||
if (!fileObject.equals(getAssetFolder())) {
|
if (!fileObject.equals(getAssetFolder())) {
|
||||||
FileChangeListener listener = new FileChangeListener() {
|
FileChangeListener listener = new FileChangeListener() {
|
||||||
|
|
||||||
public void fileFolderCreated(FileEvent fe) {
|
public void fileFolderCreated(FileEvent fe) {
|
||||||
// notifyClassPathListeners();
|
// notifyClassPathListeners();
|
||||||
}
|
}
|
||||||
@ -200,7 +198,6 @@ public class ProjectAssetManager extends DesktopAssetManager {
|
|||||||
|
|
||||||
private void prepAssetEventListeners() {
|
private void prepAssetEventListeners() {
|
||||||
super.setAssetEventListener(new AssetEventListener() {
|
super.setAssetEventListener(new AssetEventListener() {
|
||||||
|
|
||||||
public void assetLoaded(AssetKey ak) {
|
public void assetLoaded(AssetKey ak) {
|
||||||
synchronized (assetEventListeners) {
|
synchronized (assetEventListeners) {
|
||||||
for (AssetEventListener assetEventListener : assetEventListeners) {
|
for (AssetEventListener assetEventListener : assetEventListeners) {
|
||||||
@ -312,18 +309,45 @@ public class ProjectAssetManager extends DesktopAssetManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String[] getMatDefs() {
|
public String[] getMatDefs() {
|
||||||
FileObject assetsFolder = getAssetFolder();
|
return collectFilesWithSuffix("j3md");
|
||||||
if (assetsFolder == null) {
|
}
|
||||||
return new String[]{};
|
|
||||||
}
|
/**
|
||||||
Enumeration<FileObject> assets = (Enumeration<FileObject>) assetsFolder.getChildren(true);
|
* Collects files over the asset folder(s) and classpath
|
||||||
|
* @param suffix
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private String[] collectFilesWithSuffix(String suffix) {
|
||||||
ArrayList<String> list = new ArrayList<String>();
|
ArrayList<String> list = new ArrayList<String>();
|
||||||
while (assets.hasMoreElements()) {
|
FileObject assetsFolder = getAssetFolder();
|
||||||
FileObject asset = assets.nextElement();
|
if (assetsFolder != null) {
|
||||||
if (asset.getExt().equalsIgnoreCase("j3md")) {
|
Enumeration<FileObject> assets = (Enumeration<FileObject>) assetsFolder.getChildren(true);
|
||||||
list.add(getRelativeAssetPath(asset.getPath()));
|
while (assets.hasMoreElements()) {
|
||||||
|
FileObject asset = assets.nextElement();
|
||||||
|
if (asset.getExt().equalsIgnoreCase(suffix)) {
|
||||||
|
list.add(getRelativeAssetPath(asset.getPath()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (classPathItems != null) {
|
||||||
|
// TODO I need to find out if classPathItems contains all jars added to a project
|
||||||
|
Iterator<ClassPathItem> classPathItemsIter = classPathItems.iterator();
|
||||||
|
while (classPathItemsIter.hasNext()) {
|
||||||
|
ClassPathItem classPathItem = classPathItemsIter.next();
|
||||||
|
FileObject jarFile = classPathItem.object;
|
||||||
|
|
||||||
|
Enumeration<FileObject> jarEntry = (Enumeration<FileObject>) jarFile.getChildren(true);
|
||||||
|
while (jarEntry.hasMoreElements()) {
|
||||||
|
FileObject jarEntryAsset = jarEntry.nextElement();
|
||||||
|
if (jarEntryAsset.getExt().equalsIgnoreCase(suffix)) {
|
||||||
|
list.add(jarEntryAsset.getPath());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return list.toArray(new String[list.size()]);
|
return list.toArray(new String[list.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -400,7 +424,6 @@ public class ProjectAssetManager extends DesktopAssetManager {
|
|||||||
updateClassLoader();
|
updateClassLoader();
|
||||||
final ProjectAssetManager pm = this;
|
final ProjectAssetManager pm = this;
|
||||||
java.awt.EventQueue.invokeLater(new Runnable() {
|
java.awt.EventQueue.invokeLater(new Runnable() {
|
||||||
|
|
||||||
public void run() {
|
public void run() {
|
||||||
synchronized (classPathListeners) {
|
synchronized (classPathListeners) {
|
||||||
for (ClassPathChangeListener classPathChangeListener : classPathListeners) {
|
for (ClassPathChangeListener classPathChangeListener : classPathListeners) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.1" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
<Form version="1.4" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
<Form version="1.4" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||||
<NonVisualComponents>
|
<NonVisualComponents>
|
||||||
@ -120,7 +120,7 @@
|
|||||||
</Group>
|
</Group>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="1" attributes="0">
|
<Group type="103" groupAlignment="1" attributes="0">
|
||||||
<Component id="jTabbedPane2" pref="326" max="32767" attributes="0"/>
|
<Component id="jTabbedPane2" pref="320" max="32767" attributes="0"/>
|
||||||
<Component id="jTabbedPane3" pref="326" max="32767" attributes="0"/>
|
<Component id="jTabbedPane3" pref="326" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
@ -276,7 +276,7 @@
|
|||||||
<Layout>
|
<Layout>
|
||||||
<DimensionLayout dim="0">
|
<DimensionLayout dim="0">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<EmptySpace min="0" pref="157" max="32767" attributes="0"/>
|
<EmptySpace min="0" pref="131" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
<DimensionLayout dim="1">
|
<DimensionLayout dim="1">
|
||||||
|
@ -534,13 +534,13 @@ public final class MaterialEditorTopComponent extends CloneableTopComponent impl
|
|||||||
jComboBox1.addItem(string);
|
jComboBox1.addItem(string);
|
||||||
}
|
}
|
||||||
|
|
||||||
jComboBox1.addItem("Common/MatDefs/Light/Lighting.j3md");
|
// jComboBox1.addItem("Common/MatDefs/Light/Lighting.j3md");
|
||||||
jComboBox1.addItem("Common/MatDefs/Misc/Unshaded.j3md");
|
// jComboBox1.addItem("Common/MatDefs/Misc/Unshaded.j3md");
|
||||||
jComboBox1.addItem("Common/MatDefs/Misc/Particle.j3md");
|
// jComboBox1.addItem("Common/MatDefs/Misc/Particle.j3md");
|
||||||
jComboBox1.addItem("Common/MatDefs/Misc/Sky.j3md");
|
// jComboBox1.addItem("Common/MatDefs/Misc/Sky.j3md");
|
||||||
jComboBox1.addItem("Common/MatDefs/Gui/Gui.j3md");
|
// jComboBox1.addItem("Common/MatDefs/Gui/Gui.j3md");
|
||||||
jComboBox1.addItem("Common/MatDefs/Terrain/TerrainLighting.j3md");
|
// jComboBox1.addItem("Common/MatDefs/Terrain/TerrainLighting.j3md");
|
||||||
jComboBox1.addItem("Common/MatDefs/Terrain/Terrain.j3md");
|
// jComboBox1.addItem("Common/MatDefs/Terrain/Terrain.j3md");
|
||||||
// jComboBox1.addItem("Common/MatDefs/Misc/ShowNormals.j3md");
|
// jComboBox1.addItem("Common/MatDefs/Misc/ShowNormals.j3md");
|
||||||
jComboBox1.setSelectedItem(selected);
|
jComboBox1.setSelectedItem(selected);
|
||||||
materialFile = prop;
|
materialFile = prop;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
build.xml.data.CRC32=ae2392d0
|
build.xml.data.CRC32=35b10250
|
||||||
build.xml.script.CRC32=b6310686
|
build.xml.script.CRC32=b6310686
|
||||||
build.xml.stylesheet.CRC32=a56c6a5b@2.50.1
|
build.xml.stylesheet.CRC32=a56c6a5b@2.50.1
|
||||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||||
nbproject/build-impl.xml.data.CRC32=ae2392d0
|
nbproject/build-impl.xml.data.CRC32=35b10250
|
||||||
nbproject/build-impl.xml.script.CRC32=4db64ed5
|
nbproject/build-impl.xml.script.CRC32=4db64ed5
|
||||||
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@2.50.1
|
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@2.50.1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user