Normand Briere
2019-07-14 bc829f47837b5a001f911542140b0b8e63c2bb0c
GroupEditor.java
....@@ -84,6 +84,10 @@
8484
8585 void CloneSelection(boolean supports)
8686 {
87
+ if (Globals.SAVEONMAKE)
88
+ Save();
89
+ boolean keep = Globals.SAVEONMAKE;
90
+ Globals.SAVEONMAKE = false;
8791 // Object3D keep = GrafreeD.clipboard;
8892 //Object3D obj;
8993 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -94,6 +98,7 @@
9498
9599 makeSomething(clone, i==group.selection.size()-1);
96100 }
101
+ Globals.SAVEONMAKE = keep;
97102 }
98103
99104 void CloneClipboard(boolean supports)
....@@ -150,6 +155,8 @@
150155
151156 void SetupMenu2(GroupEditor oe)
152157 {
158
+ oe.jTree = new cTree();
159
+
153160 Menu menu;
154161 oe.menuBar.add(menu = new Menu("Edit"));
155162 //editItem = menu.add(new MenuItem("Edit"));
....@@ -160,7 +167,7 @@
160167 // redoItem = menu.add(new MenuItem("Redo"));
161168 // redoItem.addActionListener(this);
162169 // menu.add("-");
163
- duplicateItem = menu.add(new MenuItem("Duplicate"));
170
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
164171 duplicateItem.addActionListener(this);
165172 cloneItem = menu.add(new MenuItem("Clone"));
166173 cloneItem.addActionListener(this);
....@@ -176,7 +183,6 @@
176183 copyItem.addActionListener(this);
177184 pasteItem = menu.add(new MenuItem("Paste"));
178185 pasteItem.addActionListener(this);
179
- menu.add("-");
180186
181187 menu.add("-");
182188 pasteIntoItem = menu.add(new MenuItem("Paste into"));
....@@ -203,23 +209,23 @@
203209 //zBufferItem.addActionListener(this);
204210 //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
205211 //normalLensItem.addActionListener(this);
206
- cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
207
- revertCameraItem.addActionListener(this);
212
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
213
+ restoreCameraItem.addActionListener(this);
208214
209
- cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
210
- toggleFullScreenItem.addItemListener(this);
211
- toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
212
- cameraMenu.add("-");
215
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
216
+// toggleFullScreenItem.addItemListener(this);
217
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
218
+// cameraMenu.add("-");
219
+//
220
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
221
+// toggleTextureItem.addItemListener(this);
222
+// toggleTextureItem.setState(CameraPane.textureon);
223
+//
224
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
225
+// toggleSwitchItem.addItemListener(this);
226
+// toggleSwitchItem.setState(CameraPane.SWITCH);
213227
214
- cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
215
- toggleTextureItem.addItemListener(this);
216
- toggleTextureItem.setState(CameraPane.textureon);
217
-
218
- cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
219
- toggleSwitchItem.addItemListener(this);
220
- toggleSwitchItem.setState(CameraPane.SWITCH);
221
-
222
- cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
228
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
223229 toggleHandleItem.addItemListener(this);
224230 toggleHandleItem.setState(CameraPane.HANDLES);
225231
....@@ -246,7 +252,7 @@
246252
247253 cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
248254 toggleDebugItem.addItemListener(this);
249
- toggleDebugItem.setState(CameraPane.DEBUG);
255
+ toggleDebugItem.setState(Globals.DEBUG);
250256
251257 cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
252258 toggleFrustumItem.addItemListener(this);
....@@ -274,7 +280,7 @@
274280 {
275281 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
276282 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
277
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
283
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
278284 editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
279285 oe.cameraMenu.add("-");
280286 openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
....@@ -282,7 +288,7 @@
282288 editLeafItem.addActionListener(this);
283289 lookAtItem.addActionListener(this);
284290 //lookFromItem.addActinoListener(this);
285
- //switchItem.addActionListener(this);
291
+ //switchViewItem.addActionListener(this);
286292 }
287293
288294 oe.menuBar.add(menu = new Menu("Setting"));
....@@ -327,21 +333,29 @@
327333 }
328334
329335 oe.menuBar.add(menu = new Menu("Group"));
330
- grabItem = menu.add(new MenuItem("Grab"));
331
- grabItem.addActionListener(this);
336
+// grabItem = menu.add(new MenuItem("Grab"));
337
+// grabItem.addActionListener(this);
332338 backItem = menu.add(new MenuItem("Back"));
333339 backItem.addActionListener(this);
334340 frontItem = menu.add(new MenuItem("Front"));
335341 frontItem.addActionListener(this);
336
- compositeItem = menu.add(new MenuItem("Composite"));
337
- compositeItem.addActionListener(this);
342
+// compositeItem = menu.add(new MenuItem("Composite"));
343
+// compositeItem.addActionListener(this);
344
+
345
+ if (Globals.ADVANCED)
346
+ {
338347 hideItem = menu.add(new MenuItem("Hidden Group"));
339348 hideItem.addActionListener(this);
349
+ }
340350 ungroupItem = menu.add(new MenuItem("Ungroup"));
341351 ungroupItem.addActionListener(this);
342
- menu.add("-");
343
- randomItem = menu.add(new MenuItem("Switch node"));
344
- randomItem.addActionListener(this);
352
+
353
+// menu.add("-");
354
+//
355
+// switchItem = menu.add(new MenuItem("Switch node"));
356
+// switchItem.addActionListener(this);
357
+ if (Globals.ADVANCED)
358
+ {
345359 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
346360 switchGeoItem.addActionListener(this);
347361 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
....@@ -349,8 +363,6 @@
349363 morphItem = menu.add(new MenuItem("Morph Group"));
350364 morphItem.addActionListener(this);
351365
352
- if (Globals.ADVANCED)
353
- {
354366 menu.add("-");
355367 physicsItem = menu.add(new MenuItem("Physics"));
356368 physicsItem.addActionListener(this);
....@@ -358,30 +370,29 @@
358370 frameselectorItem.addActionListener(this);
359371 scriptNodeItem = menu.add(new MenuItem("Script Node"));
360372 scriptNodeItem.addActionListener(this);
361
- cameraItem = menu.add(new MenuItem("Camera"));
362
- cameraItem.addActionListener(this);
363373 }
364374
365375 oe.menuBar.add(menu = new Menu("Object"));
366
- textureItem = menu.add(new MenuItem("Texture"));
367
- textureItem.addActionListener(this);
376
+// textureItem = menu.add(new MenuItem("Texture"));
377
+// textureItem.addActionListener(this);
368378 billboardItem = menu.add(new MenuItem("Billboard"));
369379 billboardItem.addActionListener(this);
370380 csgItem = menu.add(new MenuItem("CSG"));
371381 csgItem.addActionListener(this);
372
- shadowXItem = menu.add(new MenuItem("Shadow X"));
382
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
373383 shadowXItem.addActionListener(this);
374
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
384
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
375385 shadowYItem.addActionListener(this);
376
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
386
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
377387 shadowZItem.addActionListener(this);
388
+ attributeItem = menu.add(new MenuItem("Attribute"));
389
+ attributeItem.addActionListener(this);
390
+
378391 if (Globals.ADVANCED)
379392 {
380393 menu.add("-");
381394 linkerItem = menu.add(new MenuItem("Linker"));
382395 linkerItem.addActionListener(this);
383
- attributeItem = menu.add(new MenuItem("Attribute"));
384
- attributeItem.addActionListener(this);
385396 templateItem = menu.add(new MenuItem("Template"));
386397 templateItem.addActionListener(this);
387398 pointflowItem = menu.add(new MenuItem("Point Flow"));
....@@ -470,6 +481,14 @@
470481 markleavesItem.addActionListener(this);
471482 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
472483 unmarkleavesItem.addActionListener(this);
484
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
485
+ rewindleavesItem.addActionListener(this);
486
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
487
+ unrewindleavesItem.addActionListener(this);
488
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
489
+ randomleavesItem.addActionListener(this);
490
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
491
+ unrandomleavesItem.addActionListener(this);
473492 menu.add("-");
474493 flipVItem = menu.add(new MenuItem("Flip V"));
475494 flipVItem.addActionListener(this);
....@@ -527,6 +546,18 @@
527546
528547 void SetupUI2(ObjEditor oe)
529548 {
549
+ // June 2019
550
+ if (oe == null)
551
+ {
552
+ //super.SetupUI2(this);
553
+ //return;
554
+ }
555
+
556
+ if (copy != group)
557
+ {
558
+ //super.SetupUI2(this);
559
+ }
560
+
530561 //new Exception().printStackTrace();
531562
532563 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -555,39 +586,66 @@
555586 oe.radioPanel.add(dummyButton);
556587 oe.buttonGroup.add(dummyButton);
557588 */
589
+ cGridBag copyOptionsPanel = new cGridBag();
590
+
591
+ copyOptionsPanel.preferredHeight = 1;
592
+
558593 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
559594
560
- oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
595
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ //minButton.setToolTipText("Minimize window");
597
+ //minButton.addActionListener(this);
598
+
599
+ if (Globals.ADVANCED)
600
+ {
601
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602
+ maxButton.setToolTipText("Maximize window");
603
+ maxButton.addActionListener(this);
604
+ }
605
+
606
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
607
+ fullButton.setToolTipText("Full-screen window");
608
+ fullButton.addActionListener(this);
609
+
610
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
611
+ screenfitButton.setToolTipText("Screen fit");
612
+ screenfitButton.addActionListener(this);
613
+
614
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
615
+ restoreCameraButton.setToolTipText("Restore viewpoint");
616
+ restoreCameraButton.addActionListener(this);
617
+
618
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
561619 undoButton.setToolTipText("Undo changes");
562620 undoButton.addActionListener(this);
621
+ undoButton.setEnabled(false);
563622
564
- oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
623
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
565624 redoButton.setToolTipText("Redo changes");
566625 redoButton.addActionListener(this);
626
+ redoButton.setEnabled(false);
567627
568
- oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
628
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569629 saveButton.setToolTipText("Save changes");
570630 saveButton.addActionListener(this);
571631
572
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
632
+ copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
573633 liveCB.setToolTipText("Enable animation");
574634 liveCB.addItemListener(this);
575635
576
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
636
+ copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
577637 oneStepButton.setToolTipText("Animate one step forward");
578638 oneStepButton.addActionListener(this);
579639
580
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
640
+ copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
581641 fastCB.setToolTipText("Fast mode");
582642 fastCB.addItemListener(this);
583643
584
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
585
- trackCB.setToolTipText("Enable tracking");
586
- trackCB.addItemListener(this);
587
-
588
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
589
- screenfitButton.setToolTipText("Screen fit");
590
- screenfitButton.addActionListener(this);
644
+ //oe.toolboxPanel.Return();
645
+
646
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
647
+// trackCB.setToolTipText("Enable tracking");
648
+// trackCB.addItemListener(this);
591649
592650 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
593651 // screenfitpointButton.addActionListener(this);
....@@ -599,65 +657,145 @@
599657 snapobjectButton.setToolTipText("Snap Object");
600658 }
601659
602
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
603
- flashSelectionButton.setToolTipText("Show selection");
604
- flashSelectionButton.addActionListener(this);
660
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
605661
606
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
607
-
608
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
662
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
609663 twoButton.setToolTipText("Show center view only");
610664 twoButton.addActionListener(this);
611
- oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
665
+ this.fullscreenLayout = twoButton;
666
+
667
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
612668 fourButton.addActionListener(this);
613669 fourButton.setToolTipText("Show left panel only");
614
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
670
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
615671 sixButton.setToolTipText("2-column layout left");
616672 sixButton.addActionListener(this);
617
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
673
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
618674 threeButton.setToolTipText("2-column layout right");
619675 threeButton.addActionListener(this);
620
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
676
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
621677 sevenButton.setToolTipText("3-column layout");
622678 sevenButton.addActionListener(this);
623679 //
624680
625
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
681
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
626682 rootButton.setToolTipText("Edit selection in new tab");
627683 rootButton.addActionListener(this);
628684
629
- oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
685
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
630686 closeButton.setToolTipText("Close tab");
631687 closeButton.addActionListener(this);
632688 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
633689 //clearButton.addActionListener(this);
634
-
635
- cGridBag commandsPanel = new cGridBag();
690
+
691
+ // INSERT
692
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
693
+ gridButton.setToolTipText("Create grid");
694
+ gridButton.addActionListener(this);
695
+
696
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
697
+ boxButton.setToolTipText("Create box");
698
+ boxButton.addActionListener(this);
699
+
700
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
701
+ sphereButton.setToolTipText("Create sphere");
702
+ sphereButton.addActionListener(this);
703
+
704
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
705
+ coneButton.setToolTipText("Create cone");
706
+ coneButton.addActionListener(this);
707
+
708
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
709
+ torusButton.setToolTipText("Create torus");
710
+ torusButton.addActionListener(this);
711
+
712
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
713
+ superButton.setToolTipText("Create superellipsoid");
714
+ superButton.addActionListener(this);
715
+
716
+ if (Globals.ADVANCED)
717
+ {
718
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
719
+ kleinButton.setToolTipText("Create Klein bottle");
720
+ kleinButton.addActionListener(this);
721
+ }
636722
637
- commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
638
- editButton.setToolTipText("Edit selection");
723
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
724
+ particlesButton.setToolTipText("Create particle system");
725
+ particlesButton.addActionListener(this);
726
+
727
+ oe.toolboxPanel.Return();
728
+
729
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
730
+ groupButton.setToolTipText("Create group");
731
+ groupButton.addActionListener(this);
732
+
733
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
734
+ compositeButton.setToolTipText("Create composite");
735
+ compositeButton.addActionListener(this);
736
+
737
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
738
+ switchButton.setToolTipText("Create item switcher");
739
+ switchButton.addActionListener(this);
740
+
741
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
742
+ loopButton.setToolTipText("Create loop");
743
+ loopButton.addActionListener(this);
744
+
745
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
746
+ textureButton.setToolTipText("Create texture");
747
+ textureButton.addActionListener(this);
748
+
749
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
750
+ overlayButton.setToolTipText("Create overlay");
751
+ overlayButton.addActionListener(this);
752
+
753
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
754
+ lightButton.setToolTipText("Create light");
755
+ lightButton.addActionListener(this);
756
+
757
+ for (int i=6; --i>=0;)
758
+ {
759
+ oe.toolboxPanel.Return();
760
+ oe.toolboxPanel.add(new cGridBag());
761
+ oe.toolboxPanel.add(new cGridBag());
762
+ oe.toolboxPanel.add(new cGridBag());
763
+ oe.toolboxPanel.add(new cGridBag());
764
+ oe.toolboxPanel.add(new cGridBag());
765
+ oe.toolboxPanel.add(new cGridBag());
766
+ oe.toolboxPanel.add(new cGridBag());
767
+ }
768
+
769
+ // EDIT panel
770
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
771
+ editButton.setToolTipText("Pin selection controls");
639772 editButton.addActionListener(this);
640773
641
- commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
642
- uneditButton.setToolTipText("Unedit selection");
774
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
775
+ uneditButton.setToolTipText("Remove selection controls");
643776 uneditButton.addActionListener(this);
644777
645
- commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
646
- allParamsButton.setToolTipText("Edit all params");
778
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
779
+ allParamsButton.setToolTipText("Show all controle");
647780 allParamsButton.addActionListener(this);
648781
649
- commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
782
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650783 clearPanelButton.setToolTipText("Clear edit panel");
651784 clearPanelButton.addActionListener(this);
652785
653
- commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
786
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
654787 unselectButton.setToolTipText("Unselect");
655788 unselectButton.addActionListener(this);
656789
657
- commandsPanel.preferredHeight = 1;
790
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
791
+ flashSelectionButton.setToolTipText("Highlight selection");
792
+ flashSelectionButton.addActionListener(this);
658793
659
- oe.treePanel.add(commandsPanel);
660
- oe.treePanel.Return();
794
+ editCommandsPanel.preferredHeight = 1;
795
+
796
+ SetPinStates(false);
797
+// oe.treePanel.add(commandsPanel);
798
+// oe.treePanel.Return();
661799
662800 // oe.aConstraints.gridx += 1;
663801 // oe.aConstraints.weighty = 0;
....@@ -674,27 +812,12 @@
674812
675813 JScrollPane jSP;
676814 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
677
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
815
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
678816 ResetModel();
679817
680818 oe.treePanel.add(jSPPanel);
681819 oe.treePanel.Return();
682820
683
- cGridBag copyOptionsPanel = new cGridBag();
684
-
685
- copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
686
- colorCB.setToolTipText("Copy color when dropped");
687
- colorCB.addItemListener(this);
688
-
689
- copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
690
- materialCB.setToolTipText("Copy material when dropped");
691
- materialCB.addItemListener(this);
692
-
693
- copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
694
- textureCB.setToolTipText("Copy texture when dropped");
695
- textureCB.addItemListener(this);
696
-
697
- copyOptionsPanel.preferredHeight = 1;
698821 oe.treePanel.add(copyOptionsPanel);
699822 oe.treePanel.Return();
700823
....@@ -725,23 +848,43 @@
725848
726849 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
727850 {
851
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
852
+ colorCB.setToolTipText("Copy color when dropped");
853
+ colorCB.addItemListener(this);
854
+
855
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
856
+ materialCB.setToolTipText("Copy material when dropped");
857
+ materialCB.addItemListener(this);
858
+
859
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
860
+ textureCB.setToolTipText("Copy texture when dropped");
861
+ textureCB.addItemListener(this);
862
+
863
+ panel.Return();
864
+
728865 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
729866 boxCB.setToolTipText("Display bounding boxes");
730867 boxCB.addItemListener(this);
731868
732869 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
733
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
870
+ zoomBoxCB.setToolTipText("Display only for wheel");
734871 zoomBoxCB.addItemListener(this);
735872
736873 if (true) // Globals.ADVANCED)
737874 {
738
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
739
- supportCB.setToolTipText("Enable rigging");
740
- supportCB.addItemListener(this);
875
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
876
+// supportCB.setToolTipText("Enable rigging");
877
+// supportCB.addItemListener(this);
878
+
879
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
880
+ freezeCB.setToolTipText("Fast moving camera");
881
+ freezeCB.addItemListener(this);
741882
742883 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
743884 // localCB.addItemListener(this);
744885
886
+ panel.Return();
887
+
745888 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
746889 crowdCB.setToolTipText("Used for crowds");
747890 crowdCB.addItemListener(this);
....@@ -758,6 +901,8 @@
758901 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
759902 // speakerMocapCB.addItemListener(this);
760903
904
+ panel.Return();
905
+
761906 if (false)
762907 {
763908 // handled in scripts
....@@ -772,32 +917,72 @@
772917 //constraints.gridy += 1;
773918 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
774919 smoothfocusCB.addItemListener(this);
920
+ panel.Return();
775921 }
776922
777923 //constraints.gridx += 1;
778924 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
779925 // debugCB.addItemListener(this);
780926
927
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
928
+ trackCB.setToolTipText("Enable tracking target");
929
+ trackCB.addItemListener(this);
930
+
781931 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
932
+ oeilCB.setToolTipText("Move camera when tracking");
782933 oeilCB.addItemListener(this);
783934
935
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
936
+ shadowCB.setToolTipText("When live compute shadows");
937
+ shadowCB.addItemListener(this);
938
+
939
+ panel.Return();
940
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
941
+ toggleTextureCB.setToolTipText("Load textures");
942
+ toggleTextureCB.addItemListener(this);
943
+
944
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
945
+ toggleSwitchCB.setToolTipText("Choose a single item");
946
+ toggleSwitchCB.addItemListener(this);
947
+
948
+ panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
949
+ autosaveCB.setToolTipText("On structure change");
950
+ autosaveCB.addItemListener(this);
951
+
952
+ panel.Return();
953
+ if (Globals.ADVANCED)
954
+ {
784955 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
785956 lookAtCB.setToolTipText("Look-at target");
786957 lookAtCB.addItemListener(this);
958
+ }
787959
788960 }
789961
790962 cGridBag fill = new cGridBag();
791
-
792963 fill.preferredHeight = 200;
964
+ cGridBag fill2 = new cGridBag();
965
+ fill2.preferredHeight = 200;
966
+ cGridBag fill3 = new cGridBag();
967
+ fill3.preferredHeight = 200;
793968
794969 panel.add(fill);
970
+ panel.add(fill2);
971
+ panel.add(fill3);
795972
796973 }
797974
798975 void EditObject(Object3D obj)
799976 {
800977 cRadio radioButton = new cRadio(obj.name);
978
+
979
+ // June 2019. Patch to avoid bug with transparency.
980
+ radioButton.hadMaterial = obj.material != null;
981
+ if (!radioButton.hadMaterial)
982
+ {
983
+ obj.material = new cMaterial();
984
+ }
985
+
801986 radioButton.SetObject(obj);
802987 radioButton.layout = sevenButton;
803988 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -809,6 +994,8 @@
809994
810995 void SetupViews(ObjEditor oe)
811996 {
997
+ theFrame = this;
998
+
812999 oe.SetupViews();
8131000
8141001 System.out.println("SetupViews");
....@@ -817,23 +1004,28 @@
8171004 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
8181005 }
8191006
820
- JCheckBox liveCB;
821
- JCheckBox supportCB;
822
- JCheckBox localCB;
823
- JCheckBox crowdCB;
824
- JCheckBox smoothCB;
825
- JCheckBox fastCB;
826
- JCheckBox slowCB;
827
- JCheckBox boxCB;
828
- JCheckBox zoomBoxCB;
829
- JCheckBox trackCB;
830
- JCheckBox smoothfocusCB;
1007
+ cToggleButton liveCB;
1008
+ cCheckBox supportCB;
1009
+ cCheckBox localCB;
1010
+ cCheckBox crowdCB;
1011
+ cCheckBox smoothCB;
1012
+ cToggleButton fastCB;
1013
+ cCheckBox slowCB;
1014
+ cCheckBox boxCB;
1015
+ cCheckBox zoomBoxCB;
1016
+ cCheckBox freezeCB;
1017
+ //cToggleButton trackCB;
1018
+ cCheckBox trackCB;
1019
+ cCheckBox smoothfocusCB;
8311020 // JCheckBox speakerMocapCB;
832
- JCheckBox speakerCameraCB;
833
- JCheckBox speakerFocusCB;
834
- JCheckBox debugCB;
835
- JCheckBox oeilCB;
836
- JCheckBox lookAtCB;
1021
+ cCheckBox speakerCameraCB;
1022
+ cCheckBox speakerFocusCB;
1023
+ cCheckBox debugCB;
1024
+
1025
+ cCheckBox oeilCB;
1026
+ cCheckBox shadowCB;
1027
+ cCheckBox autosaveCB;
1028
+ cCheckBox lookAtCB;
8371029
8381030 // static int COLOR = 1;
8391031 // static int MATERIAL = 2;
....@@ -841,9 +1033,9 @@
8411033
8421034 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
8431035
844
- JCheckBox colorCB;
845
- JCheckBox materialCB;
846
- JCheckBox textureCB;
1036
+ cCheckBox colorCB;
1037
+ cCheckBox materialCB;
1038
+ cCheckBox textureCB;
8471039
8481040 public void itemStateChanged(ItemEvent e)
8491041 {
....@@ -871,6 +1063,7 @@
8711063 } else if(e.getSource() == liveCB)
8721064 {
8731065 cameraView.ToggleLive();
1066
+ refreshContents(false);
8741067 }
8751068 else if(e.getSource() == supportCB)
8761069 {
....@@ -935,6 +1128,18 @@
9351128 {
9361129 cameraView.ToggleOeil();
9371130 }
1131
+ else if(e.getSource() == shadowCB)
1132
+ {
1133
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1134
+ }
1135
+ else if(e.getSource() == freezeCB)
1136
+ {
1137
+ Globals.FREEZEONMOVE ^= true;
1138
+ }
1139
+ else if(e.getSource() == autosaveCB)
1140
+ {
1141
+ Globals.SAVEONMAKE ^= true;
1142
+ }
9381143 else if(e.getSource() == lookAtCB)
9391144 {
9401145 cameraView.ToggleLookAt();
....@@ -951,7 +1156,8 @@
9511156
9521157 /**/
9531158 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
954
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1159
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1160
+ TreePath path = objEditor.jTree.getSelectionPath();
9551161 if ((path == null) || (path.getPathCount() <= 1)) {
9561162 // We can't move the root node or an empty selection
9571163 return;
....@@ -1014,8 +1220,6 @@
10141220 }
10151221 }
10161222
1017
- String string = (String) object;
1018
-
10191223 System.out.println("Transfer = " + object + "; drop : " + target);
10201224 // if( object instanceof java.io.File[])
10211225 // {
....@@ -1023,6 +1227,8 @@
10231227 // objEditor.DropFile((java.io.File[]) object, true);
10241228 // return;
10251229 // }
1230
+
1231
+ String string = object.toString();
10261232
10271233 // File path for Mac and Windows
10281234 if (string.charAt(0) == '/' || string.charAt(1) == ':')
....@@ -1068,23 +1274,33 @@
10681274
10691275 assert target == objEditor.jTree;
10701276 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1277
+ Object3D destinationLeaf;
10711278 try {
1072
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1279
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
10731280 } catch (Exception e) {
10741281 System.out.println("destinationPath : " + destinationPath);
10751282 return;
10761283 }
10771284
1078
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1285
+ for (int i=group.selection.size(); --i>=0;)
10791286 {
1287
+ Object3D child = (Object3D)group.selection.elementAt(i);
1288
+
1289
+ // Cannot move into itself
1290
+ if (child == destinationLeaf)
1291
+ return;
1292
+ }
1293
+
1294
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1295
+// {
10801296 loadClipboard(true);
10811297 objEditor.jTree.setSelectionPath(destinationPath);
10821298 pasteInto(false, false);
1083
- } else {
1084
- loadClipboard(false);
1085
- objEditor.jTree.setSelectionPath(destinationPath);
1086
- pasteInto(false, false); // true); // ???
1087
- }
1299
+// } else {
1300
+// loadClipboard(false);
1301
+// objEditor.jTree.setSelectionPath(destinationPath);
1302
+// pasteInto(false, false); // true); // ???
1303
+// }
10881304 }
10891305 public void dropActionChanged(DropTargetDragEvent dtde)
10901306 // Called if the user has modified the current drop gesture
....@@ -1189,22 +1405,30 @@
11891405 {
11901406 //heightFieldItem = menu.add(new MenuItem("Height Field"));
11911407 //heightFieldItem.addActionListener(this);
1192
- gridItem = menu.add(new MenuItem("Grid"));
1193
- gridItem.addActionListener(this);
1194
- rectoidItem = menu.add(new MenuItem("Box"));
1195
- rectoidItem.addActionListener(this);
1196
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1197
- ellipsoidItem.addActionListener(this);
1198
- coneItem = menu.add(new MenuItem("Cone"));
1199
- coneItem.addActionListener(this);
1200
- torusItem = menu.add(new MenuItem("Torus"));
1201
- torusItem.addActionListener(this);
1202
- superItem = menu.add(new MenuItem("Superellipsoid"));
1203
- superItem.addActionListener(this);
1408
+// gridItem = menu.add(new MenuItem("Grid"));
1409
+// gridItem.addActionListener(this);
1410
+// rectoidItem = menu.add(new MenuItem("Box"));
1411
+// rectoidItem.addActionListener(this);
1412
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1413
+// ellipsoidItem.addActionListener(this);
1414
+// coneItem = menu.add(new MenuItem("Cone"));
1415
+// coneItem.addActionListener(this);
1416
+// torusItem = menu.add(new MenuItem("Torus"));
1417
+// torusItem.addActionListener(this);
1418
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1419
+// superItem.addActionListener(this);
1420
+
1421
+ cameraItem = menu.add(new MenuItem("Camera"));
1422
+ cameraItem.addActionListener(this);
1423
+
1424
+ if (!Globals.ADVANCED)
1425
+ {
12041426 kleinItem = menu.add(new MenuItem("Klein Bottle"));
12051427 kleinItem.addActionListener(this);
1206
- particleItem = menu.add(new MenuItem("Particle system"));
1207
- particleItem.addActionListener(this);
1428
+ }
1429
+
1430
+// particleItem = menu.add(new MenuItem("Particle system"));
1431
+// particleItem.addActionListener(this);
12081432 if (Globals.ADVANCED)
12091433 {
12101434 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1230,15 +1454,15 @@
12301454 }
12311455 bezierItem = menu.add(new MenuItem("Bezier Patch"));
12321456 bezierItem.addActionListener(this);
1233
- overlayItem = menu.add(new MenuItem("Overlay"));
1234
- overlayItem.addActionListener(this);
1235
- lightItem = menu.add(new MenuItem("Light"));
1236
- lightItem.addActionListener(this);
1457
+// overlayItem = menu.add(new MenuItem("Overlay"));
1458
+// overlayItem.addActionListener(this);
1459
+// lightItem = menu.add(new MenuItem("Light"));
1460
+// lightItem.addActionListener(this);
12371461 menu.add("-");
12381462 //superLoopItem = menu.add(new MenuItem("Super Loop"));
12391463 //superLoopItem.addActionListener(this);
1240
- loopItem = menu.add(new MenuItem("Loop"));
1241
- loopItem.addActionListener(this);
1464
+// loopItem = menu.add(new MenuItem("Loop"));
1465
+// loopItem.addActionListener(this);
12421466 doubleItem = menu.add(new MenuItem("Fork"));
12431467 doubleItem.addActionListener(this);
12441468 if (Globals.ADVANCED)
....@@ -1254,6 +1478,9 @@
12541478 animationItem.addItemListener(this);
12551479 animationItem.setState(Globals.ANIMATION);
12561480
1481
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1482
+ archiveItem.addActionListener(this);
1483
+
12571484 menu.add("-");
12581485 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
12591486 parseverticesItem.addActionListener(this);
....@@ -1266,6 +1493,8 @@
12661493 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
12671494 reduce34MorphItem.addActionListener(this);
12681495 menu.add("-");
1496
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1497
+ memoryItem.addActionListener(this);
12691498 menu.add(computeAOItem = new MenuItem("Compute AO"));
12701499 computeAOItem.addActionListener(this);
12711500
....@@ -1274,11 +1503,9 @@
12741503 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
12751504 mirrorItem.addActionListener(this);
12761505 menu.add("-");
1277
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1278
- memoryItem.addActionListener(this);
12791506 menu.add(analyzeItem = new MenuItem("Analyze"));
12801507 analyzeItem.addActionListener(this);
1281
- menu.add(dumpItem = new MenuItem("Dump"));
1508
+ menu.add(dumpItem = new MenuItem("Print"));
12821509 dumpItem.addActionListener(this);
12831510 // menu.add(pathItem = new MenuItem("From-to path"));
12841511 // pathItem.addActionListener(this);
....@@ -1419,9 +1646,24 @@
14191646 shadow.material = new cMaterial(obj.material);
14201647 shadow.material.diffuse = 0.0001f;
14211648 shadow.material.specular = 0.0001f;
1649
+ //shadow.projectedVertices[1].x = 300;
14221650
14231651 makeSomething(shadow);
14241652 }
1653
+
1654
+ private void ClearUnpinned()
1655
+ {
1656
+ //for (Object3D obj : listUI)
1657
+ for (int i=listUI.size(); --i>=0;)
1658
+ {
1659
+ Object3D obj = listUI.elementAt(i);
1660
+ if (!obj.pinned)
1661
+ {
1662
+ obj.CloseUI();
1663
+ listUI.remove(i);
1664
+ }
1665
+ }
1666
+ }
14251667
14261668 /**
14271669 * applyExample
....@@ -1666,7 +1908,7 @@
16661908 {
16671909 ScreenFit();
16681910 } else
1669
- if (source == switchItem)
1911
+ if (source == switchViewItem)
16701912 {
16711913 cVector v1 = new cVector();
16721914 cVector v2 = new cVector();
....@@ -1675,11 +1917,11 @@
16751917 objEditor.cameraView.renderCamera.setAim(v2, v1);
16761918 objEditor.cameraView.repaint();
16771919 } else
1678
- if (source == rectoidItem)
1920
+ if (source == rectoidItem || source == boxButton)
16791921 {
16801922 makeSomething(new Box());
16811923 } else
1682
- if (source == particleItem)
1924
+ if (source == particleItem || source == particlesButton)
16831925 {
16841926 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
16851927 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1758,27 +2000,27 @@
17582000
17592001 makeSomething(obj);
17602002 } else
1761
- if (source == gridItem)
2003
+ if (source == gridItem || source == gridButton)
17622004 {
17632005 makeSomething(new Grid());
17642006 } else
1765
- if (source == ellipsoidItem)
2007
+ if (source == ellipsoidItem || source == sphereButton)
17662008 {
17672009 makeSomething(new Sphere());
17682010 } else
1769
- if (source == coneItem)
2011
+ if (source == coneItem || source == coneButton)
17702012 {
17712013 makeSomething(new Cone());
17722014 } else
1773
- if (source == torusItem)
2015
+ if (source == torusItem || source == torusButton)
17742016 {
17752017 makeSomething(new Torus());
17762018 } else
1777
- if (source == superItem)
2019
+ if (source == superItem || source == superButton)
17782020 {
17792021 makeSomething(new Superellipsoid());
17802022 } else
1781
- if (source == kleinItem)
2023
+ if (source == kleinItem || source == kleinButton)
17822024 {
17832025 makeSomething(new Klein());
17842026 } else
....@@ -1798,7 +2040,7 @@
17982040 {
17992041 makeSomething(new BezierSurface());
18002042 } else
1801
- if (source == overlayItem)
2043
+ if (source == overlayItem || source == overlayButton)
18022044 {
18032045 /*
18042046 Object3D obj = new BezierSurface(5,8);
....@@ -1846,7 +2088,7 @@
18462088 s.setup();
18472089 makeSomething(s);
18482090 } else
1849
- if (source == lightItem)
2091
+ if (source == lightItem || source == lightButton)
18502092 {
18512093 makeSomething(new Light());
18522094 } else
....@@ -1896,30 +2138,30 @@
18962138
18972139 group(g);
18982140 } else
1899
- if (source == loopItem)
2141
+ if (source == loopItem || source == loopButton)
19002142 {
19012143 Composite csg = new GroupLeaf();
19022144 csg.count = 5;
19032145 group(csg);
1904
- Composite child = new cGroup();
2146
+ Composite child = new cGroup("Branch");
19052147 csg.addChild(child);
19062148 child.addChild(csg);
19072149 } else
19082150 if (source == doubleItem)
19092151 {
1910
- Composite csg = new GroupLeaf();
2152
+ Composite csg = new GroupLeaf("Fork");
19112153 csg.count = 5;
19122154 group(csg);
1913
- Composite child = new cGroup();
2155
+ Composite child = new cGroup("Branch A");
19142156 csg.addChild(child);
19152157 child.addChild(csg);
1916
- child = new cGroup();
2158
+ child = new cGroup("Branch B");
19172159 csg.addChild(child);
19182160 child.addChild(csg);
19192161 } else
19202162 if (source == tripleItem)
19212163 {
1922
- Composite csg = new GroupLeaf();
2164
+ Composite csg = new GroupLeaf("Trident");
19232165 csg.count = 4;
19242166 group(csg);
19252167 Composite child = new cGroup();
....@@ -1969,9 +2211,22 @@
19692211 {
19702212 DumpObject();
19712213 } else
2214
+ if (source == minButton)
2215
+ {
2216
+ Minimize();
2217
+ } else
2218
+ if (source == maxButton)
2219
+ {
2220
+ Maximize();
2221
+ } else
2222
+ if (source == fullButton)
2223
+ {
2224
+ ToggleFullScreen();
2225
+ } else
19722226 if (source == undoButton)
19732227 {
1974
- Undo();
2228
+ if (!Undo())
2229
+ java.awt.Toolkit.getDefaultToolkit().beep();
19752230 } else
19762231 if (source == redoButton)
19772232 {
....@@ -1979,7 +2234,8 @@
19792234 } else
19802235 if (source == saveButton)
19812236 {
1982
- Save();
2237
+ if (!Save(true))
2238
+ java.awt.Toolkit.getDefaultToolkit().beep();
19832239 } else
19842240 if (source == oneStepButton)
19852241 {
....@@ -1988,17 +2244,14 @@
19882244 } else
19892245 if (source == screenfitButton)
19902246 {
1991
- //Reload(lastConverter, lastFilename, true);
19922247 ScreenFit();
19932248 } else
19942249 if (source == screenfitpointButton)
19952250 {
1996
- //Reload(lastConverter, lastFilename, true);
19972251 ScreenFitPoint();
19982252 } else
19992253 if (source == snapobjectButton)
20002254 {
2001
- //Reload(lastConverter, lastFilename, true);
20022255 SnapObject();
20032256 } else
20042257 // if (event.getSource() == recompileButton)
....@@ -2374,9 +2627,9 @@
23742627 {
23752628 ClearSelection(true);
23762629 } else
2377
- if (source == grabItem)
2630
+ if (source == grabItem || source == groupButton)
23782631 {
2379
- group(new cGroup(), true);
2632
+ group(new cGroup(), false); // true);
23802633 } else
23812634 if (source == hideItem)
23822635 {
....@@ -2394,11 +2647,11 @@
23942647 {
23952648 makeSomething(new Camera());
23962649 } else
2397
- if (source == compositeItem)
2650
+ if (source == compositeItem || source == compositeButton)
23982651 {
23992652 group(new Composite());
24002653 } else
2401
- if (source == randomItem)
2654
+ if (source == switchItem || source == switchButton)
24022655 {
24032656 RandomNode random = new RandomNode();
24042657 group(random);
....@@ -2500,7 +2753,7 @@
25002753 {
25012754 group(new cLinker());
25022755 } else
2503
- if (source == textureItem)
2756
+ if (source == textureItem || source == textureButton)
25042757 {
25052758 group(new TextureNode());
25062759 } else
....@@ -2520,17 +2773,30 @@
25202773 {
25212774 CastShadow(2);
25222775 } else
2523
- if (source == ungroupItem)
2776
+ if (source == ungroupItem || source == ungroupButton)
25242777 {
2525
- //ungroup();
2778
+ boolean hasRoot = false;
2779
+
25262780 for (int i=0; i<group.selection.size(); i++)
25272781 {
2528
- Ungroup(group.selection.get(i));
2782
+ if (group.selection.get(i) == group)
2783
+ {
2784
+ hasRoot = true;
2785
+ break;
2786
+ }
25292787 }
25302788
2531
- ClearSelection(false);
2532
-
2533
- refreshContents();
2789
+ if (!hasRoot)
2790
+ {
2791
+ for (int i=0; i<group.selection.size(); i++)
2792
+ {
2793
+ Ungroup(group.selection.get(i));
2794
+ }
2795
+
2796
+ ClearSelection(false);
2797
+
2798
+ refreshContents();
2799
+ }
25342800 } else
25352801 if (source == genUVItem)
25362802 {
....@@ -2607,6 +2873,22 @@
26072873 if (source == unmarkleavesItem)
26082874 {
26092875 MarkLeaves(false);
2876
+ } else
2877
+ if (source == rewindleavesItem)
2878
+ {
2879
+ RewindLeaves(true);
2880
+ } else
2881
+ if (source == unrewindleavesItem)
2882
+ {
2883
+ RewindLeaves(false);
2884
+ } else
2885
+ if (source == randomleavesItem)
2886
+ {
2887
+ RandomLeaves(true);
2888
+ } else
2889
+ if (source == unrandomleavesItem)
2890
+ {
2891
+ RandomLeaves(false);
26102892 } else
26112893 if (source == flipVItem)
26122894 {
....@@ -2842,6 +3124,10 @@
28423124 if (source == twoButton)
28433125 {
28443126 radio.layout = twoButton;
3127
+
3128
+ if (CameraPane.FULLSCREEN)
3129
+ fullscreenLayout = radio.layout;
3130
+
28453131 // bug
28463132 //gridPanel.setDividerLocation(1.0);
28473133 //bigPanel.setDividerLocation(0.0);
....@@ -2874,10 +3160,31 @@
28743160 bigThree.ClearUI();
28753161 bigThree.add(centralPanel);
28763162 bigThree.FlushUI();
3163
+
3164
+ cameraView.requestFocusInWindow();
3165
+
3166
+// refreshContents(true);
3167
+//
3168
+// try
3169
+// {
3170
+// java.awt.Robot bot = new java.awt.Robot();
3171
+// int mask = InputEvent.BUTTON1_MASK;
3172
+// bot.mouseMove(100, 100);
3173
+// bot.mousePress(mask);
3174
+// bot.mouseRelease(mask);
3175
+// }
3176
+// catch (Exception e)
3177
+// {
3178
+//
3179
+// }
3180
+
28773181 } else
28783182 if (source == threeButton)
28793183 {
28803184 radio.layout = threeButton;
3185
+
3186
+ if (CameraPane.FULLSCREEN)
3187
+ fullscreenLayout = radio.layout;
28813188
28823189 // bigThree.remove(scenePanel);
28833190 // bigThree.remove(centralPanel);
....@@ -2910,10 +3217,15 @@
29103217 bigThree.add(centralPanel);
29113218 bigThree.add(XYZPanel);
29123219 bigThree.FlushUI();
3220
+
3221
+ cameraView.requestFocusInWindow();
29133222 } else
29143223 if (source == fourButton)
29153224 {
29163225 radio.layout = fourButton;
3226
+
3227
+ if (CameraPane.FULLSCREEN)
3228
+ fullscreenLayout = radio.layout;
29173229
29183230 // bigThree.remove(scenePanel);
29193231 // bigThree.remove(centralPanel);
....@@ -2945,10 +3257,15 @@
29453257 bigThree.ClearUI();
29463258 bigThree.add(scenePanel);
29473259 bigThree.FlushUI();
3260
+
3261
+ cameraView.requestFocusInWindow();
29483262 } else
29493263 if (source == sixButton)
29503264 {
29513265 radio.layout = sixButton;
3266
+
3267
+ if (CameraPane.FULLSCREEN)
3268
+ fullscreenLayout = radio.layout;
29523269
29533270 // bigThree.remove(scenePanel);
29543271 // bigThree.remove(centralPanel);
....@@ -2981,10 +3298,15 @@
29813298 bigThree.add(scenePanel);
29823299 bigThree.add(centralPanel);
29833300 bigThree.FlushUI();
3301
+
3302
+ cameraView.requestFocusInWindow();
29843303 } else
29853304 if (source == sevenButton)
29863305 {
29873306 radio.layout = sevenButton;
3307
+
3308
+ if (CameraPane.FULLSCREEN)
3309
+ fullscreenLayout = radio.layout;
29883310
29893311 // bigThree.remove(scenePanel);
29903312 // bigThree.remove(centralPanel);
....@@ -3018,6 +3340,8 @@
30183340 bigThree.add(centralPanel);
30193341 bigThree.add(XYZPanel);
30203342 bigThree.FlushUI();
3343
+
3344
+ cameraView.requestFocusInWindow();
30213345 } else
30223346 if (source == rootButton)
30233347 {
....@@ -3029,6 +3353,7 @@
30293353 EditObject(obj);
30303354 }
30313355
3356
+ cameraView.requestFocusInWindow();
30323357 refreshContents(true);
30333358 } else
30343359 if (source == closeButton)
....@@ -3038,22 +3363,37 @@
30383363 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
30393364 {
30403365 ab = (cRadio)e.nextElement();
3041
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3366
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
30423367 {
3368
+ // Patch to avoid bug with transparency.
3369
+ if (!ab.hadMaterial)
3370
+ {
3371
+ ab.object.material = null;
3372
+ }
3373
+
30433374 buttonGroup.remove(ab);
30443375 radioPanel.remove(ab);
30453376
3046
- ab.GetObject().editWindow = null;
3377
+ //ab.GetObject().editWindow = null;
3378
+ ab.GetObject().manipWindow = null;
30473379 // ab.GetObject().objectUI = null; // ?????????
30483380
30493381 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
30503382 break;
30513383 }
30523384 }
3385
+
3386
+ cameraView.requestFocusInWindow();
30533387 refreshContents(true);
30543388 } else
30553389 if (source == editItem || source == editButton)
30563390 {
3391
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3392
+ {
3393
+ Object3D child = (Object3D)e.nextElement();
3394
+ child.pinned = true;
3395
+ }
3396
+
30573397 EditSelection(false);
30583398 } else
30593399 if (source == uneditButton)
....@@ -3063,6 +3403,7 @@
30633403 Object3D child = (Object3D)e.nextElement();
30643404 if(child.editWindow != null)
30653405 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3406
+ child.pinned = false;
30663407 child.CloseUI();
30673408 listUI.remove(child);
30683409
....@@ -3079,6 +3420,7 @@
30793420 //copy.ClearUI();
30803421 for (Object3D obj : listUI)
30813422 {
3423
+ obj.pinned = false;
30823424 obj.CloseUI();
30833425 }
30843426 listUI.clear();
....@@ -3088,7 +3430,7 @@
30883430 {
30893431 assert(copy == group);
30903432
3091
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3433
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
30923434
30933435 for (Object3D obj : listUI)
30943436 {
....@@ -3154,7 +3496,8 @@
31543496 }
31553497
31563498 // fix "+" issue
3157
- group.editWindow = this;
3499
+ //group.editWindow = this;
3500
+ group.manipWindow = this;
31583501
31593502 /*
31603503 currentLayout = radio.layout;
....@@ -3162,18 +3505,25 @@
31623505 currentLayout = sevenButton;
31633506 */
31643507 radio.layout.doClick();
3508
+
3509
+ ClearUnpinned();
3510
+ SetPinStates(group.selection.size() > 0);
3511
+ if (group.selection.size() == 1)
3512
+ EditSelection(false);
31653513 keepparent = group.parent;
31663514 // PARENT = NULL or not???
31673515 //group.parent = null; // ROOT
31683516 //group.attributes = -1;
31693517 ResetModel();
3518
+
3519
+ cameraView.requestFocusInWindow();
31703520 refreshContents(true);
31713521 } else if (event.getSource() == editCameraItem)
31723522 {
31733523 cameraView.ProtectCamera();
31743524 cameraView.repaint();
31753525 return;
3176
- } else if (event.getSource() == revertCameraItem)
3526
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
31773527 {
31783528 cameraView.RevertCamera();
31793529 cameraView.repaint();
....@@ -3190,7 +3540,6 @@
31903540 }
31913541
31923542 boolean useclient = false;
3193
- cRadio radio;
31943543
31953544 void ToggleRoot()
31963545 {
....@@ -4145,6 +4494,18 @@
41454494 refreshContents();
41464495 }
41474496
4497
+ void RewindLeaves(boolean hide)
4498
+ {
4499
+ group.selection.RewindLeaves(hide);
4500
+ refreshContents();
4501
+ }
4502
+
4503
+ void RandomLeaves(boolean hide)
4504
+ {
4505
+ group.selection.RandomLeaves(hide);
4506
+ refreshContents();
4507
+ }
4508
+
41484509 void SetTexRes(int tr)
41494510 {
41504511 group.selection.SetTexRes(tr);
....@@ -4216,10 +4577,6 @@
42164577 // }
42174578 // }
42184579
4219
- static boolean allparams = true;
4220
-
4221
- static Vector<Object3D> listUI = new Vector<Object3D>();
4222
-
42234580 void EditSelection(boolean newWindow)
42244581 {
42254582 // aConstraints.gridy = 0;
....@@ -4227,7 +4584,7 @@
42274584 {
42284585 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
42294586 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4230
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4587
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
42314588
42324589 Object3D elem = (Object3D)group.selection.elementAt(i);
42334590 if(elem != group || !newWindow)
....@@ -4312,7 +4669,8 @@
43124669 //new Exception().printStackTrace();
43134670
43144671 freezemodel = true;
4315
-
4672
+ ClearUnpinned();
4673
+
43164674 /**/
43174675 //switch (event.id)
43184676 {
....@@ -4320,7 +4678,6 @@
43204678 //case 702: // Event.LIST_DESELECT
43214679 group.deselectAll();
43224680 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4323
- objEditor.ClearInfo(); // .GetMaterial());
43244681 if (tps != null)
43254682 {
43264683 for (int i=0; i < tps.length; i++)
....@@ -4329,10 +4686,8 @@
43294686
43304687 //if (child.parent != null)
43314688 //child.parent.addSelectee(child);
4689
+ objEditor.SetMaterial(child);
43324690 group.addSelectee(child);
4333
- objEditor.SetMaterial(child); // .GetMaterial());
4334
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4335
- System.err.println("info : " + child.GetPath());
43364691 }
43374692 }
43384693 // else
....@@ -4342,15 +4697,13 @@
43424697 // System.err.println("info : " + group.GetPath());
43434698 // }
43444699
4345
- objEditor.SetText(); // jan 2014
4346
-
43474700 if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
43484701 CameraPane.flash = true;
43494702
43504703 if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
43514704 // a camera
43524705 {
4353
- if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4706
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
43544707 {
43554708 CameraPane.camerachangeframe = 0; // don't refuse it
43564709 Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
....@@ -4359,6 +4712,13 @@
43594712 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
43604713 }
43614714
4715
+ if (tps != null && tps.length == 1)
4716
+ {
4717
+ EditSelection(false);
4718
+ }
4719
+
4720
+ SetPinStates(tps != null && tps.length > 0);
4721
+
43624722 refreshContents();
43634723 //return true;
43644724 }
....@@ -4367,6 +4727,35 @@
43674727
43684728 freezemodel = false;
43694729 }
4730
+
4731
+ void SetPinStates(boolean enabled)
4732
+ {
4733
+ editButton.setEnabled(enabled);
4734
+ uneditButton.setEnabled(enabled);
4735
+ unselectButton.setEnabled(enabled);
4736
+ flashSelectionButton.setEnabled(enabled);
4737
+ }
4738
+
4739
+ void refreshContents(boolean cp)
4740
+ {
4741
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4742
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
4743
+ {
4744
+ objEditor.ClearInfo(); // .GetMaterial());
4745
+
4746
+ for (int i=0; i < group.selection.Size(); i++)
4747
+ {
4748
+ Object3D child = (Object3D) group.selection.get(i);
4749
+
4750
+ objEditor.AddInfo(child, this, true);
4751
+ System.err.println("info : " + child.GetPath());
4752
+ }
4753
+
4754
+ objEditor.SetText(); // jan 2014
4755
+ }
4756
+
4757
+ super.refreshContents(cp);
4758
+ }
43704759
43714760 void linkSomething(Object3D thing)
43724761 {
....@@ -4449,7 +4838,8 @@
44494838
44504839 if (cut)
44514840 {
4452
- Save();
4841
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4842
+// Save();
44534843 //int indices[] = jList.getSelectedIndices();
44544844 //for (int i = indices.length - 1; i >= 0; i--)
44554845 //jList.remove(indices[i]);
....@@ -4552,6 +4942,10 @@
45524942
45534943 void paste(boolean expand)
45544944 {
4945
+ if (Globals.SAVEONMAKE)
4946
+ Save();
4947
+ boolean keep = Globals.SAVEONMAKE;
4948
+ Globals.SAVEONMAKE = false;
45554949 // if (GrafreeD.clipboard == null)
45564950 // return;
45574951 boolean first = true;
....@@ -4611,6 +5005,7 @@
46115005 Grafreed.clipboard.get(0).parent = keepparent;
46125006 }
46135007
5008
+ Globals.SAVEONMAKE = keep;
46145009 ResetModel();
46155010 refreshContents();
46165011 }
....@@ -4746,6 +5141,10 @@
47465141
47475142 void group(Object3D csg, boolean grab)
47485143 {
5144
+ if (Globals.SAVEONMAKE)
5145
+ Save();
5146
+ boolean keep = Globals.SAVEONMAKE;
5147
+ Globals.SAVEONMAKE = false;
47495148 if (//false) // why??
47505149 !group.selection.isEmpty())
47515150 {
....@@ -4859,10 +5258,15 @@
48595258 //node.add(csg);
48605259 //makeSomething(node);
48615260 makeSomething(csg);
5261
+ Globals.SAVEONMAKE = keep;
48625262 }
48635263
48645264 void Ungroup(Object3D g)
48655265 {
5266
+ if (Globals.SAVEONMAKE)
5267
+ Save();
5268
+ boolean keep = Globals.SAVEONMAKE;
5269
+ Globals.SAVEONMAKE = false;
48665270 if (g instanceof HiddenObject)
48675271 {
48685272 HiddenObject h = (HiddenObject) g;
....@@ -4879,6 +5283,7 @@
48795283 objEditor.makeSomething(g.get(i), false);
48805284 }
48815285 }
5286
+ Globals.SAVEONMAKE = keep;
48825287 }
48835288
48845289 void ungroup()
....@@ -5167,10 +5572,28 @@
51675572 cButton clearpanelButton;
51685573 cButton unselectButton;
51695574
5575
+ cButton restoreCameraButton;
5576
+
51705577 cButton saveButton;
5171
- cButton undoButton;
5172
- cButton redoButton;
51735578 cButton oneStepButton;
5579
+
5580
+ cButton groupButton;
5581
+ cButton ungroupButton;
5582
+ cButton compositeButton;
5583
+ cButton switchButton;
5584
+ cButton loopButton;
5585
+ cButton textureButton;
5586
+
5587
+ cButton gridButton;
5588
+ cButton boxButton;
5589
+ cButton sphereButton;
5590
+ cButton coneButton;
5591
+ cButton torusButton;
5592
+ cButton superButton;
5593
+ cButton kleinButton;
5594
+ cButton particlesButton;
5595
+ cButton overlayButton;
5596
+ cButton lightButton;
51745597
51755598 cButton screenfitButton;
51765599 cButton screenfitpointButton;
....@@ -5183,14 +5606,6 @@
51835606
51845607 cButton setsupportButton;
51855608
5186
- cButton twoButton;
5187
- cButton sixButton;
5188
- cButton threeButton;
5189
- cButton sevenButton;
5190
- cButton fourButton; // full panel
5191
- cButton oneButton; // full XYZ
5192
- //cButton currentLayout;
5193
-
51945609 //
51955610 //Composite
51965611 Object3D // to do !!
....@@ -5200,11 +5615,11 @@
52005615 //JTree jTree;
52015616 private MenuItem lookAtItem;
52025617 private MenuItem lookFromItem;
5203
- private MenuItem switchItem;
5618
+ private MenuItem switchViewItem;
52045619 private MenuItem cutItem;
52055620 private MenuItem undoItem;
52065621 private MenuItem redoItem;
5207
- private MenuItem duplicateItem;
5622
+ private JMenuItem duplicateItem;
52085623 private MenuItem cloneItem;
52095624 private MenuItem cloneSupportItem;
52105625 private MenuItem overwriteGeoItem;
....@@ -5267,6 +5682,10 @@
52675682 private MenuItem showleavesItem;
52685683 private MenuItem markleavesItem;
52695684 private MenuItem unmarkleavesItem;
5685
+ private MenuItem rewindleavesItem;
5686
+ private MenuItem unrewindleavesItem;
5687
+ private MenuItem randomleavesItem;
5688
+ private MenuItem unrandomleavesItem;
52705689
52715690 private MenuItem flipVItem;
52725691 private MenuItem unflipVItem;
....@@ -5288,7 +5707,7 @@
52885707 private MenuItem frontItem;
52895708 private MenuItem cameraItem;
52905709 private MenuItem compositeItem;
5291
- private MenuItem randomItem;
5710
+ private MenuItem switchItem;
52925711 private MenuItem physicsItem;
52935712 private MenuItem frameselectorItem;
52945713 private MenuItem scriptNodeItem;
....@@ -5362,5 +5781,5 @@
53625781
53635782 Menu cameraMenu;
53645783 MenuItem editCameraItem;
5365
- MenuItem revertCameraItem;
5784
+ MenuItem restoreCameraItem;
53665785 }