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,97 +434,28 @@
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);
443
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
446444 fastCB.setToolTipText("Fast mode");
447445 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);
446
+
447
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
515448 trackCB.setToolTipText("Enable tracking");
516449 trackCB.addItemListener(this);
517450
518
- oe.aConstraints.gridx += 1;
519
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
451
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
520452 screenfitButton.setToolTipText("Screen fit");
521453 screenfitButton.addActionListener(this);
522
- oe.aConstraints.gridx += 1;
454
+
523455 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
524456 // screenfitpointButton.addActionListener(this);
525457 // oe.aConstraints.gridx += 1;
526
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
458
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
527459 snapobjectButton.addActionListener(this);
528460 snapobjectButton.setToolTipText("Snap Object");
529461 oe.aConstraints.gridx += 1;
....@@ -533,76 +465,66 @@
533465 oe.aConstraints.weighty = 0;
534466 oe.aConstraints.gridwidth = 1;
535467
536
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
468
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
537469 flashSelectionButton.setToolTipText("Show selection");
538470 flashSelectionButton.addActionListener(this);
539471
540
- oe.toolbarPanel.add(new cButton(" ", false));
472
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
541473
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);
474
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
548475 twoButton.setToolTipText("Show center view only");
549476 twoButton.addActionListener(this);
550
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
477
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
551478 fourButton.addActionListener(this);
552479 fourButton.setToolTipText("Show left panel only");
553
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
480
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
554481 sixButton.setToolTipText("2-column layout left");
555482 sixButton.addActionListener(this);
556
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
483
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
557484 threeButton.setToolTipText("2-column layout right");
558485 threeButton.addActionListener(this);
559
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
486
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
560487 sevenButton.setToolTipText("3-column layout");
561488 sevenButton.addActionListener(this);
562489 //
563490
564
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
565
- 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");
566493 rootButton.addActionListener(this);
567
- oe.aConstraints.gridx += 1;
568
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
494
+
495
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
569496 closeButton.setToolTipText("Close tab");
570497 closeButton.addActionListener(this);
571498 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
572499 //clearButton.addActionListener(this);
573
- oe.aConstraints.gridx += 1;
574500
575
- oe.aConstraints.gridx = 1; //
576
- 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");
577505 editButton.addActionListener(this);
578
- oe.aConstraints.gridx += 1;
579
- oe.aConstraints.weighty = 0;
580
- oe.aConstraints.gridwidth = 1;
581506
582
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
507
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
508
+ uneditButton.setToolTipText("Unedit selection");
583509 uneditButton.addActionListener(this);
584510
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);
511
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
512
+ clearPanelButton.setToolTipText("Clear edit panel");
590513 clearPanelButton.addActionListener(this);
591514
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);
515
+ commandsPanel.add(allParamsButton = new cButton("A", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
516
+ allParamsButton.setToolTipText("All params??");
597517 allParamsButton.addActionListener(this);
598518
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);
519
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
520
+ unselectButton.setToolTipText("Unselect");
604521 unselectButton.addActionListener(this);
605522
523
+ commandsPanel.preferredHeight = 1;
524
+
525
+ oe.treePanel.add(commandsPanel);
526
+ oe.treePanel.Return();
527
+
606528 // oe.aConstraints.gridx += 1;
607529 // oe.aConstraints.weighty = 0;
608530 // oe.aConstraints.gridwidth = 1;
....@@ -614,40 +536,37 @@
614536 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
615537 // gcButton.addActionListener(this);
616538
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;
539
+ cGridBag jSPPanel = new cGridBag();
540
+
541
+ JScrollPane jSP;
628542 //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);
543
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
630544 ResetModel();
631
- oe.aConstraints.weighty = 0.5;
632
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
633
- oe.aConstraints.gridy += 1;
634
- oe.aConstraints.gridwidth = 1;
545
+
546
+ oe.treePanel.add(jSPPanel);
547
+ oe.treePanel.Return();
635548
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);
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");
640553 colorCB.addItemListener(this);
641
- oe.aConstraints.gridx += 2;
642
- 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");
643557 materialCB.addItemListener(this);
644
- oe.aConstraints.gridx += 2;
645
- 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");
646561 textureCB.addItemListener(this);
647562
648
- oe.aConstraints.gridx = 0;
649
- oe.aConstraints.gridy += 1;
563
+ copyOptionsPanel.preferredHeight = 1;
564
+ oe.treePanel.add(copyOptionsPanel);
565
+ oe.treePanel.Return();
650566
567
+// mainPanel.setDividerLocation(0.5); //1.0);
568
+// mainPanel.setResizeWeight(0.5);
569
+
651570 //jList.addListSelectionListener(this);
652571 oe.jTree.addTreeSelectionListener(this);
653572 //jTree.setRootVisible(false);
....@@ -669,6 +588,74 @@
669588 radio.layout = sevenButton;
670589 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
671590 }
591
+
592
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
593
+ {
594
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
595
+ supportCB.setToolTipText("Enabled rigging");
596
+ supportCB.addItemListener(this);
597
+
598
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
599
+ // localCB.addItemListener(this);
600
+
601
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
602
+ crowdCB.setToolTipText("Used for crowds");
603
+ crowdCB.addItemListener(this);
604
+
605
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
606
+ smoothCB.setToolTipText("Snapping delay");
607
+ smoothCB.addItemListener(this);
608
+
609
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
610
+ slowCB.setToolTipText("Smooth interpolation");
611
+ slowCB.addItemListener(this);
612
+
613
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
614
+ boxCB.setToolTipText("Display bounding boxes");
615
+ boxCB.addItemListener(this);
616
+
617
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
618
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
619
+ zoomBoxCB.addItemListener(this);
620
+
621
+// constraints.gridy += 1;
622
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
623
+// speakerMocapCB.addItemListener(this);
624
+
625
+ if (false)
626
+ {
627
+ // handled in scripts
628
+ //constraints.gridy += 1;
629
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
630
+ speakerCameraCB.addItemListener(this);
631
+
632
+ //constraints.gridy += 1;
633
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
634
+ speakerFocusCB.addItemListener(this);
635
+
636
+ //constraints.gridy += 1;
637
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
638
+ smoothfocusCB.addItemListener(this);
639
+ }
640
+
641
+//constraints.gridx += 1;
642
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
643
+// debugCB.addItemListener(this);
644
+
645
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
646
+ oeilCB.addItemListener(this);
647
+
648
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
649
+ lookAtCB.setToolTipText("Look-at target");
650
+ lookAtCB.addItemListener(this);
651
+
652
+ cGridBag fill = new cGridBag();
653
+
654
+ fill.preferredHeight = 200;
655
+
656
+ panel.add(fill);
657
+
658
+ }
672659
673660 void EditObject(Object3D obj)
674661 {
....@@ -1115,7 +1102,7 @@
11151102 {
11161103 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11171104 animationItem.addItemListener(this);
1118
- animationItem.setState(CameraPane.ANIMATION);
1105
+ animationItem.setState(Globals.ANIMATION);
11191106
11201107 menu.add("-");
11211108 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
....@@ -1510,6 +1497,7 @@
15101497 //
15111498 public void actionPerformed(ActionEvent event) // , Object arg)
15121499 {
1500
+ Object source = event.getSource();
15131501 /*
15141502 if (event.getSource() == nameField)
15151503 {
....@@ -1521,11 +1509,11 @@
15211509 }
15221510 else
15231511 */
1524
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1512
+ if (source == lookAtItem || source == lookFromItem)
15251513 {
15261514 ScreenFit();
15271515 } else
1528
- if (event.getSource() == switchItem)
1516
+ if (source == switchItem)
15291517 {
15301518 cVector v1 = new cVector();
15311519 cVector v2 = new cVector();
....@@ -1534,11 +1522,11 @@
15341522 objEditor.cameraView.renderCamera.setAim(v2, v1);
15351523 objEditor.cameraView.repaint();
15361524 } else
1537
- if (event.getSource() == rectoidItem)
1525
+ if (source == rectoidItem)
15381526 {
15391527 makeSomething(new Box());
15401528 } else
1541
- if (event.getSource() == particleItem)
1529
+ if (source == particleItem)
15421530 {
15431531 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15441532 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1559,9 +1547,9 @@
15591547 applyExample(particleGeom, "SMOKE");
15601548 makeSomething(particleGeom);
15611549 } else
1562
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1550
+ if (source == ragdollItem || source == ragdoll2Item)
15631551 {
1564
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1552
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15651553
15661554 ragdoll.toParent = LA.newMatrix();
15671555 ragdoll.fromParent = LA.newMatrix();
....@@ -1579,7 +1567,7 @@
15791567 } else
15801568 /*
15811569 */
1582
- if (event.getSource() == heightFieldItem)
1570
+ if (source == heightFieldItem)
15831571 {
15841572 Object3D obj = new Object3D();
15851573
....@@ -1617,31 +1605,31 @@
16171605
16181606 makeSomething(obj);
16191607 } else
1620
- if (event.getSource() == gridItem)
1608
+ if (source == gridItem)
16211609 {
16221610 makeSomething(new Grid());
16231611 } else
1624
- if (event.getSource() == ellipsoidItem)
1612
+ if (source == ellipsoidItem)
16251613 {
16261614 makeSomething(new Sphere());
16271615 } else
1628
- if (event.getSource() == coneItem)
1616
+ if (source == coneItem)
16291617 {
16301618 makeSomething(new Cone());
16311619 } else
1632
- if (event.getSource() == torusItem)
1620
+ if (source == torusItem)
16331621 {
16341622 makeSomething(new Torus());
16351623 } else
1636
- if (event.getSource() == superItem)
1624
+ if (source == superItem)
16371625 {
16381626 makeSomething(new Superellipsoid());
16391627 } else
1640
- if (event.getSource() == kleinItem)
1628
+ if (source == kleinItem)
16411629 {
16421630 makeSomething(new Klein());
16431631 } else
1644
- if (event.getSource() == blobItem)
1632
+ if (source == blobItem)
16451633 {
16461634 Blob blob = new Blob();
16471635 BlobComponent comp = new BlobComponent();
....@@ -1649,15 +1637,15 @@
16491637 //blob.retile();
16501638 makeSomething(blob);
16511639 } else
1652
- if (event.getSource() == latheItem)
1640
+ if (source == latheItem)
16531641 {
16541642 makeSomething(new Lathe());
16551643 } else
1656
- if (event.getSource() == bezierItem)
1644
+ if (source == bezierItem)
16571645 {
16581646 makeSomething(new BezierSurface());
16591647 } else
1660
- if (event.getSource() == checkerItem)
1648
+ if (source == checkerItem)
16611649 {
16621650 /*
16631651 Object3D obj = new BezierSurface(5,8);
....@@ -1672,7 +1660,7 @@
16721660 */
16731661 makeSomething(new Checker());
16741662 } else
1675
- if (event.getSource() == meshItem)
1663
+ if (source == meshItem)
16761664 {
16771665 Object3D itemtomake = new Object3D();
16781666 Object3D child;
....@@ -1693,35 +1681,35 @@
16931681 makeSomething(child);
16941682 }
16951683 } else
1696
- if (event.getSource() == springItem)
1684
+ if (source == springItem)
16971685 {
16981686 cSpring s = new cSpring();
16991687 s.setup();
17001688 makeSomething(s);
17011689 } else
1702
- if (event.getSource() == flagItem)
1690
+ if (source == flagItem)
17031691 {
17041692 cSpring s = new cFlag();
17051693 s.setup();
17061694 makeSomething(s);
17071695 } else
1708
- if (event.getSource() == lightItem)
1696
+ if (source == lightItem)
17091697 {
17101698 makeSomething(new Light());
17111699 } else
1712
- if (event.getSource() == csgItem)
1700
+ if (source == csgItem)
17131701 {
17141702 group(new CSG());
17151703 } else
1716
- if (event.getSource() == templateItem)
1704
+ if (source == templateItem)
17171705 {
17181706 group(new cTemplate());
17191707 } else
1720
- if (event.getSource() == attributeItem)
1708
+ if (source == attributeItem)
17211709 {
17221710 makeSomething(new Attribute());
17231711 } else
1724
- if (event.getSource() == pointflowItem)
1712
+ if (source == pointflowItem)
17251713 {
17261714 makeSomething(new PointFlow());
17271715 } else
....@@ -1733,7 +1721,7 @@
17331721 } else
17341722 */
17351723
1736
- if (event.getSource() == superLoopItem)
1724
+ if (source == superLoopItem)
17371725 {
17381726 Composite g = new cGroup();
17391727 for (int i=0; i<15; i++)
....@@ -1755,7 +1743,7 @@
17551743
17561744 group(g);
17571745 } else
1758
- if (event.getSource() == loopItem)
1746
+ if (source == loopItem)
17591747 {
17601748 Composite csg = new GroupLeaf();
17611749 csg.count = 5;
....@@ -1764,7 +1752,7 @@
17641752 csg.addChild(child);
17651753 child.addChild(csg);
17661754 } else
1767
- if (event.getSource() == doubleItem)
1755
+ if (source == doubleItem)
17681756 {
17691757 Composite csg = new GroupLeaf();
17701758 csg.count = 5;
....@@ -1776,7 +1764,7 @@
17761764 csg.addChild(child);
17771765 child.addChild(csg);
17781766 } else
1779
- if (event.getSource() == tripleItem)
1767
+ if (source == tripleItem)
17801768 {
17811769 Composite csg = new GroupLeaf();
17821770 csg.count = 4;
....@@ -1792,70 +1780,70 @@
17921780 child.addChild(csg);
17931781 } else
17941782
1795
- if (event.getSource() == importGFDItem)
1783
+ if (source == importGFDItem)
17961784 {
17971785 ImportGFD();
17981786 } else
1799
- if (event.getSource() == importVRMLX3DItem)
1787
+ if (source == importVRMLX3DItem)
18001788 {
18011789 ImportVRMLX3D();
18021790 } else
1803
- if (event.getSource() == import3DSItem)
1791
+ if (source == import3DSItem)
18041792 {
18051793 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
18061794 } else
1807
- if (event.getSource() == importOBJItem)
1795
+ if (source == importOBJItem)
18081796 {
18091797 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
18101798 } else
1811
- if (event.getSource() == computeAOItem)
1799
+ if (source == computeAOItem)
18121800 {
18131801 Globals.drawMode = CameraPane.OCCLUSION;
18141802 Globals.theRenderer.repaint();
18151803 } else
1816
- if (event.getSource() == recompileItem)
1804
+ if (source == recompileItem)
18171805 {
18181806 Recompile();
18191807 refreshContents();
18201808 } else
1821
- if (event.getSource() == editScriptItem)
1809
+ if (source == editScriptItem)
18221810 {
18231811 OpenDialog();
18241812 refreshContents();
18251813 } else
1826
- if (event.getSource() == invariantsItem)
1814
+ if (source == invariantsItem)
18271815 {
18281816 System.out.println("Invariants:");
18291817 GrafreeD.grafreeD.universe.invariants();
18301818 } else
1831
- if (event.getSource() == memoryItem)
1819
+ if (source == memoryItem)
18321820 {
18331821 //System.out.println("Invariants:");
18341822 PrintMemory();
18351823 } else
1836
- if (event.getSource() == pathItem)
1824
+ if (source == pathItem)
18371825 {
18381826 PrintPath();
18391827 } else
1840
- if (event.getSource() == analyzeItem)
1828
+ if (source == analyzeItem)
18411829 {
18421830 AnalyzeObject();
18431831 } else
1844
- if (event.getSource() == dumpItem)
1832
+ if (source == dumpItem)
18451833 {
18461834 DumpObject();
18471835 } else
1848
- if (event.getSource() == screenfitButton)
1836
+ if (source == screenfitButton)
18491837 {
18501838 //Reload(lastConverter, lastFilename, true);
18511839 ScreenFit();
18521840 } else
1853
- if (event.getSource() == screenfitpointButton)
1841
+ if (source == screenfitpointButton)
18541842 {
18551843 //Reload(lastConverter, lastFilename, true);
18561844 ScreenFitPoint();
18571845 } else
1858
- if (event.getSource() == snapobjectButton)
1846
+ if (source == snapobjectButton)
18591847 {
18601848 //Reload(lastConverter, lastFilename, true);
18611849 SnapObject();
....@@ -1866,13 +1854,13 @@
18661854 // Recompile();
18671855 // refreshContents();
18681856 // } else
1869
- if (event.getSource() == gcButton)
1857
+ if (source == gcButton)
18701858 {
18711859 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18721860 System.gc();
18731861 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18741862 } else
1875
- if (event.getSource() == editLeafItem)
1863
+ if (source == editLeafItem)
18761864 {
18771865 Object3D obj;
18781866 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1886,62 +1874,62 @@
18861874 }
18871875 refreshContents(true);
18881876 } else
1889
- if (event.getSource() == openWindowItem)
1877
+ if (source == openWindowItem)
18901878 {
18911879 EditSelection(true);
18921880 } else
1893
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1881
+ if (source == cutItem || source == clearButton)
18941882 {
18951883 loadClipboard(true);
18961884 } else
1897
- if (event.getSource() == duplicateItem)
1885
+ if (source == duplicateItem)
18981886 {
18991887 Object3D keep = GrafreeD.clipboard;
19001888 loadClipboard(false);
19011889 paste(false);
19021890 GrafreeD.clipboard = keep;
19031891 } else
1904
- if (event.getSource() == cloneItem)
1892
+ if (source == cloneItem)
19051893 {
19061894 CloneSelection(false);
19071895 } else
1908
- if (event.getSource() == cloneSupportItem)
1896
+ if (source == cloneSupportItem)
19091897 {
19101898 CloneSelection(true);
19111899 } else
1912
- if (event.getSource() == copyItem)
1900
+ if (source == copyItem)
19131901 {
19141902 loadClipboard(false);
19151903 } else
1916
- if (event.getSource() == pasteItem)
1904
+ if (source == pasteItem)
19171905 {
19181906 paste(false);
19191907 } else
1920
- if (event.getSource() == pasteLinkItem)
1908
+ if (source == pasteLinkItem)
19211909 {
19221910 pasteInto(false);
19231911 } else
1924
- if (event.getSource() == pasteCloneItem)
1912
+ if (source == pasteCloneItem)
19251913 {
19261914 pasteInto(true);
19271915 } else
1928
- if (event.getSource() == pasteExpandItem)
1916
+ if (source == pasteExpandItem)
19291917 {
19301918 paste(true);
19311919 } else
1932
- if (event.getSource() == synchronizeItem)
1920
+ if (source == synchronizeItem)
19331921 {
19341922 Overwrite(Object3D.TRANSFORM);
19351923 } else
1936
- if (event.getSource() == overwriteNameItem)
1924
+ if (source == overwriteNameItem)
19371925 {
19381926 Overwrite(Object3D.NAME);
19391927 } else
1940
- if (event.getSource() == overwriteUVItem)
1928
+ if (source == overwriteUVItem)
19411929 {
19421930 Overwrite(Object3D.UV);
19431931 } else
1944
- if (event.getSource() == overwriteMatItem)
1932
+ if (source == overwriteMatItem)
19451933 {
19461934 /* july 2015
19471935 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1961,7 +1949,7 @@
19611949
19621950 Overwrite(dropAttributes);
19631951 }
1964
- if (event.getSource() == overwriteGeoItem)
1952
+ if (source == overwriteGeoItem)
19651953 {
19661954 Overwrite(Object3D.GEOMETRY);
19671955 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1978,7 +1966,7 @@
19781966 // refreshContents();
19791967 // }
19801968 } else
1981
- if (event.getSource() == generateMeshItem)
1969
+ if (source == generateMeshItem)
19821970 {
19831971 //if (group.selection.size() == 1)
19841972 // for (int i=0; i<group.selection.size(); i++)
....@@ -1989,7 +1977,7 @@
19891977 ResetModel();
19901978 refreshContents();
19911979 } else
1992
- if (event.getSource() == extractGeometriesItem)
1980
+ if (source == extractGeometriesItem)
19931981 {
19941982 boolean one = false;
19951983
....@@ -2016,7 +2004,7 @@
20162004 ResetModel();
20172005 refreshContents();
20182006 } else
2019
- if (event.getSource() == cloneGeometriesItem)
2007
+ if (source == cloneGeometriesItem)
20202008 {
20212009 boolean one = false;
20222010
....@@ -2042,7 +2030,7 @@
20422030 ResetModel();
20432031 refreshContents();
20442032 } else
2045
- if (event.getSource() == shareGeometriesItem)
2033
+ if (source == shareGeometriesItem)
20462034 {
20472035 boolean one = false;
20482036
....@@ -2072,7 +2060,7 @@
20722060 refreshContents();
20732061 }
20742062 } else
2075
- if (event.getSource() == mergeGeometriesItem)
2063
+ if (source == mergeGeometriesItem)
20762064 {
20772065 boolean one = false;
20782066
....@@ -2102,7 +2090,7 @@
21022090 ResetModel();
21032091 refreshContents();
21042092 } else
2105
- if (event.getSource() == linkverticesItem)
2093
+ if (source == linkverticesItem)
21062094 {
21072095 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21082096 // {
....@@ -2135,7 +2123,7 @@
21352123 refreshContents();
21362124 }
21372125 } else
2138
- if (event.getSource() == resetsupportItem)
2126
+ if (source == resetsupportItem)
21392127 {
21402128 for (int i=0; i<group.selection.size(); i++)
21412129 {
....@@ -2147,7 +2135,7 @@
21472135
21482136 refreshContents();
21492137 } else
2150
- if (event.getSource() == relinkverticesItem)
2138
+ if (source == relinkverticesItem)
21512139 {
21522140 boolean random = CameraPane.RANDOM;
21532141 CameraPane.RANDOM = false; // parse all random nodes
....@@ -2156,7 +2144,7 @@
21562144
21572145 refreshContents();
21582146 } else
2159
- if (event.getSource() == resetreferencesItem)
2147
+ if (source == resetreferencesItem)
21602148 {
21612149 for (int i=0; i<group.selection.size(); i++)
21622150 {
....@@ -2165,7 +2153,7 @@
21652153
21662154 refreshContents();
21672155 } else
2168
- if (event.getSource() == setMasterItem)
2156
+ if (source == setMasterItem)
21692157 {
21702158 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21712159 {
....@@ -2178,7 +2166,7 @@
21782166 refreshContents();
21792167 }
21802168 } else
2181
- if (event.getSource() == poseMeshItem)
2169
+ if (source == poseMeshItem)
21822170 {
21832171 if (group.selection.size() == 1)
21842172 {
....@@ -2197,19 +2185,19 @@
21972185 }
21982186
21992187 } else
2200
- if (event.getSource() == revertMeshItem)
2188
+ if (source == revertMeshItem)
22012189 {
22022190 RevertMeshes();
22032191 } else
2204
- if (event.getSource() == resetMeshItem)
2192
+ if (source == resetMeshItem)
22052193 {
22062194 ResetAll();
22072195 } else
2208
- if (event.getSource() == stepAllItem)
2196
+ if (source == stepAllItem)
22092197 {
22102198 StepAll();
22112199 } else
2212
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2200
+ if (source == clearItem) // || event.getSource() == clearButton)
22132201 {
22142202 //int indices[] = jList.getSelectedIndices();
22152203 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2217,46 +2205,46 @@
22172205
22182206 ClearSelection(false);
22192207 } else
2220
- if (event.getSource() == clearAllItem)
2208
+ if (source == clearAllItem)
22212209 {
22222210 ClearSelection(true);
22232211 } else
2224
- if (event.getSource() == grabItem)
2212
+ if (source == grabItem)
22252213 {
22262214 group(new cGroup(), true);
22272215 } else
2228
- if (event.getSource() == hideItem)
2216
+ if (source == hideItem)
22292217 {
22302218 group(new HiddenObject());
22312219 } else
2232
- if (event.getSource() == frontItem)
2220
+ if (source == frontItem)
22332221 {
22342222 front();
22352223 } else
2236
- if (event.getSource() == backItem)
2224
+ if (source == backItem)
22372225 {
22382226 back();
22392227 } else
2240
- if (event.getSource() == cameraItem)
2228
+ if (source == cameraItem)
22412229 {
22422230 makeSomething(new Camera());
22432231 } else
2244
- if (event.getSource() == compositeItem)
2232
+ if (source == compositeItem)
22452233 {
22462234 group(new Composite());
22472235 } else
2248
- if (event.getSource() == randomItem)
2236
+ if (source == randomItem)
22492237 {
22502238 RandomNode random = new RandomNode();
22512239 group(random);
22522240 if (random.size() > 0)
22532241 random.name = random.get(0).name + "Rnd";
22542242 } else
2255
- if (event.getSource() == physicsItem)
2243
+ if (source == physicsItem)
22562244 {
22572245 group(new PhysicsNode());
22582246 } else
2259
- if (event.getSource() == frameselectorItem)
2247
+ if (source == frameselectorItem)
22602248 {
22612249 for (int i=0; i<group.selection.size(); i++)
22622250 {
....@@ -2268,7 +2256,7 @@
22682256 ResetModel();
22692257 refreshContents();
22702258 } else
2271
- if (event.getSource() == switchGeoItem)
2259
+ if (source == switchGeoItem)
22722260 {
22732261 for (int i=0; i<group.selection.size(); i++)
22742262 {
....@@ -2280,7 +2268,7 @@
22802268 ResetModel();
22812269 refreshContents();
22822270 } else
2283
- if (event.getSource() == switchTransfoItem)
2271
+ if (source == switchTransfoItem)
22842272 {
22852273 for (int i=0; i<group.selection.size(); i++)
22862274 {
....@@ -2292,7 +2280,7 @@
22922280 ResetModel();
22932281 refreshContents();
22942282 } else
2295
- if (event.getSource() == morphItem)
2283
+ if (source == morphItem)
22962284 {
22972285 for (int i=0; i<group.selection.size(); i++)
22982286 {
....@@ -2304,7 +2292,7 @@
23042292 ResetModel();
23052293 refreshContents();
23062294 } else
2307
- if (event.getSource() == scriptNodeItem)
2295
+ if (source == scriptNodeItem)
23082296 {
23092297 boolean atleastone = false;
23102298
....@@ -2343,31 +2331,31 @@
23432331 }
23442332 }
23452333 } else
2346
- if (event.getSource() == linkerItem)
2334
+ if (source == linkerItem)
23472335 {
23482336 group(new cLinker());
23492337 } else
2350
- if (event.getSource() == textureItem)
2338
+ if (source == textureItem)
23512339 {
23522340 group(new TextureNode());
23532341 } else
2354
- if (event.getSource() == billboardItem)
2342
+ if (source == billboardItem)
23552343 {
23562344 group(new BillboardNode());
23572345 } else
2358
- if (event.getSource() == shadowXItem)
2346
+ if (source == shadowXItem)
23592347 {
23602348 CastShadow(0);
23612349 } else
2362
- if (event.getSource() == shadowYItem)
2350
+ if (source == shadowYItem)
23632351 {
23642352 CastShadow(1);
23652353 } else
2366
- if (event.getSource() == shadowZItem)
2354
+ if (source == shadowZItem)
23672355 {
23682356 CastShadow(2);
23692357 } else
2370
- if (event.getSource() == ungroupItem)
2358
+ if (source == ungroupItem)
23712359 {
23722360 //ungroup();
23732361 for (int i=0; i<group.selection.size(); i++)
....@@ -2379,179 +2367,179 @@
23792367
23802368 refreshContents();
23812369 } else
2382
- if (event.getSource() == genUVItem)
2370
+ if (source == genUVItem)
23832371 {
23842372 GenUV();
23852373 } else
2386
- if (event.getSource() == genNormalsCADItem)
2374
+ if (source == genNormalsCADItem)
23872375 {
23882376 GenNormals(true);
23892377 } else
2390
- if (event.getSource() == genNormalsMESHItem)
2378
+ if (source == genNormalsMESHItem)
23912379 {
23922380 GenNormals(true); // TODO
23932381 } else
2394
- if (event.getSource() == genNormalsORGANItem)
2382
+ if (source == genNormalsORGANItem)
23952383 {
23962384 GenNormals(false);
23972385 } else
2398
- if (event.getSource() == genNormalsMINEItem)
2386
+ if (source == genNormalsMINEItem)
23992387 {
24002388 GenNormalsMINE();
24012389 } else
2402
- if (event.getSource() == stripifyItem)
2390
+ if (source == stripifyItem)
24032391 {
24042392 Stripify();
24052393 } else
2406
- if (event.getSource() == unstripifyItem)
2394
+ if (source == unstripifyItem)
24072395 {
24082396 Unstripify();
24092397 } else
2410
- if (event.getSource() == trimItem)
2398
+ if (source == trimItem)
24112399 {
24122400 Trim();
24132401 } else
2414
- if (event.getSource() == untrimItem)
2402
+ if (source == untrimItem)
24152403 {
24162404 Untrim();
24172405 } else
2418
- if (event.getSource() == clearColorsItem)
2406
+ if (source == clearColorsItem)
24192407 {
24202408 ClearColors();
24212409 } else
2422
- if (event.getSource() == clearMaterialsItem)
2410
+ if (source == clearMaterialsItem)
24232411 {
24242412 ClearMaterials();
24252413 } else
2426
- if (event.getSource() == liveleavesItem)
2414
+ if (source == liveleavesItem)
24272415 {
24282416 LiveLeaves(true);
24292417 } else
2430
- if (event.getSource() == unliveleavesItem)
2418
+ if (source == unliveleavesItem)
24312419 {
24322420 LiveLeaves(false);
24332421 } else
2434
- if (event.getSource() == supportleavesItem)
2422
+ if (source == supportleavesItem)
24352423 {
24362424 SupportLeaves(true);
24372425 } else
2438
- if (event.getSource() == unsupportleavesItem)
2426
+ if (source == unsupportleavesItem)
24392427 {
24402428 SupportLeaves(false);
24412429 } else
2442
- if (event.getSource() == hideleavesItem)
2430
+ if (source == hideleavesItem)
24432431 {
24442432 HideLeaves(true);
24452433 } else
2446
- if (event.getSource() == showleavesItem)
2434
+ if (source == showleavesItem)
24472435 {
24482436 HideLeaves(false);
24492437 } else
2450
- if (event.getSource() == markleavesItem)
2438
+ if (source == markleavesItem)
24512439 {
24522440 MarkLeaves(true);
24532441 } else
2454
- if (event.getSource() == unmarkleavesItem)
2442
+ if (source == unmarkleavesItem)
24552443 {
24562444 MarkLeaves(false);
24572445 } else
2458
- if (event.getSource() == flipVItem)
2446
+ if (source == flipVItem)
24592447 {
24602448 FlipV(true);
24612449 } else
2462
- if (event.getSource() == unflipVItem)
2450
+ if (source == unflipVItem)
24632451 {
24642452 FlipV(false);
24652453 } else
2466
- if (event.getSource() == lowTexturesItem)
2454
+ if (source == lowTexturesItem)
24672455 {
24682456 SetTexRes(0);
24692457 } else
2470
- if (event.getSource() == normalTexturesItem)
2458
+ if (source == normalTexturesItem)
24712459 {
24722460 SetTexRes(1);
24732461 } else
2474
- if (event.getSource() == highTexturesItem)
2462
+ if (source == highTexturesItem)
24752463 {
24762464 SetTexRes(2);
24772465 } else
2478
- if (event.getSource() == veryhighTexturesItem)
2466
+ if (source == veryhighTexturesItem)
24792467 {
24802468 SetTexRes(3);
24812469 } else
2482
- if (event.getSource() == maxTexturesItem)
2470
+ if (source == maxTexturesItem)
24832471 {
24842472 SetTexRes(4);
24852473 } else
2486
- if (event.getSource() == panoTexturesItem)
2474
+ if (source == panoTexturesItem)
24872475 {
24882476 SetTexRes(5);
24892477 } else
2490
- if (event.getSource() == reverseNormalsItem)
2478
+ if (source == reverseNormalsItem)
24912479 {
24922480 ReverseNormals();
24932481 } else
2494
- if (event.getSource() == parseverticesItem)
2482
+ if (source == parseverticesItem)
24952483 {
24962484 ParseVertices();
24972485 } else
2498
- if (event.getSource() == textureFieldItem)
2486
+ if (source == textureFieldItem)
24992487 {
25002488 TextureVertices();
25012489 } else
2502
- if (event.getSource() == alignItem)
2490
+ if (source == alignItem)
25032491 {
25042492 Align();
25052493 } else
2506
- if (event.getSource() == mirrorItem)
2494
+ if (source == mirrorItem)
25072495 {
25082496 MirrorPoses();
25092497 } else
2510
- if (event.getSource() == reduceMorphItem)
2498
+ if (source == reduceMorphItem)
25112499 {
25122500 MeshReduction(false);
25132501 } else
2514
- if (event.getSource() == reduce34MorphItem)
2502
+ if (source == reduce34MorphItem)
25152503 {
25162504 MeshReduction(true);
25172505 } else
2518
- if (event.getSource() == reverseTrianglesItem)
2506
+ if (source == reverseTrianglesItem)
25192507 {
25202508 ReverseTriangles();
25212509 } else
2522
- if (event.getSource() == reduceMeshItem)
2510
+ if (source == reduceMeshItem)
25232511 {
25242512 ReduceMesh(false);
25252513 } else
2526
- if (event.getSource() == reduce34MeshItem)
2514
+ if (source == reduce34MeshItem)
25272515 {
25282516 ReduceMesh(true);
25292517 } else
2530
- if (event.getSource() == increaseMeshItem)
2518
+ if (source == increaseMeshItem)
25312519 {
25322520 IncreaseMesh();
25332521 } else
2534
- if (event.getSource() == clipMeshItem)
2522
+ if (source == clipMeshItem)
25352523 {
25362524 ClipMesh();
25372525 } else
2538
- if (event.getSource() == smoothMeshItem)
2526
+ if (source == smoothMeshItem)
25392527 {
25402528 SmoothMesh();
25412529 } else
2542
- if (event.getSource() == transformgeometryItem)
2530
+ if (source == transformgeometryItem)
25432531 {
25442532 TransformGeometry();
25452533 } else
2546
- if (event.getSource() == resetTransformItem)
2534
+ if (source == resetTransformItem)
25472535 {
25482536 ResetTransform();
25492537 } else
2550
- if (event.getSource() == resetCentroidItem)
2538
+ if (source == resetCentroidItem)
25512539 {
25522540 ResetCentroid();
25532541 } else
2554
- if (event.getSource() == resetParentItem)
2542
+ if (source == resetParentItem)
25552543 {
25562544 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25572545 {
....@@ -2561,7 +2549,7 @@
25612549
25622550 refreshContents();
25632551 } else
2564
- if (event.getSource() == repairParentItem)
2552
+ if (source == repairParentItem)
25652553 {
25662554 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25672555 {
....@@ -2575,7 +2563,7 @@
25752563
25762564 refreshContents();
25772565 } else
2578
- if (event.getSource() == repairShadowItem)
2566
+ if (source == repairShadowItem)
25792567 {
25802568 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25812569 {
....@@ -2589,7 +2577,7 @@
25892577
25902578 refreshContents();
25912579 } else
2592
- if (event.getSource() == sortbysizeItem)
2580
+ if (source == sortbysizeItem)
25932581 {
25942582 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25952583 {
....@@ -2601,7 +2589,7 @@
26012589 ResetModel();
26022590 refreshContents();
26032591 } else
2604
- if (event.getSource() == sortbynameItem)
2592
+ if (source == sortbynameItem)
26052593 {
26062594 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26072595 {
....@@ -2613,7 +2601,7 @@
26132601 ResetModel();
26142602 refreshContents();
26152603 } else
2616
- if (event.getSource() == attachPigmentItem)
2604
+ if (source == attachPigmentItem)
26172605 {
26182606 String texture = GetFile("Attach pigment");
26192607 Object3D obj;
....@@ -2625,7 +2613,7 @@
26252613
26262614 refreshContents();
26272615 } else
2628
- if (event.getSource() == detachPigmentItem)
2616
+ if (source == detachPigmentItem)
26292617 {
26302618 Object3D obj;
26312619 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2636,7 +2624,7 @@
26362624
26372625 refreshContents();
26382626 } else
2639
- if (event.getSource() == attachBumpItem)
2627
+ if (source == attachBumpItem)
26402628 {
26412629 String texture = GetFile("Attach bump");
26422630 Object3D obj;
....@@ -2648,7 +2636,7 @@
26482636
26492637 refreshContents();
26502638 } else
2651
- if (event.getSource() == detachBumpItem)
2639
+ if (source == detachBumpItem)
26522640 {
26532641 Object3D obj;
26542642 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2659,7 +2647,7 @@
26592647
26602648 refreshContents();
26612649 } else
2662
- if (event.getSource() == pigmentBumpItem)
2650
+ if (source == pigmentBumpItem)
26632651 {
26642652 Object3D obj;
26652653 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2670,158 +2658,195 @@
26702658
26712659 refreshContents();
26722660 } else
2673
- if (event.getSource() == flashSelectionButton)
2661
+ if (source == flashSelectionButton)
26742662 {
26752663 CameraPane.flash = true;
26762664 refreshContents();
26772665 } else
2678
- if (event.getSource() == oneButton)
2666
+ if (source == oneButton)
26792667 {
26802668 } else
2681
- if (event.getSource() == twoButton)
2669
+ if (source == twoButton)
26822670 {
26832671 radio.layout = twoButton;
26842672 // bug
26852673 //gridPanel.setDividerLocation(1.0);
26862674 //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();
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();
27112704 } else
2712
- if (event.getSource() == threeButton)
2705
+ if (source == threeButton)
27132706 {
27142707 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();
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();
27392740 } else
2740
- if (event.getSource() == fourButton)
2741
+ if (source == fourButton)
27412742 {
27422743 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();
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();
27672775 } else
2768
- if (event.getSource() == sixButton)
2776
+ if (source == sixButton)
27692777 {
27702778 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();
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();
27952811 } else
2796
- if (event.getSource() == sevenButton)
2812
+ if (source == sevenButton)
27972813 {
27982814 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();
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();
28232848 } else
2824
- if (event.getSource() == rootButton)
2849
+ if (source == rootButton)
28252850 {
28262851 Object3D obj;
28272852 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2833,7 +2858,7 @@
28332858
28342859 refreshContents(true);
28352860 } else
2836
- if (event.getSource() == closeButton)
2861
+ if (source == closeButton)
28372862 {
28382863 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28392864 cRadio ab;
....@@ -2854,11 +2879,11 @@
28542879 }
28552880 refreshContents(true);
28562881 } else
2857
- if (event.getSource() == editItem || event.getSource() == editButton)
2882
+ if (source == editItem || source == editButton)
28582883 {
28592884 EditSelection(false);
28602885 } else
2861
- if (event.getSource() == uneditButton)
2886
+ if (source == uneditButton)
28622887 {
28632888 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28642889 {
....@@ -2870,12 +2895,12 @@
28702895
28712896 child.editWindow = null; // ???????????
28722897 }
2873
- objEditor.ctrlPanel.revalidate();
2898
+ objEditor.ctrlPanel.validate();
28742899 //objEditor.jTree.clearSelection();
28752900 //objEditor.ResetSliders();
28762901 refreshContents(true);
28772902 } else
2878
- if (event.getSource() == clearPanelButton)
2903
+ if (source == clearPanelButton)
28792904 {
28802905 assert(copy == group);
28812906 //copy.ClearUI();
....@@ -2886,7 +2911,7 @@
28862911 listUI.clear();
28872912 refreshContents(true);
28882913 } else
2889
- if (event.getSource() == allParamsButton)
2914
+ if (source == allParamsButton)
28902915 {
28912916 assert(copy == group);
28922917
....@@ -2907,19 +2932,19 @@
29072932
29082933 refreshContents(true);
29092934 } else
2910
- if (event.getSource() == unselectButton)
2935
+ if (source == unselectButton)
29112936 {
29122937 objEditor.jTree.clearSelection();
29132938 // ?? oct 2012 GrafreeD.clipboard.clear();
29142939 objEditor.ResetSliders();
29152940 refreshContents(true);
29162941 } else
2917
- if(event.getSource() instanceof cRadio)
2942
+ if(source instanceof cRadio)
29182943 {
29192944 group.parent = keepparent;
29202945 group.attributes = 0;
29212946 //group.editWindow = null;
2922
- /*cRadio*/ radio = (cRadio)event.getSource();
2947
+ /*cRadio*/ radio = (cRadio)source;
29232948 Object3D obj = radio.GetObject();
29242949 System.out.println("Edit " + obj);
29252950 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -4078,12 +4103,12 @@
40784103 System.err.println("info : " + child.GetPath());
40794104 }
40804105 }
4081
- else
4082
- {
4083
- objEditor.SetMaterial(group); // .GetMaterial());
4084
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4085
- System.err.println("info : " + group.GetPath());
4086
- }
4106
+// else
4107
+// {
4108
+// objEditor.SetMaterial(group); // .GetMaterial());
4109
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4110
+// System.err.println("info : " + group.GetPath());
4111
+// }
40874112
40884113 objEditor.SetText(); // jan 2014
40894114