Normand Briere
2019-05-01 b1585b5b2b60c4165be400636c787fae24428c6a
GroupEditor.java
....@@ -12,6 +12,7 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
....@@ -433,84 +434,26 @@
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", CameraPane.isLIVE()), oe.aConstraints);
439
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
440
+ liveCB.setToolTipText("Enabled animation");
441441 liveCB.addItemListener(this);
442442
443
- oe.aConstraints.gridx += 1;
444
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
445
- supportCB.addItemListener(this);
446
-
447
- // oe.aConstraints.gridx += 1;
448
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
449
- // localCB.addItemListener(this);
450
-
451
- oe.aConstraints.gridx += 1;
452
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
453
- crowdCB.addItemListener(this);
454
-
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
457
- smoothCB.addItemListener(this);
458
-
459
- oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
461
- fastCB.addItemListener(this);
462
- oe.aConstraints.gridx += 1;
463
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
464
- slowCB.addItemListener(this);
465
- oe.aConstraints.gridx += 1;
466
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
467
- boxCB.addItemListener(this);
468
-
469
-// oe.aConstraints.gridx += 1;
470
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
471
-// speakerMocapCB.addItemListener(this);
472
-
473
- if (false)
474
- {
475
- // handled in scripts
476
- oe.aConstraints.gridx += 1;
477
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
478
- speakerCameraCB.addItemListener(this);
479
-
480
- oe.aConstraints.gridx += 1;
481
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
482
- speakerFocusCB.addItemListener(this);
483
-
484
- oe.aConstraints.gridx += 1;
485
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
486
- smoothfocusCB.addItemListener(this);
487
- }
488
-
489
-//oe.aConstraints.gridx += 1;
490
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
491
-// debugCB.addItemListener(this);
492
-
493
- oe.aConstraints.gridx += 1;
494
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
495
- oeilCB.addItemListener(this);
496
-
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
499
- lookAtCB.addItemListener(this);
500
-
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
443
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
444
+ trackCB.setToolTipText("Enable tracking");
503445 trackCB.addItemListener(this);
504446
505
- oe.aConstraints.gridx += 1;
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
447
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
448
+ screenfitButton.setToolTipText("Screen fit");
507449 screenfitButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
450
+
509451 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
510452 // screenfitpointButton.addActionListener(this);
511453 // oe.aConstraints.gridx += 1;
512
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
454
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
513455 snapobjectButton.addActionListener(this);
456
+ snapobjectButton.setToolTipText("Snap Object");
514457 oe.aConstraints.gridx += 1;
515458
516459 //aConstraints.gridx = 0;
....@@ -518,65 +461,66 @@
518461 oe.aConstraints.weighty = 0;
519462 oe.aConstraints.gridwidth = 1;
520463
521
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
464
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
465
+ flashSelectionButton.setToolTipText("Show selection");
522466 flashSelectionButton.addActionListener(this);
523
- oe.aConstraints.gridx += 1;
524
- oe.aConstraints.weighty = 0;
525
- oe.aConstraints.gridwidth = 1;
526467
527
- //
528
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
468
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
469
+
470
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
471
+ twoButton.setToolTipText("Show center view only");
529472 twoButton.addActionListener(this);
530
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
473
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
531474 fourButton.addActionListener(this);
532
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
475
+ fourButton.setToolTipText("Show left panel only");
476
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
477
+ sixButton.setToolTipText("2-column layout left");
533478 sixButton.addActionListener(this);
534
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
479
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
480
+ threeButton.setToolTipText("2-column layout right");
535481 threeButton.addActionListener(this);
536
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
482
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
483
+ sevenButton.setToolTipText("3-column layout");
537484 sevenButton.addActionListener(this);
538485 //
539486
540
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
487
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
488
+ rootButton.setToolTipText("Edit selection in new tab");
541489 rootButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
490
+
491
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
492
+ closeButton.setToolTipText("Close tab");
544493 closeButton.addActionListener(this);
545494 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
546495 //clearButton.addActionListener(this);
547
- oe.aConstraints.gridx += 1;
548496
549
- oe.aConstraints.gridx = 1; //
550
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
497
+ cGridBag commandsPanel = new cGridBag();
498
+
499
+ commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
500
+ editButton.setToolTipText("Edit selection");
551501 editButton.addActionListener(this);
552
- oe.aConstraints.gridx += 1;
553
- oe.aConstraints.weighty = 0;
554
- oe.aConstraints.gridwidth = 1;
555502
556
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
503
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
504
+ uneditButton.setToolTipText("Unedit selection");
557505 uneditButton.addActionListener(this);
558506
559
- oe.aConstraints.gridx += 1;
560
- oe.aConstraints.weighty = 0;
561
- oe.aConstraints.gridwidth = 1;
562
-
563
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
507
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
508
+ clearPanelButton.setToolTipText("Clear edit panel");
564509 clearPanelButton.addActionListener(this);
565510
566
- oe.aConstraints.gridx += 1;
567
- oe.aConstraints.weighty = 0;
568
- oe.aConstraints.gridwidth = 1;
569
-
570
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
511
+ commandsPanel.add(allParamsButton = new cButton("A", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
512
+ allParamsButton.setToolTipText("All params??");
571513 allParamsButton.addActionListener(this);
572514
573
- oe.aConstraints.gridx += 1;
574
- oe.aConstraints.weighty = 0;
575
- oe.aConstraints.gridwidth = 1;
576
-
577
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
515
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
516
+ unselectButton.setToolTipText("Unselect");
578517 unselectButton.addActionListener(this);
579518
519
+ commandsPanel.preferredHeight = 1;
520
+
521
+ oe.treePanel.add(commandsPanel);
522
+ oe.treePanel.Return();
523
+
580524 // oe.aConstraints.gridx += 1;
581525 // oe.aConstraints.weighty = 0;
582526 // oe.aConstraints.gridwidth = 1;
....@@ -588,40 +532,37 @@
588532 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
589533 // gcButton.addActionListener(this);
590534
591
- oe.aConstraints.gridx = 0;
592
- oe.aConstraints.gridy += 1;
593
-
594
- //ctrlPanel.add(objList = new List(5, true));
595
- oe.aConstraints.gridwidth = 100;
596
- // oe.aConstraints.gridheight = 100;
597
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
598
- oe.aConstraints.gridheight = 1;
599
- oe.aConstraints.weighty = 0.5;
600
- oe.aConstraints.gridx = 0;
601
- JScrollPane jSP;
535
+ cGridBag jSPPanel = new cGridBag();
536
+
537
+ JScrollPane jSP;
602538 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
603
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
539
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
604540 ResetModel();
605
- oe.aConstraints.weighty = 0.5;
606
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
607
- oe.aConstraints.gridy += 1;
608
- oe.aConstraints.gridwidth = 1;
541
+
542
+ oe.treePanel.add(jSPPanel);
543
+ oe.treePanel.Return();
609544
610
- oe.aConstraints.weighty = 0;
611
- oe.aConstraints.gridwidth = 2;
612
-
613
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
545
+ cGridBag copyOptionsPanel = new cGridBag();
546
+
547
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
548
+ colorCB.setToolTipText("Copy color when dropped");
614549 colorCB.addItemListener(this);
615
- oe.aConstraints.gridx += 2;
616
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
550
+
551
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
552
+ materialCB.setToolTipText("Copy material when dropped");
617553 materialCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
554
+
555
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
556
+ textureCB.setToolTipText("Copy texture when dropped");
620557 textureCB.addItemListener(this);
621558
622
- oe.aConstraints.gridx = 0;
623
- oe.aConstraints.gridy += 1;
559
+ copyOptionsPanel.preferredHeight = 1;
560
+ oe.treePanel.add(copyOptionsPanel);
561
+ oe.treePanel.Return();
624562
563
+// mainPanel.setDividerLocation(0.5); //1.0);
564
+// mainPanel.setResizeWeight(0.5);
565
+
625566 //jList.addListSelectionListener(this);
626567 oe.jTree.addTreeSelectionListener(this);
627568 //jTree.setRootVisible(false);
....@@ -643,17 +584,97 @@
643584 radio.layout = sevenButton;
644585 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
645586 }
587
+
588
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
589
+ {
590
+ //constraints.gridx = 0;
591
+ //constraints.gridy = 0;
592
+ panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
593
+ fastCB.setToolTipText("Fast mode");
594
+ fastCB.addItemListener(this);
595
+ //constraints.gridy += 1;
596
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
597
+ supportCB.setToolTipText("Enabled rigging");
598
+ supportCB.addItemListener(this);
599
+
600
+ // constraints.gridy += 1;
601
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
602
+ // localCB.addItemListener(this);
603
+
604
+ //constraints.gridy += 1;
605
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
606
+ crowdCB.setToolTipText("Used for crowds");
607
+ crowdCB.addItemListener(this);
608
+
609
+ //constraints.gridy += 1;
610
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
611
+ smoothCB.setToolTipText("Snapping delay");
612
+ smoothCB.addItemListener(this);
613
+
614
+ //constraints.gridy += 1;
615
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
616
+ slowCB.setToolTipText("Smooth interpolation");
617
+ slowCB.addItemListener(this);
618
+ //constraints.gridy += 1;
619
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
620
+ boxCB.setToolTipText("Display bounding boxes");
621
+ boxCB.addItemListener(this);
622
+ //constraints.gridy += 1;
623
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
624
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
625
+ zoomBoxCB.addItemListener(this);
626
+
627
+// constraints.gridy += 1;
628
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
629
+// speakerMocapCB.addItemListener(this);
630
+
631
+ if (false)
632
+ {
633
+ // handled in scripts
634
+ //constraints.gridy += 1;
635
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
636
+ speakerCameraCB.addItemListener(this);
637
+
638
+ //constraints.gridy += 1;
639
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
640
+ speakerFocusCB.addItemListener(this);
641
+
642
+ //constraints.gridy += 1;
643
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
644
+ smoothfocusCB.addItemListener(this);
645
+ }
646
+
647
+//constraints.gridx += 1;
648
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
649
+// debugCB.addItemListener(this);
650
+
651
+ //constraints.gridy += 1;
652
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
653
+ oeilCB.addItemListener(this);
654
+
655
+ //constraints.gridy += 1;
656
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
657
+ lookAtCB.setToolTipText("Look-at target");
658
+ lookAtCB.addItemListener(this);
659
+
660
+ cGridBag fill = new cGridBag();
661
+
662
+ fill.preferredHeight = 200;
663
+
664
+ panel.add(fill);
665
+
666
+ }
646667
647668 void EditObject(Object3D obj)
648669 {
649
- cRadio dummyButton = new cRadio(obj.name);
650
- dummyButton.SetObject(obj);
651
- dummyButton.layout = sevenButton;
652
- dummyButton.SetCamera(cameraView.renderCamera, false);
653
- dummyButton.addActionListener(this);
654
- radioPanel.add(dummyButton);
655
- buttonGroup.add(dummyButton);
656
- dummyButton.doClick();
670
+ cRadio radioButton = new cRadio(obj.name);
671
+ radioButton.SetObject(obj);
672
+ radioButton.layout = sevenButton;
673
+ radioButton.SetCamera(cameraView.renderCamera, false);
674
+ radioButton.addActionListener(this);
675
+ radioPanel.add(radioButton);
676
+ buttonGroup.add(radioButton);
677
+ radioButton.doClick();
657678 }
658679 void SetupViews(ObjEditor oe)
659680 {
....@@ -673,6 +694,7 @@
673694 JCheckBox fastCB;
674695 JCheckBox slowCB;
675696 JCheckBox boxCB;
697
+ JCheckBox zoomBoxCB;
676698 JCheckBox trackCB;
677699 JCheckBox smoothfocusCB;
678700 // JCheckBox speakerMocapCB;
....@@ -715,8 +737,7 @@
715737 dropAttributes |= Object3D.TEXTURE;
716738 else
717739 dropAttributes &= ~Object3D.TEXTURE;
718
- }
719
- else if(e.getSource() == liveCB)
740
+ } else if(e.getSource() == liveCB)
720741 {
721742 cameraView.ToggleLive();
722743 }
....@@ -753,6 +774,10 @@
753774 Recompile();
754775 cameraView.repaint();
755776 // refreshContents();
777
+ }
778
+ else if(e.getSource() == zoomBoxCB)
779
+ {
780
+ cameraView.ToggleZoomBoxMode();
756781 }
757782 else if(e.getSource() == smoothfocusCB)
758783 {
....@@ -1118,6 +1143,8 @@
11181143 resetParentItem.addActionListener(this);
11191144 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11201145 repairParentItem.addActionListener(this);
1146
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1147
+ repairShadowItem.addActionListener(this);
11211148 menu.add(invariantsItem = new MenuItem("Invariants"));
11221149 invariantsItem.addActionListener(this);
11231150 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1478,6 +1505,7 @@
14781505 //
14791506 public void actionPerformed(ActionEvent event) // , Object arg)
14801507 {
1508
+ Object source = event.getSource();
14811509 /*
14821510 if (event.getSource() == nameField)
14831511 {
....@@ -1489,11 +1517,11 @@
14891517 }
14901518 else
14911519 */
1492
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1520
+ if (source == lookAtItem || source == lookFromItem)
14931521 {
14941522 ScreenFit();
14951523 } else
1496
- if (event.getSource() == switchItem)
1524
+ if (source == switchItem)
14971525 {
14981526 cVector v1 = new cVector();
14991527 cVector v2 = new cVector();
....@@ -1502,11 +1530,11 @@
15021530 objEditor.cameraView.renderCamera.setAim(v2, v1);
15031531 objEditor.cameraView.repaint();
15041532 } else
1505
- if (event.getSource() == rectoidItem)
1533
+ if (source == rectoidItem)
15061534 {
15071535 makeSomething(new Box());
15081536 } else
1509
- if (event.getSource() == particleItem)
1537
+ if (source == particleItem)
15101538 {
15111539 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15121540 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1527,9 +1555,9 @@
15271555 applyExample(particleGeom, "SMOKE");
15281556 makeSomething(particleGeom);
15291557 } else
1530
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1558
+ if (source == ragdollItem || source == ragdoll2Item)
15311559 {
1532
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1560
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15331561
15341562 ragdoll.toParent = LA.newMatrix();
15351563 ragdoll.fromParent = LA.newMatrix();
....@@ -1547,7 +1575,7 @@
15471575 } else
15481576 /*
15491577 */
1550
- if (event.getSource() == heightFieldItem)
1578
+ if (source == heightFieldItem)
15511579 {
15521580 Object3D obj = new Object3D();
15531581
....@@ -1585,31 +1613,31 @@
15851613
15861614 makeSomething(obj);
15871615 } else
1588
- if (event.getSource() == gridItem)
1616
+ if (source == gridItem)
15891617 {
15901618 makeSomething(new Grid());
15911619 } else
1592
- if (event.getSource() == ellipsoidItem)
1620
+ if (source == ellipsoidItem)
15931621 {
15941622 makeSomething(new Sphere());
15951623 } else
1596
- if (event.getSource() == coneItem)
1624
+ if (source == coneItem)
15971625 {
15981626 makeSomething(new Cone());
15991627 } else
1600
- if (event.getSource() == torusItem)
1628
+ if (source == torusItem)
16011629 {
16021630 makeSomething(new Torus());
16031631 } else
1604
- if (event.getSource() == superItem)
1632
+ if (source == superItem)
16051633 {
16061634 makeSomething(new Superellipsoid());
16071635 } else
1608
- if (event.getSource() == kleinItem)
1636
+ if (source == kleinItem)
16091637 {
16101638 makeSomething(new Klein());
16111639 } else
1612
- if (event.getSource() == blobItem)
1640
+ if (source == blobItem)
16131641 {
16141642 Blob blob = new Blob();
16151643 BlobComponent comp = new BlobComponent();
....@@ -1617,15 +1645,15 @@
16171645 //blob.retile();
16181646 makeSomething(blob);
16191647 } else
1620
- if (event.getSource() == latheItem)
1648
+ if (source == latheItem)
16211649 {
16221650 makeSomething(new Lathe());
16231651 } else
1624
- if (event.getSource() == bezierItem)
1652
+ if (source == bezierItem)
16251653 {
16261654 makeSomething(new BezierSurface());
16271655 } else
1628
- if (event.getSource() == checkerItem)
1656
+ if (source == checkerItem)
16291657 {
16301658 /*
16311659 Object3D obj = new BezierSurface(5,8);
....@@ -1640,7 +1668,7 @@
16401668 */
16411669 makeSomething(new Checker());
16421670 } else
1643
- if (event.getSource() == meshItem)
1671
+ if (source == meshItem)
16441672 {
16451673 Object3D itemtomake = new Object3D();
16461674 Object3D child;
....@@ -1661,35 +1689,35 @@
16611689 makeSomething(child);
16621690 }
16631691 } else
1664
- if (event.getSource() == springItem)
1692
+ if (source == springItem)
16651693 {
16661694 cSpring s = new cSpring();
16671695 s.setup();
16681696 makeSomething(s);
16691697 } else
1670
- if (event.getSource() == flagItem)
1698
+ if (source == flagItem)
16711699 {
16721700 cSpring s = new cFlag();
16731701 s.setup();
16741702 makeSomething(s);
16751703 } else
1676
- if (event.getSource() == lightItem)
1704
+ if (source == lightItem)
16771705 {
16781706 makeSomething(new Light());
16791707 } else
1680
- if (event.getSource() == csgItem)
1708
+ if (source == csgItem)
16811709 {
16821710 group(new CSG());
16831711 } else
1684
- if (event.getSource() == templateItem)
1712
+ if (source == templateItem)
16851713 {
16861714 group(new cTemplate());
16871715 } else
1688
- if (event.getSource() == attributeItem)
1716
+ if (source == attributeItem)
16891717 {
16901718 makeSomething(new Attribute());
16911719 } else
1692
- if (event.getSource() == pointflowItem)
1720
+ if (source == pointflowItem)
16931721 {
16941722 makeSomething(new PointFlow());
16951723 } else
....@@ -1701,7 +1729,7 @@
17011729 } else
17021730 */
17031731
1704
- if (event.getSource() == superLoopItem)
1732
+ if (source == superLoopItem)
17051733 {
17061734 Composite g = new cGroup();
17071735 for (int i=0; i<15; i++)
....@@ -1723,7 +1751,7 @@
17231751
17241752 group(g);
17251753 } else
1726
- if (event.getSource() == loopItem)
1754
+ if (source == loopItem)
17271755 {
17281756 Composite csg = new GroupLeaf();
17291757 csg.count = 5;
....@@ -1732,7 +1760,7 @@
17321760 csg.addChild(child);
17331761 child.addChild(csg);
17341762 } else
1735
- if (event.getSource() == doubleItem)
1763
+ if (source == doubleItem)
17361764 {
17371765 Composite csg = new GroupLeaf();
17381766 csg.count = 5;
....@@ -1744,7 +1772,7 @@
17441772 csg.addChild(child);
17451773 child.addChild(csg);
17461774 } else
1747
- if (event.getSource() == tripleItem)
1775
+ if (source == tripleItem)
17481776 {
17491777 Composite csg = new GroupLeaf();
17501778 csg.count = 4;
....@@ -1760,70 +1788,70 @@
17601788 child.addChild(csg);
17611789 } else
17621790
1763
- if (event.getSource() == importGFDItem)
1791
+ if (source == importGFDItem)
17641792 {
17651793 ImportGFD();
17661794 } else
1767
- if (event.getSource() == importVRMLX3DItem)
1795
+ if (source == importVRMLX3DItem)
17681796 {
17691797 ImportVRMLX3D();
17701798 } else
1771
- if (event.getSource() == import3DSItem)
1799
+ if (source == import3DSItem)
17721800 {
17731801 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17741802 } else
1775
- if (event.getSource() == importOBJItem)
1803
+ if (source == importOBJItem)
17761804 {
17771805 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
17781806 } else
1779
- if (event.getSource() == computeAOItem)
1807
+ if (source == computeAOItem)
17801808 {
1781
- CameraPane.drawMode = CameraPane.OCCLUSION;
1782
- CameraPane.theRenderer.repaint();
1809
+ Globals.drawMode = CameraPane.OCCLUSION;
1810
+ Globals.theRenderer.repaint();
17831811 } else
1784
- if (event.getSource() == recompileItem)
1812
+ if (source == recompileItem)
17851813 {
17861814 Recompile();
17871815 refreshContents();
17881816 } else
1789
- if (event.getSource() == editScriptItem)
1817
+ if (source == editScriptItem)
17901818 {
17911819 OpenDialog();
17921820 refreshContents();
17931821 } else
1794
- if (event.getSource() == invariantsItem)
1822
+ if (source == invariantsItem)
17951823 {
17961824 System.out.println("Invariants:");
1797
- GrafreeD.theApplet3D.universe.invariants();
1825
+ GrafreeD.grafreeD.universe.invariants();
17981826 } else
1799
- if (event.getSource() == memoryItem)
1827
+ if (source == memoryItem)
18001828 {
18011829 //System.out.println("Invariants:");
18021830 PrintMemory();
18031831 } else
1804
- if (event.getSource() == pathItem)
1832
+ if (source == pathItem)
18051833 {
18061834 PrintPath();
18071835 } else
1808
- if (event.getSource() == analyzeItem)
1836
+ if (source == analyzeItem)
18091837 {
18101838 AnalyzeObject();
18111839 } else
1812
- if (event.getSource() == dumpItem)
1840
+ if (source == dumpItem)
18131841 {
18141842 DumpObject();
18151843 } else
1816
- if (event.getSource() == screenfitButton)
1844
+ if (source == screenfitButton)
18171845 {
18181846 //Reload(lastConverter, lastFilename, true);
18191847 ScreenFit();
18201848 } else
1821
- if (event.getSource() == screenfitpointButton)
1849
+ if (source == screenfitpointButton)
18221850 {
18231851 //Reload(lastConverter, lastFilename, true);
18241852 ScreenFitPoint();
18251853 } else
1826
- if (event.getSource() == snapobjectButton)
1854
+ if (source == snapobjectButton)
18271855 {
18281856 //Reload(lastConverter, lastFilename, true);
18291857 SnapObject();
....@@ -1834,13 +1862,13 @@
18341862 // Recompile();
18351863 // refreshContents();
18361864 // } else
1837
- if (event.getSource() == gcButton)
1865
+ if (source == gcButton)
18381866 {
18391867 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18401868 System.gc();
18411869 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18421870 } else
1843
- if (event.getSource() == editLeafItem)
1871
+ if (source == editLeafItem)
18441872 {
18451873 Object3D obj;
18461874 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1854,62 +1882,62 @@
18541882 }
18551883 refreshContents(true);
18561884 } else
1857
- if (event.getSource() == openWindowItem)
1885
+ if (source == openWindowItem)
18581886 {
18591887 EditSelection(true);
18601888 } else
1861
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1889
+ if (source == cutItem || source == clearButton)
18621890 {
18631891 loadClipboard(true);
18641892 } else
1865
- if (event.getSource() == duplicateItem)
1893
+ if (source == duplicateItem)
18661894 {
18671895 Object3D keep = GrafreeD.clipboard;
18681896 loadClipboard(false);
18691897 paste(false);
18701898 GrafreeD.clipboard = keep;
18711899 } else
1872
- if (event.getSource() == cloneItem)
1900
+ if (source == cloneItem)
18731901 {
18741902 CloneSelection(false);
18751903 } else
1876
- if (event.getSource() == cloneSupportItem)
1904
+ if (source == cloneSupportItem)
18771905 {
18781906 CloneSelection(true);
18791907 } else
1880
- if (event.getSource() == copyItem)
1908
+ if (source == copyItem)
18811909 {
18821910 loadClipboard(false);
18831911 } else
1884
- if (event.getSource() == pasteItem)
1912
+ if (source == pasteItem)
18851913 {
18861914 paste(false);
18871915 } else
1888
- if (event.getSource() == pasteLinkItem)
1916
+ if (source == pasteLinkItem)
18891917 {
18901918 pasteInto(false);
18911919 } else
1892
- if (event.getSource() == pasteCloneItem)
1920
+ if (source == pasteCloneItem)
18931921 {
18941922 pasteInto(true);
18951923 } else
1896
- if (event.getSource() == pasteExpandItem)
1924
+ if (source == pasteExpandItem)
18971925 {
18981926 paste(true);
18991927 } else
1900
- if (event.getSource() == synchronizeItem)
1928
+ if (source == synchronizeItem)
19011929 {
19021930 Overwrite(Object3D.TRANSFORM);
19031931 } else
1904
- if (event.getSource() == overwriteNameItem)
1932
+ if (source == overwriteNameItem)
19051933 {
19061934 Overwrite(Object3D.NAME);
19071935 } else
1908
- if (event.getSource() == overwriteUVItem)
1936
+ if (source == overwriteUVItem)
19091937 {
19101938 Overwrite(Object3D.UV);
19111939 } else
1912
- if (event.getSource() == overwriteMatItem)
1940
+ if (source == overwriteMatItem)
19131941 {
19141942 /* july 2015
19151943 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1929,7 +1957,7 @@
19291957
19301958 Overwrite(dropAttributes);
19311959 }
1932
- if (event.getSource() == overwriteGeoItem)
1960
+ if (source == overwriteGeoItem)
19331961 {
19341962 Overwrite(Object3D.GEOMETRY);
19351963 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1946,7 +1974,7 @@
19461974 // refreshContents();
19471975 // }
19481976 } else
1949
- if (event.getSource() == generateMeshItem)
1977
+ if (source == generateMeshItem)
19501978 {
19511979 //if (group.selection.size() == 1)
19521980 // for (int i=0; i<group.selection.size(); i++)
....@@ -1957,7 +1985,7 @@
19571985 ResetModel();
19581986 refreshContents();
19591987 } else
1960
- if (event.getSource() == extractGeometriesItem)
1988
+ if (source == extractGeometriesItem)
19611989 {
19621990 boolean one = false;
19631991
....@@ -1984,7 +2012,7 @@
19842012 ResetModel();
19852013 refreshContents();
19862014 } else
1987
- if (event.getSource() == cloneGeometriesItem)
2015
+ if (source == cloneGeometriesItem)
19882016 {
19892017 boolean one = false;
19902018
....@@ -2010,7 +2038,7 @@
20102038 ResetModel();
20112039 refreshContents();
20122040 } else
2013
- if (event.getSource() == shareGeometriesItem)
2041
+ if (source == shareGeometriesItem)
20142042 {
20152043 boolean one = false;
20162044
....@@ -2040,7 +2068,7 @@
20402068 refreshContents();
20412069 }
20422070 } else
2043
- if (event.getSource() == mergeGeometriesItem)
2071
+ if (source == mergeGeometriesItem)
20442072 {
20452073 boolean one = false;
20462074
....@@ -2070,7 +2098,7 @@
20702098 ResetModel();
20712099 refreshContents();
20722100 } else
2073
- if (event.getSource() == linkverticesItem)
2101
+ if (source == linkverticesItem)
20742102 {
20752103 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20762104 // {
....@@ -2090,7 +2118,7 @@
20902118 if (content instanceof cGroup && ((cGroup)content).transientlink )
20912119 content = ((cGroup)content).get(0);
20922120
2093
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2121
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20942122 for (int i=0; i<group.selection.size(); i++)
20952123 {
20962124 boolean random = CameraPane.RANDOM;
....@@ -2099,11 +2127,11 @@
20992127 // group.selection.get(i).setMasterThis(content); // should be identity
21002128 CameraPane.RANDOM = random;
21012129 }
2102
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2130
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21032131 refreshContents();
21042132 }
21052133 } else
2106
- if (event.getSource() == resetsupportItem)
2134
+ if (source == resetsupportItem)
21072135 {
21082136 for (int i=0; i<group.selection.size(); i++)
21092137 {
....@@ -2115,7 +2143,7 @@
21152143
21162144 refreshContents();
21172145 } else
2118
- if (event.getSource() == relinkverticesItem)
2146
+ if (source == relinkverticesItem)
21192147 {
21202148 boolean random = CameraPane.RANDOM;
21212149 CameraPane.RANDOM = false; // parse all random nodes
....@@ -2124,7 +2152,7 @@
21242152
21252153 refreshContents();
21262154 } else
2127
- if (event.getSource() == resetreferencesItem)
2155
+ if (source == resetreferencesItem)
21282156 {
21292157 for (int i=0; i<group.selection.size(); i++)
21302158 {
....@@ -2133,7 +2161,7 @@
21332161
21342162 refreshContents();
21352163 } else
2136
- if (event.getSource() == setMasterItem)
2164
+ if (source == setMasterItem)
21372165 {
21382166 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21392167 {
....@@ -2146,7 +2174,7 @@
21462174 refreshContents();
21472175 }
21482176 } else
2149
- if (event.getSource() == poseMeshItem)
2177
+ if (source == poseMeshItem)
21502178 {
21512179 if (group.selection.size() == 1)
21522180 {
....@@ -2165,19 +2193,19 @@
21652193 }
21662194
21672195 } else
2168
- if (event.getSource() == revertMeshItem)
2196
+ if (source == revertMeshItem)
21692197 {
21702198 RevertMeshes();
21712199 } else
2172
- if (event.getSource() == resetMeshItem)
2200
+ if (source == resetMeshItem)
21732201 {
21742202 ResetAll();
21752203 } else
2176
- if (event.getSource() == stepAllItem)
2204
+ if (source == stepAllItem)
21772205 {
21782206 StepAll();
21792207 } else
2180
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2208
+ if (source == clearItem) // || event.getSource() == clearButton)
21812209 {
21822210 //int indices[] = jList.getSelectedIndices();
21832211 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2185,46 +2213,46 @@
21852213
21862214 ClearSelection(false);
21872215 } else
2188
- if (event.getSource() == clearAllItem)
2216
+ if (source == clearAllItem)
21892217 {
21902218 ClearSelection(true);
21912219 } else
2192
- if (event.getSource() == grabItem)
2220
+ if (source == grabItem)
21932221 {
21942222 group(new cGroup(), true);
21952223 } else
2196
- if (event.getSource() == hideItem)
2224
+ if (source == hideItem)
21972225 {
21982226 group(new HiddenObject());
21992227 } else
2200
- if (event.getSource() == frontItem)
2228
+ if (source == frontItem)
22012229 {
22022230 front();
22032231 } else
2204
- if (event.getSource() == backItem)
2232
+ if (source == backItem)
22052233 {
22062234 back();
22072235 } else
2208
- if (event.getSource() == cameraItem)
2236
+ if (source == cameraItem)
22092237 {
22102238 makeSomething(new Camera());
22112239 } else
2212
- if (event.getSource() == compositeItem)
2240
+ if (source == compositeItem)
22132241 {
22142242 group(new Composite());
22152243 } else
2216
- if (event.getSource() == randomItem)
2244
+ if (source == randomItem)
22172245 {
22182246 RandomNode random = new RandomNode();
22192247 group(random);
22202248 if (random.size() > 0)
22212249 random.name = random.get(0).name + "Rnd";
22222250 } else
2223
- if (event.getSource() == physicsItem)
2251
+ if (source == physicsItem)
22242252 {
22252253 group(new PhysicsNode());
22262254 } else
2227
- if (event.getSource() == frameselectorItem)
2255
+ if (source == frameselectorItem)
22282256 {
22292257 for (int i=0; i<group.selection.size(); i++)
22302258 {
....@@ -2236,7 +2264,7 @@
22362264 ResetModel();
22372265 refreshContents();
22382266 } else
2239
- if (event.getSource() == switchGeoItem)
2267
+ if (source == switchGeoItem)
22402268 {
22412269 for (int i=0; i<group.selection.size(); i++)
22422270 {
....@@ -2248,7 +2276,7 @@
22482276 ResetModel();
22492277 refreshContents();
22502278 } else
2251
- if (event.getSource() == switchTransfoItem)
2279
+ if (source == switchTransfoItem)
22522280 {
22532281 for (int i=0; i<group.selection.size(); i++)
22542282 {
....@@ -2260,7 +2288,7 @@
22602288 ResetModel();
22612289 refreshContents();
22622290 } else
2263
- if (event.getSource() == morphItem)
2291
+ if (source == morphItem)
22642292 {
22652293 for (int i=0; i<group.selection.size(); i++)
22662294 {
....@@ -2272,7 +2300,7 @@
22722300 ResetModel();
22732301 refreshContents();
22742302 } else
2275
- if (event.getSource() == scriptNodeItem)
2303
+ if (source == scriptNodeItem)
22762304 {
22772305 boolean atleastone = false;
22782306
....@@ -2311,31 +2339,31 @@
23112339 }
23122340 }
23132341 } else
2314
- if (event.getSource() == linkerItem)
2342
+ if (source == linkerItem)
23152343 {
23162344 group(new cLinker());
23172345 } else
2318
- if (event.getSource() == textureItem)
2346
+ if (source == textureItem)
23192347 {
23202348 group(new TextureNode());
23212349 } else
2322
- if (event.getSource() == billboardItem)
2350
+ if (source == billboardItem)
23232351 {
23242352 group(new BillboardNode());
23252353 } else
2326
- if (event.getSource() == shadowXItem)
2354
+ if (source == shadowXItem)
23272355 {
23282356 CastShadow(0);
23292357 } else
2330
- if (event.getSource() == shadowYItem)
2358
+ if (source == shadowYItem)
23312359 {
23322360 CastShadow(1);
23332361 } else
2334
- if (event.getSource() == shadowZItem)
2362
+ if (source == shadowZItem)
23352363 {
23362364 CastShadow(2);
23372365 } else
2338
- if (event.getSource() == ungroupItem)
2366
+ if (source == ungroupItem)
23392367 {
23402368 //ungroup();
23412369 for (int i=0; i<group.selection.size(); i++)
....@@ -2347,179 +2375,179 @@
23472375
23482376 refreshContents();
23492377 } else
2350
- if (event.getSource() == genUVItem)
2378
+ if (source == genUVItem)
23512379 {
23522380 GenUV();
23532381 } else
2354
- if (event.getSource() == genNormalsCADItem)
2382
+ if (source == genNormalsCADItem)
23552383 {
23562384 GenNormals(true);
23572385 } else
2358
- if (event.getSource() == genNormalsMESHItem)
2386
+ if (source == genNormalsMESHItem)
23592387 {
23602388 GenNormals(true); // TODO
23612389 } else
2362
- if (event.getSource() == genNormalsORGANItem)
2390
+ if (source == genNormalsORGANItem)
23632391 {
23642392 GenNormals(false);
23652393 } else
2366
- if (event.getSource() == genNormalsMINEItem)
2394
+ if (source == genNormalsMINEItem)
23672395 {
23682396 GenNormalsMINE();
23692397 } else
2370
- if (event.getSource() == stripifyItem)
2398
+ if (source == stripifyItem)
23712399 {
23722400 Stripify();
23732401 } else
2374
- if (event.getSource() == unstripifyItem)
2402
+ if (source == unstripifyItem)
23752403 {
23762404 Unstripify();
23772405 } else
2378
- if (event.getSource() == trimItem)
2406
+ if (source == trimItem)
23792407 {
23802408 Trim();
23812409 } else
2382
- if (event.getSource() == untrimItem)
2410
+ if (source == untrimItem)
23832411 {
23842412 Untrim();
23852413 } else
2386
- if (event.getSource() == clearColorsItem)
2414
+ if (source == clearColorsItem)
23872415 {
23882416 ClearColors();
23892417 } else
2390
- if (event.getSource() == clearMaterialsItem)
2418
+ if (source == clearMaterialsItem)
23912419 {
23922420 ClearMaterials();
23932421 } else
2394
- if (event.getSource() == liveleavesItem)
2422
+ if (source == liveleavesItem)
23952423 {
23962424 LiveLeaves(true);
23972425 } else
2398
- if (event.getSource() == unliveleavesItem)
2426
+ if (source == unliveleavesItem)
23992427 {
24002428 LiveLeaves(false);
24012429 } else
2402
- if (event.getSource() == supportleavesItem)
2430
+ if (source == supportleavesItem)
24032431 {
24042432 SupportLeaves(true);
24052433 } else
2406
- if (event.getSource() == unsupportleavesItem)
2434
+ if (source == unsupportleavesItem)
24072435 {
24082436 SupportLeaves(false);
24092437 } else
2410
- if (event.getSource() == hideleavesItem)
2438
+ if (source == hideleavesItem)
24112439 {
24122440 HideLeaves(true);
24132441 } else
2414
- if (event.getSource() == showleavesItem)
2442
+ if (source == showleavesItem)
24152443 {
24162444 HideLeaves(false);
24172445 } else
2418
- if (event.getSource() == markleavesItem)
2446
+ if (source == markleavesItem)
24192447 {
24202448 MarkLeaves(true);
24212449 } else
2422
- if (event.getSource() == unmarkleavesItem)
2450
+ if (source == unmarkleavesItem)
24232451 {
24242452 MarkLeaves(false);
24252453 } else
2426
- if (event.getSource() == flipVItem)
2454
+ if (source == flipVItem)
24272455 {
24282456 FlipV(true);
24292457 } else
2430
- if (event.getSource() == unflipVItem)
2458
+ if (source == unflipVItem)
24312459 {
24322460 FlipV(false);
24332461 } else
2434
- if (event.getSource() == lowTexturesItem)
2462
+ if (source == lowTexturesItem)
24352463 {
24362464 SetTexRes(0);
24372465 } else
2438
- if (event.getSource() == normalTexturesItem)
2466
+ if (source == normalTexturesItem)
24392467 {
24402468 SetTexRes(1);
24412469 } else
2442
- if (event.getSource() == highTexturesItem)
2470
+ if (source == highTexturesItem)
24432471 {
24442472 SetTexRes(2);
24452473 } else
2446
- if (event.getSource() == veryhighTexturesItem)
2474
+ if (source == veryhighTexturesItem)
24472475 {
24482476 SetTexRes(3);
24492477 } else
2450
- if (event.getSource() == maxTexturesItem)
2478
+ if (source == maxTexturesItem)
24512479 {
24522480 SetTexRes(4);
24532481 } else
2454
- if (event.getSource() == panoTexturesItem)
2482
+ if (source == panoTexturesItem)
24552483 {
24562484 SetTexRes(5);
24572485 } else
2458
- if (event.getSource() == reverseNormalsItem)
2486
+ if (source == reverseNormalsItem)
24592487 {
24602488 ReverseNormals();
24612489 } else
2462
- if (event.getSource() == parseverticesItem)
2490
+ if (source == parseverticesItem)
24632491 {
24642492 ParseVertices();
24652493 } else
2466
- if (event.getSource() == textureFieldItem)
2494
+ if (source == textureFieldItem)
24672495 {
24682496 TextureVertices();
24692497 } else
2470
- if (event.getSource() == alignItem)
2498
+ if (source == alignItem)
24712499 {
24722500 Align();
24732501 } else
2474
- if (event.getSource() == mirrorItem)
2502
+ if (source == mirrorItem)
24752503 {
24762504 MirrorPoses();
24772505 } else
2478
- if (event.getSource() == reduceMorphItem)
2506
+ if (source == reduceMorphItem)
24792507 {
24802508 MeshReduction(false);
24812509 } else
2482
- if (event.getSource() == reduce34MorphItem)
2510
+ if (source == reduce34MorphItem)
24832511 {
24842512 MeshReduction(true);
24852513 } else
2486
- if (event.getSource() == reverseTrianglesItem)
2514
+ if (source == reverseTrianglesItem)
24872515 {
24882516 ReverseTriangles();
24892517 } else
2490
- if (event.getSource() == reduceMeshItem)
2518
+ if (source == reduceMeshItem)
24912519 {
24922520 ReduceMesh(false);
24932521 } else
2494
- if (event.getSource() == reduce34MeshItem)
2522
+ if (source == reduce34MeshItem)
24952523 {
24962524 ReduceMesh(true);
24972525 } else
2498
- if (event.getSource() == increaseMeshItem)
2526
+ if (source == increaseMeshItem)
24992527 {
25002528 IncreaseMesh();
25012529 } else
2502
- if (event.getSource() == clipMeshItem)
2530
+ if (source == clipMeshItem)
25032531 {
25042532 ClipMesh();
25052533 } else
2506
- if (event.getSource() == smoothMeshItem)
2534
+ if (source == smoothMeshItem)
25072535 {
25082536 SmoothMesh();
25092537 } else
2510
- if (event.getSource() == transformgeometryItem)
2538
+ if (source == transformgeometryItem)
25112539 {
25122540 TransformGeometry();
25132541 } else
2514
- if (event.getSource() == resetTransformItem)
2542
+ if (source == resetTransformItem)
25152543 {
25162544 ResetTransform();
25172545 } else
2518
- if (event.getSource() == resetCentroidItem)
2546
+ if (source == resetCentroidItem)
25192547 {
25202548 ResetCentroid();
25212549 } else
2522
- if (event.getSource() == resetParentItem)
2550
+ if (source == resetParentItem)
25232551 {
25242552 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25252553 {
....@@ -2529,7 +2557,7 @@
25292557
25302558 refreshContents();
25312559 } else
2532
- if (event.getSource() == repairParentItem)
2560
+ if (source == repairParentItem)
25332561 {
25342562 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25352563 {
....@@ -2543,7 +2571,21 @@
25432571
25442572 refreshContents();
25452573 } else
2546
- if (event.getSource() == sortbysizeItem)
2574
+ if (source == repairShadowItem)
2575
+ {
2576
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2577
+ {
2578
+ Object3D obj = (Object3D)e.nextElement();
2579
+ obj.RepairShadow();
2580
+// for (int i=0; i<obj.size(); i++)
2581
+// {
2582
+// obj.get(i).parent = obj;
2583
+// }
2584
+ }
2585
+
2586
+ refreshContents();
2587
+ } else
2588
+ if (source == sortbysizeItem)
25472589 {
25482590 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25492591 {
....@@ -2555,7 +2597,7 @@
25552597 ResetModel();
25562598 refreshContents();
25572599 } else
2558
- if (event.getSource() == sortbynameItem)
2600
+ if (source == sortbynameItem)
25592601 {
25602602 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25612603 {
....@@ -2567,7 +2609,7 @@
25672609 ResetModel();
25682610 refreshContents();
25692611 } else
2570
- if (event.getSource() == attachPigmentItem)
2612
+ if (source == attachPigmentItem)
25712613 {
25722614 String texture = GetFile("Attach pigment");
25732615 Object3D obj;
....@@ -2579,7 +2621,7 @@
25792621
25802622 refreshContents();
25812623 } else
2582
- if (event.getSource() == detachPigmentItem)
2624
+ if (source == detachPigmentItem)
25832625 {
25842626 Object3D obj;
25852627 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2590,7 +2632,7 @@
25902632
25912633 refreshContents();
25922634 } else
2593
- if (event.getSource() == attachBumpItem)
2635
+ if (source == attachBumpItem)
25942636 {
25952637 String texture = GetFile("Attach bump");
25962638 Object3D obj;
....@@ -2602,7 +2644,7 @@
26022644
26032645 refreshContents();
26042646 } else
2605
- if (event.getSource() == detachBumpItem)
2647
+ if (source == detachBumpItem)
26062648 {
26072649 Object3D obj;
26082650 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2613,7 +2655,7 @@
26132655
26142656 refreshContents();
26152657 } else
2616
- if (event.getSource() == pigmentBumpItem)
2658
+ if (source == pigmentBumpItem)
26172659 {
26182660 Object3D obj;
26192661 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2624,158 +2666,195 @@
26242666
26252667 refreshContents();
26262668 } else
2627
- if (event.getSource() == flashSelectionButton)
2669
+ if (source == flashSelectionButton)
26282670 {
26292671 CameraPane.flash = true;
26302672 refreshContents();
26312673 } else
2632
- if (event.getSource() == oneButton)
2674
+ if (source == oneButton)
26332675 {
26342676 } else
2635
- if (event.getSource() == twoButton)
2677
+ if (source == twoButton)
26362678 {
26372679 radio.layout = twoButton;
26382680 // bug
26392681 //gridPanel.setDividerLocation(1.0);
26402682 //bigPanel.setDividerLocation(0.0);
2641
- bigThree.remove(jtp);
2642
- bigThree.remove(cameraPanel);
2643
- bigThree.remove(XYZPanel);
2644
- aWindowConstraints.gridx = 0;
2645
- aWindowConstraints.gridy = 0;
2646
- aWindowConstraints.gridwidth = 1;
2647
- // aConstraints.gridheight = 3;
2648
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2649
- aWindowConstraints.weightx = 0;
2650
- aWindowConstraints.weighty = 1;
2651
- //bigThree.add(jtp, aWindowConstraints);
2652
- aWindowConstraints.weightx = 1;
2653
- aWindowConstraints.gridwidth = 3;
2654
- // aConstraints.gridheight = 3;
2655
- aWindowConstraints.gridx = 1;
2656
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2657
- bigThree.add(cameraPanel, aWindowConstraints);
2658
- aWindowConstraints.weightx = 0;
2659
- aWindowConstraints.gridx = 4;
2660
- aWindowConstraints.gridwidth = 1;
2661
- // aConstraints.gridheight = 3;
2662
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2663
- //bigThree.add(XYZPanel, aWindowConstraints);
2664
- bigThree.revalidate();
2683
+// bigThree.remove(scenePanel);
2684
+// bigThree.remove(centralPanel);
2685
+// bigThree.remove(XYZPanel);
2686
+// aWindowConstraints.gridx = 0;
2687
+// aWindowConstraints.gridy = 0;
2688
+// aWindowConstraints.gridwidth = 1;
2689
+// // aConstraints.gridheight = 3;
2690
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2691
+// aWindowConstraints.weightx = 0;
2692
+// aWindowConstraints.weighty = 1;
2693
+// //bigThree.add(jtp, aWindowConstraints);
2694
+// aWindowConstraints.weightx = 1;
2695
+// aWindowConstraints.gridwidth = 3;
2696
+// // aConstraints.gridheight = 3;
2697
+// aWindowConstraints.gridx = 1;
2698
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2699
+// bigThree.add(centralPanel, aWindowConstraints);
2700
+// aWindowConstraints.weightx = 0;
2701
+// aWindowConstraints.gridx = 4;
2702
+// aWindowConstraints.gridwidth = 1;
2703
+// // aConstraints.gridheight = 3;
2704
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2705
+// //bigThree.add(XYZPanel, aWindowConstraints);
2706
+// scenePanel.setVisible(false);
2707
+// centralPanel.setVisible(true);
2708
+// XYZPanel.setVisible(false);
2709
+ bigThree.ClearUI();
2710
+ bigThree.add(centralPanel);
2711
+ bigThree.FlushUI();
26652712 } else
2666
- if (event.getSource() == threeButton)
2713
+ if (source == threeButton)
26672714 {
26682715 radio.layout = threeButton;
2669
- bigThree.remove(jtp);
2670
- bigThree.remove(cameraPanel);
2671
- bigThree.remove(XYZPanel);
2672
- aWindowConstraints.gridx = 0;
2673
- aWindowConstraints.gridy = 0;
2674
- aWindowConstraints.gridwidth = 1;
2675
- // aConstraints.gridheight = 3;
2676
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2677
- aWindowConstraints.weightx = 0;
2678
- aWindowConstraints.weighty = 1;
2679
- //bigThree.add(jtp, aWindowConstraints);
2680
- aWindowConstraints.weightx = 1;
2681
- aWindowConstraints.gridwidth = 3;
2682
- // aConstraints.gridheight = 3;
2683
- aWindowConstraints.gridx = 1;
2684
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2685
- bigThree.add(cameraPanel, aWindowConstraints);
2686
- aWindowConstraints.weightx = 0;
2687
- aWindowConstraints.gridx = 4;
2688
- aWindowConstraints.gridwidth = 1;
2689
- // aConstraints.gridheight = 3;
2690
- aConstraints.fill = GridBagConstraints.VERTICAL;
2691
- bigThree.add(XYZPanel, aWindowConstraints);
2692
- bigThree.revalidate();
2716
+
2717
+// bigThree.remove(scenePanel);
2718
+// bigThree.remove(centralPanel);
2719
+// bigThree.remove(XYZPanel);
2720
+// aWindowConstraints.gridx = 0;
2721
+// aWindowConstraints.gridy = 0;
2722
+// aWindowConstraints.gridwidth = 1;
2723
+// // aConstraints.gridheight = 3;
2724
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2725
+// aWindowConstraints.weightx = 0;
2726
+// aWindowConstraints.weighty = 1;
2727
+// //bigThree.add(jtp, aWindowConstraints);
2728
+// aWindowConstraints.weightx = 1;
2729
+// aWindowConstraints.gridwidth = 3;
2730
+// // aConstraints.gridheight = 3;
2731
+// aWindowConstraints.gridx = 1;
2732
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2733
+// bigThree.add(centralPanel, aWindowConstraints);
2734
+// aWindowConstraints.weightx = 0;
2735
+// aWindowConstraints.gridx = 4;
2736
+// aWindowConstraints.gridwidth = 1;
2737
+// // aConstraints.gridheight = 3;
2738
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2739
+// bigThree.add(XYZPanel, aWindowConstraints);
2740
+// bigThree.validate();
2741
+// scenePanel.setVisible(false);
2742
+// centralPanel.setVisible(true);
2743
+// XYZPanel.setVisible(true);
2744
+ bigThree.ClearUI();
2745
+ bigThree.add(centralPanel);
2746
+ bigThree.add(XYZPanel);
2747
+ bigThree.FlushUI();
26932748 } else
2694
- if (event.getSource() == fourButton)
2749
+ if (source == fourButton)
26952750 {
26962751 radio.layout = fourButton;
2697
- bigThree.remove(jtp);
2698
- bigThree.remove(cameraPanel);
2699
- bigThree.remove(XYZPanel);
2700
- aWindowConstraints.gridx = 0;
2701
- aWindowConstraints.gridy = 0;
2702
- aWindowConstraints.gridwidth = 1;
2703
- // aWindowConstraints.gridheight = 3;
2704
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2705
- aWindowConstraints.weightx = 1;
2706
- aWindowConstraints.weighty = 1;
2707
- bigThree.add(jtp, aWindowConstraints);
2708
- aWindowConstraints.weightx = 1;
2709
- aWindowConstraints.gridwidth = 3;
2710
- // aConstraints.gridheight = 3;
2711
- aWindowConstraints.gridx = 1;
2712
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2713
- //bigThree.add(cameraPanel, aWindowConstraints);
2714
- aWindowConstraints.weightx = 0;
2715
- aWindowConstraints.gridx = 4;
2716
- aWindowConstraints.gridwidth = 1;
2717
- // aWindowConstraints.gridheight = 3;
2718
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2719
- //bigThree.add(XYZPanel, aWindowConstraints);
2720
- bigThree.revalidate();
2752
+
2753
+// bigThree.remove(scenePanel);
2754
+// bigThree.remove(centralPanel);
2755
+// bigThree.remove(XYZPanel);
2756
+// aWindowConstraints.gridx = 0;
2757
+// aWindowConstraints.gridy = 0;
2758
+// aWindowConstraints.gridwidth = 1;
2759
+// // aWindowConstraints.gridheight = 3;
2760
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2761
+// aWindowConstraints.weightx = 1;
2762
+// aWindowConstraints.weighty = 1;
2763
+// bigThree.add(scenePanel, aWindowConstraints);
2764
+// aWindowConstraints.weightx = 1;
2765
+// aWindowConstraints.gridwidth = 3;
2766
+// // aConstraints.gridheight = 3;
2767
+// aWindowConstraints.gridx = 1;
2768
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2769
+// //bigThree.add(cameraPanel, aWindowConstraints);
2770
+// aWindowConstraints.weightx = 0;
2771
+// aWindowConstraints.gridx = 4;
2772
+// aWindowConstraints.gridwidth = 1;
2773
+// // aWindowConstraints.gridheight = 3;
2774
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2775
+// //bigThree.add(XYZPanel, aWindowConstraints);
2776
+// bigThree.validate();
2777
+// scenePanel.setVisible(true);
2778
+// centralPanel.setVisible(false);
2779
+// XYZPanel.setVisible(false);
2780
+ bigThree.ClearUI();
2781
+ bigThree.add(scenePanel);
2782
+ bigThree.FlushUI();
27212783 } else
2722
- if (event.getSource() == sixButton)
2784
+ if (source == sixButton)
27232785 {
27242786 radio.layout = sixButton;
2725
- bigThree.remove(jtp);
2726
- bigThree.remove(cameraPanel);
2727
- bigThree.remove(XYZPanel);
2728
- aWindowConstraints.gridx = 0;
2729
- aWindowConstraints.gridy = 0;
2730
- aWindowConstraints.gridwidth = 1;
2731
- // aConstraints.gridheight = 3;
2732
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2733
- aWindowConstraints.weightx = 0;
2734
- aWindowConstraints.weighty = 1;
2735
- bigThree.add(jtp, aWindowConstraints);
2736
- aWindowConstraints.weightx = 1;
2737
- aWindowConstraints.gridwidth = 3;
2738
- // aWindowConstraints.gridheight = 3;
2739
- aWindowConstraints.gridx = 1;
2740
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2741
- bigThree.add(cameraPanel, aWindowConstraints);
2742
- aWindowConstraints.weightx = 0;
2743
- aWindowConstraints.gridx = 4;
2744
- aWindowConstraints.gridwidth = 1;
2745
- // aWindowConstraints.gridheight = 3;
2746
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2747
- //bigThree.add(XYZPanel, aConstraints);
2748
- bigThree.revalidate();
2787
+
2788
+// bigThree.remove(scenePanel);
2789
+// bigThree.remove(centralPanel);
2790
+// bigThree.remove(XYZPanel);
2791
+// aWindowConstraints.gridx = 0;
2792
+// aWindowConstraints.gridy = 0;
2793
+// aWindowConstraints.gridwidth = 1;
2794
+// // aConstraints.gridheight = 3;
2795
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2796
+// aWindowConstraints.weightx = 0;
2797
+// aWindowConstraints.weighty = 1;
2798
+// bigThree.add(scenePanel, aWindowConstraints);
2799
+// aWindowConstraints.weightx = 1;
2800
+// aWindowConstraints.gridwidth = 3;
2801
+// // aWindowConstraints.gridheight = 3;
2802
+// aWindowConstraints.gridx = 1;
2803
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2804
+// bigThree.add(centralPanel, aWindowConstraints);
2805
+// aWindowConstraints.weightx = 0;
2806
+// aWindowConstraints.gridx = 4;
2807
+// aWindowConstraints.gridwidth = 1;
2808
+// // aWindowConstraints.gridheight = 3;
2809
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2810
+// //bigThree.add(XYZPanel, aConstraints);
2811
+// bigThree.validate();
2812
+// scenePanel.setVisible(true);
2813
+// centralPanel.setVisible(true);
2814
+// XYZPanel.setVisible(false);
2815
+ bigThree.ClearUI();
2816
+ bigThree.add(scenePanel);
2817
+ bigThree.add(centralPanel);
2818
+ bigThree.FlushUI();
27492819 } else
2750
- if (event.getSource() == sevenButton)
2820
+ if (source == sevenButton)
27512821 {
27522822 radio.layout = sevenButton;
2753
- bigThree.remove(jtp);
2754
- bigThree.remove(cameraPanel);
2755
- bigThree.remove(XYZPanel);
2756
- aWindowConstraints.gridx = 0;
2757
- aWindowConstraints.gridy = 0;
2758
- aWindowConstraints.gridwidth = 1;
2759
- // aWindowConstraints.gridheight = 3;
2760
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2761
- aWindowConstraints.weightx = 0;
2762
- aWindowConstraints.weighty = 1;
2763
- bigThree.add(jtp, aWindowConstraints);
2764
- aWindowConstraints.weightx = 1;
2765
- aWindowConstraints.gridwidth = 3;
2766
- // aWindowConstraints.gridheight = 3;
2767
- aWindowConstraints.gridx = 1;
2768
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2769
- bigThree.add(cameraPanel, aWindowConstraints);
2770
- aWindowConstraints.weightx = 0;
2771
- aWindowConstraints.gridx = 4;
2772
- aWindowConstraints.gridwidth = 1;
2773
- // aConstraints.gridheight = 3;
2774
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2775
- bigThree.add(XYZPanel, aWindowConstraints);
2776
- bigThree.revalidate();
2823
+
2824
+// bigThree.remove(scenePanel);
2825
+// bigThree.remove(centralPanel);
2826
+// bigThree.remove(XYZPanel);
2827
+// aWindowConstraints.gridx = 0;
2828
+// aWindowConstraints.gridy = 0;
2829
+// aWindowConstraints.gridwidth = 1;
2830
+// // aWindowConstraints.gridheight = 3;
2831
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2832
+// aWindowConstraints.weightx = 0;
2833
+// aWindowConstraints.weighty = 1;
2834
+// bigThree.add(scenePanel, aWindowConstraints);
2835
+// aWindowConstraints.weightx = 1;
2836
+// aWindowConstraints.gridwidth = 3;
2837
+// // aWindowConstraints.gridheight = 3;
2838
+// aWindowConstraints.gridx = 1;
2839
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2840
+// bigThree.add(centralPanel, aWindowConstraints);
2841
+// aWindowConstraints.weightx = 0;
2842
+// aWindowConstraints.gridx = 4;
2843
+// aWindowConstraints.gridwidth = 1;
2844
+// // aConstraints.gridheight = 3;
2845
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2846
+// bigThree.add(XYZPanel, aWindowConstraints);
2847
+// bigThree.validate();
2848
+// scenePanel.setVisible(true);
2849
+// centralPanel.setVisible(true);
2850
+// XYZPanel.setVisible(true);
2851
+ bigThree.ClearUI();
2852
+ bigThree.add(scenePanel);
2853
+ bigThree.add(centralPanel);
2854
+ bigThree.add(XYZPanel);
2855
+ bigThree.FlushUI();
27772856 } else
2778
- if (event.getSource() == rootButton)
2857
+ if (source == rootButton)
27792858 {
27802859 Object3D obj;
27812860 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2787,7 +2866,7 @@
27872866
27882867 refreshContents(true);
27892868 } else
2790
- if (event.getSource() == closeButton)
2869
+ if (source == closeButton)
27912870 {
27922871 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27932872 cRadio ab;
....@@ -2808,11 +2887,11 @@
28082887 }
28092888 refreshContents(true);
28102889 } else
2811
- if (event.getSource() == editItem || event.getSource() == editButton)
2890
+ if (source == editItem || source == editButton)
28122891 {
28132892 EditSelection(false);
28142893 } else
2815
- if (event.getSource() == uneditButton)
2894
+ if (source == uneditButton)
28162895 {
28172896 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28182897 {
....@@ -2824,12 +2903,12 @@
28242903
28252904 child.editWindow = null; // ???????????
28262905 }
2827
- objEditor.ctrlPanel.revalidate();
2906
+ objEditor.ctrlPanel.validate();
28282907 //objEditor.jTree.clearSelection();
28292908 //objEditor.ResetSliders();
28302909 refreshContents(true);
28312910 } else
2832
- if (event.getSource() == clearPanelButton)
2911
+ if (source == clearPanelButton)
28332912 {
28342913 assert(copy == group);
28352914 //copy.ClearUI();
....@@ -2840,7 +2919,7 @@
28402919 listUI.clear();
28412920 refreshContents(true);
28422921 } else
2843
- if (event.getSource() == allParamsButton)
2922
+ if (source == allParamsButton)
28442923 {
28452924 assert(copy == group);
28462925
....@@ -2861,19 +2940,19 @@
28612940
28622941 refreshContents(true);
28632942 } else
2864
- if (event.getSource() == unselectButton)
2943
+ if (source == unselectButton)
28652944 {
28662945 objEditor.jTree.clearSelection();
28672946 // ?? oct 2012 GrafreeD.clipboard.clear();
28682947 objEditor.ResetSliders();
28692948 refreshContents(true);
28702949 } else
2871
- if(event.getSource() instanceof cRadio)
2950
+ if(source instanceof cRadio)
28722951 {
28732952 group.parent = keepparent;
28742953 group.attributes = 0;
28752954 //group.editWindow = null;
2876
- /*cRadio*/ radio = (cRadio)event.getSource();
2955
+ /*cRadio*/ radio = (cRadio)source;
28772956 Object3D obj = radio.GetObject();
28782957 System.out.println("Edit " + obj);
28792958 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2893,7 +2972,7 @@
28932972 }
28942973
28952974 copy = group;
2896
- //CameraPane.theRenderer.object = group;
2975
+ //Globals.theRenderer.object = group;
28972976 if(!useclient)
28982977 {
28992978 cameraView.renderCamera = radio.camera;
....@@ -2902,7 +2981,8 @@
29022981 cameraView.cameras[cameraView.cameracount] = radio.camera;
29032982 cameraView.targetLookAt.set(radio.camera.lookAt);
29042983 cameraView.object = group;
2905
- cameraView.lighttouched = true;
2984
+ //cameraView.lighttouched = true;
2985
+ Globals.lighttouched = true;
29062986 topView.object = group;
29072987 frontView.object = group;
29082988 sideView.object = group;
....@@ -2938,7 +3018,7 @@
29383018 if (useclient)
29393019 {
29403020 cameraView.object = client;
2941
- cameraView.lighttouched = true;
3021
+ Globals.lighttouched = true;
29423022 //topView.object = client;
29433023 //frontView.object = client;
29443024 //sideView.object = client;
....@@ -2946,7 +3026,7 @@
29463026 else
29473027 {
29483028 cameraView.object = group;
2949
- cameraView.lighttouched = true;
3029
+ Globals.lighttouched = true;
29503030 //topView.object = group;
29513031 //frontView.object = group;
29523032 //sideView.object = group;
....@@ -3454,7 +3534,7 @@
34543534 String pigment = Object3D.GetPigment(tex);
34553535 //String bump = Object3D.GetBump(tex);
34563536
3457
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3537
+ com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
34583538
34593539 double s = v.s;
34603540
....@@ -3755,7 +3835,7 @@
37553835 group.selection.RelinkToSupport(); // july 2014
37563836 System.out.println("DONE.");
37573837 refreshContents();
3758
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
3838
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
37593839 }
37603840
37613841 void ReduceMesh(boolean reduction34)
....@@ -4031,25 +4111,25 @@
40314111 System.err.println("info : " + child.GetPath());
40324112 }
40334113 }
4034
- else
4035
- {
4036
- objEditor.SetMaterial(group); // .GetMaterial());
4037
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4038
- System.err.println("info : " + group.GetPath());
4039
- }
4114
+// else
4115
+// {
4116
+// objEditor.SetMaterial(group); // .GetMaterial());
4117
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4118
+// System.err.println("info : " + group.GetPath());
4119
+// }
40404120
40414121 objEditor.SetText(); // jan 2014
40424122
4043
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4123
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
40444124 CameraPane.flash = true;
40454125
40464126 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
40474127 // a camera
40484128 {
40494129 CameraPane.camerachangeframe = 0; // don't refuse it
4050
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4051
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
4052
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4130
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4131
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4132
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40534133 }
40544134
40554135 refreshContents();
....@@ -5007,6 +5087,7 @@
50075087
50085088 private MenuItem resetParentItem;
50095089 private MenuItem repairParentItem;
5090
+ private MenuItem repairShadowItem;
50105091 private MenuItem sortbysizeItem;
50115092 private MenuItem sortbynameItem;
50125093