Normand Briere
2019-06-03 e24558ddeacfc945b9e9ba0a32b552d04e2ed4dd
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
....@@ -905,7 +945,9 @@
905945 // objEditor.DropFile((java.io.File[]) object, true);
906946 // return;
907947 // }
908
- if (string.charAt(0) == '/')
948
+
949
+ // File path for Mac and Windows
950
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
909951 {
910952 // file(s)
911953 String[] names = string.split("\n");
....@@ -932,7 +974,7 @@
932974
933975 flashIt = false;
934976 CameraPane pane = (CameraPane) target;
935
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
977
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
936978 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
937979
938980 if (group.selection.size() == 1)
....@@ -959,11 +1001,11 @@
9591001 {
9601002 loadClipboard(true);
9611003 objEditor.jTree.setSelectionPath(destinationPath);
962
- pasteInto(false);
1004
+ pasteInto(false, false);
9631005 } else {
9641006 loadClipboard(false);
9651007 objEditor.jTree.setSelectionPath(destinationPath);
966
- pasteInto(false); // true); // ???
1008
+ pasteInto(false, false); // true); // ???
9671009 }
9681010 }
9691011 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1085,27 +1127,33 @@
10851127 kleinItem.addActionListener(this);
10861128 particleItem = menu.add(new MenuItem("Particle system"));
10871129 particleItem.addActionListener(this);
1130
+ if (Globals.ADVANCED)
1131
+ {
10881132 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10891133 ragdollItem.addActionListener(this);
10901134 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10911135 ragdoll2Item.addActionListener(this);
1136
+ }
10921137 menu.add("-");
1093
- meshItem = menu.add(new MenuItem("Mesh"));
1138
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10941139 meshItem.addActionListener(this);
10951140 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10961141 // meshGroupItem.addActionListener(this);
1142
+ if (Globals.ADVANCED)
1143
+ {
10971144 springItem = menu.add(new MenuItem("Spring"));
10981145 springItem.addActionListener(this);
10991146 flagItem = menu.add(new MenuItem("Flag"));
11001147 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);
11051148 blobItem = menu.add(new MenuItem("Blob"));
11061149 blobItem.addActionListener(this);
11071150 latheItem = menu.add(new MenuItem("Lathe"));
11081151 latheItem.addActionListener(this);
1152
+ }
1153
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1154
+ bezierItem.addActionListener(this);
1155
+ overlayItem = menu.add(new MenuItem("Overlay"));
1156
+ overlayItem.addActionListener(this);
11091157 lightItem = menu.add(new MenuItem("Light"));
11101158 lightItem.addActionListener(this);
11111159 menu.add("-");
....@@ -1115,34 +1163,39 @@
11151163 loopItem.addActionListener(this);
11161164 doubleItem = menu.add(new MenuItem("Fork"));
11171165 doubleItem.addActionListener(this);
1166
+ if (Globals.ADVANCED)
1167
+ {
11181168 tripleItem = menu.add(new MenuItem("Trident"));
11191169 tripleItem.addActionListener(this);
1170
+ }
11201171 }
11211172
11221173 void buildToolsMenu(Menu menu)
11231174 {
11241175 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11251176 animationItem.addItemListener(this);
1126
- animationItem.setState(CameraPane.ANIMATION);
1177
+ animationItem.setState(Globals.ANIMATION);
11271178
11281179 menu.add("-");
11291180 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11301181 parseverticesItem.addActionListener(this);
11311182 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11321183 textureFieldItem.addActionListener(this);
1133
- alignItem = menu.add(new MenuItem("Align"));
1184
+ alignItem = menu.add(new MenuItem("Align Objects"));
11341185 alignItem.addActionListener(this);
1135
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1136
- mirrorItem.addActionListener(this);
11371186 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11381187 reduceMorphItem.addActionListener(this);
11391188 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11401189 reduce34MorphItem.addActionListener(this);
1141
-
1190
+ menu.add("-");
11421191 menu.add(computeAOItem = new MenuItem("Compute AO"));
11431192 computeAOItem.addActionListener(this);
1144
- menu.add("-");
11451193
1194
+ if (Globals.ADVANCED)
1195
+ {
1196
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1197
+ mirrorItem.addActionListener(this);
1198
+ menu.add("-");
11461199 menu.add(memoryItem = new MenuItem("Memory Usage"));
11471200 memoryItem.addActionListener(this);
11481201 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1165,6 +1218,7 @@
11651218 menu.add("-");
11661219 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11671220 editScriptItem.addActionListener(this);
1221
+ }
11681222 }
11691223
11701224 void ScreenFit()
....@@ -1493,9 +1547,9 @@
14931547
14941548 void Overwrite(int mask)
14951549 {
1496
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1550
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14971551 {
1498
- Object3D content = GrafreeD.clipboard.get(0);
1552
+ Object3D content = Grafreed.clipboard.get(0);
14991553
15001554 if (content instanceof cGroup && ((cGroup)content).transientlink )
15011555 content = ((cGroup)content).get(0);
....@@ -1518,6 +1572,7 @@
15181572 //
15191573 public void actionPerformed(ActionEvent event) // , Object arg)
15201574 {
1575
+ Object source = event.getSource();
15211576 /*
15221577 if (event.getSource() == nameField)
15231578 {
....@@ -1529,11 +1584,11 @@
15291584 }
15301585 else
15311586 */
1532
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1587
+ if (source == lookAtItem || source == lookFromItem)
15331588 {
15341589 ScreenFit();
15351590 } else
1536
- if (event.getSource() == switchItem)
1591
+ if (source == switchItem)
15371592 {
15381593 cVector v1 = new cVector();
15391594 cVector v2 = new cVector();
....@@ -1542,11 +1597,11 @@
15421597 objEditor.cameraView.renderCamera.setAim(v2, v1);
15431598 objEditor.cameraView.repaint();
15441599 } else
1545
- if (event.getSource() == rectoidItem)
1600
+ if (source == rectoidItem)
15461601 {
15471602 makeSomething(new Box());
15481603 } else
1549
- if (event.getSource() == particleItem)
1604
+ if (source == particleItem)
15501605 {
15511606 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15521607 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1567,9 +1622,9 @@
15671622 applyExample(particleGeom, "SMOKE");
15681623 makeSomething(particleGeom);
15691624 } else
1570
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1625
+ if (source == ragdollItem || source == ragdoll2Item)
15711626 {
1572
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1627
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15731628
15741629 ragdoll.toParent = LA.newMatrix();
15751630 ragdoll.fromParent = LA.newMatrix();
....@@ -1587,7 +1642,7 @@
15871642 } else
15881643 /*
15891644 */
1590
- if (event.getSource() == heightFieldItem)
1645
+ if (source == heightFieldItem)
15911646 {
15921647 Object3D obj = new Object3D();
15931648
....@@ -1625,31 +1680,31 @@
16251680
16261681 makeSomething(obj);
16271682 } else
1628
- if (event.getSource() == gridItem)
1683
+ if (source == gridItem)
16291684 {
16301685 makeSomething(new Grid());
16311686 } else
1632
- if (event.getSource() == ellipsoidItem)
1687
+ if (source == ellipsoidItem)
16331688 {
16341689 makeSomething(new Sphere());
16351690 } else
1636
- if (event.getSource() == coneItem)
1691
+ if (source == coneItem)
16371692 {
16381693 makeSomething(new Cone());
16391694 } else
1640
- if (event.getSource() == torusItem)
1695
+ if (source == torusItem)
16411696 {
16421697 makeSomething(new Torus());
16431698 } else
1644
- if (event.getSource() == superItem)
1699
+ if (source == superItem)
16451700 {
16461701 makeSomething(new Superellipsoid());
16471702 } else
1648
- if (event.getSource() == kleinItem)
1703
+ if (source == kleinItem)
16491704 {
16501705 makeSomething(new Klein());
16511706 } else
1652
- if (event.getSource() == blobItem)
1707
+ if (source == blobItem)
16531708 {
16541709 Blob blob = new Blob();
16551710 BlobComponent comp = new BlobComponent();
....@@ -1657,15 +1712,15 @@
16571712 //blob.retile();
16581713 makeSomething(blob);
16591714 } else
1660
- if (event.getSource() == latheItem)
1715
+ if (source == latheItem)
16611716 {
16621717 makeSomething(new Lathe());
16631718 } else
1664
- if (event.getSource() == bezierItem)
1719
+ if (source == bezierItem)
16651720 {
16661721 makeSomething(new BezierSurface());
16671722 } else
1668
- if (event.getSource() == checkerItem)
1723
+ if (source == overlayItem)
16691724 {
16701725 /*
16711726 Object3D obj = new BezierSurface(5,8);
....@@ -1680,7 +1735,7 @@
16801735 */
16811736 makeSomething(new Checker());
16821737 } else
1683
- if (event.getSource() == meshItem)
1738
+ if (source == meshItem)
16841739 {
16851740 Object3D itemtomake = new Object3D();
16861741 Object3D child;
....@@ -1701,35 +1756,35 @@
17011756 makeSomething(child);
17021757 }
17031758 } else
1704
- if (event.getSource() == springItem)
1759
+ if (source == springItem)
17051760 {
17061761 cSpring s = new cSpring();
17071762 s.setup();
17081763 makeSomething(s);
17091764 } else
1710
- if (event.getSource() == flagItem)
1765
+ if (source == flagItem)
17111766 {
17121767 cSpring s = new cFlag();
17131768 s.setup();
17141769 makeSomething(s);
17151770 } else
1716
- if (event.getSource() == lightItem)
1771
+ if (source == lightItem)
17171772 {
17181773 makeSomething(new Light());
17191774 } else
1720
- if (event.getSource() == csgItem)
1775
+ if (source == csgItem)
17211776 {
17221777 group(new CSG());
17231778 } else
1724
- if (event.getSource() == templateItem)
1779
+ if (source == templateItem)
17251780 {
17261781 group(new cTemplate());
17271782 } else
1728
- if (event.getSource() == attributeItem)
1783
+ if (source == attributeItem)
17291784 {
17301785 makeSomething(new Attribute());
17311786 } else
1732
- if (event.getSource() == pointflowItem)
1787
+ if (source == pointflowItem)
17331788 {
17341789 makeSomething(new PointFlow());
17351790 } else
....@@ -1741,7 +1796,7 @@
17411796 } else
17421797 */
17431798
1744
- if (event.getSource() == superLoopItem)
1799
+ if (source == superLoopItem)
17451800 {
17461801 Composite g = new cGroup();
17471802 for (int i=0; i<15; i++)
....@@ -1763,7 +1818,7 @@
17631818
17641819 group(g);
17651820 } else
1766
- if (event.getSource() == loopItem)
1821
+ if (source == loopItem)
17671822 {
17681823 Composite csg = new GroupLeaf();
17691824 csg.count = 5;
....@@ -1772,7 +1827,7 @@
17721827 csg.addChild(child);
17731828 child.addChild(csg);
17741829 } else
1775
- if (event.getSource() == doubleItem)
1830
+ if (source == doubleItem)
17761831 {
17771832 Composite csg = new GroupLeaf();
17781833 csg.count = 5;
....@@ -1784,7 +1839,7 @@
17841839 csg.addChild(child);
17851840 child.addChild(csg);
17861841 } else
1787
- if (event.getSource() == tripleItem)
1842
+ if (source == tripleItem)
17881843 {
17891844 Composite csg = new GroupLeaf();
17901845 csg.count = 4;
....@@ -1800,70 +1855,83 @@
18001855 child.addChild(csg);
18011856 } else
18021857
1803
- if (event.getSource() == importGFDItem)
1858
+ if (source == importGFDItem)
18041859 {
18051860 ImportGFD();
18061861 } else
1807
- if (event.getSource() == importVRMLX3DItem)
1862
+ if (source == importVRMLX3DItem)
18081863 {
18091864 ImportVRMLX3D();
18101865 } else
1811
- if (event.getSource() == import3DSItem)
1866
+ if (source == import3DSItem)
18121867 {
18131868 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
18141869 } else
1815
- if (event.getSource() == importOBJItem)
1870
+ if (source == importOBJItem)
18161871 {
1817
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1872
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1873
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1874
+ browser.setVisible(true);
1875
+ String filename = browser.getFile();
1876
+ if (filename != null && filename.length() > 0)
1877
+ {
1878
+ String fullname = browser.getDirectory() + filename;
1879
+ makeSomething(ReadOBJ(fullname), true);
1880
+ }
18181881 } else
1819
- if (event.getSource() == computeAOItem)
1882
+ if (source == computeAOItem)
18201883 {
18211884 Globals.drawMode = CameraPane.OCCLUSION;
18221885 Globals.theRenderer.repaint();
18231886 } else
1824
- if (event.getSource() == recompileItem)
1887
+ if (source == recompileItem)
18251888 {
18261889 Recompile();
18271890 refreshContents();
18281891 } else
1829
- if (event.getSource() == editScriptItem)
1892
+ if (source == editScriptItem)
18301893 {
18311894 OpenDialog();
18321895 refreshContents();
18331896 } else
1834
- if (event.getSource() == invariantsItem)
1897
+ if (source == invariantsItem)
18351898 {
18361899 System.out.println("Invariants:");
1837
- GrafreeD.grafreeD.universe.invariants();
1900
+ Grafreed.grafreeD.universe.invariants();
18381901 } else
1839
- if (event.getSource() == memoryItem)
1902
+ if (source == memoryItem)
18401903 {
18411904 //System.out.println("Invariants:");
18421905 PrintMemory();
18431906 } else
1844
- if (event.getSource() == pathItem)
1907
+ if (source == pathItem)
18451908 {
18461909 PrintPath();
18471910 } else
1848
- if (event.getSource() == analyzeItem)
1911
+ if (source == analyzeItem)
18491912 {
18501913 AnalyzeObject();
18511914 } else
1852
- if (event.getSource() == dumpItem)
1915
+ if (source == dumpItem)
18531916 {
18541917 DumpObject();
18551918 } else
1856
- if (event.getSource() == screenfitButton)
1919
+ if (source == oneStepButton)
1920
+ {
1921
+ Globals.ONESTEP = true;
1922
+ cameraView.repaint();
1923
+ } else
1924
+ if (source == screenfitButton)
18571925 {
18581926 //Reload(lastConverter, lastFilename, true);
18591927 ScreenFit();
18601928 } else
1861
- if (event.getSource() == screenfitpointButton)
1929
+ if (source == screenfitpointButton)
18621930 {
18631931 //Reload(lastConverter, lastFilename, true);
18641932 ScreenFitPoint();
18651933 } else
1866
- if (event.getSource() == snapobjectButton)
1934
+ if (source == snapobjectButton)
18671935 {
18681936 //Reload(lastConverter, lastFilename, true);
18691937 SnapObject();
....@@ -1874,13 +1942,13 @@
18741942 // Recompile();
18751943 // refreshContents();
18761944 // } else
1877
- if (event.getSource() == gcButton)
1945
+ if (source == gcButton)
18781946 {
18791947 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18801948 System.gc();
18811949 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18821950 } else
1883
- if (event.getSource() == editLeafItem)
1951
+ if (source == editLeafItem)
18841952 {
18851953 Object3D obj;
18861954 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1894,62 +1962,66 @@
18941962 }
18951963 refreshContents(true);
18961964 } else
1897
- if (event.getSource() == openWindowItem)
1965
+ if (source == openWindowItem)
18981966 {
18991967 EditSelection(true);
19001968 } else
1901
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1969
+ if (source == cutItem || source == clearButton)
19021970 {
19031971 loadClipboard(true);
19041972 } else
1905
- if (event.getSource() == duplicateItem)
1973
+ if (source == duplicateItem)
19061974 {
1907
- Object3D keep = GrafreeD.clipboard;
1975
+ Object3D keep = Grafreed.clipboard;
19081976 loadClipboard(false);
19091977 paste(false);
1910
- GrafreeD.clipboard = keep;
1978
+ Grafreed.clipboard = keep;
19111979 } else
1912
- if (event.getSource() == cloneItem)
1980
+ if (source == cloneItem)
19131981 {
19141982 CloneSelection(false);
19151983 } else
1916
- if (event.getSource() == cloneSupportItem)
1984
+ if (source == cloneSupportItem)
19171985 {
19181986 CloneSelection(true);
19191987 } else
1920
- if (event.getSource() == copyItem)
1988
+ if (source == copyItem)
19211989 {
19221990 loadClipboard(false);
19231991 } else
1924
- if (event.getSource() == pasteItem)
1992
+ if (source == pasteItem)
19251993 {
19261994 paste(false);
19271995 } else
1928
- if (event.getSource() == pasteLinkItem)
1996
+ if (source == pasteIntoItem)
19291997 {
1930
- pasteInto(false);
1998
+ pasteInto(true, false);
19311999 } else
1932
- if (event.getSource() == pasteCloneItem)
2000
+ if (source == pasteLinkItem)
19332001 {
1934
- pasteInto(true);
2002
+ pasteInto(false, false);
19352003 } else
1936
- if (event.getSource() == pasteExpandItem)
2004
+ if (source == pasteCloneItem)
2005
+ {
2006
+ pasteInto(true, true);
2007
+ } else
2008
+ if (source == pasteExpandItem)
19372009 {
19382010 paste(true);
19392011 } else
1940
- if (event.getSource() == synchronizeItem)
2012
+ if (source == synchronizeItem)
19412013 {
19422014 Overwrite(Object3D.TRANSFORM);
19432015 } else
1944
- if (event.getSource() == overwriteNameItem)
2016
+ if (source == overwriteNameItem)
19452017 {
19462018 Overwrite(Object3D.NAME);
19472019 } else
1948
- if (event.getSource() == overwriteUVItem)
2020
+ if (source == overwriteUVItem)
19492021 {
19502022 Overwrite(Object3D.UV);
19512023 } else
1952
- if (event.getSource() == overwriteMatItem)
2024
+ if (source == overwriteMatItem)
19532025 {
19542026 /* july 2015
19552027 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1969,7 +2041,7 @@
19692041
19702042 Overwrite(dropAttributes);
19712043 }
1972
- if (event.getSource() == overwriteGeoItem)
2044
+ if (source == overwriteGeoItem)
19732045 {
19742046 Overwrite(Object3D.GEOMETRY);
19752047 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1986,7 +2058,7 @@
19862058 // refreshContents();
19872059 // }
19882060 } else
1989
- if (event.getSource() == generateMeshItem)
2061
+ if (source == generateMeshItem)
19902062 {
19912063 //if (group.selection.size() == 1)
19922064 // for (int i=0; i<group.selection.size(); i++)
....@@ -1997,7 +2069,7 @@
19972069 ResetModel();
19982070 refreshContents();
19992071 } else
2000
- if (event.getSource() == extractGeometriesItem)
2072
+ if (source == extractGeometriesItem)
20012073 {
20022074 boolean one = false;
20032075
....@@ -2024,7 +2096,7 @@
20242096 ResetModel();
20252097 refreshContents();
20262098 } else
2027
- if (event.getSource() == cloneGeometriesItem)
2099
+ if (source == cloneGeometriesItem)
20282100 {
20292101 boolean one = false;
20302102
....@@ -2050,7 +2122,7 @@
20502122 ResetModel();
20512123 refreshContents();
20522124 } else
2053
- if (event.getSource() == shareGeometriesItem)
2125
+ if (source == shareGeometriesItem)
20542126 {
20552127 boolean one = false;
20562128
....@@ -2080,7 +2152,7 @@
20802152 refreshContents();
20812153 }
20822154 } else
2083
- if (event.getSource() == mergeGeometriesItem)
2155
+ if (source == mergeGeometriesItem)
20842156 {
20852157 boolean one = false;
20862158
....@@ -2110,7 +2182,7 @@
21102182 ResetModel();
21112183 refreshContents();
21122184 } else
2113
- if (event.getSource() == linkverticesItem)
2185
+ if (source == linkverticesItem)
21142186 {
21152187 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21162188 // {
....@@ -2123,9 +2195,9 @@
21232195 // group.selection.get(0).setMasterThis(content); // should be identity
21242196 // refreshContents();
21252197 // }
2126
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2198
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21272199 {
2128
- Object3D content = GrafreeD.clipboard.get(0);
2200
+ Object3D content = Grafreed.clipboard.get(0);
21292201
21302202 if (content instanceof cGroup && ((cGroup)content).transientlink )
21312203 content = ((cGroup)content).get(0);
....@@ -2133,38 +2205,38 @@
21332205 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21342206 for (int i=0; i<group.selection.size(); i++)
21352207 {
2136
- boolean random = CameraPane.RANDOM;
2137
- CameraPane.RANDOM = false; // parse all random nodes
2208
+ boolean random = CameraPane.SWITCH;
2209
+ CameraPane.SWITCH = false; // parse all random nodes
21382210 group.selection.get(i).linkVerticesThis(content);
21392211 // group.selection.get(i).setMasterThis(content); // should be identity
2140
- CameraPane.RANDOM = random;
2212
+ CameraPane.SWITCH = random;
21412213 }
21422214 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21432215 refreshContents();
21442216 }
21452217 } else
2146
- if (event.getSource() == resetsupportItem)
2218
+ if (source == resetsupportItem)
21472219 {
21482220 for (int i=0; i<group.selection.size(); i++)
21492221 {
2150
- boolean random = CameraPane.RANDOM;
2151
- CameraPane.RANDOM = false; // parse all random nodes
2222
+ boolean random = CameraPane.SWITCH;
2223
+ CameraPane.SWITCH = false; // parse all random nodes
21522224 group.selection.get(i).linkVerticesThis(null);
2153
- CameraPane.RANDOM = random;
2225
+ CameraPane.SWITCH = random;
21542226 }
21552227
21562228 refreshContents();
21572229 } else
2158
- if (event.getSource() == relinkverticesItem)
2230
+ if (source == relinkverticesItem)
21592231 {
2160
- boolean random = CameraPane.RANDOM;
2161
- CameraPane.RANDOM = false; // parse all random nodes
2232
+ boolean random = CameraPane.SWITCH;
2233
+ CameraPane.SWITCH = false; // parse all random nodes
21622234 group.selection.RelinkToSupport();
2163
- CameraPane.RANDOM = random;
2235
+ CameraPane.SWITCH = random;
21642236
21652237 refreshContents();
21662238 } else
2167
- if (event.getSource() == resetreferencesItem)
2239
+ if (source == resetreferencesItem)
21682240 {
21692241 for (int i=0; i<group.selection.size(); i++)
21702242 {
....@@ -2173,11 +2245,11 @@
21732245
21742246 refreshContents();
21752247 } else
2176
- if (event.getSource() == setMasterItem)
2248
+ if (source == setMasterItem)
21772249 {
2178
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2250
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21792251 {
2180
- Object3D content = GrafreeD.clipboard.get(0);
2252
+ Object3D content = Grafreed.clipboard.get(0);
21812253
21822254 if (content instanceof cGroup && ((cGroup)content).transientlink )
21832255 content = ((cGroup)content).get(0);
....@@ -2186,13 +2258,13 @@
21862258 refreshContents();
21872259 }
21882260 } else
2189
- if (event.getSource() == poseMeshItem)
2261
+ if (source == poseMeshItem)
21902262 {
21912263 if (group.selection.size() == 1)
21922264 {
2193
- if (GrafreeD.clipboard.size() == 1)
2265
+ if (Grafreed.clipboard.size() == 1)
21942266 {
2195
- Object3D content = GrafreeD.clipboard.get(0);
2267
+ Object3D content = Grafreed.clipboard.get(0);
21962268
21972269 if (content instanceof cGroup && ((cGroup)content).transientlink )
21982270 content = ((cGroup)content).get(0);
....@@ -2205,19 +2277,19 @@
22052277 }
22062278
22072279 } else
2208
- if (event.getSource() == revertMeshItem)
2280
+ if (source == revertMeshItem)
22092281 {
22102282 RevertMeshes();
22112283 } else
2212
- if (event.getSource() == resetMeshItem)
2284
+ if (source == resetAllItem)
22132285 {
22142286 ResetAll();
22152287 } else
2216
- if (event.getSource() == stepAllItem)
2288
+ if (source == stepAllItem)
22172289 {
22182290 StepAll();
22192291 } else
2220
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2292
+ if (source == clearItem) // || event.getSource() == clearButton)
22212293 {
22222294 //int indices[] = jList.getSelectedIndices();
22232295 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2225,46 +2297,46 @@
22252297
22262298 ClearSelection(false);
22272299 } else
2228
- if (event.getSource() == clearAllItem)
2300
+ if (source == clearAllItem)
22292301 {
22302302 ClearSelection(true);
22312303 } else
2232
- if (event.getSource() == grabItem)
2304
+ if (source == grabItem)
22332305 {
22342306 group(new cGroup(), true);
22352307 } else
2236
- if (event.getSource() == hideItem)
2308
+ if (source == hideItem)
22372309 {
22382310 group(new HiddenObject());
22392311 } else
2240
- if (event.getSource() == frontItem)
2312
+ if (source == frontItem)
22412313 {
22422314 front();
22432315 } else
2244
- if (event.getSource() == backItem)
2316
+ if (source == backItem)
22452317 {
22462318 back();
22472319 } else
2248
- if (event.getSource() == cameraItem)
2320
+ if (source == cameraItem)
22492321 {
22502322 makeSomething(new Camera());
22512323 } else
2252
- if (event.getSource() == compositeItem)
2324
+ if (source == compositeItem)
22532325 {
22542326 group(new Composite());
22552327 } else
2256
- if (event.getSource() == randomItem)
2328
+ if (source == randomItem)
22572329 {
22582330 RandomNode random = new RandomNode();
22592331 group(random);
22602332 if (random.size() > 0)
2261
- random.name = random.get(0).name + "Rnd";
2333
+ random.name = random.get(0).name + "Switch";
22622334 } else
2263
- if (event.getSource() == physicsItem)
2335
+ if (source == physicsItem)
22642336 {
22652337 group(new PhysicsNode());
22662338 } else
2267
- if (event.getSource() == frameselectorItem)
2339
+ if (source == frameselectorItem)
22682340 {
22692341 for (int i=0; i<group.selection.size(); i++)
22702342 {
....@@ -2276,7 +2348,7 @@
22762348 ResetModel();
22772349 refreshContents();
22782350 } else
2279
- if (event.getSource() == switchGeoItem)
2351
+ if (source == switchGeoItem)
22802352 {
22812353 for (int i=0; i<group.selection.size(); i++)
22822354 {
....@@ -2288,7 +2360,7 @@
22882360 ResetModel();
22892361 refreshContents();
22902362 } else
2291
- if (event.getSource() == switchTransfoItem)
2363
+ if (source == switchTransfoItem)
22922364 {
22932365 for (int i=0; i<group.selection.size(); i++)
22942366 {
....@@ -2300,7 +2372,7 @@
23002372 ResetModel();
23012373 refreshContents();
23022374 } else
2303
- if (event.getSource() == morphItem)
2375
+ if (source == morphItem)
23042376 {
23052377 for (int i=0; i<group.selection.size(); i++)
23062378 {
....@@ -2312,7 +2384,7 @@
23122384 ResetModel();
23132385 refreshContents();
23142386 } else
2315
- if (event.getSource() == scriptNodeItem)
2387
+ if (source == scriptNodeItem)
23162388 {
23172389 boolean atleastone = false;
23182390
....@@ -2351,31 +2423,31 @@
23512423 }
23522424 }
23532425 } else
2354
- if (event.getSource() == linkerItem)
2426
+ if (source == linkerItem)
23552427 {
23562428 group(new cLinker());
23572429 } else
2358
- if (event.getSource() == textureItem)
2430
+ if (source == textureItem)
23592431 {
23602432 group(new TextureNode());
23612433 } else
2362
- if (event.getSource() == billboardItem)
2434
+ if (source == billboardItem)
23632435 {
23642436 group(new BillboardNode());
23652437 } else
2366
- if (event.getSource() == shadowXItem)
2438
+ if (source == shadowXItem)
23672439 {
23682440 CastShadow(0);
23692441 } else
2370
- if (event.getSource() == shadowYItem)
2442
+ if (source == shadowYItem)
23712443 {
23722444 CastShadow(1);
23732445 } else
2374
- if (event.getSource() == shadowZItem)
2446
+ if (source == shadowZItem)
23752447 {
23762448 CastShadow(2);
23772449 } else
2378
- if (event.getSource() == ungroupItem)
2450
+ if (source == ungroupItem)
23792451 {
23802452 //ungroup();
23812453 for (int i=0; i<group.selection.size(); i++)
....@@ -2387,179 +2459,187 @@
23872459
23882460 refreshContents();
23892461 } else
2390
- if (event.getSource() == genUVItem)
2462
+ if (source == genUVItem)
23912463 {
23922464 GenUV();
23932465 } else
2394
- if (event.getSource() == genNormalsCADItem)
2466
+ if (source == genNormalsCADItem)
23952467 {
23962468 GenNormals(true);
23972469 } else
2398
- if (event.getSource() == genNormalsMESHItem)
2470
+ if (source == genNormalsMESHItem)
23992471 {
24002472 GenNormals(true); // TODO
24012473 } else
2402
- if (event.getSource() == genNormalsORGANItem)
2474
+ if (source == genNormalsORGANItem)
24032475 {
24042476 GenNormals(false);
24052477 } else
2406
- if (event.getSource() == genNormalsMINEItem)
2478
+ if (source == genNormalsMINEItem)
24072479 {
24082480 GenNormalsMINE();
24092481 } else
2410
- if (event.getSource() == stripifyItem)
2482
+ if (source == stripifyItem)
24112483 {
24122484 Stripify();
24132485 } else
2414
- if (event.getSource() == unstripifyItem)
2486
+ if (source == unstripifyItem)
24152487 {
24162488 Unstripify();
24172489 } else
2418
- if (event.getSource() == trimItem)
2490
+ if (source == trimItem)
24192491 {
24202492 Trim();
24212493 } else
2422
- if (event.getSource() == untrimItem)
2494
+ if (source == untrimItem)
24232495 {
24242496 Untrim();
24252497 } else
2426
- if (event.getSource() == clearColorsItem)
2498
+ if (source == clearColorsItem)
24272499 {
24282500 ClearColors();
24292501 } else
2430
- if (event.getSource() == clearMaterialsItem)
2502
+ if (source == clearMaterialsItem)
24312503 {
24322504 ClearMaterials();
24332505 } else
2434
- if (event.getSource() == liveleavesItem)
2506
+ if (source == liveleavesItem)
24352507 {
24362508 LiveLeaves(true);
24372509 } else
2438
- if (event.getSource() == unliveleavesItem)
2510
+ if (source == unliveleavesItem)
24392511 {
24402512 LiveLeaves(false);
24412513 } else
2442
- if (event.getSource() == supportleavesItem)
2514
+ if (source == supportleavesItem)
24432515 {
24442516 SupportLeaves(true);
24452517 } else
2446
- if (event.getSource() == unsupportleavesItem)
2518
+ if (source == unsupportleavesItem)
24472519 {
24482520 SupportLeaves(false);
24492521 } else
2450
- if (event.getSource() == hideleavesItem)
2522
+ if (source == hideleavesItem)
24512523 {
24522524 HideLeaves(true);
24532525 } else
2454
- if (event.getSource() == showleavesItem)
2526
+ if (source == showleavesItem)
24552527 {
24562528 HideLeaves(false);
24572529 } else
2458
- if (event.getSource() == markleavesItem)
2530
+ if (source == markleavesItem)
24592531 {
24602532 MarkLeaves(true);
24612533 } else
2462
- if (event.getSource() == unmarkleavesItem)
2534
+ if (source == unmarkleavesItem)
24632535 {
24642536 MarkLeaves(false);
24652537 } else
2466
- if (event.getSource() == flipVItem)
2538
+ if (source == flipVItem)
24672539 {
24682540 FlipV(true);
24692541 } else
2470
- if (event.getSource() == unflipVItem)
2542
+ if (source == unflipVItem)
24712543 {
24722544 FlipV(false);
24732545 } else
2474
- if (event.getSource() == lowTexturesItem)
2546
+ if (source == lowTexturesItem)
24752547 {
24762548 SetTexRes(0);
24772549 } else
2478
- if (event.getSource() == normalTexturesItem)
2550
+ if (source == normalTexturesItem)
24792551 {
24802552 SetTexRes(1);
24812553 } else
2482
- if (event.getSource() == highTexturesItem)
2554
+ if (source == highTexturesItem)
24832555 {
24842556 SetTexRes(2);
24852557 } else
2486
- if (event.getSource() == veryhighTexturesItem)
2558
+ if (source == veryhighTexturesItem)
24872559 {
24882560 SetTexRes(3);
24892561 } else
2490
- if (event.getSource() == maxTexturesItem)
2562
+ if (source == maxTexturesItem)
24912563 {
24922564 SetTexRes(4);
24932565 } else
2494
- if (event.getSource() == panoTexturesItem)
2566
+ if (source == panoTexturesItem)
24952567 {
24962568 SetTexRes(5);
24972569 } else
2498
- if (event.getSource() == reverseNormalsItem)
2570
+ if (source == reverseNormalsItem)
24992571 {
25002572 ReverseNormals();
25012573 } else
2502
- if (event.getSource() == parseverticesItem)
2574
+ if (source == parseverticesItem)
25032575 {
25042576 ParseVertices();
25052577 } else
2506
- if (event.getSource() == textureFieldItem)
2578
+ if (source == textureFieldItem)
25072579 {
25082580 TextureVertices();
25092581 } else
2510
- if (event.getSource() == alignItem)
2582
+ if (source == alignItem)
25112583 {
25122584 Align();
25132585 } else
2514
- if (event.getSource() == mirrorItem)
2586
+ if (source == mirrorItem)
25152587 {
25162588 MirrorPoses();
25172589 } else
2518
- if (event.getSource() == reduceMorphItem)
2590
+ if (source == reduceMorphItem)
25192591 {
25202592 MeshReduction(false);
25212593 } else
2522
- if (event.getSource() == reduce34MorphItem)
2594
+ if (source == reduce34MorphItem)
25232595 {
25242596 MeshReduction(true);
25252597 } else
2526
- if (event.getSource() == reverseTrianglesItem)
2598
+ if (source == reverseTrianglesItem)
25272599 {
25282600 ReverseTriangles();
25292601 } else
2530
- if (event.getSource() == reduceMeshItem)
2602
+ if (source == reduceMeshItem)
25312603 {
25322604 ReduceMesh(false);
25332605 } else
2534
- if (event.getSource() == reduce34MeshItem)
2606
+ if (source == reduce34MeshItem)
25352607 {
25362608 ReduceMesh(true);
25372609 } else
2538
- if (event.getSource() == increaseMeshItem)
2610
+ if (source == increaseMeshItem)
25392611 {
25402612 IncreaseMesh();
25412613 } else
2542
- if (event.getSource() == clipMeshItem)
2614
+ if (source == clipMeshItem)
25432615 {
25442616 ClipMesh();
25452617 } else
2546
- if (event.getSource() == smoothMeshItem)
2618
+ if (source == smoothMeshItem)
25472619 {
25482620 SmoothMesh();
25492621 } else
2550
- if (event.getSource() == transformgeometryItem)
2622
+ if (source == transformGeometryItem)
25512623 {
25522624 TransformGeometry();
25532625 } else
2554
- if (event.getSource() == resetTransformItem)
2626
+ if (source == transformChildrenItem)
2627
+ {
2628
+ TransformChildren();
2629
+ } else
2630
+ if (source == resetTransformItem)
25552631 {
25562632 ResetTransform();
25572633 } else
2558
- if (event.getSource() == resetCentroidItem)
2634
+ if (source == resetCentroidItem)
25592635 {
2560
- ResetCentroid();
2636
+ ResetCentroid(true);
25612637 } else
2562
- if (event.getSource() == resetParentItem)
2638
+ if (source == resetCentroidXZItem)
2639
+ {
2640
+ ResetCentroid(false);
2641
+ } else
2642
+ if (source == resetParentItem)
25632643 {
25642644 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25652645 {
....@@ -2569,7 +2649,7 @@
25692649
25702650 refreshContents();
25712651 } else
2572
- if (event.getSource() == repairParentItem)
2652
+ if (source == repairParentItem)
25732653 {
25742654 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25752655 {
....@@ -2583,7 +2663,7 @@
25832663
25842664 refreshContents();
25852665 } else
2586
- if (event.getSource() == repairShadowItem)
2666
+ if (source == repairShadowItem)
25872667 {
25882668 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25892669 {
....@@ -2597,7 +2677,7 @@
25972677
25982678 refreshContents();
25992679 } else
2600
- if (event.getSource() == sortbysizeItem)
2680
+ if (source == sortbysizeItem)
26012681 {
26022682 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26032683 {
....@@ -2609,7 +2689,7 @@
26092689 ResetModel();
26102690 refreshContents();
26112691 } else
2612
- if (event.getSource() == sortbynameItem)
2692
+ if (source == sortbynameItem)
26132693 {
26142694 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26152695 {
....@@ -2621,7 +2701,7 @@
26212701 ResetModel();
26222702 refreshContents();
26232703 } else
2624
- if (event.getSource() == attachPigmentItem)
2704
+ if (source == attachPigmentItem)
26252705 {
26262706 String texture = GetFile("Attach pigment");
26272707 Object3D obj;
....@@ -2633,7 +2713,7 @@
26332713
26342714 refreshContents();
26352715 } else
2636
- if (event.getSource() == detachPigmentItem)
2716
+ if (source == detachPigmentItem)
26372717 {
26382718 Object3D obj;
26392719 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2644,7 +2724,7 @@
26442724
26452725 refreshContents();
26462726 } else
2647
- if (event.getSource() == attachBumpItem)
2727
+ if (source == attachBumpItem)
26482728 {
26492729 String texture = GetFile("Attach bump");
26502730 Object3D obj;
....@@ -2656,7 +2736,7 @@
26562736
26572737 refreshContents();
26582738 } else
2659
- if (event.getSource() == detachBumpItem)
2739
+ if (source == detachBumpItem)
26602740 {
26612741 Object3D obj;
26622742 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2667,7 +2747,7 @@
26672747
26682748 refreshContents();
26692749 } else
2670
- if (event.getSource() == pigmentBumpItem)
2750
+ if (source == pigmentBumpItem)
26712751 {
26722752 Object3D obj;
26732753 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2678,158 +2758,195 @@
26782758
26792759 refreshContents();
26802760 } else
2681
- if (event.getSource() == flashSelectionButton)
2761
+ if (source == flashSelectionButton)
26822762 {
26832763 CameraPane.flash = true;
26842764 refreshContents();
26852765 } else
2686
- if (event.getSource() == oneButton)
2766
+ if (source == oneButton)
26872767 {
26882768 } else
2689
- if (event.getSource() == twoButton)
2769
+ if (source == twoButton)
26902770 {
26912771 radio.layout = twoButton;
26922772 // bug
26932773 //gridPanel.setDividerLocation(1.0);
26942774 //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();
2775
+// bigThree.remove(scenePanel);
2776
+// bigThree.remove(centralPanel);
2777
+// bigThree.remove(XYZPanel);
2778
+// aWindowConstraints.gridx = 0;
2779
+// aWindowConstraints.gridy = 0;
2780
+// aWindowConstraints.gridwidth = 1;
2781
+// // aConstraints.gridheight = 3;
2782
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2783
+// aWindowConstraints.weightx = 0;
2784
+// aWindowConstraints.weighty = 1;
2785
+// //bigThree.add(jtp, aWindowConstraints);
2786
+// aWindowConstraints.weightx = 1;
2787
+// aWindowConstraints.gridwidth = 3;
2788
+// // aConstraints.gridheight = 3;
2789
+// aWindowConstraints.gridx = 1;
2790
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2791
+// bigThree.add(centralPanel, aWindowConstraints);
2792
+// aWindowConstraints.weightx = 0;
2793
+// aWindowConstraints.gridx = 4;
2794
+// aWindowConstraints.gridwidth = 1;
2795
+// // aConstraints.gridheight = 3;
2796
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2797
+// //bigThree.add(XYZPanel, aWindowConstraints);
2798
+// scenePanel.setVisible(false);
2799
+// centralPanel.setVisible(true);
2800
+// XYZPanel.setVisible(false);
2801
+ bigThree.ClearUI();
2802
+ bigThree.add(centralPanel);
2803
+ bigThree.FlushUI();
27192804 } else
2720
- if (event.getSource() == threeButton)
2805
+ if (source == threeButton)
27212806 {
27222807 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();
2808
+
2809
+// bigThree.remove(scenePanel);
2810
+// bigThree.remove(centralPanel);
2811
+// bigThree.remove(XYZPanel);
2812
+// aWindowConstraints.gridx = 0;
2813
+// aWindowConstraints.gridy = 0;
2814
+// aWindowConstraints.gridwidth = 1;
2815
+// // aConstraints.gridheight = 3;
2816
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2817
+// aWindowConstraints.weightx = 0;
2818
+// aWindowConstraints.weighty = 1;
2819
+// //bigThree.add(jtp, aWindowConstraints);
2820
+// aWindowConstraints.weightx = 1;
2821
+// aWindowConstraints.gridwidth = 3;
2822
+// // aConstraints.gridheight = 3;
2823
+// aWindowConstraints.gridx = 1;
2824
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2825
+// bigThree.add(centralPanel, aWindowConstraints);
2826
+// aWindowConstraints.weightx = 0;
2827
+// aWindowConstraints.gridx = 4;
2828
+// aWindowConstraints.gridwidth = 1;
2829
+// // aConstraints.gridheight = 3;
2830
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2831
+// bigThree.add(XYZPanel, aWindowConstraints);
2832
+// bigThree.validate();
2833
+// scenePanel.setVisible(false);
2834
+// centralPanel.setVisible(true);
2835
+// XYZPanel.setVisible(true);
2836
+ bigThree.ClearUI();
2837
+ bigThree.add(centralPanel);
2838
+ bigThree.add(XYZPanel);
2839
+ bigThree.FlushUI();
27472840 } else
2748
- if (event.getSource() == fourButton)
2841
+ if (source == fourButton)
27492842 {
27502843 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();
2844
+
2845
+// bigThree.remove(scenePanel);
2846
+// bigThree.remove(centralPanel);
2847
+// bigThree.remove(XYZPanel);
2848
+// aWindowConstraints.gridx = 0;
2849
+// aWindowConstraints.gridy = 0;
2850
+// aWindowConstraints.gridwidth = 1;
2851
+// // aWindowConstraints.gridheight = 3;
2852
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2853
+// aWindowConstraints.weightx = 1;
2854
+// aWindowConstraints.weighty = 1;
2855
+// bigThree.add(scenePanel, aWindowConstraints);
2856
+// aWindowConstraints.weightx = 1;
2857
+// aWindowConstraints.gridwidth = 3;
2858
+// // aConstraints.gridheight = 3;
2859
+// aWindowConstraints.gridx = 1;
2860
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2861
+// //bigThree.add(cameraPanel, aWindowConstraints);
2862
+// aWindowConstraints.weightx = 0;
2863
+// aWindowConstraints.gridx = 4;
2864
+// aWindowConstraints.gridwidth = 1;
2865
+// // aWindowConstraints.gridheight = 3;
2866
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2867
+// //bigThree.add(XYZPanel, aWindowConstraints);
2868
+// bigThree.validate();
2869
+// scenePanel.setVisible(true);
2870
+// centralPanel.setVisible(false);
2871
+// XYZPanel.setVisible(false);
2872
+ bigThree.ClearUI();
2873
+ bigThree.add(scenePanel);
2874
+ bigThree.FlushUI();
27752875 } else
2776
- if (event.getSource() == sixButton)
2876
+ if (source == sixButton)
27772877 {
27782878 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();
2879
+
2880
+// bigThree.remove(scenePanel);
2881
+// bigThree.remove(centralPanel);
2882
+// bigThree.remove(XYZPanel);
2883
+// aWindowConstraints.gridx = 0;
2884
+// aWindowConstraints.gridy = 0;
2885
+// aWindowConstraints.gridwidth = 1;
2886
+// // aConstraints.gridheight = 3;
2887
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2888
+// aWindowConstraints.weightx = 0;
2889
+// aWindowConstraints.weighty = 1;
2890
+// bigThree.add(scenePanel, aWindowConstraints);
2891
+// aWindowConstraints.weightx = 1;
2892
+// aWindowConstraints.gridwidth = 3;
2893
+// // aWindowConstraints.gridheight = 3;
2894
+// aWindowConstraints.gridx = 1;
2895
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2896
+// bigThree.add(centralPanel, aWindowConstraints);
2897
+// aWindowConstraints.weightx = 0;
2898
+// aWindowConstraints.gridx = 4;
2899
+// aWindowConstraints.gridwidth = 1;
2900
+// // aWindowConstraints.gridheight = 3;
2901
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2902
+// //bigThree.add(XYZPanel, aConstraints);
2903
+// bigThree.validate();
2904
+// scenePanel.setVisible(true);
2905
+// centralPanel.setVisible(true);
2906
+// XYZPanel.setVisible(false);
2907
+ bigThree.ClearUI();
2908
+ bigThree.add(scenePanel);
2909
+ bigThree.add(centralPanel);
2910
+ bigThree.FlushUI();
28032911 } else
2804
- if (event.getSource() == sevenButton)
2912
+ if (source == sevenButton)
28052913 {
28062914 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();
2915
+
2916
+// bigThree.remove(scenePanel);
2917
+// bigThree.remove(centralPanel);
2918
+// bigThree.remove(XYZPanel);
2919
+// aWindowConstraints.gridx = 0;
2920
+// aWindowConstraints.gridy = 0;
2921
+// aWindowConstraints.gridwidth = 1;
2922
+// // aWindowConstraints.gridheight = 3;
2923
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2924
+// aWindowConstraints.weightx = 0;
2925
+// aWindowConstraints.weighty = 1;
2926
+// bigThree.add(scenePanel, aWindowConstraints);
2927
+// aWindowConstraints.weightx = 1;
2928
+// aWindowConstraints.gridwidth = 3;
2929
+// // aWindowConstraints.gridheight = 3;
2930
+// aWindowConstraints.gridx = 1;
2931
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2932
+// bigThree.add(centralPanel, aWindowConstraints);
2933
+// aWindowConstraints.weightx = 0;
2934
+// aWindowConstraints.gridx = 4;
2935
+// aWindowConstraints.gridwidth = 1;
2936
+// // aConstraints.gridheight = 3;
2937
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2938
+// bigThree.add(XYZPanel, aWindowConstraints);
2939
+// bigThree.validate();
2940
+// scenePanel.setVisible(true);
2941
+// centralPanel.setVisible(true);
2942
+// XYZPanel.setVisible(true);
2943
+ bigThree.ClearUI();
2944
+ bigThree.add(scenePanel);
2945
+ bigThree.add(centralPanel);
2946
+ bigThree.add(XYZPanel);
2947
+ bigThree.FlushUI();
28312948 } else
2832
- if (event.getSource() == rootButton)
2949
+ if (source == rootButton)
28332950 {
28342951 Object3D obj;
28352952 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2841,7 +2958,7 @@
28412958
28422959 refreshContents(true);
28432960 } else
2844
- if (event.getSource() == closeButton)
2961
+ if (source == closeButton)
28452962 {
28462963 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28472964 cRadio ab;
....@@ -2862,11 +2979,11 @@
28622979 }
28632980 refreshContents(true);
28642981 } else
2865
- if (event.getSource() == editItem || event.getSource() == editButton)
2982
+ if (source == editItem || source == editButton)
28662983 {
28672984 EditSelection(false);
28682985 } else
2869
- if (event.getSource() == uneditButton)
2986
+ if (source == uneditButton)
28702987 {
28712988 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28722989 {
....@@ -2878,12 +2995,12 @@
28782995
28792996 child.editWindow = null; // ???????????
28802997 }
2881
- objEditor.ctrlPanel.revalidate();
2998
+ objEditor.ctrlPanel.FlushUI();
28822999 //objEditor.jTree.clearSelection();
28833000 //objEditor.ResetSliders();
28843001 refreshContents(true);
28853002 } else
2886
- if (event.getSource() == clearPanelButton)
3003
+ if (source == clearPanelButton)
28873004 {
28883005 assert(copy == group);
28893006 //copy.ClearUI();
....@@ -2894,7 +3011,7 @@
28943011 listUI.clear();
28953012 refreshContents(true);
28963013 } else
2897
- if (event.getSource() == allParamsButton)
3014
+ if (source == allParamsButton)
28983015 {
28993016 assert(copy == group);
29003017
....@@ -2915,19 +3032,19 @@
29153032
29163033 refreshContents(true);
29173034 } else
2918
- if (event.getSource() == unselectButton)
3035
+ if (source == unselectButton)
29193036 {
29203037 objEditor.jTree.clearSelection();
29213038 // ?? oct 2012 GrafreeD.clipboard.clear();
29223039 objEditor.ResetSliders();
29233040 refreshContents(true);
29243041 } else
2925
- if(event.getSource() instanceof cRadio)
3042
+ if(source instanceof cRadio)
29263043 {
29273044 group.parent = keepparent;
29283045 group.attributes = 0;
29293046 //group.editWindow = null;
2930
- /*cRadio*/ radio = (cRadio)event.getSource();
3047
+ /*cRadio*/ radio = (cRadio)source;
29313048 Object3D obj = radio.GetObject();
29323049 System.out.println("Edit " + obj);
29333050 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -3036,6 +3153,28 @@
30363153 refreshContents();
30373154 }
30383155
3156
+ void TransformChildren()
3157
+ {
3158
+ Object3D obj;
3159
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3160
+ {
3161
+ obj = (Object3D)e.nextElement();
3162
+ obj.KeepTextureMatrices();
3163
+ obj.TransformChildren();
3164
+ obj.RestoreTextureMatrices();
3165
+
3166
+// if (obj.parent == null)
3167
+// {
3168
+// System.out.println("NULL PARENT!");
3169
+// new Exception().printStackTrace();
3170
+// }
3171
+// else
3172
+// TouchTransform(obj);
3173
+// //obj.parent.Touch();
3174
+ }
3175
+
3176
+ refreshContents();
3177
+ }
30393178
30403179 void ResetTransform()
30413180 {
....@@ -3148,7 +3287,7 @@
31483287 refreshContents();
31493288 }
31503289
3151
- void ResetCentroid()
3290
+ void ResetCentroid(boolean full)
31523291 {
31533292 Object3D obj;
31543293 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3163,12 +3302,16 @@
31633302 LA.matIdentity(Object3D.mat);
31643303 obj.getBounds(minima, maxima, false);
31653304 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3166
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3305
+ if (full)
3306
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31673307 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31683308 obj.TransformMesh(Object3D.mat);
3309
+
31693310 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3170
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3311
+ if (full)
3312
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31713313 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3314
+
31723315 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31733316 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31743317 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3234,9 +3377,9 @@
32343377 obj = (Object3D)e.nextElement();
32353378
32363379 System.out.println("Object is: " + obj);
3237
- GrafreeD.AnalyzeObject(obj);
3380
+ Grafreed.AnalyzeObject(obj);
32383381 System.out.println("Boundary rep: " + obj.bRep);
3239
- GrafreeD.AnalyzeObject(obj.bRep);
3382
+ Grafreed.AnalyzeObject(obj.bRep);
32403383
32413384 // System.err.println((size/1024) + " KB is the size of " + obj);
32423385 }
....@@ -3450,8 +3593,8 @@
34503593
34513594 void ParseVertices()
34523595 {
3453
- boolean epsequal = GrafreeD.epsequal;
3454
- GrafreeD.epsequal = true;
3596
+ boolean epsequal = Grafreed.epsequal;
3597
+ Grafreed.epsequal = true;
34553598
34563599 for (int i=0; i<group.selection.size(); i++)
34573600 {
....@@ -3476,7 +3619,7 @@
34763619 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34773620 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34783621
3479
- g.add(GrafreeD.clipboard);
3622
+ g.add(Grafreed.clipboard);
34803623
34813624 buffer.add(g);
34823625 }
....@@ -3491,7 +3634,7 @@
34913634 makeSomething(buffer, i==group.selection.size()-1);
34923635 }
34933636
3494
- GrafreeD.epsequal = epsequal;
3637
+ Grafreed.epsequal = epsequal;
34953638
34963639 refreshContents();
34973640 }
....@@ -3509,7 +3652,16 @@
35093652 String pigment = Object3D.GetPigment(tex);
35103653 //String bump = Object3D.GetBump(tex);
35113654
3512
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3655
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3656
+
3657
+ try
3658
+ {
3659
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3660
+ }
3661
+ catch (Exception e)
3662
+ {
3663
+ System.err.println("FAIL: " + node);
3664
+ }
35133665
35143666 double s = v.s;
35153667
....@@ -3597,11 +3749,11 @@
35973749
35983750 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35993751
3600
- boolean random = CameraPane.RANDOM;
3601
- CameraPane.RANDOM = false; // parse all random nodes
3752
+ boolean random = CameraPane.SWITCH;
3753
+ CameraPane.SWITCH = false; // parse all random nodes
36023754 lowres.linkVerticesThis(null);
36033755 lowres.linkVerticesThis(sn);
3604
- CameraPane.RANDOM = random;
3756
+ CameraPane.SWITCH = random;
36053757
36063758 System.err.flush();
36073759
....@@ -3641,7 +3793,7 @@
36413793 return;
36423794
36433795 Object3D poses = group.selection.get(0);
3644
- Object3D ref = GrafreeD.clipboard.get(0);
3796
+ Object3D ref = Grafreed.clipboard.get(0);
36453797
36463798 Object3D newgroup = new Object3D("Po:" + poses.name);
36473799
....@@ -3835,9 +3987,9 @@
38353987
38363988 void ClipMesh()
38373989 {
3838
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
3990
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38393991 {
3840
- Object3D content = GrafreeD.clipboard.get(0);
3992
+ Object3D content = Grafreed.clipboard.get(0);
38413993
38423994 if (content instanceof cGroup && ((cGroup)content).transientlink )
38433995 content = ((cGroup)content).get(0);
....@@ -3846,7 +3998,7 @@
38463998 // {
38473999 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38484000 // }
3849
- group.selection.ClipMesh(GrafreeD.clipboard);
4001
+ group.selection.ClipMesh(Grafreed.clipboard);
38504002 }
38514003 // group.selection.ClipMesh(GrafreeD.clipboard);
38524004 System.out.println("DONE.");
....@@ -4086,12 +4238,12 @@
40864238 System.err.println("info : " + child.GetPath());
40874239 }
40884240 }
4089
- else
4090
- {
4091
- objEditor.SetMaterial(group); // .GetMaterial());
4092
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4093
- System.err.println("info : " + group.GetPath());
4094
- }
4241
+// else
4242
+// {
4243
+// objEditor.SetMaterial(group); // .GetMaterial());
4244
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4245
+// System.err.println("info : " + group.GetPath());
4246
+// }
40954247
40964248 objEditor.SetText(); // jan 2014
40974249
....@@ -4186,12 +4338,12 @@
41864338 {
41874339 if (group.selection.isEmpty())
41884340 return;
4189
- GrafreeD.clipboardIsTempGroup = false;
4341
+ Grafreed.clipboardIsTempGroup = false;
41904342 Composite tGroup = null;
41914343 if (group.selection.size() > 0) // 1)
41924344 {
41934345 tGroup = new cGroup();
4194
- GrafreeD.clipboardIsTempGroup = true;
4346
+ Grafreed.clipboardIsTempGroup = true;
41954347 }
41964348
41974349 if (cut)
....@@ -4231,16 +4383,16 @@
42314383 //System.out.println("cut " + child);
42324384 //System.out.println("parent = " + child.parent);
42334385 // tmp.addChild(child);
4234
- if (GrafreeD.clipboardIsTempGroup)
4386
+ if (Grafreed.clipboardIsTempGroup)
42354387 tGroup.add/*Child*/(tmp);
42364388 else
4237
- GrafreeD.clipboard = tmp;
4389
+ Grafreed.clipboard = tmp;
42384390 }
42394391 else
4240
- if (GrafreeD.clipboardIsTempGroup)
4392
+ if (Grafreed.clipboardIsTempGroup)
42414393 tGroup.add/*Child*/(child);
42424394 else
4243
- GrafreeD.clipboard = child;
4395
+ Grafreed.clipboard = child;
42444396 }
42454397
42464398 //ResetModel();
....@@ -4272,21 +4424,21 @@
42724424 //System.out.println("cut " + elem);
42734425 //System.out.println("parent = " + elem.parent);
42744426 // tmp.addChild(elem);
4275
- if (GrafreeD.clipboardIsTempGroup)
4427
+ if (Grafreed.clipboardIsTempGroup)
42764428 tGroup.add/*Child*/(tmp);
42774429 else
4278
- GrafreeD.clipboard = tmp;
4430
+ Grafreed.clipboard = tmp;
42794431 }
42804432 else
4281
- if (GrafreeD.clipboardIsTempGroup)
4433
+ if (Grafreed.clipboardIsTempGroup)
42824434 tGroup.add/*Child*/(child);
42834435 else
4284
- GrafreeD.clipboard = child;
4436
+ Grafreed.clipboard = child;
42854437 }
42864438
42874439 }
4288
- if (GrafreeD.clipboardIsTempGroup)
4289
- GrafreeD.clipboard = tGroup;
4440
+ if (Grafreed.clipboardIsTempGroup)
4441
+ Grafreed.clipboard = tGroup;
42904442 if (cut)
42914443 {
42924444 ResetModel();
....@@ -4300,7 +4452,7 @@
43004452 // return;
43014453 boolean first = true;
43024454
4303
- if (GrafreeD.clipboardIsTempGroup)
4455
+ if (Grafreed.clipboardIsTempGroup)
43044456 {
43054457 Composite temp;
43064458
....@@ -4311,7 +4463,7 @@
43114463 temp = (Composite)Applet3D.clipboard.deepCopy();
43124464 */
43134465 Object3D elem;
4314
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4466
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43154467 {
43164468 Object3D child = (Object3D)e.nextElement();
43174469
....@@ -4345,21 +4497,21 @@
43454497 //Object3D cb = Applet3D.clipboard;
43464498 //temp.addChild(cb);
43474499 //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());
4500
+ assert(Grafreed.clipboard.parent == null);
4501
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4502
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4503
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4504
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43534505 else
4354
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4355
- GrafreeD.clipboard.get(0).parent = keepparent;
4506
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4507
+ Grafreed.clipboard.get(0).parent = keepparent;
43564508 }
43574509
43584510 ResetModel();
43594511 refreshContents();
43604512 }
43614513
4362
- void pasteInto(boolean copyit)
4514
+ void pasteInto(boolean copyit, boolean clone)
43634515 {
43644516 // if (GrafreeD.clipboard == null)
43654517 // return;
....@@ -4388,15 +4540,22 @@
43884540 if (copyit)
43894541 {
43904542 // paste(false);
4391
- CloneClipboard(false); // sept 2014
4543
+ if (clone)
4544
+ {
4545
+ CloneClipboard(false); // sept 2014
4546
+ }
4547
+ else
4548
+ {
4549
+ paste(false);
4550
+ }
43924551 }
43934552 else
43944553 {
43954554 boolean first = true;
43964555
4397
- if (GrafreeD.clipboardIsTempGroup)
4556
+ if (Grafreed.clipboardIsTempGroup)
43984557 {
4399
- Composite temp = (Composite)GrafreeD.clipboard;
4558
+ Composite temp = (Composite)Grafreed.clipboard;
44004559 Object3D copy;
44014560 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44024561 {
....@@ -4406,7 +4565,7 @@
44064565 }
44074566 } else
44084567 {
4409
- linkSomething(GrafreeD.clipboard); //.get(0));
4568
+ linkSomething(Grafreed.clipboard); //.get(0));
44104569 }
44114570 }
44124571 }
....@@ -4851,7 +5010,7 @@
48515010
48525011 void ImportVRMLX3D()
48535012 {
4854
- if (GrafreeD.standAlone)
5013
+ if (Grafreed.standAlone)
48555014 {
48565015 /**/
48575016 FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
....@@ -4868,7 +5027,7 @@
48685027
48695028 String GetFile(String dialogName)
48705029 {
4871
- if (GrafreeD.standAlone)
5030
+ if (Grafreed.standAlone)
48725031 {
48735032 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48745033 browser.show();
....@@ -4932,10 +5091,12 @@
49325091 cButton flashSelectionButton;
49335092 cButton editButton;
49345093 cButton uneditButton;
5094
+ JCheckBox allParamsButton;
49355095 cButton clearpanelButton;
4936
- cButton allParamsButton;
49375096 cButton unselectButton;
49385097
5098
+ cButton oneStepButton;
5099
+
49395100 cButton screenfitButton;
49405101 cButton screenfitpointButton;
49415102 cButton snapobjectButton;
....@@ -4979,7 +5140,7 @@
49795140 private MenuItem linkverticesItem;
49805141 private MenuItem relinkverticesItem;
49815142 private MenuItem setMasterItem;
4982
- private MenuItem resetMeshItem;
5143
+ private MenuItem resetAllItem;
49835144 private MenuItem stepAllItem;
49845145 private MenuItem revertMeshItem;
49855146 private MenuItem poseMeshItem;
....@@ -4990,6 +5151,7 @@
49905151 private MenuItem mergeGeometriesItem;
49915152 private MenuItem copyItem;
49925153 private MenuItem pasteItem;
5154
+ private MenuItem pasteIntoItem;
49935155 private MenuItem pasteLinkItem;
49945156 private MenuItem pasteCloneItem;
49955157 private MenuItem pasteExpandItem;
....@@ -5039,8 +5201,10 @@
50395201 private MenuItem panoTexturesItem;
50405202
50415203 private MenuItem resetCentroidItem;
5042
- private MenuItem transformgeometryItem;
5204
+ private MenuItem resetCentroidXZItem;
50435205 private MenuItem resetTransformItem;
5206
+ private MenuItem transformGeometryItem;
5207
+ private MenuItem transformChildrenItem;
50445208 private MenuItem hideItem;
50455209 private MenuItem grabItem;
50465210 private MenuItem backItem;
....@@ -5087,7 +5251,7 @@
50875251 private MenuItem blobItem;
50885252 private MenuItem latheItem;
50895253 private MenuItem bezierItem;
5090
- private MenuItem checkerItem;
5254
+ private MenuItem overlayItem;
50915255 private MenuItem meshItem;
50925256 // private MenuItem meshGroupItem;
50935257 private MenuItem springItem;