Normand Briere
2019-04-29 bed42c663d286d76a32f155049f9efabc2fdb73f
GroupEditor.java
....@@ -434,76 +434,24 @@
434434 oe.buttonGroup.add(dummyButton);
435435 */
436436 aConstraints.gridy += 1;
437
+
438
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439
+
437440 oe.aConstraints.gridwidth = 1;
438441 oe.aConstraints.gridx = 0;
439442
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
443
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
444
+ liveCB.setToolTipText("Enabled animation");
441445 liveCB.addItemListener(this);
442446
443447 oe.aConstraints.gridx += 1;
444
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
445
- supportCB.addItemListener(this);
446
-
447
- // oe.aConstraints.gridx += 1;
448
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
449
- // localCB.addItemListener(this);
450
-
451
- oe.aConstraints.gridx += 1;
452
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
453
- crowdCB.addItemListener(this);
454
-
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
457
- smoothCB.addItemListener(this);
458
-
459
- oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
461
- fastCB.addItemListener(this);
462
- oe.aConstraints.gridx += 1;
463
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
464
- slowCB.addItemListener(this);
465
- oe.aConstraints.gridx += 1;
466
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
467
- boxCB.addItemListener(this);
468
-
469
-// oe.aConstraints.gridx += 1;
470
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
471
-// speakerMocapCB.addItemListener(this);
472
-
473
- if (false)
474
- {
475
- // handled in scripts
476
- oe.aConstraints.gridx += 1;
477
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
478
- speakerCameraCB.addItemListener(this);
479
-
480
- oe.aConstraints.gridx += 1;
481
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
482
- speakerFocusCB.addItemListener(this);
483
-
484
- oe.aConstraints.gridx += 1;
485
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
486
- smoothfocusCB.addItemListener(this);
487
- }
488
-
489
-//oe.aConstraints.gridx += 1;
490
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
491
-// debugCB.addItemListener(this);
492
-
493
- oe.aConstraints.gridx += 1;
494
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
495
- oeilCB.addItemListener(this);
496
-
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
499
- lookAtCB.addItemListener(this);
500
-
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
448
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
449
+ trackCB.setToolTipText("Enable tracking");
503450 trackCB.addItemListener(this);
504451
505452 oe.aConstraints.gridx += 1;
506453 oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
454
+ screenfitButton.setToolTipText("Screen fit");
507455 screenfitButton.addActionListener(this);
508456 oe.aConstraints.gridx += 1;
509457 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
....@@ -511,6 +459,7 @@
511459 // oe.aConstraints.gridx += 1;
512460 oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
513461 snapobjectButton.addActionListener(this);
462
+ snapobjectButton.setToolTipText("Snap Object");
514463 oe.aConstraints.gridx += 1;
515464
516465 //aConstraints.gridx = 0;
....@@ -519,28 +468,39 @@
519468 oe.aConstraints.gridwidth = 1;
520469
521470 oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
471
+ flashSelectionButton.setToolTipText("Show selection");
522472 flashSelectionButton.addActionListener(this);
473
+
474
+ oe.toolbarPanel.add(new cButton(" ", false));
475
+
523476 oe.aConstraints.gridx += 1;
524477 oe.aConstraints.weighty = 0;
525478 oe.aConstraints.gridwidth = 1;
526479
527480 //
528481 oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
482
+ twoButton.setToolTipText("Show center view only");
529483 twoButton.addActionListener(this);
530484 oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
531485 fourButton.addActionListener(this);
486
+ fourButton.setToolTipText("Show left panel only");
532487 oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
488
+ sixButton.setToolTipText("2-column layout left");
533489 sixButton.addActionListener(this);
534490 oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
491
+ threeButton.setToolTipText("2-column layout right");
535492 threeButton.addActionListener(this);
536493 oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
494
+ sevenButton.setToolTipText("3-column layout");
537495 sevenButton.addActionListener(this);
538496 //
539497
540
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
498
+ oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
499
+ rootButton.setToolTipText("Edit object in new tab");
541500 rootButton.addActionListener(this);
542501 oe.aConstraints.gridx += 1;
543502 oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
503
+ closeButton.setToolTipText("Close tab");
544504 closeButton.addActionListener(this);
545505 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
546506 //clearButton.addActionListener(this);
....@@ -643,17 +603,91 @@
643603 radio.layout = sevenButton;
644604 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
645605 }
606
+
607
+ void AddOptions(JPanel panel, GridBagConstraints constraints)
608
+ {
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);
639
+ boxCB.setToolTipText("Display bounding boxes");
640
+ boxCB.addItemListener(this);
641
+ constraints.gridy += 1;
642
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints);
643
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
644
+ zoomBoxCB.addItemListener(this);
645
+
646
+// constraints.gridy += 1;
647
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
648
+// speakerMocapCB.addItemListener(this);
649
+
650
+ if (false)
651
+ {
652
+ // handled in scripts
653
+ constraints.gridy += 1;
654
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints);
655
+ speakerCameraCB.addItemListener(this);
656
+
657
+ constraints.gridy += 1;
658
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints);
659
+ speakerFocusCB.addItemListener(this);
660
+
661
+ constraints.gridy += 1;
662
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints);
663
+ smoothfocusCB.addItemListener(this);
664
+ }
665
+
666
+//constraints.gridx += 1;
667
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
668
+// debugCB.addItemListener(this);
669
+
670
+ constraints.gridy += 1;
671
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints);
672
+ oeilCB.addItemListener(this);
673
+
674
+ constraints.gridy += 1;
675
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints);
676
+ lookAtCB.setToolTipText("Look-at target");
677
+ lookAtCB.addItemListener(this);
678
+
679
+ }
646680
647681 void EditObject(Object3D obj)
648682 {
649
- cRadio dummyButton = new cRadio(obj.name);
650
- dummyButton.SetObject(obj);
651
- dummyButton.layout = sevenButton;
652
- dummyButton.SetCamera(cameraView.renderCamera, false);
653
- dummyButton.addActionListener(this);
654
- radioPanel.add(dummyButton);
655
- buttonGroup.add(dummyButton);
656
- dummyButton.doClick();
683
+ cRadio radioButton = new cRadio(obj.name);
684
+ radioButton.SetObject(obj);
685
+ radioButton.layout = sevenButton;
686
+ radioButton.SetCamera(cameraView.renderCamera, false);
687
+ radioButton.addActionListener(this);
688
+ radioPanel.add(radioButton);
689
+ buttonGroup.add(radioButton);
690
+ radioButton.doClick();
657691 }
658692 void SetupViews(ObjEditor oe)
659693 {
....@@ -673,6 +707,7 @@
673707 JCheckBox fastCB;
674708 JCheckBox slowCB;
675709 JCheckBox boxCB;
710
+ JCheckBox zoomBoxCB;
676711 JCheckBox trackCB;
677712 JCheckBox smoothfocusCB;
678713 // JCheckBox speakerMocapCB;
....@@ -715,8 +750,7 @@
715750 dropAttributes |= Object3D.TEXTURE;
716751 else
717752 dropAttributes &= ~Object3D.TEXTURE;
718
- }
719
- else if(e.getSource() == liveCB)
753
+ } else if(e.getSource() == liveCB)
720754 {
721755 cameraView.ToggleLive();
722756 }
....@@ -753,6 +787,10 @@
753787 Recompile();
754788 cameraView.repaint();
755789 // refreshContents();
790
+ }
791
+ else if(e.getSource() == zoomBoxCB)
792
+ {
793
+ cameraView.ToggleZoomBoxMode();
756794 }
757795 else if(e.getSource() == smoothfocusCB)
758796 {
....@@ -1118,6 +1156,8 @@
11181156 resetParentItem.addActionListener(this);
11191157 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11201158 repairParentItem.addActionListener(this);
1159
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1160
+ repairShadowItem.addActionListener(this);
11211161 menu.add(invariantsItem = new MenuItem("Invariants"));
11221162 invariantsItem.addActionListener(this);
11231163 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1478,6 +1518,7 @@
14781518 //
14791519 public void actionPerformed(ActionEvent event) // , Object arg)
14801520 {
1521
+ Object source = event.getSource();
14811522 /*
14821523 if (event.getSource() == nameField)
14831524 {
....@@ -1489,11 +1530,11 @@
14891530 }
14901531 else
14911532 */
1492
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1533
+ if (source == lookAtItem || source == lookFromItem)
14931534 {
14941535 ScreenFit();
14951536 } else
1496
- if (event.getSource() == switchItem)
1537
+ if (source == switchItem)
14971538 {
14981539 cVector v1 = new cVector();
14991540 cVector v2 = new cVector();
....@@ -1502,11 +1543,11 @@
15021543 objEditor.cameraView.renderCamera.setAim(v2, v1);
15031544 objEditor.cameraView.repaint();
15041545 } else
1505
- if (event.getSource() == rectoidItem)
1546
+ if (source == rectoidItem)
15061547 {
15071548 makeSomething(new Box());
15081549 } else
1509
- if (event.getSource() == particleItem)
1550
+ if (source == particleItem)
15101551 {
15111552 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15121553 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1527,9 +1568,9 @@
15271568 applyExample(particleGeom, "SMOKE");
15281569 makeSomething(particleGeom);
15291570 } else
1530
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1571
+ if (source == ragdollItem || source == ragdoll2Item)
15311572 {
1532
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1573
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15331574
15341575 ragdoll.toParent = LA.newMatrix();
15351576 ragdoll.fromParent = LA.newMatrix();
....@@ -1547,7 +1588,7 @@
15471588 } else
15481589 /*
15491590 */
1550
- if (event.getSource() == heightFieldItem)
1591
+ if (source == heightFieldItem)
15511592 {
15521593 Object3D obj = new Object3D();
15531594
....@@ -1585,31 +1626,31 @@
15851626
15861627 makeSomething(obj);
15871628 } else
1588
- if (event.getSource() == gridItem)
1629
+ if (source == gridItem)
15891630 {
15901631 makeSomething(new Grid());
15911632 } else
1592
- if (event.getSource() == ellipsoidItem)
1633
+ if (source == ellipsoidItem)
15931634 {
15941635 makeSomething(new Sphere());
15951636 } else
1596
- if (event.getSource() == coneItem)
1637
+ if (source == coneItem)
15971638 {
15981639 makeSomething(new Cone());
15991640 } else
1600
- if (event.getSource() == torusItem)
1641
+ if (source == torusItem)
16011642 {
16021643 makeSomething(new Torus());
16031644 } else
1604
- if (event.getSource() == superItem)
1645
+ if (source == superItem)
16051646 {
16061647 makeSomething(new Superellipsoid());
16071648 } else
1608
- if (event.getSource() == kleinItem)
1649
+ if (source == kleinItem)
16091650 {
16101651 makeSomething(new Klein());
16111652 } else
1612
- if (event.getSource() == blobItem)
1653
+ if (source == blobItem)
16131654 {
16141655 Blob blob = new Blob();
16151656 BlobComponent comp = new BlobComponent();
....@@ -1617,15 +1658,15 @@
16171658 //blob.retile();
16181659 makeSomething(blob);
16191660 } else
1620
- if (event.getSource() == latheItem)
1661
+ if (source == latheItem)
16211662 {
16221663 makeSomething(new Lathe());
16231664 } else
1624
- if (event.getSource() == bezierItem)
1665
+ if (source == bezierItem)
16251666 {
16261667 makeSomething(new BezierSurface());
16271668 } else
1628
- if (event.getSource() == checkerItem)
1669
+ if (source == checkerItem)
16291670 {
16301671 /*
16311672 Object3D obj = new BezierSurface(5,8);
....@@ -1640,7 +1681,7 @@
16401681 */
16411682 makeSomething(new Checker());
16421683 } else
1643
- if (event.getSource() == meshItem)
1684
+ if (source == meshItem)
16441685 {
16451686 Object3D itemtomake = new Object3D();
16461687 Object3D child;
....@@ -1661,35 +1702,35 @@
16611702 makeSomething(child);
16621703 }
16631704 } else
1664
- if (event.getSource() == springItem)
1705
+ if (source == springItem)
16651706 {
16661707 cSpring s = new cSpring();
16671708 s.setup();
16681709 makeSomething(s);
16691710 } else
1670
- if (event.getSource() == flagItem)
1711
+ if (source == flagItem)
16711712 {
16721713 cSpring s = new cFlag();
16731714 s.setup();
16741715 makeSomething(s);
16751716 } else
1676
- if (event.getSource() == lightItem)
1717
+ if (source == lightItem)
16771718 {
16781719 makeSomething(new Light());
16791720 } else
1680
- if (event.getSource() == csgItem)
1721
+ if (source == csgItem)
16811722 {
16821723 group(new CSG());
16831724 } else
1684
- if (event.getSource() == templateItem)
1725
+ if (source == templateItem)
16851726 {
16861727 group(new cTemplate());
16871728 } else
1688
- if (event.getSource() == attributeItem)
1729
+ if (source == attributeItem)
16891730 {
16901731 makeSomething(new Attribute());
16911732 } else
1692
- if (event.getSource() == pointflowItem)
1733
+ if (source == pointflowItem)
16931734 {
16941735 makeSomething(new PointFlow());
16951736 } else
....@@ -1701,7 +1742,7 @@
17011742 } else
17021743 */
17031744
1704
- if (event.getSource() == superLoopItem)
1745
+ if (source == superLoopItem)
17051746 {
17061747 Composite g = new cGroup();
17071748 for (int i=0; i<15; i++)
....@@ -1723,7 +1764,7 @@
17231764
17241765 group(g);
17251766 } else
1726
- if (event.getSource() == loopItem)
1767
+ if (source == loopItem)
17271768 {
17281769 Composite csg = new GroupLeaf();
17291770 csg.count = 5;
....@@ -1732,7 +1773,7 @@
17321773 csg.addChild(child);
17331774 child.addChild(csg);
17341775 } else
1735
- if (event.getSource() == doubleItem)
1776
+ if (source == doubleItem)
17361777 {
17371778 Composite csg = new GroupLeaf();
17381779 csg.count = 5;
....@@ -1744,7 +1785,7 @@
17441785 csg.addChild(child);
17451786 child.addChild(csg);
17461787 } else
1747
- if (event.getSource() == tripleItem)
1788
+ if (source == tripleItem)
17481789 {
17491790 Composite csg = new GroupLeaf();
17501791 csg.count = 4;
....@@ -1760,70 +1801,70 @@
17601801 child.addChild(csg);
17611802 } else
17621803
1763
- if (event.getSource() == importGFDItem)
1804
+ if (source == importGFDItem)
17641805 {
17651806 ImportGFD();
17661807 } else
1767
- if (event.getSource() == importVRMLX3DItem)
1808
+ if (source == importVRMLX3DItem)
17681809 {
17691810 ImportVRMLX3D();
17701811 } else
1771
- if (event.getSource() == import3DSItem)
1812
+ if (source == import3DSItem)
17721813 {
17731814 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17741815 } else
1775
- if (event.getSource() == importOBJItem)
1816
+ if (source == importOBJItem)
17761817 {
17771818 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
17781819 } else
1779
- if (event.getSource() == computeAOItem)
1820
+ if (source == computeAOItem)
17801821 {
1781
- CameraPane.drawMode = CameraPane.OCCLUSION;
1782
- CameraPane.theRenderer.repaint();
1822
+ Globals.drawMode = CameraPane.OCCLUSION;
1823
+ Globals.theRenderer.repaint();
17831824 } else
1784
- if (event.getSource() == recompileItem)
1825
+ if (source == recompileItem)
17851826 {
17861827 Recompile();
17871828 refreshContents();
17881829 } else
1789
- if (event.getSource() == editScriptItem)
1830
+ if (source == editScriptItem)
17901831 {
17911832 OpenDialog();
17921833 refreshContents();
17931834 } else
1794
- if (event.getSource() == invariantsItem)
1835
+ if (source == invariantsItem)
17951836 {
17961837 System.out.println("Invariants:");
1797
- GrafreeD.theApplet3D.universe.invariants();
1838
+ GrafreeD.grafreeD.universe.invariants();
17981839 } else
1799
- if (event.getSource() == memoryItem)
1840
+ if (source == memoryItem)
18001841 {
18011842 //System.out.println("Invariants:");
18021843 PrintMemory();
18031844 } else
1804
- if (event.getSource() == pathItem)
1845
+ if (source == pathItem)
18051846 {
18061847 PrintPath();
18071848 } else
1808
- if (event.getSource() == analyzeItem)
1849
+ if (source == analyzeItem)
18091850 {
18101851 AnalyzeObject();
18111852 } else
1812
- if (event.getSource() == dumpItem)
1853
+ if (source == dumpItem)
18131854 {
18141855 DumpObject();
18151856 } else
1816
- if (event.getSource() == screenfitButton)
1857
+ if (source == screenfitButton)
18171858 {
18181859 //Reload(lastConverter, lastFilename, true);
18191860 ScreenFit();
18201861 } else
1821
- if (event.getSource() == screenfitpointButton)
1862
+ if (source == screenfitpointButton)
18221863 {
18231864 //Reload(lastConverter, lastFilename, true);
18241865 ScreenFitPoint();
18251866 } else
1826
- if (event.getSource() == snapobjectButton)
1867
+ if (source == snapobjectButton)
18271868 {
18281869 //Reload(lastConverter, lastFilename, true);
18291870 SnapObject();
....@@ -1834,13 +1875,13 @@
18341875 // Recompile();
18351876 // refreshContents();
18361877 // } else
1837
- if (event.getSource() == gcButton)
1878
+ if (source == gcButton)
18381879 {
18391880 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18401881 System.gc();
18411882 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18421883 } else
1843
- if (event.getSource() == editLeafItem)
1884
+ if (source == editLeafItem)
18441885 {
18451886 Object3D obj;
18461887 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1854,62 +1895,62 @@
18541895 }
18551896 refreshContents(true);
18561897 } else
1857
- if (event.getSource() == openWindowItem)
1898
+ if (source == openWindowItem)
18581899 {
18591900 EditSelection(true);
18601901 } else
1861
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1902
+ if (source == cutItem || source == clearButton)
18621903 {
18631904 loadClipboard(true);
18641905 } else
1865
- if (event.getSource() == duplicateItem)
1906
+ if (source == duplicateItem)
18661907 {
18671908 Object3D keep = GrafreeD.clipboard;
18681909 loadClipboard(false);
18691910 paste(false);
18701911 GrafreeD.clipboard = keep;
18711912 } else
1872
- if (event.getSource() == cloneItem)
1913
+ if (source == cloneItem)
18731914 {
18741915 CloneSelection(false);
18751916 } else
1876
- if (event.getSource() == cloneSupportItem)
1917
+ if (source == cloneSupportItem)
18771918 {
18781919 CloneSelection(true);
18791920 } else
1880
- if (event.getSource() == copyItem)
1921
+ if (source == copyItem)
18811922 {
18821923 loadClipboard(false);
18831924 } else
1884
- if (event.getSource() == pasteItem)
1925
+ if (source == pasteItem)
18851926 {
18861927 paste(false);
18871928 } else
1888
- if (event.getSource() == pasteLinkItem)
1929
+ if (source == pasteLinkItem)
18891930 {
18901931 pasteInto(false);
18911932 } else
1892
- if (event.getSource() == pasteCloneItem)
1933
+ if (source == pasteCloneItem)
18931934 {
18941935 pasteInto(true);
18951936 } else
1896
- if (event.getSource() == pasteExpandItem)
1937
+ if (source == pasteExpandItem)
18971938 {
18981939 paste(true);
18991940 } else
1900
- if (event.getSource() == synchronizeItem)
1941
+ if (source == synchronizeItem)
19011942 {
19021943 Overwrite(Object3D.TRANSFORM);
19031944 } else
1904
- if (event.getSource() == overwriteNameItem)
1945
+ if (source == overwriteNameItem)
19051946 {
19061947 Overwrite(Object3D.NAME);
19071948 } else
1908
- if (event.getSource() == overwriteUVItem)
1949
+ if (source == overwriteUVItem)
19091950 {
19101951 Overwrite(Object3D.UV);
19111952 } else
1912
- if (event.getSource() == overwriteMatItem)
1953
+ if (source == overwriteMatItem)
19131954 {
19141955 /* july 2015
19151956 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1929,7 +1970,7 @@
19291970
19301971 Overwrite(dropAttributes);
19311972 }
1932
- if (event.getSource() == overwriteGeoItem)
1973
+ if (source == overwriteGeoItem)
19331974 {
19341975 Overwrite(Object3D.GEOMETRY);
19351976 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1946,7 +1987,7 @@
19461987 // refreshContents();
19471988 // }
19481989 } else
1949
- if (event.getSource() == generateMeshItem)
1990
+ if (source == generateMeshItem)
19501991 {
19511992 //if (group.selection.size() == 1)
19521993 // for (int i=0; i<group.selection.size(); i++)
....@@ -1957,7 +1998,7 @@
19571998 ResetModel();
19581999 refreshContents();
19592000 } else
1960
- if (event.getSource() == extractGeometriesItem)
2001
+ if (source == extractGeometriesItem)
19612002 {
19622003 boolean one = false;
19632004
....@@ -1984,7 +2025,7 @@
19842025 ResetModel();
19852026 refreshContents();
19862027 } else
1987
- if (event.getSource() == cloneGeometriesItem)
2028
+ if (source == cloneGeometriesItem)
19882029 {
19892030 boolean one = false;
19902031
....@@ -2010,7 +2051,7 @@
20102051 ResetModel();
20112052 refreshContents();
20122053 } else
2013
- if (event.getSource() == shareGeometriesItem)
2054
+ if (source == shareGeometriesItem)
20142055 {
20152056 boolean one = false;
20162057
....@@ -2040,7 +2081,7 @@
20402081 refreshContents();
20412082 }
20422083 } else
2043
- if (event.getSource() == mergeGeometriesItem)
2084
+ if (source == mergeGeometriesItem)
20442085 {
20452086 boolean one = false;
20462087
....@@ -2070,7 +2111,7 @@
20702111 ResetModel();
20712112 refreshContents();
20722113 } else
2073
- if (event.getSource() == linkverticesItem)
2114
+ if (source == linkverticesItem)
20742115 {
20752116 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20762117 // {
....@@ -2090,7 +2131,7 @@
20902131 if (content instanceof cGroup && ((cGroup)content).transientlink )
20912132 content = ((cGroup)content).get(0);
20922133
2093
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2134
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20942135 for (int i=0; i<group.selection.size(); i++)
20952136 {
20962137 boolean random = CameraPane.RANDOM;
....@@ -2099,11 +2140,11 @@
20992140 // group.selection.get(i).setMasterThis(content); // should be identity
21002141 CameraPane.RANDOM = random;
21012142 }
2102
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2143
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21032144 refreshContents();
21042145 }
21052146 } else
2106
- if (event.getSource() == resetsupportItem)
2147
+ if (source == resetsupportItem)
21072148 {
21082149 for (int i=0; i<group.selection.size(); i++)
21092150 {
....@@ -2115,7 +2156,7 @@
21152156
21162157 refreshContents();
21172158 } else
2118
- if (event.getSource() == relinkverticesItem)
2159
+ if (source == relinkverticesItem)
21192160 {
21202161 boolean random = CameraPane.RANDOM;
21212162 CameraPane.RANDOM = false; // parse all random nodes
....@@ -2124,7 +2165,7 @@
21242165
21252166 refreshContents();
21262167 } else
2127
- if (event.getSource() == resetreferencesItem)
2168
+ if (source == resetreferencesItem)
21282169 {
21292170 for (int i=0; i<group.selection.size(); i++)
21302171 {
....@@ -2133,7 +2174,7 @@
21332174
21342175 refreshContents();
21352176 } else
2136
- if (event.getSource() == setMasterItem)
2177
+ if (source == setMasterItem)
21372178 {
21382179 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21392180 {
....@@ -2146,7 +2187,7 @@
21462187 refreshContents();
21472188 }
21482189 } else
2149
- if (event.getSource() == poseMeshItem)
2190
+ if (source == poseMeshItem)
21502191 {
21512192 if (group.selection.size() == 1)
21522193 {
....@@ -2165,19 +2206,19 @@
21652206 }
21662207
21672208 } else
2168
- if (event.getSource() == revertMeshItem)
2209
+ if (source == revertMeshItem)
21692210 {
21702211 RevertMeshes();
21712212 } else
2172
- if (event.getSource() == resetMeshItem)
2213
+ if (source == resetMeshItem)
21732214 {
21742215 ResetAll();
21752216 } else
2176
- if (event.getSource() == stepAllItem)
2217
+ if (source == stepAllItem)
21772218 {
21782219 StepAll();
21792220 } else
2180
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2221
+ if (source == clearItem) // || event.getSource() == clearButton)
21812222 {
21822223 //int indices[] = jList.getSelectedIndices();
21832224 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2185,46 +2226,46 @@
21852226
21862227 ClearSelection(false);
21872228 } else
2188
- if (event.getSource() == clearAllItem)
2229
+ if (source == clearAllItem)
21892230 {
21902231 ClearSelection(true);
21912232 } else
2192
- if (event.getSource() == grabItem)
2233
+ if (source == grabItem)
21932234 {
21942235 group(new cGroup(), true);
21952236 } else
2196
- if (event.getSource() == hideItem)
2237
+ if (source == hideItem)
21972238 {
21982239 group(new HiddenObject());
21992240 } else
2200
- if (event.getSource() == frontItem)
2241
+ if (source == frontItem)
22012242 {
22022243 front();
22032244 } else
2204
- if (event.getSource() == backItem)
2245
+ if (source == backItem)
22052246 {
22062247 back();
22072248 } else
2208
- if (event.getSource() == cameraItem)
2249
+ if (source == cameraItem)
22092250 {
22102251 makeSomething(new Camera());
22112252 } else
2212
- if (event.getSource() == compositeItem)
2253
+ if (source == compositeItem)
22132254 {
22142255 group(new Composite());
22152256 } else
2216
- if (event.getSource() == randomItem)
2257
+ if (source == randomItem)
22172258 {
22182259 RandomNode random = new RandomNode();
22192260 group(random);
22202261 if (random.size() > 0)
22212262 random.name = random.get(0).name + "Rnd";
22222263 } else
2223
- if (event.getSource() == physicsItem)
2264
+ if (source == physicsItem)
22242265 {
22252266 group(new PhysicsNode());
22262267 } else
2227
- if (event.getSource() == frameselectorItem)
2268
+ if (source == frameselectorItem)
22282269 {
22292270 for (int i=0; i<group.selection.size(); i++)
22302271 {
....@@ -2236,7 +2277,7 @@
22362277 ResetModel();
22372278 refreshContents();
22382279 } else
2239
- if (event.getSource() == switchGeoItem)
2280
+ if (source == switchGeoItem)
22402281 {
22412282 for (int i=0; i<group.selection.size(); i++)
22422283 {
....@@ -2248,7 +2289,7 @@
22482289 ResetModel();
22492290 refreshContents();
22502291 } else
2251
- if (event.getSource() == switchTransfoItem)
2292
+ if (source == switchTransfoItem)
22522293 {
22532294 for (int i=0; i<group.selection.size(); i++)
22542295 {
....@@ -2260,7 +2301,7 @@
22602301 ResetModel();
22612302 refreshContents();
22622303 } else
2263
- if (event.getSource() == morphItem)
2304
+ if (source == morphItem)
22642305 {
22652306 for (int i=0; i<group.selection.size(); i++)
22662307 {
....@@ -2272,7 +2313,7 @@
22722313 ResetModel();
22732314 refreshContents();
22742315 } else
2275
- if (event.getSource() == scriptNodeItem)
2316
+ if (source == scriptNodeItem)
22762317 {
22772318 boolean atleastone = false;
22782319
....@@ -2311,31 +2352,31 @@
23112352 }
23122353 }
23132354 } else
2314
- if (event.getSource() == linkerItem)
2355
+ if (source == linkerItem)
23152356 {
23162357 group(new cLinker());
23172358 } else
2318
- if (event.getSource() == textureItem)
2359
+ if (source == textureItem)
23192360 {
23202361 group(new TextureNode());
23212362 } else
2322
- if (event.getSource() == billboardItem)
2363
+ if (source == billboardItem)
23232364 {
23242365 group(new BillboardNode());
23252366 } else
2326
- if (event.getSource() == shadowXItem)
2367
+ if (source == shadowXItem)
23272368 {
23282369 CastShadow(0);
23292370 } else
2330
- if (event.getSource() == shadowYItem)
2371
+ if (source == shadowYItem)
23312372 {
23322373 CastShadow(1);
23332374 } else
2334
- if (event.getSource() == shadowZItem)
2375
+ if (source == shadowZItem)
23352376 {
23362377 CastShadow(2);
23372378 } else
2338
- if (event.getSource() == ungroupItem)
2379
+ if (source == ungroupItem)
23392380 {
23402381 //ungroup();
23412382 for (int i=0; i<group.selection.size(); i++)
....@@ -2347,179 +2388,179 @@
23472388
23482389 refreshContents();
23492390 } else
2350
- if (event.getSource() == genUVItem)
2391
+ if (source == genUVItem)
23512392 {
23522393 GenUV();
23532394 } else
2354
- if (event.getSource() == genNormalsCADItem)
2395
+ if (source == genNormalsCADItem)
23552396 {
23562397 GenNormals(true);
23572398 } else
2358
- if (event.getSource() == genNormalsMESHItem)
2399
+ if (source == genNormalsMESHItem)
23592400 {
23602401 GenNormals(true); // TODO
23612402 } else
2362
- if (event.getSource() == genNormalsORGANItem)
2403
+ if (source == genNormalsORGANItem)
23632404 {
23642405 GenNormals(false);
23652406 } else
2366
- if (event.getSource() == genNormalsMINEItem)
2407
+ if (source == genNormalsMINEItem)
23672408 {
23682409 GenNormalsMINE();
23692410 } else
2370
- if (event.getSource() == stripifyItem)
2411
+ if (source == stripifyItem)
23712412 {
23722413 Stripify();
23732414 } else
2374
- if (event.getSource() == unstripifyItem)
2415
+ if (source == unstripifyItem)
23752416 {
23762417 Unstripify();
23772418 } else
2378
- if (event.getSource() == trimItem)
2419
+ if (source == trimItem)
23792420 {
23802421 Trim();
23812422 } else
2382
- if (event.getSource() == untrimItem)
2423
+ if (source == untrimItem)
23832424 {
23842425 Untrim();
23852426 } else
2386
- if (event.getSource() == clearColorsItem)
2427
+ if (source == clearColorsItem)
23872428 {
23882429 ClearColors();
23892430 } else
2390
- if (event.getSource() == clearMaterialsItem)
2431
+ if (source == clearMaterialsItem)
23912432 {
23922433 ClearMaterials();
23932434 } else
2394
- if (event.getSource() == liveleavesItem)
2435
+ if (source == liveleavesItem)
23952436 {
23962437 LiveLeaves(true);
23972438 } else
2398
- if (event.getSource() == unliveleavesItem)
2439
+ if (source == unliveleavesItem)
23992440 {
24002441 LiveLeaves(false);
24012442 } else
2402
- if (event.getSource() == supportleavesItem)
2443
+ if (source == supportleavesItem)
24032444 {
24042445 SupportLeaves(true);
24052446 } else
2406
- if (event.getSource() == unsupportleavesItem)
2447
+ if (source == unsupportleavesItem)
24072448 {
24082449 SupportLeaves(false);
24092450 } else
2410
- if (event.getSource() == hideleavesItem)
2451
+ if (source == hideleavesItem)
24112452 {
24122453 HideLeaves(true);
24132454 } else
2414
- if (event.getSource() == showleavesItem)
2455
+ if (source == showleavesItem)
24152456 {
24162457 HideLeaves(false);
24172458 } else
2418
- if (event.getSource() == markleavesItem)
2459
+ if (source == markleavesItem)
24192460 {
24202461 MarkLeaves(true);
24212462 } else
2422
- if (event.getSource() == unmarkleavesItem)
2463
+ if (source == unmarkleavesItem)
24232464 {
24242465 MarkLeaves(false);
24252466 } else
2426
- if (event.getSource() == flipVItem)
2467
+ if (source == flipVItem)
24272468 {
24282469 FlipV(true);
24292470 } else
2430
- if (event.getSource() == unflipVItem)
2471
+ if (source == unflipVItem)
24312472 {
24322473 FlipV(false);
24332474 } else
2434
- if (event.getSource() == lowTexturesItem)
2475
+ if (source == lowTexturesItem)
24352476 {
24362477 SetTexRes(0);
24372478 } else
2438
- if (event.getSource() == normalTexturesItem)
2479
+ if (source == normalTexturesItem)
24392480 {
24402481 SetTexRes(1);
24412482 } else
2442
- if (event.getSource() == highTexturesItem)
2483
+ if (source == highTexturesItem)
24432484 {
24442485 SetTexRes(2);
24452486 } else
2446
- if (event.getSource() == veryhighTexturesItem)
2487
+ if (source == veryhighTexturesItem)
24472488 {
24482489 SetTexRes(3);
24492490 } else
2450
- if (event.getSource() == maxTexturesItem)
2491
+ if (source == maxTexturesItem)
24512492 {
24522493 SetTexRes(4);
24532494 } else
2454
- if (event.getSource() == panoTexturesItem)
2495
+ if (source == panoTexturesItem)
24552496 {
24562497 SetTexRes(5);
24572498 } else
2458
- if (event.getSource() == reverseNormalsItem)
2499
+ if (source == reverseNormalsItem)
24592500 {
24602501 ReverseNormals();
24612502 } else
2462
- if (event.getSource() == parseverticesItem)
2503
+ if (source == parseverticesItem)
24632504 {
24642505 ParseVertices();
24652506 } else
2466
- if (event.getSource() == textureFieldItem)
2507
+ if (source == textureFieldItem)
24672508 {
24682509 TextureVertices();
24692510 } else
2470
- if (event.getSource() == alignItem)
2511
+ if (source == alignItem)
24712512 {
24722513 Align();
24732514 } else
2474
- if (event.getSource() == mirrorItem)
2515
+ if (source == mirrorItem)
24752516 {
24762517 MirrorPoses();
24772518 } else
2478
- if (event.getSource() == reduceMorphItem)
2519
+ if (source == reduceMorphItem)
24792520 {
24802521 MeshReduction(false);
24812522 } else
2482
- if (event.getSource() == reduce34MorphItem)
2523
+ if (source == reduce34MorphItem)
24832524 {
24842525 MeshReduction(true);
24852526 } else
2486
- if (event.getSource() == reverseTrianglesItem)
2527
+ if (source == reverseTrianglesItem)
24872528 {
24882529 ReverseTriangles();
24892530 } else
2490
- if (event.getSource() == reduceMeshItem)
2531
+ if (source == reduceMeshItem)
24912532 {
24922533 ReduceMesh(false);
24932534 } else
2494
- if (event.getSource() == reduce34MeshItem)
2535
+ if (source == reduce34MeshItem)
24952536 {
24962537 ReduceMesh(true);
24972538 } else
2498
- if (event.getSource() == increaseMeshItem)
2539
+ if (source == increaseMeshItem)
24992540 {
25002541 IncreaseMesh();
25012542 } else
2502
- if (event.getSource() == clipMeshItem)
2543
+ if (source == clipMeshItem)
25032544 {
25042545 ClipMesh();
25052546 } else
2506
- if (event.getSource() == smoothMeshItem)
2547
+ if (source == smoothMeshItem)
25072548 {
25082549 SmoothMesh();
25092550 } else
2510
- if (event.getSource() == transformgeometryItem)
2551
+ if (source == transformgeometryItem)
25112552 {
25122553 TransformGeometry();
25132554 } else
2514
- if (event.getSource() == resetTransformItem)
2555
+ if (source == resetTransformItem)
25152556 {
25162557 ResetTransform();
25172558 } else
2518
- if (event.getSource() == resetCentroidItem)
2559
+ if (source == resetCentroidItem)
25192560 {
25202561 ResetCentroid();
25212562 } else
2522
- if (event.getSource() == resetParentItem)
2563
+ if (source == resetParentItem)
25232564 {
25242565 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25252566 {
....@@ -2529,7 +2570,7 @@
25292570
25302571 refreshContents();
25312572 } else
2532
- if (event.getSource() == repairParentItem)
2573
+ if (source == repairParentItem)
25332574 {
25342575 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25352576 {
....@@ -2543,7 +2584,21 @@
25432584
25442585 refreshContents();
25452586 } else
2546
- if (event.getSource() == sortbysizeItem)
2587
+ if (source == repairShadowItem)
2588
+ {
2589
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2590
+ {
2591
+ Object3D obj = (Object3D)e.nextElement();
2592
+ obj.RepairShadow();
2593
+// for (int i=0; i<obj.size(); i++)
2594
+// {
2595
+// obj.get(i).parent = obj;
2596
+// }
2597
+ }
2598
+
2599
+ refreshContents();
2600
+ } else
2601
+ if (source == sortbysizeItem)
25472602 {
25482603 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25492604 {
....@@ -2555,7 +2610,7 @@
25552610 ResetModel();
25562611 refreshContents();
25572612 } else
2558
- if (event.getSource() == sortbynameItem)
2613
+ if (source == sortbynameItem)
25592614 {
25602615 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25612616 {
....@@ -2567,7 +2622,7 @@
25672622 ResetModel();
25682623 refreshContents();
25692624 } else
2570
- if (event.getSource() == attachPigmentItem)
2625
+ if (source == attachPigmentItem)
25712626 {
25722627 String texture = GetFile("Attach pigment");
25732628 Object3D obj;
....@@ -2579,7 +2634,7 @@
25792634
25802635 refreshContents();
25812636 } else
2582
- if (event.getSource() == detachPigmentItem)
2637
+ if (source == detachPigmentItem)
25832638 {
25842639 Object3D obj;
25852640 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2590,7 +2645,7 @@
25902645
25912646 refreshContents();
25922647 } else
2593
- if (event.getSource() == attachBumpItem)
2648
+ if (source == attachBumpItem)
25942649 {
25952650 String texture = GetFile("Attach bump");
25962651 Object3D obj;
....@@ -2602,7 +2657,7 @@
26022657
26032658 refreshContents();
26042659 } else
2605
- if (event.getSource() == detachBumpItem)
2660
+ if (source == detachBumpItem)
26062661 {
26072662 Object3D obj;
26082663 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2613,7 +2668,7 @@
26132668
26142669 refreshContents();
26152670 } else
2616
- if (event.getSource() == pigmentBumpItem)
2671
+ if (source == pigmentBumpItem)
26172672 {
26182673 Object3D obj;
26192674 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2624,158 +2679,195 @@
26242679
26252680 refreshContents();
26262681 } else
2627
- if (event.getSource() == flashSelectionButton)
2682
+ if (source == flashSelectionButton)
26282683 {
26292684 CameraPane.flash = true;
26302685 refreshContents();
26312686 } else
2632
- if (event.getSource() == oneButton)
2687
+ if (source == oneButton)
26332688 {
26342689 } else
2635
- if (event.getSource() == twoButton)
2690
+ if (source == twoButton)
26362691 {
26372692 radio.layout = twoButton;
26382693 // bug
26392694 //gridPanel.setDividerLocation(1.0);
26402695 //bigPanel.setDividerLocation(0.0);
2641
- bigThree.remove(jtp);
2642
- bigThree.remove(cameraPanel);
2643
- bigThree.remove(XYZPanel);
2644
- aWindowConstraints.gridx = 0;
2645
- aWindowConstraints.gridy = 0;
2646
- aWindowConstraints.gridwidth = 1;
2647
- // aConstraints.gridheight = 3;
2648
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2649
- aWindowConstraints.weightx = 0;
2650
- aWindowConstraints.weighty = 1;
2651
- //bigThree.add(jtp, aWindowConstraints);
2652
- aWindowConstraints.weightx = 1;
2653
- aWindowConstraints.gridwidth = 3;
2654
- // aConstraints.gridheight = 3;
2655
- aWindowConstraints.gridx = 1;
2656
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2657
- bigThree.add(cameraPanel, aWindowConstraints);
2658
- aWindowConstraints.weightx = 0;
2659
- aWindowConstraints.gridx = 4;
2660
- aWindowConstraints.gridwidth = 1;
2661
- // aConstraints.gridheight = 3;
2662
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2663
- //bigThree.add(XYZPanel, aWindowConstraints);
2664
- bigThree.revalidate();
2696
+// bigThree.remove(scenePanel);
2697
+// bigThree.remove(centralPanel);
2698
+// bigThree.remove(XYZPanel);
2699
+// aWindowConstraints.gridx = 0;
2700
+// aWindowConstraints.gridy = 0;
2701
+// aWindowConstraints.gridwidth = 1;
2702
+// // aConstraints.gridheight = 3;
2703
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2704
+// aWindowConstraints.weightx = 0;
2705
+// aWindowConstraints.weighty = 1;
2706
+// //bigThree.add(jtp, aWindowConstraints);
2707
+// aWindowConstraints.weightx = 1;
2708
+// aWindowConstraints.gridwidth = 3;
2709
+// // aConstraints.gridheight = 3;
2710
+// aWindowConstraints.gridx = 1;
2711
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2712
+// bigThree.add(centralPanel, aWindowConstraints);
2713
+// aWindowConstraints.weightx = 0;
2714
+// aWindowConstraints.gridx = 4;
2715
+// aWindowConstraints.gridwidth = 1;
2716
+// // aConstraints.gridheight = 3;
2717
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2718
+// //bigThree.add(XYZPanel, aWindowConstraints);
2719
+// scenePanel.setVisible(false);
2720
+// centralPanel.setVisible(true);
2721
+// XYZPanel.setVisible(false);
2722
+ bigThree.ClearUI();
2723
+ bigThree.addComponent(centralPanel);
2724
+ bigThree.FlushUI();
26652725 } else
2666
- if (event.getSource() == threeButton)
2726
+ if (source == threeButton)
26672727 {
26682728 radio.layout = threeButton;
2669
- bigThree.remove(jtp);
2670
- bigThree.remove(cameraPanel);
2671
- bigThree.remove(XYZPanel);
2672
- aWindowConstraints.gridx = 0;
2673
- aWindowConstraints.gridy = 0;
2674
- aWindowConstraints.gridwidth = 1;
2675
- // aConstraints.gridheight = 3;
2676
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2677
- aWindowConstraints.weightx = 0;
2678
- aWindowConstraints.weighty = 1;
2679
- //bigThree.add(jtp, aWindowConstraints);
2680
- aWindowConstraints.weightx = 1;
2681
- aWindowConstraints.gridwidth = 3;
2682
- // aConstraints.gridheight = 3;
2683
- aWindowConstraints.gridx = 1;
2684
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2685
- bigThree.add(cameraPanel, aWindowConstraints);
2686
- aWindowConstraints.weightx = 0;
2687
- aWindowConstraints.gridx = 4;
2688
- aWindowConstraints.gridwidth = 1;
2689
- // aConstraints.gridheight = 3;
2690
- aConstraints.fill = GridBagConstraints.VERTICAL;
2691
- bigThree.add(XYZPanel, aWindowConstraints);
2692
- bigThree.revalidate();
2729
+
2730
+// bigThree.remove(scenePanel);
2731
+// bigThree.remove(centralPanel);
2732
+// bigThree.remove(XYZPanel);
2733
+// aWindowConstraints.gridx = 0;
2734
+// aWindowConstraints.gridy = 0;
2735
+// aWindowConstraints.gridwidth = 1;
2736
+// // aConstraints.gridheight = 3;
2737
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2738
+// aWindowConstraints.weightx = 0;
2739
+// aWindowConstraints.weighty = 1;
2740
+// //bigThree.add(jtp, aWindowConstraints);
2741
+// aWindowConstraints.weightx = 1;
2742
+// aWindowConstraints.gridwidth = 3;
2743
+// // aConstraints.gridheight = 3;
2744
+// aWindowConstraints.gridx = 1;
2745
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2746
+// bigThree.add(centralPanel, aWindowConstraints);
2747
+// aWindowConstraints.weightx = 0;
2748
+// aWindowConstraints.gridx = 4;
2749
+// aWindowConstraints.gridwidth = 1;
2750
+// // aConstraints.gridheight = 3;
2751
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2752
+// bigThree.add(XYZPanel, aWindowConstraints);
2753
+// bigThree.validate();
2754
+// scenePanel.setVisible(false);
2755
+// centralPanel.setVisible(true);
2756
+// XYZPanel.setVisible(true);
2757
+ bigThree.ClearUI();
2758
+ bigThree.addComponent(centralPanel);
2759
+ bigThree.addComponent(XYZPanel);
2760
+ bigThree.FlushUI();
26932761 } else
2694
- if (event.getSource() == fourButton)
2762
+ if (source == fourButton)
26952763 {
26962764 radio.layout = fourButton;
2697
- bigThree.remove(jtp);
2698
- bigThree.remove(cameraPanel);
2699
- bigThree.remove(XYZPanel);
2700
- aWindowConstraints.gridx = 0;
2701
- aWindowConstraints.gridy = 0;
2702
- aWindowConstraints.gridwidth = 1;
2703
- // aWindowConstraints.gridheight = 3;
2704
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2705
- aWindowConstraints.weightx = 1;
2706
- aWindowConstraints.weighty = 1;
2707
- bigThree.add(jtp, aWindowConstraints);
2708
- aWindowConstraints.weightx = 1;
2709
- aWindowConstraints.gridwidth = 3;
2710
- // aConstraints.gridheight = 3;
2711
- aWindowConstraints.gridx = 1;
2712
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2713
- //bigThree.add(cameraPanel, aWindowConstraints);
2714
- aWindowConstraints.weightx = 0;
2715
- aWindowConstraints.gridx = 4;
2716
- aWindowConstraints.gridwidth = 1;
2717
- // aWindowConstraints.gridheight = 3;
2718
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2719
- //bigThree.add(XYZPanel, aWindowConstraints);
2720
- bigThree.revalidate();
2765
+
2766
+// bigThree.remove(scenePanel);
2767
+// bigThree.remove(centralPanel);
2768
+// bigThree.remove(XYZPanel);
2769
+// aWindowConstraints.gridx = 0;
2770
+// aWindowConstraints.gridy = 0;
2771
+// aWindowConstraints.gridwidth = 1;
2772
+// // aWindowConstraints.gridheight = 3;
2773
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2774
+// aWindowConstraints.weightx = 1;
2775
+// aWindowConstraints.weighty = 1;
2776
+// bigThree.add(scenePanel, aWindowConstraints);
2777
+// aWindowConstraints.weightx = 1;
2778
+// aWindowConstraints.gridwidth = 3;
2779
+// // aConstraints.gridheight = 3;
2780
+// aWindowConstraints.gridx = 1;
2781
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2782
+// //bigThree.add(cameraPanel, aWindowConstraints);
2783
+// aWindowConstraints.weightx = 0;
2784
+// aWindowConstraints.gridx = 4;
2785
+// aWindowConstraints.gridwidth = 1;
2786
+// // aWindowConstraints.gridheight = 3;
2787
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2788
+// //bigThree.add(XYZPanel, aWindowConstraints);
2789
+// bigThree.validate();
2790
+// scenePanel.setVisible(true);
2791
+// centralPanel.setVisible(false);
2792
+// XYZPanel.setVisible(false);
2793
+ bigThree.ClearUI();
2794
+ bigThree.addComponent(scenePanel);
2795
+ bigThree.FlushUI();
27212796 } else
2722
- if (event.getSource() == sixButton)
2797
+ if (source == sixButton)
27232798 {
27242799 radio.layout = sixButton;
2725
- bigThree.remove(jtp);
2726
- bigThree.remove(cameraPanel);
2727
- bigThree.remove(XYZPanel);
2728
- aWindowConstraints.gridx = 0;
2729
- aWindowConstraints.gridy = 0;
2730
- aWindowConstraints.gridwidth = 1;
2731
- // aConstraints.gridheight = 3;
2732
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2733
- aWindowConstraints.weightx = 0;
2734
- aWindowConstraints.weighty = 1;
2735
- bigThree.add(jtp, aWindowConstraints);
2736
- aWindowConstraints.weightx = 1;
2737
- aWindowConstraints.gridwidth = 3;
2738
- // aWindowConstraints.gridheight = 3;
2739
- aWindowConstraints.gridx = 1;
2740
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2741
- bigThree.add(cameraPanel, aWindowConstraints);
2742
- aWindowConstraints.weightx = 0;
2743
- aWindowConstraints.gridx = 4;
2744
- aWindowConstraints.gridwidth = 1;
2745
- // aWindowConstraints.gridheight = 3;
2746
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2747
- //bigThree.add(XYZPanel, aConstraints);
2748
- bigThree.revalidate();
2800
+
2801
+// bigThree.remove(scenePanel);
2802
+// bigThree.remove(centralPanel);
2803
+// bigThree.remove(XYZPanel);
2804
+// aWindowConstraints.gridx = 0;
2805
+// aWindowConstraints.gridy = 0;
2806
+// aWindowConstraints.gridwidth = 1;
2807
+// // aConstraints.gridheight = 3;
2808
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2809
+// aWindowConstraints.weightx = 0;
2810
+// aWindowConstraints.weighty = 1;
2811
+// bigThree.add(scenePanel, aWindowConstraints);
2812
+// aWindowConstraints.weightx = 1;
2813
+// aWindowConstraints.gridwidth = 3;
2814
+// // aWindowConstraints.gridheight = 3;
2815
+// aWindowConstraints.gridx = 1;
2816
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2817
+// bigThree.add(centralPanel, aWindowConstraints);
2818
+// aWindowConstraints.weightx = 0;
2819
+// aWindowConstraints.gridx = 4;
2820
+// aWindowConstraints.gridwidth = 1;
2821
+// // aWindowConstraints.gridheight = 3;
2822
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2823
+// //bigThree.add(XYZPanel, aConstraints);
2824
+// bigThree.validate();
2825
+// scenePanel.setVisible(true);
2826
+// centralPanel.setVisible(true);
2827
+// XYZPanel.setVisible(false);
2828
+ bigThree.ClearUI();
2829
+ bigThree.addComponent(scenePanel);
2830
+ bigThree.addComponent(centralPanel);
2831
+ bigThree.FlushUI();
27492832 } else
2750
- if (event.getSource() == sevenButton)
2833
+ if (source == sevenButton)
27512834 {
27522835 radio.layout = sevenButton;
2753
- bigThree.remove(jtp);
2754
- bigThree.remove(cameraPanel);
2755
- bigThree.remove(XYZPanel);
2756
- aWindowConstraints.gridx = 0;
2757
- aWindowConstraints.gridy = 0;
2758
- aWindowConstraints.gridwidth = 1;
2759
- // aWindowConstraints.gridheight = 3;
2760
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2761
- aWindowConstraints.weightx = 0;
2762
- aWindowConstraints.weighty = 1;
2763
- bigThree.add(jtp, aWindowConstraints);
2764
- aWindowConstraints.weightx = 1;
2765
- aWindowConstraints.gridwidth = 3;
2766
- // aWindowConstraints.gridheight = 3;
2767
- aWindowConstraints.gridx = 1;
2768
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2769
- bigThree.add(cameraPanel, aWindowConstraints);
2770
- aWindowConstraints.weightx = 0;
2771
- aWindowConstraints.gridx = 4;
2772
- aWindowConstraints.gridwidth = 1;
2773
- // aConstraints.gridheight = 3;
2774
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2775
- bigThree.add(XYZPanel, aWindowConstraints);
2776
- bigThree.revalidate();
2836
+
2837
+// bigThree.remove(scenePanel);
2838
+// bigThree.remove(centralPanel);
2839
+// bigThree.remove(XYZPanel);
2840
+// aWindowConstraints.gridx = 0;
2841
+// aWindowConstraints.gridy = 0;
2842
+// aWindowConstraints.gridwidth = 1;
2843
+// // aWindowConstraints.gridheight = 3;
2844
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2845
+// aWindowConstraints.weightx = 0;
2846
+// aWindowConstraints.weighty = 1;
2847
+// bigThree.add(scenePanel, aWindowConstraints);
2848
+// aWindowConstraints.weightx = 1;
2849
+// aWindowConstraints.gridwidth = 3;
2850
+// // aWindowConstraints.gridheight = 3;
2851
+// aWindowConstraints.gridx = 1;
2852
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2853
+// bigThree.add(centralPanel, aWindowConstraints);
2854
+// aWindowConstraints.weightx = 0;
2855
+// aWindowConstraints.gridx = 4;
2856
+// aWindowConstraints.gridwidth = 1;
2857
+// // aConstraints.gridheight = 3;
2858
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2859
+// bigThree.add(XYZPanel, aWindowConstraints);
2860
+// bigThree.validate();
2861
+// scenePanel.setVisible(true);
2862
+// centralPanel.setVisible(true);
2863
+// XYZPanel.setVisible(true);
2864
+ bigThree.ClearUI();
2865
+ bigThree.addComponent(scenePanel);
2866
+ bigThree.addComponent(centralPanel);
2867
+ bigThree.addComponent(XYZPanel);
2868
+ bigThree.FlushUI();
27772869 } else
2778
- if (event.getSource() == rootButton)
2870
+ if (source == rootButton)
27792871 {
27802872 Object3D obj;
27812873 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2787,7 +2879,7 @@
27872879
27882880 refreshContents(true);
27892881 } else
2790
- if (event.getSource() == closeButton)
2882
+ if (source == closeButton)
27912883 {
27922884 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27932885 cRadio ab;
....@@ -2808,11 +2900,11 @@
28082900 }
28092901 refreshContents(true);
28102902 } else
2811
- if (event.getSource() == editItem || event.getSource() == editButton)
2903
+ if (source == editItem || source == editButton)
28122904 {
28132905 EditSelection(false);
28142906 } else
2815
- if (event.getSource() == uneditButton)
2907
+ if (source == uneditButton)
28162908 {
28172909 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28182910 {
....@@ -2829,7 +2921,7 @@
28292921 //objEditor.ResetSliders();
28302922 refreshContents(true);
28312923 } else
2832
- if (event.getSource() == clearPanelButton)
2924
+ if (source == clearPanelButton)
28332925 {
28342926 assert(copy == group);
28352927 //copy.ClearUI();
....@@ -2840,7 +2932,7 @@
28402932 listUI.clear();
28412933 refreshContents(true);
28422934 } else
2843
- if (event.getSource() == allParamsButton)
2935
+ if (source == allParamsButton)
28442936 {
28452937 assert(copy == group);
28462938
....@@ -2861,19 +2953,19 @@
28612953
28622954 refreshContents(true);
28632955 } else
2864
- if (event.getSource() == unselectButton)
2956
+ if (source == unselectButton)
28652957 {
28662958 objEditor.jTree.clearSelection();
28672959 // ?? oct 2012 GrafreeD.clipboard.clear();
28682960 objEditor.ResetSliders();
28692961 refreshContents(true);
28702962 } else
2871
- if(event.getSource() instanceof cRadio)
2963
+ if(source instanceof cRadio)
28722964 {
28732965 group.parent = keepparent;
28742966 group.attributes = 0;
28752967 //group.editWindow = null;
2876
- /*cRadio*/ radio = (cRadio)event.getSource();
2968
+ /*cRadio*/ radio = (cRadio)source;
28772969 Object3D obj = radio.GetObject();
28782970 System.out.println("Edit " + obj);
28792971 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2893,7 +2985,7 @@
28932985 }
28942986
28952987 copy = group;
2896
- //CameraPane.theRenderer.object = group;
2988
+ //Globals.theRenderer.object = group;
28972989 if(!useclient)
28982990 {
28992991 cameraView.renderCamera = radio.camera;
....@@ -2902,7 +2994,8 @@
29022994 cameraView.cameras[cameraView.cameracount] = radio.camera;
29032995 cameraView.targetLookAt.set(radio.camera.lookAt);
29042996 cameraView.object = group;
2905
- cameraView.lighttouched = true;
2997
+ //cameraView.lighttouched = true;
2998
+ Globals.lighttouched = true;
29062999 topView.object = group;
29073000 frontView.object = group;
29083001 sideView.object = group;
....@@ -2938,7 +3031,7 @@
29383031 if (useclient)
29393032 {
29403033 cameraView.object = client;
2941
- cameraView.lighttouched = true;
3034
+ Globals.lighttouched = true;
29423035 //topView.object = client;
29433036 //frontView.object = client;
29443037 //sideView.object = client;
....@@ -2946,7 +3039,7 @@
29463039 else
29473040 {
29483041 cameraView.object = group;
2949
- cameraView.lighttouched = true;
3042
+ Globals.lighttouched = true;
29503043 //topView.object = group;
29513044 //frontView.object = group;
29523045 //sideView.object = group;
....@@ -3454,7 +3547,7 @@
34543547 String pigment = Object3D.GetPigment(tex);
34553548 //String bump = Object3D.GetBump(tex);
34563549
3457
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3550
+ com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
34583551
34593552 double s = v.s;
34603553
....@@ -3755,7 +3848,7 @@
37553848 group.selection.RelinkToSupport(); // july 2014
37563849 System.out.println("DONE.");
37573850 refreshContents();
3758
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
3851
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
37593852 }
37603853
37613854 void ReduceMesh(boolean reduction34)
....@@ -4040,16 +4133,16 @@
40404133
40414134 objEditor.SetText(); // jan 2014
40424135
4043
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4136
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
40444137 CameraPane.flash = true;
40454138
40464139 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
40474140 // a camera
40484141 {
40494142 CameraPane.camerachangeframe = 0; // don't refuse it
4050
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4051
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
4052
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4143
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4144
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4145
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40534146 }
40544147
40554148 refreshContents();
....@@ -5007,6 +5100,7 @@
50075100
50085101 private MenuItem resetParentItem;
50095102 private MenuItem repairParentItem;
5103
+ private MenuItem repairShadowItem;
50105104 private MenuItem sortbysizeItem;
50115105 private MenuItem sortbynameItem;
50125106