Normand Briere
2019-05-05 44b1501b5c4cd60ea67cc3d0971ed53f53b594e6
GroupEditor.java
....@@ -171,6 +171,14 @@
171171 //editItem.addActionListener(this);
172172 duplicateItem = menu.add(new MenuItem("Duplicate"));
173173 duplicateItem.addActionListener(this);
174
+ cloneItem = menu.add(new MenuItem("Clone"));
175
+ cloneItem.addActionListener(this);
176
+ if (Globals.ADVANCED)
177
+ {
178
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
179
+ cloneSupportItem.addActionListener(this);
180
+ }
181
+ menu.add("-");
174182 cutItem = menu.add(new MenuItem("Cut"));
175183 cutItem.addActionListener(this);
176184 copyItem = menu.add(new MenuItem("Copy"));
....@@ -178,10 +186,7 @@
178186 pasteItem = menu.add(new MenuItem("Paste"));
179187 pasteItem.addActionListener(this);
180188 menu.add("-");
181
- cloneItem = menu.add(new MenuItem("Clone"));
182
- cloneItem.addActionListener(this);
183
- cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
184
- cloneSupportItem.addActionListener(this);
189
+
185190 menu.add("-");
186191 pasteIntoItem = menu.add(new MenuItem("Paste into"));
187192 pasteIntoItem.addActionListener(this);
....@@ -272,6 +277,7 @@
272277
273278 if (Globals.ADVANCED)
274279 {
280
+ menu.add("-");
275281 physicsItem = menu.add(new MenuItem("Physics"));
276282 physicsItem.addActionListener(this);
277283 frameselectorItem = menu.add(new MenuItem("Frame Selector"));
....@@ -297,6 +303,7 @@
297303 shadowZItem.addActionListener(this);
298304 if (Globals.ADVANCED)
299305 {
306
+ menu.add("-");
300307 linkerItem = menu.add(new MenuItem("Linker"));
301308 linkerItem.addActionListener(this);
302309 attributeItem = menu.add(new MenuItem("Attribute"));
....@@ -305,8 +312,8 @@
305312 templateItem.addActionListener(this);
306313 pointflowItem = menu.add(new MenuItem("Point Flow"));
307314 pointflowItem.addActionListener(this);
308
- menu.add("-");
309315 }
316
+ menu.add("-");
310317 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
311318 resetTransformItem.addActionListener(this);
312319 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
....@@ -432,14 +439,17 @@
432439 buildCreateMenu(menu);
433440
434441 oe.menuBar.add(menu = new Menu("Include"));
435
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
436
- importGFDItem.addActionListener(this);
437
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
438
- importVRMLX3DItem.addActionListener(this);
439
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
442
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
440443 importOBJItem.addActionListener(this);
441
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
444
+ menu.add("-");
445
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
442446 import3DSItem.addActionListener(this);
447
+ menu.add("-");
448
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
449
+ importVRMLX3DItem.addActionListener(this);
450
+ menu.add("-");
451
+ importGFDItem = menu.add(new MenuItem("GrafreeD file..."));
452
+ importGFDItem.addActionListener(this);
443453
444454 oe.menuBar.add(menu = new Menu("Tools"));
445455 buildToolsMenu(menu);
....@@ -930,7 +940,9 @@
930940 // objEditor.DropFile((java.io.File[]) object, true);
931941 // return;
932942 // }
933
- if (string.charAt(0) == '/')
943
+
944
+ // File path for Mac and Windows
945
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
934946 {
935947 // file(s)
936948 String[] names = string.split("\n");
....@@ -957,7 +969,7 @@
957969
958970 flashIt = false;
959971 CameraPane pane = (CameraPane) target;
960
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
972
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
961973 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
962974
963975 if (group.selection.size() == 1)
....@@ -1164,13 +1176,13 @@
11641176 parseverticesItem.addActionListener(this);
11651177 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11661178 textureFieldItem.addActionListener(this);
1167
- alignItem = menu.add(new MenuItem("Align Object"));
1179
+ alignItem = menu.add(new MenuItem("Align Objects"));
11681180 alignItem.addActionListener(this);
11691181 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11701182 reduceMorphItem.addActionListener(this);
11711183 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11721184 reduce34MorphItem.addActionListener(this);
1173
-
1185
+ menu.add("-");
11741186 menu.add(computeAOItem = new MenuItem("Compute AO"));
11751187 computeAOItem.addActionListener(this);
11761188
....@@ -1852,7 +1864,15 @@
18521864 } else
18531865 if (source == importOBJItem)
18541866 {
1855
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1867
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1868
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1869
+ browser.setVisible(true);
1870
+ String filename = browser.getFile();
1871
+ if (filename != null && filename.length() > 0)
1872
+ {
1873
+ String fullname = browser.getDirectory() + filename;
1874
+ makeSomething(ReadOBJ(fullname), true);
1875
+ }
18561876 } else
18571877 if (source == computeAOItem)
18581878 {