Normand Briere
2019-05-01 b1585b5b2b60c4165be400636c787fae24428c6a
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,31 +434,24 @@
433434 oe.radioPanel.add(dummyButton);
434435 oe.buttonGroup.add(dummyButton);
435436 */
436
- aConstraints.gridy += 1;
437
-
438437 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439438
440
- oe.aConstraints.gridwidth = 1;
441
- oe.aConstraints.gridx = 0;
442
-
443
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
439
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
444440 liveCB.setToolTipText("Enabled animation");
445441 liveCB.addItemListener(this);
446442
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
443
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
449444 trackCB.setToolTipText("Enable tracking");
450445 trackCB.addItemListener(this);
451446
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
447
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
454448 screenfitButton.setToolTipText("Screen fit");
455449 screenfitButton.addActionListener(this);
456
- oe.aConstraints.gridx += 1;
450
+
457451 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
458452 // screenfitpointButton.addActionListener(this);
459453 // oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
454
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
461455 snapobjectButton.addActionListener(this);
462456 snapobjectButton.setToolTipText("Snap Object");
463457 oe.aConstraints.gridx += 1;
....@@ -467,76 +461,66 @@
467461 oe.aConstraints.weighty = 0;
468462 oe.aConstraints.gridwidth = 1;
469463
470
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
464
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
471465 flashSelectionButton.setToolTipText("Show selection");
472466 flashSelectionButton.addActionListener(this);
473467
474
- oe.toolbarPanel.add(new cButton(" ", false));
468
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
475469
476
- oe.aConstraints.gridx += 1;
477
- oe.aConstraints.weighty = 0;
478
- oe.aConstraints.gridwidth = 1;
479
-
480
- //
481
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
470
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
482471 twoButton.setToolTipText("Show center view only");
483472 twoButton.addActionListener(this);
484
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
473
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
485474 fourButton.addActionListener(this);
486475 fourButton.setToolTipText("Show left panel only");
487
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
476
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
488477 sixButton.setToolTipText("2-column layout left");
489478 sixButton.addActionListener(this);
490
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
479
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
491480 threeButton.setToolTipText("2-column layout right");
492481 threeButton.addActionListener(this);
493
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
482
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
494483 sevenButton.setToolTipText("3-column layout");
495484 sevenButton.addActionListener(this);
496485 //
497486
498
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
499
- rootButton.setToolTipText("Edit object in new tab");
487
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
488
+ rootButton.setToolTipText("Edit selection in new tab");
500489 rootButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
490
+
491
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
503492 closeButton.setToolTipText("Close tab");
504493 closeButton.addActionListener(this);
505494 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
506495 //clearButton.addActionListener(this);
507
- oe.aConstraints.gridx += 1;
508496
509
- oe.aConstraints.gridx = 1; //
510
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
497
+ cGridBag commandsPanel = new cGridBag();
498
+
499
+ commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
500
+ editButton.setToolTipText("Edit selection");
511501 editButton.addActionListener(this);
512
- oe.aConstraints.gridx += 1;
513
- oe.aConstraints.weighty = 0;
514
- oe.aConstraints.gridwidth = 1;
515502
516
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
503
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
504
+ uneditButton.setToolTipText("Unedit selection");
517505 uneditButton.addActionListener(this);
518506
519
- oe.aConstraints.gridx += 1;
520
- oe.aConstraints.weighty = 0;
521
- oe.aConstraints.gridwidth = 1;
522
-
523
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
507
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
508
+ clearPanelButton.setToolTipText("Clear edit panel");
524509 clearPanelButton.addActionListener(this);
525510
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
511
+ commandsPanel.add(allParamsButton = new cButton("A", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
512
+ allParamsButton.setToolTipText("All params??");
531513 allParamsButton.addActionListener(this);
532514
533
- oe.aConstraints.gridx += 1;
534
- oe.aConstraints.weighty = 0;
535
- oe.aConstraints.gridwidth = 1;
536
-
537
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
515
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
516
+ unselectButton.setToolTipText("Unselect");
538517 unselectButton.addActionListener(this);
539518
519
+ commandsPanel.preferredHeight = 1;
520
+
521
+ oe.treePanel.add(commandsPanel);
522
+ oe.treePanel.Return();
523
+
540524 // oe.aConstraints.gridx += 1;
541525 // oe.aConstraints.weighty = 0;
542526 // oe.aConstraints.gridwidth = 1;
....@@ -548,40 +532,37 @@
548532 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
549533 // gcButton.addActionListener(this);
550534
551
- oe.aConstraints.gridx = 0;
552
- oe.aConstraints.gridy += 1;
553
-
554
- //ctrlPanel.add(objList = new List(5, true));
555
- oe.aConstraints.gridwidth = 100;
556
- // oe.aConstraints.gridheight = 100;
557
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
558
- oe.aConstraints.gridheight = 1;
559
- oe.aConstraints.weighty = 0.5;
560
- oe.aConstraints.gridx = 0;
561
- JScrollPane jSP;
535
+ cGridBag jSPPanel = new cGridBag();
536
+
537
+ JScrollPane jSP;
562538 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
563
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
539
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
564540 ResetModel();
565
- oe.aConstraints.weighty = 0.5;
566
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
567
- oe.aConstraints.gridy += 1;
568
- oe.aConstraints.gridwidth = 1;
541
+
542
+ oe.treePanel.add(jSPPanel);
543
+ oe.treePanel.Return();
569544
570
- oe.aConstraints.weighty = 0;
571
- oe.aConstraints.gridwidth = 2;
572
-
573
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
545
+ cGridBag copyOptionsPanel = new cGridBag();
546
+
547
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
548
+ colorCB.setToolTipText("Copy color when dropped");
574549 colorCB.addItemListener(this);
575
- oe.aConstraints.gridx += 2;
576
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
550
+
551
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
552
+ materialCB.setToolTipText("Copy material when dropped");
577553 materialCB.addItemListener(this);
578
- oe.aConstraints.gridx += 2;
579
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
554
+
555
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
556
+ textureCB.setToolTipText("Copy texture when dropped");
580557 textureCB.addItemListener(this);
581558
582
- oe.aConstraints.gridx = 0;
583
- oe.aConstraints.gridy += 1;
559
+ copyOptionsPanel.preferredHeight = 1;
560
+ oe.treePanel.add(copyOptionsPanel);
561
+ oe.treePanel.Return();
584562
563
+// mainPanel.setDividerLocation(0.5); //1.0);
564
+// mainPanel.setResizeWeight(0.5);
565
+
585566 //jList.addListSelectionListener(this);
586567 oe.jTree.addTreeSelectionListener(this);
587568 //jTree.setRootVisible(false);
....@@ -604,15 +585,15 @@
604585 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
605586 }
606587
607
- void AddOptions(JPanel panel, GridBagConstraints constraints)
588
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
608589 {
609
- constraints.gridx = 0;
610
- constraints.gridy = 0;
611
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), constraints);
590
+ //constraints.gridx = 0;
591
+ //constraints.gridy = 0;
592
+ panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
612593 fastCB.setToolTipText("Fast mode");
613594 fastCB.addItemListener(this);
614
- constraints.gridy += 1;
615
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), constraints);
595
+ //constraints.gridy += 1;
596
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
616597 supportCB.setToolTipText("Enabled rigging");
617598 supportCB.addItemListener(this);
618599
....@@ -620,26 +601,26 @@
620601 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
621602 // localCB.addItemListener(this);
622603
623
- constraints.gridy += 1;
624
- panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), constraints);
604
+ //constraints.gridy += 1;
605
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
625606 crowdCB.setToolTipText("Used for crowds");
626607 crowdCB.addItemListener(this);
627608
628
- constraints.gridy += 1;
629
- panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), constraints);
609
+ //constraints.gridy += 1;
610
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
630611 smoothCB.setToolTipText("Snapping delay");
631612 smoothCB.addItemListener(this);
632613
633
- constraints.gridy += 1;
634
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), constraints);
614
+ //constraints.gridy += 1;
615
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
635616 slowCB.setToolTipText("Smooth interpolation");
636617 slowCB.addItemListener(this);
637
- constraints.gridy += 1;
638
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), constraints);
618
+ //constraints.gridy += 1;
619
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
639620 boxCB.setToolTipText("Display bounding boxes");
640621 boxCB.addItemListener(this);
641
- constraints.gridy += 1;
642
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints);
622
+ //constraints.gridy += 1;
623
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
643624 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
644625 zoomBoxCB.addItemListener(this);
645626
....@@ -650,16 +631,16 @@
650631 if (false)
651632 {
652633 // handled in scripts
653
- constraints.gridy += 1;
654
- panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints);
634
+ //constraints.gridy += 1;
635
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
655636 speakerCameraCB.addItemListener(this);
656637
657
- constraints.gridy += 1;
658
- panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints);
638
+ //constraints.gridy += 1;
639
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
659640 speakerFocusCB.addItemListener(this);
660641
661
- constraints.gridy += 1;
662
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints);
642
+ //constraints.gridy += 1;
643
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
663644 smoothfocusCB.addItemListener(this);
664645 }
665646
....@@ -667,14 +648,20 @@
667648 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
668649 // debugCB.addItemListener(this);
669650
670
- constraints.gridy += 1;
671
- panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints);
651
+ //constraints.gridy += 1;
652
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
672653 oeilCB.addItemListener(this);
673654
674
- constraints.gridy += 1;
675
- panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints);
655
+ //constraints.gridy += 1;
656
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
676657 lookAtCB.setToolTipText("Look-at target");
677658 lookAtCB.addItemListener(this);
659
+
660
+ cGridBag fill = new cGridBag();
661
+
662
+ fill.preferredHeight = 200;
663
+
664
+ panel.add(fill);
678665
679666 }
680667
....@@ -1518,6 +1505,7 @@
15181505 //
15191506 public void actionPerformed(ActionEvent event) // , Object arg)
15201507 {
1508
+ Object source = event.getSource();
15211509 /*
15221510 if (event.getSource() == nameField)
15231511 {
....@@ -1529,11 +1517,11 @@
15291517 }
15301518 else
15311519 */
1532
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1520
+ if (source == lookAtItem || source == lookFromItem)
15331521 {
15341522 ScreenFit();
15351523 } else
1536
- if (event.getSource() == switchItem)
1524
+ if (source == switchItem)
15371525 {
15381526 cVector v1 = new cVector();
15391527 cVector v2 = new cVector();
....@@ -1542,11 +1530,11 @@
15421530 objEditor.cameraView.renderCamera.setAim(v2, v1);
15431531 objEditor.cameraView.repaint();
15441532 } else
1545
- if (event.getSource() == rectoidItem)
1533
+ if (source == rectoidItem)
15461534 {
15471535 makeSomething(new Box());
15481536 } else
1549
- if (event.getSource() == particleItem)
1537
+ if (source == particleItem)
15501538 {
15511539 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15521540 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1567,9 +1555,9 @@
15671555 applyExample(particleGeom, "SMOKE");
15681556 makeSomething(particleGeom);
15691557 } else
1570
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1558
+ if (source == ragdollItem || source == ragdoll2Item)
15711559 {
1572
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1560
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15731561
15741562 ragdoll.toParent = LA.newMatrix();
15751563 ragdoll.fromParent = LA.newMatrix();
....@@ -1587,7 +1575,7 @@
15871575 } else
15881576 /*
15891577 */
1590
- if (event.getSource() == heightFieldItem)
1578
+ if (source == heightFieldItem)
15911579 {
15921580 Object3D obj = new Object3D();
15931581
....@@ -1625,31 +1613,31 @@
16251613
16261614 makeSomething(obj);
16271615 } else
1628
- if (event.getSource() == gridItem)
1616
+ if (source == gridItem)
16291617 {
16301618 makeSomething(new Grid());
16311619 } else
1632
- if (event.getSource() == ellipsoidItem)
1620
+ if (source == ellipsoidItem)
16331621 {
16341622 makeSomething(new Sphere());
16351623 } else
1636
- if (event.getSource() == coneItem)
1624
+ if (source == coneItem)
16371625 {
16381626 makeSomething(new Cone());
16391627 } else
1640
- if (event.getSource() == torusItem)
1628
+ if (source == torusItem)
16411629 {
16421630 makeSomething(new Torus());
16431631 } else
1644
- if (event.getSource() == superItem)
1632
+ if (source == superItem)
16451633 {
16461634 makeSomething(new Superellipsoid());
16471635 } else
1648
- if (event.getSource() == kleinItem)
1636
+ if (source == kleinItem)
16491637 {
16501638 makeSomething(new Klein());
16511639 } else
1652
- if (event.getSource() == blobItem)
1640
+ if (source == blobItem)
16531641 {
16541642 Blob blob = new Blob();
16551643 BlobComponent comp = new BlobComponent();
....@@ -1657,15 +1645,15 @@
16571645 //blob.retile();
16581646 makeSomething(blob);
16591647 } else
1660
- if (event.getSource() == latheItem)
1648
+ if (source == latheItem)
16611649 {
16621650 makeSomething(new Lathe());
16631651 } else
1664
- if (event.getSource() == bezierItem)
1652
+ if (source == bezierItem)
16651653 {
16661654 makeSomething(new BezierSurface());
16671655 } else
1668
- if (event.getSource() == checkerItem)
1656
+ if (source == checkerItem)
16691657 {
16701658 /*
16711659 Object3D obj = new BezierSurface(5,8);
....@@ -1680,7 +1668,7 @@
16801668 */
16811669 makeSomething(new Checker());
16821670 } else
1683
- if (event.getSource() == meshItem)
1671
+ if (source == meshItem)
16841672 {
16851673 Object3D itemtomake = new Object3D();
16861674 Object3D child;
....@@ -1701,35 +1689,35 @@
17011689 makeSomething(child);
17021690 }
17031691 } else
1704
- if (event.getSource() == springItem)
1692
+ if (source == springItem)
17051693 {
17061694 cSpring s = new cSpring();
17071695 s.setup();
17081696 makeSomething(s);
17091697 } else
1710
- if (event.getSource() == flagItem)
1698
+ if (source == flagItem)
17111699 {
17121700 cSpring s = new cFlag();
17131701 s.setup();
17141702 makeSomething(s);
17151703 } else
1716
- if (event.getSource() == lightItem)
1704
+ if (source == lightItem)
17171705 {
17181706 makeSomething(new Light());
17191707 } else
1720
- if (event.getSource() == csgItem)
1708
+ if (source == csgItem)
17211709 {
17221710 group(new CSG());
17231711 } else
1724
- if (event.getSource() == templateItem)
1712
+ if (source == templateItem)
17251713 {
17261714 group(new cTemplate());
17271715 } else
1728
- if (event.getSource() == attributeItem)
1716
+ if (source == attributeItem)
17291717 {
17301718 makeSomething(new Attribute());
17311719 } else
1732
- if (event.getSource() == pointflowItem)
1720
+ if (source == pointflowItem)
17331721 {
17341722 makeSomething(new PointFlow());
17351723 } else
....@@ -1741,7 +1729,7 @@
17411729 } else
17421730 */
17431731
1744
- if (event.getSource() == superLoopItem)
1732
+ if (source == superLoopItem)
17451733 {
17461734 Composite g = new cGroup();
17471735 for (int i=0; i<15; i++)
....@@ -1763,7 +1751,7 @@
17631751
17641752 group(g);
17651753 } else
1766
- if (event.getSource() == loopItem)
1754
+ if (source == loopItem)
17671755 {
17681756 Composite csg = new GroupLeaf();
17691757 csg.count = 5;
....@@ -1772,7 +1760,7 @@
17721760 csg.addChild(child);
17731761 child.addChild(csg);
17741762 } else
1775
- if (event.getSource() == doubleItem)
1763
+ if (source == doubleItem)
17761764 {
17771765 Composite csg = new GroupLeaf();
17781766 csg.count = 5;
....@@ -1784,7 +1772,7 @@
17841772 csg.addChild(child);
17851773 child.addChild(csg);
17861774 } else
1787
- if (event.getSource() == tripleItem)
1775
+ if (source == tripleItem)
17881776 {
17891777 Composite csg = new GroupLeaf();
17901778 csg.count = 4;
....@@ -1800,70 +1788,70 @@
18001788 child.addChild(csg);
18011789 } else
18021790
1803
- if (event.getSource() == importGFDItem)
1791
+ if (source == importGFDItem)
18041792 {
18051793 ImportGFD();
18061794 } else
1807
- if (event.getSource() == importVRMLX3DItem)
1795
+ if (source == importVRMLX3DItem)
18081796 {
18091797 ImportVRMLX3D();
18101798 } else
1811
- if (event.getSource() == import3DSItem)
1799
+ if (source == import3DSItem)
18121800 {
18131801 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
18141802 } else
1815
- if (event.getSource() == importOBJItem)
1803
+ if (source == importOBJItem)
18161804 {
18171805 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
18181806 } else
1819
- if (event.getSource() == computeAOItem)
1807
+ if (source == computeAOItem)
18201808 {
18211809 Globals.drawMode = CameraPane.OCCLUSION;
18221810 Globals.theRenderer.repaint();
18231811 } else
1824
- if (event.getSource() == recompileItem)
1812
+ if (source == recompileItem)
18251813 {
18261814 Recompile();
18271815 refreshContents();
18281816 } else
1829
- if (event.getSource() == editScriptItem)
1817
+ if (source == editScriptItem)
18301818 {
18311819 OpenDialog();
18321820 refreshContents();
18331821 } else
1834
- if (event.getSource() == invariantsItem)
1822
+ if (source == invariantsItem)
18351823 {
18361824 System.out.println("Invariants:");
18371825 GrafreeD.grafreeD.universe.invariants();
18381826 } else
1839
- if (event.getSource() == memoryItem)
1827
+ if (source == memoryItem)
18401828 {
18411829 //System.out.println("Invariants:");
18421830 PrintMemory();
18431831 } else
1844
- if (event.getSource() == pathItem)
1832
+ if (source == pathItem)
18451833 {
18461834 PrintPath();
18471835 } else
1848
- if (event.getSource() == analyzeItem)
1836
+ if (source == analyzeItem)
18491837 {
18501838 AnalyzeObject();
18511839 } else
1852
- if (event.getSource() == dumpItem)
1840
+ if (source == dumpItem)
18531841 {
18541842 DumpObject();
18551843 } else
1856
- if (event.getSource() == screenfitButton)
1844
+ if (source == screenfitButton)
18571845 {
18581846 //Reload(lastConverter, lastFilename, true);
18591847 ScreenFit();
18601848 } else
1861
- if (event.getSource() == screenfitpointButton)
1849
+ if (source == screenfitpointButton)
18621850 {
18631851 //Reload(lastConverter, lastFilename, true);
18641852 ScreenFitPoint();
18651853 } else
1866
- if (event.getSource() == snapobjectButton)
1854
+ if (source == snapobjectButton)
18671855 {
18681856 //Reload(lastConverter, lastFilename, true);
18691857 SnapObject();
....@@ -1874,13 +1862,13 @@
18741862 // Recompile();
18751863 // refreshContents();
18761864 // } else
1877
- if (event.getSource() == gcButton)
1865
+ if (source == gcButton)
18781866 {
18791867 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18801868 System.gc();
18811869 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18821870 } else
1883
- if (event.getSource() == editLeafItem)
1871
+ if (source == editLeafItem)
18841872 {
18851873 Object3D obj;
18861874 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1894,62 +1882,62 @@
18941882 }
18951883 refreshContents(true);
18961884 } else
1897
- if (event.getSource() == openWindowItem)
1885
+ if (source == openWindowItem)
18981886 {
18991887 EditSelection(true);
19001888 } else
1901
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1889
+ if (source == cutItem || source == clearButton)
19021890 {
19031891 loadClipboard(true);
19041892 } else
1905
- if (event.getSource() == duplicateItem)
1893
+ if (source == duplicateItem)
19061894 {
19071895 Object3D keep = GrafreeD.clipboard;
19081896 loadClipboard(false);
19091897 paste(false);
19101898 GrafreeD.clipboard = keep;
19111899 } else
1912
- if (event.getSource() == cloneItem)
1900
+ if (source == cloneItem)
19131901 {
19141902 CloneSelection(false);
19151903 } else
1916
- if (event.getSource() == cloneSupportItem)
1904
+ if (source == cloneSupportItem)
19171905 {
19181906 CloneSelection(true);
19191907 } else
1920
- if (event.getSource() == copyItem)
1908
+ if (source == copyItem)
19211909 {
19221910 loadClipboard(false);
19231911 } else
1924
- if (event.getSource() == pasteItem)
1912
+ if (source == pasteItem)
19251913 {
19261914 paste(false);
19271915 } else
1928
- if (event.getSource() == pasteLinkItem)
1916
+ if (source == pasteLinkItem)
19291917 {
19301918 pasteInto(false);
19311919 } else
1932
- if (event.getSource() == pasteCloneItem)
1920
+ if (source == pasteCloneItem)
19331921 {
19341922 pasteInto(true);
19351923 } else
1936
- if (event.getSource() == pasteExpandItem)
1924
+ if (source == pasteExpandItem)
19371925 {
19381926 paste(true);
19391927 } else
1940
- if (event.getSource() == synchronizeItem)
1928
+ if (source == synchronizeItem)
19411929 {
19421930 Overwrite(Object3D.TRANSFORM);
19431931 } else
1944
- if (event.getSource() == overwriteNameItem)
1932
+ if (source == overwriteNameItem)
19451933 {
19461934 Overwrite(Object3D.NAME);
19471935 } else
1948
- if (event.getSource() == overwriteUVItem)
1936
+ if (source == overwriteUVItem)
19491937 {
19501938 Overwrite(Object3D.UV);
19511939 } else
1952
- if (event.getSource() == overwriteMatItem)
1940
+ if (source == overwriteMatItem)
19531941 {
19541942 /* july 2015
19551943 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1969,7 +1957,7 @@
19691957
19701958 Overwrite(dropAttributes);
19711959 }
1972
- if (event.getSource() == overwriteGeoItem)
1960
+ if (source == overwriteGeoItem)
19731961 {
19741962 Overwrite(Object3D.GEOMETRY);
19751963 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1986,7 +1974,7 @@
19861974 // refreshContents();
19871975 // }
19881976 } else
1989
- if (event.getSource() == generateMeshItem)
1977
+ if (source == generateMeshItem)
19901978 {
19911979 //if (group.selection.size() == 1)
19921980 // for (int i=0; i<group.selection.size(); i++)
....@@ -1997,7 +1985,7 @@
19971985 ResetModel();
19981986 refreshContents();
19991987 } else
2000
- if (event.getSource() == extractGeometriesItem)
1988
+ if (source == extractGeometriesItem)
20011989 {
20021990 boolean one = false;
20031991
....@@ -2024,7 +2012,7 @@
20242012 ResetModel();
20252013 refreshContents();
20262014 } else
2027
- if (event.getSource() == cloneGeometriesItem)
2015
+ if (source == cloneGeometriesItem)
20282016 {
20292017 boolean one = false;
20302018
....@@ -2050,7 +2038,7 @@
20502038 ResetModel();
20512039 refreshContents();
20522040 } else
2053
- if (event.getSource() == shareGeometriesItem)
2041
+ if (source == shareGeometriesItem)
20542042 {
20552043 boolean one = false;
20562044
....@@ -2080,7 +2068,7 @@
20802068 refreshContents();
20812069 }
20822070 } else
2083
- if (event.getSource() == mergeGeometriesItem)
2071
+ if (source == mergeGeometriesItem)
20842072 {
20852073 boolean one = false;
20862074
....@@ -2110,7 +2098,7 @@
21102098 ResetModel();
21112099 refreshContents();
21122100 } else
2113
- if (event.getSource() == linkverticesItem)
2101
+ if (source == linkverticesItem)
21142102 {
21152103 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21162104 // {
....@@ -2143,7 +2131,7 @@
21432131 refreshContents();
21442132 }
21452133 } else
2146
- if (event.getSource() == resetsupportItem)
2134
+ if (source == resetsupportItem)
21472135 {
21482136 for (int i=0; i<group.selection.size(); i++)
21492137 {
....@@ -2155,7 +2143,7 @@
21552143
21562144 refreshContents();
21572145 } else
2158
- if (event.getSource() == relinkverticesItem)
2146
+ if (source == relinkverticesItem)
21592147 {
21602148 boolean random = CameraPane.RANDOM;
21612149 CameraPane.RANDOM = false; // parse all random nodes
....@@ -2164,7 +2152,7 @@
21642152
21652153 refreshContents();
21662154 } else
2167
- if (event.getSource() == resetreferencesItem)
2155
+ if (source == resetreferencesItem)
21682156 {
21692157 for (int i=0; i<group.selection.size(); i++)
21702158 {
....@@ -2173,7 +2161,7 @@
21732161
21742162 refreshContents();
21752163 } else
2176
- if (event.getSource() == setMasterItem)
2164
+ if (source == setMasterItem)
21772165 {
21782166 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21792167 {
....@@ -2186,7 +2174,7 @@
21862174 refreshContents();
21872175 }
21882176 } else
2189
- if (event.getSource() == poseMeshItem)
2177
+ if (source == poseMeshItem)
21902178 {
21912179 if (group.selection.size() == 1)
21922180 {
....@@ -2205,19 +2193,19 @@
22052193 }
22062194
22072195 } else
2208
- if (event.getSource() == revertMeshItem)
2196
+ if (source == revertMeshItem)
22092197 {
22102198 RevertMeshes();
22112199 } else
2212
- if (event.getSource() == resetMeshItem)
2200
+ if (source == resetMeshItem)
22132201 {
22142202 ResetAll();
22152203 } else
2216
- if (event.getSource() == stepAllItem)
2204
+ if (source == stepAllItem)
22172205 {
22182206 StepAll();
22192207 } else
2220
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2208
+ if (source == clearItem) // || event.getSource() == clearButton)
22212209 {
22222210 //int indices[] = jList.getSelectedIndices();
22232211 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2225,46 +2213,46 @@
22252213
22262214 ClearSelection(false);
22272215 } else
2228
- if (event.getSource() == clearAllItem)
2216
+ if (source == clearAllItem)
22292217 {
22302218 ClearSelection(true);
22312219 } else
2232
- if (event.getSource() == grabItem)
2220
+ if (source == grabItem)
22332221 {
22342222 group(new cGroup(), true);
22352223 } else
2236
- if (event.getSource() == hideItem)
2224
+ if (source == hideItem)
22372225 {
22382226 group(new HiddenObject());
22392227 } else
2240
- if (event.getSource() == frontItem)
2228
+ if (source == frontItem)
22412229 {
22422230 front();
22432231 } else
2244
- if (event.getSource() == backItem)
2232
+ if (source == backItem)
22452233 {
22462234 back();
22472235 } else
2248
- if (event.getSource() == cameraItem)
2236
+ if (source == cameraItem)
22492237 {
22502238 makeSomething(new Camera());
22512239 } else
2252
- if (event.getSource() == compositeItem)
2240
+ if (source == compositeItem)
22532241 {
22542242 group(new Composite());
22552243 } else
2256
- if (event.getSource() == randomItem)
2244
+ if (source == randomItem)
22572245 {
22582246 RandomNode random = new RandomNode();
22592247 group(random);
22602248 if (random.size() > 0)
22612249 random.name = random.get(0).name + "Rnd";
22622250 } else
2263
- if (event.getSource() == physicsItem)
2251
+ if (source == physicsItem)
22642252 {
22652253 group(new PhysicsNode());
22662254 } else
2267
- if (event.getSource() == frameselectorItem)
2255
+ if (source == frameselectorItem)
22682256 {
22692257 for (int i=0; i<group.selection.size(); i++)
22702258 {
....@@ -2276,7 +2264,7 @@
22762264 ResetModel();
22772265 refreshContents();
22782266 } else
2279
- if (event.getSource() == switchGeoItem)
2267
+ if (source == switchGeoItem)
22802268 {
22812269 for (int i=0; i<group.selection.size(); i++)
22822270 {
....@@ -2288,7 +2276,7 @@
22882276 ResetModel();
22892277 refreshContents();
22902278 } else
2291
- if (event.getSource() == switchTransfoItem)
2279
+ if (source == switchTransfoItem)
22922280 {
22932281 for (int i=0; i<group.selection.size(); i++)
22942282 {
....@@ -2300,7 +2288,7 @@
23002288 ResetModel();
23012289 refreshContents();
23022290 } else
2303
- if (event.getSource() == morphItem)
2291
+ if (source == morphItem)
23042292 {
23052293 for (int i=0; i<group.selection.size(); i++)
23062294 {
....@@ -2312,7 +2300,7 @@
23122300 ResetModel();
23132301 refreshContents();
23142302 } else
2315
- if (event.getSource() == scriptNodeItem)
2303
+ if (source == scriptNodeItem)
23162304 {
23172305 boolean atleastone = false;
23182306
....@@ -2351,31 +2339,31 @@
23512339 }
23522340 }
23532341 } else
2354
- if (event.getSource() == linkerItem)
2342
+ if (source == linkerItem)
23552343 {
23562344 group(new cLinker());
23572345 } else
2358
- if (event.getSource() == textureItem)
2346
+ if (source == textureItem)
23592347 {
23602348 group(new TextureNode());
23612349 } else
2362
- if (event.getSource() == billboardItem)
2350
+ if (source == billboardItem)
23632351 {
23642352 group(new BillboardNode());
23652353 } else
2366
- if (event.getSource() == shadowXItem)
2354
+ if (source == shadowXItem)
23672355 {
23682356 CastShadow(0);
23692357 } else
2370
- if (event.getSource() == shadowYItem)
2358
+ if (source == shadowYItem)
23712359 {
23722360 CastShadow(1);
23732361 } else
2374
- if (event.getSource() == shadowZItem)
2362
+ if (source == shadowZItem)
23752363 {
23762364 CastShadow(2);
23772365 } else
2378
- if (event.getSource() == ungroupItem)
2366
+ if (source == ungroupItem)
23792367 {
23802368 //ungroup();
23812369 for (int i=0; i<group.selection.size(); i++)
....@@ -2387,179 +2375,179 @@
23872375
23882376 refreshContents();
23892377 } else
2390
- if (event.getSource() == genUVItem)
2378
+ if (source == genUVItem)
23912379 {
23922380 GenUV();
23932381 } else
2394
- if (event.getSource() == genNormalsCADItem)
2382
+ if (source == genNormalsCADItem)
23952383 {
23962384 GenNormals(true);
23972385 } else
2398
- if (event.getSource() == genNormalsMESHItem)
2386
+ if (source == genNormalsMESHItem)
23992387 {
24002388 GenNormals(true); // TODO
24012389 } else
2402
- if (event.getSource() == genNormalsORGANItem)
2390
+ if (source == genNormalsORGANItem)
24032391 {
24042392 GenNormals(false);
24052393 } else
2406
- if (event.getSource() == genNormalsMINEItem)
2394
+ if (source == genNormalsMINEItem)
24072395 {
24082396 GenNormalsMINE();
24092397 } else
2410
- if (event.getSource() == stripifyItem)
2398
+ if (source == stripifyItem)
24112399 {
24122400 Stripify();
24132401 } else
2414
- if (event.getSource() == unstripifyItem)
2402
+ if (source == unstripifyItem)
24152403 {
24162404 Unstripify();
24172405 } else
2418
- if (event.getSource() == trimItem)
2406
+ if (source == trimItem)
24192407 {
24202408 Trim();
24212409 } else
2422
- if (event.getSource() == untrimItem)
2410
+ if (source == untrimItem)
24232411 {
24242412 Untrim();
24252413 } else
2426
- if (event.getSource() == clearColorsItem)
2414
+ if (source == clearColorsItem)
24272415 {
24282416 ClearColors();
24292417 } else
2430
- if (event.getSource() == clearMaterialsItem)
2418
+ if (source == clearMaterialsItem)
24312419 {
24322420 ClearMaterials();
24332421 } else
2434
- if (event.getSource() == liveleavesItem)
2422
+ if (source == liveleavesItem)
24352423 {
24362424 LiveLeaves(true);
24372425 } else
2438
- if (event.getSource() == unliveleavesItem)
2426
+ if (source == unliveleavesItem)
24392427 {
24402428 LiveLeaves(false);
24412429 } else
2442
- if (event.getSource() == supportleavesItem)
2430
+ if (source == supportleavesItem)
24432431 {
24442432 SupportLeaves(true);
24452433 } else
2446
- if (event.getSource() == unsupportleavesItem)
2434
+ if (source == unsupportleavesItem)
24472435 {
24482436 SupportLeaves(false);
24492437 } else
2450
- if (event.getSource() == hideleavesItem)
2438
+ if (source == hideleavesItem)
24512439 {
24522440 HideLeaves(true);
24532441 } else
2454
- if (event.getSource() == showleavesItem)
2442
+ if (source == showleavesItem)
24552443 {
24562444 HideLeaves(false);
24572445 } else
2458
- if (event.getSource() == markleavesItem)
2446
+ if (source == markleavesItem)
24592447 {
24602448 MarkLeaves(true);
24612449 } else
2462
- if (event.getSource() == unmarkleavesItem)
2450
+ if (source == unmarkleavesItem)
24632451 {
24642452 MarkLeaves(false);
24652453 } else
2466
- if (event.getSource() == flipVItem)
2454
+ if (source == flipVItem)
24672455 {
24682456 FlipV(true);
24692457 } else
2470
- if (event.getSource() == unflipVItem)
2458
+ if (source == unflipVItem)
24712459 {
24722460 FlipV(false);
24732461 } else
2474
- if (event.getSource() == lowTexturesItem)
2462
+ if (source == lowTexturesItem)
24752463 {
24762464 SetTexRes(0);
24772465 } else
2478
- if (event.getSource() == normalTexturesItem)
2466
+ if (source == normalTexturesItem)
24792467 {
24802468 SetTexRes(1);
24812469 } else
2482
- if (event.getSource() == highTexturesItem)
2470
+ if (source == highTexturesItem)
24832471 {
24842472 SetTexRes(2);
24852473 } else
2486
- if (event.getSource() == veryhighTexturesItem)
2474
+ if (source == veryhighTexturesItem)
24872475 {
24882476 SetTexRes(3);
24892477 } else
2490
- if (event.getSource() == maxTexturesItem)
2478
+ if (source == maxTexturesItem)
24912479 {
24922480 SetTexRes(4);
24932481 } else
2494
- if (event.getSource() == panoTexturesItem)
2482
+ if (source == panoTexturesItem)
24952483 {
24962484 SetTexRes(5);
24972485 } else
2498
- if (event.getSource() == reverseNormalsItem)
2486
+ if (source == reverseNormalsItem)
24992487 {
25002488 ReverseNormals();
25012489 } else
2502
- if (event.getSource() == parseverticesItem)
2490
+ if (source == parseverticesItem)
25032491 {
25042492 ParseVertices();
25052493 } else
2506
- if (event.getSource() == textureFieldItem)
2494
+ if (source == textureFieldItem)
25072495 {
25082496 TextureVertices();
25092497 } else
2510
- if (event.getSource() == alignItem)
2498
+ if (source == alignItem)
25112499 {
25122500 Align();
25132501 } else
2514
- if (event.getSource() == mirrorItem)
2502
+ if (source == mirrorItem)
25152503 {
25162504 MirrorPoses();
25172505 } else
2518
- if (event.getSource() == reduceMorphItem)
2506
+ if (source == reduceMorphItem)
25192507 {
25202508 MeshReduction(false);
25212509 } else
2522
- if (event.getSource() == reduce34MorphItem)
2510
+ if (source == reduce34MorphItem)
25232511 {
25242512 MeshReduction(true);
25252513 } else
2526
- if (event.getSource() == reverseTrianglesItem)
2514
+ if (source == reverseTrianglesItem)
25272515 {
25282516 ReverseTriangles();
25292517 } else
2530
- if (event.getSource() == reduceMeshItem)
2518
+ if (source == reduceMeshItem)
25312519 {
25322520 ReduceMesh(false);
25332521 } else
2534
- if (event.getSource() == reduce34MeshItem)
2522
+ if (source == reduce34MeshItem)
25352523 {
25362524 ReduceMesh(true);
25372525 } else
2538
- if (event.getSource() == increaseMeshItem)
2526
+ if (source == increaseMeshItem)
25392527 {
25402528 IncreaseMesh();
25412529 } else
2542
- if (event.getSource() == clipMeshItem)
2530
+ if (source == clipMeshItem)
25432531 {
25442532 ClipMesh();
25452533 } else
2546
- if (event.getSource() == smoothMeshItem)
2534
+ if (source == smoothMeshItem)
25472535 {
25482536 SmoothMesh();
25492537 } else
2550
- if (event.getSource() == transformgeometryItem)
2538
+ if (source == transformgeometryItem)
25512539 {
25522540 TransformGeometry();
25532541 } else
2554
- if (event.getSource() == resetTransformItem)
2542
+ if (source == resetTransformItem)
25552543 {
25562544 ResetTransform();
25572545 } else
2558
- if (event.getSource() == resetCentroidItem)
2546
+ if (source == resetCentroidItem)
25592547 {
25602548 ResetCentroid();
25612549 } else
2562
- if (event.getSource() == resetParentItem)
2550
+ if (source == resetParentItem)
25632551 {
25642552 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25652553 {
....@@ -2569,7 +2557,7 @@
25692557
25702558 refreshContents();
25712559 } else
2572
- if (event.getSource() == repairParentItem)
2560
+ if (source == repairParentItem)
25732561 {
25742562 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25752563 {
....@@ -2583,7 +2571,7 @@
25832571
25842572 refreshContents();
25852573 } else
2586
- if (event.getSource() == repairShadowItem)
2574
+ if (source == repairShadowItem)
25872575 {
25882576 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25892577 {
....@@ -2597,7 +2585,7 @@
25972585
25982586 refreshContents();
25992587 } else
2600
- if (event.getSource() == sortbysizeItem)
2588
+ if (source == sortbysizeItem)
26012589 {
26022590 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26032591 {
....@@ -2609,7 +2597,7 @@
26092597 ResetModel();
26102598 refreshContents();
26112599 } else
2612
- if (event.getSource() == sortbynameItem)
2600
+ if (source == sortbynameItem)
26132601 {
26142602 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26152603 {
....@@ -2621,7 +2609,7 @@
26212609 ResetModel();
26222610 refreshContents();
26232611 } else
2624
- if (event.getSource() == attachPigmentItem)
2612
+ if (source == attachPigmentItem)
26252613 {
26262614 String texture = GetFile("Attach pigment");
26272615 Object3D obj;
....@@ -2633,7 +2621,7 @@
26332621
26342622 refreshContents();
26352623 } else
2636
- if (event.getSource() == detachPigmentItem)
2624
+ if (source == detachPigmentItem)
26372625 {
26382626 Object3D obj;
26392627 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2644,7 +2632,7 @@
26442632
26452633 refreshContents();
26462634 } else
2647
- if (event.getSource() == attachBumpItem)
2635
+ if (source == attachBumpItem)
26482636 {
26492637 String texture = GetFile("Attach bump");
26502638 Object3D obj;
....@@ -2656,7 +2644,7 @@
26562644
26572645 refreshContents();
26582646 } else
2659
- if (event.getSource() == detachBumpItem)
2647
+ if (source == detachBumpItem)
26602648 {
26612649 Object3D obj;
26622650 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2667,7 +2655,7 @@
26672655
26682656 refreshContents();
26692657 } else
2670
- if (event.getSource() == pigmentBumpItem)
2658
+ if (source == pigmentBumpItem)
26712659 {
26722660 Object3D obj;
26732661 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2678,158 +2666,195 @@
26782666
26792667 refreshContents();
26802668 } else
2681
- if (event.getSource() == flashSelectionButton)
2669
+ if (source == flashSelectionButton)
26822670 {
26832671 CameraPane.flash = true;
26842672 refreshContents();
26852673 } else
2686
- if (event.getSource() == oneButton)
2674
+ if (source == oneButton)
26872675 {
26882676 } else
2689
- if (event.getSource() == twoButton)
2677
+ if (source == twoButton)
26902678 {
26912679 radio.layout = twoButton;
26922680 // bug
26932681 //gridPanel.setDividerLocation(1.0);
26942682 //bigPanel.setDividerLocation(0.0);
2695
- bigThree.remove(scenePanel);
2696
- bigThree.remove(centralPanel);
2697
- bigThree.remove(XYZPanel);
2698
- aWindowConstraints.gridx = 0;
2699
- aWindowConstraints.gridy = 0;
2700
- aWindowConstraints.gridwidth = 1;
2701
- // aConstraints.gridheight = 3;
2702
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2703
- aWindowConstraints.weightx = 0;
2704
- aWindowConstraints.weighty = 1;
2705
- //bigThree.add(jtp, aWindowConstraints);
2706
- aWindowConstraints.weightx = 1;
2707
- aWindowConstraints.gridwidth = 3;
2708
- // aConstraints.gridheight = 3;
2709
- aWindowConstraints.gridx = 1;
2710
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2711
- bigThree.add(centralPanel, aWindowConstraints);
2712
- aWindowConstraints.weightx = 0;
2713
- aWindowConstraints.gridx = 4;
2714
- aWindowConstraints.gridwidth = 1;
2715
- // aConstraints.gridheight = 3;
2716
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2717
- //bigThree.add(XYZPanel, aWindowConstraints);
2718
- bigThree.revalidate();
2683
+// bigThree.remove(scenePanel);
2684
+// bigThree.remove(centralPanel);
2685
+// bigThree.remove(XYZPanel);
2686
+// aWindowConstraints.gridx = 0;
2687
+// aWindowConstraints.gridy = 0;
2688
+// aWindowConstraints.gridwidth = 1;
2689
+// // aConstraints.gridheight = 3;
2690
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2691
+// aWindowConstraints.weightx = 0;
2692
+// aWindowConstraints.weighty = 1;
2693
+// //bigThree.add(jtp, aWindowConstraints);
2694
+// aWindowConstraints.weightx = 1;
2695
+// aWindowConstraints.gridwidth = 3;
2696
+// // aConstraints.gridheight = 3;
2697
+// aWindowConstraints.gridx = 1;
2698
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2699
+// bigThree.add(centralPanel, aWindowConstraints);
2700
+// aWindowConstraints.weightx = 0;
2701
+// aWindowConstraints.gridx = 4;
2702
+// aWindowConstraints.gridwidth = 1;
2703
+// // aConstraints.gridheight = 3;
2704
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2705
+// //bigThree.add(XYZPanel, aWindowConstraints);
2706
+// scenePanel.setVisible(false);
2707
+// centralPanel.setVisible(true);
2708
+// XYZPanel.setVisible(false);
2709
+ bigThree.ClearUI();
2710
+ bigThree.add(centralPanel);
2711
+ bigThree.FlushUI();
27192712 } else
2720
- if (event.getSource() == threeButton)
2713
+ if (source == threeButton)
27212714 {
27222715 radio.layout = threeButton;
2723
- bigThree.remove(scenePanel);
2724
- bigThree.remove(centralPanel);
2725
- bigThree.remove(XYZPanel);
2726
- aWindowConstraints.gridx = 0;
2727
- aWindowConstraints.gridy = 0;
2728
- aWindowConstraints.gridwidth = 1;
2729
- // aConstraints.gridheight = 3;
2730
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2731
- aWindowConstraints.weightx = 0;
2732
- aWindowConstraints.weighty = 1;
2733
- //bigThree.add(jtp, aWindowConstraints);
2734
- aWindowConstraints.weightx = 1;
2735
- aWindowConstraints.gridwidth = 3;
2736
- // aConstraints.gridheight = 3;
2737
- aWindowConstraints.gridx = 1;
2738
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2739
- bigThree.add(centralPanel, aWindowConstraints);
2740
- aWindowConstraints.weightx = 0;
2741
- aWindowConstraints.gridx = 4;
2742
- aWindowConstraints.gridwidth = 1;
2743
- // aConstraints.gridheight = 3;
2744
- aConstraints.fill = GridBagConstraints.VERTICAL;
2745
- bigThree.add(XYZPanel, aWindowConstraints);
2746
- bigThree.revalidate();
2716
+
2717
+// bigThree.remove(scenePanel);
2718
+// bigThree.remove(centralPanel);
2719
+// bigThree.remove(XYZPanel);
2720
+// aWindowConstraints.gridx = 0;
2721
+// aWindowConstraints.gridy = 0;
2722
+// aWindowConstraints.gridwidth = 1;
2723
+// // aConstraints.gridheight = 3;
2724
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2725
+// aWindowConstraints.weightx = 0;
2726
+// aWindowConstraints.weighty = 1;
2727
+// //bigThree.add(jtp, aWindowConstraints);
2728
+// aWindowConstraints.weightx = 1;
2729
+// aWindowConstraints.gridwidth = 3;
2730
+// // aConstraints.gridheight = 3;
2731
+// aWindowConstraints.gridx = 1;
2732
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2733
+// bigThree.add(centralPanel, aWindowConstraints);
2734
+// aWindowConstraints.weightx = 0;
2735
+// aWindowConstraints.gridx = 4;
2736
+// aWindowConstraints.gridwidth = 1;
2737
+// // aConstraints.gridheight = 3;
2738
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2739
+// bigThree.add(XYZPanel, aWindowConstraints);
2740
+// bigThree.validate();
2741
+// scenePanel.setVisible(false);
2742
+// centralPanel.setVisible(true);
2743
+// XYZPanel.setVisible(true);
2744
+ bigThree.ClearUI();
2745
+ bigThree.add(centralPanel);
2746
+ bigThree.add(XYZPanel);
2747
+ bigThree.FlushUI();
27472748 } else
2748
- if (event.getSource() == fourButton)
2749
+ if (source == fourButton)
27492750 {
27502751 radio.layout = fourButton;
2751
- bigThree.remove(scenePanel);
2752
- bigThree.remove(centralPanel);
2753
- bigThree.remove(XYZPanel);
2754
- aWindowConstraints.gridx = 0;
2755
- aWindowConstraints.gridy = 0;
2756
- aWindowConstraints.gridwidth = 1;
2757
- // aWindowConstraints.gridheight = 3;
2758
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2759
- aWindowConstraints.weightx = 1;
2760
- aWindowConstraints.weighty = 1;
2761
- bigThree.add(scenePanel, aWindowConstraints);
2762
- aWindowConstraints.weightx = 1;
2763
- aWindowConstraints.gridwidth = 3;
2764
- // aConstraints.gridheight = 3;
2765
- aWindowConstraints.gridx = 1;
2766
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2767
- //bigThree.add(cameraPanel, aWindowConstraints);
2768
- aWindowConstraints.weightx = 0;
2769
- aWindowConstraints.gridx = 4;
2770
- aWindowConstraints.gridwidth = 1;
2771
- // aWindowConstraints.gridheight = 3;
2772
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2773
- //bigThree.add(XYZPanel, aWindowConstraints);
2774
- bigThree.revalidate();
2752
+
2753
+// bigThree.remove(scenePanel);
2754
+// bigThree.remove(centralPanel);
2755
+// bigThree.remove(XYZPanel);
2756
+// aWindowConstraints.gridx = 0;
2757
+// aWindowConstraints.gridy = 0;
2758
+// aWindowConstraints.gridwidth = 1;
2759
+// // aWindowConstraints.gridheight = 3;
2760
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2761
+// aWindowConstraints.weightx = 1;
2762
+// aWindowConstraints.weighty = 1;
2763
+// bigThree.add(scenePanel, aWindowConstraints);
2764
+// aWindowConstraints.weightx = 1;
2765
+// aWindowConstraints.gridwidth = 3;
2766
+// // aConstraints.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
+// // aWindowConstraints.gridheight = 3;
2774
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2775
+// //bigThree.add(XYZPanel, aWindowConstraints);
2776
+// bigThree.validate();
2777
+// scenePanel.setVisible(true);
2778
+// centralPanel.setVisible(false);
2779
+// XYZPanel.setVisible(false);
2780
+ bigThree.ClearUI();
2781
+ bigThree.add(scenePanel);
2782
+ bigThree.FlushUI();
27752783 } else
2776
- if (event.getSource() == sixButton)
2784
+ if (source == sixButton)
27772785 {
27782786 radio.layout = sixButton;
2779
- bigThree.remove(scenePanel);
2780
- bigThree.remove(centralPanel);
2781
- bigThree.remove(XYZPanel);
2782
- aWindowConstraints.gridx = 0;
2783
- aWindowConstraints.gridy = 0;
2784
- aWindowConstraints.gridwidth = 1;
2785
- // aConstraints.gridheight = 3;
2786
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2787
- aWindowConstraints.weightx = 0;
2788
- aWindowConstraints.weighty = 1;
2789
- bigThree.add(scenePanel, aWindowConstraints);
2790
- aWindowConstraints.weightx = 1;
2791
- aWindowConstraints.gridwidth = 3;
2792
- // aWindowConstraints.gridheight = 3;
2793
- aWindowConstraints.gridx = 1;
2794
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2795
- bigThree.add(centralPanel, aWindowConstraints);
2796
- aWindowConstraints.weightx = 0;
2797
- aWindowConstraints.gridx = 4;
2798
- aWindowConstraints.gridwidth = 1;
2799
- // aWindowConstraints.gridheight = 3;
2800
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2801
- //bigThree.add(XYZPanel, aConstraints);
2802
- bigThree.revalidate();
2787
+
2788
+// bigThree.remove(scenePanel);
2789
+// bigThree.remove(centralPanel);
2790
+// bigThree.remove(XYZPanel);
2791
+// aWindowConstraints.gridx = 0;
2792
+// aWindowConstraints.gridy = 0;
2793
+// aWindowConstraints.gridwidth = 1;
2794
+// // aConstraints.gridheight = 3;
2795
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2796
+// aWindowConstraints.weightx = 0;
2797
+// aWindowConstraints.weighty = 1;
2798
+// bigThree.add(scenePanel, aWindowConstraints);
2799
+// aWindowConstraints.weightx = 1;
2800
+// aWindowConstraints.gridwidth = 3;
2801
+// // aWindowConstraints.gridheight = 3;
2802
+// aWindowConstraints.gridx = 1;
2803
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2804
+// bigThree.add(centralPanel, aWindowConstraints);
2805
+// aWindowConstraints.weightx = 0;
2806
+// aWindowConstraints.gridx = 4;
2807
+// aWindowConstraints.gridwidth = 1;
2808
+// // aWindowConstraints.gridheight = 3;
2809
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2810
+// //bigThree.add(XYZPanel, aConstraints);
2811
+// bigThree.validate();
2812
+// scenePanel.setVisible(true);
2813
+// centralPanel.setVisible(true);
2814
+// XYZPanel.setVisible(false);
2815
+ bigThree.ClearUI();
2816
+ bigThree.add(scenePanel);
2817
+ bigThree.add(centralPanel);
2818
+ bigThree.FlushUI();
28032819 } else
2804
- if (event.getSource() == sevenButton)
2820
+ if (source == sevenButton)
28052821 {
28062822 radio.layout = sevenButton;
2807
- bigThree.remove(scenePanel);
2808
- bigThree.remove(centralPanel);
2809
- bigThree.remove(XYZPanel);
2810
- aWindowConstraints.gridx = 0;
2811
- aWindowConstraints.gridy = 0;
2812
- aWindowConstraints.gridwidth = 1;
2813
- // aWindowConstraints.gridheight = 3;
2814
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2815
- aWindowConstraints.weightx = 0;
2816
- aWindowConstraints.weighty = 1;
2817
- bigThree.add(scenePanel, aWindowConstraints);
2818
- aWindowConstraints.weightx = 1;
2819
- aWindowConstraints.gridwidth = 3;
2820
- // aWindowConstraints.gridheight = 3;
2821
- aWindowConstraints.gridx = 1;
2822
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2823
- bigThree.add(centralPanel, aWindowConstraints);
2824
- aWindowConstraints.weightx = 0;
2825
- aWindowConstraints.gridx = 4;
2826
- aWindowConstraints.gridwidth = 1;
2827
- // aConstraints.gridheight = 3;
2828
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2829
- bigThree.add(XYZPanel, aWindowConstraints);
2830
- bigThree.revalidate();
2823
+
2824
+// bigThree.remove(scenePanel);
2825
+// bigThree.remove(centralPanel);
2826
+// bigThree.remove(XYZPanel);
2827
+// aWindowConstraints.gridx = 0;
2828
+// aWindowConstraints.gridy = 0;
2829
+// aWindowConstraints.gridwidth = 1;
2830
+// // aWindowConstraints.gridheight = 3;
2831
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2832
+// aWindowConstraints.weightx = 0;
2833
+// aWindowConstraints.weighty = 1;
2834
+// bigThree.add(scenePanel, aWindowConstraints);
2835
+// aWindowConstraints.weightx = 1;
2836
+// aWindowConstraints.gridwidth = 3;
2837
+// // aWindowConstraints.gridheight = 3;
2838
+// aWindowConstraints.gridx = 1;
2839
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2840
+// bigThree.add(centralPanel, aWindowConstraints);
2841
+// aWindowConstraints.weightx = 0;
2842
+// aWindowConstraints.gridx = 4;
2843
+// aWindowConstraints.gridwidth = 1;
2844
+// // aConstraints.gridheight = 3;
2845
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2846
+// bigThree.add(XYZPanel, aWindowConstraints);
2847
+// bigThree.validate();
2848
+// scenePanel.setVisible(true);
2849
+// centralPanel.setVisible(true);
2850
+// XYZPanel.setVisible(true);
2851
+ bigThree.ClearUI();
2852
+ bigThree.add(scenePanel);
2853
+ bigThree.add(centralPanel);
2854
+ bigThree.add(XYZPanel);
2855
+ bigThree.FlushUI();
28312856 } else
2832
- if (event.getSource() == rootButton)
2857
+ if (source == rootButton)
28332858 {
28342859 Object3D obj;
28352860 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2841,7 +2866,7 @@
28412866
28422867 refreshContents(true);
28432868 } else
2844
- if (event.getSource() == closeButton)
2869
+ if (source == closeButton)
28452870 {
28462871 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28472872 cRadio ab;
....@@ -2862,11 +2887,11 @@
28622887 }
28632888 refreshContents(true);
28642889 } else
2865
- if (event.getSource() == editItem || event.getSource() == editButton)
2890
+ if (source == editItem || source == editButton)
28662891 {
28672892 EditSelection(false);
28682893 } else
2869
- if (event.getSource() == uneditButton)
2894
+ if (source == uneditButton)
28702895 {
28712896 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28722897 {
....@@ -2878,12 +2903,12 @@
28782903
28792904 child.editWindow = null; // ???????????
28802905 }
2881
- objEditor.ctrlPanel.revalidate();
2906
+ objEditor.ctrlPanel.validate();
28822907 //objEditor.jTree.clearSelection();
28832908 //objEditor.ResetSliders();
28842909 refreshContents(true);
28852910 } else
2886
- if (event.getSource() == clearPanelButton)
2911
+ if (source == clearPanelButton)
28872912 {
28882913 assert(copy == group);
28892914 //copy.ClearUI();
....@@ -2894,7 +2919,7 @@
28942919 listUI.clear();
28952920 refreshContents(true);
28962921 } else
2897
- if (event.getSource() == allParamsButton)
2922
+ if (source == allParamsButton)
28982923 {
28992924 assert(copy == group);
29002925
....@@ -2915,19 +2940,19 @@
29152940
29162941 refreshContents(true);
29172942 } else
2918
- if (event.getSource() == unselectButton)
2943
+ if (source == unselectButton)
29192944 {
29202945 objEditor.jTree.clearSelection();
29212946 // ?? oct 2012 GrafreeD.clipboard.clear();
29222947 objEditor.ResetSliders();
29232948 refreshContents(true);
29242949 } else
2925
- if(event.getSource() instanceof cRadio)
2950
+ if(source instanceof cRadio)
29262951 {
29272952 group.parent = keepparent;
29282953 group.attributes = 0;
29292954 //group.editWindow = null;
2930
- /*cRadio*/ radio = (cRadio)event.getSource();
2955
+ /*cRadio*/ radio = (cRadio)source;
29312956 Object3D obj = radio.GetObject();
29322957 System.out.println("Edit " + obj);
29332958 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -4086,12 +4111,12 @@
40864111 System.err.println("info : " + child.GetPath());
40874112 }
40884113 }
4089
- else
4090
- {
4091
- objEditor.SetMaterial(group); // .GetMaterial());
4092
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4093
- System.err.println("info : " + group.GetPath());
4094
- }
4114
+// else
4115
+// {
4116
+// objEditor.SetMaterial(group); // .GetMaterial());
4117
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4118
+// System.err.println("info : " + group.GetPath());
4119
+// }
40954120
40964121 objEditor.SetText(); // jan 2014
40974122