Normand Briere
2019-05-05 1e1c7fcdb3d0f8be350c5f6c32b6afa6705168ea
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,
....@@ -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,18 +185,31 @@
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"));
211
+ if (Globals.ADVANCED)
212
+ {
193213 resetMeshItem = menu.add(new MenuItem("Reset All"));
194214 resetMeshItem.addActionListener(this);
195215 stepAllItem = menu.add(new MenuItem("Step All"));
....@@ -199,6 +219,7 @@
199219 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200220 resetreferencesItem.addActionListener(this);
201221 menu.add("-");
222
+ }
202223 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203224 overwriteGeoItem.addActionListener(this);
204225 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,19 +231,26 @@
210231 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211232 overwriteUVItem.addActionListener(this);
212233 menu.add("-");
234
+ if (Globals.ADVANCED)
235
+ {
213236 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214237 generateMeshItem.addActionListener(this);
215238 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216239 poseMeshItem.addActionListener(this);
217240 menu.add("-");
241
+ }
218242 resetsupportItem = menu.add(new MenuItem("Reset support"));
219243 resetsupportItem.addActionListener(this);
220244 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221245 linkverticesItem.addActionListener(this);
222246 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223247 relinkverticesItem.addActionListener(this);
248
+
249
+ if (Globals.ADVANCED)
250
+ {
224251 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225252 setMasterItem.addActionListener(this);
253
+ }
226254
227255 oe.menuBar.add(menu = new Menu("Group"));
228256 grabItem = menu.add(new MenuItem("Grab"));
....@@ -233,27 +261,32 @@
233261 frontItem.addActionListener(this);
234262 compositeItem = menu.add(new MenuItem("Composite"));
235263 compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
264
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237265 hideItem.addActionListener(this);
238266 ungroupItem = menu.add(new MenuItem("Ungroup"));
239267 ungroupItem.addActionListener(this);
240268 menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
269
+ randomItem = menu.add(new MenuItem("Switch node"));
242270 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);
247271 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248272 switchGeoItem.addActionListener(this);
249273 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250274 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
275
+ morphItem = menu.add(new MenuItem("Morph Group"));
252276 morphItem.addActionListener(this);
277
+
278
+ if (Globals.ADVANCED)
279
+ {
280
+ menu.add("-");
281
+ physicsItem = menu.add(new MenuItem("Physics"));
282
+ physicsItem.addActionListener(this);
283
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
284
+ frameselectorItem.addActionListener(this);
253285 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254286 scriptNodeItem.addActionListener(this);
255287 cameraItem = menu.add(new MenuItem("Camera"));
256288 cameraItem.addActionListener(this);
289
+ }
257290
258291 oe.menuBar.add(menu = new Menu("Object"));
259292 textureItem = menu.add(new MenuItem("Texture"));
....@@ -268,14 +301,18 @@
268301 shadowYItem.addActionListener(this);
269302 shadowZItem = menu.add(new MenuItem("Shadow Z"));
270303 shadowZItem.addActionListener(this);
304
+ if (Globals.ADVANCED)
305
+ {
306
+ menu.add("-");
271307 linkerItem = menu.add(new MenuItem("Linker"));
272308 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275309 attributeItem = menu.add(new MenuItem("Attribute"));
276310 attributeItem.addActionListener(this);
311
+ templateItem = menu.add(new MenuItem("Template"));
312
+ templateItem.addActionListener(this);
277313 pointflowItem = menu.add(new MenuItem("Point Flow"));
278314 pointflowItem.addActionListener(this);
315
+ }
279316 menu.add("-");
280317 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281318 resetTransformItem.addActionListener(this);
....@@ -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,10 +356,14 @@
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"));
....@@ -329,10 +373,13 @@
329373 liveleavesItem.addActionListener(this);
330374 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331375 unliveleavesItem.addActionListener(this);
376
+ if (Globals.ADVANCED)
377
+ {
332378 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333379 supportleavesItem.addActionListener(this);
334380 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335381 unsupportleavesItem.addActionListener(this);
382
+ }
336383 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337384 hideleavesItem.addActionListener(this);
338385 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -375,6 +422,8 @@
375422 sortbysizeItem.addActionListener(this);
376423 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377424 sortbynameItem.addActionListener(this);
425
+ if (Globals.ADVANCED)
426
+ {
378427 menu.add("-");
379428 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380429 extractGeometriesItem.addActionListener(this);
....@@ -384,20 +433,23 @@
384433 shareGeometriesItem.addActionListener(this);
385434 mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
386435 mergeGeometriesItem.addActionListener(this);
436
+ }
387437
388438 oe.menuBar.add(menu = new Menu("Insert"));
389439 buildCreateMenu(menu);
390440
391
-
392441 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..."));
442
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
398443 importOBJItem.addActionListener(this);
399
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
444
+ menu.add("-");
445
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
400446 import3DSItem.addActionListener(this);
447
+ menu.add("-");
448
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
449
+ importVRMLX3DItem.addActionListener(this);
450
+ menu.add("-");
451
+ importGFDItem = menu.add(new MenuItem("GrafreeD file..."));
452
+ importGFDItem.addActionListener(this);
401453
402454 oe.menuBar.add(menu = new Menu("Tools"));
403455 buildToolsMenu(menu);
....@@ -433,153 +485,98 @@
433485 oe.radioPanel.add(dummyButton);
434486 oe.buttonGroup.add(dummyButton);
435487 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
488
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439489
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
490
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
491
+ liveCB.setToolTipText("Enabled animation");
441492 liveCB.addItemListener(this);
442493
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", Globals.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);
494
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
495
+ oneStepButton.setToolTipText("Animate one step forward");
496
+ oneStepButton.addActionListener(this);
497
+
498
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
499
+ fastCB.setToolTipText("Fast mode");
461500 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);
501
+
502
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
503
+ trackCB.setToolTipText("Enable tracking");
503504 trackCB.addItemListener(this);
504505
505
- oe.aConstraints.gridx += 1;
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
506
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
507
+ screenfitButton.setToolTipText("Screen fit");
507508 screenfitButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
509
+
509510 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
510511 // 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;
515512
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);
513
+ if (Globals.ADVANCED)
514
+ {
515
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
516
+ snapobjectButton.addActionListener(this);
517
+ snapobjectButton.setToolTipText("Snap Object");
518
+ }
519
+
520
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
521
+ flashSelectionButton.setToolTipText("Show selection");
522522 flashSelectionButton.addActionListener(this);
523523
524
- oe.toolbarPanel.add(new cButton(" ", false));
524
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
525525
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);
526
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
527
+ twoButton.setToolTipText("Show center view only");
532528 twoButton.addActionListener(this);
533
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
529
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
534530 fourButton.addActionListener(this);
535
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
531
+ fourButton.setToolTipText("Show left panel only");
532
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
533
+ sixButton.setToolTipText("2-column layout left");
536534 sixButton.addActionListener(this);
537
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
535
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
536
+ threeButton.setToolTipText("2-column layout right");
538537 threeButton.addActionListener(this);
539
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
538
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
539
+ sevenButton.setToolTipText("3-column layout");
540540 sevenButton.addActionListener(this);
541541 //
542542
543
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
543
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
544
+ rootButton.setToolTipText("Edit selection in new tab");
544545 rootButton.addActionListener(this);
545
- oe.aConstraints.gridx += 1;
546
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
546
+
547
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
548
+ closeButton.setToolTipText("Close tab");
547549 closeButton.addActionListener(this);
548550 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
549551 //clearButton.addActionListener(this);
550
- oe.aConstraints.gridx += 1;
551552
552
- oe.aConstraints.gridx = 1; //
553
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
553
+ cGridBag commandsPanel = new cGridBag();
554
+
555
+ commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
556
+ editButton.setToolTipText("Edit selection");
554557 editButton.addActionListener(this);
555
- oe.aConstraints.gridx += 1;
556
- oe.aConstraints.weighty = 0;
557
- oe.aConstraints.gridwidth = 1;
558558
559
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
559
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
560
+ uneditButton.setToolTipText("Unedit selection");
560561 uneditButton.addActionListener(this);
561562
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);
563
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
564
+ allParamsButton.setToolTipText("Edit all params");
574565 allParamsButton.addActionListener(this);
575566
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);
567
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
568
+ clearPanelButton.setToolTipText("Clear edit panel");
569
+ clearPanelButton.addActionListener(this);
570
+
571
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
572
+ unselectButton.setToolTipText("Unselect");
581573 unselectButton.addActionListener(this);
582574
575
+ commandsPanel.preferredHeight = 1;
576
+
577
+ oe.treePanel.add(commandsPanel);
578
+ oe.treePanel.Return();
579
+
583580 // oe.aConstraints.gridx += 1;
584581 // oe.aConstraints.weighty = 0;
585582 // oe.aConstraints.gridwidth = 1;
....@@ -591,40 +588,37 @@
591588 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
592589 // gcButton.addActionListener(this);
593590
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;
591
+ cGridBag jSPPanel = new cGridBag();
592
+
593
+ JScrollPane jSP;
605594 //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);
595
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
607596 ResetModel();
608
- oe.aConstraints.weighty = 0.5;
609
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
610
- oe.aConstraints.gridy += 1;
611
- oe.aConstraints.gridwidth = 1;
597
+
598
+ oe.treePanel.add(jSPPanel);
599
+ oe.treePanel.Return();
612600
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);
601
+ cGridBag copyOptionsPanel = new cGridBag();
602
+
603
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
604
+ colorCB.setToolTipText("Copy color when dropped");
617605 colorCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
606
+
607
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
608
+ materialCB.setToolTipText("Copy material when dropped");
620609 materialCB.addItemListener(this);
621
- oe.aConstraints.gridx += 2;
622
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
610
+
611
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
612
+ textureCB.setToolTipText("Copy texture when dropped");
623613 textureCB.addItemListener(this);
624614
625
- oe.aConstraints.gridx = 0;
626
- oe.aConstraints.gridy += 1;
615
+ copyOptionsPanel.preferredHeight = 1;
616
+ oe.treePanel.add(copyOptionsPanel);
617
+ oe.treePanel.Return();
627618
619
+// mainPanel.setDividerLocation(0.5); //1.0);
620
+// mainPanel.setResizeWeight(0.5);
621
+
628622 //jList.addListSelectionListener(this);
629623 oe.jTree.addTreeSelectionListener(this);
630624 //jTree.setRootVisible(false);
....@@ -646,6 +640,78 @@
646640 radio.layout = sevenButton;
647641 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
648642 }
643
+
644
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
645
+ {
646
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
647
+ boxCB.setToolTipText("Display bounding boxes");
648
+ boxCB.addItemListener(this);
649
+
650
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
651
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
652
+ zoomBoxCB.addItemListener(this);
653
+
654
+ if (Globals.ADVANCED)
655
+ {
656
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
657
+ supportCB.setToolTipText("Enable rigging");
658
+ supportCB.addItemListener(this);
659
+
660
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
661
+ // localCB.addItemListener(this);
662
+
663
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
664
+ crowdCB.setToolTipText("Used for crowds");
665
+ crowdCB.addItemListener(this);
666
+
667
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
668
+ smoothCB.setToolTipText("Snapping delay");
669
+ smoothCB.addItemListener(this);
670
+
671
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
672
+ slowCB.setToolTipText("Smooth interpolation");
673
+ slowCB.addItemListener(this);
674
+
675
+// constraints.gridy += 1;
676
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
677
+// speakerMocapCB.addItemListener(this);
678
+
679
+ if (false)
680
+ {
681
+ // handled in scripts
682
+ //constraints.gridy += 1;
683
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
684
+ speakerCameraCB.addItemListener(this);
685
+
686
+ //constraints.gridy += 1;
687
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
688
+ speakerFocusCB.addItemListener(this);
689
+
690
+ //constraints.gridy += 1;
691
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
692
+ smoothfocusCB.addItemListener(this);
693
+ }
694
+
695
+//constraints.gridx += 1;
696
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
697
+// debugCB.addItemListener(this);
698
+
699
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
700
+ oeilCB.addItemListener(this);
701
+
702
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
703
+ lookAtCB.setToolTipText("Look-at target");
704
+ lookAtCB.addItemListener(this);
705
+
706
+ }
707
+
708
+ cGridBag fill = new cGridBag();
709
+
710
+ fill.preferredHeight = 200;
711
+
712
+ panel.add(fill);
713
+
714
+ }
649715
650716 void EditObject(Object3D obj)
651717 {
....@@ -676,6 +742,7 @@
676742 JCheckBox fastCB;
677743 JCheckBox slowCB;
678744 JCheckBox boxCB;
745
+ JCheckBox zoomBoxCB;
679746 JCheckBox trackCB;
680747 JCheckBox smoothfocusCB;
681748 // JCheckBox speakerMocapCB;
....@@ -755,6 +822,10 @@
755822 Recompile();
756823 cameraView.repaint();
757824 // refreshContents();
825
+ }
826
+ else if(e.getSource() == zoomBoxCB)
827
+ {
828
+ cameraView.ToggleZoomBoxMode();
758829 }
759830 else if(e.getSource() == smoothfocusCB)
760831 {
....@@ -923,11 +994,11 @@
923994 {
924995 loadClipboard(true);
925996 objEditor.jTree.setSelectionPath(destinationPath);
926
- pasteInto(false);
997
+ pasteInto(false, false);
927998 } else {
928999 loadClipboard(false);
9291000 objEditor.jTree.setSelectionPath(destinationPath);
930
- pasteInto(false); // true); // ???
1001
+ pasteInto(false, false); // true); // ???
9311002 }
9321003 }
9331004 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1049,27 +1120,33 @@
10491120 kleinItem.addActionListener(this);
10501121 particleItem = menu.add(new MenuItem("Particle system"));
10511122 particleItem.addActionListener(this);
1123
+ if (Globals.ADVANCED)
1124
+ {
10521125 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10531126 ragdollItem.addActionListener(this);
10541127 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10551128 ragdoll2Item.addActionListener(this);
1129
+ }
10561130 menu.add("-");
1057
- meshItem = menu.add(new MenuItem("Mesh"));
1131
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10581132 meshItem.addActionListener(this);
10591133 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10601134 // meshGroupItem.addActionListener(this);
1135
+ if (Globals.ADVANCED)
1136
+ {
10611137 springItem = menu.add(new MenuItem("Spring"));
10621138 springItem.addActionListener(this);
10631139 flagItem = menu.add(new MenuItem("Flag"));
10641140 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);
10691141 blobItem = menu.add(new MenuItem("Blob"));
10701142 blobItem.addActionListener(this);
10711143 latheItem = menu.add(new MenuItem("Lathe"));
10721144 latheItem.addActionListener(this);
1145
+ }
1146
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1147
+ bezierItem.addActionListener(this);
1148
+ overlayItem = menu.add(new MenuItem("Overlay"));
1149
+ overlayItem.addActionListener(this);
10731150 lightItem = menu.add(new MenuItem("Light"));
10741151 lightItem.addActionListener(this);
10751152 menu.add("-");
....@@ -1079,34 +1156,39 @@
10791156 loopItem.addActionListener(this);
10801157 doubleItem = menu.add(new MenuItem("Fork"));
10811158 doubleItem.addActionListener(this);
1159
+ if (Globals.ADVANCED)
1160
+ {
10821161 tripleItem = menu.add(new MenuItem("Trident"));
10831162 tripleItem.addActionListener(this);
1163
+ }
10841164 }
10851165
10861166 void buildToolsMenu(Menu menu)
10871167 {
10881168 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10891169 animationItem.addItemListener(this);
1090
- animationItem.setState(CameraPane.ANIMATION);
1170
+ animationItem.setState(Globals.ANIMATION);
10911171
10921172 menu.add("-");
10931173 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10941174 parseverticesItem.addActionListener(this);
10951175 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10961176 textureFieldItem.addActionListener(this);
1097
- alignItem = menu.add(new MenuItem("Align"));
1177
+ alignItem = menu.add(new MenuItem("Align Objects"));
10981178 alignItem.addActionListener(this);
1099
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1100
- mirrorItem.addActionListener(this);
11011179 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11021180 reduceMorphItem.addActionListener(this);
11031181 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11041182 reduce34MorphItem.addActionListener(this);
1105
-
1183
+ menu.add("-");
11061184 menu.add(computeAOItem = new MenuItem("Compute AO"));
11071185 computeAOItem.addActionListener(this);
1108
- menu.add("-");
11091186
1187
+ if (Globals.ADVANCED)
1188
+ {
1189
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1190
+ mirrorItem.addActionListener(this);
1191
+ menu.add("-");
11101192 menu.add(memoryItem = new MenuItem("Memory Usage"));
11111193 memoryItem.addActionListener(this);
11121194 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1129,6 +1211,7 @@
11291211 menu.add("-");
11301212 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11311213 editScriptItem.addActionListener(this);
1214
+ }
11321215 }
11331216
11341217 void ScreenFit()
....@@ -1482,6 +1565,7 @@
14821565 //
14831566 public void actionPerformed(ActionEvent event) // , Object arg)
14841567 {
1568
+ Object source = event.getSource();
14851569 /*
14861570 if (event.getSource() == nameField)
14871571 {
....@@ -1493,11 +1577,11 @@
14931577 }
14941578 else
14951579 */
1496
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1580
+ if (source == lookAtItem || source == lookFromItem)
14971581 {
14981582 ScreenFit();
14991583 } else
1500
- if (event.getSource() == switchItem)
1584
+ if (source == switchItem)
15011585 {
15021586 cVector v1 = new cVector();
15031587 cVector v2 = new cVector();
....@@ -1506,11 +1590,11 @@
15061590 objEditor.cameraView.renderCamera.setAim(v2, v1);
15071591 objEditor.cameraView.repaint();
15081592 } else
1509
- if (event.getSource() == rectoidItem)
1593
+ if (source == rectoidItem)
15101594 {
15111595 makeSomething(new Box());
15121596 } else
1513
- if (event.getSource() == particleItem)
1597
+ if (source == particleItem)
15141598 {
15151599 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15161600 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1531,9 +1615,9 @@
15311615 applyExample(particleGeom, "SMOKE");
15321616 makeSomething(particleGeom);
15331617 } else
1534
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1618
+ if (source == ragdollItem || source == ragdoll2Item)
15351619 {
1536
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1620
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15371621
15381622 ragdoll.toParent = LA.newMatrix();
15391623 ragdoll.fromParent = LA.newMatrix();
....@@ -1551,7 +1635,7 @@
15511635 } else
15521636 /*
15531637 */
1554
- if (event.getSource() == heightFieldItem)
1638
+ if (source == heightFieldItem)
15551639 {
15561640 Object3D obj = new Object3D();
15571641
....@@ -1589,31 +1673,31 @@
15891673
15901674 makeSomething(obj);
15911675 } else
1592
- if (event.getSource() == gridItem)
1676
+ if (source == gridItem)
15931677 {
15941678 makeSomething(new Grid());
15951679 } else
1596
- if (event.getSource() == ellipsoidItem)
1680
+ if (source == ellipsoidItem)
15971681 {
15981682 makeSomething(new Sphere());
15991683 } else
1600
- if (event.getSource() == coneItem)
1684
+ if (source == coneItem)
16011685 {
16021686 makeSomething(new Cone());
16031687 } else
1604
- if (event.getSource() == torusItem)
1688
+ if (source == torusItem)
16051689 {
16061690 makeSomething(new Torus());
16071691 } else
1608
- if (event.getSource() == superItem)
1692
+ if (source == superItem)
16091693 {
16101694 makeSomething(new Superellipsoid());
16111695 } else
1612
- if (event.getSource() == kleinItem)
1696
+ if (source == kleinItem)
16131697 {
16141698 makeSomething(new Klein());
16151699 } else
1616
- if (event.getSource() == blobItem)
1700
+ if (source == blobItem)
16171701 {
16181702 Blob blob = new Blob();
16191703 BlobComponent comp = new BlobComponent();
....@@ -1621,15 +1705,15 @@
16211705 //blob.retile();
16221706 makeSomething(blob);
16231707 } else
1624
- if (event.getSource() == latheItem)
1708
+ if (source == latheItem)
16251709 {
16261710 makeSomething(new Lathe());
16271711 } else
1628
- if (event.getSource() == bezierItem)
1712
+ if (source == bezierItem)
16291713 {
16301714 makeSomething(new BezierSurface());
16311715 } else
1632
- if (event.getSource() == checkerItem)
1716
+ if (source == overlayItem)
16331717 {
16341718 /*
16351719 Object3D obj = new BezierSurface(5,8);
....@@ -1644,7 +1728,7 @@
16441728 */
16451729 makeSomething(new Checker());
16461730 } else
1647
- if (event.getSource() == meshItem)
1731
+ if (source == meshItem)
16481732 {
16491733 Object3D itemtomake = new Object3D();
16501734 Object3D child;
....@@ -1665,35 +1749,35 @@
16651749 makeSomething(child);
16661750 }
16671751 } else
1668
- if (event.getSource() == springItem)
1752
+ if (source == springItem)
16691753 {
16701754 cSpring s = new cSpring();
16711755 s.setup();
16721756 makeSomething(s);
16731757 } else
1674
- if (event.getSource() == flagItem)
1758
+ if (source == flagItem)
16751759 {
16761760 cSpring s = new cFlag();
16771761 s.setup();
16781762 makeSomething(s);
16791763 } else
1680
- if (event.getSource() == lightItem)
1764
+ if (source == lightItem)
16811765 {
16821766 makeSomething(new Light());
16831767 } else
1684
- if (event.getSource() == csgItem)
1768
+ if (source == csgItem)
16851769 {
16861770 group(new CSG());
16871771 } else
1688
- if (event.getSource() == templateItem)
1772
+ if (source == templateItem)
16891773 {
16901774 group(new cTemplate());
16911775 } else
1692
- if (event.getSource() == attributeItem)
1776
+ if (source == attributeItem)
16931777 {
16941778 makeSomething(new Attribute());
16951779 } else
1696
- if (event.getSource() == pointflowItem)
1780
+ if (source == pointflowItem)
16971781 {
16981782 makeSomething(new PointFlow());
16991783 } else
....@@ -1705,7 +1789,7 @@
17051789 } else
17061790 */
17071791
1708
- if (event.getSource() == superLoopItem)
1792
+ if (source == superLoopItem)
17091793 {
17101794 Composite g = new cGroup();
17111795 for (int i=0; i<15; i++)
....@@ -1727,7 +1811,7 @@
17271811
17281812 group(g);
17291813 } else
1730
- if (event.getSource() == loopItem)
1814
+ if (source == loopItem)
17311815 {
17321816 Composite csg = new GroupLeaf();
17331817 csg.count = 5;
....@@ -1736,7 +1820,7 @@
17361820 csg.addChild(child);
17371821 child.addChild(csg);
17381822 } else
1739
- if (event.getSource() == doubleItem)
1823
+ if (source == doubleItem)
17401824 {
17411825 Composite csg = new GroupLeaf();
17421826 csg.count = 5;
....@@ -1748,7 +1832,7 @@
17481832 csg.addChild(child);
17491833 child.addChild(csg);
17501834 } else
1751
- if (event.getSource() == tripleItem)
1835
+ if (source == tripleItem)
17521836 {
17531837 Composite csg = new GroupLeaf();
17541838 csg.count = 4;
....@@ -1764,70 +1848,83 @@
17641848 child.addChild(csg);
17651849 } else
17661850
1767
- if (event.getSource() == importGFDItem)
1851
+ if (source == importGFDItem)
17681852 {
17691853 ImportGFD();
17701854 } else
1771
- if (event.getSource() == importVRMLX3DItem)
1855
+ if (source == importVRMLX3DItem)
17721856 {
17731857 ImportVRMLX3D();
17741858 } else
1775
- if (event.getSource() == import3DSItem)
1859
+ if (source == import3DSItem)
17761860 {
17771861 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17781862 } else
1779
- if (event.getSource() == importOBJItem)
1863
+ if (source == importOBJItem)
17801864 {
1781
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1865
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1866
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1867
+ browser.setVisible(true);
1868
+ String filename = browser.getFile();
1869
+ if (filename != null && filename.length() > 0)
1870
+ {
1871
+ String fullname = browser.getDirectory() + filename;
1872
+ makeSomething(ReadOBJ(fullname), true);
1873
+ }
17821874 } else
1783
- if (event.getSource() == computeAOItem)
1875
+ if (source == computeAOItem)
17841876 {
17851877 Globals.drawMode = CameraPane.OCCLUSION;
1786
- CameraPane.theRenderer.repaint();
1878
+ Globals.theRenderer.repaint();
17871879 } else
1788
- if (event.getSource() == recompileItem)
1880
+ if (source == recompileItem)
17891881 {
17901882 Recompile();
17911883 refreshContents();
17921884 } else
1793
- if (event.getSource() == editScriptItem)
1885
+ if (source == editScriptItem)
17941886 {
17951887 OpenDialog();
17961888 refreshContents();
17971889 } else
1798
- if (event.getSource() == invariantsItem)
1890
+ if (source == invariantsItem)
17991891 {
18001892 System.out.println("Invariants:");
18011893 GrafreeD.grafreeD.universe.invariants();
18021894 } else
1803
- if (event.getSource() == memoryItem)
1895
+ if (source == memoryItem)
18041896 {
18051897 //System.out.println("Invariants:");
18061898 PrintMemory();
18071899 } else
1808
- if (event.getSource() == pathItem)
1900
+ if (source == pathItem)
18091901 {
18101902 PrintPath();
18111903 } else
1812
- if (event.getSource() == analyzeItem)
1904
+ if (source == analyzeItem)
18131905 {
18141906 AnalyzeObject();
18151907 } else
1816
- if (event.getSource() == dumpItem)
1908
+ if (source == dumpItem)
18171909 {
18181910 DumpObject();
18191911 } else
1820
- if (event.getSource() == screenfitButton)
1912
+ if (source == oneStepButton)
1913
+ {
1914
+ Globals.ONESTEP = true;
1915
+ cameraView.repaint();
1916
+ } else
1917
+ if (source == screenfitButton)
18211918 {
18221919 //Reload(lastConverter, lastFilename, true);
18231920 ScreenFit();
18241921 } else
1825
- if (event.getSource() == screenfitpointButton)
1922
+ if (source == screenfitpointButton)
18261923 {
18271924 //Reload(lastConverter, lastFilename, true);
18281925 ScreenFitPoint();
18291926 } else
1830
- if (event.getSource() == snapobjectButton)
1927
+ if (source == snapobjectButton)
18311928 {
18321929 //Reload(lastConverter, lastFilename, true);
18331930 SnapObject();
....@@ -1838,13 +1935,13 @@
18381935 // Recompile();
18391936 // refreshContents();
18401937 // } else
1841
- if (event.getSource() == gcButton)
1938
+ if (source == gcButton)
18421939 {
18431940 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18441941 System.gc();
18451942 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18461943 } else
1847
- if (event.getSource() == editLeafItem)
1944
+ if (source == editLeafItem)
18481945 {
18491946 Object3D obj;
18501947 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1858,62 +1955,66 @@
18581955 }
18591956 refreshContents(true);
18601957 } else
1861
- if (event.getSource() == openWindowItem)
1958
+ if (source == openWindowItem)
18621959 {
18631960 EditSelection(true);
18641961 } else
1865
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1962
+ if (source == cutItem || source == clearButton)
18661963 {
18671964 loadClipboard(true);
18681965 } else
1869
- if (event.getSource() == duplicateItem)
1966
+ if (source == duplicateItem)
18701967 {
18711968 Object3D keep = GrafreeD.clipboard;
18721969 loadClipboard(false);
18731970 paste(false);
18741971 GrafreeD.clipboard = keep;
18751972 } else
1876
- if (event.getSource() == cloneItem)
1973
+ if (source == cloneItem)
18771974 {
18781975 CloneSelection(false);
18791976 } else
1880
- if (event.getSource() == cloneSupportItem)
1977
+ if (source == cloneSupportItem)
18811978 {
18821979 CloneSelection(true);
18831980 } else
1884
- if (event.getSource() == copyItem)
1981
+ if (source == copyItem)
18851982 {
18861983 loadClipboard(false);
18871984 } else
1888
- if (event.getSource() == pasteItem)
1985
+ if (source == pasteItem)
18891986 {
18901987 paste(false);
18911988 } else
1892
- if (event.getSource() == pasteLinkItem)
1989
+ if (source == pasteIntoItem)
18931990 {
1894
- pasteInto(false);
1991
+ pasteInto(true, false);
18951992 } else
1896
- if (event.getSource() == pasteCloneItem)
1993
+ if (source == pasteLinkItem)
18971994 {
1898
- pasteInto(true);
1995
+ pasteInto(false, false);
18991996 } else
1900
- if (event.getSource() == pasteExpandItem)
1997
+ if (source == pasteCloneItem)
1998
+ {
1999
+ pasteInto(true, true);
2000
+ } else
2001
+ if (source == pasteExpandItem)
19012002 {
19022003 paste(true);
19032004 } else
1904
- if (event.getSource() == synchronizeItem)
2005
+ if (source == synchronizeItem)
19052006 {
19062007 Overwrite(Object3D.TRANSFORM);
19072008 } else
1908
- if (event.getSource() == overwriteNameItem)
2009
+ if (source == overwriteNameItem)
19092010 {
19102011 Overwrite(Object3D.NAME);
19112012 } else
1912
- if (event.getSource() == overwriteUVItem)
2013
+ if (source == overwriteUVItem)
19132014 {
19142015 Overwrite(Object3D.UV);
19152016 } else
1916
- if (event.getSource() == overwriteMatItem)
2017
+ if (source == overwriteMatItem)
19172018 {
19182019 /* july 2015
19192020 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1933,7 +2034,7 @@
19332034
19342035 Overwrite(dropAttributes);
19352036 }
1936
- if (event.getSource() == overwriteGeoItem)
2037
+ if (source == overwriteGeoItem)
19372038 {
19382039 Overwrite(Object3D.GEOMETRY);
19392040 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1950,7 +2051,7 @@
19502051 // refreshContents();
19512052 // }
19522053 } else
1953
- if (event.getSource() == generateMeshItem)
2054
+ if (source == generateMeshItem)
19542055 {
19552056 //if (group.selection.size() == 1)
19562057 // for (int i=0; i<group.selection.size(); i++)
....@@ -1961,7 +2062,7 @@
19612062 ResetModel();
19622063 refreshContents();
19632064 } else
1964
- if (event.getSource() == extractGeometriesItem)
2065
+ if (source == extractGeometriesItem)
19652066 {
19662067 boolean one = false;
19672068
....@@ -1988,7 +2089,7 @@
19882089 ResetModel();
19892090 refreshContents();
19902091 } else
1991
- if (event.getSource() == cloneGeometriesItem)
2092
+ if (source == cloneGeometriesItem)
19922093 {
19932094 boolean one = false;
19942095
....@@ -2014,7 +2115,7 @@
20142115 ResetModel();
20152116 refreshContents();
20162117 } else
2017
- if (event.getSource() == shareGeometriesItem)
2118
+ if (source == shareGeometriesItem)
20182119 {
20192120 boolean one = false;
20202121
....@@ -2044,7 +2145,7 @@
20442145 refreshContents();
20452146 }
20462147 } else
2047
- if (event.getSource() == mergeGeometriesItem)
2148
+ if (source == mergeGeometriesItem)
20482149 {
20492150 boolean one = false;
20502151
....@@ -2074,7 +2175,7 @@
20742175 ResetModel();
20752176 refreshContents();
20762177 } else
2077
- if (event.getSource() == linkverticesItem)
2178
+ if (source == linkverticesItem)
20782179 {
20792180 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20802181 // {
....@@ -2094,41 +2195,41 @@
20942195 if (content instanceof cGroup && ((cGroup)content).transientlink )
20952196 content = ((cGroup)content).get(0);
20962197
2097
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2198
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20982199 for (int i=0; i<group.selection.size(); i++)
20992200 {
2100
- boolean random = CameraPane.RANDOM;
2101
- CameraPane.RANDOM = false; // parse all random nodes
2201
+ boolean random = CameraPane.SWITCH;
2202
+ CameraPane.SWITCH = false; // parse all random nodes
21022203 group.selection.get(i).linkVerticesThis(content);
21032204 // group.selection.get(i).setMasterThis(content); // should be identity
2104
- CameraPane.RANDOM = random;
2205
+ CameraPane.SWITCH = random;
21052206 }
2106
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2207
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21072208 refreshContents();
21082209 }
21092210 } else
2110
- if (event.getSource() == resetsupportItem)
2211
+ if (source == resetsupportItem)
21112212 {
21122213 for (int i=0; i<group.selection.size(); i++)
21132214 {
2114
- boolean random = CameraPane.RANDOM;
2115
- CameraPane.RANDOM = false; // parse all random nodes
2215
+ boolean random = CameraPane.SWITCH;
2216
+ CameraPane.SWITCH = false; // parse all random nodes
21162217 group.selection.get(i).linkVerticesThis(null);
2117
- CameraPane.RANDOM = random;
2218
+ CameraPane.SWITCH = random;
21182219 }
21192220
21202221 refreshContents();
21212222 } else
2122
- if (event.getSource() == relinkverticesItem)
2223
+ if (source == relinkverticesItem)
21232224 {
2124
- boolean random = CameraPane.RANDOM;
2125
- CameraPane.RANDOM = false; // parse all random nodes
2225
+ boolean random = CameraPane.SWITCH;
2226
+ CameraPane.SWITCH = false; // parse all random nodes
21262227 group.selection.RelinkToSupport();
2127
- CameraPane.RANDOM = random;
2228
+ CameraPane.SWITCH = random;
21282229
21292230 refreshContents();
21302231 } else
2131
- if (event.getSource() == resetreferencesItem)
2232
+ if (source == resetreferencesItem)
21322233 {
21332234 for (int i=0; i<group.selection.size(); i++)
21342235 {
....@@ -2137,7 +2238,7 @@
21372238
21382239 refreshContents();
21392240 } else
2140
- if (event.getSource() == setMasterItem)
2241
+ if (source == setMasterItem)
21412242 {
21422243 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21432244 {
....@@ -2150,7 +2251,7 @@
21502251 refreshContents();
21512252 }
21522253 } else
2153
- if (event.getSource() == poseMeshItem)
2254
+ if (source == poseMeshItem)
21542255 {
21552256 if (group.selection.size() == 1)
21562257 {
....@@ -2169,19 +2270,19 @@
21692270 }
21702271
21712272 } else
2172
- if (event.getSource() == revertMeshItem)
2273
+ if (source == revertMeshItem)
21732274 {
21742275 RevertMeshes();
21752276 } else
2176
- if (event.getSource() == resetMeshItem)
2277
+ if (source == resetMeshItem)
21772278 {
21782279 ResetAll();
21792280 } else
2180
- if (event.getSource() == stepAllItem)
2281
+ if (source == stepAllItem)
21812282 {
21822283 StepAll();
21832284 } else
2184
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2285
+ if (source == clearItem) // || event.getSource() == clearButton)
21852286 {
21862287 //int indices[] = jList.getSelectedIndices();
21872288 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2189,46 +2290,46 @@
21892290
21902291 ClearSelection(false);
21912292 } else
2192
- if (event.getSource() == clearAllItem)
2293
+ if (source == clearAllItem)
21932294 {
21942295 ClearSelection(true);
21952296 } else
2196
- if (event.getSource() == grabItem)
2297
+ if (source == grabItem)
21972298 {
21982299 group(new cGroup(), true);
21992300 } else
2200
- if (event.getSource() == hideItem)
2301
+ if (source == hideItem)
22012302 {
22022303 group(new HiddenObject());
22032304 } else
2204
- if (event.getSource() == frontItem)
2305
+ if (source == frontItem)
22052306 {
22062307 front();
22072308 } else
2208
- if (event.getSource() == backItem)
2309
+ if (source == backItem)
22092310 {
22102311 back();
22112312 } else
2212
- if (event.getSource() == cameraItem)
2313
+ if (source == cameraItem)
22132314 {
22142315 makeSomething(new Camera());
22152316 } else
2216
- if (event.getSource() == compositeItem)
2317
+ if (source == compositeItem)
22172318 {
22182319 group(new Composite());
22192320 } else
2220
- if (event.getSource() == randomItem)
2321
+ if (source == randomItem)
22212322 {
22222323 RandomNode random = new RandomNode();
22232324 group(random);
22242325 if (random.size() > 0)
2225
- random.name = random.get(0).name + "Rnd";
2326
+ random.name = random.get(0).name + "Switch";
22262327 } else
2227
- if (event.getSource() == physicsItem)
2328
+ if (source == physicsItem)
22282329 {
22292330 group(new PhysicsNode());
22302331 } else
2231
- if (event.getSource() == frameselectorItem)
2332
+ if (source == frameselectorItem)
22322333 {
22332334 for (int i=0; i<group.selection.size(); i++)
22342335 {
....@@ -2240,7 +2341,7 @@
22402341 ResetModel();
22412342 refreshContents();
22422343 } else
2243
- if (event.getSource() == switchGeoItem)
2344
+ if (source == switchGeoItem)
22442345 {
22452346 for (int i=0; i<group.selection.size(); i++)
22462347 {
....@@ -2252,7 +2353,7 @@
22522353 ResetModel();
22532354 refreshContents();
22542355 } else
2255
- if (event.getSource() == switchTransfoItem)
2356
+ if (source == switchTransfoItem)
22562357 {
22572358 for (int i=0; i<group.selection.size(); i++)
22582359 {
....@@ -2264,7 +2365,7 @@
22642365 ResetModel();
22652366 refreshContents();
22662367 } else
2267
- if (event.getSource() == morphItem)
2368
+ if (source == morphItem)
22682369 {
22692370 for (int i=0; i<group.selection.size(); i++)
22702371 {
....@@ -2276,7 +2377,7 @@
22762377 ResetModel();
22772378 refreshContents();
22782379 } else
2279
- if (event.getSource() == scriptNodeItem)
2380
+ if (source == scriptNodeItem)
22802381 {
22812382 boolean atleastone = false;
22822383
....@@ -2315,31 +2416,31 @@
23152416 }
23162417 }
23172418 } else
2318
- if (event.getSource() == linkerItem)
2419
+ if (source == linkerItem)
23192420 {
23202421 group(new cLinker());
23212422 } else
2322
- if (event.getSource() == textureItem)
2423
+ if (source == textureItem)
23232424 {
23242425 group(new TextureNode());
23252426 } else
2326
- if (event.getSource() == billboardItem)
2427
+ if (source == billboardItem)
23272428 {
23282429 group(new BillboardNode());
23292430 } else
2330
- if (event.getSource() == shadowXItem)
2431
+ if (source == shadowXItem)
23312432 {
23322433 CastShadow(0);
23332434 } else
2334
- if (event.getSource() == shadowYItem)
2435
+ if (source == shadowYItem)
23352436 {
23362437 CastShadow(1);
23372438 } else
2338
- if (event.getSource() == shadowZItem)
2439
+ if (source == shadowZItem)
23392440 {
23402441 CastShadow(2);
23412442 } else
2342
- if (event.getSource() == ungroupItem)
2443
+ if (source == ungroupItem)
23432444 {
23442445 //ungroup();
23452446 for (int i=0; i<group.selection.size(); i++)
....@@ -2351,179 +2452,179 @@
23512452
23522453 refreshContents();
23532454 } else
2354
- if (event.getSource() == genUVItem)
2455
+ if (source == genUVItem)
23552456 {
23562457 GenUV();
23572458 } else
2358
- if (event.getSource() == genNormalsCADItem)
2459
+ if (source == genNormalsCADItem)
23592460 {
23602461 GenNormals(true);
23612462 } else
2362
- if (event.getSource() == genNormalsMESHItem)
2463
+ if (source == genNormalsMESHItem)
23632464 {
23642465 GenNormals(true); // TODO
23652466 } else
2366
- if (event.getSource() == genNormalsORGANItem)
2467
+ if (source == genNormalsORGANItem)
23672468 {
23682469 GenNormals(false);
23692470 } else
2370
- if (event.getSource() == genNormalsMINEItem)
2471
+ if (source == genNormalsMINEItem)
23712472 {
23722473 GenNormalsMINE();
23732474 } else
2374
- if (event.getSource() == stripifyItem)
2475
+ if (source == stripifyItem)
23752476 {
23762477 Stripify();
23772478 } else
2378
- if (event.getSource() == unstripifyItem)
2479
+ if (source == unstripifyItem)
23792480 {
23802481 Unstripify();
23812482 } else
2382
- if (event.getSource() == trimItem)
2483
+ if (source == trimItem)
23832484 {
23842485 Trim();
23852486 } else
2386
- if (event.getSource() == untrimItem)
2487
+ if (source == untrimItem)
23872488 {
23882489 Untrim();
23892490 } else
2390
- if (event.getSource() == clearColorsItem)
2491
+ if (source == clearColorsItem)
23912492 {
23922493 ClearColors();
23932494 } else
2394
- if (event.getSource() == clearMaterialsItem)
2495
+ if (source == clearMaterialsItem)
23952496 {
23962497 ClearMaterials();
23972498 } else
2398
- if (event.getSource() == liveleavesItem)
2499
+ if (source == liveleavesItem)
23992500 {
24002501 LiveLeaves(true);
24012502 } else
2402
- if (event.getSource() == unliveleavesItem)
2503
+ if (source == unliveleavesItem)
24032504 {
24042505 LiveLeaves(false);
24052506 } else
2406
- if (event.getSource() == supportleavesItem)
2507
+ if (source == supportleavesItem)
24072508 {
24082509 SupportLeaves(true);
24092510 } else
2410
- if (event.getSource() == unsupportleavesItem)
2511
+ if (source == unsupportleavesItem)
24112512 {
24122513 SupportLeaves(false);
24132514 } else
2414
- if (event.getSource() == hideleavesItem)
2515
+ if (source == hideleavesItem)
24152516 {
24162517 HideLeaves(true);
24172518 } else
2418
- if (event.getSource() == showleavesItem)
2519
+ if (source == showleavesItem)
24192520 {
24202521 HideLeaves(false);
24212522 } else
2422
- if (event.getSource() == markleavesItem)
2523
+ if (source == markleavesItem)
24232524 {
24242525 MarkLeaves(true);
24252526 } else
2426
- if (event.getSource() == unmarkleavesItem)
2527
+ if (source == unmarkleavesItem)
24272528 {
24282529 MarkLeaves(false);
24292530 } else
2430
- if (event.getSource() == flipVItem)
2531
+ if (source == flipVItem)
24312532 {
24322533 FlipV(true);
24332534 } else
2434
- if (event.getSource() == unflipVItem)
2535
+ if (source == unflipVItem)
24352536 {
24362537 FlipV(false);
24372538 } else
2438
- if (event.getSource() == lowTexturesItem)
2539
+ if (source == lowTexturesItem)
24392540 {
24402541 SetTexRes(0);
24412542 } else
2442
- if (event.getSource() == normalTexturesItem)
2543
+ if (source == normalTexturesItem)
24432544 {
24442545 SetTexRes(1);
24452546 } else
2446
- if (event.getSource() == highTexturesItem)
2547
+ if (source == highTexturesItem)
24472548 {
24482549 SetTexRes(2);
24492550 } else
2450
- if (event.getSource() == veryhighTexturesItem)
2551
+ if (source == veryhighTexturesItem)
24512552 {
24522553 SetTexRes(3);
24532554 } else
2454
- if (event.getSource() == maxTexturesItem)
2555
+ if (source == maxTexturesItem)
24552556 {
24562557 SetTexRes(4);
24572558 } else
2458
- if (event.getSource() == panoTexturesItem)
2559
+ if (source == panoTexturesItem)
24592560 {
24602561 SetTexRes(5);
24612562 } else
2462
- if (event.getSource() == reverseNormalsItem)
2563
+ if (source == reverseNormalsItem)
24632564 {
24642565 ReverseNormals();
24652566 } else
2466
- if (event.getSource() == parseverticesItem)
2567
+ if (source == parseverticesItem)
24672568 {
24682569 ParseVertices();
24692570 } else
2470
- if (event.getSource() == textureFieldItem)
2571
+ if (source == textureFieldItem)
24712572 {
24722573 TextureVertices();
24732574 } else
2474
- if (event.getSource() == alignItem)
2575
+ if (source == alignItem)
24752576 {
24762577 Align();
24772578 } else
2478
- if (event.getSource() == mirrorItem)
2579
+ if (source == mirrorItem)
24792580 {
24802581 MirrorPoses();
24812582 } else
2482
- if (event.getSource() == reduceMorphItem)
2583
+ if (source == reduceMorphItem)
24832584 {
24842585 MeshReduction(false);
24852586 } else
2486
- if (event.getSource() == reduce34MorphItem)
2587
+ if (source == reduce34MorphItem)
24872588 {
24882589 MeshReduction(true);
24892590 } else
2490
- if (event.getSource() == reverseTrianglesItem)
2591
+ if (source == reverseTrianglesItem)
24912592 {
24922593 ReverseTriangles();
24932594 } else
2494
- if (event.getSource() == reduceMeshItem)
2595
+ if (source == reduceMeshItem)
24952596 {
24962597 ReduceMesh(false);
24972598 } else
2498
- if (event.getSource() == reduce34MeshItem)
2599
+ if (source == reduce34MeshItem)
24992600 {
25002601 ReduceMesh(true);
25012602 } else
2502
- if (event.getSource() == increaseMeshItem)
2603
+ if (source == increaseMeshItem)
25032604 {
25042605 IncreaseMesh();
25052606 } else
2506
- if (event.getSource() == clipMeshItem)
2607
+ if (source == clipMeshItem)
25072608 {
25082609 ClipMesh();
25092610 } else
2510
- if (event.getSource() == smoothMeshItem)
2611
+ if (source == smoothMeshItem)
25112612 {
25122613 SmoothMesh();
25132614 } else
2514
- if (event.getSource() == transformgeometryItem)
2615
+ if (source == transformgeometryItem)
25152616 {
25162617 TransformGeometry();
25172618 } else
2518
- if (event.getSource() == resetTransformItem)
2619
+ if (source == resetTransformItem)
25192620 {
25202621 ResetTransform();
25212622 } else
2522
- if (event.getSource() == resetCentroidItem)
2623
+ if (source == resetCentroidItem)
25232624 {
25242625 ResetCentroid();
25252626 } else
2526
- if (event.getSource() == resetParentItem)
2627
+ if (source == resetParentItem)
25272628 {
25282629 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25292630 {
....@@ -2533,7 +2634,7 @@
25332634
25342635 refreshContents();
25352636 } else
2536
- if (event.getSource() == repairParentItem)
2637
+ if (source == repairParentItem)
25372638 {
25382639 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25392640 {
....@@ -2547,7 +2648,7 @@
25472648
25482649 refreshContents();
25492650 } else
2550
- if (event.getSource() == repairShadowItem)
2651
+ if (source == repairShadowItem)
25512652 {
25522653 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25532654 {
....@@ -2561,7 +2662,7 @@
25612662
25622663 refreshContents();
25632664 } else
2564
- if (event.getSource() == sortbysizeItem)
2665
+ if (source == sortbysizeItem)
25652666 {
25662667 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25672668 {
....@@ -2573,7 +2674,7 @@
25732674 ResetModel();
25742675 refreshContents();
25752676 } else
2576
- if (event.getSource() == sortbynameItem)
2677
+ if (source == sortbynameItem)
25772678 {
25782679 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25792680 {
....@@ -2585,7 +2686,7 @@
25852686 ResetModel();
25862687 refreshContents();
25872688 } else
2588
- if (event.getSource() == attachPigmentItem)
2689
+ if (source == attachPigmentItem)
25892690 {
25902691 String texture = GetFile("Attach pigment");
25912692 Object3D obj;
....@@ -2597,7 +2698,7 @@
25972698
25982699 refreshContents();
25992700 } else
2600
- if (event.getSource() == detachPigmentItem)
2701
+ if (source == detachPigmentItem)
26012702 {
26022703 Object3D obj;
26032704 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2608,7 +2709,7 @@
26082709
26092710 refreshContents();
26102711 } else
2611
- if (event.getSource() == attachBumpItem)
2712
+ if (source == attachBumpItem)
26122713 {
26132714 String texture = GetFile("Attach bump");
26142715 Object3D obj;
....@@ -2620,7 +2721,7 @@
26202721
26212722 refreshContents();
26222723 } else
2623
- if (event.getSource() == detachBumpItem)
2724
+ if (source == detachBumpItem)
26242725 {
26252726 Object3D obj;
26262727 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2631,7 +2732,7 @@
26312732
26322733 refreshContents();
26332734 } else
2634
- if (event.getSource() == pigmentBumpItem)
2735
+ if (source == pigmentBumpItem)
26352736 {
26362737 Object3D obj;
26372738 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2642,158 +2743,195 @@
26422743
26432744 refreshContents();
26442745 } else
2645
- if (event.getSource() == flashSelectionButton)
2746
+ if (source == flashSelectionButton)
26462747 {
26472748 CameraPane.flash = true;
26482749 refreshContents();
26492750 } else
2650
- if (event.getSource() == oneButton)
2751
+ if (source == oneButton)
26512752 {
26522753 } else
2653
- if (event.getSource() == twoButton)
2754
+ if (source == twoButton)
26542755 {
26552756 radio.layout = twoButton;
26562757 // bug
26572758 //gridPanel.setDividerLocation(1.0);
26582759 //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();
2760
+// bigThree.remove(scenePanel);
2761
+// bigThree.remove(centralPanel);
2762
+// bigThree.remove(XYZPanel);
2763
+// aWindowConstraints.gridx = 0;
2764
+// aWindowConstraints.gridy = 0;
2765
+// aWindowConstraints.gridwidth = 1;
2766
+// // aConstraints.gridheight = 3;
2767
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2768
+// aWindowConstraints.weightx = 0;
2769
+// aWindowConstraints.weighty = 1;
2770
+// //bigThree.add(jtp, aWindowConstraints);
2771
+// aWindowConstraints.weightx = 1;
2772
+// aWindowConstraints.gridwidth = 3;
2773
+// // aConstraints.gridheight = 3;
2774
+// aWindowConstraints.gridx = 1;
2775
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2776
+// bigThree.add(centralPanel, aWindowConstraints);
2777
+// aWindowConstraints.weightx = 0;
2778
+// aWindowConstraints.gridx = 4;
2779
+// aWindowConstraints.gridwidth = 1;
2780
+// // aConstraints.gridheight = 3;
2781
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2782
+// //bigThree.add(XYZPanel, aWindowConstraints);
2783
+// scenePanel.setVisible(false);
2784
+// centralPanel.setVisible(true);
2785
+// XYZPanel.setVisible(false);
2786
+ bigThree.ClearUI();
2787
+ bigThree.add(centralPanel);
2788
+ bigThree.FlushUI();
26832789 } else
2684
- if (event.getSource() == threeButton)
2790
+ if (source == threeButton)
26852791 {
26862792 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();
2793
+
2794
+// bigThree.remove(scenePanel);
2795
+// bigThree.remove(centralPanel);
2796
+// bigThree.remove(XYZPanel);
2797
+// aWindowConstraints.gridx = 0;
2798
+// aWindowConstraints.gridy = 0;
2799
+// aWindowConstraints.gridwidth = 1;
2800
+// // aConstraints.gridheight = 3;
2801
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2802
+// aWindowConstraints.weightx = 0;
2803
+// aWindowConstraints.weighty = 1;
2804
+// //bigThree.add(jtp, aWindowConstraints);
2805
+// aWindowConstraints.weightx = 1;
2806
+// aWindowConstraints.gridwidth = 3;
2807
+// // aConstraints.gridheight = 3;
2808
+// aWindowConstraints.gridx = 1;
2809
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2810
+// bigThree.add(centralPanel, aWindowConstraints);
2811
+// aWindowConstraints.weightx = 0;
2812
+// aWindowConstraints.gridx = 4;
2813
+// aWindowConstraints.gridwidth = 1;
2814
+// // aConstraints.gridheight = 3;
2815
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2816
+// bigThree.add(XYZPanel, aWindowConstraints);
2817
+// bigThree.validate();
2818
+// scenePanel.setVisible(false);
2819
+// centralPanel.setVisible(true);
2820
+// XYZPanel.setVisible(true);
2821
+ bigThree.ClearUI();
2822
+ bigThree.add(centralPanel);
2823
+ bigThree.add(XYZPanel);
2824
+ bigThree.FlushUI();
27112825 } else
2712
- if (event.getSource() == fourButton)
2826
+ if (source == fourButton)
27132827 {
27142828 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();
2829
+
2830
+// bigThree.remove(scenePanel);
2831
+// bigThree.remove(centralPanel);
2832
+// bigThree.remove(XYZPanel);
2833
+// aWindowConstraints.gridx = 0;
2834
+// aWindowConstraints.gridy = 0;
2835
+// aWindowConstraints.gridwidth = 1;
2836
+// // aWindowConstraints.gridheight = 3;
2837
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2838
+// aWindowConstraints.weightx = 1;
2839
+// aWindowConstraints.weighty = 1;
2840
+// bigThree.add(scenePanel, aWindowConstraints);
2841
+// aWindowConstraints.weightx = 1;
2842
+// aWindowConstraints.gridwidth = 3;
2843
+// // aConstraints.gridheight = 3;
2844
+// aWindowConstraints.gridx = 1;
2845
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2846
+// //bigThree.add(cameraPanel, aWindowConstraints);
2847
+// aWindowConstraints.weightx = 0;
2848
+// aWindowConstraints.gridx = 4;
2849
+// aWindowConstraints.gridwidth = 1;
2850
+// // aWindowConstraints.gridheight = 3;
2851
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2852
+// //bigThree.add(XYZPanel, aWindowConstraints);
2853
+// bigThree.validate();
2854
+// scenePanel.setVisible(true);
2855
+// centralPanel.setVisible(false);
2856
+// XYZPanel.setVisible(false);
2857
+ bigThree.ClearUI();
2858
+ bigThree.add(scenePanel);
2859
+ bigThree.FlushUI();
27392860 } else
2740
- if (event.getSource() == sixButton)
2861
+ if (source == sixButton)
27412862 {
27422863 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();
2864
+
2865
+// bigThree.remove(scenePanel);
2866
+// bigThree.remove(centralPanel);
2867
+// bigThree.remove(XYZPanel);
2868
+// aWindowConstraints.gridx = 0;
2869
+// aWindowConstraints.gridy = 0;
2870
+// aWindowConstraints.gridwidth = 1;
2871
+// // aConstraints.gridheight = 3;
2872
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2873
+// aWindowConstraints.weightx = 0;
2874
+// aWindowConstraints.weighty = 1;
2875
+// bigThree.add(scenePanel, aWindowConstraints);
2876
+// aWindowConstraints.weightx = 1;
2877
+// aWindowConstraints.gridwidth = 3;
2878
+// // aWindowConstraints.gridheight = 3;
2879
+// aWindowConstraints.gridx = 1;
2880
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2881
+// bigThree.add(centralPanel, aWindowConstraints);
2882
+// aWindowConstraints.weightx = 0;
2883
+// aWindowConstraints.gridx = 4;
2884
+// aWindowConstraints.gridwidth = 1;
2885
+// // aWindowConstraints.gridheight = 3;
2886
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2887
+// //bigThree.add(XYZPanel, aConstraints);
2888
+// bigThree.validate();
2889
+// scenePanel.setVisible(true);
2890
+// centralPanel.setVisible(true);
2891
+// XYZPanel.setVisible(false);
2892
+ bigThree.ClearUI();
2893
+ bigThree.add(scenePanel);
2894
+ bigThree.add(centralPanel);
2895
+ bigThree.FlushUI();
27672896 } else
2768
- if (event.getSource() == sevenButton)
2897
+ if (source == sevenButton)
27692898 {
27702899 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();
2900
+
2901
+// bigThree.remove(scenePanel);
2902
+// bigThree.remove(centralPanel);
2903
+// bigThree.remove(XYZPanel);
2904
+// aWindowConstraints.gridx = 0;
2905
+// aWindowConstraints.gridy = 0;
2906
+// aWindowConstraints.gridwidth = 1;
2907
+// // aWindowConstraints.gridheight = 3;
2908
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2909
+// aWindowConstraints.weightx = 0;
2910
+// aWindowConstraints.weighty = 1;
2911
+// bigThree.add(scenePanel, aWindowConstraints);
2912
+// aWindowConstraints.weightx = 1;
2913
+// aWindowConstraints.gridwidth = 3;
2914
+// // aWindowConstraints.gridheight = 3;
2915
+// aWindowConstraints.gridx = 1;
2916
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2917
+// bigThree.add(centralPanel, aWindowConstraints);
2918
+// aWindowConstraints.weightx = 0;
2919
+// aWindowConstraints.gridx = 4;
2920
+// aWindowConstraints.gridwidth = 1;
2921
+// // aConstraints.gridheight = 3;
2922
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2923
+// bigThree.add(XYZPanel, aWindowConstraints);
2924
+// bigThree.validate();
2925
+// scenePanel.setVisible(true);
2926
+// centralPanel.setVisible(true);
2927
+// XYZPanel.setVisible(true);
2928
+ bigThree.ClearUI();
2929
+ bigThree.add(scenePanel);
2930
+ bigThree.add(centralPanel);
2931
+ bigThree.add(XYZPanel);
2932
+ bigThree.FlushUI();
27952933 } else
2796
- if (event.getSource() == rootButton)
2934
+ if (source == rootButton)
27972935 {
27982936 Object3D obj;
27992937 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2805,7 +2943,7 @@
28052943
28062944 refreshContents(true);
28072945 } else
2808
- if (event.getSource() == closeButton)
2946
+ if (source == closeButton)
28092947 {
28102948 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28112949 cRadio ab;
....@@ -2826,11 +2964,11 @@
28262964 }
28272965 refreshContents(true);
28282966 } else
2829
- if (event.getSource() == editItem || event.getSource() == editButton)
2967
+ if (source == editItem || source == editButton)
28302968 {
28312969 EditSelection(false);
28322970 } else
2833
- if (event.getSource() == uneditButton)
2971
+ if (source == uneditButton)
28342972 {
28352973 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28362974 {
....@@ -2842,12 +2980,12 @@
28422980
28432981 child.editWindow = null; // ???????????
28442982 }
2845
- objEditor.ctrlPanel.revalidate();
2983
+ objEditor.ctrlPanel.FlushUI();
28462984 //objEditor.jTree.clearSelection();
28472985 //objEditor.ResetSliders();
28482986 refreshContents(true);
28492987 } else
2850
- if (event.getSource() == clearPanelButton)
2988
+ if (source == clearPanelButton)
28512989 {
28522990 assert(copy == group);
28532991 //copy.ClearUI();
....@@ -2858,7 +2996,7 @@
28582996 listUI.clear();
28592997 refreshContents(true);
28602998 } else
2861
- if (event.getSource() == allParamsButton)
2999
+ if (source == allParamsButton)
28623000 {
28633001 assert(copy == group);
28643002
....@@ -2879,19 +3017,19 @@
28793017
28803018 refreshContents(true);
28813019 } else
2882
- if (event.getSource() == unselectButton)
3020
+ if (source == unselectButton)
28833021 {
28843022 objEditor.jTree.clearSelection();
28853023 // ?? oct 2012 GrafreeD.clipboard.clear();
28863024 objEditor.ResetSliders();
28873025 refreshContents(true);
28883026 } else
2889
- if(event.getSource() instanceof cRadio)
3027
+ if(source instanceof cRadio)
28903028 {
28913029 group.parent = keepparent;
28923030 group.attributes = 0;
28933031 //group.editWindow = null;
2894
- /*cRadio*/ radio = (cRadio)event.getSource();
3032
+ /*cRadio*/ radio = (cRadio)source;
28953033 Object3D obj = radio.GetObject();
28963034 System.out.println("Edit " + obj);
28973035 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2911,7 +3049,7 @@
29113049 }
29123050
29133051 copy = group;
2914
- //CameraPane.theRenderer.object = group;
3052
+ //Globals.theRenderer.object = group;
29153053 if(!useclient)
29163054 {
29173055 cameraView.renderCamera = radio.camera;
....@@ -3473,7 +3611,7 @@
34733611 String pigment = Object3D.GetPigment(tex);
34743612 //String bump = Object3D.GetBump(tex);
34753613
3476
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3614
+ com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
34773615
34783616 double s = v.s;
34793617
....@@ -3561,11 +3699,11 @@
35613699
35623700 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35633701
3564
- boolean random = CameraPane.RANDOM;
3565
- CameraPane.RANDOM = false; // parse all random nodes
3702
+ boolean random = CameraPane.SWITCH;
3703
+ CameraPane.SWITCH = false; // parse all random nodes
35663704 lowres.linkVerticesThis(null);
35673705 lowres.linkVerticesThis(sn);
3568
- CameraPane.RANDOM = random;
3706
+ CameraPane.SWITCH = random;
35693707
35703708 System.err.flush();
35713709
....@@ -3774,7 +3912,7 @@
37743912 group.selection.RelinkToSupport(); // july 2014
37753913 System.out.println("DONE.");
37763914 refreshContents();
3777
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
3915
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
37783916 }
37793917
37803918 void ReduceMesh(boolean reduction34)
....@@ -4050,12 +4188,12 @@
40504188 System.err.println("info : " + child.GetPath());
40514189 }
40524190 }
4053
- else
4054
- {
4055
- objEditor.SetMaterial(group); // .GetMaterial());
4056
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4057
- System.err.println("info : " + group.GetPath());
4058
- }
4191
+// else
4192
+// {
4193
+// objEditor.SetMaterial(group); // .GetMaterial());
4194
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4195
+// System.err.println("info : " + group.GetPath());
4196
+// }
40594197
40604198 objEditor.SetText(); // jan 2014
40614199
....@@ -4066,9 +4204,9 @@
40664204 // a camera
40674205 {
40684206 CameraPane.camerachangeframe = 0; // don't refuse it
4069
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4070
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
4071
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4207
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4208
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4209
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40724210 }
40734211
40744212 refreshContents();
....@@ -4323,7 +4461,7 @@
43234461 refreshContents();
43244462 }
43254463
4326
- void pasteInto(boolean copyit)
4464
+ void pasteInto(boolean copyit, boolean clone)
43274465 {
43284466 // if (GrafreeD.clipboard == null)
43294467 // return;
....@@ -4352,7 +4490,14 @@
43524490 if (copyit)
43534491 {
43544492 // paste(false);
4355
- CloneClipboard(false); // sept 2014
4493
+ if (clone)
4494
+ {
4495
+ CloneClipboard(false); // sept 2014
4496
+ }
4497
+ else
4498
+ {
4499
+ paste(false);
4500
+ }
43564501 }
43574502 else
43584503 {
....@@ -4896,10 +5041,12 @@
48965041 cButton flashSelectionButton;
48975042 cButton editButton;
48985043 cButton uneditButton;
5044
+ JCheckBox allParamsButton;
48995045 cButton clearpanelButton;
4900
- cButton allParamsButton;
49015046 cButton unselectButton;
49025047
5048
+ cButton oneStepButton;
5049
+
49035050 cButton screenfitButton;
49045051 cButton screenfitpointButton;
49055052 cButton snapobjectButton;
....@@ -4954,6 +5101,7 @@
49545101 private MenuItem mergeGeometriesItem;
49555102 private MenuItem copyItem;
49565103 private MenuItem pasteItem;
5104
+ private MenuItem pasteIntoItem;
49575105 private MenuItem pasteLinkItem;
49585106 private MenuItem pasteCloneItem;
49595107 private MenuItem pasteExpandItem;
....@@ -5051,7 +5199,7 @@
50515199 private MenuItem blobItem;
50525200 private MenuItem latheItem;
50535201 private MenuItem bezierItem;
5054
- private MenuItem checkerItem;
5202
+ private MenuItem overlayItem;
50555203 private MenuItem meshItem;
50565204 // private MenuItem meshGroupItem;
50575205 private MenuItem springItem;