Normand Briere
2019-06-09 989407a46041b80c71fd906bff6b97528e6f3350
GroupEditor.java
....@@ -12,6 +12,7 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
....@@ -97,14 +98,14 @@
9798
9899 void CloneClipboard(boolean supports)
99100 {
100
- assert(GrafreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
102
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
101
+ assert(Grafreed.clipboard.parent == null);
102
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
103
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
104
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
105
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105106 else
106
- makeSomething(CloneObject(GrafreeD.clipboard, false));
107
- GrafreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(Grafreed.clipboard, false));
108
+ Grafreed.clipboard.get(0).parent = keepparent;
108109 }
109110
110111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +119,7 @@
118119 // obj.support = null;
119120 if (!supports)
120121 obj.SaveSupports();
121
- Object3D clone = (Object3D)GrafreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122123 obj.parent = parent;
123124 // obj.support = support;
124125 // clone.support = support; // aout 2013
....@@ -149,6 +150,8 @@
149150
150151 void SetupMenu2(ObjEditor oe)
151152 {
153
+ if (Globals.ADVANCED)
154
+ {
152155 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153156 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154157 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,17 +163,21 @@
160163 lookAtItem.addActionListener(this);
161164 //lookFromItem.addActinoListener(this);
162165 //switchItem.addActionListener(this);
166
+ }
167
+
163168 Menu menu;
164169 oe.menuBar.add(menu = new Menu("Edit"));
165170 //editItem = menu.add(new MenuItem("Edit"));
166171 //editItem.addActionListener(this);
167172 duplicateItem = menu.add(new MenuItem("Duplicate"));
168173 duplicateItem.addActionListener(this);
169
- menu.add("-");
170174 cloneItem = menu.add(new MenuItem("Clone"));
171175 cloneItem.addActionListener(this);
176
+ if (Globals.ADVANCED)
177
+ {
172178 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173179 cloneSupportItem.addActionListener(this);
180
+ }
174181 menu.add("-");
175182 cutItem = menu.add(new MenuItem("Cut"));
176183 cutItem.addActionListener(this);
....@@ -178,27 +185,37 @@
178185 copyItem.addActionListener(this);
179186 pasteItem = menu.add(new MenuItem("Paste"));
180187 pasteItem.addActionListener(this);
188
+ menu.add("-");
189
+
190
+ menu.add("-");
191
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
192
+ pasteIntoItem.addActionListener(this);
181193 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182194 pasteLinkItem.addActionListener(this);
183195 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184196 pasteCloneItem.addActionListener(this);
185197 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186198 // pasteExpandItem.addActionListener(this);
199
+ menu.add("-");
187200 clearItem = menu.add(new MenuItem("Clear"));
188201 clearItem.addActionListener(this);
202
+
203
+ if (Globals.ADVANCED)
204
+ {
205
+ // Deletes the cameras...
189206 clearAllItem = menu.add(new MenuItem("Clear All"));
190207 clearAllItem.addActionListener(this);
208
+ }
191209
192210 oe.menuBar.add(menu = new Menu("Setting"));
193
- resetMeshItem = menu.add(new MenuItem("Reset All"));
194
- resetMeshItem.addActionListener(this);
195
- stepAllItem = menu.add(new MenuItem("Step All"));
196
- stepAllItem.addActionListener(this);
211
+ if (Globals.ADVANCED)
212
+ {
197213 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198214 revertMeshItem.addActionListener(this);
199215 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200216 resetreferencesItem.addActionListener(this);
201217 menu.add("-");
218
+ }
202219 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203220 overwriteGeoItem.addActionListener(this);
204221 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,19 +227,26 @@
210227 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211228 overwriteUVItem.addActionListener(this);
212229 menu.add("-");
230
+ if (Globals.ADVANCED)
231
+ {
213232 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214233 generateMeshItem.addActionListener(this);
215234 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216235 poseMeshItem.addActionListener(this);
217236 menu.add("-");
237
+ }
218238 resetsupportItem = menu.add(new MenuItem("Reset support"));
219239 resetsupportItem.addActionListener(this);
220240 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221241 linkverticesItem.addActionListener(this);
222242 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223243 relinkverticesItem.addActionListener(this);
244
+
245
+ if (Globals.ADVANCED)
246
+ {
224247 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225248 setMasterItem.addActionListener(this);
249
+ }
226250
227251 oe.menuBar.add(menu = new Menu("Group"));
228252 grabItem = menu.add(new MenuItem("Grab"));
....@@ -233,27 +257,32 @@
233257 frontItem.addActionListener(this);
234258 compositeItem = menu.add(new MenuItem("Composite"));
235259 compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
260
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237261 hideItem.addActionListener(this);
238262 ungroupItem = menu.add(new MenuItem("Ungroup"));
239263 ungroupItem.addActionListener(this);
240264 menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
265
+ randomItem = menu.add(new MenuItem("Switch node"));
242266 randomItem.addActionListener(this);
243
- physicsItem = menu.add(new MenuItem("Physics"));
244
- physicsItem.addActionListener(this);
245
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
246
- frameselectorItem.addActionListener(this);
247267 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248268 switchGeoItem.addActionListener(this);
249269 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250270 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
271
+ morphItem = menu.add(new MenuItem("Morph Group"));
252272 morphItem.addActionListener(this);
273
+
274
+ if (Globals.ADVANCED)
275
+ {
276
+ menu.add("-");
277
+ physicsItem = menu.add(new MenuItem("Physics"));
278
+ physicsItem.addActionListener(this);
279
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
280
+ frameselectorItem.addActionListener(this);
253281 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254282 scriptNodeItem.addActionListener(this);
255283 cameraItem = menu.add(new MenuItem("Camera"));
256284 cameraItem.addActionListener(this);
285
+ }
257286
258287 oe.menuBar.add(menu = new Menu("Object"));
259288 textureItem = menu.add(new MenuItem("Texture"));
....@@ -268,21 +297,29 @@
268297 shadowYItem.addActionListener(this);
269298 shadowZItem = menu.add(new MenuItem("Shadow Z"));
270299 shadowZItem.addActionListener(this);
300
+ if (Globals.ADVANCED)
301
+ {
302
+ menu.add("-");
271303 linkerItem = menu.add(new MenuItem("Linker"));
272304 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275305 attributeItem = menu.add(new MenuItem("Attribute"));
276306 attributeItem.addActionListener(this);
307
+ templateItem = menu.add(new MenuItem("Template"));
308
+ templateItem.addActionListener(this);
277309 pointflowItem = menu.add(new MenuItem("Point Flow"));
278310 pointflowItem.addActionListener(this);
311
+ }
279312 menu.add("-");
280313 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281314 resetTransformItem.addActionListener(this);
282315 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283316 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.addActionListener(this);
317
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
318
+ resetCentroidXZItem.addActionListener(this);
319
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
320
+ transformGeometryItem.addActionListener(this);
321
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
322
+ transformChildrenItem.addActionListener(this);
286323
287324 oe.menuBar.add(menu = new Menu("Geometry"));
288325 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +330,11 @@
293330 genNormalsCADItem.addActionListener(this);
294331 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295332 genNormalsMESHItem.addActionListener(this);
333
+ if (Globals.ADVANCED)
334
+ {
296335 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297336 genNormalsMINEItem.addActionListener(this);
337
+ }
298338 stripifyItem = menu.add(new MenuItem("Stripify"));
299339 stripifyItem.addActionListener(this);
300340 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +356,34 @@
316356 reduce34MeshItem.addActionListener(this);
317357 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318358 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321359 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322360 clipMeshItem.addActionListener(this);
361
+
362
+ if (Globals.ADVANCED)
363
+ {
364
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
365
+ smoothMeshItem.addActionListener(this);
366
+ }
323367
324368 oe.menuBar.add(menu = new Menu("Attributes"));
325369 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326370 clearMaterialsItem.addActionListener(this);
371
+ resetAllItem = menu.add(new MenuItem("Reset All"));
372
+ resetAllItem.addActionListener(this);
373
+ stepAllItem = menu.add(new MenuItem("Step All"));
374
+ stepAllItem.addActionListener(this);
327375 menu.add("-");
328376 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329377 liveleavesItem.addActionListener(this);
330378 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331379 unliveleavesItem.addActionListener(this);
380
+ if (Globals.ADVANCED)
381
+ {
332382 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333383 supportleavesItem.addActionListener(this);
334384 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335385 unsupportleavesItem.addActionListener(this);
386
+ }
336387 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337388 hideleavesItem.addActionListener(this);
338389 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -376,28 +427,34 @@
376427 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377428 sortbynameItem.addActionListener(this);
378429 menu.add("-");
430
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
431
+ shareGeometriesItem.addActionListener(this);
432
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
433
+ mergeGeometriesItem.addActionListener(this);
434
+ if (Globals.ADVANCED)
435
+ {
436
+ // Pretty much the same as duplicate and clone.
379437 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380438 extractGeometriesItem.addActionListener(this);
381439 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382440 cloneGeometriesItem.addActionListener(this);
383
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
384
- shareGeometriesItem.addActionListener(this);
385
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
386
- mergeGeometriesItem.addActionListener(this);
441
+ }
387442
388443 oe.menuBar.add(menu = new Menu("Insert"));
389444 buildCreateMenu(menu);
390445
391
-
392446 oe.menuBar.add(menu = new Menu("Include"));
393
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
394
- importGFDItem.addActionListener(this);
395
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
396
- importVRMLX3DItem.addActionListener(this);
397
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
447
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
398448 importOBJItem.addActionListener(this);
399
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
449
+ menu.add("-");
450
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
400451 import3DSItem.addActionListener(this);
452
+ menu.add("-");
453
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
454
+ importVRMLX3DItem.addActionListener(this);
455
+ menu.add("-");
456
+ importGFDItem = menu.add(new MenuItem("GrafreeD file..."));
457
+ importGFDItem.addActionListener(this);
401458
402459 oe.menuBar.add(menu = new Menu("Tools"));
403460 buildToolsMenu(menu);
....@@ -433,153 +490,98 @@
433490 oe.radioPanel.add(dummyButton);
434491 oe.buttonGroup.add(dummyButton);
435492 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
493
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439494
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
495
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
496
+ liveCB.setToolTipText("Enable animation");
441497 liveCB.addItemListener(this);
442498
443
- oe.aConstraints.gridx += 1;
444
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
445
- supportCB.addItemListener(this);
446
-
447
- // oe.aConstraints.gridx += 1;
448
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
449
- // localCB.addItemListener(this);
450
-
451
- oe.aConstraints.gridx += 1;
452
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
453
- crowdCB.addItemListener(this);
454
-
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
457
- smoothCB.addItemListener(this);
458
-
459
- oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), 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");
461505 fastCB.addItemListener(this);
462
- oe.aConstraints.gridx += 1;
463
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
464
- slowCB.addItemListener(this);
465
- oe.aConstraints.gridx += 1;
466
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
467
- boxCB.addItemListener(this);
468
-
469
-// oe.aConstraints.gridx += 1;
470
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
471
-// speakerMocapCB.addItemListener(this);
472
-
473
- if (false)
474
- {
475
- // handled in scripts
476
- oe.aConstraints.gridx += 1;
477
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
478
- speakerCameraCB.addItemListener(this);
479
-
480
- oe.aConstraints.gridx += 1;
481
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
482
- speakerFocusCB.addItemListener(this);
483
-
484
- oe.aConstraints.gridx += 1;
485
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
486
- smoothfocusCB.addItemListener(this);
487
- }
488
-
489
-//oe.aConstraints.gridx += 1;
490
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
491
-// debugCB.addItemListener(this);
492
-
493
- oe.aConstraints.gridx += 1;
494
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
495
- oeilCB.addItemListener(this);
496
-
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
499
- lookAtCB.addItemListener(this);
500
-
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
506
+
507
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
508
+ trackCB.setToolTipText("Enable tracking");
503509 trackCB.addItemListener(this);
504510
505
- oe.aConstraints.gridx += 1;
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
511
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
512
+ screenfitButton.setToolTipText("Screen fit");
507513 screenfitButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
514
+
509515 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
510516 // screenfitpointButton.addActionListener(this);
511
-// oe.aConstraints.gridx += 1;
512
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
513
- snapobjectButton.addActionListener(this);
514
- oe.aConstraints.gridx += 1;
515517
516
- //aConstraints.gridx = 0;
517
- //aConstraints.gridy += 1;
518
- oe.aConstraints.weighty = 0;
519
- oe.aConstraints.gridwidth = 1;
520
-
521
- 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);
526
+ flashSelectionButton.setToolTipText("Show selection");
522527 flashSelectionButton.addActionListener(this);
523528
524
- oe.toolbarPanel.add(new cButton(" ", false));
529
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
525530
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- //
531
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
531
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
532
+ twoButton.setToolTipText("Show center view only");
532533 twoButton.addActionListener(this);
533
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
534
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
534535 fourButton.addActionListener(this);
535
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
536
+ fourButton.setToolTipText("Show left panel only");
537
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
538
+ sixButton.setToolTipText("2-column layout left");
536539 sixButton.addActionListener(this);
537
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
540
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
541
+ threeButton.setToolTipText("2-column layout right");
538542 threeButton.addActionListener(this);
539
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
543
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
544
+ sevenButton.setToolTipText("3-column layout");
540545 sevenButton.addActionListener(this);
541546 //
542547
543
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
548
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
549
+ rootButton.setToolTipText("Edit selection in new tab");
544550 rootButton.addActionListener(this);
545
- oe.aConstraints.gridx += 1;
546
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
551
+
552
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
553
+ closeButton.setToolTipText("Close tab");
547554 closeButton.addActionListener(this);
548555 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
549556 //clearButton.addActionListener(this);
550
- oe.aConstraints.gridx += 1;
551557
552
- oe.aConstraints.gridx = 1; //
553
- 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");
554562 editButton.addActionListener(this);
555
- oe.aConstraints.gridx += 1;
556
- oe.aConstraints.weighty = 0;
557
- oe.aConstraints.gridwidth = 1;
558563
559
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
564
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
565
+ uneditButton.setToolTipText("Unedit selection");
560566 uneditButton.addActionListener(this);
561567
562
- oe.aConstraints.gridx += 1;
563
- oe.aConstraints.weighty = 0;
564
- oe.aConstraints.gridwidth = 1;
565
-
566
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
567
- clearPanelButton.addActionListener(this);
568
-
569
- oe.aConstraints.gridx += 1;
570
- oe.aConstraints.weighty = 0;
571
- oe.aConstraints.gridwidth = 1;
572
-
573
- 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");
574570 allParamsButton.addActionListener(this);
575571
576
- oe.aConstraints.gridx += 1;
577
- oe.aConstraints.weighty = 0;
578
- oe.aConstraints.gridwidth = 1;
579
-
580
- 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");
581578 unselectButton.addActionListener(this);
582579
580
+ commandsPanel.preferredHeight = 1;
581
+
582
+ oe.treePanel.add(commandsPanel);
583
+ oe.treePanel.Return();
584
+
583585 // oe.aConstraints.gridx += 1;
584586 // oe.aConstraints.weighty = 0;
585587 // oe.aConstraints.gridwidth = 1;
....@@ -591,40 +593,37 @@
591593 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
592594 // gcButton.addActionListener(this);
593595
594
- oe.aConstraints.gridx = 0;
595
- oe.aConstraints.gridy += 1;
596
-
597
- //ctrlPanel.add(objList = new List(5, true));
598
- oe.aConstraints.gridwidth = 100;
599
- // oe.aConstraints.gridheight = 100;
600
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
601
- oe.aConstraints.gridheight = 1;
602
- oe.aConstraints.weighty = 0.5;
603
- oe.aConstraints.gridx = 0;
604
- JScrollPane jSP;
596
+ cGridBag jSPPanel = new cGridBag();
597
+
598
+ JScrollPane jSP;
605599 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
606
- 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);
607601 ResetModel();
608
- oe.aConstraints.weighty = 0.5;
609
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
610
- oe.aConstraints.gridy += 1;
611
- oe.aConstraints.gridwidth = 1;
602
+
603
+ oe.treePanel.add(jSPPanel);
604
+ oe.treePanel.Return();
612605
613
- oe.aConstraints.weighty = 0;
614
- oe.aConstraints.gridwidth = 2;
615
-
616
- 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");
617610 colorCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- 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");
620614 materialCB.addItemListener(this);
621
- oe.aConstraints.gridx += 2;
622
- 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");
623618 textureCB.addItemListener(this);
624619
625
- oe.aConstraints.gridx = 0;
626
- oe.aConstraints.gridy += 1;
620
+ copyOptionsPanel.preferredHeight = 1;
621
+ oe.treePanel.add(copyOptionsPanel);
622
+ oe.treePanel.Return();
627623
624
+// mainPanel.setDividerLocation(0.5); //1.0);
625
+// mainPanel.setResizeWeight(0.5);
626
+
628627 //jList.addListSelectionListener(this);
629628 oe.jTree.addTreeSelectionListener(this);
630629 //jTree.setRootVisible(false);
....@@ -646,6 +645,78 @@
646645 radio.layout = sevenButton;
647646 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
648647 }
648
+
649
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
650
+ {
651
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
652
+ boxCB.setToolTipText("Display bounding boxes");
653
+ boxCB.addItemListener(this);
654
+
655
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
656
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
657
+ zoomBoxCB.addItemListener(this);
658
+
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
+
680
+// constraints.gridy += 1;
681
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
682
+// speakerMocapCB.addItemListener(this);
683
+
684
+ if (false)
685
+ {
686
+ // handled in scripts
687
+ //constraints.gridy += 1;
688
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
689
+ speakerCameraCB.addItemListener(this);
690
+
691
+ //constraints.gridy += 1;
692
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
693
+ speakerFocusCB.addItemListener(this);
694
+
695
+ //constraints.gridy += 1;
696
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
697
+ smoothfocusCB.addItemListener(this);
698
+ }
699
+
700
+//constraints.gridx += 1;
701
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
702
+// debugCB.addItemListener(this);
703
+
704
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
705
+ oeilCB.addItemListener(this);
706
+
707
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
708
+ lookAtCB.setToolTipText("Look-at target");
709
+ lookAtCB.addItemListener(this);
710
+
711
+ }
712
+
713
+ cGridBag fill = new cGridBag();
714
+
715
+ fill.preferredHeight = 200;
716
+
717
+ panel.add(fill);
718
+
719
+ }
649720
650721 void EditObject(Object3D obj)
651722 {
....@@ -658,6 +729,7 @@
658729 buttonGroup.add(radioButton);
659730 radioButton.doClick();
660731 }
732
+
661733 void SetupViews(ObjEditor oe)
662734 {
663735 oe.SetupViews();
....@@ -676,6 +748,7 @@
676748 JCheckBox fastCB;
677749 JCheckBox slowCB;
678750 JCheckBox boxCB;
751
+ JCheckBox zoomBoxCB;
679752 JCheckBox trackCB;
680753 JCheckBox smoothfocusCB;
681754 // JCheckBox speakerMocapCB;
....@@ -755,6 +828,10 @@
755828 Recompile();
756829 cameraView.repaint();
757830 // refreshContents();
831
+ }
832
+ else if(e.getSource() == zoomBoxCB)
833
+ {
834
+ cameraView.ToggleZoomBoxMode();
758835 }
759836 else if(e.getSource() == smoothfocusCB)
760837 {
....@@ -869,7 +946,9 @@
869946 // objEditor.DropFile((java.io.File[]) object, true);
870947 // return;
871948 // }
872
- if (string.charAt(0) == '/')
949
+
950
+ // File path for Mac and Windows
951
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
873952 {
874953 // file(s)
875954 String[] names = string.split("\n");
....@@ -896,7 +975,7 @@
896975
897976 flashIt = false;
898977 CameraPane pane = (CameraPane) target;
899
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
978
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
900979 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
901980
902981 if (group.selection.size() == 1)
....@@ -923,11 +1002,11 @@
9231002 {
9241003 loadClipboard(true);
9251004 objEditor.jTree.setSelectionPath(destinationPath);
926
- pasteInto(false);
1005
+ pasteInto(false, false);
9271006 } else {
9281007 loadClipboard(false);
9291008 objEditor.jTree.setSelectionPath(destinationPath);
930
- pasteInto(false); // true); // ???
1009
+ pasteInto(false, false); // true); // ???
9311010 }
9321011 }
9331012 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1049,27 +1128,33 @@
10491128 kleinItem.addActionListener(this);
10501129 particleItem = menu.add(new MenuItem("Particle system"));
10511130 particleItem.addActionListener(this);
1131
+ if (Globals.ADVANCED)
1132
+ {
10521133 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10531134 ragdollItem.addActionListener(this);
10541135 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10551136 ragdoll2Item.addActionListener(this);
1137
+ }
10561138 menu.add("-");
1057
- meshItem = menu.add(new MenuItem("Mesh"));
1139
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10581140 meshItem.addActionListener(this);
10591141 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10601142 // meshGroupItem.addActionListener(this);
1143
+ if (Globals.ADVANCED)
1144
+ {
10611145 springItem = menu.add(new MenuItem("Spring"));
10621146 springItem.addActionListener(this);
10631147 flagItem = menu.add(new MenuItem("Flag"));
10641148 flagItem.addActionListener(this);
1065
- bezierItem = menu.add(new MenuItem("Patch"));
1066
- bezierItem.addActionListener(this);
1067
- checkerItem = menu.add(new MenuItem("Checker"));
1068
- checkerItem.addActionListener(this);
10691149 blobItem = menu.add(new MenuItem("Blob"));
10701150 blobItem.addActionListener(this);
10711151 latheItem = menu.add(new MenuItem("Lathe"));
10721152 latheItem.addActionListener(this);
1153
+ }
1154
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1155
+ bezierItem.addActionListener(this);
1156
+ overlayItem = menu.add(new MenuItem("Overlay"));
1157
+ overlayItem.addActionListener(this);
10731158 lightItem = menu.add(new MenuItem("Light"));
10741159 lightItem.addActionListener(this);
10751160 menu.add("-");
....@@ -1079,34 +1164,39 @@
10791164 loopItem.addActionListener(this);
10801165 doubleItem = menu.add(new MenuItem("Fork"));
10811166 doubleItem.addActionListener(this);
1167
+ if (Globals.ADVANCED)
1168
+ {
10821169 tripleItem = menu.add(new MenuItem("Trident"));
10831170 tripleItem.addActionListener(this);
1171
+ }
10841172 }
10851173
10861174 void buildToolsMenu(Menu menu)
10871175 {
10881176 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10891177 animationItem.addItemListener(this);
1090
- animationItem.setState(CameraPane.ANIMATION);
1178
+ animationItem.setState(Globals.ANIMATION);
10911179
10921180 menu.add("-");
10931181 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10941182 parseverticesItem.addActionListener(this);
10951183 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10961184 textureFieldItem.addActionListener(this);
1097
- alignItem = menu.add(new MenuItem("Align"));
1185
+ alignItem = menu.add(new MenuItem("Align Objects"));
10981186 alignItem.addActionListener(this);
1099
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1100
- mirrorItem.addActionListener(this);
11011187 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11021188 reduceMorphItem.addActionListener(this);
11031189 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11041190 reduce34MorphItem.addActionListener(this);
1105
-
1191
+ menu.add("-");
11061192 menu.add(computeAOItem = new MenuItem("Compute AO"));
11071193 computeAOItem.addActionListener(this);
1108
- menu.add("-");
11091194
1195
+ if (Globals.ADVANCED)
1196
+ {
1197
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1198
+ mirrorItem.addActionListener(this);
1199
+ menu.add("-");
11101200 menu.add(memoryItem = new MenuItem("Memory Usage"));
11111201 memoryItem.addActionListener(this);
11121202 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1129,6 +1219,7 @@
11291219 menu.add("-");
11301220 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11311221 editScriptItem.addActionListener(this);
1222
+ }
11321223 }
11331224
11341225 void ScreenFit()
....@@ -1457,9 +1548,9 @@
14571548
14581549 void Overwrite(int mask)
14591550 {
1460
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1551
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14611552 {
1462
- Object3D content = GrafreeD.clipboard.get(0);
1553
+ Object3D content = Grafreed.clipboard.get(0);
14631554
14641555 if (content instanceof cGroup && ((cGroup)content).transientlink )
14651556 content = ((cGroup)content).get(0);
....@@ -1482,6 +1573,7 @@
14821573 //
14831574 public void actionPerformed(ActionEvent event) // , Object arg)
14841575 {
1576
+ Object source = event.getSource();
14851577 /*
14861578 if (event.getSource() == nameField)
14871579 {
....@@ -1493,11 +1585,11 @@
14931585 }
14941586 else
14951587 */
1496
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1588
+ if (source == lookAtItem || source == lookFromItem)
14971589 {
14981590 ScreenFit();
14991591 } else
1500
- if (event.getSource() == switchItem)
1592
+ if (source == switchItem)
15011593 {
15021594 cVector v1 = new cVector();
15031595 cVector v2 = new cVector();
....@@ -1506,11 +1598,11 @@
15061598 objEditor.cameraView.renderCamera.setAim(v2, v1);
15071599 objEditor.cameraView.repaint();
15081600 } else
1509
- if (event.getSource() == rectoidItem)
1601
+ if (source == rectoidItem)
15101602 {
15111603 makeSomething(new Box());
15121604 } else
1513
- if (event.getSource() == particleItem)
1605
+ if (source == particleItem)
15141606 {
15151607 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15161608 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1531,9 +1623,9 @@
15311623 applyExample(particleGeom, "SMOKE");
15321624 makeSomething(particleGeom);
15331625 } else
1534
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1626
+ if (source == ragdollItem || source == ragdoll2Item)
15351627 {
1536
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1628
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15371629
15381630 ragdoll.toParent = LA.newMatrix();
15391631 ragdoll.fromParent = LA.newMatrix();
....@@ -1551,7 +1643,7 @@
15511643 } else
15521644 /*
15531645 */
1554
- if (event.getSource() == heightFieldItem)
1646
+ if (source == heightFieldItem)
15551647 {
15561648 Object3D obj = new Object3D();
15571649
....@@ -1589,31 +1681,31 @@
15891681
15901682 makeSomething(obj);
15911683 } else
1592
- if (event.getSource() == gridItem)
1684
+ if (source == gridItem)
15931685 {
15941686 makeSomething(new Grid());
15951687 } else
1596
- if (event.getSource() == ellipsoidItem)
1688
+ if (source == ellipsoidItem)
15971689 {
15981690 makeSomething(new Sphere());
15991691 } else
1600
- if (event.getSource() == coneItem)
1692
+ if (source == coneItem)
16011693 {
16021694 makeSomething(new Cone());
16031695 } else
1604
- if (event.getSource() == torusItem)
1696
+ if (source == torusItem)
16051697 {
16061698 makeSomething(new Torus());
16071699 } else
1608
- if (event.getSource() == superItem)
1700
+ if (source == superItem)
16091701 {
16101702 makeSomething(new Superellipsoid());
16111703 } else
1612
- if (event.getSource() == kleinItem)
1704
+ if (source == kleinItem)
16131705 {
16141706 makeSomething(new Klein());
16151707 } else
1616
- if (event.getSource() == blobItem)
1708
+ if (source == blobItem)
16171709 {
16181710 Blob blob = new Blob();
16191711 BlobComponent comp = new BlobComponent();
....@@ -1621,15 +1713,15 @@
16211713 //blob.retile();
16221714 makeSomething(blob);
16231715 } else
1624
- if (event.getSource() == latheItem)
1716
+ if (source == latheItem)
16251717 {
16261718 makeSomething(new Lathe());
16271719 } else
1628
- if (event.getSource() == bezierItem)
1720
+ if (source == bezierItem)
16291721 {
16301722 makeSomething(new BezierSurface());
16311723 } else
1632
- if (event.getSource() == checkerItem)
1724
+ if (source == overlayItem)
16331725 {
16341726 /*
16351727 Object3D obj = new BezierSurface(5,8);
....@@ -1644,7 +1736,7 @@
16441736 */
16451737 makeSomething(new Checker());
16461738 } else
1647
- if (event.getSource() == meshItem)
1739
+ if (source == meshItem)
16481740 {
16491741 Object3D itemtomake = new Object3D();
16501742 Object3D child;
....@@ -1665,35 +1757,35 @@
16651757 makeSomething(child);
16661758 }
16671759 } else
1668
- if (event.getSource() == springItem)
1760
+ if (source == springItem)
16691761 {
16701762 cSpring s = new cSpring();
16711763 s.setup();
16721764 makeSomething(s);
16731765 } else
1674
- if (event.getSource() == flagItem)
1766
+ if (source == flagItem)
16751767 {
16761768 cSpring s = new cFlag();
16771769 s.setup();
16781770 makeSomething(s);
16791771 } else
1680
- if (event.getSource() == lightItem)
1772
+ if (source == lightItem)
16811773 {
16821774 makeSomething(new Light());
16831775 } else
1684
- if (event.getSource() == csgItem)
1776
+ if (source == csgItem)
16851777 {
16861778 group(new CSG());
16871779 } else
1688
- if (event.getSource() == templateItem)
1780
+ if (source == templateItem)
16891781 {
16901782 group(new cTemplate());
16911783 } else
1692
- if (event.getSource() == attributeItem)
1784
+ if (source == attributeItem)
16931785 {
16941786 makeSomething(new Attribute());
16951787 } else
1696
- if (event.getSource() == pointflowItem)
1788
+ if (source == pointflowItem)
16971789 {
16981790 makeSomething(new PointFlow());
16991791 } else
....@@ -1705,7 +1797,7 @@
17051797 } else
17061798 */
17071799
1708
- if (event.getSource() == superLoopItem)
1800
+ if (source == superLoopItem)
17091801 {
17101802 Composite g = new cGroup();
17111803 for (int i=0; i<15; i++)
....@@ -1727,7 +1819,7 @@
17271819
17281820 group(g);
17291821 } else
1730
- if (event.getSource() == loopItem)
1822
+ if (source == loopItem)
17311823 {
17321824 Composite csg = new GroupLeaf();
17331825 csg.count = 5;
....@@ -1736,7 +1828,7 @@
17361828 csg.addChild(child);
17371829 child.addChild(csg);
17381830 } else
1739
- if (event.getSource() == doubleItem)
1831
+ if (source == doubleItem)
17401832 {
17411833 Composite csg = new GroupLeaf();
17421834 csg.count = 5;
....@@ -1748,7 +1840,7 @@
17481840 csg.addChild(child);
17491841 child.addChild(csg);
17501842 } else
1751
- if (event.getSource() == tripleItem)
1843
+ if (source == tripleItem)
17521844 {
17531845 Composite csg = new GroupLeaf();
17541846 csg.count = 4;
....@@ -1764,70 +1856,83 @@
17641856 child.addChild(csg);
17651857 } else
17661858
1767
- if (event.getSource() == importGFDItem)
1859
+ if (source == importGFDItem)
17681860 {
17691861 ImportGFD();
17701862 } else
1771
- if (event.getSource() == importVRMLX3DItem)
1863
+ if (source == importVRMLX3DItem)
17721864 {
17731865 ImportVRMLX3D();
17741866 } else
1775
- if (event.getSource() == import3DSItem)
1867
+ if (source == import3DSItem)
17761868 {
17771869 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17781870 } else
1779
- if (event.getSource() == importOBJItem)
1871
+ if (source == importOBJItem)
17801872 {
1781
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1873
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1874
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1875
+ browser.setVisible(true);
1876
+ String filename = browser.getFile();
1877
+ if (filename != null && filename.length() > 0)
1878
+ {
1879
+ String fullname = browser.getDirectory() + filename;
1880
+ makeSomething(ReadOBJ(fullname), true);
1881
+ }
17821882 } else
1783
- if (event.getSource() == computeAOItem)
1883
+ if (source == computeAOItem)
17841884 {
1785
- CameraPane.drawMode = CameraPane.OCCLUSION;
1786
- CameraPane.theRenderer.repaint();
1885
+ Globals.drawMode = CameraPane.OCCLUSION;
1886
+ Globals.theRenderer.repaint();
17871887 } else
1788
- if (event.getSource() == recompileItem)
1888
+ if (source == recompileItem)
17891889 {
17901890 Recompile();
17911891 refreshContents();
17921892 } else
1793
- if (event.getSource() == editScriptItem)
1893
+ if (source == editScriptItem)
17941894 {
17951895 OpenDialog();
17961896 refreshContents();
17971897 } else
1798
- if (event.getSource() == invariantsItem)
1898
+ if (source == invariantsItem)
17991899 {
18001900 System.out.println("Invariants:");
1801
- GrafreeD.grafreeD.universe.invariants();
1901
+ Grafreed.grafreeD.universe.invariants();
18021902 } else
1803
- if (event.getSource() == memoryItem)
1903
+ if (source == memoryItem)
18041904 {
18051905 //System.out.println("Invariants:");
18061906 PrintMemory();
18071907 } else
1808
- if (event.getSource() == pathItem)
1908
+ if (source == pathItem)
18091909 {
18101910 PrintPath();
18111911 } else
1812
- if (event.getSource() == analyzeItem)
1912
+ if (source == analyzeItem)
18131913 {
18141914 AnalyzeObject();
18151915 } else
1816
- if (event.getSource() == dumpItem)
1916
+ if (source == dumpItem)
18171917 {
18181918 DumpObject();
18191919 } else
1820
- if (event.getSource() == screenfitButton)
1920
+ if (source == oneStepButton)
1921
+ {
1922
+ Globals.ONESTEP = true;
1923
+ cameraView.repaint();
1924
+ } else
1925
+ if (source == screenfitButton)
18211926 {
18221927 //Reload(lastConverter, lastFilename, true);
18231928 ScreenFit();
18241929 } else
1825
- if (event.getSource() == screenfitpointButton)
1930
+ if (source == screenfitpointButton)
18261931 {
18271932 //Reload(lastConverter, lastFilename, true);
18281933 ScreenFitPoint();
18291934 } else
1830
- if (event.getSource() == snapobjectButton)
1935
+ if (source == snapobjectButton)
18311936 {
18321937 //Reload(lastConverter, lastFilename, true);
18331938 SnapObject();
....@@ -1838,13 +1943,13 @@
18381943 // Recompile();
18391944 // refreshContents();
18401945 // } else
1841
- if (event.getSource() == gcButton)
1946
+ if (source == gcButton)
18421947 {
18431948 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18441949 System.gc();
18451950 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18461951 } else
1847
- if (event.getSource() == editLeafItem)
1952
+ if (source == editLeafItem)
18481953 {
18491954 Object3D obj;
18501955 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1858,62 +1963,66 @@
18581963 }
18591964 refreshContents(true);
18601965 } else
1861
- if (event.getSource() == openWindowItem)
1966
+ if (source == openWindowItem)
18621967 {
18631968 EditSelection(true);
18641969 } else
1865
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1970
+ if (source == cutItem || source == clearButton)
18661971 {
18671972 loadClipboard(true);
18681973 } else
1869
- if (event.getSource() == duplicateItem)
1974
+ if (source == duplicateItem)
18701975 {
1871
- Object3D keep = GrafreeD.clipboard;
1976
+ Object3D keep = Grafreed.clipboard;
18721977 loadClipboard(false);
18731978 paste(false);
1874
- GrafreeD.clipboard = keep;
1979
+ Grafreed.clipboard = keep;
18751980 } else
1876
- if (event.getSource() == cloneItem)
1981
+ if (source == cloneItem)
18771982 {
18781983 CloneSelection(false);
18791984 } else
1880
- if (event.getSource() == cloneSupportItem)
1985
+ if (source == cloneSupportItem)
18811986 {
18821987 CloneSelection(true);
18831988 } else
1884
- if (event.getSource() == copyItem)
1989
+ if (source == copyItem)
18851990 {
18861991 loadClipboard(false);
18871992 } else
1888
- if (event.getSource() == pasteItem)
1993
+ if (source == pasteItem)
18891994 {
18901995 paste(false);
18911996 } else
1892
- if (event.getSource() == pasteLinkItem)
1997
+ if (source == pasteIntoItem)
18931998 {
1894
- pasteInto(false);
1999
+ pasteInto(true, false);
18952000 } else
1896
- if (event.getSource() == pasteCloneItem)
2001
+ if (source == pasteLinkItem)
18972002 {
1898
- pasteInto(true);
2003
+ pasteInto(false, false);
18992004 } else
1900
- if (event.getSource() == pasteExpandItem)
2005
+ if (source == pasteCloneItem)
2006
+ {
2007
+ pasteInto(true, true);
2008
+ } else
2009
+ if (source == pasteExpandItem)
19012010 {
19022011 paste(true);
19032012 } else
1904
- if (event.getSource() == synchronizeItem)
2013
+ if (source == synchronizeItem)
19052014 {
19062015 Overwrite(Object3D.TRANSFORM);
19072016 } else
1908
- if (event.getSource() == overwriteNameItem)
2017
+ if (source == overwriteNameItem)
19092018 {
19102019 Overwrite(Object3D.NAME);
19112020 } else
1912
- if (event.getSource() == overwriteUVItem)
2021
+ if (source == overwriteUVItem)
19132022 {
19142023 Overwrite(Object3D.UV);
19152024 } else
1916
- if (event.getSource() == overwriteMatItem)
2025
+ if (source == overwriteMatItem)
19172026 {
19182027 /* july 2015
19192028 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1933,7 +2042,7 @@
19332042
19342043 Overwrite(dropAttributes);
19352044 }
1936
- if (event.getSource() == overwriteGeoItem)
2045
+ if (source == overwriteGeoItem)
19372046 {
19382047 Overwrite(Object3D.GEOMETRY);
19392048 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1950,7 +2059,7 @@
19502059 // refreshContents();
19512060 // }
19522061 } else
1953
- if (event.getSource() == generateMeshItem)
2062
+ if (source == generateMeshItem)
19542063 {
19552064 //if (group.selection.size() == 1)
19562065 // for (int i=0; i<group.selection.size(); i++)
....@@ -1961,7 +2070,7 @@
19612070 ResetModel();
19622071 refreshContents();
19632072 } else
1964
- if (event.getSource() == extractGeometriesItem)
2073
+ if (source == extractGeometriesItem)
19652074 {
19662075 boolean one = false;
19672076
....@@ -1988,7 +2097,7 @@
19882097 ResetModel();
19892098 refreshContents();
19902099 } else
1991
- if (event.getSource() == cloneGeometriesItem)
2100
+ if (source == cloneGeometriesItem)
19922101 {
19932102 boolean one = false;
19942103
....@@ -2014,7 +2123,7 @@
20142123 ResetModel();
20152124 refreshContents();
20162125 } else
2017
- if (event.getSource() == shareGeometriesItem)
2126
+ if (source == shareGeometriesItem)
20182127 {
20192128 boolean one = false;
20202129
....@@ -2044,7 +2153,7 @@
20442153 refreshContents();
20452154 }
20462155 } else
2047
- if (event.getSource() == mergeGeometriesItem)
2156
+ if (source == mergeGeometriesItem)
20482157 {
20492158 boolean one = false;
20502159
....@@ -2074,7 +2183,7 @@
20742183 ResetModel();
20752184 refreshContents();
20762185 } else
2077
- if (event.getSource() == linkverticesItem)
2186
+ if (source == linkverticesItem)
20782187 {
20792188 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20802189 // {
....@@ -2087,48 +2196,48 @@
20872196 // group.selection.get(0).setMasterThis(content); // should be identity
20882197 // refreshContents();
20892198 // }
2090
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2199
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20912200 {
2092
- Object3D content = GrafreeD.clipboard.get(0);
2201
+ Object3D content = Grafreed.clipboard.get(0);
20932202
20942203 if (content instanceof cGroup && ((cGroup)content).transientlink )
20952204 content = ((cGroup)content).get(0);
20962205
2097
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2206
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20982207 for (int i=0; i<group.selection.size(); i++)
20992208 {
2100
- boolean random = CameraPane.RANDOM;
2101
- CameraPane.RANDOM = false; // parse all random nodes
2209
+ boolean random = CameraPane.SWITCH;
2210
+ CameraPane.SWITCH = false; // parse all random nodes
21022211 group.selection.get(i).linkVerticesThis(content);
21032212 // group.selection.get(i).setMasterThis(content); // should be identity
2104
- CameraPane.RANDOM = random;
2213
+ CameraPane.SWITCH = random;
21052214 }
2106
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2215
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21072216 refreshContents();
21082217 }
21092218 } else
2110
- if (event.getSource() == resetsupportItem)
2219
+ if (source == resetsupportItem)
21112220 {
21122221 for (int i=0; i<group.selection.size(); i++)
21132222 {
2114
- boolean random = CameraPane.RANDOM;
2115
- CameraPane.RANDOM = false; // parse all random nodes
2223
+ boolean random = CameraPane.SWITCH;
2224
+ CameraPane.SWITCH = false; // parse all random nodes
21162225 group.selection.get(i).linkVerticesThis(null);
2117
- CameraPane.RANDOM = random;
2226
+ CameraPane.SWITCH = random;
21182227 }
21192228
21202229 refreshContents();
21212230 } else
2122
- if (event.getSource() == relinkverticesItem)
2231
+ if (source == relinkverticesItem)
21232232 {
2124
- boolean random = CameraPane.RANDOM;
2125
- CameraPane.RANDOM = false; // parse all random nodes
2233
+ boolean random = CameraPane.SWITCH;
2234
+ CameraPane.SWITCH = false; // parse all random nodes
21262235 group.selection.RelinkToSupport();
2127
- CameraPane.RANDOM = random;
2236
+ CameraPane.SWITCH = random;
21282237
21292238 refreshContents();
21302239 } else
2131
- if (event.getSource() == resetreferencesItem)
2240
+ if (source == resetreferencesItem)
21322241 {
21332242 for (int i=0; i<group.selection.size(); i++)
21342243 {
....@@ -2137,11 +2246,11 @@
21372246
21382247 refreshContents();
21392248 } else
2140
- if (event.getSource() == setMasterItem)
2249
+ if (source == setMasterItem)
21412250 {
2142
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2251
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21432252 {
2144
- Object3D content = GrafreeD.clipboard.get(0);
2253
+ Object3D content = Grafreed.clipboard.get(0);
21452254
21462255 if (content instanceof cGroup && ((cGroup)content).transientlink )
21472256 content = ((cGroup)content).get(0);
....@@ -2150,13 +2259,13 @@
21502259 refreshContents();
21512260 }
21522261 } else
2153
- if (event.getSource() == poseMeshItem)
2262
+ if (source == poseMeshItem)
21542263 {
21552264 if (group.selection.size() == 1)
21562265 {
2157
- if (GrafreeD.clipboard.size() == 1)
2266
+ if (Grafreed.clipboard.size() == 1)
21582267 {
2159
- Object3D content = GrafreeD.clipboard.get(0);
2268
+ Object3D content = Grafreed.clipboard.get(0);
21602269
21612270 if (content instanceof cGroup && ((cGroup)content).transientlink )
21622271 content = ((cGroup)content).get(0);
....@@ -2169,19 +2278,19 @@
21692278 }
21702279
21712280 } else
2172
- if (event.getSource() == revertMeshItem)
2281
+ if (source == revertMeshItem)
21732282 {
21742283 RevertMeshes();
21752284 } else
2176
- if (event.getSource() == resetMeshItem)
2285
+ if (source == resetAllItem)
21772286 {
21782287 ResetAll();
21792288 } else
2180
- if (event.getSource() == stepAllItem)
2289
+ if (source == stepAllItem)
21812290 {
21822291 StepAll();
21832292 } else
2184
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2293
+ if (source == clearItem) // || event.getSource() == clearButton)
21852294 {
21862295 //int indices[] = jList.getSelectedIndices();
21872296 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2189,46 +2298,46 @@
21892298
21902299 ClearSelection(false);
21912300 } else
2192
- if (event.getSource() == clearAllItem)
2301
+ if (source == clearAllItem)
21932302 {
21942303 ClearSelection(true);
21952304 } else
2196
- if (event.getSource() == grabItem)
2305
+ if (source == grabItem)
21972306 {
21982307 group(new cGroup(), true);
21992308 } else
2200
- if (event.getSource() == hideItem)
2309
+ if (source == hideItem)
22012310 {
22022311 group(new HiddenObject());
22032312 } else
2204
- if (event.getSource() == frontItem)
2313
+ if (source == frontItem)
22052314 {
22062315 front();
22072316 } else
2208
- if (event.getSource() == backItem)
2317
+ if (source == backItem)
22092318 {
22102319 back();
22112320 } else
2212
- if (event.getSource() == cameraItem)
2321
+ if (source == cameraItem)
22132322 {
22142323 makeSomething(new Camera());
22152324 } else
2216
- if (event.getSource() == compositeItem)
2325
+ if (source == compositeItem)
22172326 {
22182327 group(new Composite());
22192328 } else
2220
- if (event.getSource() == randomItem)
2329
+ if (source == randomItem)
22212330 {
22222331 RandomNode random = new RandomNode();
22232332 group(random);
22242333 if (random.size() > 0)
2225
- random.name = random.get(0).name + "Rnd";
2334
+ random.name = random.get(0).name + "Switch";
22262335 } else
2227
- if (event.getSource() == physicsItem)
2336
+ if (source == physicsItem)
22282337 {
22292338 group(new PhysicsNode());
22302339 } else
2231
- if (event.getSource() == frameselectorItem)
2340
+ if (source == frameselectorItem)
22322341 {
22332342 for (int i=0; i<group.selection.size(); i++)
22342343 {
....@@ -2240,7 +2349,7 @@
22402349 ResetModel();
22412350 refreshContents();
22422351 } else
2243
- if (event.getSource() == switchGeoItem)
2352
+ if (source == switchGeoItem)
22442353 {
22452354 for (int i=0; i<group.selection.size(); i++)
22462355 {
....@@ -2252,7 +2361,7 @@
22522361 ResetModel();
22532362 refreshContents();
22542363 } else
2255
- if (event.getSource() == switchTransfoItem)
2364
+ if (source == switchTransfoItem)
22562365 {
22572366 for (int i=0; i<group.selection.size(); i++)
22582367 {
....@@ -2264,7 +2373,7 @@
22642373 ResetModel();
22652374 refreshContents();
22662375 } else
2267
- if (event.getSource() == morphItem)
2376
+ if (source == morphItem)
22682377 {
22692378 for (int i=0; i<group.selection.size(); i++)
22702379 {
....@@ -2276,7 +2385,7 @@
22762385 ResetModel();
22772386 refreshContents();
22782387 } else
2279
- if (event.getSource() == scriptNodeItem)
2388
+ if (source == scriptNodeItem)
22802389 {
22812390 boolean atleastone = false;
22822391
....@@ -2315,31 +2424,31 @@
23152424 }
23162425 }
23172426 } else
2318
- if (event.getSource() == linkerItem)
2427
+ if (source == linkerItem)
23192428 {
23202429 group(new cLinker());
23212430 } else
2322
- if (event.getSource() == textureItem)
2431
+ if (source == textureItem)
23232432 {
23242433 group(new TextureNode());
23252434 } else
2326
- if (event.getSource() == billboardItem)
2435
+ if (source == billboardItem)
23272436 {
23282437 group(new BillboardNode());
23292438 } else
2330
- if (event.getSource() == shadowXItem)
2439
+ if (source == shadowXItem)
23312440 {
23322441 CastShadow(0);
23332442 } else
2334
- if (event.getSource() == shadowYItem)
2443
+ if (source == shadowYItem)
23352444 {
23362445 CastShadow(1);
23372446 } else
2338
- if (event.getSource() == shadowZItem)
2447
+ if (source == shadowZItem)
23392448 {
23402449 CastShadow(2);
23412450 } else
2342
- if (event.getSource() == ungroupItem)
2451
+ if (source == ungroupItem)
23432452 {
23442453 //ungroup();
23452454 for (int i=0; i<group.selection.size(); i++)
....@@ -2351,179 +2460,187 @@
23512460
23522461 refreshContents();
23532462 } else
2354
- if (event.getSource() == genUVItem)
2463
+ if (source == genUVItem)
23552464 {
23562465 GenUV();
23572466 } else
2358
- if (event.getSource() == genNormalsCADItem)
2467
+ if (source == genNormalsCADItem)
23592468 {
23602469 GenNormals(true);
23612470 } else
2362
- if (event.getSource() == genNormalsMESHItem)
2471
+ if (source == genNormalsMESHItem)
23632472 {
23642473 GenNormals(true); // TODO
23652474 } else
2366
- if (event.getSource() == genNormalsORGANItem)
2475
+ if (source == genNormalsORGANItem)
23672476 {
23682477 GenNormals(false);
23692478 } else
2370
- if (event.getSource() == genNormalsMINEItem)
2479
+ if (source == genNormalsMINEItem)
23712480 {
23722481 GenNormalsMINE();
23732482 } else
2374
- if (event.getSource() == stripifyItem)
2483
+ if (source == stripifyItem)
23752484 {
23762485 Stripify();
23772486 } else
2378
- if (event.getSource() == unstripifyItem)
2487
+ if (source == unstripifyItem)
23792488 {
23802489 Unstripify();
23812490 } else
2382
- if (event.getSource() == trimItem)
2491
+ if (source == trimItem)
23832492 {
23842493 Trim();
23852494 } else
2386
- if (event.getSource() == untrimItem)
2495
+ if (source == untrimItem)
23872496 {
23882497 Untrim();
23892498 } else
2390
- if (event.getSource() == clearColorsItem)
2499
+ if (source == clearColorsItem)
23912500 {
23922501 ClearColors();
23932502 } else
2394
- if (event.getSource() == clearMaterialsItem)
2503
+ if (source == clearMaterialsItem)
23952504 {
23962505 ClearMaterials();
23972506 } else
2398
- if (event.getSource() == liveleavesItem)
2507
+ if (source == liveleavesItem)
23992508 {
24002509 LiveLeaves(true);
24012510 } else
2402
- if (event.getSource() == unliveleavesItem)
2511
+ if (source == unliveleavesItem)
24032512 {
24042513 LiveLeaves(false);
24052514 } else
2406
- if (event.getSource() == supportleavesItem)
2515
+ if (source == supportleavesItem)
24072516 {
24082517 SupportLeaves(true);
24092518 } else
2410
- if (event.getSource() == unsupportleavesItem)
2519
+ if (source == unsupportleavesItem)
24112520 {
24122521 SupportLeaves(false);
24132522 } else
2414
- if (event.getSource() == hideleavesItem)
2523
+ if (source == hideleavesItem)
24152524 {
24162525 HideLeaves(true);
24172526 } else
2418
- if (event.getSource() == showleavesItem)
2527
+ if (source == showleavesItem)
24192528 {
24202529 HideLeaves(false);
24212530 } else
2422
- if (event.getSource() == markleavesItem)
2531
+ if (source == markleavesItem)
24232532 {
24242533 MarkLeaves(true);
24252534 } else
2426
- if (event.getSource() == unmarkleavesItem)
2535
+ if (source == unmarkleavesItem)
24272536 {
24282537 MarkLeaves(false);
24292538 } else
2430
- if (event.getSource() == flipVItem)
2539
+ if (source == flipVItem)
24312540 {
24322541 FlipV(true);
24332542 } else
2434
- if (event.getSource() == unflipVItem)
2543
+ if (source == unflipVItem)
24352544 {
24362545 FlipV(false);
24372546 } else
2438
- if (event.getSource() == lowTexturesItem)
2547
+ if (source == lowTexturesItem)
24392548 {
24402549 SetTexRes(0);
24412550 } else
2442
- if (event.getSource() == normalTexturesItem)
2551
+ if (source == normalTexturesItem)
24432552 {
24442553 SetTexRes(1);
24452554 } else
2446
- if (event.getSource() == highTexturesItem)
2555
+ if (source == highTexturesItem)
24472556 {
24482557 SetTexRes(2);
24492558 } else
2450
- if (event.getSource() == veryhighTexturesItem)
2559
+ if (source == veryhighTexturesItem)
24512560 {
24522561 SetTexRes(3);
24532562 } else
2454
- if (event.getSource() == maxTexturesItem)
2563
+ if (source == maxTexturesItem)
24552564 {
24562565 SetTexRes(4);
24572566 } else
2458
- if (event.getSource() == panoTexturesItem)
2567
+ if (source == panoTexturesItem)
24592568 {
24602569 SetTexRes(5);
24612570 } else
2462
- if (event.getSource() == reverseNormalsItem)
2571
+ if (source == reverseNormalsItem)
24632572 {
24642573 ReverseNormals();
24652574 } else
2466
- if (event.getSource() == parseverticesItem)
2575
+ if (source == parseverticesItem)
24672576 {
24682577 ParseVertices();
24692578 } else
2470
- if (event.getSource() == textureFieldItem)
2579
+ if (source == textureFieldItem)
24712580 {
24722581 TextureVertices();
24732582 } else
2474
- if (event.getSource() == alignItem)
2583
+ if (source == alignItem)
24752584 {
24762585 Align();
24772586 } else
2478
- if (event.getSource() == mirrorItem)
2587
+ if (source == mirrorItem)
24792588 {
24802589 MirrorPoses();
24812590 } else
2482
- if (event.getSource() == reduceMorphItem)
2591
+ if (source == reduceMorphItem)
24832592 {
24842593 MeshReduction(false);
24852594 } else
2486
- if (event.getSource() == reduce34MorphItem)
2595
+ if (source == reduce34MorphItem)
24872596 {
24882597 MeshReduction(true);
24892598 } else
2490
- if (event.getSource() == reverseTrianglesItem)
2599
+ if (source == reverseTrianglesItem)
24912600 {
24922601 ReverseTriangles();
24932602 } else
2494
- if (event.getSource() == reduceMeshItem)
2603
+ if (source == reduceMeshItem)
24952604 {
24962605 ReduceMesh(false);
24972606 } else
2498
- if (event.getSource() == reduce34MeshItem)
2607
+ if (source == reduce34MeshItem)
24992608 {
25002609 ReduceMesh(true);
25012610 } else
2502
- if (event.getSource() == increaseMeshItem)
2611
+ if (source == increaseMeshItem)
25032612 {
25042613 IncreaseMesh();
25052614 } else
2506
- if (event.getSource() == clipMeshItem)
2615
+ if (source == clipMeshItem)
25072616 {
25082617 ClipMesh();
25092618 } else
2510
- if (event.getSource() == smoothMeshItem)
2619
+ if (source == smoothMeshItem)
25112620 {
25122621 SmoothMesh();
25132622 } else
2514
- if (event.getSource() == transformgeometryItem)
2623
+ if (source == transformGeometryItem)
25152624 {
25162625 TransformGeometry();
25172626 } else
2518
- if (event.getSource() == resetTransformItem)
2627
+ if (source == transformChildrenItem)
2628
+ {
2629
+ TransformChildren();
2630
+ } else
2631
+ if (source == resetTransformItem)
25192632 {
25202633 ResetTransform();
25212634 } else
2522
- if (event.getSource() == resetCentroidItem)
2635
+ if (source == resetCentroidItem)
25232636 {
2524
- ResetCentroid();
2637
+ ResetCentroid(true);
25252638 } else
2526
- if (event.getSource() == resetParentItem)
2639
+ if (source == resetCentroidXZItem)
2640
+ {
2641
+ ResetCentroid(false);
2642
+ } else
2643
+ if (source == resetParentItem)
25272644 {
25282645 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25292646 {
....@@ -2533,7 +2650,7 @@
25332650
25342651 refreshContents();
25352652 } else
2536
- if (event.getSource() == repairParentItem)
2653
+ if (source == repairParentItem)
25372654 {
25382655 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25392656 {
....@@ -2547,7 +2664,7 @@
25472664
25482665 refreshContents();
25492666 } else
2550
- if (event.getSource() == repairShadowItem)
2667
+ if (source == repairShadowItem)
25512668 {
25522669 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25532670 {
....@@ -2561,7 +2678,7 @@
25612678
25622679 refreshContents();
25632680 } else
2564
- if (event.getSource() == sortbysizeItem)
2681
+ if (source == sortbysizeItem)
25652682 {
25662683 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25672684 {
....@@ -2573,7 +2690,7 @@
25732690 ResetModel();
25742691 refreshContents();
25752692 } else
2576
- if (event.getSource() == sortbynameItem)
2693
+ if (source == sortbynameItem)
25772694 {
25782695 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25792696 {
....@@ -2585,7 +2702,7 @@
25852702 ResetModel();
25862703 refreshContents();
25872704 } else
2588
- if (event.getSource() == attachPigmentItem)
2705
+ if (source == attachPigmentItem)
25892706 {
25902707 String texture = GetFile("Attach pigment");
25912708 Object3D obj;
....@@ -2597,7 +2714,7 @@
25972714
25982715 refreshContents();
25992716 } else
2600
- if (event.getSource() == detachPigmentItem)
2717
+ if (source == detachPigmentItem)
26012718 {
26022719 Object3D obj;
26032720 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2608,7 +2725,7 @@
26082725
26092726 refreshContents();
26102727 } else
2611
- if (event.getSource() == attachBumpItem)
2728
+ if (source == attachBumpItem)
26122729 {
26132730 String texture = GetFile("Attach bump");
26142731 Object3D obj;
....@@ -2620,7 +2737,7 @@
26202737
26212738 refreshContents();
26222739 } else
2623
- if (event.getSource() == detachBumpItem)
2740
+ if (source == detachBumpItem)
26242741 {
26252742 Object3D obj;
26262743 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2631,7 +2748,7 @@
26312748
26322749 refreshContents();
26332750 } else
2634
- if (event.getSource() == pigmentBumpItem)
2751
+ if (source == pigmentBumpItem)
26352752 {
26362753 Object3D obj;
26372754 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2642,158 +2759,195 @@
26422759
26432760 refreshContents();
26442761 } else
2645
- if (event.getSource() == flashSelectionButton)
2762
+ if (source == flashSelectionButton)
26462763 {
26472764 CameraPane.flash = true;
26482765 refreshContents();
26492766 } else
2650
- if (event.getSource() == oneButton)
2767
+ if (source == oneButton)
26512768 {
26522769 } else
2653
- if (event.getSource() == twoButton)
2770
+ if (source == twoButton)
26542771 {
26552772 radio.layout = twoButton;
26562773 // bug
26572774 //gridPanel.setDividerLocation(1.0);
26582775 //bigPanel.setDividerLocation(0.0);
2659
- bigThree.remove(scenePanel);
2660
- bigThree.remove(centralPanel);
2661
- bigThree.remove(XYZPanel);
2662
- aWindowConstraints.gridx = 0;
2663
- aWindowConstraints.gridy = 0;
2664
- aWindowConstraints.gridwidth = 1;
2665
- // aConstraints.gridheight = 3;
2666
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2667
- aWindowConstraints.weightx = 0;
2668
- aWindowConstraints.weighty = 1;
2669
- //bigThree.add(jtp, aWindowConstraints);
2670
- aWindowConstraints.weightx = 1;
2671
- aWindowConstraints.gridwidth = 3;
2672
- // aConstraints.gridheight = 3;
2673
- aWindowConstraints.gridx = 1;
2674
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2675
- bigThree.add(centralPanel, aWindowConstraints);
2676
- aWindowConstraints.weightx = 0;
2677
- aWindowConstraints.gridx = 4;
2678
- aWindowConstraints.gridwidth = 1;
2679
- // aConstraints.gridheight = 3;
2680
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2681
- //bigThree.add(XYZPanel, aWindowConstraints);
2682
- bigThree.revalidate();
2776
+// bigThree.remove(scenePanel);
2777
+// bigThree.remove(centralPanel);
2778
+// bigThree.remove(XYZPanel);
2779
+// aWindowConstraints.gridx = 0;
2780
+// aWindowConstraints.gridy = 0;
2781
+// aWindowConstraints.gridwidth = 1;
2782
+// // aConstraints.gridheight = 3;
2783
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2784
+// aWindowConstraints.weightx = 0;
2785
+// aWindowConstraints.weighty = 1;
2786
+// //bigThree.add(jtp, aWindowConstraints);
2787
+// aWindowConstraints.weightx = 1;
2788
+// aWindowConstraints.gridwidth = 3;
2789
+// // aConstraints.gridheight = 3;
2790
+// aWindowConstraints.gridx = 1;
2791
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2792
+// bigThree.add(centralPanel, aWindowConstraints);
2793
+// aWindowConstraints.weightx = 0;
2794
+// aWindowConstraints.gridx = 4;
2795
+// aWindowConstraints.gridwidth = 1;
2796
+// // aConstraints.gridheight = 3;
2797
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2798
+// //bigThree.add(XYZPanel, aWindowConstraints);
2799
+// scenePanel.setVisible(false);
2800
+// centralPanel.setVisible(true);
2801
+// XYZPanel.setVisible(false);
2802
+ bigThree.ClearUI();
2803
+ bigThree.add(centralPanel);
2804
+ bigThree.FlushUI();
26832805 } else
2684
- if (event.getSource() == threeButton)
2806
+ if (source == threeButton)
26852807 {
26862808 radio.layout = threeButton;
2687
- bigThree.remove(scenePanel);
2688
- bigThree.remove(centralPanel);
2689
- bigThree.remove(XYZPanel);
2690
- aWindowConstraints.gridx = 0;
2691
- aWindowConstraints.gridy = 0;
2692
- aWindowConstraints.gridwidth = 1;
2693
- // aConstraints.gridheight = 3;
2694
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2695
- aWindowConstraints.weightx = 0;
2696
- aWindowConstraints.weighty = 1;
2697
- //bigThree.add(jtp, aWindowConstraints);
2698
- aWindowConstraints.weightx = 1;
2699
- aWindowConstraints.gridwidth = 3;
2700
- // aConstraints.gridheight = 3;
2701
- aWindowConstraints.gridx = 1;
2702
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2703
- bigThree.add(centralPanel, aWindowConstraints);
2704
- aWindowConstraints.weightx = 0;
2705
- aWindowConstraints.gridx = 4;
2706
- aWindowConstraints.gridwidth = 1;
2707
- // aConstraints.gridheight = 3;
2708
- aConstraints.fill = GridBagConstraints.VERTICAL;
2709
- bigThree.add(XYZPanel, aWindowConstraints);
2710
- bigThree.revalidate();
2809
+
2810
+// bigThree.remove(scenePanel);
2811
+// bigThree.remove(centralPanel);
2812
+// bigThree.remove(XYZPanel);
2813
+// aWindowConstraints.gridx = 0;
2814
+// aWindowConstraints.gridy = 0;
2815
+// aWindowConstraints.gridwidth = 1;
2816
+// // aConstraints.gridheight = 3;
2817
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2818
+// aWindowConstraints.weightx = 0;
2819
+// aWindowConstraints.weighty = 1;
2820
+// //bigThree.add(jtp, aWindowConstraints);
2821
+// aWindowConstraints.weightx = 1;
2822
+// aWindowConstraints.gridwidth = 3;
2823
+// // aConstraints.gridheight = 3;
2824
+// aWindowConstraints.gridx = 1;
2825
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2826
+// bigThree.add(centralPanel, aWindowConstraints);
2827
+// aWindowConstraints.weightx = 0;
2828
+// aWindowConstraints.gridx = 4;
2829
+// aWindowConstraints.gridwidth = 1;
2830
+// // aConstraints.gridheight = 3;
2831
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2832
+// bigThree.add(XYZPanel, aWindowConstraints);
2833
+// bigThree.validate();
2834
+// scenePanel.setVisible(false);
2835
+// centralPanel.setVisible(true);
2836
+// XYZPanel.setVisible(true);
2837
+ bigThree.ClearUI();
2838
+ bigThree.add(centralPanel);
2839
+ bigThree.add(XYZPanel);
2840
+ bigThree.FlushUI();
27112841 } else
2712
- if (event.getSource() == fourButton)
2842
+ if (source == fourButton)
27132843 {
27142844 radio.layout = fourButton;
2715
- bigThree.remove(scenePanel);
2716
- bigThree.remove(centralPanel);
2717
- bigThree.remove(XYZPanel);
2718
- aWindowConstraints.gridx = 0;
2719
- aWindowConstraints.gridy = 0;
2720
- aWindowConstraints.gridwidth = 1;
2721
- // aWindowConstraints.gridheight = 3;
2722
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2723
- aWindowConstraints.weightx = 1;
2724
- aWindowConstraints.weighty = 1;
2725
- bigThree.add(scenePanel, aWindowConstraints);
2726
- aWindowConstraints.weightx = 1;
2727
- aWindowConstraints.gridwidth = 3;
2728
- // aConstraints.gridheight = 3;
2729
- aWindowConstraints.gridx = 1;
2730
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2731
- //bigThree.add(cameraPanel, aWindowConstraints);
2732
- aWindowConstraints.weightx = 0;
2733
- aWindowConstraints.gridx = 4;
2734
- aWindowConstraints.gridwidth = 1;
2735
- // aWindowConstraints.gridheight = 3;
2736
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2737
- //bigThree.add(XYZPanel, aWindowConstraints);
2738
- bigThree.revalidate();
2845
+
2846
+// bigThree.remove(scenePanel);
2847
+// bigThree.remove(centralPanel);
2848
+// bigThree.remove(XYZPanel);
2849
+// aWindowConstraints.gridx = 0;
2850
+// aWindowConstraints.gridy = 0;
2851
+// aWindowConstraints.gridwidth = 1;
2852
+// // aWindowConstraints.gridheight = 3;
2853
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2854
+// aWindowConstraints.weightx = 1;
2855
+// aWindowConstraints.weighty = 1;
2856
+// bigThree.add(scenePanel, aWindowConstraints);
2857
+// aWindowConstraints.weightx = 1;
2858
+// aWindowConstraints.gridwidth = 3;
2859
+// // aConstraints.gridheight = 3;
2860
+// aWindowConstraints.gridx = 1;
2861
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2862
+// //bigThree.add(cameraPanel, aWindowConstraints);
2863
+// aWindowConstraints.weightx = 0;
2864
+// aWindowConstraints.gridx = 4;
2865
+// aWindowConstraints.gridwidth = 1;
2866
+// // aWindowConstraints.gridheight = 3;
2867
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2868
+// //bigThree.add(XYZPanel, aWindowConstraints);
2869
+// bigThree.validate();
2870
+// scenePanel.setVisible(true);
2871
+// centralPanel.setVisible(false);
2872
+// XYZPanel.setVisible(false);
2873
+ bigThree.ClearUI();
2874
+ bigThree.add(scenePanel);
2875
+ bigThree.FlushUI();
27392876 } else
2740
- if (event.getSource() == sixButton)
2877
+ if (source == sixButton)
27412878 {
27422879 radio.layout = sixButton;
2743
- bigThree.remove(scenePanel);
2744
- bigThree.remove(centralPanel);
2745
- bigThree.remove(XYZPanel);
2746
- aWindowConstraints.gridx = 0;
2747
- aWindowConstraints.gridy = 0;
2748
- aWindowConstraints.gridwidth = 1;
2749
- // aConstraints.gridheight = 3;
2750
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2751
- aWindowConstraints.weightx = 0;
2752
- aWindowConstraints.weighty = 1;
2753
- bigThree.add(scenePanel, aWindowConstraints);
2754
- aWindowConstraints.weightx = 1;
2755
- aWindowConstraints.gridwidth = 3;
2756
- // aWindowConstraints.gridheight = 3;
2757
- aWindowConstraints.gridx = 1;
2758
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2759
- bigThree.add(centralPanel, aWindowConstraints);
2760
- aWindowConstraints.weightx = 0;
2761
- aWindowConstraints.gridx = 4;
2762
- aWindowConstraints.gridwidth = 1;
2763
- // aWindowConstraints.gridheight = 3;
2764
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2765
- //bigThree.add(XYZPanel, aConstraints);
2766
- bigThree.revalidate();
2880
+
2881
+// bigThree.remove(scenePanel);
2882
+// bigThree.remove(centralPanel);
2883
+// bigThree.remove(XYZPanel);
2884
+// aWindowConstraints.gridx = 0;
2885
+// aWindowConstraints.gridy = 0;
2886
+// aWindowConstraints.gridwidth = 1;
2887
+// // aConstraints.gridheight = 3;
2888
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2889
+// aWindowConstraints.weightx = 0;
2890
+// aWindowConstraints.weighty = 1;
2891
+// bigThree.add(scenePanel, aWindowConstraints);
2892
+// aWindowConstraints.weightx = 1;
2893
+// aWindowConstraints.gridwidth = 3;
2894
+// // aWindowConstraints.gridheight = 3;
2895
+// aWindowConstraints.gridx = 1;
2896
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2897
+// bigThree.add(centralPanel, aWindowConstraints);
2898
+// aWindowConstraints.weightx = 0;
2899
+// aWindowConstraints.gridx = 4;
2900
+// aWindowConstraints.gridwidth = 1;
2901
+// // aWindowConstraints.gridheight = 3;
2902
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2903
+// //bigThree.add(XYZPanel, aConstraints);
2904
+// bigThree.validate();
2905
+// scenePanel.setVisible(true);
2906
+// centralPanel.setVisible(true);
2907
+// XYZPanel.setVisible(false);
2908
+ bigThree.ClearUI();
2909
+ bigThree.add(scenePanel);
2910
+ bigThree.add(centralPanel);
2911
+ bigThree.FlushUI();
27672912 } else
2768
- if (event.getSource() == sevenButton)
2913
+ if (source == sevenButton)
27692914 {
27702915 radio.layout = sevenButton;
2771
- bigThree.remove(scenePanel);
2772
- bigThree.remove(centralPanel);
2773
- bigThree.remove(XYZPanel);
2774
- aWindowConstraints.gridx = 0;
2775
- aWindowConstraints.gridy = 0;
2776
- aWindowConstraints.gridwidth = 1;
2777
- // aWindowConstraints.gridheight = 3;
2778
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2779
- aWindowConstraints.weightx = 0;
2780
- aWindowConstraints.weighty = 1;
2781
- bigThree.add(scenePanel, aWindowConstraints);
2782
- aWindowConstraints.weightx = 1;
2783
- aWindowConstraints.gridwidth = 3;
2784
- // aWindowConstraints.gridheight = 3;
2785
- aWindowConstraints.gridx = 1;
2786
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2787
- bigThree.add(centralPanel, aWindowConstraints);
2788
- aWindowConstraints.weightx = 0;
2789
- aWindowConstraints.gridx = 4;
2790
- aWindowConstraints.gridwidth = 1;
2791
- // aConstraints.gridheight = 3;
2792
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2793
- bigThree.add(XYZPanel, aWindowConstraints);
2794
- bigThree.revalidate();
2916
+
2917
+// bigThree.remove(scenePanel);
2918
+// bigThree.remove(centralPanel);
2919
+// bigThree.remove(XYZPanel);
2920
+// aWindowConstraints.gridx = 0;
2921
+// aWindowConstraints.gridy = 0;
2922
+// aWindowConstraints.gridwidth = 1;
2923
+// // aWindowConstraints.gridheight = 3;
2924
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2925
+// aWindowConstraints.weightx = 0;
2926
+// aWindowConstraints.weighty = 1;
2927
+// bigThree.add(scenePanel, aWindowConstraints);
2928
+// aWindowConstraints.weightx = 1;
2929
+// aWindowConstraints.gridwidth = 3;
2930
+// // aWindowConstraints.gridheight = 3;
2931
+// aWindowConstraints.gridx = 1;
2932
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2933
+// bigThree.add(centralPanel, aWindowConstraints);
2934
+// aWindowConstraints.weightx = 0;
2935
+// aWindowConstraints.gridx = 4;
2936
+// aWindowConstraints.gridwidth = 1;
2937
+// // aConstraints.gridheight = 3;
2938
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2939
+// bigThree.add(XYZPanel, aWindowConstraints);
2940
+// bigThree.validate();
2941
+// scenePanel.setVisible(true);
2942
+// centralPanel.setVisible(true);
2943
+// XYZPanel.setVisible(true);
2944
+ bigThree.ClearUI();
2945
+ bigThree.add(scenePanel);
2946
+ bigThree.add(centralPanel);
2947
+ bigThree.add(XYZPanel);
2948
+ bigThree.FlushUI();
27952949 } else
2796
- if (event.getSource() == rootButton)
2950
+ if (source == rootButton)
27972951 {
27982952 Object3D obj;
27992953 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2805,7 +2959,7 @@
28052959
28062960 refreshContents(true);
28072961 } else
2808
- if (event.getSource() == closeButton)
2962
+ if (source == closeButton)
28092963 {
28102964 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28112965 cRadio ab;
....@@ -2826,11 +2980,11 @@
28262980 }
28272981 refreshContents(true);
28282982 } else
2829
- if (event.getSource() == editItem || event.getSource() == editButton)
2983
+ if (source == editItem || source == editButton)
28302984 {
28312985 EditSelection(false);
28322986 } else
2833
- if (event.getSource() == uneditButton)
2987
+ if (source == uneditButton)
28342988 {
28352989 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28362990 {
....@@ -2842,12 +2996,12 @@
28422996
28432997 child.editWindow = null; // ???????????
28442998 }
2845
- objEditor.ctrlPanel.revalidate();
2999
+ objEditor.ctrlPanel.FlushUI();
28463000 //objEditor.jTree.clearSelection();
28473001 //objEditor.ResetSliders();
28483002 refreshContents(true);
28493003 } else
2850
- if (event.getSource() == clearPanelButton)
3004
+ if (source == clearPanelButton)
28513005 {
28523006 assert(copy == group);
28533007 //copy.ClearUI();
....@@ -2858,7 +3012,7 @@
28583012 listUI.clear();
28593013 refreshContents(true);
28603014 } else
2861
- if (event.getSource() == allParamsButton)
3015
+ if (source == allParamsButton)
28623016 {
28633017 assert(copy == group);
28643018
....@@ -2879,19 +3033,19 @@
28793033
28803034 refreshContents(true);
28813035 } else
2882
- if (event.getSource() == unselectButton)
3036
+ if (source == unselectButton)
28833037 {
28843038 objEditor.jTree.clearSelection();
28853039 // ?? oct 2012 GrafreeD.clipboard.clear();
28863040 objEditor.ResetSliders();
28873041 refreshContents(true);
28883042 } else
2889
- if(event.getSource() instanceof cRadio)
3043
+ if(source instanceof cRadio)
28903044 {
28913045 group.parent = keepparent;
28923046 group.attributes = 0;
28933047 //group.editWindow = null;
2894
- /*cRadio*/ radio = (cRadio)event.getSource();
3048
+ /*cRadio*/ radio = (cRadio)source;
28953049 Object3D obj = radio.GetObject();
28963050 System.out.println("Edit " + obj);
28973051 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2911,7 +3065,7 @@
29113065 }
29123066
29133067 copy = group;
2914
- //CameraPane.theRenderer.object = group;
3068
+ //Globals.theRenderer.object = group;
29153069 if(!useclient)
29163070 {
29173071 cameraView.renderCamera = radio.camera;
....@@ -2920,12 +3074,15 @@
29203074 cameraView.cameras[cameraView.cameracount] = radio.camera;
29213075 cameraView.targetLookAt.set(radio.camera.lookAt);
29223076 cameraView.object = group;
2923
- cameraView.lighttouched = true;
3077
+ //cameraView.lighttouched = true;
3078
+ Globals.lighttouched = true;
29243079 topView.object = group;
29253080 frontView.object = group;
29263081 sideView.object = group;
29273082 }
2928
- group.editWindow = this;
3083
+
3084
+// fix "+" issue group.editWindow = this;
3085
+
29293086 /*
29303087 currentLayout = radio.layout;
29313088 if (currentLayout == null)
....@@ -2956,7 +3113,7 @@
29563113 if (useclient)
29573114 {
29583115 cameraView.object = client;
2959
- cameraView.lighttouched = true;
3116
+ Globals.lighttouched = true;
29603117 //topView.object = client;
29613118 //frontView.object = client;
29623119 //sideView.object = client;
....@@ -2964,7 +3121,7 @@
29643121 else
29653122 {
29663123 cameraView.object = group;
2967
- cameraView.lighttouched = true;
3124
+ Globals.lighttouched = true;
29683125 //topView.object = group;
29693126 //frontView.object = group;
29703127 //sideView.object = group;
....@@ -2999,6 +3156,28 @@
29993156 refreshContents();
30003157 }
30013158
3159
+ void TransformChildren()
3160
+ {
3161
+ Object3D obj;
3162
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3163
+ {
3164
+ obj = (Object3D)e.nextElement();
3165
+ obj.KeepTextureMatrices();
3166
+ obj.TransformChildren();
3167
+ obj.RestoreTextureMatrices();
3168
+
3169
+// if (obj.parent == null)
3170
+// {
3171
+// System.out.println("NULL PARENT!");
3172
+// new Exception().printStackTrace();
3173
+// }
3174
+// else
3175
+// TouchTransform(obj);
3176
+// //obj.parent.Touch();
3177
+ }
3178
+
3179
+ refreshContents();
3180
+ }
30023181
30033182 void ResetTransform()
30043183 {
....@@ -3111,7 +3290,7 @@
31113290 refreshContents();
31123291 }
31133292
3114
- void ResetCentroid()
3293
+ void ResetCentroid(boolean full)
31153294 {
31163295 Object3D obj;
31173296 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3126,12 +3305,16 @@
31263305 LA.matIdentity(Object3D.mat);
31273306 obj.getBounds(minima, maxima, false);
31283307 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3129
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3308
+ if (full)
3309
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31303310 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31313311 obj.TransformMesh(Object3D.mat);
3312
+
31323313 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3133
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3314
+ if (full)
3315
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31343316 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3317
+
31353318 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31363319 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31373320 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3197,9 +3380,9 @@
31973380 obj = (Object3D)e.nextElement();
31983381
31993382 System.out.println("Object is: " + obj);
3200
- GrafreeD.AnalyzeObject(obj);
3383
+ Grafreed.AnalyzeObject(obj);
32013384 System.out.println("Boundary rep: " + obj.bRep);
3202
- GrafreeD.AnalyzeObject(obj.bRep);
3385
+ Grafreed.AnalyzeObject(obj.bRep);
32033386
32043387 // System.err.println((size/1024) + " KB is the size of " + obj);
32053388 }
....@@ -3413,8 +3596,8 @@
34133596
34143597 void ParseVertices()
34153598 {
3416
- boolean epsequal = GrafreeD.epsequal;
3417
- GrafreeD.epsequal = true;
3599
+ boolean epsequal = Grafreed.epsequal;
3600
+ Grafreed.epsequal = true;
34183601
34193602 for (int i=0; i<group.selection.size(); i++)
34203603 {
....@@ -3439,7 +3622,7 @@
34393622 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34403623 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34413624
3442
- g.add(GrafreeD.clipboard);
3625
+ g.add(Grafreed.clipboard);
34433626
34443627 buffer.add(g);
34453628 }
....@@ -3454,7 +3637,7 @@
34543637 makeSomething(buffer, i==group.selection.size()-1);
34553638 }
34563639
3457
- GrafreeD.epsequal = epsequal;
3640
+ Grafreed.epsequal = epsequal;
34583641
34593642 refreshContents();
34603643 }
....@@ -3472,7 +3655,16 @@
34723655 String pigment = Object3D.GetPigment(tex);
34733656 //String bump = Object3D.GetBump(tex);
34743657
3475
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3658
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3659
+
3660
+ try
3661
+ {
3662
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3663
+ }
3664
+ catch (Exception e)
3665
+ {
3666
+ System.err.println("FAIL: " + node);
3667
+ }
34763668
34773669 double s = v.s;
34783670
....@@ -3560,11 +3752,11 @@
35603752
35613753 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35623754
3563
- boolean random = CameraPane.RANDOM;
3564
- CameraPane.RANDOM = false; // parse all random nodes
3755
+ boolean random = CameraPane.SWITCH;
3756
+ CameraPane.SWITCH = false; // parse all random nodes
35653757 lowres.linkVerticesThis(null);
35663758 lowres.linkVerticesThis(sn);
3567
- CameraPane.RANDOM = random;
3759
+ CameraPane.SWITCH = random;
35683760
35693761 System.err.flush();
35703762
....@@ -3604,7 +3796,7 @@
36043796 return;
36053797
36063798 Object3D poses = group.selection.get(0);
3607
- Object3D ref = GrafreeD.clipboard.get(0);
3799
+ Object3D ref = Grafreed.clipboard.get(0);
36083800
36093801 Object3D newgroup = new Object3D("Po:" + poses.name);
36103802
....@@ -3773,7 +3965,7 @@
37733965 group.selection.RelinkToSupport(); // july 2014
37743966 System.out.println("DONE.");
37753967 refreshContents();
3776
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
3968
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
37773969 }
37783970
37793971 void ReduceMesh(boolean reduction34)
....@@ -3798,9 +3990,9 @@
37983990
37993991 void ClipMesh()
38003992 {
3801
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
3993
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
38023994 {
3803
- Object3D content = GrafreeD.clipboard.get(0);
3995
+ Object3D content = Grafreed.clipboard.get(0);
38043996
38053997 if (content instanceof cGroup && ((cGroup)content).transientlink )
38063998 content = ((cGroup)content).get(0);
....@@ -3809,7 +4001,7 @@
38094001 // {
38104002 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
38114003 // }
3812
- group.selection.ClipMesh(GrafreeD.clipboard);
4004
+ group.selection.ClipMesh(Grafreed.clipboard);
38134005 }
38144006 // group.selection.ClipMesh(GrafreeD.clipboard);
38154007 System.out.println("DONE.");
....@@ -3944,7 +4136,7 @@
39444136 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39454137
39464138 Object3D elem = (Object3D)group.selection.elementAt(i);
3947
- if(elem != group)
4139
+ if(elem != group || !newWindow)
39484140 {
39494141 // if (!(elem instanceof Composite))
39504142 // newWindow = false;
....@@ -4049,25 +4241,25 @@
40494241 System.err.println("info : " + child.GetPath());
40504242 }
40514243 }
4052
- else
4053
- {
4054
- objEditor.SetMaterial(group); // .GetMaterial());
4055
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4056
- System.err.println("info : " + group.GetPath());
4057
- }
4244
+// else
4245
+// {
4246
+// objEditor.SetMaterial(group); // .GetMaterial());
4247
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4248
+// System.err.println("info : " + group.GetPath());
4249
+// }
40584250
40594251 objEditor.SetText(); // jan 2014
40604252
4061
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4253
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
40624254 CameraPane.flash = true;
40634255
40644256 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
40654257 // a camera
40664258 {
40674259 CameraPane.camerachangeframe = 0; // don't refuse it
4068
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4069
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
4070
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4260
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4261
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4262
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40714263 }
40724264
40734265 refreshContents();
....@@ -4149,12 +4341,12 @@
41494341 {
41504342 if (group.selection.isEmpty())
41514343 return;
4152
- GrafreeD.clipboardIsTempGroup = false;
4344
+ Grafreed.clipboardIsTempGroup = false;
41534345 Composite tGroup = null;
41544346 if (group.selection.size() > 0) // 1)
41554347 {
41564348 tGroup = new cGroup();
4157
- GrafreeD.clipboardIsTempGroup = true;
4349
+ Grafreed.clipboardIsTempGroup = true;
41584350 }
41594351
41604352 if (cut)
....@@ -4194,16 +4386,16 @@
41944386 //System.out.println("cut " + child);
41954387 //System.out.println("parent = " + child.parent);
41964388 // tmp.addChild(child);
4197
- if (GrafreeD.clipboardIsTempGroup)
4389
+ if (Grafreed.clipboardIsTempGroup)
41984390 tGroup.add/*Child*/(tmp);
41994391 else
4200
- GrafreeD.clipboard = tmp;
4392
+ Grafreed.clipboard = tmp;
42014393 }
42024394 else
4203
- if (GrafreeD.clipboardIsTempGroup)
4395
+ if (Grafreed.clipboardIsTempGroup)
42044396 tGroup.add/*Child*/(child);
42054397 else
4206
- GrafreeD.clipboard = child;
4398
+ Grafreed.clipboard = child;
42074399 }
42084400
42094401 //ResetModel();
....@@ -4235,21 +4427,21 @@
42354427 //System.out.println("cut " + elem);
42364428 //System.out.println("parent = " + elem.parent);
42374429 // tmp.addChild(elem);
4238
- if (GrafreeD.clipboardIsTempGroup)
4430
+ if (Grafreed.clipboardIsTempGroup)
42394431 tGroup.add/*Child*/(tmp);
42404432 else
4241
- GrafreeD.clipboard = tmp;
4433
+ Grafreed.clipboard = tmp;
42424434 }
42434435 else
4244
- if (GrafreeD.clipboardIsTempGroup)
4436
+ if (Grafreed.clipboardIsTempGroup)
42454437 tGroup.add/*Child*/(child);
42464438 else
4247
- GrafreeD.clipboard = child;
4439
+ Grafreed.clipboard = child;
42484440 }
42494441
42504442 }
4251
- if (GrafreeD.clipboardIsTempGroup)
4252
- GrafreeD.clipboard = tGroup;
4443
+ if (Grafreed.clipboardIsTempGroup)
4444
+ Grafreed.clipboard = tGroup;
42534445 if (cut)
42544446 {
42554447 ResetModel();
....@@ -4263,7 +4455,7 @@
42634455 // return;
42644456 boolean first = true;
42654457
4266
- if (GrafreeD.clipboardIsTempGroup)
4458
+ if (Grafreed.clipboardIsTempGroup)
42674459 {
42684460 Composite temp;
42694461
....@@ -4274,7 +4466,7 @@
42744466 temp = (Composite)Applet3D.clipboard.deepCopy();
42754467 */
42764468 Object3D elem;
4277
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4469
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
42784470 {
42794471 Object3D child = (Object3D)e.nextElement();
42804472
....@@ -4308,21 +4500,21 @@
43084500 //Object3D cb = Applet3D.clipboard;
43094501 //temp.addChild(cb);
43104502 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4311
- assert(GrafreeD.clipboard.parent == null);
4312
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4313
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4314
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4315
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4503
+ assert(Grafreed.clipboard.parent == null);
4504
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4505
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4506
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4507
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43164508 else
4317
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4318
- GrafreeD.clipboard.get(0).parent = keepparent;
4509
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4510
+ Grafreed.clipboard.get(0).parent = keepparent;
43194511 }
43204512
43214513 ResetModel();
43224514 refreshContents();
43234515 }
43244516
4325
- void pasteInto(boolean copyit)
4517
+ void pasteInto(boolean copyit, boolean clone)
43264518 {
43274519 // if (GrafreeD.clipboard == null)
43284520 // return;
....@@ -4351,15 +4543,22 @@
43514543 if (copyit)
43524544 {
43534545 // paste(false);
4354
- CloneClipboard(false); // sept 2014
4546
+ if (clone)
4547
+ {
4548
+ CloneClipboard(false); // sept 2014
4549
+ }
4550
+ else
4551
+ {
4552
+ paste(false);
4553
+ }
43554554 }
43564555 else
43574556 {
43584557 boolean first = true;
43594558
4360
- if (GrafreeD.clipboardIsTempGroup)
4559
+ if (Grafreed.clipboardIsTempGroup)
43614560 {
4362
- Composite temp = (Composite)GrafreeD.clipboard;
4561
+ Composite temp = (Composite)Grafreed.clipboard;
43634562 Object3D copy;
43644563 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43654564 {
....@@ -4369,7 +4568,7 @@
43694568 }
43704569 } else
43714570 {
4372
- linkSomething(GrafreeD.clipboard); //.get(0));
4571
+ linkSomething(Grafreed.clipboard); //.get(0));
43734572 }
43744573 }
43754574 }
....@@ -4814,7 +5013,7 @@
48145013
48155014 void ImportVRMLX3D()
48165015 {
4817
- if (GrafreeD.standAlone)
5016
+ if (Grafreed.standAlone)
48185017 {
48195018 /**/
48205019 FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
....@@ -4831,7 +5030,7 @@
48315030
48325031 String GetFile(String dialogName)
48335032 {
4834
- if (GrafreeD.standAlone)
5033
+ if (Grafreed.standAlone)
48355034 {
48365035 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48375036 browser.show();
....@@ -4895,10 +5094,12 @@
48955094 cButton flashSelectionButton;
48965095 cButton editButton;
48975096 cButton uneditButton;
5097
+ JCheckBox allParamsButton;
48985098 cButton clearpanelButton;
4899
- cButton allParamsButton;
49005099 cButton unselectButton;
49015100
5101
+ cButton oneStepButton;
5102
+
49025103 cButton screenfitButton;
49035104 cButton screenfitpointButton;
49045105 cButton snapobjectButton;
....@@ -4942,7 +5143,7 @@
49425143 private MenuItem linkverticesItem;
49435144 private MenuItem relinkverticesItem;
49445145 private MenuItem setMasterItem;
4945
- private MenuItem resetMeshItem;
5146
+ private MenuItem resetAllItem;
49465147 private MenuItem stepAllItem;
49475148 private MenuItem revertMeshItem;
49485149 private MenuItem poseMeshItem;
....@@ -4953,6 +5154,7 @@
49535154 private MenuItem mergeGeometriesItem;
49545155 private MenuItem copyItem;
49555156 private MenuItem pasteItem;
5157
+ private MenuItem pasteIntoItem;
49565158 private MenuItem pasteLinkItem;
49575159 private MenuItem pasteCloneItem;
49585160 private MenuItem pasteExpandItem;
....@@ -5002,8 +5204,10 @@
50025204 private MenuItem panoTexturesItem;
50035205
50045206 private MenuItem resetCentroidItem;
5005
- private MenuItem transformgeometryItem;
5207
+ private MenuItem resetCentroidXZItem;
50065208 private MenuItem resetTransformItem;
5209
+ private MenuItem transformGeometryItem;
5210
+ private MenuItem transformChildrenItem;
50075211 private MenuItem hideItem;
50085212 private MenuItem grabItem;
50095213 private MenuItem backItem;
....@@ -5050,7 +5254,7 @@
50505254 private MenuItem blobItem;
50515255 private MenuItem latheItem;
50525256 private MenuItem bezierItem;
5053
- private MenuItem checkerItem;
5257
+ private MenuItem overlayItem;
50545258 private MenuItem meshItem;
50555259 // private MenuItem meshGroupItem;
50565260 private MenuItem springItem;