Normand Briere
2019-07-28 a434119e65146fe53d612c28e1ee7af532d1b70a
GroupEditor.java
....@@ -23,6 +23,31 @@
2323 DragGestureListener, DragSourceListener, DropTargetListener,
2424 ItemListener // ListSelectionListener
2525 {
26
+
27
+ public void AddSkyboxButton(String f, String s, cGridBag row3)
28
+ {
29
+ cButton skyboxButton;
30
+ final String path = "cubemaps/" + f + "-skyboxes/" + s;
31
+ row3.add(skyboxButton = GetButton(path + "/" + s + ".jpg", !Grafreed.NIMBUSLAF));
32
+ skyboxButton.setToolTipText(s);
33
+ skyboxButton.addActionListener(new ActionListener()
34
+ {
35
+ @Override
36
+ public void actionPerformed(ActionEvent e)
37
+ {
38
+ ChangeSkybox(path);
39
+ }
40
+ });
41
+ }
42
+
43
+ public void ChangeSkybox(String name)
44
+ {
45
+ cameraView.envyoff = false;
46
+ cameraView.skyboxname = name;
47
+ cameraView.skyboxext = "jpg";
48
+ cameraView.repaint();
49
+ }
50
+
2651 //ObjEditor objEditor;
2752 public void closeUI2()
2853 {
....@@ -60,6 +85,12 @@
6085 this.copy = this.group = group;
6186 //selectees = this.group.selectees;
6287
88
+ if (copy.versions == null)
89
+ {
90
+ copy.versions = new byte[100][];
91
+ copy.versionindex = -1;
92
+ }
93
+
6394 if(ui)
6495 SetupUI(objEditor);
6596 }
....@@ -80,10 +111,22 @@
80111 SetupViews(objEditor);
81112
82113 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
114
+
115
+ if (copy.versions == null)
116
+ {
117
+ copy.versions = new byte[100][];
118
+ copy.versionindex = -1;
119
+
120
+ Save(true);
121
+ }
83122 }
84123
85124 void CloneSelection(boolean supports)
86125 {
126
+ if (Globals.REPLACEONMAKE)
127
+ Save();
128
+ boolean keep = Globals.REPLACEONMAKE;
129
+ Globals.REPLACEONMAKE = false;
87130 // Object3D keep = GrafreeD.clipboard;
88131 //Object3D obj;
89132 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -94,6 +137,7 @@
94137
95138 makeSomething(clone, i==group.selection.size()-1);
96139 }
140
+ Globals.REPLACEONMAKE = keep;
97141 }
98142
99143 void CloneClipboard(boolean supports)
....@@ -150,6 +194,8 @@
150194
151195 void SetupMenu2(GroupEditor oe)
152196 {
197
+ oe.jTree = new cTree();
198
+
153199 Menu menu;
154200 oe.menuBar.add(menu = new Menu("Edit"));
155201 //editItem = menu.add(new MenuItem("Edit"));
....@@ -160,7 +206,7 @@
160206 // redoItem = menu.add(new MenuItem("Redo"));
161207 // redoItem.addActionListener(this);
162208 // menu.add("-");
163
- duplicateItem = menu.add(new MenuItem("Duplicate"));
209
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
164210 duplicateItem.addActionListener(this);
165211 cloneItem = menu.add(new MenuItem("Clone"));
166212 cloneItem.addActionListener(this);
....@@ -187,8 +233,8 @@
187233 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
188234 // pasteExpandItem.addActionListener(this);
189235 menu.add("-");
190
- clearItem = menu.add(new MenuItem("Clear"));
191
- clearItem.addActionListener(this);
236
+ deleteItem = menu.add(new MenuItem("Delete"));
237
+ deleteItem.addActionListener(this);
192238
193239 if (Globals.ADVANCED)
194240 {
....@@ -202,23 +248,23 @@
202248 //zBufferItem.addActionListener(this);
203249 //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
204250 //normalLensItem.addActionListener(this);
205
- cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
206
- revertCameraItem.addActionListener(this);
251
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
252
+ restoreCameraItem.addActionListener(this);
207253
208
- cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
209
- toggleFullScreenItem.addItemListener(this);
210
- toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
211
- cameraMenu.add("-");
254
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
255
+// toggleFullScreenItem.addItemListener(this);
256
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
257
+// cameraMenu.add("-");
258
+//
259
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
260
+// toggleTextureItem.addItemListener(this);
261
+// toggleTextureItem.setState(CameraPane.textureon);
262
+//
263
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
264
+// toggleSwitchItem.addItemListener(this);
265
+// toggleSwitchItem.setState(CameraPane.SWITCH);
212266
213
- cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
214
- toggleTextureItem.addItemListener(this);
215
- toggleTextureItem.setState(CameraPane.textureon);
216
-
217
- cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
218
- toggleSwitchItem.addItemListener(this);
219
- toggleSwitchItem.setState(CameraPane.SWITCH);
220
-
221
- cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
267
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
222268 toggleHandleItem.addItemListener(this);
223269 toggleHandleItem.setState(CameraPane.HANDLES);
224270
....@@ -273,7 +319,7 @@
273319 {
274320 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
275321 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
276
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
322
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
277323 editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
278324 oe.cameraMenu.add("-");
279325 openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
....@@ -281,7 +327,7 @@
281327 editLeafItem.addActionListener(this);
282328 lookAtItem.addActionListener(this);
283329 //lookFromItem.addActinoListener(this);
284
- //switchItem.addActionListener(this);
330
+ //switchViewItem.addActionListener(this);
285331 }
286332
287333 oe.menuBar.add(menu = new Menu("Setting"));
....@@ -326,21 +372,29 @@
326372 }
327373
328374 oe.menuBar.add(menu = new Menu("Group"));
329
- grabItem = menu.add(new MenuItem("Grab"));
330
- grabItem.addActionListener(this);
375
+// grabItem = menu.add(new MenuItem("Grab"));
376
+// grabItem.addActionListener(this);
331377 backItem = menu.add(new MenuItem("Back"));
332378 backItem.addActionListener(this);
333379 frontItem = menu.add(new MenuItem("Front"));
334380 frontItem.addActionListener(this);
335
- compositeItem = menu.add(new MenuItem("Composite"));
336
- compositeItem.addActionListener(this);
381
+// compositeItem = menu.add(new MenuItem("Composite"));
382
+// compositeItem.addActionListener(this);
383
+
384
+ if (Globals.ADVANCED)
385
+ {
337386 hideItem = menu.add(new MenuItem("Hidden Group"));
338387 hideItem.addActionListener(this);
388
+ }
339389 ungroupItem = menu.add(new MenuItem("Ungroup"));
340390 ungroupItem.addActionListener(this);
341
- menu.add("-");
342
- randomItem = menu.add(new MenuItem("Switch node"));
343
- randomItem.addActionListener(this);
391
+
392
+// menu.add("-");
393
+//
394
+// switchItem = menu.add(new MenuItem("Switch node"));
395
+// switchItem.addActionListener(this);
396
+ if (Globals.ADVANCED)
397
+ {
344398 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
345399 switchGeoItem.addActionListener(this);
346400 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
....@@ -348,8 +402,6 @@
348402 morphItem = menu.add(new MenuItem("Morph Group"));
349403 morphItem.addActionListener(this);
350404
351
- if (Globals.ADVANCED)
352
- {
353405 menu.add("-");
354406 physicsItem = menu.add(new MenuItem("Physics"));
355407 physicsItem.addActionListener(this);
....@@ -357,13 +409,11 @@
357409 frameselectorItem.addActionListener(this);
358410 scriptNodeItem = menu.add(new MenuItem("Script Node"));
359411 scriptNodeItem.addActionListener(this);
360
- cameraItem = menu.add(new MenuItem("Camera"));
361
- cameraItem.addActionListener(this);
362412 }
363413
364414 oe.menuBar.add(menu = new Menu("Object"));
365
- textureItem = menu.add(new MenuItem("Texture"));
366
- textureItem.addActionListener(this);
415
+// textureItem = menu.add(new MenuItem("Texture"));
416
+// textureItem.addActionListener(this);
367417 billboardItem = menu.add(new MenuItem("Billboard"));
368418 billboardItem.addActionListener(this);
369419 csgItem = menu.add(new MenuItem("CSG"));
....@@ -374,13 +424,14 @@
374424 shadowYItem.addActionListener(this);
375425 shadowZItem = menu.add(new MenuItem("Shadow Blue"));
376426 shadowZItem.addActionListener(this);
427
+ attributeItem = menu.add(new MenuItem("Attribute"));
428
+ attributeItem.addActionListener(this);
429
+
377430 if (Globals.ADVANCED)
378431 {
379432 menu.add("-");
380433 linkerItem = menu.add(new MenuItem("Linker"));
381434 linkerItem.addActionListener(this);
382
- attributeItem = menu.add(new MenuItem("Attribute"));
383
- attributeItem.addActionListener(this);
384435 templateItem = menu.add(new MenuItem("Template"));
385436 templateItem.addActionListener(this);
386437 pointflowItem = menu.add(new MenuItem("Point Flow"));
....@@ -409,7 +460,7 @@
409460 genNormalsMESHItem.addActionListener(this);
410461 if (Globals.ADVANCED)
411462 {
412
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
463
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
413464 genNormalsMINEItem.addActionListener(this);
414465 }
415466 stripifyItem = menu.add(new MenuItem("Stripify"));
....@@ -502,10 +553,15 @@
502553 attachBumpItem.addActionListener(this);
503554 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
504555 pigmentBumpItem.addActionListener(this);
556
+ //embedTexturesItem
505557 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
506558 detachPigmentItem.addActionListener(this);
507559 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
508560 detachBumpItem.addActionListener(this);
561
+ embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
562
+ embedTexturesItem.addActionListener(this);
563
+ deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
564
+ deEmbedTexturesItem.addActionListener(this);
509565 menu.add("-");
510566 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
511567 sortbysizeItem.addActionListener(this);
....@@ -532,6 +588,7 @@
532588 buildToolsMenu(menu);
533589 }
534590
591
+
535592 void SetupUI2(ObjEditor oe)
536593 {
537594 // June 2019
....@@ -574,51 +631,79 @@
574631 oe.radioPanel.add(dummyButton);
575632 oe.buttonGroup.add(dummyButton);
576633 */
634
+ cGridBag copyOptionsPanel = new cGridBag();
635
+
636
+ copyOptionsPanel.preferredHeight = 2;
637
+
577638 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
578639
579640 //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
580641 //minButton.setToolTipText("Minimize window");
581642 //minButton.addActionListener(this);
582643
583
- oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
584
- maxButton.setToolTipText("Maximize window");
585
- maxButton.addActionListener(this);
644
+ if (Globals.ADVANCED)
645
+ {
646
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
647
+ maxButton.setToolTipText("Maximize window");
648
+ maxButton.addActionListener(this);
649
+ }
586650
587651 oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
588652 fullButton.setToolTipText("Full-screen window");
589653 fullButton.addActionListener(this);
590654
591
- oe.toolbarPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
592
- undoButton.setToolTipText("Undo changes");
593
- undoButton.addActionListener(this);
655
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
656
+ screenfitButton.setToolTipText("Screen fit");
657
+ screenfitButton.addActionListener(this);
658
+
659
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
660
+ restoreCameraButton.setToolTipText("Restore viewpoint");
661
+ restoreCameraButton.addActionListener(this);
594662
595
- oe.toolbarPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
- redoButton.setToolTipText("Redo changes");
597
- redoButton.addActionListener(this);
598
-
599
- oe.toolbarPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
- saveButton.setToolTipText("Save changes");
663
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
664
+ saveButton.setToolTipText("New version");
601665 saveButton.addActionListener(this);
666
+
667
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
668
+ undoButton.setToolTipText("Previous version");
669
+ undoButton.addActionListener(this);
670
+ undoButton.setEnabled(false);
602671
603
- oe.toolbarPanel.add(liveCB = GetCheckBox("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
672
+ cGridBag updown = new cGridBag().setVertical(true);
673
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
674
+ restoreButton.setToolTipText("Restore current");
675
+ restoreButton.addActionListener(this);
676
+ restoreButton.setEnabled(false);
677
+
678
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
679
+ replaceButton.setToolTipText("Replace current");
680
+ replaceButton.addActionListener(this);
681
+ replaceButton.setEnabled(false);
682
+
683
+ copyOptionsPanel.add(updown);
684
+
685
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
686
+ redoButton.setToolTipText("Next version");
687
+ redoButton.addActionListener(this);
688
+ redoButton.setEnabled(false);
689
+
690
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
604691 liveCB.setToolTipText("Enable animation");
605692 liveCB.addItemListener(this);
606693
607
- oe.toolbarPanel.add(fastCB = GetCheckBox("icons/runfast.png", CameraPane.FAST)); //, constraints);
608
- fastCB.setToolTipText("Fast mode");
609
- fastCB.addItemListener(this);
610
-
611694 oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
612695 oneStepButton.setToolTipText("Animate one step forward");
613696 oneStepButton.addActionListener(this);
614697
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);
620
- screenfitButton.setToolTipText("Screen fit");
621
- screenfitButton.addActionListener(this);
698
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
699
+ fastCB.setToolTipText("Fast mode");
700
+ fastCB.addItemListener(this);
701
+
702
+ //oe.toolboxPanel.Return();
703
+
704
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
705
+// trackCB.setToolTipText("Enable tracking");
706
+// trackCB.addItemListener(this);
622707
623708 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
624709 // screenfitpointButton.addActionListener(this);
....@@ -628,51 +713,225 @@
628713 oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629714 snapobjectButton.addActionListener(this);
630715 snapobjectButton.setToolTipText("Snap Object");
716
+
717
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
718
+ fourButton.addActionListener(this);
719
+ fourButton.setToolTipText("Show control panel only");
631720 }
632721
633
- oe.toolbarPanel.add(flashSelectionButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
- flashSelectionButton.setToolTipText("Highlight selection");
635
- flashSelectionButton.addActionListener(this);
722
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
636723
637
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
638
-
639
- oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
640
- twoButton.setToolTipText("Show center view only");
724
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
725
+ twoButton.setToolTipText("Show 3D view only");
641726 twoButton.addActionListener(this);
642
- oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
643
- fourButton.addActionListener(this);
644
- fourButton.setToolTipText("Show left panel only");
645
- oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
646
- sixButton.setToolTipText("2-column layout left");
647
- sixButton.addActionListener(this);
648
- oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
649
- threeButton.setToolTipText("2-column layout right");
727
+ this.fullscreenLayout = twoButton;
728
+
729
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
730
+ threeButton.setToolTipText("Show controls and 3D view");
650731 threeButton.addActionListener(this);
651
- oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
652
- sevenButton.setToolTipText("3-column layout");
653
- sevenButton.addActionListener(this);
732
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
733
+ sixButton.setToolTipText("Show 3D view and controls");
734
+ sixButton.addActionListener(this);
735
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
736
+// sevenButton.setToolTipText("3-column layout");
737
+// sevenButton.addActionListener(this);
654738 //
655739
656
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
657
- rootButton.setToolTipText("Edit selection in new tab");
740
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
741
+ rootButton.setToolTipText("Open selection in new tab");
658742 rootButton.addActionListener(this);
659743
660
- oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
744
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
661745 closeButton.setToolTipText("Close tab");
662746 closeButton.addActionListener(this);
663747 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
664748 //clearButton.addActionListener(this);
665
-
666
- editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
667
- editButton.setToolTipText("Edit selection");
749
+
750
+ cGridBag row1 = new cGridBag();
751
+
752
+ // INSERT
753
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
754
+ gridButton.setToolTipText("Create grid");
755
+ gridButton.addActionListener(this);
756
+
757
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
758
+ boxButton.setToolTipText("Create box");
759
+ boxButton.addActionListener(this);
760
+
761
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
762
+ sphereButton.setToolTipText("Create sphere");
763
+ sphereButton.addActionListener(this);
764
+
765
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
766
+ coneButton.setToolTipText("Create cone");
767
+ coneButton.addActionListener(this);
768
+
769
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
770
+ torusButton.setToolTipText("Create torus");
771
+ torusButton.addActionListener(this);
772
+
773
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
774
+ superButton.setToolTipText("Create superellipsoid");
775
+ superButton.addActionListener(this);
776
+
777
+ if (Globals.ADVANCED)
778
+ {
779
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
780
+ kleinButton.setToolTipText("Create Klein bottle");
781
+ kleinButton.addActionListener(this);
782
+ }
783
+
784
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
785
+ particlesButton.setToolTipText("Create particle system");
786
+ particlesButton.addActionListener(this);
787
+
788
+ oe.toolboxPanel.add(row1);
789
+
790
+ cGridBag row2 = new cGridBag();
791
+
792
+ row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
793
+ groupButton.setToolTipText("Create group");
794
+ groupButton.addActionListener(this);
795
+
796
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
797
+ compositeButton.setToolTipText("Create composite");
798
+ compositeButton.addActionListener(this);
799
+
800
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
801
+ switchButton.setToolTipText("Create item switcher");
802
+ switchButton.addActionListener(this);
803
+
804
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
805
+ loopButton.setToolTipText("Create loop");
806
+ loopButton.addActionListener(this);
807
+
808
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
809
+ textureButton.setToolTipText("Create texture");
810
+ textureButton.addActionListener(this);
811
+
812
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
813
+ overlayButton.setToolTipText("Create overlay");
814
+ overlayButton.addActionListener(this);
815
+
816
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
817
+ lightButton.setToolTipText("Create light");
818
+ lightButton.addActionListener(this);
819
+
820
+ oe.toolboxPanel.add(row2);
821
+
822
+ // ENVYMAPS
823
+ cGridBag row3 = new cGridBag();
824
+ row3.preferredHeight = 20;
825
+
826
+ AddSkyboxButton("default", "rgb", row3);
827
+ AddSkyboxButton("default", "cornell", row3);
828
+ AddSkyboxButton("default", "uffizi", row3);
829
+ AddSkyboxButton("default", "CloudyHills", row3);
830
+ AddSkyboxButton("default", "skycube", row3);
831
+
832
+ oe.toolboxPanel.add(row3);
833
+
834
+ cGridBag row4 = new cGridBag();
835
+ row4.preferredHeight = 20;
836
+
837
+ AddSkyboxButton("bridge", "Bridge2", row4);
838
+ AddSkyboxButton("urban", "GamlaStan2", row4);
839
+ AddSkyboxButton("urban", "Parliament", row4);
840
+ AddSkyboxButton("urban", "Roundabout", row4);
841
+
842
+ oe.toolboxPanel.add(row4);
843
+
844
+ cGridBag row5 = new cGridBag();
845
+ row5.preferredHeight = 20;
846
+
847
+ AddSkyboxButton("urban", "SaintLazarusChurch", row5);
848
+ AddSkyboxButton("urban", "SaintLazarusChurch2", row5);
849
+ AddSkyboxButton("urban", "SaintLazarusChurch3", row5);
850
+ AddSkyboxButton("urban", "UnionSquare", row5);
851
+
852
+ oe.toolboxPanel.add(row5);
853
+
854
+ cGridBag row6 = new cGridBag();
855
+ row6.preferredHeight = 20;
856
+
857
+ AddSkyboxButton("park", "BerzeliiPark", row6);
858
+ AddSkyboxButton("park", "Buddha", row6);
859
+ AddSkyboxButton("park", "CNTower2", row6);
860
+ //AddSkyboxButton("park", "Fatbursparken", row6);
861
+ AddSkyboxButton("park", "NiagaraFalls1", row6);
862
+
863
+ oe.toolboxPanel.add(row6);
864
+
865
+ cGridBag row7 = new cGridBag();
866
+ row7.preferredHeight = 20;
867
+
868
+ AddSkyboxButton("park", "NiagaraFalls3", row7);
869
+ AddSkyboxButton("park", "Park", row7);
870
+ //AddSkyboxButton("park", "Park2", row6);
871
+ //AddSkyboxButton("park", "Path", row6);
872
+ AddSkyboxButton("park", "Pond", row7);
873
+ AddSkyboxButton("park", "Skansen", row7);
874
+
875
+ oe.toolboxPanel.add(row7);
876
+
877
+ cGridBag row8 = new cGridBag();
878
+ row8.preferredHeight = 20;
879
+
880
+ AddSkyboxButton("park", "Skansen2", row8);
881
+ AddSkyboxButton("park", "Skansen3", row8);
882
+ AddSkyboxButton("park", "Skansen4", row8);
883
+ AddSkyboxButton("park", "Skansen5", row8);
884
+
885
+ oe.toolboxPanel.add(row8);
886
+
887
+ cGridBag row9 = new cGridBag();
888
+ row9.preferredHeight = 20;
889
+
890
+ AddSkyboxButton("park", "Stairs", row9);
891
+ //AddSkyboxButton("park", "Tantolunden", row6);
892
+ //AddSkyboxButton("park", "Tantolunden3", row6);
893
+ AddSkyboxButton("park", "Tantolunden4", row9);
894
+
895
+ oe.toolboxPanel.add(row9);
896
+/*
897
+BerzeliiPark
898
+Buddha
899
+CNTower2
900
+Fatbursparken
901
+NiagaraFalls1
902
+NiagaraFalls3
903
+Park
904
+Park2
905
+Path
906
+Pond
907
+Skansen
908
+Skansen2
909
+Skansen3
910
+Skansen4
911
+Skansen5
912
+Stairs
913
+Tantolunden
914
+Tantolunden3
915
+Tantolunden4
916
+ */
917
+
918
+ for (int i=1; --i>=0;)
919
+ {
920
+ //oe.toolboxPanel.Return();
921
+ oe.toolboxPanel.add(new cGridBag());
922
+ }
923
+
924
+ // EDIT panel
925
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
926
+ editButton.setToolTipText("Pin selection controls");
668927 editButton.addActionListener(this);
669928
670
- editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
671
- uneditButton.setToolTipText("Unedit selection");
929
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
930
+ uneditButton.setToolTipText("Remove selection controls");
672931 uneditButton.addActionListener(this);
673932
674933 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
675
- allParamsButton.setToolTipText("Edit all params");
934
+ allParamsButton.setToolTipText("Show all controle");
676935 allParamsButton.addActionListener(this);
677936
678937 editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -683,8 +942,13 @@
683942 unselectButton.setToolTipText("Unselect");
684943 unselectButton.addActionListener(this);
685944
945
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
946
+ flashSelectionButton.setToolTipText("Highlight selection");
947
+ flashSelectionButton.addActionListener(this);
948
+
686949 editCommandsPanel.preferredHeight = 1;
687950
951
+ SetPinStates(false);
688952 // oe.treePanel.add(commandsPanel);
689953 // oe.treePanel.Return();
690954
....@@ -703,32 +967,20 @@
703967
704968 JScrollPane jSP;
705969 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
706
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
970
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
707971 ResetModel();
708972
709973 oe.treePanel.add(jSPPanel);
710974 oe.treePanel.Return();
711975
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;
727976 oe.treePanel.add(copyOptionsPanel);
728977 oe.treePanel.Return();
978
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
979
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
980
+ sliderPane.preferredHeight = 1;
729981
730
-// mainPanel.setDividerLocation(0.5); //1.0);
731
-// mainPanel.setResizeWeight(0.5);
982
+// mainPanel.setDividerLocation(0.1); //1.0);
983
+ mainPanel.setResizeWeight(0.4);
732984
733985 //jList.addListSelectionListener(this);
734986 oe.jTree.addTreeSelectionListener(this);
....@@ -736,7 +988,7 @@
736988 //jTree.setEditable(true);
737989 oe.jTree.setDragEnabled(true);
738990 //jTree.setPreferredSize(new Dimension(10,10));
739
- jSP.setPreferredSize(new Dimension(100,200));
991
+ //jSP.setPreferredSize(new Dimension(100,200));
740992
741993 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
742994
....@@ -748,29 +1000,49 @@
7481000 dgr.addDragGestureListener(this);
7491001 }catch(Exception e) {}
7501002 */
751
- radio.layout = sevenButton;
1003
+ radio.layout = sixButton; // sevenButton;
7521004 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
7531005 }
7541006
7551007 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
7561008 {
1009
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
1010
+ colorCB.setToolTipText("Copy color when dropped");
1011
+ colorCB.addItemListener(this);
1012
+
1013
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
1014
+ materialCB.setToolTipText("Copy material when dropped");
1015
+ materialCB.addItemListener(this);
1016
+
1017
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
1018
+ textureCB.setToolTipText("Copy texture when dropped");
1019
+ textureCB.addItemListener(this);
1020
+
1021
+ panel.Return();
1022
+
7571023 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
7581024 boxCB.setToolTipText("Display bounding boxes");
7591025 boxCB.addItemListener(this);
7601026
7611027 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
762
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
1028
+ zoomBoxCB.setToolTipText("Display only for wheel");
7631029 zoomBoxCB.addItemListener(this);
7641030
7651031 if (true) // Globals.ADVANCED)
7661032 {
767
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
768
- supportCB.setToolTipText("Enable rigging");
769
- supportCB.addItemListener(this);
1033
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
1034
+// supportCB.setToolTipText("Enable rigging");
1035
+// supportCB.addItemListener(this);
1036
+
1037
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1038
+ freezeCB.setToolTipText("Fast moving camera");
1039
+ freezeCB.addItemListener(this);
7701040
7711041 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
7721042 // localCB.addItemListener(this);
7731043
1044
+ panel.Return();
1045
+
7741046 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
7751047 crowdCB.setToolTipText("Used for crowds");
7761048 crowdCB.addItemListener(this);
....@@ -787,6 +1059,8 @@
7871059 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
7881060 // speakerMocapCB.addItemListener(this);
7891061
1062
+ panel.Return();
1063
+
7901064 if (false)
7911065 {
7921066 // handled in scripts
....@@ -801,24 +1075,39 @@
8011075 //constraints.gridy += 1;
8021076 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
8031077 smoothfocusCB.addItemListener(this);
1078
+ panel.Return();
8041079 }
8051080
8061081 //constraints.gridx += 1;
8071082 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
8081083 // debugCB.addItemListener(this);
8091084
1085
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
1086
+ trackCB.setToolTipText("Enable tracking target");
1087
+ trackCB.addItemListener(this);
1088
+
8101089 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
811
- oeilCB.setToolTipText("Move camera when tracking target");
1090
+ oeilCB.setToolTipText("Move camera when tracking");
8121091 oeilCB.addItemListener(this);
8131092
8141093 panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
815
- shadowCB.setToolTipText("Compute shadows when live");
1094
+ shadowCB.setToolTipText("When live compute shadows");
8161095 shadowCB.addItemListener(this);
8171096
818
- panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
819
- autosaveCB.setToolTipText("Auto-save on structure change");
820
- autosaveCB.addItemListener(this);
1097
+ panel.Return();
1098
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
1099
+ toggleTextureCB.setToolTipText("Load textures");
1100
+ toggleTextureCB.addItemListener(this);
1101
+
1102
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
1103
+ toggleSwitchCB.setToolTipText("Choose a single item");
1104
+ toggleSwitchCB.addItemListener(this);
1105
+
1106
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1107
+ autokeepCB.setToolTipText("On structure change");
1108
+ autokeepCB.addItemListener(this);
8211109
1110
+ panel.Return();
8221111 if (Globals.ADVANCED)
8231112 {
8241113 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
....@@ -829,10 +1118,15 @@
8291118 }
8301119
8311120 cGridBag fill = new cGridBag();
832
-
8331121 fill.preferredHeight = 200;
1122
+ cGridBag fill2 = new cGridBag();
1123
+ fill2.preferredHeight = 200;
1124
+ cGridBag fill3 = new cGridBag();
1125
+ fill3.preferredHeight = 200;
8341126
8351127 panel.add(fill);
1128
+ panel.add(fill2);
1129
+ panel.add(fill3);
8361130
8371131 }
8381132
....@@ -840,7 +1134,7 @@
8401134 {
8411135 cRadio radioButton = new cRadio(obj.name);
8421136
843
- // Patch to avoid bug with transparency.
1137
+ // June 2019. Patch to avoid bug with transparency.
8441138 radioButton.hadMaterial = obj.material != null;
8451139 if (!radioButton.hadMaterial)
8461140 {
....@@ -848,7 +1142,7 @@
8481142 }
8491143
8501144 radioButton.SetObject(obj);
851
- radioButton.layout = sevenButton;
1145
+ radioButton.layout = sixButton; // sevenButton;
8521146 radioButton.SetCamera(cameraView.renderCamera, false);
8531147 radioButton.addActionListener(this);
8541148 radioPanel.add(radioButton);
....@@ -868,15 +1162,17 @@
8681162 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
8691163 }
8701164
871
- cCheckBox liveCB;
1165
+ cToggleButton liveCB;
8721166 cCheckBox supportCB;
8731167 cCheckBox localCB;
8741168 cCheckBox crowdCB;
8751169 cCheckBox smoothCB;
876
- cCheckBox fastCB;
1170
+ cToggleButton fastCB;
8771171 cCheckBox slowCB;
8781172 cCheckBox boxCB;
8791173 cCheckBox zoomBoxCB;
1174
+ cCheckBox freezeCB;
1175
+ //cToggleButton trackCB;
8801176 cCheckBox trackCB;
8811177 cCheckBox smoothfocusCB;
8821178 // JCheckBox speakerMocapCB;
....@@ -886,7 +1182,7 @@
8861182
8871183 cCheckBox oeilCB;
8881184 cCheckBox shadowCB;
889
- cCheckBox autosaveCB;
1185
+ cCheckBox autokeepCB;
8901186 cCheckBox lookAtCB;
8911187
8921188 // static int COLOR = 1;
....@@ -994,9 +1290,13 @@
9941290 {
9951291 Globals.COMPUTESHADOWWHENLIVE ^= true;
9961292 }
997
- else if(e.getSource() == autosaveCB)
1293
+ else if(e.getSource() == freezeCB)
9981294 {
999
- Globals.SAVEONMAKE ^= true;
1295
+ Globals.FREEZEONMOVE ^= true;
1296
+ }
1297
+ else if(e.getSource() == autokeepCB)
1298
+ {
1299
+ Globals.REPLACEONMAKE ^= true;
10001300 }
10011301 else if(e.getSource() == lookAtCB)
10021302 {
....@@ -1014,7 +1314,8 @@
10141314
10151315 /**/
10161316 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
1017
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1317
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1318
+ TreePath path = objEditor.jTree.getSelectionPath();
10181319 if ((path == null) || (path.getPathCount() <= 1)) {
10191320 // We can't move the root node or an empty selection
10201321 return;
....@@ -1077,8 +1378,6 @@
10771378 }
10781379 }
10791380
1080
- String string = (String) object;
1081
-
10821381 System.out.println("Transfer = " + object + "; drop : " + target);
10831382 // if( object instanceof java.io.File[])
10841383 // {
....@@ -1086,6 +1385,8 @@
10861385 // objEditor.DropFile((java.io.File[]) object, true);
10871386 // return;
10881387 // }
1388
+
1389
+ String string = object.toString();
10891390
10901391 // File path for Mac and Windows
10911392 if (string.charAt(0) == '/' || string.charAt(1) == ':')
....@@ -1131,23 +1432,33 @@
11311432
11321433 assert target == objEditor.jTree;
11331434 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1435
+ Object3D destinationLeaf;
11341436 try {
1135
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1437
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
11361438 } catch (Exception e) {
11371439 System.out.println("destinationPath : " + destinationPath);
11381440 return;
11391441 }
11401442
1141
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1443
+ for (int i=group.selection.size(); --i>=0;)
11421444 {
1445
+ Object3D child = (Object3D)group.selection.elementAt(i);
1446
+
1447
+ // Cannot move into itself
1448
+ if (child == destinationLeaf)
1449
+ return;
1450
+ }
1451
+
1452
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1453
+// {
11431454 loadClipboard(true);
11441455 objEditor.jTree.setSelectionPath(destinationPath);
11451456 pasteInto(false, false);
1146
- } else {
1147
- loadClipboard(false);
1148
- objEditor.jTree.setSelectionPath(destinationPath);
1149
- pasteInto(false, false); // true); // ???
1150
- }
1457
+// } else {
1458
+// loadClipboard(false);
1459
+// objEditor.jTree.setSelectionPath(destinationPath);
1460
+// pasteInto(false, false); // true); // ???
1461
+// }
11511462 }
11521463 public void dropActionChanged(DropTargetDragEvent dtde)
11531464 // Called if the user has modified the current drop gesture
....@@ -1252,22 +1563,30 @@
12521563 {
12531564 //heightFieldItem = menu.add(new MenuItem("Height Field"));
12541565 //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);
1566
+// gridItem = menu.add(new MenuItem("Grid"));
1567
+// gridItem.addActionListener(this);
1568
+// rectoidItem = menu.add(new MenuItem("Box"));
1569
+// rectoidItem.addActionListener(this);
1570
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1571
+// ellipsoidItem.addActionListener(this);
1572
+// coneItem = menu.add(new MenuItem("Cone"));
1573
+// coneItem.addActionListener(this);
1574
+// torusItem = menu.add(new MenuItem("Torus"));
1575
+// torusItem.addActionListener(this);
1576
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1577
+// superItem.addActionListener(this);
1578
+
1579
+ cameraItem = menu.add(new MenuItem("Camera"));
1580
+ cameraItem.addActionListener(this);
1581
+
1582
+ if (!Globals.ADVANCED)
1583
+ {
12671584 kleinItem = menu.add(new MenuItem("Klein Bottle"));
12681585 kleinItem.addActionListener(this);
1269
- particleItem = menu.add(new MenuItem("Particle system"));
1270
- particleItem.addActionListener(this);
1586
+ }
1587
+
1588
+// particleItem = menu.add(new MenuItem("Particle system"));
1589
+// particleItem.addActionListener(this);
12711590 if (Globals.ADVANCED)
12721591 {
12731592 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1293,15 +1612,15 @@
12931612 }
12941613 bezierItem = menu.add(new MenuItem("Bezier Patch"));
12951614 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);
1615
+// overlayItem = menu.add(new MenuItem("Overlay"));
1616
+// overlayItem.addActionListener(this);
1617
+// lightItem = menu.add(new MenuItem("Light"));
1618
+// lightItem.addActionListener(this);
13001619 menu.add("-");
13011620 //superLoopItem = menu.add(new MenuItem("Super Loop"));
13021621 //superLoopItem.addActionListener(this);
1303
- loopItem = menu.add(new MenuItem("Loop"));
1304
- loopItem.addActionListener(this);
1622
+// loopItem = menu.add(new MenuItem("Loop"));
1623
+// loopItem.addActionListener(this);
13051624 doubleItem = menu.add(new MenuItem("Fork"));
13061625 doubleItem.addActionListener(this);
13071626 if (Globals.ADVANCED)
....@@ -1317,6 +1636,9 @@
13171636 animationItem.addItemListener(this);
13181637 animationItem.setState(Globals.ANIMATION);
13191638
1639
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1640
+ archiveItem.addActionListener(this);
1641
+
13201642 menu.add("-");
13211643 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
13221644 parseverticesItem.addActionListener(this);
....@@ -1329,6 +1651,8 @@
13291651 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
13301652 reduce34MorphItem.addActionListener(this);
13311653 menu.add("-");
1654
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1655
+ memoryItem.addActionListener(this);
13321656 menu.add(computeAOItem = new MenuItem("Compute AO"));
13331657 computeAOItem.addActionListener(this);
13341658
....@@ -1337,8 +1661,6 @@
13371661 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
13381662 mirrorItem.addActionListener(this);
13391663 menu.add("-");
1340
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1341
- memoryItem.addActionListener(this);
13421664 menu.add(analyzeItem = new MenuItem("Analyze"));
13431665 analyzeItem.addActionListener(this);
13441666 menu.add(dumpItem = new MenuItem("Print"));
....@@ -1486,6 +1808,30 @@
14861808
14871809 makeSomething(shadow);
14881810 }
1811
+
1812
+ private void ClearUnpinned()
1813
+ {
1814
+ //for (Object3D obj : listUI)
1815
+ for (int i=listUI.size(); --i>=0;)
1816
+ {
1817
+ Object3D obj = listUI.elementAt(i);
1818
+ if (!obj.pinned)
1819
+ {
1820
+ obj.CloseUI();
1821
+ listUI.remove(i);
1822
+ }
1823
+ }
1824
+ }
1825
+
1826
+ private void EditElement(Object3D elem, boolean newWindow)
1827
+ {
1828
+ // if (!(elem instanceof Composite))
1829
+ // newWindow = false;
1830
+ listUI.add(elem);
1831
+ elem.openEditWindow(this, newWindow); //, false);
1832
+ System.out.println("edit : " + elem);
1833
+ elem.editWindow.refreshContents(true); // ? new
1834
+ }
14891835
14901836 /**
14911837 * applyExample
....@@ -1730,7 +2076,7 @@
17302076 {
17312077 ScreenFit();
17322078 } else
1733
- if (source == switchItem)
2079
+ if (source == switchViewItem)
17342080 {
17352081 cVector v1 = new cVector();
17362082 cVector v2 = new cVector();
....@@ -1739,11 +2085,11 @@
17392085 objEditor.cameraView.renderCamera.setAim(v2, v1);
17402086 objEditor.cameraView.repaint();
17412087 } else
1742
- if (source == rectoidItem)
2088
+ if (source == rectoidItem || source == boxButton)
17432089 {
17442090 makeSomething(new Box());
17452091 } else
1746
- if (source == particleItem)
2092
+ if (source == particleItem || source == particlesButton)
17472093 {
17482094 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
17492095 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1822,27 +2168,27 @@
18222168
18232169 makeSomething(obj);
18242170 } else
1825
- if (source == gridItem)
2171
+ if (source == gridItem || source == gridButton)
18262172 {
18272173 makeSomething(new Grid());
18282174 } else
1829
- if (source == ellipsoidItem)
2175
+ if (source == ellipsoidItem || source == sphereButton)
18302176 {
18312177 makeSomething(new Sphere());
18322178 } else
1833
- if (source == coneItem)
2179
+ if (source == coneItem || source == coneButton)
18342180 {
18352181 makeSomething(new Cone());
18362182 } else
1837
- if (source == torusItem)
2183
+ if (source == torusItem || source == torusButton)
18382184 {
18392185 makeSomething(new Torus());
18402186 } else
1841
- if (source == superItem)
2187
+ if (source == superItem || source == superButton)
18422188 {
18432189 makeSomething(new Superellipsoid());
18442190 } else
1845
- if (source == kleinItem)
2191
+ if (source == kleinItem || source == kleinButton)
18462192 {
18472193 makeSomething(new Klein());
18482194 } else
....@@ -1862,7 +2208,7 @@
18622208 {
18632209 makeSomething(new BezierSurface());
18642210 } else
1865
- if (source == overlayItem)
2211
+ if (source == overlayItem || source == overlayButton)
18662212 {
18672213 /*
18682214 Object3D obj = new BezierSurface(5,8);
....@@ -1910,10 +2256,27 @@
19102256 s.setup();
19112257 makeSomething(s);
19122258 } else
1913
- if (source == lightItem)
2259
+ if (source == lightItem || source == lightButton)
19142260 {
19152261 makeSomething(new Light());
19162262 } else
2263
+// if (source == skybox1Button ||
2264
+// source == skybox2Button ||
2265
+// source == skybox3Button ||
2266
+// source == skybox4Button ||
2267
+// source == skybox5Button ||
2268
+// source == skybox6Button ||
2269
+// source == skybox7Button ||
2270
+// source == skybox11Button ||
2271
+// source == skybox12Button ||
2272
+// source == skybox13Button ||
2273
+// source == skybox14Button ||
2274
+// source == skybox15Button ||
2275
+// source == skybox16Button ||
2276
+// source == skybox17Button)
2277
+// {
2278
+// ChangeSkybox(source);
2279
+// } else
19172280 if (source == csgItem)
19182281 {
19192282 group(new CSG());
....@@ -1960,30 +2323,30 @@
19602323
19612324 group(g);
19622325 } else
1963
- if (source == loopItem)
2326
+ if (source == loopItem || source == loopButton)
19642327 {
19652328 Composite csg = new GroupLeaf();
19662329 csg.count = 5;
19672330 group(csg);
1968
- Composite child = new cGroup();
2331
+ Composite child = new cGroup("Branch");
19692332 csg.addChild(child);
19702333 child.addChild(csg);
19712334 } else
19722335 if (source == doubleItem)
19732336 {
1974
- Composite csg = new GroupLeaf();
2337
+ Composite csg = new GroupLeaf("Fork");
19752338 csg.count = 5;
19762339 group(csg);
1977
- Composite child = new cGroup();
2340
+ Composite child = new cGroup("Branch A");
19782341 csg.addChild(child);
19792342 child.addChild(csg);
1980
- child = new cGroup();
2343
+ child = new cGroup("Branch B");
19812344 csg.addChild(child);
19822345 child.addChild(csg);
19832346 } else
19842347 if (source == tripleItem)
19852348 {
1986
- Composite csg = new GroupLeaf();
2349
+ Composite csg = new GroupLeaf("Trident");
19872350 csg.count = 4;
19882351 group(csg);
19892352 Composite child = new cGroup();
....@@ -1999,7 +2362,7 @@
19992362 if (source == computeAOItem)
20002363 {
20012364 Globals.drawMode = CameraPane.OCCLUSION;
2002
- Globals.theRenderer.repaint();
2365
+ cameraView.repaint();
20032366 } else
20042367 if (source == recompileItem)
20052368 {
....@@ -2047,15 +2410,31 @@
20472410 } else
20482411 if (source == undoButton)
20492412 {
2413
+ // Go to previous version
2414
+ //if (!Undo())
2415
+ //java.awt.Toolkit.getDefaultToolkit().beep();
20502416 Undo();
2417
+ } else
2418
+ if (source == restoreButton)
2419
+ {
2420
+ // Restore current version
2421
+ Restore();
2422
+ } else
2423
+ if (source == replaceButton)
2424
+ {
2425
+ // Overwrite current version
2426
+ Replace();
20512427 } else
20522428 if (source == redoButton)
20532429 {
2430
+ // Go to next version
20542431 Redo();
20552432 } else
20562433 if (source == saveButton)
20572434 {
2058
- Save();
2435
+ // Save a new version
2436
+ if (!Save(true))
2437
+ java.awt.Toolkit.getDefaultToolkit().beep();
20592438 } else
20602439 if (source == oneStepButton)
20612440 {
....@@ -2064,17 +2443,14 @@
20642443 } else
20652444 if (source == screenfitButton)
20662445 {
2067
- //Reload(lastConverter, lastFilename, true);
20682446 ScreenFit();
20692447 } else
20702448 if (source == screenfitpointButton)
20712449 {
2072
- //Reload(lastConverter, lastFilename, true);
20732450 ScreenFitPoint();
20742451 } else
20752452 if (source == snapobjectButton)
20762453 {
2077
- //Reload(lastConverter, lastFilename, true);
20782454 SnapObject();
20792455 } else
20802456 // if (event.getSource() == recompileButton)
....@@ -2438,7 +2814,7 @@
24382814 {
24392815 StepAll();
24402816 } else
2441
- if (source == clearItem) // || event.getSource() == clearButton)
2817
+ if (source == deleteItem) // || event.getSource() == clearButton)
24422818 {
24432819 //int indices[] = jList.getSelectedIndices();
24442820 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2450,9 +2826,9 @@
24502826 {
24512827 ClearSelection(true);
24522828 } else
2453
- if (source == grabItem)
2829
+ if (source == grabItem || source == groupButton)
24542830 {
2455
- group(new cGroup(), true);
2831
+ group(new cGroup(), false); // true);
24562832 } else
24572833 if (source == hideItem)
24582834 {
....@@ -2470,11 +2846,11 @@
24702846 {
24712847 makeSomething(new Camera());
24722848 } else
2473
- if (source == compositeItem)
2849
+ if (source == compositeItem || source == compositeButton)
24742850 {
24752851 group(new Composite());
24762852 } else
2477
- if (source == randomItem)
2853
+ if (source == switchItem || source == switchButton)
24782854 {
24792855 RandomNode random = new RandomNode();
24802856 group(random);
....@@ -2576,7 +2952,7 @@
25762952 {
25772953 group(new cLinker());
25782954 } else
2579
- if (source == textureItem)
2955
+ if (source == textureItem || source == textureButton)
25802956 {
25812957 group(new TextureNode());
25822958 } else
....@@ -2596,17 +2972,30 @@
25962972 {
25972973 CastShadow(2);
25982974 } else
2599
- if (source == ungroupItem)
2975
+ if (source == ungroupItem || source == ungroupButton)
26002976 {
2601
- //ungroup();
2977
+ boolean hasRoot = false;
2978
+
26022979 for (int i=0; i<group.selection.size(); i++)
26032980 {
2604
- Ungroup(group.selection.get(i));
2981
+ if (group.selection.get(i) == group)
2982
+ {
2983
+ hasRoot = true;
2984
+ break;
2985
+ }
26052986 }
26062987
2607
- ClearSelection(false);
2608
-
2609
- refreshContents();
2988
+ if (!hasRoot)
2989
+ {
2990
+ for (int i=0; i<group.selection.size(); i++)
2991
+ {
2992
+ Ungroup(group.selection.get(i));
2993
+ }
2994
+
2995
+ ClearSelection(false);
2996
+
2997
+ refreshContents();
2998
+ }
26102999 } else
26113000 if (source == genUVItem)
26123001 {
....@@ -2907,7 +3296,7 @@
29073296 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
29083297 {
29093298 obj = (Object3D)e.nextElement();
2910
- obj.SetBumpTexture(null);
3299
+ obj.ResetBumpTexture();
29113300 }
29123301
29133302 refreshContents();
....@@ -2923,6 +3312,31 @@
29233312
29243313 refreshContents();
29253314 } else
3315
+ if (source == embedTexturesItem)
3316
+ {
3317
+ Object3D obj;
3318
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3319
+ {
3320
+ obj = (Object3D)e.nextElement();
3321
+ obj.EmbedTextures(true);
3322
+ }
3323
+
3324
+ refreshContents();
3325
+ } else
3326
+ if (source == deEmbedTexturesItem)
3327
+ {
3328
+ Object3D obj;
3329
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3330
+ {
3331
+ obj = (Object3D)e.nextElement();
3332
+ obj.EmbedTextures(false);
3333
+ }
3334
+
3335
+ CameraPane.texturepigment.clear();
3336
+ CameraPane.texturebump.clear();
3337
+
3338
+ refreshContents();
3339
+ } else
29263340 if (source == flashSelectionButton)
29273341 {
29283342 CameraPane.flash = true;
....@@ -2934,6 +3348,10 @@
29343348 if (source == twoButton)
29353349 {
29363350 radio.layout = twoButton;
3351
+
3352
+ if (CameraPane.FULLSCREEN)
3353
+ fullscreenLayout = radio.layout;
3354
+
29373355 // bug
29383356 //gridPanel.setDividerLocation(1.0);
29393357 //bigPanel.setDividerLocation(0.0);
....@@ -2989,6 +3407,9 @@
29893407 {
29903408 radio.layout = threeButton;
29913409
3410
+ if (CameraPane.FULLSCREEN)
3411
+ fullscreenLayout = radio.layout;
3412
+
29923413 // bigThree.remove(scenePanel);
29933414 // bigThree.remove(centralPanel);
29943415 // bigThree.remove(XYZPanel);
....@@ -3017,8 +3438,8 @@
30173438 // centralPanel.setVisible(true);
30183439 // XYZPanel.setVisible(true);
30193440 bigThree.ClearUI();
3441
+ bigThree.add(scenePanel);
30203442 bigThree.add(centralPanel);
3021
- bigThree.add(XYZPanel);
30223443 bigThree.FlushUI();
30233444
30243445 cameraView.requestFocusInWindow();
....@@ -3026,6 +3447,9 @@
30263447 if (source == fourButton)
30273448 {
30283449 radio.layout = fourButton;
3450
+
3451
+ if (CameraPane.FULLSCREEN)
3452
+ fullscreenLayout = radio.layout;
30293453
30303454 // bigThree.remove(scenePanel);
30313455 // bigThree.remove(centralPanel);
....@@ -3064,6 +3488,9 @@
30643488 {
30653489 radio.layout = sixButton;
30663490
3491
+ if (CameraPane.FULLSCREEN)
3492
+ fullscreenLayout = radio.layout;
3493
+
30673494 // bigThree.remove(scenePanel);
30683495 // bigThree.remove(centralPanel);
30693496 // bigThree.remove(XYZPanel);
....@@ -3092,8 +3519,8 @@
30923519 // centralPanel.setVisible(true);
30933520 // XYZPanel.setVisible(false);
30943521 bigThree.ClearUI();
3095
- bigThree.add(scenePanel);
30963522 bigThree.add(centralPanel);
3523
+ bigThree.add(scenePanel);
30973524 bigThree.FlushUI();
30983525
30993526 cameraView.requestFocusInWindow();
....@@ -3101,6 +3528,9 @@
31013528 if (source == sevenButton)
31023529 {
31033530 radio.layout = sevenButton;
3531
+
3532
+ if (CameraPane.FULLSCREEN)
3533
+ fullscreenLayout = radio.layout;
31043534
31053535 // bigThree.remove(scenePanel);
31063536 // bigThree.remove(centralPanel);
....@@ -3182,6 +3612,12 @@
31823612 } else
31833613 if (source == editItem || source == editButton)
31843614 {
3615
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3616
+ {
3617
+ Object3D child = (Object3D)e.nextElement();
3618
+ child.pinned = true;
3619
+ }
3620
+
31853621 EditSelection(false);
31863622 } else
31873623 if (source == uneditButton)
....@@ -3191,6 +3627,7 @@
31913627 Object3D child = (Object3D)e.nextElement();
31923628 if(child.editWindow != null)
31933629 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3630
+ child.pinned = false;
31943631 child.CloseUI();
31953632 listUI.remove(child);
31963633
....@@ -3207,6 +3644,7 @@
32073644 //copy.ClearUI();
32083645 for (Object3D obj : listUI)
32093646 {
3647
+ obj.pinned = false;
32103648 obj.CloseUI();
32113649 }
32123650 listUI.clear();
....@@ -3216,7 +3654,7 @@
32163654 {
32173655 assert(copy == group);
32183656
3219
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3657
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
32203658
32213659 for (Object3D obj : listUI)
32223660 {
....@@ -3265,6 +3703,9 @@
32653703 }
32663704
32673705 copy = group;
3706
+
3707
+ SetUndoStates();
3708
+
32683709 //Globals.theRenderer.object = group;
32693710 if(!useclient)
32703711 {
....@@ -3291,6 +3732,13 @@
32913732 currentLayout = sevenButton;
32923733 */
32933734 radio.layout.doClick();
3735
+
3736
+ ClearUnpinned();
3737
+ //Grafreed.Assert(group != null);
3738
+ //Grafreed.Assert(group.selection != null);
3739
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3740
+ if (group.selection == null || group.selection.size() == 1)
3741
+ EditSelection(false);
32943742 keepparent = group.parent;
32953743 // PARENT = NULL or not???
32963744 //group.parent = null; // ROOT
....@@ -3304,7 +3752,7 @@
33043752 cameraView.ProtectCamera();
33053753 cameraView.repaint();
33063754 return;
3307
- } else if (event.getSource() == revertCameraItem)
3755
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
33083756 {
33093757 cameraView.RevertCamera();
33103758 cameraView.repaint();
....@@ -3883,7 +4331,7 @@
38834331
38844332 try
38854333 {
3886
- texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4334
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
38874335 }
38884336 catch (Exception e)
38894337 {
....@@ -4358,28 +4806,25 @@
43584806 // }
43594807 // }
43604808
4361
- static boolean allparams = true;
4362
-
4363
- static Vector<Object3D> listUI = new Vector<Object3D>();
4364
-
43654809 void EditSelection(boolean newWindow)
43664810 {
4811
+ if (group.selection == null)
4812
+ {
4813
+ EditElement(group, newWindow); // ? new
4814
+ return;
4815
+ }
4816
+
43674817 // aConstraints.gridy = 0;
43684818 for (int i=0; i<group.selection.size(); i++)
43694819 {
43704820 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
43714821 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4372
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4822
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
43734823
43744824 Object3D elem = (Object3D)group.selection.elementAt(i);
43754825 if(elem != group || !newWindow)
43764826 {
4377
- // if (!(elem instanceof Composite))
4378
- // newWindow = false;
4379
- listUI.add(elem);
4380
- elem.openEditWindow(this, newWindow); //, false);
4381
- System.out.println("edit : " + elem);
4382
- elem.editWindow.refreshContents(true); // ? new
4827
+ EditElement(elem, newWindow); // ? new
43834828 }
43844829 }
43854830 }
....@@ -4454,7 +4899,8 @@
44544899 //new Exception().printStackTrace();
44554900
44564901 freezemodel = true;
4457
-
4902
+ ClearUnpinned();
4903
+
44584904 /**/
44594905 //switch (event.id)
44604906 {
....@@ -4487,7 +4933,7 @@
44874933 if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
44884934 // a camera
44894935 {
4490
- if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4936
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
44914937 {
44924938 CameraPane.camerachangeframe = 0; // don't refuse it
44934939 Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
....@@ -4496,6 +4942,13 @@
44964942 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
44974943 }
44984944
4945
+ if (tps != null && tps.length == 1)
4946
+ {
4947
+ EditSelection(false);
4948
+ }
4949
+
4950
+ SetPinStates(tps != null && tps.length > 0);
4951
+
44994952 refreshContents();
45004953 //return true;
45014954 }
....@@ -4505,9 +4958,18 @@
45054958 freezemodel = false;
45064959 }
45074960
4961
+ void SetPinStates(boolean enabled)
4962
+ {
4963
+ editButton.setEnabled(enabled);
4964
+ uneditButton.setEnabled(enabled);
4965
+ unselectButton.setEnabled(enabled);
4966
+ flashSelectionButton.setEnabled(enabled);
4967
+ }
4968
+
45084969 void refreshContents(boolean cp)
45094970 {
4510
- if (!Globals.MOUSEDRAGGED)
4971
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
4972
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
45114973 {
45124974 objEditor.ClearInfo(); // .GetMaterial());
45134975
....@@ -4606,8 +5068,8 @@
46065068
46075069 if (cut)
46085070 {
4609
- if (Globals.SAVEONMAKE)
4610
- Save();
5071
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5072
+// Save();
46115073 //int indices[] = jList.getSelectedIndices();
46125074 //for (int i = indices.length - 1; i >= 0; i--)
46135075 //jList.remove(indices[i]);
....@@ -4710,6 +5172,10 @@
47105172
47115173 void paste(boolean expand)
47125174 {
5175
+ if (Globals.REPLACEONMAKE)
5176
+ Save();
5177
+ boolean keep = Globals.REPLACEONMAKE;
5178
+ Globals.REPLACEONMAKE = false;
47135179 // if (GrafreeD.clipboard == null)
47145180 // return;
47155181 boolean first = true;
....@@ -4769,6 +5235,7 @@
47695235 Grafreed.clipboard.get(0).parent = keepparent;
47705236 }
47715237
5238
+ Globals.REPLACEONMAKE = keep;
47725239 ResetModel();
47735240 refreshContents();
47745241 }
....@@ -4904,6 +5371,10 @@
49045371
49055372 void group(Object3D csg, boolean grab)
49065373 {
5374
+ if (Globals.REPLACEONMAKE)
5375
+ Save();
5376
+ boolean keep = Globals.REPLACEONMAKE;
5377
+ Globals.REPLACEONMAKE = false;
49075378 if (//false) // why??
49085379 !group.selection.isEmpty())
49095380 {
....@@ -5017,10 +5488,15 @@
50175488 //node.add(csg);
50185489 //makeSomething(node);
50195490 makeSomething(csg);
5491
+ Globals.REPLACEONMAKE = keep;
50205492 }
50215493
50225494 void Ungroup(Object3D g)
50235495 {
5496
+ if (Globals.REPLACEONMAKE)
5497
+ Save();
5498
+ boolean keep = Globals.REPLACEONMAKE;
5499
+ Globals.REPLACEONMAKE = false;
50245500 if (g instanceof HiddenObject)
50255501 {
50265502 HiddenObject h = (HiddenObject) g;
....@@ -5037,6 +5513,7 @@
50375513 objEditor.makeSomething(g.get(i), false);
50385514 }
50395515 }
5516
+ Globals.REPLACEONMAKE = keep;
50405517 }
50415518
50425519 void ungroup()
....@@ -5325,13 +5802,44 @@
53255802 cButton clearpanelButton;
53265803 cButton unselectButton;
53275804
5328
- cButton minButton;
5329
- cButton maxButton;
5330
- cButton fullButton;
5331
- cButton undoButton;
5332
- cButton redoButton;
5805
+ cButton restoreCameraButton;
5806
+
53335807 cButton saveButton;
53345808 cButton oneStepButton;
5809
+
5810
+ cButton groupButton;
5811
+ cButton ungroupButton;
5812
+ cButton compositeButton;
5813
+ cButton switchButton;
5814
+ cButton loopButton;
5815
+ cButton textureButton;
5816
+
5817
+ cButton skybox1Button;
5818
+ cButton skybox2Button;
5819
+ cButton skybox3Button;
5820
+ cButton skybox4Button;
5821
+ cButton skybox5Button;
5822
+ cButton skybox6Button;
5823
+ cButton skybox7Button;
5824
+
5825
+ cButton skybox11Button;
5826
+ cButton skybox12Button;
5827
+ cButton skybox13Button;
5828
+ cButton skybox14Button;
5829
+ cButton skybox15Button;
5830
+ cButton skybox16Button;
5831
+ cButton skybox17Button;
5832
+
5833
+ cButton gridButton;
5834
+ cButton boxButton;
5835
+ cButton sphereButton;
5836
+ cButton coneButton;
5837
+ cButton torusButton;
5838
+ cButton superButton;
5839
+ cButton kleinButton;
5840
+ cButton particlesButton;
5841
+ cButton overlayButton;
5842
+ cButton lightButton;
53355843
53365844 cButton screenfitButton;
53375845 cButton screenfitpointButton;
....@@ -5353,11 +5861,11 @@
53535861 //JTree jTree;
53545862 private MenuItem lookAtItem;
53555863 private MenuItem lookFromItem;
5356
- private MenuItem switchItem;
5864
+ private MenuItem switchViewItem;
53575865 private MenuItem cutItem;
53585866 private MenuItem undoItem;
53595867 private MenuItem redoItem;
5360
- private MenuItem duplicateItem;
5868
+ private JMenuItem duplicateItem;
53615869 private MenuItem cloneItem;
53625870 private MenuItem cloneSupportItem;
53635871 private MenuItem overwriteGeoItem;
....@@ -5385,7 +5893,7 @@
53855893 private MenuItem pasteLinkItem;
53865894 private MenuItem pasteCloneItem;
53875895 private MenuItem pasteExpandItem;
5388
- private MenuItem clearItem;
5896
+ private MenuItem deleteItem;
53895897 private MenuItem clearAllItem;
53905898 private MenuItem genUVItem;
53915899 private MenuItem genNormalsMESHItem;
....@@ -5445,7 +5953,7 @@
54455953 private MenuItem frontItem;
54465954 private MenuItem cameraItem;
54475955 private MenuItem compositeItem;
5448
- private MenuItem randomItem;
5956
+ private MenuItem switchItem;
54495957 private MenuItem physicsItem;
54505958 private MenuItem frameselectorItem;
54515959 private MenuItem scriptNodeItem;
....@@ -5469,6 +5977,8 @@
54695977 private MenuItem attachBumpItem;
54705978 private MenuItem detachBumpItem;
54715979 private MenuItem pigmentBumpItem;
5980
+ private MenuItem embedTexturesItem;
5981
+ private MenuItem deEmbedTexturesItem;
54725982
54735983 private MenuItem particleItem;
54745984 private MenuItem ragdollItem;
....@@ -5519,5 +6029,5 @@
55196029
55206030 Menu cameraMenu;
55216031 MenuItem editCameraItem;
5522
- MenuItem revertCameraItem;
6032
+ MenuItem restoreCameraItem;
55236033 }