Normand Briere
2019-05-02 a7277e6c6381e55761f7fa87276260fac1c94d5e
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,11 +433,11 @@
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"));
393442 importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
394443 importGFDItem.addActionListener(this);
....@@ -433,176 +482,98 @@
433482 oe.radioPanel.add(dummyButton);
434483 oe.buttonGroup.add(dummyButton);
435484 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
485
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439486
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
487
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
441488 liveCB.setToolTipText("Enabled animation");
442489 liveCB.addItemListener(this);
443490
444
- oe.aConstraints.gridx += 1;
445
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
491
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
492
+ oneStepButton.setToolTipText("Animate one step forward");
493
+ oneStepButton.addActionListener(this);
494
+
495
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
446496 fastCB.setToolTipText("Fast mode");
447497 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);
498
+
499
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
515500 trackCB.setToolTipText("Enable tracking");
516501 trackCB.addItemListener(this);
517502
518
- oe.aConstraints.gridx += 1;
519
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
503
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
520504 screenfitButton.setToolTipText("Screen fit");
521505 screenfitButton.addActionListener(this);
522
- oe.aConstraints.gridx += 1;
506
+
523507 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
524508 // 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;
530509
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);
510
+ if (Globals.ADVANCED)
511
+ {
512
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
513
+ snapobjectButton.addActionListener(this);
514
+ snapobjectButton.setToolTipText("Snap Object");
515
+ }
516
+
517
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
537518 flashSelectionButton.setToolTipText("Show selection");
538519 flashSelectionButton.addActionListener(this);
539520
540
- oe.toolbarPanel.add(new cButton(" ", false));
521
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
541522
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);
523
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
548524 twoButton.setToolTipText("Show center view only");
549525 twoButton.addActionListener(this);
550
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
526
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
551527 fourButton.addActionListener(this);
552528 fourButton.setToolTipText("Show left panel only");
553
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
529
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
554530 sixButton.setToolTipText("2-column layout left");
555531 sixButton.addActionListener(this);
556
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
532
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
557533 threeButton.setToolTipText("2-column layout right");
558534 threeButton.addActionListener(this);
559
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
535
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
560536 sevenButton.setToolTipText("3-column layout");
561537 sevenButton.addActionListener(this);
562538 //
563539
564
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
565
- rootButton.setToolTipText("Edit object in new tab");
540
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
541
+ rootButton.setToolTipText("Edit selection in new tab");
566542 rootButton.addActionListener(this);
567
- oe.aConstraints.gridx += 1;
568
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
543
+
544
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
569545 closeButton.setToolTipText("Close tab");
570546 closeButton.addActionListener(this);
571547 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
572548 //clearButton.addActionListener(this);
573
- oe.aConstraints.gridx += 1;
574549
575
- oe.aConstraints.gridx = 1; //
576
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
550
+ cGridBag commandsPanel = new cGridBag();
551
+
552
+ commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
553
+ editButton.setToolTipText("Edit selection");
577554 editButton.addActionListener(this);
578
- oe.aConstraints.gridx += 1;
579
- oe.aConstraints.weighty = 0;
580
- oe.aConstraints.gridwidth = 1;
581555
582
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
556
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
557
+ uneditButton.setToolTipText("Unedit selection");
583558 uneditButton.addActionListener(this);
584559
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);
560
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
561
+ allParamsButton.setToolTipText("Edit all params");
597562 allParamsButton.addActionListener(this);
598563
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);
564
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
565
+ clearPanelButton.setToolTipText("Clear edit panel");
566
+ clearPanelButton.addActionListener(this);
567
+
568
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
569
+ unselectButton.setToolTipText("Unselect");
604570 unselectButton.addActionListener(this);
605571
572
+ commandsPanel.preferredHeight = 1;
573
+
574
+ oe.treePanel.add(commandsPanel);
575
+ oe.treePanel.Return();
576
+
606577 // oe.aConstraints.gridx += 1;
607578 // oe.aConstraints.weighty = 0;
608579 // oe.aConstraints.gridwidth = 1;
....@@ -614,40 +585,37 @@
614585 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
615586 // gcButton.addActionListener(this);
616587
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;
588
+ cGridBag jSPPanel = new cGridBag();
589
+
590
+ JScrollPane jSP;
628591 //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);
592
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
630593 ResetModel();
631
- oe.aConstraints.weighty = 0.5;
632
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
633
- oe.aConstraints.gridy += 1;
634
- oe.aConstraints.gridwidth = 1;
594
+
595
+ oe.treePanel.add(jSPPanel);
596
+ oe.treePanel.Return();
635597
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);
598
+ cGridBag copyOptionsPanel = new cGridBag();
599
+
600
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
601
+ colorCB.setToolTipText("Copy color when dropped");
640602 colorCB.addItemListener(this);
641
- oe.aConstraints.gridx += 2;
642
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
603
+
604
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
605
+ materialCB.setToolTipText("Copy material when dropped");
643606 materialCB.addItemListener(this);
644
- oe.aConstraints.gridx += 2;
645
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
607
+
608
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
609
+ textureCB.setToolTipText("Copy texture when dropped");
646610 textureCB.addItemListener(this);
647611
648
- oe.aConstraints.gridx = 0;
649
- oe.aConstraints.gridy += 1;
612
+ copyOptionsPanel.preferredHeight = 1;
613
+ oe.treePanel.add(copyOptionsPanel);
614
+ oe.treePanel.Return();
650615
616
+// mainPanel.setDividerLocation(0.5); //1.0);
617
+// mainPanel.setResizeWeight(0.5);
618
+
651619 //jList.addListSelectionListener(this);
652620 oe.jTree.addTreeSelectionListener(this);
653621 //jTree.setRootVisible(false);
....@@ -669,6 +637,78 @@
669637 radio.layout = sevenButton;
670638 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
671639 }
640
+
641
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
642
+ {
643
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
644
+ boxCB.setToolTipText("Display bounding boxes");
645
+ boxCB.addItemListener(this);
646
+
647
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
648
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
649
+ zoomBoxCB.addItemListener(this);
650
+
651
+ if (Globals.ADVANCED)
652
+ {
653
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
654
+ supportCB.setToolTipText("Enable rigging");
655
+ supportCB.addItemListener(this);
656
+
657
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
658
+ // localCB.addItemListener(this);
659
+
660
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
661
+ crowdCB.setToolTipText("Used for crowds");
662
+ crowdCB.addItemListener(this);
663
+
664
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
665
+ smoothCB.setToolTipText("Snapping delay");
666
+ smoothCB.addItemListener(this);
667
+
668
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
669
+ slowCB.setToolTipText("Smooth interpolation");
670
+ slowCB.addItemListener(this);
671
+
672
+// constraints.gridy += 1;
673
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
674
+// speakerMocapCB.addItemListener(this);
675
+
676
+ if (false)
677
+ {
678
+ // handled in scripts
679
+ //constraints.gridy += 1;
680
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
681
+ speakerCameraCB.addItemListener(this);
682
+
683
+ //constraints.gridy += 1;
684
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
685
+ speakerFocusCB.addItemListener(this);
686
+
687
+ //constraints.gridy += 1;
688
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
689
+ smoothfocusCB.addItemListener(this);
690
+ }
691
+
692
+//constraints.gridx += 1;
693
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
694
+// debugCB.addItemListener(this);
695
+
696
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
697
+ oeilCB.addItemListener(this);
698
+
699
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
700
+ lookAtCB.setToolTipText("Look-at target");
701
+ lookAtCB.addItemListener(this);
702
+
703
+ }
704
+
705
+ cGridBag fill = new cGridBag();
706
+
707
+ fill.preferredHeight = 200;
708
+
709
+ panel.add(fill);
710
+
711
+ }
672712
673713 void EditObject(Object3D obj)
674714 {
....@@ -951,11 +991,11 @@
951991 {
952992 loadClipboard(true);
953993 objEditor.jTree.setSelectionPath(destinationPath);
954
- pasteInto(false);
994
+ pasteInto(false, false);
955995 } else {
956996 loadClipboard(false);
957997 objEditor.jTree.setSelectionPath(destinationPath);
958
- pasteInto(false); // true); // ???
998
+ pasteInto(false, false); // true); // ???
959999 }
9601000 }
9611001 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1077,27 +1117,33 @@
10771117 kleinItem.addActionListener(this);
10781118 particleItem = menu.add(new MenuItem("Particle system"));
10791119 particleItem.addActionListener(this);
1120
+ if (Globals.ADVANCED)
1121
+ {
10801122 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10811123 ragdollItem.addActionListener(this);
10821124 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10831125 ragdoll2Item.addActionListener(this);
1126
+ }
10841127 menu.add("-");
1085
- meshItem = menu.add(new MenuItem("Mesh"));
1128
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10861129 meshItem.addActionListener(this);
10871130 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10881131 // meshGroupItem.addActionListener(this);
1132
+ if (Globals.ADVANCED)
1133
+ {
10891134 springItem = menu.add(new MenuItem("Spring"));
10901135 springItem.addActionListener(this);
10911136 flagItem = menu.add(new MenuItem("Flag"));
10921137 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);
10971138 blobItem = menu.add(new MenuItem("Blob"));
10981139 blobItem.addActionListener(this);
10991140 latheItem = menu.add(new MenuItem("Lathe"));
11001141 latheItem.addActionListener(this);
1142
+ }
1143
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1144
+ bezierItem.addActionListener(this);
1145
+ overlayItem = menu.add(new MenuItem("Overlay"));
1146
+ overlayItem.addActionListener(this);
11011147 lightItem = menu.add(new MenuItem("Light"));
11021148 lightItem.addActionListener(this);
11031149 menu.add("-");
....@@ -1107,34 +1153,39 @@
11071153 loopItem.addActionListener(this);
11081154 doubleItem = menu.add(new MenuItem("Fork"));
11091155 doubleItem.addActionListener(this);
1156
+ if (Globals.ADVANCED)
1157
+ {
11101158 tripleItem = menu.add(new MenuItem("Trident"));
11111159 tripleItem.addActionListener(this);
1160
+ }
11121161 }
11131162
11141163 void buildToolsMenu(Menu menu)
11151164 {
11161165 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11171166 animationItem.addItemListener(this);
1118
- animationItem.setState(CameraPane.ANIMATION);
1167
+ animationItem.setState(Globals.ANIMATION);
11191168
11201169 menu.add("-");
11211170 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11221171 parseverticesItem.addActionListener(this);
11231172 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11241173 textureFieldItem.addActionListener(this);
1125
- alignItem = menu.add(new MenuItem("Align"));
1174
+ alignItem = menu.add(new MenuItem("Align Objects"));
11261175 alignItem.addActionListener(this);
1127
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1128
- mirrorItem.addActionListener(this);
11291176 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11301177 reduceMorphItem.addActionListener(this);
11311178 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11321179 reduce34MorphItem.addActionListener(this);
1133
-
1180
+ menu.add("-");
11341181 menu.add(computeAOItem = new MenuItem("Compute AO"));
11351182 computeAOItem.addActionListener(this);
1136
- menu.add("-");
11371183
1184
+ if (Globals.ADVANCED)
1185
+ {
1186
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1187
+ mirrorItem.addActionListener(this);
1188
+ menu.add("-");
11381189 menu.add(memoryItem = new MenuItem("Memory Usage"));
11391190 memoryItem.addActionListener(this);
11401191 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1157,6 +1208,7 @@
11571208 menu.add("-");
11581209 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11591210 editScriptItem.addActionListener(this);
1211
+ }
11601212 }
11611213
11621214 void ScreenFit()
....@@ -1510,6 +1562,7 @@
15101562 //
15111563 public void actionPerformed(ActionEvent event) // , Object arg)
15121564 {
1565
+ Object source = event.getSource();
15131566 /*
15141567 if (event.getSource() == nameField)
15151568 {
....@@ -1521,11 +1574,11 @@
15211574 }
15221575 else
15231576 */
1524
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1577
+ if (source == lookAtItem || source == lookFromItem)
15251578 {
15261579 ScreenFit();
15271580 } else
1528
- if (event.getSource() == switchItem)
1581
+ if (source == switchItem)
15291582 {
15301583 cVector v1 = new cVector();
15311584 cVector v2 = new cVector();
....@@ -1534,11 +1587,11 @@
15341587 objEditor.cameraView.renderCamera.setAim(v2, v1);
15351588 objEditor.cameraView.repaint();
15361589 } else
1537
- if (event.getSource() == rectoidItem)
1590
+ if (source == rectoidItem)
15381591 {
15391592 makeSomething(new Box());
15401593 } else
1541
- if (event.getSource() == particleItem)
1594
+ if (source == particleItem)
15421595 {
15431596 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15441597 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1559,9 +1612,9 @@
15591612 applyExample(particleGeom, "SMOKE");
15601613 makeSomething(particleGeom);
15611614 } else
1562
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1615
+ if (source == ragdollItem || source == ragdoll2Item)
15631616 {
1564
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1617
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15651618
15661619 ragdoll.toParent = LA.newMatrix();
15671620 ragdoll.fromParent = LA.newMatrix();
....@@ -1579,7 +1632,7 @@
15791632 } else
15801633 /*
15811634 */
1582
- if (event.getSource() == heightFieldItem)
1635
+ if (source == heightFieldItem)
15831636 {
15841637 Object3D obj = new Object3D();
15851638
....@@ -1617,31 +1670,31 @@
16171670
16181671 makeSomething(obj);
16191672 } else
1620
- if (event.getSource() == gridItem)
1673
+ if (source == gridItem)
16211674 {
16221675 makeSomething(new Grid());
16231676 } else
1624
- if (event.getSource() == ellipsoidItem)
1677
+ if (source == ellipsoidItem)
16251678 {
16261679 makeSomething(new Sphere());
16271680 } else
1628
- if (event.getSource() == coneItem)
1681
+ if (source == coneItem)
16291682 {
16301683 makeSomething(new Cone());
16311684 } else
1632
- if (event.getSource() == torusItem)
1685
+ if (source == torusItem)
16331686 {
16341687 makeSomething(new Torus());
16351688 } else
1636
- if (event.getSource() == superItem)
1689
+ if (source == superItem)
16371690 {
16381691 makeSomething(new Superellipsoid());
16391692 } else
1640
- if (event.getSource() == kleinItem)
1693
+ if (source == kleinItem)
16411694 {
16421695 makeSomething(new Klein());
16431696 } else
1644
- if (event.getSource() == blobItem)
1697
+ if (source == blobItem)
16451698 {
16461699 Blob blob = new Blob();
16471700 BlobComponent comp = new BlobComponent();
....@@ -1649,15 +1702,15 @@
16491702 //blob.retile();
16501703 makeSomething(blob);
16511704 } else
1652
- if (event.getSource() == latheItem)
1705
+ if (source == latheItem)
16531706 {
16541707 makeSomething(new Lathe());
16551708 } else
1656
- if (event.getSource() == bezierItem)
1709
+ if (source == bezierItem)
16571710 {
16581711 makeSomething(new BezierSurface());
16591712 } else
1660
- if (event.getSource() == checkerItem)
1713
+ if (source == overlayItem)
16611714 {
16621715 /*
16631716 Object3D obj = new BezierSurface(5,8);
....@@ -1672,7 +1725,7 @@
16721725 */
16731726 makeSomething(new Checker());
16741727 } else
1675
- if (event.getSource() == meshItem)
1728
+ if (source == meshItem)
16761729 {
16771730 Object3D itemtomake = new Object3D();
16781731 Object3D child;
....@@ -1693,35 +1746,35 @@
16931746 makeSomething(child);
16941747 }
16951748 } else
1696
- if (event.getSource() == springItem)
1749
+ if (source == springItem)
16971750 {
16981751 cSpring s = new cSpring();
16991752 s.setup();
17001753 makeSomething(s);
17011754 } else
1702
- if (event.getSource() == flagItem)
1755
+ if (source == flagItem)
17031756 {
17041757 cSpring s = new cFlag();
17051758 s.setup();
17061759 makeSomething(s);
17071760 } else
1708
- if (event.getSource() == lightItem)
1761
+ if (source == lightItem)
17091762 {
17101763 makeSomething(new Light());
17111764 } else
1712
- if (event.getSource() == csgItem)
1765
+ if (source == csgItem)
17131766 {
17141767 group(new CSG());
17151768 } else
1716
- if (event.getSource() == templateItem)
1769
+ if (source == templateItem)
17171770 {
17181771 group(new cTemplate());
17191772 } else
1720
- if (event.getSource() == attributeItem)
1773
+ if (source == attributeItem)
17211774 {
17221775 makeSomething(new Attribute());
17231776 } else
1724
- if (event.getSource() == pointflowItem)
1777
+ if (source == pointflowItem)
17251778 {
17261779 makeSomething(new PointFlow());
17271780 } else
....@@ -1733,7 +1786,7 @@
17331786 } else
17341787 */
17351788
1736
- if (event.getSource() == superLoopItem)
1789
+ if (source == superLoopItem)
17371790 {
17381791 Composite g = new cGroup();
17391792 for (int i=0; i<15; i++)
....@@ -1755,7 +1808,7 @@
17551808
17561809 group(g);
17571810 } else
1758
- if (event.getSource() == loopItem)
1811
+ if (source == loopItem)
17591812 {
17601813 Composite csg = new GroupLeaf();
17611814 csg.count = 5;
....@@ -1764,7 +1817,7 @@
17641817 csg.addChild(child);
17651818 child.addChild(csg);
17661819 } else
1767
- if (event.getSource() == doubleItem)
1820
+ if (source == doubleItem)
17681821 {
17691822 Composite csg = new GroupLeaf();
17701823 csg.count = 5;
....@@ -1776,7 +1829,7 @@
17761829 csg.addChild(child);
17771830 child.addChild(csg);
17781831 } else
1779
- if (event.getSource() == tripleItem)
1832
+ if (source == tripleItem)
17801833 {
17811834 Composite csg = new GroupLeaf();
17821835 csg.count = 4;
....@@ -1792,70 +1845,75 @@
17921845 child.addChild(csg);
17931846 } else
17941847
1795
- if (event.getSource() == importGFDItem)
1848
+ if (source == importGFDItem)
17961849 {
17971850 ImportGFD();
17981851 } else
1799
- if (event.getSource() == importVRMLX3DItem)
1852
+ if (source == importVRMLX3DItem)
18001853 {
18011854 ImportVRMLX3D();
18021855 } else
1803
- if (event.getSource() == import3DSItem)
1856
+ if (source == import3DSItem)
18041857 {
18051858 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
18061859 } else
1807
- if (event.getSource() == importOBJItem)
1860
+ if (source == importOBJItem)
18081861 {
18091862 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
18101863 } else
1811
- if (event.getSource() == computeAOItem)
1864
+ if (source == computeAOItem)
18121865 {
18131866 Globals.drawMode = CameraPane.OCCLUSION;
18141867 Globals.theRenderer.repaint();
18151868 } else
1816
- if (event.getSource() == recompileItem)
1869
+ if (source == recompileItem)
18171870 {
18181871 Recompile();
18191872 refreshContents();
18201873 } else
1821
- if (event.getSource() == editScriptItem)
1874
+ if (source == editScriptItem)
18221875 {
18231876 OpenDialog();
18241877 refreshContents();
18251878 } else
1826
- if (event.getSource() == invariantsItem)
1879
+ if (source == invariantsItem)
18271880 {
18281881 System.out.println("Invariants:");
18291882 GrafreeD.grafreeD.universe.invariants();
18301883 } else
1831
- if (event.getSource() == memoryItem)
1884
+ if (source == memoryItem)
18321885 {
18331886 //System.out.println("Invariants:");
18341887 PrintMemory();
18351888 } else
1836
- if (event.getSource() == pathItem)
1889
+ if (source == pathItem)
18371890 {
18381891 PrintPath();
18391892 } else
1840
- if (event.getSource() == analyzeItem)
1893
+ if (source == analyzeItem)
18411894 {
18421895 AnalyzeObject();
18431896 } else
1844
- if (event.getSource() == dumpItem)
1897
+ if (source == dumpItem)
18451898 {
18461899 DumpObject();
18471900 } else
1848
- if (event.getSource() == screenfitButton)
1901
+ if (source == oneStepButton)
1902
+ {
1903
+ Globals.ONESTEP = true;
1904
+ cameraView.repaint();
1905
+ } else
1906
+ if (source == screenfitButton)
18491907 {
18501908 //Reload(lastConverter, lastFilename, true);
18511909 ScreenFit();
18521910 } else
1853
- if (event.getSource() == screenfitpointButton)
1911
+ if (source == screenfitpointButton)
18541912 {
18551913 //Reload(lastConverter, lastFilename, true);
18561914 ScreenFitPoint();
18571915 } else
1858
- if (event.getSource() == snapobjectButton)
1916
+ if (source == snapobjectButton)
18591917 {
18601918 //Reload(lastConverter, lastFilename, true);
18611919 SnapObject();
....@@ -1866,13 +1924,13 @@
18661924 // Recompile();
18671925 // refreshContents();
18681926 // } else
1869
- if (event.getSource() == gcButton)
1927
+ if (source == gcButton)
18701928 {
18711929 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18721930 System.gc();
18731931 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18741932 } else
1875
- if (event.getSource() == editLeafItem)
1933
+ if (source == editLeafItem)
18761934 {
18771935 Object3D obj;
18781936 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1886,62 +1944,66 @@
18861944 }
18871945 refreshContents(true);
18881946 } else
1889
- if (event.getSource() == openWindowItem)
1947
+ if (source == openWindowItem)
18901948 {
18911949 EditSelection(true);
18921950 } else
1893
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1951
+ if (source == cutItem || source == clearButton)
18941952 {
18951953 loadClipboard(true);
18961954 } else
1897
- if (event.getSource() == duplicateItem)
1955
+ if (source == duplicateItem)
18981956 {
18991957 Object3D keep = GrafreeD.clipboard;
19001958 loadClipboard(false);
19011959 paste(false);
19021960 GrafreeD.clipboard = keep;
19031961 } else
1904
- if (event.getSource() == cloneItem)
1962
+ if (source == cloneItem)
19051963 {
19061964 CloneSelection(false);
19071965 } else
1908
- if (event.getSource() == cloneSupportItem)
1966
+ if (source == cloneSupportItem)
19091967 {
19101968 CloneSelection(true);
19111969 } else
1912
- if (event.getSource() == copyItem)
1970
+ if (source == copyItem)
19131971 {
19141972 loadClipboard(false);
19151973 } else
1916
- if (event.getSource() == pasteItem)
1974
+ if (source == pasteItem)
19171975 {
19181976 paste(false);
19191977 } else
1920
- if (event.getSource() == pasteLinkItem)
1978
+ if (source == pasteIntoItem)
19211979 {
1922
- pasteInto(false);
1980
+ pasteInto(true, false);
19231981 } else
1924
- if (event.getSource() == pasteCloneItem)
1982
+ if (source == pasteLinkItem)
19251983 {
1926
- pasteInto(true);
1984
+ pasteInto(false, false);
19271985 } else
1928
- if (event.getSource() == pasteExpandItem)
1986
+ if (source == pasteCloneItem)
1987
+ {
1988
+ pasteInto(true, true);
1989
+ } else
1990
+ if (source == pasteExpandItem)
19291991 {
19301992 paste(true);
19311993 } else
1932
- if (event.getSource() == synchronizeItem)
1994
+ if (source == synchronizeItem)
19331995 {
19341996 Overwrite(Object3D.TRANSFORM);
19351997 } else
1936
- if (event.getSource() == overwriteNameItem)
1998
+ if (source == overwriteNameItem)
19371999 {
19382000 Overwrite(Object3D.NAME);
19392001 } else
1940
- if (event.getSource() == overwriteUVItem)
2002
+ if (source == overwriteUVItem)
19412003 {
19422004 Overwrite(Object3D.UV);
19432005 } else
1944
- if (event.getSource() == overwriteMatItem)
2006
+ if (source == overwriteMatItem)
19452007 {
19462008 /* july 2015
19472009 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1961,7 +2023,7 @@
19612023
19622024 Overwrite(dropAttributes);
19632025 }
1964
- if (event.getSource() == overwriteGeoItem)
2026
+ if (source == overwriteGeoItem)
19652027 {
19662028 Overwrite(Object3D.GEOMETRY);
19672029 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1978,7 +2040,7 @@
19782040 // refreshContents();
19792041 // }
19802042 } else
1981
- if (event.getSource() == generateMeshItem)
2043
+ if (source == generateMeshItem)
19822044 {
19832045 //if (group.selection.size() == 1)
19842046 // for (int i=0; i<group.selection.size(); i++)
....@@ -1989,7 +2051,7 @@
19892051 ResetModel();
19902052 refreshContents();
19912053 } else
1992
- if (event.getSource() == extractGeometriesItem)
2054
+ if (source == extractGeometriesItem)
19932055 {
19942056 boolean one = false;
19952057
....@@ -2016,7 +2078,7 @@
20162078 ResetModel();
20172079 refreshContents();
20182080 } else
2019
- if (event.getSource() == cloneGeometriesItem)
2081
+ if (source == cloneGeometriesItem)
20202082 {
20212083 boolean one = false;
20222084
....@@ -2042,7 +2104,7 @@
20422104 ResetModel();
20432105 refreshContents();
20442106 } else
2045
- if (event.getSource() == shareGeometriesItem)
2107
+ if (source == shareGeometriesItem)
20462108 {
20472109 boolean one = false;
20482110
....@@ -2072,7 +2134,7 @@
20722134 refreshContents();
20732135 }
20742136 } else
2075
- if (event.getSource() == mergeGeometriesItem)
2137
+ if (source == mergeGeometriesItem)
20762138 {
20772139 boolean one = false;
20782140
....@@ -2102,7 +2164,7 @@
21022164 ResetModel();
21032165 refreshContents();
21042166 } else
2105
- if (event.getSource() == linkverticesItem)
2167
+ if (source == linkverticesItem)
21062168 {
21072169 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21082170 // {
....@@ -2125,38 +2187,38 @@
21252187 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21262188 for (int i=0; i<group.selection.size(); i++)
21272189 {
2128
- boolean random = CameraPane.RANDOM;
2129
- CameraPane.RANDOM = false; // parse all random nodes
2190
+ boolean random = CameraPane.SWITCH;
2191
+ CameraPane.SWITCH = false; // parse all random nodes
21302192 group.selection.get(i).linkVerticesThis(content);
21312193 // group.selection.get(i).setMasterThis(content); // should be identity
2132
- CameraPane.RANDOM = random;
2194
+ CameraPane.SWITCH = random;
21332195 }
21342196 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21352197 refreshContents();
21362198 }
21372199 } else
2138
- if (event.getSource() == resetsupportItem)
2200
+ if (source == resetsupportItem)
21392201 {
21402202 for (int i=0; i<group.selection.size(); i++)
21412203 {
2142
- boolean random = CameraPane.RANDOM;
2143
- CameraPane.RANDOM = false; // parse all random nodes
2204
+ boolean random = CameraPane.SWITCH;
2205
+ CameraPane.SWITCH = false; // parse all random nodes
21442206 group.selection.get(i).linkVerticesThis(null);
2145
- CameraPane.RANDOM = random;
2207
+ CameraPane.SWITCH = random;
21462208 }
21472209
21482210 refreshContents();
21492211 } else
2150
- if (event.getSource() == relinkverticesItem)
2212
+ if (source == relinkverticesItem)
21512213 {
2152
- boolean random = CameraPane.RANDOM;
2153
- CameraPane.RANDOM = false; // parse all random nodes
2214
+ boolean random = CameraPane.SWITCH;
2215
+ CameraPane.SWITCH = false; // parse all random nodes
21542216 group.selection.RelinkToSupport();
2155
- CameraPane.RANDOM = random;
2217
+ CameraPane.SWITCH = random;
21562218
21572219 refreshContents();
21582220 } else
2159
- if (event.getSource() == resetreferencesItem)
2221
+ if (source == resetreferencesItem)
21602222 {
21612223 for (int i=0; i<group.selection.size(); i++)
21622224 {
....@@ -2165,7 +2227,7 @@
21652227
21662228 refreshContents();
21672229 } else
2168
- if (event.getSource() == setMasterItem)
2230
+ if (source == setMasterItem)
21692231 {
21702232 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21712233 {
....@@ -2178,7 +2240,7 @@
21782240 refreshContents();
21792241 }
21802242 } else
2181
- if (event.getSource() == poseMeshItem)
2243
+ if (source == poseMeshItem)
21822244 {
21832245 if (group.selection.size() == 1)
21842246 {
....@@ -2197,19 +2259,19 @@
21972259 }
21982260
21992261 } else
2200
- if (event.getSource() == revertMeshItem)
2262
+ if (source == revertMeshItem)
22012263 {
22022264 RevertMeshes();
22032265 } else
2204
- if (event.getSource() == resetMeshItem)
2266
+ if (source == resetMeshItem)
22052267 {
22062268 ResetAll();
22072269 } else
2208
- if (event.getSource() == stepAllItem)
2270
+ if (source == stepAllItem)
22092271 {
22102272 StepAll();
22112273 } else
2212
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2274
+ if (source == clearItem) // || event.getSource() == clearButton)
22132275 {
22142276 //int indices[] = jList.getSelectedIndices();
22152277 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2217,46 +2279,46 @@
22172279
22182280 ClearSelection(false);
22192281 } else
2220
- if (event.getSource() == clearAllItem)
2282
+ if (source == clearAllItem)
22212283 {
22222284 ClearSelection(true);
22232285 } else
2224
- if (event.getSource() == grabItem)
2286
+ if (source == grabItem)
22252287 {
22262288 group(new cGroup(), true);
22272289 } else
2228
- if (event.getSource() == hideItem)
2290
+ if (source == hideItem)
22292291 {
22302292 group(new HiddenObject());
22312293 } else
2232
- if (event.getSource() == frontItem)
2294
+ if (source == frontItem)
22332295 {
22342296 front();
22352297 } else
2236
- if (event.getSource() == backItem)
2298
+ if (source == backItem)
22372299 {
22382300 back();
22392301 } else
2240
- if (event.getSource() == cameraItem)
2302
+ if (source == cameraItem)
22412303 {
22422304 makeSomething(new Camera());
22432305 } else
2244
- if (event.getSource() == compositeItem)
2306
+ if (source == compositeItem)
22452307 {
22462308 group(new Composite());
22472309 } else
2248
- if (event.getSource() == randomItem)
2310
+ if (source == randomItem)
22492311 {
22502312 RandomNode random = new RandomNode();
22512313 group(random);
22522314 if (random.size() > 0)
2253
- random.name = random.get(0).name + "Rnd";
2315
+ random.name = random.get(0).name + "Switch";
22542316 } else
2255
- if (event.getSource() == physicsItem)
2317
+ if (source == physicsItem)
22562318 {
22572319 group(new PhysicsNode());
22582320 } else
2259
- if (event.getSource() == frameselectorItem)
2321
+ if (source == frameselectorItem)
22602322 {
22612323 for (int i=0; i<group.selection.size(); i++)
22622324 {
....@@ -2268,7 +2330,7 @@
22682330 ResetModel();
22692331 refreshContents();
22702332 } else
2271
- if (event.getSource() == switchGeoItem)
2333
+ if (source == switchGeoItem)
22722334 {
22732335 for (int i=0; i<group.selection.size(); i++)
22742336 {
....@@ -2280,7 +2342,7 @@
22802342 ResetModel();
22812343 refreshContents();
22822344 } else
2283
- if (event.getSource() == switchTransfoItem)
2345
+ if (source == switchTransfoItem)
22842346 {
22852347 for (int i=0; i<group.selection.size(); i++)
22862348 {
....@@ -2292,7 +2354,7 @@
22922354 ResetModel();
22932355 refreshContents();
22942356 } else
2295
- if (event.getSource() == morphItem)
2357
+ if (source == morphItem)
22962358 {
22972359 for (int i=0; i<group.selection.size(); i++)
22982360 {
....@@ -2304,7 +2366,7 @@
23042366 ResetModel();
23052367 refreshContents();
23062368 } else
2307
- if (event.getSource() == scriptNodeItem)
2369
+ if (source == scriptNodeItem)
23082370 {
23092371 boolean atleastone = false;
23102372
....@@ -2343,31 +2405,31 @@
23432405 }
23442406 }
23452407 } else
2346
- if (event.getSource() == linkerItem)
2408
+ if (source == linkerItem)
23472409 {
23482410 group(new cLinker());
23492411 } else
2350
- if (event.getSource() == textureItem)
2412
+ if (source == textureItem)
23512413 {
23522414 group(new TextureNode());
23532415 } else
2354
- if (event.getSource() == billboardItem)
2416
+ if (source == billboardItem)
23552417 {
23562418 group(new BillboardNode());
23572419 } else
2358
- if (event.getSource() == shadowXItem)
2420
+ if (source == shadowXItem)
23592421 {
23602422 CastShadow(0);
23612423 } else
2362
- if (event.getSource() == shadowYItem)
2424
+ if (source == shadowYItem)
23632425 {
23642426 CastShadow(1);
23652427 } else
2366
- if (event.getSource() == shadowZItem)
2428
+ if (source == shadowZItem)
23672429 {
23682430 CastShadow(2);
23692431 } else
2370
- if (event.getSource() == ungroupItem)
2432
+ if (source == ungroupItem)
23712433 {
23722434 //ungroup();
23732435 for (int i=0; i<group.selection.size(); i++)
....@@ -2379,179 +2441,179 @@
23792441
23802442 refreshContents();
23812443 } else
2382
- if (event.getSource() == genUVItem)
2444
+ if (source == genUVItem)
23832445 {
23842446 GenUV();
23852447 } else
2386
- if (event.getSource() == genNormalsCADItem)
2448
+ if (source == genNormalsCADItem)
23872449 {
23882450 GenNormals(true);
23892451 } else
2390
- if (event.getSource() == genNormalsMESHItem)
2452
+ if (source == genNormalsMESHItem)
23912453 {
23922454 GenNormals(true); // TODO
23932455 } else
2394
- if (event.getSource() == genNormalsORGANItem)
2456
+ if (source == genNormalsORGANItem)
23952457 {
23962458 GenNormals(false);
23972459 } else
2398
- if (event.getSource() == genNormalsMINEItem)
2460
+ if (source == genNormalsMINEItem)
23992461 {
24002462 GenNormalsMINE();
24012463 } else
2402
- if (event.getSource() == stripifyItem)
2464
+ if (source == stripifyItem)
24032465 {
24042466 Stripify();
24052467 } else
2406
- if (event.getSource() == unstripifyItem)
2468
+ if (source == unstripifyItem)
24072469 {
24082470 Unstripify();
24092471 } else
2410
- if (event.getSource() == trimItem)
2472
+ if (source == trimItem)
24112473 {
24122474 Trim();
24132475 } else
2414
- if (event.getSource() == untrimItem)
2476
+ if (source == untrimItem)
24152477 {
24162478 Untrim();
24172479 } else
2418
- if (event.getSource() == clearColorsItem)
2480
+ if (source == clearColorsItem)
24192481 {
24202482 ClearColors();
24212483 } else
2422
- if (event.getSource() == clearMaterialsItem)
2484
+ if (source == clearMaterialsItem)
24232485 {
24242486 ClearMaterials();
24252487 } else
2426
- if (event.getSource() == liveleavesItem)
2488
+ if (source == liveleavesItem)
24272489 {
24282490 LiveLeaves(true);
24292491 } else
2430
- if (event.getSource() == unliveleavesItem)
2492
+ if (source == unliveleavesItem)
24312493 {
24322494 LiveLeaves(false);
24332495 } else
2434
- if (event.getSource() == supportleavesItem)
2496
+ if (source == supportleavesItem)
24352497 {
24362498 SupportLeaves(true);
24372499 } else
2438
- if (event.getSource() == unsupportleavesItem)
2500
+ if (source == unsupportleavesItem)
24392501 {
24402502 SupportLeaves(false);
24412503 } else
2442
- if (event.getSource() == hideleavesItem)
2504
+ if (source == hideleavesItem)
24432505 {
24442506 HideLeaves(true);
24452507 } else
2446
- if (event.getSource() == showleavesItem)
2508
+ if (source == showleavesItem)
24472509 {
24482510 HideLeaves(false);
24492511 } else
2450
- if (event.getSource() == markleavesItem)
2512
+ if (source == markleavesItem)
24512513 {
24522514 MarkLeaves(true);
24532515 } else
2454
- if (event.getSource() == unmarkleavesItem)
2516
+ if (source == unmarkleavesItem)
24552517 {
24562518 MarkLeaves(false);
24572519 } else
2458
- if (event.getSource() == flipVItem)
2520
+ if (source == flipVItem)
24592521 {
24602522 FlipV(true);
24612523 } else
2462
- if (event.getSource() == unflipVItem)
2524
+ if (source == unflipVItem)
24632525 {
24642526 FlipV(false);
24652527 } else
2466
- if (event.getSource() == lowTexturesItem)
2528
+ if (source == lowTexturesItem)
24672529 {
24682530 SetTexRes(0);
24692531 } else
2470
- if (event.getSource() == normalTexturesItem)
2532
+ if (source == normalTexturesItem)
24712533 {
24722534 SetTexRes(1);
24732535 } else
2474
- if (event.getSource() == highTexturesItem)
2536
+ if (source == highTexturesItem)
24752537 {
24762538 SetTexRes(2);
24772539 } else
2478
- if (event.getSource() == veryhighTexturesItem)
2540
+ if (source == veryhighTexturesItem)
24792541 {
24802542 SetTexRes(3);
24812543 } else
2482
- if (event.getSource() == maxTexturesItem)
2544
+ if (source == maxTexturesItem)
24832545 {
24842546 SetTexRes(4);
24852547 } else
2486
- if (event.getSource() == panoTexturesItem)
2548
+ if (source == panoTexturesItem)
24872549 {
24882550 SetTexRes(5);
24892551 } else
2490
- if (event.getSource() == reverseNormalsItem)
2552
+ if (source == reverseNormalsItem)
24912553 {
24922554 ReverseNormals();
24932555 } else
2494
- if (event.getSource() == parseverticesItem)
2556
+ if (source == parseverticesItem)
24952557 {
24962558 ParseVertices();
24972559 } else
2498
- if (event.getSource() == textureFieldItem)
2560
+ if (source == textureFieldItem)
24992561 {
25002562 TextureVertices();
25012563 } else
2502
- if (event.getSource() == alignItem)
2564
+ if (source == alignItem)
25032565 {
25042566 Align();
25052567 } else
2506
- if (event.getSource() == mirrorItem)
2568
+ if (source == mirrorItem)
25072569 {
25082570 MirrorPoses();
25092571 } else
2510
- if (event.getSource() == reduceMorphItem)
2572
+ if (source == reduceMorphItem)
25112573 {
25122574 MeshReduction(false);
25132575 } else
2514
- if (event.getSource() == reduce34MorphItem)
2576
+ if (source == reduce34MorphItem)
25152577 {
25162578 MeshReduction(true);
25172579 } else
2518
- if (event.getSource() == reverseTrianglesItem)
2580
+ if (source == reverseTrianglesItem)
25192581 {
25202582 ReverseTriangles();
25212583 } else
2522
- if (event.getSource() == reduceMeshItem)
2584
+ if (source == reduceMeshItem)
25232585 {
25242586 ReduceMesh(false);
25252587 } else
2526
- if (event.getSource() == reduce34MeshItem)
2588
+ if (source == reduce34MeshItem)
25272589 {
25282590 ReduceMesh(true);
25292591 } else
2530
- if (event.getSource() == increaseMeshItem)
2592
+ if (source == increaseMeshItem)
25312593 {
25322594 IncreaseMesh();
25332595 } else
2534
- if (event.getSource() == clipMeshItem)
2596
+ if (source == clipMeshItem)
25352597 {
25362598 ClipMesh();
25372599 } else
2538
- if (event.getSource() == smoothMeshItem)
2600
+ if (source == smoothMeshItem)
25392601 {
25402602 SmoothMesh();
25412603 } else
2542
- if (event.getSource() == transformgeometryItem)
2604
+ if (source == transformgeometryItem)
25432605 {
25442606 TransformGeometry();
25452607 } else
2546
- if (event.getSource() == resetTransformItem)
2608
+ if (source == resetTransformItem)
25472609 {
25482610 ResetTransform();
25492611 } else
2550
- if (event.getSource() == resetCentroidItem)
2612
+ if (source == resetCentroidItem)
25512613 {
25522614 ResetCentroid();
25532615 } else
2554
- if (event.getSource() == resetParentItem)
2616
+ if (source == resetParentItem)
25552617 {
25562618 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25572619 {
....@@ -2561,7 +2623,7 @@
25612623
25622624 refreshContents();
25632625 } else
2564
- if (event.getSource() == repairParentItem)
2626
+ if (source == repairParentItem)
25652627 {
25662628 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25672629 {
....@@ -2575,7 +2637,7 @@
25752637
25762638 refreshContents();
25772639 } else
2578
- if (event.getSource() == repairShadowItem)
2640
+ if (source == repairShadowItem)
25792641 {
25802642 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25812643 {
....@@ -2589,7 +2651,7 @@
25892651
25902652 refreshContents();
25912653 } else
2592
- if (event.getSource() == sortbysizeItem)
2654
+ if (source == sortbysizeItem)
25932655 {
25942656 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25952657 {
....@@ -2601,7 +2663,7 @@
26012663 ResetModel();
26022664 refreshContents();
26032665 } else
2604
- if (event.getSource() == sortbynameItem)
2666
+ if (source == sortbynameItem)
26052667 {
26062668 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26072669 {
....@@ -2613,7 +2675,7 @@
26132675 ResetModel();
26142676 refreshContents();
26152677 } else
2616
- if (event.getSource() == attachPigmentItem)
2678
+ if (source == attachPigmentItem)
26172679 {
26182680 String texture = GetFile("Attach pigment");
26192681 Object3D obj;
....@@ -2625,7 +2687,7 @@
26252687
26262688 refreshContents();
26272689 } else
2628
- if (event.getSource() == detachPigmentItem)
2690
+ if (source == detachPigmentItem)
26292691 {
26302692 Object3D obj;
26312693 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2636,7 +2698,7 @@
26362698
26372699 refreshContents();
26382700 } else
2639
- if (event.getSource() == attachBumpItem)
2701
+ if (source == attachBumpItem)
26402702 {
26412703 String texture = GetFile("Attach bump");
26422704 Object3D obj;
....@@ -2648,7 +2710,7 @@
26482710
26492711 refreshContents();
26502712 } else
2651
- if (event.getSource() == detachBumpItem)
2713
+ if (source == detachBumpItem)
26522714 {
26532715 Object3D obj;
26542716 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2659,7 +2721,7 @@
26592721
26602722 refreshContents();
26612723 } else
2662
- if (event.getSource() == pigmentBumpItem)
2724
+ if (source == pigmentBumpItem)
26632725 {
26642726 Object3D obj;
26652727 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2670,158 +2732,195 @@
26702732
26712733 refreshContents();
26722734 } else
2673
- if (event.getSource() == flashSelectionButton)
2735
+ if (source == flashSelectionButton)
26742736 {
26752737 CameraPane.flash = true;
26762738 refreshContents();
26772739 } else
2678
- if (event.getSource() == oneButton)
2740
+ if (source == oneButton)
26792741 {
26802742 } else
2681
- if (event.getSource() == twoButton)
2743
+ if (source == twoButton)
26822744 {
26832745 radio.layout = twoButton;
26842746 // bug
26852747 //gridPanel.setDividerLocation(1.0);
26862748 //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();
2749
+// bigThree.remove(scenePanel);
2750
+// bigThree.remove(centralPanel);
2751
+// bigThree.remove(XYZPanel);
2752
+// aWindowConstraints.gridx = 0;
2753
+// aWindowConstraints.gridy = 0;
2754
+// aWindowConstraints.gridwidth = 1;
2755
+// // aConstraints.gridheight = 3;
2756
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2757
+// aWindowConstraints.weightx = 0;
2758
+// aWindowConstraints.weighty = 1;
2759
+// //bigThree.add(jtp, aWindowConstraints);
2760
+// aWindowConstraints.weightx = 1;
2761
+// aWindowConstraints.gridwidth = 3;
2762
+// // aConstraints.gridheight = 3;
2763
+// aWindowConstraints.gridx = 1;
2764
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2765
+// bigThree.add(centralPanel, aWindowConstraints);
2766
+// aWindowConstraints.weightx = 0;
2767
+// aWindowConstraints.gridx = 4;
2768
+// aWindowConstraints.gridwidth = 1;
2769
+// // aConstraints.gridheight = 3;
2770
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2771
+// //bigThree.add(XYZPanel, aWindowConstraints);
2772
+// scenePanel.setVisible(false);
2773
+// centralPanel.setVisible(true);
2774
+// XYZPanel.setVisible(false);
2775
+ bigThree.ClearUI();
2776
+ bigThree.add(centralPanel);
2777
+ bigThree.FlushUI();
27112778 } else
2712
- if (event.getSource() == threeButton)
2779
+ if (source == threeButton)
27132780 {
27142781 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();
2782
+
2783
+// bigThree.remove(scenePanel);
2784
+// bigThree.remove(centralPanel);
2785
+// bigThree.remove(XYZPanel);
2786
+// aWindowConstraints.gridx = 0;
2787
+// aWindowConstraints.gridy = 0;
2788
+// aWindowConstraints.gridwidth = 1;
2789
+// // aConstraints.gridheight = 3;
2790
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2791
+// aWindowConstraints.weightx = 0;
2792
+// aWindowConstraints.weighty = 1;
2793
+// //bigThree.add(jtp, aWindowConstraints);
2794
+// aWindowConstraints.weightx = 1;
2795
+// aWindowConstraints.gridwidth = 3;
2796
+// // aConstraints.gridheight = 3;
2797
+// aWindowConstraints.gridx = 1;
2798
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2799
+// bigThree.add(centralPanel, aWindowConstraints);
2800
+// aWindowConstraints.weightx = 0;
2801
+// aWindowConstraints.gridx = 4;
2802
+// aWindowConstraints.gridwidth = 1;
2803
+// // aConstraints.gridheight = 3;
2804
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2805
+// bigThree.add(XYZPanel, aWindowConstraints);
2806
+// bigThree.validate();
2807
+// scenePanel.setVisible(false);
2808
+// centralPanel.setVisible(true);
2809
+// XYZPanel.setVisible(true);
2810
+ bigThree.ClearUI();
2811
+ bigThree.add(centralPanel);
2812
+ bigThree.add(XYZPanel);
2813
+ bigThree.FlushUI();
27392814 } else
2740
- if (event.getSource() == fourButton)
2815
+ if (source == fourButton)
27412816 {
27422817 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();
2818
+
2819
+// bigThree.remove(scenePanel);
2820
+// bigThree.remove(centralPanel);
2821
+// bigThree.remove(XYZPanel);
2822
+// aWindowConstraints.gridx = 0;
2823
+// aWindowConstraints.gridy = 0;
2824
+// aWindowConstraints.gridwidth = 1;
2825
+// // aWindowConstraints.gridheight = 3;
2826
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2827
+// aWindowConstraints.weightx = 1;
2828
+// aWindowConstraints.weighty = 1;
2829
+// bigThree.add(scenePanel, aWindowConstraints);
2830
+// aWindowConstraints.weightx = 1;
2831
+// aWindowConstraints.gridwidth = 3;
2832
+// // aConstraints.gridheight = 3;
2833
+// aWindowConstraints.gridx = 1;
2834
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2835
+// //bigThree.add(cameraPanel, aWindowConstraints);
2836
+// aWindowConstraints.weightx = 0;
2837
+// aWindowConstraints.gridx = 4;
2838
+// aWindowConstraints.gridwidth = 1;
2839
+// // aWindowConstraints.gridheight = 3;
2840
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2841
+// //bigThree.add(XYZPanel, aWindowConstraints);
2842
+// bigThree.validate();
2843
+// scenePanel.setVisible(true);
2844
+// centralPanel.setVisible(false);
2845
+// XYZPanel.setVisible(false);
2846
+ bigThree.ClearUI();
2847
+ bigThree.add(scenePanel);
2848
+ bigThree.FlushUI();
27672849 } else
2768
- if (event.getSource() == sixButton)
2850
+ if (source == sixButton)
27692851 {
27702852 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();
2853
+
2854
+// bigThree.remove(scenePanel);
2855
+// bigThree.remove(centralPanel);
2856
+// bigThree.remove(XYZPanel);
2857
+// aWindowConstraints.gridx = 0;
2858
+// aWindowConstraints.gridy = 0;
2859
+// aWindowConstraints.gridwidth = 1;
2860
+// // aConstraints.gridheight = 3;
2861
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2862
+// aWindowConstraints.weightx = 0;
2863
+// aWindowConstraints.weighty = 1;
2864
+// bigThree.add(scenePanel, aWindowConstraints);
2865
+// aWindowConstraints.weightx = 1;
2866
+// aWindowConstraints.gridwidth = 3;
2867
+// // aWindowConstraints.gridheight = 3;
2868
+// aWindowConstraints.gridx = 1;
2869
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2870
+// bigThree.add(centralPanel, aWindowConstraints);
2871
+// aWindowConstraints.weightx = 0;
2872
+// aWindowConstraints.gridx = 4;
2873
+// aWindowConstraints.gridwidth = 1;
2874
+// // aWindowConstraints.gridheight = 3;
2875
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2876
+// //bigThree.add(XYZPanel, aConstraints);
2877
+// bigThree.validate();
2878
+// scenePanel.setVisible(true);
2879
+// centralPanel.setVisible(true);
2880
+// XYZPanel.setVisible(false);
2881
+ bigThree.ClearUI();
2882
+ bigThree.add(scenePanel);
2883
+ bigThree.add(centralPanel);
2884
+ bigThree.FlushUI();
27952885 } else
2796
- if (event.getSource() == sevenButton)
2886
+ if (source == sevenButton)
27972887 {
27982888 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();
2889
+
2890
+// bigThree.remove(scenePanel);
2891
+// bigThree.remove(centralPanel);
2892
+// bigThree.remove(XYZPanel);
2893
+// aWindowConstraints.gridx = 0;
2894
+// aWindowConstraints.gridy = 0;
2895
+// aWindowConstraints.gridwidth = 1;
2896
+// // aWindowConstraints.gridheight = 3;
2897
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2898
+// aWindowConstraints.weightx = 0;
2899
+// aWindowConstraints.weighty = 1;
2900
+// bigThree.add(scenePanel, aWindowConstraints);
2901
+// aWindowConstraints.weightx = 1;
2902
+// aWindowConstraints.gridwidth = 3;
2903
+// // aWindowConstraints.gridheight = 3;
2904
+// aWindowConstraints.gridx = 1;
2905
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2906
+// bigThree.add(centralPanel, aWindowConstraints);
2907
+// aWindowConstraints.weightx = 0;
2908
+// aWindowConstraints.gridx = 4;
2909
+// aWindowConstraints.gridwidth = 1;
2910
+// // aConstraints.gridheight = 3;
2911
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2912
+// bigThree.add(XYZPanel, aWindowConstraints);
2913
+// bigThree.validate();
2914
+// scenePanel.setVisible(true);
2915
+// centralPanel.setVisible(true);
2916
+// XYZPanel.setVisible(true);
2917
+ bigThree.ClearUI();
2918
+ bigThree.add(scenePanel);
2919
+ bigThree.add(centralPanel);
2920
+ bigThree.add(XYZPanel);
2921
+ bigThree.FlushUI();
28232922 } else
2824
- if (event.getSource() == rootButton)
2923
+ if (source == rootButton)
28252924 {
28262925 Object3D obj;
28272926 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2833,7 +2932,7 @@
28332932
28342933 refreshContents(true);
28352934 } else
2836
- if (event.getSource() == closeButton)
2935
+ if (source == closeButton)
28372936 {
28382937 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28392938 cRadio ab;
....@@ -2854,11 +2953,11 @@
28542953 }
28552954 refreshContents(true);
28562955 } else
2857
- if (event.getSource() == editItem || event.getSource() == editButton)
2956
+ if (source == editItem || source == editButton)
28582957 {
28592958 EditSelection(false);
28602959 } else
2861
- if (event.getSource() == uneditButton)
2960
+ if (source == uneditButton)
28622961 {
28632962 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28642963 {
....@@ -2870,12 +2969,12 @@
28702969
28712970 child.editWindow = null; // ???????????
28722971 }
2873
- objEditor.ctrlPanel.revalidate();
2972
+ objEditor.ctrlPanel.FlushUI();
28742973 //objEditor.jTree.clearSelection();
28752974 //objEditor.ResetSliders();
28762975 refreshContents(true);
28772976 } else
2878
- if (event.getSource() == clearPanelButton)
2977
+ if (source == clearPanelButton)
28792978 {
28802979 assert(copy == group);
28812980 //copy.ClearUI();
....@@ -2886,7 +2985,7 @@
28862985 listUI.clear();
28872986 refreshContents(true);
28882987 } else
2889
- if (event.getSource() == allParamsButton)
2988
+ if (source == allParamsButton)
28902989 {
28912990 assert(copy == group);
28922991
....@@ -2907,19 +3006,19 @@
29073006
29083007 refreshContents(true);
29093008 } else
2910
- if (event.getSource() == unselectButton)
3009
+ if (source == unselectButton)
29113010 {
29123011 objEditor.jTree.clearSelection();
29133012 // ?? oct 2012 GrafreeD.clipboard.clear();
29143013 objEditor.ResetSliders();
29153014 refreshContents(true);
29163015 } else
2917
- if(event.getSource() instanceof cRadio)
3016
+ if(source instanceof cRadio)
29183017 {
29193018 group.parent = keepparent;
29203019 group.attributes = 0;
29213020 //group.editWindow = null;
2922
- /*cRadio*/ radio = (cRadio)event.getSource();
3021
+ /*cRadio*/ radio = (cRadio)source;
29233022 Object3D obj = radio.GetObject();
29243023 System.out.println("Edit " + obj);
29253024 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -3589,11 +3688,11 @@
35893688
35903689 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35913690
3592
- boolean random = CameraPane.RANDOM;
3593
- CameraPane.RANDOM = false; // parse all random nodes
3691
+ boolean random = CameraPane.SWITCH;
3692
+ CameraPane.SWITCH = false; // parse all random nodes
35943693 lowres.linkVerticesThis(null);
35953694 lowres.linkVerticesThis(sn);
3596
- CameraPane.RANDOM = random;
3695
+ CameraPane.SWITCH = random;
35973696
35983697 System.err.flush();
35993698
....@@ -4078,12 +4177,12 @@
40784177 System.err.println("info : " + child.GetPath());
40794178 }
40804179 }
4081
- else
4082
- {
4083
- objEditor.SetMaterial(group); // .GetMaterial());
4084
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4085
- System.err.println("info : " + group.GetPath());
4086
- }
4180
+// else
4181
+// {
4182
+// objEditor.SetMaterial(group); // .GetMaterial());
4183
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4184
+// System.err.println("info : " + group.GetPath());
4185
+// }
40874186
40884187 objEditor.SetText(); // jan 2014
40894188
....@@ -4351,7 +4450,7 @@
43514450 refreshContents();
43524451 }
43534452
4354
- void pasteInto(boolean copyit)
4453
+ void pasteInto(boolean copyit, boolean clone)
43554454 {
43564455 // if (GrafreeD.clipboard == null)
43574456 // return;
....@@ -4380,7 +4479,14 @@
43804479 if (copyit)
43814480 {
43824481 // paste(false);
4383
- CloneClipboard(false); // sept 2014
4482
+ if (clone)
4483
+ {
4484
+ CloneClipboard(false); // sept 2014
4485
+ }
4486
+ else
4487
+ {
4488
+ paste(false);
4489
+ }
43844490 }
43854491 else
43864492 {
....@@ -4924,10 +5030,12 @@
49245030 cButton flashSelectionButton;
49255031 cButton editButton;
49265032 cButton uneditButton;
5033
+ JCheckBox allParamsButton;
49275034 cButton clearpanelButton;
4928
- cButton allParamsButton;
49295035 cButton unselectButton;
49305036
5037
+ cButton oneStepButton;
5038
+
49315039 cButton screenfitButton;
49325040 cButton screenfitpointButton;
49335041 cButton snapobjectButton;
....@@ -4982,6 +5090,7 @@
49825090 private MenuItem mergeGeometriesItem;
49835091 private MenuItem copyItem;
49845092 private MenuItem pasteItem;
5093
+ private MenuItem pasteIntoItem;
49855094 private MenuItem pasteLinkItem;
49865095 private MenuItem pasteCloneItem;
49875096 private MenuItem pasteExpandItem;
....@@ -5079,7 +5188,7 @@
50795188 private MenuItem blobItem;
50805189 private MenuItem latheItem;
50815190 private MenuItem bezierItem;
5082
- private MenuItem checkerItem;
5191
+ private MenuItem overlayItem;
50835192 private MenuItem meshItem;
50845193 // private MenuItem meshGroupItem;
50855194 private MenuItem springItem;