Normand Briere
2019-05-01 20c1a07b76c39462594aedfedfe6e6adb17cd552
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,28 @@
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(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
444
+ fastCB.setToolTipText("Fast mode");
445
+ fastCB.addItemListener(this);
446
+
447
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
449448 trackCB.setToolTipText("Enable tracking");
450449 trackCB.addItemListener(this);
451450
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
451
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
454452 screenfitButton.setToolTipText("Screen fit");
455453 screenfitButton.addActionListener(this);
456
- oe.aConstraints.gridx += 1;
454
+
457455 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
458456 // screenfitpointButton.addActionListener(this);
459457 // oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
458
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
461459 snapobjectButton.addActionListener(this);
462460 snapobjectButton.setToolTipText("Snap Object");
463461 oe.aConstraints.gridx += 1;
....@@ -467,76 +465,66 @@
467465 oe.aConstraints.weighty = 0;
468466 oe.aConstraints.gridwidth = 1;
469467
470
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
468
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
471469 flashSelectionButton.setToolTipText("Show selection");
472470 flashSelectionButton.addActionListener(this);
473471
474
- oe.toolbarPanel.add(new cButton(" ", false));
472
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
475473
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);
474
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
482475 twoButton.setToolTipText("Show center view only");
483476 twoButton.addActionListener(this);
484
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
477
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
485478 fourButton.addActionListener(this);
486479 fourButton.setToolTipText("Show left panel only");
487
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
480
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
488481 sixButton.setToolTipText("2-column layout left");
489482 sixButton.addActionListener(this);
490
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
483
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
491484 threeButton.setToolTipText("2-column layout right");
492485 threeButton.addActionListener(this);
493
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
486
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
494487 sevenButton.setToolTipText("3-column layout");
495488 sevenButton.addActionListener(this);
496489 //
497490
498
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
499
- rootButton.setToolTipText("Edit object in new tab");
491
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
492
+ rootButton.setToolTipText("Edit selection in new tab");
500493 rootButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
494
+
495
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
503496 closeButton.setToolTipText("Close tab");
504497 closeButton.addActionListener(this);
505498 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
506499 //clearButton.addActionListener(this);
507
- oe.aConstraints.gridx += 1;
508500
509
- oe.aConstraints.gridx = 1; //
510
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
501
+ cGridBag commandsPanel = new cGridBag();
502
+
503
+ commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
504
+ editButton.setToolTipText("Edit selection");
511505 editButton.addActionListener(this);
512
- oe.aConstraints.gridx += 1;
513
- oe.aConstraints.weighty = 0;
514
- oe.aConstraints.gridwidth = 1;
515506
516
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
507
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
508
+ uneditButton.setToolTipText("Unedit selection");
517509 uneditButton.addActionListener(this);
518510
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);
511
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
512
+ clearPanelButton.setToolTipText("Clear edit panel");
524513 clearPanelButton.addActionListener(this);
525514
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);
515
+ commandsPanel.add(allParamsButton = new cButton("A", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
516
+ allParamsButton.setToolTipText("All params??");
531517 allParamsButton.addActionListener(this);
532518
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);
519
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
520
+ unselectButton.setToolTipText("Unselect");
538521 unselectButton.addActionListener(this);
539522
523
+ commandsPanel.preferredHeight = 1;
524
+
525
+ oe.treePanel.add(commandsPanel);
526
+ oe.treePanel.Return();
527
+
540528 // oe.aConstraints.gridx += 1;
541529 // oe.aConstraints.weighty = 0;
542530 // oe.aConstraints.gridwidth = 1;
....@@ -548,40 +536,37 @@
548536 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
549537 // gcButton.addActionListener(this);
550538
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;
539
+ cGridBag jSPPanel = new cGridBag();
540
+
541
+ JScrollPane jSP;
562542 //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);
543
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
564544 ResetModel();
565
- oe.aConstraints.weighty = 0.5;
566
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
567
- oe.aConstraints.gridy += 1;
568
- oe.aConstraints.gridwidth = 1;
545
+
546
+ oe.treePanel.add(jSPPanel);
547
+ oe.treePanel.Return();
569548
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);
549
+ cGridBag copyOptionsPanel = new cGridBag();
550
+
551
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
552
+ colorCB.setToolTipText("Copy color when dropped");
574553 colorCB.addItemListener(this);
575
- oe.aConstraints.gridx += 2;
576
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
554
+
555
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
556
+ materialCB.setToolTipText("Copy material when dropped");
577557 materialCB.addItemListener(this);
578
- oe.aConstraints.gridx += 2;
579
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
558
+
559
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
560
+ textureCB.setToolTipText("Copy texture when dropped");
580561 textureCB.addItemListener(this);
581562
582
- oe.aConstraints.gridx = 0;
583
- oe.aConstraints.gridy += 1;
563
+ copyOptionsPanel.preferredHeight = 1;
564
+ oe.treePanel.add(copyOptionsPanel);
565
+ oe.treePanel.Return();
584566
567
+// mainPanel.setDividerLocation(0.5); //1.0);
568
+// mainPanel.setResizeWeight(0.5);
569
+
585570 //jList.addListSelectionListener(this);
586571 oe.jTree.addTreeSelectionListener(this);
587572 //jTree.setRootVisible(false);
....@@ -604,42 +589,32 @@
604589 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
605590 }
606591
607
- void AddOptions(JPanel panel, GridBagConstraints constraints)
592
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
608593 {
609
- constraints.gridx = 0;
610
- constraints.gridy = 0;
611
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), constraints);
612
- fastCB.setToolTipText("Fast mode");
613
- fastCB.addItemListener(this);
614
- constraints.gridy += 1;
615
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), constraints);
594
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
616595 supportCB.setToolTipText("Enabled rigging");
617596 supportCB.addItemListener(this);
618597
619
- // constraints.gridy += 1;
620598 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
621599 // localCB.addItemListener(this);
622600
623
- constraints.gridy += 1;
624
- panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), constraints);
601
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
625602 crowdCB.setToolTipText("Used for crowds");
626603 crowdCB.addItemListener(this);
627604
628
- constraints.gridy += 1;
629
- panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), constraints);
605
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
630606 smoothCB.setToolTipText("Snapping delay");
631607 smoothCB.addItemListener(this);
632608
633
- constraints.gridy += 1;
634
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), constraints);
609
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
635610 slowCB.setToolTipText("Smooth interpolation");
636611 slowCB.addItemListener(this);
637
- constraints.gridy += 1;
638
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), constraints);
612
+
613
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
639614 boxCB.setToolTipText("Display bounding boxes");
640615 boxCB.addItemListener(this);
641
- constraints.gridy += 1;
642
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints);
616
+
617
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
643618 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
644619 zoomBoxCB.addItemListener(this);
645620
....@@ -650,16 +625,16 @@
650625 if (false)
651626 {
652627 // handled in scripts
653
- constraints.gridy += 1;
654
- panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints);
628
+ //constraints.gridy += 1;
629
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
655630 speakerCameraCB.addItemListener(this);
656631
657
- constraints.gridy += 1;
658
- panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints);
632
+ //constraints.gridy += 1;
633
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
659634 speakerFocusCB.addItemListener(this);
660635
661
- constraints.gridy += 1;
662
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints);
636
+ //constraints.gridy += 1;
637
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
663638 smoothfocusCB.addItemListener(this);
664639 }
665640
....@@ -667,14 +642,18 @@
667642 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
668643 // debugCB.addItemListener(this);
669644
670
- constraints.gridy += 1;
671
- panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints);
645
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
672646 oeilCB.addItemListener(this);
673647
674
- constraints.gridy += 1;
675
- panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints);
648
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
676649 lookAtCB.setToolTipText("Look-at target");
677650 lookAtCB.addItemListener(this);
651
+
652
+ cGridBag fill = new cGridBag();
653
+
654
+ fill.preferredHeight = 200;
655
+
656
+ panel.add(fill);
678657
679658 }
680659
....@@ -1123,7 +1102,7 @@
11231102 {
11241103 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11251104 animationItem.addItemListener(this);
1126
- animationItem.setState(CameraPane.ANIMATION);
1105
+ animationItem.setState(Globals.ANIMATION);
11271106
11281107 menu.add("-");
11291108 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
....@@ -1518,6 +1497,7 @@
15181497 //
15191498 public void actionPerformed(ActionEvent event) // , Object arg)
15201499 {
1500
+ Object source = event.getSource();
15211501 /*
15221502 if (event.getSource() == nameField)
15231503 {
....@@ -1529,11 +1509,11 @@
15291509 }
15301510 else
15311511 */
1532
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1512
+ if (source == lookAtItem || source == lookFromItem)
15331513 {
15341514 ScreenFit();
15351515 } else
1536
- if (event.getSource() == switchItem)
1516
+ if (source == switchItem)
15371517 {
15381518 cVector v1 = new cVector();
15391519 cVector v2 = new cVector();
....@@ -1542,11 +1522,11 @@
15421522 objEditor.cameraView.renderCamera.setAim(v2, v1);
15431523 objEditor.cameraView.repaint();
15441524 } else
1545
- if (event.getSource() == rectoidItem)
1525
+ if (source == rectoidItem)
15461526 {
15471527 makeSomething(new Box());
15481528 } else
1549
- if (event.getSource() == particleItem)
1529
+ if (source == particleItem)
15501530 {
15511531 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15521532 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1567,9 +1547,9 @@
15671547 applyExample(particleGeom, "SMOKE");
15681548 makeSomething(particleGeom);
15691549 } else
1570
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1550
+ if (source == ragdollItem || source == ragdoll2Item)
15711551 {
1572
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1552
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15731553
15741554 ragdoll.toParent = LA.newMatrix();
15751555 ragdoll.fromParent = LA.newMatrix();
....@@ -1587,7 +1567,7 @@
15871567 } else
15881568 /*
15891569 */
1590
- if (event.getSource() == heightFieldItem)
1570
+ if (source == heightFieldItem)
15911571 {
15921572 Object3D obj = new Object3D();
15931573
....@@ -1625,31 +1605,31 @@
16251605
16261606 makeSomething(obj);
16271607 } else
1628
- if (event.getSource() == gridItem)
1608
+ if (source == gridItem)
16291609 {
16301610 makeSomething(new Grid());
16311611 } else
1632
- if (event.getSource() == ellipsoidItem)
1612
+ if (source == ellipsoidItem)
16331613 {
16341614 makeSomething(new Sphere());
16351615 } else
1636
- if (event.getSource() == coneItem)
1616
+ if (source == coneItem)
16371617 {
16381618 makeSomething(new Cone());
16391619 } else
1640
- if (event.getSource() == torusItem)
1620
+ if (source == torusItem)
16411621 {
16421622 makeSomething(new Torus());
16431623 } else
1644
- if (event.getSource() == superItem)
1624
+ if (source == superItem)
16451625 {
16461626 makeSomething(new Superellipsoid());
16471627 } else
1648
- if (event.getSource() == kleinItem)
1628
+ if (source == kleinItem)
16491629 {
16501630 makeSomething(new Klein());
16511631 } else
1652
- if (event.getSource() == blobItem)
1632
+ if (source == blobItem)
16531633 {
16541634 Blob blob = new Blob();
16551635 BlobComponent comp = new BlobComponent();
....@@ -1657,15 +1637,15 @@
16571637 //blob.retile();
16581638 makeSomething(blob);
16591639 } else
1660
- if (event.getSource() == latheItem)
1640
+ if (source == latheItem)
16611641 {
16621642 makeSomething(new Lathe());
16631643 } else
1664
- if (event.getSource() == bezierItem)
1644
+ if (source == bezierItem)
16651645 {
16661646 makeSomething(new BezierSurface());
16671647 } else
1668
- if (event.getSource() == checkerItem)
1648
+ if (source == checkerItem)
16691649 {
16701650 /*
16711651 Object3D obj = new BezierSurface(5,8);
....@@ -1680,7 +1660,7 @@
16801660 */
16811661 makeSomething(new Checker());
16821662 } else
1683
- if (event.getSource() == meshItem)
1663
+ if (source == meshItem)
16841664 {
16851665 Object3D itemtomake = new Object3D();
16861666 Object3D child;
....@@ -1701,35 +1681,35 @@
17011681 makeSomething(child);
17021682 }
17031683 } else
1704
- if (event.getSource() == springItem)
1684
+ if (source == springItem)
17051685 {
17061686 cSpring s = new cSpring();
17071687 s.setup();
17081688 makeSomething(s);
17091689 } else
1710
- if (event.getSource() == flagItem)
1690
+ if (source == flagItem)
17111691 {
17121692 cSpring s = new cFlag();
17131693 s.setup();
17141694 makeSomething(s);
17151695 } else
1716
- if (event.getSource() == lightItem)
1696
+ if (source == lightItem)
17171697 {
17181698 makeSomething(new Light());
17191699 } else
1720
- if (event.getSource() == csgItem)
1700
+ if (source == csgItem)
17211701 {
17221702 group(new CSG());
17231703 } else
1724
- if (event.getSource() == templateItem)
1704
+ if (source == templateItem)
17251705 {
17261706 group(new cTemplate());
17271707 } else
1728
- if (event.getSource() == attributeItem)
1708
+ if (source == attributeItem)
17291709 {
17301710 makeSomething(new Attribute());
17311711 } else
1732
- if (event.getSource() == pointflowItem)
1712
+ if (source == pointflowItem)
17331713 {
17341714 makeSomething(new PointFlow());
17351715 } else
....@@ -1741,7 +1721,7 @@
17411721 } else
17421722 */
17431723
1744
- if (event.getSource() == superLoopItem)
1724
+ if (source == superLoopItem)
17451725 {
17461726 Composite g = new cGroup();
17471727 for (int i=0; i<15; i++)
....@@ -1763,7 +1743,7 @@
17631743
17641744 group(g);
17651745 } else
1766
- if (event.getSource() == loopItem)
1746
+ if (source == loopItem)
17671747 {
17681748 Composite csg = new GroupLeaf();
17691749 csg.count = 5;
....@@ -1772,7 +1752,7 @@
17721752 csg.addChild(child);
17731753 child.addChild(csg);
17741754 } else
1775
- if (event.getSource() == doubleItem)
1755
+ if (source == doubleItem)
17761756 {
17771757 Composite csg = new GroupLeaf();
17781758 csg.count = 5;
....@@ -1784,7 +1764,7 @@
17841764 csg.addChild(child);
17851765 child.addChild(csg);
17861766 } else
1787
- if (event.getSource() == tripleItem)
1767
+ if (source == tripleItem)
17881768 {
17891769 Composite csg = new GroupLeaf();
17901770 csg.count = 4;
....@@ -1800,70 +1780,70 @@
18001780 child.addChild(csg);
18011781 } else
18021782
1803
- if (event.getSource() == importGFDItem)
1783
+ if (source == importGFDItem)
18041784 {
18051785 ImportGFD();
18061786 } else
1807
- if (event.getSource() == importVRMLX3DItem)
1787
+ if (source == importVRMLX3DItem)
18081788 {
18091789 ImportVRMLX3D();
18101790 } else
1811
- if (event.getSource() == import3DSItem)
1791
+ if (source == import3DSItem)
18121792 {
18131793 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
18141794 } else
1815
- if (event.getSource() == importOBJItem)
1795
+ if (source == importOBJItem)
18161796 {
18171797 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
18181798 } else
1819
- if (event.getSource() == computeAOItem)
1799
+ if (source == computeAOItem)
18201800 {
18211801 Globals.drawMode = CameraPane.OCCLUSION;
18221802 Globals.theRenderer.repaint();
18231803 } else
1824
- if (event.getSource() == recompileItem)
1804
+ if (source == recompileItem)
18251805 {
18261806 Recompile();
18271807 refreshContents();
18281808 } else
1829
- if (event.getSource() == editScriptItem)
1809
+ if (source == editScriptItem)
18301810 {
18311811 OpenDialog();
18321812 refreshContents();
18331813 } else
1834
- if (event.getSource() == invariantsItem)
1814
+ if (source == invariantsItem)
18351815 {
18361816 System.out.println("Invariants:");
18371817 GrafreeD.grafreeD.universe.invariants();
18381818 } else
1839
- if (event.getSource() == memoryItem)
1819
+ if (source == memoryItem)
18401820 {
18411821 //System.out.println("Invariants:");
18421822 PrintMemory();
18431823 } else
1844
- if (event.getSource() == pathItem)
1824
+ if (source == pathItem)
18451825 {
18461826 PrintPath();
18471827 } else
1848
- if (event.getSource() == analyzeItem)
1828
+ if (source == analyzeItem)
18491829 {
18501830 AnalyzeObject();
18511831 } else
1852
- if (event.getSource() == dumpItem)
1832
+ if (source == dumpItem)
18531833 {
18541834 DumpObject();
18551835 } else
1856
- if (event.getSource() == screenfitButton)
1836
+ if (source == screenfitButton)
18571837 {
18581838 //Reload(lastConverter, lastFilename, true);
18591839 ScreenFit();
18601840 } else
1861
- if (event.getSource() == screenfitpointButton)
1841
+ if (source == screenfitpointButton)
18621842 {
18631843 //Reload(lastConverter, lastFilename, true);
18641844 ScreenFitPoint();
18651845 } else
1866
- if (event.getSource() == snapobjectButton)
1846
+ if (source == snapobjectButton)
18671847 {
18681848 //Reload(lastConverter, lastFilename, true);
18691849 SnapObject();
....@@ -1874,13 +1854,13 @@
18741854 // Recompile();
18751855 // refreshContents();
18761856 // } else
1877
- if (event.getSource() == gcButton)
1857
+ if (source == gcButton)
18781858 {
18791859 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18801860 System.gc();
18811861 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18821862 } else
1883
- if (event.getSource() == editLeafItem)
1863
+ if (source == editLeafItem)
18841864 {
18851865 Object3D obj;
18861866 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1894,62 +1874,62 @@
18941874 }
18951875 refreshContents(true);
18961876 } else
1897
- if (event.getSource() == openWindowItem)
1877
+ if (source == openWindowItem)
18981878 {
18991879 EditSelection(true);
19001880 } else
1901
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1881
+ if (source == cutItem || source == clearButton)
19021882 {
19031883 loadClipboard(true);
19041884 } else
1905
- if (event.getSource() == duplicateItem)
1885
+ if (source == duplicateItem)
19061886 {
19071887 Object3D keep = GrafreeD.clipboard;
19081888 loadClipboard(false);
19091889 paste(false);
19101890 GrafreeD.clipboard = keep;
19111891 } else
1912
- if (event.getSource() == cloneItem)
1892
+ if (source == cloneItem)
19131893 {
19141894 CloneSelection(false);
19151895 } else
1916
- if (event.getSource() == cloneSupportItem)
1896
+ if (source == cloneSupportItem)
19171897 {
19181898 CloneSelection(true);
19191899 } else
1920
- if (event.getSource() == copyItem)
1900
+ if (source == copyItem)
19211901 {
19221902 loadClipboard(false);
19231903 } else
1924
- if (event.getSource() == pasteItem)
1904
+ if (source == pasteItem)
19251905 {
19261906 paste(false);
19271907 } else
1928
- if (event.getSource() == pasteLinkItem)
1908
+ if (source == pasteLinkItem)
19291909 {
19301910 pasteInto(false);
19311911 } else
1932
- if (event.getSource() == pasteCloneItem)
1912
+ if (source == pasteCloneItem)
19331913 {
19341914 pasteInto(true);
19351915 } else
1936
- if (event.getSource() == pasteExpandItem)
1916
+ if (source == pasteExpandItem)
19371917 {
19381918 paste(true);
19391919 } else
1940
- if (event.getSource() == synchronizeItem)
1920
+ if (source == synchronizeItem)
19411921 {
19421922 Overwrite(Object3D.TRANSFORM);
19431923 } else
1944
- if (event.getSource() == overwriteNameItem)
1924
+ if (source == overwriteNameItem)
19451925 {
19461926 Overwrite(Object3D.NAME);
19471927 } else
1948
- if (event.getSource() == overwriteUVItem)
1928
+ if (source == overwriteUVItem)
19491929 {
19501930 Overwrite(Object3D.UV);
19511931 } else
1952
- if (event.getSource() == overwriteMatItem)
1932
+ if (source == overwriteMatItem)
19531933 {
19541934 /* july 2015
19551935 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1969,7 +1949,7 @@
19691949
19701950 Overwrite(dropAttributes);
19711951 }
1972
- if (event.getSource() == overwriteGeoItem)
1952
+ if (source == overwriteGeoItem)
19731953 {
19741954 Overwrite(Object3D.GEOMETRY);
19751955 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1986,7 +1966,7 @@
19861966 // refreshContents();
19871967 // }
19881968 } else
1989
- if (event.getSource() == generateMeshItem)
1969
+ if (source == generateMeshItem)
19901970 {
19911971 //if (group.selection.size() == 1)
19921972 // for (int i=0; i<group.selection.size(); i++)
....@@ -1997,7 +1977,7 @@
19971977 ResetModel();
19981978 refreshContents();
19991979 } else
2000
- if (event.getSource() == extractGeometriesItem)
1980
+ if (source == extractGeometriesItem)
20011981 {
20021982 boolean one = false;
20031983
....@@ -2024,7 +2004,7 @@
20242004 ResetModel();
20252005 refreshContents();
20262006 } else
2027
- if (event.getSource() == cloneGeometriesItem)
2007
+ if (source == cloneGeometriesItem)
20282008 {
20292009 boolean one = false;
20302010
....@@ -2050,7 +2030,7 @@
20502030 ResetModel();
20512031 refreshContents();
20522032 } else
2053
- if (event.getSource() == shareGeometriesItem)
2033
+ if (source == shareGeometriesItem)
20542034 {
20552035 boolean one = false;
20562036
....@@ -2080,7 +2060,7 @@
20802060 refreshContents();
20812061 }
20822062 } else
2083
- if (event.getSource() == mergeGeometriesItem)
2063
+ if (source == mergeGeometriesItem)
20842064 {
20852065 boolean one = false;
20862066
....@@ -2110,7 +2090,7 @@
21102090 ResetModel();
21112091 refreshContents();
21122092 } else
2113
- if (event.getSource() == linkverticesItem)
2093
+ if (source == linkverticesItem)
21142094 {
21152095 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21162096 // {
....@@ -2143,7 +2123,7 @@
21432123 refreshContents();
21442124 }
21452125 } else
2146
- if (event.getSource() == resetsupportItem)
2126
+ if (source == resetsupportItem)
21472127 {
21482128 for (int i=0; i<group.selection.size(); i++)
21492129 {
....@@ -2155,7 +2135,7 @@
21552135
21562136 refreshContents();
21572137 } else
2158
- if (event.getSource() == relinkverticesItem)
2138
+ if (source == relinkverticesItem)
21592139 {
21602140 boolean random = CameraPane.RANDOM;
21612141 CameraPane.RANDOM = false; // parse all random nodes
....@@ -2164,7 +2144,7 @@
21642144
21652145 refreshContents();
21662146 } else
2167
- if (event.getSource() == resetreferencesItem)
2147
+ if (source == resetreferencesItem)
21682148 {
21692149 for (int i=0; i<group.selection.size(); i++)
21702150 {
....@@ -2173,7 +2153,7 @@
21732153
21742154 refreshContents();
21752155 } else
2176
- if (event.getSource() == setMasterItem)
2156
+ if (source == setMasterItem)
21772157 {
21782158 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21792159 {
....@@ -2186,7 +2166,7 @@
21862166 refreshContents();
21872167 }
21882168 } else
2189
- if (event.getSource() == poseMeshItem)
2169
+ if (source == poseMeshItem)
21902170 {
21912171 if (group.selection.size() == 1)
21922172 {
....@@ -2205,19 +2185,19 @@
22052185 }
22062186
22072187 } else
2208
- if (event.getSource() == revertMeshItem)
2188
+ if (source == revertMeshItem)
22092189 {
22102190 RevertMeshes();
22112191 } else
2212
- if (event.getSource() == resetMeshItem)
2192
+ if (source == resetMeshItem)
22132193 {
22142194 ResetAll();
22152195 } else
2216
- if (event.getSource() == stepAllItem)
2196
+ if (source == stepAllItem)
22172197 {
22182198 StepAll();
22192199 } else
2220
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2200
+ if (source == clearItem) // || event.getSource() == clearButton)
22212201 {
22222202 //int indices[] = jList.getSelectedIndices();
22232203 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2225,46 +2205,46 @@
22252205
22262206 ClearSelection(false);
22272207 } else
2228
- if (event.getSource() == clearAllItem)
2208
+ if (source == clearAllItem)
22292209 {
22302210 ClearSelection(true);
22312211 } else
2232
- if (event.getSource() == grabItem)
2212
+ if (source == grabItem)
22332213 {
22342214 group(new cGroup(), true);
22352215 } else
2236
- if (event.getSource() == hideItem)
2216
+ if (source == hideItem)
22372217 {
22382218 group(new HiddenObject());
22392219 } else
2240
- if (event.getSource() == frontItem)
2220
+ if (source == frontItem)
22412221 {
22422222 front();
22432223 } else
2244
- if (event.getSource() == backItem)
2224
+ if (source == backItem)
22452225 {
22462226 back();
22472227 } else
2248
- if (event.getSource() == cameraItem)
2228
+ if (source == cameraItem)
22492229 {
22502230 makeSomething(new Camera());
22512231 } else
2252
- if (event.getSource() == compositeItem)
2232
+ if (source == compositeItem)
22532233 {
22542234 group(new Composite());
22552235 } else
2256
- if (event.getSource() == randomItem)
2236
+ if (source == randomItem)
22572237 {
22582238 RandomNode random = new RandomNode();
22592239 group(random);
22602240 if (random.size() > 0)
22612241 random.name = random.get(0).name + "Rnd";
22622242 } else
2263
- if (event.getSource() == physicsItem)
2243
+ if (source == physicsItem)
22642244 {
22652245 group(new PhysicsNode());
22662246 } else
2267
- if (event.getSource() == frameselectorItem)
2247
+ if (source == frameselectorItem)
22682248 {
22692249 for (int i=0; i<group.selection.size(); i++)
22702250 {
....@@ -2276,7 +2256,7 @@
22762256 ResetModel();
22772257 refreshContents();
22782258 } else
2279
- if (event.getSource() == switchGeoItem)
2259
+ if (source == switchGeoItem)
22802260 {
22812261 for (int i=0; i<group.selection.size(); i++)
22822262 {
....@@ -2288,7 +2268,7 @@
22882268 ResetModel();
22892269 refreshContents();
22902270 } else
2291
- if (event.getSource() == switchTransfoItem)
2271
+ if (source == switchTransfoItem)
22922272 {
22932273 for (int i=0; i<group.selection.size(); i++)
22942274 {
....@@ -2300,7 +2280,7 @@
23002280 ResetModel();
23012281 refreshContents();
23022282 } else
2303
- if (event.getSource() == morphItem)
2283
+ if (source == morphItem)
23042284 {
23052285 for (int i=0; i<group.selection.size(); i++)
23062286 {
....@@ -2312,7 +2292,7 @@
23122292 ResetModel();
23132293 refreshContents();
23142294 } else
2315
- if (event.getSource() == scriptNodeItem)
2295
+ if (source == scriptNodeItem)
23162296 {
23172297 boolean atleastone = false;
23182298
....@@ -2351,31 +2331,31 @@
23512331 }
23522332 }
23532333 } else
2354
- if (event.getSource() == linkerItem)
2334
+ if (source == linkerItem)
23552335 {
23562336 group(new cLinker());
23572337 } else
2358
- if (event.getSource() == textureItem)
2338
+ if (source == textureItem)
23592339 {
23602340 group(new TextureNode());
23612341 } else
2362
- if (event.getSource() == billboardItem)
2342
+ if (source == billboardItem)
23632343 {
23642344 group(new BillboardNode());
23652345 } else
2366
- if (event.getSource() == shadowXItem)
2346
+ if (source == shadowXItem)
23672347 {
23682348 CastShadow(0);
23692349 } else
2370
- if (event.getSource() == shadowYItem)
2350
+ if (source == shadowYItem)
23712351 {
23722352 CastShadow(1);
23732353 } else
2374
- if (event.getSource() == shadowZItem)
2354
+ if (source == shadowZItem)
23752355 {
23762356 CastShadow(2);
23772357 } else
2378
- if (event.getSource() == ungroupItem)
2358
+ if (source == ungroupItem)
23792359 {
23802360 //ungroup();
23812361 for (int i=0; i<group.selection.size(); i++)
....@@ -2387,179 +2367,179 @@
23872367
23882368 refreshContents();
23892369 } else
2390
- if (event.getSource() == genUVItem)
2370
+ if (source == genUVItem)
23912371 {
23922372 GenUV();
23932373 } else
2394
- if (event.getSource() == genNormalsCADItem)
2374
+ if (source == genNormalsCADItem)
23952375 {
23962376 GenNormals(true);
23972377 } else
2398
- if (event.getSource() == genNormalsMESHItem)
2378
+ if (source == genNormalsMESHItem)
23992379 {
24002380 GenNormals(true); // TODO
24012381 } else
2402
- if (event.getSource() == genNormalsORGANItem)
2382
+ if (source == genNormalsORGANItem)
24032383 {
24042384 GenNormals(false);
24052385 } else
2406
- if (event.getSource() == genNormalsMINEItem)
2386
+ if (source == genNormalsMINEItem)
24072387 {
24082388 GenNormalsMINE();
24092389 } else
2410
- if (event.getSource() == stripifyItem)
2390
+ if (source == stripifyItem)
24112391 {
24122392 Stripify();
24132393 } else
2414
- if (event.getSource() == unstripifyItem)
2394
+ if (source == unstripifyItem)
24152395 {
24162396 Unstripify();
24172397 } else
2418
- if (event.getSource() == trimItem)
2398
+ if (source == trimItem)
24192399 {
24202400 Trim();
24212401 } else
2422
- if (event.getSource() == untrimItem)
2402
+ if (source == untrimItem)
24232403 {
24242404 Untrim();
24252405 } else
2426
- if (event.getSource() == clearColorsItem)
2406
+ if (source == clearColorsItem)
24272407 {
24282408 ClearColors();
24292409 } else
2430
- if (event.getSource() == clearMaterialsItem)
2410
+ if (source == clearMaterialsItem)
24312411 {
24322412 ClearMaterials();
24332413 } else
2434
- if (event.getSource() == liveleavesItem)
2414
+ if (source == liveleavesItem)
24352415 {
24362416 LiveLeaves(true);
24372417 } else
2438
- if (event.getSource() == unliveleavesItem)
2418
+ if (source == unliveleavesItem)
24392419 {
24402420 LiveLeaves(false);
24412421 } else
2442
- if (event.getSource() == supportleavesItem)
2422
+ if (source == supportleavesItem)
24432423 {
24442424 SupportLeaves(true);
24452425 } else
2446
- if (event.getSource() == unsupportleavesItem)
2426
+ if (source == unsupportleavesItem)
24472427 {
24482428 SupportLeaves(false);
24492429 } else
2450
- if (event.getSource() == hideleavesItem)
2430
+ if (source == hideleavesItem)
24512431 {
24522432 HideLeaves(true);
24532433 } else
2454
- if (event.getSource() == showleavesItem)
2434
+ if (source == showleavesItem)
24552435 {
24562436 HideLeaves(false);
24572437 } else
2458
- if (event.getSource() == markleavesItem)
2438
+ if (source == markleavesItem)
24592439 {
24602440 MarkLeaves(true);
24612441 } else
2462
- if (event.getSource() == unmarkleavesItem)
2442
+ if (source == unmarkleavesItem)
24632443 {
24642444 MarkLeaves(false);
24652445 } else
2466
- if (event.getSource() == flipVItem)
2446
+ if (source == flipVItem)
24672447 {
24682448 FlipV(true);
24692449 } else
2470
- if (event.getSource() == unflipVItem)
2450
+ if (source == unflipVItem)
24712451 {
24722452 FlipV(false);
24732453 } else
2474
- if (event.getSource() == lowTexturesItem)
2454
+ if (source == lowTexturesItem)
24752455 {
24762456 SetTexRes(0);
24772457 } else
2478
- if (event.getSource() == normalTexturesItem)
2458
+ if (source == normalTexturesItem)
24792459 {
24802460 SetTexRes(1);
24812461 } else
2482
- if (event.getSource() == highTexturesItem)
2462
+ if (source == highTexturesItem)
24832463 {
24842464 SetTexRes(2);
24852465 } else
2486
- if (event.getSource() == veryhighTexturesItem)
2466
+ if (source == veryhighTexturesItem)
24872467 {
24882468 SetTexRes(3);
24892469 } else
2490
- if (event.getSource() == maxTexturesItem)
2470
+ if (source == maxTexturesItem)
24912471 {
24922472 SetTexRes(4);
24932473 } else
2494
- if (event.getSource() == panoTexturesItem)
2474
+ if (source == panoTexturesItem)
24952475 {
24962476 SetTexRes(5);
24972477 } else
2498
- if (event.getSource() == reverseNormalsItem)
2478
+ if (source == reverseNormalsItem)
24992479 {
25002480 ReverseNormals();
25012481 } else
2502
- if (event.getSource() == parseverticesItem)
2482
+ if (source == parseverticesItem)
25032483 {
25042484 ParseVertices();
25052485 } else
2506
- if (event.getSource() == textureFieldItem)
2486
+ if (source == textureFieldItem)
25072487 {
25082488 TextureVertices();
25092489 } else
2510
- if (event.getSource() == alignItem)
2490
+ if (source == alignItem)
25112491 {
25122492 Align();
25132493 } else
2514
- if (event.getSource() == mirrorItem)
2494
+ if (source == mirrorItem)
25152495 {
25162496 MirrorPoses();
25172497 } else
2518
- if (event.getSource() == reduceMorphItem)
2498
+ if (source == reduceMorphItem)
25192499 {
25202500 MeshReduction(false);
25212501 } else
2522
- if (event.getSource() == reduce34MorphItem)
2502
+ if (source == reduce34MorphItem)
25232503 {
25242504 MeshReduction(true);
25252505 } else
2526
- if (event.getSource() == reverseTrianglesItem)
2506
+ if (source == reverseTrianglesItem)
25272507 {
25282508 ReverseTriangles();
25292509 } else
2530
- if (event.getSource() == reduceMeshItem)
2510
+ if (source == reduceMeshItem)
25312511 {
25322512 ReduceMesh(false);
25332513 } else
2534
- if (event.getSource() == reduce34MeshItem)
2514
+ if (source == reduce34MeshItem)
25352515 {
25362516 ReduceMesh(true);
25372517 } else
2538
- if (event.getSource() == increaseMeshItem)
2518
+ if (source == increaseMeshItem)
25392519 {
25402520 IncreaseMesh();
25412521 } else
2542
- if (event.getSource() == clipMeshItem)
2522
+ if (source == clipMeshItem)
25432523 {
25442524 ClipMesh();
25452525 } else
2546
- if (event.getSource() == smoothMeshItem)
2526
+ if (source == smoothMeshItem)
25472527 {
25482528 SmoothMesh();
25492529 } else
2550
- if (event.getSource() == transformgeometryItem)
2530
+ if (source == transformgeometryItem)
25512531 {
25522532 TransformGeometry();
25532533 } else
2554
- if (event.getSource() == resetTransformItem)
2534
+ if (source == resetTransformItem)
25552535 {
25562536 ResetTransform();
25572537 } else
2558
- if (event.getSource() == resetCentroidItem)
2538
+ if (source == resetCentroidItem)
25592539 {
25602540 ResetCentroid();
25612541 } else
2562
- if (event.getSource() == resetParentItem)
2542
+ if (source == resetParentItem)
25632543 {
25642544 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25652545 {
....@@ -2569,7 +2549,7 @@
25692549
25702550 refreshContents();
25712551 } else
2572
- if (event.getSource() == repairParentItem)
2552
+ if (source == repairParentItem)
25732553 {
25742554 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25752555 {
....@@ -2583,7 +2563,7 @@
25832563
25842564 refreshContents();
25852565 } else
2586
- if (event.getSource() == repairShadowItem)
2566
+ if (source == repairShadowItem)
25872567 {
25882568 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25892569 {
....@@ -2597,7 +2577,7 @@
25972577
25982578 refreshContents();
25992579 } else
2600
- if (event.getSource() == sortbysizeItem)
2580
+ if (source == sortbysizeItem)
26012581 {
26022582 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26032583 {
....@@ -2609,7 +2589,7 @@
26092589 ResetModel();
26102590 refreshContents();
26112591 } else
2612
- if (event.getSource() == sortbynameItem)
2592
+ if (source == sortbynameItem)
26132593 {
26142594 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26152595 {
....@@ -2621,7 +2601,7 @@
26212601 ResetModel();
26222602 refreshContents();
26232603 } else
2624
- if (event.getSource() == attachPigmentItem)
2604
+ if (source == attachPigmentItem)
26252605 {
26262606 String texture = GetFile("Attach pigment");
26272607 Object3D obj;
....@@ -2633,7 +2613,7 @@
26332613
26342614 refreshContents();
26352615 } else
2636
- if (event.getSource() == detachPigmentItem)
2616
+ if (source == detachPigmentItem)
26372617 {
26382618 Object3D obj;
26392619 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2644,7 +2624,7 @@
26442624
26452625 refreshContents();
26462626 } else
2647
- if (event.getSource() == attachBumpItem)
2627
+ if (source == attachBumpItem)
26482628 {
26492629 String texture = GetFile("Attach bump");
26502630 Object3D obj;
....@@ -2656,7 +2636,7 @@
26562636
26572637 refreshContents();
26582638 } else
2659
- if (event.getSource() == detachBumpItem)
2639
+ if (source == detachBumpItem)
26602640 {
26612641 Object3D obj;
26622642 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2667,7 +2647,7 @@
26672647
26682648 refreshContents();
26692649 } else
2670
- if (event.getSource() == pigmentBumpItem)
2650
+ if (source == pigmentBumpItem)
26712651 {
26722652 Object3D obj;
26732653 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2678,158 +2658,195 @@
26782658
26792659 refreshContents();
26802660 } else
2681
- if (event.getSource() == flashSelectionButton)
2661
+ if (source == flashSelectionButton)
26822662 {
26832663 CameraPane.flash = true;
26842664 refreshContents();
26852665 } else
2686
- if (event.getSource() == oneButton)
2666
+ if (source == oneButton)
26872667 {
26882668 } else
2689
- if (event.getSource() == twoButton)
2669
+ if (source == twoButton)
26902670 {
26912671 radio.layout = twoButton;
26922672 // bug
26932673 //gridPanel.setDividerLocation(1.0);
26942674 //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();
2675
+// bigThree.remove(scenePanel);
2676
+// bigThree.remove(centralPanel);
2677
+// bigThree.remove(XYZPanel);
2678
+// aWindowConstraints.gridx = 0;
2679
+// aWindowConstraints.gridy = 0;
2680
+// aWindowConstraints.gridwidth = 1;
2681
+// // aConstraints.gridheight = 3;
2682
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2683
+// aWindowConstraints.weightx = 0;
2684
+// aWindowConstraints.weighty = 1;
2685
+// //bigThree.add(jtp, aWindowConstraints);
2686
+// aWindowConstraints.weightx = 1;
2687
+// aWindowConstraints.gridwidth = 3;
2688
+// // aConstraints.gridheight = 3;
2689
+// aWindowConstraints.gridx = 1;
2690
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2691
+// bigThree.add(centralPanel, aWindowConstraints);
2692
+// aWindowConstraints.weightx = 0;
2693
+// aWindowConstraints.gridx = 4;
2694
+// aWindowConstraints.gridwidth = 1;
2695
+// // aConstraints.gridheight = 3;
2696
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2697
+// //bigThree.add(XYZPanel, aWindowConstraints);
2698
+// scenePanel.setVisible(false);
2699
+// centralPanel.setVisible(true);
2700
+// XYZPanel.setVisible(false);
2701
+ bigThree.ClearUI();
2702
+ bigThree.add(centralPanel);
2703
+ bigThree.FlushUI();
27192704 } else
2720
- if (event.getSource() == threeButton)
2705
+ if (source == threeButton)
27212706 {
27222707 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();
2708
+
2709
+// bigThree.remove(scenePanel);
2710
+// bigThree.remove(centralPanel);
2711
+// bigThree.remove(XYZPanel);
2712
+// aWindowConstraints.gridx = 0;
2713
+// aWindowConstraints.gridy = 0;
2714
+// aWindowConstraints.gridwidth = 1;
2715
+// // aConstraints.gridheight = 3;
2716
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2717
+// aWindowConstraints.weightx = 0;
2718
+// aWindowConstraints.weighty = 1;
2719
+// //bigThree.add(jtp, aWindowConstraints);
2720
+// aWindowConstraints.weightx = 1;
2721
+// aWindowConstraints.gridwidth = 3;
2722
+// // aConstraints.gridheight = 3;
2723
+// aWindowConstraints.gridx = 1;
2724
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2725
+// bigThree.add(centralPanel, aWindowConstraints);
2726
+// aWindowConstraints.weightx = 0;
2727
+// aWindowConstraints.gridx = 4;
2728
+// aWindowConstraints.gridwidth = 1;
2729
+// // aConstraints.gridheight = 3;
2730
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2731
+// bigThree.add(XYZPanel, aWindowConstraints);
2732
+// bigThree.validate();
2733
+// scenePanel.setVisible(false);
2734
+// centralPanel.setVisible(true);
2735
+// XYZPanel.setVisible(true);
2736
+ bigThree.ClearUI();
2737
+ bigThree.add(centralPanel);
2738
+ bigThree.add(XYZPanel);
2739
+ bigThree.FlushUI();
27472740 } else
2748
- if (event.getSource() == fourButton)
2741
+ if (source == fourButton)
27492742 {
27502743 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();
2744
+
2745
+// bigThree.remove(scenePanel);
2746
+// bigThree.remove(centralPanel);
2747
+// bigThree.remove(XYZPanel);
2748
+// aWindowConstraints.gridx = 0;
2749
+// aWindowConstraints.gridy = 0;
2750
+// aWindowConstraints.gridwidth = 1;
2751
+// // aWindowConstraints.gridheight = 3;
2752
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2753
+// aWindowConstraints.weightx = 1;
2754
+// aWindowConstraints.weighty = 1;
2755
+// bigThree.add(scenePanel, aWindowConstraints);
2756
+// aWindowConstraints.weightx = 1;
2757
+// aWindowConstraints.gridwidth = 3;
2758
+// // aConstraints.gridheight = 3;
2759
+// aWindowConstraints.gridx = 1;
2760
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2761
+// //bigThree.add(cameraPanel, aWindowConstraints);
2762
+// aWindowConstraints.weightx = 0;
2763
+// aWindowConstraints.gridx = 4;
2764
+// aWindowConstraints.gridwidth = 1;
2765
+// // aWindowConstraints.gridheight = 3;
2766
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2767
+// //bigThree.add(XYZPanel, aWindowConstraints);
2768
+// bigThree.validate();
2769
+// scenePanel.setVisible(true);
2770
+// centralPanel.setVisible(false);
2771
+// XYZPanel.setVisible(false);
2772
+ bigThree.ClearUI();
2773
+ bigThree.add(scenePanel);
2774
+ bigThree.FlushUI();
27752775 } else
2776
- if (event.getSource() == sixButton)
2776
+ if (source == sixButton)
27772777 {
27782778 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();
2779
+
2780
+// bigThree.remove(scenePanel);
2781
+// bigThree.remove(centralPanel);
2782
+// bigThree.remove(XYZPanel);
2783
+// aWindowConstraints.gridx = 0;
2784
+// aWindowConstraints.gridy = 0;
2785
+// aWindowConstraints.gridwidth = 1;
2786
+// // aConstraints.gridheight = 3;
2787
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2788
+// aWindowConstraints.weightx = 0;
2789
+// aWindowConstraints.weighty = 1;
2790
+// bigThree.add(scenePanel, aWindowConstraints);
2791
+// aWindowConstraints.weightx = 1;
2792
+// aWindowConstraints.gridwidth = 3;
2793
+// // aWindowConstraints.gridheight = 3;
2794
+// aWindowConstraints.gridx = 1;
2795
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2796
+// bigThree.add(centralPanel, aWindowConstraints);
2797
+// aWindowConstraints.weightx = 0;
2798
+// aWindowConstraints.gridx = 4;
2799
+// aWindowConstraints.gridwidth = 1;
2800
+// // aWindowConstraints.gridheight = 3;
2801
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2802
+// //bigThree.add(XYZPanel, aConstraints);
2803
+// bigThree.validate();
2804
+// scenePanel.setVisible(true);
2805
+// centralPanel.setVisible(true);
2806
+// XYZPanel.setVisible(false);
2807
+ bigThree.ClearUI();
2808
+ bigThree.add(scenePanel);
2809
+ bigThree.add(centralPanel);
2810
+ bigThree.FlushUI();
28032811 } else
2804
- if (event.getSource() == sevenButton)
2812
+ if (source == sevenButton)
28052813 {
28062814 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();
2815
+
2816
+// bigThree.remove(scenePanel);
2817
+// bigThree.remove(centralPanel);
2818
+// bigThree.remove(XYZPanel);
2819
+// aWindowConstraints.gridx = 0;
2820
+// aWindowConstraints.gridy = 0;
2821
+// aWindowConstraints.gridwidth = 1;
2822
+// // aWindowConstraints.gridheight = 3;
2823
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2824
+// aWindowConstraints.weightx = 0;
2825
+// aWindowConstraints.weighty = 1;
2826
+// bigThree.add(scenePanel, aWindowConstraints);
2827
+// aWindowConstraints.weightx = 1;
2828
+// aWindowConstraints.gridwidth = 3;
2829
+// // aWindowConstraints.gridheight = 3;
2830
+// aWindowConstraints.gridx = 1;
2831
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2832
+// bigThree.add(centralPanel, aWindowConstraints);
2833
+// aWindowConstraints.weightx = 0;
2834
+// aWindowConstraints.gridx = 4;
2835
+// aWindowConstraints.gridwidth = 1;
2836
+// // aConstraints.gridheight = 3;
2837
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2838
+// bigThree.add(XYZPanel, aWindowConstraints);
2839
+// bigThree.validate();
2840
+// scenePanel.setVisible(true);
2841
+// centralPanel.setVisible(true);
2842
+// XYZPanel.setVisible(true);
2843
+ bigThree.ClearUI();
2844
+ bigThree.add(scenePanel);
2845
+ bigThree.add(centralPanel);
2846
+ bigThree.add(XYZPanel);
2847
+ bigThree.FlushUI();
28312848 } else
2832
- if (event.getSource() == rootButton)
2849
+ if (source == rootButton)
28332850 {
28342851 Object3D obj;
28352852 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2841,7 +2858,7 @@
28412858
28422859 refreshContents(true);
28432860 } else
2844
- if (event.getSource() == closeButton)
2861
+ if (source == closeButton)
28452862 {
28462863 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28472864 cRadio ab;
....@@ -2862,11 +2879,11 @@
28622879 }
28632880 refreshContents(true);
28642881 } else
2865
- if (event.getSource() == editItem || event.getSource() == editButton)
2882
+ if (source == editItem || source == editButton)
28662883 {
28672884 EditSelection(false);
28682885 } else
2869
- if (event.getSource() == uneditButton)
2886
+ if (source == uneditButton)
28702887 {
28712888 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28722889 {
....@@ -2878,12 +2895,12 @@
28782895
28792896 child.editWindow = null; // ???????????
28802897 }
2881
- objEditor.ctrlPanel.revalidate();
2898
+ objEditor.ctrlPanel.validate();
28822899 //objEditor.jTree.clearSelection();
28832900 //objEditor.ResetSliders();
28842901 refreshContents(true);
28852902 } else
2886
- if (event.getSource() == clearPanelButton)
2903
+ if (source == clearPanelButton)
28872904 {
28882905 assert(copy == group);
28892906 //copy.ClearUI();
....@@ -2894,7 +2911,7 @@
28942911 listUI.clear();
28952912 refreshContents(true);
28962913 } else
2897
- if (event.getSource() == allParamsButton)
2914
+ if (source == allParamsButton)
28982915 {
28992916 assert(copy == group);
29002917
....@@ -2915,19 +2932,19 @@
29152932
29162933 refreshContents(true);
29172934 } else
2918
- if (event.getSource() == unselectButton)
2935
+ if (source == unselectButton)
29192936 {
29202937 objEditor.jTree.clearSelection();
29212938 // ?? oct 2012 GrafreeD.clipboard.clear();
29222939 objEditor.ResetSliders();
29232940 refreshContents(true);
29242941 } else
2925
- if(event.getSource() instanceof cRadio)
2942
+ if(source instanceof cRadio)
29262943 {
29272944 group.parent = keepparent;
29282945 group.attributes = 0;
29292946 //group.editWindow = null;
2930
- /*cRadio*/ radio = (cRadio)event.getSource();
2947
+ /*cRadio*/ radio = (cRadio)source;
29312948 Object3D obj = radio.GetObject();
29322949 System.out.println("Edit " + obj);
29332950 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -4086,12 +4103,12 @@
40864103 System.err.println("info : " + child.GetPath());
40874104 }
40884105 }
4089
- else
4090
- {
4091
- objEditor.SetMaterial(group); // .GetMaterial());
4092
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4093
- System.err.println("info : " + group.GetPath());
4094
- }
4106
+// else
4107
+// {
4108
+// objEditor.SetMaterial(group); // .GetMaterial());
4109
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4110
+// System.err.println("info : " + group.GetPath());
4111
+// }
40954112
40964113 objEditor.SetText(); // jan 2014
40974114