Normand Briere
2019-05-01 20c1a07b76c39462594aedfedfe6e6adb17cd552
GroupEditor.java
....@@ -12,6 +12,7 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
....@@ -433,84 +434,30 @@
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);
443
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
444
+ fastCB.setToolTipText("Fast mode");
461445 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);
446
+
447
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
448
+ trackCB.setToolTipText("Enable tracking");
503449 trackCB.addItemListener(this);
504450
505
- oe.aConstraints.gridx += 1;
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
451
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
452
+ screenfitButton.setToolTipText("Screen fit");
507453 screenfitButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
454
+
509455 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
510456 // screenfitpointButton.addActionListener(this);
511457 // oe.aConstraints.gridx += 1;
512
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
458
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
513459 snapobjectButton.addActionListener(this);
460
+ snapobjectButton.setToolTipText("Snap Object");
514461 oe.aConstraints.gridx += 1;
515462
516463 //aConstraints.gridx = 0;
....@@ -518,65 +465,66 @@
518465 oe.aConstraints.weighty = 0;
519466 oe.aConstraints.gridwidth = 1;
520467
521
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
468
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
469
+ flashSelectionButton.setToolTipText("Show selection");
522470 flashSelectionButton.addActionListener(this);
523
- oe.aConstraints.gridx += 1;
524
- oe.aConstraints.weighty = 0;
525
- oe.aConstraints.gridwidth = 1;
526471
527
- //
528
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
472
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
473
+
474
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
475
+ twoButton.setToolTipText("Show center view only");
529476 twoButton.addActionListener(this);
530
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
477
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
531478 fourButton.addActionListener(this);
532
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
479
+ fourButton.setToolTipText("Show left panel only");
480
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
481
+ sixButton.setToolTipText("2-column layout left");
533482 sixButton.addActionListener(this);
534
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
483
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
484
+ threeButton.setToolTipText("2-column layout right");
535485 threeButton.addActionListener(this);
536
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
486
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
487
+ sevenButton.setToolTipText("3-column layout");
537488 sevenButton.addActionListener(this);
538489 //
539490
540
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
491
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
492
+ rootButton.setToolTipText("Edit selection in new tab");
541493 rootButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
494
+
495
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
496
+ closeButton.setToolTipText("Close tab");
544497 closeButton.addActionListener(this);
545498 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
546499 //clearButton.addActionListener(this);
547
- oe.aConstraints.gridx += 1;
548500
549
- oe.aConstraints.gridx = 1; //
550
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
501
+ cGridBag commandsPanel = new cGridBag();
502
+
503
+ commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
504
+ editButton.setToolTipText("Edit selection");
551505 editButton.addActionListener(this);
552
- oe.aConstraints.gridx += 1;
553
- oe.aConstraints.weighty = 0;
554
- oe.aConstraints.gridwidth = 1;
555506
556
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
507
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
508
+ uneditButton.setToolTipText("Unedit selection");
557509 uneditButton.addActionListener(this);
558510
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);
511
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
512
+ clearPanelButton.setToolTipText("Clear edit panel");
564513 clearPanelButton.addActionListener(this);
565514
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);
515
+ commandsPanel.add(allParamsButton = new cButton("A", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
516
+ allParamsButton.setToolTipText("All params??");
571517 allParamsButton.addActionListener(this);
572518
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);
519
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
520
+ unselectButton.setToolTipText("Unselect");
578521 unselectButton.addActionListener(this);
579522
523
+ commandsPanel.preferredHeight = 1;
524
+
525
+ oe.treePanel.add(commandsPanel);
526
+ oe.treePanel.Return();
527
+
580528 // oe.aConstraints.gridx += 1;
581529 // oe.aConstraints.weighty = 0;
582530 // oe.aConstraints.gridwidth = 1;
....@@ -588,40 +536,37 @@
588536 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
589537 // gcButton.addActionListener(this);
590538
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;
539
+ cGridBag jSPPanel = new cGridBag();
540
+
541
+ JScrollPane jSP;
602542 //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);
543
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
604544 ResetModel();
605
- oe.aConstraints.weighty = 0.5;
606
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
607
- oe.aConstraints.gridy += 1;
608
- oe.aConstraints.gridwidth = 1;
545
+
546
+ oe.treePanel.add(jSPPanel);
547
+ oe.treePanel.Return();
609548
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);
549
+ cGridBag copyOptionsPanel = new cGridBag();
550
+
551
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
552
+ colorCB.setToolTipText("Copy color when dropped");
614553 colorCB.addItemListener(this);
615
- oe.aConstraints.gridx += 2;
616
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
554
+
555
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
556
+ materialCB.setToolTipText("Copy material when dropped");
617557 materialCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
558
+
559
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
560
+ textureCB.setToolTipText("Copy texture when dropped");
620561 textureCB.addItemListener(this);
621562
622
- oe.aConstraints.gridx = 0;
623
- oe.aConstraints.gridy += 1;
563
+ copyOptionsPanel.preferredHeight = 1;
564
+ oe.treePanel.add(copyOptionsPanel);
565
+ oe.treePanel.Return();
624566
567
+// mainPanel.setDividerLocation(0.5); //1.0);
568
+// mainPanel.setResizeWeight(0.5);
569
+
625570 //jList.addListSelectionListener(this);
626571 oe.jTree.addTreeSelectionListener(this);
627572 //jTree.setRootVisible(false);
....@@ -643,17 +588,85 @@
643588 radio.layout = sevenButton;
644589 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
645590 }
591
+
592
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
593
+ {
594
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
595
+ supportCB.setToolTipText("Enabled rigging");
596
+ supportCB.addItemListener(this);
597
+
598
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
599
+ // localCB.addItemListener(this);
600
+
601
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
602
+ crowdCB.setToolTipText("Used for crowds");
603
+ crowdCB.addItemListener(this);
604
+
605
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
606
+ smoothCB.setToolTipText("Snapping delay");
607
+ smoothCB.addItemListener(this);
608
+
609
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
610
+ slowCB.setToolTipText("Smooth interpolation");
611
+ slowCB.addItemListener(this);
612
+
613
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
614
+ boxCB.setToolTipText("Display bounding boxes");
615
+ boxCB.addItemListener(this);
616
+
617
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
618
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
619
+ zoomBoxCB.addItemListener(this);
620
+
621
+// constraints.gridy += 1;
622
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
623
+// speakerMocapCB.addItemListener(this);
624
+
625
+ if (false)
626
+ {
627
+ // handled in scripts
628
+ //constraints.gridy += 1;
629
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
630
+ speakerCameraCB.addItemListener(this);
631
+
632
+ //constraints.gridy += 1;
633
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
634
+ speakerFocusCB.addItemListener(this);
635
+
636
+ //constraints.gridy += 1;
637
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
638
+ smoothfocusCB.addItemListener(this);
639
+ }
640
+
641
+//constraints.gridx += 1;
642
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
643
+// debugCB.addItemListener(this);
644
+
645
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
646
+ oeilCB.addItemListener(this);
647
+
648
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
649
+ lookAtCB.setToolTipText("Look-at target");
650
+ lookAtCB.addItemListener(this);
651
+
652
+ cGridBag fill = new cGridBag();
653
+
654
+ fill.preferredHeight = 200;
655
+
656
+ panel.add(fill);
657
+
658
+ }
646659
647660 void EditObject(Object3D obj)
648661 {
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();
662
+ cRadio radioButton = new cRadio(obj.name);
663
+ radioButton.SetObject(obj);
664
+ radioButton.layout = sevenButton;
665
+ radioButton.SetCamera(cameraView.renderCamera, false);
666
+ radioButton.addActionListener(this);
667
+ radioPanel.add(radioButton);
668
+ buttonGroup.add(radioButton);
669
+ radioButton.doClick();
657670 }
658671 void SetupViews(ObjEditor oe)
659672 {
....@@ -673,6 +686,7 @@
673686 JCheckBox fastCB;
674687 JCheckBox slowCB;
675688 JCheckBox boxCB;
689
+ JCheckBox zoomBoxCB;
676690 JCheckBox trackCB;
677691 JCheckBox smoothfocusCB;
678692 // JCheckBox speakerMocapCB;
....@@ -715,8 +729,7 @@
715729 dropAttributes |= Object3D.TEXTURE;
716730 else
717731 dropAttributes &= ~Object3D.TEXTURE;
718
- }
719
- else if(e.getSource() == liveCB)
732
+ } else if(e.getSource() == liveCB)
720733 {
721734 cameraView.ToggleLive();
722735 }
....@@ -753,6 +766,10 @@
753766 Recompile();
754767 cameraView.repaint();
755768 // refreshContents();
769
+ }
770
+ else if(e.getSource() == zoomBoxCB)
771
+ {
772
+ cameraView.ToggleZoomBoxMode();
756773 }
757774 else if(e.getSource() == smoothfocusCB)
758775 {
....@@ -1085,7 +1102,7 @@
10851102 {
10861103 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10871104 animationItem.addItemListener(this);
1088
- animationItem.setState(CameraPane.ANIMATION);
1105
+ animationItem.setState(Globals.ANIMATION);
10891106
10901107 menu.add("-");
10911108 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
....@@ -1118,6 +1135,8 @@
11181135 resetParentItem.addActionListener(this);
11191136 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11201137 repairParentItem.addActionListener(this);
1138
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1139
+ repairShadowItem.addActionListener(this);
11211140 menu.add(invariantsItem = new MenuItem("Invariants"));
11221141 invariantsItem.addActionListener(this);
11231142 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1478,6 +1497,7 @@
14781497 //
14791498 public void actionPerformed(ActionEvent event) // , Object arg)
14801499 {
1500
+ Object source = event.getSource();
14811501 /*
14821502 if (event.getSource() == nameField)
14831503 {
....@@ -1489,11 +1509,11 @@
14891509 }
14901510 else
14911511 */
1492
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1512
+ if (source == lookAtItem || source == lookFromItem)
14931513 {
14941514 ScreenFit();
14951515 } else
1496
- if (event.getSource() == switchItem)
1516
+ if (source == switchItem)
14971517 {
14981518 cVector v1 = new cVector();
14991519 cVector v2 = new cVector();
....@@ -1502,11 +1522,11 @@
15021522 objEditor.cameraView.renderCamera.setAim(v2, v1);
15031523 objEditor.cameraView.repaint();
15041524 } else
1505
- if (event.getSource() == rectoidItem)
1525
+ if (source == rectoidItem)
15061526 {
15071527 makeSomething(new Box());
15081528 } else
1509
- if (event.getSource() == particleItem)
1529
+ if (source == particleItem)
15101530 {
15111531 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15121532 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1527,9 +1547,9 @@
15271547 applyExample(particleGeom, "SMOKE");
15281548 makeSomething(particleGeom);
15291549 } else
1530
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1550
+ if (source == ragdollItem || source == ragdoll2Item)
15311551 {
1532
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1552
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15331553
15341554 ragdoll.toParent = LA.newMatrix();
15351555 ragdoll.fromParent = LA.newMatrix();
....@@ -1547,7 +1567,7 @@
15471567 } else
15481568 /*
15491569 */
1550
- if (event.getSource() == heightFieldItem)
1570
+ if (source == heightFieldItem)
15511571 {
15521572 Object3D obj = new Object3D();
15531573
....@@ -1585,31 +1605,31 @@
15851605
15861606 makeSomething(obj);
15871607 } else
1588
- if (event.getSource() == gridItem)
1608
+ if (source == gridItem)
15891609 {
15901610 makeSomething(new Grid());
15911611 } else
1592
- if (event.getSource() == ellipsoidItem)
1612
+ if (source == ellipsoidItem)
15931613 {
15941614 makeSomething(new Sphere());
15951615 } else
1596
- if (event.getSource() == coneItem)
1616
+ if (source == coneItem)
15971617 {
15981618 makeSomething(new Cone());
15991619 } else
1600
- if (event.getSource() == torusItem)
1620
+ if (source == torusItem)
16011621 {
16021622 makeSomething(new Torus());
16031623 } else
1604
- if (event.getSource() == superItem)
1624
+ if (source == superItem)
16051625 {
16061626 makeSomething(new Superellipsoid());
16071627 } else
1608
- if (event.getSource() == kleinItem)
1628
+ if (source == kleinItem)
16091629 {
16101630 makeSomething(new Klein());
16111631 } else
1612
- if (event.getSource() == blobItem)
1632
+ if (source == blobItem)
16131633 {
16141634 Blob blob = new Blob();
16151635 BlobComponent comp = new BlobComponent();
....@@ -1617,15 +1637,15 @@
16171637 //blob.retile();
16181638 makeSomething(blob);
16191639 } else
1620
- if (event.getSource() == latheItem)
1640
+ if (source == latheItem)
16211641 {
16221642 makeSomething(new Lathe());
16231643 } else
1624
- if (event.getSource() == bezierItem)
1644
+ if (source == bezierItem)
16251645 {
16261646 makeSomething(new BezierSurface());
16271647 } else
1628
- if (event.getSource() == checkerItem)
1648
+ if (source == checkerItem)
16291649 {
16301650 /*
16311651 Object3D obj = new BezierSurface(5,8);
....@@ -1640,7 +1660,7 @@
16401660 */
16411661 makeSomething(new Checker());
16421662 } else
1643
- if (event.getSource() == meshItem)
1663
+ if (source == meshItem)
16441664 {
16451665 Object3D itemtomake = new Object3D();
16461666 Object3D child;
....@@ -1661,35 +1681,35 @@
16611681 makeSomething(child);
16621682 }
16631683 } else
1664
- if (event.getSource() == springItem)
1684
+ if (source == springItem)
16651685 {
16661686 cSpring s = new cSpring();
16671687 s.setup();
16681688 makeSomething(s);
16691689 } else
1670
- if (event.getSource() == flagItem)
1690
+ if (source == flagItem)
16711691 {
16721692 cSpring s = new cFlag();
16731693 s.setup();
16741694 makeSomething(s);
16751695 } else
1676
- if (event.getSource() == lightItem)
1696
+ if (source == lightItem)
16771697 {
16781698 makeSomething(new Light());
16791699 } else
1680
- if (event.getSource() == csgItem)
1700
+ if (source == csgItem)
16811701 {
16821702 group(new CSG());
16831703 } else
1684
- if (event.getSource() == templateItem)
1704
+ if (source == templateItem)
16851705 {
16861706 group(new cTemplate());
16871707 } else
1688
- if (event.getSource() == attributeItem)
1708
+ if (source == attributeItem)
16891709 {
16901710 makeSomething(new Attribute());
16911711 } else
1692
- if (event.getSource() == pointflowItem)
1712
+ if (source == pointflowItem)
16931713 {
16941714 makeSomething(new PointFlow());
16951715 } else
....@@ -1701,7 +1721,7 @@
17011721 } else
17021722 */
17031723
1704
- if (event.getSource() == superLoopItem)
1724
+ if (source == superLoopItem)
17051725 {
17061726 Composite g = new cGroup();
17071727 for (int i=0; i<15; i++)
....@@ -1723,7 +1743,7 @@
17231743
17241744 group(g);
17251745 } else
1726
- if (event.getSource() == loopItem)
1746
+ if (source == loopItem)
17271747 {
17281748 Composite csg = new GroupLeaf();
17291749 csg.count = 5;
....@@ -1732,7 +1752,7 @@
17321752 csg.addChild(child);
17331753 child.addChild(csg);
17341754 } else
1735
- if (event.getSource() == doubleItem)
1755
+ if (source == doubleItem)
17361756 {
17371757 Composite csg = new GroupLeaf();
17381758 csg.count = 5;
....@@ -1744,7 +1764,7 @@
17441764 csg.addChild(child);
17451765 child.addChild(csg);
17461766 } else
1747
- if (event.getSource() == tripleItem)
1767
+ if (source == tripleItem)
17481768 {
17491769 Composite csg = new GroupLeaf();
17501770 csg.count = 4;
....@@ -1760,70 +1780,70 @@
17601780 child.addChild(csg);
17611781 } else
17621782
1763
- if (event.getSource() == importGFDItem)
1783
+ if (source == importGFDItem)
17641784 {
17651785 ImportGFD();
17661786 } else
1767
- if (event.getSource() == importVRMLX3DItem)
1787
+ if (source == importVRMLX3DItem)
17681788 {
17691789 ImportVRMLX3D();
17701790 } else
1771
- if (event.getSource() == import3DSItem)
1791
+ if (source == import3DSItem)
17721792 {
17731793 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17741794 } else
1775
- if (event.getSource() == importOBJItem)
1795
+ if (source == importOBJItem)
17761796 {
17771797 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
17781798 } else
1779
- if (event.getSource() == computeAOItem)
1799
+ if (source == computeAOItem)
17801800 {
1781
- CameraPane.drawMode = CameraPane.OCCLUSION;
1782
- CameraPane.theRenderer.repaint();
1801
+ Globals.drawMode = CameraPane.OCCLUSION;
1802
+ Globals.theRenderer.repaint();
17831803 } else
1784
- if (event.getSource() == recompileItem)
1804
+ if (source == recompileItem)
17851805 {
17861806 Recompile();
17871807 refreshContents();
17881808 } else
1789
- if (event.getSource() == editScriptItem)
1809
+ if (source == editScriptItem)
17901810 {
17911811 OpenDialog();
17921812 refreshContents();
17931813 } else
1794
- if (event.getSource() == invariantsItem)
1814
+ if (source == invariantsItem)
17951815 {
17961816 System.out.println("Invariants:");
17971817 GrafreeD.grafreeD.universe.invariants();
17981818 } else
1799
- if (event.getSource() == memoryItem)
1819
+ if (source == memoryItem)
18001820 {
18011821 //System.out.println("Invariants:");
18021822 PrintMemory();
18031823 } else
1804
- if (event.getSource() == pathItem)
1824
+ if (source == pathItem)
18051825 {
18061826 PrintPath();
18071827 } else
1808
- if (event.getSource() == analyzeItem)
1828
+ if (source == analyzeItem)
18091829 {
18101830 AnalyzeObject();
18111831 } else
1812
- if (event.getSource() == dumpItem)
1832
+ if (source == dumpItem)
18131833 {
18141834 DumpObject();
18151835 } else
1816
- if (event.getSource() == screenfitButton)
1836
+ if (source == screenfitButton)
18171837 {
18181838 //Reload(lastConverter, lastFilename, true);
18191839 ScreenFit();
18201840 } else
1821
- if (event.getSource() == screenfitpointButton)
1841
+ if (source == screenfitpointButton)
18221842 {
18231843 //Reload(lastConverter, lastFilename, true);
18241844 ScreenFitPoint();
18251845 } else
1826
- if (event.getSource() == snapobjectButton)
1846
+ if (source == snapobjectButton)
18271847 {
18281848 //Reload(lastConverter, lastFilename, true);
18291849 SnapObject();
....@@ -1834,13 +1854,13 @@
18341854 // Recompile();
18351855 // refreshContents();
18361856 // } else
1837
- if (event.getSource() == gcButton)
1857
+ if (source == gcButton)
18381858 {
18391859 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18401860 System.gc();
18411861 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18421862 } else
1843
- if (event.getSource() == editLeafItem)
1863
+ if (source == editLeafItem)
18441864 {
18451865 Object3D obj;
18461866 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1854,62 +1874,62 @@
18541874 }
18551875 refreshContents(true);
18561876 } else
1857
- if (event.getSource() == openWindowItem)
1877
+ if (source == openWindowItem)
18581878 {
18591879 EditSelection(true);
18601880 } else
1861
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1881
+ if (source == cutItem || source == clearButton)
18621882 {
18631883 loadClipboard(true);
18641884 } else
1865
- if (event.getSource() == duplicateItem)
1885
+ if (source == duplicateItem)
18661886 {
18671887 Object3D keep = GrafreeD.clipboard;
18681888 loadClipboard(false);
18691889 paste(false);
18701890 GrafreeD.clipboard = keep;
18711891 } else
1872
- if (event.getSource() == cloneItem)
1892
+ if (source == cloneItem)
18731893 {
18741894 CloneSelection(false);
18751895 } else
1876
- if (event.getSource() == cloneSupportItem)
1896
+ if (source == cloneSupportItem)
18771897 {
18781898 CloneSelection(true);
18791899 } else
1880
- if (event.getSource() == copyItem)
1900
+ if (source == copyItem)
18811901 {
18821902 loadClipboard(false);
18831903 } else
1884
- if (event.getSource() == pasteItem)
1904
+ if (source == pasteItem)
18851905 {
18861906 paste(false);
18871907 } else
1888
- if (event.getSource() == pasteLinkItem)
1908
+ if (source == pasteLinkItem)
18891909 {
18901910 pasteInto(false);
18911911 } else
1892
- if (event.getSource() == pasteCloneItem)
1912
+ if (source == pasteCloneItem)
18931913 {
18941914 pasteInto(true);
18951915 } else
1896
- if (event.getSource() == pasteExpandItem)
1916
+ if (source == pasteExpandItem)
18971917 {
18981918 paste(true);
18991919 } else
1900
- if (event.getSource() == synchronizeItem)
1920
+ if (source == synchronizeItem)
19011921 {
19021922 Overwrite(Object3D.TRANSFORM);
19031923 } else
1904
- if (event.getSource() == overwriteNameItem)
1924
+ if (source == overwriteNameItem)
19051925 {
19061926 Overwrite(Object3D.NAME);
19071927 } else
1908
- if (event.getSource() == overwriteUVItem)
1928
+ if (source == overwriteUVItem)
19091929 {
19101930 Overwrite(Object3D.UV);
19111931 } else
1912
- if (event.getSource() == overwriteMatItem)
1932
+ if (source == overwriteMatItem)
19131933 {
19141934 /* july 2015
19151935 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1929,7 +1949,7 @@
19291949
19301950 Overwrite(dropAttributes);
19311951 }
1932
- if (event.getSource() == overwriteGeoItem)
1952
+ if (source == overwriteGeoItem)
19331953 {
19341954 Overwrite(Object3D.GEOMETRY);
19351955 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1946,7 +1966,7 @@
19461966 // refreshContents();
19471967 // }
19481968 } else
1949
- if (event.getSource() == generateMeshItem)
1969
+ if (source == generateMeshItem)
19501970 {
19511971 //if (group.selection.size() == 1)
19521972 // for (int i=0; i<group.selection.size(); i++)
....@@ -1957,7 +1977,7 @@
19571977 ResetModel();
19581978 refreshContents();
19591979 } else
1960
- if (event.getSource() == extractGeometriesItem)
1980
+ if (source == extractGeometriesItem)
19611981 {
19621982 boolean one = false;
19631983
....@@ -1984,7 +2004,7 @@
19842004 ResetModel();
19852005 refreshContents();
19862006 } else
1987
- if (event.getSource() == cloneGeometriesItem)
2007
+ if (source == cloneGeometriesItem)
19882008 {
19892009 boolean one = false;
19902010
....@@ -2010,7 +2030,7 @@
20102030 ResetModel();
20112031 refreshContents();
20122032 } else
2013
- if (event.getSource() == shareGeometriesItem)
2033
+ if (source == shareGeometriesItem)
20142034 {
20152035 boolean one = false;
20162036
....@@ -2040,7 +2060,7 @@
20402060 refreshContents();
20412061 }
20422062 } else
2043
- if (event.getSource() == mergeGeometriesItem)
2063
+ if (source == mergeGeometriesItem)
20442064 {
20452065 boolean one = false;
20462066
....@@ -2070,7 +2090,7 @@
20702090 ResetModel();
20712091 refreshContents();
20722092 } else
2073
- if (event.getSource() == linkverticesItem)
2093
+ if (source == linkverticesItem)
20742094 {
20752095 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20762096 // {
....@@ -2090,7 +2110,7 @@
20902110 if (content instanceof cGroup && ((cGroup)content).transientlink )
20912111 content = ((cGroup)content).get(0);
20922112
2093
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2113
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20942114 for (int i=0; i<group.selection.size(); i++)
20952115 {
20962116 boolean random = CameraPane.RANDOM;
....@@ -2099,11 +2119,11 @@
20992119 // group.selection.get(i).setMasterThis(content); // should be identity
21002120 CameraPane.RANDOM = random;
21012121 }
2102
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2122
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21032123 refreshContents();
21042124 }
21052125 } else
2106
- if (event.getSource() == resetsupportItem)
2126
+ if (source == resetsupportItem)
21072127 {
21082128 for (int i=0; i<group.selection.size(); i++)
21092129 {
....@@ -2115,7 +2135,7 @@
21152135
21162136 refreshContents();
21172137 } else
2118
- if (event.getSource() == relinkverticesItem)
2138
+ if (source == relinkverticesItem)
21192139 {
21202140 boolean random = CameraPane.RANDOM;
21212141 CameraPane.RANDOM = false; // parse all random nodes
....@@ -2124,7 +2144,7 @@
21242144
21252145 refreshContents();
21262146 } else
2127
- if (event.getSource() == resetreferencesItem)
2147
+ if (source == resetreferencesItem)
21282148 {
21292149 for (int i=0; i<group.selection.size(); i++)
21302150 {
....@@ -2133,7 +2153,7 @@
21332153
21342154 refreshContents();
21352155 } else
2136
- if (event.getSource() == setMasterItem)
2156
+ if (source == setMasterItem)
21372157 {
21382158 if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21392159 {
....@@ -2146,7 +2166,7 @@
21462166 refreshContents();
21472167 }
21482168 } else
2149
- if (event.getSource() == poseMeshItem)
2169
+ if (source == poseMeshItem)
21502170 {
21512171 if (group.selection.size() == 1)
21522172 {
....@@ -2165,19 +2185,19 @@
21652185 }
21662186
21672187 } else
2168
- if (event.getSource() == revertMeshItem)
2188
+ if (source == revertMeshItem)
21692189 {
21702190 RevertMeshes();
21712191 } else
2172
- if (event.getSource() == resetMeshItem)
2192
+ if (source == resetMeshItem)
21732193 {
21742194 ResetAll();
21752195 } else
2176
- if (event.getSource() == stepAllItem)
2196
+ if (source == stepAllItem)
21772197 {
21782198 StepAll();
21792199 } else
2180
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2200
+ if (source == clearItem) // || event.getSource() == clearButton)
21812201 {
21822202 //int indices[] = jList.getSelectedIndices();
21832203 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2185,46 +2205,46 @@
21852205
21862206 ClearSelection(false);
21872207 } else
2188
- if (event.getSource() == clearAllItem)
2208
+ if (source == clearAllItem)
21892209 {
21902210 ClearSelection(true);
21912211 } else
2192
- if (event.getSource() == grabItem)
2212
+ if (source == grabItem)
21932213 {
21942214 group(new cGroup(), true);
21952215 } else
2196
- if (event.getSource() == hideItem)
2216
+ if (source == hideItem)
21972217 {
21982218 group(new HiddenObject());
21992219 } else
2200
- if (event.getSource() == frontItem)
2220
+ if (source == frontItem)
22012221 {
22022222 front();
22032223 } else
2204
- if (event.getSource() == backItem)
2224
+ if (source == backItem)
22052225 {
22062226 back();
22072227 } else
2208
- if (event.getSource() == cameraItem)
2228
+ if (source == cameraItem)
22092229 {
22102230 makeSomething(new Camera());
22112231 } else
2212
- if (event.getSource() == compositeItem)
2232
+ if (source == compositeItem)
22132233 {
22142234 group(new Composite());
22152235 } else
2216
- if (event.getSource() == randomItem)
2236
+ if (source == randomItem)
22172237 {
22182238 RandomNode random = new RandomNode();
22192239 group(random);
22202240 if (random.size() > 0)
22212241 random.name = random.get(0).name + "Rnd";
22222242 } else
2223
- if (event.getSource() == physicsItem)
2243
+ if (source == physicsItem)
22242244 {
22252245 group(new PhysicsNode());
22262246 } else
2227
- if (event.getSource() == frameselectorItem)
2247
+ if (source == frameselectorItem)
22282248 {
22292249 for (int i=0; i<group.selection.size(); i++)
22302250 {
....@@ -2236,7 +2256,7 @@
22362256 ResetModel();
22372257 refreshContents();
22382258 } else
2239
- if (event.getSource() == switchGeoItem)
2259
+ if (source == switchGeoItem)
22402260 {
22412261 for (int i=0; i<group.selection.size(); i++)
22422262 {
....@@ -2248,7 +2268,7 @@
22482268 ResetModel();
22492269 refreshContents();
22502270 } else
2251
- if (event.getSource() == switchTransfoItem)
2271
+ if (source == switchTransfoItem)
22522272 {
22532273 for (int i=0; i<group.selection.size(); i++)
22542274 {
....@@ -2260,7 +2280,7 @@
22602280 ResetModel();
22612281 refreshContents();
22622282 } else
2263
- if (event.getSource() == morphItem)
2283
+ if (source == morphItem)
22642284 {
22652285 for (int i=0; i<group.selection.size(); i++)
22662286 {
....@@ -2272,7 +2292,7 @@
22722292 ResetModel();
22732293 refreshContents();
22742294 } else
2275
- if (event.getSource() == scriptNodeItem)
2295
+ if (source == scriptNodeItem)
22762296 {
22772297 boolean atleastone = false;
22782298
....@@ -2311,31 +2331,31 @@
23112331 }
23122332 }
23132333 } else
2314
- if (event.getSource() == linkerItem)
2334
+ if (source == linkerItem)
23152335 {
23162336 group(new cLinker());
23172337 } else
2318
- if (event.getSource() == textureItem)
2338
+ if (source == textureItem)
23192339 {
23202340 group(new TextureNode());
23212341 } else
2322
- if (event.getSource() == billboardItem)
2342
+ if (source == billboardItem)
23232343 {
23242344 group(new BillboardNode());
23252345 } else
2326
- if (event.getSource() == shadowXItem)
2346
+ if (source == shadowXItem)
23272347 {
23282348 CastShadow(0);
23292349 } else
2330
- if (event.getSource() == shadowYItem)
2350
+ if (source == shadowYItem)
23312351 {
23322352 CastShadow(1);
23332353 } else
2334
- if (event.getSource() == shadowZItem)
2354
+ if (source == shadowZItem)
23352355 {
23362356 CastShadow(2);
23372357 } else
2338
- if (event.getSource() == ungroupItem)
2358
+ if (source == ungroupItem)
23392359 {
23402360 //ungroup();
23412361 for (int i=0; i<group.selection.size(); i++)
....@@ -2347,179 +2367,179 @@
23472367
23482368 refreshContents();
23492369 } else
2350
- if (event.getSource() == genUVItem)
2370
+ if (source == genUVItem)
23512371 {
23522372 GenUV();
23532373 } else
2354
- if (event.getSource() == genNormalsCADItem)
2374
+ if (source == genNormalsCADItem)
23552375 {
23562376 GenNormals(true);
23572377 } else
2358
- if (event.getSource() == genNormalsMESHItem)
2378
+ if (source == genNormalsMESHItem)
23592379 {
23602380 GenNormals(true); // TODO
23612381 } else
2362
- if (event.getSource() == genNormalsORGANItem)
2382
+ if (source == genNormalsORGANItem)
23632383 {
23642384 GenNormals(false);
23652385 } else
2366
- if (event.getSource() == genNormalsMINEItem)
2386
+ if (source == genNormalsMINEItem)
23672387 {
23682388 GenNormalsMINE();
23692389 } else
2370
- if (event.getSource() == stripifyItem)
2390
+ if (source == stripifyItem)
23712391 {
23722392 Stripify();
23732393 } else
2374
- if (event.getSource() == unstripifyItem)
2394
+ if (source == unstripifyItem)
23752395 {
23762396 Unstripify();
23772397 } else
2378
- if (event.getSource() == trimItem)
2398
+ if (source == trimItem)
23792399 {
23802400 Trim();
23812401 } else
2382
- if (event.getSource() == untrimItem)
2402
+ if (source == untrimItem)
23832403 {
23842404 Untrim();
23852405 } else
2386
- if (event.getSource() == clearColorsItem)
2406
+ if (source == clearColorsItem)
23872407 {
23882408 ClearColors();
23892409 } else
2390
- if (event.getSource() == clearMaterialsItem)
2410
+ if (source == clearMaterialsItem)
23912411 {
23922412 ClearMaterials();
23932413 } else
2394
- if (event.getSource() == liveleavesItem)
2414
+ if (source == liveleavesItem)
23952415 {
23962416 LiveLeaves(true);
23972417 } else
2398
- if (event.getSource() == unliveleavesItem)
2418
+ if (source == unliveleavesItem)
23992419 {
24002420 LiveLeaves(false);
24012421 } else
2402
- if (event.getSource() == supportleavesItem)
2422
+ if (source == supportleavesItem)
24032423 {
24042424 SupportLeaves(true);
24052425 } else
2406
- if (event.getSource() == unsupportleavesItem)
2426
+ if (source == unsupportleavesItem)
24072427 {
24082428 SupportLeaves(false);
24092429 } else
2410
- if (event.getSource() == hideleavesItem)
2430
+ if (source == hideleavesItem)
24112431 {
24122432 HideLeaves(true);
24132433 } else
2414
- if (event.getSource() == showleavesItem)
2434
+ if (source == showleavesItem)
24152435 {
24162436 HideLeaves(false);
24172437 } else
2418
- if (event.getSource() == markleavesItem)
2438
+ if (source == markleavesItem)
24192439 {
24202440 MarkLeaves(true);
24212441 } else
2422
- if (event.getSource() == unmarkleavesItem)
2442
+ if (source == unmarkleavesItem)
24232443 {
24242444 MarkLeaves(false);
24252445 } else
2426
- if (event.getSource() == flipVItem)
2446
+ if (source == flipVItem)
24272447 {
24282448 FlipV(true);
24292449 } else
2430
- if (event.getSource() == unflipVItem)
2450
+ if (source == unflipVItem)
24312451 {
24322452 FlipV(false);
24332453 } else
2434
- if (event.getSource() == lowTexturesItem)
2454
+ if (source == lowTexturesItem)
24352455 {
24362456 SetTexRes(0);
24372457 } else
2438
- if (event.getSource() == normalTexturesItem)
2458
+ if (source == normalTexturesItem)
24392459 {
24402460 SetTexRes(1);
24412461 } else
2442
- if (event.getSource() == highTexturesItem)
2462
+ if (source == highTexturesItem)
24432463 {
24442464 SetTexRes(2);
24452465 } else
2446
- if (event.getSource() == veryhighTexturesItem)
2466
+ if (source == veryhighTexturesItem)
24472467 {
24482468 SetTexRes(3);
24492469 } else
2450
- if (event.getSource() == maxTexturesItem)
2470
+ if (source == maxTexturesItem)
24512471 {
24522472 SetTexRes(4);
24532473 } else
2454
- if (event.getSource() == panoTexturesItem)
2474
+ if (source == panoTexturesItem)
24552475 {
24562476 SetTexRes(5);
24572477 } else
2458
- if (event.getSource() == reverseNormalsItem)
2478
+ if (source == reverseNormalsItem)
24592479 {
24602480 ReverseNormals();
24612481 } else
2462
- if (event.getSource() == parseverticesItem)
2482
+ if (source == parseverticesItem)
24632483 {
24642484 ParseVertices();
24652485 } else
2466
- if (event.getSource() == textureFieldItem)
2486
+ if (source == textureFieldItem)
24672487 {
24682488 TextureVertices();
24692489 } else
2470
- if (event.getSource() == alignItem)
2490
+ if (source == alignItem)
24712491 {
24722492 Align();
24732493 } else
2474
- if (event.getSource() == mirrorItem)
2494
+ if (source == mirrorItem)
24752495 {
24762496 MirrorPoses();
24772497 } else
2478
- if (event.getSource() == reduceMorphItem)
2498
+ if (source == reduceMorphItem)
24792499 {
24802500 MeshReduction(false);
24812501 } else
2482
- if (event.getSource() == reduce34MorphItem)
2502
+ if (source == reduce34MorphItem)
24832503 {
24842504 MeshReduction(true);
24852505 } else
2486
- if (event.getSource() == reverseTrianglesItem)
2506
+ if (source == reverseTrianglesItem)
24872507 {
24882508 ReverseTriangles();
24892509 } else
2490
- if (event.getSource() == reduceMeshItem)
2510
+ if (source == reduceMeshItem)
24912511 {
24922512 ReduceMesh(false);
24932513 } else
2494
- if (event.getSource() == reduce34MeshItem)
2514
+ if (source == reduce34MeshItem)
24952515 {
24962516 ReduceMesh(true);
24972517 } else
2498
- if (event.getSource() == increaseMeshItem)
2518
+ if (source == increaseMeshItem)
24992519 {
25002520 IncreaseMesh();
25012521 } else
2502
- if (event.getSource() == clipMeshItem)
2522
+ if (source == clipMeshItem)
25032523 {
25042524 ClipMesh();
25052525 } else
2506
- if (event.getSource() == smoothMeshItem)
2526
+ if (source == smoothMeshItem)
25072527 {
25082528 SmoothMesh();
25092529 } else
2510
- if (event.getSource() == transformgeometryItem)
2530
+ if (source == transformgeometryItem)
25112531 {
25122532 TransformGeometry();
25132533 } else
2514
- if (event.getSource() == resetTransformItem)
2534
+ if (source == resetTransformItem)
25152535 {
25162536 ResetTransform();
25172537 } else
2518
- if (event.getSource() == resetCentroidItem)
2538
+ if (source == resetCentroidItem)
25192539 {
25202540 ResetCentroid();
25212541 } else
2522
- if (event.getSource() == resetParentItem)
2542
+ if (source == resetParentItem)
25232543 {
25242544 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25252545 {
....@@ -2529,7 +2549,7 @@
25292549
25302550 refreshContents();
25312551 } else
2532
- if (event.getSource() == repairParentItem)
2552
+ if (source == repairParentItem)
25332553 {
25342554 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25352555 {
....@@ -2543,7 +2563,21 @@
25432563
25442564 refreshContents();
25452565 } else
2546
- if (event.getSource() == sortbysizeItem)
2566
+ if (source == repairShadowItem)
2567
+ {
2568
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2569
+ {
2570
+ Object3D obj = (Object3D)e.nextElement();
2571
+ obj.RepairShadow();
2572
+// for (int i=0; i<obj.size(); i++)
2573
+// {
2574
+// obj.get(i).parent = obj;
2575
+// }
2576
+ }
2577
+
2578
+ refreshContents();
2579
+ } else
2580
+ if (source == sortbysizeItem)
25472581 {
25482582 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25492583 {
....@@ -2555,7 +2589,7 @@
25552589 ResetModel();
25562590 refreshContents();
25572591 } else
2558
- if (event.getSource() == sortbynameItem)
2592
+ if (source == sortbynameItem)
25592593 {
25602594 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25612595 {
....@@ -2567,7 +2601,7 @@
25672601 ResetModel();
25682602 refreshContents();
25692603 } else
2570
- if (event.getSource() == attachPigmentItem)
2604
+ if (source == attachPigmentItem)
25712605 {
25722606 String texture = GetFile("Attach pigment");
25732607 Object3D obj;
....@@ -2579,7 +2613,7 @@
25792613
25802614 refreshContents();
25812615 } else
2582
- if (event.getSource() == detachPigmentItem)
2616
+ if (source == detachPigmentItem)
25832617 {
25842618 Object3D obj;
25852619 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2590,7 +2624,7 @@
25902624
25912625 refreshContents();
25922626 } else
2593
- if (event.getSource() == attachBumpItem)
2627
+ if (source == attachBumpItem)
25942628 {
25952629 String texture = GetFile("Attach bump");
25962630 Object3D obj;
....@@ -2602,7 +2636,7 @@
26022636
26032637 refreshContents();
26042638 } else
2605
- if (event.getSource() == detachBumpItem)
2639
+ if (source == detachBumpItem)
26062640 {
26072641 Object3D obj;
26082642 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2613,7 +2647,7 @@
26132647
26142648 refreshContents();
26152649 } else
2616
- if (event.getSource() == pigmentBumpItem)
2650
+ if (source == pigmentBumpItem)
26172651 {
26182652 Object3D obj;
26192653 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2624,158 +2658,195 @@
26242658
26252659 refreshContents();
26262660 } else
2627
- if (event.getSource() == flashSelectionButton)
2661
+ if (source == flashSelectionButton)
26282662 {
26292663 CameraPane.flash = true;
26302664 refreshContents();
26312665 } else
2632
- if (event.getSource() == oneButton)
2666
+ if (source == oneButton)
26332667 {
26342668 } else
2635
- if (event.getSource() == twoButton)
2669
+ if (source == twoButton)
26362670 {
26372671 radio.layout = twoButton;
26382672 // bug
26392673 //gridPanel.setDividerLocation(1.0);
26402674 //bigPanel.setDividerLocation(0.0);
2641
- bigThree.remove(scenePanel);
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();
2675
+// bigThree.remove(scenePanel);
2676
+// bigThree.remove(centralPanel);
2677
+// bigThree.remove(XYZPanel);
2678
+// aWindowConstraints.gridx = 0;
2679
+// aWindowConstraints.gridy = 0;
2680
+// aWindowConstraints.gridwidth = 1;
2681
+// // aConstraints.gridheight = 3;
2682
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2683
+// aWindowConstraints.weightx = 0;
2684
+// aWindowConstraints.weighty = 1;
2685
+// //bigThree.add(jtp, aWindowConstraints);
2686
+// aWindowConstraints.weightx = 1;
2687
+// aWindowConstraints.gridwidth = 3;
2688
+// // aConstraints.gridheight = 3;
2689
+// aWindowConstraints.gridx = 1;
2690
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2691
+// bigThree.add(centralPanel, aWindowConstraints);
2692
+// aWindowConstraints.weightx = 0;
2693
+// aWindowConstraints.gridx = 4;
2694
+// aWindowConstraints.gridwidth = 1;
2695
+// // aConstraints.gridheight = 3;
2696
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2697
+// //bigThree.add(XYZPanel, aWindowConstraints);
2698
+// scenePanel.setVisible(false);
2699
+// centralPanel.setVisible(true);
2700
+// XYZPanel.setVisible(false);
2701
+ bigThree.ClearUI();
2702
+ bigThree.add(centralPanel);
2703
+ bigThree.FlushUI();
26652704 } else
2666
- if (event.getSource() == threeButton)
2705
+ if (source == threeButton)
26672706 {
26682707 radio.layout = threeButton;
2669
- bigThree.remove(scenePanel);
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();
2708
+
2709
+// bigThree.remove(scenePanel);
2710
+// bigThree.remove(centralPanel);
2711
+// bigThree.remove(XYZPanel);
2712
+// aWindowConstraints.gridx = 0;
2713
+// aWindowConstraints.gridy = 0;
2714
+// aWindowConstraints.gridwidth = 1;
2715
+// // aConstraints.gridheight = 3;
2716
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2717
+// aWindowConstraints.weightx = 0;
2718
+// aWindowConstraints.weighty = 1;
2719
+// //bigThree.add(jtp, aWindowConstraints);
2720
+// aWindowConstraints.weightx = 1;
2721
+// aWindowConstraints.gridwidth = 3;
2722
+// // aConstraints.gridheight = 3;
2723
+// aWindowConstraints.gridx = 1;
2724
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2725
+// bigThree.add(centralPanel, aWindowConstraints);
2726
+// aWindowConstraints.weightx = 0;
2727
+// aWindowConstraints.gridx = 4;
2728
+// aWindowConstraints.gridwidth = 1;
2729
+// // aConstraints.gridheight = 3;
2730
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2731
+// bigThree.add(XYZPanel, aWindowConstraints);
2732
+// bigThree.validate();
2733
+// scenePanel.setVisible(false);
2734
+// centralPanel.setVisible(true);
2735
+// XYZPanel.setVisible(true);
2736
+ bigThree.ClearUI();
2737
+ bigThree.add(centralPanel);
2738
+ bigThree.add(XYZPanel);
2739
+ bigThree.FlushUI();
26932740 } else
2694
- if (event.getSource() == fourButton)
2741
+ if (source == fourButton)
26952742 {
26962743 radio.layout = fourButton;
2697
- bigThree.remove(scenePanel);
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(scenePanel, 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();
2744
+
2745
+// bigThree.remove(scenePanel);
2746
+// bigThree.remove(centralPanel);
2747
+// bigThree.remove(XYZPanel);
2748
+// aWindowConstraints.gridx = 0;
2749
+// aWindowConstraints.gridy = 0;
2750
+// aWindowConstraints.gridwidth = 1;
2751
+// // aWindowConstraints.gridheight = 3;
2752
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2753
+// aWindowConstraints.weightx = 1;
2754
+// aWindowConstraints.weighty = 1;
2755
+// bigThree.add(scenePanel, aWindowConstraints);
2756
+// aWindowConstraints.weightx = 1;
2757
+// aWindowConstraints.gridwidth = 3;
2758
+// // aConstraints.gridheight = 3;
2759
+// aWindowConstraints.gridx = 1;
2760
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2761
+// //bigThree.add(cameraPanel, aWindowConstraints);
2762
+// aWindowConstraints.weightx = 0;
2763
+// aWindowConstraints.gridx = 4;
2764
+// aWindowConstraints.gridwidth = 1;
2765
+// // aWindowConstraints.gridheight = 3;
2766
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2767
+// //bigThree.add(XYZPanel, aWindowConstraints);
2768
+// bigThree.validate();
2769
+// scenePanel.setVisible(true);
2770
+// centralPanel.setVisible(false);
2771
+// XYZPanel.setVisible(false);
2772
+ bigThree.ClearUI();
2773
+ bigThree.add(scenePanel);
2774
+ bigThree.FlushUI();
27212775 } else
2722
- if (event.getSource() == sixButton)
2776
+ if (source == sixButton)
27232777 {
27242778 radio.layout = sixButton;
2725
- bigThree.remove(scenePanel);
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(scenePanel, 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();
2779
+
2780
+// bigThree.remove(scenePanel);
2781
+// bigThree.remove(centralPanel);
2782
+// bigThree.remove(XYZPanel);
2783
+// aWindowConstraints.gridx = 0;
2784
+// aWindowConstraints.gridy = 0;
2785
+// aWindowConstraints.gridwidth = 1;
2786
+// // aConstraints.gridheight = 3;
2787
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2788
+// aWindowConstraints.weightx = 0;
2789
+// aWindowConstraints.weighty = 1;
2790
+// bigThree.add(scenePanel, aWindowConstraints);
2791
+// aWindowConstraints.weightx = 1;
2792
+// aWindowConstraints.gridwidth = 3;
2793
+// // aWindowConstraints.gridheight = 3;
2794
+// aWindowConstraints.gridx = 1;
2795
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2796
+// bigThree.add(centralPanel, aWindowConstraints);
2797
+// aWindowConstraints.weightx = 0;
2798
+// aWindowConstraints.gridx = 4;
2799
+// aWindowConstraints.gridwidth = 1;
2800
+// // aWindowConstraints.gridheight = 3;
2801
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2802
+// //bigThree.add(XYZPanel, aConstraints);
2803
+// bigThree.validate();
2804
+// scenePanel.setVisible(true);
2805
+// centralPanel.setVisible(true);
2806
+// XYZPanel.setVisible(false);
2807
+ bigThree.ClearUI();
2808
+ bigThree.add(scenePanel);
2809
+ bigThree.add(centralPanel);
2810
+ bigThree.FlushUI();
27492811 } else
2750
- if (event.getSource() == sevenButton)
2812
+ if (source == sevenButton)
27512813 {
27522814 radio.layout = sevenButton;
2753
- bigThree.remove(scenePanel);
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(scenePanel, 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();
2815
+
2816
+// bigThree.remove(scenePanel);
2817
+// bigThree.remove(centralPanel);
2818
+// bigThree.remove(XYZPanel);
2819
+// aWindowConstraints.gridx = 0;
2820
+// aWindowConstraints.gridy = 0;
2821
+// aWindowConstraints.gridwidth = 1;
2822
+// // aWindowConstraints.gridheight = 3;
2823
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2824
+// aWindowConstraints.weightx = 0;
2825
+// aWindowConstraints.weighty = 1;
2826
+// bigThree.add(scenePanel, aWindowConstraints);
2827
+// aWindowConstraints.weightx = 1;
2828
+// aWindowConstraints.gridwidth = 3;
2829
+// // aWindowConstraints.gridheight = 3;
2830
+// aWindowConstraints.gridx = 1;
2831
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2832
+// bigThree.add(centralPanel, aWindowConstraints);
2833
+// aWindowConstraints.weightx = 0;
2834
+// aWindowConstraints.gridx = 4;
2835
+// aWindowConstraints.gridwidth = 1;
2836
+// // aConstraints.gridheight = 3;
2837
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2838
+// bigThree.add(XYZPanel, aWindowConstraints);
2839
+// bigThree.validate();
2840
+// scenePanel.setVisible(true);
2841
+// centralPanel.setVisible(true);
2842
+// XYZPanel.setVisible(true);
2843
+ bigThree.ClearUI();
2844
+ bigThree.add(scenePanel);
2845
+ bigThree.add(centralPanel);
2846
+ bigThree.add(XYZPanel);
2847
+ bigThree.FlushUI();
27772848 } else
2778
- if (event.getSource() == rootButton)
2849
+ if (source == rootButton)
27792850 {
27802851 Object3D obj;
27812852 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2787,7 +2858,7 @@
27872858
27882859 refreshContents(true);
27892860 } else
2790
- if (event.getSource() == closeButton)
2861
+ if (source == closeButton)
27912862 {
27922863 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27932864 cRadio ab;
....@@ -2808,11 +2879,11 @@
28082879 }
28092880 refreshContents(true);
28102881 } else
2811
- if (event.getSource() == editItem || event.getSource() == editButton)
2882
+ if (source == editItem || source == editButton)
28122883 {
28132884 EditSelection(false);
28142885 } else
2815
- if (event.getSource() == uneditButton)
2886
+ if (source == uneditButton)
28162887 {
28172888 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28182889 {
....@@ -2824,12 +2895,12 @@
28242895
28252896 child.editWindow = null; // ???????????
28262897 }
2827
- objEditor.ctrlPanel.revalidate();
2898
+ objEditor.ctrlPanel.validate();
28282899 //objEditor.jTree.clearSelection();
28292900 //objEditor.ResetSliders();
28302901 refreshContents(true);
28312902 } else
2832
- if (event.getSource() == clearPanelButton)
2903
+ if (source == clearPanelButton)
28332904 {
28342905 assert(copy == group);
28352906 //copy.ClearUI();
....@@ -2840,7 +2911,7 @@
28402911 listUI.clear();
28412912 refreshContents(true);
28422913 } else
2843
- if (event.getSource() == allParamsButton)
2914
+ if (source == allParamsButton)
28442915 {
28452916 assert(copy == group);
28462917
....@@ -2861,19 +2932,19 @@
28612932
28622933 refreshContents(true);
28632934 } else
2864
- if (event.getSource() == unselectButton)
2935
+ if (source == unselectButton)
28652936 {
28662937 objEditor.jTree.clearSelection();
28672938 // ?? oct 2012 GrafreeD.clipboard.clear();
28682939 objEditor.ResetSliders();
28692940 refreshContents(true);
28702941 } else
2871
- if(event.getSource() instanceof cRadio)
2942
+ if(source instanceof cRadio)
28722943 {
28732944 group.parent = keepparent;
28742945 group.attributes = 0;
28752946 //group.editWindow = null;
2876
- /*cRadio*/ radio = (cRadio)event.getSource();
2947
+ /*cRadio*/ radio = (cRadio)source;
28772948 Object3D obj = radio.GetObject();
28782949 System.out.println("Edit " + obj);
28792950 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2893,7 +2964,7 @@
28932964 }
28942965
28952966 copy = group;
2896
- //CameraPane.theRenderer.object = group;
2967
+ //Globals.theRenderer.object = group;
28972968 if(!useclient)
28982969 {
28992970 cameraView.renderCamera = radio.camera;
....@@ -2902,7 +2973,8 @@
29022973 cameraView.cameras[cameraView.cameracount] = radio.camera;
29032974 cameraView.targetLookAt.set(radio.camera.lookAt);
29042975 cameraView.object = group;
2905
- cameraView.lighttouched = true;
2976
+ //cameraView.lighttouched = true;
2977
+ Globals.lighttouched = true;
29062978 topView.object = group;
29072979 frontView.object = group;
29082980 sideView.object = group;
....@@ -2938,7 +3010,7 @@
29383010 if (useclient)
29393011 {
29403012 cameraView.object = client;
2941
- cameraView.lighttouched = true;
3013
+ Globals.lighttouched = true;
29423014 //topView.object = client;
29433015 //frontView.object = client;
29443016 //sideView.object = client;
....@@ -2946,7 +3018,7 @@
29463018 else
29473019 {
29483020 cameraView.object = group;
2949
- cameraView.lighttouched = true;
3021
+ Globals.lighttouched = true;
29503022 //topView.object = group;
29513023 //frontView.object = group;
29523024 //sideView.object = group;
....@@ -3454,7 +3526,7 @@
34543526 String pigment = Object3D.GetPigment(tex);
34553527 //String bump = Object3D.GetBump(tex);
34563528
3457
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3529
+ com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
34583530
34593531 double s = v.s;
34603532
....@@ -3755,7 +3827,7 @@
37553827 group.selection.RelinkToSupport(); // july 2014
37563828 System.out.println("DONE.");
37573829 refreshContents();
3758
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
3830
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
37593831 }
37603832
37613833 void ReduceMesh(boolean reduction34)
....@@ -4031,25 +4103,25 @@
40314103 System.err.println("info : " + child.GetPath());
40324104 }
40334105 }
4034
- else
4035
- {
4036
- objEditor.SetMaterial(group); // .GetMaterial());
4037
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4038
- System.err.println("info : " + group.GetPath());
4039
- }
4106
+// else
4107
+// {
4108
+// objEditor.SetMaterial(group); // .GetMaterial());
4109
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4110
+// System.err.println("info : " + group.GetPath());
4111
+// }
40404112
40414113 objEditor.SetText(); // jan 2014
40424114
4043
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4115
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
40444116 CameraPane.flash = true;
40454117
40464118 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
40474119 // a camera
40484120 {
40494121 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;
4122
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4123
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4124
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40534125 }
40544126
40554127 refreshContents();
....@@ -5007,6 +5079,7 @@
50075079
50085080 private MenuItem resetParentItem;
50095081 private MenuItem repairParentItem;
5082
+ private MenuItem repairShadowItem;
50105083 private MenuItem sortbysizeItem;
50115084 private MenuItem sortbynameItem;
50125085