Main repository of MikuMikuStudio
Revision | ed07a711379d4a20c07ffce6de019a31f63f3948 (tree) |
---|---|
Time | 2013-03-06 01:00:43 |
Author | brentowens@gmail.com <brentowens@gmai...> |
Commiter | brentowens@gmail.com |
speaking of SDK, material property editor is now sorted alphabetically
git-svn-id: http://jmonkeyengine.googlecode.com/svn/trunk@10464 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
@@ -46,8 +46,11 @@ import java.awt.Rectangle; | ||
46 | 46 | import java.beans.PropertyChangeEvent; |
47 | 47 | import java.beans.PropertyChangeListener; |
48 | 48 | import java.beans.PropertyEditor; |
49 | +import java.util.Arrays; | |
50 | +import java.util.Collections; | |
49 | 51 | import java.util.Iterator; |
50 | 52 | import java.util.LinkedList; |
53 | +import java.util.List; | |
51 | 54 | import java.util.concurrent.Callable; |
52 | 55 | import java.util.concurrent.ExecutionException; |
53 | 56 | import org.openide.filesystems.FileObject; |
@@ -167,7 +170,10 @@ public class MaterialPropertyEditor implements PropertyEditor, SceneExplorerProp | ||
167 | 170 | return new String[]{}; |
168 | 171 | } |
169 | 172 | if (material.getAssetName() == null) { |
170 | - String[] materials = request.getManager().getMaterials(); | |
173 | + String[] matsUnsorted = request.getManager().getMaterials(); | |
174 | + List<String> matList = Arrays.asList(matsUnsorted); | |
175 | + Collections.sort(matList); | |
176 | + String[] materials = matList.toArray(new String[0]); | |
171 | 177 | String[] mats = new String[materials.length + 1]; |
172 | 178 | mats[0] = ("create j3m file"); |
173 | 179 | for (int i = 0; i < materials.length; i++) { |
@@ -176,7 +182,10 @@ public class MaterialPropertyEditor implements PropertyEditor, SceneExplorerProp | ||
176 | 182 | } |
177 | 183 | return mats; |
178 | 184 | } else { |
179 | - return request.getManager().getMaterials(); | |
185 | + String[] matsUnsorted = request.getManager().getMaterials(); | |
186 | + List<String> matList = Arrays.asList(matsUnsorted); | |
187 | + Collections.sort(matList); | |
188 | + return matList.toArray(new String[0]); | |
180 | 189 | } |
181 | 190 | } |
182 | 191 |
@@ -127,6 +127,9 @@ public class AddTerrainAction extends AbstractNewSpatialWizardAction { | ||
127 | 127 | for (int w=0; w<alphaTextureSize; w++) |
128 | 128 | alphaBlend.setRGB(w, h, 0x00FF0000);//argb |
129 | 129 | } |
130 | + File textureFolder = new File(assetFolder+"/Textures/"); | |
131 | + if (!textureFolder.exists()) | |
132 | + textureFolder.mkdir(); | |
130 | 133 | File alphaFolder = new File(assetFolder+"/Textures/terrain-alpha/"); |
131 | 134 | if (!alphaFolder.exists()) |
132 | 135 | alphaFolder.mkdir(); |