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,176 +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);
441491 liveCB.setToolTipText("Enabled animation");
442492 liveCB.addItemListener(this);
443493
444
- oe.aConstraints.gridx += 1;
445
- 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);
446499 fastCB.setToolTipText("Fast mode");
447500 fastCB.addItemListener(this);
448
- oe.aConstraints.gridx += 1;
449
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
450
- supportCB.setToolTipText("Enabled rigging");
451
- supportCB.addItemListener(this);
452
-
453
- // oe.aConstraints.gridx += 1;
454
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
455
- // localCB.addItemListener(this);
456
-
457
- oe.aConstraints.gridx += 1;
458
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), oe.aConstraints);
459
- crowdCB.setToolTipText("Used for crowds");
460
- crowdCB.addItemListener(this);
461
-
462
- oe.aConstraints.gridx += 1;
463
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
464
- smoothCB.setToolTipText("Snapping delay");
465
- smoothCB.addItemListener(this);
466
-
467
- oe.aConstraints.gridx += 1;
468
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
469
- slowCB.setToolTipText("Smooth interpolation");
470
- slowCB.addItemListener(this);
471
- oe.aConstraints.gridx += 1;
472
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), oe.aConstraints);
473
- boxCB.setToolTipText("Display bounding boxes");
474
- boxCB.addItemListener(this);
475
- oe.aConstraints.gridx += 1;
476
- oe.toolbarPanel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), oe.aConstraints);
477
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
478
- zoomBoxCB.addItemListener(this);
479
-
480
-// oe.aConstraints.gridx += 1;
481
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
482
-// speakerMocapCB.addItemListener(this);
483
-
484
- if (false)
485
- {
486
- // handled in scripts
487
- oe.aConstraints.gridx += 1;
488
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
489
- speakerCameraCB.addItemListener(this);
490
-
491
- oe.aConstraints.gridx += 1;
492
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
493
- speakerFocusCB.addItemListener(this);
494
-
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
497
- smoothfocusCB.addItemListener(this);
498
- }
499
-
500
-//oe.aConstraints.gridx += 1;
501
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
502
-// debugCB.addItemListener(this);
503
-
504
- oe.aConstraints.gridx += 1;
505
- oe.toolbarPanel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), oe.aConstraints);
506
- oeilCB.addItemListener(this);
507
-
508
- oe.aConstraints.gridx += 1;
509
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), oe.aConstraints);
510
- lookAtCB.setToolTipText("Look-at target");
511
- lookAtCB.addItemListener(this);
512
-
513
- oe.aConstraints.gridx += 1;
514
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
501
+
502
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
515503 trackCB.setToolTipText("Enable tracking");
516504 trackCB.addItemListener(this);
517505
518
- oe.aConstraints.gridx += 1;
519
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
506
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
520507 screenfitButton.setToolTipText("Screen fit");
521508 screenfitButton.addActionListener(this);
522
- oe.aConstraints.gridx += 1;
509
+
523510 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
524511 // screenfitpointButton.addActionListener(this);
525
-// oe.aConstraints.gridx += 1;
526
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
527
- snapobjectButton.addActionListener(this);
528
- snapobjectButton.setToolTipText("Snap Object");
529
- oe.aConstraints.gridx += 1;
530512
531
- //aConstraints.gridx = 0;
532
- //aConstraints.gridy += 1;
533
- oe.aConstraints.weighty = 0;
534
- oe.aConstraints.gridwidth = 1;
535
-
536
- 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);
537521 flashSelectionButton.setToolTipText("Show selection");
538522 flashSelectionButton.addActionListener(this);
539523
540
- oe.toolbarPanel.add(new cButton(" ", false));
524
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
541525
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545
-
546
- //
547
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
526
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
548527 twoButton.setToolTipText("Show center view only");
549528 twoButton.addActionListener(this);
550
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
529
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
551530 fourButton.addActionListener(this);
552531 fourButton.setToolTipText("Show left panel only");
553
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
532
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
554533 sixButton.setToolTipText("2-column layout left");
555534 sixButton.addActionListener(this);
556
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
535
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
557536 threeButton.setToolTipText("2-column layout right");
558537 threeButton.addActionListener(this);
559
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
538
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
560539 sevenButton.setToolTipText("3-column layout");
561540 sevenButton.addActionListener(this);
562541 //
563542
564
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
565
- rootButton.setToolTipText("Edit object in new tab");
543
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
544
+ rootButton.setToolTipText("Edit selection in new tab");
566545 rootButton.addActionListener(this);
567
- oe.aConstraints.gridx += 1;
568
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
546
+
547
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
569548 closeButton.setToolTipText("Close tab");
570549 closeButton.addActionListener(this);
571550 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
572551 //clearButton.addActionListener(this);
573
- oe.aConstraints.gridx += 1;
574552
575
- oe.aConstraints.gridx = 1; //
576
- 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");
577557 editButton.addActionListener(this);
578
- oe.aConstraints.gridx += 1;
579
- oe.aConstraints.weighty = 0;
580
- oe.aConstraints.gridwidth = 1;
581558
582
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
559
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
560
+ uneditButton.setToolTipText("Unedit selection");
583561 uneditButton.addActionListener(this);
584562
585
- oe.aConstraints.gridx += 1;
586
- oe.aConstraints.weighty = 0;
587
- oe.aConstraints.gridwidth = 1;
588
-
589
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
590
- clearPanelButton.addActionListener(this);
591
-
592
- oe.aConstraints.gridx += 1;
593
- oe.aConstraints.weighty = 0;
594
- oe.aConstraints.gridwidth = 1;
595
-
596
- 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");
597565 allParamsButton.addActionListener(this);
598566
599
- oe.aConstraints.gridx += 1;
600
- oe.aConstraints.weighty = 0;
601
- oe.aConstraints.gridwidth = 1;
602
-
603
- 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");
604573 unselectButton.addActionListener(this);
605574
575
+ commandsPanel.preferredHeight = 1;
576
+
577
+ oe.treePanel.add(commandsPanel);
578
+ oe.treePanel.Return();
579
+
606580 // oe.aConstraints.gridx += 1;
607581 // oe.aConstraints.weighty = 0;
608582 // oe.aConstraints.gridwidth = 1;
....@@ -614,40 +588,37 @@
614588 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
615589 // gcButton.addActionListener(this);
616590
617
- oe.aConstraints.gridx = 0;
618
- oe.aConstraints.gridy += 1;
619
-
620
- //ctrlPanel.add(objList = new List(5, true));
621
- oe.aConstraints.gridwidth = 100;
622
- // oe.aConstraints.gridheight = 100;
623
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
624
- oe.aConstraints.gridheight = 1;
625
- oe.aConstraints.weighty = 0.5;
626
- oe.aConstraints.gridx = 0;
627
- JScrollPane jSP;
591
+ cGridBag jSPPanel = new cGridBag();
592
+
593
+ JScrollPane jSP;
628594 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
629
- 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);
630596 ResetModel();
631
- oe.aConstraints.weighty = 0.5;
632
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
633
- oe.aConstraints.gridy += 1;
634
- oe.aConstraints.gridwidth = 1;
597
+
598
+ oe.treePanel.add(jSPPanel);
599
+ oe.treePanel.Return();
635600
636
- oe.aConstraints.weighty = 0;
637
- oe.aConstraints.gridwidth = 2;
638
-
639
- 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");
640605 colorCB.addItemListener(this);
641
- oe.aConstraints.gridx += 2;
642
- 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");
643609 materialCB.addItemListener(this);
644
- oe.aConstraints.gridx += 2;
645
- 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");
646613 textureCB.addItemListener(this);
647614
648
- oe.aConstraints.gridx = 0;
649
- oe.aConstraints.gridy += 1;
615
+ copyOptionsPanel.preferredHeight = 1;
616
+ oe.treePanel.add(copyOptionsPanel);
617
+ oe.treePanel.Return();
650618
619
+// mainPanel.setDividerLocation(0.5); //1.0);
620
+// mainPanel.setResizeWeight(0.5);
621
+
651622 //jList.addListSelectionListener(this);
652623 oe.jTree.addTreeSelectionListener(this);
653624 //jTree.setRootVisible(false);
....@@ -669,6 +640,78 @@
669640 radio.layout = sevenButton;
670641 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
671642 }
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
+ }
672715
673716 void EditObject(Object3D obj)
674717 {
....@@ -951,11 +994,11 @@
951994 {
952995 loadClipboard(true);
953996 objEditor.jTree.setSelectionPath(destinationPath);
954
- pasteInto(false);
997
+ pasteInto(false, false);
955998 } else {
956999 loadClipboard(false);
9571000 objEditor.jTree.setSelectionPath(destinationPath);
958
- pasteInto(false); // true); // ???
1001
+ pasteInto(false, false); // true); // ???
9591002 }
9601003 }
9611004 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1077,27 +1120,33 @@
10771120 kleinItem.addActionListener(this);
10781121 particleItem = menu.add(new MenuItem("Particle system"));
10791122 particleItem.addActionListener(this);
1123
+ if (Globals.ADVANCED)
1124
+ {
10801125 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10811126 ragdollItem.addActionListener(this);
10821127 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10831128 ragdoll2Item.addActionListener(this);
1129
+ }
10841130 menu.add("-");
1085
- meshItem = menu.add(new MenuItem("Mesh"));
1131
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10861132 meshItem.addActionListener(this);
10871133 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10881134 // meshGroupItem.addActionListener(this);
1135
+ if (Globals.ADVANCED)
1136
+ {
10891137 springItem = menu.add(new MenuItem("Spring"));
10901138 springItem.addActionListener(this);
10911139 flagItem = menu.add(new MenuItem("Flag"));
10921140 flagItem.addActionListener(this);
1093
- bezierItem = menu.add(new MenuItem("Patch"));
1094
- bezierItem.addActionListener(this);
1095
- checkerItem = menu.add(new MenuItem("Checker"));
1096
- checkerItem.addActionListener(this);
10971141 blobItem = menu.add(new MenuItem("Blob"));
10981142 blobItem.addActionListener(this);
10991143 latheItem = menu.add(new MenuItem("Lathe"));
11001144 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);
11011150 lightItem = menu.add(new MenuItem("Light"));
11021151 lightItem.addActionListener(this);
11031152 menu.add("-");
....@@ -1107,34 +1156,39 @@
11071156 loopItem.addActionListener(this);
11081157 doubleItem = menu.add(new MenuItem("Fork"));
11091158 doubleItem.addActionListener(this);
1159
+ if (Globals.ADVANCED)
1160
+ {
11101161 tripleItem = menu.add(new MenuItem("Trident"));
11111162 tripleItem.addActionListener(this);
1163
+ }
11121164 }
11131165
11141166 void buildToolsMenu(Menu menu)
11151167 {
11161168 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11171169 animationItem.addItemListener(this);
1118
- animationItem.setState(CameraPane.ANIMATION);
1170
+ animationItem.setState(Globals.ANIMATION);
11191171
11201172 menu.add("-");
11211173 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11221174 parseverticesItem.addActionListener(this);
11231175 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11241176 textureFieldItem.addActionListener(this);
1125
- alignItem = menu.add(new MenuItem("Align"));
1177
+ alignItem = menu.add(new MenuItem("Align Objects"));
11261178 alignItem.addActionListener(this);
1127
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1128
- mirrorItem.addActionListener(this);
11291179 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11301180 reduceMorphItem.addActionListener(this);
11311181 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11321182 reduce34MorphItem.addActionListener(this);
1133
-
1183
+ menu.add("-");
11341184 menu.add(computeAOItem = new MenuItem("Compute AO"));
11351185 computeAOItem.addActionListener(this);
1136
- menu.add("-");
11371186
1187
+ if (Globals.ADVANCED)
1188
+ {
1189
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1190
+ mirrorItem.addActionListener(this);
1191
+ menu.add("-");
11381192 menu.add(memoryItem = new MenuItem("Memory Usage"));
11391193 memoryItem.addActionListener(this);
11401194 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1157,6 +1211,7 @@
11571211 menu.add("-");
11581212 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11591213 editScriptItem.addActionListener(this);
1214
+ }
11601215 }
11611216
11621217 void ScreenFit()
....@@ -1510,6 +1565,7 @@
15101565 //
15111566 public void actionPerformed(ActionEvent event) // , Object arg)
15121567 {
1568
+ Object source = event.getSource();
15131569 /*
15141570 if (event.getSource() == nameField)
15151571 {
....@@ -1521,11 +1577,11 @@
15211577 }
15221578 else
15231579 */
1524
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1580
+ if (source == lookAtItem || source == lookFromItem)
15251581 {
15261582 ScreenFit();
15271583 } else
1528
- if (event.getSource() == switchItem)
1584
+ if (source == switchItem)
15291585 {
15301586 cVector v1 = new cVector();
15311587 cVector v2 = new cVector();
....@@ -1534,11 +1590,11 @@
15341590 objEditor.cameraView.renderCamera.setAim(v2, v1);
15351591 objEditor.cameraView.repaint();
15361592 } else
1537
- if (event.getSource() == rectoidItem)
1593
+ if (source == rectoidItem)
15381594 {
15391595 makeSomething(new Box());
15401596 } else
1541
- if (event.getSource() == particleItem)
1597
+ if (source == particleItem)
15421598 {
15431599 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15441600 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1559,9 +1615,9 @@
15591615 applyExample(particleGeom, "SMOKE");
15601616 makeSomething(particleGeom);
15611617 } else
1562
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1618
+ if (source == ragdollItem || source == ragdoll2Item)
15631619 {
1564
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1620
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15651621
15661622 ragdoll.toParent = LA.newMatrix();
15671623 ragdoll.fromParent = LA.newMatrix();
....@@ -1579,7 +1635,7 @@
15791635 } else
15801636 /*
15811637 */
1582
- if (event.getSource() == heightFieldItem)
1638
+ if (source == heightFieldItem)
15831639 {
15841640 Object3D obj = new Object3D();
15851641
....@@ -1617,31 +1673,31 @@
16171673
16181674 makeSomething(obj);
16191675 } else
1620
- if (event.getSource() == gridItem)
1676
+ if (source == gridItem)
16211677 {
16221678 makeSomething(new Grid());
16231679 } else
1624
- if (event.getSource() == ellipsoidItem)
1680
+ if (source == ellipsoidItem)
16251681 {
16261682 makeSomething(new Sphere());
16271683 } else
1628
- if (event.getSource() == coneItem)
1684
+ if (source == coneItem)
16291685 {
16301686 makeSomething(new Cone());
16311687 } else
1632
- if (event.getSource() == torusItem)
1688
+ if (source == torusItem)
16331689 {
16341690 makeSomething(new Torus());
16351691 } else
1636
- if (event.getSource() == superItem)
1692
+ if (source == superItem)
16371693 {
16381694 makeSomething(new Superellipsoid());
16391695 } else
1640
- if (event.getSource() == kleinItem)
1696
+ if (source == kleinItem)
16411697 {
16421698 makeSomething(new Klein());
16431699 } else
1644
- if (event.getSource() == blobItem)
1700
+ if (source == blobItem)
16451701 {
16461702 Blob blob = new Blob();
16471703 BlobComponent comp = new BlobComponent();
....@@ -1649,15 +1705,15 @@
16491705 //blob.retile();
16501706 makeSomething(blob);
16511707 } else
1652
- if (event.getSource() == latheItem)
1708
+ if (source == latheItem)
16531709 {
16541710 makeSomething(new Lathe());
16551711 } else
1656
- if (event.getSource() == bezierItem)
1712
+ if (source == bezierItem)
16571713 {
16581714 makeSomething(new BezierSurface());
16591715 } else
1660
- if (event.getSource() == checkerItem)
1716
+ if (source == overlayItem)
16611717 {
16621718 /*
16631719 Object3D obj = new BezierSurface(5,8);
....@@ -1672,7 +1728,7 @@
16721728 */
16731729 makeSomething(new Checker());
16741730 } else
1675
- if (event.getSource() == meshItem)
1731
+ if (source == meshItem)
16761732 {
16771733 Object3D itemtomake = new Object3D();
16781734 Object3D child;
....@@ -1693,35 +1749,35 @@
16931749 makeSomething(child);
16941750 }
16951751 } else
1696
- if (event.getSource() == springItem)
1752
+ if (source == springItem)
16971753 {
16981754 cSpring s = new cSpring();
16991755 s.setup();
17001756 makeSomething(s);
17011757 } else
1702
- if (event.getSource() == flagItem)
1758
+ if (source == flagItem)
17031759 {
17041760 cSpring s = new cFlag();
17051761 s.setup();
17061762 makeSomething(s);
17071763 } else
1708
- if (event.getSource() == lightItem)
1764
+ if (source == lightItem)
17091765 {
17101766 makeSomething(new Light());
17111767 } else
1712
- if (event.getSource() == csgItem)
1768
+ if (source == csgItem)
17131769 {
17141770 group(new CSG());
17151771 } else
1716
- if (event.getSource() == templateItem)
1772
+ if (source == templateItem)
17171773 {
17181774 group(new cTemplate());
17191775 } else
1720
- if (event.getSource() == attributeItem)
1776
+ if (source == attributeItem)
17211777 {
17221778 makeSomething(new Attribute());
17231779 } else
1724
- if (event.getSource() == pointflowItem)
1780
+ if (source == pointflowItem)
17251781 {
17261782 makeSomething(new PointFlow());
17271783 } else
....@@ -1733,7 +1789,7 @@
17331789 } else
17341790 */
17351791
1736
- if (event.getSource() == superLoopItem)
1792
+ if (source == superLoopItem)
17371793 {
17381794 Composite g = new cGroup();
17391795 for (int i=0; i<15; i++)
....@@ -1755,7 +1811,7 @@
17551811
17561812 group(g);
17571813 } else
1758
- if (event.getSource() == loopItem)
1814
+ if (source == loopItem)
17591815 {
17601816 Composite csg = new GroupLeaf();
17611817 csg.count = 5;
....@@ -1764,7 +1820,7 @@
17641820 csg.addChild(child);
17651821 child.addChild(csg);
17661822 } else
1767
- if (event.getSource() == doubleItem)
1823
+ if (source == doubleItem)
17681824 {
17691825 Composite csg = new GroupLeaf();
17701826 csg.count = 5;
....@@ -1776,7 +1832,7 @@
17761832 csg.addChild(child);
17771833 child.addChild(csg);
17781834 } else
1779
- if (event.getSource() == tripleItem)
1835
+ if (source == tripleItem)
17801836 {
17811837 Composite csg = new GroupLeaf();
17821838 csg.count = 4;
....@@ -1792,70 +1848,83 @@
17921848 child.addChild(csg);
17931849 } else
17941850
1795
- if (event.getSource() == importGFDItem)
1851
+ if (source == importGFDItem)
17961852 {
17971853 ImportGFD();
17981854 } else
1799
- if (event.getSource() == importVRMLX3DItem)
1855
+ if (source == importVRMLX3DItem)
18001856 {
18011857 ImportVRMLX3D();
18021858 } else
1803
- if (event.getSource() == import3DSItem)
1859
+ if (source == import3DSItem)
18041860 {
18051861 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
18061862 } else
1807
- if (event.getSource() == importOBJItem)
1863
+ if (source == importOBJItem)
18081864 {
1809
- 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
+ }
18101874 } else
1811
- if (event.getSource() == computeAOItem)
1875
+ if (source == computeAOItem)
18121876 {
18131877 Globals.drawMode = CameraPane.OCCLUSION;
18141878 Globals.theRenderer.repaint();
18151879 } else
1816
- if (event.getSource() == recompileItem)
1880
+ if (source == recompileItem)
18171881 {
18181882 Recompile();
18191883 refreshContents();
18201884 } else
1821
- if (event.getSource() == editScriptItem)
1885
+ if (source == editScriptItem)
18221886 {
18231887 OpenDialog();
18241888 refreshContents();
18251889 } else
1826
- if (event.getSource() == invariantsItem)
1890
+ if (source == invariantsItem)
18271891 {
18281892 System.out.println("Invariants:");
18291893 GrafreeD.grafreeD.universe.invariants();
18301894 } else
1831
- if (event.getSource() == memoryItem)
1895
+ if (source == memoryItem)
18321896 {
18331897 //System.out.println("Invariants:");
18341898 PrintMemory();
18351899 } else
1836
- if (event.getSource() == pathItem)
1900
+ if (source == pathItem)
18371901 {
18381902 PrintPath();
18391903 } else
1840
- if (event.getSource() == analyzeItem)
1904
+ if (source == analyzeItem)
18411905 {
18421906 AnalyzeObject();
18431907 } else
1844
- if (event.getSource() == dumpItem)
1908
+ if (source == dumpItem)
18451909 {
18461910 DumpObject();
18471911 } else
1848
- if (event.getSource() == screenfitButton)
1912
+ if (source == oneStepButton)
1913
+ {
1914
+ Globals.ONESTEP = true;
1915
+ cameraView.repaint();
1916
+ } else
1917
+ if (source == screenfitButton)
18491918 {
18501919 //Reload(lastConverter, lastFilename, true);
18511920 ScreenFit();
18521921 } else
1853
- if (event.getSource() == screenfitpointButton)
1922
+ if (source == screenfitpointButton)
18541923 {
18551924 //Reload(lastConverter, lastFilename, true);
18561925 ScreenFitPoint();
18571926 } else
1858
- if (event.getSource() == snapobjectButton)
1927
+ if (source == snapobjectButton)
18591928 {
18601929 //Reload(lastConverter, lastFilename, true);
18611930 SnapObject();
....@@ -1866,13 +1935,13 @@
18661935 // Recompile();
18671936 // refreshContents();
18681937 // } else
1869
- if (event.getSource() == gcButton)
1938
+ if (source == gcButton)
18701939 {
18711940 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18721941 System.gc();
18731942 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18741943 } else
1875
- if (event.getSource() == editLeafItem)
1944
+ if (source == editLeafItem)
18761945 {
18771946 Object3D obj;
18781947 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1886,62 +1955,66 @@
18861955 }
18871956 refreshContents(true);
18881957 } else
1889
- if (event.getSource() == openWindowItem)
1958
+ if (source == openWindowItem)
18901959 {
18911960 EditSelection(true);
18921961 } else
1893
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1962
+ if (source == cutItem || source == clearButton)
18941963 {
18951964 loadClipboard(true);
18961965 } else
1897
- if (event.getSource() == duplicateItem)
1966
+ if (source == duplicateItem)
18981967 {
18991968 Object3D keep = GrafreeD.clipboard;
19001969 loadClipboard(false);
19011970 paste(false);
19021971 GrafreeD.clipboard = keep;
19031972 } else
1904
- if (event.getSource() == cloneItem)
1973
+ if (source == cloneItem)
19051974 {
19061975 CloneSelection(false);
19071976 } else
1908
- if (event.getSource() == cloneSupportItem)
1977
+ if (source == cloneSupportItem)
19091978 {
19101979 CloneSelection(true);
19111980 } else
1912
- if (event.getSource() == copyItem)
1981
+ if (source == copyItem)
19131982 {
19141983 loadClipboard(false);
19151984 } else
1916
- if (event.getSource() == pasteItem)
1985
+ if (source == pasteItem)
19171986 {
19181987 paste(false);
19191988 } else
1920
- if (event.getSource() == pasteLinkItem)
1989
+ if (source == pasteIntoItem)
19211990 {
1922
- pasteInto(false);
1991
+ pasteInto(true, false);
19231992 } else
1924
- if (event.getSource() == pasteCloneItem)
1993
+ if (source == pasteLinkItem)
19251994 {
1926
- pasteInto(true);
1995
+ pasteInto(false, false);
19271996 } else
1928
- if (event.getSource() == pasteExpandItem)
1997
+ if (source == pasteCloneItem)
1998
+ {
1999
+ pasteInto(true, true);
2000
+ } else
2001
+ if (source == pasteExpandItem)
19292002 {
19302003 paste(true);
19312004 } else
1932
- if (event.getSource() == synchronizeItem)
2005
+ if (source == synchronizeItem)
19332006 {
19342007 Overwrite(Object3D.TRANSFORM);
19352008 } else
1936
- if (event.getSource() == overwriteNameItem)
2009
+ if (source == overwriteNameItem)
19372010 {
19382011 Overwrite(Object3D.NAME);
19392012 } else
1940
- if (event.getSource() == overwriteUVItem)
2013
+ if (source == overwriteUVItem)
19412014 {
19422015 Overwrite(Object3D.UV);
19432016 } else
1944
- if (event.getSource() == overwriteMatItem)
2017
+ if (source == overwriteMatItem)
19452018 {
19462019 /* july 2015
19472020 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1961,7 +2034,7 @@
19612034
19622035 Overwrite(dropAttributes);
19632036 }
1964
- if (event.getSource() == overwriteGeoItem)
2037
+ if (source == overwriteGeoItem)
19652038 {
19662039 Overwrite(Object3D.GEOMETRY);
19672040 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1978,7 +2051,7 @@
19782051 // refreshContents();
19792052 // }
19802053 } else
1981
- if (event.getSource() == generateMeshItem)
2054
+ if (source == generateMeshItem)
19822055 {
19832056 //if (group.selection.size() == 1)
19842057 // for (int i=0; i<group.selection.size(); i++)
....@@ -1989,7 +2062,7 @@
19892062 ResetModel();
19902063 refreshContents();
19912064 } else
1992
- if (event.getSource() == extractGeometriesItem)
2065
+ if (source == extractGeometriesItem)
19932066 {
19942067 boolean one = false;
19952068
....@@ -2016,7 +2089,7 @@
20162089 ResetModel();
20172090 refreshContents();
20182091 } else
2019
- if (event.getSource() == cloneGeometriesItem)
2092
+ if (source == cloneGeometriesItem)
20202093 {
20212094 boolean one = false;
20222095
....@@ -2042,7 +2115,7 @@
20422115 ResetModel();
20432116 refreshContents();
20442117 } else
2045
- if (event.getSource() == shareGeometriesItem)
2118
+ if (source == shareGeometriesItem)
20462119 {
20472120 boolean one = false;
20482121
....@@ -2072,7 +2145,7 @@
20722145 refreshContents();
20732146 }
20742147 } else
2075
- if (event.getSource() == mergeGeometriesItem)
2148
+ if (source == mergeGeometriesItem)
20762149 {
20772150 boolean one = false;
20782151
....@@ -2102,7 +2175,7 @@
21022175 ResetModel();
21032176 refreshContents();
21042177 } else
2105
- if (event.getSource() == linkverticesItem)
2178
+ if (source == linkverticesItem)
21062179 {
21072180 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21082181 // {
....@@ -2125,38 +2198,38 @@
21252198 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21262199 for (int i=0; i<group.selection.size(); i++)
21272200 {
2128
- boolean random = CameraPane.RANDOM;
2129
- CameraPane.RANDOM = false; // parse all random nodes
2201
+ boolean random = CameraPane.SWITCH;
2202
+ CameraPane.SWITCH = false; // parse all random nodes
21302203 group.selection.get(i).linkVerticesThis(content);
21312204 // group.selection.get(i).setMasterThis(content); // should be identity
2132
- CameraPane.RANDOM = random;
2205
+ CameraPane.SWITCH = random;
21332206 }
21342207 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21352208 refreshContents();
21362209 }
21372210 } else
2138
- if (event.getSource() == resetsupportItem)
2211
+ if (source == resetsupportItem)
21392212 {
21402213 for (int i=0; i<group.selection.size(); i++)
21412214 {
2142
- boolean random = CameraPane.RANDOM;
2143
- CameraPane.RANDOM = false; // parse all random nodes
2215
+ boolean random = CameraPane.SWITCH;
2216
+ CameraPane.SWITCH = false; // parse all random nodes
21442217 group.selection.get(i).linkVerticesThis(null);
2145
- CameraPane.RANDOM = random;
2218
+ CameraPane.SWITCH = random;
21462219 }
21472220
21482221 refreshContents();
21492222 } else
2150
- if (event.getSource() == relinkverticesItem)
2223
+ if (source == relinkverticesItem)
21512224 {
2152
- boolean random = CameraPane.RANDOM;
2153
- CameraPane.RANDOM = false; // parse all random nodes
2225
+ boolean random = CameraPane.SWITCH;
2226
+ CameraPane.SWITCH = false; // parse all random nodes
21542227 group.selection.RelinkToSupport();
2155
- CameraPane.RANDOM = random;
2228
+ CameraPane.SWITCH = random;
21562229
21572230 refreshContents();
21582231 } else
2159
- if (event.getSource() == resetreferencesItem)
2232
+ if (source == resetreferencesItem)
21602233 {
21612234 for (int i=0; i<group.selection.size(); i++)
21622235 {
....@@ -2165,7 +2238,7 @@
21652238
21662239 refreshContents();
21672240 } else
2168
- if (event.getSource() == setMasterItem)
2241
+ if (source == setMasterItem)
21692242 {
21702243 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21712244 {
....@@ -2178,7 +2251,7 @@
21782251 refreshContents();
21792252 }
21802253 } else
2181
- if (event.getSource() == poseMeshItem)
2254
+ if (source == poseMeshItem)
21822255 {
21832256 if (group.selection.size() == 1)
21842257 {
....@@ -2197,19 +2270,19 @@
21972270 }
21982271
21992272 } else
2200
- if (event.getSource() == revertMeshItem)
2273
+ if (source == revertMeshItem)
22012274 {
22022275 RevertMeshes();
22032276 } else
2204
- if (event.getSource() == resetMeshItem)
2277
+ if (source == resetMeshItem)
22052278 {
22062279 ResetAll();
22072280 } else
2208
- if (event.getSource() == stepAllItem)
2281
+ if (source == stepAllItem)
22092282 {
22102283 StepAll();
22112284 } else
2212
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2285
+ if (source == clearItem) // || event.getSource() == clearButton)
22132286 {
22142287 //int indices[] = jList.getSelectedIndices();
22152288 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2217,46 +2290,46 @@
22172290
22182291 ClearSelection(false);
22192292 } else
2220
- if (event.getSource() == clearAllItem)
2293
+ if (source == clearAllItem)
22212294 {
22222295 ClearSelection(true);
22232296 } else
2224
- if (event.getSource() == grabItem)
2297
+ if (source == grabItem)
22252298 {
22262299 group(new cGroup(), true);
22272300 } else
2228
- if (event.getSource() == hideItem)
2301
+ if (source == hideItem)
22292302 {
22302303 group(new HiddenObject());
22312304 } else
2232
- if (event.getSource() == frontItem)
2305
+ if (source == frontItem)
22332306 {
22342307 front();
22352308 } else
2236
- if (event.getSource() == backItem)
2309
+ if (source == backItem)
22372310 {
22382311 back();
22392312 } else
2240
- if (event.getSource() == cameraItem)
2313
+ if (source == cameraItem)
22412314 {
22422315 makeSomething(new Camera());
22432316 } else
2244
- if (event.getSource() == compositeItem)
2317
+ if (source == compositeItem)
22452318 {
22462319 group(new Composite());
22472320 } else
2248
- if (event.getSource() == randomItem)
2321
+ if (source == randomItem)
22492322 {
22502323 RandomNode random = new RandomNode();
22512324 group(random);
22522325 if (random.size() > 0)
2253
- random.name = random.get(0).name + "Rnd";
2326
+ random.name = random.get(0).name + "Switch";
22542327 } else
2255
- if (event.getSource() == physicsItem)
2328
+ if (source == physicsItem)
22562329 {
22572330 group(new PhysicsNode());
22582331 } else
2259
- if (event.getSource() == frameselectorItem)
2332
+ if (source == frameselectorItem)
22602333 {
22612334 for (int i=0; i<group.selection.size(); i++)
22622335 {
....@@ -2268,7 +2341,7 @@
22682341 ResetModel();
22692342 refreshContents();
22702343 } else
2271
- if (event.getSource() == switchGeoItem)
2344
+ if (source == switchGeoItem)
22722345 {
22732346 for (int i=0; i<group.selection.size(); i++)
22742347 {
....@@ -2280,7 +2353,7 @@
22802353 ResetModel();
22812354 refreshContents();
22822355 } else
2283
- if (event.getSource() == switchTransfoItem)
2356
+ if (source == switchTransfoItem)
22842357 {
22852358 for (int i=0; i<group.selection.size(); i++)
22862359 {
....@@ -2292,7 +2365,7 @@
22922365 ResetModel();
22932366 refreshContents();
22942367 } else
2295
- if (event.getSource() == morphItem)
2368
+ if (source == morphItem)
22962369 {
22972370 for (int i=0; i<group.selection.size(); i++)
22982371 {
....@@ -2304,7 +2377,7 @@
23042377 ResetModel();
23052378 refreshContents();
23062379 } else
2307
- if (event.getSource() == scriptNodeItem)
2380
+ if (source == scriptNodeItem)
23082381 {
23092382 boolean atleastone = false;
23102383
....@@ -2343,31 +2416,31 @@
23432416 }
23442417 }
23452418 } else
2346
- if (event.getSource() == linkerItem)
2419
+ if (source == linkerItem)
23472420 {
23482421 group(new cLinker());
23492422 } else
2350
- if (event.getSource() == textureItem)
2423
+ if (source == textureItem)
23512424 {
23522425 group(new TextureNode());
23532426 } else
2354
- if (event.getSource() == billboardItem)
2427
+ if (source == billboardItem)
23552428 {
23562429 group(new BillboardNode());
23572430 } else
2358
- if (event.getSource() == shadowXItem)
2431
+ if (source == shadowXItem)
23592432 {
23602433 CastShadow(0);
23612434 } else
2362
- if (event.getSource() == shadowYItem)
2435
+ if (source == shadowYItem)
23632436 {
23642437 CastShadow(1);
23652438 } else
2366
- if (event.getSource() == shadowZItem)
2439
+ if (source == shadowZItem)
23672440 {
23682441 CastShadow(2);
23692442 } else
2370
- if (event.getSource() == ungroupItem)
2443
+ if (source == ungroupItem)
23712444 {
23722445 //ungroup();
23732446 for (int i=0; i<group.selection.size(); i++)
....@@ -2379,179 +2452,179 @@
23792452
23802453 refreshContents();
23812454 } else
2382
- if (event.getSource() == genUVItem)
2455
+ if (source == genUVItem)
23832456 {
23842457 GenUV();
23852458 } else
2386
- if (event.getSource() == genNormalsCADItem)
2459
+ if (source == genNormalsCADItem)
23872460 {
23882461 GenNormals(true);
23892462 } else
2390
- if (event.getSource() == genNormalsMESHItem)
2463
+ if (source == genNormalsMESHItem)
23912464 {
23922465 GenNormals(true); // TODO
23932466 } else
2394
- if (event.getSource() == genNormalsORGANItem)
2467
+ if (source == genNormalsORGANItem)
23952468 {
23962469 GenNormals(false);
23972470 } else
2398
- if (event.getSource() == genNormalsMINEItem)
2471
+ if (source == genNormalsMINEItem)
23992472 {
24002473 GenNormalsMINE();
24012474 } else
2402
- if (event.getSource() == stripifyItem)
2475
+ if (source == stripifyItem)
24032476 {
24042477 Stripify();
24052478 } else
2406
- if (event.getSource() == unstripifyItem)
2479
+ if (source == unstripifyItem)
24072480 {
24082481 Unstripify();
24092482 } else
2410
- if (event.getSource() == trimItem)
2483
+ if (source == trimItem)
24112484 {
24122485 Trim();
24132486 } else
2414
- if (event.getSource() == untrimItem)
2487
+ if (source == untrimItem)
24152488 {
24162489 Untrim();
24172490 } else
2418
- if (event.getSource() == clearColorsItem)
2491
+ if (source == clearColorsItem)
24192492 {
24202493 ClearColors();
24212494 } else
2422
- if (event.getSource() == clearMaterialsItem)
2495
+ if (source == clearMaterialsItem)
24232496 {
24242497 ClearMaterials();
24252498 } else
2426
- if (event.getSource() == liveleavesItem)
2499
+ if (source == liveleavesItem)
24272500 {
24282501 LiveLeaves(true);
24292502 } else
2430
- if (event.getSource() == unliveleavesItem)
2503
+ if (source == unliveleavesItem)
24312504 {
24322505 LiveLeaves(false);
24332506 } else
2434
- if (event.getSource() == supportleavesItem)
2507
+ if (source == supportleavesItem)
24352508 {
24362509 SupportLeaves(true);
24372510 } else
2438
- if (event.getSource() == unsupportleavesItem)
2511
+ if (source == unsupportleavesItem)
24392512 {
24402513 SupportLeaves(false);
24412514 } else
2442
- if (event.getSource() == hideleavesItem)
2515
+ if (source == hideleavesItem)
24432516 {
24442517 HideLeaves(true);
24452518 } else
2446
- if (event.getSource() == showleavesItem)
2519
+ if (source == showleavesItem)
24472520 {
24482521 HideLeaves(false);
24492522 } else
2450
- if (event.getSource() == markleavesItem)
2523
+ if (source == markleavesItem)
24512524 {
24522525 MarkLeaves(true);
24532526 } else
2454
- if (event.getSource() == unmarkleavesItem)
2527
+ if (source == unmarkleavesItem)
24552528 {
24562529 MarkLeaves(false);
24572530 } else
2458
- if (event.getSource() == flipVItem)
2531
+ if (source == flipVItem)
24592532 {
24602533 FlipV(true);
24612534 } else
2462
- if (event.getSource() == unflipVItem)
2535
+ if (source == unflipVItem)
24632536 {
24642537 FlipV(false);
24652538 } else
2466
- if (event.getSource() == lowTexturesItem)
2539
+ if (source == lowTexturesItem)
24672540 {
24682541 SetTexRes(0);
24692542 } else
2470
- if (event.getSource() == normalTexturesItem)
2543
+ if (source == normalTexturesItem)
24712544 {
24722545 SetTexRes(1);
24732546 } else
2474
- if (event.getSource() == highTexturesItem)
2547
+ if (source == highTexturesItem)
24752548 {
24762549 SetTexRes(2);
24772550 } else
2478
- if (event.getSource() == veryhighTexturesItem)
2551
+ if (source == veryhighTexturesItem)
24792552 {
24802553 SetTexRes(3);
24812554 } else
2482
- if (event.getSource() == maxTexturesItem)
2555
+ if (source == maxTexturesItem)
24832556 {
24842557 SetTexRes(4);
24852558 } else
2486
- if (event.getSource() == panoTexturesItem)
2559
+ if (source == panoTexturesItem)
24872560 {
24882561 SetTexRes(5);
24892562 } else
2490
- if (event.getSource() == reverseNormalsItem)
2563
+ if (source == reverseNormalsItem)
24912564 {
24922565 ReverseNormals();
24932566 } else
2494
- if (event.getSource() == parseverticesItem)
2567
+ if (source == parseverticesItem)
24952568 {
24962569 ParseVertices();
24972570 } else
2498
- if (event.getSource() == textureFieldItem)
2571
+ if (source == textureFieldItem)
24992572 {
25002573 TextureVertices();
25012574 } else
2502
- if (event.getSource() == alignItem)
2575
+ if (source == alignItem)
25032576 {
25042577 Align();
25052578 } else
2506
- if (event.getSource() == mirrorItem)
2579
+ if (source == mirrorItem)
25072580 {
25082581 MirrorPoses();
25092582 } else
2510
- if (event.getSource() == reduceMorphItem)
2583
+ if (source == reduceMorphItem)
25112584 {
25122585 MeshReduction(false);
25132586 } else
2514
- if (event.getSource() == reduce34MorphItem)
2587
+ if (source == reduce34MorphItem)
25152588 {
25162589 MeshReduction(true);
25172590 } else
2518
- if (event.getSource() == reverseTrianglesItem)
2591
+ if (source == reverseTrianglesItem)
25192592 {
25202593 ReverseTriangles();
25212594 } else
2522
- if (event.getSource() == reduceMeshItem)
2595
+ if (source == reduceMeshItem)
25232596 {
25242597 ReduceMesh(false);
25252598 } else
2526
- if (event.getSource() == reduce34MeshItem)
2599
+ if (source == reduce34MeshItem)
25272600 {
25282601 ReduceMesh(true);
25292602 } else
2530
- if (event.getSource() == increaseMeshItem)
2603
+ if (source == increaseMeshItem)
25312604 {
25322605 IncreaseMesh();
25332606 } else
2534
- if (event.getSource() == clipMeshItem)
2607
+ if (source == clipMeshItem)
25352608 {
25362609 ClipMesh();
25372610 } else
2538
- if (event.getSource() == smoothMeshItem)
2611
+ if (source == smoothMeshItem)
25392612 {
25402613 SmoothMesh();
25412614 } else
2542
- if (event.getSource() == transformgeometryItem)
2615
+ if (source == transformgeometryItem)
25432616 {
25442617 TransformGeometry();
25452618 } else
2546
- if (event.getSource() == resetTransformItem)
2619
+ if (source == resetTransformItem)
25472620 {
25482621 ResetTransform();
25492622 } else
2550
- if (event.getSource() == resetCentroidItem)
2623
+ if (source == resetCentroidItem)
25512624 {
25522625 ResetCentroid();
25532626 } else
2554
- if (event.getSource() == resetParentItem)
2627
+ if (source == resetParentItem)
25552628 {
25562629 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25572630 {
....@@ -2561,7 +2634,7 @@
25612634
25622635 refreshContents();
25632636 } else
2564
- if (event.getSource() == repairParentItem)
2637
+ if (source == repairParentItem)
25652638 {
25662639 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25672640 {
....@@ -2575,7 +2648,7 @@
25752648
25762649 refreshContents();
25772650 } else
2578
- if (event.getSource() == repairShadowItem)
2651
+ if (source == repairShadowItem)
25792652 {
25802653 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25812654 {
....@@ -2589,7 +2662,7 @@
25892662
25902663 refreshContents();
25912664 } else
2592
- if (event.getSource() == sortbysizeItem)
2665
+ if (source == sortbysizeItem)
25932666 {
25942667 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25952668 {
....@@ -2601,7 +2674,7 @@
26012674 ResetModel();
26022675 refreshContents();
26032676 } else
2604
- if (event.getSource() == sortbynameItem)
2677
+ if (source == sortbynameItem)
26052678 {
26062679 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26072680 {
....@@ -2613,7 +2686,7 @@
26132686 ResetModel();
26142687 refreshContents();
26152688 } else
2616
- if (event.getSource() == attachPigmentItem)
2689
+ if (source == attachPigmentItem)
26172690 {
26182691 String texture = GetFile("Attach pigment");
26192692 Object3D obj;
....@@ -2625,7 +2698,7 @@
26252698
26262699 refreshContents();
26272700 } else
2628
- if (event.getSource() == detachPigmentItem)
2701
+ if (source == detachPigmentItem)
26292702 {
26302703 Object3D obj;
26312704 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2636,7 +2709,7 @@
26362709
26372710 refreshContents();
26382711 } else
2639
- if (event.getSource() == attachBumpItem)
2712
+ if (source == attachBumpItem)
26402713 {
26412714 String texture = GetFile("Attach bump");
26422715 Object3D obj;
....@@ -2648,7 +2721,7 @@
26482721
26492722 refreshContents();
26502723 } else
2651
- if (event.getSource() == detachBumpItem)
2724
+ if (source == detachBumpItem)
26522725 {
26532726 Object3D obj;
26542727 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2659,7 +2732,7 @@
26592732
26602733 refreshContents();
26612734 } else
2662
- if (event.getSource() == pigmentBumpItem)
2735
+ if (source == pigmentBumpItem)
26632736 {
26642737 Object3D obj;
26652738 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2670,158 +2743,195 @@
26702743
26712744 refreshContents();
26722745 } else
2673
- if (event.getSource() == flashSelectionButton)
2746
+ if (source == flashSelectionButton)
26742747 {
26752748 CameraPane.flash = true;
26762749 refreshContents();
26772750 } else
2678
- if (event.getSource() == oneButton)
2751
+ if (source == oneButton)
26792752 {
26802753 } else
2681
- if (event.getSource() == twoButton)
2754
+ if (source == twoButton)
26822755 {
26832756 radio.layout = twoButton;
26842757 // bug
26852758 //gridPanel.setDividerLocation(1.0);
26862759 //bigPanel.setDividerLocation(0.0);
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
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2709
- //bigThree.add(XYZPanel, aWindowConstraints);
2710
- 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();
27112789 } else
2712
- if (event.getSource() == threeButton)
2790
+ if (source == threeButton)
27132791 {
27142792 radio.layout = threeButton;
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
- // aConstraints.gridheight = 3;
2722
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2723
- aWindowConstraints.weightx = 0;
2724
- aWindowConstraints.weighty = 1;
2725
- //bigThree.add(jtp, 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(centralPanel, aWindowConstraints);
2732
- aWindowConstraints.weightx = 0;
2733
- aWindowConstraints.gridx = 4;
2734
- aWindowConstraints.gridwidth = 1;
2735
- // aConstraints.gridheight = 3;
2736
- aConstraints.fill = GridBagConstraints.VERTICAL;
2737
- bigThree.add(XYZPanel, aWindowConstraints);
2738
- 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();
27392825 } else
2740
- if (event.getSource() == fourButton)
2826
+ if (source == fourButton)
27412827 {
27422828 radio.layout = fourButton;
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
- // aWindowConstraints.gridheight = 3;
2750
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2751
- aWindowConstraints.weightx = 1;
2752
- aWindowConstraints.weighty = 1;
2753
- bigThree.add(scenePanel, aWindowConstraints);
2754
- aWindowConstraints.weightx = 1;
2755
- aWindowConstraints.gridwidth = 3;
2756
- // aConstraints.gridheight = 3;
2757
- aWindowConstraints.gridx = 1;
2758
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2759
- //bigThree.add(cameraPanel, 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, aWindowConstraints);
2766
- 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();
27672860 } else
2768
- if (event.getSource() == sixButton)
2861
+ if (source == sixButton)
27692862 {
27702863 radio.layout = sixButton;
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
- // aConstraints.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
- // aWindowConstraints.gridheight = 3;
2792
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2793
- //bigThree.add(XYZPanel, aConstraints);
2794
- 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();
27952896 } else
2796
- if (event.getSource() == sevenButton)
2897
+ if (source == sevenButton)
27972898 {
27982899 radio.layout = sevenButton;
2799
- bigThree.remove(scenePanel);
2800
- bigThree.remove(centralPanel);
2801
- bigThree.remove(XYZPanel);
2802
- aWindowConstraints.gridx = 0;
2803
- aWindowConstraints.gridy = 0;
2804
- aWindowConstraints.gridwidth = 1;
2805
- // aWindowConstraints.gridheight = 3;
2806
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2807
- aWindowConstraints.weightx = 0;
2808
- aWindowConstraints.weighty = 1;
2809
- bigThree.add(scenePanel, aWindowConstraints);
2810
- aWindowConstraints.weightx = 1;
2811
- aWindowConstraints.gridwidth = 3;
2812
- // aWindowConstraints.gridheight = 3;
2813
- aWindowConstraints.gridx = 1;
2814
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2815
- bigThree.add(centralPanel, aWindowConstraints);
2816
- aWindowConstraints.weightx = 0;
2817
- aWindowConstraints.gridx = 4;
2818
- aWindowConstraints.gridwidth = 1;
2819
- // aConstraints.gridheight = 3;
2820
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2821
- bigThree.add(XYZPanel, aWindowConstraints);
2822
- 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();
28232933 } else
2824
- if (event.getSource() == rootButton)
2934
+ if (source == rootButton)
28252935 {
28262936 Object3D obj;
28272937 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2833,7 +2943,7 @@
28332943
28342944 refreshContents(true);
28352945 } else
2836
- if (event.getSource() == closeButton)
2946
+ if (source == closeButton)
28372947 {
28382948 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28392949 cRadio ab;
....@@ -2854,11 +2964,11 @@
28542964 }
28552965 refreshContents(true);
28562966 } else
2857
- if (event.getSource() == editItem || event.getSource() == editButton)
2967
+ if (source == editItem || source == editButton)
28582968 {
28592969 EditSelection(false);
28602970 } else
2861
- if (event.getSource() == uneditButton)
2971
+ if (source == uneditButton)
28622972 {
28632973 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28642974 {
....@@ -2870,12 +2980,12 @@
28702980
28712981 child.editWindow = null; // ???????????
28722982 }
2873
- objEditor.ctrlPanel.revalidate();
2983
+ objEditor.ctrlPanel.FlushUI();
28742984 //objEditor.jTree.clearSelection();
28752985 //objEditor.ResetSliders();
28762986 refreshContents(true);
28772987 } else
2878
- if (event.getSource() == clearPanelButton)
2988
+ if (source == clearPanelButton)
28792989 {
28802990 assert(copy == group);
28812991 //copy.ClearUI();
....@@ -2886,7 +2996,7 @@
28862996 listUI.clear();
28872997 refreshContents(true);
28882998 } else
2889
- if (event.getSource() == allParamsButton)
2999
+ if (source == allParamsButton)
28903000 {
28913001 assert(copy == group);
28923002
....@@ -2907,19 +3017,19 @@
29073017
29083018 refreshContents(true);
29093019 } else
2910
- if (event.getSource() == unselectButton)
3020
+ if (source == unselectButton)
29113021 {
29123022 objEditor.jTree.clearSelection();
29133023 // ?? oct 2012 GrafreeD.clipboard.clear();
29143024 objEditor.ResetSliders();
29153025 refreshContents(true);
29163026 } else
2917
- if(event.getSource() instanceof cRadio)
3027
+ if(source instanceof cRadio)
29183028 {
29193029 group.parent = keepparent;
29203030 group.attributes = 0;
29213031 //group.editWindow = null;
2922
- /*cRadio*/ radio = (cRadio)event.getSource();
3032
+ /*cRadio*/ radio = (cRadio)source;
29233033 Object3D obj = radio.GetObject();
29243034 System.out.println("Edit " + obj);
29253035 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -3589,11 +3699,11 @@
35893699
35903700 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35913701
3592
- boolean random = CameraPane.RANDOM;
3593
- CameraPane.RANDOM = false; // parse all random nodes
3702
+ boolean random = CameraPane.SWITCH;
3703
+ CameraPane.SWITCH = false; // parse all random nodes
35943704 lowres.linkVerticesThis(null);
35953705 lowres.linkVerticesThis(sn);
3596
- CameraPane.RANDOM = random;
3706
+ CameraPane.SWITCH = random;
35973707
35983708 System.err.flush();
35993709
....@@ -4078,12 +4188,12 @@
40784188 System.err.println("info : " + child.GetPath());
40794189 }
40804190 }
4081
- else
4082
- {
4083
- objEditor.SetMaterial(group); // .GetMaterial());
4084
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4085
- System.err.println("info : " + group.GetPath());
4086
- }
4191
+// else
4192
+// {
4193
+// objEditor.SetMaterial(group); // .GetMaterial());
4194
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4195
+// System.err.println("info : " + group.GetPath());
4196
+// }
40874197
40884198 objEditor.SetText(); // jan 2014
40894199
....@@ -4351,7 +4461,7 @@
43514461 refreshContents();
43524462 }
43534463
4354
- void pasteInto(boolean copyit)
4464
+ void pasteInto(boolean copyit, boolean clone)
43554465 {
43564466 // if (GrafreeD.clipboard == null)
43574467 // return;
....@@ -4380,7 +4490,14 @@
43804490 if (copyit)
43814491 {
43824492 // paste(false);
4383
- CloneClipboard(false); // sept 2014
4493
+ if (clone)
4494
+ {
4495
+ CloneClipboard(false); // sept 2014
4496
+ }
4497
+ else
4498
+ {
4499
+ paste(false);
4500
+ }
43844501 }
43854502 else
43864503 {
....@@ -4924,10 +5041,12 @@
49245041 cButton flashSelectionButton;
49255042 cButton editButton;
49265043 cButton uneditButton;
5044
+ JCheckBox allParamsButton;
49275045 cButton clearpanelButton;
4928
- cButton allParamsButton;
49295046 cButton unselectButton;
49305047
5048
+ cButton oneStepButton;
5049
+
49315050 cButton screenfitButton;
49325051 cButton screenfitpointButton;
49335052 cButton snapobjectButton;
....@@ -4982,6 +5101,7 @@
49825101 private MenuItem mergeGeometriesItem;
49835102 private MenuItem copyItem;
49845103 private MenuItem pasteItem;
5104
+ private MenuItem pasteIntoItem;
49855105 private MenuItem pasteLinkItem;
49865106 private MenuItem pasteCloneItem;
49875107 private MenuItem pasteExpandItem;
....@@ -5079,7 +5199,7 @@
50795199 private MenuItem blobItem;
50805200 private MenuItem latheItem;
50815201 private MenuItem bezierItem;
5082
- private MenuItem checkerItem;
5202
+ private MenuItem overlayItem;
50835203 private MenuItem meshItem;
50845204 // private MenuItem meshGroupItem;
50855205 private MenuItem springItem;