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,110 +482,98 @@
433482 oe.radioPanel.add(dummyButton);
434483 oe.buttonGroup.add(dummyButton);
435484 */
436
- aConstraints.gridy += 1;
437
-
438485 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439486
440
- oe.aConstraints.gridwidth = 1;
441
- oe.aConstraints.gridx = 0;
442
-
443
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
487
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
444488 liveCB.setToolTipText("Enabled animation");
445489 liveCB.addItemListener(this);
446490
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), 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);
496
+ fastCB.setToolTipText("Fast mode");
497
+ fastCB.addItemListener(this);
498
+
499
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
449500 trackCB.setToolTipText("Enable tracking");
450501 trackCB.addItemListener(this);
451502
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
503
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
454504 screenfitButton.setToolTipText("Screen fit");
455505 screenfitButton.addActionListener(this);
456
- oe.aConstraints.gridx += 1;
506
+
457507 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
458508 // screenfitpointButton.addActionListener(this);
459
-// oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
461
- snapobjectButton.addActionListener(this);
462
- snapobjectButton.setToolTipText("Snap Object");
463
- oe.aConstraints.gridx += 1;
464509
465
- //aConstraints.gridx = 0;
466
- //aConstraints.gridy += 1;
467
- oe.aConstraints.weighty = 0;
468
- oe.aConstraints.gridwidth = 1;
469
-
470
- 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);
471518 flashSelectionButton.setToolTipText("Show selection");
472519 flashSelectionButton.addActionListener(this);
473520
474
- oe.toolbarPanel.add(new cButton(" ", false));
521
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
475522
476
- oe.aConstraints.gridx += 1;
477
- oe.aConstraints.weighty = 0;
478
- oe.aConstraints.gridwidth = 1;
479
-
480
- //
481
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
523
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
482524 twoButton.setToolTipText("Show center view only");
483525 twoButton.addActionListener(this);
484
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
526
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
485527 fourButton.addActionListener(this);
486528 fourButton.setToolTipText("Show left panel only");
487
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
529
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
488530 sixButton.setToolTipText("2-column layout left");
489531 sixButton.addActionListener(this);
490
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
532
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
491533 threeButton.setToolTipText("2-column layout right");
492534 threeButton.addActionListener(this);
493
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
535
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
494536 sevenButton.setToolTipText("3-column layout");
495537 sevenButton.addActionListener(this);
496538 //
497539
498
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
499
- 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");
500542 rootButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
543
+
544
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
503545 closeButton.setToolTipText("Close tab");
504546 closeButton.addActionListener(this);
505547 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
506548 //clearButton.addActionListener(this);
507
- oe.aConstraints.gridx += 1;
508549
509
- oe.aConstraints.gridx = 1; //
510
- 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");
511554 editButton.addActionListener(this);
512
- oe.aConstraints.gridx += 1;
513
- oe.aConstraints.weighty = 0;
514
- oe.aConstraints.gridwidth = 1;
515555
516
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
556
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
557
+ uneditButton.setToolTipText("Unedit selection");
517558 uneditButton.addActionListener(this);
518559
519
- oe.aConstraints.gridx += 1;
520
- oe.aConstraints.weighty = 0;
521
- oe.aConstraints.gridwidth = 1;
522
-
523
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
524
- clearPanelButton.addActionListener(this);
525
-
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- 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");
531562 allParamsButton.addActionListener(this);
532563
533
- oe.aConstraints.gridx += 1;
534
- oe.aConstraints.weighty = 0;
535
- oe.aConstraints.gridwidth = 1;
536
-
537
- 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");
538570 unselectButton.addActionListener(this);
539571
572
+ commandsPanel.preferredHeight = 1;
573
+
574
+ oe.treePanel.add(commandsPanel);
575
+ oe.treePanel.Return();
576
+
540577 // oe.aConstraints.gridx += 1;
541578 // oe.aConstraints.weighty = 0;
542579 // oe.aConstraints.gridwidth = 1;
....@@ -548,40 +585,37 @@
548585 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
549586 // gcButton.addActionListener(this);
550587
551
- oe.aConstraints.gridx = 0;
552
- oe.aConstraints.gridy += 1;
553
-
554
- //ctrlPanel.add(objList = new List(5, true));
555
- oe.aConstraints.gridwidth = 100;
556
- // oe.aConstraints.gridheight = 100;
557
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
558
- oe.aConstraints.gridheight = 1;
559
- oe.aConstraints.weighty = 0.5;
560
- oe.aConstraints.gridx = 0;
561
- JScrollPane jSP;
588
+ cGridBag jSPPanel = new cGridBag();
589
+
590
+ JScrollPane jSP;
562591 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
563
- 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);
564593 ResetModel();
565
- oe.aConstraints.weighty = 0.5;
566
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
567
- oe.aConstraints.gridy += 1;
568
- oe.aConstraints.gridwidth = 1;
594
+
595
+ oe.treePanel.add(jSPPanel);
596
+ oe.treePanel.Return();
569597
570
- oe.aConstraints.weighty = 0;
571
- oe.aConstraints.gridwidth = 2;
572
-
573
- 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");
574602 colorCB.addItemListener(this);
575
- oe.aConstraints.gridx += 2;
576
- 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");
577606 materialCB.addItemListener(this);
578
- oe.aConstraints.gridx += 2;
579
- 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");
580610 textureCB.addItemListener(this);
581611
582
- oe.aConstraints.gridx = 0;
583
- oe.aConstraints.gridy += 1;
612
+ copyOptionsPanel.preferredHeight = 1;
613
+ oe.treePanel.add(copyOptionsPanel);
614
+ oe.treePanel.Return();
584615
616
+// mainPanel.setDividerLocation(0.5); //1.0);
617
+// mainPanel.setResizeWeight(0.5);
618
+
585619 //jList.addListSelectionListener(this);
586620 oe.jTree.addTreeSelectionListener(this);
587621 //jTree.setRootVisible(false);
....@@ -604,45 +638,37 @@
604638 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
605639 }
606640
607
- void AddOptions(JPanel panel, GridBagConstraints constraints)
641
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
608642 {
609
- constraints.gridx = 0;
610
- constraints.gridy = 0;
611
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), constraints);
612
- fastCB.setToolTipText("Fast mode");
613
- fastCB.addItemListener(this);
614
- constraints.gridy += 1;
615
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), constraints);
616
- supportCB.setToolTipText("Enabled rigging");
617
- supportCB.addItemListener(this);
618
-
619
- // constraints.gridy += 1;
620
- // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
621
- // localCB.addItemListener(this);
622
-
623
- constraints.gridy += 1;
624
- panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), constraints);
625
- crowdCB.setToolTipText("Used for crowds");
626
- crowdCB.addItemListener(this);
627
-
628
- constraints.gridy += 1;
629
- panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), constraints);
630
- smoothCB.setToolTipText("Snapping delay");
631
- smoothCB.addItemListener(this);
632
-
633
- constraints.gridy += 1;
634
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), constraints);
635
- slowCB.setToolTipText("Smooth interpolation");
636
- slowCB.addItemListener(this);
637
- constraints.gridy += 1;
638
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), constraints);
643
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
639644 boxCB.setToolTipText("Display bounding boxes");
640645 boxCB.addItemListener(this);
641
- constraints.gridy += 1;
642
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints);
646
+
647
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
643648 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
644649 zoomBoxCB.addItemListener(this);
645650
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
+
646672 // constraints.gridy += 1;
647673 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
648674 // speakerMocapCB.addItemListener(this);
....@@ -650,16 +676,16 @@
650676 if (false)
651677 {
652678 // handled in scripts
653
- constraints.gridy += 1;
654
- panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints);
679
+ //constraints.gridy += 1;
680
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
655681 speakerCameraCB.addItemListener(this);
656682
657
- constraints.gridy += 1;
658
- panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints);
683
+ //constraints.gridy += 1;
684
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
659685 speakerFocusCB.addItemListener(this);
660686
661
- constraints.gridy += 1;
662
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints);
687
+ //constraints.gridy += 1;
688
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
663689 smoothfocusCB.addItemListener(this);
664690 }
665691
....@@ -667,14 +693,20 @@
667693 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
668694 // debugCB.addItemListener(this);
669695
670
- constraints.gridy += 1;
671
- panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints);
696
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
672697 oeilCB.addItemListener(this);
673698
674
- constraints.gridy += 1;
675
- panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints);
699
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
676700 lookAtCB.setToolTipText("Look-at target");
677701 lookAtCB.addItemListener(this);
702
+
703
+ }
704
+
705
+ cGridBag fill = new cGridBag();
706
+
707
+ fill.preferredHeight = 200;
708
+
709
+ panel.add(fill);
678710
679711 }
680712
....@@ -959,11 +991,11 @@
959991 {
960992 loadClipboard(true);
961993 objEditor.jTree.setSelectionPath(destinationPath);
962
- pasteInto(false);
994
+ pasteInto(false, false);
963995 } else {
964996 loadClipboard(false);
965997 objEditor.jTree.setSelectionPath(destinationPath);
966
- pasteInto(false); // true); // ???
998
+ pasteInto(false, false); // true); // ???
967999 }
9681000 }
9691001 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1085,27 +1117,33 @@
10851117 kleinItem.addActionListener(this);
10861118 particleItem = menu.add(new MenuItem("Particle system"));
10871119 particleItem.addActionListener(this);
1120
+ if (Globals.ADVANCED)
1121
+ {
10881122 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10891123 ragdollItem.addActionListener(this);
10901124 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10911125 ragdoll2Item.addActionListener(this);
1126
+ }
10921127 menu.add("-");
1093
- meshItem = menu.add(new MenuItem("Mesh"));
1128
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10941129 meshItem.addActionListener(this);
10951130 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10961131 // meshGroupItem.addActionListener(this);
1132
+ if (Globals.ADVANCED)
1133
+ {
10971134 springItem = menu.add(new MenuItem("Spring"));
10981135 springItem.addActionListener(this);
10991136 flagItem = menu.add(new MenuItem("Flag"));
11001137 flagItem.addActionListener(this);
1101
- bezierItem = menu.add(new MenuItem("Patch"));
1102
- bezierItem.addActionListener(this);
1103
- checkerItem = menu.add(new MenuItem("Checker"));
1104
- checkerItem.addActionListener(this);
11051138 blobItem = menu.add(new MenuItem("Blob"));
11061139 blobItem.addActionListener(this);
11071140 latheItem = menu.add(new MenuItem("Lathe"));
11081141 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);
11091147 lightItem = menu.add(new MenuItem("Light"));
11101148 lightItem.addActionListener(this);
11111149 menu.add("-");
....@@ -1115,34 +1153,39 @@
11151153 loopItem.addActionListener(this);
11161154 doubleItem = menu.add(new MenuItem("Fork"));
11171155 doubleItem.addActionListener(this);
1156
+ if (Globals.ADVANCED)
1157
+ {
11181158 tripleItem = menu.add(new MenuItem("Trident"));
11191159 tripleItem.addActionListener(this);
1160
+ }
11201161 }
11211162
11221163 void buildToolsMenu(Menu menu)
11231164 {
11241165 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11251166 animationItem.addItemListener(this);
1126
- animationItem.setState(CameraPane.ANIMATION);
1167
+ animationItem.setState(Globals.ANIMATION);
11271168
11281169 menu.add("-");
11291170 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11301171 parseverticesItem.addActionListener(this);
11311172 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11321173 textureFieldItem.addActionListener(this);
1133
- alignItem = menu.add(new MenuItem("Align"));
1174
+ alignItem = menu.add(new MenuItem("Align Objects"));
11341175 alignItem.addActionListener(this);
1135
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1136
- mirrorItem.addActionListener(this);
11371176 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11381177 reduceMorphItem.addActionListener(this);
11391178 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11401179 reduce34MorphItem.addActionListener(this);
1141
-
1180
+ menu.add("-");
11421181 menu.add(computeAOItem = new MenuItem("Compute AO"));
11431182 computeAOItem.addActionListener(this);
1144
- menu.add("-");
11451183
1184
+ if (Globals.ADVANCED)
1185
+ {
1186
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1187
+ mirrorItem.addActionListener(this);
1188
+ menu.add("-");
11461189 menu.add(memoryItem = new MenuItem("Memory Usage"));
11471190 memoryItem.addActionListener(this);
11481191 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1165,6 +1208,7 @@
11651208 menu.add("-");
11661209 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11671210 editScriptItem.addActionListener(this);
1211
+ }
11681212 }
11691213
11701214 void ScreenFit()
....@@ -1518,6 +1562,7 @@
15181562 //
15191563 public void actionPerformed(ActionEvent event) // , Object arg)
15201564 {
1565
+ Object source = event.getSource();
15211566 /*
15221567 if (event.getSource() == nameField)
15231568 {
....@@ -1529,11 +1574,11 @@
15291574 }
15301575 else
15311576 */
1532
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1577
+ if (source == lookAtItem || source == lookFromItem)
15331578 {
15341579 ScreenFit();
15351580 } else
1536
- if (event.getSource() == switchItem)
1581
+ if (source == switchItem)
15371582 {
15381583 cVector v1 = new cVector();
15391584 cVector v2 = new cVector();
....@@ -1542,11 +1587,11 @@
15421587 objEditor.cameraView.renderCamera.setAim(v2, v1);
15431588 objEditor.cameraView.repaint();
15441589 } else
1545
- if (event.getSource() == rectoidItem)
1590
+ if (source == rectoidItem)
15461591 {
15471592 makeSomething(new Box());
15481593 } else
1549
- if (event.getSource() == particleItem)
1594
+ if (source == particleItem)
15501595 {
15511596 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15521597 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1567,9 +1612,9 @@
15671612 applyExample(particleGeom, "SMOKE");
15681613 makeSomething(particleGeom);
15691614 } else
1570
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1615
+ if (source == ragdollItem || source == ragdoll2Item)
15711616 {
1572
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1617
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15731618
15741619 ragdoll.toParent = LA.newMatrix();
15751620 ragdoll.fromParent = LA.newMatrix();
....@@ -1587,7 +1632,7 @@
15871632 } else
15881633 /*
15891634 */
1590
- if (event.getSource() == heightFieldItem)
1635
+ if (source == heightFieldItem)
15911636 {
15921637 Object3D obj = new Object3D();
15931638
....@@ -1625,31 +1670,31 @@
16251670
16261671 makeSomething(obj);
16271672 } else
1628
- if (event.getSource() == gridItem)
1673
+ if (source == gridItem)
16291674 {
16301675 makeSomething(new Grid());
16311676 } else
1632
- if (event.getSource() == ellipsoidItem)
1677
+ if (source == ellipsoidItem)
16331678 {
16341679 makeSomething(new Sphere());
16351680 } else
1636
- if (event.getSource() == coneItem)
1681
+ if (source == coneItem)
16371682 {
16381683 makeSomething(new Cone());
16391684 } else
1640
- if (event.getSource() == torusItem)
1685
+ if (source == torusItem)
16411686 {
16421687 makeSomething(new Torus());
16431688 } else
1644
- if (event.getSource() == superItem)
1689
+ if (source == superItem)
16451690 {
16461691 makeSomething(new Superellipsoid());
16471692 } else
1648
- if (event.getSource() == kleinItem)
1693
+ if (source == kleinItem)
16491694 {
16501695 makeSomething(new Klein());
16511696 } else
1652
- if (event.getSource() == blobItem)
1697
+ if (source == blobItem)
16531698 {
16541699 Blob blob = new Blob();
16551700 BlobComponent comp = new BlobComponent();
....@@ -1657,15 +1702,15 @@
16571702 //blob.retile();
16581703 makeSomething(blob);
16591704 } else
1660
- if (event.getSource() == latheItem)
1705
+ if (source == latheItem)
16611706 {
16621707 makeSomething(new Lathe());
16631708 } else
1664
- if (event.getSource() == bezierItem)
1709
+ if (source == bezierItem)
16651710 {
16661711 makeSomething(new BezierSurface());
16671712 } else
1668
- if (event.getSource() == checkerItem)
1713
+ if (source == overlayItem)
16691714 {
16701715 /*
16711716 Object3D obj = new BezierSurface(5,8);
....@@ -1680,7 +1725,7 @@
16801725 */
16811726 makeSomething(new Checker());
16821727 } else
1683
- if (event.getSource() == meshItem)
1728
+ if (source == meshItem)
16841729 {
16851730 Object3D itemtomake = new Object3D();
16861731 Object3D child;
....@@ -1701,35 +1746,35 @@
17011746 makeSomething(child);
17021747 }
17031748 } else
1704
- if (event.getSource() == springItem)
1749
+ if (source == springItem)
17051750 {
17061751 cSpring s = new cSpring();
17071752 s.setup();
17081753 makeSomething(s);
17091754 } else
1710
- if (event.getSource() == flagItem)
1755
+ if (source == flagItem)
17111756 {
17121757 cSpring s = new cFlag();
17131758 s.setup();
17141759 makeSomething(s);
17151760 } else
1716
- if (event.getSource() == lightItem)
1761
+ if (source == lightItem)
17171762 {
17181763 makeSomething(new Light());
17191764 } else
1720
- if (event.getSource() == csgItem)
1765
+ if (source == csgItem)
17211766 {
17221767 group(new CSG());
17231768 } else
1724
- if (event.getSource() == templateItem)
1769
+ if (source == templateItem)
17251770 {
17261771 group(new cTemplate());
17271772 } else
1728
- if (event.getSource() == attributeItem)
1773
+ if (source == attributeItem)
17291774 {
17301775 makeSomething(new Attribute());
17311776 } else
1732
- if (event.getSource() == pointflowItem)
1777
+ if (source == pointflowItem)
17331778 {
17341779 makeSomething(new PointFlow());
17351780 } else
....@@ -1741,7 +1786,7 @@
17411786 } else
17421787 */
17431788
1744
- if (event.getSource() == superLoopItem)
1789
+ if (source == superLoopItem)
17451790 {
17461791 Composite g = new cGroup();
17471792 for (int i=0; i<15; i++)
....@@ -1763,7 +1808,7 @@
17631808
17641809 group(g);
17651810 } else
1766
- if (event.getSource() == loopItem)
1811
+ if (source == loopItem)
17671812 {
17681813 Composite csg = new GroupLeaf();
17691814 csg.count = 5;
....@@ -1772,7 +1817,7 @@
17721817 csg.addChild(child);
17731818 child.addChild(csg);
17741819 } else
1775
- if (event.getSource() == doubleItem)
1820
+ if (source == doubleItem)
17761821 {
17771822 Composite csg = new GroupLeaf();
17781823 csg.count = 5;
....@@ -1784,7 +1829,7 @@
17841829 csg.addChild(child);
17851830 child.addChild(csg);
17861831 } else
1787
- if (event.getSource() == tripleItem)
1832
+ if (source == tripleItem)
17881833 {
17891834 Composite csg = new GroupLeaf();
17901835 csg.count = 4;
....@@ -1800,70 +1845,75 @@
18001845 child.addChild(csg);
18011846 } else
18021847
1803
- if (event.getSource() == importGFDItem)
1848
+ if (source == importGFDItem)
18041849 {
18051850 ImportGFD();
18061851 } else
1807
- if (event.getSource() == importVRMLX3DItem)
1852
+ if (source == importVRMLX3DItem)
18081853 {
18091854 ImportVRMLX3D();
18101855 } else
1811
- if (event.getSource() == import3DSItem)
1856
+ if (source == import3DSItem)
18121857 {
18131858 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
18141859 } else
1815
- if (event.getSource() == importOBJItem)
1860
+ if (source == importOBJItem)
18161861 {
18171862 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
18181863 } else
1819
- if (event.getSource() == computeAOItem)
1864
+ if (source == computeAOItem)
18201865 {
18211866 Globals.drawMode = CameraPane.OCCLUSION;
18221867 Globals.theRenderer.repaint();
18231868 } else
1824
- if (event.getSource() == recompileItem)
1869
+ if (source == recompileItem)
18251870 {
18261871 Recompile();
18271872 refreshContents();
18281873 } else
1829
- if (event.getSource() == editScriptItem)
1874
+ if (source == editScriptItem)
18301875 {
18311876 OpenDialog();
18321877 refreshContents();
18331878 } else
1834
- if (event.getSource() == invariantsItem)
1879
+ if (source == invariantsItem)
18351880 {
18361881 System.out.println("Invariants:");
18371882 GrafreeD.grafreeD.universe.invariants();
18381883 } else
1839
- if (event.getSource() == memoryItem)
1884
+ if (source == memoryItem)
18401885 {
18411886 //System.out.println("Invariants:");
18421887 PrintMemory();
18431888 } else
1844
- if (event.getSource() == pathItem)
1889
+ if (source == pathItem)
18451890 {
18461891 PrintPath();
18471892 } else
1848
- if (event.getSource() == analyzeItem)
1893
+ if (source == analyzeItem)
18491894 {
18501895 AnalyzeObject();
18511896 } else
1852
- if (event.getSource() == dumpItem)
1897
+ if (source == dumpItem)
18531898 {
18541899 DumpObject();
18551900 } else
1856
- if (event.getSource() == screenfitButton)
1901
+ if (source == oneStepButton)
1902
+ {
1903
+ Globals.ONESTEP = true;
1904
+ cameraView.repaint();
1905
+ } else
1906
+ if (source == screenfitButton)
18571907 {
18581908 //Reload(lastConverter, lastFilename, true);
18591909 ScreenFit();
18601910 } else
1861
- if (event.getSource() == screenfitpointButton)
1911
+ if (source == screenfitpointButton)
18621912 {
18631913 //Reload(lastConverter, lastFilename, true);
18641914 ScreenFitPoint();
18651915 } else
1866
- if (event.getSource() == snapobjectButton)
1916
+ if (source == snapobjectButton)
18671917 {
18681918 //Reload(lastConverter, lastFilename, true);
18691919 SnapObject();
....@@ -1874,13 +1924,13 @@
18741924 // Recompile();
18751925 // refreshContents();
18761926 // } else
1877
- if (event.getSource() == gcButton)
1927
+ if (source == gcButton)
18781928 {
18791929 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18801930 System.gc();
18811931 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18821932 } else
1883
- if (event.getSource() == editLeafItem)
1933
+ if (source == editLeafItem)
18841934 {
18851935 Object3D obj;
18861936 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1894,62 +1944,66 @@
18941944 }
18951945 refreshContents(true);
18961946 } else
1897
- if (event.getSource() == openWindowItem)
1947
+ if (source == openWindowItem)
18981948 {
18991949 EditSelection(true);
19001950 } else
1901
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1951
+ if (source == cutItem || source == clearButton)
19021952 {
19031953 loadClipboard(true);
19041954 } else
1905
- if (event.getSource() == duplicateItem)
1955
+ if (source == duplicateItem)
19061956 {
19071957 Object3D keep = GrafreeD.clipboard;
19081958 loadClipboard(false);
19091959 paste(false);
19101960 GrafreeD.clipboard = keep;
19111961 } else
1912
- if (event.getSource() == cloneItem)
1962
+ if (source == cloneItem)
19131963 {
19141964 CloneSelection(false);
19151965 } else
1916
- if (event.getSource() == cloneSupportItem)
1966
+ if (source == cloneSupportItem)
19171967 {
19181968 CloneSelection(true);
19191969 } else
1920
- if (event.getSource() == copyItem)
1970
+ if (source == copyItem)
19211971 {
19221972 loadClipboard(false);
19231973 } else
1924
- if (event.getSource() == pasteItem)
1974
+ if (source == pasteItem)
19251975 {
19261976 paste(false);
19271977 } else
1928
- if (event.getSource() == pasteLinkItem)
1978
+ if (source == pasteIntoItem)
19291979 {
1930
- pasteInto(false);
1980
+ pasteInto(true, false);
19311981 } else
1932
- if (event.getSource() == pasteCloneItem)
1982
+ if (source == pasteLinkItem)
19331983 {
1934
- pasteInto(true);
1984
+ pasteInto(false, false);
19351985 } else
1936
- if (event.getSource() == pasteExpandItem)
1986
+ if (source == pasteCloneItem)
1987
+ {
1988
+ pasteInto(true, true);
1989
+ } else
1990
+ if (source == pasteExpandItem)
19371991 {
19381992 paste(true);
19391993 } else
1940
- if (event.getSource() == synchronizeItem)
1994
+ if (source == synchronizeItem)
19411995 {
19421996 Overwrite(Object3D.TRANSFORM);
19431997 } else
1944
- if (event.getSource() == overwriteNameItem)
1998
+ if (source == overwriteNameItem)
19451999 {
19462000 Overwrite(Object3D.NAME);
19472001 } else
1948
- if (event.getSource() == overwriteUVItem)
2002
+ if (source == overwriteUVItem)
19492003 {
19502004 Overwrite(Object3D.UV);
19512005 } else
1952
- if (event.getSource() == overwriteMatItem)
2006
+ if (source == overwriteMatItem)
19532007 {
19542008 /* july 2015
19552009 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1969,7 +2023,7 @@
19692023
19702024 Overwrite(dropAttributes);
19712025 }
1972
- if (event.getSource() == overwriteGeoItem)
2026
+ if (source == overwriteGeoItem)
19732027 {
19742028 Overwrite(Object3D.GEOMETRY);
19752029 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1986,7 +2040,7 @@
19862040 // refreshContents();
19872041 // }
19882042 } else
1989
- if (event.getSource() == generateMeshItem)
2043
+ if (source == generateMeshItem)
19902044 {
19912045 //if (group.selection.size() == 1)
19922046 // for (int i=0; i<group.selection.size(); i++)
....@@ -1997,7 +2051,7 @@
19972051 ResetModel();
19982052 refreshContents();
19992053 } else
2000
- if (event.getSource() == extractGeometriesItem)
2054
+ if (source == extractGeometriesItem)
20012055 {
20022056 boolean one = false;
20032057
....@@ -2024,7 +2078,7 @@
20242078 ResetModel();
20252079 refreshContents();
20262080 } else
2027
- if (event.getSource() == cloneGeometriesItem)
2081
+ if (source == cloneGeometriesItem)
20282082 {
20292083 boolean one = false;
20302084
....@@ -2050,7 +2104,7 @@
20502104 ResetModel();
20512105 refreshContents();
20522106 } else
2053
- if (event.getSource() == shareGeometriesItem)
2107
+ if (source == shareGeometriesItem)
20542108 {
20552109 boolean one = false;
20562110
....@@ -2080,7 +2134,7 @@
20802134 refreshContents();
20812135 }
20822136 } else
2083
- if (event.getSource() == mergeGeometriesItem)
2137
+ if (source == mergeGeometriesItem)
20842138 {
20852139 boolean one = false;
20862140
....@@ -2110,7 +2164,7 @@
21102164 ResetModel();
21112165 refreshContents();
21122166 } else
2113
- if (event.getSource() == linkverticesItem)
2167
+ if (source == linkverticesItem)
21142168 {
21152169 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21162170 // {
....@@ -2133,38 +2187,38 @@
21332187 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
21342188 for (int i=0; i<group.selection.size(); i++)
21352189 {
2136
- boolean random = CameraPane.RANDOM;
2137
- CameraPane.RANDOM = false; // parse all random nodes
2190
+ boolean random = CameraPane.SWITCH;
2191
+ CameraPane.SWITCH = false; // parse all random nodes
21382192 group.selection.get(i).linkVerticesThis(content);
21392193 // group.selection.get(i).setMasterThis(content); // should be identity
2140
- CameraPane.RANDOM = random;
2194
+ CameraPane.SWITCH = random;
21412195 }
21422196 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21432197 refreshContents();
21442198 }
21452199 } else
2146
- if (event.getSource() == resetsupportItem)
2200
+ if (source == resetsupportItem)
21472201 {
21482202 for (int i=0; i<group.selection.size(); i++)
21492203 {
2150
- boolean random = CameraPane.RANDOM;
2151
- CameraPane.RANDOM = false; // parse all random nodes
2204
+ boolean random = CameraPane.SWITCH;
2205
+ CameraPane.SWITCH = false; // parse all random nodes
21522206 group.selection.get(i).linkVerticesThis(null);
2153
- CameraPane.RANDOM = random;
2207
+ CameraPane.SWITCH = random;
21542208 }
21552209
21562210 refreshContents();
21572211 } else
2158
- if (event.getSource() == relinkverticesItem)
2212
+ if (source == relinkverticesItem)
21592213 {
2160
- boolean random = CameraPane.RANDOM;
2161
- CameraPane.RANDOM = false; // parse all random nodes
2214
+ boolean random = CameraPane.SWITCH;
2215
+ CameraPane.SWITCH = false; // parse all random nodes
21622216 group.selection.RelinkToSupport();
2163
- CameraPane.RANDOM = random;
2217
+ CameraPane.SWITCH = random;
21642218
21652219 refreshContents();
21662220 } else
2167
- if (event.getSource() == resetreferencesItem)
2221
+ if (source == resetreferencesItem)
21682222 {
21692223 for (int i=0; i<group.selection.size(); i++)
21702224 {
....@@ -2173,7 +2227,7 @@
21732227
21742228 refreshContents();
21752229 } else
2176
- if (event.getSource() == setMasterItem)
2230
+ if (source == setMasterItem)
21772231 {
21782232 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21792233 {
....@@ -2186,7 +2240,7 @@
21862240 refreshContents();
21872241 }
21882242 } else
2189
- if (event.getSource() == poseMeshItem)
2243
+ if (source == poseMeshItem)
21902244 {
21912245 if (group.selection.size() == 1)
21922246 {
....@@ -2205,19 +2259,19 @@
22052259 }
22062260
22072261 } else
2208
- if (event.getSource() == revertMeshItem)
2262
+ if (source == revertMeshItem)
22092263 {
22102264 RevertMeshes();
22112265 } else
2212
- if (event.getSource() == resetMeshItem)
2266
+ if (source == resetMeshItem)
22132267 {
22142268 ResetAll();
22152269 } else
2216
- if (event.getSource() == stepAllItem)
2270
+ if (source == stepAllItem)
22172271 {
22182272 StepAll();
22192273 } else
2220
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2274
+ if (source == clearItem) // || event.getSource() == clearButton)
22212275 {
22222276 //int indices[] = jList.getSelectedIndices();
22232277 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2225,46 +2279,46 @@
22252279
22262280 ClearSelection(false);
22272281 } else
2228
- if (event.getSource() == clearAllItem)
2282
+ if (source == clearAllItem)
22292283 {
22302284 ClearSelection(true);
22312285 } else
2232
- if (event.getSource() == grabItem)
2286
+ if (source == grabItem)
22332287 {
22342288 group(new cGroup(), true);
22352289 } else
2236
- if (event.getSource() == hideItem)
2290
+ if (source == hideItem)
22372291 {
22382292 group(new HiddenObject());
22392293 } else
2240
- if (event.getSource() == frontItem)
2294
+ if (source == frontItem)
22412295 {
22422296 front();
22432297 } else
2244
- if (event.getSource() == backItem)
2298
+ if (source == backItem)
22452299 {
22462300 back();
22472301 } else
2248
- if (event.getSource() == cameraItem)
2302
+ if (source == cameraItem)
22492303 {
22502304 makeSomething(new Camera());
22512305 } else
2252
- if (event.getSource() == compositeItem)
2306
+ if (source == compositeItem)
22532307 {
22542308 group(new Composite());
22552309 } else
2256
- if (event.getSource() == randomItem)
2310
+ if (source == randomItem)
22572311 {
22582312 RandomNode random = new RandomNode();
22592313 group(random);
22602314 if (random.size() > 0)
2261
- random.name = random.get(0).name + "Rnd";
2315
+ random.name = random.get(0).name + "Switch";
22622316 } else
2263
- if (event.getSource() == physicsItem)
2317
+ if (source == physicsItem)
22642318 {
22652319 group(new PhysicsNode());
22662320 } else
2267
- if (event.getSource() == frameselectorItem)
2321
+ if (source == frameselectorItem)
22682322 {
22692323 for (int i=0; i<group.selection.size(); i++)
22702324 {
....@@ -2276,7 +2330,7 @@
22762330 ResetModel();
22772331 refreshContents();
22782332 } else
2279
- if (event.getSource() == switchGeoItem)
2333
+ if (source == switchGeoItem)
22802334 {
22812335 for (int i=0; i<group.selection.size(); i++)
22822336 {
....@@ -2288,7 +2342,7 @@
22882342 ResetModel();
22892343 refreshContents();
22902344 } else
2291
- if (event.getSource() == switchTransfoItem)
2345
+ if (source == switchTransfoItem)
22922346 {
22932347 for (int i=0; i<group.selection.size(); i++)
22942348 {
....@@ -2300,7 +2354,7 @@
23002354 ResetModel();
23012355 refreshContents();
23022356 } else
2303
- if (event.getSource() == morphItem)
2357
+ if (source == morphItem)
23042358 {
23052359 for (int i=0; i<group.selection.size(); i++)
23062360 {
....@@ -2312,7 +2366,7 @@
23122366 ResetModel();
23132367 refreshContents();
23142368 } else
2315
- if (event.getSource() == scriptNodeItem)
2369
+ if (source == scriptNodeItem)
23162370 {
23172371 boolean atleastone = false;
23182372
....@@ -2351,31 +2405,31 @@
23512405 }
23522406 }
23532407 } else
2354
- if (event.getSource() == linkerItem)
2408
+ if (source == linkerItem)
23552409 {
23562410 group(new cLinker());
23572411 } else
2358
- if (event.getSource() == textureItem)
2412
+ if (source == textureItem)
23592413 {
23602414 group(new TextureNode());
23612415 } else
2362
- if (event.getSource() == billboardItem)
2416
+ if (source == billboardItem)
23632417 {
23642418 group(new BillboardNode());
23652419 } else
2366
- if (event.getSource() == shadowXItem)
2420
+ if (source == shadowXItem)
23672421 {
23682422 CastShadow(0);
23692423 } else
2370
- if (event.getSource() == shadowYItem)
2424
+ if (source == shadowYItem)
23712425 {
23722426 CastShadow(1);
23732427 } else
2374
- if (event.getSource() == shadowZItem)
2428
+ if (source == shadowZItem)
23752429 {
23762430 CastShadow(2);
23772431 } else
2378
- if (event.getSource() == ungroupItem)
2432
+ if (source == ungroupItem)
23792433 {
23802434 //ungroup();
23812435 for (int i=0; i<group.selection.size(); i++)
....@@ -2387,179 +2441,179 @@
23872441
23882442 refreshContents();
23892443 } else
2390
- if (event.getSource() == genUVItem)
2444
+ if (source == genUVItem)
23912445 {
23922446 GenUV();
23932447 } else
2394
- if (event.getSource() == genNormalsCADItem)
2448
+ if (source == genNormalsCADItem)
23952449 {
23962450 GenNormals(true);
23972451 } else
2398
- if (event.getSource() == genNormalsMESHItem)
2452
+ if (source == genNormalsMESHItem)
23992453 {
24002454 GenNormals(true); // TODO
24012455 } else
2402
- if (event.getSource() == genNormalsORGANItem)
2456
+ if (source == genNormalsORGANItem)
24032457 {
24042458 GenNormals(false);
24052459 } else
2406
- if (event.getSource() == genNormalsMINEItem)
2460
+ if (source == genNormalsMINEItem)
24072461 {
24082462 GenNormalsMINE();
24092463 } else
2410
- if (event.getSource() == stripifyItem)
2464
+ if (source == stripifyItem)
24112465 {
24122466 Stripify();
24132467 } else
2414
- if (event.getSource() == unstripifyItem)
2468
+ if (source == unstripifyItem)
24152469 {
24162470 Unstripify();
24172471 } else
2418
- if (event.getSource() == trimItem)
2472
+ if (source == trimItem)
24192473 {
24202474 Trim();
24212475 } else
2422
- if (event.getSource() == untrimItem)
2476
+ if (source == untrimItem)
24232477 {
24242478 Untrim();
24252479 } else
2426
- if (event.getSource() == clearColorsItem)
2480
+ if (source == clearColorsItem)
24272481 {
24282482 ClearColors();
24292483 } else
2430
- if (event.getSource() == clearMaterialsItem)
2484
+ if (source == clearMaterialsItem)
24312485 {
24322486 ClearMaterials();
24332487 } else
2434
- if (event.getSource() == liveleavesItem)
2488
+ if (source == liveleavesItem)
24352489 {
24362490 LiveLeaves(true);
24372491 } else
2438
- if (event.getSource() == unliveleavesItem)
2492
+ if (source == unliveleavesItem)
24392493 {
24402494 LiveLeaves(false);
24412495 } else
2442
- if (event.getSource() == supportleavesItem)
2496
+ if (source == supportleavesItem)
24432497 {
24442498 SupportLeaves(true);
24452499 } else
2446
- if (event.getSource() == unsupportleavesItem)
2500
+ if (source == unsupportleavesItem)
24472501 {
24482502 SupportLeaves(false);
24492503 } else
2450
- if (event.getSource() == hideleavesItem)
2504
+ if (source == hideleavesItem)
24512505 {
24522506 HideLeaves(true);
24532507 } else
2454
- if (event.getSource() == showleavesItem)
2508
+ if (source == showleavesItem)
24552509 {
24562510 HideLeaves(false);
24572511 } else
2458
- if (event.getSource() == markleavesItem)
2512
+ if (source == markleavesItem)
24592513 {
24602514 MarkLeaves(true);
24612515 } else
2462
- if (event.getSource() == unmarkleavesItem)
2516
+ if (source == unmarkleavesItem)
24632517 {
24642518 MarkLeaves(false);
24652519 } else
2466
- if (event.getSource() == flipVItem)
2520
+ if (source == flipVItem)
24672521 {
24682522 FlipV(true);
24692523 } else
2470
- if (event.getSource() == unflipVItem)
2524
+ if (source == unflipVItem)
24712525 {
24722526 FlipV(false);
24732527 } else
2474
- if (event.getSource() == lowTexturesItem)
2528
+ if (source == lowTexturesItem)
24752529 {
24762530 SetTexRes(0);
24772531 } else
2478
- if (event.getSource() == normalTexturesItem)
2532
+ if (source == normalTexturesItem)
24792533 {
24802534 SetTexRes(1);
24812535 } else
2482
- if (event.getSource() == highTexturesItem)
2536
+ if (source == highTexturesItem)
24832537 {
24842538 SetTexRes(2);
24852539 } else
2486
- if (event.getSource() == veryhighTexturesItem)
2540
+ if (source == veryhighTexturesItem)
24872541 {
24882542 SetTexRes(3);
24892543 } else
2490
- if (event.getSource() == maxTexturesItem)
2544
+ if (source == maxTexturesItem)
24912545 {
24922546 SetTexRes(4);
24932547 } else
2494
- if (event.getSource() == panoTexturesItem)
2548
+ if (source == panoTexturesItem)
24952549 {
24962550 SetTexRes(5);
24972551 } else
2498
- if (event.getSource() == reverseNormalsItem)
2552
+ if (source == reverseNormalsItem)
24992553 {
25002554 ReverseNormals();
25012555 } else
2502
- if (event.getSource() == parseverticesItem)
2556
+ if (source == parseverticesItem)
25032557 {
25042558 ParseVertices();
25052559 } else
2506
- if (event.getSource() == textureFieldItem)
2560
+ if (source == textureFieldItem)
25072561 {
25082562 TextureVertices();
25092563 } else
2510
- if (event.getSource() == alignItem)
2564
+ if (source == alignItem)
25112565 {
25122566 Align();
25132567 } else
2514
- if (event.getSource() == mirrorItem)
2568
+ if (source == mirrorItem)
25152569 {
25162570 MirrorPoses();
25172571 } else
2518
- if (event.getSource() == reduceMorphItem)
2572
+ if (source == reduceMorphItem)
25192573 {
25202574 MeshReduction(false);
25212575 } else
2522
- if (event.getSource() == reduce34MorphItem)
2576
+ if (source == reduce34MorphItem)
25232577 {
25242578 MeshReduction(true);
25252579 } else
2526
- if (event.getSource() == reverseTrianglesItem)
2580
+ if (source == reverseTrianglesItem)
25272581 {
25282582 ReverseTriangles();
25292583 } else
2530
- if (event.getSource() == reduceMeshItem)
2584
+ if (source == reduceMeshItem)
25312585 {
25322586 ReduceMesh(false);
25332587 } else
2534
- if (event.getSource() == reduce34MeshItem)
2588
+ if (source == reduce34MeshItem)
25352589 {
25362590 ReduceMesh(true);
25372591 } else
2538
- if (event.getSource() == increaseMeshItem)
2592
+ if (source == increaseMeshItem)
25392593 {
25402594 IncreaseMesh();
25412595 } else
2542
- if (event.getSource() == clipMeshItem)
2596
+ if (source == clipMeshItem)
25432597 {
25442598 ClipMesh();
25452599 } else
2546
- if (event.getSource() == smoothMeshItem)
2600
+ if (source == smoothMeshItem)
25472601 {
25482602 SmoothMesh();
25492603 } else
2550
- if (event.getSource() == transformgeometryItem)
2604
+ if (source == transformgeometryItem)
25512605 {
25522606 TransformGeometry();
25532607 } else
2554
- if (event.getSource() == resetTransformItem)
2608
+ if (source == resetTransformItem)
25552609 {
25562610 ResetTransform();
25572611 } else
2558
- if (event.getSource() == resetCentroidItem)
2612
+ if (source == resetCentroidItem)
25592613 {
25602614 ResetCentroid();
25612615 } else
2562
- if (event.getSource() == resetParentItem)
2616
+ if (source == resetParentItem)
25632617 {
25642618 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25652619 {
....@@ -2569,7 +2623,7 @@
25692623
25702624 refreshContents();
25712625 } else
2572
- if (event.getSource() == repairParentItem)
2626
+ if (source == repairParentItem)
25732627 {
25742628 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25752629 {
....@@ -2583,7 +2637,7 @@
25832637
25842638 refreshContents();
25852639 } else
2586
- if (event.getSource() == repairShadowItem)
2640
+ if (source == repairShadowItem)
25872641 {
25882642 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25892643 {
....@@ -2597,7 +2651,7 @@
25972651
25982652 refreshContents();
25992653 } else
2600
- if (event.getSource() == sortbysizeItem)
2654
+ if (source == sortbysizeItem)
26012655 {
26022656 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26032657 {
....@@ -2609,7 +2663,7 @@
26092663 ResetModel();
26102664 refreshContents();
26112665 } else
2612
- if (event.getSource() == sortbynameItem)
2666
+ if (source == sortbynameItem)
26132667 {
26142668 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26152669 {
....@@ -2621,7 +2675,7 @@
26212675 ResetModel();
26222676 refreshContents();
26232677 } else
2624
- if (event.getSource() == attachPigmentItem)
2678
+ if (source == attachPigmentItem)
26252679 {
26262680 String texture = GetFile("Attach pigment");
26272681 Object3D obj;
....@@ -2633,7 +2687,7 @@
26332687
26342688 refreshContents();
26352689 } else
2636
- if (event.getSource() == detachPigmentItem)
2690
+ if (source == detachPigmentItem)
26372691 {
26382692 Object3D obj;
26392693 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2644,7 +2698,7 @@
26442698
26452699 refreshContents();
26462700 } else
2647
- if (event.getSource() == attachBumpItem)
2701
+ if (source == attachBumpItem)
26482702 {
26492703 String texture = GetFile("Attach bump");
26502704 Object3D obj;
....@@ -2656,7 +2710,7 @@
26562710
26572711 refreshContents();
26582712 } else
2659
- if (event.getSource() == detachBumpItem)
2713
+ if (source == detachBumpItem)
26602714 {
26612715 Object3D obj;
26622716 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2667,7 +2721,7 @@
26672721
26682722 refreshContents();
26692723 } else
2670
- if (event.getSource() == pigmentBumpItem)
2724
+ if (source == pigmentBumpItem)
26712725 {
26722726 Object3D obj;
26732727 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2678,158 +2732,195 @@
26782732
26792733 refreshContents();
26802734 } else
2681
- if (event.getSource() == flashSelectionButton)
2735
+ if (source == flashSelectionButton)
26822736 {
26832737 CameraPane.flash = true;
26842738 refreshContents();
26852739 } else
2686
- if (event.getSource() == oneButton)
2740
+ if (source == oneButton)
26872741 {
26882742 } else
2689
- if (event.getSource() == twoButton)
2743
+ if (source == twoButton)
26902744 {
26912745 radio.layout = twoButton;
26922746 // bug
26932747 //gridPanel.setDividerLocation(1.0);
26942748 //bigPanel.setDividerLocation(0.0);
2695
- bigThree.remove(scenePanel);
2696
- bigThree.remove(centralPanel);
2697
- bigThree.remove(XYZPanel);
2698
- aWindowConstraints.gridx = 0;
2699
- aWindowConstraints.gridy = 0;
2700
- aWindowConstraints.gridwidth = 1;
2701
- // aConstraints.gridheight = 3;
2702
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2703
- aWindowConstraints.weightx = 0;
2704
- aWindowConstraints.weighty = 1;
2705
- //bigThree.add(jtp, aWindowConstraints);
2706
- aWindowConstraints.weightx = 1;
2707
- aWindowConstraints.gridwidth = 3;
2708
- // aConstraints.gridheight = 3;
2709
- aWindowConstraints.gridx = 1;
2710
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2711
- bigThree.add(centralPanel, aWindowConstraints);
2712
- aWindowConstraints.weightx = 0;
2713
- aWindowConstraints.gridx = 4;
2714
- aWindowConstraints.gridwidth = 1;
2715
- // aConstraints.gridheight = 3;
2716
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2717
- //bigThree.add(XYZPanel, aWindowConstraints);
2718
- 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();
27192778 } else
2720
- if (event.getSource() == threeButton)
2779
+ if (source == threeButton)
27212780 {
27222781 radio.layout = threeButton;
2723
- bigThree.remove(scenePanel);
2724
- bigThree.remove(centralPanel);
2725
- bigThree.remove(XYZPanel);
2726
- aWindowConstraints.gridx = 0;
2727
- aWindowConstraints.gridy = 0;
2728
- aWindowConstraints.gridwidth = 1;
2729
- // aConstraints.gridheight = 3;
2730
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2731
- aWindowConstraints.weightx = 0;
2732
- aWindowConstraints.weighty = 1;
2733
- //bigThree.add(jtp, aWindowConstraints);
2734
- aWindowConstraints.weightx = 1;
2735
- aWindowConstraints.gridwidth = 3;
2736
- // aConstraints.gridheight = 3;
2737
- aWindowConstraints.gridx = 1;
2738
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2739
- bigThree.add(centralPanel, aWindowConstraints);
2740
- aWindowConstraints.weightx = 0;
2741
- aWindowConstraints.gridx = 4;
2742
- aWindowConstraints.gridwidth = 1;
2743
- // aConstraints.gridheight = 3;
2744
- aConstraints.fill = GridBagConstraints.VERTICAL;
2745
- bigThree.add(XYZPanel, aWindowConstraints);
2746
- 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();
27472814 } else
2748
- if (event.getSource() == fourButton)
2815
+ if (source == fourButton)
27492816 {
27502817 radio.layout = fourButton;
2751
- bigThree.remove(scenePanel);
2752
- bigThree.remove(centralPanel);
2753
- bigThree.remove(XYZPanel);
2754
- aWindowConstraints.gridx = 0;
2755
- aWindowConstraints.gridy = 0;
2756
- aWindowConstraints.gridwidth = 1;
2757
- // aWindowConstraints.gridheight = 3;
2758
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2759
- aWindowConstraints.weightx = 1;
2760
- aWindowConstraints.weighty = 1;
2761
- bigThree.add(scenePanel, aWindowConstraints);
2762
- aWindowConstraints.weightx = 1;
2763
- aWindowConstraints.gridwidth = 3;
2764
- // aConstraints.gridheight = 3;
2765
- aWindowConstraints.gridx = 1;
2766
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2767
- //bigThree.add(cameraPanel, aWindowConstraints);
2768
- aWindowConstraints.weightx = 0;
2769
- aWindowConstraints.gridx = 4;
2770
- aWindowConstraints.gridwidth = 1;
2771
- // aWindowConstraints.gridheight = 3;
2772
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2773
- //bigThree.add(XYZPanel, aWindowConstraints);
2774
- 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();
27752849 } else
2776
- if (event.getSource() == sixButton)
2850
+ if (source == sixButton)
27772851 {
27782852 radio.layout = sixButton;
2779
- bigThree.remove(scenePanel);
2780
- bigThree.remove(centralPanel);
2781
- bigThree.remove(XYZPanel);
2782
- aWindowConstraints.gridx = 0;
2783
- aWindowConstraints.gridy = 0;
2784
- aWindowConstraints.gridwidth = 1;
2785
- // aConstraints.gridheight = 3;
2786
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2787
- aWindowConstraints.weightx = 0;
2788
- aWindowConstraints.weighty = 1;
2789
- bigThree.add(scenePanel, aWindowConstraints);
2790
- aWindowConstraints.weightx = 1;
2791
- aWindowConstraints.gridwidth = 3;
2792
- // aWindowConstraints.gridheight = 3;
2793
- aWindowConstraints.gridx = 1;
2794
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2795
- bigThree.add(centralPanel, aWindowConstraints);
2796
- aWindowConstraints.weightx = 0;
2797
- aWindowConstraints.gridx = 4;
2798
- aWindowConstraints.gridwidth = 1;
2799
- // aWindowConstraints.gridheight = 3;
2800
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2801
- //bigThree.add(XYZPanel, aConstraints);
2802
- 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();
28032885 } else
2804
- if (event.getSource() == sevenButton)
2886
+ if (source == sevenButton)
28052887 {
28062888 radio.layout = sevenButton;
2807
- bigThree.remove(scenePanel);
2808
- bigThree.remove(centralPanel);
2809
- bigThree.remove(XYZPanel);
2810
- aWindowConstraints.gridx = 0;
2811
- aWindowConstraints.gridy = 0;
2812
- aWindowConstraints.gridwidth = 1;
2813
- // aWindowConstraints.gridheight = 3;
2814
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2815
- aWindowConstraints.weightx = 0;
2816
- aWindowConstraints.weighty = 1;
2817
- bigThree.add(scenePanel, aWindowConstraints);
2818
- aWindowConstraints.weightx = 1;
2819
- aWindowConstraints.gridwidth = 3;
2820
- // aWindowConstraints.gridheight = 3;
2821
- aWindowConstraints.gridx = 1;
2822
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2823
- bigThree.add(centralPanel, aWindowConstraints);
2824
- aWindowConstraints.weightx = 0;
2825
- aWindowConstraints.gridx = 4;
2826
- aWindowConstraints.gridwidth = 1;
2827
- // aConstraints.gridheight = 3;
2828
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2829
- bigThree.add(XYZPanel, aWindowConstraints);
2830
- 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();
28312922 } else
2832
- if (event.getSource() == rootButton)
2923
+ if (source == rootButton)
28332924 {
28342925 Object3D obj;
28352926 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2841,7 +2932,7 @@
28412932
28422933 refreshContents(true);
28432934 } else
2844
- if (event.getSource() == closeButton)
2935
+ if (source == closeButton)
28452936 {
28462937 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28472938 cRadio ab;
....@@ -2862,11 +2953,11 @@
28622953 }
28632954 refreshContents(true);
28642955 } else
2865
- if (event.getSource() == editItem || event.getSource() == editButton)
2956
+ if (source == editItem || source == editButton)
28662957 {
28672958 EditSelection(false);
28682959 } else
2869
- if (event.getSource() == uneditButton)
2960
+ if (source == uneditButton)
28702961 {
28712962 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28722963 {
....@@ -2878,12 +2969,12 @@
28782969
28792970 child.editWindow = null; // ???????????
28802971 }
2881
- objEditor.ctrlPanel.revalidate();
2972
+ objEditor.ctrlPanel.FlushUI();
28822973 //objEditor.jTree.clearSelection();
28832974 //objEditor.ResetSliders();
28842975 refreshContents(true);
28852976 } else
2886
- if (event.getSource() == clearPanelButton)
2977
+ if (source == clearPanelButton)
28872978 {
28882979 assert(copy == group);
28892980 //copy.ClearUI();
....@@ -2894,7 +2985,7 @@
28942985 listUI.clear();
28952986 refreshContents(true);
28962987 } else
2897
- if (event.getSource() == allParamsButton)
2988
+ if (source == allParamsButton)
28982989 {
28992990 assert(copy == group);
29002991
....@@ -2915,19 +3006,19 @@
29153006
29163007 refreshContents(true);
29173008 } else
2918
- if (event.getSource() == unselectButton)
3009
+ if (source == unselectButton)
29193010 {
29203011 objEditor.jTree.clearSelection();
29213012 // ?? oct 2012 GrafreeD.clipboard.clear();
29223013 objEditor.ResetSliders();
29233014 refreshContents(true);
29243015 } else
2925
- if(event.getSource() instanceof cRadio)
3016
+ if(source instanceof cRadio)
29263017 {
29273018 group.parent = keepparent;
29283019 group.attributes = 0;
29293020 //group.editWindow = null;
2930
- /*cRadio*/ radio = (cRadio)event.getSource();
3021
+ /*cRadio*/ radio = (cRadio)source;
29313022 Object3D obj = radio.GetObject();
29323023 System.out.println("Edit " + obj);
29333024 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -3597,11 +3688,11 @@
35973688
35983689 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35993690
3600
- boolean random = CameraPane.RANDOM;
3601
- CameraPane.RANDOM = false; // parse all random nodes
3691
+ boolean random = CameraPane.SWITCH;
3692
+ CameraPane.SWITCH = false; // parse all random nodes
36023693 lowres.linkVerticesThis(null);
36033694 lowres.linkVerticesThis(sn);
3604
- CameraPane.RANDOM = random;
3695
+ CameraPane.SWITCH = random;
36053696
36063697 System.err.flush();
36073698
....@@ -4086,12 +4177,12 @@
40864177 System.err.println("info : " + child.GetPath());
40874178 }
40884179 }
4089
- else
4090
- {
4091
- objEditor.SetMaterial(group); // .GetMaterial());
4092
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4093
- System.err.println("info : " + group.GetPath());
4094
- }
4180
+// else
4181
+// {
4182
+// objEditor.SetMaterial(group); // .GetMaterial());
4183
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4184
+// System.err.println("info : " + group.GetPath());
4185
+// }
40954186
40964187 objEditor.SetText(); // jan 2014
40974188
....@@ -4359,7 +4450,7 @@
43594450 refreshContents();
43604451 }
43614452
4362
- void pasteInto(boolean copyit)
4453
+ void pasteInto(boolean copyit, boolean clone)
43634454 {
43644455 // if (GrafreeD.clipboard == null)
43654456 // return;
....@@ -4388,7 +4479,14 @@
43884479 if (copyit)
43894480 {
43904481 // paste(false);
4391
- CloneClipboard(false); // sept 2014
4482
+ if (clone)
4483
+ {
4484
+ CloneClipboard(false); // sept 2014
4485
+ }
4486
+ else
4487
+ {
4488
+ paste(false);
4489
+ }
43924490 }
43934491 else
43944492 {
....@@ -4932,10 +5030,12 @@
49325030 cButton flashSelectionButton;
49335031 cButton editButton;
49345032 cButton uneditButton;
5033
+ JCheckBox allParamsButton;
49355034 cButton clearpanelButton;
4936
- cButton allParamsButton;
49375035 cButton unselectButton;
49385036
5037
+ cButton oneStepButton;
5038
+
49395039 cButton screenfitButton;
49405040 cButton screenfitpointButton;
49415041 cButton snapobjectButton;
....@@ -4990,6 +5090,7 @@
49905090 private MenuItem mergeGeometriesItem;
49915091 private MenuItem copyItem;
49925092 private MenuItem pasteItem;
5093
+ private MenuItem pasteIntoItem;
49935094 private MenuItem pasteLinkItem;
49945095 private MenuItem pasteCloneItem;
49955096 private MenuItem pasteExpandItem;
....@@ -5087,7 +5188,7 @@
50875188 private MenuItem blobItem;
50885189 private MenuItem latheItem;
50895190 private MenuItem bezierItem;
5090
- private MenuItem checkerItem;
5191
+ private MenuItem overlayItem;
50915192 private MenuItem meshItem;
50925193 // private MenuItem meshGroupItem;
50935194 private MenuItem springItem;