Normand Briere
2019-05-01 25cef97465f0bfa8959663754e9243006324c81c
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,
....@@ -433,97 +434,24 @@
433434 oe.radioPanel.add(dummyButton);
434435 oe.buttonGroup.add(dummyButton);
435436 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
437
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439438
440439 oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
441440 liveCB.setToolTipText("Enabled animation");
442441 liveCB.addItemListener(this);
443442
444
- oe.aConstraints.gridx += 1;
445
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
446
- fastCB.setToolTipText("Fast mode");
447
- 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);
443
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
515444 trackCB.setToolTipText("Enable tracking");
516445 trackCB.addItemListener(this);
517446
518
- oe.aConstraints.gridx += 1;
519
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
447
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
520448 screenfitButton.setToolTipText("Screen fit");
521449 screenfitButton.addActionListener(this);
522
- oe.aConstraints.gridx += 1;
450
+
523451 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
524452 // screenfitpointButton.addActionListener(this);
525453 // oe.aConstraints.gridx += 1;
526
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
454
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
527455 snapobjectButton.addActionListener(this);
528456 snapobjectButton.setToolTipText("Snap Object");
529457 oe.aConstraints.gridx += 1;
....@@ -533,39 +461,34 @@
533461 oe.aConstraints.weighty = 0;
534462 oe.aConstraints.gridwidth = 1;
535463
536
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
464
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
537465 flashSelectionButton.setToolTipText("Show selection");
538466 flashSelectionButton.addActionListener(this);
539467
540
- oe.toolbarPanel.add(new cButton(" ", false));
468
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
541469
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);
470
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
548471 twoButton.setToolTipText("Show center view only");
549472 twoButton.addActionListener(this);
550
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
473
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
551474 fourButton.addActionListener(this);
552475 fourButton.setToolTipText("Show left panel only");
553
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
476
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
554477 sixButton.setToolTipText("2-column layout left");
555478 sixButton.addActionListener(this);
556
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
479
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
557480 threeButton.setToolTipText("2-column layout right");
558481 threeButton.addActionListener(this);
559
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
482
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
560483 sevenButton.setToolTipText("3-column layout");
561484 sevenButton.addActionListener(this);
562485 //
563486
564
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
487
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
565488 rootButton.setToolTipText("Edit object in new tab");
566489 rootButton.addActionListener(this);
567490 oe.aConstraints.gridx += 1;
568
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
491
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
569492 closeButton.setToolTipText("Close tab");
570493 closeButton.addActionListener(this);
571494 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
....@@ -669,6 +592,80 @@
669592 radio.layout = sevenButton;
670593 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
671594 }
595
+
596
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
597
+ {
598
+ //constraints.gridx = 0;
599
+ //constraints.gridy = 0;
600
+ panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
601
+ fastCB.setToolTipText("Fast mode");
602
+ fastCB.addItemListener(this);
603
+ //constraints.gridy += 1;
604
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
605
+ supportCB.setToolTipText("Enabled rigging");
606
+ supportCB.addItemListener(this);
607
+
608
+ // constraints.gridy += 1;
609
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
610
+ // localCB.addItemListener(this);
611
+
612
+ //constraints.gridy += 1;
613
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
614
+ crowdCB.setToolTipText("Used for crowds");
615
+ crowdCB.addItemListener(this);
616
+
617
+ //constraints.gridy += 1;
618
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
619
+ smoothCB.setToolTipText("Snapping delay");
620
+ smoothCB.addItemListener(this);
621
+
622
+ //constraints.gridy += 1;
623
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
624
+ slowCB.setToolTipText("Smooth interpolation");
625
+ slowCB.addItemListener(this);
626
+ //constraints.gridy += 1;
627
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
628
+ boxCB.setToolTipText("Display bounding boxes");
629
+ boxCB.addItemListener(this);
630
+ //constraints.gridy += 1;
631
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
632
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
633
+ zoomBoxCB.addItemListener(this);
634
+
635
+// constraints.gridy += 1;
636
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
637
+// speakerMocapCB.addItemListener(this);
638
+
639
+ if (false)
640
+ {
641
+ // handled in scripts
642
+ //constraints.gridy += 1;
643
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
644
+ speakerCameraCB.addItemListener(this);
645
+
646
+ //constraints.gridy += 1;
647
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
648
+ speakerFocusCB.addItemListener(this);
649
+
650
+ //constraints.gridy += 1;
651
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
652
+ smoothfocusCB.addItemListener(this);
653
+ }
654
+
655
+//constraints.gridx += 1;
656
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
657
+// debugCB.addItemListener(this);
658
+
659
+ //constraints.gridy += 1;
660
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
661
+ oeilCB.addItemListener(this);
662
+
663
+ //constraints.gridy += 1;
664
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
665
+ lookAtCB.setToolTipText("Look-at target");
666
+ lookAtCB.addItemListener(this);
667
+
668
+ }
672669
673670 void EditObject(Object3D obj)
674671 {
....@@ -1510,6 +1507,7 @@
15101507 //
15111508 public void actionPerformed(ActionEvent event) // , Object arg)
15121509 {
1510
+ Object source = event.getSource();
15131511 /*
15141512 if (event.getSource() == nameField)
15151513 {
....@@ -1521,11 +1519,11 @@
15211519 }
15221520 else
15231521 */
1524
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1522
+ if (source == lookAtItem || source == lookFromItem)
15251523 {
15261524 ScreenFit();
15271525 } else
1528
- if (event.getSource() == switchItem)
1526
+ if (source == switchItem)
15291527 {
15301528 cVector v1 = new cVector();
15311529 cVector v2 = new cVector();
....@@ -1534,11 +1532,11 @@
15341532 objEditor.cameraView.renderCamera.setAim(v2, v1);
15351533 objEditor.cameraView.repaint();
15361534 } else
1537
- if (event.getSource() == rectoidItem)
1535
+ if (source == rectoidItem)
15381536 {
15391537 makeSomething(new Box());
15401538 } else
1541
- if (event.getSource() == particleItem)
1539
+ if (source == particleItem)
15421540 {
15431541 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15441542 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1559,9 +1557,9 @@
15591557 applyExample(particleGeom, "SMOKE");
15601558 makeSomething(particleGeom);
15611559 } else
1562
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1560
+ if (source == ragdollItem || source == ragdoll2Item)
15631561 {
1564
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1562
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15651563
15661564 ragdoll.toParent = LA.newMatrix();
15671565 ragdoll.fromParent = LA.newMatrix();
....@@ -1579,7 +1577,7 @@
15791577 } else
15801578 /*
15811579 */
1582
- if (event.getSource() == heightFieldItem)
1580
+ if (source == heightFieldItem)
15831581 {
15841582 Object3D obj = new Object3D();
15851583
....@@ -1617,31 +1615,31 @@
16171615
16181616 makeSomething(obj);
16191617 } else
1620
- if (event.getSource() == gridItem)
1618
+ if (source == gridItem)
16211619 {
16221620 makeSomething(new Grid());
16231621 } else
1624
- if (event.getSource() == ellipsoidItem)
1622
+ if (source == ellipsoidItem)
16251623 {
16261624 makeSomething(new Sphere());
16271625 } else
1628
- if (event.getSource() == coneItem)
1626
+ if (source == coneItem)
16291627 {
16301628 makeSomething(new Cone());
16311629 } else
1632
- if (event.getSource() == torusItem)
1630
+ if (source == torusItem)
16331631 {
16341632 makeSomething(new Torus());
16351633 } else
1636
- if (event.getSource() == superItem)
1634
+ if (source == superItem)
16371635 {
16381636 makeSomething(new Superellipsoid());
16391637 } else
1640
- if (event.getSource() == kleinItem)
1638
+ if (source == kleinItem)
16411639 {
16421640 makeSomething(new Klein());
16431641 } else
1644
- if (event.getSource() == blobItem)
1642
+ if (source == blobItem)
16451643 {
16461644 Blob blob = new Blob();
16471645 BlobComponent comp = new BlobComponent();
....@@ -1649,15 +1647,15 @@
16491647 //blob.retile();
16501648 makeSomething(blob);
16511649 } else
1652
- if (event.getSource() == latheItem)
1650
+ if (source == latheItem)
16531651 {
16541652 makeSomething(new Lathe());
16551653 } else
1656
- if (event.getSource() == bezierItem)
1654
+ if (source == bezierItem)
16571655 {
16581656 makeSomething(new BezierSurface());
16591657 } else
1660
- if (event.getSource() == checkerItem)
1658
+ if (source == checkerItem)
16611659 {
16621660 /*
16631661 Object3D obj = new BezierSurface(5,8);
....@@ -1672,7 +1670,7 @@
16721670 */
16731671 makeSomething(new Checker());
16741672 } else
1675
- if (event.getSource() == meshItem)
1673
+ if (source == meshItem)
16761674 {
16771675 Object3D itemtomake = new Object3D();
16781676 Object3D child;
....@@ -1693,35 +1691,35 @@
16931691 makeSomething(child);
16941692 }
16951693 } else
1696
- if (event.getSource() == springItem)
1694
+ if (source == springItem)
16971695 {
16981696 cSpring s = new cSpring();
16991697 s.setup();
17001698 makeSomething(s);
17011699 } else
1702
- if (event.getSource() == flagItem)
1700
+ if (source == flagItem)
17031701 {
17041702 cSpring s = new cFlag();
17051703 s.setup();
17061704 makeSomething(s);
17071705 } else
1708
- if (event.getSource() == lightItem)
1706
+ if (source == lightItem)
17091707 {
17101708 makeSomething(new Light());
17111709 } else
1712
- if (event.getSource() == csgItem)
1710
+ if (source == csgItem)
17131711 {
17141712 group(new CSG());
17151713 } else
1716
- if (event.getSource() == templateItem)
1714
+ if (source == templateItem)
17171715 {
17181716 group(new cTemplate());
17191717 } else
1720
- if (event.getSource() == attributeItem)
1718
+ if (source == attributeItem)
17211719 {
17221720 makeSomething(new Attribute());
17231721 } else
1724
- if (event.getSource() == pointflowItem)
1722
+ if (source == pointflowItem)
17251723 {
17261724 makeSomething(new PointFlow());
17271725 } else
....@@ -1733,7 +1731,7 @@
17331731 } else
17341732 */
17351733
1736
- if (event.getSource() == superLoopItem)
1734
+ if (source == superLoopItem)
17371735 {
17381736 Composite g = new cGroup();
17391737 for (int i=0; i<15; i++)
....@@ -1755,7 +1753,7 @@
17551753
17561754 group(g);
17571755 } else
1758
- if (event.getSource() == loopItem)
1756
+ if (source == loopItem)
17591757 {
17601758 Composite csg = new GroupLeaf();
17611759 csg.count = 5;
....@@ -1764,7 +1762,7 @@
17641762 csg.addChild(child);
17651763 child.addChild(csg);
17661764 } else
1767
- if (event.getSource() == doubleItem)
1765
+ if (source == doubleItem)
17681766 {
17691767 Composite csg = new GroupLeaf();
17701768 csg.count = 5;
....@@ -1776,7 +1774,7 @@
17761774 csg.addChild(child);
17771775 child.addChild(csg);
17781776 } else
1779
- if (event.getSource() == tripleItem)
1777
+ if (source == tripleItem)
17801778 {
17811779 Composite csg = new GroupLeaf();
17821780 csg.count = 4;
....@@ -1792,70 +1790,70 @@
17921790 child.addChild(csg);
17931791 } else
17941792
1795
- if (event.getSource() == importGFDItem)
1793
+ if (source == importGFDItem)
17961794 {
17971795 ImportGFD();
17981796 } else
1799
- if (event.getSource() == importVRMLX3DItem)
1797
+ if (source == importVRMLX3DItem)
18001798 {
18011799 ImportVRMLX3D();
18021800 } else
1803
- if (event.getSource() == import3DSItem)
1801
+ if (source == import3DSItem)
18041802 {
18051803 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
18061804 } else
1807
- if (event.getSource() == importOBJItem)
1805
+ if (source == importOBJItem)
18081806 {
18091807 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
18101808 } else
1811
- if (event.getSource() == computeAOItem)
1809
+ if (source == computeAOItem)
18121810 {
18131811 Globals.drawMode = CameraPane.OCCLUSION;
18141812 Globals.theRenderer.repaint();
18151813 } else
1816
- if (event.getSource() == recompileItem)
1814
+ if (source == recompileItem)
18171815 {
18181816 Recompile();
18191817 refreshContents();
18201818 } else
1821
- if (event.getSource() == editScriptItem)
1819
+ if (source == editScriptItem)
18221820 {
18231821 OpenDialog();
18241822 refreshContents();
18251823 } else
1826
- if (event.getSource() == invariantsItem)
1824
+ if (source == invariantsItem)
18271825 {
18281826 System.out.println("Invariants:");
18291827 GrafreeD.grafreeD.universe.invariants();
18301828 } else
1831
- if (event.getSource() == memoryItem)
1829
+ if (source == memoryItem)
18321830 {
18331831 //System.out.println("Invariants:");
18341832 PrintMemory();
18351833 } else
1836
- if (event.getSource() == pathItem)
1834
+ if (source == pathItem)
18371835 {
18381836 PrintPath();
18391837 } else
1840
- if (event.getSource() == analyzeItem)
1838
+ if (source == analyzeItem)
18411839 {
18421840 AnalyzeObject();
18431841 } else
1844
- if (event.getSource() == dumpItem)
1842
+ if (source == dumpItem)
18451843 {
18461844 DumpObject();
18471845 } else
1848
- if (event.getSource() == screenfitButton)
1846
+ if (source == screenfitButton)
18491847 {
18501848 //Reload(lastConverter, lastFilename, true);
18511849 ScreenFit();
18521850 } else
1853
- if (event.getSource() == screenfitpointButton)
1851
+ if (source == screenfitpointButton)
18541852 {
18551853 //Reload(lastConverter, lastFilename, true);
18561854 ScreenFitPoint();
18571855 } else
1858
- if (event.getSource() == snapobjectButton)
1856
+ if (source == snapobjectButton)
18591857 {
18601858 //Reload(lastConverter, lastFilename, true);
18611859 SnapObject();
....@@ -1866,13 +1864,13 @@
18661864 // Recompile();
18671865 // refreshContents();
18681866 // } else
1869
- if (event.getSource() == gcButton)
1867
+ if (source == gcButton)
18701868 {
18711869 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18721870 System.gc();
18731871 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18741872 } else
1875
- if (event.getSource() == editLeafItem)
1873
+ if (source == editLeafItem)
18761874 {
18771875 Object3D obj;
18781876 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1886,62 +1884,62 @@
18861884 }
18871885 refreshContents(true);
18881886 } else
1889
- if (event.getSource() == openWindowItem)
1887
+ if (source == openWindowItem)
18901888 {
18911889 EditSelection(true);
18921890 } else
1893
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1891
+ if (source == cutItem || source == clearButton)
18941892 {
18951893 loadClipboard(true);
18961894 } else
1897
- if (event.getSource() == duplicateItem)
1895
+ if (source == duplicateItem)
18981896 {
18991897 Object3D keep = GrafreeD.clipboard;
19001898 loadClipboard(false);
19011899 paste(false);
19021900 GrafreeD.clipboard = keep;
19031901 } else
1904
- if (event.getSource() == cloneItem)
1902
+ if (source == cloneItem)
19051903 {
19061904 CloneSelection(false);
19071905 } else
1908
- if (event.getSource() == cloneSupportItem)
1906
+ if (source == cloneSupportItem)
19091907 {
19101908 CloneSelection(true);
19111909 } else
1912
- if (event.getSource() == copyItem)
1910
+ if (source == copyItem)
19131911 {
19141912 loadClipboard(false);
19151913 } else
1916
- if (event.getSource() == pasteItem)
1914
+ if (source == pasteItem)
19171915 {
19181916 paste(false);
19191917 } else
1920
- if (event.getSource() == pasteLinkItem)
1918
+ if (source == pasteLinkItem)
19211919 {
19221920 pasteInto(false);
19231921 } else
1924
- if (event.getSource() == pasteCloneItem)
1922
+ if (source == pasteCloneItem)
19251923 {
19261924 pasteInto(true);
19271925 } else
1928
- if (event.getSource() == pasteExpandItem)
1926
+ if (source == pasteExpandItem)
19291927 {
19301928 paste(true);
19311929 } else
1932
- if (event.getSource() == synchronizeItem)
1930
+ if (source == synchronizeItem)
19331931 {
19341932 Overwrite(Object3D.TRANSFORM);
19351933 } else
1936
- if (event.getSource() == overwriteNameItem)
1934
+ if (source == overwriteNameItem)
19371935 {
19381936 Overwrite(Object3D.NAME);
19391937 } else
1940
- if (event.getSource() == overwriteUVItem)
1938
+ if (source == overwriteUVItem)
19411939 {
19421940 Overwrite(Object3D.UV);
19431941 } else
1944
- if (event.getSource() == overwriteMatItem)
1942
+ if (source == overwriteMatItem)
19451943 {
19461944 /* july 2015
19471945 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1961,7 +1959,7 @@
19611959
19621960 Overwrite(dropAttributes);
19631961 }
1964
- if (event.getSource() == overwriteGeoItem)
1962
+ if (source == overwriteGeoItem)
19651963 {
19661964 Overwrite(Object3D.GEOMETRY);
19671965 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1978,7 +1976,7 @@
19781976 // refreshContents();
19791977 // }
19801978 } else
1981
- if (event.getSource() == generateMeshItem)
1979
+ if (source == generateMeshItem)
19821980 {
19831981 //if (group.selection.size() == 1)
19841982 // for (int i=0; i<group.selection.size(); i++)
....@@ -1989,7 +1987,7 @@
19891987 ResetModel();
19901988 refreshContents();
19911989 } else
1992
- if (event.getSource() == extractGeometriesItem)
1990
+ if (source == extractGeometriesItem)
19931991 {
19941992 boolean one = false;
19951993
....@@ -2016,7 +2014,7 @@
20162014 ResetModel();
20172015 refreshContents();
20182016 } else
2019
- if (event.getSource() == cloneGeometriesItem)
2017
+ if (source == cloneGeometriesItem)
20202018 {
20212019 boolean one = false;
20222020
....@@ -2042,7 +2040,7 @@
20422040 ResetModel();
20432041 refreshContents();
20442042 } else
2045
- if (event.getSource() == shareGeometriesItem)
2043
+ if (source == shareGeometriesItem)
20462044 {
20472045 boolean one = false;
20482046
....@@ -2072,7 +2070,7 @@
20722070 refreshContents();
20732071 }
20742072 } else
2075
- if (event.getSource() == mergeGeometriesItem)
2073
+ if (source == mergeGeometriesItem)
20762074 {
20772075 boolean one = false;
20782076
....@@ -2102,7 +2100,7 @@
21022100 ResetModel();
21032101 refreshContents();
21042102 } else
2105
- if (event.getSource() == linkverticesItem)
2103
+ if (source == linkverticesItem)
21062104 {
21072105 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21082106 // {
....@@ -2135,7 +2133,7 @@
21352133 refreshContents();
21362134 }
21372135 } else
2138
- if (event.getSource() == resetsupportItem)
2136
+ if (source == resetsupportItem)
21392137 {
21402138 for (int i=0; i<group.selection.size(); i++)
21412139 {
....@@ -2147,7 +2145,7 @@
21472145
21482146 refreshContents();
21492147 } else
2150
- if (event.getSource() == relinkverticesItem)
2148
+ if (source == relinkverticesItem)
21512149 {
21522150 boolean random = CameraPane.RANDOM;
21532151 CameraPane.RANDOM = false; // parse all random nodes
....@@ -2156,7 +2154,7 @@
21562154
21572155 refreshContents();
21582156 } else
2159
- if (event.getSource() == resetreferencesItem)
2157
+ if (source == resetreferencesItem)
21602158 {
21612159 for (int i=0; i<group.selection.size(); i++)
21622160 {
....@@ -2165,7 +2163,7 @@
21652163
21662164 refreshContents();
21672165 } else
2168
- if (event.getSource() == setMasterItem)
2166
+ if (source == setMasterItem)
21692167 {
21702168 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21712169 {
....@@ -2178,7 +2176,7 @@
21782176 refreshContents();
21792177 }
21802178 } else
2181
- if (event.getSource() == poseMeshItem)
2179
+ if (source == poseMeshItem)
21822180 {
21832181 if (group.selection.size() == 1)
21842182 {
....@@ -2197,19 +2195,19 @@
21972195 }
21982196
21992197 } else
2200
- if (event.getSource() == revertMeshItem)
2198
+ if (source == revertMeshItem)
22012199 {
22022200 RevertMeshes();
22032201 } else
2204
- if (event.getSource() == resetMeshItem)
2202
+ if (source == resetMeshItem)
22052203 {
22062204 ResetAll();
22072205 } else
2208
- if (event.getSource() == stepAllItem)
2206
+ if (source == stepAllItem)
22092207 {
22102208 StepAll();
22112209 } else
2212
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2210
+ if (source == clearItem) // || event.getSource() == clearButton)
22132211 {
22142212 //int indices[] = jList.getSelectedIndices();
22152213 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2217,46 +2215,46 @@
22172215
22182216 ClearSelection(false);
22192217 } else
2220
- if (event.getSource() == clearAllItem)
2218
+ if (source == clearAllItem)
22212219 {
22222220 ClearSelection(true);
22232221 } else
2224
- if (event.getSource() == grabItem)
2222
+ if (source == grabItem)
22252223 {
22262224 group(new cGroup(), true);
22272225 } else
2228
- if (event.getSource() == hideItem)
2226
+ if (source == hideItem)
22292227 {
22302228 group(new HiddenObject());
22312229 } else
2232
- if (event.getSource() == frontItem)
2230
+ if (source == frontItem)
22332231 {
22342232 front();
22352233 } else
2236
- if (event.getSource() == backItem)
2234
+ if (source == backItem)
22372235 {
22382236 back();
22392237 } else
2240
- if (event.getSource() == cameraItem)
2238
+ if (source == cameraItem)
22412239 {
22422240 makeSomething(new Camera());
22432241 } else
2244
- if (event.getSource() == compositeItem)
2242
+ if (source == compositeItem)
22452243 {
22462244 group(new Composite());
22472245 } else
2248
- if (event.getSource() == randomItem)
2246
+ if (source == randomItem)
22492247 {
22502248 RandomNode random = new RandomNode();
22512249 group(random);
22522250 if (random.size() > 0)
22532251 random.name = random.get(0).name + "Rnd";
22542252 } else
2255
- if (event.getSource() == physicsItem)
2253
+ if (source == physicsItem)
22562254 {
22572255 group(new PhysicsNode());
22582256 } else
2259
- if (event.getSource() == frameselectorItem)
2257
+ if (source == frameselectorItem)
22602258 {
22612259 for (int i=0; i<group.selection.size(); i++)
22622260 {
....@@ -2268,7 +2266,7 @@
22682266 ResetModel();
22692267 refreshContents();
22702268 } else
2271
- if (event.getSource() == switchGeoItem)
2269
+ if (source == switchGeoItem)
22722270 {
22732271 for (int i=0; i<group.selection.size(); i++)
22742272 {
....@@ -2280,7 +2278,7 @@
22802278 ResetModel();
22812279 refreshContents();
22822280 } else
2283
- if (event.getSource() == switchTransfoItem)
2281
+ if (source == switchTransfoItem)
22842282 {
22852283 for (int i=0; i<group.selection.size(); i++)
22862284 {
....@@ -2292,7 +2290,7 @@
22922290 ResetModel();
22932291 refreshContents();
22942292 } else
2295
- if (event.getSource() == morphItem)
2293
+ if (source == morphItem)
22962294 {
22972295 for (int i=0; i<group.selection.size(); i++)
22982296 {
....@@ -2304,7 +2302,7 @@
23042302 ResetModel();
23052303 refreshContents();
23062304 } else
2307
- if (event.getSource() == scriptNodeItem)
2305
+ if (source == scriptNodeItem)
23082306 {
23092307 boolean atleastone = false;
23102308
....@@ -2343,31 +2341,31 @@
23432341 }
23442342 }
23452343 } else
2346
- if (event.getSource() == linkerItem)
2344
+ if (source == linkerItem)
23472345 {
23482346 group(new cLinker());
23492347 } else
2350
- if (event.getSource() == textureItem)
2348
+ if (source == textureItem)
23512349 {
23522350 group(new TextureNode());
23532351 } else
2354
- if (event.getSource() == billboardItem)
2352
+ if (source == billboardItem)
23552353 {
23562354 group(new BillboardNode());
23572355 } else
2358
- if (event.getSource() == shadowXItem)
2356
+ if (source == shadowXItem)
23592357 {
23602358 CastShadow(0);
23612359 } else
2362
- if (event.getSource() == shadowYItem)
2360
+ if (source == shadowYItem)
23632361 {
23642362 CastShadow(1);
23652363 } else
2366
- if (event.getSource() == shadowZItem)
2364
+ if (source == shadowZItem)
23672365 {
23682366 CastShadow(2);
23692367 } else
2370
- if (event.getSource() == ungroupItem)
2368
+ if (source == ungroupItem)
23712369 {
23722370 //ungroup();
23732371 for (int i=0; i<group.selection.size(); i++)
....@@ -2379,179 +2377,179 @@
23792377
23802378 refreshContents();
23812379 } else
2382
- if (event.getSource() == genUVItem)
2380
+ if (source == genUVItem)
23832381 {
23842382 GenUV();
23852383 } else
2386
- if (event.getSource() == genNormalsCADItem)
2384
+ if (source == genNormalsCADItem)
23872385 {
23882386 GenNormals(true);
23892387 } else
2390
- if (event.getSource() == genNormalsMESHItem)
2388
+ if (source == genNormalsMESHItem)
23912389 {
23922390 GenNormals(true); // TODO
23932391 } else
2394
- if (event.getSource() == genNormalsORGANItem)
2392
+ if (source == genNormalsORGANItem)
23952393 {
23962394 GenNormals(false);
23972395 } else
2398
- if (event.getSource() == genNormalsMINEItem)
2396
+ if (source == genNormalsMINEItem)
23992397 {
24002398 GenNormalsMINE();
24012399 } else
2402
- if (event.getSource() == stripifyItem)
2400
+ if (source == stripifyItem)
24032401 {
24042402 Stripify();
24052403 } else
2406
- if (event.getSource() == unstripifyItem)
2404
+ if (source == unstripifyItem)
24072405 {
24082406 Unstripify();
24092407 } else
2410
- if (event.getSource() == trimItem)
2408
+ if (source == trimItem)
24112409 {
24122410 Trim();
24132411 } else
2414
- if (event.getSource() == untrimItem)
2412
+ if (source == untrimItem)
24152413 {
24162414 Untrim();
24172415 } else
2418
- if (event.getSource() == clearColorsItem)
2416
+ if (source == clearColorsItem)
24192417 {
24202418 ClearColors();
24212419 } else
2422
- if (event.getSource() == clearMaterialsItem)
2420
+ if (source == clearMaterialsItem)
24232421 {
24242422 ClearMaterials();
24252423 } else
2426
- if (event.getSource() == liveleavesItem)
2424
+ if (source == liveleavesItem)
24272425 {
24282426 LiveLeaves(true);
24292427 } else
2430
- if (event.getSource() == unliveleavesItem)
2428
+ if (source == unliveleavesItem)
24312429 {
24322430 LiveLeaves(false);
24332431 } else
2434
- if (event.getSource() == supportleavesItem)
2432
+ if (source == supportleavesItem)
24352433 {
24362434 SupportLeaves(true);
24372435 } else
2438
- if (event.getSource() == unsupportleavesItem)
2436
+ if (source == unsupportleavesItem)
24392437 {
24402438 SupportLeaves(false);
24412439 } else
2442
- if (event.getSource() == hideleavesItem)
2440
+ if (source == hideleavesItem)
24432441 {
24442442 HideLeaves(true);
24452443 } else
2446
- if (event.getSource() == showleavesItem)
2444
+ if (source == showleavesItem)
24472445 {
24482446 HideLeaves(false);
24492447 } else
2450
- if (event.getSource() == markleavesItem)
2448
+ if (source == markleavesItem)
24512449 {
24522450 MarkLeaves(true);
24532451 } else
2454
- if (event.getSource() == unmarkleavesItem)
2452
+ if (source == unmarkleavesItem)
24552453 {
24562454 MarkLeaves(false);
24572455 } else
2458
- if (event.getSource() == flipVItem)
2456
+ if (source == flipVItem)
24592457 {
24602458 FlipV(true);
24612459 } else
2462
- if (event.getSource() == unflipVItem)
2460
+ if (source == unflipVItem)
24632461 {
24642462 FlipV(false);
24652463 } else
2466
- if (event.getSource() == lowTexturesItem)
2464
+ if (source == lowTexturesItem)
24672465 {
24682466 SetTexRes(0);
24692467 } else
2470
- if (event.getSource() == normalTexturesItem)
2468
+ if (source == normalTexturesItem)
24712469 {
24722470 SetTexRes(1);
24732471 } else
2474
- if (event.getSource() == highTexturesItem)
2472
+ if (source == highTexturesItem)
24752473 {
24762474 SetTexRes(2);
24772475 } else
2478
- if (event.getSource() == veryhighTexturesItem)
2476
+ if (source == veryhighTexturesItem)
24792477 {
24802478 SetTexRes(3);
24812479 } else
2482
- if (event.getSource() == maxTexturesItem)
2480
+ if (source == maxTexturesItem)
24832481 {
24842482 SetTexRes(4);
24852483 } else
2486
- if (event.getSource() == panoTexturesItem)
2484
+ if (source == panoTexturesItem)
24872485 {
24882486 SetTexRes(5);
24892487 } else
2490
- if (event.getSource() == reverseNormalsItem)
2488
+ if (source == reverseNormalsItem)
24912489 {
24922490 ReverseNormals();
24932491 } else
2494
- if (event.getSource() == parseverticesItem)
2492
+ if (source == parseverticesItem)
24952493 {
24962494 ParseVertices();
24972495 } else
2498
- if (event.getSource() == textureFieldItem)
2496
+ if (source == textureFieldItem)
24992497 {
25002498 TextureVertices();
25012499 } else
2502
- if (event.getSource() == alignItem)
2500
+ if (source == alignItem)
25032501 {
25042502 Align();
25052503 } else
2506
- if (event.getSource() == mirrorItem)
2504
+ if (source == mirrorItem)
25072505 {
25082506 MirrorPoses();
25092507 } else
2510
- if (event.getSource() == reduceMorphItem)
2508
+ if (source == reduceMorphItem)
25112509 {
25122510 MeshReduction(false);
25132511 } else
2514
- if (event.getSource() == reduce34MorphItem)
2512
+ if (source == reduce34MorphItem)
25152513 {
25162514 MeshReduction(true);
25172515 } else
2518
- if (event.getSource() == reverseTrianglesItem)
2516
+ if (source == reverseTrianglesItem)
25192517 {
25202518 ReverseTriangles();
25212519 } else
2522
- if (event.getSource() == reduceMeshItem)
2520
+ if (source == reduceMeshItem)
25232521 {
25242522 ReduceMesh(false);
25252523 } else
2526
- if (event.getSource() == reduce34MeshItem)
2524
+ if (source == reduce34MeshItem)
25272525 {
25282526 ReduceMesh(true);
25292527 } else
2530
- if (event.getSource() == increaseMeshItem)
2528
+ if (source == increaseMeshItem)
25312529 {
25322530 IncreaseMesh();
25332531 } else
2534
- if (event.getSource() == clipMeshItem)
2532
+ if (source == clipMeshItem)
25352533 {
25362534 ClipMesh();
25372535 } else
2538
- if (event.getSource() == smoothMeshItem)
2536
+ if (source == smoothMeshItem)
25392537 {
25402538 SmoothMesh();
25412539 } else
2542
- if (event.getSource() == transformgeometryItem)
2540
+ if (source == transformgeometryItem)
25432541 {
25442542 TransformGeometry();
25452543 } else
2546
- if (event.getSource() == resetTransformItem)
2544
+ if (source == resetTransformItem)
25472545 {
25482546 ResetTransform();
25492547 } else
2550
- if (event.getSource() == resetCentroidItem)
2548
+ if (source == resetCentroidItem)
25512549 {
25522550 ResetCentroid();
25532551 } else
2554
- if (event.getSource() == resetParentItem)
2552
+ if (source == resetParentItem)
25552553 {
25562554 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25572555 {
....@@ -2561,7 +2559,7 @@
25612559
25622560 refreshContents();
25632561 } else
2564
- if (event.getSource() == repairParentItem)
2562
+ if (source == repairParentItem)
25652563 {
25662564 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25672565 {
....@@ -2575,7 +2573,7 @@
25752573
25762574 refreshContents();
25772575 } else
2578
- if (event.getSource() == repairShadowItem)
2576
+ if (source == repairShadowItem)
25792577 {
25802578 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25812579 {
....@@ -2589,7 +2587,7 @@
25892587
25902588 refreshContents();
25912589 } else
2592
- if (event.getSource() == sortbysizeItem)
2590
+ if (source == sortbysizeItem)
25932591 {
25942592 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25952593 {
....@@ -2601,7 +2599,7 @@
26012599 ResetModel();
26022600 refreshContents();
26032601 } else
2604
- if (event.getSource() == sortbynameItem)
2602
+ if (source == sortbynameItem)
26052603 {
26062604 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26072605 {
....@@ -2613,7 +2611,7 @@
26132611 ResetModel();
26142612 refreshContents();
26152613 } else
2616
- if (event.getSource() == attachPigmentItem)
2614
+ if (source == attachPigmentItem)
26172615 {
26182616 String texture = GetFile("Attach pigment");
26192617 Object3D obj;
....@@ -2625,7 +2623,7 @@
26252623
26262624 refreshContents();
26272625 } else
2628
- if (event.getSource() == detachPigmentItem)
2626
+ if (source == detachPigmentItem)
26292627 {
26302628 Object3D obj;
26312629 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2636,7 +2634,7 @@
26362634
26372635 refreshContents();
26382636 } else
2639
- if (event.getSource() == attachBumpItem)
2637
+ if (source == attachBumpItem)
26402638 {
26412639 String texture = GetFile("Attach bump");
26422640 Object3D obj;
....@@ -2648,7 +2646,7 @@
26482646
26492647 refreshContents();
26502648 } else
2651
- if (event.getSource() == detachBumpItem)
2649
+ if (source == detachBumpItem)
26522650 {
26532651 Object3D obj;
26542652 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2659,7 +2657,7 @@
26592657
26602658 refreshContents();
26612659 } else
2662
- if (event.getSource() == pigmentBumpItem)
2660
+ if (source == pigmentBumpItem)
26632661 {
26642662 Object3D obj;
26652663 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2670,158 +2668,195 @@
26702668
26712669 refreshContents();
26722670 } else
2673
- if (event.getSource() == flashSelectionButton)
2671
+ if (source == flashSelectionButton)
26742672 {
26752673 CameraPane.flash = true;
26762674 refreshContents();
26772675 } else
2678
- if (event.getSource() == oneButton)
2676
+ if (source == oneButton)
26792677 {
26802678 } else
2681
- if (event.getSource() == twoButton)
2679
+ if (source == twoButton)
26822680 {
26832681 radio.layout = twoButton;
26842682 // bug
26852683 //gridPanel.setDividerLocation(1.0);
26862684 //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();
2685
+// bigThree.remove(scenePanel);
2686
+// bigThree.remove(centralPanel);
2687
+// bigThree.remove(XYZPanel);
2688
+// aWindowConstraints.gridx = 0;
2689
+// aWindowConstraints.gridy = 0;
2690
+// aWindowConstraints.gridwidth = 1;
2691
+// // aConstraints.gridheight = 3;
2692
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2693
+// aWindowConstraints.weightx = 0;
2694
+// aWindowConstraints.weighty = 1;
2695
+// //bigThree.add(jtp, aWindowConstraints);
2696
+// aWindowConstraints.weightx = 1;
2697
+// aWindowConstraints.gridwidth = 3;
2698
+// // aConstraints.gridheight = 3;
2699
+// aWindowConstraints.gridx = 1;
2700
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2701
+// bigThree.add(centralPanel, aWindowConstraints);
2702
+// aWindowConstraints.weightx = 0;
2703
+// aWindowConstraints.gridx = 4;
2704
+// aWindowConstraints.gridwidth = 1;
2705
+// // aConstraints.gridheight = 3;
2706
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2707
+// //bigThree.add(XYZPanel, aWindowConstraints);
2708
+// scenePanel.setVisible(false);
2709
+// centralPanel.setVisible(true);
2710
+// XYZPanel.setVisible(false);
2711
+ bigThree.ClearUI();
2712
+ bigThree.add(centralPanel);
2713
+ bigThree.FlushUI();
27112714 } else
2712
- if (event.getSource() == threeButton)
2715
+ if (source == threeButton)
27132716 {
27142717 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();
2718
+
2719
+// bigThree.remove(scenePanel);
2720
+// bigThree.remove(centralPanel);
2721
+// bigThree.remove(XYZPanel);
2722
+// aWindowConstraints.gridx = 0;
2723
+// aWindowConstraints.gridy = 0;
2724
+// aWindowConstraints.gridwidth = 1;
2725
+// // aConstraints.gridheight = 3;
2726
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2727
+// aWindowConstraints.weightx = 0;
2728
+// aWindowConstraints.weighty = 1;
2729
+// //bigThree.add(jtp, aWindowConstraints);
2730
+// aWindowConstraints.weightx = 1;
2731
+// aWindowConstraints.gridwidth = 3;
2732
+// // aConstraints.gridheight = 3;
2733
+// aWindowConstraints.gridx = 1;
2734
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2735
+// bigThree.add(centralPanel, aWindowConstraints);
2736
+// aWindowConstraints.weightx = 0;
2737
+// aWindowConstraints.gridx = 4;
2738
+// aWindowConstraints.gridwidth = 1;
2739
+// // aConstraints.gridheight = 3;
2740
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2741
+// bigThree.add(XYZPanel, aWindowConstraints);
2742
+// bigThree.validate();
2743
+// scenePanel.setVisible(false);
2744
+// centralPanel.setVisible(true);
2745
+// XYZPanel.setVisible(true);
2746
+ bigThree.ClearUI();
2747
+ bigThree.add(centralPanel);
2748
+ bigThree.add(XYZPanel);
2749
+ bigThree.FlushUI();
27392750 } else
2740
- if (event.getSource() == fourButton)
2751
+ if (source == fourButton)
27412752 {
27422753 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();
2754
+
2755
+// bigThree.remove(scenePanel);
2756
+// bigThree.remove(centralPanel);
2757
+// bigThree.remove(XYZPanel);
2758
+// aWindowConstraints.gridx = 0;
2759
+// aWindowConstraints.gridy = 0;
2760
+// aWindowConstraints.gridwidth = 1;
2761
+// // aWindowConstraints.gridheight = 3;
2762
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2763
+// aWindowConstraints.weightx = 1;
2764
+// aWindowConstraints.weighty = 1;
2765
+// bigThree.add(scenePanel, aWindowConstraints);
2766
+// aWindowConstraints.weightx = 1;
2767
+// aWindowConstraints.gridwidth = 3;
2768
+// // aConstraints.gridheight = 3;
2769
+// aWindowConstraints.gridx = 1;
2770
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2771
+// //bigThree.add(cameraPanel, aWindowConstraints);
2772
+// aWindowConstraints.weightx = 0;
2773
+// aWindowConstraints.gridx = 4;
2774
+// aWindowConstraints.gridwidth = 1;
2775
+// // aWindowConstraints.gridheight = 3;
2776
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2777
+// //bigThree.add(XYZPanel, aWindowConstraints);
2778
+// bigThree.validate();
2779
+// scenePanel.setVisible(true);
2780
+// centralPanel.setVisible(false);
2781
+// XYZPanel.setVisible(false);
2782
+ bigThree.ClearUI();
2783
+ bigThree.add(scenePanel);
2784
+ bigThree.FlushUI();
27672785 } else
2768
- if (event.getSource() == sixButton)
2786
+ if (source == sixButton)
27692787 {
27702788 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();
2789
+
2790
+// bigThree.remove(scenePanel);
2791
+// bigThree.remove(centralPanel);
2792
+// bigThree.remove(XYZPanel);
2793
+// aWindowConstraints.gridx = 0;
2794
+// aWindowConstraints.gridy = 0;
2795
+// aWindowConstraints.gridwidth = 1;
2796
+// // aConstraints.gridheight = 3;
2797
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2798
+// aWindowConstraints.weightx = 0;
2799
+// aWindowConstraints.weighty = 1;
2800
+// bigThree.add(scenePanel, aWindowConstraints);
2801
+// aWindowConstraints.weightx = 1;
2802
+// aWindowConstraints.gridwidth = 3;
2803
+// // aWindowConstraints.gridheight = 3;
2804
+// aWindowConstraints.gridx = 1;
2805
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2806
+// bigThree.add(centralPanel, aWindowConstraints);
2807
+// aWindowConstraints.weightx = 0;
2808
+// aWindowConstraints.gridx = 4;
2809
+// aWindowConstraints.gridwidth = 1;
2810
+// // aWindowConstraints.gridheight = 3;
2811
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2812
+// //bigThree.add(XYZPanel, aConstraints);
2813
+// bigThree.validate();
2814
+// scenePanel.setVisible(true);
2815
+// centralPanel.setVisible(true);
2816
+// XYZPanel.setVisible(false);
2817
+ bigThree.ClearUI();
2818
+ bigThree.add(scenePanel);
2819
+ bigThree.add(centralPanel);
2820
+ bigThree.FlushUI();
27952821 } else
2796
- if (event.getSource() == sevenButton)
2822
+ if (source == sevenButton)
27972823 {
27982824 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();
2825
+
2826
+// bigThree.remove(scenePanel);
2827
+// bigThree.remove(centralPanel);
2828
+// bigThree.remove(XYZPanel);
2829
+// aWindowConstraints.gridx = 0;
2830
+// aWindowConstraints.gridy = 0;
2831
+// aWindowConstraints.gridwidth = 1;
2832
+// // aWindowConstraints.gridheight = 3;
2833
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2834
+// aWindowConstraints.weightx = 0;
2835
+// aWindowConstraints.weighty = 1;
2836
+// bigThree.add(scenePanel, aWindowConstraints);
2837
+// aWindowConstraints.weightx = 1;
2838
+// aWindowConstraints.gridwidth = 3;
2839
+// // aWindowConstraints.gridheight = 3;
2840
+// aWindowConstraints.gridx = 1;
2841
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2842
+// bigThree.add(centralPanel, aWindowConstraints);
2843
+// aWindowConstraints.weightx = 0;
2844
+// aWindowConstraints.gridx = 4;
2845
+// aWindowConstraints.gridwidth = 1;
2846
+// // aConstraints.gridheight = 3;
2847
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2848
+// bigThree.add(XYZPanel, aWindowConstraints);
2849
+// bigThree.validate();
2850
+// scenePanel.setVisible(true);
2851
+// centralPanel.setVisible(true);
2852
+// XYZPanel.setVisible(true);
2853
+ bigThree.ClearUI();
2854
+ bigThree.add(scenePanel);
2855
+ bigThree.add(centralPanel);
2856
+ bigThree.add(XYZPanel);
2857
+ bigThree.FlushUI();
28232858 } else
2824
- if (event.getSource() == rootButton)
2859
+ if (source == rootButton)
28252860 {
28262861 Object3D obj;
28272862 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2833,7 +2868,7 @@
28332868
28342869 refreshContents(true);
28352870 } else
2836
- if (event.getSource() == closeButton)
2871
+ if (source == closeButton)
28372872 {
28382873 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28392874 cRadio ab;
....@@ -2854,11 +2889,11 @@
28542889 }
28552890 refreshContents(true);
28562891 } else
2857
- if (event.getSource() == editItem || event.getSource() == editButton)
2892
+ if (source == editItem || source == editButton)
28582893 {
28592894 EditSelection(false);
28602895 } else
2861
- if (event.getSource() == uneditButton)
2896
+ if (source == uneditButton)
28622897 {
28632898 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28642899 {
....@@ -2870,12 +2905,12 @@
28702905
28712906 child.editWindow = null; // ???????????
28722907 }
2873
- objEditor.ctrlPanel.revalidate();
2908
+ objEditor.ctrlPanel.validate();
28742909 //objEditor.jTree.clearSelection();
28752910 //objEditor.ResetSliders();
28762911 refreshContents(true);
28772912 } else
2878
- if (event.getSource() == clearPanelButton)
2913
+ if (source == clearPanelButton)
28792914 {
28802915 assert(copy == group);
28812916 //copy.ClearUI();
....@@ -2886,7 +2921,7 @@
28862921 listUI.clear();
28872922 refreshContents(true);
28882923 } else
2889
- if (event.getSource() == allParamsButton)
2924
+ if (source == allParamsButton)
28902925 {
28912926 assert(copy == group);
28922927
....@@ -2907,19 +2942,19 @@
29072942
29082943 refreshContents(true);
29092944 } else
2910
- if (event.getSource() == unselectButton)
2945
+ if (source == unselectButton)
29112946 {
29122947 objEditor.jTree.clearSelection();
29132948 // ?? oct 2012 GrafreeD.clipboard.clear();
29142949 objEditor.ResetSliders();
29152950 refreshContents(true);
29162951 } else
2917
- if(event.getSource() instanceof cRadio)
2952
+ if(source instanceof cRadio)
29182953 {
29192954 group.parent = keepparent;
29202955 group.attributes = 0;
29212956 //group.editWindow = null;
2922
- /*cRadio*/ radio = (cRadio)event.getSource();
2957
+ /*cRadio*/ radio = (cRadio)source;
29232958 Object3D obj = radio.GetObject();
29242959 System.out.println("Edit " + obj);
29252960 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)