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,6 +580,10 @@
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);
....@@ -588,37 +598,43 @@
588598 fullButton.setToolTipText("Full-screen window");
589599 fullButton.addActionListener(this);
590600
591
- oe.toolbarPanel.add(undoButton = GetButton("icons/undo.png", !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 = GetButton("icons/redo.png", !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 = GetButton("icons/down_arrow.png", !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 = GetCheckBox("icons/run.png", 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(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);
621
+ copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
612622 oneStepButton.setToolTipText("Animate one step forward");
613623 oneStepButton.addActionListener(this);
614624
615
- oe.toolbarPanel.add(trackCB = GetCheckBox("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
616
- trackCB.setToolTipText("Enable tracking");
617
- trackCB.addItemListener(this);
618
-
619
- oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
625
+ copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
626
+ fastCB.setToolTipText("Fast mode");
627
+ fastCB.addItemListener(this);
628
+
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 = 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));
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,24 +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
+
818920 panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
819921 autosaveCB.setToolTipText("Auto-save on structure change");
820922 autosaveCB.addItemListener(this);
821923
924
+ panel.Return();
822925 if (Globals.ADVANCED)
823926 {
824927 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
....@@ -829,10 +932,15 @@
829932 }
830933
831934 cGridBag fill = new cGridBag();
832
-
833935 fill.preferredHeight = 200;
936
+ cGridBag fill2 = new cGridBag();
937
+ fill2.preferredHeight = 200;
938
+ cGridBag fill3 = new cGridBag();
939
+ fill3.preferredHeight = 200;
834940
835941 panel.add(fill);
942
+ panel.add(fill2);
943
+ panel.add(fill3);
836944
837945 }
838946
....@@ -868,15 +976,16 @@
868976 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
869977 }
870978
871
- cCheckBox liveCB;
979
+ cToggleButton liveCB;
872980 cCheckBox supportCB;
873981 cCheckBox localCB;
874982 cCheckBox crowdCB;
875983 cCheckBox smoothCB;
876
- cCheckBox fastCB;
984
+ cToggleButton fastCB;
877985 cCheckBox slowCB;
878986 cCheckBox boxCB;
879987 cCheckBox zoomBoxCB;
988
+ //cToggleButton trackCB;
880989 cCheckBox trackCB;
881990 cCheckBox smoothfocusCB;
882991 // JCheckBox speakerMocapCB;
....@@ -1014,7 +1123,8 @@
10141123
10151124 /**/
10161125 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
1017
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1126
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1127
+ TreePath path = objEditor.jTree.getSelectionPath();
10181128 if ((path == null) || (path.getPathCount() <= 1)) {
10191129 // We can't move the root node or an empty selection
10201130 return;
....@@ -1131,23 +1241,33 @@
11311241
11321242 assert target == objEditor.jTree;
11331243 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1244
+ Object3D destinationLeaf;
11341245 try {
1135
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1246
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
11361247 } catch (Exception e) {
11371248 System.out.println("destinationPath : " + destinationPath);
11381249 return;
11391250 }
11401251
1141
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1252
+ for (int i=group.selection.size(); --i>=0;)
11421253 {
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
+// {
11431263 loadClipboard(true);
11441264 objEditor.jTree.setSelectionPath(destinationPath);
11451265 pasteInto(false, false);
1146
- } else {
1147
- loadClipboard(false);
1148
- objEditor.jTree.setSelectionPath(destinationPath);
1149
- pasteInto(false, false); // true); // ???
1150
- }
1266
+// } else {
1267
+// loadClipboard(false);
1268
+// objEditor.jTree.setSelectionPath(destinationPath);
1269
+// pasteInto(false, false); // true); // ???
1270
+// }
11511271 }
11521272 public void dropActionChanged(DropTargetDragEvent dtde)
11531273 // Called if the user has modified the current drop gesture
....@@ -1252,22 +1372,30 @@
12521372 {
12531373 //heightFieldItem = menu.add(new MenuItem("Height Field"));
12541374 //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);
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
+ {
12671393 kleinItem = menu.add(new MenuItem("Klein Bottle"));
12681394 kleinItem.addActionListener(this);
1269
- particleItem = menu.add(new MenuItem("Particle system"));
1270
- particleItem.addActionListener(this);
1395
+ }
1396
+
1397
+// particleItem = menu.add(new MenuItem("Particle system"));
1398
+// particleItem.addActionListener(this);
12711399 if (Globals.ADVANCED)
12721400 {
12731401 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1293,15 +1421,15 @@
12931421 }
12941422 bezierItem = menu.add(new MenuItem("Bezier Patch"));
12951423 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);
1424
+// overlayItem = menu.add(new MenuItem("Overlay"));
1425
+// overlayItem.addActionListener(this);
1426
+// lightItem = menu.add(new MenuItem("Light"));
1427
+// lightItem.addActionListener(this);
13001428 menu.add("-");
13011429 //superLoopItem = menu.add(new MenuItem("Super Loop"));
13021430 //superLoopItem.addActionListener(this);
1303
- loopItem = menu.add(new MenuItem("Loop"));
1304
- loopItem.addActionListener(this);
1431
+// loopItem = menu.add(new MenuItem("Loop"));
1432
+// loopItem.addActionListener(this);
13051433 doubleItem = menu.add(new MenuItem("Fork"));
13061434 doubleItem.addActionListener(this);
13071435 if (Globals.ADVANCED)
....@@ -1730,7 +1858,7 @@
17301858 {
17311859 ScreenFit();
17321860 } else
1733
- if (source == switchItem)
1861
+ if (source == switchViewItem)
17341862 {
17351863 cVector v1 = new cVector();
17361864 cVector v2 = new cVector();
....@@ -1739,11 +1867,11 @@
17391867 objEditor.cameraView.renderCamera.setAim(v2, v1);
17401868 objEditor.cameraView.repaint();
17411869 } else
1742
- if (source == rectoidItem)
1870
+ if (source == rectoidItem || source == boxButton)
17431871 {
17441872 makeSomething(new Box());
17451873 } else
1746
- if (source == particleItem)
1874
+ if (source == particleItem || source == particlesButton)
17471875 {
17481876 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
17491877 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1822,27 +1950,27 @@
18221950
18231951 makeSomething(obj);
18241952 } else
1825
- if (source == gridItem)
1953
+ if (source == gridItem || source == gridButton)
18261954 {
18271955 makeSomething(new Grid());
18281956 } else
1829
- if (source == ellipsoidItem)
1957
+ if (source == ellipsoidItem || source == sphereButton)
18301958 {
18311959 makeSomething(new Sphere());
18321960 } else
1833
- if (source == coneItem)
1961
+ if (source == coneItem || source == coneButton)
18341962 {
18351963 makeSomething(new Cone());
18361964 } else
1837
- if (source == torusItem)
1965
+ if (source == torusItem || source == torusButton)
18381966 {
18391967 makeSomething(new Torus());
18401968 } else
1841
- if (source == superItem)
1969
+ if (source == superItem || source == superButton)
18421970 {
18431971 makeSomething(new Superellipsoid());
18441972 } else
1845
- if (source == kleinItem)
1973
+ if (source == kleinItem || source == kleinButton)
18461974 {
18471975 makeSomething(new Klein());
18481976 } else
....@@ -1862,7 +1990,7 @@
18621990 {
18631991 makeSomething(new BezierSurface());
18641992 } else
1865
- if (source == overlayItem)
1993
+ if (source == overlayItem || source == overlayButton)
18661994 {
18671995 /*
18681996 Object3D obj = new BezierSurface(5,8);
....@@ -1910,7 +2038,7 @@
19102038 s.setup();
19112039 makeSomething(s);
19122040 } else
1913
- if (source == lightItem)
2041
+ if (source == lightItem || source == lightButton)
19142042 {
19152043 makeSomething(new Light());
19162044 } else
....@@ -1960,7 +2088,7 @@
19602088
19612089 group(g);
19622090 } else
1963
- if (source == loopItem)
2091
+ if (source == loopItem || source == loopButton)
19642092 {
19652093 Composite csg = new GroupLeaf();
19662094 csg.count = 5;
....@@ -2450,9 +2578,9 @@
24502578 {
24512579 ClearSelection(true);
24522580 } else
2453
- if (source == grabItem)
2581
+ if (source == grabItem || source == groupButton)
24542582 {
2455
- group(new cGroup(), true);
2583
+ group(new cGroup(), false); // true);
24562584 } else
24572585 if (source == hideItem)
24582586 {
....@@ -2470,11 +2598,11 @@
24702598 {
24712599 makeSomething(new Camera());
24722600 } else
2473
- if (source == compositeItem)
2601
+ if (source == compositeItem || source == compositeButton)
24742602 {
24752603 group(new Composite());
24762604 } else
2477
- if (source == randomItem)
2605
+ if (source == switchItem || source == switchButton)
24782606 {
24792607 RandomNode random = new RandomNode();
24802608 group(random);
....@@ -2576,7 +2704,7 @@
25762704 {
25772705 group(new cLinker());
25782706 } else
2579
- if (source == textureItem)
2707
+ if (source == textureItem || source == textureButton)
25802708 {
25812709 group(new TextureNode());
25822710 } else
....@@ -2596,7 +2724,7 @@
25962724 {
25972725 CastShadow(2);
25982726 } else
2599
- if (source == ungroupItem)
2727
+ if (source == ungroupItem || source == ungroupButton)
26002728 {
26012729 //ungroup();
26022730 for (int i=0; i<group.selection.size(); i++)
....@@ -2934,6 +3062,10 @@
29343062 if (source == twoButton)
29353063 {
29363064 radio.layout = twoButton;
3065
+
3066
+ if (CameraPane.FULLSCREEN)
3067
+ fullscreenLayout = radio.layout;
3068
+
29373069 // bug
29383070 //gridPanel.setDividerLocation(1.0);
29393071 //bigPanel.setDividerLocation(0.0);
....@@ -2989,6 +3121,9 @@
29893121 {
29903122 radio.layout = threeButton;
29913123
3124
+ if (CameraPane.FULLSCREEN)
3125
+ fullscreenLayout = radio.layout;
3126
+
29923127 // bigThree.remove(scenePanel);
29933128 // bigThree.remove(centralPanel);
29943129 // bigThree.remove(XYZPanel);
....@@ -3027,6 +3162,9 @@
30273162 {
30283163 radio.layout = fourButton;
30293164
3165
+ if (CameraPane.FULLSCREEN)
3166
+ fullscreenLayout = radio.layout;
3167
+
30303168 // bigThree.remove(scenePanel);
30313169 // bigThree.remove(centralPanel);
30323170 // bigThree.remove(XYZPanel);
....@@ -3063,6 +3201,9 @@
30633201 if (source == sixButton)
30643202 {
30653203 radio.layout = sixButton;
3204
+
3205
+ if (CameraPane.FULLSCREEN)
3206
+ fullscreenLayout = radio.layout;
30663207
30673208 // bigThree.remove(scenePanel);
30683209 // bigThree.remove(centralPanel);
....@@ -3101,6 +3242,9 @@
31013242 if (source == sevenButton)
31023243 {
31033244 radio.layout = sevenButton;
3245
+
3246
+ if (CameraPane.FULLSCREEN)
3247
+ fullscreenLayout = radio.layout;
31043248
31053249 // bigThree.remove(scenePanel);
31063250 // bigThree.remove(centralPanel);
....@@ -3304,7 +3448,7 @@
33043448 cameraView.ProtectCamera();
33053449 cameraView.repaint();
33063450 return;
3307
- } else if (event.getSource() == revertCameraItem)
3451
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
33083452 {
33093453 cameraView.RevertCamera();
33103454 cameraView.repaint();
....@@ -4369,7 +4513,7 @@
43694513 {
43704514 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
43714515 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4372
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4516
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
43734517
43744518 Object3D elem = (Object3D)group.selection.elementAt(i);
43754519 if(elem != group || !newWindow)
....@@ -4507,7 +4651,8 @@
45074651
45084652 void refreshContents(boolean cp)
45094653 {
4510
- if (!Globals.MOUSEDRAGGED)
4654
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4655
+ if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING)
45114656 {
45124657 objEditor.ClearInfo(); // .GetMaterial());
45134658
....@@ -5325,6 +5470,8 @@
53255470 cButton clearpanelButton;
53265471 cButton unselectButton;
53275472
5473
+ cButton restoreCameraButton;
5474
+
53285475 cButton minButton;
53295476 cButton maxButton;
53305477 cButton fullButton;
....@@ -5332,6 +5479,24 @@
53325479 cButton redoButton;
53335480 cButton saveButton;
53345481 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;
53355500
53365501 cButton screenfitButton;
53375502 cButton screenfitpointButton;
....@@ -5353,11 +5518,11 @@
53535518 //JTree jTree;
53545519 private MenuItem lookAtItem;
53555520 private MenuItem lookFromItem;
5356
- private MenuItem switchItem;
5521
+ private MenuItem switchViewItem;
53575522 private MenuItem cutItem;
53585523 private MenuItem undoItem;
53595524 private MenuItem redoItem;
5360
- private MenuItem duplicateItem;
5525
+ private JMenuItem duplicateItem;
53615526 private MenuItem cloneItem;
53625527 private MenuItem cloneSupportItem;
53635528 private MenuItem overwriteGeoItem;
....@@ -5445,7 +5610,7 @@
54455610 private MenuItem frontItem;
54465611 private MenuItem cameraItem;
54475612 private MenuItem compositeItem;
5448
- private MenuItem randomItem;
5613
+ private MenuItem switchItem;
54495614 private MenuItem physicsItem;
54505615 private MenuItem frameselectorItem;
54515616 private MenuItem scriptNodeItem;
....@@ -5519,5 +5684,5 @@
55195684
55205685 Menu cameraMenu;
55215686 MenuItem editCameraItem;
5522
- MenuItem revertCameraItem;
5687
+ MenuItem restoreCameraItem;
55235688 }