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,97 +434,24 @@
433434 oe.radioPanel.add(dummyButton);
434435 oe.buttonGroup.add(dummyButton);
435436 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
437
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439438
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
439
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
441440 liveCB.setToolTipText("Enabled animation");
442441 liveCB.addItemListener(this);
443442
444
- oe.aConstraints.gridx += 1;
445
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
446
- fastCB.setToolTipText("Fast mode");
447
- fastCB.addItemListener(this);
448
- oe.aConstraints.gridx += 1;
449
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
450
- supportCB.setToolTipText("Enabled rigging");
451
- supportCB.addItemListener(this);
452
-
453
- // oe.aConstraints.gridx += 1;
454
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
455
- // localCB.addItemListener(this);
456
-
457
- oe.aConstraints.gridx += 1;
458
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), oe.aConstraints);
459
- crowdCB.setToolTipText("Used for crowds");
460
- crowdCB.addItemListener(this);
461
-
462
- oe.aConstraints.gridx += 1;
463
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
464
- smoothCB.setToolTipText("Snapping delay");
465
- smoothCB.addItemListener(this);
466
-
467
- oe.aConstraints.gridx += 1;
468
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
469
- slowCB.setToolTipText("Smooth interpolation");
470
- slowCB.addItemListener(this);
471
- oe.aConstraints.gridx += 1;
472
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), oe.aConstraints);
473
- boxCB.setToolTipText("Display bounding boxes");
474
- boxCB.addItemListener(this);
475
- oe.aConstraints.gridx += 1;
476
- oe.toolbarPanel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), oe.aConstraints);
477
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
478
- zoomBoxCB.addItemListener(this);
479
-
480
-// oe.aConstraints.gridx += 1;
481
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
482
-// speakerMocapCB.addItemListener(this);
483
-
484
- if (false)
485
- {
486
- // handled in scripts
487
- oe.aConstraints.gridx += 1;
488
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
489
- speakerCameraCB.addItemListener(this);
490
-
491
- oe.aConstraints.gridx += 1;
492
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
493
- speakerFocusCB.addItemListener(this);
494
-
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
497
- smoothfocusCB.addItemListener(this);
498
- }
499
-
500
-//oe.aConstraints.gridx += 1;
501
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
502
-// debugCB.addItemListener(this);
503
-
504
- oe.aConstraints.gridx += 1;
505
- oe.toolbarPanel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), oe.aConstraints);
506
- oeilCB.addItemListener(this);
507
-
508
- oe.aConstraints.gridx += 1;
509
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), oe.aConstraints);
510
- lookAtCB.setToolTipText("Look-at target");
511
- lookAtCB.addItemListener(this);
512
-
513
- oe.aConstraints.gridx += 1;
514
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
443
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
515444 trackCB.setToolTipText("Enable tracking");
516445 trackCB.addItemListener(this);
517446
518
- oe.aConstraints.gridx += 1;
519
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
447
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
520448 screenfitButton.setToolTipText("Screen fit");
521449 screenfitButton.addActionListener(this);
522
- oe.aConstraints.gridx += 1;
450
+
523451 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
524452 // screenfitpointButton.addActionListener(this);
525453 // oe.aConstraints.gridx += 1;
526
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
454
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
527455 snapobjectButton.addActionListener(this);
528456 snapobjectButton.setToolTipText("Snap Object");
529457 oe.aConstraints.gridx += 1;
....@@ -533,76 +461,66 @@
533461 oe.aConstraints.weighty = 0;
534462 oe.aConstraints.gridwidth = 1;
535463
536
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
464
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
537465 flashSelectionButton.setToolTipText("Show selection");
538466 flashSelectionButton.addActionListener(this);
539467
540
- oe.toolbarPanel.add(new cButton(" ", false));
468
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
541469
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545
-
546
- //
547
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
470
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
548471 twoButton.setToolTipText("Show center view only");
549472 twoButton.addActionListener(this);
550
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
473
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
551474 fourButton.addActionListener(this);
552475 fourButton.setToolTipText("Show left panel only");
553
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
476
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
554477 sixButton.setToolTipText("2-column layout left");
555478 sixButton.addActionListener(this);
556
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
479
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
557480 threeButton.setToolTipText("2-column layout right");
558481 threeButton.addActionListener(this);
559
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
482
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
560483 sevenButton.setToolTipText("3-column layout");
561484 sevenButton.addActionListener(this);
562485 //
563486
564
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
565
- 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");
566489 rootButton.addActionListener(this);
567
- oe.aConstraints.gridx += 1;
568
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
490
+
491
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
569492 closeButton.setToolTipText("Close tab");
570493 closeButton.addActionListener(this);
571494 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
572495 //clearButton.addActionListener(this);
573
- oe.aConstraints.gridx += 1;
574496
575
- oe.aConstraints.gridx = 1; //
576
- 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");
577501 editButton.addActionListener(this);
578
- oe.aConstraints.gridx += 1;
579
- oe.aConstraints.weighty = 0;
580
- oe.aConstraints.gridwidth = 1;
581502
582
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
503
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
504
+ uneditButton.setToolTipText("Unedit selection");
583505 uneditButton.addActionListener(this);
584506
585
- oe.aConstraints.gridx += 1;
586
- oe.aConstraints.weighty = 0;
587
- oe.aConstraints.gridwidth = 1;
588
-
589
- 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");
590509 clearPanelButton.addActionListener(this);
591510
592
- oe.aConstraints.gridx += 1;
593
- oe.aConstraints.weighty = 0;
594
- oe.aConstraints.gridwidth = 1;
595
-
596
- 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??");
597513 allParamsButton.addActionListener(this);
598514
599
- oe.aConstraints.gridx += 1;
600
- oe.aConstraints.weighty = 0;
601
- oe.aConstraints.gridwidth = 1;
602
-
603
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
515
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
516
+ unselectButton.setToolTipText("Unselect");
604517 unselectButton.addActionListener(this);
605518
519
+ commandsPanel.preferredHeight = 1;
520
+
521
+ oe.treePanel.add(commandsPanel);
522
+ oe.treePanel.Return();
523
+
606524 // oe.aConstraints.gridx += 1;
607525 // oe.aConstraints.weighty = 0;
608526 // oe.aConstraints.gridwidth = 1;
....@@ -614,40 +532,37 @@
614532 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
615533 // gcButton.addActionListener(this);
616534
617
- oe.aConstraints.gridx = 0;
618
- oe.aConstraints.gridy += 1;
619
-
620
- //ctrlPanel.add(objList = new List(5, true));
621
- oe.aConstraints.gridwidth = 100;
622
- // oe.aConstraints.gridheight = 100;
623
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
624
- oe.aConstraints.gridheight = 1;
625
- oe.aConstraints.weighty = 0.5;
626
- oe.aConstraints.gridx = 0;
627
- JScrollPane jSP;
535
+ cGridBag jSPPanel = new cGridBag();
536
+
537
+ JScrollPane jSP;
628538 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
629
- 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);
630540 ResetModel();
631
- oe.aConstraints.weighty = 0.5;
632
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
633
- oe.aConstraints.gridy += 1;
634
- oe.aConstraints.gridwidth = 1;
541
+
542
+ oe.treePanel.add(jSPPanel);
543
+ oe.treePanel.Return();
635544
636
- oe.aConstraints.weighty = 0;
637
- oe.aConstraints.gridwidth = 2;
638
-
639
- 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");
640549 colorCB.addItemListener(this);
641
- oe.aConstraints.gridx += 2;
642
- 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");
643553 materialCB.addItemListener(this);
644
- oe.aConstraints.gridx += 2;
645
- 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");
646557 textureCB.addItemListener(this);
647558
648
- oe.aConstraints.gridx = 0;
649
- oe.aConstraints.gridy += 1;
559
+ copyOptionsPanel.preferredHeight = 1;
560
+ oe.treePanel.add(copyOptionsPanel);
561
+ oe.treePanel.Return();
650562
563
+// mainPanel.setDividerLocation(0.5); //1.0);
564
+// mainPanel.setResizeWeight(0.5);
565
+
651566 //jList.addListSelectionListener(this);
652567 oe.jTree.addTreeSelectionListener(this);
653568 //jTree.setRootVisible(false);
....@@ -669,6 +584,86 @@
669584 radio.layout = sevenButton;
670585 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
671586 }
587
+
588
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
589
+ {
590
+ //constraints.gridx = 0;
591
+ //constraints.gridy = 0;
592
+ panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
593
+ fastCB.setToolTipText("Fast mode");
594
+ fastCB.addItemListener(this);
595
+ //constraints.gridy += 1;
596
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
597
+ supportCB.setToolTipText("Enabled rigging");
598
+ supportCB.addItemListener(this);
599
+
600
+ // constraints.gridy += 1;
601
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
602
+ // localCB.addItemListener(this);
603
+
604
+ //constraints.gridy += 1;
605
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
606
+ crowdCB.setToolTipText("Used for crowds");
607
+ crowdCB.addItemListener(this);
608
+
609
+ //constraints.gridy += 1;
610
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
611
+ smoothCB.setToolTipText("Snapping delay");
612
+ smoothCB.addItemListener(this);
613
+
614
+ //constraints.gridy += 1;
615
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
616
+ slowCB.setToolTipText("Smooth interpolation");
617
+ slowCB.addItemListener(this);
618
+ //constraints.gridy += 1;
619
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
620
+ boxCB.setToolTipText("Display bounding boxes");
621
+ boxCB.addItemListener(this);
622
+ //constraints.gridy += 1;
623
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
624
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
625
+ zoomBoxCB.addItemListener(this);
626
+
627
+// constraints.gridy += 1;
628
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
629
+// speakerMocapCB.addItemListener(this);
630
+
631
+ if (false)
632
+ {
633
+ // handled in scripts
634
+ //constraints.gridy += 1;
635
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
636
+ speakerCameraCB.addItemListener(this);
637
+
638
+ //constraints.gridy += 1;
639
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
640
+ speakerFocusCB.addItemListener(this);
641
+
642
+ //constraints.gridy += 1;
643
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
644
+ smoothfocusCB.addItemListener(this);
645
+ }
646
+
647
+//constraints.gridx += 1;
648
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
649
+// debugCB.addItemListener(this);
650
+
651
+ //constraints.gridy += 1;
652
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
653
+ oeilCB.addItemListener(this);
654
+
655
+ //constraints.gridy += 1;
656
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
657
+ lookAtCB.setToolTipText("Look-at target");
658
+ lookAtCB.addItemListener(this);
659
+
660
+ cGridBag fill = new cGridBag();
661
+
662
+ fill.preferredHeight = 200;
663
+
664
+ panel.add(fill);
665
+
666
+ }
672667
673668 void EditObject(Object3D obj)
674669 {
....@@ -1510,6 +1505,7 @@
15101505 //
15111506 public void actionPerformed(ActionEvent event) // , Object arg)
15121507 {
1508
+ Object source = event.getSource();
15131509 /*
15141510 if (event.getSource() == nameField)
15151511 {
....@@ -1521,11 +1517,11 @@
15211517 }
15221518 else
15231519 */
1524
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1520
+ if (source == lookAtItem || source == lookFromItem)
15251521 {
15261522 ScreenFit();
15271523 } else
1528
- if (event.getSource() == switchItem)
1524
+ if (source == switchItem)
15291525 {
15301526 cVector v1 = new cVector();
15311527 cVector v2 = new cVector();
....@@ -1534,11 +1530,11 @@
15341530 objEditor.cameraView.renderCamera.setAim(v2, v1);
15351531 objEditor.cameraView.repaint();
15361532 } else
1537
- if (event.getSource() == rectoidItem)
1533
+ if (source == rectoidItem)
15381534 {
15391535 makeSomething(new Box());
15401536 } else
1541
- if (event.getSource() == particleItem)
1537
+ if (source == particleItem)
15421538 {
15431539 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15441540 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1559,9 +1555,9 @@
15591555 applyExample(particleGeom, "SMOKE");
15601556 makeSomething(particleGeom);
15611557 } else
1562
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1558
+ if (source == ragdollItem || source == ragdoll2Item)
15631559 {
1564
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1560
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15651561
15661562 ragdoll.toParent = LA.newMatrix();
15671563 ragdoll.fromParent = LA.newMatrix();
....@@ -1579,7 +1575,7 @@
15791575 } else
15801576 /*
15811577 */
1582
- if (event.getSource() == heightFieldItem)
1578
+ if (source == heightFieldItem)
15831579 {
15841580 Object3D obj = new Object3D();
15851581
....@@ -1617,31 +1613,31 @@
16171613
16181614 makeSomething(obj);
16191615 } else
1620
- if (event.getSource() == gridItem)
1616
+ if (source == gridItem)
16211617 {
16221618 makeSomething(new Grid());
16231619 } else
1624
- if (event.getSource() == ellipsoidItem)
1620
+ if (source == ellipsoidItem)
16251621 {
16261622 makeSomething(new Sphere());
16271623 } else
1628
- if (event.getSource() == coneItem)
1624
+ if (source == coneItem)
16291625 {
16301626 makeSomething(new Cone());
16311627 } else
1632
- if (event.getSource() == torusItem)
1628
+ if (source == torusItem)
16331629 {
16341630 makeSomething(new Torus());
16351631 } else
1636
- if (event.getSource() == superItem)
1632
+ if (source == superItem)
16371633 {
16381634 makeSomething(new Superellipsoid());
16391635 } else
1640
- if (event.getSource() == kleinItem)
1636
+ if (source == kleinItem)
16411637 {
16421638 makeSomething(new Klein());
16431639 } else
1644
- if (event.getSource() == blobItem)
1640
+ if (source == blobItem)
16451641 {
16461642 Blob blob = new Blob();
16471643 BlobComponent comp = new BlobComponent();
....@@ -1649,15 +1645,15 @@
16491645 //blob.retile();
16501646 makeSomething(blob);
16511647 } else
1652
- if (event.getSource() == latheItem)
1648
+ if (source == latheItem)
16531649 {
16541650 makeSomething(new Lathe());
16551651 } else
1656
- if (event.getSource() == bezierItem)
1652
+ if (source == bezierItem)
16571653 {
16581654 makeSomething(new BezierSurface());
16591655 } else
1660
- if (event.getSource() == checkerItem)
1656
+ if (source == checkerItem)
16611657 {
16621658 /*
16631659 Object3D obj = new BezierSurface(5,8);
....@@ -1672,7 +1668,7 @@
16721668 */
16731669 makeSomething(new Checker());
16741670 } else
1675
- if (event.getSource() == meshItem)
1671
+ if (source == meshItem)
16761672 {
16771673 Object3D itemtomake = new Object3D();
16781674 Object3D child;
....@@ -1693,35 +1689,35 @@
16931689 makeSomething(child);
16941690 }
16951691 } else
1696
- if (event.getSource() == springItem)
1692
+ if (source == springItem)
16971693 {
16981694 cSpring s = new cSpring();
16991695 s.setup();
17001696 makeSomething(s);
17011697 } else
1702
- if (event.getSource() == flagItem)
1698
+ if (source == flagItem)
17031699 {
17041700 cSpring s = new cFlag();
17051701 s.setup();
17061702 makeSomething(s);
17071703 } else
1708
- if (event.getSource() == lightItem)
1704
+ if (source == lightItem)
17091705 {
17101706 makeSomething(new Light());
17111707 } else
1712
- if (event.getSource() == csgItem)
1708
+ if (source == csgItem)
17131709 {
17141710 group(new CSG());
17151711 } else
1716
- if (event.getSource() == templateItem)
1712
+ if (source == templateItem)
17171713 {
17181714 group(new cTemplate());
17191715 } else
1720
- if (event.getSource() == attributeItem)
1716
+ if (source == attributeItem)
17211717 {
17221718 makeSomething(new Attribute());
17231719 } else
1724
- if (event.getSource() == pointflowItem)
1720
+ if (source == pointflowItem)
17251721 {
17261722 makeSomething(new PointFlow());
17271723 } else
....@@ -1733,7 +1729,7 @@
17331729 } else
17341730 */
17351731
1736
- if (event.getSource() == superLoopItem)
1732
+ if (source == superLoopItem)
17371733 {
17381734 Composite g = new cGroup();
17391735 for (int i=0; i<15; i++)
....@@ -1755,7 +1751,7 @@
17551751
17561752 group(g);
17571753 } else
1758
- if (event.getSource() == loopItem)
1754
+ if (source == loopItem)
17591755 {
17601756 Composite csg = new GroupLeaf();
17611757 csg.count = 5;
....@@ -1764,7 +1760,7 @@
17641760 csg.addChild(child);
17651761 child.addChild(csg);
17661762 } else
1767
- if (event.getSource() == doubleItem)
1763
+ if (source == doubleItem)
17681764 {
17691765 Composite csg = new GroupLeaf();
17701766 csg.count = 5;
....@@ -1776,7 +1772,7 @@
17761772 csg.addChild(child);
17771773 child.addChild(csg);
17781774 } else
1779
- if (event.getSource() == tripleItem)
1775
+ if (source == tripleItem)
17801776 {
17811777 Composite csg = new GroupLeaf();
17821778 csg.count = 4;
....@@ -1792,70 +1788,70 @@
17921788 child.addChild(csg);
17931789 } else
17941790
1795
- if (event.getSource() == importGFDItem)
1791
+ if (source == importGFDItem)
17961792 {
17971793 ImportGFD();
17981794 } else
1799
- if (event.getSource() == importVRMLX3DItem)
1795
+ if (source == importVRMLX3DItem)
18001796 {
18011797 ImportVRMLX3D();
18021798 } else
1803
- if (event.getSource() == import3DSItem)
1799
+ if (source == import3DSItem)
18041800 {
18051801 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
18061802 } else
1807
- if (event.getSource() == importOBJItem)
1803
+ if (source == importOBJItem)
18081804 {
18091805 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
18101806 } else
1811
- if (event.getSource() == computeAOItem)
1807
+ if (source == computeAOItem)
18121808 {
18131809 Globals.drawMode = CameraPane.OCCLUSION;
18141810 Globals.theRenderer.repaint();
18151811 } else
1816
- if (event.getSource() == recompileItem)
1812
+ if (source == recompileItem)
18171813 {
18181814 Recompile();
18191815 refreshContents();
18201816 } else
1821
- if (event.getSource() == editScriptItem)
1817
+ if (source == editScriptItem)
18221818 {
18231819 OpenDialog();
18241820 refreshContents();
18251821 } else
1826
- if (event.getSource() == invariantsItem)
1822
+ if (source == invariantsItem)
18271823 {
18281824 System.out.println("Invariants:");
18291825 GrafreeD.grafreeD.universe.invariants();
18301826 } else
1831
- if (event.getSource() == memoryItem)
1827
+ if (source == memoryItem)
18321828 {
18331829 //System.out.println("Invariants:");
18341830 PrintMemory();
18351831 } else
1836
- if (event.getSource() == pathItem)
1832
+ if (source == pathItem)
18371833 {
18381834 PrintPath();
18391835 } else
1840
- if (event.getSource() == analyzeItem)
1836
+ if (source == analyzeItem)
18411837 {
18421838 AnalyzeObject();
18431839 } else
1844
- if (event.getSource() == dumpItem)
1840
+ if (source == dumpItem)
18451841 {
18461842 DumpObject();
18471843 } else
1848
- if (event.getSource() == screenfitButton)
1844
+ if (source == screenfitButton)
18491845 {
18501846 //Reload(lastConverter, lastFilename, true);
18511847 ScreenFit();
18521848 } else
1853
- if (event.getSource() == screenfitpointButton)
1849
+ if (source == screenfitpointButton)
18541850 {
18551851 //Reload(lastConverter, lastFilename, true);
18561852 ScreenFitPoint();
18571853 } else
1858
- if (event.getSource() == snapobjectButton)
1854
+ if (source == snapobjectButton)
18591855 {
18601856 //Reload(lastConverter, lastFilename, true);
18611857 SnapObject();
....@@ -1866,13 +1862,13 @@
18661862 // Recompile();
18671863 // refreshContents();
18681864 // } else
1869
- if (event.getSource() == gcButton)
1865
+ if (source == gcButton)
18701866 {
18711867 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18721868 System.gc();
18731869 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18741870 } else
1875
- if (event.getSource() == editLeafItem)
1871
+ if (source == editLeafItem)
18761872 {
18771873 Object3D obj;
18781874 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1886,62 +1882,62 @@
18861882 }
18871883 refreshContents(true);
18881884 } else
1889
- if (event.getSource() == openWindowItem)
1885
+ if (source == openWindowItem)
18901886 {
18911887 EditSelection(true);
18921888 } else
1893
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1889
+ if (source == cutItem || source == clearButton)
18941890 {
18951891 loadClipboard(true);
18961892 } else
1897
- if (event.getSource() == duplicateItem)
1893
+ if (source == duplicateItem)
18981894 {
18991895 Object3D keep = GrafreeD.clipboard;
19001896 loadClipboard(false);
19011897 paste(false);
19021898 GrafreeD.clipboard = keep;
19031899 } else
1904
- if (event.getSource() == cloneItem)
1900
+ if (source == cloneItem)
19051901 {
19061902 CloneSelection(false);
19071903 } else
1908
- if (event.getSource() == cloneSupportItem)
1904
+ if (source == cloneSupportItem)
19091905 {
19101906 CloneSelection(true);
19111907 } else
1912
- if (event.getSource() == copyItem)
1908
+ if (source == copyItem)
19131909 {
19141910 loadClipboard(false);
19151911 } else
1916
- if (event.getSource() == pasteItem)
1912
+ if (source == pasteItem)
19171913 {
19181914 paste(false);
19191915 } else
1920
- if (event.getSource() == pasteLinkItem)
1916
+ if (source == pasteLinkItem)
19211917 {
19221918 pasteInto(false);
19231919 } else
1924
- if (event.getSource() == pasteCloneItem)
1920
+ if (source == pasteCloneItem)
19251921 {
19261922 pasteInto(true);
19271923 } else
1928
- if (event.getSource() == pasteExpandItem)
1924
+ if (source == pasteExpandItem)
19291925 {
19301926 paste(true);
19311927 } else
1932
- if (event.getSource() == synchronizeItem)
1928
+ if (source == synchronizeItem)
19331929 {
19341930 Overwrite(Object3D.TRANSFORM);
19351931 } else
1936
- if (event.getSource() == overwriteNameItem)
1932
+ if (source == overwriteNameItem)
19371933 {
19381934 Overwrite(Object3D.NAME);
19391935 } else
1940
- if (event.getSource() == overwriteUVItem)
1936
+ if (source == overwriteUVItem)
19411937 {
19421938 Overwrite(Object3D.UV);
19431939 } else
1944
- if (event.getSource() == overwriteMatItem)
1940
+ if (source == overwriteMatItem)
19451941 {
19461942 /* july 2015
19471943 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1961,7 +1957,7 @@
19611957
19621958 Overwrite(dropAttributes);
19631959 }
1964
- if (event.getSource() == overwriteGeoItem)
1960
+ if (source == overwriteGeoItem)
19651961 {
19661962 Overwrite(Object3D.GEOMETRY);
19671963 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1978,7 +1974,7 @@
19781974 // refreshContents();
19791975 // }
19801976 } else
1981
- if (event.getSource() == generateMeshItem)
1977
+ if (source == generateMeshItem)
19821978 {
19831979 //if (group.selection.size() == 1)
19841980 // for (int i=0; i<group.selection.size(); i++)
....@@ -1989,7 +1985,7 @@
19891985 ResetModel();
19901986 refreshContents();
19911987 } else
1992
- if (event.getSource() == extractGeometriesItem)
1988
+ if (source == extractGeometriesItem)
19931989 {
19941990 boolean one = false;
19951991
....@@ -2016,7 +2012,7 @@
20162012 ResetModel();
20172013 refreshContents();
20182014 } else
2019
- if (event.getSource() == cloneGeometriesItem)
2015
+ if (source == cloneGeometriesItem)
20202016 {
20212017 boolean one = false;
20222018
....@@ -2042,7 +2038,7 @@
20422038 ResetModel();
20432039 refreshContents();
20442040 } else
2045
- if (event.getSource() == shareGeometriesItem)
2041
+ if (source == shareGeometriesItem)
20462042 {
20472043 boolean one = false;
20482044
....@@ -2072,7 +2068,7 @@
20722068 refreshContents();
20732069 }
20742070 } else
2075
- if (event.getSource() == mergeGeometriesItem)
2071
+ if (source == mergeGeometriesItem)
20762072 {
20772073 boolean one = false;
20782074
....@@ -2102,7 +2098,7 @@
21022098 ResetModel();
21032099 refreshContents();
21042100 } else
2105
- if (event.getSource() == linkverticesItem)
2101
+ if (source == linkverticesItem)
21062102 {
21072103 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21082104 // {
....@@ -2135,7 +2131,7 @@
21352131 refreshContents();
21362132 }
21372133 } else
2138
- if (event.getSource() == resetsupportItem)
2134
+ if (source == resetsupportItem)
21392135 {
21402136 for (int i=0; i<group.selection.size(); i++)
21412137 {
....@@ -2147,7 +2143,7 @@
21472143
21482144 refreshContents();
21492145 } else
2150
- if (event.getSource() == relinkverticesItem)
2146
+ if (source == relinkverticesItem)
21512147 {
21522148 boolean random = CameraPane.RANDOM;
21532149 CameraPane.RANDOM = false; // parse all random nodes
....@@ -2156,7 +2152,7 @@
21562152
21572153 refreshContents();
21582154 } else
2159
- if (event.getSource() == resetreferencesItem)
2155
+ if (source == resetreferencesItem)
21602156 {
21612157 for (int i=0; i<group.selection.size(); i++)
21622158 {
....@@ -2165,7 +2161,7 @@
21652161
21662162 refreshContents();
21672163 } else
2168
- if (event.getSource() == setMasterItem)
2164
+ if (source == setMasterItem)
21692165 {
21702166 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21712167 {
....@@ -2178,7 +2174,7 @@
21782174 refreshContents();
21792175 }
21802176 } else
2181
- if (event.getSource() == poseMeshItem)
2177
+ if (source == poseMeshItem)
21822178 {
21832179 if (group.selection.size() == 1)
21842180 {
....@@ -2197,19 +2193,19 @@
21972193 }
21982194
21992195 } else
2200
- if (event.getSource() == revertMeshItem)
2196
+ if (source == revertMeshItem)
22012197 {
22022198 RevertMeshes();
22032199 } else
2204
- if (event.getSource() == resetMeshItem)
2200
+ if (source == resetMeshItem)
22052201 {
22062202 ResetAll();
22072203 } else
2208
- if (event.getSource() == stepAllItem)
2204
+ if (source == stepAllItem)
22092205 {
22102206 StepAll();
22112207 } else
2212
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2208
+ if (source == clearItem) // || event.getSource() == clearButton)
22132209 {
22142210 //int indices[] = jList.getSelectedIndices();
22152211 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2217,46 +2213,46 @@
22172213
22182214 ClearSelection(false);
22192215 } else
2220
- if (event.getSource() == clearAllItem)
2216
+ if (source == clearAllItem)
22212217 {
22222218 ClearSelection(true);
22232219 } else
2224
- if (event.getSource() == grabItem)
2220
+ if (source == grabItem)
22252221 {
22262222 group(new cGroup(), true);
22272223 } else
2228
- if (event.getSource() == hideItem)
2224
+ if (source == hideItem)
22292225 {
22302226 group(new HiddenObject());
22312227 } else
2232
- if (event.getSource() == frontItem)
2228
+ if (source == frontItem)
22332229 {
22342230 front();
22352231 } else
2236
- if (event.getSource() == backItem)
2232
+ if (source == backItem)
22372233 {
22382234 back();
22392235 } else
2240
- if (event.getSource() == cameraItem)
2236
+ if (source == cameraItem)
22412237 {
22422238 makeSomething(new Camera());
22432239 } else
2244
- if (event.getSource() == compositeItem)
2240
+ if (source == compositeItem)
22452241 {
22462242 group(new Composite());
22472243 } else
2248
- if (event.getSource() == randomItem)
2244
+ if (source == randomItem)
22492245 {
22502246 RandomNode random = new RandomNode();
22512247 group(random);
22522248 if (random.size() > 0)
22532249 random.name = random.get(0).name + "Rnd";
22542250 } else
2255
- if (event.getSource() == physicsItem)
2251
+ if (source == physicsItem)
22562252 {
22572253 group(new PhysicsNode());
22582254 } else
2259
- if (event.getSource() == frameselectorItem)
2255
+ if (source == frameselectorItem)
22602256 {
22612257 for (int i=0; i<group.selection.size(); i++)
22622258 {
....@@ -2268,7 +2264,7 @@
22682264 ResetModel();
22692265 refreshContents();
22702266 } else
2271
- if (event.getSource() == switchGeoItem)
2267
+ if (source == switchGeoItem)
22722268 {
22732269 for (int i=0; i<group.selection.size(); i++)
22742270 {
....@@ -2280,7 +2276,7 @@
22802276 ResetModel();
22812277 refreshContents();
22822278 } else
2283
- if (event.getSource() == switchTransfoItem)
2279
+ if (source == switchTransfoItem)
22842280 {
22852281 for (int i=0; i<group.selection.size(); i++)
22862282 {
....@@ -2292,7 +2288,7 @@
22922288 ResetModel();
22932289 refreshContents();
22942290 } else
2295
- if (event.getSource() == morphItem)
2291
+ if (source == morphItem)
22962292 {
22972293 for (int i=0; i<group.selection.size(); i++)
22982294 {
....@@ -2304,7 +2300,7 @@
23042300 ResetModel();
23052301 refreshContents();
23062302 } else
2307
- if (event.getSource() == scriptNodeItem)
2303
+ if (source == scriptNodeItem)
23082304 {
23092305 boolean atleastone = false;
23102306
....@@ -2343,31 +2339,31 @@
23432339 }
23442340 }
23452341 } else
2346
- if (event.getSource() == linkerItem)
2342
+ if (source == linkerItem)
23472343 {
23482344 group(new cLinker());
23492345 } else
2350
- if (event.getSource() == textureItem)
2346
+ if (source == textureItem)
23512347 {
23522348 group(new TextureNode());
23532349 } else
2354
- if (event.getSource() == billboardItem)
2350
+ if (source == billboardItem)
23552351 {
23562352 group(new BillboardNode());
23572353 } else
2358
- if (event.getSource() == shadowXItem)
2354
+ if (source == shadowXItem)
23592355 {
23602356 CastShadow(0);
23612357 } else
2362
- if (event.getSource() == shadowYItem)
2358
+ if (source == shadowYItem)
23632359 {
23642360 CastShadow(1);
23652361 } else
2366
- if (event.getSource() == shadowZItem)
2362
+ if (source == shadowZItem)
23672363 {
23682364 CastShadow(2);
23692365 } else
2370
- if (event.getSource() == ungroupItem)
2366
+ if (source == ungroupItem)
23712367 {
23722368 //ungroup();
23732369 for (int i=0; i<group.selection.size(); i++)
....@@ -2379,179 +2375,179 @@
23792375
23802376 refreshContents();
23812377 } else
2382
- if (event.getSource() == genUVItem)
2378
+ if (source == genUVItem)
23832379 {
23842380 GenUV();
23852381 } else
2386
- if (event.getSource() == genNormalsCADItem)
2382
+ if (source == genNormalsCADItem)
23872383 {
23882384 GenNormals(true);
23892385 } else
2390
- if (event.getSource() == genNormalsMESHItem)
2386
+ if (source == genNormalsMESHItem)
23912387 {
23922388 GenNormals(true); // TODO
23932389 } else
2394
- if (event.getSource() == genNormalsORGANItem)
2390
+ if (source == genNormalsORGANItem)
23952391 {
23962392 GenNormals(false);
23972393 } else
2398
- if (event.getSource() == genNormalsMINEItem)
2394
+ if (source == genNormalsMINEItem)
23992395 {
24002396 GenNormalsMINE();
24012397 } else
2402
- if (event.getSource() == stripifyItem)
2398
+ if (source == stripifyItem)
24032399 {
24042400 Stripify();
24052401 } else
2406
- if (event.getSource() == unstripifyItem)
2402
+ if (source == unstripifyItem)
24072403 {
24082404 Unstripify();
24092405 } else
2410
- if (event.getSource() == trimItem)
2406
+ if (source == trimItem)
24112407 {
24122408 Trim();
24132409 } else
2414
- if (event.getSource() == untrimItem)
2410
+ if (source == untrimItem)
24152411 {
24162412 Untrim();
24172413 } else
2418
- if (event.getSource() == clearColorsItem)
2414
+ if (source == clearColorsItem)
24192415 {
24202416 ClearColors();
24212417 } else
2422
- if (event.getSource() == clearMaterialsItem)
2418
+ if (source == clearMaterialsItem)
24232419 {
24242420 ClearMaterials();
24252421 } else
2426
- if (event.getSource() == liveleavesItem)
2422
+ if (source == liveleavesItem)
24272423 {
24282424 LiveLeaves(true);
24292425 } else
2430
- if (event.getSource() == unliveleavesItem)
2426
+ if (source == unliveleavesItem)
24312427 {
24322428 LiveLeaves(false);
24332429 } else
2434
- if (event.getSource() == supportleavesItem)
2430
+ if (source == supportleavesItem)
24352431 {
24362432 SupportLeaves(true);
24372433 } else
2438
- if (event.getSource() == unsupportleavesItem)
2434
+ if (source == unsupportleavesItem)
24392435 {
24402436 SupportLeaves(false);
24412437 } else
2442
- if (event.getSource() == hideleavesItem)
2438
+ if (source == hideleavesItem)
24432439 {
24442440 HideLeaves(true);
24452441 } else
2446
- if (event.getSource() == showleavesItem)
2442
+ if (source == showleavesItem)
24472443 {
24482444 HideLeaves(false);
24492445 } else
2450
- if (event.getSource() == markleavesItem)
2446
+ if (source == markleavesItem)
24512447 {
24522448 MarkLeaves(true);
24532449 } else
2454
- if (event.getSource() == unmarkleavesItem)
2450
+ if (source == unmarkleavesItem)
24552451 {
24562452 MarkLeaves(false);
24572453 } else
2458
- if (event.getSource() == flipVItem)
2454
+ if (source == flipVItem)
24592455 {
24602456 FlipV(true);
24612457 } else
2462
- if (event.getSource() == unflipVItem)
2458
+ if (source == unflipVItem)
24632459 {
24642460 FlipV(false);
24652461 } else
2466
- if (event.getSource() == lowTexturesItem)
2462
+ if (source == lowTexturesItem)
24672463 {
24682464 SetTexRes(0);
24692465 } else
2470
- if (event.getSource() == normalTexturesItem)
2466
+ if (source == normalTexturesItem)
24712467 {
24722468 SetTexRes(1);
24732469 } else
2474
- if (event.getSource() == highTexturesItem)
2470
+ if (source == highTexturesItem)
24752471 {
24762472 SetTexRes(2);
24772473 } else
2478
- if (event.getSource() == veryhighTexturesItem)
2474
+ if (source == veryhighTexturesItem)
24792475 {
24802476 SetTexRes(3);
24812477 } else
2482
- if (event.getSource() == maxTexturesItem)
2478
+ if (source == maxTexturesItem)
24832479 {
24842480 SetTexRes(4);
24852481 } else
2486
- if (event.getSource() == panoTexturesItem)
2482
+ if (source == panoTexturesItem)
24872483 {
24882484 SetTexRes(5);
24892485 } else
2490
- if (event.getSource() == reverseNormalsItem)
2486
+ if (source == reverseNormalsItem)
24912487 {
24922488 ReverseNormals();
24932489 } else
2494
- if (event.getSource() == parseverticesItem)
2490
+ if (source == parseverticesItem)
24952491 {
24962492 ParseVertices();
24972493 } else
2498
- if (event.getSource() == textureFieldItem)
2494
+ if (source == textureFieldItem)
24992495 {
25002496 TextureVertices();
25012497 } else
2502
- if (event.getSource() == alignItem)
2498
+ if (source == alignItem)
25032499 {
25042500 Align();
25052501 } else
2506
- if (event.getSource() == mirrorItem)
2502
+ if (source == mirrorItem)
25072503 {
25082504 MirrorPoses();
25092505 } else
2510
- if (event.getSource() == reduceMorphItem)
2506
+ if (source == reduceMorphItem)
25112507 {
25122508 MeshReduction(false);
25132509 } else
2514
- if (event.getSource() == reduce34MorphItem)
2510
+ if (source == reduce34MorphItem)
25152511 {
25162512 MeshReduction(true);
25172513 } else
2518
- if (event.getSource() == reverseTrianglesItem)
2514
+ if (source == reverseTrianglesItem)
25192515 {
25202516 ReverseTriangles();
25212517 } else
2522
- if (event.getSource() == reduceMeshItem)
2518
+ if (source == reduceMeshItem)
25232519 {
25242520 ReduceMesh(false);
25252521 } else
2526
- if (event.getSource() == reduce34MeshItem)
2522
+ if (source == reduce34MeshItem)
25272523 {
25282524 ReduceMesh(true);
25292525 } else
2530
- if (event.getSource() == increaseMeshItem)
2526
+ if (source == increaseMeshItem)
25312527 {
25322528 IncreaseMesh();
25332529 } else
2534
- if (event.getSource() == clipMeshItem)
2530
+ if (source == clipMeshItem)
25352531 {
25362532 ClipMesh();
25372533 } else
2538
- if (event.getSource() == smoothMeshItem)
2534
+ if (source == smoothMeshItem)
25392535 {
25402536 SmoothMesh();
25412537 } else
2542
- if (event.getSource() == transformgeometryItem)
2538
+ if (source == transformgeometryItem)
25432539 {
25442540 TransformGeometry();
25452541 } else
2546
- if (event.getSource() == resetTransformItem)
2542
+ if (source == resetTransformItem)
25472543 {
25482544 ResetTransform();
25492545 } else
2550
- if (event.getSource() == resetCentroidItem)
2546
+ if (source == resetCentroidItem)
25512547 {
25522548 ResetCentroid();
25532549 } else
2554
- if (event.getSource() == resetParentItem)
2550
+ if (source == resetParentItem)
25552551 {
25562552 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25572553 {
....@@ -2561,7 +2557,7 @@
25612557
25622558 refreshContents();
25632559 } else
2564
- if (event.getSource() == repairParentItem)
2560
+ if (source == repairParentItem)
25652561 {
25662562 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25672563 {
....@@ -2575,7 +2571,7 @@
25752571
25762572 refreshContents();
25772573 } else
2578
- if (event.getSource() == repairShadowItem)
2574
+ if (source == repairShadowItem)
25792575 {
25802576 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25812577 {
....@@ -2589,7 +2585,7 @@
25892585
25902586 refreshContents();
25912587 } else
2592
- if (event.getSource() == sortbysizeItem)
2588
+ if (source == sortbysizeItem)
25932589 {
25942590 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25952591 {
....@@ -2601,7 +2597,7 @@
26012597 ResetModel();
26022598 refreshContents();
26032599 } else
2604
- if (event.getSource() == sortbynameItem)
2600
+ if (source == sortbynameItem)
26052601 {
26062602 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26072603 {
....@@ -2613,7 +2609,7 @@
26132609 ResetModel();
26142610 refreshContents();
26152611 } else
2616
- if (event.getSource() == attachPigmentItem)
2612
+ if (source == attachPigmentItem)
26172613 {
26182614 String texture = GetFile("Attach pigment");
26192615 Object3D obj;
....@@ -2625,7 +2621,7 @@
26252621
26262622 refreshContents();
26272623 } else
2628
- if (event.getSource() == detachPigmentItem)
2624
+ if (source == detachPigmentItem)
26292625 {
26302626 Object3D obj;
26312627 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2636,7 +2632,7 @@
26362632
26372633 refreshContents();
26382634 } else
2639
- if (event.getSource() == attachBumpItem)
2635
+ if (source == attachBumpItem)
26402636 {
26412637 String texture = GetFile("Attach bump");
26422638 Object3D obj;
....@@ -2648,7 +2644,7 @@
26482644
26492645 refreshContents();
26502646 } else
2651
- if (event.getSource() == detachBumpItem)
2647
+ if (source == detachBumpItem)
26522648 {
26532649 Object3D obj;
26542650 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2659,7 +2655,7 @@
26592655
26602656 refreshContents();
26612657 } else
2662
- if (event.getSource() == pigmentBumpItem)
2658
+ if (source == pigmentBumpItem)
26632659 {
26642660 Object3D obj;
26652661 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2670,158 +2666,195 @@
26702666
26712667 refreshContents();
26722668 } else
2673
- if (event.getSource() == flashSelectionButton)
2669
+ if (source == flashSelectionButton)
26742670 {
26752671 CameraPane.flash = true;
26762672 refreshContents();
26772673 } else
2678
- if (event.getSource() == oneButton)
2674
+ if (source == oneButton)
26792675 {
26802676 } else
2681
- if (event.getSource() == twoButton)
2677
+ if (source == twoButton)
26822678 {
26832679 radio.layout = twoButton;
26842680 // bug
26852681 //gridPanel.setDividerLocation(1.0);
26862682 //bigPanel.setDividerLocation(0.0);
2687
- bigThree.remove(scenePanel);
2688
- bigThree.remove(centralPanel);
2689
- bigThree.remove(XYZPanel);
2690
- aWindowConstraints.gridx = 0;
2691
- aWindowConstraints.gridy = 0;
2692
- aWindowConstraints.gridwidth = 1;
2693
- // aConstraints.gridheight = 3;
2694
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2695
- aWindowConstraints.weightx = 0;
2696
- aWindowConstraints.weighty = 1;
2697
- //bigThree.add(jtp, aWindowConstraints);
2698
- aWindowConstraints.weightx = 1;
2699
- aWindowConstraints.gridwidth = 3;
2700
- // aConstraints.gridheight = 3;
2701
- aWindowConstraints.gridx = 1;
2702
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2703
- bigThree.add(centralPanel, aWindowConstraints);
2704
- aWindowConstraints.weightx = 0;
2705
- aWindowConstraints.gridx = 4;
2706
- aWindowConstraints.gridwidth = 1;
2707
- // aConstraints.gridheight = 3;
2708
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2709
- //bigThree.add(XYZPanel, aWindowConstraints);
2710
- 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();
27112712 } else
2712
- if (event.getSource() == threeButton)
2713
+ if (source == threeButton)
27132714 {
27142715 radio.layout = threeButton;
2715
- bigThree.remove(scenePanel);
2716
- bigThree.remove(centralPanel);
2717
- bigThree.remove(XYZPanel);
2718
- aWindowConstraints.gridx = 0;
2719
- aWindowConstraints.gridy = 0;
2720
- aWindowConstraints.gridwidth = 1;
2721
- // aConstraints.gridheight = 3;
2722
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2723
- aWindowConstraints.weightx = 0;
2724
- aWindowConstraints.weighty = 1;
2725
- //bigThree.add(jtp, aWindowConstraints);
2726
- aWindowConstraints.weightx = 1;
2727
- aWindowConstraints.gridwidth = 3;
2728
- // aConstraints.gridheight = 3;
2729
- aWindowConstraints.gridx = 1;
2730
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2731
- bigThree.add(centralPanel, aWindowConstraints);
2732
- aWindowConstraints.weightx = 0;
2733
- aWindowConstraints.gridx = 4;
2734
- aWindowConstraints.gridwidth = 1;
2735
- // aConstraints.gridheight = 3;
2736
- aConstraints.fill = GridBagConstraints.VERTICAL;
2737
- bigThree.add(XYZPanel, aWindowConstraints);
2738
- 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();
27392748 } else
2740
- if (event.getSource() == fourButton)
2749
+ if (source == fourButton)
27412750 {
27422751 radio.layout = fourButton;
2743
- bigThree.remove(scenePanel);
2744
- bigThree.remove(centralPanel);
2745
- bigThree.remove(XYZPanel);
2746
- aWindowConstraints.gridx = 0;
2747
- aWindowConstraints.gridy = 0;
2748
- aWindowConstraints.gridwidth = 1;
2749
- // aWindowConstraints.gridheight = 3;
2750
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2751
- aWindowConstraints.weightx = 1;
2752
- aWindowConstraints.weighty = 1;
2753
- bigThree.add(scenePanel, aWindowConstraints);
2754
- aWindowConstraints.weightx = 1;
2755
- aWindowConstraints.gridwidth = 3;
2756
- // aConstraints.gridheight = 3;
2757
- aWindowConstraints.gridx = 1;
2758
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2759
- //bigThree.add(cameraPanel, aWindowConstraints);
2760
- aWindowConstraints.weightx = 0;
2761
- aWindowConstraints.gridx = 4;
2762
- aWindowConstraints.gridwidth = 1;
2763
- // aWindowConstraints.gridheight = 3;
2764
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2765
- //bigThree.add(XYZPanel, aWindowConstraints);
2766
- 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();
27672783 } else
2768
- if (event.getSource() == sixButton)
2784
+ if (source == sixButton)
27692785 {
27702786 radio.layout = sixButton;
2771
- bigThree.remove(scenePanel);
2772
- bigThree.remove(centralPanel);
2773
- bigThree.remove(XYZPanel);
2774
- aWindowConstraints.gridx = 0;
2775
- aWindowConstraints.gridy = 0;
2776
- aWindowConstraints.gridwidth = 1;
2777
- // aConstraints.gridheight = 3;
2778
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2779
- aWindowConstraints.weightx = 0;
2780
- aWindowConstraints.weighty = 1;
2781
- bigThree.add(scenePanel, aWindowConstraints);
2782
- aWindowConstraints.weightx = 1;
2783
- aWindowConstraints.gridwidth = 3;
2784
- // aWindowConstraints.gridheight = 3;
2785
- aWindowConstraints.gridx = 1;
2786
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2787
- bigThree.add(centralPanel, aWindowConstraints);
2788
- aWindowConstraints.weightx = 0;
2789
- aWindowConstraints.gridx = 4;
2790
- aWindowConstraints.gridwidth = 1;
2791
- // aWindowConstraints.gridheight = 3;
2792
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2793
- //bigThree.add(XYZPanel, aConstraints);
2794
- 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();
27952819 } else
2796
- if (event.getSource() == sevenButton)
2820
+ if (source == sevenButton)
27972821 {
27982822 radio.layout = sevenButton;
2799
- bigThree.remove(scenePanel);
2800
- bigThree.remove(centralPanel);
2801
- bigThree.remove(XYZPanel);
2802
- aWindowConstraints.gridx = 0;
2803
- aWindowConstraints.gridy = 0;
2804
- aWindowConstraints.gridwidth = 1;
2805
- // aWindowConstraints.gridheight = 3;
2806
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2807
- aWindowConstraints.weightx = 0;
2808
- aWindowConstraints.weighty = 1;
2809
- bigThree.add(scenePanel, aWindowConstraints);
2810
- aWindowConstraints.weightx = 1;
2811
- aWindowConstraints.gridwidth = 3;
2812
- // aWindowConstraints.gridheight = 3;
2813
- aWindowConstraints.gridx = 1;
2814
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2815
- bigThree.add(centralPanel, aWindowConstraints);
2816
- aWindowConstraints.weightx = 0;
2817
- aWindowConstraints.gridx = 4;
2818
- aWindowConstraints.gridwidth = 1;
2819
- // aConstraints.gridheight = 3;
2820
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2821
- bigThree.add(XYZPanel, aWindowConstraints);
2822
- 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();
28232856 } else
2824
- if (event.getSource() == rootButton)
2857
+ if (source == rootButton)
28252858 {
28262859 Object3D obj;
28272860 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2833,7 +2866,7 @@
28332866
28342867 refreshContents(true);
28352868 } else
2836
- if (event.getSource() == closeButton)
2869
+ if (source == closeButton)
28372870 {
28382871 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28392872 cRadio ab;
....@@ -2854,11 +2887,11 @@
28542887 }
28552888 refreshContents(true);
28562889 } else
2857
- if (event.getSource() == editItem || event.getSource() == editButton)
2890
+ if (source == editItem || source == editButton)
28582891 {
28592892 EditSelection(false);
28602893 } else
2861
- if (event.getSource() == uneditButton)
2894
+ if (source == uneditButton)
28622895 {
28632896 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28642897 {
....@@ -2870,12 +2903,12 @@
28702903
28712904 child.editWindow = null; // ???????????
28722905 }
2873
- objEditor.ctrlPanel.revalidate();
2906
+ objEditor.ctrlPanel.validate();
28742907 //objEditor.jTree.clearSelection();
28752908 //objEditor.ResetSliders();
28762909 refreshContents(true);
28772910 } else
2878
- if (event.getSource() == clearPanelButton)
2911
+ if (source == clearPanelButton)
28792912 {
28802913 assert(copy == group);
28812914 //copy.ClearUI();
....@@ -2886,7 +2919,7 @@
28862919 listUI.clear();
28872920 refreshContents(true);
28882921 } else
2889
- if (event.getSource() == allParamsButton)
2922
+ if (source == allParamsButton)
28902923 {
28912924 assert(copy == group);
28922925
....@@ -2907,19 +2940,19 @@
29072940
29082941 refreshContents(true);
29092942 } else
2910
- if (event.getSource() == unselectButton)
2943
+ if (source == unselectButton)
29112944 {
29122945 objEditor.jTree.clearSelection();
29132946 // ?? oct 2012 GrafreeD.clipboard.clear();
29142947 objEditor.ResetSliders();
29152948 refreshContents(true);
29162949 } else
2917
- if(event.getSource() instanceof cRadio)
2950
+ if(source instanceof cRadio)
29182951 {
29192952 group.parent = keepparent;
29202953 group.attributes = 0;
29212954 //group.editWindow = null;
2922
- /*cRadio*/ radio = (cRadio)event.getSource();
2955
+ /*cRadio*/ radio = (cRadio)source;
29232956 Object3D obj = radio.GetObject();
29242957 System.out.println("Edit " + obj);
29252958 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -4078,12 +4111,12 @@
40784111 System.err.println("info : " + child.GetPath());
40794112 }
40804113 }
4081
- else
4082
- {
4083
- objEditor.SetMaterial(group); // .GetMaterial());
4084
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4085
- System.err.println("info : " + group.GetPath());
4086
- }
4114
+// else
4115
+// {
4116
+// objEditor.SetMaterial(group); // .GetMaterial());
4117
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4118
+// System.err.println("info : " + group.GetPath());
4119
+// }
40874120
40884121 objEditor.SetText(); // jan 2014
40894122