Normand Briere
2019-04-29 8c837a9e50c29e66bdf5bd7ea2fd15b1a7d5d598
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,28 +469,39 @@
519469 oe.aConstraints.gridwidth = 1;
520470
521471 oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
472
+ flashSelectionButton.setToolTipText("Show selection");
522473 flashSelectionButton.addActionListener(this);
474
+
475
+ oe.toolbarPanel.add(new cButton(" ", false));
476
+
523477 oe.aConstraints.gridx += 1;
524478 oe.aConstraints.weighty = 0;
525479 oe.aConstraints.gridwidth = 1;
526480
527481 //
528482 oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
483
+ twoButton.setToolTipText("Show center view only");
529484 twoButton.addActionListener(this);
530485 oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
531486 fourButton.addActionListener(this);
487
+ fourButton.setToolTipText("Show left panel only");
532488 oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
489
+ sixButton.setToolTipText("2-column layout left");
533490 sixButton.addActionListener(this);
534491 oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
492
+ threeButton.setToolTipText("2-column layout right");
535493 threeButton.addActionListener(this);
536494 oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
495
+ sevenButton.setToolTipText("3-column layout");
537496 sevenButton.addActionListener(this);
538497 //
539498
540
- 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");
541501 rootButton.addActionListener(this);
542502 oe.aConstraints.gridx += 1;
543503 oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
504
+ closeButton.setToolTipText("Close tab");
544505 closeButton.addActionListener(this);
545506 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
546507 //clearButton.addActionListener(this);
....@@ -643,17 +604,91 @@
643604 radio.layout = sevenButton;
644605 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
645606 }
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
+ }
646681
647682 void EditObject(Object3D obj)
648683 {
649
- cRadio dummyButton = new cRadio(obj.name);
650
- dummyButton.SetObject(obj);
651
- dummyButton.layout = sevenButton;
652
- dummyButton.SetCamera(cameraView.renderCamera, false);
653
- dummyButton.addActionListener(this);
654
- radioPanel.add(dummyButton);
655
- buttonGroup.add(dummyButton);
656
- dummyButton.doClick();
684
+ cRadio radioButton = new cRadio(obj.name);
685
+ radioButton.SetObject(obj);
686
+ radioButton.layout = sevenButton;
687
+ radioButton.SetCamera(cameraView.renderCamera, false);
688
+ radioButton.addActionListener(this);
689
+ radioPanel.add(radioButton);
690
+ buttonGroup.add(radioButton);
691
+ radioButton.doClick();
657692 }
658693 void SetupViews(ObjEditor oe)
659694 {
....@@ -673,6 +708,7 @@
673708 JCheckBox fastCB;
674709 JCheckBox slowCB;
675710 JCheckBox boxCB;
711
+ JCheckBox zoomBoxCB;
676712 JCheckBox trackCB;
677713 JCheckBox smoothfocusCB;
678714 // JCheckBox speakerMocapCB;
....@@ -715,8 +751,7 @@
715751 dropAttributes |= Object3D.TEXTURE;
716752 else
717753 dropAttributes &= ~Object3D.TEXTURE;
718
- }
719
- else if(e.getSource() == liveCB)
754
+ } else if(e.getSource() == liveCB)
720755 {
721756 cameraView.ToggleLive();
722757 }
....@@ -753,6 +788,10 @@
753788 Recompile();
754789 cameraView.repaint();
755790 // refreshContents();
791
+ }
792
+ else if(e.getSource() == zoomBoxCB)
793
+ {
794
+ cameraView.ToggleZoomBoxMode();
756795 }
757796 else if(e.getSource() == smoothfocusCB)
758797 {
....@@ -1118,6 +1157,8 @@
11181157 resetParentItem.addActionListener(this);
11191158 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11201159 repairParentItem.addActionListener(this);
1160
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1161
+ repairShadowItem.addActionListener(this);
11211162 menu.add(invariantsItem = new MenuItem("Invariants"));
11221163 invariantsItem.addActionListener(this);
11231164 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1478,6 +1519,7 @@
14781519 //
14791520 public void actionPerformed(ActionEvent event) // , Object arg)
14801521 {
1522
+ Object source = event.getSource();
14811523 /*
14821524 if (event.getSource() == nameField)
14831525 {
....@@ -1489,11 +1531,11 @@
14891531 }
14901532 else
14911533 */
1492
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1534
+ if (source == lookAtItem || source == lookFromItem)
14931535 {
14941536 ScreenFit();
14951537 } else
1496
- if (event.getSource() == switchItem)
1538
+ if (source == switchItem)
14971539 {
14981540 cVector v1 = new cVector();
14991541 cVector v2 = new cVector();
....@@ -1502,11 +1544,11 @@
15021544 objEditor.cameraView.renderCamera.setAim(v2, v1);
15031545 objEditor.cameraView.repaint();
15041546 } else
1505
- if (event.getSource() == rectoidItem)
1547
+ if (source == rectoidItem)
15061548 {
15071549 makeSomething(new Box());
15081550 } else
1509
- if (event.getSource() == particleItem)
1551
+ if (source == particleItem)
15101552 {
15111553 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15121554 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1527,9 +1569,9 @@
15271569 applyExample(particleGeom, "SMOKE");
15281570 makeSomething(particleGeom);
15291571 } else
1530
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1572
+ if (source == ragdollItem || source == ragdoll2Item)
15311573 {
1532
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1574
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15331575
15341576 ragdoll.toParent = LA.newMatrix();
15351577 ragdoll.fromParent = LA.newMatrix();
....@@ -1547,7 +1589,7 @@
15471589 } else
15481590 /*
15491591 */
1550
- if (event.getSource() == heightFieldItem)
1592
+ if (source == heightFieldItem)
15511593 {
15521594 Object3D obj = new Object3D();
15531595
....@@ -1585,31 +1627,31 @@
15851627
15861628 makeSomething(obj);
15871629 } else
1588
- if (event.getSource() == gridItem)
1630
+ if (source == gridItem)
15891631 {
15901632 makeSomething(new Grid());
15911633 } else
1592
- if (event.getSource() == ellipsoidItem)
1634
+ if (source == ellipsoidItem)
15931635 {
15941636 makeSomething(new Sphere());
15951637 } else
1596
- if (event.getSource() == coneItem)
1638
+ if (source == coneItem)
15971639 {
15981640 makeSomething(new Cone());
15991641 } else
1600
- if (event.getSource() == torusItem)
1642
+ if (source == torusItem)
16011643 {
16021644 makeSomething(new Torus());
16031645 } else
1604
- if (event.getSource() == superItem)
1646
+ if (source == superItem)
16051647 {
16061648 makeSomething(new Superellipsoid());
16071649 } else
1608
- if (event.getSource() == kleinItem)
1650
+ if (source == kleinItem)
16091651 {
16101652 makeSomething(new Klein());
16111653 } else
1612
- if (event.getSource() == blobItem)
1654
+ if (source == blobItem)
16131655 {
16141656 Blob blob = new Blob();
16151657 BlobComponent comp = new BlobComponent();
....@@ -1617,15 +1659,15 @@
16171659 //blob.retile();
16181660 makeSomething(blob);
16191661 } else
1620
- if (event.getSource() == latheItem)
1662
+ if (source == latheItem)
16211663 {
16221664 makeSomething(new Lathe());
16231665 } else
1624
- if (event.getSource() == bezierItem)
1666
+ if (source == bezierItem)
16251667 {
16261668 makeSomething(new BezierSurface());
16271669 } else
1628
- if (event.getSource() == checkerItem)
1670
+ if (source == checkerItem)
16291671 {
16301672 /*
16311673 Object3D obj = new BezierSurface(5,8);
....@@ -1640,7 +1682,7 @@
16401682 */
16411683 makeSomething(new Checker());
16421684 } else
1643
- if (event.getSource() == meshItem)
1685
+ if (source == meshItem)
16441686 {
16451687 Object3D itemtomake = new Object3D();
16461688 Object3D child;
....@@ -1661,35 +1703,35 @@
16611703 makeSomething(child);
16621704 }
16631705 } else
1664
- if (event.getSource() == springItem)
1706
+ if (source == springItem)
16651707 {
16661708 cSpring s = new cSpring();
16671709 s.setup();
16681710 makeSomething(s);
16691711 } else
1670
- if (event.getSource() == flagItem)
1712
+ if (source == flagItem)
16711713 {
16721714 cSpring s = new cFlag();
16731715 s.setup();
16741716 makeSomething(s);
16751717 } else
1676
- if (event.getSource() == lightItem)
1718
+ if (source == lightItem)
16771719 {
16781720 makeSomething(new Light());
16791721 } else
1680
- if (event.getSource() == csgItem)
1722
+ if (source == csgItem)
16811723 {
16821724 group(new CSG());
16831725 } else
1684
- if (event.getSource() == templateItem)
1726
+ if (source == templateItem)
16851727 {
16861728 group(new cTemplate());
16871729 } else
1688
- if (event.getSource() == attributeItem)
1730
+ if (source == attributeItem)
16891731 {
16901732 makeSomething(new Attribute());
16911733 } else
1692
- if (event.getSource() == pointflowItem)
1734
+ if (source == pointflowItem)
16931735 {
16941736 makeSomething(new PointFlow());
16951737 } else
....@@ -1701,7 +1743,7 @@
17011743 } else
17021744 */
17031745
1704
- if (event.getSource() == superLoopItem)
1746
+ if (source == superLoopItem)
17051747 {
17061748 Composite g = new cGroup();
17071749 for (int i=0; i<15; i++)
....@@ -1723,7 +1765,7 @@
17231765
17241766 group(g);
17251767 } else
1726
- if (event.getSource() == loopItem)
1768
+ if (source == loopItem)
17271769 {
17281770 Composite csg = new GroupLeaf();
17291771 csg.count = 5;
....@@ -1732,7 +1774,7 @@
17321774 csg.addChild(child);
17331775 child.addChild(csg);
17341776 } else
1735
- if (event.getSource() == doubleItem)
1777
+ if (source == doubleItem)
17361778 {
17371779 Composite csg = new GroupLeaf();
17381780 csg.count = 5;
....@@ -1744,7 +1786,7 @@
17441786 csg.addChild(child);
17451787 child.addChild(csg);
17461788 } else
1747
- if (event.getSource() == tripleItem)
1789
+ if (source == tripleItem)
17481790 {
17491791 Composite csg = new GroupLeaf();
17501792 csg.count = 4;
....@@ -1760,70 +1802,70 @@
17601802 child.addChild(csg);
17611803 } else
17621804
1763
- if (event.getSource() == importGFDItem)
1805
+ if (source == importGFDItem)
17641806 {
17651807 ImportGFD();
17661808 } else
1767
- if (event.getSource() == importVRMLX3DItem)
1809
+ if (source == importVRMLX3DItem)
17681810 {
17691811 ImportVRMLX3D();
17701812 } else
1771
- if (event.getSource() == import3DSItem)
1813
+ if (source == import3DSItem)
17721814 {
17731815 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17741816 } else
1775
- if (event.getSource() == importOBJItem)
1817
+ if (source == importOBJItem)
17761818 {
17771819 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
17781820 } else
1779
- if (event.getSource() == computeAOItem)
1821
+ if (source == computeAOItem)
17801822 {
1781
- CameraPane.drawMode = CameraPane.OCCLUSION;
1782
- CameraPane.theRenderer.repaint();
1823
+ Globals.drawMode = CameraPane.OCCLUSION;
1824
+ Globals.theRenderer.repaint();
17831825 } else
1784
- if (event.getSource() == recompileItem)
1826
+ if (source == recompileItem)
17851827 {
17861828 Recompile();
17871829 refreshContents();
17881830 } else
1789
- if (event.getSource() == editScriptItem)
1831
+ if (source == editScriptItem)
17901832 {
17911833 OpenDialog();
17921834 refreshContents();
17931835 } else
1794
- if (event.getSource() == invariantsItem)
1836
+ if (source == invariantsItem)
17951837 {
17961838 System.out.println("Invariants:");
17971839 GrafreeD.grafreeD.universe.invariants();
17981840 } else
1799
- if (event.getSource() == memoryItem)
1841
+ if (source == memoryItem)
18001842 {
18011843 //System.out.println("Invariants:");
18021844 PrintMemory();
18031845 } else
1804
- if (event.getSource() == pathItem)
1846
+ if (source == pathItem)
18051847 {
18061848 PrintPath();
18071849 } else
1808
- if (event.getSource() == analyzeItem)
1850
+ if (source == analyzeItem)
18091851 {
18101852 AnalyzeObject();
18111853 } else
1812
- if (event.getSource() == dumpItem)
1854
+ if (source == dumpItem)
18131855 {
18141856 DumpObject();
18151857 } else
1816
- if (event.getSource() == screenfitButton)
1858
+ if (source == screenfitButton)
18171859 {
18181860 //Reload(lastConverter, lastFilename, true);
18191861 ScreenFit();
18201862 } else
1821
- if (event.getSource() == screenfitpointButton)
1863
+ if (source == screenfitpointButton)
18221864 {
18231865 //Reload(lastConverter, lastFilename, true);
18241866 ScreenFitPoint();
18251867 } else
1826
- if (event.getSource() == snapobjectButton)
1868
+ if (source == snapobjectButton)
18271869 {
18281870 //Reload(lastConverter, lastFilename, true);
18291871 SnapObject();
....@@ -1834,13 +1876,13 @@
18341876 // Recompile();
18351877 // refreshContents();
18361878 // } else
1837
- if (event.getSource() == gcButton)
1879
+ if (source == gcButton)
18381880 {
18391881 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18401882 System.gc();
18411883 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18421884 } else
1843
- if (event.getSource() == editLeafItem)
1885
+ if (source == editLeafItem)
18441886 {
18451887 Object3D obj;
18461888 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1854,62 +1896,62 @@
18541896 }
18551897 refreshContents(true);
18561898 } else
1857
- if (event.getSource() == openWindowItem)
1899
+ if (source == openWindowItem)
18581900 {
18591901 EditSelection(true);
18601902 } else
1861
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1903
+ if (source == cutItem || source == clearButton)
18621904 {
18631905 loadClipboard(true);
18641906 } else
1865
- if (event.getSource() == duplicateItem)
1907
+ if (source == duplicateItem)
18661908 {
18671909 Object3D keep = GrafreeD.clipboard;
18681910 loadClipboard(false);
18691911 paste(false);
18701912 GrafreeD.clipboard = keep;
18711913 } else
1872
- if (event.getSource() == cloneItem)
1914
+ if (source == cloneItem)
18731915 {
18741916 CloneSelection(false);
18751917 } else
1876
- if (event.getSource() == cloneSupportItem)
1918
+ if (source == cloneSupportItem)
18771919 {
18781920 CloneSelection(true);
18791921 } else
1880
- if (event.getSource() == copyItem)
1922
+ if (source == copyItem)
18811923 {
18821924 loadClipboard(false);
18831925 } else
1884
- if (event.getSource() == pasteItem)
1926
+ if (source == pasteItem)
18851927 {
18861928 paste(false);
18871929 } else
1888
- if (event.getSource() == pasteLinkItem)
1930
+ if (source == pasteLinkItem)
18891931 {
18901932 pasteInto(false);
18911933 } else
1892
- if (event.getSource() == pasteCloneItem)
1934
+ if (source == pasteCloneItem)
18931935 {
18941936 pasteInto(true);
18951937 } else
1896
- if (event.getSource() == pasteExpandItem)
1938
+ if (source == pasteExpandItem)
18971939 {
18981940 paste(true);
18991941 } else
1900
- if (event.getSource() == synchronizeItem)
1942
+ if (source == synchronizeItem)
19011943 {
19021944 Overwrite(Object3D.TRANSFORM);
19031945 } else
1904
- if (event.getSource() == overwriteNameItem)
1946
+ if (source == overwriteNameItem)
19051947 {
19061948 Overwrite(Object3D.NAME);
19071949 } else
1908
- if (event.getSource() == overwriteUVItem)
1950
+ if (source == overwriteUVItem)
19091951 {
19101952 Overwrite(Object3D.UV);
19111953 } else
1912
- if (event.getSource() == overwriteMatItem)
1954
+ if (source == overwriteMatItem)
19131955 {
19141956 /* july 2015
19151957 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1929,7 +1971,7 @@
19291971
19301972 Overwrite(dropAttributes);
19311973 }
1932
- if (event.getSource() == overwriteGeoItem)
1974
+ if (source == overwriteGeoItem)
19331975 {
19341976 Overwrite(Object3D.GEOMETRY);
19351977 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1946,7 +1988,7 @@
19461988 // refreshContents();
19471989 // }
19481990 } else
1949
- if (event.getSource() == generateMeshItem)
1991
+ if (source == generateMeshItem)
19501992 {
19511993 //if (group.selection.size() == 1)
19521994 // for (int i=0; i<group.selection.size(); i++)
....@@ -1957,7 +1999,7 @@
19571999 ResetModel();
19582000 refreshContents();
19592001 } else
1960
- if (event.getSource() == extractGeometriesItem)
2002
+ if (source == extractGeometriesItem)
19612003 {
19622004 boolean one = false;
19632005
....@@ -1984,7 +2026,7 @@
19842026 ResetModel();
19852027 refreshContents();
19862028 } else
1987
- if (event.getSource() == cloneGeometriesItem)
2029
+ if (source == cloneGeometriesItem)
19882030 {
19892031 boolean one = false;
19902032
....@@ -2010,7 +2052,7 @@
20102052 ResetModel();
20112053 refreshContents();
20122054 } else
2013
- if (event.getSource() == shareGeometriesItem)
2055
+ if (source == shareGeometriesItem)
20142056 {
20152057 boolean one = false;
20162058
....@@ -2040,7 +2082,7 @@
20402082 refreshContents();
20412083 }
20422084 } else
2043
- if (event.getSource() == mergeGeometriesItem)
2085
+ if (source == mergeGeometriesItem)
20442086 {
20452087 boolean one = false;
20462088
....@@ -2070,7 +2112,7 @@
20702112 ResetModel();
20712113 refreshContents();
20722114 } else
2073
- if (event.getSource() == linkverticesItem)
2115
+ if (source == linkverticesItem)
20742116 {
20752117 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20762118 // {
....@@ -2090,7 +2132,7 @@
20902132 if (content instanceof cGroup && ((cGroup)content).transientlink )
20912133 content = ((cGroup)content).get(0);
20922134
2093
- 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));
20942136 for (int i=0; i<group.selection.size(); i++)
20952137 {
20962138 boolean random = CameraPane.RANDOM;
....@@ -2099,11 +2141,11 @@
20992141 // group.selection.get(i).setMasterThis(content); // should be identity
21002142 CameraPane.RANDOM = random;
21012143 }
2102
- 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));
21032145 refreshContents();
21042146 }
21052147 } else
2106
- if (event.getSource() == resetsupportItem)
2148
+ if (source == resetsupportItem)
21072149 {
21082150 for (int i=0; i<group.selection.size(); i++)
21092151 {
....@@ -2115,7 +2157,7 @@
21152157
21162158 refreshContents();
21172159 } else
2118
- if (event.getSource() == relinkverticesItem)
2160
+ if (source == relinkverticesItem)
21192161 {
21202162 boolean random = CameraPane.RANDOM;
21212163 CameraPane.RANDOM = false; // parse all random nodes
....@@ -2124,7 +2166,7 @@
21242166
21252167 refreshContents();
21262168 } else
2127
- if (event.getSource() == resetreferencesItem)
2169
+ if (source == resetreferencesItem)
21282170 {
21292171 for (int i=0; i<group.selection.size(); i++)
21302172 {
....@@ -2133,7 +2175,7 @@
21332175
21342176 refreshContents();
21352177 } else
2136
- if (event.getSource() == setMasterItem)
2178
+ if (source == setMasterItem)
21372179 {
21382180 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21392181 {
....@@ -2146,7 +2188,7 @@
21462188 refreshContents();
21472189 }
21482190 } else
2149
- if (event.getSource() == poseMeshItem)
2191
+ if (source == poseMeshItem)
21502192 {
21512193 if (group.selection.size() == 1)
21522194 {
....@@ -2165,19 +2207,19 @@
21652207 }
21662208
21672209 } else
2168
- if (event.getSource() == revertMeshItem)
2210
+ if (source == revertMeshItem)
21692211 {
21702212 RevertMeshes();
21712213 } else
2172
- if (event.getSource() == resetMeshItem)
2214
+ if (source == resetMeshItem)
21732215 {
21742216 ResetAll();
21752217 } else
2176
- if (event.getSource() == stepAllItem)
2218
+ if (source == stepAllItem)
21772219 {
21782220 StepAll();
21792221 } else
2180
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2222
+ if (source == clearItem) // || event.getSource() == clearButton)
21812223 {
21822224 //int indices[] = jList.getSelectedIndices();
21832225 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2185,46 +2227,46 @@
21852227
21862228 ClearSelection(false);
21872229 } else
2188
- if (event.getSource() == clearAllItem)
2230
+ if (source == clearAllItem)
21892231 {
21902232 ClearSelection(true);
21912233 } else
2192
- if (event.getSource() == grabItem)
2234
+ if (source == grabItem)
21932235 {
21942236 group(new cGroup(), true);
21952237 } else
2196
- if (event.getSource() == hideItem)
2238
+ if (source == hideItem)
21972239 {
21982240 group(new HiddenObject());
21992241 } else
2200
- if (event.getSource() == frontItem)
2242
+ if (source == frontItem)
22012243 {
22022244 front();
22032245 } else
2204
- if (event.getSource() == backItem)
2246
+ if (source == backItem)
22052247 {
22062248 back();
22072249 } else
2208
- if (event.getSource() == cameraItem)
2250
+ if (source == cameraItem)
22092251 {
22102252 makeSomething(new Camera());
22112253 } else
2212
- if (event.getSource() == compositeItem)
2254
+ if (source == compositeItem)
22132255 {
22142256 group(new Composite());
22152257 } else
2216
- if (event.getSource() == randomItem)
2258
+ if (source == randomItem)
22172259 {
22182260 RandomNode random = new RandomNode();
22192261 group(random);
22202262 if (random.size() > 0)
22212263 random.name = random.get(0).name + "Rnd";
22222264 } else
2223
- if (event.getSource() == physicsItem)
2265
+ if (source == physicsItem)
22242266 {
22252267 group(new PhysicsNode());
22262268 } else
2227
- if (event.getSource() == frameselectorItem)
2269
+ if (source == frameselectorItem)
22282270 {
22292271 for (int i=0; i<group.selection.size(); i++)
22302272 {
....@@ -2236,7 +2278,7 @@
22362278 ResetModel();
22372279 refreshContents();
22382280 } else
2239
- if (event.getSource() == switchGeoItem)
2281
+ if (source == switchGeoItem)
22402282 {
22412283 for (int i=0; i<group.selection.size(); i++)
22422284 {
....@@ -2248,7 +2290,7 @@
22482290 ResetModel();
22492291 refreshContents();
22502292 } else
2251
- if (event.getSource() == switchTransfoItem)
2293
+ if (source == switchTransfoItem)
22522294 {
22532295 for (int i=0; i<group.selection.size(); i++)
22542296 {
....@@ -2260,7 +2302,7 @@
22602302 ResetModel();
22612303 refreshContents();
22622304 } else
2263
- if (event.getSource() == morphItem)
2305
+ if (source == morphItem)
22642306 {
22652307 for (int i=0; i<group.selection.size(); i++)
22662308 {
....@@ -2272,7 +2314,7 @@
22722314 ResetModel();
22732315 refreshContents();
22742316 } else
2275
- if (event.getSource() == scriptNodeItem)
2317
+ if (source == scriptNodeItem)
22762318 {
22772319 boolean atleastone = false;
22782320
....@@ -2311,31 +2353,31 @@
23112353 }
23122354 }
23132355 } else
2314
- if (event.getSource() == linkerItem)
2356
+ if (source == linkerItem)
23152357 {
23162358 group(new cLinker());
23172359 } else
2318
- if (event.getSource() == textureItem)
2360
+ if (source == textureItem)
23192361 {
23202362 group(new TextureNode());
23212363 } else
2322
- if (event.getSource() == billboardItem)
2364
+ if (source == billboardItem)
23232365 {
23242366 group(new BillboardNode());
23252367 } else
2326
- if (event.getSource() == shadowXItem)
2368
+ if (source == shadowXItem)
23272369 {
23282370 CastShadow(0);
23292371 } else
2330
- if (event.getSource() == shadowYItem)
2372
+ if (source == shadowYItem)
23312373 {
23322374 CastShadow(1);
23332375 } else
2334
- if (event.getSource() == shadowZItem)
2376
+ if (source == shadowZItem)
23352377 {
23362378 CastShadow(2);
23372379 } else
2338
- if (event.getSource() == ungroupItem)
2380
+ if (source == ungroupItem)
23392381 {
23402382 //ungroup();
23412383 for (int i=0; i<group.selection.size(); i++)
....@@ -2347,179 +2389,179 @@
23472389
23482390 refreshContents();
23492391 } else
2350
- if (event.getSource() == genUVItem)
2392
+ if (source == genUVItem)
23512393 {
23522394 GenUV();
23532395 } else
2354
- if (event.getSource() == genNormalsCADItem)
2396
+ if (source == genNormalsCADItem)
23552397 {
23562398 GenNormals(true);
23572399 } else
2358
- if (event.getSource() == genNormalsMESHItem)
2400
+ if (source == genNormalsMESHItem)
23592401 {
23602402 GenNormals(true); // TODO
23612403 } else
2362
- if (event.getSource() == genNormalsORGANItem)
2404
+ if (source == genNormalsORGANItem)
23632405 {
23642406 GenNormals(false);
23652407 } else
2366
- if (event.getSource() == genNormalsMINEItem)
2408
+ if (source == genNormalsMINEItem)
23672409 {
23682410 GenNormalsMINE();
23692411 } else
2370
- if (event.getSource() == stripifyItem)
2412
+ if (source == stripifyItem)
23712413 {
23722414 Stripify();
23732415 } else
2374
- if (event.getSource() == unstripifyItem)
2416
+ if (source == unstripifyItem)
23752417 {
23762418 Unstripify();
23772419 } else
2378
- if (event.getSource() == trimItem)
2420
+ if (source == trimItem)
23792421 {
23802422 Trim();
23812423 } else
2382
- if (event.getSource() == untrimItem)
2424
+ if (source == untrimItem)
23832425 {
23842426 Untrim();
23852427 } else
2386
- if (event.getSource() == clearColorsItem)
2428
+ if (source == clearColorsItem)
23872429 {
23882430 ClearColors();
23892431 } else
2390
- if (event.getSource() == clearMaterialsItem)
2432
+ if (source == clearMaterialsItem)
23912433 {
23922434 ClearMaterials();
23932435 } else
2394
- if (event.getSource() == liveleavesItem)
2436
+ if (source == liveleavesItem)
23952437 {
23962438 LiveLeaves(true);
23972439 } else
2398
- if (event.getSource() == unliveleavesItem)
2440
+ if (source == unliveleavesItem)
23992441 {
24002442 LiveLeaves(false);
24012443 } else
2402
- if (event.getSource() == supportleavesItem)
2444
+ if (source == supportleavesItem)
24032445 {
24042446 SupportLeaves(true);
24052447 } else
2406
- if (event.getSource() == unsupportleavesItem)
2448
+ if (source == unsupportleavesItem)
24072449 {
24082450 SupportLeaves(false);
24092451 } else
2410
- if (event.getSource() == hideleavesItem)
2452
+ if (source == hideleavesItem)
24112453 {
24122454 HideLeaves(true);
24132455 } else
2414
- if (event.getSource() == showleavesItem)
2456
+ if (source == showleavesItem)
24152457 {
24162458 HideLeaves(false);
24172459 } else
2418
- if (event.getSource() == markleavesItem)
2460
+ if (source == markleavesItem)
24192461 {
24202462 MarkLeaves(true);
24212463 } else
2422
- if (event.getSource() == unmarkleavesItem)
2464
+ if (source == unmarkleavesItem)
24232465 {
24242466 MarkLeaves(false);
24252467 } else
2426
- if (event.getSource() == flipVItem)
2468
+ if (source == flipVItem)
24272469 {
24282470 FlipV(true);
24292471 } else
2430
- if (event.getSource() == unflipVItem)
2472
+ if (source == unflipVItem)
24312473 {
24322474 FlipV(false);
24332475 } else
2434
- if (event.getSource() == lowTexturesItem)
2476
+ if (source == lowTexturesItem)
24352477 {
24362478 SetTexRes(0);
24372479 } else
2438
- if (event.getSource() == normalTexturesItem)
2480
+ if (source == normalTexturesItem)
24392481 {
24402482 SetTexRes(1);
24412483 } else
2442
- if (event.getSource() == highTexturesItem)
2484
+ if (source == highTexturesItem)
24432485 {
24442486 SetTexRes(2);
24452487 } else
2446
- if (event.getSource() == veryhighTexturesItem)
2488
+ if (source == veryhighTexturesItem)
24472489 {
24482490 SetTexRes(3);
24492491 } else
2450
- if (event.getSource() == maxTexturesItem)
2492
+ if (source == maxTexturesItem)
24512493 {
24522494 SetTexRes(4);
24532495 } else
2454
- if (event.getSource() == panoTexturesItem)
2496
+ if (source == panoTexturesItem)
24552497 {
24562498 SetTexRes(5);
24572499 } else
2458
- if (event.getSource() == reverseNormalsItem)
2500
+ if (source == reverseNormalsItem)
24592501 {
24602502 ReverseNormals();
24612503 } else
2462
- if (event.getSource() == parseverticesItem)
2504
+ if (source == parseverticesItem)
24632505 {
24642506 ParseVertices();
24652507 } else
2466
- if (event.getSource() == textureFieldItem)
2508
+ if (source == textureFieldItem)
24672509 {
24682510 TextureVertices();
24692511 } else
2470
- if (event.getSource() == alignItem)
2512
+ if (source == alignItem)
24712513 {
24722514 Align();
24732515 } else
2474
- if (event.getSource() == mirrorItem)
2516
+ if (source == mirrorItem)
24752517 {
24762518 MirrorPoses();
24772519 } else
2478
- if (event.getSource() == reduceMorphItem)
2520
+ if (source == reduceMorphItem)
24792521 {
24802522 MeshReduction(false);
24812523 } else
2482
- if (event.getSource() == reduce34MorphItem)
2524
+ if (source == reduce34MorphItem)
24832525 {
24842526 MeshReduction(true);
24852527 } else
2486
- if (event.getSource() == reverseTrianglesItem)
2528
+ if (source == reverseTrianglesItem)
24872529 {
24882530 ReverseTriangles();
24892531 } else
2490
- if (event.getSource() == reduceMeshItem)
2532
+ if (source == reduceMeshItem)
24912533 {
24922534 ReduceMesh(false);
24932535 } else
2494
- if (event.getSource() == reduce34MeshItem)
2536
+ if (source == reduce34MeshItem)
24952537 {
24962538 ReduceMesh(true);
24972539 } else
2498
- if (event.getSource() == increaseMeshItem)
2540
+ if (source == increaseMeshItem)
24992541 {
25002542 IncreaseMesh();
25012543 } else
2502
- if (event.getSource() == clipMeshItem)
2544
+ if (source == clipMeshItem)
25032545 {
25042546 ClipMesh();
25052547 } else
2506
- if (event.getSource() == smoothMeshItem)
2548
+ if (source == smoothMeshItem)
25072549 {
25082550 SmoothMesh();
25092551 } else
2510
- if (event.getSource() == transformgeometryItem)
2552
+ if (source == transformgeometryItem)
25112553 {
25122554 TransformGeometry();
25132555 } else
2514
- if (event.getSource() == resetTransformItem)
2556
+ if (source == resetTransformItem)
25152557 {
25162558 ResetTransform();
25172559 } else
2518
- if (event.getSource() == resetCentroidItem)
2560
+ if (source == resetCentroidItem)
25192561 {
25202562 ResetCentroid();
25212563 } else
2522
- if (event.getSource() == resetParentItem)
2564
+ if (source == resetParentItem)
25232565 {
25242566 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25252567 {
....@@ -2529,7 +2571,7 @@
25292571
25302572 refreshContents();
25312573 } else
2532
- if (event.getSource() == repairParentItem)
2574
+ if (source == repairParentItem)
25332575 {
25342576 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25352577 {
....@@ -2543,7 +2585,21 @@
25432585
25442586 refreshContents();
25452587 } else
2546
- 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)
25472603 {
25482604 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25492605 {
....@@ -2555,7 +2611,7 @@
25552611 ResetModel();
25562612 refreshContents();
25572613 } else
2558
- if (event.getSource() == sortbynameItem)
2614
+ if (source == sortbynameItem)
25592615 {
25602616 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25612617 {
....@@ -2567,7 +2623,7 @@
25672623 ResetModel();
25682624 refreshContents();
25692625 } else
2570
- if (event.getSource() == attachPigmentItem)
2626
+ if (source == attachPigmentItem)
25712627 {
25722628 String texture = GetFile("Attach pigment");
25732629 Object3D obj;
....@@ -2579,7 +2635,7 @@
25792635
25802636 refreshContents();
25812637 } else
2582
- if (event.getSource() == detachPigmentItem)
2638
+ if (source == detachPigmentItem)
25832639 {
25842640 Object3D obj;
25852641 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2590,7 +2646,7 @@
25902646
25912647 refreshContents();
25922648 } else
2593
- if (event.getSource() == attachBumpItem)
2649
+ if (source == attachBumpItem)
25942650 {
25952651 String texture = GetFile("Attach bump");
25962652 Object3D obj;
....@@ -2602,7 +2658,7 @@
26022658
26032659 refreshContents();
26042660 } else
2605
- if (event.getSource() == detachBumpItem)
2661
+ if (source == detachBumpItem)
26062662 {
26072663 Object3D obj;
26082664 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2613,7 +2669,7 @@
26132669
26142670 refreshContents();
26152671 } else
2616
- if (event.getSource() == pigmentBumpItem)
2672
+ if (source == pigmentBumpItem)
26172673 {
26182674 Object3D obj;
26192675 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2624,158 +2680,195 @@
26242680
26252681 refreshContents();
26262682 } else
2627
- if (event.getSource() == flashSelectionButton)
2683
+ if (source == flashSelectionButton)
26282684 {
26292685 CameraPane.flash = true;
26302686 refreshContents();
26312687 } else
2632
- if (event.getSource() == oneButton)
2688
+ if (source == oneButton)
26332689 {
26342690 } else
2635
- if (event.getSource() == twoButton)
2691
+ if (source == twoButton)
26362692 {
26372693 radio.layout = twoButton;
26382694 // bug
26392695 //gridPanel.setDividerLocation(1.0);
26402696 //bigPanel.setDividerLocation(0.0);
2641
- bigThree.remove(scenePanel);
2642
- bigThree.remove(cameraPanel);
2643
- bigThree.remove(XYZPanel);
2644
- aWindowConstraints.gridx = 0;
2645
- aWindowConstraints.gridy = 0;
2646
- aWindowConstraints.gridwidth = 1;
2647
- // aConstraints.gridheight = 3;
2648
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2649
- aWindowConstraints.weightx = 0;
2650
- aWindowConstraints.weighty = 1;
2651
- //bigThree.add(jtp, aWindowConstraints);
2652
- aWindowConstraints.weightx = 1;
2653
- aWindowConstraints.gridwidth = 3;
2654
- // aConstraints.gridheight = 3;
2655
- aWindowConstraints.gridx = 1;
2656
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2657
- bigThree.add(cameraPanel, aWindowConstraints);
2658
- aWindowConstraints.weightx = 0;
2659
- aWindowConstraints.gridx = 4;
2660
- aWindowConstraints.gridwidth = 1;
2661
- // aConstraints.gridheight = 3;
2662
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2663
- //bigThree.add(XYZPanel, aWindowConstraints);
2664
- bigThree.revalidate();
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();
26652726 } else
2666
- if (event.getSource() == threeButton)
2727
+ if (source == threeButton)
26672728 {
26682729 radio.layout = threeButton;
2669
- bigThree.remove(scenePanel);
2670
- bigThree.remove(cameraPanel);
2671
- bigThree.remove(XYZPanel);
2672
- aWindowConstraints.gridx = 0;
2673
- aWindowConstraints.gridy = 0;
2674
- aWindowConstraints.gridwidth = 1;
2675
- // aConstraints.gridheight = 3;
2676
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2677
- aWindowConstraints.weightx = 0;
2678
- aWindowConstraints.weighty = 1;
2679
- //bigThree.add(jtp, aWindowConstraints);
2680
- aWindowConstraints.weightx = 1;
2681
- aWindowConstraints.gridwidth = 3;
2682
- // aConstraints.gridheight = 3;
2683
- aWindowConstraints.gridx = 1;
2684
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2685
- bigThree.add(cameraPanel, aWindowConstraints);
2686
- aWindowConstraints.weightx = 0;
2687
- aWindowConstraints.gridx = 4;
2688
- aWindowConstraints.gridwidth = 1;
2689
- // aConstraints.gridheight = 3;
2690
- aConstraints.fill = GridBagConstraints.VERTICAL;
2691
- bigThree.add(XYZPanel, aWindowConstraints);
2692
- bigThree.revalidate();
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();
26932762 } else
2694
- if (event.getSource() == fourButton)
2763
+ if (source == fourButton)
26952764 {
26962765 radio.layout = fourButton;
2697
- bigThree.remove(scenePanel);
2698
- bigThree.remove(cameraPanel);
2699
- bigThree.remove(XYZPanel);
2700
- aWindowConstraints.gridx = 0;
2701
- aWindowConstraints.gridy = 0;
2702
- aWindowConstraints.gridwidth = 1;
2703
- // aWindowConstraints.gridheight = 3;
2704
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2705
- aWindowConstraints.weightx = 1;
2706
- aWindowConstraints.weighty = 1;
2707
- bigThree.add(scenePanel, aWindowConstraints);
2708
- aWindowConstraints.weightx = 1;
2709
- aWindowConstraints.gridwidth = 3;
2710
- // aConstraints.gridheight = 3;
2711
- aWindowConstraints.gridx = 1;
2712
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2713
- //bigThree.add(cameraPanel, aWindowConstraints);
2714
- aWindowConstraints.weightx = 0;
2715
- aWindowConstraints.gridx = 4;
2716
- aWindowConstraints.gridwidth = 1;
2717
- // aWindowConstraints.gridheight = 3;
2718
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2719
- //bigThree.add(XYZPanel, aWindowConstraints);
2720
- bigThree.revalidate();
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();
27212797 } else
2722
- if (event.getSource() == sixButton)
2798
+ if (source == sixButton)
27232799 {
27242800 radio.layout = sixButton;
2725
- bigThree.remove(scenePanel);
2726
- bigThree.remove(cameraPanel);
2727
- bigThree.remove(XYZPanel);
2728
- aWindowConstraints.gridx = 0;
2729
- aWindowConstraints.gridy = 0;
2730
- aWindowConstraints.gridwidth = 1;
2731
- // aConstraints.gridheight = 3;
2732
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2733
- aWindowConstraints.weightx = 0;
2734
- aWindowConstraints.weighty = 1;
2735
- bigThree.add(scenePanel, aWindowConstraints);
2736
- aWindowConstraints.weightx = 1;
2737
- aWindowConstraints.gridwidth = 3;
2738
- // aWindowConstraints.gridheight = 3;
2739
- aWindowConstraints.gridx = 1;
2740
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2741
- bigThree.add(cameraPanel, aWindowConstraints);
2742
- aWindowConstraints.weightx = 0;
2743
- aWindowConstraints.gridx = 4;
2744
- aWindowConstraints.gridwidth = 1;
2745
- // aWindowConstraints.gridheight = 3;
2746
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2747
- //bigThree.add(XYZPanel, aConstraints);
2748
- bigThree.revalidate();
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();
27492833 } else
2750
- if (event.getSource() == sevenButton)
2834
+ if (source == sevenButton)
27512835 {
27522836 radio.layout = sevenButton;
2753
- bigThree.remove(scenePanel);
2754
- bigThree.remove(cameraPanel);
2755
- bigThree.remove(XYZPanel);
2756
- aWindowConstraints.gridx = 0;
2757
- aWindowConstraints.gridy = 0;
2758
- aWindowConstraints.gridwidth = 1;
2759
- // aWindowConstraints.gridheight = 3;
2760
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2761
- aWindowConstraints.weightx = 0;
2762
- aWindowConstraints.weighty = 1;
2763
- bigThree.add(scenePanel, aWindowConstraints);
2764
- aWindowConstraints.weightx = 1;
2765
- aWindowConstraints.gridwidth = 3;
2766
- // aWindowConstraints.gridheight = 3;
2767
- aWindowConstraints.gridx = 1;
2768
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2769
- bigThree.add(cameraPanel, aWindowConstraints);
2770
- aWindowConstraints.weightx = 0;
2771
- aWindowConstraints.gridx = 4;
2772
- aWindowConstraints.gridwidth = 1;
2773
- // aConstraints.gridheight = 3;
2774
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2775
- bigThree.add(XYZPanel, aWindowConstraints);
2776
- bigThree.revalidate();
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();
27772870 } else
2778
- if (event.getSource() == rootButton)
2871
+ if (source == rootButton)
27792872 {
27802873 Object3D obj;
27812874 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2787,7 +2880,7 @@
27872880
27882881 refreshContents(true);
27892882 } else
2790
- if (event.getSource() == closeButton)
2883
+ if (source == closeButton)
27912884 {
27922885 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27932886 cRadio ab;
....@@ -2808,11 +2901,11 @@
28082901 }
28092902 refreshContents(true);
28102903 } else
2811
- if (event.getSource() == editItem || event.getSource() == editButton)
2904
+ if (source == editItem || source == editButton)
28122905 {
28132906 EditSelection(false);
28142907 } else
2815
- if (event.getSource() == uneditButton)
2908
+ if (source == uneditButton)
28162909 {
28172910 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28182911 {
....@@ -2824,12 +2917,12 @@
28242917
28252918 child.editWindow = null; // ???????????
28262919 }
2827
- objEditor.ctrlPanel.revalidate();
2920
+ objEditor.ctrlPanel.validate();
28282921 //objEditor.jTree.clearSelection();
28292922 //objEditor.ResetSliders();
28302923 refreshContents(true);
28312924 } else
2832
- if (event.getSource() == clearPanelButton)
2925
+ if (source == clearPanelButton)
28332926 {
28342927 assert(copy == group);
28352928 //copy.ClearUI();
....@@ -2840,7 +2933,7 @@
28402933 listUI.clear();
28412934 refreshContents(true);
28422935 } else
2843
- if (event.getSource() == allParamsButton)
2936
+ if (source == allParamsButton)
28442937 {
28452938 assert(copy == group);
28462939
....@@ -2861,19 +2954,19 @@
28612954
28622955 refreshContents(true);
28632956 } else
2864
- if (event.getSource() == unselectButton)
2957
+ if (source == unselectButton)
28652958 {
28662959 objEditor.jTree.clearSelection();
28672960 // ?? oct 2012 GrafreeD.clipboard.clear();
28682961 objEditor.ResetSliders();
28692962 refreshContents(true);
28702963 } else
2871
- if(event.getSource() instanceof cRadio)
2964
+ if(source instanceof cRadio)
28722965 {
28732966 group.parent = keepparent;
28742967 group.attributes = 0;
28752968 //group.editWindow = null;
2876
- /*cRadio*/ radio = (cRadio)event.getSource();
2969
+ /*cRadio*/ radio = (cRadio)source;
28772970 Object3D obj = radio.GetObject();
28782971 System.out.println("Edit " + obj);
28792972 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2893,7 +2986,7 @@
28932986 }
28942987
28952988 copy = group;
2896
- //CameraPane.theRenderer.object = group;
2989
+ //Globals.theRenderer.object = group;
28972990 if(!useclient)
28982991 {
28992992 cameraView.renderCamera = radio.camera;
....@@ -2902,7 +2995,8 @@
29022995 cameraView.cameras[cameraView.cameracount] = radio.camera;
29032996 cameraView.targetLookAt.set(radio.camera.lookAt);
29042997 cameraView.object = group;
2905
- cameraView.lighttouched = true;
2998
+ //cameraView.lighttouched = true;
2999
+ Globals.lighttouched = true;
29063000 topView.object = group;
29073001 frontView.object = group;
29083002 sideView.object = group;
....@@ -2938,7 +3032,7 @@
29383032 if (useclient)
29393033 {
29403034 cameraView.object = client;
2941
- cameraView.lighttouched = true;
3035
+ Globals.lighttouched = true;
29423036 //topView.object = client;
29433037 //frontView.object = client;
29443038 //sideView.object = client;
....@@ -2946,7 +3040,7 @@
29463040 else
29473041 {
29483042 cameraView.object = group;
2949
- cameraView.lighttouched = true;
3043
+ Globals.lighttouched = true;
29503044 //topView.object = group;
29513045 //frontView.object = group;
29523046 //sideView.object = group;
....@@ -3454,7 +3548,7 @@
34543548 String pigment = Object3D.GetPigment(tex);
34553549 //String bump = Object3D.GetBump(tex);
34563550
3457
- 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);
34583552
34593553 double s = v.s;
34603554
....@@ -3755,7 +3849,7 @@
37553849 group.selection.RelinkToSupport(); // july 2014
37563850 System.out.println("DONE.");
37573851 refreshContents();
3758
- 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));
37593853 }
37603854
37613855 void ReduceMesh(boolean reduction34)
....@@ -4040,16 +4134,16 @@
40404134
40414135 objEditor.SetText(); // jan 2014
40424136
4043
- 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))
40444138 CameraPane.flash = true;
40454139
40464140 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
40474141 // a camera
40484142 {
40494143 CameraPane.camerachangeframe = 0; // don't refuse it
4050
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4051
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
4052
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4144
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4145
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4146
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40534147 }
40544148
40554149 refreshContents();
....@@ -5007,6 +5101,7 @@
50075101
50085102 private MenuItem resetParentItem;
50095103 private MenuItem repairParentItem;
5104
+ private MenuItem repairShadowItem;
50105105 private MenuItem sortbysizeItem;
50115106 private MenuItem sortbynameItem;
50125107