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,6 +592,80 @@
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 {
....@@ -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 {
....@@ -1482,6 +1507,7 @@
14821507 //
14831508 public void actionPerformed(ActionEvent event) // , Object arg)
14841509 {
1510
+ Object source = event.getSource();
14851511 /*
14861512 if (event.getSource() == nameField)
14871513 {
....@@ -1493,11 +1519,11 @@
14931519 }
14941520 else
14951521 */
1496
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1522
+ if (source == lookAtItem || source == lookFromItem)
14971523 {
14981524 ScreenFit();
14991525 } else
1500
- if (event.getSource() == switchItem)
1526
+ if (source == switchItem)
15011527 {
15021528 cVector v1 = new cVector();
15031529 cVector v2 = new cVector();
....@@ -1506,11 +1532,11 @@
15061532 objEditor.cameraView.renderCamera.setAim(v2, v1);
15071533 objEditor.cameraView.repaint();
15081534 } else
1509
- if (event.getSource() == rectoidItem)
1535
+ if (source == rectoidItem)
15101536 {
15111537 makeSomething(new Box());
15121538 } else
1513
- if (event.getSource() == particleItem)
1539
+ if (source == particleItem)
15141540 {
15151541 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15161542 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1531,9 +1557,9 @@
15311557 applyExample(particleGeom, "SMOKE");
15321558 makeSomething(particleGeom);
15331559 } else
1534
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1560
+ if (source == ragdollItem || source == ragdoll2Item)
15351561 {
1536
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1562
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15371563
15381564 ragdoll.toParent = LA.newMatrix();
15391565 ragdoll.fromParent = LA.newMatrix();
....@@ -1551,7 +1577,7 @@
15511577 } else
15521578 /*
15531579 */
1554
- if (event.getSource() == heightFieldItem)
1580
+ if (source == heightFieldItem)
15551581 {
15561582 Object3D obj = new Object3D();
15571583
....@@ -1589,31 +1615,31 @@
15891615
15901616 makeSomething(obj);
15911617 } else
1592
- if (event.getSource() == gridItem)
1618
+ if (source == gridItem)
15931619 {
15941620 makeSomething(new Grid());
15951621 } else
1596
- if (event.getSource() == ellipsoidItem)
1622
+ if (source == ellipsoidItem)
15971623 {
15981624 makeSomething(new Sphere());
15991625 } else
1600
- if (event.getSource() == coneItem)
1626
+ if (source == coneItem)
16011627 {
16021628 makeSomething(new Cone());
16031629 } else
1604
- if (event.getSource() == torusItem)
1630
+ if (source == torusItem)
16051631 {
16061632 makeSomething(new Torus());
16071633 } else
1608
- if (event.getSource() == superItem)
1634
+ if (source == superItem)
16091635 {
16101636 makeSomething(new Superellipsoid());
16111637 } else
1612
- if (event.getSource() == kleinItem)
1638
+ if (source == kleinItem)
16131639 {
16141640 makeSomething(new Klein());
16151641 } else
1616
- if (event.getSource() == blobItem)
1642
+ if (source == blobItem)
16171643 {
16181644 Blob blob = new Blob();
16191645 BlobComponent comp = new BlobComponent();
....@@ -1621,15 +1647,15 @@
16211647 //blob.retile();
16221648 makeSomething(blob);
16231649 } else
1624
- if (event.getSource() == latheItem)
1650
+ if (source == latheItem)
16251651 {
16261652 makeSomething(new Lathe());
16271653 } else
1628
- if (event.getSource() == bezierItem)
1654
+ if (source == bezierItem)
16291655 {
16301656 makeSomething(new BezierSurface());
16311657 } else
1632
- if (event.getSource() == checkerItem)
1658
+ if (source == checkerItem)
16331659 {
16341660 /*
16351661 Object3D obj = new BezierSurface(5,8);
....@@ -1644,7 +1670,7 @@
16441670 */
16451671 makeSomething(new Checker());
16461672 } else
1647
- if (event.getSource() == meshItem)
1673
+ if (source == meshItem)
16481674 {
16491675 Object3D itemtomake = new Object3D();
16501676 Object3D child;
....@@ -1665,35 +1691,35 @@
16651691 makeSomething(child);
16661692 }
16671693 } else
1668
- if (event.getSource() == springItem)
1694
+ if (source == springItem)
16691695 {
16701696 cSpring s = new cSpring();
16711697 s.setup();
16721698 makeSomething(s);
16731699 } else
1674
- if (event.getSource() == flagItem)
1700
+ if (source == flagItem)
16751701 {
16761702 cSpring s = new cFlag();
16771703 s.setup();
16781704 makeSomething(s);
16791705 } else
1680
- if (event.getSource() == lightItem)
1706
+ if (source == lightItem)
16811707 {
16821708 makeSomething(new Light());
16831709 } else
1684
- if (event.getSource() == csgItem)
1710
+ if (source == csgItem)
16851711 {
16861712 group(new CSG());
16871713 } else
1688
- if (event.getSource() == templateItem)
1714
+ if (source == templateItem)
16891715 {
16901716 group(new cTemplate());
16911717 } else
1692
- if (event.getSource() == attributeItem)
1718
+ if (source == attributeItem)
16931719 {
16941720 makeSomething(new Attribute());
16951721 } else
1696
- if (event.getSource() == pointflowItem)
1722
+ if (source == pointflowItem)
16971723 {
16981724 makeSomething(new PointFlow());
16991725 } else
....@@ -1705,7 +1731,7 @@
17051731 } else
17061732 */
17071733
1708
- if (event.getSource() == superLoopItem)
1734
+ if (source == superLoopItem)
17091735 {
17101736 Composite g = new cGroup();
17111737 for (int i=0; i<15; i++)
....@@ -1727,7 +1753,7 @@
17271753
17281754 group(g);
17291755 } else
1730
- if (event.getSource() == loopItem)
1756
+ if (source == loopItem)
17311757 {
17321758 Composite csg = new GroupLeaf();
17331759 csg.count = 5;
....@@ -1736,7 +1762,7 @@
17361762 csg.addChild(child);
17371763 child.addChild(csg);
17381764 } else
1739
- if (event.getSource() == doubleItem)
1765
+ if (source == doubleItem)
17401766 {
17411767 Composite csg = new GroupLeaf();
17421768 csg.count = 5;
....@@ -1748,7 +1774,7 @@
17481774 csg.addChild(child);
17491775 child.addChild(csg);
17501776 } else
1751
- if (event.getSource() == tripleItem)
1777
+ if (source == tripleItem)
17521778 {
17531779 Composite csg = new GroupLeaf();
17541780 csg.count = 4;
....@@ -1764,70 +1790,70 @@
17641790 child.addChild(csg);
17651791 } else
17661792
1767
- if (event.getSource() == importGFDItem)
1793
+ if (source == importGFDItem)
17681794 {
17691795 ImportGFD();
17701796 } else
1771
- if (event.getSource() == importVRMLX3DItem)
1797
+ if (source == importVRMLX3DItem)
17721798 {
17731799 ImportVRMLX3D();
17741800 } else
1775
- if (event.getSource() == import3DSItem)
1801
+ if (source == import3DSItem)
17761802 {
17771803 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17781804 } else
1779
- if (event.getSource() == importOBJItem)
1805
+ if (source == importOBJItem)
17801806 {
17811807 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
17821808 } else
1783
- if (event.getSource() == computeAOItem)
1809
+ if (source == computeAOItem)
17841810 {
1785
- CameraPane.drawMode = CameraPane.OCCLUSION;
1786
- CameraPane.theRenderer.repaint();
1811
+ Globals.drawMode = CameraPane.OCCLUSION;
1812
+ Globals.theRenderer.repaint();
17871813 } else
1788
- if (event.getSource() == recompileItem)
1814
+ if (source == recompileItem)
17891815 {
17901816 Recompile();
17911817 refreshContents();
17921818 } else
1793
- if (event.getSource() == editScriptItem)
1819
+ if (source == editScriptItem)
17941820 {
17951821 OpenDialog();
17961822 refreshContents();
17971823 } else
1798
- if (event.getSource() == invariantsItem)
1824
+ if (source == invariantsItem)
17991825 {
18001826 System.out.println("Invariants:");
18011827 GrafreeD.grafreeD.universe.invariants();
18021828 } else
1803
- if (event.getSource() == memoryItem)
1829
+ if (source == memoryItem)
18041830 {
18051831 //System.out.println("Invariants:");
18061832 PrintMemory();
18071833 } else
1808
- if (event.getSource() == pathItem)
1834
+ if (source == pathItem)
18091835 {
18101836 PrintPath();
18111837 } else
1812
- if (event.getSource() == analyzeItem)
1838
+ if (source == analyzeItem)
18131839 {
18141840 AnalyzeObject();
18151841 } else
1816
- if (event.getSource() == dumpItem)
1842
+ if (source == dumpItem)
18171843 {
18181844 DumpObject();
18191845 } else
1820
- if (event.getSource() == screenfitButton)
1846
+ if (source == screenfitButton)
18211847 {
18221848 //Reload(lastConverter, lastFilename, true);
18231849 ScreenFit();
18241850 } else
1825
- if (event.getSource() == screenfitpointButton)
1851
+ if (source == screenfitpointButton)
18261852 {
18271853 //Reload(lastConverter, lastFilename, true);
18281854 ScreenFitPoint();
18291855 } else
1830
- if (event.getSource() == snapobjectButton)
1856
+ if (source == snapobjectButton)
18311857 {
18321858 //Reload(lastConverter, lastFilename, true);
18331859 SnapObject();
....@@ -1838,13 +1864,13 @@
18381864 // Recompile();
18391865 // refreshContents();
18401866 // } else
1841
- if (event.getSource() == gcButton)
1867
+ if (source == gcButton)
18421868 {
18431869 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18441870 System.gc();
18451871 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18461872 } else
1847
- if (event.getSource() == editLeafItem)
1873
+ if (source == editLeafItem)
18481874 {
18491875 Object3D obj;
18501876 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1858,62 +1884,62 @@
18581884 }
18591885 refreshContents(true);
18601886 } else
1861
- if (event.getSource() == openWindowItem)
1887
+ if (source == openWindowItem)
18621888 {
18631889 EditSelection(true);
18641890 } else
1865
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1891
+ if (source == cutItem || source == clearButton)
18661892 {
18671893 loadClipboard(true);
18681894 } else
1869
- if (event.getSource() == duplicateItem)
1895
+ if (source == duplicateItem)
18701896 {
18711897 Object3D keep = GrafreeD.clipboard;
18721898 loadClipboard(false);
18731899 paste(false);
18741900 GrafreeD.clipboard = keep;
18751901 } else
1876
- if (event.getSource() == cloneItem)
1902
+ if (source == cloneItem)
18771903 {
18781904 CloneSelection(false);
18791905 } else
1880
- if (event.getSource() == cloneSupportItem)
1906
+ if (source == cloneSupportItem)
18811907 {
18821908 CloneSelection(true);
18831909 } else
1884
- if (event.getSource() == copyItem)
1910
+ if (source == copyItem)
18851911 {
18861912 loadClipboard(false);
18871913 } else
1888
- if (event.getSource() == pasteItem)
1914
+ if (source == pasteItem)
18891915 {
18901916 paste(false);
18911917 } else
1892
- if (event.getSource() == pasteLinkItem)
1918
+ if (source == pasteLinkItem)
18931919 {
18941920 pasteInto(false);
18951921 } else
1896
- if (event.getSource() == pasteCloneItem)
1922
+ if (source == pasteCloneItem)
18971923 {
18981924 pasteInto(true);
18991925 } else
1900
- if (event.getSource() == pasteExpandItem)
1926
+ if (source == pasteExpandItem)
19011927 {
19021928 paste(true);
19031929 } else
1904
- if (event.getSource() == synchronizeItem)
1930
+ if (source == synchronizeItem)
19051931 {
19061932 Overwrite(Object3D.TRANSFORM);
19071933 } else
1908
- if (event.getSource() == overwriteNameItem)
1934
+ if (source == overwriteNameItem)
19091935 {
19101936 Overwrite(Object3D.NAME);
19111937 } else
1912
- if (event.getSource() == overwriteUVItem)
1938
+ if (source == overwriteUVItem)
19131939 {
19141940 Overwrite(Object3D.UV);
19151941 } else
1916
- if (event.getSource() == overwriteMatItem)
1942
+ if (source == overwriteMatItem)
19171943 {
19181944 /* july 2015
19191945 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1933,7 +1959,7 @@
19331959
19341960 Overwrite(dropAttributes);
19351961 }
1936
- if (event.getSource() == overwriteGeoItem)
1962
+ if (source == overwriteGeoItem)
19371963 {
19381964 Overwrite(Object3D.GEOMETRY);
19391965 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1950,7 +1976,7 @@
19501976 // refreshContents();
19511977 // }
19521978 } else
1953
- if (event.getSource() == generateMeshItem)
1979
+ if (source == generateMeshItem)
19541980 {
19551981 //if (group.selection.size() == 1)
19561982 // for (int i=0; i<group.selection.size(); i++)
....@@ -1961,7 +1987,7 @@
19611987 ResetModel();
19621988 refreshContents();
19631989 } else
1964
- if (event.getSource() == extractGeometriesItem)
1990
+ if (source == extractGeometriesItem)
19651991 {
19661992 boolean one = false;
19671993
....@@ -1988,7 +2014,7 @@
19882014 ResetModel();
19892015 refreshContents();
19902016 } else
1991
- if (event.getSource() == cloneGeometriesItem)
2017
+ if (source == cloneGeometriesItem)
19922018 {
19932019 boolean one = false;
19942020
....@@ -2014,7 +2040,7 @@
20142040 ResetModel();
20152041 refreshContents();
20162042 } else
2017
- if (event.getSource() == shareGeometriesItem)
2043
+ if (source == shareGeometriesItem)
20182044 {
20192045 boolean one = false;
20202046
....@@ -2044,7 +2070,7 @@
20442070 refreshContents();
20452071 }
20462072 } else
2047
- if (event.getSource() == mergeGeometriesItem)
2073
+ if (source == mergeGeometriesItem)
20482074 {
20492075 boolean one = false;
20502076
....@@ -2074,7 +2100,7 @@
20742100 ResetModel();
20752101 refreshContents();
20762102 } else
2077
- if (event.getSource() == linkverticesItem)
2103
+ if (source == linkverticesItem)
20782104 {
20792105 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20802106 // {
....@@ -2094,7 +2120,7 @@
20942120 if (content instanceof cGroup && ((cGroup)content).transientlink )
20952121 content = ((cGroup)content).get(0);
20962122
2097
- 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));
20982124 for (int i=0; i<group.selection.size(); i++)
20992125 {
21002126 boolean random = CameraPane.RANDOM;
....@@ -2103,11 +2129,11 @@
21032129 // group.selection.get(i).setMasterThis(content); // should be identity
21042130 CameraPane.RANDOM = random;
21052131 }
2106
- 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));
21072133 refreshContents();
21082134 }
21092135 } else
2110
- if (event.getSource() == resetsupportItem)
2136
+ if (source == resetsupportItem)
21112137 {
21122138 for (int i=0; i<group.selection.size(); i++)
21132139 {
....@@ -2119,7 +2145,7 @@
21192145
21202146 refreshContents();
21212147 } else
2122
- if (event.getSource() == relinkverticesItem)
2148
+ if (source == relinkverticesItem)
21232149 {
21242150 boolean random = CameraPane.RANDOM;
21252151 CameraPane.RANDOM = false; // parse all random nodes
....@@ -2128,7 +2154,7 @@
21282154
21292155 refreshContents();
21302156 } else
2131
- if (event.getSource() == resetreferencesItem)
2157
+ if (source == resetreferencesItem)
21322158 {
21332159 for (int i=0; i<group.selection.size(); i++)
21342160 {
....@@ -2137,7 +2163,7 @@
21372163
21382164 refreshContents();
21392165 } else
2140
- if (event.getSource() == setMasterItem)
2166
+ if (source == setMasterItem)
21412167 {
21422168 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21432169 {
....@@ -2150,7 +2176,7 @@
21502176 refreshContents();
21512177 }
21522178 } else
2153
- if (event.getSource() == poseMeshItem)
2179
+ if (source == poseMeshItem)
21542180 {
21552181 if (group.selection.size() == 1)
21562182 {
....@@ -2169,19 +2195,19 @@
21692195 }
21702196
21712197 } else
2172
- if (event.getSource() == revertMeshItem)
2198
+ if (source == revertMeshItem)
21732199 {
21742200 RevertMeshes();
21752201 } else
2176
- if (event.getSource() == resetMeshItem)
2202
+ if (source == resetMeshItem)
21772203 {
21782204 ResetAll();
21792205 } else
2180
- if (event.getSource() == stepAllItem)
2206
+ if (source == stepAllItem)
21812207 {
21822208 StepAll();
21832209 } else
2184
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2210
+ if (source == clearItem) // || event.getSource() == clearButton)
21852211 {
21862212 //int indices[] = jList.getSelectedIndices();
21872213 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2189,46 +2215,46 @@
21892215
21902216 ClearSelection(false);
21912217 } else
2192
- if (event.getSource() == clearAllItem)
2218
+ if (source == clearAllItem)
21932219 {
21942220 ClearSelection(true);
21952221 } else
2196
- if (event.getSource() == grabItem)
2222
+ if (source == grabItem)
21972223 {
21982224 group(new cGroup(), true);
21992225 } else
2200
- if (event.getSource() == hideItem)
2226
+ if (source == hideItem)
22012227 {
22022228 group(new HiddenObject());
22032229 } else
2204
- if (event.getSource() == frontItem)
2230
+ if (source == frontItem)
22052231 {
22062232 front();
22072233 } else
2208
- if (event.getSource() == backItem)
2234
+ if (source == backItem)
22092235 {
22102236 back();
22112237 } else
2212
- if (event.getSource() == cameraItem)
2238
+ if (source == cameraItem)
22132239 {
22142240 makeSomething(new Camera());
22152241 } else
2216
- if (event.getSource() == compositeItem)
2242
+ if (source == compositeItem)
22172243 {
22182244 group(new Composite());
22192245 } else
2220
- if (event.getSource() == randomItem)
2246
+ if (source == randomItem)
22212247 {
22222248 RandomNode random = new RandomNode();
22232249 group(random);
22242250 if (random.size() > 0)
22252251 random.name = random.get(0).name + "Rnd";
22262252 } else
2227
- if (event.getSource() == physicsItem)
2253
+ if (source == physicsItem)
22282254 {
22292255 group(new PhysicsNode());
22302256 } else
2231
- if (event.getSource() == frameselectorItem)
2257
+ if (source == frameselectorItem)
22322258 {
22332259 for (int i=0; i<group.selection.size(); i++)
22342260 {
....@@ -2240,7 +2266,7 @@
22402266 ResetModel();
22412267 refreshContents();
22422268 } else
2243
- if (event.getSource() == switchGeoItem)
2269
+ if (source == switchGeoItem)
22442270 {
22452271 for (int i=0; i<group.selection.size(); i++)
22462272 {
....@@ -2252,7 +2278,7 @@
22522278 ResetModel();
22532279 refreshContents();
22542280 } else
2255
- if (event.getSource() == switchTransfoItem)
2281
+ if (source == switchTransfoItem)
22562282 {
22572283 for (int i=0; i<group.selection.size(); i++)
22582284 {
....@@ -2264,7 +2290,7 @@
22642290 ResetModel();
22652291 refreshContents();
22662292 } else
2267
- if (event.getSource() == morphItem)
2293
+ if (source == morphItem)
22682294 {
22692295 for (int i=0; i<group.selection.size(); i++)
22702296 {
....@@ -2276,7 +2302,7 @@
22762302 ResetModel();
22772303 refreshContents();
22782304 } else
2279
- if (event.getSource() == scriptNodeItem)
2305
+ if (source == scriptNodeItem)
22802306 {
22812307 boolean atleastone = false;
22822308
....@@ -2315,31 +2341,31 @@
23152341 }
23162342 }
23172343 } else
2318
- if (event.getSource() == linkerItem)
2344
+ if (source == linkerItem)
23192345 {
23202346 group(new cLinker());
23212347 } else
2322
- if (event.getSource() == textureItem)
2348
+ if (source == textureItem)
23232349 {
23242350 group(new TextureNode());
23252351 } else
2326
- if (event.getSource() == billboardItem)
2352
+ if (source == billboardItem)
23272353 {
23282354 group(new BillboardNode());
23292355 } else
2330
- if (event.getSource() == shadowXItem)
2356
+ if (source == shadowXItem)
23312357 {
23322358 CastShadow(0);
23332359 } else
2334
- if (event.getSource() == shadowYItem)
2360
+ if (source == shadowYItem)
23352361 {
23362362 CastShadow(1);
23372363 } else
2338
- if (event.getSource() == shadowZItem)
2364
+ if (source == shadowZItem)
23392365 {
23402366 CastShadow(2);
23412367 } else
2342
- if (event.getSource() == ungroupItem)
2368
+ if (source == ungroupItem)
23432369 {
23442370 //ungroup();
23452371 for (int i=0; i<group.selection.size(); i++)
....@@ -2351,179 +2377,179 @@
23512377
23522378 refreshContents();
23532379 } else
2354
- if (event.getSource() == genUVItem)
2380
+ if (source == genUVItem)
23552381 {
23562382 GenUV();
23572383 } else
2358
- if (event.getSource() == genNormalsCADItem)
2384
+ if (source == genNormalsCADItem)
23592385 {
23602386 GenNormals(true);
23612387 } else
2362
- if (event.getSource() == genNormalsMESHItem)
2388
+ if (source == genNormalsMESHItem)
23632389 {
23642390 GenNormals(true); // TODO
23652391 } else
2366
- if (event.getSource() == genNormalsORGANItem)
2392
+ if (source == genNormalsORGANItem)
23672393 {
23682394 GenNormals(false);
23692395 } else
2370
- if (event.getSource() == genNormalsMINEItem)
2396
+ if (source == genNormalsMINEItem)
23712397 {
23722398 GenNormalsMINE();
23732399 } else
2374
- if (event.getSource() == stripifyItem)
2400
+ if (source == stripifyItem)
23752401 {
23762402 Stripify();
23772403 } else
2378
- if (event.getSource() == unstripifyItem)
2404
+ if (source == unstripifyItem)
23792405 {
23802406 Unstripify();
23812407 } else
2382
- if (event.getSource() == trimItem)
2408
+ if (source == trimItem)
23832409 {
23842410 Trim();
23852411 } else
2386
- if (event.getSource() == untrimItem)
2412
+ if (source == untrimItem)
23872413 {
23882414 Untrim();
23892415 } else
2390
- if (event.getSource() == clearColorsItem)
2416
+ if (source == clearColorsItem)
23912417 {
23922418 ClearColors();
23932419 } else
2394
- if (event.getSource() == clearMaterialsItem)
2420
+ if (source == clearMaterialsItem)
23952421 {
23962422 ClearMaterials();
23972423 } else
2398
- if (event.getSource() == liveleavesItem)
2424
+ if (source == liveleavesItem)
23992425 {
24002426 LiveLeaves(true);
24012427 } else
2402
- if (event.getSource() == unliveleavesItem)
2428
+ if (source == unliveleavesItem)
24032429 {
24042430 LiveLeaves(false);
24052431 } else
2406
- if (event.getSource() == supportleavesItem)
2432
+ if (source == supportleavesItem)
24072433 {
24082434 SupportLeaves(true);
24092435 } else
2410
- if (event.getSource() == unsupportleavesItem)
2436
+ if (source == unsupportleavesItem)
24112437 {
24122438 SupportLeaves(false);
24132439 } else
2414
- if (event.getSource() == hideleavesItem)
2440
+ if (source == hideleavesItem)
24152441 {
24162442 HideLeaves(true);
24172443 } else
2418
- if (event.getSource() == showleavesItem)
2444
+ if (source == showleavesItem)
24192445 {
24202446 HideLeaves(false);
24212447 } else
2422
- if (event.getSource() == markleavesItem)
2448
+ if (source == markleavesItem)
24232449 {
24242450 MarkLeaves(true);
24252451 } else
2426
- if (event.getSource() == unmarkleavesItem)
2452
+ if (source == unmarkleavesItem)
24272453 {
24282454 MarkLeaves(false);
24292455 } else
2430
- if (event.getSource() == flipVItem)
2456
+ if (source == flipVItem)
24312457 {
24322458 FlipV(true);
24332459 } else
2434
- if (event.getSource() == unflipVItem)
2460
+ if (source == unflipVItem)
24352461 {
24362462 FlipV(false);
24372463 } else
2438
- if (event.getSource() == lowTexturesItem)
2464
+ if (source == lowTexturesItem)
24392465 {
24402466 SetTexRes(0);
24412467 } else
2442
- if (event.getSource() == normalTexturesItem)
2468
+ if (source == normalTexturesItem)
24432469 {
24442470 SetTexRes(1);
24452471 } else
2446
- if (event.getSource() == highTexturesItem)
2472
+ if (source == highTexturesItem)
24472473 {
24482474 SetTexRes(2);
24492475 } else
2450
- if (event.getSource() == veryhighTexturesItem)
2476
+ if (source == veryhighTexturesItem)
24512477 {
24522478 SetTexRes(3);
24532479 } else
2454
- if (event.getSource() == maxTexturesItem)
2480
+ if (source == maxTexturesItem)
24552481 {
24562482 SetTexRes(4);
24572483 } else
2458
- if (event.getSource() == panoTexturesItem)
2484
+ if (source == panoTexturesItem)
24592485 {
24602486 SetTexRes(5);
24612487 } else
2462
- if (event.getSource() == reverseNormalsItem)
2488
+ if (source == reverseNormalsItem)
24632489 {
24642490 ReverseNormals();
24652491 } else
2466
- if (event.getSource() == parseverticesItem)
2492
+ if (source == parseverticesItem)
24672493 {
24682494 ParseVertices();
24692495 } else
2470
- if (event.getSource() == textureFieldItem)
2496
+ if (source == textureFieldItem)
24712497 {
24722498 TextureVertices();
24732499 } else
2474
- if (event.getSource() == alignItem)
2500
+ if (source == alignItem)
24752501 {
24762502 Align();
24772503 } else
2478
- if (event.getSource() == mirrorItem)
2504
+ if (source == mirrorItem)
24792505 {
24802506 MirrorPoses();
24812507 } else
2482
- if (event.getSource() == reduceMorphItem)
2508
+ if (source == reduceMorphItem)
24832509 {
24842510 MeshReduction(false);
24852511 } else
2486
- if (event.getSource() == reduce34MorphItem)
2512
+ if (source == reduce34MorphItem)
24872513 {
24882514 MeshReduction(true);
24892515 } else
2490
- if (event.getSource() == reverseTrianglesItem)
2516
+ if (source == reverseTrianglesItem)
24912517 {
24922518 ReverseTriangles();
24932519 } else
2494
- if (event.getSource() == reduceMeshItem)
2520
+ if (source == reduceMeshItem)
24952521 {
24962522 ReduceMesh(false);
24972523 } else
2498
- if (event.getSource() == reduce34MeshItem)
2524
+ if (source == reduce34MeshItem)
24992525 {
25002526 ReduceMesh(true);
25012527 } else
2502
- if (event.getSource() == increaseMeshItem)
2528
+ if (source == increaseMeshItem)
25032529 {
25042530 IncreaseMesh();
25052531 } else
2506
- if (event.getSource() == clipMeshItem)
2532
+ if (source == clipMeshItem)
25072533 {
25082534 ClipMesh();
25092535 } else
2510
- if (event.getSource() == smoothMeshItem)
2536
+ if (source == smoothMeshItem)
25112537 {
25122538 SmoothMesh();
25132539 } else
2514
- if (event.getSource() == transformgeometryItem)
2540
+ if (source == transformgeometryItem)
25152541 {
25162542 TransformGeometry();
25172543 } else
2518
- if (event.getSource() == resetTransformItem)
2544
+ if (source == resetTransformItem)
25192545 {
25202546 ResetTransform();
25212547 } else
2522
- if (event.getSource() == resetCentroidItem)
2548
+ if (source == resetCentroidItem)
25232549 {
25242550 ResetCentroid();
25252551 } else
2526
- if (event.getSource() == resetParentItem)
2552
+ if (source == resetParentItem)
25272553 {
25282554 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25292555 {
....@@ -2533,7 +2559,7 @@
25332559
25342560 refreshContents();
25352561 } else
2536
- if (event.getSource() == repairParentItem)
2562
+ if (source == repairParentItem)
25372563 {
25382564 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25392565 {
....@@ -2547,7 +2573,7 @@
25472573
25482574 refreshContents();
25492575 } else
2550
- if (event.getSource() == repairShadowItem)
2576
+ if (source == repairShadowItem)
25512577 {
25522578 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25532579 {
....@@ -2561,7 +2587,7 @@
25612587
25622588 refreshContents();
25632589 } else
2564
- if (event.getSource() == sortbysizeItem)
2590
+ if (source == sortbysizeItem)
25652591 {
25662592 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25672593 {
....@@ -2573,7 +2599,7 @@
25732599 ResetModel();
25742600 refreshContents();
25752601 } else
2576
- if (event.getSource() == sortbynameItem)
2602
+ if (source == sortbynameItem)
25772603 {
25782604 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25792605 {
....@@ -2585,7 +2611,7 @@
25852611 ResetModel();
25862612 refreshContents();
25872613 } else
2588
- if (event.getSource() == attachPigmentItem)
2614
+ if (source == attachPigmentItem)
25892615 {
25902616 String texture = GetFile("Attach pigment");
25912617 Object3D obj;
....@@ -2597,7 +2623,7 @@
25972623
25982624 refreshContents();
25992625 } else
2600
- if (event.getSource() == detachPigmentItem)
2626
+ if (source == detachPigmentItem)
26012627 {
26022628 Object3D obj;
26032629 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2608,7 +2634,7 @@
26082634
26092635 refreshContents();
26102636 } else
2611
- if (event.getSource() == attachBumpItem)
2637
+ if (source == attachBumpItem)
26122638 {
26132639 String texture = GetFile("Attach bump");
26142640 Object3D obj;
....@@ -2620,7 +2646,7 @@
26202646
26212647 refreshContents();
26222648 } else
2623
- if (event.getSource() == detachBumpItem)
2649
+ if (source == detachBumpItem)
26242650 {
26252651 Object3D obj;
26262652 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2631,7 +2657,7 @@
26312657
26322658 refreshContents();
26332659 } else
2634
- if (event.getSource() == pigmentBumpItem)
2660
+ if (source == pigmentBumpItem)
26352661 {
26362662 Object3D obj;
26372663 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2642,158 +2668,195 @@
26422668
26432669 refreshContents();
26442670 } else
2645
- if (event.getSource() == flashSelectionButton)
2671
+ if (source == flashSelectionButton)
26462672 {
26472673 CameraPane.flash = true;
26482674 refreshContents();
26492675 } else
2650
- if (event.getSource() == oneButton)
2676
+ if (source == oneButton)
26512677 {
26522678 } else
2653
- if (event.getSource() == twoButton)
2679
+ if (source == twoButton)
26542680 {
26552681 radio.layout = twoButton;
26562682 // bug
26572683 //gridPanel.setDividerLocation(1.0);
26582684 //bigPanel.setDividerLocation(0.0);
2659
- bigThree.remove(scenePanel);
2660
- bigThree.remove(centralPanel);
2661
- bigThree.remove(XYZPanel);
2662
- aWindowConstraints.gridx = 0;
2663
- aWindowConstraints.gridy = 0;
2664
- aWindowConstraints.gridwidth = 1;
2665
- // aConstraints.gridheight = 3;
2666
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2667
- aWindowConstraints.weightx = 0;
2668
- aWindowConstraints.weighty = 1;
2669
- //bigThree.add(jtp, aWindowConstraints);
2670
- aWindowConstraints.weightx = 1;
2671
- aWindowConstraints.gridwidth = 3;
2672
- // aConstraints.gridheight = 3;
2673
- aWindowConstraints.gridx = 1;
2674
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2675
- bigThree.add(centralPanel, aWindowConstraints);
2676
- aWindowConstraints.weightx = 0;
2677
- aWindowConstraints.gridx = 4;
2678
- aWindowConstraints.gridwidth = 1;
2679
- // aConstraints.gridheight = 3;
2680
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2681
- //bigThree.add(XYZPanel, aWindowConstraints);
2682
- 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();
26832714 } else
2684
- if (event.getSource() == threeButton)
2715
+ if (source == threeButton)
26852716 {
26862717 radio.layout = threeButton;
2687
- bigThree.remove(scenePanel);
2688
- bigThree.remove(centralPanel);
2689
- bigThree.remove(XYZPanel);
2690
- aWindowConstraints.gridx = 0;
2691
- aWindowConstraints.gridy = 0;
2692
- aWindowConstraints.gridwidth = 1;
2693
- // aConstraints.gridheight = 3;
2694
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2695
- aWindowConstraints.weightx = 0;
2696
- aWindowConstraints.weighty = 1;
2697
- //bigThree.add(jtp, aWindowConstraints);
2698
- aWindowConstraints.weightx = 1;
2699
- aWindowConstraints.gridwidth = 3;
2700
- // aConstraints.gridheight = 3;
2701
- aWindowConstraints.gridx = 1;
2702
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2703
- bigThree.add(centralPanel, aWindowConstraints);
2704
- aWindowConstraints.weightx = 0;
2705
- aWindowConstraints.gridx = 4;
2706
- aWindowConstraints.gridwidth = 1;
2707
- // aConstraints.gridheight = 3;
2708
- aConstraints.fill = GridBagConstraints.VERTICAL;
2709
- bigThree.add(XYZPanel, aWindowConstraints);
2710
- 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();
27112750 } else
2712
- if (event.getSource() == fourButton)
2751
+ if (source == fourButton)
27132752 {
27142753 radio.layout = fourButton;
2715
- bigThree.remove(scenePanel);
2716
- bigThree.remove(centralPanel);
2717
- bigThree.remove(XYZPanel);
2718
- aWindowConstraints.gridx = 0;
2719
- aWindowConstraints.gridy = 0;
2720
- aWindowConstraints.gridwidth = 1;
2721
- // aWindowConstraints.gridheight = 3;
2722
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2723
- aWindowConstraints.weightx = 1;
2724
- aWindowConstraints.weighty = 1;
2725
- bigThree.add(scenePanel, aWindowConstraints);
2726
- aWindowConstraints.weightx = 1;
2727
- aWindowConstraints.gridwidth = 3;
2728
- // aConstraints.gridheight = 3;
2729
- aWindowConstraints.gridx = 1;
2730
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2731
- //bigThree.add(cameraPanel, aWindowConstraints);
2732
- aWindowConstraints.weightx = 0;
2733
- aWindowConstraints.gridx = 4;
2734
- aWindowConstraints.gridwidth = 1;
2735
- // aWindowConstraints.gridheight = 3;
2736
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2737
- //bigThree.add(XYZPanel, aWindowConstraints);
2738
- 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();
27392785 } else
2740
- if (event.getSource() == sixButton)
2786
+ if (source == sixButton)
27412787 {
27422788 radio.layout = sixButton;
2743
- bigThree.remove(scenePanel);
2744
- bigThree.remove(centralPanel);
2745
- bigThree.remove(XYZPanel);
2746
- aWindowConstraints.gridx = 0;
2747
- aWindowConstraints.gridy = 0;
2748
- aWindowConstraints.gridwidth = 1;
2749
- // aConstraints.gridheight = 3;
2750
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2751
- aWindowConstraints.weightx = 0;
2752
- aWindowConstraints.weighty = 1;
2753
- bigThree.add(scenePanel, aWindowConstraints);
2754
- aWindowConstraints.weightx = 1;
2755
- aWindowConstraints.gridwidth = 3;
2756
- // aWindowConstraints.gridheight = 3;
2757
- aWindowConstraints.gridx = 1;
2758
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2759
- bigThree.add(centralPanel, aWindowConstraints);
2760
- aWindowConstraints.weightx = 0;
2761
- aWindowConstraints.gridx = 4;
2762
- aWindowConstraints.gridwidth = 1;
2763
- // aWindowConstraints.gridheight = 3;
2764
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2765
- //bigThree.add(XYZPanel, aConstraints);
2766
- 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();
27672821 } else
2768
- if (event.getSource() == sevenButton)
2822
+ if (source == sevenButton)
27692823 {
27702824 radio.layout = sevenButton;
2771
- bigThree.remove(scenePanel);
2772
- bigThree.remove(centralPanel);
2773
- bigThree.remove(XYZPanel);
2774
- aWindowConstraints.gridx = 0;
2775
- aWindowConstraints.gridy = 0;
2776
- aWindowConstraints.gridwidth = 1;
2777
- // aWindowConstraints.gridheight = 3;
2778
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2779
- aWindowConstraints.weightx = 0;
2780
- aWindowConstraints.weighty = 1;
2781
- bigThree.add(scenePanel, aWindowConstraints);
2782
- aWindowConstraints.weightx = 1;
2783
- aWindowConstraints.gridwidth = 3;
2784
- // aWindowConstraints.gridheight = 3;
2785
- aWindowConstraints.gridx = 1;
2786
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2787
- bigThree.add(centralPanel, aWindowConstraints);
2788
- aWindowConstraints.weightx = 0;
2789
- aWindowConstraints.gridx = 4;
2790
- aWindowConstraints.gridwidth = 1;
2791
- // aConstraints.gridheight = 3;
2792
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2793
- bigThree.add(XYZPanel, aWindowConstraints);
2794
- 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();
27952858 } else
2796
- if (event.getSource() == rootButton)
2859
+ if (source == rootButton)
27972860 {
27982861 Object3D obj;
27992862 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2805,7 +2868,7 @@
28052868
28062869 refreshContents(true);
28072870 } else
2808
- if (event.getSource() == closeButton)
2871
+ if (source == closeButton)
28092872 {
28102873 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28112874 cRadio ab;
....@@ -2826,11 +2889,11 @@
28262889 }
28272890 refreshContents(true);
28282891 } else
2829
- if (event.getSource() == editItem || event.getSource() == editButton)
2892
+ if (source == editItem || source == editButton)
28302893 {
28312894 EditSelection(false);
28322895 } else
2833
- if (event.getSource() == uneditButton)
2896
+ if (source == uneditButton)
28342897 {
28352898 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28362899 {
....@@ -2842,12 +2905,12 @@
28422905
28432906 child.editWindow = null; // ???????????
28442907 }
2845
- objEditor.ctrlPanel.revalidate();
2908
+ objEditor.ctrlPanel.validate();
28462909 //objEditor.jTree.clearSelection();
28472910 //objEditor.ResetSliders();
28482911 refreshContents(true);
28492912 } else
2850
- if (event.getSource() == clearPanelButton)
2913
+ if (source == clearPanelButton)
28512914 {
28522915 assert(copy == group);
28532916 //copy.ClearUI();
....@@ -2858,7 +2921,7 @@
28582921 listUI.clear();
28592922 refreshContents(true);
28602923 } else
2861
- if (event.getSource() == allParamsButton)
2924
+ if (source == allParamsButton)
28622925 {
28632926 assert(copy == group);
28642927
....@@ -2879,19 +2942,19 @@
28792942
28802943 refreshContents(true);
28812944 } else
2882
- if (event.getSource() == unselectButton)
2945
+ if (source == unselectButton)
28832946 {
28842947 objEditor.jTree.clearSelection();
28852948 // ?? oct 2012 GrafreeD.clipboard.clear();
28862949 objEditor.ResetSliders();
28872950 refreshContents(true);
28882951 } else
2889
- if(event.getSource() instanceof cRadio)
2952
+ if(source instanceof cRadio)
28902953 {
28912954 group.parent = keepparent;
28922955 group.attributes = 0;
28932956 //group.editWindow = null;
2894
- /*cRadio*/ radio = (cRadio)event.getSource();
2957
+ /*cRadio*/ radio = (cRadio)source;
28952958 Object3D obj = radio.GetObject();
28962959 System.out.println("Edit " + obj);
28972960 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2911,7 +2974,7 @@
29112974 }
29122975
29132976 copy = group;
2914
- //CameraPane.theRenderer.object = group;
2977
+ //Globals.theRenderer.object = group;
29152978 if(!useclient)
29162979 {
29172980 cameraView.renderCamera = radio.camera;
....@@ -2920,7 +2983,8 @@
29202983 cameraView.cameras[cameraView.cameracount] = radio.camera;
29212984 cameraView.targetLookAt.set(radio.camera.lookAt);
29222985 cameraView.object = group;
2923
- cameraView.lighttouched = true;
2986
+ //cameraView.lighttouched = true;
2987
+ Globals.lighttouched = true;
29242988 topView.object = group;
29252989 frontView.object = group;
29262990 sideView.object = group;
....@@ -2956,7 +3020,7 @@
29563020 if (useclient)
29573021 {
29583022 cameraView.object = client;
2959
- cameraView.lighttouched = true;
3023
+ Globals.lighttouched = true;
29603024 //topView.object = client;
29613025 //frontView.object = client;
29623026 //sideView.object = client;
....@@ -2964,7 +3028,7 @@
29643028 else
29653029 {
29663030 cameraView.object = group;
2967
- cameraView.lighttouched = true;
3031
+ Globals.lighttouched = true;
29683032 //topView.object = group;
29693033 //frontView.object = group;
29703034 //sideView.object = group;
....@@ -3472,7 +3536,7 @@
34723536 String pigment = Object3D.GetPigment(tex);
34733537 //String bump = Object3D.GetBump(tex);
34743538
3475
- 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);
34763540
34773541 double s = v.s;
34783542
....@@ -3773,7 +3837,7 @@
37733837 group.selection.RelinkToSupport(); // july 2014
37743838 System.out.println("DONE.");
37753839 refreshContents();
3776
- 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));
37773841 }
37783842
37793843 void ReduceMesh(boolean reduction34)
....@@ -4058,16 +4122,16 @@
40584122
40594123 objEditor.SetText(); // jan 2014
40604124
4061
- 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))
40624126 CameraPane.flash = true;
40634127
40644128 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
40654129 // a camera
40664130 {
40674131 CameraPane.camerachangeframe = 0; // don't refuse it
4068
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4069
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
4070
- // 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;
40714135 }
40724136
40734137 refreshContents();