Normand Briere
2019-06-27 f78dd18c66d607b693c0bf5937fc59181bf5a26b
GroupEditor.java
....@@ -204,21 +204,21 @@
204204 //zBufferItem.addActionListener(this);
205205 //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
206206 //normalLensItem.addActionListener(this);
207
- cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
208
- revertCameraItem.addActionListener(this);
207
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
208
+ restoreCameraItem.addActionListener(this);
209209
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);
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);
222222
223223 cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
224224 toggleHandleItem.addItemListener(this);
....@@ -275,7 +275,7 @@
275275 {
276276 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
277277 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
278
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
278
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
279279 editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
280280 oe.cameraMenu.add("-");
281281 openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
....@@ -283,7 +283,7 @@
283283 editLeafItem.addActionListener(this);
284284 lookAtItem.addActionListener(this);
285285 //lookFromItem.addActinoListener(this);
286
- //switchItem.addActionListener(this);
286
+ //switchViewItem.addActionListener(this);
287287 }
288288
289289 oe.menuBar.add(menu = new Menu("Setting"));
....@@ -328,14 +328,14 @@
328328 }
329329
330330 oe.menuBar.add(menu = new Menu("Group"));
331
- grabItem = menu.add(new MenuItem("Grab"));
332
- grabItem.addActionListener(this);
331
+// grabItem = menu.add(new MenuItem("Grab"));
332
+// grabItem.addActionListener(this);
333333 backItem = menu.add(new MenuItem("Back"));
334334 backItem.addActionListener(this);
335335 frontItem = menu.add(new MenuItem("Front"));
336336 frontItem.addActionListener(this);
337
- compositeItem = menu.add(new MenuItem("Composite"));
338
- compositeItem.addActionListener(this);
337
+// compositeItem = menu.add(new MenuItem("Composite"));
338
+// compositeItem.addActionListener(this);
339339
340340 if (Globals.ADVANCED)
341341 {
....@@ -345,10 +345,10 @@
345345 ungroupItem = menu.add(new MenuItem("Ungroup"));
346346 ungroupItem.addActionListener(this);
347347
348
- menu.add("-");
349
-
350
- randomItem = menu.add(new MenuItem("Switch node"));
351
- randomItem.addActionListener(this);
348
+// menu.add("-");
349
+//
350
+// switchItem = menu.add(new MenuItem("Switch node"));
351
+// switchItem.addActionListener(this);
352352 if (Globals.ADVANCED)
353353 {
354354 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
....@@ -365,13 +365,11 @@
365365 frameselectorItem.addActionListener(this);
366366 scriptNodeItem = menu.add(new MenuItem("Script Node"));
367367 scriptNodeItem.addActionListener(this);
368
- cameraItem = menu.add(new MenuItem("Camera"));
369
- cameraItem.addActionListener(this);
370368 }
371369
372370 oe.menuBar.add(menu = new Menu("Object"));
373
- textureItem = menu.add(new MenuItem("Texture"));
374
- textureItem.addActionListener(this);
371
+// textureItem = menu.add(new MenuItem("Texture"));
372
+// textureItem.addActionListener(this);
375373 billboardItem = menu.add(new MenuItem("Billboard"));
376374 billboardItem.addActionListener(this);
377375 csgItem = menu.add(new MenuItem("CSG"));
....@@ -582,6 +580,10 @@
582580 oe.radioPanel.add(dummyButton);
583581 oe.buttonGroup.add(dummyButton);
584582 */
583
+ cGridBag copyOptionsPanel = new cGridBag();
584
+
585
+ copyOptionsPanel.preferredHeight = 2;
586
+
585587 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
586588
587589 //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -596,39 +598,45 @@
596598 fullButton.setToolTipText("Full-screen window");
597599 fullButton.addActionListener(this);
598600
599
- oe.toolboxPanel.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);
600606 undoButton.setToolTipText("Undo changes");
601607 undoButton.addActionListener(this);
608
+ undoButton.setEnabled(false);
602609
603
- oe.toolboxPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
610
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
604611 redoButton.setToolTipText("Redo changes");
605612 redoButton.addActionListener(this);
613
+ redoButton.setEnabled(false);
606614
607
- oe.toolboxPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
615
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608616 saveButton.setToolTipText("Save changes");
609617 saveButton.addActionListener(this);
610618
611
- oe.toolboxPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
619
+ copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
612620 liveCB.setToolTipText("Enable animation");
613621 liveCB.addItemListener(this);
614622
615
- oe.toolboxPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
623
+ copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
616624 oneStepButton.setToolTipText("Animate one step forward");
617625 oneStepButton.addActionListener(this);
618626
619
- oe.toolboxPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
627
+ copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
620628 fastCB.setToolTipText("Fast mode");
621629 fastCB.addItemListener(this);
622630
623
- oe.toolboxPanel.Return();
631
+ //oe.toolboxPanel.Return();
624632
625
- oe.toolboxPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
626
- trackCB.setToolTipText("Enable tracking");
627
- trackCB.addItemListener(this);
628
-
629
- oe.toolboxPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
633
+ copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
630634 screenfitButton.setToolTipText("Screen fit");
631635 screenfitButton.addActionListener(this);
636
+
637
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
638
+// trackCB.setToolTipText("Enable tracking");
639
+// trackCB.addItemListener(this);
632640
633641 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
634642 // screenfitpointButton.addActionListener(this);
....@@ -640,10 +648,6 @@
640648 snapobjectButton.setToolTipText("Snap Object");
641649 }
642650
643
- oe.toolboxPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
644
- flashSelectionButton.setToolTipText("Highlight selection");
645
- flashSelectionButton.addActionListener(this);
646
-
647651 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
648652
649653 oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -688,8 +692,6 @@
688692 sphereButton.setToolTipText("Create sphere");
689693 sphereButton.addActionListener(this);
690694
691
- oe.toolboxPanel.Return();
692
-
693695 oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
694696 coneButton.setToolTipText("Create cone");
695697 coneButton.addActionListener(this);
....@@ -713,6 +715,28 @@
713715 particlesButton.setToolTipText("Create particle system");
714716 particlesButton.addActionListener(this);
715717
718
+ oe.toolboxPanel.Return();
719
+
720
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
721
+ groupButton.setToolTipText("Create group");
722
+ groupButton.addActionListener(this);
723
+
724
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
725
+ compositeButton.setToolTipText("Create composite");
726
+ compositeButton.addActionListener(this);
727
+
728
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
729
+ switchButton.setToolTipText("Create switch");
730
+ switchButton.addActionListener(this);
731
+
732
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
733
+ loopButton.setToolTipText("Create loop");
734
+ loopButton.addActionListener(this);
735
+
736
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
737
+ textureButton.setToolTipText("Create texture");
738
+ textureButton.addActionListener(this);
739
+
716740 oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
717741 overlayButton.setToolTipText("Create overlay");
718742 overlayButton.addActionListener(this);
....@@ -721,17 +745,29 @@
721745 lightButton.setToolTipText("Create light");
722746 lightButton.addActionListener(this);
723747
748
+ for (int i=6; --i>=0;)
749
+ {
750
+ oe.toolboxPanel.Return();
751
+ oe.toolboxPanel.add(new cGridBag());
752
+ oe.toolboxPanel.add(new cGridBag());
753
+ oe.toolboxPanel.add(new cGridBag());
754
+ oe.toolboxPanel.add(new cGridBag());
755
+ oe.toolboxPanel.add(new cGridBag());
756
+ oe.toolboxPanel.add(new cGridBag());
757
+ oe.toolboxPanel.add(new cGridBag());
758
+ }
759
+
724760 // EDIT panel
725
- editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
726
- editButton.setToolTipText("Edit selection");
761
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
762
+ editButton.setToolTipText("Pin selection controls");
727763 editButton.addActionListener(this);
728764
729
- editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
730
- uneditButton.setToolTipText("Unedit selection");
765
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
766
+ uneditButton.setToolTipText("Remove selection controls");
731767 uneditButton.addActionListener(this);
732768
733769 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
734
- allParamsButton.setToolTipText("Edit all params");
770
+ allParamsButton.setToolTipText("Show all controle");
735771 allParamsButton.addActionListener(this);
736772
737773 editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -742,8 +778,13 @@
742778 unselectButton.setToolTipText("Unselect");
743779 unselectButton.addActionListener(this);
744780
781
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
782
+ flashSelectionButton.setToolTipText("Highlight selection");
783
+ flashSelectionButton.addActionListener(this);
784
+
745785 editCommandsPanel.preferredHeight = 1;
746786
787
+ SetPinStates(false);
747788 // oe.treePanel.add(commandsPanel);
748789 // oe.treePanel.Return();
749790
....@@ -768,21 +809,6 @@
768809 oe.treePanel.add(jSPPanel);
769810 oe.treePanel.Return();
770811
771
- cGridBag copyOptionsPanel = new cGridBag();
772
-
773
- copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
774
- colorCB.setToolTipText("Copy color when dropped");
775
- colorCB.addItemListener(this);
776
-
777
- copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
778
- materialCB.setToolTipText("Copy material when dropped");
779
- materialCB.addItemListener(this);
780
-
781
- copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
782
- textureCB.setToolTipText("Copy texture when dropped");
783
- textureCB.addItemListener(this);
784
-
785
- copyOptionsPanel.preferredHeight = 1;
786812 oe.treePanel.add(copyOptionsPanel);
787813 oe.treePanel.Return();
788814
....@@ -813,12 +839,26 @@
813839
814840 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
815841 {
842
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
843
+ colorCB.setToolTipText("Copy color when dropped");
844
+ colorCB.addItemListener(this);
845
+
846
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
847
+ materialCB.setToolTipText("Copy material when dropped");
848
+ materialCB.addItemListener(this);
849
+
850
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
851
+ textureCB.setToolTipText("Copy texture when dropped");
852
+ textureCB.addItemListener(this);
853
+
854
+ panel.Return();
855
+
816856 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
817857 boxCB.setToolTipText("Display bounding boxes");
818858 boxCB.addItemListener(this);
819859
820860 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
821
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
861
+ zoomBoxCB.setToolTipText("Display only for wheel");
822862 zoomBoxCB.addItemListener(this);
823863
824864 if (true) // Globals.ADVANCED)
....@@ -830,6 +870,8 @@
830870 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
831871 // localCB.addItemListener(this);
832872
873
+ panel.Return();
874
+
833875 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
834876 crowdCB.setToolTipText("Used for crowds");
835877 crowdCB.addItemListener(this);
....@@ -846,6 +888,8 @@
846888 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
847889 // speakerMocapCB.addItemListener(this);
848890
891
+ panel.Return();
892
+
849893 if (false)
850894 {
851895 // handled in scripts
....@@ -860,24 +904,39 @@
860904 //constraints.gridy += 1;
861905 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
862906 smoothfocusCB.addItemListener(this);
907
+ panel.Return();
863908 }
864909
865910 //constraints.gridx += 1;
866911 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
867912 // debugCB.addItemListener(this);
868913
914
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
915
+ trackCB.setToolTipText("Enable tracking target");
916
+ trackCB.addItemListener(this);
917
+
869918 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
870
- oeilCB.setToolTipText("Move camera when tracking target");
919
+ oeilCB.setToolTipText("Move camera when tracking");
871920 oeilCB.addItemListener(this);
872921
873922 panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
874
- shadowCB.setToolTipText("Compute shadows when live");
923
+ shadowCB.setToolTipText("When live compute shadows");
875924 shadowCB.addItemListener(this);
876925
926
+ panel.Return();
927
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
928
+ toggleTextureCB.setToolTipText("Load textures");
929
+ toggleTextureCB.addItemListener(this);
930
+
931
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
932
+ toggleSwitchCB.setToolTipText("Use switch");
933
+ toggleSwitchCB.addItemListener(this);
934
+
877935 panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
878
- autosaveCB.setToolTipText("Auto-save on structure change");
936
+ autosaveCB.setToolTipText("On structure change");
879937 autosaveCB.addItemListener(this);
880938
939
+ panel.Return();
881940 if (Globals.ADVANCED)
882941 {
883942 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
....@@ -888,10 +947,15 @@
888947 }
889948
890949 cGridBag fill = new cGridBag();
891
-
892950 fill.preferredHeight = 200;
951
+ cGridBag fill2 = new cGridBag();
952
+ fill2.preferredHeight = 200;
953
+ cGridBag fill3 = new cGridBag();
954
+ fill3.preferredHeight = 200;
893955
894956 panel.add(fill);
957
+ panel.add(fill2);
958
+ panel.add(fill3);
895959
896960 }
897961
....@@ -936,7 +1000,8 @@
9361000 cCheckBox slowCB;
9371001 cCheckBox boxCB;
9381002 cCheckBox zoomBoxCB;
939
- cToggleButton trackCB;
1003
+ //cToggleButton trackCB;
1004
+ cCheckBox trackCB;
9401005 cCheckBox smoothfocusCB;
9411006 // JCheckBox speakerMocapCB;
9421007 cCheckBox speakerCameraCB;
....@@ -1191,13 +1256,23 @@
11911256
11921257 assert target == objEditor.jTree;
11931258 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1259
+ Object3D destinationLeaf;
11941260 try {
1195
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1261
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
11961262 } catch (Exception e) {
11971263 System.out.println("destinationPath : " + destinationPath);
11981264 return;
11991265 }
12001266
1267
+ for (int i=group.selection.size(); --i>=0;)
1268
+ {
1269
+ Object3D child = (Object3D)group.selection.elementAt(i);
1270
+
1271
+ // Cannot move into itself
1272
+ if (child == destinationLeaf)
1273
+ return;
1274
+ }
1275
+
12011276 // june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
12021277 // {
12031278 loadClipboard(true);
....@@ -1312,22 +1387,30 @@
13121387 {
13131388 //heightFieldItem = menu.add(new MenuItem("Height Field"));
13141389 //heightFieldItem.addActionListener(this);
1315
- gridItem = menu.add(new MenuItem("Grid"));
1316
- gridItem.addActionListener(this);
1317
- rectoidItem = menu.add(new MenuItem("Box"));
1318
- rectoidItem.addActionListener(this);
1319
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1320
- ellipsoidItem.addActionListener(this);
1321
- coneItem = menu.add(new MenuItem("Cone"));
1322
- coneItem.addActionListener(this);
1323
- torusItem = menu.add(new MenuItem("Torus"));
1324
- torusItem.addActionListener(this);
1325
- superItem = menu.add(new MenuItem("Superellipsoid"));
1326
- superItem.addActionListener(this);
1390
+// gridItem = menu.add(new MenuItem("Grid"));
1391
+// gridItem.addActionListener(this);
1392
+// rectoidItem = menu.add(new MenuItem("Box"));
1393
+// rectoidItem.addActionListener(this);
1394
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1395
+// ellipsoidItem.addActionListener(this);
1396
+// coneItem = menu.add(new MenuItem("Cone"));
1397
+// coneItem.addActionListener(this);
1398
+// torusItem = menu.add(new MenuItem("Torus"));
1399
+// torusItem.addActionListener(this);
1400
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1401
+// superItem.addActionListener(this);
1402
+
1403
+ cameraItem = menu.add(new MenuItem("Camera"));
1404
+ cameraItem.addActionListener(this);
1405
+
1406
+ if (!Globals.ADVANCED)
1407
+ {
13271408 kleinItem = menu.add(new MenuItem("Klein Bottle"));
13281409 kleinItem.addActionListener(this);
1329
- particleItem = menu.add(new MenuItem("Particle system"));
1330
- particleItem.addActionListener(this);
1410
+ }
1411
+
1412
+// particleItem = menu.add(new MenuItem("Particle system"));
1413
+// particleItem.addActionListener(this);
13311414 if (Globals.ADVANCED)
13321415 {
13331416 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1353,15 +1436,15 @@
13531436 }
13541437 bezierItem = menu.add(new MenuItem("Bezier Patch"));
13551438 bezierItem.addActionListener(this);
1356
- overlayItem = menu.add(new MenuItem("Overlay"));
1357
- overlayItem.addActionListener(this);
1358
- lightItem = menu.add(new MenuItem("Light"));
1359
- lightItem.addActionListener(this);
1439
+// overlayItem = menu.add(new MenuItem("Overlay"));
1440
+// overlayItem.addActionListener(this);
1441
+// lightItem = menu.add(new MenuItem("Light"));
1442
+// lightItem.addActionListener(this);
13601443 menu.add("-");
13611444 //superLoopItem = menu.add(new MenuItem("Super Loop"));
13621445 //superLoopItem.addActionListener(this);
1363
- loopItem = menu.add(new MenuItem("Loop"));
1364
- loopItem.addActionListener(this);
1446
+// loopItem = menu.add(new MenuItem("Loop"));
1447
+// loopItem.addActionListener(this);
13651448 doubleItem = menu.add(new MenuItem("Fork"));
13661449 doubleItem.addActionListener(this);
13671450 if (Globals.ADVANCED)
....@@ -1546,6 +1629,20 @@
15461629
15471630 makeSomething(shadow);
15481631 }
1632
+
1633
+ private void ClearUnpinned()
1634
+ {
1635
+ //for (Object3D obj : listUI)
1636
+ for (int i=listUI.size(); --i>=0;)
1637
+ {
1638
+ Object3D obj = listUI.elementAt(i);
1639
+ if (!obj.pinned)
1640
+ {
1641
+ obj.CloseUI();
1642
+ listUI.remove(i);
1643
+ }
1644
+ }
1645
+ }
15491646
15501647 /**
15511648 * applyExample
....@@ -1790,7 +1887,7 @@
17901887 {
17911888 ScreenFit();
17921889 } else
1793
- if (source == switchItem)
1890
+ if (source == switchViewItem)
17941891 {
17951892 cVector v1 = new cVector();
17961893 cVector v2 = new cVector();
....@@ -2020,7 +2117,7 @@
20202117
20212118 group(g);
20222119 } else
2023
- if (source == loopItem)
2120
+ if (source == loopItem || source == loopButton)
20242121 {
20252122 Composite csg = new GroupLeaf();
20262123 csg.count = 5;
....@@ -2510,9 +2607,9 @@
25102607 {
25112608 ClearSelection(true);
25122609 } else
2513
- if (source == grabItem)
2610
+ if (source == grabItem || source == groupButton)
25142611 {
2515
- group(new cGroup(), true);
2612
+ group(new cGroup(), false); // true);
25162613 } else
25172614 if (source == hideItem)
25182615 {
....@@ -2530,11 +2627,11 @@
25302627 {
25312628 makeSomething(new Camera());
25322629 } else
2533
- if (source == compositeItem)
2630
+ if (source == compositeItem || source == compositeButton)
25342631 {
25352632 group(new Composite());
25362633 } else
2537
- if (source == randomItem)
2634
+ if (source == switchItem || source == switchButton)
25382635 {
25392636 RandomNode random = new RandomNode();
25402637 group(random);
....@@ -2636,7 +2733,7 @@
26362733 {
26372734 group(new cLinker());
26382735 } else
2639
- if (source == textureItem)
2736
+ if (source == textureItem || source == textureButton)
26402737 {
26412738 group(new TextureNode());
26422739 } else
....@@ -3258,6 +3355,12 @@
32583355 } else
32593356 if (source == editItem || source == editButton)
32603357 {
3358
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3359
+ {
3360
+ Object3D child = (Object3D)e.nextElement();
3361
+ child.pinned = true;
3362
+ }
3363
+
32613364 EditSelection(false);
32623365 } else
32633366 if (source == uneditButton)
....@@ -3267,6 +3370,7 @@
32673370 Object3D child = (Object3D)e.nextElement();
32683371 if(child.editWindow != null)
32693372 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3373
+ child.pinned = false;
32703374 child.CloseUI();
32713375 listUI.remove(child);
32723376
....@@ -3283,6 +3387,7 @@
32833387 //copy.ClearUI();
32843388 for (Object3D obj : listUI)
32853389 {
3390
+ obj.pinned = false;
32863391 obj.CloseUI();
32873392 }
32883393 listUI.clear();
....@@ -3292,7 +3397,7 @@
32923397 {
32933398 assert(copy == group);
32943399
3295
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3400
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
32963401
32973402 for (Object3D obj : listUI)
32983403 {
....@@ -3367,6 +3472,11 @@
33673472 currentLayout = sevenButton;
33683473 */
33693474 radio.layout.doClick();
3475
+
3476
+ ClearUnpinned();
3477
+ SetPinStates(group.selection.size() > 0);
3478
+ if (group.selection.size() == 1)
3479
+ EditSelection(false);
33703480 keepparent = group.parent;
33713481 // PARENT = NULL or not???
33723482 //group.parent = null; // ROOT
....@@ -3380,7 +3490,7 @@
33803490 cameraView.ProtectCamera();
33813491 cameraView.repaint();
33823492 return;
3383
- } else if (event.getSource() == revertCameraItem)
3493
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
33843494 {
33853495 cameraView.RevertCamera();
33863496 cameraView.repaint();
....@@ -4434,10 +4544,6 @@
44344544 // }
44354545 // }
44364546
4437
- static boolean allparams = true;
4438
-
4439
- static Vector<Object3D> listUI = new Vector<Object3D>();
4440
-
44414547 void EditSelection(boolean newWindow)
44424548 {
44434549 // aConstraints.gridy = 0;
....@@ -4530,7 +4636,8 @@
45304636 //new Exception().printStackTrace();
45314637
45324638 freezemodel = true;
4533
-
4639
+ ClearUnpinned();
4640
+
45344641 /**/
45354642 //switch (event.id)
45364643 {
....@@ -4563,7 +4670,7 @@
45634670 if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
45644671 // a camera
45654672 {
4566
- if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4673
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
45674674 {
45684675 CameraPane.camerachangeframe = 0; // don't refuse it
45694676 Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
....@@ -4572,6 +4679,13 @@
45724679 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
45734680 }
45744681
4682
+ if (tps != null && tps.length == 1)
4683
+ {
4684
+ EditSelection(false);
4685
+ }
4686
+
4687
+ SetPinStates(tps != null && tps.length > 0);
4688
+
45754689 refreshContents();
45764690 //return true;
45774691 }
....@@ -4581,9 +4695,18 @@
45814695 freezemodel = false;
45824696 }
45834697
4698
+ void SetPinStates(boolean enabled)
4699
+ {
4700
+ editButton.setEnabled(enabled);
4701
+ uneditButton.setEnabled(enabled);
4702
+ unselectButton.setEnabled(enabled);
4703
+ flashSelectionButton.setEnabled(enabled);
4704
+ }
4705
+
45844706 void refreshContents(boolean cp)
45854707 {
4586
- if (!Globals.MOUSEDRAGGED)
4708
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4709
+ if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING)
45874710 {
45884711 objEditor.ClearInfo(); // .GetMaterial());
45894712
....@@ -5401,17 +5524,20 @@
54015524 cButton clearpanelButton;
54025525 cButton unselectButton;
54035526
5527
+ cButton restoreCameraButton;
5528
+
54045529 cButton minButton;
54055530 cButton maxButton;
54065531 cButton fullButton;
5407
- cButton undoButton;
5408
- cButton redoButton;
54095532 cButton saveButton;
54105533 cButton oneStepButton;
54115534
54125535 cButton groupButton;
54135536 cButton ungroupButton;
54145537 cButton compositeButton;
5538
+ cButton switchButton;
5539
+ cButton loopButton;
5540
+ cButton textureButton;
54155541
54165542 cButton gridButton;
54175543 cButton boxButton;
....@@ -5444,7 +5570,7 @@
54445570 //JTree jTree;
54455571 private MenuItem lookAtItem;
54465572 private MenuItem lookFromItem;
5447
- private MenuItem switchItem;
5573
+ private MenuItem switchViewItem;
54485574 private MenuItem cutItem;
54495575 private MenuItem undoItem;
54505576 private MenuItem redoItem;
....@@ -5536,7 +5662,7 @@
55365662 private MenuItem frontItem;
55375663 private MenuItem cameraItem;
55385664 private MenuItem compositeItem;
5539
- private MenuItem randomItem;
5665
+ private MenuItem switchItem;
55405666 private MenuItem physicsItem;
55415667 private MenuItem frameselectorItem;
55425668 private MenuItem scriptNodeItem;
....@@ -5610,5 +5736,5 @@
56105736
56115737 Menu cameraMenu;
56125738 MenuItem editCameraItem;
5613
- MenuItem revertCameraItem;
5739
+ MenuItem restoreCameraItem;
56145740 }