Normand Briere
2019-04-29 c0c300a9dbd4c0fc127e003e9481d3f9246bbe7a
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,6 +468,7 @@
519468 oe.aConstraints.gridwidth = 1;
520469
521470 oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
471
+ flashSelectionButton.setToolTipText("Show selection");
522472 flashSelectionButton.addActionListener(this);
523473
524474 oe.toolbarPanel.add(new cButton(" ", false));
....@@ -529,21 +479,28 @@
529479
530480 //
531481 oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
482
+ twoButton.setToolTipText("Show center view only");
532483 twoButton.addActionListener(this);
533484 oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
534485 fourButton.addActionListener(this);
486
+ fourButton.setToolTipText("Show left panel only");
535487 oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
488
+ sixButton.setToolTipText("2-column layout left");
536489 sixButton.addActionListener(this);
537490 oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
491
+ threeButton.setToolTipText("2-column layout right");
538492 threeButton.addActionListener(this);
539493 oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
494
+ sevenButton.setToolTipText("3-column layout");
540495 sevenButton.addActionListener(this);
541496 //
542497
543
- 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");
544500 rootButton.addActionListener(this);
545501 oe.aConstraints.gridx += 1;
546502 oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
503
+ closeButton.setToolTipText("Close tab");
547504 closeButton.addActionListener(this);
548505 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
549506 //clearButton.addActionListener(this);
....@@ -646,17 +603,91 @@
646603 radio.layout = sevenButton;
647604 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
648605 }
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
+ }
649680
650681 void EditObject(Object3D obj)
651682 {
652
- cRadio dummyButton = new cRadio(obj.name);
653
- dummyButton.SetObject(obj);
654
- dummyButton.layout = sevenButton;
655
- dummyButton.SetCamera(cameraView.renderCamera, false);
656
- dummyButton.addActionListener(this);
657
- radioPanel.add(dummyButton);
658
- buttonGroup.add(dummyButton);
659
- 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();
660691 }
661692 void SetupViews(ObjEditor oe)
662693 {
....@@ -676,6 +707,7 @@
676707 JCheckBox fastCB;
677708 JCheckBox slowCB;
678709 JCheckBox boxCB;
710
+ JCheckBox zoomBoxCB;
679711 JCheckBox trackCB;
680712 JCheckBox smoothfocusCB;
681713 // JCheckBox speakerMocapCB;
....@@ -755,6 +787,10 @@
755787 Recompile();
756788 cameraView.repaint();
757789 // refreshContents();
790
+ }
791
+ else if(e.getSource() == zoomBoxCB)
792
+ {
793
+ cameraView.ToggleZoomBoxMode();
758794 }
759795 else if(e.getSource() == smoothfocusCB)
760796 {
....@@ -1120,6 +1156,8 @@
11201156 resetParentItem.addActionListener(this);
11211157 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11221158 repairParentItem.addActionListener(this);
1159
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1160
+ repairShadowItem.addActionListener(this);
11231161 menu.add(invariantsItem = new MenuItem("Invariants"));
11241162 invariantsItem.addActionListener(this);
11251163 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1480,6 +1518,7 @@
14801518 //
14811519 public void actionPerformed(ActionEvent event) // , Object arg)
14821520 {
1521
+ Object source = event.getSource();
14831522 /*
14841523 if (event.getSource() == nameField)
14851524 {
....@@ -1491,11 +1530,11 @@
14911530 }
14921531 else
14931532 */
1494
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1533
+ if (source == lookAtItem || source == lookFromItem)
14951534 {
14961535 ScreenFit();
14971536 } else
1498
- if (event.getSource() == switchItem)
1537
+ if (source == switchItem)
14991538 {
15001539 cVector v1 = new cVector();
15011540 cVector v2 = new cVector();
....@@ -1504,11 +1543,11 @@
15041543 objEditor.cameraView.renderCamera.setAim(v2, v1);
15051544 objEditor.cameraView.repaint();
15061545 } else
1507
- if (event.getSource() == rectoidItem)
1546
+ if (source == rectoidItem)
15081547 {
15091548 makeSomething(new Box());
15101549 } else
1511
- if (event.getSource() == particleItem)
1550
+ if (source == particleItem)
15121551 {
15131552 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15141553 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1529,9 +1568,9 @@
15291568 applyExample(particleGeom, "SMOKE");
15301569 makeSomething(particleGeom);
15311570 } else
1532
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1571
+ if (source == ragdollItem || source == ragdoll2Item)
15331572 {
1534
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1573
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15351574
15361575 ragdoll.toParent = LA.newMatrix();
15371576 ragdoll.fromParent = LA.newMatrix();
....@@ -1549,7 +1588,7 @@
15491588 } else
15501589 /*
15511590 */
1552
- if (event.getSource() == heightFieldItem)
1591
+ if (source == heightFieldItem)
15531592 {
15541593 Object3D obj = new Object3D();
15551594
....@@ -1587,31 +1626,31 @@
15871626
15881627 makeSomething(obj);
15891628 } else
1590
- if (event.getSource() == gridItem)
1629
+ if (source == gridItem)
15911630 {
15921631 makeSomething(new Grid());
15931632 } else
1594
- if (event.getSource() == ellipsoidItem)
1633
+ if (source == ellipsoidItem)
15951634 {
15961635 makeSomething(new Sphere());
15971636 } else
1598
- if (event.getSource() == coneItem)
1637
+ if (source == coneItem)
15991638 {
16001639 makeSomething(new Cone());
16011640 } else
1602
- if (event.getSource() == torusItem)
1641
+ if (source == torusItem)
16031642 {
16041643 makeSomething(new Torus());
16051644 } else
1606
- if (event.getSource() == superItem)
1645
+ if (source == superItem)
16071646 {
16081647 makeSomething(new Superellipsoid());
16091648 } else
1610
- if (event.getSource() == kleinItem)
1649
+ if (source == kleinItem)
16111650 {
16121651 makeSomething(new Klein());
16131652 } else
1614
- if (event.getSource() == blobItem)
1653
+ if (source == blobItem)
16151654 {
16161655 Blob blob = new Blob();
16171656 BlobComponent comp = new BlobComponent();
....@@ -1619,15 +1658,15 @@
16191658 //blob.retile();
16201659 makeSomething(blob);
16211660 } else
1622
- if (event.getSource() == latheItem)
1661
+ if (source == latheItem)
16231662 {
16241663 makeSomething(new Lathe());
16251664 } else
1626
- if (event.getSource() == bezierItem)
1665
+ if (source == bezierItem)
16271666 {
16281667 makeSomething(new BezierSurface());
16291668 } else
1630
- if (event.getSource() == checkerItem)
1669
+ if (source == checkerItem)
16311670 {
16321671 /*
16331672 Object3D obj = new BezierSurface(5,8);
....@@ -1642,7 +1681,7 @@
16421681 */
16431682 makeSomething(new Checker());
16441683 } else
1645
- if (event.getSource() == meshItem)
1684
+ if (source == meshItem)
16461685 {
16471686 Object3D itemtomake = new Object3D();
16481687 Object3D child;
....@@ -1663,35 +1702,35 @@
16631702 makeSomething(child);
16641703 }
16651704 } else
1666
- if (event.getSource() == springItem)
1705
+ if (source == springItem)
16671706 {
16681707 cSpring s = new cSpring();
16691708 s.setup();
16701709 makeSomething(s);
16711710 } else
1672
- if (event.getSource() == flagItem)
1711
+ if (source == flagItem)
16731712 {
16741713 cSpring s = new cFlag();
16751714 s.setup();
16761715 makeSomething(s);
16771716 } else
1678
- if (event.getSource() == lightItem)
1717
+ if (source == lightItem)
16791718 {
16801719 makeSomething(new Light());
16811720 } else
1682
- if (event.getSource() == csgItem)
1721
+ if (source == csgItem)
16831722 {
16841723 group(new CSG());
16851724 } else
1686
- if (event.getSource() == templateItem)
1725
+ if (source == templateItem)
16871726 {
16881727 group(new cTemplate());
16891728 } else
1690
- if (event.getSource() == attributeItem)
1729
+ if (source == attributeItem)
16911730 {
16921731 makeSomething(new Attribute());
16931732 } else
1694
- if (event.getSource() == pointflowItem)
1733
+ if (source == pointflowItem)
16951734 {
16961735 makeSomething(new PointFlow());
16971736 } else
....@@ -1703,7 +1742,7 @@
17031742 } else
17041743 */
17051744
1706
- if (event.getSource() == superLoopItem)
1745
+ if (source == superLoopItem)
17071746 {
17081747 Composite g = new cGroup();
17091748 for (int i=0; i<15; i++)
....@@ -1725,7 +1764,7 @@
17251764
17261765 group(g);
17271766 } else
1728
- if (event.getSource() == loopItem)
1767
+ if (source == loopItem)
17291768 {
17301769 Composite csg = new GroupLeaf();
17311770 csg.count = 5;
....@@ -1734,7 +1773,7 @@
17341773 csg.addChild(child);
17351774 child.addChild(csg);
17361775 } else
1737
- if (event.getSource() == doubleItem)
1776
+ if (source == doubleItem)
17381777 {
17391778 Composite csg = new GroupLeaf();
17401779 csg.count = 5;
....@@ -1746,7 +1785,7 @@
17461785 csg.addChild(child);
17471786 child.addChild(csg);
17481787 } else
1749
- if (event.getSource() == tripleItem)
1788
+ if (source == tripleItem)
17501789 {
17511790 Composite csg = new GroupLeaf();
17521791 csg.count = 4;
....@@ -1762,70 +1801,70 @@
17621801 child.addChild(csg);
17631802 } else
17641803
1765
- if (event.getSource() == importGFDItem)
1804
+ if (source == importGFDItem)
17661805 {
17671806 ImportGFD();
17681807 } else
1769
- if (event.getSource() == importVRMLX3DItem)
1808
+ if (source == importVRMLX3DItem)
17701809 {
17711810 ImportVRMLX3D();
17721811 } else
1773
- if (event.getSource() == import3DSItem)
1812
+ if (source == import3DSItem)
17741813 {
17751814 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17761815 } else
1777
- if (event.getSource() == importOBJItem)
1816
+ if (source == importOBJItem)
17781817 {
17791818 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
17801819 } else
1781
- if (event.getSource() == computeAOItem)
1820
+ if (source == computeAOItem)
17821821 {
1783
- CameraPane.drawMode = CameraPane.OCCLUSION;
1784
- CameraPane.theRenderer.repaint();
1822
+ Globals.drawMode = CameraPane.OCCLUSION;
1823
+ Globals.theRenderer.repaint();
17851824 } else
1786
- if (event.getSource() == recompileItem)
1825
+ if (source == recompileItem)
17871826 {
17881827 Recompile();
17891828 refreshContents();
17901829 } else
1791
- if (event.getSource() == editScriptItem)
1830
+ if (source == editScriptItem)
17921831 {
17931832 OpenDialog();
17941833 refreshContents();
17951834 } else
1796
- if (event.getSource() == invariantsItem)
1835
+ if (source == invariantsItem)
17971836 {
17981837 System.out.println("Invariants:");
17991838 GrafreeD.grafreeD.universe.invariants();
18001839 } else
1801
- if (event.getSource() == memoryItem)
1840
+ if (source == memoryItem)
18021841 {
18031842 //System.out.println("Invariants:");
18041843 PrintMemory();
18051844 } else
1806
- if (event.getSource() == pathItem)
1845
+ if (source == pathItem)
18071846 {
18081847 PrintPath();
18091848 } else
1810
- if (event.getSource() == analyzeItem)
1849
+ if (source == analyzeItem)
18111850 {
18121851 AnalyzeObject();
18131852 } else
1814
- if (event.getSource() == dumpItem)
1853
+ if (source == dumpItem)
18151854 {
18161855 DumpObject();
18171856 } else
1818
- if (event.getSource() == screenfitButton)
1857
+ if (source == screenfitButton)
18191858 {
18201859 //Reload(lastConverter, lastFilename, true);
18211860 ScreenFit();
18221861 } else
1823
- if (event.getSource() == screenfitpointButton)
1862
+ if (source == screenfitpointButton)
18241863 {
18251864 //Reload(lastConverter, lastFilename, true);
18261865 ScreenFitPoint();
18271866 } else
1828
- if (event.getSource() == snapobjectButton)
1867
+ if (source == snapobjectButton)
18291868 {
18301869 //Reload(lastConverter, lastFilename, true);
18311870 SnapObject();
....@@ -1836,13 +1875,13 @@
18361875 // Recompile();
18371876 // refreshContents();
18381877 // } else
1839
- if (event.getSource() == gcButton)
1878
+ if (source == gcButton)
18401879 {
18411880 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18421881 System.gc();
18431882 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18441883 } else
1845
- if (event.getSource() == editLeafItem)
1884
+ if (source == editLeafItem)
18461885 {
18471886 Object3D obj;
18481887 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1856,62 +1895,62 @@
18561895 }
18571896 refreshContents(true);
18581897 } else
1859
- if (event.getSource() == openWindowItem)
1898
+ if (source == openWindowItem)
18601899 {
18611900 EditSelection(true);
18621901 } else
1863
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1902
+ if (source == cutItem || source == clearButton)
18641903 {
18651904 loadClipboard(true);
18661905 } else
1867
- if (event.getSource() == duplicateItem)
1906
+ if (source == duplicateItem)
18681907 {
18691908 Object3D keep = GrafreeD.clipboard;
18701909 loadClipboard(false);
18711910 paste(false);
18721911 GrafreeD.clipboard = keep;
18731912 } else
1874
- if (event.getSource() == cloneItem)
1913
+ if (source == cloneItem)
18751914 {
18761915 CloneSelection(false);
18771916 } else
1878
- if (event.getSource() == cloneSupportItem)
1917
+ if (source == cloneSupportItem)
18791918 {
18801919 CloneSelection(true);
18811920 } else
1882
- if (event.getSource() == copyItem)
1921
+ if (source == copyItem)
18831922 {
18841923 loadClipboard(false);
18851924 } else
1886
- if (event.getSource() == pasteItem)
1925
+ if (source == pasteItem)
18871926 {
18881927 paste(false);
18891928 } else
1890
- if (event.getSource() == pasteLinkItem)
1929
+ if (source == pasteLinkItem)
18911930 {
18921931 pasteInto(false);
18931932 } else
1894
- if (event.getSource() == pasteCloneItem)
1933
+ if (source == pasteCloneItem)
18951934 {
18961935 pasteInto(true);
18971936 } else
1898
- if (event.getSource() == pasteExpandItem)
1937
+ if (source == pasteExpandItem)
18991938 {
19001939 paste(true);
19011940 } else
1902
- if (event.getSource() == synchronizeItem)
1941
+ if (source == synchronizeItem)
19031942 {
19041943 Overwrite(Object3D.TRANSFORM);
19051944 } else
1906
- if (event.getSource() == overwriteNameItem)
1945
+ if (source == overwriteNameItem)
19071946 {
19081947 Overwrite(Object3D.NAME);
19091948 } else
1910
- if (event.getSource() == overwriteUVItem)
1949
+ if (source == overwriteUVItem)
19111950 {
19121951 Overwrite(Object3D.UV);
19131952 } else
1914
- if (event.getSource() == overwriteMatItem)
1953
+ if (source == overwriteMatItem)
19151954 {
19161955 /* july 2015
19171956 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1931,7 +1970,7 @@
19311970
19321971 Overwrite(dropAttributes);
19331972 }
1934
- if (event.getSource() == overwriteGeoItem)
1973
+ if (source == overwriteGeoItem)
19351974 {
19361975 Overwrite(Object3D.GEOMETRY);
19371976 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1948,7 +1987,7 @@
19481987 // refreshContents();
19491988 // }
19501989 } else
1951
- if (event.getSource() == generateMeshItem)
1990
+ if (source == generateMeshItem)
19521991 {
19531992 //if (group.selection.size() == 1)
19541993 // for (int i=0; i<group.selection.size(); i++)
....@@ -1959,7 +1998,7 @@
19591998 ResetModel();
19601999 refreshContents();
19612000 } else
1962
- if (event.getSource() == extractGeometriesItem)
2001
+ if (source == extractGeometriesItem)
19632002 {
19642003 boolean one = false;
19652004
....@@ -1986,7 +2025,7 @@
19862025 ResetModel();
19872026 refreshContents();
19882027 } else
1989
- if (event.getSource() == cloneGeometriesItem)
2028
+ if (source == cloneGeometriesItem)
19902029 {
19912030 boolean one = false;
19922031
....@@ -2012,7 +2051,7 @@
20122051 ResetModel();
20132052 refreshContents();
20142053 } else
2015
- if (event.getSource() == shareGeometriesItem)
2054
+ if (source == shareGeometriesItem)
20162055 {
20172056 boolean one = false;
20182057
....@@ -2042,7 +2081,7 @@
20422081 refreshContents();
20432082 }
20442083 } else
2045
- if (event.getSource() == mergeGeometriesItem)
2084
+ if (source == mergeGeometriesItem)
20462085 {
20472086 boolean one = false;
20482087
....@@ -2072,7 +2111,7 @@
20722111 ResetModel();
20732112 refreshContents();
20742113 } else
2075
- if (event.getSource() == linkverticesItem)
2114
+ if (source == linkverticesItem)
20762115 {
20772116 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20782117 // {
....@@ -2092,7 +2131,7 @@
20922131 if (content instanceof cGroup && ((cGroup)content).transientlink )
20932132 content = ((cGroup)content).get(0);
20942133
2095
- 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));
20962135 for (int i=0; i<group.selection.size(); i++)
20972136 {
20982137 boolean random = CameraPane.RANDOM;
....@@ -2101,11 +2140,11 @@
21012140 // group.selection.get(i).setMasterThis(content); // should be identity
21022141 CameraPane.RANDOM = random;
21032142 }
2104
- 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));
21052144 refreshContents();
21062145 }
21072146 } else
2108
- if (event.getSource() == resetsupportItem)
2147
+ if (source == resetsupportItem)
21092148 {
21102149 for (int i=0; i<group.selection.size(); i++)
21112150 {
....@@ -2117,7 +2156,7 @@
21172156
21182157 refreshContents();
21192158 } else
2120
- if (event.getSource() == relinkverticesItem)
2159
+ if (source == relinkverticesItem)
21212160 {
21222161 boolean random = CameraPane.RANDOM;
21232162 CameraPane.RANDOM = false; // parse all random nodes
....@@ -2126,7 +2165,7 @@
21262165
21272166 refreshContents();
21282167 } else
2129
- if (event.getSource() == resetreferencesItem)
2168
+ if (source == resetreferencesItem)
21302169 {
21312170 for (int i=0; i<group.selection.size(); i++)
21322171 {
....@@ -2135,7 +2174,7 @@
21352174
21362175 refreshContents();
21372176 } else
2138
- if (event.getSource() == setMasterItem)
2177
+ if (source == setMasterItem)
21392178 {
21402179 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21412180 {
....@@ -2148,7 +2187,7 @@
21482187 refreshContents();
21492188 }
21502189 } else
2151
- if (event.getSource() == poseMeshItem)
2190
+ if (source == poseMeshItem)
21522191 {
21532192 if (group.selection.size() == 1)
21542193 {
....@@ -2167,19 +2206,19 @@
21672206 }
21682207
21692208 } else
2170
- if (event.getSource() == revertMeshItem)
2209
+ if (source == revertMeshItem)
21712210 {
21722211 RevertMeshes();
21732212 } else
2174
- if (event.getSource() == resetMeshItem)
2213
+ if (source == resetMeshItem)
21752214 {
21762215 ResetAll();
21772216 } else
2178
- if (event.getSource() == stepAllItem)
2217
+ if (source == stepAllItem)
21792218 {
21802219 StepAll();
21812220 } else
2182
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2221
+ if (source == clearItem) // || event.getSource() == clearButton)
21832222 {
21842223 //int indices[] = jList.getSelectedIndices();
21852224 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2187,46 +2226,46 @@
21872226
21882227 ClearSelection(false);
21892228 } else
2190
- if (event.getSource() == clearAllItem)
2229
+ if (source == clearAllItem)
21912230 {
21922231 ClearSelection(true);
21932232 } else
2194
- if (event.getSource() == grabItem)
2233
+ if (source == grabItem)
21952234 {
21962235 group(new cGroup(), true);
21972236 } else
2198
- if (event.getSource() == hideItem)
2237
+ if (source == hideItem)
21992238 {
22002239 group(new HiddenObject());
22012240 } else
2202
- if (event.getSource() == frontItem)
2241
+ if (source == frontItem)
22032242 {
22042243 front();
22052244 } else
2206
- if (event.getSource() == backItem)
2245
+ if (source == backItem)
22072246 {
22082247 back();
22092248 } else
2210
- if (event.getSource() == cameraItem)
2249
+ if (source == cameraItem)
22112250 {
22122251 makeSomething(new Camera());
22132252 } else
2214
- if (event.getSource() == compositeItem)
2253
+ if (source == compositeItem)
22152254 {
22162255 group(new Composite());
22172256 } else
2218
- if (event.getSource() == randomItem)
2257
+ if (source == randomItem)
22192258 {
22202259 RandomNode random = new RandomNode();
22212260 group(random);
22222261 if (random.size() > 0)
22232262 random.name = random.get(0).name + "Rnd";
22242263 } else
2225
- if (event.getSource() == physicsItem)
2264
+ if (source == physicsItem)
22262265 {
22272266 group(new PhysicsNode());
22282267 } else
2229
- if (event.getSource() == frameselectorItem)
2268
+ if (source == frameselectorItem)
22302269 {
22312270 for (int i=0; i<group.selection.size(); i++)
22322271 {
....@@ -2238,7 +2277,7 @@
22382277 ResetModel();
22392278 refreshContents();
22402279 } else
2241
- if (event.getSource() == switchGeoItem)
2280
+ if (source == switchGeoItem)
22422281 {
22432282 for (int i=0; i<group.selection.size(); i++)
22442283 {
....@@ -2250,7 +2289,7 @@
22502289 ResetModel();
22512290 refreshContents();
22522291 } else
2253
- if (event.getSource() == switchTransfoItem)
2292
+ if (source == switchTransfoItem)
22542293 {
22552294 for (int i=0; i<group.selection.size(); i++)
22562295 {
....@@ -2262,7 +2301,7 @@
22622301 ResetModel();
22632302 refreshContents();
22642303 } else
2265
- if (event.getSource() == morphItem)
2304
+ if (source == morphItem)
22662305 {
22672306 for (int i=0; i<group.selection.size(); i++)
22682307 {
....@@ -2274,7 +2313,7 @@
22742313 ResetModel();
22752314 refreshContents();
22762315 } else
2277
- if (event.getSource() == scriptNodeItem)
2316
+ if (source == scriptNodeItem)
22782317 {
22792318 boolean atleastone = false;
22802319
....@@ -2313,31 +2352,31 @@
23132352 }
23142353 }
23152354 } else
2316
- if (event.getSource() == linkerItem)
2355
+ if (source == linkerItem)
23172356 {
23182357 group(new cLinker());
23192358 } else
2320
- if (event.getSource() == textureItem)
2359
+ if (source == textureItem)
23212360 {
23222361 group(new TextureNode());
23232362 } else
2324
- if (event.getSource() == billboardItem)
2363
+ if (source == billboardItem)
23252364 {
23262365 group(new BillboardNode());
23272366 } else
2328
- if (event.getSource() == shadowXItem)
2367
+ if (source == shadowXItem)
23292368 {
23302369 CastShadow(0);
23312370 } else
2332
- if (event.getSource() == shadowYItem)
2371
+ if (source == shadowYItem)
23332372 {
23342373 CastShadow(1);
23352374 } else
2336
- if (event.getSource() == shadowZItem)
2375
+ if (source == shadowZItem)
23372376 {
23382377 CastShadow(2);
23392378 } else
2340
- if (event.getSource() == ungroupItem)
2379
+ if (source == ungroupItem)
23412380 {
23422381 //ungroup();
23432382 for (int i=0; i<group.selection.size(); i++)
....@@ -2349,179 +2388,179 @@
23492388
23502389 refreshContents();
23512390 } else
2352
- if (event.getSource() == genUVItem)
2391
+ if (source == genUVItem)
23532392 {
23542393 GenUV();
23552394 } else
2356
- if (event.getSource() == genNormalsCADItem)
2395
+ if (source == genNormalsCADItem)
23572396 {
23582397 GenNormals(true);
23592398 } else
2360
- if (event.getSource() == genNormalsMESHItem)
2399
+ if (source == genNormalsMESHItem)
23612400 {
23622401 GenNormals(true); // TODO
23632402 } else
2364
- if (event.getSource() == genNormalsORGANItem)
2403
+ if (source == genNormalsORGANItem)
23652404 {
23662405 GenNormals(false);
23672406 } else
2368
- if (event.getSource() == genNormalsMINEItem)
2407
+ if (source == genNormalsMINEItem)
23692408 {
23702409 GenNormalsMINE();
23712410 } else
2372
- if (event.getSource() == stripifyItem)
2411
+ if (source == stripifyItem)
23732412 {
23742413 Stripify();
23752414 } else
2376
- if (event.getSource() == unstripifyItem)
2415
+ if (source == unstripifyItem)
23772416 {
23782417 Unstripify();
23792418 } else
2380
- if (event.getSource() == trimItem)
2419
+ if (source == trimItem)
23812420 {
23822421 Trim();
23832422 } else
2384
- if (event.getSource() == untrimItem)
2423
+ if (source == untrimItem)
23852424 {
23862425 Untrim();
23872426 } else
2388
- if (event.getSource() == clearColorsItem)
2427
+ if (source == clearColorsItem)
23892428 {
23902429 ClearColors();
23912430 } else
2392
- if (event.getSource() == clearMaterialsItem)
2431
+ if (source == clearMaterialsItem)
23932432 {
23942433 ClearMaterials();
23952434 } else
2396
- if (event.getSource() == liveleavesItem)
2435
+ if (source == liveleavesItem)
23972436 {
23982437 LiveLeaves(true);
23992438 } else
2400
- if (event.getSource() == unliveleavesItem)
2439
+ if (source == unliveleavesItem)
24012440 {
24022441 LiveLeaves(false);
24032442 } else
2404
- if (event.getSource() == supportleavesItem)
2443
+ if (source == supportleavesItem)
24052444 {
24062445 SupportLeaves(true);
24072446 } else
2408
- if (event.getSource() == unsupportleavesItem)
2447
+ if (source == unsupportleavesItem)
24092448 {
24102449 SupportLeaves(false);
24112450 } else
2412
- if (event.getSource() == hideleavesItem)
2451
+ if (source == hideleavesItem)
24132452 {
24142453 HideLeaves(true);
24152454 } else
2416
- if (event.getSource() == showleavesItem)
2455
+ if (source == showleavesItem)
24172456 {
24182457 HideLeaves(false);
24192458 } else
2420
- if (event.getSource() == markleavesItem)
2459
+ if (source == markleavesItem)
24212460 {
24222461 MarkLeaves(true);
24232462 } else
2424
- if (event.getSource() == unmarkleavesItem)
2463
+ if (source == unmarkleavesItem)
24252464 {
24262465 MarkLeaves(false);
24272466 } else
2428
- if (event.getSource() == flipVItem)
2467
+ if (source == flipVItem)
24292468 {
24302469 FlipV(true);
24312470 } else
2432
- if (event.getSource() == unflipVItem)
2471
+ if (source == unflipVItem)
24332472 {
24342473 FlipV(false);
24352474 } else
2436
- if (event.getSource() == lowTexturesItem)
2475
+ if (source == lowTexturesItem)
24372476 {
24382477 SetTexRes(0);
24392478 } else
2440
- if (event.getSource() == normalTexturesItem)
2479
+ if (source == normalTexturesItem)
24412480 {
24422481 SetTexRes(1);
24432482 } else
2444
- if (event.getSource() == highTexturesItem)
2483
+ if (source == highTexturesItem)
24452484 {
24462485 SetTexRes(2);
24472486 } else
2448
- if (event.getSource() == veryhighTexturesItem)
2487
+ if (source == veryhighTexturesItem)
24492488 {
24502489 SetTexRes(3);
24512490 } else
2452
- if (event.getSource() == maxTexturesItem)
2491
+ if (source == maxTexturesItem)
24532492 {
24542493 SetTexRes(4);
24552494 } else
2456
- if (event.getSource() == panoTexturesItem)
2495
+ if (source == panoTexturesItem)
24572496 {
24582497 SetTexRes(5);
24592498 } else
2460
- if (event.getSource() == reverseNormalsItem)
2499
+ if (source == reverseNormalsItem)
24612500 {
24622501 ReverseNormals();
24632502 } else
2464
- if (event.getSource() == parseverticesItem)
2503
+ if (source == parseverticesItem)
24652504 {
24662505 ParseVertices();
24672506 } else
2468
- if (event.getSource() == textureFieldItem)
2507
+ if (source == textureFieldItem)
24692508 {
24702509 TextureVertices();
24712510 } else
2472
- if (event.getSource() == alignItem)
2511
+ if (source == alignItem)
24732512 {
24742513 Align();
24752514 } else
2476
- if (event.getSource() == mirrorItem)
2515
+ if (source == mirrorItem)
24772516 {
24782517 MirrorPoses();
24792518 } else
2480
- if (event.getSource() == reduceMorphItem)
2519
+ if (source == reduceMorphItem)
24812520 {
24822521 MeshReduction(false);
24832522 } else
2484
- if (event.getSource() == reduce34MorphItem)
2523
+ if (source == reduce34MorphItem)
24852524 {
24862525 MeshReduction(true);
24872526 } else
2488
- if (event.getSource() == reverseTrianglesItem)
2527
+ if (source == reverseTrianglesItem)
24892528 {
24902529 ReverseTriangles();
24912530 } else
2492
- if (event.getSource() == reduceMeshItem)
2531
+ if (source == reduceMeshItem)
24932532 {
24942533 ReduceMesh(false);
24952534 } else
2496
- if (event.getSource() == reduce34MeshItem)
2535
+ if (source == reduce34MeshItem)
24972536 {
24982537 ReduceMesh(true);
24992538 } else
2500
- if (event.getSource() == increaseMeshItem)
2539
+ if (source == increaseMeshItem)
25012540 {
25022541 IncreaseMesh();
25032542 } else
2504
- if (event.getSource() == clipMeshItem)
2543
+ if (source == clipMeshItem)
25052544 {
25062545 ClipMesh();
25072546 } else
2508
- if (event.getSource() == smoothMeshItem)
2547
+ if (source == smoothMeshItem)
25092548 {
25102549 SmoothMesh();
25112550 } else
2512
- if (event.getSource() == transformgeometryItem)
2551
+ if (source == transformgeometryItem)
25132552 {
25142553 TransformGeometry();
25152554 } else
2516
- if (event.getSource() == resetTransformItem)
2555
+ if (source == resetTransformItem)
25172556 {
25182557 ResetTransform();
25192558 } else
2520
- if (event.getSource() == resetCentroidItem)
2559
+ if (source == resetCentroidItem)
25212560 {
25222561 ResetCentroid();
25232562 } else
2524
- if (event.getSource() == resetParentItem)
2563
+ if (source == resetParentItem)
25252564 {
25262565 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25272566 {
....@@ -2531,7 +2570,7 @@
25312570
25322571 refreshContents();
25332572 } else
2534
- if (event.getSource() == repairParentItem)
2573
+ if (source == repairParentItem)
25352574 {
25362575 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25372576 {
....@@ -2545,7 +2584,21 @@
25452584
25462585 refreshContents();
25472586 } else
2548
- 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)
25492602 {
25502603 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25512604 {
....@@ -2557,7 +2610,7 @@
25572610 ResetModel();
25582611 refreshContents();
25592612 } else
2560
- if (event.getSource() == sortbynameItem)
2613
+ if (source == sortbynameItem)
25612614 {
25622615 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25632616 {
....@@ -2569,7 +2622,7 @@
25692622 ResetModel();
25702623 refreshContents();
25712624 } else
2572
- if (event.getSource() == attachPigmentItem)
2625
+ if (source == attachPigmentItem)
25732626 {
25742627 String texture = GetFile("Attach pigment");
25752628 Object3D obj;
....@@ -2581,7 +2634,7 @@
25812634
25822635 refreshContents();
25832636 } else
2584
- if (event.getSource() == detachPigmentItem)
2637
+ if (source == detachPigmentItem)
25852638 {
25862639 Object3D obj;
25872640 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2592,7 +2645,7 @@
25922645
25932646 refreshContents();
25942647 } else
2595
- if (event.getSource() == attachBumpItem)
2648
+ if (source == attachBumpItem)
25962649 {
25972650 String texture = GetFile("Attach bump");
25982651 Object3D obj;
....@@ -2604,7 +2657,7 @@
26042657
26052658 refreshContents();
26062659 } else
2607
- if (event.getSource() == detachBumpItem)
2660
+ if (source == detachBumpItem)
26082661 {
26092662 Object3D obj;
26102663 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2615,7 +2668,7 @@
26152668
26162669 refreshContents();
26172670 } else
2618
- if (event.getSource() == pigmentBumpItem)
2671
+ if (source == pigmentBumpItem)
26192672 {
26202673 Object3D obj;
26212674 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2626,158 +2679,195 @@
26262679
26272680 refreshContents();
26282681 } else
2629
- if (event.getSource() == flashSelectionButton)
2682
+ if (source == flashSelectionButton)
26302683 {
26312684 CameraPane.flash = true;
26322685 refreshContents();
26332686 } else
2634
- if (event.getSource() == oneButton)
2687
+ if (source == oneButton)
26352688 {
26362689 } else
2637
- if (event.getSource() == twoButton)
2690
+ if (source == twoButton)
26382691 {
26392692 radio.layout = twoButton;
26402693 // bug
26412694 //gridPanel.setDividerLocation(1.0);
26422695 //bigPanel.setDividerLocation(0.0);
2643
- bigThree.remove(scenePanel);
2644
- bigThree.remove(centralPanel);
2645
- bigThree.remove(XYZPanel);
2646
- aWindowConstraints.gridx = 0;
2647
- aWindowConstraints.gridy = 0;
2648
- aWindowConstraints.gridwidth = 1;
2649
- // aConstraints.gridheight = 3;
2650
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2651
- aWindowConstraints.weightx = 0;
2652
- aWindowConstraints.weighty = 1;
2653
- //bigThree.add(jtp, aWindowConstraints);
2654
- aWindowConstraints.weightx = 1;
2655
- aWindowConstraints.gridwidth = 3;
2656
- // aConstraints.gridheight = 3;
2657
- aWindowConstraints.gridx = 1;
2658
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2659
- bigThree.add(centralPanel, aWindowConstraints);
2660
- aWindowConstraints.weightx = 0;
2661
- aWindowConstraints.gridx = 4;
2662
- aWindowConstraints.gridwidth = 1;
2663
- // aConstraints.gridheight = 3;
2664
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2665
- //bigThree.add(XYZPanel, aWindowConstraints);
2666
- 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.add(centralPanel);
2724
+ bigThree.FlushUI();
26672725 } else
2668
- if (event.getSource() == threeButton)
2726
+ if (source == threeButton)
26692727 {
26702728 radio.layout = threeButton;
2671
- bigThree.remove(scenePanel);
2672
- bigThree.remove(centralPanel);
2673
- bigThree.remove(XYZPanel);
2674
- aWindowConstraints.gridx = 0;
2675
- aWindowConstraints.gridy = 0;
2676
- aWindowConstraints.gridwidth = 1;
2677
- // aConstraints.gridheight = 3;
2678
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2679
- aWindowConstraints.weightx = 0;
2680
- aWindowConstraints.weighty = 1;
2681
- //bigThree.add(jtp, aWindowConstraints);
2682
- aWindowConstraints.weightx = 1;
2683
- aWindowConstraints.gridwidth = 3;
2684
- // aConstraints.gridheight = 3;
2685
- aWindowConstraints.gridx = 1;
2686
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2687
- bigThree.add(centralPanel, aWindowConstraints);
2688
- aWindowConstraints.weightx = 0;
2689
- aWindowConstraints.gridx = 4;
2690
- aWindowConstraints.gridwidth = 1;
2691
- // aConstraints.gridheight = 3;
2692
- aConstraints.fill = GridBagConstraints.VERTICAL;
2693
- bigThree.add(XYZPanel, aWindowConstraints);
2694
- 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.add(centralPanel);
2759
+ bigThree.add(XYZPanel);
2760
+ bigThree.FlushUI();
26952761 } else
2696
- if (event.getSource() == fourButton)
2762
+ if (source == fourButton)
26972763 {
26982764 radio.layout = fourButton;
2699
- bigThree.remove(scenePanel);
2700
- bigThree.remove(centralPanel);
2701
- bigThree.remove(XYZPanel);
2702
- aWindowConstraints.gridx = 0;
2703
- aWindowConstraints.gridy = 0;
2704
- aWindowConstraints.gridwidth = 1;
2705
- // aWindowConstraints.gridheight = 3;
2706
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2707
- aWindowConstraints.weightx = 1;
2708
- aWindowConstraints.weighty = 1;
2709
- bigThree.add(scenePanel, aWindowConstraints);
2710
- aWindowConstraints.weightx = 1;
2711
- aWindowConstraints.gridwidth = 3;
2712
- // aConstraints.gridheight = 3;
2713
- aWindowConstraints.gridx = 1;
2714
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2715
- //bigThree.add(cameraPanel, aWindowConstraints);
2716
- aWindowConstraints.weightx = 0;
2717
- aWindowConstraints.gridx = 4;
2718
- aWindowConstraints.gridwidth = 1;
2719
- // aWindowConstraints.gridheight = 3;
2720
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2721
- //bigThree.add(XYZPanel, aWindowConstraints);
2722
- 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.add(scenePanel);
2795
+ bigThree.FlushUI();
27232796 } else
2724
- if (event.getSource() == sixButton)
2797
+ if (source == sixButton)
27252798 {
27262799 radio.layout = sixButton;
2727
- bigThree.remove(scenePanel);
2728
- bigThree.remove(centralPanel);
2729
- bigThree.remove(XYZPanel);
2730
- aWindowConstraints.gridx = 0;
2731
- aWindowConstraints.gridy = 0;
2732
- aWindowConstraints.gridwidth = 1;
2733
- // aConstraints.gridheight = 3;
2734
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2735
- aWindowConstraints.weightx = 0;
2736
- aWindowConstraints.weighty = 1;
2737
- bigThree.add(scenePanel, aWindowConstraints);
2738
- aWindowConstraints.weightx = 1;
2739
- aWindowConstraints.gridwidth = 3;
2740
- // aWindowConstraints.gridheight = 3;
2741
- aWindowConstraints.gridx = 1;
2742
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2743
- bigThree.add(centralPanel, aWindowConstraints);
2744
- aWindowConstraints.weightx = 0;
2745
- aWindowConstraints.gridx = 4;
2746
- aWindowConstraints.gridwidth = 1;
2747
- // aWindowConstraints.gridheight = 3;
2748
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2749
- //bigThree.add(XYZPanel, aConstraints);
2750
- 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.add(scenePanel);
2830
+ bigThree.add(centralPanel);
2831
+ bigThree.FlushUI();
27512832 } else
2752
- if (event.getSource() == sevenButton)
2833
+ if (source == sevenButton)
27532834 {
27542835 radio.layout = sevenButton;
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.VERTICAL;
2763
- aWindowConstraints.weightx = 0;
2764
- aWindowConstraints.weighty = 1;
2765
- bigThree.add(scenePanel, aWindowConstraints);
2766
- aWindowConstraints.weightx = 1;
2767
- aWindowConstraints.gridwidth = 3;
2768
- // aWindowConstraints.gridheight = 3;
2769
- aWindowConstraints.gridx = 1;
2770
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2771
- bigThree.add(centralPanel, aWindowConstraints);
2772
- aWindowConstraints.weightx = 0;
2773
- aWindowConstraints.gridx = 4;
2774
- aWindowConstraints.gridwidth = 1;
2775
- // aConstraints.gridheight = 3;
2776
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2777
- bigThree.add(XYZPanel, aWindowConstraints);
2778
- 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.add(scenePanel);
2866
+ bigThree.add(centralPanel);
2867
+ bigThree.add(XYZPanel);
2868
+ bigThree.FlushUI();
27792869 } else
2780
- if (event.getSource() == rootButton)
2870
+ if (source == rootButton)
27812871 {
27822872 Object3D obj;
27832873 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2789,7 +2879,7 @@
27892879
27902880 refreshContents(true);
27912881 } else
2792
- if (event.getSource() == closeButton)
2882
+ if (source == closeButton)
27932883 {
27942884 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27952885 cRadio ab;
....@@ -2810,11 +2900,11 @@
28102900 }
28112901 refreshContents(true);
28122902 } else
2813
- if (event.getSource() == editItem || event.getSource() == editButton)
2903
+ if (source == editItem || source == editButton)
28142904 {
28152905 EditSelection(false);
28162906 } else
2817
- if (event.getSource() == uneditButton)
2907
+ if (source == uneditButton)
28182908 {
28192909 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28202910 {
....@@ -2831,7 +2921,7 @@
28312921 //objEditor.ResetSliders();
28322922 refreshContents(true);
28332923 } else
2834
- if (event.getSource() == clearPanelButton)
2924
+ if (source == clearPanelButton)
28352925 {
28362926 assert(copy == group);
28372927 //copy.ClearUI();
....@@ -2842,7 +2932,7 @@
28422932 listUI.clear();
28432933 refreshContents(true);
28442934 } else
2845
- if (event.getSource() == allParamsButton)
2935
+ if (source == allParamsButton)
28462936 {
28472937 assert(copy == group);
28482938
....@@ -2863,19 +2953,19 @@
28632953
28642954 refreshContents(true);
28652955 } else
2866
- if (event.getSource() == unselectButton)
2956
+ if (source == unselectButton)
28672957 {
28682958 objEditor.jTree.clearSelection();
28692959 // ?? oct 2012 GrafreeD.clipboard.clear();
28702960 objEditor.ResetSliders();
28712961 refreshContents(true);
28722962 } else
2873
- if(event.getSource() instanceof cRadio)
2963
+ if(source instanceof cRadio)
28742964 {
28752965 group.parent = keepparent;
28762966 group.attributes = 0;
28772967 //group.editWindow = null;
2878
- /*cRadio*/ radio = (cRadio)event.getSource();
2968
+ /*cRadio*/ radio = (cRadio)source;
28792969 Object3D obj = radio.GetObject();
28802970 System.out.println("Edit " + obj);
28812971 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2895,7 +2985,7 @@
28952985 }
28962986
28972987 copy = group;
2898
- //CameraPane.theRenderer.object = group;
2988
+ //Globals.theRenderer.object = group;
28992989 if(!useclient)
29002990 {
29012991 cameraView.renderCamera = radio.camera;
....@@ -2904,7 +2994,8 @@
29042994 cameraView.cameras[cameraView.cameracount] = radio.camera;
29052995 cameraView.targetLookAt.set(radio.camera.lookAt);
29062996 cameraView.object = group;
2907
- cameraView.lighttouched = true;
2997
+ //cameraView.lighttouched = true;
2998
+ Globals.lighttouched = true;
29082999 topView.object = group;
29093000 frontView.object = group;
29103001 sideView.object = group;
....@@ -2940,7 +3031,7 @@
29403031 if (useclient)
29413032 {
29423033 cameraView.object = client;
2943
- cameraView.lighttouched = true;
3034
+ Globals.lighttouched = true;
29443035 //topView.object = client;
29453036 //frontView.object = client;
29463037 //sideView.object = client;
....@@ -2948,7 +3039,7 @@
29483039 else
29493040 {
29503041 cameraView.object = group;
2951
- cameraView.lighttouched = true;
3042
+ Globals.lighttouched = true;
29523043 //topView.object = group;
29533044 //frontView.object = group;
29543045 //sideView.object = group;
....@@ -3456,7 +3547,7 @@
34563547 String pigment = Object3D.GetPigment(tex);
34573548 //String bump = Object3D.GetBump(tex);
34583549
3459
- 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);
34603551
34613552 double s = v.s;
34623553
....@@ -3757,7 +3848,7 @@
37573848 group.selection.RelinkToSupport(); // july 2014
37583849 System.out.println("DONE.");
37593850 refreshContents();
3760
- 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));
37613852 }
37623853
37633854 void ReduceMesh(boolean reduction34)
....@@ -4042,16 +4133,16 @@
40424133
40434134 objEditor.SetText(); // jan 2014
40444135
4045
- 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))
40464137 CameraPane.flash = true;
40474138
40484139 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
40494140 // a camera
40504141 {
40514142 CameraPane.camerachangeframe = 0; // don't refuse it
4052
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4053
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
4054
- // 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;
40554146 }
40564147
40574148 refreshContents();
....@@ -5009,6 +5100,7 @@
50095100
50105101 private MenuItem resetParentItem;
50115102 private MenuItem repairParentItem;
5103
+ private MenuItem repairShadowItem;
50125104 private MenuItem sortbysizeItem;
50135105 private MenuItem sortbynameItem;
50145106