Normand Briere
2019-05-01 504890a7b930ab6b853c49de825ae848e0535339
GroupEditor.java
....@@ -12,6 +12,7 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
....@@ -434,76 +435,24 @@
434435 oe.buttonGroup.add(dummyButton);
435436 */
436437 aConstraints.gridy += 1;
438
+
439
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
440
+
437441 oe.aConstraints.gridwidth = 1;
438442 oe.aConstraints.gridx = 0;
439443
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
444
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
445
+ liveCB.setToolTipText("Enabled animation");
441446 liveCB.addItemListener(this);
442447
443448 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);
449
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
450
+ trackCB.setToolTipText("Enable tracking");
503451 trackCB.addItemListener(this);
504452
505453 oe.aConstraints.gridx += 1;
506454 oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
455
+ screenfitButton.setToolTipText("Screen fit");
507456 screenfitButton.addActionListener(this);
508457 oe.aConstraints.gridx += 1;
509458 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
....@@ -511,6 +460,7 @@
511460 // oe.aConstraints.gridx += 1;
512461 oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
513462 snapobjectButton.addActionListener(this);
463
+ snapobjectButton.setToolTipText("Snap Object");
514464 oe.aConstraints.gridx += 1;
515465
516466 //aConstraints.gridx = 0;
....@@ -519,6 +469,7 @@
519469 oe.aConstraints.gridwidth = 1;
520470
521471 oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
472
+ flashSelectionButton.setToolTipText("Show selection");
522473 flashSelectionButton.addActionListener(this);
523474
524475 oe.toolbarPanel.add(new cButton(" ", false));
....@@ -529,21 +480,28 @@
529480
530481 //
531482 oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
483
+ twoButton.setToolTipText("Show center view only");
532484 twoButton.addActionListener(this);
533485 oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
534486 fourButton.addActionListener(this);
487
+ fourButton.setToolTipText("Show left panel only");
535488 oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
489
+ sixButton.setToolTipText("2-column layout left");
536490 sixButton.addActionListener(this);
537491 oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
492
+ threeButton.setToolTipText("2-column layout right");
538493 threeButton.addActionListener(this);
539494 oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
495
+ sevenButton.setToolTipText("3-column layout");
540496 sevenButton.addActionListener(this);
541497 //
542498
543
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
499
+ oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
500
+ rootButton.setToolTipText("Edit object in new tab");
544501 rootButton.addActionListener(this);
545502 oe.aConstraints.gridx += 1;
546503 oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
504
+ closeButton.setToolTipText("Close tab");
547505 closeButton.addActionListener(this);
548506 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
549507 //clearButton.addActionListener(this);
....@@ -646,6 +604,80 @@
646604 radio.layout = sevenButton;
647605 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
648606 }
607
+
608
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
609
+ {
610
+ //constraints.gridx = 0;
611
+ //constraints.gridy = 0;
612
+ panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
613
+ fastCB.setToolTipText("Fast mode");
614
+ fastCB.addItemListener(this);
615
+ //constraints.gridy += 1;
616
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
617
+ supportCB.setToolTipText("Enabled rigging");
618
+ supportCB.addItemListener(this);
619
+
620
+ // constraints.gridy += 1;
621
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
622
+ // localCB.addItemListener(this);
623
+
624
+ //constraints.gridy += 1;
625
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
626
+ crowdCB.setToolTipText("Used for crowds");
627
+ crowdCB.addItemListener(this);
628
+
629
+ //constraints.gridy += 1;
630
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
631
+ smoothCB.setToolTipText("Snapping delay");
632
+ smoothCB.addItemListener(this);
633
+
634
+ //constraints.gridy += 1;
635
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
636
+ slowCB.setToolTipText("Smooth interpolation");
637
+ slowCB.addItemListener(this);
638
+ //constraints.gridy += 1;
639
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
640
+ boxCB.setToolTipText("Display bounding boxes");
641
+ boxCB.addItemListener(this);
642
+ //constraints.gridy += 1;
643
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
644
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
645
+ zoomBoxCB.addItemListener(this);
646
+
647
+// constraints.gridy += 1;
648
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
649
+// speakerMocapCB.addItemListener(this);
650
+
651
+ if (false)
652
+ {
653
+ // handled in scripts
654
+ //constraints.gridy += 1;
655
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
656
+ speakerCameraCB.addItemListener(this);
657
+
658
+ //constraints.gridy += 1;
659
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
660
+ speakerFocusCB.addItemListener(this);
661
+
662
+ //constraints.gridy += 1;
663
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
664
+ smoothfocusCB.addItemListener(this);
665
+ }
666
+
667
+//constraints.gridx += 1;
668
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
669
+// debugCB.addItemListener(this);
670
+
671
+ //constraints.gridy += 1;
672
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
673
+ oeilCB.addItemListener(this);
674
+
675
+ //constraints.gridy += 1;
676
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
677
+ lookAtCB.setToolTipText("Look-at target");
678
+ lookAtCB.addItemListener(this);
679
+
680
+ }
649681
650682 void EditObject(Object3D obj)
651683 {
....@@ -676,6 +708,7 @@
676708 JCheckBox fastCB;
677709 JCheckBox slowCB;
678710 JCheckBox boxCB;
711
+ JCheckBox zoomBoxCB;
679712 JCheckBox trackCB;
680713 JCheckBox smoothfocusCB;
681714 // JCheckBox speakerMocapCB;
....@@ -755,6 +788,10 @@
755788 Recompile();
756789 cameraView.repaint();
757790 // refreshContents();
791
+ }
792
+ else if(e.getSource() == zoomBoxCB)
793
+ {
794
+ cameraView.ToggleZoomBoxMode();
758795 }
759796 else if(e.getSource() == smoothfocusCB)
760797 {
....@@ -1120,6 +1157,8 @@
11201157 resetParentItem.addActionListener(this);
11211158 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11221159 repairParentItem.addActionListener(this);
1160
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1161
+ repairShadowItem.addActionListener(this);
11231162 menu.add(invariantsItem = new MenuItem("Invariants"));
11241163 invariantsItem.addActionListener(this);
11251164 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1480,6 +1519,7 @@
14801519 //
14811520 public void actionPerformed(ActionEvent event) // , Object arg)
14821521 {
1522
+ Object source = event.getSource();
14831523 /*
14841524 if (event.getSource() == nameField)
14851525 {
....@@ -1491,11 +1531,11 @@
14911531 }
14921532 else
14931533 */
1494
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1534
+ if (source == lookAtItem || source == lookFromItem)
14951535 {
14961536 ScreenFit();
14971537 } else
1498
- if (event.getSource() == switchItem)
1538
+ if (source == switchItem)
14991539 {
15001540 cVector v1 = new cVector();
15011541 cVector v2 = new cVector();
....@@ -1504,11 +1544,11 @@
15041544 objEditor.cameraView.renderCamera.setAim(v2, v1);
15051545 objEditor.cameraView.repaint();
15061546 } else
1507
- if (event.getSource() == rectoidItem)
1547
+ if (source == rectoidItem)
15081548 {
15091549 makeSomething(new Box());
15101550 } else
1511
- if (event.getSource() == particleItem)
1551
+ if (source == particleItem)
15121552 {
15131553 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15141554 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1529,9 +1569,9 @@
15291569 applyExample(particleGeom, "SMOKE");
15301570 makeSomething(particleGeom);
15311571 } else
1532
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1572
+ if (source == ragdollItem || source == ragdoll2Item)
15331573 {
1534
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1574
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15351575
15361576 ragdoll.toParent = LA.newMatrix();
15371577 ragdoll.fromParent = LA.newMatrix();
....@@ -1549,7 +1589,7 @@
15491589 } else
15501590 /*
15511591 */
1552
- if (event.getSource() == heightFieldItem)
1592
+ if (source == heightFieldItem)
15531593 {
15541594 Object3D obj = new Object3D();
15551595
....@@ -1587,31 +1627,31 @@
15871627
15881628 makeSomething(obj);
15891629 } else
1590
- if (event.getSource() == gridItem)
1630
+ if (source == gridItem)
15911631 {
15921632 makeSomething(new Grid());
15931633 } else
1594
- if (event.getSource() == ellipsoidItem)
1634
+ if (source == ellipsoidItem)
15951635 {
15961636 makeSomething(new Sphere());
15971637 } else
1598
- if (event.getSource() == coneItem)
1638
+ if (source == coneItem)
15991639 {
16001640 makeSomething(new Cone());
16011641 } else
1602
- if (event.getSource() == torusItem)
1642
+ if (source == torusItem)
16031643 {
16041644 makeSomething(new Torus());
16051645 } else
1606
- if (event.getSource() == superItem)
1646
+ if (source == superItem)
16071647 {
16081648 makeSomething(new Superellipsoid());
16091649 } else
1610
- if (event.getSource() == kleinItem)
1650
+ if (source == kleinItem)
16111651 {
16121652 makeSomething(new Klein());
16131653 } else
1614
- if (event.getSource() == blobItem)
1654
+ if (source == blobItem)
16151655 {
16161656 Blob blob = new Blob();
16171657 BlobComponent comp = new BlobComponent();
....@@ -1619,15 +1659,15 @@
16191659 //blob.retile();
16201660 makeSomething(blob);
16211661 } else
1622
- if (event.getSource() == latheItem)
1662
+ if (source == latheItem)
16231663 {
16241664 makeSomething(new Lathe());
16251665 } else
1626
- if (event.getSource() == bezierItem)
1666
+ if (source == bezierItem)
16271667 {
16281668 makeSomething(new BezierSurface());
16291669 } else
1630
- if (event.getSource() == checkerItem)
1670
+ if (source == checkerItem)
16311671 {
16321672 /*
16331673 Object3D obj = new BezierSurface(5,8);
....@@ -1642,7 +1682,7 @@
16421682 */
16431683 makeSomething(new Checker());
16441684 } else
1645
- if (event.getSource() == meshItem)
1685
+ if (source == meshItem)
16461686 {
16471687 Object3D itemtomake = new Object3D();
16481688 Object3D child;
....@@ -1663,35 +1703,35 @@
16631703 makeSomething(child);
16641704 }
16651705 } else
1666
- if (event.getSource() == springItem)
1706
+ if (source == springItem)
16671707 {
16681708 cSpring s = new cSpring();
16691709 s.setup();
16701710 makeSomething(s);
16711711 } else
1672
- if (event.getSource() == flagItem)
1712
+ if (source == flagItem)
16731713 {
16741714 cSpring s = new cFlag();
16751715 s.setup();
16761716 makeSomething(s);
16771717 } else
1678
- if (event.getSource() == lightItem)
1718
+ if (source == lightItem)
16791719 {
16801720 makeSomething(new Light());
16811721 } else
1682
- if (event.getSource() == csgItem)
1722
+ if (source == csgItem)
16831723 {
16841724 group(new CSG());
16851725 } else
1686
- if (event.getSource() == templateItem)
1726
+ if (source == templateItem)
16871727 {
16881728 group(new cTemplate());
16891729 } else
1690
- if (event.getSource() == attributeItem)
1730
+ if (source == attributeItem)
16911731 {
16921732 makeSomething(new Attribute());
16931733 } else
1694
- if (event.getSource() == pointflowItem)
1734
+ if (source == pointflowItem)
16951735 {
16961736 makeSomething(new PointFlow());
16971737 } else
....@@ -1703,7 +1743,7 @@
17031743 } else
17041744 */
17051745
1706
- if (event.getSource() == superLoopItem)
1746
+ if (source == superLoopItem)
17071747 {
17081748 Composite g = new cGroup();
17091749 for (int i=0; i<15; i++)
....@@ -1725,7 +1765,7 @@
17251765
17261766 group(g);
17271767 } else
1728
- if (event.getSource() == loopItem)
1768
+ if (source == loopItem)
17291769 {
17301770 Composite csg = new GroupLeaf();
17311771 csg.count = 5;
....@@ -1734,7 +1774,7 @@
17341774 csg.addChild(child);
17351775 child.addChild(csg);
17361776 } else
1737
- if (event.getSource() == doubleItem)
1777
+ if (source == doubleItem)
17381778 {
17391779 Composite csg = new GroupLeaf();
17401780 csg.count = 5;
....@@ -1746,7 +1786,7 @@
17461786 csg.addChild(child);
17471787 child.addChild(csg);
17481788 } else
1749
- if (event.getSource() == tripleItem)
1789
+ if (source == tripleItem)
17501790 {
17511791 Composite csg = new GroupLeaf();
17521792 csg.count = 4;
....@@ -1762,70 +1802,70 @@
17621802 child.addChild(csg);
17631803 } else
17641804
1765
- if (event.getSource() == importGFDItem)
1805
+ if (source == importGFDItem)
17661806 {
17671807 ImportGFD();
17681808 } else
1769
- if (event.getSource() == importVRMLX3DItem)
1809
+ if (source == importVRMLX3DItem)
17701810 {
17711811 ImportVRMLX3D();
17721812 } else
1773
- if (event.getSource() == import3DSItem)
1813
+ if (source == import3DSItem)
17741814 {
17751815 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17761816 } else
1777
- if (event.getSource() == importOBJItem)
1817
+ if (source == importOBJItem)
17781818 {
17791819 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
17801820 } else
1781
- if (event.getSource() == computeAOItem)
1821
+ if (source == computeAOItem)
17821822 {
1783
- CameraPane.drawMode = CameraPane.OCCLUSION;
1784
- CameraPane.theRenderer.repaint();
1823
+ Globals.drawMode = CameraPane.OCCLUSION;
1824
+ Globals.theRenderer.repaint();
17851825 } else
1786
- if (event.getSource() == recompileItem)
1826
+ if (source == recompileItem)
17871827 {
17881828 Recompile();
17891829 refreshContents();
17901830 } else
1791
- if (event.getSource() == editScriptItem)
1831
+ if (source == editScriptItem)
17921832 {
17931833 OpenDialog();
17941834 refreshContents();
17951835 } else
1796
- if (event.getSource() == invariantsItem)
1836
+ if (source == invariantsItem)
17971837 {
17981838 System.out.println("Invariants:");
17991839 GrafreeD.grafreeD.universe.invariants();
18001840 } else
1801
- if (event.getSource() == memoryItem)
1841
+ if (source == memoryItem)
18021842 {
18031843 //System.out.println("Invariants:");
18041844 PrintMemory();
18051845 } else
1806
- if (event.getSource() == pathItem)
1846
+ if (source == pathItem)
18071847 {
18081848 PrintPath();
18091849 } else
1810
- if (event.getSource() == analyzeItem)
1850
+ if (source == analyzeItem)
18111851 {
18121852 AnalyzeObject();
18131853 } else
1814
- if (event.getSource() == dumpItem)
1854
+ if (source == dumpItem)
18151855 {
18161856 DumpObject();
18171857 } else
1818
- if (event.getSource() == screenfitButton)
1858
+ if (source == screenfitButton)
18191859 {
18201860 //Reload(lastConverter, lastFilename, true);
18211861 ScreenFit();
18221862 } else
1823
- if (event.getSource() == screenfitpointButton)
1863
+ if (source == screenfitpointButton)
18241864 {
18251865 //Reload(lastConverter, lastFilename, true);
18261866 ScreenFitPoint();
18271867 } else
1828
- if (event.getSource() == snapobjectButton)
1868
+ if (source == snapobjectButton)
18291869 {
18301870 //Reload(lastConverter, lastFilename, true);
18311871 SnapObject();
....@@ -1836,13 +1876,13 @@
18361876 // Recompile();
18371877 // refreshContents();
18381878 // } else
1839
- if (event.getSource() == gcButton)
1879
+ if (source == gcButton)
18401880 {
18411881 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18421882 System.gc();
18431883 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18441884 } else
1845
- if (event.getSource() == editLeafItem)
1885
+ if (source == editLeafItem)
18461886 {
18471887 Object3D obj;
18481888 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1856,62 +1896,62 @@
18561896 }
18571897 refreshContents(true);
18581898 } else
1859
- if (event.getSource() == openWindowItem)
1899
+ if (source == openWindowItem)
18601900 {
18611901 EditSelection(true);
18621902 } else
1863
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1903
+ if (source == cutItem || source == clearButton)
18641904 {
18651905 loadClipboard(true);
18661906 } else
1867
- if (event.getSource() == duplicateItem)
1907
+ if (source == duplicateItem)
18681908 {
18691909 Object3D keep = GrafreeD.clipboard;
18701910 loadClipboard(false);
18711911 paste(false);
18721912 GrafreeD.clipboard = keep;
18731913 } else
1874
- if (event.getSource() == cloneItem)
1914
+ if (source == cloneItem)
18751915 {
18761916 CloneSelection(false);
18771917 } else
1878
- if (event.getSource() == cloneSupportItem)
1918
+ if (source == cloneSupportItem)
18791919 {
18801920 CloneSelection(true);
18811921 } else
1882
- if (event.getSource() == copyItem)
1922
+ if (source == copyItem)
18831923 {
18841924 loadClipboard(false);
18851925 } else
1886
- if (event.getSource() == pasteItem)
1926
+ if (source == pasteItem)
18871927 {
18881928 paste(false);
18891929 } else
1890
- if (event.getSource() == pasteLinkItem)
1930
+ if (source == pasteLinkItem)
18911931 {
18921932 pasteInto(false);
18931933 } else
1894
- if (event.getSource() == pasteCloneItem)
1934
+ if (source == pasteCloneItem)
18951935 {
18961936 pasteInto(true);
18971937 } else
1898
- if (event.getSource() == pasteExpandItem)
1938
+ if (source == pasteExpandItem)
18991939 {
19001940 paste(true);
19011941 } else
1902
- if (event.getSource() == synchronizeItem)
1942
+ if (source == synchronizeItem)
19031943 {
19041944 Overwrite(Object3D.TRANSFORM);
19051945 } else
1906
- if (event.getSource() == overwriteNameItem)
1946
+ if (source == overwriteNameItem)
19071947 {
19081948 Overwrite(Object3D.NAME);
19091949 } else
1910
- if (event.getSource() == overwriteUVItem)
1950
+ if (source == overwriteUVItem)
19111951 {
19121952 Overwrite(Object3D.UV);
19131953 } else
1914
- if (event.getSource() == overwriteMatItem)
1954
+ if (source == overwriteMatItem)
19151955 {
19161956 /* july 2015
19171957 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1931,7 +1971,7 @@
19311971
19321972 Overwrite(dropAttributes);
19331973 }
1934
- if (event.getSource() == overwriteGeoItem)
1974
+ if (source == overwriteGeoItem)
19351975 {
19361976 Overwrite(Object3D.GEOMETRY);
19371977 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1948,7 +1988,7 @@
19481988 // refreshContents();
19491989 // }
19501990 } else
1951
- if (event.getSource() == generateMeshItem)
1991
+ if (source == generateMeshItem)
19521992 {
19531993 //if (group.selection.size() == 1)
19541994 // for (int i=0; i<group.selection.size(); i++)
....@@ -1959,7 +1999,7 @@
19591999 ResetModel();
19602000 refreshContents();
19612001 } else
1962
- if (event.getSource() == extractGeometriesItem)
2002
+ if (source == extractGeometriesItem)
19632003 {
19642004 boolean one = false;
19652005
....@@ -1986,7 +2026,7 @@
19862026 ResetModel();
19872027 refreshContents();
19882028 } else
1989
- if (event.getSource() == cloneGeometriesItem)
2029
+ if (source == cloneGeometriesItem)
19902030 {
19912031 boolean one = false;
19922032
....@@ -2012,7 +2052,7 @@
20122052 ResetModel();
20132053 refreshContents();
20142054 } else
2015
- if (event.getSource() == shareGeometriesItem)
2055
+ if (source == shareGeometriesItem)
20162056 {
20172057 boolean one = false;
20182058
....@@ -2042,7 +2082,7 @@
20422082 refreshContents();
20432083 }
20442084 } else
2045
- if (event.getSource() == mergeGeometriesItem)
2085
+ if (source == mergeGeometriesItem)
20462086 {
20472087 boolean one = false;
20482088
....@@ -2072,7 +2112,7 @@
20722112 ResetModel();
20732113 refreshContents();
20742114 } else
2075
- if (event.getSource() == linkverticesItem)
2115
+ if (source == linkverticesItem)
20762116 {
20772117 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20782118 // {
....@@ -2092,7 +2132,7 @@
20922132 if (content instanceof cGroup && ((cGroup)content).transientlink )
20932133 content = ((cGroup)content).get(0);
20942134
2095
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2135
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20962136 for (int i=0; i<group.selection.size(); i++)
20972137 {
20982138 boolean random = CameraPane.RANDOM;
....@@ -2101,11 +2141,11 @@
21012141 // group.selection.get(i).setMasterThis(content); // should be identity
21022142 CameraPane.RANDOM = random;
21032143 }
2104
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2144
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21052145 refreshContents();
21062146 }
21072147 } else
2108
- if (event.getSource() == resetsupportItem)
2148
+ if (source == resetsupportItem)
21092149 {
21102150 for (int i=0; i<group.selection.size(); i++)
21112151 {
....@@ -2117,7 +2157,7 @@
21172157
21182158 refreshContents();
21192159 } else
2120
- if (event.getSource() == relinkverticesItem)
2160
+ if (source == relinkverticesItem)
21212161 {
21222162 boolean random = CameraPane.RANDOM;
21232163 CameraPane.RANDOM = false; // parse all random nodes
....@@ -2126,7 +2166,7 @@
21262166
21272167 refreshContents();
21282168 } else
2129
- if (event.getSource() == resetreferencesItem)
2169
+ if (source == resetreferencesItem)
21302170 {
21312171 for (int i=0; i<group.selection.size(); i++)
21322172 {
....@@ -2135,7 +2175,7 @@
21352175
21362176 refreshContents();
21372177 } else
2138
- if (event.getSource() == setMasterItem)
2178
+ if (source == setMasterItem)
21392179 {
21402180 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21412181 {
....@@ -2148,7 +2188,7 @@
21482188 refreshContents();
21492189 }
21502190 } else
2151
- if (event.getSource() == poseMeshItem)
2191
+ if (source == poseMeshItem)
21522192 {
21532193 if (group.selection.size() == 1)
21542194 {
....@@ -2167,19 +2207,19 @@
21672207 }
21682208
21692209 } else
2170
- if (event.getSource() == revertMeshItem)
2210
+ if (source == revertMeshItem)
21712211 {
21722212 RevertMeshes();
21732213 } else
2174
- if (event.getSource() == resetMeshItem)
2214
+ if (source == resetMeshItem)
21752215 {
21762216 ResetAll();
21772217 } else
2178
- if (event.getSource() == stepAllItem)
2218
+ if (source == stepAllItem)
21792219 {
21802220 StepAll();
21812221 } else
2182
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2222
+ if (source == clearItem) // || event.getSource() == clearButton)
21832223 {
21842224 //int indices[] = jList.getSelectedIndices();
21852225 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2187,46 +2227,46 @@
21872227
21882228 ClearSelection(false);
21892229 } else
2190
- if (event.getSource() == clearAllItem)
2230
+ if (source == clearAllItem)
21912231 {
21922232 ClearSelection(true);
21932233 } else
2194
- if (event.getSource() == grabItem)
2234
+ if (source == grabItem)
21952235 {
21962236 group(new cGroup(), true);
21972237 } else
2198
- if (event.getSource() == hideItem)
2238
+ if (source == hideItem)
21992239 {
22002240 group(new HiddenObject());
22012241 } else
2202
- if (event.getSource() == frontItem)
2242
+ if (source == frontItem)
22032243 {
22042244 front();
22052245 } else
2206
- if (event.getSource() == backItem)
2246
+ if (source == backItem)
22072247 {
22082248 back();
22092249 } else
2210
- if (event.getSource() == cameraItem)
2250
+ if (source == cameraItem)
22112251 {
22122252 makeSomething(new Camera());
22132253 } else
2214
- if (event.getSource() == compositeItem)
2254
+ if (source == compositeItem)
22152255 {
22162256 group(new Composite());
22172257 } else
2218
- if (event.getSource() == randomItem)
2258
+ if (source == randomItem)
22192259 {
22202260 RandomNode random = new RandomNode();
22212261 group(random);
22222262 if (random.size() > 0)
22232263 random.name = random.get(0).name + "Rnd";
22242264 } else
2225
- if (event.getSource() == physicsItem)
2265
+ if (source == physicsItem)
22262266 {
22272267 group(new PhysicsNode());
22282268 } else
2229
- if (event.getSource() == frameselectorItem)
2269
+ if (source == frameselectorItem)
22302270 {
22312271 for (int i=0; i<group.selection.size(); i++)
22322272 {
....@@ -2238,7 +2278,7 @@
22382278 ResetModel();
22392279 refreshContents();
22402280 } else
2241
- if (event.getSource() == switchGeoItem)
2281
+ if (source == switchGeoItem)
22422282 {
22432283 for (int i=0; i<group.selection.size(); i++)
22442284 {
....@@ -2250,7 +2290,7 @@
22502290 ResetModel();
22512291 refreshContents();
22522292 } else
2253
- if (event.getSource() == switchTransfoItem)
2293
+ if (source == switchTransfoItem)
22542294 {
22552295 for (int i=0; i<group.selection.size(); i++)
22562296 {
....@@ -2262,7 +2302,7 @@
22622302 ResetModel();
22632303 refreshContents();
22642304 } else
2265
- if (event.getSource() == morphItem)
2305
+ if (source == morphItem)
22662306 {
22672307 for (int i=0; i<group.selection.size(); i++)
22682308 {
....@@ -2274,7 +2314,7 @@
22742314 ResetModel();
22752315 refreshContents();
22762316 } else
2277
- if (event.getSource() == scriptNodeItem)
2317
+ if (source == scriptNodeItem)
22782318 {
22792319 boolean atleastone = false;
22802320
....@@ -2313,31 +2353,31 @@
23132353 }
23142354 }
23152355 } else
2316
- if (event.getSource() == linkerItem)
2356
+ if (source == linkerItem)
23172357 {
23182358 group(new cLinker());
23192359 } else
2320
- if (event.getSource() == textureItem)
2360
+ if (source == textureItem)
23212361 {
23222362 group(new TextureNode());
23232363 } else
2324
- if (event.getSource() == billboardItem)
2364
+ if (source == billboardItem)
23252365 {
23262366 group(new BillboardNode());
23272367 } else
2328
- if (event.getSource() == shadowXItem)
2368
+ if (source == shadowXItem)
23292369 {
23302370 CastShadow(0);
23312371 } else
2332
- if (event.getSource() == shadowYItem)
2372
+ if (source == shadowYItem)
23332373 {
23342374 CastShadow(1);
23352375 } else
2336
- if (event.getSource() == shadowZItem)
2376
+ if (source == shadowZItem)
23372377 {
23382378 CastShadow(2);
23392379 } else
2340
- if (event.getSource() == ungroupItem)
2380
+ if (source == ungroupItem)
23412381 {
23422382 //ungroup();
23432383 for (int i=0; i<group.selection.size(); i++)
....@@ -2349,179 +2389,179 @@
23492389
23502390 refreshContents();
23512391 } else
2352
- if (event.getSource() == genUVItem)
2392
+ if (source == genUVItem)
23532393 {
23542394 GenUV();
23552395 } else
2356
- if (event.getSource() == genNormalsCADItem)
2396
+ if (source == genNormalsCADItem)
23572397 {
23582398 GenNormals(true);
23592399 } else
2360
- if (event.getSource() == genNormalsMESHItem)
2400
+ if (source == genNormalsMESHItem)
23612401 {
23622402 GenNormals(true); // TODO
23632403 } else
2364
- if (event.getSource() == genNormalsORGANItem)
2404
+ if (source == genNormalsORGANItem)
23652405 {
23662406 GenNormals(false);
23672407 } else
2368
- if (event.getSource() == genNormalsMINEItem)
2408
+ if (source == genNormalsMINEItem)
23692409 {
23702410 GenNormalsMINE();
23712411 } else
2372
- if (event.getSource() == stripifyItem)
2412
+ if (source == stripifyItem)
23732413 {
23742414 Stripify();
23752415 } else
2376
- if (event.getSource() == unstripifyItem)
2416
+ if (source == unstripifyItem)
23772417 {
23782418 Unstripify();
23792419 } else
2380
- if (event.getSource() == trimItem)
2420
+ if (source == trimItem)
23812421 {
23822422 Trim();
23832423 } else
2384
- if (event.getSource() == untrimItem)
2424
+ if (source == untrimItem)
23852425 {
23862426 Untrim();
23872427 } else
2388
- if (event.getSource() == clearColorsItem)
2428
+ if (source == clearColorsItem)
23892429 {
23902430 ClearColors();
23912431 } else
2392
- if (event.getSource() == clearMaterialsItem)
2432
+ if (source == clearMaterialsItem)
23932433 {
23942434 ClearMaterials();
23952435 } else
2396
- if (event.getSource() == liveleavesItem)
2436
+ if (source == liveleavesItem)
23972437 {
23982438 LiveLeaves(true);
23992439 } else
2400
- if (event.getSource() == unliveleavesItem)
2440
+ if (source == unliveleavesItem)
24012441 {
24022442 LiveLeaves(false);
24032443 } else
2404
- if (event.getSource() == supportleavesItem)
2444
+ if (source == supportleavesItem)
24052445 {
24062446 SupportLeaves(true);
24072447 } else
2408
- if (event.getSource() == unsupportleavesItem)
2448
+ if (source == unsupportleavesItem)
24092449 {
24102450 SupportLeaves(false);
24112451 } else
2412
- if (event.getSource() == hideleavesItem)
2452
+ if (source == hideleavesItem)
24132453 {
24142454 HideLeaves(true);
24152455 } else
2416
- if (event.getSource() == showleavesItem)
2456
+ if (source == showleavesItem)
24172457 {
24182458 HideLeaves(false);
24192459 } else
2420
- if (event.getSource() == markleavesItem)
2460
+ if (source == markleavesItem)
24212461 {
24222462 MarkLeaves(true);
24232463 } else
2424
- if (event.getSource() == unmarkleavesItem)
2464
+ if (source == unmarkleavesItem)
24252465 {
24262466 MarkLeaves(false);
24272467 } else
2428
- if (event.getSource() == flipVItem)
2468
+ if (source == flipVItem)
24292469 {
24302470 FlipV(true);
24312471 } else
2432
- if (event.getSource() == unflipVItem)
2472
+ if (source == unflipVItem)
24332473 {
24342474 FlipV(false);
24352475 } else
2436
- if (event.getSource() == lowTexturesItem)
2476
+ if (source == lowTexturesItem)
24372477 {
24382478 SetTexRes(0);
24392479 } else
2440
- if (event.getSource() == normalTexturesItem)
2480
+ if (source == normalTexturesItem)
24412481 {
24422482 SetTexRes(1);
24432483 } else
2444
- if (event.getSource() == highTexturesItem)
2484
+ if (source == highTexturesItem)
24452485 {
24462486 SetTexRes(2);
24472487 } else
2448
- if (event.getSource() == veryhighTexturesItem)
2488
+ if (source == veryhighTexturesItem)
24492489 {
24502490 SetTexRes(3);
24512491 } else
2452
- if (event.getSource() == maxTexturesItem)
2492
+ if (source == maxTexturesItem)
24532493 {
24542494 SetTexRes(4);
24552495 } else
2456
- if (event.getSource() == panoTexturesItem)
2496
+ if (source == panoTexturesItem)
24572497 {
24582498 SetTexRes(5);
24592499 } else
2460
- if (event.getSource() == reverseNormalsItem)
2500
+ if (source == reverseNormalsItem)
24612501 {
24622502 ReverseNormals();
24632503 } else
2464
- if (event.getSource() == parseverticesItem)
2504
+ if (source == parseverticesItem)
24652505 {
24662506 ParseVertices();
24672507 } else
2468
- if (event.getSource() == textureFieldItem)
2508
+ if (source == textureFieldItem)
24692509 {
24702510 TextureVertices();
24712511 } else
2472
- if (event.getSource() == alignItem)
2512
+ if (source == alignItem)
24732513 {
24742514 Align();
24752515 } else
2476
- if (event.getSource() == mirrorItem)
2516
+ if (source == mirrorItem)
24772517 {
24782518 MirrorPoses();
24792519 } else
2480
- if (event.getSource() == reduceMorphItem)
2520
+ if (source == reduceMorphItem)
24812521 {
24822522 MeshReduction(false);
24832523 } else
2484
- if (event.getSource() == reduce34MorphItem)
2524
+ if (source == reduce34MorphItem)
24852525 {
24862526 MeshReduction(true);
24872527 } else
2488
- if (event.getSource() == reverseTrianglesItem)
2528
+ if (source == reverseTrianglesItem)
24892529 {
24902530 ReverseTriangles();
24912531 } else
2492
- if (event.getSource() == reduceMeshItem)
2532
+ if (source == reduceMeshItem)
24932533 {
24942534 ReduceMesh(false);
24952535 } else
2496
- if (event.getSource() == reduce34MeshItem)
2536
+ if (source == reduce34MeshItem)
24972537 {
24982538 ReduceMesh(true);
24992539 } else
2500
- if (event.getSource() == increaseMeshItem)
2540
+ if (source == increaseMeshItem)
25012541 {
25022542 IncreaseMesh();
25032543 } else
2504
- if (event.getSource() == clipMeshItem)
2544
+ if (source == clipMeshItem)
25052545 {
25062546 ClipMesh();
25072547 } else
2508
- if (event.getSource() == smoothMeshItem)
2548
+ if (source == smoothMeshItem)
25092549 {
25102550 SmoothMesh();
25112551 } else
2512
- if (event.getSource() == transformgeometryItem)
2552
+ if (source == transformgeometryItem)
25132553 {
25142554 TransformGeometry();
25152555 } else
2516
- if (event.getSource() == resetTransformItem)
2556
+ if (source == resetTransformItem)
25172557 {
25182558 ResetTransform();
25192559 } else
2520
- if (event.getSource() == resetCentroidItem)
2560
+ if (source == resetCentroidItem)
25212561 {
25222562 ResetCentroid();
25232563 } else
2524
- if (event.getSource() == resetParentItem)
2564
+ if (source == resetParentItem)
25252565 {
25262566 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25272567 {
....@@ -2531,7 +2571,7 @@
25312571
25322572 refreshContents();
25332573 } else
2534
- if (event.getSource() == repairParentItem)
2574
+ if (source == repairParentItem)
25352575 {
25362576 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25372577 {
....@@ -2545,7 +2585,21 @@
25452585
25462586 refreshContents();
25472587 } else
2548
- if (event.getSource() == sortbysizeItem)
2588
+ if (source == repairShadowItem)
2589
+ {
2590
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2591
+ {
2592
+ Object3D obj = (Object3D)e.nextElement();
2593
+ obj.RepairShadow();
2594
+// for (int i=0; i<obj.size(); i++)
2595
+// {
2596
+// obj.get(i).parent = obj;
2597
+// }
2598
+ }
2599
+
2600
+ refreshContents();
2601
+ } else
2602
+ if (source == sortbysizeItem)
25492603 {
25502604 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25512605 {
....@@ -2557,7 +2611,7 @@
25572611 ResetModel();
25582612 refreshContents();
25592613 } else
2560
- if (event.getSource() == sortbynameItem)
2614
+ if (source == sortbynameItem)
25612615 {
25622616 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25632617 {
....@@ -2569,7 +2623,7 @@
25692623 ResetModel();
25702624 refreshContents();
25712625 } else
2572
- if (event.getSource() == attachPigmentItem)
2626
+ if (source == attachPigmentItem)
25732627 {
25742628 String texture = GetFile("Attach pigment");
25752629 Object3D obj;
....@@ -2581,7 +2635,7 @@
25812635
25822636 refreshContents();
25832637 } else
2584
- if (event.getSource() == detachPigmentItem)
2638
+ if (source == detachPigmentItem)
25852639 {
25862640 Object3D obj;
25872641 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2592,7 +2646,7 @@
25922646
25932647 refreshContents();
25942648 } else
2595
- if (event.getSource() == attachBumpItem)
2649
+ if (source == attachBumpItem)
25962650 {
25972651 String texture = GetFile("Attach bump");
25982652 Object3D obj;
....@@ -2604,7 +2658,7 @@
26042658
26052659 refreshContents();
26062660 } else
2607
- if (event.getSource() == detachBumpItem)
2661
+ if (source == detachBumpItem)
26082662 {
26092663 Object3D obj;
26102664 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2615,7 +2669,7 @@
26152669
26162670 refreshContents();
26172671 } else
2618
- if (event.getSource() == pigmentBumpItem)
2672
+ if (source == pigmentBumpItem)
26192673 {
26202674 Object3D obj;
26212675 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2626,158 +2680,195 @@
26262680
26272681 refreshContents();
26282682 } else
2629
- if (event.getSource() == flashSelectionButton)
2683
+ if (source == flashSelectionButton)
26302684 {
26312685 CameraPane.flash = true;
26322686 refreshContents();
26332687 } else
2634
- if (event.getSource() == oneButton)
2688
+ if (source == oneButton)
26352689 {
26362690 } else
2637
- if (event.getSource() == twoButton)
2691
+ if (source == twoButton)
26382692 {
26392693 radio.layout = twoButton;
26402694 // bug
26412695 //gridPanel.setDividerLocation(1.0);
26422696 //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();
2697
+// bigThree.remove(scenePanel);
2698
+// bigThree.remove(centralPanel);
2699
+// bigThree.remove(XYZPanel);
2700
+// aWindowConstraints.gridx = 0;
2701
+// aWindowConstraints.gridy = 0;
2702
+// aWindowConstraints.gridwidth = 1;
2703
+// // aConstraints.gridheight = 3;
2704
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2705
+// aWindowConstraints.weightx = 0;
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(centralPanel, aWindowConstraints);
2714
+// aWindowConstraints.weightx = 0;
2715
+// aWindowConstraints.gridx = 4;
2716
+// aWindowConstraints.gridwidth = 1;
2717
+// // aConstraints.gridheight = 3;
2718
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2719
+// //bigThree.add(XYZPanel, aWindowConstraints);
2720
+// scenePanel.setVisible(false);
2721
+// centralPanel.setVisible(true);
2722
+// XYZPanel.setVisible(false);
2723
+ bigThree.ClearUI();
2724
+ bigThree.add(centralPanel);
2725
+ bigThree.FlushUI();
26672726 } else
2668
- if (event.getSource() == threeButton)
2727
+ if (source == threeButton)
26692728 {
26702729 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();
2730
+
2731
+// bigThree.remove(scenePanel);
2732
+// bigThree.remove(centralPanel);
2733
+// bigThree.remove(XYZPanel);
2734
+// aWindowConstraints.gridx = 0;
2735
+// aWindowConstraints.gridy = 0;
2736
+// aWindowConstraints.gridwidth = 1;
2737
+// // aConstraints.gridheight = 3;
2738
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2739
+// aWindowConstraints.weightx = 0;
2740
+// aWindowConstraints.weighty = 1;
2741
+// //bigThree.add(jtp, aWindowConstraints);
2742
+// aWindowConstraints.weightx = 1;
2743
+// aWindowConstraints.gridwidth = 3;
2744
+// // aConstraints.gridheight = 3;
2745
+// aWindowConstraints.gridx = 1;
2746
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2747
+// bigThree.add(centralPanel, aWindowConstraints);
2748
+// aWindowConstraints.weightx = 0;
2749
+// aWindowConstraints.gridx = 4;
2750
+// aWindowConstraints.gridwidth = 1;
2751
+// // aConstraints.gridheight = 3;
2752
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2753
+// bigThree.add(XYZPanel, aWindowConstraints);
2754
+// bigThree.validate();
2755
+// scenePanel.setVisible(false);
2756
+// centralPanel.setVisible(true);
2757
+// XYZPanel.setVisible(true);
2758
+ bigThree.ClearUI();
2759
+ bigThree.add(centralPanel);
2760
+ bigThree.add(XYZPanel);
2761
+ bigThree.FlushUI();
26952762 } else
2696
- if (event.getSource() == fourButton)
2763
+ if (source == fourButton)
26972764 {
26982765 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();
2766
+
2767
+// bigThree.remove(scenePanel);
2768
+// bigThree.remove(centralPanel);
2769
+// bigThree.remove(XYZPanel);
2770
+// aWindowConstraints.gridx = 0;
2771
+// aWindowConstraints.gridy = 0;
2772
+// aWindowConstraints.gridwidth = 1;
2773
+// // aWindowConstraints.gridheight = 3;
2774
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2775
+// aWindowConstraints.weightx = 1;
2776
+// aWindowConstraints.weighty = 1;
2777
+// bigThree.add(scenePanel, aWindowConstraints);
2778
+// aWindowConstraints.weightx = 1;
2779
+// aWindowConstraints.gridwidth = 3;
2780
+// // aConstraints.gridheight = 3;
2781
+// aWindowConstraints.gridx = 1;
2782
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2783
+// //bigThree.add(cameraPanel, aWindowConstraints);
2784
+// aWindowConstraints.weightx = 0;
2785
+// aWindowConstraints.gridx = 4;
2786
+// aWindowConstraints.gridwidth = 1;
2787
+// // aWindowConstraints.gridheight = 3;
2788
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2789
+// //bigThree.add(XYZPanel, aWindowConstraints);
2790
+// bigThree.validate();
2791
+// scenePanel.setVisible(true);
2792
+// centralPanel.setVisible(false);
2793
+// XYZPanel.setVisible(false);
2794
+ bigThree.ClearUI();
2795
+ bigThree.add(scenePanel);
2796
+ bigThree.FlushUI();
27232797 } else
2724
- if (event.getSource() == sixButton)
2798
+ if (source == sixButton)
27252799 {
27262800 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();
2801
+
2802
+// bigThree.remove(scenePanel);
2803
+// bigThree.remove(centralPanel);
2804
+// bigThree.remove(XYZPanel);
2805
+// aWindowConstraints.gridx = 0;
2806
+// aWindowConstraints.gridy = 0;
2807
+// aWindowConstraints.gridwidth = 1;
2808
+// // aConstraints.gridheight = 3;
2809
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2810
+// aWindowConstraints.weightx = 0;
2811
+// aWindowConstraints.weighty = 1;
2812
+// bigThree.add(scenePanel, aWindowConstraints);
2813
+// aWindowConstraints.weightx = 1;
2814
+// aWindowConstraints.gridwidth = 3;
2815
+// // aWindowConstraints.gridheight = 3;
2816
+// aWindowConstraints.gridx = 1;
2817
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2818
+// bigThree.add(centralPanel, aWindowConstraints);
2819
+// aWindowConstraints.weightx = 0;
2820
+// aWindowConstraints.gridx = 4;
2821
+// aWindowConstraints.gridwidth = 1;
2822
+// // aWindowConstraints.gridheight = 3;
2823
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2824
+// //bigThree.add(XYZPanel, aConstraints);
2825
+// bigThree.validate();
2826
+// scenePanel.setVisible(true);
2827
+// centralPanel.setVisible(true);
2828
+// XYZPanel.setVisible(false);
2829
+ bigThree.ClearUI();
2830
+ bigThree.add(scenePanel);
2831
+ bigThree.add(centralPanel);
2832
+ bigThree.FlushUI();
27512833 } else
2752
- if (event.getSource() == sevenButton)
2834
+ if (source == sevenButton)
27532835 {
27542836 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();
2837
+
2838
+// bigThree.remove(scenePanel);
2839
+// bigThree.remove(centralPanel);
2840
+// bigThree.remove(XYZPanel);
2841
+// aWindowConstraints.gridx = 0;
2842
+// aWindowConstraints.gridy = 0;
2843
+// aWindowConstraints.gridwidth = 1;
2844
+// // aWindowConstraints.gridheight = 3;
2845
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2846
+// aWindowConstraints.weightx = 0;
2847
+// aWindowConstraints.weighty = 1;
2848
+// bigThree.add(scenePanel, aWindowConstraints);
2849
+// aWindowConstraints.weightx = 1;
2850
+// aWindowConstraints.gridwidth = 3;
2851
+// // aWindowConstraints.gridheight = 3;
2852
+// aWindowConstraints.gridx = 1;
2853
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2854
+// bigThree.add(centralPanel, aWindowConstraints);
2855
+// aWindowConstraints.weightx = 0;
2856
+// aWindowConstraints.gridx = 4;
2857
+// aWindowConstraints.gridwidth = 1;
2858
+// // aConstraints.gridheight = 3;
2859
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2860
+// bigThree.add(XYZPanel, aWindowConstraints);
2861
+// bigThree.validate();
2862
+// scenePanel.setVisible(true);
2863
+// centralPanel.setVisible(true);
2864
+// XYZPanel.setVisible(true);
2865
+ bigThree.ClearUI();
2866
+ bigThree.add(scenePanel);
2867
+ bigThree.add(centralPanel);
2868
+ bigThree.add(XYZPanel);
2869
+ bigThree.FlushUI();
27792870 } else
2780
- if (event.getSource() == rootButton)
2871
+ if (source == rootButton)
27812872 {
27822873 Object3D obj;
27832874 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2789,7 +2880,7 @@
27892880
27902881 refreshContents(true);
27912882 } else
2792
- if (event.getSource() == closeButton)
2883
+ if (source == closeButton)
27932884 {
27942885 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27952886 cRadio ab;
....@@ -2810,11 +2901,11 @@
28102901 }
28112902 refreshContents(true);
28122903 } else
2813
- if (event.getSource() == editItem || event.getSource() == editButton)
2904
+ if (source == editItem || source == editButton)
28142905 {
28152906 EditSelection(false);
28162907 } else
2817
- if (event.getSource() == uneditButton)
2908
+ if (source == uneditButton)
28182909 {
28192910 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28202911 {
....@@ -2826,12 +2917,12 @@
28262917
28272918 child.editWindow = null; // ???????????
28282919 }
2829
- objEditor.ctrlPanel.revalidate();
2920
+ objEditor.ctrlPanel.validate();
28302921 //objEditor.jTree.clearSelection();
28312922 //objEditor.ResetSliders();
28322923 refreshContents(true);
28332924 } else
2834
- if (event.getSource() == clearPanelButton)
2925
+ if (source == clearPanelButton)
28352926 {
28362927 assert(copy == group);
28372928 //copy.ClearUI();
....@@ -2842,7 +2933,7 @@
28422933 listUI.clear();
28432934 refreshContents(true);
28442935 } else
2845
- if (event.getSource() == allParamsButton)
2936
+ if (source == allParamsButton)
28462937 {
28472938 assert(copy == group);
28482939
....@@ -2863,19 +2954,19 @@
28632954
28642955 refreshContents(true);
28652956 } else
2866
- if (event.getSource() == unselectButton)
2957
+ if (source == unselectButton)
28672958 {
28682959 objEditor.jTree.clearSelection();
28692960 // ?? oct 2012 GrafreeD.clipboard.clear();
28702961 objEditor.ResetSliders();
28712962 refreshContents(true);
28722963 } else
2873
- if(event.getSource() instanceof cRadio)
2964
+ if(source instanceof cRadio)
28742965 {
28752966 group.parent = keepparent;
28762967 group.attributes = 0;
28772968 //group.editWindow = null;
2878
- /*cRadio*/ radio = (cRadio)event.getSource();
2969
+ /*cRadio*/ radio = (cRadio)source;
28792970 Object3D obj = radio.GetObject();
28802971 System.out.println("Edit " + obj);
28812972 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2895,7 +2986,7 @@
28952986 }
28962987
28972988 copy = group;
2898
- //CameraPane.theRenderer.object = group;
2989
+ //Globals.theRenderer.object = group;
28992990 if(!useclient)
29002991 {
29012992 cameraView.renderCamera = radio.camera;
....@@ -2904,7 +2995,8 @@
29042995 cameraView.cameras[cameraView.cameracount] = radio.camera;
29052996 cameraView.targetLookAt.set(radio.camera.lookAt);
29062997 cameraView.object = group;
2907
- cameraView.lighttouched = true;
2998
+ //cameraView.lighttouched = true;
2999
+ Globals.lighttouched = true;
29083000 topView.object = group;
29093001 frontView.object = group;
29103002 sideView.object = group;
....@@ -2940,7 +3032,7 @@
29403032 if (useclient)
29413033 {
29423034 cameraView.object = client;
2943
- cameraView.lighttouched = true;
3035
+ Globals.lighttouched = true;
29443036 //topView.object = client;
29453037 //frontView.object = client;
29463038 //sideView.object = client;
....@@ -2948,7 +3040,7 @@
29483040 else
29493041 {
29503042 cameraView.object = group;
2951
- cameraView.lighttouched = true;
3043
+ Globals.lighttouched = true;
29523044 //topView.object = group;
29533045 //frontView.object = group;
29543046 //sideView.object = group;
....@@ -3456,7 +3548,7 @@
34563548 String pigment = Object3D.GetPigment(tex);
34573549 //String bump = Object3D.GetBump(tex);
34583550
3459
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3551
+ com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
34603552
34613553 double s = v.s;
34623554
....@@ -3757,7 +3849,7 @@
37573849 group.selection.RelinkToSupport(); // july 2014
37583850 System.out.println("DONE.");
37593851 refreshContents();
3760
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
3852
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
37613853 }
37623854
37633855 void ReduceMesh(boolean reduction34)
....@@ -4042,16 +4134,16 @@
40424134
40434135 objEditor.SetText(); // jan 2014
40444136
4045
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4137
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
40464138 CameraPane.flash = true;
40474139
40484140 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
40494141 // a camera
40504142 {
40514143 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;
4144
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4145
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4146
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40554147 }
40564148
40574149 refreshContents();
....@@ -5009,6 +5101,7 @@
50095101
50105102 private MenuItem resetParentItem;
50115103 private MenuItem repairParentItem;
5104
+ private MenuItem repairShadowItem;
50125105 private MenuItem sortbysizeItem;
50135106 private MenuItem sortbynameItem;
50145107