Normand Briere
2019-05-05 631719825b865aaf9fa1cb124d9fc5bd9dd78bd4
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 {
....@@ -897,7 +940,9 @@
897940 // objEditor.DropFile((java.io.File[]) object, true);
898941 // return;
899942 // }
900
- if (string.charAt(0) == '/')
943
+
944
+ // File path for Mac and Windows
945
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
901946 {
902947 // file(s)
903948 String[] names = string.split("\n");
....@@ -924,7 +969,7 @@
924969
925970 flashIt = false;
926971 CameraPane pane = (CameraPane) target;
927
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
972
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
928973 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
929974
930975 if (group.selection.size() == 1)
....@@ -951,11 +996,11 @@
951996 {
952997 loadClipboard(true);
953998 objEditor.jTree.setSelectionPath(destinationPath);
954
- pasteInto(false);
999
+ pasteInto(false, false);
9551000 } else {
9561001 loadClipboard(false);
9571002 objEditor.jTree.setSelectionPath(destinationPath);
958
- pasteInto(false); // true); // ???
1003
+ pasteInto(false, false); // true); // ???
9591004 }
9601005 }
9611006 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1077,27 +1122,33 @@
10771122 kleinItem.addActionListener(this);
10781123 particleItem = menu.add(new MenuItem("Particle system"));
10791124 particleItem.addActionListener(this);
1125
+ if (Globals.ADVANCED)
1126
+ {
10801127 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10811128 ragdollItem.addActionListener(this);
10821129 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10831130 ragdoll2Item.addActionListener(this);
1131
+ }
10841132 menu.add("-");
1085
- meshItem = menu.add(new MenuItem("Mesh"));
1133
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10861134 meshItem.addActionListener(this);
10871135 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10881136 // meshGroupItem.addActionListener(this);
1137
+ if (Globals.ADVANCED)
1138
+ {
10891139 springItem = menu.add(new MenuItem("Spring"));
10901140 springItem.addActionListener(this);
10911141 flagItem = menu.add(new MenuItem("Flag"));
10921142 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);
10971143 blobItem = menu.add(new MenuItem("Blob"));
10981144 blobItem.addActionListener(this);
10991145 latheItem = menu.add(new MenuItem("Lathe"));
11001146 latheItem.addActionListener(this);
1147
+ }
1148
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1149
+ bezierItem.addActionListener(this);
1150
+ overlayItem = menu.add(new MenuItem("Overlay"));
1151
+ overlayItem.addActionListener(this);
11011152 lightItem = menu.add(new MenuItem("Light"));
11021153 lightItem.addActionListener(this);
11031154 menu.add("-");
....@@ -1107,34 +1158,39 @@
11071158 loopItem.addActionListener(this);
11081159 doubleItem = menu.add(new MenuItem("Fork"));
11091160 doubleItem.addActionListener(this);
1161
+ if (Globals.ADVANCED)
1162
+ {
11101163 tripleItem = menu.add(new MenuItem("Trident"));
11111164 tripleItem.addActionListener(this);
1165
+ }
11121166 }
11131167
11141168 void buildToolsMenu(Menu menu)
11151169 {
11161170 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11171171 animationItem.addItemListener(this);
1118
- animationItem.setState(CameraPane.ANIMATION);
1172
+ animationItem.setState(Globals.ANIMATION);
11191173
11201174 menu.add("-");
11211175 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11221176 parseverticesItem.addActionListener(this);
11231177 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11241178 textureFieldItem.addActionListener(this);
1125
- alignItem = menu.add(new MenuItem("Align"));
1179
+ alignItem = menu.add(new MenuItem("Align Objects"));
11261180 alignItem.addActionListener(this);
1127
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1128
- mirrorItem.addActionListener(this);
11291181 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11301182 reduceMorphItem.addActionListener(this);
11311183 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11321184 reduce34MorphItem.addActionListener(this);
1133
-
1185
+ menu.add("-");
11341186 menu.add(computeAOItem = new MenuItem("Compute AO"));
11351187 computeAOItem.addActionListener(this);
1136
- menu.add("-");
11371188
1189
+ if (Globals.ADVANCED)
1190
+ {
1191
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1192
+ mirrorItem.addActionListener(this);
1193
+ menu.add("-");
11381194 menu.add(memoryItem = new MenuItem("Memory Usage"));
11391195 memoryItem.addActionListener(this);
11401196 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1157,6 +1213,7 @@
11571213 menu.add("-");
11581214 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11591215 editScriptItem.addActionListener(this);
1216
+ }
11601217 }
11611218
11621219 void ScreenFit()
....@@ -1510,6 +1567,7 @@
15101567 //
15111568 public void actionPerformed(ActionEvent event) // , Object arg)
15121569 {
1570
+ Object source = event.getSource();
15131571 /*
15141572 if (event.getSource() == nameField)
15151573 {
....@@ -1521,11 +1579,11 @@
15211579 }
15221580 else
15231581 */
1524
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1582
+ if (source == lookAtItem || source == lookFromItem)
15251583 {
15261584 ScreenFit();
15271585 } else
1528
- if (event.getSource() == switchItem)
1586
+ if (source == switchItem)
15291587 {
15301588 cVector v1 = new cVector();
15311589 cVector v2 = new cVector();
....@@ -1534,11 +1592,11 @@
15341592 objEditor.cameraView.renderCamera.setAim(v2, v1);
15351593 objEditor.cameraView.repaint();
15361594 } else
1537
- if (event.getSource() == rectoidItem)
1595
+ if (source == rectoidItem)
15381596 {
15391597 makeSomething(new Box());
15401598 } else
1541
- if (event.getSource() == particleItem)
1599
+ if (source == particleItem)
15421600 {
15431601 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15441602 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1559,9 +1617,9 @@
15591617 applyExample(particleGeom, "SMOKE");
15601618 makeSomething(particleGeom);
15611619 } else
1562
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1620
+ if (source == ragdollItem || source == ragdoll2Item)
15631621 {
1564
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1622
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15651623
15661624 ragdoll.toParent = LA.newMatrix();
15671625 ragdoll.fromParent = LA.newMatrix();
....@@ -1579,7 +1637,7 @@
15791637 } else
15801638 /*
15811639 */
1582
- if (event.getSource() == heightFieldItem)
1640
+ if (source == heightFieldItem)
15831641 {
15841642 Object3D obj = new Object3D();
15851643
....@@ -1617,31 +1675,31 @@
16171675
16181676 makeSomething(obj);
16191677 } else
1620
- if (event.getSource() == gridItem)
1678
+ if (source == gridItem)
16211679 {
16221680 makeSomething(new Grid());
16231681 } else
1624
- if (event.getSource() == ellipsoidItem)
1682
+ if (source == ellipsoidItem)
16251683 {
16261684 makeSomething(new Sphere());
16271685 } else
1628
- if (event.getSource() == coneItem)
1686
+ if (source == coneItem)
16291687 {
16301688 makeSomething(new Cone());
16311689 } else
1632
- if (event.getSource() == torusItem)
1690
+ if (source == torusItem)
16331691 {
16341692 makeSomething(new Torus());
16351693 } else
1636
- if (event.getSource() == superItem)
1694
+ if (source == superItem)
16371695 {
16381696 makeSomething(new Superellipsoid());
16391697 } else
1640
- if (event.getSource() == kleinItem)
1698
+ if (source == kleinItem)
16411699 {
16421700 makeSomething(new Klein());
16431701 } else
1644
- if (event.getSource() == blobItem)
1702
+ if (source == blobItem)
16451703 {
16461704 Blob blob = new Blob();
16471705 BlobComponent comp = new BlobComponent();
....@@ -1649,15 +1707,15 @@
16491707 //blob.retile();
16501708 makeSomething(blob);
16511709 } else
1652
- if (event.getSource() == latheItem)
1710
+ if (source == latheItem)
16531711 {
16541712 makeSomething(new Lathe());
16551713 } else
1656
- if (event.getSource() == bezierItem)
1714
+ if (source == bezierItem)
16571715 {
16581716 makeSomething(new BezierSurface());
16591717 } else
1660
- if (event.getSource() == checkerItem)
1718
+ if (source == overlayItem)
16611719 {
16621720 /*
16631721 Object3D obj = new BezierSurface(5,8);
....@@ -1672,7 +1730,7 @@
16721730 */
16731731 makeSomething(new Checker());
16741732 } else
1675
- if (event.getSource() == meshItem)
1733
+ if (source == meshItem)
16761734 {
16771735 Object3D itemtomake = new Object3D();
16781736 Object3D child;
....@@ -1693,35 +1751,35 @@
16931751 makeSomething(child);
16941752 }
16951753 } else
1696
- if (event.getSource() == springItem)
1754
+ if (source == springItem)
16971755 {
16981756 cSpring s = new cSpring();
16991757 s.setup();
17001758 makeSomething(s);
17011759 } else
1702
- if (event.getSource() == flagItem)
1760
+ if (source == flagItem)
17031761 {
17041762 cSpring s = new cFlag();
17051763 s.setup();
17061764 makeSomething(s);
17071765 } else
1708
- if (event.getSource() == lightItem)
1766
+ if (source == lightItem)
17091767 {
17101768 makeSomething(new Light());
17111769 } else
1712
- if (event.getSource() == csgItem)
1770
+ if (source == csgItem)
17131771 {
17141772 group(new CSG());
17151773 } else
1716
- if (event.getSource() == templateItem)
1774
+ if (source == templateItem)
17171775 {
17181776 group(new cTemplate());
17191777 } else
1720
- if (event.getSource() == attributeItem)
1778
+ if (source == attributeItem)
17211779 {
17221780 makeSomething(new Attribute());
17231781 } else
1724
- if (event.getSource() == pointflowItem)
1782
+ if (source == pointflowItem)
17251783 {
17261784 makeSomething(new PointFlow());
17271785 } else
....@@ -1733,7 +1791,7 @@
17331791 } else
17341792 */
17351793
1736
- if (event.getSource() == superLoopItem)
1794
+ if (source == superLoopItem)
17371795 {
17381796 Composite g = new cGroup();
17391797 for (int i=0; i<15; i++)
....@@ -1755,7 +1813,7 @@
17551813
17561814 group(g);
17571815 } else
1758
- if (event.getSource() == loopItem)
1816
+ if (source == loopItem)
17591817 {
17601818 Composite csg = new GroupLeaf();
17611819 csg.count = 5;
....@@ -1764,7 +1822,7 @@
17641822 csg.addChild(child);
17651823 child.addChild(csg);
17661824 } else
1767
- if (event.getSource() == doubleItem)
1825
+ if (source == doubleItem)
17681826 {
17691827 Composite csg = new GroupLeaf();
17701828 csg.count = 5;
....@@ -1776,7 +1834,7 @@
17761834 csg.addChild(child);
17771835 child.addChild(csg);
17781836 } else
1779
- if (event.getSource() == tripleItem)
1837
+ if (source == tripleItem)
17801838 {
17811839 Composite csg = new GroupLeaf();
17821840 csg.count = 4;
....@@ -1792,70 +1850,83 @@
17921850 child.addChild(csg);
17931851 } else
17941852
1795
- if (event.getSource() == importGFDItem)
1853
+ if (source == importGFDItem)
17961854 {
17971855 ImportGFD();
17981856 } else
1799
- if (event.getSource() == importVRMLX3DItem)
1857
+ if (source == importVRMLX3DItem)
18001858 {
18011859 ImportVRMLX3D();
18021860 } else
1803
- if (event.getSource() == import3DSItem)
1861
+ if (source == import3DSItem)
18041862 {
18051863 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
18061864 } else
1807
- if (event.getSource() == importOBJItem)
1865
+ if (source == importOBJItem)
18081866 {
1809
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1867
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1868
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1869
+ browser.setVisible(true);
1870
+ String filename = browser.getFile();
1871
+ if (filename != null && filename.length() > 0)
1872
+ {
1873
+ String fullname = browser.getDirectory() + filename;
1874
+ makeSomething(ReadOBJ(fullname), true);
1875
+ }
18101876 } else
1811
- if (event.getSource() == computeAOItem)
1877
+ if (source == computeAOItem)
18121878 {
18131879 Globals.drawMode = CameraPane.OCCLUSION;
18141880 Globals.theRenderer.repaint();
18151881 } else
1816
- if (event.getSource() == recompileItem)
1882
+ if (source == recompileItem)
18171883 {
18181884 Recompile();
18191885 refreshContents();
18201886 } else
1821
- if (event.getSource() == editScriptItem)
1887
+ if (source == editScriptItem)
18221888 {
18231889 OpenDialog();
18241890 refreshContents();
18251891 } else
1826
- if (event.getSource() == invariantsItem)
1892
+ if (source == invariantsItem)
18271893 {
18281894 System.out.println("Invariants:");
18291895 GrafreeD.grafreeD.universe.invariants();
18301896 } else
1831
- if (event.getSource() == memoryItem)
1897
+ if (source == memoryItem)
18321898 {
18331899 //System.out.println("Invariants:");
18341900 PrintMemory();
18351901 } else
1836
- if (event.getSource() == pathItem)
1902
+ if (source == pathItem)
18371903 {
18381904 PrintPath();
18391905 } else
1840
- if (event.getSource() == analyzeItem)
1906
+ if (source == analyzeItem)
18411907 {
18421908 AnalyzeObject();
18431909 } else
1844
- if (event.getSource() == dumpItem)
1910
+ if (source == dumpItem)
18451911 {
18461912 DumpObject();
18471913 } else
1848
- if (event.getSource() == screenfitButton)
1914
+ if (source == oneStepButton)
1915
+ {
1916
+ Globals.ONESTEP = true;
1917
+ cameraView.repaint();
1918
+ } else
1919
+ if (source == screenfitButton)
18491920 {
18501921 //Reload(lastConverter, lastFilename, true);
18511922 ScreenFit();
18521923 } else
1853
- if (event.getSource() == screenfitpointButton)
1924
+ if (source == screenfitpointButton)
18541925 {
18551926 //Reload(lastConverter, lastFilename, true);
18561927 ScreenFitPoint();
18571928 } else
1858
- if (event.getSource() == snapobjectButton)
1929
+ if (source == snapobjectButton)
18591930 {
18601931 //Reload(lastConverter, lastFilename, true);
18611932 SnapObject();
....@@ -1866,13 +1937,13 @@
18661937 // Recompile();
18671938 // refreshContents();
18681939 // } else
1869
- if (event.getSource() == gcButton)
1940
+ if (source == gcButton)
18701941 {
18711942 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18721943 System.gc();
18731944 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18741945 } else
1875
- if (event.getSource() == editLeafItem)
1946
+ if (source == editLeafItem)
18761947 {
18771948 Object3D obj;
18781949 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1886,62 +1957,66 @@
18861957 }
18871958 refreshContents(true);
18881959 } else
1889
- if (event.getSource() == openWindowItem)
1960
+ if (source == openWindowItem)
18901961 {
18911962 EditSelection(true);
18921963 } else
1893
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1964
+ if (source == cutItem || source == clearButton)
18941965 {
18951966 loadClipboard(true);
18961967 } else
1897
- if (event.getSource() == duplicateItem)
1968
+ if (source == duplicateItem)
18981969 {
18991970 Object3D keep = GrafreeD.clipboard;
19001971 loadClipboard(false);
19011972 paste(false);
19021973 GrafreeD.clipboard = keep;
19031974 } else
1904
- if (event.getSource() == cloneItem)
1975
+ if (source == cloneItem)
19051976 {
19061977 CloneSelection(false);
19071978 } else
1908
- if (event.getSource() == cloneSupportItem)
1979
+ if (source == cloneSupportItem)
19091980 {
19101981 CloneSelection(true);
19111982 } else
1912
- if (event.getSource() == copyItem)
1983
+ if (source == copyItem)
19131984 {
19141985 loadClipboard(false);
19151986 } else
1916
- if (event.getSource() == pasteItem)
1987
+ if (source == pasteItem)
19171988 {
19181989 paste(false);
19191990 } else
1920
- if (event.getSource() == pasteLinkItem)
1991
+ if (source == pasteIntoItem)
19211992 {
1922
- pasteInto(false);
1993
+ pasteInto(true, false);
19231994 } else
1924
- if (event.getSource() == pasteCloneItem)
1995
+ if (source == pasteLinkItem)
19251996 {
1926
- pasteInto(true);
1997
+ pasteInto(false, false);
19271998 } else
1928
- if (event.getSource() == pasteExpandItem)
1999
+ if (source == pasteCloneItem)
2000
+ {
2001
+ pasteInto(true, true);
2002
+ } else
2003
+ if (source == pasteExpandItem)
19292004 {
19302005 paste(true);
19312006 } else
1932
- if (event.getSource() == synchronizeItem)
2007
+ if (source == synchronizeItem)
19332008 {
19342009 Overwrite(Object3D.TRANSFORM);
19352010 } else
1936
- if (event.getSource() == overwriteNameItem)
2011
+ if (source == overwriteNameItem)
19372012 {
19382013 Overwrite(Object3D.NAME);
19392014 } else
1940
- if (event.getSource() == overwriteUVItem)
2015
+ if (source == overwriteUVItem)
19412016 {
19422017 Overwrite(Object3D.UV);
19432018 } else
1944
- if (event.getSource() == overwriteMatItem)
2019
+ if (source == overwriteMatItem)
19452020 {
19462021 /* july 2015
19472022 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1961,7 +2036,7 @@
19612036
19622037 Overwrite(dropAttributes);
19632038 }
1964
- if (event.getSource() == overwriteGeoItem)
2039
+ if (source == overwriteGeoItem)
19652040 {
19662041 Overwrite(Object3D.GEOMETRY);
19672042 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1978,7 +2053,7 @@
19782053 // refreshContents();
19792054 // }
19802055 } else
1981
- if (event.getSource() == generateMeshItem)
2056
+ if (source == generateMeshItem)
19822057 {
19832058 //if (group.selection.size() == 1)
19842059 // for (int i=0; i<group.selection.size(); i++)
....@@ -1989,7 +2064,7 @@
19892064 ResetModel();
19902065 refreshContents();
19912066 } else
1992
- if (event.getSource() == extractGeometriesItem)
2067
+ if (source == extractGeometriesItem)
19932068 {
19942069 boolean one = false;
19952070
....@@ -2016,7 +2091,7 @@
20162091 ResetModel();
20172092 refreshContents();
20182093 } else
2019
- if (event.getSource() == cloneGeometriesItem)
2094
+ if (source == cloneGeometriesItem)
20202095 {
20212096 boolean one = false;
20222097
....@@ -2042,7 +2117,7 @@
20422117 ResetModel();
20432118 refreshContents();
20442119 } else
2045
- if (event.getSource() == shareGeometriesItem)
2120
+ if (source == shareGeometriesItem)
20462121 {
20472122 boolean one = false;
20482123
....@@ -2072,7 +2147,7 @@
20722147 refreshContents();
20732148 }
20742149 } else
2075
- if (event.getSource() == mergeGeometriesItem)
2150
+ if (source == mergeGeometriesItem)
20762151 {
20772152 boolean one = false;
20782153
....@@ -2102,7 +2177,7 @@
21022177 ResetModel();
21032178 refreshContents();
21042179 } else
2105
- if (event.getSource() == linkverticesItem)
2180
+ if (source == linkverticesItem)
21062181 {
21072182 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21082183 // {
....@@ -2125,38 +2200,38 @@
21252200 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21262201 for (int i=0; i<group.selection.size(); i++)
21272202 {
2128
- boolean random = CameraPane.RANDOM;
2129
- CameraPane.RANDOM = false; // parse all random nodes
2203
+ boolean random = CameraPane.SWITCH;
2204
+ CameraPane.SWITCH = false; // parse all random nodes
21302205 group.selection.get(i).linkVerticesThis(content);
21312206 // group.selection.get(i).setMasterThis(content); // should be identity
2132
- CameraPane.RANDOM = random;
2207
+ CameraPane.SWITCH = random;
21332208 }
21342209 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21352210 refreshContents();
21362211 }
21372212 } else
2138
- if (event.getSource() == resetsupportItem)
2213
+ if (source == resetsupportItem)
21392214 {
21402215 for (int i=0; i<group.selection.size(); i++)
21412216 {
2142
- boolean random = CameraPane.RANDOM;
2143
- CameraPane.RANDOM = false; // parse all random nodes
2217
+ boolean random = CameraPane.SWITCH;
2218
+ CameraPane.SWITCH = false; // parse all random nodes
21442219 group.selection.get(i).linkVerticesThis(null);
2145
- CameraPane.RANDOM = random;
2220
+ CameraPane.SWITCH = random;
21462221 }
21472222
21482223 refreshContents();
21492224 } else
2150
- if (event.getSource() == relinkverticesItem)
2225
+ if (source == relinkverticesItem)
21512226 {
2152
- boolean random = CameraPane.RANDOM;
2153
- CameraPane.RANDOM = false; // parse all random nodes
2227
+ boolean random = CameraPane.SWITCH;
2228
+ CameraPane.SWITCH = false; // parse all random nodes
21542229 group.selection.RelinkToSupport();
2155
- CameraPane.RANDOM = random;
2230
+ CameraPane.SWITCH = random;
21562231
21572232 refreshContents();
21582233 } else
2159
- if (event.getSource() == resetreferencesItem)
2234
+ if (source == resetreferencesItem)
21602235 {
21612236 for (int i=0; i<group.selection.size(); i++)
21622237 {
....@@ -2165,7 +2240,7 @@
21652240
21662241 refreshContents();
21672242 } else
2168
- if (event.getSource() == setMasterItem)
2243
+ if (source == setMasterItem)
21692244 {
21702245 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21712246 {
....@@ -2178,7 +2253,7 @@
21782253 refreshContents();
21792254 }
21802255 } else
2181
- if (event.getSource() == poseMeshItem)
2256
+ if (source == poseMeshItem)
21822257 {
21832258 if (group.selection.size() == 1)
21842259 {
....@@ -2197,19 +2272,19 @@
21972272 }
21982273
21992274 } else
2200
- if (event.getSource() == revertMeshItem)
2275
+ if (source == revertMeshItem)
22012276 {
22022277 RevertMeshes();
22032278 } else
2204
- if (event.getSource() == resetMeshItem)
2279
+ if (source == resetMeshItem)
22052280 {
22062281 ResetAll();
22072282 } else
2208
- if (event.getSource() == stepAllItem)
2283
+ if (source == stepAllItem)
22092284 {
22102285 StepAll();
22112286 } else
2212
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2287
+ if (source == clearItem) // || event.getSource() == clearButton)
22132288 {
22142289 //int indices[] = jList.getSelectedIndices();
22152290 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2217,46 +2292,46 @@
22172292
22182293 ClearSelection(false);
22192294 } else
2220
- if (event.getSource() == clearAllItem)
2295
+ if (source == clearAllItem)
22212296 {
22222297 ClearSelection(true);
22232298 } else
2224
- if (event.getSource() == grabItem)
2299
+ if (source == grabItem)
22252300 {
22262301 group(new cGroup(), true);
22272302 } else
2228
- if (event.getSource() == hideItem)
2303
+ if (source == hideItem)
22292304 {
22302305 group(new HiddenObject());
22312306 } else
2232
- if (event.getSource() == frontItem)
2307
+ if (source == frontItem)
22332308 {
22342309 front();
22352310 } else
2236
- if (event.getSource() == backItem)
2311
+ if (source == backItem)
22372312 {
22382313 back();
22392314 } else
2240
- if (event.getSource() == cameraItem)
2315
+ if (source == cameraItem)
22412316 {
22422317 makeSomething(new Camera());
22432318 } else
2244
- if (event.getSource() == compositeItem)
2319
+ if (source == compositeItem)
22452320 {
22462321 group(new Composite());
22472322 } else
2248
- if (event.getSource() == randomItem)
2323
+ if (source == randomItem)
22492324 {
22502325 RandomNode random = new RandomNode();
22512326 group(random);
22522327 if (random.size() > 0)
2253
- random.name = random.get(0).name + "Rnd";
2328
+ random.name = random.get(0).name + "Switch";
22542329 } else
2255
- if (event.getSource() == physicsItem)
2330
+ if (source == physicsItem)
22562331 {
22572332 group(new PhysicsNode());
22582333 } else
2259
- if (event.getSource() == frameselectorItem)
2334
+ if (source == frameselectorItem)
22602335 {
22612336 for (int i=0; i<group.selection.size(); i++)
22622337 {
....@@ -2268,7 +2343,7 @@
22682343 ResetModel();
22692344 refreshContents();
22702345 } else
2271
- if (event.getSource() == switchGeoItem)
2346
+ if (source == switchGeoItem)
22722347 {
22732348 for (int i=0; i<group.selection.size(); i++)
22742349 {
....@@ -2280,7 +2355,7 @@
22802355 ResetModel();
22812356 refreshContents();
22822357 } else
2283
- if (event.getSource() == switchTransfoItem)
2358
+ if (source == switchTransfoItem)
22842359 {
22852360 for (int i=0; i<group.selection.size(); i++)
22862361 {
....@@ -2292,7 +2367,7 @@
22922367 ResetModel();
22932368 refreshContents();
22942369 } else
2295
- if (event.getSource() == morphItem)
2370
+ if (source == morphItem)
22962371 {
22972372 for (int i=0; i<group.selection.size(); i++)
22982373 {
....@@ -2304,7 +2379,7 @@
23042379 ResetModel();
23052380 refreshContents();
23062381 } else
2307
- if (event.getSource() == scriptNodeItem)
2382
+ if (source == scriptNodeItem)
23082383 {
23092384 boolean atleastone = false;
23102385
....@@ -2343,31 +2418,31 @@
23432418 }
23442419 }
23452420 } else
2346
- if (event.getSource() == linkerItem)
2421
+ if (source == linkerItem)
23472422 {
23482423 group(new cLinker());
23492424 } else
2350
- if (event.getSource() == textureItem)
2425
+ if (source == textureItem)
23512426 {
23522427 group(new TextureNode());
23532428 } else
2354
- if (event.getSource() == billboardItem)
2429
+ if (source == billboardItem)
23552430 {
23562431 group(new BillboardNode());
23572432 } else
2358
- if (event.getSource() == shadowXItem)
2433
+ if (source == shadowXItem)
23592434 {
23602435 CastShadow(0);
23612436 } else
2362
- if (event.getSource() == shadowYItem)
2437
+ if (source == shadowYItem)
23632438 {
23642439 CastShadow(1);
23652440 } else
2366
- if (event.getSource() == shadowZItem)
2441
+ if (source == shadowZItem)
23672442 {
23682443 CastShadow(2);
23692444 } else
2370
- if (event.getSource() == ungroupItem)
2445
+ if (source == ungroupItem)
23712446 {
23722447 //ungroup();
23732448 for (int i=0; i<group.selection.size(); i++)
....@@ -2379,179 +2454,179 @@
23792454
23802455 refreshContents();
23812456 } else
2382
- if (event.getSource() == genUVItem)
2457
+ if (source == genUVItem)
23832458 {
23842459 GenUV();
23852460 } else
2386
- if (event.getSource() == genNormalsCADItem)
2461
+ if (source == genNormalsCADItem)
23872462 {
23882463 GenNormals(true);
23892464 } else
2390
- if (event.getSource() == genNormalsMESHItem)
2465
+ if (source == genNormalsMESHItem)
23912466 {
23922467 GenNormals(true); // TODO
23932468 } else
2394
- if (event.getSource() == genNormalsORGANItem)
2469
+ if (source == genNormalsORGANItem)
23952470 {
23962471 GenNormals(false);
23972472 } else
2398
- if (event.getSource() == genNormalsMINEItem)
2473
+ if (source == genNormalsMINEItem)
23992474 {
24002475 GenNormalsMINE();
24012476 } else
2402
- if (event.getSource() == stripifyItem)
2477
+ if (source == stripifyItem)
24032478 {
24042479 Stripify();
24052480 } else
2406
- if (event.getSource() == unstripifyItem)
2481
+ if (source == unstripifyItem)
24072482 {
24082483 Unstripify();
24092484 } else
2410
- if (event.getSource() == trimItem)
2485
+ if (source == trimItem)
24112486 {
24122487 Trim();
24132488 } else
2414
- if (event.getSource() == untrimItem)
2489
+ if (source == untrimItem)
24152490 {
24162491 Untrim();
24172492 } else
2418
- if (event.getSource() == clearColorsItem)
2493
+ if (source == clearColorsItem)
24192494 {
24202495 ClearColors();
24212496 } else
2422
- if (event.getSource() == clearMaterialsItem)
2497
+ if (source == clearMaterialsItem)
24232498 {
24242499 ClearMaterials();
24252500 } else
2426
- if (event.getSource() == liveleavesItem)
2501
+ if (source == liveleavesItem)
24272502 {
24282503 LiveLeaves(true);
24292504 } else
2430
- if (event.getSource() == unliveleavesItem)
2505
+ if (source == unliveleavesItem)
24312506 {
24322507 LiveLeaves(false);
24332508 } else
2434
- if (event.getSource() == supportleavesItem)
2509
+ if (source == supportleavesItem)
24352510 {
24362511 SupportLeaves(true);
24372512 } else
2438
- if (event.getSource() == unsupportleavesItem)
2513
+ if (source == unsupportleavesItem)
24392514 {
24402515 SupportLeaves(false);
24412516 } else
2442
- if (event.getSource() == hideleavesItem)
2517
+ if (source == hideleavesItem)
24432518 {
24442519 HideLeaves(true);
24452520 } else
2446
- if (event.getSource() == showleavesItem)
2521
+ if (source == showleavesItem)
24472522 {
24482523 HideLeaves(false);
24492524 } else
2450
- if (event.getSource() == markleavesItem)
2525
+ if (source == markleavesItem)
24512526 {
24522527 MarkLeaves(true);
24532528 } else
2454
- if (event.getSource() == unmarkleavesItem)
2529
+ if (source == unmarkleavesItem)
24552530 {
24562531 MarkLeaves(false);
24572532 } else
2458
- if (event.getSource() == flipVItem)
2533
+ if (source == flipVItem)
24592534 {
24602535 FlipV(true);
24612536 } else
2462
- if (event.getSource() == unflipVItem)
2537
+ if (source == unflipVItem)
24632538 {
24642539 FlipV(false);
24652540 } else
2466
- if (event.getSource() == lowTexturesItem)
2541
+ if (source == lowTexturesItem)
24672542 {
24682543 SetTexRes(0);
24692544 } else
2470
- if (event.getSource() == normalTexturesItem)
2545
+ if (source == normalTexturesItem)
24712546 {
24722547 SetTexRes(1);
24732548 } else
2474
- if (event.getSource() == highTexturesItem)
2549
+ if (source == highTexturesItem)
24752550 {
24762551 SetTexRes(2);
24772552 } else
2478
- if (event.getSource() == veryhighTexturesItem)
2553
+ if (source == veryhighTexturesItem)
24792554 {
24802555 SetTexRes(3);
24812556 } else
2482
- if (event.getSource() == maxTexturesItem)
2557
+ if (source == maxTexturesItem)
24832558 {
24842559 SetTexRes(4);
24852560 } else
2486
- if (event.getSource() == panoTexturesItem)
2561
+ if (source == panoTexturesItem)
24872562 {
24882563 SetTexRes(5);
24892564 } else
2490
- if (event.getSource() == reverseNormalsItem)
2565
+ if (source == reverseNormalsItem)
24912566 {
24922567 ReverseNormals();
24932568 } else
2494
- if (event.getSource() == parseverticesItem)
2569
+ if (source == parseverticesItem)
24952570 {
24962571 ParseVertices();
24972572 } else
2498
- if (event.getSource() == textureFieldItem)
2573
+ if (source == textureFieldItem)
24992574 {
25002575 TextureVertices();
25012576 } else
2502
- if (event.getSource() == alignItem)
2577
+ if (source == alignItem)
25032578 {
25042579 Align();
25052580 } else
2506
- if (event.getSource() == mirrorItem)
2581
+ if (source == mirrorItem)
25072582 {
25082583 MirrorPoses();
25092584 } else
2510
- if (event.getSource() == reduceMorphItem)
2585
+ if (source == reduceMorphItem)
25112586 {
25122587 MeshReduction(false);
25132588 } else
2514
- if (event.getSource() == reduce34MorphItem)
2589
+ if (source == reduce34MorphItem)
25152590 {
25162591 MeshReduction(true);
25172592 } else
2518
- if (event.getSource() == reverseTrianglesItem)
2593
+ if (source == reverseTrianglesItem)
25192594 {
25202595 ReverseTriangles();
25212596 } else
2522
- if (event.getSource() == reduceMeshItem)
2597
+ if (source == reduceMeshItem)
25232598 {
25242599 ReduceMesh(false);
25252600 } else
2526
- if (event.getSource() == reduce34MeshItem)
2601
+ if (source == reduce34MeshItem)
25272602 {
25282603 ReduceMesh(true);
25292604 } else
2530
- if (event.getSource() == increaseMeshItem)
2605
+ if (source == increaseMeshItem)
25312606 {
25322607 IncreaseMesh();
25332608 } else
2534
- if (event.getSource() == clipMeshItem)
2609
+ if (source == clipMeshItem)
25352610 {
25362611 ClipMesh();
25372612 } else
2538
- if (event.getSource() == smoothMeshItem)
2613
+ if (source == smoothMeshItem)
25392614 {
25402615 SmoothMesh();
25412616 } else
2542
- if (event.getSource() == transformgeometryItem)
2617
+ if (source == transformgeometryItem)
25432618 {
25442619 TransformGeometry();
25452620 } else
2546
- if (event.getSource() == resetTransformItem)
2621
+ if (source == resetTransformItem)
25472622 {
25482623 ResetTransform();
25492624 } else
2550
- if (event.getSource() == resetCentroidItem)
2625
+ if (source == resetCentroidItem)
25512626 {
25522627 ResetCentroid();
25532628 } else
2554
- if (event.getSource() == resetParentItem)
2629
+ if (source == resetParentItem)
25552630 {
25562631 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25572632 {
....@@ -2561,7 +2636,7 @@
25612636
25622637 refreshContents();
25632638 } else
2564
- if (event.getSource() == repairParentItem)
2639
+ if (source == repairParentItem)
25652640 {
25662641 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25672642 {
....@@ -2575,7 +2650,7 @@
25752650
25762651 refreshContents();
25772652 } else
2578
- if (event.getSource() == repairShadowItem)
2653
+ if (source == repairShadowItem)
25792654 {
25802655 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25812656 {
....@@ -2589,7 +2664,7 @@
25892664
25902665 refreshContents();
25912666 } else
2592
- if (event.getSource() == sortbysizeItem)
2667
+ if (source == sortbysizeItem)
25932668 {
25942669 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25952670 {
....@@ -2601,7 +2676,7 @@
26012676 ResetModel();
26022677 refreshContents();
26032678 } else
2604
- if (event.getSource() == sortbynameItem)
2679
+ if (source == sortbynameItem)
26052680 {
26062681 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26072682 {
....@@ -2613,7 +2688,7 @@
26132688 ResetModel();
26142689 refreshContents();
26152690 } else
2616
- if (event.getSource() == attachPigmentItem)
2691
+ if (source == attachPigmentItem)
26172692 {
26182693 String texture = GetFile("Attach pigment");
26192694 Object3D obj;
....@@ -2625,7 +2700,7 @@
26252700
26262701 refreshContents();
26272702 } else
2628
- if (event.getSource() == detachPigmentItem)
2703
+ if (source == detachPigmentItem)
26292704 {
26302705 Object3D obj;
26312706 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2636,7 +2711,7 @@
26362711
26372712 refreshContents();
26382713 } else
2639
- if (event.getSource() == attachBumpItem)
2714
+ if (source == attachBumpItem)
26402715 {
26412716 String texture = GetFile("Attach bump");
26422717 Object3D obj;
....@@ -2648,7 +2723,7 @@
26482723
26492724 refreshContents();
26502725 } else
2651
- if (event.getSource() == detachBumpItem)
2726
+ if (source == detachBumpItem)
26522727 {
26532728 Object3D obj;
26542729 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2659,7 +2734,7 @@
26592734
26602735 refreshContents();
26612736 } else
2662
- if (event.getSource() == pigmentBumpItem)
2737
+ if (source == pigmentBumpItem)
26632738 {
26642739 Object3D obj;
26652740 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2670,158 +2745,195 @@
26702745
26712746 refreshContents();
26722747 } else
2673
- if (event.getSource() == flashSelectionButton)
2748
+ if (source == flashSelectionButton)
26742749 {
26752750 CameraPane.flash = true;
26762751 refreshContents();
26772752 } else
2678
- if (event.getSource() == oneButton)
2753
+ if (source == oneButton)
26792754 {
26802755 } else
2681
- if (event.getSource() == twoButton)
2756
+ if (source == twoButton)
26822757 {
26832758 radio.layout = twoButton;
26842759 // bug
26852760 //gridPanel.setDividerLocation(1.0);
26862761 //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();
2762
+// bigThree.remove(scenePanel);
2763
+// bigThree.remove(centralPanel);
2764
+// bigThree.remove(XYZPanel);
2765
+// aWindowConstraints.gridx = 0;
2766
+// aWindowConstraints.gridy = 0;
2767
+// aWindowConstraints.gridwidth = 1;
2768
+// // aConstraints.gridheight = 3;
2769
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2770
+// aWindowConstraints.weightx = 0;
2771
+// aWindowConstraints.weighty = 1;
2772
+// //bigThree.add(jtp, aWindowConstraints);
2773
+// aWindowConstraints.weightx = 1;
2774
+// aWindowConstraints.gridwidth = 3;
2775
+// // aConstraints.gridheight = 3;
2776
+// aWindowConstraints.gridx = 1;
2777
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2778
+// bigThree.add(centralPanel, aWindowConstraints);
2779
+// aWindowConstraints.weightx = 0;
2780
+// aWindowConstraints.gridx = 4;
2781
+// aWindowConstraints.gridwidth = 1;
2782
+// // aConstraints.gridheight = 3;
2783
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2784
+// //bigThree.add(XYZPanel, aWindowConstraints);
2785
+// scenePanel.setVisible(false);
2786
+// centralPanel.setVisible(true);
2787
+// XYZPanel.setVisible(false);
2788
+ bigThree.ClearUI();
2789
+ bigThree.add(centralPanel);
2790
+ bigThree.FlushUI();
27112791 } else
2712
- if (event.getSource() == threeButton)
2792
+ if (source == threeButton)
27132793 {
27142794 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();
2795
+
2796
+// bigThree.remove(scenePanel);
2797
+// bigThree.remove(centralPanel);
2798
+// bigThree.remove(XYZPanel);
2799
+// aWindowConstraints.gridx = 0;
2800
+// aWindowConstraints.gridy = 0;
2801
+// aWindowConstraints.gridwidth = 1;
2802
+// // aConstraints.gridheight = 3;
2803
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2804
+// aWindowConstraints.weightx = 0;
2805
+// aWindowConstraints.weighty = 1;
2806
+// //bigThree.add(jtp, aWindowConstraints);
2807
+// aWindowConstraints.weightx = 1;
2808
+// aWindowConstraints.gridwidth = 3;
2809
+// // aConstraints.gridheight = 3;
2810
+// aWindowConstraints.gridx = 1;
2811
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2812
+// bigThree.add(centralPanel, aWindowConstraints);
2813
+// aWindowConstraints.weightx = 0;
2814
+// aWindowConstraints.gridx = 4;
2815
+// aWindowConstraints.gridwidth = 1;
2816
+// // aConstraints.gridheight = 3;
2817
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2818
+// bigThree.add(XYZPanel, aWindowConstraints);
2819
+// bigThree.validate();
2820
+// scenePanel.setVisible(false);
2821
+// centralPanel.setVisible(true);
2822
+// XYZPanel.setVisible(true);
2823
+ bigThree.ClearUI();
2824
+ bigThree.add(centralPanel);
2825
+ bigThree.add(XYZPanel);
2826
+ bigThree.FlushUI();
27392827 } else
2740
- if (event.getSource() == fourButton)
2828
+ if (source == fourButton)
27412829 {
27422830 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();
2831
+
2832
+// bigThree.remove(scenePanel);
2833
+// bigThree.remove(centralPanel);
2834
+// bigThree.remove(XYZPanel);
2835
+// aWindowConstraints.gridx = 0;
2836
+// aWindowConstraints.gridy = 0;
2837
+// aWindowConstraints.gridwidth = 1;
2838
+// // aWindowConstraints.gridheight = 3;
2839
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2840
+// aWindowConstraints.weightx = 1;
2841
+// aWindowConstraints.weighty = 1;
2842
+// bigThree.add(scenePanel, aWindowConstraints);
2843
+// aWindowConstraints.weightx = 1;
2844
+// aWindowConstraints.gridwidth = 3;
2845
+// // aConstraints.gridheight = 3;
2846
+// aWindowConstraints.gridx = 1;
2847
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2848
+// //bigThree.add(cameraPanel, aWindowConstraints);
2849
+// aWindowConstraints.weightx = 0;
2850
+// aWindowConstraints.gridx = 4;
2851
+// aWindowConstraints.gridwidth = 1;
2852
+// // aWindowConstraints.gridheight = 3;
2853
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2854
+// //bigThree.add(XYZPanel, aWindowConstraints);
2855
+// bigThree.validate();
2856
+// scenePanel.setVisible(true);
2857
+// centralPanel.setVisible(false);
2858
+// XYZPanel.setVisible(false);
2859
+ bigThree.ClearUI();
2860
+ bigThree.add(scenePanel);
2861
+ bigThree.FlushUI();
27672862 } else
2768
- if (event.getSource() == sixButton)
2863
+ if (source == sixButton)
27692864 {
27702865 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();
2866
+
2867
+// bigThree.remove(scenePanel);
2868
+// bigThree.remove(centralPanel);
2869
+// bigThree.remove(XYZPanel);
2870
+// aWindowConstraints.gridx = 0;
2871
+// aWindowConstraints.gridy = 0;
2872
+// aWindowConstraints.gridwidth = 1;
2873
+// // aConstraints.gridheight = 3;
2874
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2875
+// aWindowConstraints.weightx = 0;
2876
+// aWindowConstraints.weighty = 1;
2877
+// bigThree.add(scenePanel, aWindowConstraints);
2878
+// aWindowConstraints.weightx = 1;
2879
+// aWindowConstraints.gridwidth = 3;
2880
+// // aWindowConstraints.gridheight = 3;
2881
+// aWindowConstraints.gridx = 1;
2882
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2883
+// bigThree.add(centralPanel, aWindowConstraints);
2884
+// aWindowConstraints.weightx = 0;
2885
+// aWindowConstraints.gridx = 4;
2886
+// aWindowConstraints.gridwidth = 1;
2887
+// // aWindowConstraints.gridheight = 3;
2888
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2889
+// //bigThree.add(XYZPanel, aConstraints);
2890
+// bigThree.validate();
2891
+// scenePanel.setVisible(true);
2892
+// centralPanel.setVisible(true);
2893
+// XYZPanel.setVisible(false);
2894
+ bigThree.ClearUI();
2895
+ bigThree.add(scenePanel);
2896
+ bigThree.add(centralPanel);
2897
+ bigThree.FlushUI();
27952898 } else
2796
- if (event.getSource() == sevenButton)
2899
+ if (source == sevenButton)
27972900 {
27982901 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();
2902
+
2903
+// bigThree.remove(scenePanel);
2904
+// bigThree.remove(centralPanel);
2905
+// bigThree.remove(XYZPanel);
2906
+// aWindowConstraints.gridx = 0;
2907
+// aWindowConstraints.gridy = 0;
2908
+// aWindowConstraints.gridwidth = 1;
2909
+// // aWindowConstraints.gridheight = 3;
2910
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2911
+// aWindowConstraints.weightx = 0;
2912
+// aWindowConstraints.weighty = 1;
2913
+// bigThree.add(scenePanel, aWindowConstraints);
2914
+// aWindowConstraints.weightx = 1;
2915
+// aWindowConstraints.gridwidth = 3;
2916
+// // aWindowConstraints.gridheight = 3;
2917
+// aWindowConstraints.gridx = 1;
2918
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2919
+// bigThree.add(centralPanel, aWindowConstraints);
2920
+// aWindowConstraints.weightx = 0;
2921
+// aWindowConstraints.gridx = 4;
2922
+// aWindowConstraints.gridwidth = 1;
2923
+// // aConstraints.gridheight = 3;
2924
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2925
+// bigThree.add(XYZPanel, aWindowConstraints);
2926
+// bigThree.validate();
2927
+// scenePanel.setVisible(true);
2928
+// centralPanel.setVisible(true);
2929
+// XYZPanel.setVisible(true);
2930
+ bigThree.ClearUI();
2931
+ bigThree.add(scenePanel);
2932
+ bigThree.add(centralPanel);
2933
+ bigThree.add(XYZPanel);
2934
+ bigThree.FlushUI();
28232935 } else
2824
- if (event.getSource() == rootButton)
2936
+ if (source == rootButton)
28252937 {
28262938 Object3D obj;
28272939 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2833,7 +2945,7 @@
28332945
28342946 refreshContents(true);
28352947 } else
2836
- if (event.getSource() == closeButton)
2948
+ if (source == closeButton)
28372949 {
28382950 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28392951 cRadio ab;
....@@ -2854,11 +2966,11 @@
28542966 }
28552967 refreshContents(true);
28562968 } else
2857
- if (event.getSource() == editItem || event.getSource() == editButton)
2969
+ if (source == editItem || source == editButton)
28582970 {
28592971 EditSelection(false);
28602972 } else
2861
- if (event.getSource() == uneditButton)
2973
+ if (source == uneditButton)
28622974 {
28632975 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28642976 {
....@@ -2870,12 +2982,12 @@
28702982
28712983 child.editWindow = null; // ???????????
28722984 }
2873
- objEditor.ctrlPanel.revalidate();
2985
+ objEditor.ctrlPanel.FlushUI();
28742986 //objEditor.jTree.clearSelection();
28752987 //objEditor.ResetSliders();
28762988 refreshContents(true);
28772989 } else
2878
- if (event.getSource() == clearPanelButton)
2990
+ if (source == clearPanelButton)
28792991 {
28802992 assert(copy == group);
28812993 //copy.ClearUI();
....@@ -2886,7 +2998,7 @@
28862998 listUI.clear();
28872999 refreshContents(true);
28883000 } else
2889
- if (event.getSource() == allParamsButton)
3001
+ if (source == allParamsButton)
28903002 {
28913003 assert(copy == group);
28923004
....@@ -2907,19 +3019,19 @@
29073019
29083020 refreshContents(true);
29093021 } else
2910
- if (event.getSource() == unselectButton)
3022
+ if (source == unselectButton)
29113023 {
29123024 objEditor.jTree.clearSelection();
29133025 // ?? oct 2012 GrafreeD.clipboard.clear();
29143026 objEditor.ResetSliders();
29153027 refreshContents(true);
29163028 } else
2917
- if(event.getSource() instanceof cRadio)
3029
+ if(source instanceof cRadio)
29183030 {
29193031 group.parent = keepparent;
29203032 group.attributes = 0;
29213033 //group.editWindow = null;
2922
- /*cRadio*/ radio = (cRadio)event.getSource();
3034
+ /*cRadio*/ radio = (cRadio)source;
29233035 Object3D obj = radio.GetObject();
29243036 System.out.println("Edit " + obj);
29253037 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -3589,11 +3701,11 @@
35893701
35903702 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35913703
3592
- boolean random = CameraPane.RANDOM;
3593
- CameraPane.RANDOM = false; // parse all random nodes
3704
+ boolean random = CameraPane.SWITCH;
3705
+ CameraPane.SWITCH = false; // parse all random nodes
35943706 lowres.linkVerticesThis(null);
35953707 lowres.linkVerticesThis(sn);
3596
- CameraPane.RANDOM = random;
3708
+ CameraPane.SWITCH = random;
35973709
35983710 System.err.flush();
35993711
....@@ -4078,12 +4190,12 @@
40784190 System.err.println("info : " + child.GetPath());
40794191 }
40804192 }
4081
- else
4082
- {
4083
- objEditor.SetMaterial(group); // .GetMaterial());
4084
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4085
- System.err.println("info : " + group.GetPath());
4086
- }
4193
+// else
4194
+// {
4195
+// objEditor.SetMaterial(group); // .GetMaterial());
4196
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4197
+// System.err.println("info : " + group.GetPath());
4198
+// }
40874199
40884200 objEditor.SetText(); // jan 2014
40894201
....@@ -4351,7 +4463,7 @@
43514463 refreshContents();
43524464 }
43534465
4354
- void pasteInto(boolean copyit)
4466
+ void pasteInto(boolean copyit, boolean clone)
43554467 {
43564468 // if (GrafreeD.clipboard == null)
43574469 // return;
....@@ -4380,7 +4492,14 @@
43804492 if (copyit)
43814493 {
43824494 // paste(false);
4383
- CloneClipboard(false); // sept 2014
4495
+ if (clone)
4496
+ {
4497
+ CloneClipboard(false); // sept 2014
4498
+ }
4499
+ else
4500
+ {
4501
+ paste(false);
4502
+ }
43844503 }
43854504 else
43864505 {
....@@ -4924,10 +5043,12 @@
49245043 cButton flashSelectionButton;
49255044 cButton editButton;
49265045 cButton uneditButton;
5046
+ JCheckBox allParamsButton;
49275047 cButton clearpanelButton;
4928
- cButton allParamsButton;
49295048 cButton unselectButton;
49305049
5050
+ cButton oneStepButton;
5051
+
49315052 cButton screenfitButton;
49325053 cButton screenfitpointButton;
49335054 cButton snapobjectButton;
....@@ -4982,6 +5103,7 @@
49825103 private MenuItem mergeGeometriesItem;
49835104 private MenuItem copyItem;
49845105 private MenuItem pasteItem;
5106
+ private MenuItem pasteIntoItem;
49855107 private MenuItem pasteLinkItem;
49865108 private MenuItem pasteCloneItem;
49875109 private MenuItem pasteExpandItem;
....@@ -5079,7 +5201,7 @@
50795201 private MenuItem blobItem;
50805202 private MenuItem latheItem;
50815203 private MenuItem bezierItem;
5082
- private MenuItem checkerItem;
5204
+ private MenuItem overlayItem;
50835205 private MenuItem meshItem;
50845206 // private MenuItem meshGroupItem;
50855207 private MenuItem springItem;