Normand Briere
2019-05-01 a742f6cebf1d471217d836e07934e5c02c22b6db
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,
....@@ -238,16 +239,16 @@
238239 ungroupItem = menu.add(new MenuItem("Ungroup"));
239240 ungroupItem.addActionListener(this);
240241 menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
242
+ randomItem = menu.add(new MenuItem("Switch node"));
242243 randomItem.addActionListener(this);
243
- physicsItem = menu.add(new MenuItem("Physics"));
244
- physicsItem.addActionListener(this);
245
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
246
- frameselectorItem.addActionListener(this);
247244 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248245 switchGeoItem.addActionListener(this);
249246 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250247 switchTransfoItem.addActionListener(this);
248
+ physicsItem = menu.add(new MenuItem("Physics"));
249
+ physicsItem.addActionListener(this);
250
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
251
+ frameselectorItem.addActionListener(this);
251252 morphItem = menu.add(new MenuItem("Morph"));
252253 morphItem.addActionListener(this);
253254 scriptNodeItem = menu.add(new MenuItem("Script Node"));
....@@ -433,110 +434,94 @@
433434 oe.radioPanel.add(dummyButton);
434435 oe.buttonGroup.add(dummyButton);
435436 */
436
- aConstraints.gridy += 1;
437
-
438437 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439438
440
- oe.aConstraints.gridwidth = 1;
441
- oe.aConstraints.gridx = 0;
442
-
443
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
439
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
444440 liveCB.setToolTipText("Enabled animation");
445441 liveCB.addItemListener(this);
446442
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
443
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
444
+ fastCB.setToolTipText("Fast mode");
445
+ fastCB.addItemListener(this);
446
+
447
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
449448 trackCB.setToolTipText("Enable tracking");
450449 trackCB.addItemListener(this);
451450
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
451
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
454452 screenfitButton.setToolTipText("Screen fit");
455453 screenfitButton.addActionListener(this);
456
- oe.aConstraints.gridx += 1;
454
+
457455 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
458456 // screenfitpointButton.addActionListener(this);
459
-// oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
461
- snapobjectButton.addActionListener(this);
462
- snapobjectButton.setToolTipText("Snap Object");
463
- oe.aConstraints.gridx += 1;
464457
465
- //aConstraints.gridx = 0;
466
- //aConstraints.gridy += 1;
467
- oe.aConstraints.weighty = 0;
468
- oe.aConstraints.gridwidth = 1;
469
-
470
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
458
+ if (Globals.ADVANCED)
459
+ {
460
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
461
+ snapobjectButton.addActionListener(this);
462
+ snapobjectButton.setToolTipText("Snap Object");
463
+ }
464
+
465
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
471466 flashSelectionButton.setToolTipText("Show selection");
472467 flashSelectionButton.addActionListener(this);
473468
474
- oe.toolbarPanel.add(new cButton(" ", false));
469
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
475470
476
- oe.aConstraints.gridx += 1;
477
- oe.aConstraints.weighty = 0;
478
- oe.aConstraints.gridwidth = 1;
479
-
480
- //
481
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
471
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
482472 twoButton.setToolTipText("Show center view only");
483473 twoButton.addActionListener(this);
484
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
474
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
485475 fourButton.addActionListener(this);
486476 fourButton.setToolTipText("Show left panel only");
487
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
477
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
488478 sixButton.setToolTipText("2-column layout left");
489479 sixButton.addActionListener(this);
490
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
480
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
491481 threeButton.setToolTipText("2-column layout right");
492482 threeButton.addActionListener(this);
493
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
483
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
494484 sevenButton.setToolTipText("3-column layout");
495485 sevenButton.addActionListener(this);
496486 //
497487
498
- oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
499
- rootButton.setToolTipText("Edit object in new tab");
488
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
489
+ rootButton.setToolTipText("Edit selection in new tab");
500490 rootButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
491
+
492
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
503493 closeButton.setToolTipText("Close tab");
504494 closeButton.addActionListener(this);
505495 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
506496 //clearButton.addActionListener(this);
507
- oe.aConstraints.gridx += 1;
508497
509
- oe.aConstraints.gridx = 1; //
510
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
498
+ cGridBag commandsPanel = new cGridBag();
499
+
500
+ commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
501
+ editButton.setToolTipText("Edit selection");
511502 editButton.addActionListener(this);
512
- oe.aConstraints.gridx += 1;
513
- oe.aConstraints.weighty = 0;
514
- oe.aConstraints.gridwidth = 1;
515503
516
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
504
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
505
+ uneditButton.setToolTipText("Unedit selection");
517506 uneditButton.addActionListener(this);
518507
519
- oe.aConstraints.gridx += 1;
520
- oe.aConstraints.weighty = 0;
521
- oe.aConstraints.gridwidth = 1;
522
-
523
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
508
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
509
+ clearPanelButton.setToolTipText("Clear edit panel");
524510 clearPanelButton.addActionListener(this);
525511
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
512
+ commandsPanel.add(allParamsButton = new cButton("A", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
513
+ allParamsButton.setToolTipText("All params??");
531514 allParamsButton.addActionListener(this);
532515
533
- oe.aConstraints.gridx += 1;
534
- oe.aConstraints.weighty = 0;
535
- oe.aConstraints.gridwidth = 1;
536
-
537
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
516
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
517
+ unselectButton.setToolTipText("Unselect");
538518 unselectButton.addActionListener(this);
539519
520
+ commandsPanel.preferredHeight = 1;
521
+
522
+ oe.treePanel.add(commandsPanel);
523
+ oe.treePanel.Return();
524
+
540525 // oe.aConstraints.gridx += 1;
541526 // oe.aConstraints.weighty = 0;
542527 // oe.aConstraints.gridwidth = 1;
....@@ -548,40 +533,37 @@
548533 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
549534 // gcButton.addActionListener(this);
550535
551
- oe.aConstraints.gridx = 0;
552
- oe.aConstraints.gridy += 1;
553
-
554
- //ctrlPanel.add(objList = new List(5, true));
555
- oe.aConstraints.gridwidth = 100;
556
- // oe.aConstraints.gridheight = 100;
557
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
558
- oe.aConstraints.gridheight = 1;
559
- oe.aConstraints.weighty = 0.5;
560
- oe.aConstraints.gridx = 0;
561
- JScrollPane jSP;
536
+ cGridBag jSPPanel = new cGridBag();
537
+
538
+ JScrollPane jSP;
562539 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
563
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
540
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
564541 ResetModel();
565
- oe.aConstraints.weighty = 0.5;
566
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
567
- oe.aConstraints.gridy += 1;
568
- oe.aConstraints.gridwidth = 1;
542
+
543
+ oe.treePanel.add(jSPPanel);
544
+ oe.treePanel.Return();
569545
570
- oe.aConstraints.weighty = 0;
571
- oe.aConstraints.gridwidth = 2;
572
-
573
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
546
+ cGridBag copyOptionsPanel = new cGridBag();
547
+
548
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
549
+ colorCB.setToolTipText("Copy color when dropped");
574550 colorCB.addItemListener(this);
575
- oe.aConstraints.gridx += 2;
576
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
551
+
552
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
553
+ materialCB.setToolTipText("Copy material when dropped");
577554 materialCB.addItemListener(this);
578
- oe.aConstraints.gridx += 2;
579
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
555
+
556
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
557
+ textureCB.setToolTipText("Copy texture when dropped");
580558 textureCB.addItemListener(this);
581559
582
- oe.aConstraints.gridx = 0;
583
- oe.aConstraints.gridy += 1;
560
+ copyOptionsPanel.preferredHeight = 1;
561
+ oe.treePanel.add(copyOptionsPanel);
562
+ oe.treePanel.Return();
584563
564
+// mainPanel.setDividerLocation(0.5); //1.0);
565
+// mainPanel.setResizeWeight(0.5);
566
+
585567 //jList.addListSelectionListener(this);
586568 oe.jTree.addTreeSelectionListener(this);
587569 //jTree.setRootVisible(false);
....@@ -604,42 +586,32 @@
604586 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
605587 }
606588
607
- void AddOptions(JPanel panel, GridBagConstraints constraints)
589
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
608590 {
609
- constraints.gridx = 0;
610
- constraints.gridy = 0;
611
- panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), constraints);
612
- fastCB.setToolTipText("Fast mode");
613
- fastCB.addItemListener(this);
614
- constraints.gridy += 1;
615
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), constraints);
591
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
616592 supportCB.setToolTipText("Enabled rigging");
617593 supportCB.addItemListener(this);
618594
619
- // constraints.gridy += 1;
620595 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
621596 // localCB.addItemListener(this);
622597
623
- constraints.gridy += 1;
624
- panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), constraints);
598
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
625599 crowdCB.setToolTipText("Used for crowds");
626600 crowdCB.addItemListener(this);
627601
628
- constraints.gridy += 1;
629
- panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), constraints);
602
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
630603 smoothCB.setToolTipText("Snapping delay");
631604 smoothCB.addItemListener(this);
632605
633
- constraints.gridy += 1;
634
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), constraints);
606
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
635607 slowCB.setToolTipText("Smooth interpolation");
636608 slowCB.addItemListener(this);
637
- constraints.gridy += 1;
638
- panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), constraints);
609
+
610
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
639611 boxCB.setToolTipText("Display bounding boxes");
640612 boxCB.addItemListener(this);
641
- constraints.gridy += 1;
642
- panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints);
613
+
614
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
643615 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
644616 zoomBoxCB.addItemListener(this);
645617
....@@ -650,16 +622,16 @@
650622 if (false)
651623 {
652624 // handled in scripts
653
- constraints.gridy += 1;
654
- panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints);
625
+ //constraints.gridy += 1;
626
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
655627 speakerCameraCB.addItemListener(this);
656628
657
- constraints.gridy += 1;
658
- panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints);
629
+ //constraints.gridy += 1;
630
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
659631 speakerFocusCB.addItemListener(this);
660632
661
- constraints.gridy += 1;
662
- panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints);
633
+ //constraints.gridy += 1;
634
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
663635 smoothfocusCB.addItemListener(this);
664636 }
665637
....@@ -667,14 +639,18 @@
667639 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
668640 // debugCB.addItemListener(this);
669641
670
- constraints.gridy += 1;
671
- panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints);
642
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
672643 oeilCB.addItemListener(this);
673644
674
- constraints.gridy += 1;
675
- panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints);
645
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
676646 lookAtCB.setToolTipText("Look-at target");
677647 lookAtCB.addItemListener(this);
648
+
649
+ cGridBag fill = new cGridBag();
650
+
651
+ fill.preferredHeight = 200;
652
+
653
+ panel.add(fill);
678654
679655 }
680656
....@@ -1123,7 +1099,7 @@
11231099 {
11241100 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
11251101 animationItem.addItemListener(this);
1126
- animationItem.setState(CameraPane.ANIMATION);
1102
+ animationItem.setState(Globals.ANIMATION);
11271103
11281104 menu.add("-");
11291105 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
....@@ -1518,6 +1494,7 @@
15181494 //
15191495 public void actionPerformed(ActionEvent event) // , Object arg)
15201496 {
1497
+ Object source = event.getSource();
15211498 /*
15221499 if (event.getSource() == nameField)
15231500 {
....@@ -1529,11 +1506,11 @@
15291506 }
15301507 else
15311508 */
1532
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1509
+ if (source == lookAtItem || source == lookFromItem)
15331510 {
15341511 ScreenFit();
15351512 } else
1536
- if (event.getSource() == switchItem)
1513
+ if (source == switchItem)
15371514 {
15381515 cVector v1 = new cVector();
15391516 cVector v2 = new cVector();
....@@ -1542,11 +1519,11 @@
15421519 objEditor.cameraView.renderCamera.setAim(v2, v1);
15431520 objEditor.cameraView.repaint();
15441521 } else
1545
- if (event.getSource() == rectoidItem)
1522
+ if (source == rectoidItem)
15461523 {
15471524 makeSomething(new Box());
15481525 } else
1549
- if (event.getSource() == particleItem)
1526
+ if (source == particleItem)
15501527 {
15511528 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15521529 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1567,9 +1544,9 @@
15671544 applyExample(particleGeom, "SMOKE");
15681545 makeSomething(particleGeom);
15691546 } else
1570
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1547
+ if (source == ragdollItem || source == ragdoll2Item)
15711548 {
1572
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1549
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15731550
15741551 ragdoll.toParent = LA.newMatrix();
15751552 ragdoll.fromParent = LA.newMatrix();
....@@ -1587,7 +1564,7 @@
15871564 } else
15881565 /*
15891566 */
1590
- if (event.getSource() == heightFieldItem)
1567
+ if (source == heightFieldItem)
15911568 {
15921569 Object3D obj = new Object3D();
15931570
....@@ -1625,31 +1602,31 @@
16251602
16261603 makeSomething(obj);
16271604 } else
1628
- if (event.getSource() == gridItem)
1605
+ if (source == gridItem)
16291606 {
16301607 makeSomething(new Grid());
16311608 } else
1632
- if (event.getSource() == ellipsoidItem)
1609
+ if (source == ellipsoidItem)
16331610 {
16341611 makeSomething(new Sphere());
16351612 } else
1636
- if (event.getSource() == coneItem)
1613
+ if (source == coneItem)
16371614 {
16381615 makeSomething(new Cone());
16391616 } else
1640
- if (event.getSource() == torusItem)
1617
+ if (source == torusItem)
16411618 {
16421619 makeSomething(new Torus());
16431620 } else
1644
- if (event.getSource() == superItem)
1621
+ if (source == superItem)
16451622 {
16461623 makeSomething(new Superellipsoid());
16471624 } else
1648
- if (event.getSource() == kleinItem)
1625
+ if (source == kleinItem)
16491626 {
16501627 makeSomething(new Klein());
16511628 } else
1652
- if (event.getSource() == blobItem)
1629
+ if (source == blobItem)
16531630 {
16541631 Blob blob = new Blob();
16551632 BlobComponent comp = new BlobComponent();
....@@ -1657,15 +1634,15 @@
16571634 //blob.retile();
16581635 makeSomething(blob);
16591636 } else
1660
- if (event.getSource() == latheItem)
1637
+ if (source == latheItem)
16611638 {
16621639 makeSomething(new Lathe());
16631640 } else
1664
- if (event.getSource() == bezierItem)
1641
+ if (source == bezierItem)
16651642 {
16661643 makeSomething(new BezierSurface());
16671644 } else
1668
- if (event.getSource() == checkerItem)
1645
+ if (source == checkerItem)
16691646 {
16701647 /*
16711648 Object3D obj = new BezierSurface(5,8);
....@@ -1680,7 +1657,7 @@
16801657 */
16811658 makeSomething(new Checker());
16821659 } else
1683
- if (event.getSource() == meshItem)
1660
+ if (source == meshItem)
16841661 {
16851662 Object3D itemtomake = new Object3D();
16861663 Object3D child;
....@@ -1701,35 +1678,35 @@
17011678 makeSomething(child);
17021679 }
17031680 } else
1704
- if (event.getSource() == springItem)
1681
+ if (source == springItem)
17051682 {
17061683 cSpring s = new cSpring();
17071684 s.setup();
17081685 makeSomething(s);
17091686 } else
1710
- if (event.getSource() == flagItem)
1687
+ if (source == flagItem)
17111688 {
17121689 cSpring s = new cFlag();
17131690 s.setup();
17141691 makeSomething(s);
17151692 } else
1716
- if (event.getSource() == lightItem)
1693
+ if (source == lightItem)
17171694 {
17181695 makeSomething(new Light());
17191696 } else
1720
- if (event.getSource() == csgItem)
1697
+ if (source == csgItem)
17211698 {
17221699 group(new CSG());
17231700 } else
1724
- if (event.getSource() == templateItem)
1701
+ if (source == templateItem)
17251702 {
17261703 group(new cTemplate());
17271704 } else
1728
- if (event.getSource() == attributeItem)
1705
+ if (source == attributeItem)
17291706 {
17301707 makeSomething(new Attribute());
17311708 } else
1732
- if (event.getSource() == pointflowItem)
1709
+ if (source == pointflowItem)
17331710 {
17341711 makeSomething(new PointFlow());
17351712 } else
....@@ -1741,7 +1718,7 @@
17411718 } else
17421719 */
17431720
1744
- if (event.getSource() == superLoopItem)
1721
+ if (source == superLoopItem)
17451722 {
17461723 Composite g = new cGroup();
17471724 for (int i=0; i<15; i++)
....@@ -1763,7 +1740,7 @@
17631740
17641741 group(g);
17651742 } else
1766
- if (event.getSource() == loopItem)
1743
+ if (source == loopItem)
17671744 {
17681745 Composite csg = new GroupLeaf();
17691746 csg.count = 5;
....@@ -1772,7 +1749,7 @@
17721749 csg.addChild(child);
17731750 child.addChild(csg);
17741751 } else
1775
- if (event.getSource() == doubleItem)
1752
+ if (source == doubleItem)
17761753 {
17771754 Composite csg = new GroupLeaf();
17781755 csg.count = 5;
....@@ -1784,7 +1761,7 @@
17841761 csg.addChild(child);
17851762 child.addChild(csg);
17861763 } else
1787
- if (event.getSource() == tripleItem)
1764
+ if (source == tripleItem)
17881765 {
17891766 Composite csg = new GroupLeaf();
17901767 csg.count = 4;
....@@ -1800,70 +1777,70 @@
18001777 child.addChild(csg);
18011778 } else
18021779
1803
- if (event.getSource() == importGFDItem)
1780
+ if (source == importGFDItem)
18041781 {
18051782 ImportGFD();
18061783 } else
1807
- if (event.getSource() == importVRMLX3DItem)
1784
+ if (source == importVRMLX3DItem)
18081785 {
18091786 ImportVRMLX3D();
18101787 } else
1811
- if (event.getSource() == import3DSItem)
1788
+ if (source == import3DSItem)
18121789 {
18131790 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
18141791 } else
1815
- if (event.getSource() == importOBJItem)
1792
+ if (source == importOBJItem)
18161793 {
18171794 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
18181795 } else
1819
- if (event.getSource() == computeAOItem)
1796
+ if (source == computeAOItem)
18201797 {
18211798 Globals.drawMode = CameraPane.OCCLUSION;
18221799 Globals.theRenderer.repaint();
18231800 } else
1824
- if (event.getSource() == recompileItem)
1801
+ if (source == recompileItem)
18251802 {
18261803 Recompile();
18271804 refreshContents();
18281805 } else
1829
- if (event.getSource() == editScriptItem)
1806
+ if (source == editScriptItem)
18301807 {
18311808 OpenDialog();
18321809 refreshContents();
18331810 } else
1834
- if (event.getSource() == invariantsItem)
1811
+ if (source == invariantsItem)
18351812 {
18361813 System.out.println("Invariants:");
18371814 GrafreeD.grafreeD.universe.invariants();
18381815 } else
1839
- if (event.getSource() == memoryItem)
1816
+ if (source == memoryItem)
18401817 {
18411818 //System.out.println("Invariants:");
18421819 PrintMemory();
18431820 } else
1844
- if (event.getSource() == pathItem)
1821
+ if (source == pathItem)
18451822 {
18461823 PrintPath();
18471824 } else
1848
- if (event.getSource() == analyzeItem)
1825
+ if (source == analyzeItem)
18491826 {
18501827 AnalyzeObject();
18511828 } else
1852
- if (event.getSource() == dumpItem)
1829
+ if (source == dumpItem)
18531830 {
18541831 DumpObject();
18551832 } else
1856
- if (event.getSource() == screenfitButton)
1833
+ if (source == screenfitButton)
18571834 {
18581835 //Reload(lastConverter, lastFilename, true);
18591836 ScreenFit();
18601837 } else
1861
- if (event.getSource() == screenfitpointButton)
1838
+ if (source == screenfitpointButton)
18621839 {
18631840 //Reload(lastConverter, lastFilename, true);
18641841 ScreenFitPoint();
18651842 } else
1866
- if (event.getSource() == snapobjectButton)
1843
+ if (source == snapobjectButton)
18671844 {
18681845 //Reload(lastConverter, lastFilename, true);
18691846 SnapObject();
....@@ -1874,13 +1851,13 @@
18741851 // Recompile();
18751852 // refreshContents();
18761853 // } else
1877
- if (event.getSource() == gcButton)
1854
+ if (source == gcButton)
18781855 {
18791856 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18801857 System.gc();
18811858 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18821859 } else
1883
- if (event.getSource() == editLeafItem)
1860
+ if (source == editLeafItem)
18841861 {
18851862 Object3D obj;
18861863 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1894,62 +1871,62 @@
18941871 }
18951872 refreshContents(true);
18961873 } else
1897
- if (event.getSource() == openWindowItem)
1874
+ if (source == openWindowItem)
18981875 {
18991876 EditSelection(true);
19001877 } else
1901
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1878
+ if (source == cutItem || source == clearButton)
19021879 {
19031880 loadClipboard(true);
19041881 } else
1905
- if (event.getSource() == duplicateItem)
1882
+ if (source == duplicateItem)
19061883 {
19071884 Object3D keep = GrafreeD.clipboard;
19081885 loadClipboard(false);
19091886 paste(false);
19101887 GrafreeD.clipboard = keep;
19111888 } else
1912
- if (event.getSource() == cloneItem)
1889
+ if (source == cloneItem)
19131890 {
19141891 CloneSelection(false);
19151892 } else
1916
- if (event.getSource() == cloneSupportItem)
1893
+ if (source == cloneSupportItem)
19171894 {
19181895 CloneSelection(true);
19191896 } else
1920
- if (event.getSource() == copyItem)
1897
+ if (source == copyItem)
19211898 {
19221899 loadClipboard(false);
19231900 } else
1924
- if (event.getSource() == pasteItem)
1901
+ if (source == pasteItem)
19251902 {
19261903 paste(false);
19271904 } else
1928
- if (event.getSource() == pasteLinkItem)
1905
+ if (source == pasteLinkItem)
19291906 {
19301907 pasteInto(false);
19311908 } else
1932
- if (event.getSource() == pasteCloneItem)
1909
+ if (source == pasteCloneItem)
19331910 {
19341911 pasteInto(true);
19351912 } else
1936
- if (event.getSource() == pasteExpandItem)
1913
+ if (source == pasteExpandItem)
19371914 {
19381915 paste(true);
19391916 } else
1940
- if (event.getSource() == synchronizeItem)
1917
+ if (source == synchronizeItem)
19411918 {
19421919 Overwrite(Object3D.TRANSFORM);
19431920 } else
1944
- if (event.getSource() == overwriteNameItem)
1921
+ if (source == overwriteNameItem)
19451922 {
19461923 Overwrite(Object3D.NAME);
19471924 } else
1948
- if (event.getSource() == overwriteUVItem)
1925
+ if (source == overwriteUVItem)
19491926 {
19501927 Overwrite(Object3D.UV);
19511928 } else
1952
- if (event.getSource() == overwriteMatItem)
1929
+ if (source == overwriteMatItem)
19531930 {
19541931 /* july 2015
19551932 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1969,7 +1946,7 @@
19691946
19701947 Overwrite(dropAttributes);
19711948 }
1972
- if (event.getSource() == overwriteGeoItem)
1949
+ if (source == overwriteGeoItem)
19731950 {
19741951 Overwrite(Object3D.GEOMETRY);
19751952 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1986,7 +1963,7 @@
19861963 // refreshContents();
19871964 // }
19881965 } else
1989
- if (event.getSource() == generateMeshItem)
1966
+ if (source == generateMeshItem)
19901967 {
19911968 //if (group.selection.size() == 1)
19921969 // for (int i=0; i<group.selection.size(); i++)
....@@ -1997,7 +1974,7 @@
19971974 ResetModel();
19981975 refreshContents();
19991976 } else
2000
- if (event.getSource() == extractGeometriesItem)
1977
+ if (source == extractGeometriesItem)
20011978 {
20021979 boolean one = false;
20031980
....@@ -2024,7 +2001,7 @@
20242001 ResetModel();
20252002 refreshContents();
20262003 } else
2027
- if (event.getSource() == cloneGeometriesItem)
2004
+ if (source == cloneGeometriesItem)
20282005 {
20292006 boolean one = false;
20302007
....@@ -2050,7 +2027,7 @@
20502027 ResetModel();
20512028 refreshContents();
20522029 } else
2053
- if (event.getSource() == shareGeometriesItem)
2030
+ if (source == shareGeometriesItem)
20542031 {
20552032 boolean one = false;
20562033
....@@ -2080,7 +2057,7 @@
20802057 refreshContents();
20812058 }
20822059 } else
2083
- if (event.getSource() == mergeGeometriesItem)
2060
+ if (source == mergeGeometriesItem)
20842061 {
20852062 boolean one = false;
20862063
....@@ -2110,7 +2087,7 @@
21102087 ResetModel();
21112088 refreshContents();
21122089 } else
2113
- if (event.getSource() == linkverticesItem)
2090
+ if (source == linkverticesItem)
21142091 {
21152092 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21162093 // {
....@@ -2143,7 +2120,7 @@
21432120 refreshContents();
21442121 }
21452122 } else
2146
- if (event.getSource() == resetsupportItem)
2123
+ if (source == resetsupportItem)
21472124 {
21482125 for (int i=0; i<group.selection.size(); i++)
21492126 {
....@@ -2155,7 +2132,7 @@
21552132
21562133 refreshContents();
21572134 } else
2158
- if (event.getSource() == relinkverticesItem)
2135
+ if (source == relinkverticesItem)
21592136 {
21602137 boolean random = CameraPane.RANDOM;
21612138 CameraPane.RANDOM = false; // parse all random nodes
....@@ -2164,7 +2141,7 @@
21642141
21652142 refreshContents();
21662143 } else
2167
- if (event.getSource() == resetreferencesItem)
2144
+ if (source == resetreferencesItem)
21682145 {
21692146 for (int i=0; i<group.selection.size(); i++)
21702147 {
....@@ -2173,7 +2150,7 @@
21732150
21742151 refreshContents();
21752152 } else
2176
- if (event.getSource() == setMasterItem)
2153
+ if (source == setMasterItem)
21772154 {
21782155 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21792156 {
....@@ -2186,7 +2163,7 @@
21862163 refreshContents();
21872164 }
21882165 } else
2189
- if (event.getSource() == poseMeshItem)
2166
+ if (source == poseMeshItem)
21902167 {
21912168 if (group.selection.size() == 1)
21922169 {
....@@ -2205,19 +2182,19 @@
22052182 }
22062183
22072184 } else
2208
- if (event.getSource() == revertMeshItem)
2185
+ if (source == revertMeshItem)
22092186 {
22102187 RevertMeshes();
22112188 } else
2212
- if (event.getSource() == resetMeshItem)
2189
+ if (source == resetMeshItem)
22132190 {
22142191 ResetAll();
22152192 } else
2216
- if (event.getSource() == stepAllItem)
2193
+ if (source == stepAllItem)
22172194 {
22182195 StepAll();
22192196 } else
2220
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2197
+ if (source == clearItem) // || event.getSource() == clearButton)
22212198 {
22222199 //int indices[] = jList.getSelectedIndices();
22232200 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2225,46 +2202,46 @@
22252202
22262203 ClearSelection(false);
22272204 } else
2228
- if (event.getSource() == clearAllItem)
2205
+ if (source == clearAllItem)
22292206 {
22302207 ClearSelection(true);
22312208 } else
2232
- if (event.getSource() == grabItem)
2209
+ if (source == grabItem)
22332210 {
22342211 group(new cGroup(), true);
22352212 } else
2236
- if (event.getSource() == hideItem)
2213
+ if (source == hideItem)
22372214 {
22382215 group(new HiddenObject());
22392216 } else
2240
- if (event.getSource() == frontItem)
2217
+ if (source == frontItem)
22412218 {
22422219 front();
22432220 } else
2244
- if (event.getSource() == backItem)
2221
+ if (source == backItem)
22452222 {
22462223 back();
22472224 } else
2248
- if (event.getSource() == cameraItem)
2225
+ if (source == cameraItem)
22492226 {
22502227 makeSomething(new Camera());
22512228 } else
2252
- if (event.getSource() == compositeItem)
2229
+ if (source == compositeItem)
22532230 {
22542231 group(new Composite());
22552232 } else
2256
- if (event.getSource() == randomItem)
2233
+ if (source == randomItem)
22572234 {
22582235 RandomNode random = new RandomNode();
22592236 group(random);
22602237 if (random.size() > 0)
2261
- random.name = random.get(0).name + "Rnd";
2238
+ random.name = random.get(0).name + "Switch";
22622239 } else
2263
- if (event.getSource() == physicsItem)
2240
+ if (source == physicsItem)
22642241 {
22652242 group(new PhysicsNode());
22662243 } else
2267
- if (event.getSource() == frameselectorItem)
2244
+ if (source == frameselectorItem)
22682245 {
22692246 for (int i=0; i<group.selection.size(); i++)
22702247 {
....@@ -2276,7 +2253,7 @@
22762253 ResetModel();
22772254 refreshContents();
22782255 } else
2279
- if (event.getSource() == switchGeoItem)
2256
+ if (source == switchGeoItem)
22802257 {
22812258 for (int i=0; i<group.selection.size(); i++)
22822259 {
....@@ -2288,7 +2265,7 @@
22882265 ResetModel();
22892266 refreshContents();
22902267 } else
2291
- if (event.getSource() == switchTransfoItem)
2268
+ if (source == switchTransfoItem)
22922269 {
22932270 for (int i=0; i<group.selection.size(); i++)
22942271 {
....@@ -2300,7 +2277,7 @@
23002277 ResetModel();
23012278 refreshContents();
23022279 } else
2303
- if (event.getSource() == morphItem)
2280
+ if (source == morphItem)
23042281 {
23052282 for (int i=0; i<group.selection.size(); i++)
23062283 {
....@@ -2312,7 +2289,7 @@
23122289 ResetModel();
23132290 refreshContents();
23142291 } else
2315
- if (event.getSource() == scriptNodeItem)
2292
+ if (source == scriptNodeItem)
23162293 {
23172294 boolean atleastone = false;
23182295
....@@ -2351,31 +2328,31 @@
23512328 }
23522329 }
23532330 } else
2354
- if (event.getSource() == linkerItem)
2331
+ if (source == linkerItem)
23552332 {
23562333 group(new cLinker());
23572334 } else
2358
- if (event.getSource() == textureItem)
2335
+ if (source == textureItem)
23592336 {
23602337 group(new TextureNode());
23612338 } else
2362
- if (event.getSource() == billboardItem)
2339
+ if (source == billboardItem)
23632340 {
23642341 group(new BillboardNode());
23652342 } else
2366
- if (event.getSource() == shadowXItem)
2343
+ if (source == shadowXItem)
23672344 {
23682345 CastShadow(0);
23692346 } else
2370
- if (event.getSource() == shadowYItem)
2347
+ if (source == shadowYItem)
23712348 {
23722349 CastShadow(1);
23732350 } else
2374
- if (event.getSource() == shadowZItem)
2351
+ if (source == shadowZItem)
23752352 {
23762353 CastShadow(2);
23772354 } else
2378
- if (event.getSource() == ungroupItem)
2355
+ if (source == ungroupItem)
23792356 {
23802357 //ungroup();
23812358 for (int i=0; i<group.selection.size(); i++)
....@@ -2387,179 +2364,179 @@
23872364
23882365 refreshContents();
23892366 } else
2390
- if (event.getSource() == genUVItem)
2367
+ if (source == genUVItem)
23912368 {
23922369 GenUV();
23932370 } else
2394
- if (event.getSource() == genNormalsCADItem)
2371
+ if (source == genNormalsCADItem)
23952372 {
23962373 GenNormals(true);
23972374 } else
2398
- if (event.getSource() == genNormalsMESHItem)
2375
+ if (source == genNormalsMESHItem)
23992376 {
24002377 GenNormals(true); // TODO
24012378 } else
2402
- if (event.getSource() == genNormalsORGANItem)
2379
+ if (source == genNormalsORGANItem)
24032380 {
24042381 GenNormals(false);
24052382 } else
2406
- if (event.getSource() == genNormalsMINEItem)
2383
+ if (source == genNormalsMINEItem)
24072384 {
24082385 GenNormalsMINE();
24092386 } else
2410
- if (event.getSource() == stripifyItem)
2387
+ if (source == stripifyItem)
24112388 {
24122389 Stripify();
24132390 } else
2414
- if (event.getSource() == unstripifyItem)
2391
+ if (source == unstripifyItem)
24152392 {
24162393 Unstripify();
24172394 } else
2418
- if (event.getSource() == trimItem)
2395
+ if (source == trimItem)
24192396 {
24202397 Trim();
24212398 } else
2422
- if (event.getSource() == untrimItem)
2399
+ if (source == untrimItem)
24232400 {
24242401 Untrim();
24252402 } else
2426
- if (event.getSource() == clearColorsItem)
2403
+ if (source == clearColorsItem)
24272404 {
24282405 ClearColors();
24292406 } else
2430
- if (event.getSource() == clearMaterialsItem)
2407
+ if (source == clearMaterialsItem)
24312408 {
24322409 ClearMaterials();
24332410 } else
2434
- if (event.getSource() == liveleavesItem)
2411
+ if (source == liveleavesItem)
24352412 {
24362413 LiveLeaves(true);
24372414 } else
2438
- if (event.getSource() == unliveleavesItem)
2415
+ if (source == unliveleavesItem)
24392416 {
24402417 LiveLeaves(false);
24412418 } else
2442
- if (event.getSource() == supportleavesItem)
2419
+ if (source == supportleavesItem)
24432420 {
24442421 SupportLeaves(true);
24452422 } else
2446
- if (event.getSource() == unsupportleavesItem)
2423
+ if (source == unsupportleavesItem)
24472424 {
24482425 SupportLeaves(false);
24492426 } else
2450
- if (event.getSource() == hideleavesItem)
2427
+ if (source == hideleavesItem)
24512428 {
24522429 HideLeaves(true);
24532430 } else
2454
- if (event.getSource() == showleavesItem)
2431
+ if (source == showleavesItem)
24552432 {
24562433 HideLeaves(false);
24572434 } else
2458
- if (event.getSource() == markleavesItem)
2435
+ if (source == markleavesItem)
24592436 {
24602437 MarkLeaves(true);
24612438 } else
2462
- if (event.getSource() == unmarkleavesItem)
2439
+ if (source == unmarkleavesItem)
24632440 {
24642441 MarkLeaves(false);
24652442 } else
2466
- if (event.getSource() == flipVItem)
2443
+ if (source == flipVItem)
24672444 {
24682445 FlipV(true);
24692446 } else
2470
- if (event.getSource() == unflipVItem)
2447
+ if (source == unflipVItem)
24712448 {
24722449 FlipV(false);
24732450 } else
2474
- if (event.getSource() == lowTexturesItem)
2451
+ if (source == lowTexturesItem)
24752452 {
24762453 SetTexRes(0);
24772454 } else
2478
- if (event.getSource() == normalTexturesItem)
2455
+ if (source == normalTexturesItem)
24792456 {
24802457 SetTexRes(1);
24812458 } else
2482
- if (event.getSource() == highTexturesItem)
2459
+ if (source == highTexturesItem)
24832460 {
24842461 SetTexRes(2);
24852462 } else
2486
- if (event.getSource() == veryhighTexturesItem)
2463
+ if (source == veryhighTexturesItem)
24872464 {
24882465 SetTexRes(3);
24892466 } else
2490
- if (event.getSource() == maxTexturesItem)
2467
+ if (source == maxTexturesItem)
24912468 {
24922469 SetTexRes(4);
24932470 } else
2494
- if (event.getSource() == panoTexturesItem)
2471
+ if (source == panoTexturesItem)
24952472 {
24962473 SetTexRes(5);
24972474 } else
2498
- if (event.getSource() == reverseNormalsItem)
2475
+ if (source == reverseNormalsItem)
24992476 {
25002477 ReverseNormals();
25012478 } else
2502
- if (event.getSource() == parseverticesItem)
2479
+ if (source == parseverticesItem)
25032480 {
25042481 ParseVertices();
25052482 } else
2506
- if (event.getSource() == textureFieldItem)
2483
+ if (source == textureFieldItem)
25072484 {
25082485 TextureVertices();
25092486 } else
2510
- if (event.getSource() == alignItem)
2487
+ if (source == alignItem)
25112488 {
25122489 Align();
25132490 } else
2514
- if (event.getSource() == mirrorItem)
2491
+ if (source == mirrorItem)
25152492 {
25162493 MirrorPoses();
25172494 } else
2518
- if (event.getSource() == reduceMorphItem)
2495
+ if (source == reduceMorphItem)
25192496 {
25202497 MeshReduction(false);
25212498 } else
2522
- if (event.getSource() == reduce34MorphItem)
2499
+ if (source == reduce34MorphItem)
25232500 {
25242501 MeshReduction(true);
25252502 } else
2526
- if (event.getSource() == reverseTrianglesItem)
2503
+ if (source == reverseTrianglesItem)
25272504 {
25282505 ReverseTriangles();
25292506 } else
2530
- if (event.getSource() == reduceMeshItem)
2507
+ if (source == reduceMeshItem)
25312508 {
25322509 ReduceMesh(false);
25332510 } else
2534
- if (event.getSource() == reduce34MeshItem)
2511
+ if (source == reduce34MeshItem)
25352512 {
25362513 ReduceMesh(true);
25372514 } else
2538
- if (event.getSource() == increaseMeshItem)
2515
+ if (source == increaseMeshItem)
25392516 {
25402517 IncreaseMesh();
25412518 } else
2542
- if (event.getSource() == clipMeshItem)
2519
+ if (source == clipMeshItem)
25432520 {
25442521 ClipMesh();
25452522 } else
2546
- if (event.getSource() == smoothMeshItem)
2523
+ if (source == smoothMeshItem)
25472524 {
25482525 SmoothMesh();
25492526 } else
2550
- if (event.getSource() == transformgeometryItem)
2527
+ if (source == transformgeometryItem)
25512528 {
25522529 TransformGeometry();
25532530 } else
2554
- if (event.getSource() == resetTransformItem)
2531
+ if (source == resetTransformItem)
25552532 {
25562533 ResetTransform();
25572534 } else
2558
- if (event.getSource() == resetCentroidItem)
2535
+ if (source == resetCentroidItem)
25592536 {
25602537 ResetCentroid();
25612538 } else
2562
- if (event.getSource() == resetParentItem)
2539
+ if (source == resetParentItem)
25632540 {
25642541 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25652542 {
....@@ -2569,7 +2546,7 @@
25692546
25702547 refreshContents();
25712548 } else
2572
- if (event.getSource() == repairParentItem)
2549
+ if (source == repairParentItem)
25732550 {
25742551 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25752552 {
....@@ -2583,7 +2560,7 @@
25832560
25842561 refreshContents();
25852562 } else
2586
- if (event.getSource() == repairShadowItem)
2563
+ if (source == repairShadowItem)
25872564 {
25882565 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25892566 {
....@@ -2597,7 +2574,7 @@
25972574
25982575 refreshContents();
25992576 } else
2600
- if (event.getSource() == sortbysizeItem)
2577
+ if (source == sortbysizeItem)
26012578 {
26022579 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26032580 {
....@@ -2609,7 +2586,7 @@
26092586 ResetModel();
26102587 refreshContents();
26112588 } else
2612
- if (event.getSource() == sortbynameItem)
2589
+ if (source == sortbynameItem)
26132590 {
26142591 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26152592 {
....@@ -2621,7 +2598,7 @@
26212598 ResetModel();
26222599 refreshContents();
26232600 } else
2624
- if (event.getSource() == attachPigmentItem)
2601
+ if (source == attachPigmentItem)
26252602 {
26262603 String texture = GetFile("Attach pigment");
26272604 Object3D obj;
....@@ -2633,7 +2610,7 @@
26332610
26342611 refreshContents();
26352612 } else
2636
- if (event.getSource() == detachPigmentItem)
2613
+ if (source == detachPigmentItem)
26372614 {
26382615 Object3D obj;
26392616 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2644,7 +2621,7 @@
26442621
26452622 refreshContents();
26462623 } else
2647
- if (event.getSource() == attachBumpItem)
2624
+ if (source == attachBumpItem)
26482625 {
26492626 String texture = GetFile("Attach bump");
26502627 Object3D obj;
....@@ -2656,7 +2633,7 @@
26562633
26572634 refreshContents();
26582635 } else
2659
- if (event.getSource() == detachBumpItem)
2636
+ if (source == detachBumpItem)
26602637 {
26612638 Object3D obj;
26622639 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2667,7 +2644,7 @@
26672644
26682645 refreshContents();
26692646 } else
2670
- if (event.getSource() == pigmentBumpItem)
2647
+ if (source == pigmentBumpItem)
26712648 {
26722649 Object3D obj;
26732650 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2678,158 +2655,195 @@
26782655
26792656 refreshContents();
26802657 } else
2681
- if (event.getSource() == flashSelectionButton)
2658
+ if (source == flashSelectionButton)
26822659 {
26832660 CameraPane.flash = true;
26842661 refreshContents();
26852662 } else
2686
- if (event.getSource() == oneButton)
2663
+ if (source == oneButton)
26872664 {
26882665 } else
2689
- if (event.getSource() == twoButton)
2666
+ if (source == twoButton)
26902667 {
26912668 radio.layout = twoButton;
26922669 // bug
26932670 //gridPanel.setDividerLocation(1.0);
26942671 //bigPanel.setDividerLocation(0.0);
2695
- bigThree.remove(scenePanel);
2696
- bigThree.remove(centralPanel);
2697
- bigThree.remove(XYZPanel);
2698
- aWindowConstraints.gridx = 0;
2699
- aWindowConstraints.gridy = 0;
2700
- aWindowConstraints.gridwidth = 1;
2701
- // aConstraints.gridheight = 3;
2702
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2703
- aWindowConstraints.weightx = 0;
2704
- aWindowConstraints.weighty = 1;
2705
- //bigThree.add(jtp, aWindowConstraints);
2706
- aWindowConstraints.weightx = 1;
2707
- aWindowConstraints.gridwidth = 3;
2708
- // aConstraints.gridheight = 3;
2709
- aWindowConstraints.gridx = 1;
2710
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2711
- bigThree.add(centralPanel, aWindowConstraints);
2712
- aWindowConstraints.weightx = 0;
2713
- aWindowConstraints.gridx = 4;
2714
- aWindowConstraints.gridwidth = 1;
2715
- // aConstraints.gridheight = 3;
2716
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2717
- //bigThree.add(XYZPanel, aWindowConstraints);
2718
- bigThree.revalidate();
2672
+// bigThree.remove(scenePanel);
2673
+// bigThree.remove(centralPanel);
2674
+// bigThree.remove(XYZPanel);
2675
+// aWindowConstraints.gridx = 0;
2676
+// aWindowConstraints.gridy = 0;
2677
+// aWindowConstraints.gridwidth = 1;
2678
+// // aConstraints.gridheight = 3;
2679
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2680
+// aWindowConstraints.weightx = 0;
2681
+// aWindowConstraints.weighty = 1;
2682
+// //bigThree.add(jtp, aWindowConstraints);
2683
+// aWindowConstraints.weightx = 1;
2684
+// aWindowConstraints.gridwidth = 3;
2685
+// // aConstraints.gridheight = 3;
2686
+// aWindowConstraints.gridx = 1;
2687
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2688
+// bigThree.add(centralPanel, aWindowConstraints);
2689
+// aWindowConstraints.weightx = 0;
2690
+// aWindowConstraints.gridx = 4;
2691
+// aWindowConstraints.gridwidth = 1;
2692
+// // aConstraints.gridheight = 3;
2693
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2694
+// //bigThree.add(XYZPanel, aWindowConstraints);
2695
+// scenePanel.setVisible(false);
2696
+// centralPanel.setVisible(true);
2697
+// XYZPanel.setVisible(false);
2698
+ bigThree.ClearUI();
2699
+ bigThree.add(centralPanel);
2700
+ bigThree.FlushUI();
27192701 } else
2720
- if (event.getSource() == threeButton)
2702
+ if (source == threeButton)
27212703 {
27222704 radio.layout = threeButton;
2723
- bigThree.remove(scenePanel);
2724
- bigThree.remove(centralPanel);
2725
- bigThree.remove(XYZPanel);
2726
- aWindowConstraints.gridx = 0;
2727
- aWindowConstraints.gridy = 0;
2728
- aWindowConstraints.gridwidth = 1;
2729
- // aConstraints.gridheight = 3;
2730
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2731
- aWindowConstraints.weightx = 0;
2732
- aWindowConstraints.weighty = 1;
2733
- //bigThree.add(jtp, aWindowConstraints);
2734
- aWindowConstraints.weightx = 1;
2735
- aWindowConstraints.gridwidth = 3;
2736
- // aConstraints.gridheight = 3;
2737
- aWindowConstraints.gridx = 1;
2738
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2739
- bigThree.add(centralPanel, aWindowConstraints);
2740
- aWindowConstraints.weightx = 0;
2741
- aWindowConstraints.gridx = 4;
2742
- aWindowConstraints.gridwidth = 1;
2743
- // aConstraints.gridheight = 3;
2744
- aConstraints.fill = GridBagConstraints.VERTICAL;
2745
- bigThree.add(XYZPanel, aWindowConstraints);
2746
- bigThree.revalidate();
2705
+
2706
+// bigThree.remove(scenePanel);
2707
+// bigThree.remove(centralPanel);
2708
+// bigThree.remove(XYZPanel);
2709
+// aWindowConstraints.gridx = 0;
2710
+// aWindowConstraints.gridy = 0;
2711
+// aWindowConstraints.gridwidth = 1;
2712
+// // aConstraints.gridheight = 3;
2713
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2714
+// aWindowConstraints.weightx = 0;
2715
+// aWindowConstraints.weighty = 1;
2716
+// //bigThree.add(jtp, aWindowConstraints);
2717
+// aWindowConstraints.weightx = 1;
2718
+// aWindowConstraints.gridwidth = 3;
2719
+// // aConstraints.gridheight = 3;
2720
+// aWindowConstraints.gridx = 1;
2721
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2722
+// bigThree.add(centralPanel, aWindowConstraints);
2723
+// aWindowConstraints.weightx = 0;
2724
+// aWindowConstraints.gridx = 4;
2725
+// aWindowConstraints.gridwidth = 1;
2726
+// // aConstraints.gridheight = 3;
2727
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2728
+// bigThree.add(XYZPanel, aWindowConstraints);
2729
+// bigThree.validate();
2730
+// scenePanel.setVisible(false);
2731
+// centralPanel.setVisible(true);
2732
+// XYZPanel.setVisible(true);
2733
+ bigThree.ClearUI();
2734
+ bigThree.add(centralPanel);
2735
+ bigThree.add(XYZPanel);
2736
+ bigThree.FlushUI();
27472737 } else
2748
- if (event.getSource() == fourButton)
2738
+ if (source == fourButton)
27492739 {
27502740 radio.layout = fourButton;
2751
- bigThree.remove(scenePanel);
2752
- bigThree.remove(centralPanel);
2753
- bigThree.remove(XYZPanel);
2754
- aWindowConstraints.gridx = 0;
2755
- aWindowConstraints.gridy = 0;
2756
- aWindowConstraints.gridwidth = 1;
2757
- // aWindowConstraints.gridheight = 3;
2758
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2759
- aWindowConstraints.weightx = 1;
2760
- aWindowConstraints.weighty = 1;
2761
- bigThree.add(scenePanel, aWindowConstraints);
2762
- aWindowConstraints.weightx = 1;
2763
- aWindowConstraints.gridwidth = 3;
2764
- // aConstraints.gridheight = 3;
2765
- aWindowConstraints.gridx = 1;
2766
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2767
- //bigThree.add(cameraPanel, aWindowConstraints);
2768
- aWindowConstraints.weightx = 0;
2769
- aWindowConstraints.gridx = 4;
2770
- aWindowConstraints.gridwidth = 1;
2771
- // aWindowConstraints.gridheight = 3;
2772
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2773
- //bigThree.add(XYZPanel, aWindowConstraints);
2774
- bigThree.revalidate();
2741
+
2742
+// bigThree.remove(scenePanel);
2743
+// bigThree.remove(centralPanel);
2744
+// bigThree.remove(XYZPanel);
2745
+// aWindowConstraints.gridx = 0;
2746
+// aWindowConstraints.gridy = 0;
2747
+// aWindowConstraints.gridwidth = 1;
2748
+// // aWindowConstraints.gridheight = 3;
2749
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2750
+// aWindowConstraints.weightx = 1;
2751
+// aWindowConstraints.weighty = 1;
2752
+// bigThree.add(scenePanel, aWindowConstraints);
2753
+// aWindowConstraints.weightx = 1;
2754
+// aWindowConstraints.gridwidth = 3;
2755
+// // aConstraints.gridheight = 3;
2756
+// aWindowConstraints.gridx = 1;
2757
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2758
+// //bigThree.add(cameraPanel, aWindowConstraints);
2759
+// aWindowConstraints.weightx = 0;
2760
+// aWindowConstraints.gridx = 4;
2761
+// aWindowConstraints.gridwidth = 1;
2762
+// // aWindowConstraints.gridheight = 3;
2763
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2764
+// //bigThree.add(XYZPanel, aWindowConstraints);
2765
+// bigThree.validate();
2766
+// scenePanel.setVisible(true);
2767
+// centralPanel.setVisible(false);
2768
+// XYZPanel.setVisible(false);
2769
+ bigThree.ClearUI();
2770
+ bigThree.add(scenePanel);
2771
+ bigThree.FlushUI();
27752772 } else
2776
- if (event.getSource() == sixButton)
2773
+ if (source == sixButton)
27772774 {
27782775 radio.layout = sixButton;
2779
- bigThree.remove(scenePanel);
2780
- bigThree.remove(centralPanel);
2781
- bigThree.remove(XYZPanel);
2782
- aWindowConstraints.gridx = 0;
2783
- aWindowConstraints.gridy = 0;
2784
- aWindowConstraints.gridwidth = 1;
2785
- // aConstraints.gridheight = 3;
2786
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2787
- aWindowConstraints.weightx = 0;
2788
- aWindowConstraints.weighty = 1;
2789
- bigThree.add(scenePanel, aWindowConstraints);
2790
- aWindowConstraints.weightx = 1;
2791
- aWindowConstraints.gridwidth = 3;
2792
- // aWindowConstraints.gridheight = 3;
2793
- aWindowConstraints.gridx = 1;
2794
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2795
- bigThree.add(centralPanel, aWindowConstraints);
2796
- aWindowConstraints.weightx = 0;
2797
- aWindowConstraints.gridx = 4;
2798
- aWindowConstraints.gridwidth = 1;
2799
- // aWindowConstraints.gridheight = 3;
2800
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2801
- //bigThree.add(XYZPanel, aConstraints);
2802
- bigThree.revalidate();
2776
+
2777
+// bigThree.remove(scenePanel);
2778
+// bigThree.remove(centralPanel);
2779
+// bigThree.remove(XYZPanel);
2780
+// aWindowConstraints.gridx = 0;
2781
+// aWindowConstraints.gridy = 0;
2782
+// aWindowConstraints.gridwidth = 1;
2783
+// // aConstraints.gridheight = 3;
2784
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2785
+// aWindowConstraints.weightx = 0;
2786
+// aWindowConstraints.weighty = 1;
2787
+// bigThree.add(scenePanel, aWindowConstraints);
2788
+// aWindowConstraints.weightx = 1;
2789
+// aWindowConstraints.gridwidth = 3;
2790
+// // aWindowConstraints.gridheight = 3;
2791
+// aWindowConstraints.gridx = 1;
2792
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2793
+// bigThree.add(centralPanel, aWindowConstraints);
2794
+// aWindowConstraints.weightx = 0;
2795
+// aWindowConstraints.gridx = 4;
2796
+// aWindowConstraints.gridwidth = 1;
2797
+// // aWindowConstraints.gridheight = 3;
2798
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2799
+// //bigThree.add(XYZPanel, aConstraints);
2800
+// bigThree.validate();
2801
+// scenePanel.setVisible(true);
2802
+// centralPanel.setVisible(true);
2803
+// XYZPanel.setVisible(false);
2804
+ bigThree.ClearUI();
2805
+ bigThree.add(scenePanel);
2806
+ bigThree.add(centralPanel);
2807
+ bigThree.FlushUI();
28032808 } else
2804
- if (event.getSource() == sevenButton)
2809
+ if (source == sevenButton)
28052810 {
28062811 radio.layout = sevenButton;
2807
- bigThree.remove(scenePanel);
2808
- bigThree.remove(centralPanel);
2809
- bigThree.remove(XYZPanel);
2810
- aWindowConstraints.gridx = 0;
2811
- aWindowConstraints.gridy = 0;
2812
- aWindowConstraints.gridwidth = 1;
2813
- // aWindowConstraints.gridheight = 3;
2814
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2815
- aWindowConstraints.weightx = 0;
2816
- aWindowConstraints.weighty = 1;
2817
- bigThree.add(scenePanel, aWindowConstraints);
2818
- aWindowConstraints.weightx = 1;
2819
- aWindowConstraints.gridwidth = 3;
2820
- // aWindowConstraints.gridheight = 3;
2821
- aWindowConstraints.gridx = 1;
2822
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2823
- bigThree.add(centralPanel, aWindowConstraints);
2824
- aWindowConstraints.weightx = 0;
2825
- aWindowConstraints.gridx = 4;
2826
- aWindowConstraints.gridwidth = 1;
2827
- // aConstraints.gridheight = 3;
2828
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2829
- bigThree.add(XYZPanel, aWindowConstraints);
2830
- bigThree.revalidate();
2812
+
2813
+// bigThree.remove(scenePanel);
2814
+// bigThree.remove(centralPanel);
2815
+// bigThree.remove(XYZPanel);
2816
+// aWindowConstraints.gridx = 0;
2817
+// aWindowConstraints.gridy = 0;
2818
+// aWindowConstraints.gridwidth = 1;
2819
+// // aWindowConstraints.gridheight = 3;
2820
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2821
+// aWindowConstraints.weightx = 0;
2822
+// aWindowConstraints.weighty = 1;
2823
+// bigThree.add(scenePanel, aWindowConstraints);
2824
+// aWindowConstraints.weightx = 1;
2825
+// aWindowConstraints.gridwidth = 3;
2826
+// // aWindowConstraints.gridheight = 3;
2827
+// aWindowConstraints.gridx = 1;
2828
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2829
+// bigThree.add(centralPanel, aWindowConstraints);
2830
+// aWindowConstraints.weightx = 0;
2831
+// aWindowConstraints.gridx = 4;
2832
+// aWindowConstraints.gridwidth = 1;
2833
+// // aConstraints.gridheight = 3;
2834
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2835
+// bigThree.add(XYZPanel, aWindowConstraints);
2836
+// bigThree.validate();
2837
+// scenePanel.setVisible(true);
2838
+// centralPanel.setVisible(true);
2839
+// XYZPanel.setVisible(true);
2840
+ bigThree.ClearUI();
2841
+ bigThree.add(scenePanel);
2842
+ bigThree.add(centralPanel);
2843
+ bigThree.add(XYZPanel);
2844
+ bigThree.FlushUI();
28312845 } else
2832
- if (event.getSource() == rootButton)
2846
+ if (source == rootButton)
28332847 {
28342848 Object3D obj;
28352849 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2841,7 +2855,7 @@
28412855
28422856 refreshContents(true);
28432857 } else
2844
- if (event.getSource() == closeButton)
2858
+ if (source == closeButton)
28452859 {
28462860 //System.out.println("CLOSE: " + buttonGroup.getSelection());
28472861 cRadio ab;
....@@ -2862,11 +2876,11 @@
28622876 }
28632877 refreshContents(true);
28642878 } else
2865
- if (event.getSource() == editItem || event.getSource() == editButton)
2879
+ if (source == editItem || source == editButton)
28662880 {
28672881 EditSelection(false);
28682882 } else
2869
- if (event.getSource() == uneditButton)
2883
+ if (source == uneditButton)
28702884 {
28712885 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28722886 {
....@@ -2878,12 +2892,12 @@
28782892
28792893 child.editWindow = null; // ???????????
28802894 }
2881
- objEditor.ctrlPanel.revalidate();
2895
+ objEditor.ctrlPanel.validate();
28822896 //objEditor.jTree.clearSelection();
28832897 //objEditor.ResetSliders();
28842898 refreshContents(true);
28852899 } else
2886
- if (event.getSource() == clearPanelButton)
2900
+ if (source == clearPanelButton)
28872901 {
28882902 assert(copy == group);
28892903 //copy.ClearUI();
....@@ -2894,7 +2908,7 @@
28942908 listUI.clear();
28952909 refreshContents(true);
28962910 } else
2897
- if (event.getSource() == allParamsButton)
2911
+ if (source == allParamsButton)
28982912 {
28992913 assert(copy == group);
29002914
....@@ -2915,19 +2929,19 @@
29152929
29162930 refreshContents(true);
29172931 } else
2918
- if (event.getSource() == unselectButton)
2932
+ if (source == unselectButton)
29192933 {
29202934 objEditor.jTree.clearSelection();
29212935 // ?? oct 2012 GrafreeD.clipboard.clear();
29222936 objEditor.ResetSliders();
29232937 refreshContents(true);
29242938 } else
2925
- if(event.getSource() instanceof cRadio)
2939
+ if(source instanceof cRadio)
29262940 {
29272941 group.parent = keepparent;
29282942 group.attributes = 0;
29292943 //group.editWindow = null;
2930
- /*cRadio*/ radio = (cRadio)event.getSource();
2944
+ /*cRadio*/ radio = (cRadio)source;
29312945 Object3D obj = radio.GetObject();
29322946 System.out.println("Edit " + obj);
29332947 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -4086,12 +4100,12 @@
40864100 System.err.println("info : " + child.GetPath());
40874101 }
40884102 }
4089
- else
4090
- {
4091
- objEditor.SetMaterial(group); // .GetMaterial());
4092
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4093
- System.err.println("info : " + group.GetPath());
4094
- }
4103
+// else
4104
+// {
4105
+// objEditor.SetMaterial(group); // .GetMaterial());
4106
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4107
+// System.err.println("info : " + group.GetPath());
4108
+// }
40954109
40964110 objEditor.SetText(); // jan 2014
40974111