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,29 +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);
523
- oe.aConstraints.gridx += 1;
524
- oe.aConstraints.weighty = 0;
525
- oe.aConstraints.gridwidth = 1;
526467
527
- //
528
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
468
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
469
+
470
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
471
+ twoButton.setToolTipText("Show center view only");
529472 twoButton.addActionListener(this);
530
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
473
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
531474 fourButton.addActionListener(this);
532
- 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");
533478 sixButton.addActionListener(this);
534
- 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");
535481 threeButton.addActionListener(this);
536
- 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");
537484 sevenButton.addActionListener(this);
538485 //
539486
540
- 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");
541489 rootButton.addActionListener(this);
542490 oe.aConstraints.gridx += 1;
543
- 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");
544493 closeButton.addActionListener(this);
545494 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
546495 //clearButton.addActionListener(this);
....@@ -643,17 +592,91 @@
643592 radio.layout = sevenButton;
644593 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
645594 }
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
+ }
646669
647670 void EditObject(Object3D obj)
648671 {
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();
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();
657680 }
658681 void SetupViews(ObjEditor oe)
659682 {
....@@ -673,6 +696,7 @@
673696 JCheckBox fastCB;
674697 JCheckBox slowCB;
675698 JCheckBox boxCB;
699
+ JCheckBox zoomBoxCB;
676700 JCheckBox trackCB;
677701 JCheckBox smoothfocusCB;
678702 // JCheckBox speakerMocapCB;
....@@ -715,8 +739,7 @@
715739 dropAttributes |= Object3D.TEXTURE;
716740 else
717741 dropAttributes &= ~Object3D.TEXTURE;
718
- }
719
- else if(e.getSource() == liveCB)
742
+ } else if(e.getSource() == liveCB)
720743 {
721744 cameraView.ToggleLive();
722745 }
....@@ -753,6 +776,10 @@
753776 Recompile();
754777 cameraView.repaint();
755778 // refreshContents();
779
+ }
780
+ else if(e.getSource() == zoomBoxCB)
781
+ {
782
+ cameraView.ToggleZoomBoxMode();
756783 }
757784 else if(e.getSource() == smoothfocusCB)
758785 {
....@@ -1118,6 +1145,8 @@
11181145 resetParentItem.addActionListener(this);
11191146 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11201147 repairParentItem.addActionListener(this);
1148
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1149
+ repairShadowItem.addActionListener(this);
11211150 menu.add(invariantsItem = new MenuItem("Invariants"));
11221151 invariantsItem.addActionListener(this);
11231152 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1478,6 +1507,7 @@
14781507 //
14791508 public void actionPerformed(ActionEvent event) // , Object arg)
14801509 {
1510
+ Object source = event.getSource();
14811511 /*
14821512 if (event.getSource() == nameField)
14831513 {
....@@ -1489,11 +1519,11 @@
14891519 }
14901520 else
14911521 */
1492
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1522
+ if (source == lookAtItem || source == lookFromItem)
14931523 {
14941524 ScreenFit();
14951525 } else
1496
- if (event.getSource() == switchItem)
1526
+ if (source == switchItem)
14971527 {
14981528 cVector v1 = new cVector();
14991529 cVector v2 = new cVector();
....@@ -1502,11 +1532,11 @@
15021532 objEditor.cameraView.renderCamera.setAim(v2, v1);
15031533 objEditor.cameraView.repaint();
15041534 } else
1505
- if (event.getSource() == rectoidItem)
1535
+ if (source == rectoidItem)
15061536 {
15071537 makeSomething(new Box());
15081538 } else
1509
- if (event.getSource() == particleItem)
1539
+ if (source == particleItem)
15101540 {
15111541 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15121542 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1527,9 +1557,9 @@
15271557 applyExample(particleGeom, "SMOKE");
15281558 makeSomething(particleGeom);
15291559 } else
1530
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1560
+ if (source == ragdollItem || source == ragdoll2Item)
15311561 {
1532
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1562
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15331563
15341564 ragdoll.toParent = LA.newMatrix();
15351565 ragdoll.fromParent = LA.newMatrix();
....@@ -1547,7 +1577,7 @@
15471577 } else
15481578 /*
15491579 */
1550
- if (event.getSource() == heightFieldItem)
1580
+ if (source == heightFieldItem)
15511581 {
15521582 Object3D obj = new Object3D();
15531583
....@@ -1585,31 +1615,31 @@
15851615
15861616 makeSomething(obj);
15871617 } else
1588
- if (event.getSource() == gridItem)
1618
+ if (source == gridItem)
15891619 {
15901620 makeSomething(new Grid());
15911621 } else
1592
- if (event.getSource() == ellipsoidItem)
1622
+ if (source == ellipsoidItem)
15931623 {
15941624 makeSomething(new Sphere());
15951625 } else
1596
- if (event.getSource() == coneItem)
1626
+ if (source == coneItem)
15971627 {
15981628 makeSomething(new Cone());
15991629 } else
1600
- if (event.getSource() == torusItem)
1630
+ if (source == torusItem)
16011631 {
16021632 makeSomething(new Torus());
16031633 } else
1604
- if (event.getSource() == superItem)
1634
+ if (source == superItem)
16051635 {
16061636 makeSomething(new Superellipsoid());
16071637 } else
1608
- if (event.getSource() == kleinItem)
1638
+ if (source == kleinItem)
16091639 {
16101640 makeSomething(new Klein());
16111641 } else
1612
- if (event.getSource() == blobItem)
1642
+ if (source == blobItem)
16131643 {
16141644 Blob blob = new Blob();
16151645 BlobComponent comp = new BlobComponent();
....@@ -1617,15 +1647,15 @@
16171647 //blob.retile();
16181648 makeSomething(blob);
16191649 } else
1620
- if (event.getSource() == latheItem)
1650
+ if (source == latheItem)
16211651 {
16221652 makeSomething(new Lathe());
16231653 } else
1624
- if (event.getSource() == bezierItem)
1654
+ if (source == bezierItem)
16251655 {
16261656 makeSomething(new BezierSurface());
16271657 } else
1628
- if (event.getSource() == checkerItem)
1658
+ if (source == checkerItem)
16291659 {
16301660 /*
16311661 Object3D obj = new BezierSurface(5,8);
....@@ -1640,7 +1670,7 @@
16401670 */
16411671 makeSomething(new Checker());
16421672 } else
1643
- if (event.getSource() == meshItem)
1673
+ if (source == meshItem)
16441674 {
16451675 Object3D itemtomake = new Object3D();
16461676 Object3D child;
....@@ -1661,35 +1691,35 @@
16611691 makeSomething(child);
16621692 }
16631693 } else
1664
- if (event.getSource() == springItem)
1694
+ if (source == springItem)
16651695 {
16661696 cSpring s = new cSpring();
16671697 s.setup();
16681698 makeSomething(s);
16691699 } else
1670
- if (event.getSource() == flagItem)
1700
+ if (source == flagItem)
16711701 {
16721702 cSpring s = new cFlag();
16731703 s.setup();
16741704 makeSomething(s);
16751705 } else
1676
- if (event.getSource() == lightItem)
1706
+ if (source == lightItem)
16771707 {
16781708 makeSomething(new Light());
16791709 } else
1680
- if (event.getSource() == csgItem)
1710
+ if (source == csgItem)
16811711 {
16821712 group(new CSG());
16831713 } else
1684
- if (event.getSource() == templateItem)
1714
+ if (source == templateItem)
16851715 {
16861716 group(new cTemplate());
16871717 } else
1688
- if (event.getSource() == attributeItem)
1718
+ if (source == attributeItem)
16891719 {
16901720 makeSomething(new Attribute());
16911721 } else
1692
- if (event.getSource() == pointflowItem)
1722
+ if (source == pointflowItem)
16931723 {
16941724 makeSomething(new PointFlow());
16951725 } else
....@@ -1701,7 +1731,7 @@
17011731 } else
17021732 */
17031733
1704
- if (event.getSource() == superLoopItem)
1734
+ if (source == superLoopItem)
17051735 {
17061736 Composite g = new cGroup();
17071737 for (int i=0; i<15; i++)
....@@ -1723,7 +1753,7 @@
17231753
17241754 group(g);
17251755 } else
1726
- if (event.getSource() == loopItem)
1756
+ if (source == loopItem)
17271757 {
17281758 Composite csg = new GroupLeaf();
17291759 csg.count = 5;
....@@ -1732,7 +1762,7 @@
17321762 csg.addChild(child);
17331763 child.addChild(csg);
17341764 } else
1735
- if (event.getSource() == doubleItem)
1765
+ if (source == doubleItem)
17361766 {
17371767 Composite csg = new GroupLeaf();
17381768 csg.count = 5;
....@@ -1744,7 +1774,7 @@
17441774 csg.addChild(child);
17451775 child.addChild(csg);
17461776 } else
1747
- if (event.getSource() == tripleItem)
1777
+ if (source == tripleItem)
17481778 {
17491779 Composite csg = new GroupLeaf();
17501780 csg.count = 4;
....@@ -1760,70 +1790,70 @@
17601790 child.addChild(csg);
17611791 } else
17621792
1763
- if (event.getSource() == importGFDItem)
1793
+ if (source == importGFDItem)
17641794 {
17651795 ImportGFD();
17661796 } else
1767
- if (event.getSource() == importVRMLX3DItem)
1797
+ if (source == importVRMLX3DItem)
17681798 {
17691799 ImportVRMLX3D();
17701800 } else
1771
- if (event.getSource() == import3DSItem)
1801
+ if (source == import3DSItem)
17721802 {
17731803 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17741804 } else
1775
- if (event.getSource() == importOBJItem)
1805
+ if (source == importOBJItem)
17761806 {
17771807 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
17781808 } else
1779
- if (event.getSource() == computeAOItem)
1809
+ if (source == computeAOItem)
17801810 {
1781
- CameraPane.drawMode = CameraPane.OCCLUSION;
1782
- CameraPane.theRenderer.repaint();
1811
+ Globals.drawMode = CameraPane.OCCLUSION;
1812
+ Globals.theRenderer.repaint();
17831813 } else
1784
- if (event.getSource() == recompileItem)
1814
+ if (source == recompileItem)
17851815 {
17861816 Recompile();
17871817 refreshContents();
17881818 } else
1789
- if (event.getSource() == editScriptItem)
1819
+ if (source == editScriptItem)
17901820 {
17911821 OpenDialog();
17921822 refreshContents();
17931823 } else
1794
- if (event.getSource() == invariantsItem)
1824
+ if (source == invariantsItem)
17951825 {
17961826 System.out.println("Invariants:");
17971827 GrafreeD.grafreeD.universe.invariants();
17981828 } else
1799
- if (event.getSource() == memoryItem)
1829
+ if (source == memoryItem)
18001830 {
18011831 //System.out.println("Invariants:");
18021832 PrintMemory();
18031833 } else
1804
- if (event.getSource() == pathItem)
1834
+ if (source == pathItem)
18051835 {
18061836 PrintPath();
18071837 } else
1808
- if (event.getSource() == analyzeItem)
1838
+ if (source == analyzeItem)
18091839 {
18101840 AnalyzeObject();
18111841 } else
1812
- if (event.getSource() == dumpItem)
1842
+ if (source == dumpItem)
18131843 {
18141844 DumpObject();
18151845 } else
1816
- if (event.getSource() == screenfitButton)
1846
+ if (source == screenfitButton)
18171847 {
18181848 //Reload(lastConverter, lastFilename, true);
18191849 ScreenFit();
18201850 } else
1821
- if (event.getSource() == screenfitpointButton)
1851
+ if (source == screenfitpointButton)
18221852 {
18231853 //Reload(lastConverter, lastFilename, true);
18241854 ScreenFitPoint();
18251855 } else
1826
- if (event.getSource() == snapobjectButton)
1856
+ if (source == snapobjectButton)
18271857 {
18281858 //Reload(lastConverter, lastFilename, true);
18291859 SnapObject();
....@@ -1834,13 +1864,13 @@
18341864 // Recompile();
18351865 // refreshContents();
18361866 // } else
1837
- if (event.getSource() == gcButton)
1867
+ if (source == gcButton)
18381868 {
18391869 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18401870 System.gc();
18411871 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18421872 } else
1843
- if (event.getSource() == editLeafItem)
1873
+ if (source == editLeafItem)
18441874 {
18451875 Object3D obj;
18461876 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1854,62 +1884,62 @@
18541884 }
18551885 refreshContents(true);
18561886 } else
1857
- if (event.getSource() == openWindowItem)
1887
+ if (source == openWindowItem)
18581888 {
18591889 EditSelection(true);
18601890 } else
1861
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1891
+ if (source == cutItem || source == clearButton)
18621892 {
18631893 loadClipboard(true);
18641894 } else
1865
- if (event.getSource() == duplicateItem)
1895
+ if (source == duplicateItem)
18661896 {
18671897 Object3D keep = GrafreeD.clipboard;
18681898 loadClipboard(false);
18691899 paste(false);
18701900 GrafreeD.clipboard = keep;
18711901 } else
1872
- if (event.getSource() == cloneItem)
1902
+ if (source == cloneItem)
18731903 {
18741904 CloneSelection(false);
18751905 } else
1876
- if (event.getSource() == cloneSupportItem)
1906
+ if (source == cloneSupportItem)
18771907 {
18781908 CloneSelection(true);
18791909 } else
1880
- if (event.getSource() == copyItem)
1910
+ if (source == copyItem)
18811911 {
18821912 loadClipboard(false);
18831913 } else
1884
- if (event.getSource() == pasteItem)
1914
+ if (source == pasteItem)
18851915 {
18861916 paste(false);
18871917 } else
1888
- if (event.getSource() == pasteLinkItem)
1918
+ if (source == pasteLinkItem)
18891919 {
18901920 pasteInto(false);
18911921 } else
1892
- if (event.getSource() == pasteCloneItem)
1922
+ if (source == pasteCloneItem)
18931923 {
18941924 pasteInto(true);
18951925 } else
1896
- if (event.getSource() == pasteExpandItem)
1926
+ if (source == pasteExpandItem)
18971927 {
18981928 paste(true);
18991929 } else
1900
- if (event.getSource() == synchronizeItem)
1930
+ if (source == synchronizeItem)
19011931 {
19021932 Overwrite(Object3D.TRANSFORM);
19031933 } else
1904
- if (event.getSource() == overwriteNameItem)
1934
+ if (source == overwriteNameItem)
19051935 {
19061936 Overwrite(Object3D.NAME);
19071937 } else
1908
- if (event.getSource() == overwriteUVItem)
1938
+ if (source == overwriteUVItem)
19091939 {
19101940 Overwrite(Object3D.UV);
19111941 } else
1912
- if (event.getSource() == overwriteMatItem)
1942
+ if (source == overwriteMatItem)
19131943 {
19141944 /* july 2015
19151945 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1929,7 +1959,7 @@
19291959
19301960 Overwrite(dropAttributes);
19311961 }
1932
- if (event.getSource() == overwriteGeoItem)
1962
+ if (source == overwriteGeoItem)
19331963 {
19341964 Overwrite(Object3D.GEOMETRY);
19351965 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1946,7 +1976,7 @@
19461976 // refreshContents();
19471977 // }
19481978 } else
1949
- if (event.getSource() == generateMeshItem)
1979
+ if (source == generateMeshItem)
19501980 {
19511981 //if (group.selection.size() == 1)
19521982 // for (int i=0; i<group.selection.size(); i++)
....@@ -1957,7 +1987,7 @@
19571987 ResetModel();
19581988 refreshContents();
19591989 } else
1960
- if (event.getSource() == extractGeometriesItem)
1990
+ if (source == extractGeometriesItem)
19611991 {
19621992 boolean one = false;
19631993
....@@ -1984,7 +2014,7 @@
19842014 ResetModel();
19852015 refreshContents();
19862016 } else
1987
- if (event.getSource() == cloneGeometriesItem)
2017
+ if (source == cloneGeometriesItem)
19882018 {
19892019 boolean one = false;
19902020
....@@ -2010,7 +2040,7 @@
20102040 ResetModel();
20112041 refreshContents();
20122042 } else
2013
- if (event.getSource() == shareGeometriesItem)
2043
+ if (source == shareGeometriesItem)
20142044 {
20152045 boolean one = false;
20162046
....@@ -2040,7 +2070,7 @@
20402070 refreshContents();
20412071 }
20422072 } else
2043
- if (event.getSource() == mergeGeometriesItem)
2073
+ if (source == mergeGeometriesItem)
20442074 {
20452075 boolean one = false;
20462076
....@@ -2070,7 +2100,7 @@
20702100 ResetModel();
20712101 refreshContents();
20722102 } else
2073
- if (event.getSource() == linkverticesItem)
2103
+ if (source == linkverticesItem)
20742104 {
20752105 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20762106 // {
....@@ -2090,7 +2120,7 @@
20902120 if (content instanceof cGroup && ((cGroup)content).transientlink )
20912121 content = ((cGroup)content).get(0);
20922122
2093
- 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));
20942124 for (int i=0; i<group.selection.size(); i++)
20952125 {
20962126 boolean random = CameraPane.RANDOM;
....@@ -2099,11 +2129,11 @@
20992129 // group.selection.get(i).setMasterThis(content); // should be identity
21002130 CameraPane.RANDOM = random;
21012131 }
2102
- 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));
21032133 refreshContents();
21042134 }
21052135 } else
2106
- if (event.getSource() == resetsupportItem)
2136
+ if (source == resetsupportItem)
21072137 {
21082138 for (int i=0; i<group.selection.size(); i++)
21092139 {
....@@ -2115,7 +2145,7 @@
21152145
21162146 refreshContents();
21172147 } else
2118
- if (event.getSource() == relinkverticesItem)
2148
+ if (source == relinkverticesItem)
21192149 {
21202150 boolean random = CameraPane.RANDOM;
21212151 CameraPane.RANDOM = false; // parse all random nodes
....@@ -2124,7 +2154,7 @@
21242154
21252155 refreshContents();
21262156 } else
2127
- if (event.getSource() == resetreferencesItem)
2157
+ if (source == resetreferencesItem)
21282158 {
21292159 for (int i=0; i<group.selection.size(); i++)
21302160 {
....@@ -2133,7 +2163,7 @@
21332163
21342164 refreshContents();
21352165 } else
2136
- if (event.getSource() == setMasterItem)
2166
+ if (source == setMasterItem)
21372167 {
21382168 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21392169 {
....@@ -2146,7 +2176,7 @@
21462176 refreshContents();
21472177 }
21482178 } else
2149
- if (event.getSource() == poseMeshItem)
2179
+ if (source == poseMeshItem)
21502180 {
21512181 if (group.selection.size() == 1)
21522182 {
....@@ -2165,19 +2195,19 @@
21652195 }
21662196
21672197 } else
2168
- if (event.getSource() == revertMeshItem)
2198
+ if (source == revertMeshItem)
21692199 {
21702200 RevertMeshes();
21712201 } else
2172
- if (event.getSource() == resetMeshItem)
2202
+ if (source == resetMeshItem)
21732203 {
21742204 ResetAll();
21752205 } else
2176
- if (event.getSource() == stepAllItem)
2206
+ if (source == stepAllItem)
21772207 {
21782208 StepAll();
21792209 } else
2180
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2210
+ if (source == clearItem) // || event.getSource() == clearButton)
21812211 {
21822212 //int indices[] = jList.getSelectedIndices();
21832213 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2185,46 +2215,46 @@
21852215
21862216 ClearSelection(false);
21872217 } else
2188
- if (event.getSource() == clearAllItem)
2218
+ if (source == clearAllItem)
21892219 {
21902220 ClearSelection(true);
21912221 } else
2192
- if (event.getSource() == grabItem)
2222
+ if (source == grabItem)
21932223 {
21942224 group(new cGroup(), true);
21952225 } else
2196
- if (event.getSource() == hideItem)
2226
+ if (source == hideItem)
21972227 {
21982228 group(new HiddenObject());
21992229 } else
2200
- if (event.getSource() == frontItem)
2230
+ if (source == frontItem)
22012231 {
22022232 front();
22032233 } else
2204
- if (event.getSource() == backItem)
2234
+ if (source == backItem)
22052235 {
22062236 back();
22072237 } else
2208
- if (event.getSource() == cameraItem)
2238
+ if (source == cameraItem)
22092239 {
22102240 makeSomething(new Camera());
22112241 } else
2212
- if (event.getSource() == compositeItem)
2242
+ if (source == compositeItem)
22132243 {
22142244 group(new Composite());
22152245 } else
2216
- if (event.getSource() == randomItem)
2246
+ if (source == randomItem)
22172247 {
22182248 RandomNode random = new RandomNode();
22192249 group(random);
22202250 if (random.size() > 0)
22212251 random.name = random.get(0).name + "Rnd";
22222252 } else
2223
- if (event.getSource() == physicsItem)
2253
+ if (source == physicsItem)
22242254 {
22252255 group(new PhysicsNode());
22262256 } else
2227
- if (event.getSource() == frameselectorItem)
2257
+ if (source == frameselectorItem)
22282258 {
22292259 for (int i=0; i<group.selection.size(); i++)
22302260 {
....@@ -2236,7 +2266,7 @@
22362266 ResetModel();
22372267 refreshContents();
22382268 } else
2239
- if (event.getSource() == switchGeoItem)
2269
+ if (source == switchGeoItem)
22402270 {
22412271 for (int i=0; i<group.selection.size(); i++)
22422272 {
....@@ -2248,7 +2278,7 @@
22482278 ResetModel();
22492279 refreshContents();
22502280 } else
2251
- if (event.getSource() == switchTransfoItem)
2281
+ if (source == switchTransfoItem)
22522282 {
22532283 for (int i=0; i<group.selection.size(); i++)
22542284 {
....@@ -2260,7 +2290,7 @@
22602290 ResetModel();
22612291 refreshContents();
22622292 } else
2263
- if (event.getSource() == morphItem)
2293
+ if (source == morphItem)
22642294 {
22652295 for (int i=0; i<group.selection.size(); i++)
22662296 {
....@@ -2272,7 +2302,7 @@
22722302 ResetModel();
22732303 refreshContents();
22742304 } else
2275
- if (event.getSource() == scriptNodeItem)
2305
+ if (source == scriptNodeItem)
22762306 {
22772307 boolean atleastone = false;
22782308
....@@ -2311,31 +2341,31 @@
23112341 }
23122342 }
23132343 } else
2314
- if (event.getSource() == linkerItem)
2344
+ if (source == linkerItem)
23152345 {
23162346 group(new cLinker());
23172347 } else
2318
- if (event.getSource() == textureItem)
2348
+ if (source == textureItem)
23192349 {
23202350 group(new TextureNode());
23212351 } else
2322
- if (event.getSource() == billboardItem)
2352
+ if (source == billboardItem)
23232353 {
23242354 group(new BillboardNode());
23252355 } else
2326
- if (event.getSource() == shadowXItem)
2356
+ if (source == shadowXItem)
23272357 {
23282358 CastShadow(0);
23292359 } else
2330
- if (event.getSource() == shadowYItem)
2360
+ if (source == shadowYItem)
23312361 {
23322362 CastShadow(1);
23332363 } else
2334
- if (event.getSource() == shadowZItem)
2364
+ if (source == shadowZItem)
23352365 {
23362366 CastShadow(2);
23372367 } else
2338
- if (event.getSource() == ungroupItem)
2368
+ if (source == ungroupItem)
23392369 {
23402370 //ungroup();
23412371 for (int i=0; i<group.selection.size(); i++)
....@@ -2347,179 +2377,179 @@
23472377
23482378 refreshContents();
23492379 } else
2350
- if (event.getSource() == genUVItem)
2380
+ if (source == genUVItem)
23512381 {
23522382 GenUV();
23532383 } else
2354
- if (event.getSource() == genNormalsCADItem)
2384
+ if (source == genNormalsCADItem)
23552385 {
23562386 GenNormals(true);
23572387 } else
2358
- if (event.getSource() == genNormalsMESHItem)
2388
+ if (source == genNormalsMESHItem)
23592389 {
23602390 GenNormals(true); // TODO
23612391 } else
2362
- if (event.getSource() == genNormalsORGANItem)
2392
+ if (source == genNormalsORGANItem)
23632393 {
23642394 GenNormals(false);
23652395 } else
2366
- if (event.getSource() == genNormalsMINEItem)
2396
+ if (source == genNormalsMINEItem)
23672397 {
23682398 GenNormalsMINE();
23692399 } else
2370
- if (event.getSource() == stripifyItem)
2400
+ if (source == stripifyItem)
23712401 {
23722402 Stripify();
23732403 } else
2374
- if (event.getSource() == unstripifyItem)
2404
+ if (source == unstripifyItem)
23752405 {
23762406 Unstripify();
23772407 } else
2378
- if (event.getSource() == trimItem)
2408
+ if (source == trimItem)
23792409 {
23802410 Trim();
23812411 } else
2382
- if (event.getSource() == untrimItem)
2412
+ if (source == untrimItem)
23832413 {
23842414 Untrim();
23852415 } else
2386
- if (event.getSource() == clearColorsItem)
2416
+ if (source == clearColorsItem)
23872417 {
23882418 ClearColors();
23892419 } else
2390
- if (event.getSource() == clearMaterialsItem)
2420
+ if (source == clearMaterialsItem)
23912421 {
23922422 ClearMaterials();
23932423 } else
2394
- if (event.getSource() == liveleavesItem)
2424
+ if (source == liveleavesItem)
23952425 {
23962426 LiveLeaves(true);
23972427 } else
2398
- if (event.getSource() == unliveleavesItem)
2428
+ if (source == unliveleavesItem)
23992429 {
24002430 LiveLeaves(false);
24012431 } else
2402
- if (event.getSource() == supportleavesItem)
2432
+ if (source == supportleavesItem)
24032433 {
24042434 SupportLeaves(true);
24052435 } else
2406
- if (event.getSource() == unsupportleavesItem)
2436
+ if (source == unsupportleavesItem)
24072437 {
24082438 SupportLeaves(false);
24092439 } else
2410
- if (event.getSource() == hideleavesItem)
2440
+ if (source == hideleavesItem)
24112441 {
24122442 HideLeaves(true);
24132443 } else
2414
- if (event.getSource() == showleavesItem)
2444
+ if (source == showleavesItem)
24152445 {
24162446 HideLeaves(false);
24172447 } else
2418
- if (event.getSource() == markleavesItem)
2448
+ if (source == markleavesItem)
24192449 {
24202450 MarkLeaves(true);
24212451 } else
2422
- if (event.getSource() == unmarkleavesItem)
2452
+ if (source == unmarkleavesItem)
24232453 {
24242454 MarkLeaves(false);
24252455 } else
2426
- if (event.getSource() == flipVItem)
2456
+ if (source == flipVItem)
24272457 {
24282458 FlipV(true);
24292459 } else
2430
- if (event.getSource() == unflipVItem)
2460
+ if (source == unflipVItem)
24312461 {
24322462 FlipV(false);
24332463 } else
2434
- if (event.getSource() == lowTexturesItem)
2464
+ if (source == lowTexturesItem)
24352465 {
24362466 SetTexRes(0);
24372467 } else
2438
- if (event.getSource() == normalTexturesItem)
2468
+ if (source == normalTexturesItem)
24392469 {
24402470 SetTexRes(1);
24412471 } else
2442
- if (event.getSource() == highTexturesItem)
2472
+ if (source == highTexturesItem)
24432473 {
24442474 SetTexRes(2);
24452475 } else
2446
- if (event.getSource() == veryhighTexturesItem)
2476
+ if (source == veryhighTexturesItem)
24472477 {
24482478 SetTexRes(3);
24492479 } else
2450
- if (event.getSource() == maxTexturesItem)
2480
+ if (source == maxTexturesItem)
24512481 {
24522482 SetTexRes(4);
24532483 } else
2454
- if (event.getSource() == panoTexturesItem)
2484
+ if (source == panoTexturesItem)
24552485 {
24562486 SetTexRes(5);
24572487 } else
2458
- if (event.getSource() == reverseNormalsItem)
2488
+ if (source == reverseNormalsItem)
24592489 {
24602490 ReverseNormals();
24612491 } else
2462
- if (event.getSource() == parseverticesItem)
2492
+ if (source == parseverticesItem)
24632493 {
24642494 ParseVertices();
24652495 } else
2466
- if (event.getSource() == textureFieldItem)
2496
+ if (source == textureFieldItem)
24672497 {
24682498 TextureVertices();
24692499 } else
2470
- if (event.getSource() == alignItem)
2500
+ if (source == alignItem)
24712501 {
24722502 Align();
24732503 } else
2474
- if (event.getSource() == mirrorItem)
2504
+ if (source == mirrorItem)
24752505 {
24762506 MirrorPoses();
24772507 } else
2478
- if (event.getSource() == reduceMorphItem)
2508
+ if (source == reduceMorphItem)
24792509 {
24802510 MeshReduction(false);
24812511 } else
2482
- if (event.getSource() == reduce34MorphItem)
2512
+ if (source == reduce34MorphItem)
24832513 {
24842514 MeshReduction(true);
24852515 } else
2486
- if (event.getSource() == reverseTrianglesItem)
2516
+ if (source == reverseTrianglesItem)
24872517 {
24882518 ReverseTriangles();
24892519 } else
2490
- if (event.getSource() == reduceMeshItem)
2520
+ if (source == reduceMeshItem)
24912521 {
24922522 ReduceMesh(false);
24932523 } else
2494
- if (event.getSource() == reduce34MeshItem)
2524
+ if (source == reduce34MeshItem)
24952525 {
24962526 ReduceMesh(true);
24972527 } else
2498
- if (event.getSource() == increaseMeshItem)
2528
+ if (source == increaseMeshItem)
24992529 {
25002530 IncreaseMesh();
25012531 } else
2502
- if (event.getSource() == clipMeshItem)
2532
+ if (source == clipMeshItem)
25032533 {
25042534 ClipMesh();
25052535 } else
2506
- if (event.getSource() == smoothMeshItem)
2536
+ if (source == smoothMeshItem)
25072537 {
25082538 SmoothMesh();
25092539 } else
2510
- if (event.getSource() == transformgeometryItem)
2540
+ if (source == transformgeometryItem)
25112541 {
25122542 TransformGeometry();
25132543 } else
2514
- if (event.getSource() == resetTransformItem)
2544
+ if (source == resetTransformItem)
25152545 {
25162546 ResetTransform();
25172547 } else
2518
- if (event.getSource() == resetCentroidItem)
2548
+ if (source == resetCentroidItem)
25192549 {
25202550 ResetCentroid();
25212551 } else
2522
- if (event.getSource() == resetParentItem)
2552
+ if (source == resetParentItem)
25232553 {
25242554 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25252555 {
....@@ -2529,7 +2559,7 @@
25292559
25302560 refreshContents();
25312561 } else
2532
- if (event.getSource() == repairParentItem)
2562
+ if (source == repairParentItem)
25332563 {
25342564 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25352565 {
....@@ -2543,7 +2573,21 @@
25432573
25442574 refreshContents();
25452575 } else
2546
- 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)
25472591 {
25482592 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25492593 {
....@@ -2555,7 +2599,7 @@
25552599 ResetModel();
25562600 refreshContents();
25572601 } else
2558
- if (event.getSource() == sortbynameItem)
2602
+ if (source == sortbynameItem)
25592603 {
25602604 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25612605 {
....@@ -2567,7 +2611,7 @@
25672611 ResetModel();
25682612 refreshContents();
25692613 } else
2570
- if (event.getSource() == attachPigmentItem)
2614
+ if (source == attachPigmentItem)
25712615 {
25722616 String texture = GetFile("Attach pigment");
25732617 Object3D obj;
....@@ -2579,7 +2623,7 @@
25792623
25802624 refreshContents();
25812625 } else
2582
- if (event.getSource() == detachPigmentItem)
2626
+ if (source == detachPigmentItem)
25832627 {
25842628 Object3D obj;
25852629 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2590,7 +2634,7 @@
25902634
25912635 refreshContents();
25922636 } else
2593
- if (event.getSource() == attachBumpItem)
2637
+ if (source == attachBumpItem)
25942638 {
25952639 String texture = GetFile("Attach bump");
25962640 Object3D obj;
....@@ -2602,7 +2646,7 @@
26022646
26032647 refreshContents();
26042648 } else
2605
- if (event.getSource() == detachBumpItem)
2649
+ if (source == detachBumpItem)
26062650 {
26072651 Object3D obj;
26082652 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2613,7 +2657,7 @@
26132657
26142658 refreshContents();
26152659 } else
2616
- if (event.getSource() == pigmentBumpItem)
2660
+ if (source == pigmentBumpItem)
26172661 {
26182662 Object3D obj;
26192663 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2624,158 +2668,195 @@
26242668
26252669 refreshContents();
26262670 } else
2627
- if (event.getSource() == flashSelectionButton)
2671
+ if (source == flashSelectionButton)
26282672 {
26292673 CameraPane.flash = true;
26302674 refreshContents();
26312675 } else
2632
- if (event.getSource() == oneButton)
2676
+ if (source == oneButton)
26332677 {
26342678 } else
2635
- if (event.getSource() == twoButton)
2679
+ if (source == twoButton)
26362680 {
26372681 radio.layout = twoButton;
26382682 // bug
26392683 //gridPanel.setDividerLocation(1.0);
26402684 //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();
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();
26652714 } else
2666
- if (event.getSource() == threeButton)
2715
+ if (source == threeButton)
26672716 {
26682717 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();
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();
26932750 } else
2694
- if (event.getSource() == fourButton)
2751
+ if (source == fourButton)
26952752 {
26962753 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();
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();
27212785 } else
2722
- if (event.getSource() == sixButton)
2786
+ if (source == sixButton)
27232787 {
27242788 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();
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();
27492821 } else
2750
- if (event.getSource() == sevenButton)
2822
+ if (source == sevenButton)
27512823 {
27522824 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();
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();
27772858 } else
2778
- if (event.getSource() == rootButton)
2859
+ if (source == rootButton)
27792860 {
27802861 Object3D obj;
27812862 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2787,7 +2868,7 @@
27872868
27882869 refreshContents(true);
27892870 } else
2790
- if (event.getSource() == closeButton)
2871
+ if (source == closeButton)
27912872 {
27922873 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27932874 cRadio ab;
....@@ -2808,11 +2889,11 @@
28082889 }
28092890 refreshContents(true);
28102891 } else
2811
- if (event.getSource() == editItem || event.getSource() == editButton)
2892
+ if (source == editItem || source == editButton)
28122893 {
28132894 EditSelection(false);
28142895 } else
2815
- if (event.getSource() == uneditButton)
2896
+ if (source == uneditButton)
28162897 {
28172898 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28182899 {
....@@ -2824,12 +2905,12 @@
28242905
28252906 child.editWindow = null; // ???????????
28262907 }
2827
- objEditor.ctrlPanel.revalidate();
2908
+ objEditor.ctrlPanel.validate();
28282909 //objEditor.jTree.clearSelection();
28292910 //objEditor.ResetSliders();
28302911 refreshContents(true);
28312912 } else
2832
- if (event.getSource() == clearPanelButton)
2913
+ if (source == clearPanelButton)
28332914 {
28342915 assert(copy == group);
28352916 //copy.ClearUI();
....@@ -2840,7 +2921,7 @@
28402921 listUI.clear();
28412922 refreshContents(true);
28422923 } else
2843
- if (event.getSource() == allParamsButton)
2924
+ if (source == allParamsButton)
28442925 {
28452926 assert(copy == group);
28462927
....@@ -2861,19 +2942,19 @@
28612942
28622943 refreshContents(true);
28632944 } else
2864
- if (event.getSource() == unselectButton)
2945
+ if (source == unselectButton)
28652946 {
28662947 objEditor.jTree.clearSelection();
28672948 // ?? oct 2012 GrafreeD.clipboard.clear();
28682949 objEditor.ResetSliders();
28692950 refreshContents(true);
28702951 } else
2871
- if(event.getSource() instanceof cRadio)
2952
+ if(source instanceof cRadio)
28722953 {
28732954 group.parent = keepparent;
28742955 group.attributes = 0;
28752956 //group.editWindow = null;
2876
- /*cRadio*/ radio = (cRadio)event.getSource();
2957
+ /*cRadio*/ radio = (cRadio)source;
28772958 Object3D obj = radio.GetObject();
28782959 System.out.println("Edit " + obj);
28792960 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2893,7 +2974,7 @@
28932974 }
28942975
28952976 copy = group;
2896
- //CameraPane.theRenderer.object = group;
2977
+ //Globals.theRenderer.object = group;
28972978 if(!useclient)
28982979 {
28992980 cameraView.renderCamera = radio.camera;
....@@ -2902,7 +2983,8 @@
29022983 cameraView.cameras[cameraView.cameracount] = radio.camera;
29032984 cameraView.targetLookAt.set(radio.camera.lookAt);
29042985 cameraView.object = group;
2905
- cameraView.lighttouched = true;
2986
+ //cameraView.lighttouched = true;
2987
+ Globals.lighttouched = true;
29062988 topView.object = group;
29072989 frontView.object = group;
29082990 sideView.object = group;
....@@ -2938,7 +3020,7 @@
29383020 if (useclient)
29393021 {
29403022 cameraView.object = client;
2941
- cameraView.lighttouched = true;
3023
+ Globals.lighttouched = true;
29423024 //topView.object = client;
29433025 //frontView.object = client;
29443026 //sideView.object = client;
....@@ -2946,7 +3028,7 @@
29463028 else
29473029 {
29483030 cameraView.object = group;
2949
- cameraView.lighttouched = true;
3031
+ Globals.lighttouched = true;
29503032 //topView.object = group;
29513033 //frontView.object = group;
29523034 //sideView.object = group;
....@@ -3454,7 +3536,7 @@
34543536 String pigment = Object3D.GetPigment(tex);
34553537 //String bump = Object3D.GetBump(tex);
34563538
3457
- 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);
34583540
34593541 double s = v.s;
34603542
....@@ -3755,7 +3837,7 @@
37553837 group.selection.RelinkToSupport(); // july 2014
37563838 System.out.println("DONE.");
37573839 refreshContents();
3758
- 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));
37593841 }
37603842
37613843 void ReduceMesh(boolean reduction34)
....@@ -4040,16 +4122,16 @@
40404122
40414123 objEditor.SetText(); // jan 2014
40424124
4043
- 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))
40444126 CameraPane.flash = true;
40454127
40464128 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
40474129 // a camera
40484130 {
40494131 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;
4132
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4133
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4134
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40534135 }
40544136
40554137 refreshContents();
....@@ -5007,6 +5089,7 @@
50075089
50085090 private MenuItem resetParentItem;
50095091 private MenuItem repairParentItem;
5092
+ private MenuItem repairShadowItem;
50105093 private MenuItem sortbysizeItem;
50115094 private MenuItem sortbynameItem;
50125095