Normand Briere
2019-06-25 26b24f5b623e709a88e91e9bce0864f9d5e8f084
GroupEditor.java
....@@ -150,6 +150,8 @@
150150
151151 void SetupMenu2(GroupEditor oe)
152152 {
153
+ oe.jTree = new cTree();
154
+
153155 Menu menu;
154156 oe.menuBar.add(menu = new Menu("Edit"));
155157 //editItem = menu.add(new MenuItem("Edit"));
....@@ -160,7 +162,7 @@
160162 // redoItem = menu.add(new MenuItem("Redo"));
161163 // redoItem.addActionListener(this);
162164 // menu.add("-");
163
- duplicateItem = menu.add(new MenuItem("Duplicate"));
165
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
164166 duplicateItem.addActionListener(this);
165167 cloneItem = menu.add(new MenuItem("Clone"));
166168 cloneItem.addActionListener(this);
....@@ -202,21 +204,21 @@
202204 //zBufferItem.addActionListener(this);
203205 //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
204206 //normalLensItem.addActionListener(this);
205
- cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
206
- revertCameraItem.addActionListener(this);
207
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
208
+ restoreCameraItem.addActionListener(this);
207209
208
- cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
209
- toggleFullScreenItem.addItemListener(this);
210
- toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
211
- cameraMenu.add("-");
212
-
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);
210
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
211
+// toggleFullScreenItem.addItemListener(this);
212
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
213
+// cameraMenu.add("-");
214
+//
215
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
216
+// toggleTextureItem.addItemListener(this);
217
+// toggleTextureItem.setState(CameraPane.textureon);
218
+//
219
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
220
+// toggleSwitchItem.addItemListener(this);
221
+// toggleSwitchItem.setState(CameraPane.SWITCH);
220222
221223 cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
222224 toggleHandleItem.addItemListener(this);
....@@ -273,7 +275,7 @@
273275 {
274276 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
275277 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
276
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
278
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
277279 editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
278280 oe.cameraMenu.add("-");
279281 openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
....@@ -281,7 +283,7 @@
281283 editLeafItem.addActionListener(this);
282284 lookAtItem.addActionListener(this);
283285 //lookFromItem.addActinoListener(this);
284
- //switchItem.addActionListener(this);
286
+ //switchViewItem.addActionListener(this);
285287 }
286288
287289 oe.menuBar.add(menu = new Menu("Setting"));
....@@ -326,21 +328,29 @@
326328 }
327329
328330 oe.menuBar.add(menu = new Menu("Group"));
329
- grabItem = menu.add(new MenuItem("Grab"));
330
- grabItem.addActionListener(this);
331
+// grabItem = menu.add(new MenuItem("Grab"));
332
+// grabItem.addActionListener(this);
331333 backItem = menu.add(new MenuItem("Back"));
332334 backItem.addActionListener(this);
333335 frontItem = menu.add(new MenuItem("Front"));
334336 frontItem.addActionListener(this);
335
- compositeItem = menu.add(new MenuItem("Composite"));
336
- compositeItem.addActionListener(this);
337
+// compositeItem = menu.add(new MenuItem("Composite"));
338
+// compositeItem.addActionListener(this);
339
+
340
+ if (Globals.ADVANCED)
341
+ {
337342 hideItem = menu.add(new MenuItem("Hidden Group"));
338343 hideItem.addActionListener(this);
344
+ }
339345 ungroupItem = menu.add(new MenuItem("Ungroup"));
340346 ungroupItem.addActionListener(this);
341
- menu.add("-");
342
- randomItem = menu.add(new MenuItem("Switch node"));
343
- randomItem.addActionListener(this);
347
+
348
+// menu.add("-");
349
+//
350
+// switchItem = menu.add(new MenuItem("Switch node"));
351
+// switchItem.addActionListener(this);
352
+ if (Globals.ADVANCED)
353
+ {
344354 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
345355 switchGeoItem.addActionListener(this);
346356 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
....@@ -348,8 +358,6 @@
348358 morphItem = menu.add(new MenuItem("Morph Group"));
349359 morphItem.addActionListener(this);
350360
351
- if (Globals.ADVANCED)
352
- {
353361 menu.add("-");
354362 physicsItem = menu.add(new MenuItem("Physics"));
355363 physicsItem.addActionListener(this);
....@@ -357,13 +365,11 @@
357365 frameselectorItem.addActionListener(this);
358366 scriptNodeItem = menu.add(new MenuItem("Script Node"));
359367 scriptNodeItem.addActionListener(this);
360
- cameraItem = menu.add(new MenuItem("Camera"));
361
- cameraItem.addActionListener(this);
362368 }
363369
364370 oe.menuBar.add(menu = new Menu("Object"));
365
- textureItem = menu.add(new MenuItem("Texture"));
366
- textureItem.addActionListener(this);
371
+// textureItem = menu.add(new MenuItem("Texture"));
372
+// textureItem.addActionListener(this);
367373 billboardItem = menu.add(new MenuItem("Billboard"));
368374 billboardItem.addActionListener(this);
369375 csgItem = menu.add(new MenuItem("CSG"));
....@@ -574,51 +580,61 @@
574580 oe.radioPanel.add(dummyButton);
575581 oe.buttonGroup.add(dummyButton);
576582 */
583
+ cGridBag copyOptionsPanel = new cGridBag();
584
+
585
+ copyOptionsPanel.preferredHeight = 2;
586
+
577587 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
578588
579589 //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
580590 //minButton.setToolTipText("Minimize window");
581591 //minButton.addActionListener(this);
582592
583
- oe.toolbarPanel.add(maxButton = new cButton("\u271A", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
593
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
584594 maxButton.setToolTipText("Maximize window");
585595 maxButton.addActionListener(this);
586596
587
- oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
597
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
588598 fullButton.setToolTipText("Full-screen window");
589599 fullButton.addActionListener(this);
590600
591
- oe.toolbarPanel.add(undoButton = new cButton("\u21a9", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
601
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602
+ restoreCameraButton.setToolTipText("Restore viewpoint");
603
+ restoreCameraButton.addActionListener(this);
604
+
605
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
592606 undoButton.setToolTipText("Undo changes");
593607 undoButton.addActionListener(this);
594608
595
- oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
609
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596610 redoButton.setToolTipText("Redo changes");
597611 redoButton.addActionListener(this);
598612
599
- oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
613
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600614 saveButton.setToolTipText("Save changes");
601615 saveButton.addActionListener(this);
602616
603
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
617
+ copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
604618 liveCB.setToolTipText("Enable animation");
605619 liveCB.addItemListener(this);
606620
607
- oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
621
+ copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608622 oneStepButton.setToolTipText("Animate one step forward");
609623 oneStepButton.addActionListener(this);
610624
611
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
625
+ copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
612626 fastCB.setToolTipText("Fast mode");
613627 fastCB.addItemListener(this);
614628
615
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints);
616
- trackCB.setToolTipText("Enable tracking");
617
- trackCB.addItemListener(this);
618
-
619
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629
+ //oe.toolboxPanel.Return();
630
+
631
+ copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620632 screenfitButton.setToolTipText("Screen fit");
621633 screenfitButton.addActionListener(this);
634
+
635
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
636
+// trackCB.setToolTipText("Enable tracking");
637
+// trackCB.addItemListener(this);
622638
623639 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
624640 // screenfitpointButton.addActionListener(this);
....@@ -630,15 +646,13 @@
630646 snapobjectButton.setToolTipText("Snap Object");
631647 }
632648
633
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
- flashSelectionButton.setToolTipText("Show selection");
635
- flashSelectionButton.addActionListener(this);
636
-
637
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
649
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
638650
639651 oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
640652 twoButton.setToolTipText("Show center view only");
641653 twoButton.addActionListener(this);
654
+ this.fullscreenLayout = twoButton;
655
+
642656 oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
643657 fourButton.addActionListener(this);
644658 fourButton.setToolTipText("Show left panel only");
....@@ -653,16 +667,83 @@
653667 sevenButton.addActionListener(this);
654668 //
655669
656
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
670
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
657671 rootButton.setToolTipText("Edit selection in new tab");
658672 rootButton.addActionListener(this);
659673
660
- oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
674
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
661675 closeButton.setToolTipText("Close tab");
662676 closeButton.addActionListener(this);
663677 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
664678 //clearButton.addActionListener(this);
665
-
679
+
680
+ // INSERT
681
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
682
+ gridButton.setToolTipText("Create grid");
683
+ gridButton.addActionListener(this);
684
+
685
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
686
+ boxButton.setToolTipText("Create box");
687
+ boxButton.addActionListener(this);
688
+
689
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
690
+ sphereButton.setToolTipText("Create sphere");
691
+ sphereButton.addActionListener(this);
692
+
693
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
694
+ coneButton.setToolTipText("Create cone");
695
+ coneButton.addActionListener(this);
696
+
697
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
698
+ torusButton.setToolTipText("Create torus");
699
+ torusButton.addActionListener(this);
700
+
701
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
702
+ superButton.setToolTipText("Create superellipsoid");
703
+ superButton.addActionListener(this);
704
+
705
+ if (Globals.ADVANCED)
706
+ {
707
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
708
+ kleinButton.setToolTipText("Create Klein bottle");
709
+ kleinButton.addActionListener(this);
710
+ }
711
+
712
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
713
+ particlesButton.setToolTipText("Create particle system");
714
+ particlesButton.addActionListener(this);
715
+
716
+ oe.toolboxPanel.Return();
717
+
718
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
719
+ groupButton.setToolTipText("Create group");
720
+ groupButton.addActionListener(this);
721
+
722
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
723
+ compositeButton.setToolTipText("Create composite");
724
+ compositeButton.addActionListener(this);
725
+
726
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
727
+ switchButton.setToolTipText("Create switch");
728
+ switchButton.addActionListener(this);
729
+
730
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
731
+ loopButton.setToolTipText("Create loop");
732
+ loopButton.addActionListener(this);
733
+
734
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
735
+ textureButton.setToolTipText("Create texture");
736
+ textureButton.addActionListener(this);
737
+
738
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
739
+ overlayButton.setToolTipText("Create overlay");
740
+ overlayButton.addActionListener(this);
741
+
742
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
743
+ lightButton.setToolTipText("Create light");
744
+ lightButton.addActionListener(this);
745
+
746
+ // EDIT panel
666747 editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
667748 editButton.setToolTipText("Edit selection");
668749 editButton.addActionListener(this);
....@@ -683,6 +764,10 @@
683764 unselectButton.setToolTipText("Unselect");
684765 unselectButton.addActionListener(this);
685766
767
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
768
+ flashSelectionButton.setToolTipText("Highlight selection");
769
+ flashSelectionButton.addActionListener(this);
770
+
686771 editCommandsPanel.preferredHeight = 1;
687772
688773 // oe.treePanel.add(commandsPanel);
....@@ -703,27 +788,12 @@
703788
704789 JScrollPane jSP;
705790 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
706
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
791
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
707792 ResetModel();
708793
709794 oe.treePanel.add(jSPPanel);
710795 oe.treePanel.Return();
711796
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;
727797 oe.treePanel.add(copyOptionsPanel);
728798 oe.treePanel.Return();
729799
....@@ -754,6 +824,20 @@
754824
755825 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
756826 {
827
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
828
+ colorCB.setToolTipText("Copy color when dropped");
829
+ colorCB.addItemListener(this);
830
+
831
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
832
+ materialCB.setToolTipText("Copy material when dropped");
833
+ materialCB.addItemListener(this);
834
+
835
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
836
+ textureCB.setToolTipText("Copy texture when dropped");
837
+ textureCB.addItemListener(this);
838
+
839
+ panel.Return();
840
+
757841 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
758842 boxCB.setToolTipText("Display bounding boxes");
759843 boxCB.addItemListener(this);
....@@ -771,6 +855,8 @@
771855 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
772856 // localCB.addItemListener(this);
773857
858
+ panel.Return();
859
+
774860 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
775861 crowdCB.setToolTipText("Used for crowds");
776862 crowdCB.addItemListener(this);
....@@ -787,6 +873,8 @@
787873 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
788874 // speakerMocapCB.addItemListener(this);
789875
876
+ panel.Return();
877
+
790878 if (false)
791879 {
792880 // handled in scripts
....@@ -801,32 +889,72 @@
801889 //constraints.gridy += 1;
802890 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
803891 smoothfocusCB.addItemListener(this);
892
+ panel.Return();
804893 }
805894
806895 //constraints.gridx += 1;
807896 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
808897 // debugCB.addItemListener(this);
809898
899
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
900
+ trackCB.setToolTipText("Enable tracking target");
901
+ trackCB.addItemListener(this);
902
+
810903 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
904
+ oeilCB.setToolTipText("Move camera when tracking");
811905 oeilCB.addItemListener(this);
812906
907
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
908
+ shadowCB.setToolTipText("Compute shadows when live");
909
+ shadowCB.addItemListener(this);
910
+
911
+ panel.Return();
912
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
913
+ toggleTextureCB.setToolTipText("Load textures");
914
+ toggleTextureCB.addItemListener(this);
915
+
916
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
917
+ toggleSwitchCB.setToolTipText("Use switch");
918
+ toggleSwitchCB.addItemListener(this);
919
+
920
+ panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
921
+ autosaveCB.setToolTipText("Auto-save on structure change");
922
+ autosaveCB.addItemListener(this);
923
+
924
+ panel.Return();
925
+ if (Globals.ADVANCED)
926
+ {
813927 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
814928 lookAtCB.setToolTipText("Look-at target");
815929 lookAtCB.addItemListener(this);
930
+ }
816931
817932 }
818933
819934 cGridBag fill = new cGridBag();
820
-
821935 fill.preferredHeight = 200;
936
+ cGridBag fill2 = new cGridBag();
937
+ fill2.preferredHeight = 200;
938
+ cGridBag fill3 = new cGridBag();
939
+ fill3.preferredHeight = 200;
822940
823941 panel.add(fill);
942
+ panel.add(fill2);
943
+ panel.add(fill3);
824944
825945 }
826946
827947 void EditObject(Object3D obj)
828948 {
829949 cRadio radioButton = new cRadio(obj.name);
950
+
951
+ // Patch to avoid bug with transparency.
952
+ radioButton.hadMaterial = obj.material != null;
953
+ if (!radioButton.hadMaterial)
954
+ {
955
+ obj.material = new cMaterial();
956
+ }
957
+
830958 radioButton.SetObject(obj);
831959 radioButton.layout = sevenButton;
832960 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -848,23 +976,27 @@
848976 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
849977 }
850978
851
- JCheckBox liveCB;
852
- JCheckBox supportCB;
853
- JCheckBox localCB;
854
- JCheckBox crowdCB;
855
- JCheckBox smoothCB;
856
- JCheckBox fastCB;
857
- JCheckBox slowCB;
858
- JCheckBox boxCB;
859
- JCheckBox zoomBoxCB;
860
- JCheckBox trackCB;
861
- JCheckBox smoothfocusCB;
979
+ cToggleButton liveCB;
980
+ cCheckBox supportCB;
981
+ cCheckBox localCB;
982
+ cCheckBox crowdCB;
983
+ cCheckBox smoothCB;
984
+ cToggleButton fastCB;
985
+ cCheckBox slowCB;
986
+ cCheckBox boxCB;
987
+ cCheckBox zoomBoxCB;
988
+ //cToggleButton trackCB;
989
+ cCheckBox trackCB;
990
+ cCheckBox smoothfocusCB;
862991 // JCheckBox speakerMocapCB;
863
- JCheckBox speakerCameraCB;
864
- JCheckBox speakerFocusCB;
865
- JCheckBox debugCB;
866
- JCheckBox oeilCB;
867
- JCheckBox lookAtCB;
992
+ cCheckBox speakerCameraCB;
993
+ cCheckBox speakerFocusCB;
994
+ cCheckBox debugCB;
995
+
996
+ cCheckBox oeilCB;
997
+ cCheckBox shadowCB;
998
+ cCheckBox autosaveCB;
999
+ cCheckBox lookAtCB;
8681000
8691001 // static int COLOR = 1;
8701002 // static int MATERIAL = 2;
....@@ -872,9 +1004,9 @@
8721004
8731005 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
8741006
875
- JCheckBox colorCB;
876
- JCheckBox materialCB;
877
- JCheckBox textureCB;
1007
+ cCheckBox colorCB;
1008
+ cCheckBox materialCB;
1009
+ cCheckBox textureCB;
8781010
8791011 public void itemStateChanged(ItemEvent e)
8801012 {
....@@ -967,6 +1099,14 @@
9671099 {
9681100 cameraView.ToggleOeil();
9691101 }
1102
+ else if(e.getSource() == shadowCB)
1103
+ {
1104
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1105
+ }
1106
+ else if(e.getSource() == autosaveCB)
1107
+ {
1108
+ Globals.SAVEONMAKE ^= true;
1109
+ }
9701110 else if(e.getSource() == lookAtCB)
9711111 {
9721112 cameraView.ToggleLookAt();
....@@ -983,7 +1123,8 @@
9831123
9841124 /**/
9851125 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
986
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1126
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1127
+ TreePath path = objEditor.jTree.getSelectionPath();
9871128 if ((path == null) || (path.getPathCount() <= 1)) {
9881129 // We can't move the root node or an empty selection
9891130 return;
....@@ -1100,23 +1241,33 @@
11001241
11011242 assert target == objEditor.jTree;
11021243 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1244
+ Object3D destinationLeaf;
11031245 try {
1104
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1246
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
11051247 } catch (Exception e) {
11061248 System.out.println("destinationPath : " + destinationPath);
11071249 return;
11081250 }
11091251
1110
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1252
+ for (int i=group.selection.size(); --i>=0;)
11111253 {
1254
+ Object3D child = (Object3D)group.selection.elementAt(i);
1255
+
1256
+ // Cannot move into itself
1257
+ if (child == destinationLeaf)
1258
+ return;
1259
+ }
1260
+
1261
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1262
+// {
11121263 loadClipboard(true);
11131264 objEditor.jTree.setSelectionPath(destinationPath);
11141265 pasteInto(false, false);
1115
- } else {
1116
- loadClipboard(false);
1117
- objEditor.jTree.setSelectionPath(destinationPath);
1118
- pasteInto(false, false); // true); // ???
1119
- }
1266
+// } else {
1267
+// loadClipboard(false);
1268
+// objEditor.jTree.setSelectionPath(destinationPath);
1269
+// pasteInto(false, false); // true); // ???
1270
+// }
11201271 }
11211272 public void dropActionChanged(DropTargetDragEvent dtde)
11221273 // Called if the user has modified the current drop gesture
....@@ -1221,22 +1372,30 @@
12211372 {
12221373 //heightFieldItem = menu.add(new MenuItem("Height Field"));
12231374 //heightFieldItem.addActionListener(this);
1224
- gridItem = menu.add(new MenuItem("Grid"));
1225
- gridItem.addActionListener(this);
1226
- rectoidItem = menu.add(new MenuItem("Box"));
1227
- rectoidItem.addActionListener(this);
1228
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1229
- ellipsoidItem.addActionListener(this);
1230
- coneItem = menu.add(new MenuItem("Cone"));
1231
- coneItem.addActionListener(this);
1232
- torusItem = menu.add(new MenuItem("Torus"));
1233
- torusItem.addActionListener(this);
1234
- superItem = menu.add(new MenuItem("Superellipsoid"));
1235
- superItem.addActionListener(this);
1375
+// gridItem = menu.add(new MenuItem("Grid"));
1376
+// gridItem.addActionListener(this);
1377
+// rectoidItem = menu.add(new MenuItem("Box"));
1378
+// rectoidItem.addActionListener(this);
1379
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1380
+// ellipsoidItem.addActionListener(this);
1381
+// coneItem = menu.add(new MenuItem("Cone"));
1382
+// coneItem.addActionListener(this);
1383
+// torusItem = menu.add(new MenuItem("Torus"));
1384
+// torusItem.addActionListener(this);
1385
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1386
+// superItem.addActionListener(this);
1387
+
1388
+ cameraItem = menu.add(new MenuItem("Camera"));
1389
+ cameraItem.addActionListener(this);
1390
+
1391
+ if (!Globals.ADVANCED)
1392
+ {
12361393 kleinItem = menu.add(new MenuItem("Klein Bottle"));
12371394 kleinItem.addActionListener(this);
1238
- particleItem = menu.add(new MenuItem("Particle system"));
1239
- particleItem.addActionListener(this);
1395
+ }
1396
+
1397
+// particleItem = menu.add(new MenuItem("Particle system"));
1398
+// particleItem.addActionListener(this);
12401399 if (Globals.ADVANCED)
12411400 {
12421401 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1262,15 +1421,15 @@
12621421 }
12631422 bezierItem = menu.add(new MenuItem("Bezier Patch"));
12641423 bezierItem.addActionListener(this);
1265
- overlayItem = menu.add(new MenuItem("Overlay"));
1266
- overlayItem.addActionListener(this);
1267
- lightItem = menu.add(new MenuItem("Light"));
1268
- lightItem.addActionListener(this);
1424
+// overlayItem = menu.add(new MenuItem("Overlay"));
1425
+// overlayItem.addActionListener(this);
1426
+// lightItem = menu.add(new MenuItem("Light"));
1427
+// lightItem.addActionListener(this);
12691428 menu.add("-");
12701429 //superLoopItem = menu.add(new MenuItem("Super Loop"));
12711430 //superLoopItem.addActionListener(this);
1272
- loopItem = menu.add(new MenuItem("Loop"));
1273
- loopItem.addActionListener(this);
1431
+// loopItem = menu.add(new MenuItem("Loop"));
1432
+// loopItem.addActionListener(this);
12741433 doubleItem = menu.add(new MenuItem("Fork"));
12751434 doubleItem.addActionListener(this);
12761435 if (Globals.ADVANCED)
....@@ -1699,7 +1858,7 @@
16991858 {
17001859 ScreenFit();
17011860 } else
1702
- if (source == switchItem)
1861
+ if (source == switchViewItem)
17031862 {
17041863 cVector v1 = new cVector();
17051864 cVector v2 = new cVector();
....@@ -1708,11 +1867,11 @@
17081867 objEditor.cameraView.renderCamera.setAim(v2, v1);
17091868 objEditor.cameraView.repaint();
17101869 } else
1711
- if (source == rectoidItem)
1870
+ if (source == rectoidItem || source == boxButton)
17121871 {
17131872 makeSomething(new Box());
17141873 } else
1715
- if (source == particleItem)
1874
+ if (source == particleItem || source == particlesButton)
17161875 {
17171876 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
17181877 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1791,27 +1950,27 @@
17911950
17921951 makeSomething(obj);
17931952 } else
1794
- if (source == gridItem)
1953
+ if (source == gridItem || source == gridButton)
17951954 {
17961955 makeSomething(new Grid());
17971956 } else
1798
- if (source == ellipsoidItem)
1957
+ if (source == ellipsoidItem || source == sphereButton)
17991958 {
18001959 makeSomething(new Sphere());
18011960 } else
1802
- if (source == coneItem)
1961
+ if (source == coneItem || source == coneButton)
18031962 {
18041963 makeSomething(new Cone());
18051964 } else
1806
- if (source == torusItem)
1965
+ if (source == torusItem || source == torusButton)
18071966 {
18081967 makeSomething(new Torus());
18091968 } else
1810
- if (source == superItem)
1969
+ if (source == superItem || source == superButton)
18111970 {
18121971 makeSomething(new Superellipsoid());
18131972 } else
1814
- if (source == kleinItem)
1973
+ if (source == kleinItem || source == kleinButton)
18151974 {
18161975 makeSomething(new Klein());
18171976 } else
....@@ -1831,7 +1990,7 @@
18311990 {
18321991 makeSomething(new BezierSurface());
18331992 } else
1834
- if (source == overlayItem)
1993
+ if (source == overlayItem || source == overlayButton)
18351994 {
18361995 /*
18371996 Object3D obj = new BezierSurface(5,8);
....@@ -1879,7 +2038,7 @@
18792038 s.setup();
18802039 makeSomething(s);
18812040 } else
1882
- if (source == lightItem)
2041
+ if (source == lightItem || source == lightButton)
18832042 {
18842043 makeSomething(new Light());
18852044 } else
....@@ -1929,7 +2088,7 @@
19292088
19302089 group(g);
19312090 } else
1932
- if (source == loopItem)
2091
+ if (source == loopItem || source == loopButton)
19332092 {
19342093 Composite csg = new GroupLeaf();
19352094 csg.count = 5;
....@@ -2419,9 +2578,9 @@
24192578 {
24202579 ClearSelection(true);
24212580 } else
2422
- if (source == grabItem)
2581
+ if (source == grabItem || source == groupButton)
24232582 {
2424
- group(new cGroup(), true);
2583
+ group(new cGroup(), false); // true);
24252584 } else
24262585 if (source == hideItem)
24272586 {
....@@ -2439,11 +2598,11 @@
24392598 {
24402599 makeSomething(new Camera());
24412600 } else
2442
- if (source == compositeItem)
2601
+ if (source == compositeItem || source == compositeButton)
24432602 {
24442603 group(new Composite());
24452604 } else
2446
- if (source == randomItem)
2605
+ if (source == switchItem || source == switchButton)
24472606 {
24482607 RandomNode random = new RandomNode();
24492608 group(random);
....@@ -2545,7 +2704,7 @@
25452704 {
25462705 group(new cLinker());
25472706 } else
2548
- if (source == textureItem)
2707
+ if (source == textureItem || source == textureButton)
25492708 {
25502709 group(new TextureNode());
25512710 } else
....@@ -2565,7 +2724,7 @@
25652724 {
25662725 CastShadow(2);
25672726 } else
2568
- if (source == ungroupItem)
2727
+ if (source == ungroupItem || source == ungroupButton)
25692728 {
25702729 //ungroup();
25712730 for (int i=0; i<group.selection.size(); i++)
....@@ -2903,6 +3062,10 @@
29033062 if (source == twoButton)
29043063 {
29053064 radio.layout = twoButton;
3065
+
3066
+ if (CameraPane.FULLSCREEN)
3067
+ fullscreenLayout = radio.layout;
3068
+
29063069 // bug
29073070 //gridPanel.setDividerLocation(1.0);
29083071 //bigPanel.setDividerLocation(0.0);
....@@ -2958,6 +3121,9 @@
29583121 {
29593122 radio.layout = threeButton;
29603123
3124
+ if (CameraPane.FULLSCREEN)
3125
+ fullscreenLayout = radio.layout;
3126
+
29613127 // bigThree.remove(scenePanel);
29623128 // bigThree.remove(centralPanel);
29633129 // bigThree.remove(XYZPanel);
....@@ -2996,6 +3162,9 @@
29963162 {
29973163 radio.layout = fourButton;
29983164
3165
+ if (CameraPane.FULLSCREEN)
3166
+ fullscreenLayout = radio.layout;
3167
+
29993168 // bigThree.remove(scenePanel);
30003169 // bigThree.remove(centralPanel);
30013170 // bigThree.remove(XYZPanel);
....@@ -3032,6 +3201,9 @@
30323201 if (source == sixButton)
30333202 {
30343203 radio.layout = sixButton;
3204
+
3205
+ if (CameraPane.FULLSCREEN)
3206
+ fullscreenLayout = radio.layout;
30353207
30363208 // bigThree.remove(scenePanel);
30373209 // bigThree.remove(centralPanel);
....@@ -3070,6 +3242,9 @@
30703242 if (source == sevenButton)
30713243 {
30723244 radio.layout = sevenButton;
3245
+
3246
+ if (CameraPane.FULLSCREEN)
3247
+ fullscreenLayout = radio.layout;
30733248
30743249 // bigThree.remove(scenePanel);
30753250 // bigThree.remove(centralPanel);
....@@ -3126,12 +3301,19 @@
31263301 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
31273302 {
31283303 ab = (cRadio)e.nextElement();
3129
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3304
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
31303305 {
3306
+ // Patch to avoid bug with transparency.
3307
+ if (!ab.hadMaterial)
3308
+ {
3309
+ ab.object.material = null;
3310
+ }
3311
+
31313312 buttonGroup.remove(ab);
31323313 radioPanel.remove(ab);
31333314
3134
- ab.GetObject().editWindow = null;
3315
+ //ab.GetObject().editWindow = null;
3316
+ ab.GetObject().manipWindow = null;
31353317 // ab.GetObject().objectUI = null; // ?????????
31363318
31373319 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
....@@ -3245,6 +3427,7 @@
32453427
32463428 // fix "+" issue
32473429 //group.editWindow = this;
3430
+ group.manipWindow = this;
32483431
32493432 /*
32503433 currentLayout = radio.layout;
....@@ -3265,7 +3448,7 @@
32653448 cameraView.ProtectCamera();
32663449 cameraView.repaint();
32673450 return;
3268
- } else if (event.getSource() == revertCameraItem)
3451
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
32693452 {
32703453 cameraView.RevertCamera();
32713454 cameraView.repaint();
....@@ -4330,7 +4513,7 @@
43304513 {
43314514 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
43324515 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4333
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4516
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
43344517
43354518 Object3D elem = (Object3D)group.selection.elementAt(i);
43364519 if(elem != group || !newWindow)
....@@ -4468,7 +4651,8 @@
44684651
44694652 void refreshContents(boolean cp)
44704653 {
4471
- if (!Globals.MOUSEDRAGGED)
4654
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4655
+ if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING)
44724656 {
44734657 objEditor.ClearInfo(); // .GetMaterial());
44744658
....@@ -4567,6 +4751,7 @@
45674751
45684752 if (cut)
45694753 {
4754
+ if (Globals.SAVEONMAKE)
45704755 Save();
45714756 //int indices[] = jList.getSelectedIndices();
45724757 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -5285,6 +5470,8 @@
52855470 cButton clearpanelButton;
52865471 cButton unselectButton;
52875472
5473
+ cButton restoreCameraButton;
5474
+
52885475 cButton minButton;
52895476 cButton maxButton;
52905477 cButton fullButton;
....@@ -5292,6 +5479,24 @@
52925479 cButton redoButton;
52935480 cButton saveButton;
52945481 cButton oneStepButton;
5482
+
5483
+ cButton groupButton;
5484
+ cButton ungroupButton;
5485
+ cButton compositeButton;
5486
+ cButton switchButton;
5487
+ cButton loopButton;
5488
+ cButton textureButton;
5489
+
5490
+ cButton gridButton;
5491
+ cButton boxButton;
5492
+ cButton sphereButton;
5493
+ cButton coneButton;
5494
+ cButton torusButton;
5495
+ cButton superButton;
5496
+ cButton kleinButton;
5497
+ cButton particlesButton;
5498
+ cButton overlayButton;
5499
+ cButton lightButton;
52955500
52965501 cButton screenfitButton;
52975502 cButton screenfitpointButton;
....@@ -5313,11 +5518,11 @@
53135518 //JTree jTree;
53145519 private MenuItem lookAtItem;
53155520 private MenuItem lookFromItem;
5316
- private MenuItem switchItem;
5521
+ private MenuItem switchViewItem;
53175522 private MenuItem cutItem;
53185523 private MenuItem undoItem;
53195524 private MenuItem redoItem;
5320
- private MenuItem duplicateItem;
5525
+ private JMenuItem duplicateItem;
53215526 private MenuItem cloneItem;
53225527 private MenuItem cloneSupportItem;
53235528 private MenuItem overwriteGeoItem;
....@@ -5405,7 +5610,7 @@
54055610 private MenuItem frontItem;
54065611 private MenuItem cameraItem;
54075612 private MenuItem compositeItem;
5408
- private MenuItem randomItem;
5613
+ private MenuItem switchItem;
54095614 private MenuItem physicsItem;
54105615 private MenuItem frameselectorItem;
54115616 private MenuItem scriptNodeItem;
....@@ -5479,5 +5684,5 @@
54795684
54805685 Menu cameraMenu;
54815686 MenuItem editCameraItem;
5482
- MenuItem revertCameraItem;
5687
+ MenuItem restoreCameraItem;
54835688 }