Normand Briere
2019-05-01 25cef97465f0bfa8959663754e9243006324c81c
GroupEditor.java
....@@ -12,6 +12,7 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
....@@ -433,84 +434,26 @@
433434 oe.radioPanel.add(dummyButton);
434435 oe.buttonGroup.add(dummyButton);
435436 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
437
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439438
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
439
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
440
+ liveCB.setToolTipText("Enabled animation");
441441 liveCB.addItemListener(this);
442442
443
- 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);
443
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
444
+ trackCB.setToolTipText("Enable tracking");
503445 trackCB.addItemListener(this);
504446
505
- oe.aConstraints.gridx += 1;
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
447
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
448
+ screenfitButton.setToolTipText("Screen fit");
507449 screenfitButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
450
+
509451 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
510452 // screenfitpointButton.addActionListener(this);
511453 // oe.aConstraints.gridx += 1;
512
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
454
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
513455 snapobjectButton.addActionListener(this);
456
+ snapobjectButton.setToolTipText("Snap Object");
514457 oe.aConstraints.gridx += 1;
515458
516459 //aConstraints.gridx = 0;
....@@ -518,32 +461,35 @@
518461 oe.aConstraints.weighty = 0;
519462 oe.aConstraints.gridwidth = 1;
520463
521
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
464
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
465
+ flashSelectionButton.setToolTipText("Show selection");
522466 flashSelectionButton.addActionListener(this);
523467
524
- oe.toolbarPanel.add(new cButton(" ", false));
468
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
525469
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- //
531
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
470
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
471
+ twoButton.setToolTipText("Show center view only");
532472 twoButton.addActionListener(this);
533
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
473
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
534474 fourButton.addActionListener(this);
535
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
475
+ fourButton.setToolTipText("Show left panel only");
476
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
477
+ sixButton.setToolTipText("2-column layout left");
536478 sixButton.addActionListener(this);
537
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
479
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
480
+ threeButton.setToolTipText("2-column layout right");
538481 threeButton.addActionListener(this);
539
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
482
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
483
+ sevenButton.setToolTipText("3-column layout");
540484 sevenButton.addActionListener(this);
541485 //
542486
543
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
487
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
488
+ rootButton.setToolTipText("Edit object in new tab");
544489 rootButton.addActionListener(this);
545490 oe.aConstraints.gridx += 1;
546
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
491
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
492
+ closeButton.setToolTipText("Close tab");
547493 closeButton.addActionListener(this);
548494 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
549495 //clearButton.addActionListener(this);
....@@ -646,17 +592,91 @@
646592 radio.layout = sevenButton;
647593 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
648594 }
595
+
596
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
597
+ {
598
+ //constraints.gridx = 0;
599
+ //constraints.gridy = 0;
600
+ panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
601
+ fastCB.setToolTipText("Fast mode");
602
+ fastCB.addItemListener(this);
603
+ //constraints.gridy += 1;
604
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
605
+ supportCB.setToolTipText("Enabled rigging");
606
+ supportCB.addItemListener(this);
607
+
608
+ // constraints.gridy += 1;
609
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
610
+ // localCB.addItemListener(this);
611
+
612
+ //constraints.gridy += 1;
613
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
614
+ crowdCB.setToolTipText("Used for crowds");
615
+ crowdCB.addItemListener(this);
616
+
617
+ //constraints.gridy += 1;
618
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
619
+ smoothCB.setToolTipText("Snapping delay");
620
+ smoothCB.addItemListener(this);
621
+
622
+ //constraints.gridy += 1;
623
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
624
+ slowCB.setToolTipText("Smooth interpolation");
625
+ slowCB.addItemListener(this);
626
+ //constraints.gridy += 1;
627
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
628
+ boxCB.setToolTipText("Display bounding boxes");
629
+ boxCB.addItemListener(this);
630
+ //constraints.gridy += 1;
631
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
632
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
633
+ zoomBoxCB.addItemListener(this);
634
+
635
+// constraints.gridy += 1;
636
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
637
+// speakerMocapCB.addItemListener(this);
638
+
639
+ if (false)
640
+ {
641
+ // handled in scripts
642
+ //constraints.gridy += 1;
643
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
644
+ speakerCameraCB.addItemListener(this);
645
+
646
+ //constraints.gridy += 1;
647
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
648
+ speakerFocusCB.addItemListener(this);
649
+
650
+ //constraints.gridy += 1;
651
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
652
+ smoothfocusCB.addItemListener(this);
653
+ }
654
+
655
+//constraints.gridx += 1;
656
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
657
+// debugCB.addItemListener(this);
658
+
659
+ //constraints.gridy += 1;
660
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
661
+ oeilCB.addItemListener(this);
662
+
663
+ //constraints.gridy += 1;
664
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
665
+ lookAtCB.setToolTipText("Look-at target");
666
+ lookAtCB.addItemListener(this);
667
+
668
+ }
649669
650670 void EditObject(Object3D obj)
651671 {
652
- cRadio dummyButton = new cRadio(obj.name);
653
- dummyButton.SetObject(obj);
654
- dummyButton.layout = sevenButton;
655
- dummyButton.SetCamera(cameraView.renderCamera, false);
656
- dummyButton.addActionListener(this);
657
- radioPanel.add(dummyButton);
658
- buttonGroup.add(dummyButton);
659
- dummyButton.doClick();
672
+ cRadio radioButton = new cRadio(obj.name);
673
+ radioButton.SetObject(obj);
674
+ radioButton.layout = sevenButton;
675
+ radioButton.SetCamera(cameraView.renderCamera, false);
676
+ radioButton.addActionListener(this);
677
+ radioPanel.add(radioButton);
678
+ buttonGroup.add(radioButton);
679
+ radioButton.doClick();
660680 }
661681 void SetupViews(ObjEditor oe)
662682 {
....@@ -676,6 +696,7 @@
676696 JCheckBox fastCB;
677697 JCheckBox slowCB;
678698 JCheckBox boxCB;
699
+ JCheckBox zoomBoxCB;
679700 JCheckBox trackCB;
680701 JCheckBox smoothfocusCB;
681702 // JCheckBox speakerMocapCB;
....@@ -755,6 +776,10 @@
755776 Recompile();
756777 cameraView.repaint();
757778 // refreshContents();
779
+ }
780
+ else if(e.getSource() == zoomBoxCB)
781
+ {
782
+ cameraView.ToggleZoomBoxMode();
758783 }
759784 else if(e.getSource() == smoothfocusCB)
760785 {
....@@ -1120,6 +1145,8 @@
11201145 resetParentItem.addActionListener(this);
11211146 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11221147 repairParentItem.addActionListener(this);
1148
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1149
+ repairShadowItem.addActionListener(this);
11231150 menu.add(invariantsItem = new MenuItem("Invariants"));
11241151 invariantsItem.addActionListener(this);
11251152 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1480,6 +1507,7 @@
14801507 //
14811508 public void actionPerformed(ActionEvent event) // , Object arg)
14821509 {
1510
+ Object source = event.getSource();
14831511 /*
14841512 if (event.getSource() == nameField)
14851513 {
....@@ -1491,11 +1519,11 @@
14911519 }
14921520 else
14931521 */
1494
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1522
+ if (source == lookAtItem || source == lookFromItem)
14951523 {
14961524 ScreenFit();
14971525 } else
1498
- if (event.getSource() == switchItem)
1526
+ if (source == switchItem)
14991527 {
15001528 cVector v1 = new cVector();
15011529 cVector v2 = new cVector();
....@@ -1504,11 +1532,11 @@
15041532 objEditor.cameraView.renderCamera.setAim(v2, v1);
15051533 objEditor.cameraView.repaint();
15061534 } else
1507
- if (event.getSource() == rectoidItem)
1535
+ if (source == rectoidItem)
15081536 {
15091537 makeSomething(new Box());
15101538 } else
1511
- if (event.getSource() == particleItem)
1539
+ if (source == particleItem)
15121540 {
15131541 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15141542 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1529,9 +1557,9 @@
15291557 applyExample(particleGeom, "SMOKE");
15301558 makeSomething(particleGeom);
15311559 } else
1532
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1560
+ if (source == ragdollItem || source == ragdoll2Item)
15331561 {
1534
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1562
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15351563
15361564 ragdoll.toParent = LA.newMatrix();
15371565 ragdoll.fromParent = LA.newMatrix();
....@@ -1549,7 +1577,7 @@
15491577 } else
15501578 /*
15511579 */
1552
- if (event.getSource() == heightFieldItem)
1580
+ if (source == heightFieldItem)
15531581 {
15541582 Object3D obj = new Object3D();
15551583
....@@ -1587,31 +1615,31 @@
15871615
15881616 makeSomething(obj);
15891617 } else
1590
- if (event.getSource() == gridItem)
1618
+ if (source == gridItem)
15911619 {
15921620 makeSomething(new Grid());
15931621 } else
1594
- if (event.getSource() == ellipsoidItem)
1622
+ if (source == ellipsoidItem)
15951623 {
15961624 makeSomething(new Sphere());
15971625 } else
1598
- if (event.getSource() == coneItem)
1626
+ if (source == coneItem)
15991627 {
16001628 makeSomething(new Cone());
16011629 } else
1602
- if (event.getSource() == torusItem)
1630
+ if (source == torusItem)
16031631 {
16041632 makeSomething(new Torus());
16051633 } else
1606
- if (event.getSource() == superItem)
1634
+ if (source == superItem)
16071635 {
16081636 makeSomething(new Superellipsoid());
16091637 } else
1610
- if (event.getSource() == kleinItem)
1638
+ if (source == kleinItem)
16111639 {
16121640 makeSomething(new Klein());
16131641 } else
1614
- if (event.getSource() == blobItem)
1642
+ if (source == blobItem)
16151643 {
16161644 Blob blob = new Blob();
16171645 BlobComponent comp = new BlobComponent();
....@@ -1619,15 +1647,15 @@
16191647 //blob.retile();
16201648 makeSomething(blob);
16211649 } else
1622
- if (event.getSource() == latheItem)
1650
+ if (source == latheItem)
16231651 {
16241652 makeSomething(new Lathe());
16251653 } else
1626
- if (event.getSource() == bezierItem)
1654
+ if (source == bezierItem)
16271655 {
16281656 makeSomething(new BezierSurface());
16291657 } else
1630
- if (event.getSource() == checkerItem)
1658
+ if (source == checkerItem)
16311659 {
16321660 /*
16331661 Object3D obj = new BezierSurface(5,8);
....@@ -1642,7 +1670,7 @@
16421670 */
16431671 makeSomething(new Checker());
16441672 } else
1645
- if (event.getSource() == meshItem)
1673
+ if (source == meshItem)
16461674 {
16471675 Object3D itemtomake = new Object3D();
16481676 Object3D child;
....@@ -1663,35 +1691,35 @@
16631691 makeSomething(child);
16641692 }
16651693 } else
1666
- if (event.getSource() == springItem)
1694
+ if (source == springItem)
16671695 {
16681696 cSpring s = new cSpring();
16691697 s.setup();
16701698 makeSomething(s);
16711699 } else
1672
- if (event.getSource() == flagItem)
1700
+ if (source == flagItem)
16731701 {
16741702 cSpring s = new cFlag();
16751703 s.setup();
16761704 makeSomething(s);
16771705 } else
1678
- if (event.getSource() == lightItem)
1706
+ if (source == lightItem)
16791707 {
16801708 makeSomething(new Light());
16811709 } else
1682
- if (event.getSource() == csgItem)
1710
+ if (source == csgItem)
16831711 {
16841712 group(new CSG());
16851713 } else
1686
- if (event.getSource() == templateItem)
1714
+ if (source == templateItem)
16871715 {
16881716 group(new cTemplate());
16891717 } else
1690
- if (event.getSource() == attributeItem)
1718
+ if (source == attributeItem)
16911719 {
16921720 makeSomething(new Attribute());
16931721 } else
1694
- if (event.getSource() == pointflowItem)
1722
+ if (source == pointflowItem)
16951723 {
16961724 makeSomething(new PointFlow());
16971725 } else
....@@ -1703,7 +1731,7 @@
17031731 } else
17041732 */
17051733
1706
- if (event.getSource() == superLoopItem)
1734
+ if (source == superLoopItem)
17071735 {
17081736 Composite g = new cGroup();
17091737 for (int i=0; i<15; i++)
....@@ -1725,7 +1753,7 @@
17251753
17261754 group(g);
17271755 } else
1728
- if (event.getSource() == loopItem)
1756
+ if (source == loopItem)
17291757 {
17301758 Composite csg = new GroupLeaf();
17311759 csg.count = 5;
....@@ -1734,7 +1762,7 @@
17341762 csg.addChild(child);
17351763 child.addChild(csg);
17361764 } else
1737
- if (event.getSource() == doubleItem)
1765
+ if (source == doubleItem)
17381766 {
17391767 Composite csg = new GroupLeaf();
17401768 csg.count = 5;
....@@ -1746,7 +1774,7 @@
17461774 csg.addChild(child);
17471775 child.addChild(csg);
17481776 } else
1749
- if (event.getSource() == tripleItem)
1777
+ if (source == tripleItem)
17501778 {
17511779 Composite csg = new GroupLeaf();
17521780 csg.count = 4;
....@@ -1762,70 +1790,70 @@
17621790 child.addChild(csg);
17631791 } else
17641792
1765
- if (event.getSource() == importGFDItem)
1793
+ if (source == importGFDItem)
17661794 {
17671795 ImportGFD();
17681796 } else
1769
- if (event.getSource() == importVRMLX3DItem)
1797
+ if (source == importVRMLX3DItem)
17701798 {
17711799 ImportVRMLX3D();
17721800 } else
1773
- if (event.getSource() == import3DSItem)
1801
+ if (source == import3DSItem)
17741802 {
17751803 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17761804 } else
1777
- if (event.getSource() == importOBJItem)
1805
+ if (source == importOBJItem)
17781806 {
17791807 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
17801808 } else
1781
- if (event.getSource() == computeAOItem)
1809
+ if (source == computeAOItem)
17821810 {
1783
- CameraPane.drawMode = CameraPane.OCCLUSION;
1784
- CameraPane.theRenderer.repaint();
1811
+ Globals.drawMode = CameraPane.OCCLUSION;
1812
+ Globals.theRenderer.repaint();
17851813 } else
1786
- if (event.getSource() == recompileItem)
1814
+ if (source == recompileItem)
17871815 {
17881816 Recompile();
17891817 refreshContents();
17901818 } else
1791
- if (event.getSource() == editScriptItem)
1819
+ if (source == editScriptItem)
17921820 {
17931821 OpenDialog();
17941822 refreshContents();
17951823 } else
1796
- if (event.getSource() == invariantsItem)
1824
+ if (source == invariantsItem)
17971825 {
17981826 System.out.println("Invariants:");
17991827 GrafreeD.grafreeD.universe.invariants();
18001828 } else
1801
- if (event.getSource() == memoryItem)
1829
+ if (source == memoryItem)
18021830 {
18031831 //System.out.println("Invariants:");
18041832 PrintMemory();
18051833 } else
1806
- if (event.getSource() == pathItem)
1834
+ if (source == pathItem)
18071835 {
18081836 PrintPath();
18091837 } else
1810
- if (event.getSource() == analyzeItem)
1838
+ if (source == analyzeItem)
18111839 {
18121840 AnalyzeObject();
18131841 } else
1814
- if (event.getSource() == dumpItem)
1842
+ if (source == dumpItem)
18151843 {
18161844 DumpObject();
18171845 } else
1818
- if (event.getSource() == screenfitButton)
1846
+ if (source == screenfitButton)
18191847 {
18201848 //Reload(lastConverter, lastFilename, true);
18211849 ScreenFit();
18221850 } else
1823
- if (event.getSource() == screenfitpointButton)
1851
+ if (source == screenfitpointButton)
18241852 {
18251853 //Reload(lastConverter, lastFilename, true);
18261854 ScreenFitPoint();
18271855 } else
1828
- if (event.getSource() == snapobjectButton)
1856
+ if (source == snapobjectButton)
18291857 {
18301858 //Reload(lastConverter, lastFilename, true);
18311859 SnapObject();
....@@ -1836,13 +1864,13 @@
18361864 // Recompile();
18371865 // refreshContents();
18381866 // } else
1839
- if (event.getSource() == gcButton)
1867
+ if (source == gcButton)
18401868 {
18411869 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18421870 System.gc();
18431871 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18441872 } else
1845
- if (event.getSource() == editLeafItem)
1873
+ if (source == editLeafItem)
18461874 {
18471875 Object3D obj;
18481876 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1856,62 +1884,62 @@
18561884 }
18571885 refreshContents(true);
18581886 } else
1859
- if (event.getSource() == openWindowItem)
1887
+ if (source == openWindowItem)
18601888 {
18611889 EditSelection(true);
18621890 } else
1863
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1891
+ if (source == cutItem || source == clearButton)
18641892 {
18651893 loadClipboard(true);
18661894 } else
1867
- if (event.getSource() == duplicateItem)
1895
+ if (source == duplicateItem)
18681896 {
18691897 Object3D keep = GrafreeD.clipboard;
18701898 loadClipboard(false);
18711899 paste(false);
18721900 GrafreeD.clipboard = keep;
18731901 } else
1874
- if (event.getSource() == cloneItem)
1902
+ if (source == cloneItem)
18751903 {
18761904 CloneSelection(false);
18771905 } else
1878
- if (event.getSource() == cloneSupportItem)
1906
+ if (source == cloneSupportItem)
18791907 {
18801908 CloneSelection(true);
18811909 } else
1882
- if (event.getSource() == copyItem)
1910
+ if (source == copyItem)
18831911 {
18841912 loadClipboard(false);
18851913 } else
1886
- if (event.getSource() == pasteItem)
1914
+ if (source == pasteItem)
18871915 {
18881916 paste(false);
18891917 } else
1890
- if (event.getSource() == pasteLinkItem)
1918
+ if (source == pasteLinkItem)
18911919 {
18921920 pasteInto(false);
18931921 } else
1894
- if (event.getSource() == pasteCloneItem)
1922
+ if (source == pasteCloneItem)
18951923 {
18961924 pasteInto(true);
18971925 } else
1898
- if (event.getSource() == pasteExpandItem)
1926
+ if (source == pasteExpandItem)
18991927 {
19001928 paste(true);
19011929 } else
1902
- if (event.getSource() == synchronizeItem)
1930
+ if (source == synchronizeItem)
19031931 {
19041932 Overwrite(Object3D.TRANSFORM);
19051933 } else
1906
- if (event.getSource() == overwriteNameItem)
1934
+ if (source == overwriteNameItem)
19071935 {
19081936 Overwrite(Object3D.NAME);
19091937 } else
1910
- if (event.getSource() == overwriteUVItem)
1938
+ if (source == overwriteUVItem)
19111939 {
19121940 Overwrite(Object3D.UV);
19131941 } else
1914
- if (event.getSource() == overwriteMatItem)
1942
+ if (source == overwriteMatItem)
19151943 {
19161944 /* july 2015
19171945 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1931,7 +1959,7 @@
19311959
19321960 Overwrite(dropAttributes);
19331961 }
1934
- if (event.getSource() == overwriteGeoItem)
1962
+ if (source == overwriteGeoItem)
19351963 {
19361964 Overwrite(Object3D.GEOMETRY);
19371965 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1948,7 +1976,7 @@
19481976 // refreshContents();
19491977 // }
19501978 } else
1951
- if (event.getSource() == generateMeshItem)
1979
+ if (source == generateMeshItem)
19521980 {
19531981 //if (group.selection.size() == 1)
19541982 // for (int i=0; i<group.selection.size(); i++)
....@@ -1959,7 +1987,7 @@
19591987 ResetModel();
19601988 refreshContents();
19611989 } else
1962
- if (event.getSource() == extractGeometriesItem)
1990
+ if (source == extractGeometriesItem)
19631991 {
19641992 boolean one = false;
19651993
....@@ -1986,7 +2014,7 @@
19862014 ResetModel();
19872015 refreshContents();
19882016 } else
1989
- if (event.getSource() == cloneGeometriesItem)
2017
+ if (source == cloneGeometriesItem)
19902018 {
19912019 boolean one = false;
19922020
....@@ -2012,7 +2040,7 @@
20122040 ResetModel();
20132041 refreshContents();
20142042 } else
2015
- if (event.getSource() == shareGeometriesItem)
2043
+ if (source == shareGeometriesItem)
20162044 {
20172045 boolean one = false;
20182046
....@@ -2042,7 +2070,7 @@
20422070 refreshContents();
20432071 }
20442072 } else
2045
- if (event.getSource() == mergeGeometriesItem)
2073
+ if (source == mergeGeometriesItem)
20462074 {
20472075 boolean one = false;
20482076
....@@ -2072,7 +2100,7 @@
20722100 ResetModel();
20732101 refreshContents();
20742102 } else
2075
- if (event.getSource() == linkverticesItem)
2103
+ if (source == linkverticesItem)
20762104 {
20772105 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20782106 // {
....@@ -2092,7 +2120,7 @@
20922120 if (content instanceof cGroup && ((cGroup)content).transientlink )
20932121 content = ((cGroup)content).get(0);
20942122
2095
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2123
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20962124 for (int i=0; i<group.selection.size(); i++)
20972125 {
20982126 boolean random = CameraPane.RANDOM;
....@@ -2101,11 +2129,11 @@
21012129 // group.selection.get(i).setMasterThis(content); // should be identity
21022130 CameraPane.RANDOM = random;
21032131 }
2104
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2132
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21052133 refreshContents();
21062134 }
21072135 } else
2108
- if (event.getSource() == resetsupportItem)
2136
+ if (source == resetsupportItem)
21092137 {
21102138 for (int i=0; i<group.selection.size(); i++)
21112139 {
....@@ -2117,7 +2145,7 @@
21172145
21182146 refreshContents();
21192147 } else
2120
- if (event.getSource() == relinkverticesItem)
2148
+ if (source == relinkverticesItem)
21212149 {
21222150 boolean random = CameraPane.RANDOM;
21232151 CameraPane.RANDOM = false; // parse all random nodes
....@@ -2126,7 +2154,7 @@
21262154
21272155 refreshContents();
21282156 } else
2129
- if (event.getSource() == resetreferencesItem)
2157
+ if (source == resetreferencesItem)
21302158 {
21312159 for (int i=0; i<group.selection.size(); i++)
21322160 {
....@@ -2135,7 +2163,7 @@
21352163
21362164 refreshContents();
21372165 } else
2138
- if (event.getSource() == setMasterItem)
2166
+ if (source == setMasterItem)
21392167 {
21402168 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21412169 {
....@@ -2148,7 +2176,7 @@
21482176 refreshContents();
21492177 }
21502178 } else
2151
- if (event.getSource() == poseMeshItem)
2179
+ if (source == poseMeshItem)
21522180 {
21532181 if (group.selection.size() == 1)
21542182 {
....@@ -2167,19 +2195,19 @@
21672195 }
21682196
21692197 } else
2170
- if (event.getSource() == revertMeshItem)
2198
+ if (source == revertMeshItem)
21712199 {
21722200 RevertMeshes();
21732201 } else
2174
- if (event.getSource() == resetMeshItem)
2202
+ if (source == resetMeshItem)
21752203 {
21762204 ResetAll();
21772205 } else
2178
- if (event.getSource() == stepAllItem)
2206
+ if (source == stepAllItem)
21792207 {
21802208 StepAll();
21812209 } else
2182
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2210
+ if (source == clearItem) // || event.getSource() == clearButton)
21832211 {
21842212 //int indices[] = jList.getSelectedIndices();
21852213 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2187,46 +2215,46 @@
21872215
21882216 ClearSelection(false);
21892217 } else
2190
- if (event.getSource() == clearAllItem)
2218
+ if (source == clearAllItem)
21912219 {
21922220 ClearSelection(true);
21932221 } else
2194
- if (event.getSource() == grabItem)
2222
+ if (source == grabItem)
21952223 {
21962224 group(new cGroup(), true);
21972225 } else
2198
- if (event.getSource() == hideItem)
2226
+ if (source == hideItem)
21992227 {
22002228 group(new HiddenObject());
22012229 } else
2202
- if (event.getSource() == frontItem)
2230
+ if (source == frontItem)
22032231 {
22042232 front();
22052233 } else
2206
- if (event.getSource() == backItem)
2234
+ if (source == backItem)
22072235 {
22082236 back();
22092237 } else
2210
- if (event.getSource() == cameraItem)
2238
+ if (source == cameraItem)
22112239 {
22122240 makeSomething(new Camera());
22132241 } else
2214
- if (event.getSource() == compositeItem)
2242
+ if (source == compositeItem)
22152243 {
22162244 group(new Composite());
22172245 } else
2218
- if (event.getSource() == randomItem)
2246
+ if (source == randomItem)
22192247 {
22202248 RandomNode random = new RandomNode();
22212249 group(random);
22222250 if (random.size() > 0)
22232251 random.name = random.get(0).name + "Rnd";
22242252 } else
2225
- if (event.getSource() == physicsItem)
2253
+ if (source == physicsItem)
22262254 {
22272255 group(new PhysicsNode());
22282256 } else
2229
- if (event.getSource() == frameselectorItem)
2257
+ if (source == frameselectorItem)
22302258 {
22312259 for (int i=0; i<group.selection.size(); i++)
22322260 {
....@@ -2238,7 +2266,7 @@
22382266 ResetModel();
22392267 refreshContents();
22402268 } else
2241
- if (event.getSource() == switchGeoItem)
2269
+ if (source == switchGeoItem)
22422270 {
22432271 for (int i=0; i<group.selection.size(); i++)
22442272 {
....@@ -2250,7 +2278,7 @@
22502278 ResetModel();
22512279 refreshContents();
22522280 } else
2253
- if (event.getSource() == switchTransfoItem)
2281
+ if (source == switchTransfoItem)
22542282 {
22552283 for (int i=0; i<group.selection.size(); i++)
22562284 {
....@@ -2262,7 +2290,7 @@
22622290 ResetModel();
22632291 refreshContents();
22642292 } else
2265
- if (event.getSource() == morphItem)
2293
+ if (source == morphItem)
22662294 {
22672295 for (int i=0; i<group.selection.size(); i++)
22682296 {
....@@ -2274,7 +2302,7 @@
22742302 ResetModel();
22752303 refreshContents();
22762304 } else
2277
- if (event.getSource() == scriptNodeItem)
2305
+ if (source == scriptNodeItem)
22782306 {
22792307 boolean atleastone = false;
22802308
....@@ -2313,31 +2341,31 @@
23132341 }
23142342 }
23152343 } else
2316
- if (event.getSource() == linkerItem)
2344
+ if (source == linkerItem)
23172345 {
23182346 group(new cLinker());
23192347 } else
2320
- if (event.getSource() == textureItem)
2348
+ if (source == textureItem)
23212349 {
23222350 group(new TextureNode());
23232351 } else
2324
- if (event.getSource() == billboardItem)
2352
+ if (source == billboardItem)
23252353 {
23262354 group(new BillboardNode());
23272355 } else
2328
- if (event.getSource() == shadowXItem)
2356
+ if (source == shadowXItem)
23292357 {
23302358 CastShadow(0);
23312359 } else
2332
- if (event.getSource() == shadowYItem)
2360
+ if (source == shadowYItem)
23332361 {
23342362 CastShadow(1);
23352363 } else
2336
- if (event.getSource() == shadowZItem)
2364
+ if (source == shadowZItem)
23372365 {
23382366 CastShadow(2);
23392367 } else
2340
- if (event.getSource() == ungroupItem)
2368
+ if (source == ungroupItem)
23412369 {
23422370 //ungroup();
23432371 for (int i=0; i<group.selection.size(); i++)
....@@ -2349,179 +2377,179 @@
23492377
23502378 refreshContents();
23512379 } else
2352
- if (event.getSource() == genUVItem)
2380
+ if (source == genUVItem)
23532381 {
23542382 GenUV();
23552383 } else
2356
- if (event.getSource() == genNormalsCADItem)
2384
+ if (source == genNormalsCADItem)
23572385 {
23582386 GenNormals(true);
23592387 } else
2360
- if (event.getSource() == genNormalsMESHItem)
2388
+ if (source == genNormalsMESHItem)
23612389 {
23622390 GenNormals(true); // TODO
23632391 } else
2364
- if (event.getSource() == genNormalsORGANItem)
2392
+ if (source == genNormalsORGANItem)
23652393 {
23662394 GenNormals(false);
23672395 } else
2368
- if (event.getSource() == genNormalsMINEItem)
2396
+ if (source == genNormalsMINEItem)
23692397 {
23702398 GenNormalsMINE();
23712399 } else
2372
- if (event.getSource() == stripifyItem)
2400
+ if (source == stripifyItem)
23732401 {
23742402 Stripify();
23752403 } else
2376
- if (event.getSource() == unstripifyItem)
2404
+ if (source == unstripifyItem)
23772405 {
23782406 Unstripify();
23792407 } else
2380
- if (event.getSource() == trimItem)
2408
+ if (source == trimItem)
23812409 {
23822410 Trim();
23832411 } else
2384
- if (event.getSource() == untrimItem)
2412
+ if (source == untrimItem)
23852413 {
23862414 Untrim();
23872415 } else
2388
- if (event.getSource() == clearColorsItem)
2416
+ if (source == clearColorsItem)
23892417 {
23902418 ClearColors();
23912419 } else
2392
- if (event.getSource() == clearMaterialsItem)
2420
+ if (source == clearMaterialsItem)
23932421 {
23942422 ClearMaterials();
23952423 } else
2396
- if (event.getSource() == liveleavesItem)
2424
+ if (source == liveleavesItem)
23972425 {
23982426 LiveLeaves(true);
23992427 } else
2400
- if (event.getSource() == unliveleavesItem)
2428
+ if (source == unliveleavesItem)
24012429 {
24022430 LiveLeaves(false);
24032431 } else
2404
- if (event.getSource() == supportleavesItem)
2432
+ if (source == supportleavesItem)
24052433 {
24062434 SupportLeaves(true);
24072435 } else
2408
- if (event.getSource() == unsupportleavesItem)
2436
+ if (source == unsupportleavesItem)
24092437 {
24102438 SupportLeaves(false);
24112439 } else
2412
- if (event.getSource() == hideleavesItem)
2440
+ if (source == hideleavesItem)
24132441 {
24142442 HideLeaves(true);
24152443 } else
2416
- if (event.getSource() == showleavesItem)
2444
+ if (source == showleavesItem)
24172445 {
24182446 HideLeaves(false);
24192447 } else
2420
- if (event.getSource() == markleavesItem)
2448
+ if (source == markleavesItem)
24212449 {
24222450 MarkLeaves(true);
24232451 } else
2424
- if (event.getSource() == unmarkleavesItem)
2452
+ if (source == unmarkleavesItem)
24252453 {
24262454 MarkLeaves(false);
24272455 } else
2428
- if (event.getSource() == flipVItem)
2456
+ if (source == flipVItem)
24292457 {
24302458 FlipV(true);
24312459 } else
2432
- if (event.getSource() == unflipVItem)
2460
+ if (source == unflipVItem)
24332461 {
24342462 FlipV(false);
24352463 } else
2436
- if (event.getSource() == lowTexturesItem)
2464
+ if (source == lowTexturesItem)
24372465 {
24382466 SetTexRes(0);
24392467 } else
2440
- if (event.getSource() == normalTexturesItem)
2468
+ if (source == normalTexturesItem)
24412469 {
24422470 SetTexRes(1);
24432471 } else
2444
- if (event.getSource() == highTexturesItem)
2472
+ if (source == highTexturesItem)
24452473 {
24462474 SetTexRes(2);
24472475 } else
2448
- if (event.getSource() == veryhighTexturesItem)
2476
+ if (source == veryhighTexturesItem)
24492477 {
24502478 SetTexRes(3);
24512479 } else
2452
- if (event.getSource() == maxTexturesItem)
2480
+ if (source == maxTexturesItem)
24532481 {
24542482 SetTexRes(4);
24552483 } else
2456
- if (event.getSource() == panoTexturesItem)
2484
+ if (source == panoTexturesItem)
24572485 {
24582486 SetTexRes(5);
24592487 } else
2460
- if (event.getSource() == reverseNormalsItem)
2488
+ if (source == reverseNormalsItem)
24612489 {
24622490 ReverseNormals();
24632491 } else
2464
- if (event.getSource() == parseverticesItem)
2492
+ if (source == parseverticesItem)
24652493 {
24662494 ParseVertices();
24672495 } else
2468
- if (event.getSource() == textureFieldItem)
2496
+ if (source == textureFieldItem)
24692497 {
24702498 TextureVertices();
24712499 } else
2472
- if (event.getSource() == alignItem)
2500
+ if (source == alignItem)
24732501 {
24742502 Align();
24752503 } else
2476
- if (event.getSource() == mirrorItem)
2504
+ if (source == mirrorItem)
24772505 {
24782506 MirrorPoses();
24792507 } else
2480
- if (event.getSource() == reduceMorphItem)
2508
+ if (source == reduceMorphItem)
24812509 {
24822510 MeshReduction(false);
24832511 } else
2484
- if (event.getSource() == reduce34MorphItem)
2512
+ if (source == reduce34MorphItem)
24852513 {
24862514 MeshReduction(true);
24872515 } else
2488
- if (event.getSource() == reverseTrianglesItem)
2516
+ if (source == reverseTrianglesItem)
24892517 {
24902518 ReverseTriangles();
24912519 } else
2492
- if (event.getSource() == reduceMeshItem)
2520
+ if (source == reduceMeshItem)
24932521 {
24942522 ReduceMesh(false);
24952523 } else
2496
- if (event.getSource() == reduce34MeshItem)
2524
+ if (source == reduce34MeshItem)
24972525 {
24982526 ReduceMesh(true);
24992527 } else
2500
- if (event.getSource() == increaseMeshItem)
2528
+ if (source == increaseMeshItem)
25012529 {
25022530 IncreaseMesh();
25032531 } else
2504
- if (event.getSource() == clipMeshItem)
2532
+ if (source == clipMeshItem)
25052533 {
25062534 ClipMesh();
25072535 } else
2508
- if (event.getSource() == smoothMeshItem)
2536
+ if (source == smoothMeshItem)
25092537 {
25102538 SmoothMesh();
25112539 } else
2512
- if (event.getSource() == transformgeometryItem)
2540
+ if (source == transformgeometryItem)
25132541 {
25142542 TransformGeometry();
25152543 } else
2516
- if (event.getSource() == resetTransformItem)
2544
+ if (source == resetTransformItem)
25172545 {
25182546 ResetTransform();
25192547 } else
2520
- if (event.getSource() == resetCentroidItem)
2548
+ if (source == resetCentroidItem)
25212549 {
25222550 ResetCentroid();
25232551 } else
2524
- if (event.getSource() == resetParentItem)
2552
+ if (source == resetParentItem)
25252553 {
25262554 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25272555 {
....@@ -2531,7 +2559,7 @@
25312559
25322560 refreshContents();
25332561 } else
2534
- if (event.getSource() == repairParentItem)
2562
+ if (source == repairParentItem)
25352563 {
25362564 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25372565 {
....@@ -2545,7 +2573,21 @@
25452573
25462574 refreshContents();
25472575 } else
2548
- if (event.getSource() == sortbysizeItem)
2576
+ if (source == repairShadowItem)
2577
+ {
2578
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2579
+ {
2580
+ Object3D obj = (Object3D)e.nextElement();
2581
+ obj.RepairShadow();
2582
+// for (int i=0; i<obj.size(); i++)
2583
+// {
2584
+// obj.get(i).parent = obj;
2585
+// }
2586
+ }
2587
+
2588
+ refreshContents();
2589
+ } else
2590
+ if (source == sortbysizeItem)
25492591 {
25502592 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25512593 {
....@@ -2557,7 +2599,7 @@
25572599 ResetModel();
25582600 refreshContents();
25592601 } else
2560
- if (event.getSource() == sortbynameItem)
2602
+ if (source == sortbynameItem)
25612603 {
25622604 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25632605 {
....@@ -2569,7 +2611,7 @@
25692611 ResetModel();
25702612 refreshContents();
25712613 } else
2572
- if (event.getSource() == attachPigmentItem)
2614
+ if (source == attachPigmentItem)
25732615 {
25742616 String texture = GetFile("Attach pigment");
25752617 Object3D obj;
....@@ -2581,7 +2623,7 @@
25812623
25822624 refreshContents();
25832625 } else
2584
- if (event.getSource() == detachPigmentItem)
2626
+ if (source == detachPigmentItem)
25852627 {
25862628 Object3D obj;
25872629 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2592,7 +2634,7 @@
25922634
25932635 refreshContents();
25942636 } else
2595
- if (event.getSource() == attachBumpItem)
2637
+ if (source == attachBumpItem)
25962638 {
25972639 String texture = GetFile("Attach bump");
25982640 Object3D obj;
....@@ -2604,7 +2646,7 @@
26042646
26052647 refreshContents();
26062648 } else
2607
- if (event.getSource() == detachBumpItem)
2649
+ if (source == detachBumpItem)
26082650 {
26092651 Object3D obj;
26102652 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2615,7 +2657,7 @@
26152657
26162658 refreshContents();
26172659 } else
2618
- if (event.getSource() == pigmentBumpItem)
2660
+ if (source == pigmentBumpItem)
26192661 {
26202662 Object3D obj;
26212663 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2626,158 +2668,195 @@
26262668
26272669 refreshContents();
26282670 } else
2629
- if (event.getSource() == flashSelectionButton)
2671
+ if (source == flashSelectionButton)
26302672 {
26312673 CameraPane.flash = true;
26322674 refreshContents();
26332675 } else
2634
- if (event.getSource() == oneButton)
2676
+ if (source == oneButton)
26352677 {
26362678 } else
2637
- if (event.getSource() == twoButton)
2679
+ if (source == twoButton)
26382680 {
26392681 radio.layout = twoButton;
26402682 // bug
26412683 //gridPanel.setDividerLocation(1.0);
26422684 //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();
2685
+// bigThree.remove(scenePanel);
2686
+// bigThree.remove(centralPanel);
2687
+// bigThree.remove(XYZPanel);
2688
+// aWindowConstraints.gridx = 0;
2689
+// aWindowConstraints.gridy = 0;
2690
+// aWindowConstraints.gridwidth = 1;
2691
+// // aConstraints.gridheight = 3;
2692
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2693
+// aWindowConstraints.weightx = 0;
2694
+// aWindowConstraints.weighty = 1;
2695
+// //bigThree.add(jtp, aWindowConstraints);
2696
+// aWindowConstraints.weightx = 1;
2697
+// aWindowConstraints.gridwidth = 3;
2698
+// // aConstraints.gridheight = 3;
2699
+// aWindowConstraints.gridx = 1;
2700
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2701
+// bigThree.add(centralPanel, aWindowConstraints);
2702
+// aWindowConstraints.weightx = 0;
2703
+// aWindowConstraints.gridx = 4;
2704
+// aWindowConstraints.gridwidth = 1;
2705
+// // aConstraints.gridheight = 3;
2706
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2707
+// //bigThree.add(XYZPanel, aWindowConstraints);
2708
+// scenePanel.setVisible(false);
2709
+// centralPanel.setVisible(true);
2710
+// XYZPanel.setVisible(false);
2711
+ bigThree.ClearUI();
2712
+ bigThree.add(centralPanel);
2713
+ bigThree.FlushUI();
26672714 } else
2668
- if (event.getSource() == threeButton)
2715
+ if (source == threeButton)
26692716 {
26702717 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();
2718
+
2719
+// bigThree.remove(scenePanel);
2720
+// bigThree.remove(centralPanel);
2721
+// bigThree.remove(XYZPanel);
2722
+// aWindowConstraints.gridx = 0;
2723
+// aWindowConstraints.gridy = 0;
2724
+// aWindowConstraints.gridwidth = 1;
2725
+// // aConstraints.gridheight = 3;
2726
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2727
+// aWindowConstraints.weightx = 0;
2728
+// aWindowConstraints.weighty = 1;
2729
+// //bigThree.add(jtp, aWindowConstraints);
2730
+// aWindowConstraints.weightx = 1;
2731
+// aWindowConstraints.gridwidth = 3;
2732
+// // aConstraints.gridheight = 3;
2733
+// aWindowConstraints.gridx = 1;
2734
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2735
+// bigThree.add(centralPanel, aWindowConstraints);
2736
+// aWindowConstraints.weightx = 0;
2737
+// aWindowConstraints.gridx = 4;
2738
+// aWindowConstraints.gridwidth = 1;
2739
+// // aConstraints.gridheight = 3;
2740
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2741
+// bigThree.add(XYZPanel, aWindowConstraints);
2742
+// bigThree.validate();
2743
+// scenePanel.setVisible(false);
2744
+// centralPanel.setVisible(true);
2745
+// XYZPanel.setVisible(true);
2746
+ bigThree.ClearUI();
2747
+ bigThree.add(centralPanel);
2748
+ bigThree.add(XYZPanel);
2749
+ bigThree.FlushUI();
26952750 } else
2696
- if (event.getSource() == fourButton)
2751
+ if (source == fourButton)
26972752 {
26982753 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();
2754
+
2755
+// bigThree.remove(scenePanel);
2756
+// bigThree.remove(centralPanel);
2757
+// bigThree.remove(XYZPanel);
2758
+// aWindowConstraints.gridx = 0;
2759
+// aWindowConstraints.gridy = 0;
2760
+// aWindowConstraints.gridwidth = 1;
2761
+// // aWindowConstraints.gridheight = 3;
2762
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2763
+// aWindowConstraints.weightx = 1;
2764
+// aWindowConstraints.weighty = 1;
2765
+// bigThree.add(scenePanel, aWindowConstraints);
2766
+// aWindowConstraints.weightx = 1;
2767
+// aWindowConstraints.gridwidth = 3;
2768
+// // aConstraints.gridheight = 3;
2769
+// aWindowConstraints.gridx = 1;
2770
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2771
+// //bigThree.add(cameraPanel, aWindowConstraints);
2772
+// aWindowConstraints.weightx = 0;
2773
+// aWindowConstraints.gridx = 4;
2774
+// aWindowConstraints.gridwidth = 1;
2775
+// // aWindowConstraints.gridheight = 3;
2776
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2777
+// //bigThree.add(XYZPanel, aWindowConstraints);
2778
+// bigThree.validate();
2779
+// scenePanel.setVisible(true);
2780
+// centralPanel.setVisible(false);
2781
+// XYZPanel.setVisible(false);
2782
+ bigThree.ClearUI();
2783
+ bigThree.add(scenePanel);
2784
+ bigThree.FlushUI();
27232785 } else
2724
- if (event.getSource() == sixButton)
2786
+ if (source == sixButton)
27252787 {
27262788 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();
2789
+
2790
+// bigThree.remove(scenePanel);
2791
+// bigThree.remove(centralPanel);
2792
+// bigThree.remove(XYZPanel);
2793
+// aWindowConstraints.gridx = 0;
2794
+// aWindowConstraints.gridy = 0;
2795
+// aWindowConstraints.gridwidth = 1;
2796
+// // aConstraints.gridheight = 3;
2797
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2798
+// aWindowConstraints.weightx = 0;
2799
+// aWindowConstraints.weighty = 1;
2800
+// bigThree.add(scenePanel, aWindowConstraints);
2801
+// aWindowConstraints.weightx = 1;
2802
+// aWindowConstraints.gridwidth = 3;
2803
+// // aWindowConstraints.gridheight = 3;
2804
+// aWindowConstraints.gridx = 1;
2805
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2806
+// bigThree.add(centralPanel, aWindowConstraints);
2807
+// aWindowConstraints.weightx = 0;
2808
+// aWindowConstraints.gridx = 4;
2809
+// aWindowConstraints.gridwidth = 1;
2810
+// // aWindowConstraints.gridheight = 3;
2811
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2812
+// //bigThree.add(XYZPanel, aConstraints);
2813
+// bigThree.validate();
2814
+// scenePanel.setVisible(true);
2815
+// centralPanel.setVisible(true);
2816
+// XYZPanel.setVisible(false);
2817
+ bigThree.ClearUI();
2818
+ bigThree.add(scenePanel);
2819
+ bigThree.add(centralPanel);
2820
+ bigThree.FlushUI();
27512821 } else
2752
- if (event.getSource() == sevenButton)
2822
+ if (source == sevenButton)
27532823 {
27542824 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();
2825
+
2826
+// bigThree.remove(scenePanel);
2827
+// bigThree.remove(centralPanel);
2828
+// bigThree.remove(XYZPanel);
2829
+// aWindowConstraints.gridx = 0;
2830
+// aWindowConstraints.gridy = 0;
2831
+// aWindowConstraints.gridwidth = 1;
2832
+// // aWindowConstraints.gridheight = 3;
2833
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2834
+// aWindowConstraints.weightx = 0;
2835
+// aWindowConstraints.weighty = 1;
2836
+// bigThree.add(scenePanel, aWindowConstraints);
2837
+// aWindowConstraints.weightx = 1;
2838
+// aWindowConstraints.gridwidth = 3;
2839
+// // aWindowConstraints.gridheight = 3;
2840
+// aWindowConstraints.gridx = 1;
2841
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2842
+// bigThree.add(centralPanel, aWindowConstraints);
2843
+// aWindowConstraints.weightx = 0;
2844
+// aWindowConstraints.gridx = 4;
2845
+// aWindowConstraints.gridwidth = 1;
2846
+// // aConstraints.gridheight = 3;
2847
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2848
+// bigThree.add(XYZPanel, aWindowConstraints);
2849
+// bigThree.validate();
2850
+// scenePanel.setVisible(true);
2851
+// centralPanel.setVisible(true);
2852
+// XYZPanel.setVisible(true);
2853
+ bigThree.ClearUI();
2854
+ bigThree.add(scenePanel);
2855
+ bigThree.add(centralPanel);
2856
+ bigThree.add(XYZPanel);
2857
+ bigThree.FlushUI();
27792858 } else
2780
- if (event.getSource() == rootButton)
2859
+ if (source == rootButton)
27812860 {
27822861 Object3D obj;
27832862 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2789,7 +2868,7 @@
27892868
27902869 refreshContents(true);
27912870 } else
2792
- if (event.getSource() == closeButton)
2871
+ if (source == closeButton)
27932872 {
27942873 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27952874 cRadio ab;
....@@ -2810,11 +2889,11 @@
28102889 }
28112890 refreshContents(true);
28122891 } else
2813
- if (event.getSource() == editItem || event.getSource() == editButton)
2892
+ if (source == editItem || source == editButton)
28142893 {
28152894 EditSelection(false);
28162895 } else
2817
- if (event.getSource() == uneditButton)
2896
+ if (source == uneditButton)
28182897 {
28192898 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28202899 {
....@@ -2826,12 +2905,12 @@
28262905
28272906 child.editWindow = null; // ???????????
28282907 }
2829
- objEditor.ctrlPanel.revalidate();
2908
+ objEditor.ctrlPanel.validate();
28302909 //objEditor.jTree.clearSelection();
28312910 //objEditor.ResetSliders();
28322911 refreshContents(true);
28332912 } else
2834
- if (event.getSource() == clearPanelButton)
2913
+ if (source == clearPanelButton)
28352914 {
28362915 assert(copy == group);
28372916 //copy.ClearUI();
....@@ -2842,7 +2921,7 @@
28422921 listUI.clear();
28432922 refreshContents(true);
28442923 } else
2845
- if (event.getSource() == allParamsButton)
2924
+ if (source == allParamsButton)
28462925 {
28472926 assert(copy == group);
28482927
....@@ -2863,19 +2942,19 @@
28632942
28642943 refreshContents(true);
28652944 } else
2866
- if (event.getSource() == unselectButton)
2945
+ if (source == unselectButton)
28672946 {
28682947 objEditor.jTree.clearSelection();
28692948 // ?? oct 2012 GrafreeD.clipboard.clear();
28702949 objEditor.ResetSliders();
28712950 refreshContents(true);
28722951 } else
2873
- if(event.getSource() instanceof cRadio)
2952
+ if(source instanceof cRadio)
28742953 {
28752954 group.parent = keepparent;
28762955 group.attributes = 0;
28772956 //group.editWindow = null;
2878
- /*cRadio*/ radio = (cRadio)event.getSource();
2957
+ /*cRadio*/ radio = (cRadio)source;
28792958 Object3D obj = radio.GetObject();
28802959 System.out.println("Edit " + obj);
28812960 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2895,7 +2974,7 @@
28952974 }
28962975
28972976 copy = group;
2898
- //CameraPane.theRenderer.object = group;
2977
+ //Globals.theRenderer.object = group;
28992978 if(!useclient)
29002979 {
29012980 cameraView.renderCamera = radio.camera;
....@@ -2904,7 +2983,8 @@
29042983 cameraView.cameras[cameraView.cameracount] = radio.camera;
29052984 cameraView.targetLookAt.set(radio.camera.lookAt);
29062985 cameraView.object = group;
2907
- cameraView.lighttouched = true;
2986
+ //cameraView.lighttouched = true;
2987
+ Globals.lighttouched = true;
29082988 topView.object = group;
29092989 frontView.object = group;
29102990 sideView.object = group;
....@@ -2940,7 +3020,7 @@
29403020 if (useclient)
29413021 {
29423022 cameraView.object = client;
2943
- cameraView.lighttouched = true;
3023
+ Globals.lighttouched = true;
29443024 //topView.object = client;
29453025 //frontView.object = client;
29463026 //sideView.object = client;
....@@ -2948,7 +3028,7 @@
29483028 else
29493029 {
29503030 cameraView.object = group;
2951
- cameraView.lighttouched = true;
3031
+ Globals.lighttouched = true;
29523032 //topView.object = group;
29533033 //frontView.object = group;
29543034 //sideView.object = group;
....@@ -3456,7 +3536,7 @@
34563536 String pigment = Object3D.GetPigment(tex);
34573537 //String bump = Object3D.GetBump(tex);
34583538
3459
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3539
+ com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
34603540
34613541 double s = v.s;
34623542
....@@ -3757,7 +3837,7 @@
37573837 group.selection.RelinkToSupport(); // july 2014
37583838 System.out.println("DONE.");
37593839 refreshContents();
3760
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
3840
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
37613841 }
37623842
37633843 void ReduceMesh(boolean reduction34)
....@@ -4042,16 +4122,16 @@
40424122
40434123 objEditor.SetText(); // jan 2014
40444124
4045
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4125
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
40464126 CameraPane.flash = true;
40474127
40484128 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
40494129 // a camera
40504130 {
40514131 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;
4132
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4133
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4134
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40554135 }
40564136
40574137 refreshContents();
....@@ -5009,6 +5089,7 @@
50095089
50105090 private MenuItem resetParentItem;
50115091 private MenuItem repairParentItem;
5092
+ private MenuItem repairShadowItem;
50125093 private MenuItem sortbysizeItem;
50135094 private MenuItem sortbynameItem;
50145095