Normand Briere
2019-06-25 d2f456cf5280f59425084532bd2397ec625f7577
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,20 +889,39 @@
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);
811
- oeilCB.setToolTipText("Move camera when tracking target");
904
+ oeilCB.setToolTipText("Move camera when tracking");
812905 oeilCB.addItemListener(this);
813906
814907 panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
815908 shadowCB.setToolTipText("Compute shadows when live");
816909 shadowCB.addItemListener(this);
817910
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();
818925 if (Globals.ADVANCED)
819926 {
820927 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
....@@ -825,10 +932,15 @@
825932 }
826933
827934 cGridBag fill = new cGridBag();
828
-
829935 fill.preferredHeight = 200;
936
+ cGridBag fill2 = new cGridBag();
937
+ fill2.preferredHeight = 200;
938
+ cGridBag fill3 = new cGridBag();
939
+ fill3.preferredHeight = 200;
830940
831941 panel.add(fill);
942
+ panel.add(fill2);
943
+ panel.add(fill3);
832944
833945 }
834946
....@@ -864,25 +976,27 @@
864976 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
865977 }
866978
867
- JCheckBox liveCB;
868
- JCheckBox supportCB;
869
- JCheckBox localCB;
870
- JCheckBox crowdCB;
871
- JCheckBox smoothCB;
872
- JCheckBox fastCB;
873
- JCheckBox slowCB;
874
- JCheckBox boxCB;
875
- JCheckBox zoomBoxCB;
876
- JCheckBox trackCB;
877
- 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;
878991 // JCheckBox speakerMocapCB;
879
- JCheckBox speakerCameraCB;
880
- JCheckBox speakerFocusCB;
881
- JCheckBox debugCB;
992
+ cCheckBox speakerCameraCB;
993
+ cCheckBox speakerFocusCB;
994
+ cCheckBox debugCB;
882995
883
- JCheckBox oeilCB;
884
- JCheckBox shadowCB;
885
- JCheckBox lookAtCB;
996
+ cCheckBox oeilCB;
997
+ cCheckBox shadowCB;
998
+ cCheckBox autosaveCB;
999
+ cCheckBox lookAtCB;
8861000
8871001 // static int COLOR = 1;
8881002 // static int MATERIAL = 2;
....@@ -890,9 +1004,9 @@
8901004
8911005 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
8921006
893
- JCheckBox colorCB;
894
- JCheckBox materialCB;
895
- JCheckBox textureCB;
1007
+ cCheckBox colorCB;
1008
+ cCheckBox materialCB;
1009
+ cCheckBox textureCB;
8961010
8971011 public void itemStateChanged(ItemEvent e)
8981012 {
....@@ -989,6 +1103,10 @@
9891103 {
9901104 Globals.COMPUTESHADOWWHENLIVE ^= true;
9911105 }
1106
+ else if(e.getSource() == autosaveCB)
1107
+ {
1108
+ Globals.SAVEONMAKE ^= true;
1109
+ }
9921110 else if(e.getSource() == lookAtCB)
9931111 {
9941112 cameraView.ToggleLookAt();
....@@ -1005,7 +1123,8 @@
10051123
10061124 /**/
10071125 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
1008
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1126
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1127
+ TreePath path = objEditor.jTree.getSelectionPath();
10091128 if ((path == null) || (path.getPathCount() <= 1)) {
10101129 // We can't move the root node or an empty selection
10111130 return;
....@@ -1122,23 +1241,33 @@
11221241
11231242 assert target == objEditor.jTree;
11241243 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1244
+ Object3D destinationLeaf;
11251245 try {
1126
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1246
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
11271247 } catch (Exception e) {
11281248 System.out.println("destinationPath : " + destinationPath);
11291249 return;
11301250 }
11311251
1132
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1252
+ for (int i=group.selection.size(); --i>=0;)
11331253 {
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
+// {
11341263 loadClipboard(true);
11351264 objEditor.jTree.setSelectionPath(destinationPath);
11361265 pasteInto(false, false);
1137
- } else {
1138
- loadClipboard(false);
1139
- objEditor.jTree.setSelectionPath(destinationPath);
1140
- pasteInto(false, false); // true); // ???
1141
- }
1266
+// } else {
1267
+// loadClipboard(false);
1268
+// objEditor.jTree.setSelectionPath(destinationPath);
1269
+// pasteInto(false, false); // true); // ???
1270
+// }
11421271 }
11431272 public void dropActionChanged(DropTargetDragEvent dtde)
11441273 // Called if the user has modified the current drop gesture
....@@ -1243,22 +1372,30 @@
12431372 {
12441373 //heightFieldItem = menu.add(new MenuItem("Height Field"));
12451374 //heightFieldItem.addActionListener(this);
1246
- gridItem = menu.add(new MenuItem("Grid"));
1247
- gridItem.addActionListener(this);
1248
- rectoidItem = menu.add(new MenuItem("Box"));
1249
- rectoidItem.addActionListener(this);
1250
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1251
- ellipsoidItem.addActionListener(this);
1252
- coneItem = menu.add(new MenuItem("Cone"));
1253
- coneItem.addActionListener(this);
1254
- torusItem = menu.add(new MenuItem("Torus"));
1255
- torusItem.addActionListener(this);
1256
- superItem = menu.add(new MenuItem("Superellipsoid"));
1257
- 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
+ {
12581393 kleinItem = menu.add(new MenuItem("Klein Bottle"));
12591394 kleinItem.addActionListener(this);
1260
- particleItem = menu.add(new MenuItem("Particle system"));
1261
- particleItem.addActionListener(this);
1395
+ }
1396
+
1397
+// particleItem = menu.add(new MenuItem("Particle system"));
1398
+// particleItem.addActionListener(this);
12621399 if (Globals.ADVANCED)
12631400 {
12641401 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1284,15 +1421,15 @@
12841421 }
12851422 bezierItem = menu.add(new MenuItem("Bezier Patch"));
12861423 bezierItem.addActionListener(this);
1287
- overlayItem = menu.add(new MenuItem("Overlay"));
1288
- overlayItem.addActionListener(this);
1289
- lightItem = menu.add(new MenuItem("Light"));
1290
- 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);
12911428 menu.add("-");
12921429 //superLoopItem = menu.add(new MenuItem("Super Loop"));
12931430 //superLoopItem.addActionListener(this);
1294
- loopItem = menu.add(new MenuItem("Loop"));
1295
- loopItem.addActionListener(this);
1431
+// loopItem = menu.add(new MenuItem("Loop"));
1432
+// loopItem.addActionListener(this);
12961433 doubleItem = menu.add(new MenuItem("Fork"));
12971434 doubleItem.addActionListener(this);
12981435 if (Globals.ADVANCED)
....@@ -1721,7 +1858,7 @@
17211858 {
17221859 ScreenFit();
17231860 } else
1724
- if (source == switchItem)
1861
+ if (source == switchViewItem)
17251862 {
17261863 cVector v1 = new cVector();
17271864 cVector v2 = new cVector();
....@@ -1730,11 +1867,11 @@
17301867 objEditor.cameraView.renderCamera.setAim(v2, v1);
17311868 objEditor.cameraView.repaint();
17321869 } else
1733
- if (source == rectoidItem)
1870
+ if (source == rectoidItem || source == boxButton)
17341871 {
17351872 makeSomething(new Box());
17361873 } else
1737
- if (source == particleItem)
1874
+ if (source == particleItem || source == particlesButton)
17381875 {
17391876 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
17401877 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1813,27 +1950,27 @@
18131950
18141951 makeSomething(obj);
18151952 } else
1816
- if (source == gridItem)
1953
+ if (source == gridItem || source == gridButton)
18171954 {
18181955 makeSomething(new Grid());
18191956 } else
1820
- if (source == ellipsoidItem)
1957
+ if (source == ellipsoidItem || source == sphereButton)
18211958 {
18221959 makeSomething(new Sphere());
18231960 } else
1824
- if (source == coneItem)
1961
+ if (source == coneItem || source == coneButton)
18251962 {
18261963 makeSomething(new Cone());
18271964 } else
1828
- if (source == torusItem)
1965
+ if (source == torusItem || source == torusButton)
18291966 {
18301967 makeSomething(new Torus());
18311968 } else
1832
- if (source == superItem)
1969
+ if (source == superItem || source == superButton)
18331970 {
18341971 makeSomething(new Superellipsoid());
18351972 } else
1836
- if (source == kleinItem)
1973
+ if (source == kleinItem || source == kleinButton)
18371974 {
18381975 makeSomething(new Klein());
18391976 } else
....@@ -1853,7 +1990,7 @@
18531990 {
18541991 makeSomething(new BezierSurface());
18551992 } else
1856
- if (source == overlayItem)
1993
+ if (source == overlayItem || source == overlayButton)
18571994 {
18581995 /*
18591996 Object3D obj = new BezierSurface(5,8);
....@@ -1901,7 +2038,7 @@
19012038 s.setup();
19022039 makeSomething(s);
19032040 } else
1904
- if (source == lightItem)
2041
+ if (source == lightItem || source == lightButton)
19052042 {
19062043 makeSomething(new Light());
19072044 } else
....@@ -1951,7 +2088,7 @@
19512088
19522089 group(g);
19532090 } else
1954
- if (source == loopItem)
2091
+ if (source == loopItem || source == loopButton)
19552092 {
19562093 Composite csg = new GroupLeaf();
19572094 csg.count = 5;
....@@ -2441,9 +2578,9 @@
24412578 {
24422579 ClearSelection(true);
24432580 } else
2444
- if (source == grabItem)
2581
+ if (source == grabItem || source == groupButton)
24452582 {
2446
- group(new cGroup(), true);
2583
+ group(new cGroup(), false); // true);
24472584 } else
24482585 if (source == hideItem)
24492586 {
....@@ -2461,11 +2598,11 @@
24612598 {
24622599 makeSomething(new Camera());
24632600 } else
2464
- if (source == compositeItem)
2601
+ if (source == compositeItem || source == compositeButton)
24652602 {
24662603 group(new Composite());
24672604 } else
2468
- if (source == randomItem)
2605
+ if (source == switchItem || source == switchButton)
24692606 {
24702607 RandomNode random = new RandomNode();
24712608 group(random);
....@@ -2567,7 +2704,7 @@
25672704 {
25682705 group(new cLinker());
25692706 } else
2570
- if (source == textureItem)
2707
+ if (source == textureItem || source == textureButton)
25712708 {
25722709 group(new TextureNode());
25732710 } else
....@@ -2587,7 +2724,7 @@
25872724 {
25882725 CastShadow(2);
25892726 } else
2590
- if (source == ungroupItem)
2727
+ if (source == ungroupItem || source == ungroupButton)
25912728 {
25922729 //ungroup();
25932730 for (int i=0; i<group.selection.size(); i++)
....@@ -2925,6 +3062,10 @@
29253062 if (source == twoButton)
29263063 {
29273064 radio.layout = twoButton;
3065
+
3066
+ if (CameraPane.FULLSCREEN)
3067
+ fullscreenLayout = radio.layout;
3068
+
29283069 // bug
29293070 //gridPanel.setDividerLocation(1.0);
29303071 //bigPanel.setDividerLocation(0.0);
....@@ -2980,6 +3121,9 @@
29803121 {
29813122 radio.layout = threeButton;
29823123
3124
+ if (CameraPane.FULLSCREEN)
3125
+ fullscreenLayout = radio.layout;
3126
+
29833127 // bigThree.remove(scenePanel);
29843128 // bigThree.remove(centralPanel);
29853129 // bigThree.remove(XYZPanel);
....@@ -3018,6 +3162,9 @@
30183162 {
30193163 radio.layout = fourButton;
30203164
3165
+ if (CameraPane.FULLSCREEN)
3166
+ fullscreenLayout = radio.layout;
3167
+
30213168 // bigThree.remove(scenePanel);
30223169 // bigThree.remove(centralPanel);
30233170 // bigThree.remove(XYZPanel);
....@@ -3054,6 +3201,9 @@
30543201 if (source == sixButton)
30553202 {
30563203 radio.layout = sixButton;
3204
+
3205
+ if (CameraPane.FULLSCREEN)
3206
+ fullscreenLayout = radio.layout;
30573207
30583208 // bigThree.remove(scenePanel);
30593209 // bigThree.remove(centralPanel);
....@@ -3092,6 +3242,9 @@
30923242 if (source == sevenButton)
30933243 {
30943244 radio.layout = sevenButton;
3245
+
3246
+ if (CameraPane.FULLSCREEN)
3247
+ fullscreenLayout = radio.layout;
30953248
30963249 // bigThree.remove(scenePanel);
30973250 // bigThree.remove(centralPanel);
....@@ -3159,7 +3312,8 @@
31593312 buttonGroup.remove(ab);
31603313 radioPanel.remove(ab);
31613314
3162
- ab.GetObject().editWindow = null;
3315
+ //ab.GetObject().editWindow = null;
3316
+ ab.GetObject().manipWindow = null;
31633317 // ab.GetObject().objectUI = null; // ?????????
31643318
31653319 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
....@@ -3273,6 +3427,7 @@
32733427
32743428 // fix "+" issue
32753429 //group.editWindow = this;
3430
+ group.manipWindow = this;
32763431
32773432 /*
32783433 currentLayout = radio.layout;
....@@ -3293,7 +3448,7 @@
32933448 cameraView.ProtectCamera();
32943449 cameraView.repaint();
32953450 return;
3296
- } else if (event.getSource() == revertCameraItem)
3451
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
32973452 {
32983453 cameraView.RevertCamera();
32993454 cameraView.repaint();
....@@ -4358,7 +4513,7 @@
43584513 {
43594514 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
43604515 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4361
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4516
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
43624517
43634518 Object3D elem = (Object3D)group.selection.elementAt(i);
43644519 if(elem != group || !newWindow)
....@@ -4496,7 +4651,8 @@
44964651
44974652 void refreshContents(boolean cp)
44984653 {
4499
- if (!Globals.MOUSEDRAGGED)
4654
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4655
+ if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING)
45004656 {
45014657 objEditor.ClearInfo(); // .GetMaterial());
45024658
....@@ -4595,6 +4751,7 @@
45954751
45964752 if (cut)
45974753 {
4754
+ if (Globals.SAVEONMAKE)
45984755 Save();
45994756 //int indices[] = jList.getSelectedIndices();
46004757 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -5313,6 +5470,8 @@
53135470 cButton clearpanelButton;
53145471 cButton unselectButton;
53155472
5473
+ cButton restoreCameraButton;
5474
+
53165475 cButton minButton;
53175476 cButton maxButton;
53185477 cButton fullButton;
....@@ -5320,6 +5479,24 @@
53205479 cButton redoButton;
53215480 cButton saveButton;
53225481 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;
53235500
53245501 cButton screenfitButton;
53255502 cButton screenfitpointButton;
....@@ -5341,11 +5518,11 @@
53415518 //JTree jTree;
53425519 private MenuItem lookAtItem;
53435520 private MenuItem lookFromItem;
5344
- private MenuItem switchItem;
5521
+ private MenuItem switchViewItem;
53455522 private MenuItem cutItem;
53465523 private MenuItem undoItem;
53475524 private MenuItem redoItem;
5348
- private MenuItem duplicateItem;
5525
+ private JMenuItem duplicateItem;
53495526 private MenuItem cloneItem;
53505527 private MenuItem cloneSupportItem;
53515528 private MenuItem overwriteGeoItem;
....@@ -5433,7 +5610,7 @@
54335610 private MenuItem frontItem;
54345611 private MenuItem cameraItem;
54355612 private MenuItem compositeItem;
5436
- private MenuItem randomItem;
5613
+ private MenuItem switchItem;
54375614 private MenuItem physicsItem;
54385615 private MenuItem frameselectorItem;
54395616 private MenuItem scriptNodeItem;
....@@ -5507,5 +5684,5 @@
55075684
55085685 Menu cameraMenu;
55095686 MenuItem editCameraItem;
5510
- MenuItem revertCameraItem;
5687
+ MenuItem restoreCameraItem;
55115688 }