Normand Briere
2019-06-09 989407a46041b80c71fd906bff6b97528e6f3350
GroupEditor.java
....@@ -12,6 +12,7 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
....@@ -97,14 +98,14 @@
9798
9899 void CloneClipboard(boolean supports)
99100 {
100
- assert(GrafreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
102
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
101
+ assert(Grafreed.clipboard.parent == null);
102
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
103
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
104
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
105
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105106 else
106
- makeSomething(CloneObject(GrafreeD.clipboard, false));
107
- GrafreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(Grafreed.clipboard, false));
108
+ Grafreed.clipboard.get(0).parent = keepparent;
108109 }
109110
110111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +119,7 @@
118119 // obj.support = null;
119120 if (!supports)
120121 obj.SaveSupports();
121
- Object3D clone = (Object3D)GrafreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122123 obj.parent = parent;
123124 // obj.support = support;
124125 // clone.support = support; // aout 2013
....@@ -149,6 +150,8 @@
149150
150151 void SetupMenu2(ObjEditor oe)
151152 {
153
+ if (Globals.ADVANCED)
154
+ {
152155 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153156 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154157 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,17 +163,21 @@
160163 lookAtItem.addActionListener(this);
161164 //lookFromItem.addActinoListener(this);
162165 //switchItem.addActionListener(this);
166
+ }
167
+
163168 Menu menu;
164169 oe.menuBar.add(menu = new Menu("Edit"));
165170 //editItem = menu.add(new MenuItem("Edit"));
166171 //editItem.addActionListener(this);
167172 duplicateItem = menu.add(new MenuItem("Duplicate"));
168173 duplicateItem.addActionListener(this);
169
- menu.add("-");
170174 cloneItem = menu.add(new MenuItem("Clone"));
171175 cloneItem.addActionListener(this);
176
+ if (Globals.ADVANCED)
177
+ {
172178 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173179 cloneSupportItem.addActionListener(this);
180
+ }
174181 menu.add("-");
175182 cutItem = menu.add(new MenuItem("Cut"));
176183 cutItem.addActionListener(this);
....@@ -178,27 +185,37 @@
178185 copyItem.addActionListener(this);
179186 pasteItem = menu.add(new MenuItem("Paste"));
180187 pasteItem.addActionListener(this);
188
+ menu.add("-");
189
+
190
+ menu.add("-");
191
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
192
+ pasteIntoItem.addActionListener(this);
181193 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182194 pasteLinkItem.addActionListener(this);
183195 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184196 pasteCloneItem.addActionListener(this);
185197 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186198 // pasteExpandItem.addActionListener(this);
199
+ menu.add("-");
187200 clearItem = menu.add(new MenuItem("Clear"));
188201 clearItem.addActionListener(this);
202
+
203
+ if (Globals.ADVANCED)
204
+ {
205
+ // Deletes the cameras...
189206 clearAllItem = menu.add(new MenuItem("Clear All"));
190207 clearAllItem.addActionListener(this);
208
+ }
191209
192210 oe.menuBar.add(menu = new Menu("Setting"));
193
- resetMeshItem = menu.add(new MenuItem("Reset All"));
194
- resetMeshItem.addActionListener(this);
195
- stepAllItem = menu.add(new MenuItem("Step All"));
196
- stepAllItem.addActionListener(this);
211
+ if (Globals.ADVANCED)
212
+ {
197213 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198214 revertMeshItem.addActionListener(this);
199215 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200216 resetreferencesItem.addActionListener(this);
201217 menu.add("-");
218
+ }
202219 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203220 overwriteGeoItem.addActionListener(this);
204221 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,19 +227,26 @@
210227 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211228 overwriteUVItem.addActionListener(this);
212229 menu.add("-");
230
+ if (Globals.ADVANCED)
231
+ {
213232 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214233 generateMeshItem.addActionListener(this);
215234 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216235 poseMeshItem.addActionListener(this);
217236 menu.add("-");
237
+ }
218238 resetsupportItem = menu.add(new MenuItem("Reset support"));
219239 resetsupportItem.addActionListener(this);
220240 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221241 linkverticesItem.addActionListener(this);
222242 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223243 relinkverticesItem.addActionListener(this);
244
+
245
+ if (Globals.ADVANCED)
246
+ {
224247 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225248 setMasterItem.addActionListener(this);
249
+ }
226250
227251 oe.menuBar.add(menu = new Menu("Group"));
228252 grabItem = menu.add(new MenuItem("Grab"));
....@@ -233,27 +257,32 @@
233257 frontItem.addActionListener(this);
234258 compositeItem = menu.add(new MenuItem("Composite"));
235259 compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
260
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237261 hideItem.addActionListener(this);
238262 ungroupItem = menu.add(new MenuItem("Ungroup"));
239263 ungroupItem.addActionListener(this);
240264 menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
265
+ randomItem = menu.add(new MenuItem("Switch node"));
242266 randomItem.addActionListener(this);
243
- physicsItem = menu.add(new MenuItem("Physics"));
244
- physicsItem.addActionListener(this);
245
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
246
- frameselectorItem.addActionListener(this);
247267 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248268 switchGeoItem.addActionListener(this);
249269 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250270 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
271
+ morphItem = menu.add(new MenuItem("Morph Group"));
252272 morphItem.addActionListener(this);
273
+
274
+ if (Globals.ADVANCED)
275
+ {
276
+ menu.add("-");
277
+ physicsItem = menu.add(new MenuItem("Physics"));
278
+ physicsItem.addActionListener(this);
279
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
280
+ frameselectorItem.addActionListener(this);
253281 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254282 scriptNodeItem.addActionListener(this);
255283 cameraItem = menu.add(new MenuItem("Camera"));
256284 cameraItem.addActionListener(this);
285
+ }
257286
258287 oe.menuBar.add(menu = new Menu("Object"));
259288 textureItem = menu.add(new MenuItem("Texture"));
....@@ -268,21 +297,29 @@
268297 shadowYItem.addActionListener(this);
269298 shadowZItem = menu.add(new MenuItem("Shadow Z"));
270299 shadowZItem.addActionListener(this);
300
+ if (Globals.ADVANCED)
301
+ {
302
+ menu.add("-");
271303 linkerItem = menu.add(new MenuItem("Linker"));
272304 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275305 attributeItem = menu.add(new MenuItem("Attribute"));
276306 attributeItem.addActionListener(this);
307
+ templateItem = menu.add(new MenuItem("Template"));
308
+ templateItem.addActionListener(this);
277309 pointflowItem = menu.add(new MenuItem("Point Flow"));
278310 pointflowItem.addActionListener(this);
311
+ }
279312 menu.add("-");
280313 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281314 resetTransformItem.addActionListener(this);
282315 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283316 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.addActionListener(this);
317
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
318
+ resetCentroidXZItem.addActionListener(this);
319
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
320
+ transformGeometryItem.addActionListener(this);
321
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
322
+ transformChildrenItem.addActionListener(this);
286323
287324 oe.menuBar.add(menu = new Menu("Geometry"));
288325 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +330,11 @@
293330 genNormalsCADItem.addActionListener(this);
294331 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295332 genNormalsMESHItem.addActionListener(this);
333
+ if (Globals.ADVANCED)
334
+ {
296335 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297336 genNormalsMINEItem.addActionListener(this);
337
+ }
298338 stripifyItem = menu.add(new MenuItem("Stripify"));
299339 stripifyItem.addActionListener(this);
300340 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +356,34 @@
316356 reduce34MeshItem.addActionListener(this);
317357 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318358 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321359 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322360 clipMeshItem.addActionListener(this);
361
+
362
+ if (Globals.ADVANCED)
363
+ {
364
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
365
+ smoothMeshItem.addActionListener(this);
366
+ }
323367
324368 oe.menuBar.add(menu = new Menu("Attributes"));
325369 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326370 clearMaterialsItem.addActionListener(this);
371
+ resetAllItem = menu.add(new MenuItem("Reset All"));
372
+ resetAllItem.addActionListener(this);
373
+ stepAllItem = menu.add(new MenuItem("Step All"));
374
+ stepAllItem.addActionListener(this);
327375 menu.add("-");
328376 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329377 liveleavesItem.addActionListener(this);
330378 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331379 unliveleavesItem.addActionListener(this);
380
+ if (Globals.ADVANCED)
381
+ {
332382 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333383 supportleavesItem.addActionListener(this);
334384 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335385 unsupportleavesItem.addActionListener(this);
386
+ }
336387 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337388 hideleavesItem.addActionListener(this);
338389 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -376,28 +427,34 @@
376427 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377428 sortbynameItem.addActionListener(this);
378429 menu.add("-");
430
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
431
+ shareGeometriesItem.addActionListener(this);
432
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
433
+ mergeGeometriesItem.addActionListener(this);
434
+ if (Globals.ADVANCED)
435
+ {
436
+ // Pretty much the same as duplicate and clone.
379437 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380438 extractGeometriesItem.addActionListener(this);
381439 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382440 cloneGeometriesItem.addActionListener(this);
383
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
384
- shareGeometriesItem.addActionListener(this);
385
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
386
- mergeGeometriesItem.addActionListener(this);
441
+ }
387442
388443 oe.menuBar.add(menu = new Menu("Insert"));
389444 buildCreateMenu(menu);
390445
391
-
392446 oe.menuBar.add(menu = new Menu("Include"));
393
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
394
- importGFDItem.addActionListener(this);
395
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
396
- importVRMLX3DItem.addActionListener(this);
397
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
447
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
398448 importOBJItem.addActionListener(this);
399
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
449
+ menu.add("-");
450
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
400451 import3DSItem.addActionListener(this);
452
+ menu.add("-");
453
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
454
+ importVRMLX3DItem.addActionListener(this);
455
+ menu.add("-");
456
+ importGFDItem = menu.add(new MenuItem("GrafreeD file..."));
457
+ importGFDItem.addActionListener(this);
401458
402459 oe.menuBar.add(menu = new Menu("Tools"));
403460 buildToolsMenu(menu);
....@@ -433,110 +490,98 @@
433490 oe.radioPanel.add(dummyButton);
434491 oe.buttonGroup.add(dummyButton);
435492 */
436
- aConstraints.gridy += 1;
437
-
438493 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439494
440
- oe.aConstraints.gridwidth = 1;
441
- oe.aConstraints.gridx = 0;
442
-
443
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
444
- liveCB.setToolTipText("Enabled animation");
495
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
496
+ liveCB.setToolTipText("Enable animation");
445497 liveCB.addItemListener(this);
446498
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
499
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
500
+ oneStepButton.setToolTipText("Animate one step forward");
501
+ oneStepButton.addActionListener(this);
502
+
503
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
504
+ fastCB.setToolTipText("Fast mode");
505
+ fastCB.addItemListener(this);
506
+
507
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
449508 trackCB.setToolTipText("Enable tracking");
450509 trackCB.addItemListener(this);
451510
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
511
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
454512 screenfitButton.setToolTipText("Screen fit");
455513 screenfitButton.addActionListener(this);
456
- oe.aConstraints.gridx += 1;
514
+
457515 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
458516 // screenfitpointButton.addActionListener(this);
459
-// oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
461
- snapobjectButton.addActionListener(this);
462
- snapobjectButton.setToolTipText("Snap Object");
463
- oe.aConstraints.gridx += 1;
464517
465
- //aConstraints.gridx = 0;
466
- //aConstraints.gridy += 1;
467
- oe.aConstraints.weighty = 0;
468
- oe.aConstraints.gridwidth = 1;
469
-
470
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
518
+ if (Globals.ADVANCED)
519
+ {
520
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
521
+ snapobjectButton.addActionListener(this);
522
+ snapobjectButton.setToolTipText("Snap Object");
523
+ }
524
+
525
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
471526 flashSelectionButton.setToolTipText("Show selection");
472527 flashSelectionButton.addActionListener(this);
473528
474
- oe.toolbarPanel.add(new cButton(" ", false));
529
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
475530
476
- oe.aConstraints.gridx += 1;
477
- oe.aConstraints.weighty = 0;
478
- oe.aConstraints.gridwidth = 1;
479
-
480
- //
481
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
531
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
482532 twoButton.setToolTipText("Show center view only");
483533 twoButton.addActionListener(this);
484
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
534
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
485535 fourButton.addActionListener(this);
486536 fourButton.setToolTipText("Show left panel only");
487
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
537
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
488538 sixButton.setToolTipText("2-column layout left");
489539 sixButton.addActionListener(this);
490
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
540
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
491541 threeButton.setToolTipText("2-column layout right");
492542 threeButton.addActionListener(this);
493
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
543
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
494544 sevenButton.setToolTipText("3-column layout");
495545 sevenButton.addActionListener(this);
496546 //
497547
498
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
499
- rootButton.setToolTipText("Edit object in new tab");
548
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
549
+ rootButton.setToolTipText("Edit selection in new tab");
500550 rootButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
551
+
552
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
503553 closeButton.setToolTipText("Close tab");
504554 closeButton.addActionListener(this);
505555 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
506556 //clearButton.addActionListener(this);
507
- oe.aConstraints.gridx += 1;
508557
509
- oe.aConstraints.gridx = 1; //
510
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
558
+ cGridBag commandsPanel = new cGridBag();
559
+
560
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
561
+ editButton.setToolTipText("Edit selection");
511562 editButton.addActionListener(this);
512
- oe.aConstraints.gridx += 1;
513
- oe.aConstraints.weighty = 0;
514
- oe.aConstraints.gridwidth = 1;
515563
516
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
564
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
565
+ uneditButton.setToolTipText("Unedit selection");
517566 uneditButton.addActionListener(this);
518567
519
- oe.aConstraints.gridx += 1;
520
- oe.aConstraints.weighty = 0;
521
- oe.aConstraints.gridwidth = 1;
522
-
523
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
524
- clearPanelButton.addActionListener(this);
525
-
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
568
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
569
+ allParamsButton.setToolTipText("Edit all params");
531570 allParamsButton.addActionListener(this);
532571
533
- oe.aConstraints.gridx += 1;
534
- oe.aConstraints.weighty = 0;
535
- oe.aConstraints.gridwidth = 1;
536
-
537
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
572
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
573
+ clearPanelButton.setToolTipText("Clear edit panel");
574
+ clearPanelButton.addActionListener(this);
575
+
576
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
577
+ unselectButton.setToolTipText("Unselect");
538578 unselectButton.addActionListener(this);
539579
580
+ commandsPanel.preferredHeight = 1;
581
+
582
+ oe.treePanel.add(commandsPanel);
583
+ oe.treePanel.Return();
584
+
540585 // oe.aConstraints.gridx += 1;
541586 // oe.aConstraints.weighty = 0;
542587 // oe.aConstraints.gridwidth = 1;
....@@ -548,40 +593,37 @@
548593 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
549594 // gcButton.addActionListener(this);
550595
551
- oe.aConstraints.gridx = 0;
552
- oe.aConstraints.gridy += 1;
553
-
554
- //ctrlPanel.add(objList = new List(5, true));
555
- oe.aConstraints.gridwidth = 100;
556
- // oe.aConstraints.gridheight = 100;
557
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
558
- oe.aConstraints.gridheight = 1;
559
- oe.aConstraints.weighty = 0.5;
560
- oe.aConstraints.gridx = 0;
561
- JScrollPane jSP;
596
+ cGridBag jSPPanel = new cGridBag();
597
+
598
+ JScrollPane jSP;
562599 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
563
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
600
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
564601 ResetModel();
565
- oe.aConstraints.weighty = 0.5;
566
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
567
- oe.aConstraints.gridy += 1;
568
- oe.aConstraints.gridwidth = 1;
602
+
603
+ oe.treePanel.add(jSPPanel);
604
+ oe.treePanel.Return();
569605
570
- oe.aConstraints.weighty = 0;
571
- oe.aConstraints.gridwidth = 2;
572
-
573
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
606
+ cGridBag copyOptionsPanel = new cGridBag();
607
+
608
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
609
+ colorCB.setToolTipText("Copy color when dropped");
574610 colorCB.addItemListener(this);
575
- oe.aConstraints.gridx += 2;
576
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
611
+
612
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
613
+ materialCB.setToolTipText("Copy material when dropped");
577614 materialCB.addItemListener(this);
578
- oe.aConstraints.gridx += 2;
579
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
615
+
616
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
617
+ textureCB.setToolTipText("Copy texture when dropped");
580618 textureCB.addItemListener(this);
581619
582
- oe.aConstraints.gridx = 0;
583
- oe.aConstraints.gridy += 1;
620
+ copyOptionsPanel.preferredHeight = 1;
621
+ oe.treePanel.add(copyOptionsPanel);
622
+ oe.treePanel.Return();
584623
624
+// mainPanel.setDividerLocation(0.5); //1.0);
625
+// mainPanel.setResizeWeight(0.5);
626
+
585627 //jList.addListSelectionListener(this);
586628 oe.jTree.addTreeSelectionListener(this);
587629 //jTree.setRootVisible(false);
....@@ -604,45 +646,37 @@
604646 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
605647 }
606648
607
- void AddOptions(JPanel panel, GridBagConstraints constraints)
649
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
608650 {
609
- constraints.gridx = 0;
610
- constraints.gridy = 0;
611
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), constraints);
612
- fastCB.setToolTipText("Fast mode");
613
- fastCB.addItemListener(this);
614
- constraints.gridy += 1;
615
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), constraints);
616
- supportCB.setToolTipText("Enabled rigging");
617
- supportCB.addItemListener(this);
618
-
619
- // constraints.gridy += 1;
620
- // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
621
- // localCB.addItemListener(this);
622
-
623
- constraints.gridy += 1;
624
- panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), constraints);
625
- crowdCB.setToolTipText("Used for crowds");
626
- crowdCB.addItemListener(this);
627
-
628
- constraints.gridy += 1;
629
- panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), constraints);
630
- smoothCB.setToolTipText("Snapping delay");
631
- smoothCB.addItemListener(this);
632
-
633
- constraints.gridy += 1;
634
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), constraints);
635
- slowCB.setToolTipText("Smooth interpolation");
636
- slowCB.addItemListener(this);
637
- constraints.gridy += 1;
638
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), constraints);
651
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
639652 boxCB.setToolTipText("Display bounding boxes");
640653 boxCB.addItemListener(this);
641
- constraints.gridy += 1;
642
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints);
654
+
655
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
643656 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
644657 zoomBoxCB.addItemListener(this);
645658
659
+ if (true) // Globals.ADVANCED)
660
+ {
661
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
662
+ supportCB.setToolTipText("Enable rigging");
663
+ supportCB.addItemListener(this);
664
+
665
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
666
+ // localCB.addItemListener(this);
667
+
668
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
669
+ crowdCB.setToolTipText("Used for crowds");
670
+ crowdCB.addItemListener(this);
671
+
672
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
673
+ smoothCB.setToolTipText("Snapping delay");
674
+ smoothCB.addItemListener(this);
675
+
676
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
677
+ slowCB.setToolTipText("Smooth interpolation");
678
+ slowCB.addItemListener(this);
679
+
646680 // constraints.gridy += 1;
647681 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
648682 // speakerMocapCB.addItemListener(this);
....@@ -650,16 +684,16 @@
650684 if (false)
651685 {
652686 // handled in scripts
653
- constraints.gridy += 1;
654
- panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints);
687
+ //constraints.gridy += 1;
688
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
655689 speakerCameraCB.addItemListener(this);
656690
657
- constraints.gridy += 1;
658
- panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints);
691
+ //constraints.gridy += 1;
692
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
659693 speakerFocusCB.addItemListener(this);
660694
661
- constraints.gridy += 1;
662
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints);
695
+ //constraints.gridy += 1;
696
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
663697 smoothfocusCB.addItemListener(this);
664698 }
665699
....@@ -667,14 +701,20 @@
667701 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
668702 // debugCB.addItemListener(this);
669703
670
- constraints.gridy += 1;
671
- panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints);
704
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
672705 oeilCB.addItemListener(this);
673706
674
- constraints.gridy += 1;
675
- panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints);
707
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
676708 lookAtCB.setToolTipText("Look-at target");
677709 lookAtCB.addItemListener(this);
710
+
711
+ }
712
+
713
+ cGridBag fill = new cGridBag();
714
+
715
+ fill.preferredHeight = 200;
716
+
717
+ panel.add(fill);
678718
679719 }
680720
....@@ -689,6 +729,7 @@
689729 buttonGroup.add(radioButton);
690730 radioButton.doClick();
691731 }
732
+
692733 void SetupViews(ObjEditor oe)
693734 {
694735 oe.SetupViews();
....@@ -905,7 +946,9 @@
905946 // objEditor.DropFile((java.io.File[]) object, true);
906947 // return;
907948 // }
908
- if (string.charAt(0) == '/')
949
+
950
+ // File path for Mac and Windows
951
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
909952 {
910953 // file(s)
911954 String[] names = string.split("\n");
....@@ -932,7 +975,7 @@
932975
933976 flashIt = false;
934977 CameraPane pane = (CameraPane) target;
935
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
978
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
936979 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
937980
938981 if (group.selection.size() == 1)
....@@ -959,11 +1002,11 @@
9591002 {
9601003 loadClipboard(true);
9611004 objEditor.jTree.setSelectionPath(destinationPath);
962
- pasteInto(false);
1005
+ pasteInto(false, false);
9631006 } else {
9641007 loadClipboard(false);
9651008 objEditor.jTree.setSelectionPath(destinationPath);
966
- pasteInto(false); // true); // ???
1009
+ pasteInto(false, false); // true); // ???
9671010 }
9681011 }
9691012 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1085,27 +1128,33 @@
10851128 kleinItem.addActionListener(this);
10861129 particleItem = menu.add(new MenuItem("Particle system"));
10871130 particleItem.addActionListener(this);
1131
+ if (Globals.ADVANCED)
1132
+ {
10881133 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10891134 ragdollItem.addActionListener(this);
10901135 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10911136 ragdoll2Item.addActionListener(this);
1137
+ }
10921138 menu.add("-");
1093
- meshItem = menu.add(new MenuItem("Mesh"));
1139
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10941140 meshItem.addActionListener(this);
10951141 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10961142 // meshGroupItem.addActionListener(this);
1143
+ if (Globals.ADVANCED)
1144
+ {
10971145 springItem = menu.add(new MenuItem("Spring"));
10981146 springItem.addActionListener(this);
10991147 flagItem = menu.add(new MenuItem("Flag"));
11001148 flagItem.addActionListener(this);
1101
- bezierItem = menu.add(new MenuItem("Patch"));
1102
- bezierItem.addActionListener(this);
1103
- checkerItem = menu.add(new MenuItem("Checker"));
1104
- checkerItem.addActionListener(this);
11051149 blobItem = menu.add(new MenuItem("Blob"));
11061150 blobItem.addActionListener(this);
11071151 latheItem = menu.add(new MenuItem("Lathe"));
11081152 latheItem.addActionListener(this);
1153
+ }
1154
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1155
+ bezierItem.addActionListener(this);
1156
+ overlayItem = menu.add(new MenuItem("Overlay"));
1157
+ overlayItem.addActionListener(this);
11091158 lightItem = menu.add(new MenuItem("Light"));
11101159 lightItem.addActionListener(this);
11111160 menu.add("-");
....@@ -1115,34 +1164,39 @@
11151164 loopItem.addActionListener(this);
11161165 doubleItem = menu.add(new MenuItem("Fork"));
11171166 doubleItem.addActionListener(this);
1167
+ if (Globals.ADVANCED)
1168
+ {
11181169 tripleItem = menu.add(new MenuItem("Trident"));
11191170 tripleItem.addActionListener(this);
1171
+ }
11201172 }
11211173
11221174 void buildToolsMenu(Menu menu)
11231175 {
11241176 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11251177 animationItem.addItemListener(this);
1126
- animationItem.setState(CameraPane.ANIMATION);
1178
+ animationItem.setState(Globals.ANIMATION);
11271179
11281180 menu.add("-");
11291181 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11301182 parseverticesItem.addActionListener(this);
11311183 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11321184 textureFieldItem.addActionListener(this);
1133
- alignItem = menu.add(new MenuItem("Align"));
1185
+ alignItem = menu.add(new MenuItem("Align Objects"));
11341186 alignItem.addActionListener(this);
1135
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1136
- mirrorItem.addActionListener(this);
11371187 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11381188 reduceMorphItem.addActionListener(this);
11391189 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11401190 reduce34MorphItem.addActionListener(this);
1141
-
1191
+ menu.add("-");
11421192 menu.add(computeAOItem = new MenuItem("Compute AO"));
11431193 computeAOItem.addActionListener(this);
1144
- menu.add("-");
11451194
1195
+ if (Globals.ADVANCED)
1196
+ {
1197
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1198
+ mirrorItem.addActionListener(this);
1199
+ menu.add("-");
11461200 menu.add(memoryItem = new MenuItem("Memory Usage"));
11471201 memoryItem.addActionListener(this);
11481202 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1165,6 +1219,7 @@
11651219 menu.add("-");
11661220 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11671221 editScriptItem.addActionListener(this);
1222
+ }
11681223 }
11691224
11701225 void ScreenFit()
....@@ -1493,9 +1548,9 @@
14931548
14941549 void Overwrite(int mask)
14951550 {
1496
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1551
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14971552 {
1498
- Object3D content = GrafreeD.clipboard.get(0);
1553
+ Object3D content = Grafreed.clipboard.get(0);
14991554
15001555 if (content instanceof cGroup && ((cGroup)content).transientlink )
15011556 content = ((cGroup)content).get(0);
....@@ -1518,6 +1573,7 @@
15181573 //
15191574 public void actionPerformed(ActionEvent event) // , Object arg)
15201575 {
1576
+ Object source = event.getSource();
15211577 /*
15221578 if (event.getSource() == nameField)
15231579 {
....@@ -1529,11 +1585,11 @@
15291585 }
15301586 else
15311587 */
1532
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1588
+ if (source == lookAtItem || source == lookFromItem)
15331589 {
15341590 ScreenFit();
15351591 } else
1536
- if (event.getSource() == switchItem)
1592
+ if (source == switchItem)
15371593 {
15381594 cVector v1 = new cVector();
15391595 cVector v2 = new cVector();
....@@ -1542,11 +1598,11 @@
15421598 objEditor.cameraView.renderCamera.setAim(v2, v1);
15431599 objEditor.cameraView.repaint();
15441600 } else
1545
- if (event.getSource() == rectoidItem)
1601
+ if (source == rectoidItem)
15461602 {
15471603 makeSomething(new Box());
15481604 } else
1549
- if (event.getSource() == particleItem)
1605
+ if (source == particleItem)
15501606 {
15511607 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15521608 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1567,9 +1623,9 @@
15671623 applyExample(particleGeom, "SMOKE");
15681624 makeSomething(particleGeom);
15691625 } else
1570
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1626
+ if (source == ragdollItem || source == ragdoll2Item)
15711627 {
1572
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1628
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15731629
15741630 ragdoll.toParent = LA.newMatrix();
15751631 ragdoll.fromParent = LA.newMatrix();
....@@ -1587,7 +1643,7 @@
15871643 } else
15881644 /*
15891645 */
1590
- if (event.getSource() == heightFieldItem)
1646
+ if (source == heightFieldItem)
15911647 {
15921648 Object3D obj = new Object3D();
15931649
....@@ -1625,31 +1681,31 @@
16251681
16261682 makeSomething(obj);
16271683 } else
1628
- if (event.getSource() == gridItem)
1684
+ if (source == gridItem)
16291685 {
16301686 makeSomething(new Grid());
16311687 } else
1632
- if (event.getSource() == ellipsoidItem)
1688
+ if (source == ellipsoidItem)
16331689 {
16341690 makeSomething(new Sphere());
16351691 } else
1636
- if (event.getSource() == coneItem)
1692
+ if (source == coneItem)
16371693 {
16381694 makeSomething(new Cone());
16391695 } else
1640
- if (event.getSource() == torusItem)
1696
+ if (source == torusItem)
16411697 {
16421698 makeSomething(new Torus());
16431699 } else
1644
- if (event.getSource() == superItem)
1700
+ if (source == superItem)
16451701 {
16461702 makeSomething(new Superellipsoid());
16471703 } else
1648
- if (event.getSource() == kleinItem)
1704
+ if (source == kleinItem)
16491705 {
16501706 makeSomething(new Klein());
16511707 } else
1652
- if (event.getSource() == blobItem)
1708
+ if (source == blobItem)
16531709 {
16541710 Blob blob = new Blob();
16551711 BlobComponent comp = new BlobComponent();
....@@ -1657,15 +1713,15 @@
16571713 //blob.retile();
16581714 makeSomething(blob);
16591715 } else
1660
- if (event.getSource() == latheItem)
1716
+ if (source == latheItem)
16611717 {
16621718 makeSomething(new Lathe());
16631719 } else
1664
- if (event.getSource() == bezierItem)
1720
+ if (source == bezierItem)
16651721 {
16661722 makeSomething(new BezierSurface());
16671723 } else
1668
- if (event.getSource() == checkerItem)
1724
+ if (source == overlayItem)
16691725 {
16701726 /*
16711727 Object3D obj = new BezierSurface(5,8);
....@@ -1680,7 +1736,7 @@
16801736 */
16811737 makeSomething(new Checker());
16821738 } else
1683
- if (event.getSource() == meshItem)
1739
+ if (source == meshItem)
16841740 {
16851741 Object3D itemtomake = new Object3D();
16861742 Object3D child;
....@@ -1701,35 +1757,35 @@
17011757 makeSomething(child);
17021758 }
17031759 } else
1704
- if (event.getSource() == springItem)
1760
+ if (source == springItem)
17051761 {
17061762 cSpring s = new cSpring();
17071763 s.setup();
17081764 makeSomething(s);
17091765 } else
1710
- if (event.getSource() == flagItem)
1766
+ if (source == flagItem)
17111767 {
17121768 cSpring s = new cFlag();
17131769 s.setup();
17141770 makeSomething(s);
17151771 } else
1716
- if (event.getSource() == lightItem)
1772
+ if (source == lightItem)
17171773 {
17181774 makeSomething(new Light());
17191775 } else
1720
- if (event.getSource() == csgItem)
1776
+ if (source == csgItem)
17211777 {
17221778 group(new CSG());
17231779 } else
1724
- if (event.getSource() == templateItem)
1780
+ if (source == templateItem)
17251781 {
17261782 group(new cTemplate());
17271783 } else
1728
- if (event.getSource() == attributeItem)
1784
+ if (source == attributeItem)
17291785 {
17301786 makeSomething(new Attribute());
17311787 } else
1732
- if (event.getSource() == pointflowItem)
1788
+ if (source == pointflowItem)
17331789 {
17341790 makeSomething(new PointFlow());
17351791 } else
....@@ -1741,7 +1797,7 @@
17411797 } else
17421798 */
17431799
1744
- if (event.getSource() == superLoopItem)
1800
+ if (source == superLoopItem)
17451801 {
17461802 Composite g = new cGroup();
17471803 for (int i=0; i<15; i++)
....@@ -1763,7 +1819,7 @@
17631819
17641820 group(g);
17651821 } else
1766
- if (event.getSource() == loopItem)
1822
+ if (source == loopItem)
17671823 {
17681824 Composite csg = new GroupLeaf();
17691825 csg.count = 5;
....@@ -1772,7 +1828,7 @@
17721828 csg.addChild(child);
17731829 child.addChild(csg);
17741830 } else
1775
- if (event.getSource() == doubleItem)
1831
+ if (source == doubleItem)
17761832 {
17771833 Composite csg = new GroupLeaf();
17781834 csg.count = 5;
....@@ -1784,7 +1840,7 @@
17841840 csg.addChild(child);
17851841 child.addChild(csg);
17861842 } else
1787
- if (event.getSource() == tripleItem)
1843
+ if (source == tripleItem)
17881844 {
17891845 Composite csg = new GroupLeaf();
17901846 csg.count = 4;
....@@ -1800,70 +1856,83 @@
18001856 child.addChild(csg);
18011857 } else
18021858
1803
- if (event.getSource() == importGFDItem)
1859
+ if (source == importGFDItem)
18041860 {
18051861 ImportGFD();
18061862 } else
1807
- if (event.getSource() == importVRMLX3DItem)
1863
+ if (source == importVRMLX3DItem)
18081864 {
18091865 ImportVRMLX3D();
18101866 } else
1811
- if (event.getSource() == import3DSItem)
1867
+ if (source == import3DSItem)
18121868 {
18131869 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
18141870 } else
1815
- if (event.getSource() == importOBJItem)
1871
+ if (source == importOBJItem)
18161872 {
1817
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1873
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1874
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1875
+ browser.setVisible(true);
1876
+ String filename = browser.getFile();
1877
+ if (filename != null && filename.length() > 0)
1878
+ {
1879
+ String fullname = browser.getDirectory() + filename;
1880
+ makeSomething(ReadOBJ(fullname), true);
1881
+ }
18181882 } else
1819
- if (event.getSource() == computeAOItem)
1883
+ if (source == computeAOItem)
18201884 {
18211885 Globals.drawMode = CameraPane.OCCLUSION;
18221886 Globals.theRenderer.repaint();
18231887 } else
1824
- if (event.getSource() == recompileItem)
1888
+ if (source == recompileItem)
18251889 {
18261890 Recompile();
18271891 refreshContents();
18281892 } else
1829
- if (event.getSource() == editScriptItem)
1893
+ if (source == editScriptItem)
18301894 {
18311895 OpenDialog();
18321896 refreshContents();
18331897 } else
1834
- if (event.getSource() == invariantsItem)
1898
+ if (source == invariantsItem)
18351899 {
18361900 System.out.println("Invariants:");
1837
- GrafreeD.grafreeD.universe.invariants();
1901
+ Grafreed.grafreeD.universe.invariants();
18381902 } else
1839
- if (event.getSource() == memoryItem)
1903
+ if (source == memoryItem)
18401904 {
18411905 //System.out.println("Invariants:");
18421906 PrintMemory();
18431907 } else
1844
- if (event.getSource() == pathItem)
1908
+ if (source == pathItem)
18451909 {
18461910 PrintPath();
18471911 } else
1848
- if (event.getSource() == analyzeItem)
1912
+ if (source == analyzeItem)
18491913 {
18501914 AnalyzeObject();
18511915 } else
1852
- if (event.getSource() == dumpItem)
1916
+ if (source == dumpItem)
18531917 {
18541918 DumpObject();
18551919 } else
1856
- if (event.getSource() == screenfitButton)
1920
+ if (source == oneStepButton)
1921
+ {
1922
+ Globals.ONESTEP = true;
1923
+ cameraView.repaint();
1924
+ } else
1925
+ if (source == screenfitButton)
18571926 {
18581927 //Reload(lastConverter, lastFilename, true);
18591928 ScreenFit();
18601929 } else
1861
- if (event.getSource() == screenfitpointButton)
1930
+ if (source == screenfitpointButton)
18621931 {
18631932 //Reload(lastConverter, lastFilename, true);
18641933 ScreenFitPoint();
18651934 } else
1866
- if (event.getSource() == snapobjectButton)
1935
+ if (source == snapobjectButton)
18671936 {
18681937 //Reload(lastConverter, lastFilename, true);
18691938 SnapObject();
....@@ -1874,13 +1943,13 @@
18741943 // Recompile();
18751944 // refreshContents();
18761945 // } else
1877
- if (event.getSource() == gcButton)
1946
+ if (source == gcButton)
18781947 {
18791948 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18801949 System.gc();
18811950 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18821951 } else
1883
- if (event.getSource() == editLeafItem)
1952
+ if (source == editLeafItem)
18841953 {
18851954 Object3D obj;
18861955 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1894,62 +1963,66 @@
18941963 }
18951964 refreshContents(true);
18961965 } else
1897
- if (event.getSource() == openWindowItem)
1966
+ if (source == openWindowItem)
18981967 {
18991968 EditSelection(true);
19001969 } else
1901
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1970
+ if (source == cutItem || source == clearButton)
19021971 {
19031972 loadClipboard(true);
19041973 } else
1905
- if (event.getSource() == duplicateItem)
1974
+ if (source == duplicateItem)
19061975 {
1907
- Object3D keep = GrafreeD.clipboard;
1976
+ Object3D keep = Grafreed.clipboard;
19081977 loadClipboard(false);
19091978 paste(false);
1910
- GrafreeD.clipboard = keep;
1979
+ Grafreed.clipboard = keep;
19111980 } else
1912
- if (event.getSource() == cloneItem)
1981
+ if (source == cloneItem)
19131982 {
19141983 CloneSelection(false);
19151984 } else
1916
- if (event.getSource() == cloneSupportItem)
1985
+ if (source == cloneSupportItem)
19171986 {
19181987 CloneSelection(true);
19191988 } else
1920
- if (event.getSource() == copyItem)
1989
+ if (source == copyItem)
19211990 {
19221991 loadClipboard(false);
19231992 } else
1924
- if (event.getSource() == pasteItem)
1993
+ if (source == pasteItem)
19251994 {
19261995 paste(false);
19271996 } else
1928
- if (event.getSource() == pasteLinkItem)
1997
+ if (source == pasteIntoItem)
19291998 {
1930
- pasteInto(false);
1999
+ pasteInto(true, false);
19312000 } else
1932
- if (event.getSource() == pasteCloneItem)
2001
+ if (source == pasteLinkItem)
19332002 {
1934
- pasteInto(true);
2003
+ pasteInto(false, false);
19352004 } else
1936
- if (event.getSource() == pasteExpandItem)
2005
+ if (source == pasteCloneItem)
2006
+ {
2007
+ pasteInto(true, true);
2008
+ } else
2009
+ if (source == pasteExpandItem)
19372010 {
19382011 paste(true);
19392012 } else
1940
- if (event.getSource() == synchronizeItem)
2013
+ if (source == synchronizeItem)
19412014 {
19422015 Overwrite(Object3D.TRANSFORM);
19432016 } else
1944
- if (event.getSource() == overwriteNameItem)
2017
+ if (source == overwriteNameItem)
19452018 {
19462019 Overwrite(Object3D.NAME);
19472020 } else
1948
- if (event.getSource() == overwriteUVItem)
2021
+ if (source == overwriteUVItem)
19492022 {
19502023 Overwrite(Object3D.UV);
19512024 } else
1952
- if (event.getSource() == overwriteMatItem)
2025
+ if (source == overwriteMatItem)
19532026 {
19542027 /* july 2015
19552028 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1969,7 +2042,7 @@
19692042
19702043 Overwrite(dropAttributes);
19712044 }
1972
- if (event.getSource() == overwriteGeoItem)
2045
+ if (source == overwriteGeoItem)
19732046 {
19742047 Overwrite(Object3D.GEOMETRY);
19752048 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1986,7 +2059,7 @@
19862059 // refreshContents();
19872060 // }
19882061 } else
1989
- if (event.getSource() == generateMeshItem)
2062
+ if (source == generateMeshItem)
19902063 {
19912064 //if (group.selection.size() == 1)
19922065 // for (int i=0; i<group.selection.size(); i++)
....@@ -1997,7 +2070,7 @@
19972070 ResetModel();
19982071 refreshContents();
19992072 } else
2000
- if (event.getSource() == extractGeometriesItem)
2073
+ if (source == extractGeometriesItem)
20012074 {
20022075 boolean one = false;
20032076
....@@ -2024,7 +2097,7 @@
20242097 ResetModel();
20252098 refreshContents();
20262099 } else
2027
- if (event.getSource() == cloneGeometriesItem)
2100
+ if (source == cloneGeometriesItem)
20282101 {
20292102 boolean one = false;
20302103
....@@ -2050,7 +2123,7 @@
20502123 ResetModel();
20512124 refreshContents();
20522125 } else
2053
- if (event.getSource() == shareGeometriesItem)
2126
+ if (source == shareGeometriesItem)
20542127 {
20552128 boolean one = false;
20562129
....@@ -2080,7 +2153,7 @@
20802153 refreshContents();
20812154 }
20822155 } else
2083
- if (event.getSource() == mergeGeometriesItem)
2156
+ if (source == mergeGeometriesItem)
20842157 {
20852158 boolean one = false;
20862159
....@@ -2110,7 +2183,7 @@
21102183 ResetModel();
21112184 refreshContents();
21122185 } else
2113
- if (event.getSource() == linkverticesItem)
2186
+ if (source == linkverticesItem)
21142187 {
21152188 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21162189 // {
....@@ -2123,9 +2196,9 @@
21232196 // group.selection.get(0).setMasterThis(content); // should be identity
21242197 // refreshContents();
21252198 // }
2126
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2199
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21272200 {
2128
- Object3D content = GrafreeD.clipboard.get(0);
2201
+ Object3D content = Grafreed.clipboard.get(0);
21292202
21302203 if (content instanceof cGroup && ((cGroup)content).transientlink )
21312204 content = ((cGroup)content).get(0);
....@@ -2133,38 +2206,38 @@
21332206 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21342207 for (int i=0; i<group.selection.size(); i++)
21352208 {
2136
- boolean random = CameraPane.RANDOM;
2137
- CameraPane.RANDOM = false; // parse all random nodes
2209
+ boolean random = CameraPane.SWITCH;
2210
+ CameraPane.SWITCH = false; // parse all random nodes
21382211 group.selection.get(i).linkVerticesThis(content);
21392212 // group.selection.get(i).setMasterThis(content); // should be identity
2140
- CameraPane.RANDOM = random;
2213
+ CameraPane.SWITCH = random;
21412214 }
21422215 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21432216 refreshContents();
21442217 }
21452218 } else
2146
- if (event.getSource() == resetsupportItem)
2219
+ if (source == resetsupportItem)
21472220 {
21482221 for (int i=0; i<group.selection.size(); i++)
21492222 {
2150
- boolean random = CameraPane.RANDOM;
2151
- CameraPane.RANDOM = false; // parse all random nodes
2223
+ boolean random = CameraPane.SWITCH;
2224
+ CameraPane.SWITCH = false; // parse all random nodes
21522225 group.selection.get(i).linkVerticesThis(null);
2153
- CameraPane.RANDOM = random;
2226
+ CameraPane.SWITCH = random;
21542227 }
21552228
21562229 refreshContents();
21572230 } else
2158
- if (event.getSource() == relinkverticesItem)
2231
+ if (source == relinkverticesItem)
21592232 {
2160
- boolean random = CameraPane.RANDOM;
2161
- CameraPane.RANDOM = false; // parse all random nodes
2233
+ boolean random = CameraPane.SWITCH;
2234
+ CameraPane.SWITCH = false; // parse all random nodes
21622235 group.selection.RelinkToSupport();
2163
- CameraPane.RANDOM = random;
2236
+ CameraPane.SWITCH = random;
21642237
21652238 refreshContents();
21662239 } else
2167
- if (event.getSource() == resetreferencesItem)
2240
+ if (source == resetreferencesItem)
21682241 {
21692242 for (int i=0; i<group.selection.size(); i++)
21702243 {
....@@ -2173,11 +2246,11 @@
21732246
21742247 refreshContents();
21752248 } else
2176
- if (event.getSource() == setMasterItem)
2249
+ if (source == setMasterItem)
21772250 {
2178
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2251
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21792252 {
2180
- Object3D content = GrafreeD.clipboard.get(0);
2253
+ Object3D content = Grafreed.clipboard.get(0);
21812254
21822255 if (content instanceof cGroup && ((cGroup)content).transientlink )
21832256 content = ((cGroup)content).get(0);
....@@ -2186,13 +2259,13 @@
21862259 refreshContents();
21872260 }
21882261 } else
2189
- if (event.getSource() == poseMeshItem)
2262
+ if (source == poseMeshItem)
21902263 {
21912264 if (group.selection.size() == 1)
21922265 {
2193
- if (GrafreeD.clipboard.size() == 1)
2266
+ if (Grafreed.clipboard.size() == 1)
21942267 {
2195
- Object3D content = GrafreeD.clipboard.get(0);
2268
+ Object3D content = Grafreed.clipboard.get(0);
21962269
21972270 if (content instanceof cGroup && ((cGroup)content).transientlink )
21982271 content = ((cGroup)content).get(0);
....@@ -2205,19 +2278,19 @@
22052278 }
22062279
22072280 } else
2208
- if (event.getSource() == revertMeshItem)
2281
+ if (source == revertMeshItem)
22092282 {
22102283 RevertMeshes();
22112284 } else
2212
- if (event.getSource() == resetMeshItem)
2285
+ if (source == resetAllItem)
22132286 {
22142287 ResetAll();
22152288 } else
2216
- if (event.getSource() == stepAllItem)
2289
+ if (source == stepAllItem)
22172290 {
22182291 StepAll();
22192292 } else
2220
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2293
+ if (source == clearItem) // || event.getSource() == clearButton)
22212294 {
22222295 //int indices[] = jList.getSelectedIndices();
22232296 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2225,46 +2298,46 @@
22252298
22262299 ClearSelection(false);
22272300 } else
2228
- if (event.getSource() == clearAllItem)
2301
+ if (source == clearAllItem)
22292302 {
22302303 ClearSelection(true);
22312304 } else
2232
- if (event.getSource() == grabItem)
2305
+ if (source == grabItem)
22332306 {
22342307 group(new cGroup(), true);
22352308 } else
2236
- if (event.getSource() == hideItem)
2309
+ if (source == hideItem)
22372310 {
22382311 group(new HiddenObject());
22392312 } else
2240
- if (event.getSource() == frontItem)
2313
+ if (source == frontItem)
22412314 {
22422315 front();
22432316 } else
2244
- if (event.getSource() == backItem)
2317
+ if (source == backItem)
22452318 {
22462319 back();
22472320 } else
2248
- if (event.getSource() == cameraItem)
2321
+ if (source == cameraItem)
22492322 {
22502323 makeSomething(new Camera());
22512324 } else
2252
- if (event.getSource() == compositeItem)
2325
+ if (source == compositeItem)
22532326 {
22542327 group(new Composite());
22552328 } else
2256
- if (event.getSource() == randomItem)
2329
+ if (source == randomItem)
22572330 {
22582331 RandomNode random = new RandomNode();
22592332 group(random);
22602333 if (random.size() > 0)
2261
- random.name = random.get(0).name + "Rnd";
2334
+ random.name = random.get(0).name + "Switch";
22622335 } else
2263
- if (event.getSource() == physicsItem)
2336
+ if (source == physicsItem)
22642337 {
22652338 group(new PhysicsNode());
22662339 } else
2267
- if (event.getSource() == frameselectorItem)
2340
+ if (source == frameselectorItem)
22682341 {
22692342 for (int i=0; i<group.selection.size(); i++)
22702343 {
....@@ -2276,7 +2349,7 @@
22762349 ResetModel();
22772350 refreshContents();
22782351 } else
2279
- if (event.getSource() == switchGeoItem)
2352
+ if (source == switchGeoItem)
22802353 {
22812354 for (int i=0; i<group.selection.size(); i++)
22822355 {
....@@ -2288,7 +2361,7 @@
22882361 ResetModel();
22892362 refreshContents();
22902363 } else
2291
- if (event.getSource() == switchTransfoItem)
2364
+ if (source == switchTransfoItem)
22922365 {
22932366 for (int i=0; i<group.selection.size(); i++)
22942367 {
....@@ -2300,7 +2373,7 @@
23002373 ResetModel();
23012374 refreshContents();
23022375 } else
2303
- if (event.getSource() == morphItem)
2376
+ if (source == morphItem)
23042377 {
23052378 for (int i=0; i<group.selection.size(); i++)
23062379 {
....@@ -2312,7 +2385,7 @@
23122385 ResetModel();
23132386 refreshContents();
23142387 } else
2315
- if (event.getSource() == scriptNodeItem)
2388
+ if (source == scriptNodeItem)
23162389 {
23172390 boolean atleastone = false;
23182391
....@@ -2351,31 +2424,31 @@
23512424 }
23522425 }
23532426 } else
2354
- if (event.getSource() == linkerItem)
2427
+ if (source == linkerItem)
23552428 {
23562429 group(new cLinker());
23572430 } else
2358
- if (event.getSource() == textureItem)
2431
+ if (source == textureItem)
23592432 {
23602433 group(new TextureNode());
23612434 } else
2362
- if (event.getSource() == billboardItem)
2435
+ if (source == billboardItem)
23632436 {
23642437 group(new BillboardNode());
23652438 } else
2366
- if (event.getSource() == shadowXItem)
2439
+ if (source == shadowXItem)
23672440 {
23682441 CastShadow(0);
23692442 } else
2370
- if (event.getSource() == shadowYItem)
2443
+ if (source == shadowYItem)
23712444 {
23722445 CastShadow(1);
23732446 } else
2374
- if (event.getSource() == shadowZItem)
2447
+ if (source == shadowZItem)
23752448 {
23762449 CastShadow(2);
23772450 } else
2378
- if (event.getSource() == ungroupItem)
2451
+ if (source == ungroupItem)
23792452 {
23802453 //ungroup();
23812454 for (int i=0; i<group.selection.size(); i++)
....@@ -2387,179 +2460,187 @@
23872460
23882461 refreshContents();
23892462 } else
2390
- if (event.getSource() == genUVItem)
2463
+ if (source == genUVItem)
23912464 {
23922465 GenUV();
23932466 } else
2394
- if (event.getSource() == genNormalsCADItem)
2467
+ if (source == genNormalsCADItem)
23952468 {
23962469 GenNormals(true);
23972470 } else
2398
- if (event.getSource() == genNormalsMESHItem)
2471
+ if (source == genNormalsMESHItem)
23992472 {
24002473 GenNormals(true); // TODO
24012474 } else
2402
- if (event.getSource() == genNormalsORGANItem)
2475
+ if (source == genNormalsORGANItem)
24032476 {
24042477 GenNormals(false);
24052478 } else
2406
- if (event.getSource() == genNormalsMINEItem)
2479
+ if (source == genNormalsMINEItem)
24072480 {
24082481 GenNormalsMINE();
24092482 } else
2410
- if (event.getSource() == stripifyItem)
2483
+ if (source == stripifyItem)
24112484 {
24122485 Stripify();
24132486 } else
2414
- if (event.getSource() == unstripifyItem)
2487
+ if (source == unstripifyItem)
24152488 {
24162489 Unstripify();
24172490 } else
2418
- if (event.getSource() == trimItem)
2491
+ if (source == trimItem)
24192492 {
24202493 Trim();
24212494 } else
2422
- if (event.getSource() == untrimItem)
2495
+ if (source == untrimItem)
24232496 {
24242497 Untrim();
24252498 } else
2426
- if (event.getSource() == clearColorsItem)
2499
+ if (source == clearColorsItem)
24272500 {
24282501 ClearColors();
24292502 } else
2430
- if (event.getSource() == clearMaterialsItem)
2503
+ if (source == clearMaterialsItem)
24312504 {
24322505 ClearMaterials();
24332506 } else
2434
- if (event.getSource() == liveleavesItem)
2507
+ if (source == liveleavesItem)
24352508 {
24362509 LiveLeaves(true);
24372510 } else
2438
- if (event.getSource() == unliveleavesItem)
2511
+ if (source == unliveleavesItem)
24392512 {
24402513 LiveLeaves(false);
24412514 } else
2442
- if (event.getSource() == supportleavesItem)
2515
+ if (source == supportleavesItem)
24432516 {
24442517 SupportLeaves(true);
24452518 } else
2446
- if (event.getSource() == unsupportleavesItem)
2519
+ if (source == unsupportleavesItem)
24472520 {
24482521 SupportLeaves(false);
24492522 } else
2450
- if (event.getSource() == hideleavesItem)
2523
+ if (source == hideleavesItem)
24512524 {
24522525 HideLeaves(true);
24532526 } else
2454
- if (event.getSource() == showleavesItem)
2527
+ if (source == showleavesItem)
24552528 {
24562529 HideLeaves(false);
24572530 } else
2458
- if (event.getSource() == markleavesItem)
2531
+ if (source == markleavesItem)
24592532 {
24602533 MarkLeaves(true);
24612534 } else
2462
- if (event.getSource() == unmarkleavesItem)
2535
+ if (source == unmarkleavesItem)
24632536 {
24642537 MarkLeaves(false);
24652538 } else
2466
- if (event.getSource() == flipVItem)
2539
+ if (source == flipVItem)
24672540 {
24682541 FlipV(true);
24692542 } else
2470
- if (event.getSource() == unflipVItem)
2543
+ if (source == unflipVItem)
24712544 {
24722545 FlipV(false);
24732546 } else
2474
- if (event.getSource() == lowTexturesItem)
2547
+ if (source == lowTexturesItem)
24752548 {
24762549 SetTexRes(0);
24772550 } else
2478
- if (event.getSource() == normalTexturesItem)
2551
+ if (source == normalTexturesItem)
24792552 {
24802553 SetTexRes(1);
24812554 } else
2482
- if (event.getSource() == highTexturesItem)
2555
+ if (source == highTexturesItem)
24832556 {
24842557 SetTexRes(2);
24852558 } else
2486
- if (event.getSource() == veryhighTexturesItem)
2559
+ if (source == veryhighTexturesItem)
24872560 {
24882561 SetTexRes(3);
24892562 } else
2490
- if (event.getSource() == maxTexturesItem)
2563
+ if (source == maxTexturesItem)
24912564 {
24922565 SetTexRes(4);
24932566 } else
2494
- if (event.getSource() == panoTexturesItem)
2567
+ if (source == panoTexturesItem)
24952568 {
24962569 SetTexRes(5);
24972570 } else
2498
- if (event.getSource() == reverseNormalsItem)
2571
+ if (source == reverseNormalsItem)
24992572 {
25002573 ReverseNormals();
25012574 } else
2502
- if (event.getSource() == parseverticesItem)
2575
+ if (source == parseverticesItem)
25032576 {
25042577 ParseVertices();
25052578 } else
2506
- if (event.getSource() == textureFieldItem)
2579
+ if (source == textureFieldItem)
25072580 {
25082581 TextureVertices();
25092582 } else
2510
- if (event.getSource() == alignItem)
2583
+ if (source == alignItem)
25112584 {
25122585 Align();
25132586 } else
2514
- if (event.getSource() == mirrorItem)
2587
+ if (source == mirrorItem)
25152588 {
25162589 MirrorPoses();
25172590 } else
2518
- if (event.getSource() == reduceMorphItem)
2591
+ if (source == reduceMorphItem)
25192592 {
25202593 MeshReduction(false);
25212594 } else
2522
- if (event.getSource() == reduce34MorphItem)
2595
+ if (source == reduce34MorphItem)
25232596 {
25242597 MeshReduction(true);
25252598 } else
2526
- if (event.getSource() == reverseTrianglesItem)
2599
+ if (source == reverseTrianglesItem)
25272600 {
25282601 ReverseTriangles();
25292602 } else
2530
- if (event.getSource() == reduceMeshItem)
2603
+ if (source == reduceMeshItem)
25312604 {
25322605 ReduceMesh(false);
25332606 } else
2534
- if (event.getSource() == reduce34MeshItem)
2607
+ if (source == reduce34MeshItem)
25352608 {
25362609 ReduceMesh(true);
25372610 } else
2538
- if (event.getSource() == increaseMeshItem)
2611
+ if (source == increaseMeshItem)
25392612 {
25402613 IncreaseMesh();
25412614 } else
2542
- if (event.getSource() == clipMeshItem)
2615
+ if (source == clipMeshItem)
25432616 {
25442617 ClipMesh();
25452618 } else
2546
- if (event.getSource() == smoothMeshItem)
2619
+ if (source == smoothMeshItem)
25472620 {
25482621 SmoothMesh();
25492622 } else
2550
- if (event.getSource() == transformgeometryItem)
2623
+ if (source == transformGeometryItem)
25512624 {
25522625 TransformGeometry();
25532626 } else
2554
- if (event.getSource() == resetTransformItem)
2627
+ if (source == transformChildrenItem)
2628
+ {
2629
+ TransformChildren();
2630
+ } else
2631
+ if (source == resetTransformItem)
25552632 {
25562633 ResetTransform();
25572634 } else
2558
- if (event.getSource() == resetCentroidItem)
2635
+ if (source == resetCentroidItem)
25592636 {
2560
- ResetCentroid();
2637
+ ResetCentroid(true);
25612638 } else
2562
- if (event.getSource() == resetParentItem)
2639
+ if (source == resetCentroidXZItem)
2640
+ {
2641
+ ResetCentroid(false);
2642
+ } else
2643
+ if (source == resetParentItem)
25632644 {
25642645 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25652646 {
....@@ -2569,7 +2650,7 @@
25692650
25702651 refreshContents();
25712652 } else
2572
- if (event.getSource() == repairParentItem)
2653
+ if (source == repairParentItem)
25732654 {
25742655 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25752656 {
....@@ -2583,7 +2664,7 @@
25832664
25842665 refreshContents();
25852666 } else
2586
- if (event.getSource() == repairShadowItem)
2667
+ if (source == repairShadowItem)
25872668 {
25882669 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25892670 {
....@@ -2597,7 +2678,7 @@
25972678
25982679 refreshContents();
25992680 } else
2600
- if (event.getSource() == sortbysizeItem)
2681
+ if (source == sortbysizeItem)
26012682 {
26022683 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26032684 {
....@@ -2609,7 +2690,7 @@
26092690 ResetModel();
26102691 refreshContents();
26112692 } else
2612
- if (event.getSource() == sortbynameItem)
2693
+ if (source == sortbynameItem)
26132694 {
26142695 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26152696 {
....@@ -2621,7 +2702,7 @@
26212702 ResetModel();
26222703 refreshContents();
26232704 } else
2624
- if (event.getSource() == attachPigmentItem)
2705
+ if (source == attachPigmentItem)
26252706 {
26262707 String texture = GetFile("Attach pigment");
26272708 Object3D obj;
....@@ -2633,7 +2714,7 @@
26332714
26342715 refreshContents();
26352716 } else
2636
- if (event.getSource() == detachPigmentItem)
2717
+ if (source == detachPigmentItem)
26372718 {
26382719 Object3D obj;
26392720 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2644,7 +2725,7 @@
26442725
26452726 refreshContents();
26462727 } else
2647
- if (event.getSource() == attachBumpItem)
2728
+ if (source == attachBumpItem)
26482729 {
26492730 String texture = GetFile("Attach bump");
26502731 Object3D obj;
....@@ -2656,7 +2737,7 @@
26562737
26572738 refreshContents();
26582739 } else
2659
- if (event.getSource() == detachBumpItem)
2740
+ if (source == detachBumpItem)
26602741 {
26612742 Object3D obj;
26622743 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2667,7 +2748,7 @@
26672748
26682749 refreshContents();
26692750 } else
2670
- if (event.getSource() == pigmentBumpItem)
2751
+ if (source == pigmentBumpItem)
26712752 {
26722753 Object3D obj;
26732754 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2678,158 +2759,195 @@
26782759
26792760 refreshContents();
26802761 } else
2681
- if (event.getSource() == flashSelectionButton)
2762
+ if (source == flashSelectionButton)
26822763 {
26832764 CameraPane.flash = true;
26842765 refreshContents();
26852766 } else
2686
- if (event.getSource() == oneButton)
2767
+ if (source == oneButton)
26872768 {
26882769 } else
2689
- if (event.getSource() == twoButton)
2770
+ if (source == twoButton)
26902771 {
26912772 radio.layout = twoButton;
26922773 // bug
26932774 //gridPanel.setDividerLocation(1.0);
26942775 //bigPanel.setDividerLocation(0.0);
2695
- bigThree.remove(scenePanel);
2696
- bigThree.remove(centralPanel);
2697
- bigThree.remove(XYZPanel);
2698
- aWindowConstraints.gridx = 0;
2699
- aWindowConstraints.gridy = 0;
2700
- aWindowConstraints.gridwidth = 1;
2701
- // aConstraints.gridheight = 3;
2702
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2703
- aWindowConstraints.weightx = 0;
2704
- aWindowConstraints.weighty = 1;
2705
- //bigThree.add(jtp, aWindowConstraints);
2706
- aWindowConstraints.weightx = 1;
2707
- aWindowConstraints.gridwidth = 3;
2708
- // aConstraints.gridheight = 3;
2709
- aWindowConstraints.gridx = 1;
2710
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2711
- bigThree.add(centralPanel, aWindowConstraints);
2712
- aWindowConstraints.weightx = 0;
2713
- aWindowConstraints.gridx = 4;
2714
- aWindowConstraints.gridwidth = 1;
2715
- // aConstraints.gridheight = 3;
2716
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2717
- //bigThree.add(XYZPanel, aWindowConstraints);
2718
- bigThree.revalidate();
2776
+// bigThree.remove(scenePanel);
2777
+// bigThree.remove(centralPanel);
2778
+// bigThree.remove(XYZPanel);
2779
+// aWindowConstraints.gridx = 0;
2780
+// aWindowConstraints.gridy = 0;
2781
+// aWindowConstraints.gridwidth = 1;
2782
+// // aConstraints.gridheight = 3;
2783
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2784
+// aWindowConstraints.weightx = 0;
2785
+// aWindowConstraints.weighty = 1;
2786
+// //bigThree.add(jtp, aWindowConstraints);
2787
+// aWindowConstraints.weightx = 1;
2788
+// aWindowConstraints.gridwidth = 3;
2789
+// // aConstraints.gridheight = 3;
2790
+// aWindowConstraints.gridx = 1;
2791
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2792
+// bigThree.add(centralPanel, aWindowConstraints);
2793
+// aWindowConstraints.weightx = 0;
2794
+// aWindowConstraints.gridx = 4;
2795
+// aWindowConstraints.gridwidth = 1;
2796
+// // aConstraints.gridheight = 3;
2797
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2798
+// //bigThree.add(XYZPanel, aWindowConstraints);
2799
+// scenePanel.setVisible(false);
2800
+// centralPanel.setVisible(true);
2801
+// XYZPanel.setVisible(false);
2802
+ bigThree.ClearUI();
2803
+ bigThree.add(centralPanel);
2804
+ bigThree.FlushUI();
27192805 } else
2720
- if (event.getSource() == threeButton)
2806
+ if (source == threeButton)
27212807 {
27222808 radio.layout = threeButton;
2723
- bigThree.remove(scenePanel);
2724
- bigThree.remove(centralPanel);
2725
- bigThree.remove(XYZPanel);
2726
- aWindowConstraints.gridx = 0;
2727
- aWindowConstraints.gridy = 0;
2728
- aWindowConstraints.gridwidth = 1;
2729
- // aConstraints.gridheight = 3;
2730
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2731
- aWindowConstraints.weightx = 0;
2732
- aWindowConstraints.weighty = 1;
2733
- //bigThree.add(jtp, aWindowConstraints);
2734
- aWindowConstraints.weightx = 1;
2735
- aWindowConstraints.gridwidth = 3;
2736
- // aConstraints.gridheight = 3;
2737
- aWindowConstraints.gridx = 1;
2738
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2739
- bigThree.add(centralPanel, aWindowConstraints);
2740
- aWindowConstraints.weightx = 0;
2741
- aWindowConstraints.gridx = 4;
2742
- aWindowConstraints.gridwidth = 1;
2743
- // aConstraints.gridheight = 3;
2744
- aConstraints.fill = GridBagConstraints.VERTICAL;
2745
- bigThree.add(XYZPanel, aWindowConstraints);
2746
- bigThree.revalidate();
2809
+
2810
+// bigThree.remove(scenePanel);
2811
+// bigThree.remove(centralPanel);
2812
+// bigThree.remove(XYZPanel);
2813
+// aWindowConstraints.gridx = 0;
2814
+// aWindowConstraints.gridy = 0;
2815
+// aWindowConstraints.gridwidth = 1;
2816
+// // aConstraints.gridheight = 3;
2817
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2818
+// aWindowConstraints.weightx = 0;
2819
+// aWindowConstraints.weighty = 1;
2820
+// //bigThree.add(jtp, aWindowConstraints);
2821
+// aWindowConstraints.weightx = 1;
2822
+// aWindowConstraints.gridwidth = 3;
2823
+// // aConstraints.gridheight = 3;
2824
+// aWindowConstraints.gridx = 1;
2825
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2826
+// bigThree.add(centralPanel, aWindowConstraints);
2827
+// aWindowConstraints.weightx = 0;
2828
+// aWindowConstraints.gridx = 4;
2829
+// aWindowConstraints.gridwidth = 1;
2830
+// // aConstraints.gridheight = 3;
2831
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2832
+// bigThree.add(XYZPanel, aWindowConstraints);
2833
+// bigThree.validate();
2834
+// scenePanel.setVisible(false);
2835
+// centralPanel.setVisible(true);
2836
+// XYZPanel.setVisible(true);
2837
+ bigThree.ClearUI();
2838
+ bigThree.add(centralPanel);
2839
+ bigThree.add(XYZPanel);
2840
+ bigThree.FlushUI();
27472841 } else
2748
- if (event.getSource() == fourButton)
2842
+ if (source == fourButton)
27492843 {
27502844 radio.layout = fourButton;
2751
- bigThree.remove(scenePanel);
2752
- bigThree.remove(centralPanel);
2753
- bigThree.remove(XYZPanel);
2754
- aWindowConstraints.gridx = 0;
2755
- aWindowConstraints.gridy = 0;
2756
- aWindowConstraints.gridwidth = 1;
2757
- // aWindowConstraints.gridheight = 3;
2758
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2759
- aWindowConstraints.weightx = 1;
2760
- aWindowConstraints.weighty = 1;
2761
- bigThree.add(scenePanel, aWindowConstraints);
2762
- aWindowConstraints.weightx = 1;
2763
- aWindowConstraints.gridwidth = 3;
2764
- // aConstraints.gridheight = 3;
2765
- aWindowConstraints.gridx = 1;
2766
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2767
- //bigThree.add(cameraPanel, aWindowConstraints);
2768
- aWindowConstraints.weightx = 0;
2769
- aWindowConstraints.gridx = 4;
2770
- aWindowConstraints.gridwidth = 1;
2771
- // aWindowConstraints.gridheight = 3;
2772
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2773
- //bigThree.add(XYZPanel, aWindowConstraints);
2774
- bigThree.revalidate();
2845
+
2846
+// bigThree.remove(scenePanel);
2847
+// bigThree.remove(centralPanel);
2848
+// bigThree.remove(XYZPanel);
2849
+// aWindowConstraints.gridx = 0;
2850
+// aWindowConstraints.gridy = 0;
2851
+// aWindowConstraints.gridwidth = 1;
2852
+// // aWindowConstraints.gridheight = 3;
2853
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2854
+// aWindowConstraints.weightx = 1;
2855
+// aWindowConstraints.weighty = 1;
2856
+// bigThree.add(scenePanel, aWindowConstraints);
2857
+// aWindowConstraints.weightx = 1;
2858
+// aWindowConstraints.gridwidth = 3;
2859
+// // aConstraints.gridheight = 3;
2860
+// aWindowConstraints.gridx = 1;
2861
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2862
+// //bigThree.add(cameraPanel, aWindowConstraints);
2863
+// aWindowConstraints.weightx = 0;
2864
+// aWindowConstraints.gridx = 4;
2865
+// aWindowConstraints.gridwidth = 1;
2866
+// // aWindowConstraints.gridheight = 3;
2867
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2868
+// //bigThree.add(XYZPanel, aWindowConstraints);
2869
+// bigThree.validate();
2870
+// scenePanel.setVisible(true);
2871
+// centralPanel.setVisible(false);
2872
+// XYZPanel.setVisible(false);
2873
+ bigThree.ClearUI();
2874
+ bigThree.add(scenePanel);
2875
+ bigThree.FlushUI();
27752876 } else
2776
- if (event.getSource() == sixButton)
2877
+ if (source == sixButton)
27772878 {
27782879 radio.layout = sixButton;
2779
- bigThree.remove(scenePanel);
2780
- bigThree.remove(centralPanel);
2781
- bigThree.remove(XYZPanel);
2782
- aWindowConstraints.gridx = 0;
2783
- aWindowConstraints.gridy = 0;
2784
- aWindowConstraints.gridwidth = 1;
2785
- // aConstraints.gridheight = 3;
2786
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2787
- aWindowConstraints.weightx = 0;
2788
- aWindowConstraints.weighty = 1;
2789
- bigThree.add(scenePanel, aWindowConstraints);
2790
- aWindowConstraints.weightx = 1;
2791
- aWindowConstraints.gridwidth = 3;
2792
- // aWindowConstraints.gridheight = 3;
2793
- aWindowConstraints.gridx = 1;
2794
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2795
- bigThree.add(centralPanel, aWindowConstraints);
2796
- aWindowConstraints.weightx = 0;
2797
- aWindowConstraints.gridx = 4;
2798
- aWindowConstraints.gridwidth = 1;
2799
- // aWindowConstraints.gridheight = 3;
2800
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2801
- //bigThree.add(XYZPanel, aConstraints);
2802
- bigThree.revalidate();
2880
+
2881
+// bigThree.remove(scenePanel);
2882
+// bigThree.remove(centralPanel);
2883
+// bigThree.remove(XYZPanel);
2884
+// aWindowConstraints.gridx = 0;
2885
+// aWindowConstraints.gridy = 0;
2886
+// aWindowConstraints.gridwidth = 1;
2887
+// // aConstraints.gridheight = 3;
2888
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2889
+// aWindowConstraints.weightx = 0;
2890
+// aWindowConstraints.weighty = 1;
2891
+// bigThree.add(scenePanel, aWindowConstraints);
2892
+// aWindowConstraints.weightx = 1;
2893
+// aWindowConstraints.gridwidth = 3;
2894
+// // aWindowConstraints.gridheight = 3;
2895
+// aWindowConstraints.gridx = 1;
2896
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2897
+// bigThree.add(centralPanel, aWindowConstraints);
2898
+// aWindowConstraints.weightx = 0;
2899
+// aWindowConstraints.gridx = 4;
2900
+// aWindowConstraints.gridwidth = 1;
2901
+// // aWindowConstraints.gridheight = 3;
2902
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2903
+// //bigThree.add(XYZPanel, aConstraints);
2904
+// bigThree.validate();
2905
+// scenePanel.setVisible(true);
2906
+// centralPanel.setVisible(true);
2907
+// XYZPanel.setVisible(false);
2908
+ bigThree.ClearUI();
2909
+ bigThree.add(scenePanel);
2910
+ bigThree.add(centralPanel);
2911
+ bigThree.FlushUI();
28032912 } else
2804
- if (event.getSource() == sevenButton)
2913
+ if (source == sevenButton)
28052914 {
28062915 radio.layout = sevenButton;
2807
- bigThree.remove(scenePanel);
2808
- bigThree.remove(centralPanel);
2809
- bigThree.remove(XYZPanel);
2810
- aWindowConstraints.gridx = 0;
2811
- aWindowConstraints.gridy = 0;
2812
- aWindowConstraints.gridwidth = 1;
2813
- // aWindowConstraints.gridheight = 3;
2814
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2815
- aWindowConstraints.weightx = 0;
2816
- aWindowConstraints.weighty = 1;
2817
- bigThree.add(scenePanel, aWindowConstraints);
2818
- aWindowConstraints.weightx = 1;
2819
- aWindowConstraints.gridwidth = 3;
2820
- // aWindowConstraints.gridheight = 3;
2821
- aWindowConstraints.gridx = 1;
2822
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2823
- bigThree.add(centralPanel, aWindowConstraints);
2824
- aWindowConstraints.weightx = 0;
2825
- aWindowConstraints.gridx = 4;
2826
- aWindowConstraints.gridwidth = 1;
2827
- // aConstraints.gridheight = 3;
2828
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2829
- bigThree.add(XYZPanel, aWindowConstraints);
2830
- bigThree.revalidate();
2916
+
2917
+// bigThree.remove(scenePanel);
2918
+// bigThree.remove(centralPanel);
2919
+// bigThree.remove(XYZPanel);
2920
+// aWindowConstraints.gridx = 0;
2921
+// aWindowConstraints.gridy = 0;
2922
+// aWindowConstraints.gridwidth = 1;
2923
+// // aWindowConstraints.gridheight = 3;
2924
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2925
+// aWindowConstraints.weightx = 0;
2926
+// aWindowConstraints.weighty = 1;
2927
+// bigThree.add(scenePanel, aWindowConstraints);
2928
+// aWindowConstraints.weightx = 1;
2929
+// aWindowConstraints.gridwidth = 3;
2930
+// // aWindowConstraints.gridheight = 3;
2931
+// aWindowConstraints.gridx = 1;
2932
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2933
+// bigThree.add(centralPanel, aWindowConstraints);
2934
+// aWindowConstraints.weightx = 0;
2935
+// aWindowConstraints.gridx = 4;
2936
+// aWindowConstraints.gridwidth = 1;
2937
+// // aConstraints.gridheight = 3;
2938
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2939
+// bigThree.add(XYZPanel, aWindowConstraints);
2940
+// bigThree.validate();
2941
+// scenePanel.setVisible(true);
2942
+// centralPanel.setVisible(true);
2943
+// XYZPanel.setVisible(true);
2944
+ bigThree.ClearUI();
2945
+ bigThree.add(scenePanel);
2946
+ bigThree.add(centralPanel);
2947
+ bigThree.add(XYZPanel);
2948
+ bigThree.FlushUI();
28312949 } else
2832
- if (event.getSource() == rootButton)
2950
+ if (source == rootButton)
28332951 {
28342952 Object3D obj;
28352953 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2841,7 +2959,7 @@
28412959
28422960 refreshContents(true);
28432961 } else
2844
- if (event.getSource() == closeButton)
2962
+ if (source == closeButton)
28452963 {
28462964 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28472965 cRadio ab;
....@@ -2862,11 +2980,11 @@
28622980 }
28632981 refreshContents(true);
28642982 } else
2865
- if (event.getSource() == editItem || event.getSource() == editButton)
2983
+ if (source == editItem || source == editButton)
28662984 {
28672985 EditSelection(false);
28682986 } else
2869
- if (event.getSource() == uneditButton)
2987
+ if (source == uneditButton)
28702988 {
28712989 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28722990 {
....@@ -2878,12 +2996,12 @@
28782996
28792997 child.editWindow = null; // ???????????
28802998 }
2881
- objEditor.ctrlPanel.revalidate();
2999
+ objEditor.ctrlPanel.FlushUI();
28823000 //objEditor.jTree.clearSelection();
28833001 //objEditor.ResetSliders();
28843002 refreshContents(true);
28853003 } else
2886
- if (event.getSource() == clearPanelButton)
3004
+ if (source == clearPanelButton)
28873005 {
28883006 assert(copy == group);
28893007 //copy.ClearUI();
....@@ -2894,7 +3012,7 @@
28943012 listUI.clear();
28953013 refreshContents(true);
28963014 } else
2897
- if (event.getSource() == allParamsButton)
3015
+ if (source == allParamsButton)
28983016 {
28993017 assert(copy == group);
29003018
....@@ -2915,19 +3033,19 @@
29153033
29163034 refreshContents(true);
29173035 } else
2918
- if (event.getSource() == unselectButton)
3036
+ if (source == unselectButton)
29193037 {
29203038 objEditor.jTree.clearSelection();
29213039 // ?? oct 2012 GrafreeD.clipboard.clear();
29223040 objEditor.ResetSliders();
29233041 refreshContents(true);
29243042 } else
2925
- if(event.getSource() instanceof cRadio)
3043
+ if(source instanceof cRadio)
29263044 {
29273045 group.parent = keepparent;
29283046 group.attributes = 0;
29293047 //group.editWindow = null;
2930
- /*cRadio*/ radio = (cRadio)event.getSource();
3048
+ /*cRadio*/ radio = (cRadio)source;
29313049 Object3D obj = radio.GetObject();
29323050 System.out.println("Edit " + obj);
29333051 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2962,7 +3080,9 @@
29623080 frontView.object = group;
29633081 sideView.object = group;
29643082 }
2965
- group.editWindow = this;
3083
+
3084
+// fix "+" issue group.editWindow = this;
3085
+
29663086 /*
29673087 currentLayout = radio.layout;
29683088 if (currentLayout == null)
....@@ -3036,6 +3156,28 @@
30363156 refreshContents();
30373157 }
30383158
3159
+ void TransformChildren()
3160
+ {
3161
+ Object3D obj;
3162
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3163
+ {
3164
+ obj = (Object3D)e.nextElement();
3165
+ obj.KeepTextureMatrices();
3166
+ obj.TransformChildren();
3167
+ obj.RestoreTextureMatrices();
3168
+
3169
+// if (obj.parent == null)
3170
+// {
3171
+// System.out.println("NULL PARENT!");
3172
+// new Exception().printStackTrace();
3173
+// }
3174
+// else
3175
+// TouchTransform(obj);
3176
+// //obj.parent.Touch();
3177
+ }
3178
+
3179
+ refreshContents();
3180
+ }
30393181
30403182 void ResetTransform()
30413183 {
....@@ -3148,7 +3290,7 @@
31483290 refreshContents();
31493291 }
31503292
3151
- void ResetCentroid()
3293
+ void ResetCentroid(boolean full)
31523294 {
31533295 Object3D obj;
31543296 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3163,12 +3305,16 @@
31633305 LA.matIdentity(Object3D.mat);
31643306 obj.getBounds(minima, maxima, false);
31653307 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3166
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3308
+ if (full)
3309
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31673310 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31683311 obj.TransformMesh(Object3D.mat);
3312
+
31693313 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3170
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3314
+ if (full)
3315
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31713316 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3317
+
31723318 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31733319 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31743320 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3234,9 +3380,9 @@
32343380 obj = (Object3D)e.nextElement();
32353381
32363382 System.out.println("Object is: " + obj);
3237
- GrafreeD.AnalyzeObject(obj);
3383
+ Grafreed.AnalyzeObject(obj);
32383384 System.out.println("Boundary rep: " + obj.bRep);
3239
- GrafreeD.AnalyzeObject(obj.bRep);
3385
+ Grafreed.AnalyzeObject(obj.bRep);
32403386
32413387 // System.err.println((size/1024) + " KB is the size of " + obj);
32423388 }
....@@ -3450,8 +3596,8 @@
34503596
34513597 void ParseVertices()
34523598 {
3453
- boolean epsequal = GrafreeD.epsequal;
3454
- GrafreeD.epsequal = true;
3599
+ boolean epsequal = Grafreed.epsequal;
3600
+ Grafreed.epsequal = true;
34553601
34563602 for (int i=0; i<group.selection.size(); i++)
34573603 {
....@@ -3476,7 +3622,7 @@
34763622 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34773623 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34783624
3479
- g.add(GrafreeD.clipboard);
3625
+ g.add(Grafreed.clipboard);
34803626
34813627 buffer.add(g);
34823628 }
....@@ -3491,7 +3637,7 @@
34913637 makeSomething(buffer, i==group.selection.size()-1);
34923638 }
34933639
3494
- GrafreeD.epsequal = epsequal;
3640
+ Grafreed.epsequal = epsequal;
34953641
34963642 refreshContents();
34973643 }
....@@ -3509,7 +3655,16 @@
35093655 String pigment = Object3D.GetPigment(tex);
35103656 //String bump = Object3D.GetBump(tex);
35113657
3512
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3658
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3659
+
3660
+ try
3661
+ {
3662
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3663
+ }
3664
+ catch (Exception e)
3665
+ {
3666
+ System.err.println("FAIL: " + node);
3667
+ }
35133668
35143669 double s = v.s;
35153670
....@@ -3597,11 +3752,11 @@
35973752
35983753 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35993754
3600
- boolean random = CameraPane.RANDOM;
3601
- CameraPane.RANDOM = false; // parse all random nodes
3755
+ boolean random = CameraPane.SWITCH;
3756
+ CameraPane.SWITCH = false; // parse all random nodes
36023757 lowres.linkVerticesThis(null);
36033758 lowres.linkVerticesThis(sn);
3604
- CameraPane.RANDOM = random;
3759
+ CameraPane.SWITCH = random;
36053760
36063761 System.err.flush();
36073762
....@@ -3641,7 +3796,7 @@
36413796 return;
36423797
36433798 Object3D poses = group.selection.get(0);
3644
- Object3D ref = GrafreeD.clipboard.get(0);
3799
+ Object3D ref = Grafreed.clipboard.get(0);
36453800
36463801 Object3D newgroup = new Object3D("Po:" + poses.name);
36473802
....@@ -3835,9 +3990,9 @@
38353990
38363991 void ClipMesh()
38373992 {
3838
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
3993
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38393994 {
3840
- Object3D content = GrafreeD.clipboard.get(0);
3995
+ Object3D content = Grafreed.clipboard.get(0);
38413996
38423997 if (content instanceof cGroup && ((cGroup)content).transientlink )
38433998 content = ((cGroup)content).get(0);
....@@ -3846,7 +4001,7 @@
38464001 // {
38474002 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38484003 // }
3849
- group.selection.ClipMesh(GrafreeD.clipboard);
4004
+ group.selection.ClipMesh(Grafreed.clipboard);
38504005 }
38514006 // group.selection.ClipMesh(GrafreeD.clipboard);
38524007 System.out.println("DONE.");
....@@ -3981,7 +4136,7 @@
39814136 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39824137
39834138 Object3D elem = (Object3D)group.selection.elementAt(i);
3984
- if(elem != group)
4139
+ if(elem != group || !newWindow)
39854140 {
39864141 // if (!(elem instanceof Composite))
39874142 // newWindow = false;
....@@ -4086,12 +4241,12 @@
40864241 System.err.println("info : " + child.GetPath());
40874242 }
40884243 }
4089
- else
4090
- {
4091
- objEditor.SetMaterial(group); // .GetMaterial());
4092
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4093
- System.err.println("info : " + group.GetPath());
4094
- }
4244
+// else
4245
+// {
4246
+// objEditor.SetMaterial(group); // .GetMaterial());
4247
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4248
+// System.err.println("info : " + group.GetPath());
4249
+// }
40954250
40964251 objEditor.SetText(); // jan 2014
40974252
....@@ -4186,12 +4341,12 @@
41864341 {
41874342 if (group.selection.isEmpty())
41884343 return;
4189
- GrafreeD.clipboardIsTempGroup = false;
4344
+ Grafreed.clipboardIsTempGroup = false;
41904345 Composite tGroup = null;
41914346 if (group.selection.size() > 0) // 1)
41924347 {
41934348 tGroup = new cGroup();
4194
- GrafreeD.clipboardIsTempGroup = true;
4349
+ Grafreed.clipboardIsTempGroup = true;
41954350 }
41964351
41974352 if (cut)
....@@ -4231,16 +4386,16 @@
42314386 //System.out.println("cut " + child);
42324387 //System.out.println("parent = " + child.parent);
42334388 // tmp.addChild(child);
4234
- if (GrafreeD.clipboardIsTempGroup)
4389
+ if (Grafreed.clipboardIsTempGroup)
42354390 tGroup.add/*Child*/(tmp);
42364391 else
4237
- GrafreeD.clipboard = tmp;
4392
+ Grafreed.clipboard = tmp;
42384393 }
42394394 else
4240
- if (GrafreeD.clipboardIsTempGroup)
4395
+ if (Grafreed.clipboardIsTempGroup)
42414396 tGroup.add/*Child*/(child);
42424397 else
4243
- GrafreeD.clipboard = child;
4398
+ Grafreed.clipboard = child;
42444399 }
42454400
42464401 //ResetModel();
....@@ -4272,21 +4427,21 @@
42724427 //System.out.println("cut " + elem);
42734428 //System.out.println("parent = " + elem.parent);
42744429 // tmp.addChild(elem);
4275
- if (GrafreeD.clipboardIsTempGroup)
4430
+ if (Grafreed.clipboardIsTempGroup)
42764431 tGroup.add/*Child*/(tmp);
42774432 else
4278
- GrafreeD.clipboard = tmp;
4433
+ Grafreed.clipboard = tmp;
42794434 }
42804435 else
4281
- if (GrafreeD.clipboardIsTempGroup)
4436
+ if (Grafreed.clipboardIsTempGroup)
42824437 tGroup.add/*Child*/(child);
42834438 else
4284
- GrafreeD.clipboard = child;
4439
+ Grafreed.clipboard = child;
42854440 }
42864441
42874442 }
4288
- if (GrafreeD.clipboardIsTempGroup)
4289
- GrafreeD.clipboard = tGroup;
4443
+ if (Grafreed.clipboardIsTempGroup)
4444
+ Grafreed.clipboard = tGroup;
42904445 if (cut)
42914446 {
42924447 ResetModel();
....@@ -4300,7 +4455,7 @@
43004455 // return;
43014456 boolean first = true;
43024457
4303
- if (GrafreeD.clipboardIsTempGroup)
4458
+ if (Grafreed.clipboardIsTempGroup)
43044459 {
43054460 Composite temp;
43064461
....@@ -4311,7 +4466,7 @@
43114466 temp = (Composite)Applet3D.clipboard.deepCopy();
43124467 */
43134468 Object3D elem;
4314
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4469
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43154470 {
43164471 Object3D child = (Object3D)e.nextElement();
43174472
....@@ -4345,21 +4500,21 @@
43454500 //Object3D cb = Applet3D.clipboard;
43464501 //temp.addChild(cb);
43474502 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4348
- assert(GrafreeD.clipboard.parent == null);
4349
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4350
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4351
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4352
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4503
+ assert(Grafreed.clipboard.parent == null);
4504
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4505
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4506
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4507
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43534508 else
4354
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4355
- GrafreeD.clipboard.get(0).parent = keepparent;
4509
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4510
+ Grafreed.clipboard.get(0).parent = keepparent;
43564511 }
43574512
43584513 ResetModel();
43594514 refreshContents();
43604515 }
43614516
4362
- void pasteInto(boolean copyit)
4517
+ void pasteInto(boolean copyit, boolean clone)
43634518 {
43644519 // if (GrafreeD.clipboard == null)
43654520 // return;
....@@ -4388,15 +4543,22 @@
43884543 if (copyit)
43894544 {
43904545 // paste(false);
4391
- CloneClipboard(false); // sept 2014
4546
+ if (clone)
4547
+ {
4548
+ CloneClipboard(false); // sept 2014
4549
+ }
4550
+ else
4551
+ {
4552
+ paste(false);
4553
+ }
43924554 }
43934555 else
43944556 {
43954557 boolean first = true;
43964558
4397
- if (GrafreeD.clipboardIsTempGroup)
4559
+ if (Grafreed.clipboardIsTempGroup)
43984560 {
4399
- Composite temp = (Composite)GrafreeD.clipboard;
4561
+ Composite temp = (Composite)Grafreed.clipboard;
44004562 Object3D copy;
44014563 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44024564 {
....@@ -4406,7 +4568,7 @@
44064568 }
44074569 } else
44084570 {
4409
- linkSomething(GrafreeD.clipboard); //.get(0));
4571
+ linkSomething(Grafreed.clipboard); //.get(0));
44104572 }
44114573 }
44124574 }
....@@ -4851,7 +5013,7 @@
48515013
48525014 void ImportVRMLX3D()
48535015 {
4854
- if (GrafreeD.standAlone)
5016
+ if (Grafreed.standAlone)
48555017 {
48565018 /**/
48575019 FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
....@@ -4868,7 +5030,7 @@
48685030
48695031 String GetFile(String dialogName)
48705032 {
4871
- if (GrafreeD.standAlone)
5033
+ if (Grafreed.standAlone)
48725034 {
48735035 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48745036 browser.show();
....@@ -4932,10 +5094,12 @@
49325094 cButton flashSelectionButton;
49335095 cButton editButton;
49345096 cButton uneditButton;
5097
+ JCheckBox allParamsButton;
49355098 cButton clearpanelButton;
4936
- cButton allParamsButton;
49375099 cButton unselectButton;
49385100
5101
+ cButton oneStepButton;
5102
+
49395103 cButton screenfitButton;
49405104 cButton screenfitpointButton;
49415105 cButton snapobjectButton;
....@@ -4979,7 +5143,7 @@
49795143 private MenuItem linkverticesItem;
49805144 private MenuItem relinkverticesItem;
49815145 private MenuItem setMasterItem;
4982
- private MenuItem resetMeshItem;
5146
+ private MenuItem resetAllItem;
49835147 private MenuItem stepAllItem;
49845148 private MenuItem revertMeshItem;
49855149 private MenuItem poseMeshItem;
....@@ -4990,6 +5154,7 @@
49905154 private MenuItem mergeGeometriesItem;
49915155 private MenuItem copyItem;
49925156 private MenuItem pasteItem;
5157
+ private MenuItem pasteIntoItem;
49935158 private MenuItem pasteLinkItem;
49945159 private MenuItem pasteCloneItem;
49955160 private MenuItem pasteExpandItem;
....@@ -5039,8 +5204,10 @@
50395204 private MenuItem panoTexturesItem;
50405205
50415206 private MenuItem resetCentroidItem;
5042
- private MenuItem transformgeometryItem;
5207
+ private MenuItem resetCentroidXZItem;
50435208 private MenuItem resetTransformItem;
5209
+ private MenuItem transformGeometryItem;
5210
+ private MenuItem transformChildrenItem;
50445211 private MenuItem hideItem;
50455212 private MenuItem grabItem;
50465213 private MenuItem backItem;
....@@ -5087,7 +5254,7 @@
50875254 private MenuItem blobItem;
50885255 private MenuItem latheItem;
50895256 private MenuItem bezierItem;
5090
- private MenuItem checkerItem;
5257
+ private MenuItem overlayItem;
50915258 private MenuItem meshItem;
50925259 // private MenuItem meshGroupItem;
50935260 private MenuItem springItem;