speaking of SDK, material property editor is now sorted alphabetically

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10464 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
bre..om 12 years ago
parent 3888036176
commit b1657e6846
  1. 13
      sdk/jme3-materialeditor/src/com/jme3/gde/materials/MaterialPropertyEditor.java
  2. 3
      sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/AddTerrainAction.java

@ -46,8 +46,11 @@ import java.awt.Rectangle;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyEditor;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import org.openide.filesystems.FileObject;
@ -167,7 +170,10 @@ public class MaterialPropertyEditor implements PropertyEditor, SceneExplorerProp
return new String[]{};
}
if (material.getAssetName() == null) {
String[] materials = request.getManager().getMaterials();
String[] matsUnsorted = request.getManager().getMaterials();
List<String> matList = Arrays.asList(matsUnsorted);
Collections.sort(matList);
String[] materials = matList.toArray(new String[0]);
String[] mats = new String[materials.length + 1];
mats[0] = ("create j3m file");
for (int i = 0; i < materials.length; i++) {
@ -176,7 +182,10 @@ public class MaterialPropertyEditor implements PropertyEditor, SceneExplorerProp
}
return mats;
} else {
return request.getManager().getMaterials();
String[] matsUnsorted = request.getManager().getMaterials();
List<String> matList = Arrays.asList(matsUnsorted);
Collections.sort(matList);
return matList.toArray(new String[0]);
}
}

@ -127,6 +127,9 @@ public class AddTerrainAction extends AbstractNewSpatialWizardAction {
for (int w=0; w<alphaTextureSize; w++)
alphaBlend.setRGB(w, h, 0x00FF0000);//argb
}
File textureFolder = new File(assetFolder+"/Textures/");
if (!textureFolder.exists())
textureFolder.mkdir();
File alphaFolder = new File(assetFolder+"/Textures/terrain-alpha/");
if (!alphaFolder.exists())
alphaFolder.mkdir();

Loading…
Cancel
Save