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);
....@@ -202,23 +209,23 @@
202209 //zBufferItem.addActionListener(this);
203210 //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
204211 //normalLensItem.addActionListener(this);
205
- cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
206
- revertCameraItem.addActionListener(this);
212
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
213
+ restoreCameraItem.addActionListener(this);
207214
208
- cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
209
- toggleFullScreenItem.addItemListener(this);
210
- toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
211
- 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);
212227
213
- cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
214
- toggleTextureItem.addItemListener(this);
215
- toggleTextureItem.setState(CameraPane.textureon);
216
-
217
- cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
218
- toggleSwitchItem.addItemListener(this);
219
- toggleSwitchItem.setState(CameraPane.SWITCH);
220
-
221
- cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
228
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
222229 toggleHandleItem.addItemListener(this);
223230 toggleHandleItem.setState(CameraPane.HANDLES);
224231
....@@ -273,7 +280,7 @@
273280 {
274281 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
275282 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
276
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
283
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
277284 editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
278285 oe.cameraMenu.add("-");
279286 openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
....@@ -281,7 +288,7 @@
281288 editLeafItem.addActionListener(this);
282289 lookAtItem.addActionListener(this);
283290 //lookFromItem.addActinoListener(this);
284
- //switchItem.addActionListener(this);
291
+ //switchViewItem.addActionListener(this);
285292 }
286293
287294 oe.menuBar.add(menu = new Menu("Setting"));
....@@ -326,21 +333,29 @@
326333 }
327334
328335 oe.menuBar.add(menu = new Menu("Group"));
329
- grabItem = menu.add(new MenuItem("Grab"));
330
- grabItem.addActionListener(this);
336
+// grabItem = menu.add(new MenuItem("Grab"));
337
+// grabItem.addActionListener(this);
331338 backItem = menu.add(new MenuItem("Back"));
332339 backItem.addActionListener(this);
333340 frontItem = menu.add(new MenuItem("Front"));
334341 frontItem.addActionListener(this);
335
- compositeItem = menu.add(new MenuItem("Composite"));
336
- compositeItem.addActionListener(this);
342
+// compositeItem = menu.add(new MenuItem("Composite"));
343
+// compositeItem.addActionListener(this);
344
+
345
+ if (Globals.ADVANCED)
346
+ {
337347 hideItem = menu.add(new MenuItem("Hidden Group"));
338348 hideItem.addActionListener(this);
349
+ }
339350 ungroupItem = menu.add(new MenuItem("Ungroup"));
340351 ungroupItem.addActionListener(this);
341
- menu.add("-");
342
- randomItem = menu.add(new MenuItem("Switch node"));
343
- 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
+ {
344359 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
345360 switchGeoItem.addActionListener(this);
346361 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
....@@ -348,8 +363,6 @@
348363 morphItem = menu.add(new MenuItem("Morph Group"));
349364 morphItem.addActionListener(this);
350365
351
- if (Globals.ADVANCED)
352
- {
353366 menu.add("-");
354367 physicsItem = menu.add(new MenuItem("Physics"));
355368 physicsItem.addActionListener(this);
....@@ -357,13 +370,11 @@
357370 frameselectorItem.addActionListener(this);
358371 scriptNodeItem = menu.add(new MenuItem("Script Node"));
359372 scriptNodeItem.addActionListener(this);
360
- cameraItem = menu.add(new MenuItem("Camera"));
361
- cameraItem.addActionListener(this);
362373 }
363374
364375 oe.menuBar.add(menu = new Menu("Object"));
365
- textureItem = menu.add(new MenuItem("Texture"));
366
- textureItem.addActionListener(this);
376
+// textureItem = menu.add(new MenuItem("Texture"));
377
+// textureItem.addActionListener(this);
367378 billboardItem = menu.add(new MenuItem("Billboard"));
368379 billboardItem.addActionListener(this);
369380 csgItem = menu.add(new MenuItem("CSG"));
....@@ -374,13 +385,14 @@
374385 shadowYItem.addActionListener(this);
375386 shadowZItem = menu.add(new MenuItem("Shadow Blue"));
376387 shadowZItem.addActionListener(this);
388
+ attributeItem = menu.add(new MenuItem("Attribute"));
389
+ attributeItem.addActionListener(this);
390
+
377391 if (Globals.ADVANCED)
378392 {
379393 menu.add("-");
380394 linkerItem = menu.add(new MenuItem("Linker"));
381395 linkerItem.addActionListener(this);
382
- attributeItem = menu.add(new MenuItem("Attribute"));
383
- attributeItem.addActionListener(this);
384396 templateItem = menu.add(new MenuItem("Template"));
385397 templateItem.addActionListener(this);
386398 pointflowItem = menu.add(new MenuItem("Point Flow"));
....@@ -574,51 +586,66 @@
574586 oe.radioPanel.add(dummyButton);
575587 oe.buttonGroup.add(dummyButton);
576588 */
589
+ cGridBag copyOptionsPanel = new cGridBag();
590
+
591
+ copyOptionsPanel.preferredHeight = 1;
592
+
577593 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
578594
579595 //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
580596 //minButton.setToolTipText("Minimize window");
581597 //minButton.addActionListener(this);
582598
583
- oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
584
- maxButton.setToolTipText("Maximize window");
585
- maxButton.addActionListener(this);
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
+ }
586605
587606 oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
588607 fullButton.setToolTipText("Full-screen window");
589608 fullButton.addActionListener(this);
590609
591
- oe.toolbarPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
592
- undoButton.setToolTipText("Undo changes");
593
- undoButton.addActionListener(this);
594
-
595
- oe.toolbarPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
- redoButton.setToolTipText("Redo changes");
597
- redoButton.addActionListener(this);
598
-
599
- oe.toolbarPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
- saveButton.setToolTipText("Save changes");
601
- saveButton.addActionListener(this);
602
-
603
- oe.toolbarPanel.add(liveCB = GetCheckBox("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
604
- liveCB.setToolTipText("Enable animation");
605
- liveCB.addItemListener(this);
606
-
607
- oe.toolbarPanel.add(fastCB = GetCheckBox("icons/runfast.png", CameraPane.FAST)); //, constraints);
608
- fastCB.setToolTipText("Fast mode");
609
- fastCB.addItemListener(this);
610
-
611
- oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
612
- oneStepButton.setToolTipText("Animate one step forward");
613
- oneStepButton.addActionListener(this);
614
-
615
- oe.toolbarPanel.add(trackCB = GetCheckBox("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
616
- trackCB.setToolTipText("Enable tracking");
617
- trackCB.addItemListener(this);
618
-
619610 oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620611 screenfitButton.setToolTipText("Screen fit");
621612 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);
619
+ undoButton.setToolTipText("Undo changes");
620
+ undoButton.addActionListener(this);
621
+ undoButton.setEnabled(false);
622
+
623
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
624
+ redoButton.setToolTipText("Redo changes");
625
+ redoButton.addActionListener(this);
626
+ redoButton.setEnabled(false);
627
+
628
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629
+ saveButton.setToolTipText("Save changes");
630
+ saveButton.addActionListener(this);
631
+
632
+ copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
633
+ liveCB.setToolTipText("Enable animation");
634
+ liveCB.addItemListener(this);
635
+
636
+ copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
637
+ oneStepButton.setToolTipText("Animate one step forward");
638
+ oneStepButton.addActionListener(this);
639
+
640
+ copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
641
+ fastCB.setToolTipText("Fast mode");
642
+ fastCB.addItemListener(this);
643
+
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);
622649
623650 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
624651 // screenfitpointButton.addActionListener(this);
....@@ -630,15 +657,13 @@
630657 snapobjectButton.setToolTipText("Snap Object");
631658 }
632659
633
- oe.toolbarPanel.add(flashSelectionButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
- flashSelectionButton.setToolTipText("Highlight selection");
635
- flashSelectionButton.addActionListener(this);
636
-
637
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
660
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
638661
639662 oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
640663 twoButton.setToolTipText("Show center view only");
641664 twoButton.addActionListener(this);
665
+ this.fullscreenLayout = twoButton;
666
+
642667 oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
643668 fourButton.addActionListener(this);
644669 fourButton.setToolTipText("Show left panel only");
....@@ -653,26 +678,105 @@
653678 sevenButton.addActionListener(this);
654679 //
655680
656
- 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);
657682 rootButton.setToolTipText("Edit selection in new tab");
658683 rootButton.addActionListener(this);
659684
660
- 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);
661686 closeButton.setToolTipText("Close tab");
662687 closeButton.addActionListener(this);
663688 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
664689 //clearButton.addActionListener(this);
665
-
666
- editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
667
- editButton.setToolTipText("Edit selection");
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
+ }
722
+
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");
668772 editButton.addActionListener(this);
669773
670
- editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
671
- uneditButton.setToolTipText("Unedit selection");
774
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
775
+ uneditButton.setToolTipText("Remove selection controls");
672776 uneditButton.addActionListener(this);
673777
674778 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
675
- allParamsButton.setToolTipText("Edit all params");
779
+ allParamsButton.setToolTipText("Show all controle");
676780 allParamsButton.addActionListener(this);
677781
678782 editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -683,8 +787,13 @@
683787 unselectButton.setToolTipText("Unselect");
684788 unselectButton.addActionListener(this);
685789
790
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
791
+ flashSelectionButton.setToolTipText("Highlight selection");
792
+ flashSelectionButton.addActionListener(this);
793
+
686794 editCommandsPanel.preferredHeight = 1;
687795
796
+ SetPinStates(false);
688797 // oe.treePanel.add(commandsPanel);
689798 // oe.treePanel.Return();
690799
....@@ -703,27 +812,12 @@
703812
704813 JScrollPane jSP;
705814 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
706
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
815
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
707816 ResetModel();
708817
709818 oe.treePanel.add(jSPPanel);
710819 oe.treePanel.Return();
711820
712
- cGridBag copyOptionsPanel = new cGridBag();
713
-
714
- copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
715
- colorCB.setToolTipText("Copy color when dropped");
716
- colorCB.addItemListener(this);
717
-
718
- copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
719
- materialCB.setToolTipText("Copy material when dropped");
720
- materialCB.addItemListener(this);
721
-
722
- copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
723
- textureCB.setToolTipText("Copy texture when dropped");
724
- textureCB.addItemListener(this);
725
-
726
- copyOptionsPanel.preferredHeight = 1;
727821 oe.treePanel.add(copyOptionsPanel);
728822 oe.treePanel.Return();
729823
....@@ -754,23 +848,43 @@
754848
755849 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
756850 {
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
+
757865 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
758866 boxCB.setToolTipText("Display bounding boxes");
759867 boxCB.addItemListener(this);
760868
761869 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
762
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
870
+ zoomBoxCB.setToolTipText("Display only for wheel");
763871 zoomBoxCB.addItemListener(this);
764872
765873 if (true) // Globals.ADVANCED)
766874 {
767
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
768
- supportCB.setToolTipText("Enable rigging");
769
- 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);
770882
771883 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
772884 // localCB.addItemListener(this);
773885
886
+ panel.Return();
887
+
774888 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
775889 crowdCB.setToolTipText("Used for crowds");
776890 crowdCB.addItemListener(this);
....@@ -787,6 +901,8 @@
787901 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
788902 // speakerMocapCB.addItemListener(this);
789903
904
+ panel.Return();
905
+
790906 if (false)
791907 {
792908 // handled in scripts
....@@ -801,24 +917,39 @@
801917 //constraints.gridy += 1;
802918 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
803919 smoothfocusCB.addItemListener(this);
920
+ panel.Return();
804921 }
805922
806923 //constraints.gridx += 1;
807924 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
808925 // debugCB.addItemListener(this);
809926
927
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
928
+ trackCB.setToolTipText("Enable tracking target");
929
+ trackCB.addItemListener(this);
930
+
810931 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
811
- oeilCB.setToolTipText("Move camera when tracking target");
932
+ oeilCB.setToolTipText("Move camera when tracking");
812933 oeilCB.addItemListener(this);
813934
814935 panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
815
- shadowCB.setToolTipText("Compute shadows when live");
936
+ shadowCB.setToolTipText("When live compute shadows");
816937 shadowCB.addItemListener(this);
817938
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
+
818948 panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
819
- autosaveCB.setToolTipText("Auto-save on structure change");
949
+ autosaveCB.setToolTipText("On structure change");
820950 autosaveCB.addItemListener(this);
821951
952
+ panel.Return();
822953 if (Globals.ADVANCED)
823954 {
824955 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
....@@ -829,10 +960,15 @@
829960 }
830961
831962 cGridBag fill = new cGridBag();
832
-
833963 fill.preferredHeight = 200;
964
+ cGridBag fill2 = new cGridBag();
965
+ fill2.preferredHeight = 200;
966
+ cGridBag fill3 = new cGridBag();
967
+ fill3.preferredHeight = 200;
834968
835969 panel.add(fill);
970
+ panel.add(fill2);
971
+ panel.add(fill3);
836972
837973 }
838974
....@@ -840,7 +976,7 @@
840976 {
841977 cRadio radioButton = new cRadio(obj.name);
842978
843
- // Patch to avoid bug with transparency.
979
+ // June 2019. Patch to avoid bug with transparency.
844980 radioButton.hadMaterial = obj.material != null;
845981 if (!radioButton.hadMaterial)
846982 {
....@@ -868,15 +1004,17 @@
8681004 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
8691005 }
8701006
871
- cCheckBox liveCB;
1007
+ cToggleButton liveCB;
8721008 cCheckBox supportCB;
8731009 cCheckBox localCB;
8741010 cCheckBox crowdCB;
8751011 cCheckBox smoothCB;
876
- cCheckBox fastCB;
1012
+ cToggleButton fastCB;
8771013 cCheckBox slowCB;
8781014 cCheckBox boxCB;
8791015 cCheckBox zoomBoxCB;
1016
+ cCheckBox freezeCB;
1017
+ //cToggleButton trackCB;
8801018 cCheckBox trackCB;
8811019 cCheckBox smoothfocusCB;
8821020 // JCheckBox speakerMocapCB;
....@@ -994,6 +1132,10 @@
9941132 {
9951133 Globals.COMPUTESHADOWWHENLIVE ^= true;
9961134 }
1135
+ else if(e.getSource() == freezeCB)
1136
+ {
1137
+ Globals.FREEZEONMOVE ^= true;
1138
+ }
9971139 else if(e.getSource() == autosaveCB)
9981140 {
9991141 Globals.SAVEONMAKE ^= true;
....@@ -1014,7 +1156,8 @@
10141156
10151157 /**/
10161158 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
1017
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1159
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1160
+ TreePath path = objEditor.jTree.getSelectionPath();
10181161 if ((path == null) || (path.getPathCount() <= 1)) {
10191162 // We can't move the root node or an empty selection
10201163 return;
....@@ -1077,8 +1220,6 @@
10771220 }
10781221 }
10791222
1080
- String string = (String) object;
1081
-
10821223 System.out.println("Transfer = " + object + "; drop : " + target);
10831224 // if( object instanceof java.io.File[])
10841225 // {
....@@ -1086,6 +1227,8 @@
10861227 // objEditor.DropFile((java.io.File[]) object, true);
10871228 // return;
10881229 // }
1230
+
1231
+ String string = object.toString();
10891232
10901233 // File path for Mac and Windows
10911234 if (string.charAt(0) == '/' || string.charAt(1) == ':')
....@@ -1131,23 +1274,33 @@
11311274
11321275 assert target == objEditor.jTree;
11331276 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1277
+ Object3D destinationLeaf;
11341278 try {
1135
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1279
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
11361280 } catch (Exception e) {
11371281 System.out.println("destinationPath : " + destinationPath);
11381282 return;
11391283 }
11401284
1141
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1285
+ for (int i=group.selection.size(); --i>=0;)
11421286 {
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
+// {
11431296 loadClipboard(true);
11441297 objEditor.jTree.setSelectionPath(destinationPath);
11451298 pasteInto(false, false);
1146
- } else {
1147
- loadClipboard(false);
1148
- objEditor.jTree.setSelectionPath(destinationPath);
1149
- pasteInto(false, false); // true); // ???
1150
- }
1299
+// } else {
1300
+// loadClipboard(false);
1301
+// objEditor.jTree.setSelectionPath(destinationPath);
1302
+// pasteInto(false, false); // true); // ???
1303
+// }
11511304 }
11521305 public void dropActionChanged(DropTargetDragEvent dtde)
11531306 // Called if the user has modified the current drop gesture
....@@ -1252,22 +1405,30 @@
12521405 {
12531406 //heightFieldItem = menu.add(new MenuItem("Height Field"));
12541407 //heightFieldItem.addActionListener(this);
1255
- gridItem = menu.add(new MenuItem("Grid"));
1256
- gridItem.addActionListener(this);
1257
- rectoidItem = menu.add(new MenuItem("Box"));
1258
- rectoidItem.addActionListener(this);
1259
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1260
- ellipsoidItem.addActionListener(this);
1261
- coneItem = menu.add(new MenuItem("Cone"));
1262
- coneItem.addActionListener(this);
1263
- torusItem = menu.add(new MenuItem("Torus"));
1264
- torusItem.addActionListener(this);
1265
- superItem = menu.add(new MenuItem("Superellipsoid"));
1266
- 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
+ {
12671426 kleinItem = menu.add(new MenuItem("Klein Bottle"));
12681427 kleinItem.addActionListener(this);
1269
- particleItem = menu.add(new MenuItem("Particle system"));
1270
- particleItem.addActionListener(this);
1428
+ }
1429
+
1430
+// particleItem = menu.add(new MenuItem("Particle system"));
1431
+// particleItem.addActionListener(this);
12711432 if (Globals.ADVANCED)
12721433 {
12731434 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1293,15 +1454,15 @@
12931454 }
12941455 bezierItem = menu.add(new MenuItem("Bezier Patch"));
12951456 bezierItem.addActionListener(this);
1296
- overlayItem = menu.add(new MenuItem("Overlay"));
1297
- overlayItem.addActionListener(this);
1298
- lightItem = menu.add(new MenuItem("Light"));
1299
- 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);
13001461 menu.add("-");
13011462 //superLoopItem = menu.add(new MenuItem("Super Loop"));
13021463 //superLoopItem.addActionListener(this);
1303
- loopItem = menu.add(new MenuItem("Loop"));
1304
- loopItem.addActionListener(this);
1464
+// loopItem = menu.add(new MenuItem("Loop"));
1465
+// loopItem.addActionListener(this);
13051466 doubleItem = menu.add(new MenuItem("Fork"));
13061467 doubleItem.addActionListener(this);
13071468 if (Globals.ADVANCED)
....@@ -1317,6 +1478,9 @@
13171478 animationItem.addItemListener(this);
13181479 animationItem.setState(Globals.ANIMATION);
13191480
1481
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1482
+ archiveItem.addActionListener(this);
1483
+
13201484 menu.add("-");
13211485 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
13221486 parseverticesItem.addActionListener(this);
....@@ -1329,6 +1493,8 @@
13291493 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
13301494 reduce34MorphItem.addActionListener(this);
13311495 menu.add("-");
1496
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1497
+ memoryItem.addActionListener(this);
13321498 menu.add(computeAOItem = new MenuItem("Compute AO"));
13331499 computeAOItem.addActionListener(this);
13341500
....@@ -1337,8 +1503,6 @@
13371503 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
13381504 mirrorItem.addActionListener(this);
13391505 menu.add("-");
1340
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1341
- memoryItem.addActionListener(this);
13421506 menu.add(analyzeItem = new MenuItem("Analyze"));
13431507 analyzeItem.addActionListener(this);
13441508 menu.add(dumpItem = new MenuItem("Print"));
....@@ -1486,6 +1650,20 @@
14861650
14871651 makeSomething(shadow);
14881652 }
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
+ }
14891667
14901668 /**
14911669 * applyExample
....@@ -1730,7 +1908,7 @@
17301908 {
17311909 ScreenFit();
17321910 } else
1733
- if (source == switchItem)
1911
+ if (source == switchViewItem)
17341912 {
17351913 cVector v1 = new cVector();
17361914 cVector v2 = new cVector();
....@@ -1739,11 +1917,11 @@
17391917 objEditor.cameraView.renderCamera.setAim(v2, v1);
17401918 objEditor.cameraView.repaint();
17411919 } else
1742
- if (source == rectoidItem)
1920
+ if (source == rectoidItem || source == boxButton)
17431921 {
17441922 makeSomething(new Box());
17451923 } else
1746
- if (source == particleItem)
1924
+ if (source == particleItem || source == particlesButton)
17471925 {
17481926 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
17491927 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1822,27 +2000,27 @@
18222000
18232001 makeSomething(obj);
18242002 } else
1825
- if (source == gridItem)
2003
+ if (source == gridItem || source == gridButton)
18262004 {
18272005 makeSomething(new Grid());
18282006 } else
1829
- if (source == ellipsoidItem)
2007
+ if (source == ellipsoidItem || source == sphereButton)
18302008 {
18312009 makeSomething(new Sphere());
18322010 } else
1833
- if (source == coneItem)
2011
+ if (source == coneItem || source == coneButton)
18342012 {
18352013 makeSomething(new Cone());
18362014 } else
1837
- if (source == torusItem)
2015
+ if (source == torusItem || source == torusButton)
18382016 {
18392017 makeSomething(new Torus());
18402018 } else
1841
- if (source == superItem)
2019
+ if (source == superItem || source == superButton)
18422020 {
18432021 makeSomething(new Superellipsoid());
18442022 } else
1845
- if (source == kleinItem)
2023
+ if (source == kleinItem || source == kleinButton)
18462024 {
18472025 makeSomething(new Klein());
18482026 } else
....@@ -1862,7 +2040,7 @@
18622040 {
18632041 makeSomething(new BezierSurface());
18642042 } else
1865
- if (source == overlayItem)
2043
+ if (source == overlayItem || source == overlayButton)
18662044 {
18672045 /*
18682046 Object3D obj = new BezierSurface(5,8);
....@@ -1910,7 +2088,7 @@
19102088 s.setup();
19112089 makeSomething(s);
19122090 } else
1913
- if (source == lightItem)
2091
+ if (source == lightItem || source == lightButton)
19142092 {
19152093 makeSomething(new Light());
19162094 } else
....@@ -1960,30 +2138,30 @@
19602138
19612139 group(g);
19622140 } else
1963
- if (source == loopItem)
2141
+ if (source == loopItem || source == loopButton)
19642142 {
19652143 Composite csg = new GroupLeaf();
19662144 csg.count = 5;
19672145 group(csg);
1968
- Composite child = new cGroup();
2146
+ Composite child = new cGroup("Branch");
19692147 csg.addChild(child);
19702148 child.addChild(csg);
19712149 } else
19722150 if (source == doubleItem)
19732151 {
1974
- Composite csg = new GroupLeaf();
2152
+ Composite csg = new GroupLeaf("Fork");
19752153 csg.count = 5;
19762154 group(csg);
1977
- Composite child = new cGroup();
2155
+ Composite child = new cGroup("Branch A");
19782156 csg.addChild(child);
19792157 child.addChild(csg);
1980
- child = new cGroup();
2158
+ child = new cGroup("Branch B");
19812159 csg.addChild(child);
19822160 child.addChild(csg);
19832161 } else
19842162 if (source == tripleItem)
19852163 {
1986
- Composite csg = new GroupLeaf();
2164
+ Composite csg = new GroupLeaf("Trident");
19872165 csg.count = 4;
19882166 group(csg);
19892167 Composite child = new cGroup();
....@@ -2047,7 +2225,8 @@
20472225 } else
20482226 if (source == undoButton)
20492227 {
2050
- Undo();
2228
+ if (!Undo())
2229
+ java.awt.Toolkit.getDefaultToolkit().beep();
20512230 } else
20522231 if (source == redoButton)
20532232 {
....@@ -2055,7 +2234,8 @@
20552234 } else
20562235 if (source == saveButton)
20572236 {
2058
- Save();
2237
+ if (!Save(true))
2238
+ java.awt.Toolkit.getDefaultToolkit().beep();
20592239 } else
20602240 if (source == oneStepButton)
20612241 {
....@@ -2064,17 +2244,14 @@
20642244 } else
20652245 if (source == screenfitButton)
20662246 {
2067
- //Reload(lastConverter, lastFilename, true);
20682247 ScreenFit();
20692248 } else
20702249 if (source == screenfitpointButton)
20712250 {
2072
- //Reload(lastConverter, lastFilename, true);
20732251 ScreenFitPoint();
20742252 } else
20752253 if (source == snapobjectButton)
20762254 {
2077
- //Reload(lastConverter, lastFilename, true);
20782255 SnapObject();
20792256 } else
20802257 // if (event.getSource() == recompileButton)
....@@ -2450,9 +2627,9 @@
24502627 {
24512628 ClearSelection(true);
24522629 } else
2453
- if (source == grabItem)
2630
+ if (source == grabItem || source == groupButton)
24542631 {
2455
- group(new cGroup(), true);
2632
+ group(new cGroup(), false); // true);
24562633 } else
24572634 if (source == hideItem)
24582635 {
....@@ -2470,11 +2647,11 @@
24702647 {
24712648 makeSomething(new Camera());
24722649 } else
2473
- if (source == compositeItem)
2650
+ if (source == compositeItem || source == compositeButton)
24742651 {
24752652 group(new Composite());
24762653 } else
2477
- if (source == randomItem)
2654
+ if (source == switchItem || source == switchButton)
24782655 {
24792656 RandomNode random = new RandomNode();
24802657 group(random);
....@@ -2576,7 +2753,7 @@
25762753 {
25772754 group(new cLinker());
25782755 } else
2579
- if (source == textureItem)
2756
+ if (source == textureItem || source == textureButton)
25802757 {
25812758 group(new TextureNode());
25822759 } else
....@@ -2596,17 +2773,30 @@
25962773 {
25972774 CastShadow(2);
25982775 } else
2599
- if (source == ungroupItem)
2776
+ if (source == ungroupItem || source == ungroupButton)
26002777 {
2601
- //ungroup();
2778
+ boolean hasRoot = false;
2779
+
26022780 for (int i=0; i<group.selection.size(); i++)
26032781 {
2604
- Ungroup(group.selection.get(i));
2782
+ if (group.selection.get(i) == group)
2783
+ {
2784
+ hasRoot = true;
2785
+ break;
2786
+ }
26052787 }
26062788
2607
- ClearSelection(false);
2608
-
2609
- 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
+ }
26102800 } else
26112801 if (source == genUVItem)
26122802 {
....@@ -2934,6 +3124,10 @@
29343124 if (source == twoButton)
29353125 {
29363126 radio.layout = twoButton;
3127
+
3128
+ if (CameraPane.FULLSCREEN)
3129
+ fullscreenLayout = radio.layout;
3130
+
29373131 // bug
29383132 //gridPanel.setDividerLocation(1.0);
29393133 //bigPanel.setDividerLocation(0.0);
....@@ -2989,6 +3183,9 @@
29893183 {
29903184 radio.layout = threeButton;
29913185
3186
+ if (CameraPane.FULLSCREEN)
3187
+ fullscreenLayout = radio.layout;
3188
+
29923189 // bigThree.remove(scenePanel);
29933190 // bigThree.remove(centralPanel);
29943191 // bigThree.remove(XYZPanel);
....@@ -3027,6 +3224,9 @@
30273224 {
30283225 radio.layout = fourButton;
30293226
3227
+ if (CameraPane.FULLSCREEN)
3228
+ fullscreenLayout = radio.layout;
3229
+
30303230 // bigThree.remove(scenePanel);
30313231 // bigThree.remove(centralPanel);
30323232 // bigThree.remove(XYZPanel);
....@@ -3063,6 +3263,9 @@
30633263 if (source == sixButton)
30643264 {
30653265 radio.layout = sixButton;
3266
+
3267
+ if (CameraPane.FULLSCREEN)
3268
+ fullscreenLayout = radio.layout;
30663269
30673270 // bigThree.remove(scenePanel);
30683271 // bigThree.remove(centralPanel);
....@@ -3101,6 +3304,9 @@
31013304 if (source == sevenButton)
31023305 {
31033306 radio.layout = sevenButton;
3307
+
3308
+ if (CameraPane.FULLSCREEN)
3309
+ fullscreenLayout = radio.layout;
31043310
31053311 // bigThree.remove(scenePanel);
31063312 // bigThree.remove(centralPanel);
....@@ -3182,6 +3388,12 @@
31823388 } else
31833389 if (source == editItem || source == editButton)
31843390 {
3391
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3392
+ {
3393
+ Object3D child = (Object3D)e.nextElement();
3394
+ child.pinned = true;
3395
+ }
3396
+
31853397 EditSelection(false);
31863398 } else
31873399 if (source == uneditButton)
....@@ -3191,6 +3403,7 @@
31913403 Object3D child = (Object3D)e.nextElement();
31923404 if(child.editWindow != null)
31933405 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3406
+ child.pinned = false;
31943407 child.CloseUI();
31953408 listUI.remove(child);
31963409
....@@ -3207,6 +3420,7 @@
32073420 //copy.ClearUI();
32083421 for (Object3D obj : listUI)
32093422 {
3423
+ obj.pinned = false;
32103424 obj.CloseUI();
32113425 }
32123426 listUI.clear();
....@@ -3216,7 +3430,7 @@
32163430 {
32173431 assert(copy == group);
32183432
3219
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3433
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
32203434
32213435 for (Object3D obj : listUI)
32223436 {
....@@ -3291,6 +3505,11 @@
32913505 currentLayout = sevenButton;
32923506 */
32933507 radio.layout.doClick();
3508
+
3509
+ ClearUnpinned();
3510
+ SetPinStates(group.selection.size() > 0);
3511
+ if (group.selection.size() == 1)
3512
+ EditSelection(false);
32943513 keepparent = group.parent;
32953514 // PARENT = NULL or not???
32963515 //group.parent = null; // ROOT
....@@ -3304,7 +3523,7 @@
33043523 cameraView.ProtectCamera();
33053524 cameraView.repaint();
33063525 return;
3307
- } else if (event.getSource() == revertCameraItem)
3526
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
33083527 {
33093528 cameraView.RevertCamera();
33103529 cameraView.repaint();
....@@ -4358,10 +4577,6 @@
43584577 // }
43594578 // }
43604579
4361
- static boolean allparams = true;
4362
-
4363
- static Vector<Object3D> listUI = new Vector<Object3D>();
4364
-
43654580 void EditSelection(boolean newWindow)
43664581 {
43674582 // aConstraints.gridy = 0;
....@@ -4369,7 +4584,7 @@
43694584 {
43704585 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
43714586 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4372
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4587
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
43734588
43744589 Object3D elem = (Object3D)group.selection.elementAt(i);
43754590 if(elem != group || !newWindow)
....@@ -4454,7 +4669,8 @@
44544669 //new Exception().printStackTrace();
44554670
44564671 freezemodel = true;
4457
-
4672
+ ClearUnpinned();
4673
+
44584674 /**/
44594675 //switch (event.id)
44604676 {
....@@ -4487,7 +4703,7 @@
44874703 if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
44884704 // a camera
44894705 {
4490
- if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4706
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
44914707 {
44924708 CameraPane.camerachangeframe = 0; // don't refuse it
44934709 Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
....@@ -4496,6 +4712,13 @@
44964712 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
44974713 }
44984714
4715
+ if (tps != null && tps.length == 1)
4716
+ {
4717
+ EditSelection(false);
4718
+ }
4719
+
4720
+ SetPinStates(tps != null && tps.length > 0);
4721
+
44994722 refreshContents();
45004723 //return true;
45014724 }
....@@ -4505,9 +4728,18 @@
45054728 freezemodel = false;
45064729 }
45074730
4731
+ void SetPinStates(boolean enabled)
4732
+ {
4733
+ editButton.setEnabled(enabled);
4734
+ uneditButton.setEnabled(enabled);
4735
+ unselectButton.setEnabled(enabled);
4736
+ flashSelectionButton.setEnabled(enabled);
4737
+ }
4738
+
45084739 void refreshContents(boolean cp)
45094740 {
4510
- if (!Globals.MOUSEDRAGGED)
4741
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4742
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
45114743 {
45124744 objEditor.ClearInfo(); // .GetMaterial());
45134745
....@@ -4606,8 +4838,8 @@
46064838
46074839 if (cut)
46084840 {
4609
- if (Globals.SAVEONMAKE)
4610
- Save();
4841
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4842
+// Save();
46114843 //int indices[] = jList.getSelectedIndices();
46124844 //for (int i = indices.length - 1; i >= 0; i--)
46134845 //jList.remove(indices[i]);
....@@ -4710,6 +4942,10 @@
47104942
47114943 void paste(boolean expand)
47124944 {
4945
+ if (Globals.SAVEONMAKE)
4946
+ Save();
4947
+ boolean keep = Globals.SAVEONMAKE;
4948
+ Globals.SAVEONMAKE = false;
47134949 // if (GrafreeD.clipboard == null)
47144950 // return;
47154951 boolean first = true;
....@@ -4769,6 +5005,7 @@
47695005 Grafreed.clipboard.get(0).parent = keepparent;
47705006 }
47715007
5008
+ Globals.SAVEONMAKE = keep;
47725009 ResetModel();
47735010 refreshContents();
47745011 }
....@@ -4904,6 +5141,10 @@
49045141
49055142 void group(Object3D csg, boolean grab)
49065143 {
5144
+ if (Globals.SAVEONMAKE)
5145
+ Save();
5146
+ boolean keep = Globals.SAVEONMAKE;
5147
+ Globals.SAVEONMAKE = false;
49075148 if (//false) // why??
49085149 !group.selection.isEmpty())
49095150 {
....@@ -5017,10 +5258,15 @@
50175258 //node.add(csg);
50185259 //makeSomething(node);
50195260 makeSomething(csg);
5261
+ Globals.SAVEONMAKE = keep;
50205262 }
50215263
50225264 void Ungroup(Object3D g)
50235265 {
5266
+ if (Globals.SAVEONMAKE)
5267
+ Save();
5268
+ boolean keep = Globals.SAVEONMAKE;
5269
+ Globals.SAVEONMAKE = false;
50245270 if (g instanceof HiddenObject)
50255271 {
50265272 HiddenObject h = (HiddenObject) g;
....@@ -5037,6 +5283,7 @@
50375283 objEditor.makeSomething(g.get(i), false);
50385284 }
50395285 }
5286
+ Globals.SAVEONMAKE = keep;
50405287 }
50415288
50425289 void ungroup()
....@@ -5325,13 +5572,28 @@
53255572 cButton clearpanelButton;
53265573 cButton unselectButton;
53275574
5328
- cButton minButton;
5329
- cButton maxButton;
5330
- cButton fullButton;
5331
- cButton undoButton;
5332
- cButton redoButton;
5575
+ cButton restoreCameraButton;
5576
+
53335577 cButton saveButton;
53345578 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;
53355597
53365598 cButton screenfitButton;
53375599 cButton screenfitpointButton;
....@@ -5353,11 +5615,11 @@
53535615 //JTree jTree;
53545616 private MenuItem lookAtItem;
53555617 private MenuItem lookFromItem;
5356
- private MenuItem switchItem;
5618
+ private MenuItem switchViewItem;
53575619 private MenuItem cutItem;
53585620 private MenuItem undoItem;
53595621 private MenuItem redoItem;
5360
- private MenuItem duplicateItem;
5622
+ private JMenuItem duplicateItem;
53615623 private MenuItem cloneItem;
53625624 private MenuItem cloneSupportItem;
53635625 private MenuItem overwriteGeoItem;
....@@ -5445,7 +5707,7 @@
54455707 private MenuItem frontItem;
54465708 private MenuItem cameraItem;
54475709 private MenuItem compositeItem;
5448
- private MenuItem randomItem;
5710
+ private MenuItem switchItem;
54495711 private MenuItem physicsItem;
54505712 private MenuItem frameselectorItem;
54515713 private MenuItem scriptNodeItem;
....@@ -5519,5 +5781,5 @@
55195781
55205782 Menu cameraMenu;
55215783 MenuItem editCameraItem;
5522
- MenuItem revertCameraItem;
5784
+ MenuItem restoreCameraItem;
55235785 }