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 = new cButton("\u271A", !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
587
- oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
651
+ 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 = new cButton("\u21a9", !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 = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
- redoButton.setToolTipText("Redo changes");
597
- redoButton.addActionListener(this);
598
-
599
- oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !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 = new cCheckBox("Live", 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(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
694
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608695 oneStepButton.setToolTipText("Animate one step forward");
609696 oneStepButton.addActionListener(this);
610697
611
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
698
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
612699 fastCB.setToolTipText("Fast mode");
613700 fastCB.addItemListener(this);
614701
615
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints);
616
- trackCB.setToolTipText("Enable tracking");
617
- trackCB.addItemListener(this);
618
-
619
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620
- screenfitButton.setToolTipText("Screen fit");
621
- screenfitButton.addActionListener(this);
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 = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
- flashSelectionButton.setToolTipText("Show 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,20 +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
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);
1109
+
1110
+ panel.Return();
8181111 if (Globals.ADVANCED)
8191112 {
8201113 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
....@@ -825,10 +1118,15 @@
8251118 }
8261119
8271120 cGridBag fill = new cGridBag();
828
-
8291121 fill.preferredHeight = 200;
1122
+ cGridBag fill2 = new cGridBag();
1123
+ fill2.preferredHeight = 200;
1124
+ cGridBag fill3 = new cGridBag();
1125
+ fill3.preferredHeight = 200;
8301126
8311127 panel.add(fill);
1128
+ panel.add(fill2);
1129
+ panel.add(fill3);
8321130
8331131 }
8341132
....@@ -836,7 +1134,7 @@
8361134 {
8371135 cRadio radioButton = new cRadio(obj.name);
8381136
839
- // Patch to avoid bug with transparency.
1137
+ // June 2019. Patch to avoid bug with transparency.
8401138 radioButton.hadMaterial = obj.material != null;
8411139 if (!radioButton.hadMaterial)
8421140 {
....@@ -844,7 +1142,7 @@
8441142 }
8451143
8461144 radioButton.SetObject(obj);
847
- radioButton.layout = sevenButton;
1145
+ radioButton.layout = sixButton; // sevenButton;
8481146 radioButton.SetCamera(cameraView.renderCamera, false);
8491147 radioButton.addActionListener(this);
8501148 radioPanel.add(radioButton);
....@@ -864,25 +1162,28 @@
8641162 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
8651163 }
8661164
867
- JCheckBox liveCB;
868
- JCheckBox supportCB;
869
- JCheckBox localCB;
870
- JCheckBox crowdCB;
871
- JCheckBox smoothCB;
872
- JCheckBox fastCB;
873
- JCheckBox slowCB;
874
- JCheckBox boxCB;
875
- JCheckBox zoomBoxCB;
876
- JCheckBox trackCB;
877
- JCheckBox smoothfocusCB;
1165
+ cToggleButton liveCB;
1166
+ cCheckBox supportCB;
1167
+ cCheckBox localCB;
1168
+ cCheckBox crowdCB;
1169
+ cCheckBox smoothCB;
1170
+ cToggleButton fastCB;
1171
+ cCheckBox slowCB;
1172
+ cCheckBox boxCB;
1173
+ cCheckBox zoomBoxCB;
1174
+ cCheckBox freezeCB;
1175
+ //cToggleButton trackCB;
1176
+ cCheckBox trackCB;
1177
+ cCheckBox smoothfocusCB;
8781178 // JCheckBox speakerMocapCB;
879
- JCheckBox speakerCameraCB;
880
- JCheckBox speakerFocusCB;
881
- JCheckBox debugCB;
1179
+ cCheckBox speakerCameraCB;
1180
+ cCheckBox speakerFocusCB;
1181
+ cCheckBox debugCB;
8821182
883
- JCheckBox oeilCB;
884
- JCheckBox shadowCB;
885
- JCheckBox lookAtCB;
1183
+ cCheckBox oeilCB;
1184
+ cCheckBox shadowCB;
1185
+ cCheckBox autokeepCB;
1186
+ cCheckBox lookAtCB;
8861187
8871188 // static int COLOR = 1;
8881189 // static int MATERIAL = 2;
....@@ -890,9 +1191,9 @@
8901191
8911192 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
8921193
893
- JCheckBox colorCB;
894
- JCheckBox materialCB;
895
- JCheckBox textureCB;
1194
+ cCheckBox colorCB;
1195
+ cCheckBox materialCB;
1196
+ cCheckBox textureCB;
8961197
8971198 public void itemStateChanged(ItemEvent e)
8981199 {
....@@ -989,6 +1290,14 @@
9891290 {
9901291 Globals.COMPUTESHADOWWHENLIVE ^= true;
9911292 }
1293
+ else if(e.getSource() == freezeCB)
1294
+ {
1295
+ Globals.FREEZEONMOVE ^= true;
1296
+ }
1297
+ else if(e.getSource() == autokeepCB)
1298
+ {
1299
+ Globals.REPLACEONMAKE ^= true;
1300
+ }
9921301 else if(e.getSource() == lookAtCB)
9931302 {
9941303 cameraView.ToggleLookAt();
....@@ -1005,7 +1314,8 @@
10051314
10061315 /**/
10071316 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
1008
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1317
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1318
+ TreePath path = objEditor.jTree.getSelectionPath();
10091319 if ((path == null) || (path.getPathCount() <= 1)) {
10101320 // We can't move the root node or an empty selection
10111321 return;
....@@ -1068,8 +1378,6 @@
10681378 }
10691379 }
10701380
1071
- String string = (String) object;
1072
-
10731381 System.out.println("Transfer = " + object + "; drop : " + target);
10741382 // if( object instanceof java.io.File[])
10751383 // {
....@@ -1077,6 +1385,8 @@
10771385 // objEditor.DropFile((java.io.File[]) object, true);
10781386 // return;
10791387 // }
1388
+
1389
+ String string = object.toString();
10801390
10811391 // File path for Mac and Windows
10821392 if (string.charAt(0) == '/' || string.charAt(1) == ':')
....@@ -1122,23 +1432,33 @@
11221432
11231433 assert target == objEditor.jTree;
11241434 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1435
+ Object3D destinationLeaf;
11251436 try {
1126
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1437
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
11271438 } catch (Exception e) {
11281439 System.out.println("destinationPath : " + destinationPath);
11291440 return;
11301441 }
11311442
1132
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1443
+ for (int i=group.selection.size(); --i>=0;)
11331444 {
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
+// {
11341454 loadClipboard(true);
11351455 objEditor.jTree.setSelectionPath(destinationPath);
11361456 pasteInto(false, false);
1137
- } else {
1138
- loadClipboard(false);
1139
- objEditor.jTree.setSelectionPath(destinationPath);
1140
- pasteInto(false, false); // true); // ???
1141
- }
1457
+// } else {
1458
+// loadClipboard(false);
1459
+// objEditor.jTree.setSelectionPath(destinationPath);
1460
+// pasteInto(false, false); // true); // ???
1461
+// }
11421462 }
11431463 public void dropActionChanged(DropTargetDragEvent dtde)
11441464 // Called if the user has modified the current drop gesture
....@@ -1243,22 +1563,30 @@
12431563 {
12441564 //heightFieldItem = menu.add(new MenuItem("Height Field"));
12451565 //heightFieldItem.addActionListener(this);
1246
- gridItem = menu.add(new MenuItem("Grid"));
1247
- gridItem.addActionListener(this);
1248
- rectoidItem = menu.add(new MenuItem("Box"));
1249
- rectoidItem.addActionListener(this);
1250
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1251
- ellipsoidItem.addActionListener(this);
1252
- coneItem = menu.add(new MenuItem("Cone"));
1253
- coneItem.addActionListener(this);
1254
- torusItem = menu.add(new MenuItem("Torus"));
1255
- torusItem.addActionListener(this);
1256
- superItem = menu.add(new MenuItem("Superellipsoid"));
1257
- superItem.addActionListener(this);
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
+ {
12581584 kleinItem = menu.add(new MenuItem("Klein Bottle"));
12591585 kleinItem.addActionListener(this);
1260
- particleItem = menu.add(new MenuItem("Particle system"));
1261
- particleItem.addActionListener(this);
1586
+ }
1587
+
1588
+// particleItem = menu.add(new MenuItem("Particle system"));
1589
+// particleItem.addActionListener(this);
12621590 if (Globals.ADVANCED)
12631591 {
12641592 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1284,15 +1612,15 @@
12841612 }
12851613 bezierItem = menu.add(new MenuItem("Bezier Patch"));
12861614 bezierItem.addActionListener(this);
1287
- overlayItem = menu.add(new MenuItem("Overlay"));
1288
- overlayItem.addActionListener(this);
1289
- lightItem = menu.add(new MenuItem("Light"));
1290
- lightItem.addActionListener(this);
1615
+// overlayItem = menu.add(new MenuItem("Overlay"));
1616
+// overlayItem.addActionListener(this);
1617
+// lightItem = menu.add(new MenuItem("Light"));
1618
+// lightItem.addActionListener(this);
12911619 menu.add("-");
12921620 //superLoopItem = menu.add(new MenuItem("Super Loop"));
12931621 //superLoopItem.addActionListener(this);
1294
- loopItem = menu.add(new MenuItem("Loop"));
1295
- loopItem.addActionListener(this);
1622
+// loopItem = menu.add(new MenuItem("Loop"));
1623
+// loopItem.addActionListener(this);
12961624 doubleItem = menu.add(new MenuItem("Fork"));
12971625 doubleItem.addActionListener(this);
12981626 if (Globals.ADVANCED)
....@@ -1308,6 +1636,9 @@
13081636 animationItem.addItemListener(this);
13091637 animationItem.setState(Globals.ANIMATION);
13101638
1639
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1640
+ archiveItem.addActionListener(this);
1641
+
13111642 menu.add("-");
13121643 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
13131644 parseverticesItem.addActionListener(this);
....@@ -1320,6 +1651,8 @@
13201651 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
13211652 reduce34MorphItem.addActionListener(this);
13221653 menu.add("-");
1654
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1655
+ memoryItem.addActionListener(this);
13231656 menu.add(computeAOItem = new MenuItem("Compute AO"));
13241657 computeAOItem.addActionListener(this);
13251658
....@@ -1328,8 +1661,6 @@
13281661 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
13291662 mirrorItem.addActionListener(this);
13301663 menu.add("-");
1331
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1332
- memoryItem.addActionListener(this);
13331664 menu.add(analyzeItem = new MenuItem("Analyze"));
13341665 analyzeItem.addActionListener(this);
13351666 menu.add(dumpItem = new MenuItem("Print"));
....@@ -1477,6 +1808,30 @@
14771808
14781809 makeSomething(shadow);
14791810 }
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
+ }
14801835
14811836 /**
14821837 * applyExample
....@@ -1721,7 +2076,7 @@
17212076 {
17222077 ScreenFit();
17232078 } else
1724
- if (source == switchItem)
2079
+ if (source == switchViewItem)
17252080 {
17262081 cVector v1 = new cVector();
17272082 cVector v2 = new cVector();
....@@ -1730,11 +2085,11 @@
17302085 objEditor.cameraView.renderCamera.setAim(v2, v1);
17312086 objEditor.cameraView.repaint();
17322087 } else
1733
- if (source == rectoidItem)
2088
+ if (source == rectoidItem || source == boxButton)
17342089 {
17352090 makeSomething(new Box());
17362091 } else
1737
- if (source == particleItem)
2092
+ if (source == particleItem || source == particlesButton)
17382093 {
17392094 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
17402095 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1813,27 +2168,27 @@
18132168
18142169 makeSomething(obj);
18152170 } else
1816
- if (source == gridItem)
2171
+ if (source == gridItem || source == gridButton)
18172172 {
18182173 makeSomething(new Grid());
18192174 } else
1820
- if (source == ellipsoidItem)
2175
+ if (source == ellipsoidItem || source == sphereButton)
18212176 {
18222177 makeSomething(new Sphere());
18232178 } else
1824
- if (source == coneItem)
2179
+ if (source == coneItem || source == coneButton)
18252180 {
18262181 makeSomething(new Cone());
18272182 } else
1828
- if (source == torusItem)
2183
+ if (source == torusItem || source == torusButton)
18292184 {
18302185 makeSomething(new Torus());
18312186 } else
1832
- if (source == superItem)
2187
+ if (source == superItem || source == superButton)
18332188 {
18342189 makeSomething(new Superellipsoid());
18352190 } else
1836
- if (source == kleinItem)
2191
+ if (source == kleinItem || source == kleinButton)
18372192 {
18382193 makeSomething(new Klein());
18392194 } else
....@@ -1853,7 +2208,7 @@
18532208 {
18542209 makeSomething(new BezierSurface());
18552210 } else
1856
- if (source == overlayItem)
2211
+ if (source == overlayItem || source == overlayButton)
18572212 {
18582213 /*
18592214 Object3D obj = new BezierSurface(5,8);
....@@ -1901,10 +2256,27 @@
19012256 s.setup();
19022257 makeSomething(s);
19032258 } else
1904
- if (source == lightItem)
2259
+ if (source == lightItem || source == lightButton)
19052260 {
19062261 makeSomething(new Light());
19072262 } 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
19082280 if (source == csgItem)
19092281 {
19102282 group(new CSG());
....@@ -1951,30 +2323,30 @@
19512323
19522324 group(g);
19532325 } else
1954
- if (source == loopItem)
2326
+ if (source == loopItem || source == loopButton)
19552327 {
19562328 Composite csg = new GroupLeaf();
19572329 csg.count = 5;
19582330 group(csg);
1959
- Composite child = new cGroup();
2331
+ Composite child = new cGroup("Branch");
19602332 csg.addChild(child);
19612333 child.addChild(csg);
19622334 } else
19632335 if (source == doubleItem)
19642336 {
1965
- Composite csg = new GroupLeaf();
2337
+ Composite csg = new GroupLeaf("Fork");
19662338 csg.count = 5;
19672339 group(csg);
1968
- Composite child = new cGroup();
2340
+ Composite child = new cGroup("Branch A");
19692341 csg.addChild(child);
19702342 child.addChild(csg);
1971
- child = new cGroup();
2343
+ child = new cGroup("Branch B");
19722344 csg.addChild(child);
19732345 child.addChild(csg);
19742346 } else
19752347 if (source == tripleItem)
19762348 {
1977
- Composite csg = new GroupLeaf();
2349
+ Composite csg = new GroupLeaf("Trident");
19782350 csg.count = 4;
19792351 group(csg);
19802352 Composite child = new cGroup();
....@@ -1990,7 +2362,7 @@
19902362 if (source == computeAOItem)
19912363 {
19922364 Globals.drawMode = CameraPane.OCCLUSION;
1993
- Globals.theRenderer.repaint();
2365
+ cameraView.repaint();
19942366 } else
19952367 if (source == recompileItem)
19962368 {
....@@ -2038,15 +2410,31 @@
20382410 } else
20392411 if (source == undoButton)
20402412 {
2413
+ // Go to previous version
2414
+ //if (!Undo())
2415
+ //java.awt.Toolkit.getDefaultToolkit().beep();
20412416 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();
20422427 } else
20432428 if (source == redoButton)
20442429 {
2430
+ // Go to next version
20452431 Redo();
20462432 } else
20472433 if (source == saveButton)
20482434 {
2049
- Save();
2435
+ // Save a new version
2436
+ if (!Save(true))
2437
+ java.awt.Toolkit.getDefaultToolkit().beep();
20502438 } else
20512439 if (source == oneStepButton)
20522440 {
....@@ -2055,17 +2443,14 @@
20552443 } else
20562444 if (source == screenfitButton)
20572445 {
2058
- //Reload(lastConverter, lastFilename, true);
20592446 ScreenFit();
20602447 } else
20612448 if (source == screenfitpointButton)
20622449 {
2063
- //Reload(lastConverter, lastFilename, true);
20642450 ScreenFitPoint();
20652451 } else
20662452 if (source == snapobjectButton)
20672453 {
2068
- //Reload(lastConverter, lastFilename, true);
20692454 SnapObject();
20702455 } else
20712456 // if (event.getSource() == recompileButton)
....@@ -2429,7 +2814,7 @@
24292814 {
24302815 StepAll();
24312816 } else
2432
- if (source == clearItem) // || event.getSource() == clearButton)
2817
+ if (source == deleteItem) // || event.getSource() == clearButton)
24332818 {
24342819 //int indices[] = jList.getSelectedIndices();
24352820 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2441,9 +2826,9 @@
24412826 {
24422827 ClearSelection(true);
24432828 } else
2444
- if (source == grabItem)
2829
+ if (source == grabItem || source == groupButton)
24452830 {
2446
- group(new cGroup(), true);
2831
+ group(new cGroup(), false); // true);
24472832 } else
24482833 if (source == hideItem)
24492834 {
....@@ -2461,11 +2846,11 @@
24612846 {
24622847 makeSomething(new Camera());
24632848 } else
2464
- if (source == compositeItem)
2849
+ if (source == compositeItem || source == compositeButton)
24652850 {
24662851 group(new Composite());
24672852 } else
2468
- if (source == randomItem)
2853
+ if (source == switchItem || source == switchButton)
24692854 {
24702855 RandomNode random = new RandomNode();
24712856 group(random);
....@@ -2567,7 +2952,7 @@
25672952 {
25682953 group(new cLinker());
25692954 } else
2570
- if (source == textureItem)
2955
+ if (source == textureItem || source == textureButton)
25712956 {
25722957 group(new TextureNode());
25732958 } else
....@@ -2587,17 +2972,30 @@
25872972 {
25882973 CastShadow(2);
25892974 } else
2590
- if (source == ungroupItem)
2975
+ if (source == ungroupItem || source == ungroupButton)
25912976 {
2592
- //ungroup();
2977
+ boolean hasRoot = false;
2978
+
25932979 for (int i=0; i<group.selection.size(); i++)
25942980 {
2595
- Ungroup(group.selection.get(i));
2981
+ if (group.selection.get(i) == group)
2982
+ {
2983
+ hasRoot = true;
2984
+ break;
2985
+ }
25962986 }
25972987
2598
- ClearSelection(false);
2599
-
2600
- 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
+ }
26012999 } else
26023000 if (source == genUVItem)
26033001 {
....@@ -2898,7 +3296,7 @@
28983296 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28993297 {
29003298 obj = (Object3D)e.nextElement();
2901
- obj.SetBumpTexture(null);
3299
+ obj.ResetBumpTexture();
29023300 }
29033301
29043302 refreshContents();
....@@ -2914,6 +3312,31 @@
29143312
29153313 refreshContents();
29163314 } 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
29173340 if (source == flashSelectionButton)
29183341 {
29193342 CameraPane.flash = true;
....@@ -2925,6 +3348,10 @@
29253348 if (source == twoButton)
29263349 {
29273350 radio.layout = twoButton;
3351
+
3352
+ if (CameraPane.FULLSCREEN)
3353
+ fullscreenLayout = radio.layout;
3354
+
29283355 // bug
29293356 //gridPanel.setDividerLocation(1.0);
29303357 //bigPanel.setDividerLocation(0.0);
....@@ -2980,6 +3407,9 @@
29803407 {
29813408 radio.layout = threeButton;
29823409
3410
+ if (CameraPane.FULLSCREEN)
3411
+ fullscreenLayout = radio.layout;
3412
+
29833413 // bigThree.remove(scenePanel);
29843414 // bigThree.remove(centralPanel);
29853415 // bigThree.remove(XYZPanel);
....@@ -3008,8 +3438,8 @@
30083438 // centralPanel.setVisible(true);
30093439 // XYZPanel.setVisible(true);
30103440 bigThree.ClearUI();
3441
+ bigThree.add(scenePanel);
30113442 bigThree.add(centralPanel);
3012
- bigThree.add(XYZPanel);
30133443 bigThree.FlushUI();
30143444
30153445 cameraView.requestFocusInWindow();
....@@ -3017,6 +3447,9 @@
30173447 if (source == fourButton)
30183448 {
30193449 radio.layout = fourButton;
3450
+
3451
+ if (CameraPane.FULLSCREEN)
3452
+ fullscreenLayout = radio.layout;
30203453
30213454 // bigThree.remove(scenePanel);
30223455 // bigThree.remove(centralPanel);
....@@ -3055,6 +3488,9 @@
30553488 {
30563489 radio.layout = sixButton;
30573490
3491
+ if (CameraPane.FULLSCREEN)
3492
+ fullscreenLayout = radio.layout;
3493
+
30583494 // bigThree.remove(scenePanel);
30593495 // bigThree.remove(centralPanel);
30603496 // bigThree.remove(XYZPanel);
....@@ -3083,8 +3519,8 @@
30833519 // centralPanel.setVisible(true);
30843520 // XYZPanel.setVisible(false);
30853521 bigThree.ClearUI();
3086
- bigThree.add(scenePanel);
30873522 bigThree.add(centralPanel);
3523
+ bigThree.add(scenePanel);
30883524 bigThree.FlushUI();
30893525
30903526 cameraView.requestFocusInWindow();
....@@ -3092,6 +3528,9 @@
30923528 if (source == sevenButton)
30933529 {
30943530 radio.layout = sevenButton;
3531
+
3532
+ if (CameraPane.FULLSCREEN)
3533
+ fullscreenLayout = radio.layout;
30953534
30963535 // bigThree.remove(scenePanel);
30973536 // bigThree.remove(centralPanel);
....@@ -3159,7 +3598,8 @@
31593598 buttonGroup.remove(ab);
31603599 radioPanel.remove(ab);
31613600
3162
- ab.GetObject().editWindow = null;
3601
+ //ab.GetObject().editWindow = null;
3602
+ ab.GetObject().manipWindow = null;
31633603 // ab.GetObject().objectUI = null; // ?????????
31643604
31653605 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
....@@ -3172,6 +3612,12 @@
31723612 } else
31733613 if (source == editItem || source == editButton)
31743614 {
3615
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3616
+ {
3617
+ Object3D child = (Object3D)e.nextElement();
3618
+ child.pinned = true;
3619
+ }
3620
+
31753621 EditSelection(false);
31763622 } else
31773623 if (source == uneditButton)
....@@ -3181,6 +3627,7 @@
31813627 Object3D child = (Object3D)e.nextElement();
31823628 if(child.editWindow != null)
31833629 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3630
+ child.pinned = false;
31843631 child.CloseUI();
31853632 listUI.remove(child);
31863633
....@@ -3197,6 +3644,7 @@
31973644 //copy.ClearUI();
31983645 for (Object3D obj : listUI)
31993646 {
3647
+ obj.pinned = false;
32003648 obj.CloseUI();
32013649 }
32023650 listUI.clear();
....@@ -3206,7 +3654,7 @@
32063654 {
32073655 assert(copy == group);
32083656
3209
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3657
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
32103658
32113659 for (Object3D obj : listUI)
32123660 {
....@@ -3255,6 +3703,9 @@
32553703 }
32563704
32573705 copy = group;
3706
+
3707
+ SetUndoStates();
3708
+
32583709 //Globals.theRenderer.object = group;
32593710 if(!useclient)
32603711 {
....@@ -3273,6 +3724,7 @@
32733724
32743725 // fix "+" issue
32753726 //group.editWindow = this;
3727
+ group.manipWindow = this;
32763728
32773729 /*
32783730 currentLayout = radio.layout;
....@@ -3280,6 +3732,13 @@
32803732 currentLayout = sevenButton;
32813733 */
32823734 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);
32833742 keepparent = group.parent;
32843743 // PARENT = NULL or not???
32853744 //group.parent = null; // ROOT
....@@ -3293,7 +3752,7 @@
32933752 cameraView.ProtectCamera();
32943753 cameraView.repaint();
32953754 return;
3296
- } else if (event.getSource() == revertCameraItem)
3755
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
32973756 {
32983757 cameraView.RevertCamera();
32993758 cameraView.repaint();
....@@ -3872,7 +4331,7 @@
38724331
38734332 try
38744333 {
3875
- texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4334
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
38764335 }
38774336 catch (Exception e)
38784337 {
....@@ -4347,28 +4806,25 @@
43474806 // }
43484807 // }
43494808
4350
- static boolean allparams = true;
4351
-
4352
- static Vector<Object3D> listUI = new Vector<Object3D>();
4353
-
43544809 void EditSelection(boolean newWindow)
43554810 {
4811
+ if (group.selection == null)
4812
+ {
4813
+ EditElement(group, newWindow); // ? new
4814
+ return;
4815
+ }
4816
+
43564817 // aConstraints.gridy = 0;
43574818 for (int i=0; i<group.selection.size(); i++)
43584819 {
43594820 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
43604821 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4361
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4822
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
43624823
43634824 Object3D elem = (Object3D)group.selection.elementAt(i);
43644825 if(elem != group || !newWindow)
43654826 {
4366
- // if (!(elem instanceof Composite))
4367
- // newWindow = false;
4368
- listUI.add(elem);
4369
- elem.openEditWindow(this, newWindow); //, false);
4370
- System.out.println("edit : " + elem);
4371
- elem.editWindow.refreshContents(true); // ? new
4827
+ EditElement(elem, newWindow); // ? new
43724828 }
43734829 }
43744830 }
....@@ -4443,7 +4899,8 @@
44434899 //new Exception().printStackTrace();
44444900
44454901 freezemodel = true;
4446
-
4902
+ ClearUnpinned();
4903
+
44474904 /**/
44484905 //switch (event.id)
44494906 {
....@@ -4476,7 +4933,7 @@
44764933 if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
44774934 // a camera
44784935 {
4479
- if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4936
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
44804937 {
44814938 CameraPane.camerachangeframe = 0; // don't refuse it
44824939 Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
....@@ -4485,6 +4942,13 @@
44854942 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
44864943 }
44874944
4945
+ if (tps != null && tps.length == 1)
4946
+ {
4947
+ EditSelection(false);
4948
+ }
4949
+
4950
+ SetPinStates(tps != null && tps.length > 0);
4951
+
44884952 refreshContents();
44894953 //return true;
44904954 }
....@@ -4494,9 +4958,18 @@
44944958 freezemodel = false;
44954959 }
44964960
4961
+ void SetPinStates(boolean enabled)
4962
+ {
4963
+ editButton.setEnabled(enabled);
4964
+ uneditButton.setEnabled(enabled);
4965
+ unselectButton.setEnabled(enabled);
4966
+ flashSelectionButton.setEnabled(enabled);
4967
+ }
4968
+
44974969 void refreshContents(boolean cp)
44984970 {
4499
- if (!Globals.MOUSEDRAGGED)
4971
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
4972
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
45004973 {
45014974 objEditor.ClearInfo(); // .GetMaterial());
45024975
....@@ -4595,7 +5068,8 @@
45955068
45965069 if (cut)
45975070 {
4598
- Save();
5071
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5072
+// Save();
45995073 //int indices[] = jList.getSelectedIndices();
46005074 //for (int i = indices.length - 1; i >= 0; i--)
46015075 //jList.remove(indices[i]);
....@@ -4698,6 +5172,10 @@
46985172
46995173 void paste(boolean expand)
47005174 {
5175
+ if (Globals.REPLACEONMAKE)
5176
+ Save();
5177
+ boolean keep = Globals.REPLACEONMAKE;
5178
+ Globals.REPLACEONMAKE = false;
47015179 // if (GrafreeD.clipboard == null)
47025180 // return;
47035181 boolean first = true;
....@@ -4757,6 +5235,7 @@
47575235 Grafreed.clipboard.get(0).parent = keepparent;
47585236 }
47595237
5238
+ Globals.REPLACEONMAKE = keep;
47605239 ResetModel();
47615240 refreshContents();
47625241 }
....@@ -4892,6 +5371,10 @@
48925371
48935372 void group(Object3D csg, boolean grab)
48945373 {
5374
+ if (Globals.REPLACEONMAKE)
5375
+ Save();
5376
+ boolean keep = Globals.REPLACEONMAKE;
5377
+ Globals.REPLACEONMAKE = false;
48955378 if (//false) // why??
48965379 !group.selection.isEmpty())
48975380 {
....@@ -5005,10 +5488,15 @@
50055488 //node.add(csg);
50065489 //makeSomething(node);
50075490 makeSomething(csg);
5491
+ Globals.REPLACEONMAKE = keep;
50085492 }
50095493
50105494 void Ungroup(Object3D g)
50115495 {
5496
+ if (Globals.REPLACEONMAKE)
5497
+ Save();
5498
+ boolean keep = Globals.REPLACEONMAKE;
5499
+ Globals.REPLACEONMAKE = false;
50125500 if (g instanceof HiddenObject)
50135501 {
50145502 HiddenObject h = (HiddenObject) g;
....@@ -5025,6 +5513,7 @@
50255513 objEditor.makeSomething(g.get(i), false);
50265514 }
50275515 }
5516
+ Globals.REPLACEONMAKE = keep;
50285517 }
50295518
50305519 void ungroup()
....@@ -5313,13 +5802,44 @@
53135802 cButton clearpanelButton;
53145803 cButton unselectButton;
53155804
5316
- cButton minButton;
5317
- cButton maxButton;
5318
- cButton fullButton;
5319
- cButton undoButton;
5320
- cButton redoButton;
5805
+ cButton restoreCameraButton;
5806
+
53215807 cButton saveButton;
53225808 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;
53235843
53245844 cButton screenfitButton;
53255845 cButton screenfitpointButton;
....@@ -5341,11 +5861,11 @@
53415861 //JTree jTree;
53425862 private MenuItem lookAtItem;
53435863 private MenuItem lookFromItem;
5344
- private MenuItem switchItem;
5864
+ private MenuItem switchViewItem;
53455865 private MenuItem cutItem;
53465866 private MenuItem undoItem;
53475867 private MenuItem redoItem;
5348
- private MenuItem duplicateItem;
5868
+ private JMenuItem duplicateItem;
53495869 private MenuItem cloneItem;
53505870 private MenuItem cloneSupportItem;
53515871 private MenuItem overwriteGeoItem;
....@@ -5373,7 +5893,7 @@
53735893 private MenuItem pasteLinkItem;
53745894 private MenuItem pasteCloneItem;
53755895 private MenuItem pasteExpandItem;
5376
- private MenuItem clearItem;
5896
+ private MenuItem deleteItem;
53775897 private MenuItem clearAllItem;
53785898 private MenuItem genUVItem;
53795899 private MenuItem genNormalsMESHItem;
....@@ -5433,7 +5953,7 @@
54335953 private MenuItem frontItem;
54345954 private MenuItem cameraItem;
54355955 private MenuItem compositeItem;
5436
- private MenuItem randomItem;
5956
+ private MenuItem switchItem;
54375957 private MenuItem physicsItem;
54385958 private MenuItem frameselectorItem;
54395959 private MenuItem scriptNodeItem;
....@@ -5457,6 +5977,8 @@
54575977 private MenuItem attachBumpItem;
54585978 private MenuItem detachBumpItem;
54595979 private MenuItem pigmentBumpItem;
5980
+ private MenuItem embedTexturesItem;
5981
+ private MenuItem deEmbedTexturesItem;
54605982
54615983 private MenuItem particleItem;
54625984 private MenuItem ragdollItem;
....@@ -5507,5 +6029,5 @@
55076029
55086030 Menu cameraMenu;
55096031 MenuItem editCameraItem;
5510
- MenuItem revertCameraItem;
6032
+ MenuItem restoreCameraItem;
55116033 }