Normand Briere
2019-07-18 d7a17c35c443e2cb6c09eaa3cfeaf590a571faa1
GroupEditor.java
....@@ -60,6 +60,12 @@
6060 this.copy = this.group = group;
6161 //selectees = this.group.selectees;
6262
63
+ if (copy.versions == null)
64
+ {
65
+ copy.versions = new byte[100][];
66
+ copy.versionindex = -1;
67
+ }
68
+
6369 if(ui)
6470 SetupUI(objEditor);
6571 }
....@@ -74,6 +80,12 @@
7480 this.copy = this.group = copy;
7581 //selectees = this.group.selectees;
7682
83
+ if (copy.versions == null)
84
+ {
85
+ copy.versions = new byte[100][];
86
+ copy.versionindex = -1;
87
+ }
88
+
7789 SetupMenu2(this); //objEditor);
7890 SetupUI2(objEditor);
7991 objEditor.SetupUI(true);
....@@ -84,6 +96,10 @@
8496
8597 void CloneSelection(boolean supports)
8698 {
99
+ if (Globals.REPLACEONMAKE)
100
+ Save();
101
+ boolean keep = Globals.REPLACEONMAKE;
102
+ Globals.REPLACEONMAKE = false;
87103 // Object3D keep = GrafreeD.clipboard;
88104 //Object3D obj;
89105 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -94,6 +110,7 @@
94110
95111 makeSomething(clone, i==group.selection.size()-1);
96112 }
113
+ Globals.REPLACEONMAKE = keep;
97114 }
98115
99116 void CloneClipboard(boolean supports)
....@@ -150,16 +167,19 @@
150167
151168 void SetupMenu2(GroupEditor oe)
152169 {
170
+ oe.jTree = new cTree();
171
+
153172 Menu menu;
154173 oe.menuBar.add(menu = new Menu("Edit"));
155174 //editItem = menu.add(new MenuItem("Edit"));
156175 //editItem.addActionListener(this);
157
- undoItem = menu.add(new MenuItem("Undo"));
158
- undoItem.addActionListener(this);
159
- redoItem = menu.add(new MenuItem("Redo"));
160
- redoItem.addActionListener(this);
161
- menu.add("-");
162
- duplicateItem = menu.add(new MenuItem("Duplicate"));
176
+
177
+// undoItem = menu.add(new MenuItem("Undo"));
178
+// undoItem.addActionListener(this);
179
+// redoItem = menu.add(new MenuItem("Redo"));
180
+// redoItem.addActionListener(this);
181
+// menu.add("-");
182
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
163183 duplicateItem.addActionListener(this);
164184 cloneItem = menu.add(new MenuItem("Clone"));
165185 cloneItem.addActionListener(this);
....@@ -175,7 +195,6 @@
175195 copyItem.addActionListener(this);
176196 pasteItem = menu.add(new MenuItem("Paste"));
177197 pasteItem.addActionListener(this);
178
- menu.add("-");
179198
180199 menu.add("-");
181200 pasteIntoItem = menu.add(new MenuItem("Paste into"));
....@@ -202,23 +221,23 @@
202221 //zBufferItem.addActionListener(this);
203222 //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
204223 //normalLensItem.addActionListener(this);
205
- cameraMenu.add(revertCameraItem = new MenuItem("Restore Camera"));
206
- revertCameraItem.addActionListener(this);
224
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
225
+ restoreCameraItem.addActionListener(this);
207226
208
- cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
209
- toggleFullScreenItem.addItemListener(this);
210
- toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
211
- cameraMenu.add("-");
227
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
228
+// toggleFullScreenItem.addItemListener(this);
229
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
230
+// cameraMenu.add("-");
231
+//
232
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
233
+// toggleTextureItem.addItemListener(this);
234
+// toggleTextureItem.setState(CameraPane.textureon);
235
+//
236
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
237
+// toggleSwitchItem.addItemListener(this);
238
+// toggleSwitchItem.setState(CameraPane.SWITCH);
212239
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"));
240
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
222241 toggleHandleItem.addItemListener(this);
223242 toggleHandleItem.setState(CameraPane.HANDLES);
224243
....@@ -245,7 +264,7 @@
245264
246265 cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
247266 toggleDebugItem.addItemListener(this);
248
- toggleDebugItem.setState(CameraPane.DEBUG);
267
+ toggleDebugItem.setState(Globals.DEBUG);
249268
250269 cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
251270 toggleFrustumItem.addItemListener(this);
....@@ -266,14 +285,14 @@
266285 // animationItem.addItemListener(this);
267286 // animationItem.setState(CameraPane.ANIMATION);
268287 cameraMenu.add("-");
269
- cameraMenu.add(editCameraItem = new MenuItem("Save Camera"));
288
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
270289 editCameraItem.addActionListener(this);
271290
272291 if (Globals.ADVANCED)
273292 {
274293 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
275294 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
276
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
295
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
277296 editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
278297 oe.cameraMenu.add("-");
279298 openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
....@@ -281,7 +300,7 @@
281300 editLeafItem.addActionListener(this);
282301 lookAtItem.addActionListener(this);
283302 //lookFromItem.addActinoListener(this);
284
- //switchItem.addActionListener(this);
303
+ //switchViewItem.addActionListener(this);
285304 }
286305
287306 oe.menuBar.add(menu = new Menu("Setting"));
....@@ -326,21 +345,29 @@
326345 }
327346
328347 oe.menuBar.add(menu = new Menu("Group"));
329
- grabItem = menu.add(new MenuItem("Grab"));
330
- grabItem.addActionListener(this);
348
+// grabItem = menu.add(new MenuItem("Grab"));
349
+// grabItem.addActionListener(this);
331350 backItem = menu.add(new MenuItem("Back"));
332351 backItem.addActionListener(this);
333352 frontItem = menu.add(new MenuItem("Front"));
334353 frontItem.addActionListener(this);
335
- compositeItem = menu.add(new MenuItem("Composite"));
336
- compositeItem.addActionListener(this);
354
+// compositeItem = menu.add(new MenuItem("Composite"));
355
+// compositeItem.addActionListener(this);
356
+
357
+ if (Globals.ADVANCED)
358
+ {
337359 hideItem = menu.add(new MenuItem("Hidden Group"));
338360 hideItem.addActionListener(this);
361
+ }
339362 ungroupItem = menu.add(new MenuItem("Ungroup"));
340363 ungroupItem.addActionListener(this);
341
- menu.add("-");
342
- randomItem = menu.add(new MenuItem("Switch node"));
343
- randomItem.addActionListener(this);
364
+
365
+// menu.add("-");
366
+//
367
+// switchItem = menu.add(new MenuItem("Switch node"));
368
+// switchItem.addActionListener(this);
369
+ if (Globals.ADVANCED)
370
+ {
344371 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
345372 switchGeoItem.addActionListener(this);
346373 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
....@@ -348,8 +375,6 @@
348375 morphItem = menu.add(new MenuItem("Morph Group"));
349376 morphItem.addActionListener(this);
350377
351
- if (Globals.ADVANCED)
352
- {
353378 menu.add("-");
354379 physicsItem = menu.add(new MenuItem("Physics"));
355380 physicsItem.addActionListener(this);
....@@ -357,30 +382,29 @@
357382 frameselectorItem.addActionListener(this);
358383 scriptNodeItem = menu.add(new MenuItem("Script Node"));
359384 scriptNodeItem.addActionListener(this);
360
- cameraItem = menu.add(new MenuItem("Camera"));
361
- cameraItem.addActionListener(this);
362385 }
363386
364387 oe.menuBar.add(menu = new Menu("Object"));
365
- textureItem = menu.add(new MenuItem("Texture"));
366
- textureItem.addActionListener(this);
388
+// textureItem = menu.add(new MenuItem("Texture"));
389
+// textureItem.addActionListener(this);
367390 billboardItem = menu.add(new MenuItem("Billboard"));
368391 billboardItem.addActionListener(this);
369392 csgItem = menu.add(new MenuItem("CSG"));
370393 csgItem.addActionListener(this);
371
- shadowXItem = menu.add(new MenuItem("Shadow X"));
394
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
372395 shadowXItem.addActionListener(this);
373
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
396
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
374397 shadowYItem.addActionListener(this);
375
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
398
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
376399 shadowZItem.addActionListener(this);
400
+ attributeItem = menu.add(new MenuItem("Attribute"));
401
+ attributeItem.addActionListener(this);
402
+
377403 if (Globals.ADVANCED)
378404 {
379405 menu.add("-");
380406 linkerItem = menu.add(new MenuItem("Linker"));
381407 linkerItem.addActionListener(this);
382
- attributeItem = menu.add(new MenuItem("Attribute"));
383
- attributeItem.addActionListener(this);
384408 templateItem = menu.add(new MenuItem("Template"));
385409 templateItem.addActionListener(this);
386410 pointflowItem = menu.add(new MenuItem("Point Flow"));
....@@ -469,6 +493,14 @@
469493 markleavesItem.addActionListener(this);
470494 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
471495 unmarkleavesItem.addActionListener(this);
496
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
497
+ rewindleavesItem.addActionListener(this);
498
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
499
+ unrewindleavesItem.addActionListener(this);
500
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
501
+ randomleavesItem.addActionListener(this);
502
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
503
+ unrandomleavesItem.addActionListener(this);
472504 menu.add("-");
473505 flipVItem = menu.add(new MenuItem("Flip V"));
474506 flipVItem.addActionListener(this);
....@@ -524,8 +556,21 @@
524556 buildToolsMenu(menu);
525557 }
526558
559
+
527560 void SetupUI2(ObjEditor oe)
528561 {
562
+ // June 2019
563
+ if (oe == null)
564
+ {
565
+ //super.SetupUI2(this);
566
+ //return;
567
+ }
568
+
569
+ if (copy != group)
570
+ {
571
+ //super.SetupUI2(this);
572
+ }
573
+
529574 //new Exception().printStackTrace();
530575
531576 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -554,27 +599,79 @@
554599 oe.radioPanel.add(dummyButton);
555600 oe.buttonGroup.add(dummyButton);
556601 */
602
+ cGridBag copyOptionsPanel = new cGridBag();
603
+
604
+ copyOptionsPanel.preferredHeight = 1;
605
+
557606 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
558607
559
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
608
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
609
+ //minButton.setToolTipText("Minimize window");
610
+ //minButton.addActionListener(this);
611
+
612
+ if (Globals.ADVANCED)
613
+ {
614
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
615
+ maxButton.setToolTipText("Maximize window");
616
+ maxButton.addActionListener(this);
617
+ }
618
+
619
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620
+ fullButton.setToolTipText("Full-screen window");
621
+ fullButton.addActionListener(this);
622
+
623
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
624
+ screenfitButton.setToolTipText("Screen fit");
625
+ screenfitButton.addActionListener(this);
626
+
627
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
628
+ restoreCameraButton.setToolTipText("Restore viewpoint");
629
+ restoreCameraButton.addActionListener(this);
630
+
631
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
632
+ saveButton.setToolTipText("New version");
633
+ saveButton.addActionListener(this);
634
+
635
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
636
+ undoButton.setToolTipText("Previous version");
637
+ undoButton.addActionListener(this);
638
+ undoButton.setEnabled(false);
639
+
640
+ cGridBag updown = new cGridBag().setVertical(true);
641
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
642
+ restoreButton.setToolTipText("Restore current");
643
+ restoreButton.addActionListener(this);
644
+ restoreButton.setEnabled(false);
645
+
646
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
647
+ replaceButton.setToolTipText("Replace current");
648
+ replaceButton.addActionListener(this);
649
+ replaceButton.setEnabled(false);
650
+
651
+ copyOptionsPanel.add(updown);
652
+
653
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
654
+ redoButton.setToolTipText("Next version");
655
+ redoButton.addActionListener(this);
656
+ redoButton.setEnabled(false);
657
+
658
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
560659 liveCB.setToolTipText("Enable animation");
561660 liveCB.addItemListener(this);
562661
563
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
662
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
564663 oneStepButton.setToolTipText("Animate one step forward");
565664 oneStepButton.addActionListener(this);
566665
567
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
666
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
568667 fastCB.setToolTipText("Fast mode");
569668 fastCB.addItemListener(this);
570669
571
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
572
- trackCB.setToolTipText("Enable tracking");
573
- trackCB.addItemListener(this);
574
-
575
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
576
- screenfitButton.setToolTipText("Screen fit");
577
- screenfitButton.addActionListener(this);
670
+ //oe.toolboxPanel.Return();
671
+
672
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
673
+// trackCB.setToolTipText("Enable tracking");
674
+// trackCB.addItemListener(this);
578675
579676 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
580677 // screenfitpointButton.addActionListener(this);
....@@ -586,65 +683,145 @@
586683 snapobjectButton.setToolTipText("Snap Object");
587684 }
588685
589
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
590
- flashSelectionButton.setToolTipText("Show selection");
591
- flashSelectionButton.addActionListener(this);
686
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
592687
593
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
594
-
595
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
688
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596689 twoButton.setToolTipText("Show center view only");
597690 twoButton.addActionListener(this);
598
- oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
691
+ this.fullscreenLayout = twoButton;
692
+
693
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
599694 fourButton.addActionListener(this);
600695 fourButton.setToolTipText("Show left panel only");
601
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
696
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602697 sixButton.setToolTipText("2-column layout left");
603698 sixButton.addActionListener(this);
604
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
699
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
605700 threeButton.setToolTipText("2-column layout right");
606701 threeButton.addActionListener(this);
607
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
702
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608703 sevenButton.setToolTipText("3-column layout");
609704 sevenButton.addActionListener(this);
610705 //
611706
612
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
707
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
613708 rootButton.setToolTipText("Edit selection in new tab");
614709 rootButton.addActionListener(this);
615710
616
- oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
711
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
617712 closeButton.setToolTipText("Close tab");
618713 closeButton.addActionListener(this);
619714 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
620715 //clearButton.addActionListener(this);
621
-
622
- cGridBag commandsPanel = new cGridBag();
716
+
717
+ // INSERT
718
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
719
+ gridButton.setToolTipText("Create grid");
720
+ gridButton.addActionListener(this);
721
+
722
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
723
+ boxButton.setToolTipText("Create box");
724
+ boxButton.addActionListener(this);
725
+
726
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
727
+ sphereButton.setToolTipText("Create sphere");
728
+ sphereButton.addActionListener(this);
729
+
730
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
731
+ coneButton.setToolTipText("Create cone");
732
+ coneButton.addActionListener(this);
733
+
734
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
735
+ torusButton.setToolTipText("Create torus");
736
+ torusButton.addActionListener(this);
737
+
738
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
739
+ superButton.setToolTipText("Create superellipsoid");
740
+ superButton.addActionListener(this);
741
+
742
+ if (Globals.ADVANCED)
743
+ {
744
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
745
+ kleinButton.setToolTipText("Create Klein bottle");
746
+ kleinButton.addActionListener(this);
747
+ }
623748
624
- commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
625
- editButton.setToolTipText("Edit selection");
749
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
750
+ particlesButton.setToolTipText("Create particle system");
751
+ particlesButton.addActionListener(this);
752
+
753
+ oe.toolboxPanel.Return();
754
+
755
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
756
+ groupButton.setToolTipText("Create group");
757
+ groupButton.addActionListener(this);
758
+
759
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
760
+ compositeButton.setToolTipText("Create composite");
761
+ compositeButton.addActionListener(this);
762
+
763
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
764
+ switchButton.setToolTipText("Create item switcher");
765
+ switchButton.addActionListener(this);
766
+
767
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
768
+ loopButton.setToolTipText("Create loop");
769
+ loopButton.addActionListener(this);
770
+
771
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
772
+ textureButton.setToolTipText("Create texture");
773
+ textureButton.addActionListener(this);
774
+
775
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
776
+ overlayButton.setToolTipText("Create overlay");
777
+ overlayButton.addActionListener(this);
778
+
779
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
780
+ lightButton.setToolTipText("Create light");
781
+ lightButton.addActionListener(this);
782
+
783
+ for (int i=6; --i>=0;)
784
+ {
785
+ oe.toolboxPanel.Return();
786
+ oe.toolboxPanel.add(new cGridBag());
787
+ oe.toolboxPanel.add(new cGridBag());
788
+ oe.toolboxPanel.add(new cGridBag());
789
+ oe.toolboxPanel.add(new cGridBag());
790
+ oe.toolboxPanel.add(new cGridBag());
791
+ oe.toolboxPanel.add(new cGridBag());
792
+ oe.toolboxPanel.add(new cGridBag());
793
+ }
794
+
795
+ // EDIT panel
796
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
797
+ editButton.setToolTipText("Pin selection controls");
626798 editButton.addActionListener(this);
627799
628
- commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629
- uneditButton.setToolTipText("Unedit selection");
800
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
801
+ uneditButton.setToolTipText("Remove selection controls");
630802 uneditButton.addActionListener(this);
631803
632
- commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
633
- allParamsButton.setToolTipText("Edit all params");
804
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
805
+ allParamsButton.setToolTipText("Show all controle");
634806 allParamsButton.addActionListener(this);
635807
636
- commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
808
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
637809 clearPanelButton.setToolTipText("Clear edit panel");
638810 clearPanelButton.addActionListener(this);
639811
640
- commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
812
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
641813 unselectButton.setToolTipText("Unselect");
642814 unselectButton.addActionListener(this);
643815
644
- commandsPanel.preferredHeight = 1;
816
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
817
+ flashSelectionButton.setToolTipText("Highlight selection");
818
+ flashSelectionButton.addActionListener(this);
645819
646
- oe.treePanel.add(commandsPanel);
647
- oe.treePanel.Return();
820
+ editCommandsPanel.preferredHeight = 1;
821
+
822
+ SetPinStates(false);
823
+// oe.treePanel.add(commandsPanel);
824
+// oe.treePanel.Return();
648825
649826 // oe.aConstraints.gridx += 1;
650827 // oe.aConstraints.weighty = 0;
....@@ -661,29 +838,17 @@
661838
662839 JScrollPane jSP;
663840 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
664
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
841
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
665842 ResetModel();
666843
667844 oe.treePanel.add(jSPPanel);
668845 oe.treePanel.Return();
669846
670
- cGridBag copyOptionsPanel = new cGridBag();
671
-
672
- copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
673
- colorCB.setToolTipText("Copy color when dropped");
674
- colorCB.addItemListener(this);
675
-
676
- copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
677
- materialCB.setToolTipText("Copy material when dropped");
678
- materialCB.addItemListener(this);
679
-
680
- copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
681
- textureCB.setToolTipText("Copy texture when dropped");
682
- textureCB.addItemListener(this);
683
-
684
- copyOptionsPanel.preferredHeight = 1;
685847 oe.treePanel.add(copyOptionsPanel);
686848 oe.treePanel.Return();
849
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
850
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
851
+ sliderPane.preferredHeight = 1;
687852
688853 // mainPanel.setDividerLocation(0.5); //1.0);
689854 // mainPanel.setResizeWeight(0.5);
....@@ -712,23 +877,43 @@
712877
713878 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
714879 {
880
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
881
+ colorCB.setToolTipText("Copy color when dropped");
882
+ colorCB.addItemListener(this);
883
+
884
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
885
+ materialCB.setToolTipText("Copy material when dropped");
886
+ materialCB.addItemListener(this);
887
+
888
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
889
+ textureCB.setToolTipText("Copy texture when dropped");
890
+ textureCB.addItemListener(this);
891
+
892
+ panel.Return();
893
+
715894 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
716895 boxCB.setToolTipText("Display bounding boxes");
717896 boxCB.addItemListener(this);
718897
719898 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
720
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
899
+ zoomBoxCB.setToolTipText("Display only for wheel");
721900 zoomBoxCB.addItemListener(this);
722901
723902 if (true) // Globals.ADVANCED)
724903 {
725
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
726
- supportCB.setToolTipText("Enable rigging");
727
- supportCB.addItemListener(this);
904
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
905
+// supportCB.setToolTipText("Enable rigging");
906
+// supportCB.addItemListener(this);
907
+
908
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
909
+ freezeCB.setToolTipText("Fast moving camera");
910
+ freezeCB.addItemListener(this);
728911
729912 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
730913 // localCB.addItemListener(this);
731914
915
+ panel.Return();
916
+
732917 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
733918 crowdCB.setToolTipText("Used for crowds");
734919 crowdCB.addItemListener(this);
....@@ -745,6 +930,8 @@
745930 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
746931 // speakerMocapCB.addItemListener(this);
747932
933
+ panel.Return();
934
+
748935 if (false)
749936 {
750937 // handled in scripts
....@@ -759,32 +946,72 @@
759946 //constraints.gridy += 1;
760947 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
761948 smoothfocusCB.addItemListener(this);
949
+ panel.Return();
762950 }
763951
764952 //constraints.gridx += 1;
765953 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
766954 // debugCB.addItemListener(this);
767955
956
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
957
+ trackCB.setToolTipText("Enable tracking target");
958
+ trackCB.addItemListener(this);
959
+
768960 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
961
+ oeilCB.setToolTipText("Move camera when tracking");
769962 oeilCB.addItemListener(this);
770963
964
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
965
+ shadowCB.setToolTipText("When live compute shadows");
966
+ shadowCB.addItemListener(this);
967
+
968
+ panel.Return();
969
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
970
+ toggleTextureCB.setToolTipText("Load textures");
971
+ toggleTextureCB.addItemListener(this);
972
+
973
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
974
+ toggleSwitchCB.setToolTipText("Choose a single item");
975
+ toggleSwitchCB.addItemListener(this);
976
+
977
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
978
+ autokeepCB.setToolTipText("On structure change");
979
+ autokeepCB.addItemListener(this);
980
+
981
+ panel.Return();
982
+ if (Globals.ADVANCED)
983
+ {
771984 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
772985 lookAtCB.setToolTipText("Look-at target");
773986 lookAtCB.addItemListener(this);
987
+ }
774988
775989 }
776990
777991 cGridBag fill = new cGridBag();
778
-
779992 fill.preferredHeight = 200;
993
+ cGridBag fill2 = new cGridBag();
994
+ fill2.preferredHeight = 200;
995
+ cGridBag fill3 = new cGridBag();
996
+ fill3.preferredHeight = 200;
780997
781998 panel.add(fill);
999
+ panel.add(fill2);
1000
+ panel.add(fill3);
7821001
7831002 }
7841003
7851004 void EditObject(Object3D obj)
7861005 {
7871006 cRadio radioButton = new cRadio(obj.name);
1007
+
1008
+ // June 2019. Patch to avoid bug with transparency.
1009
+ radioButton.hadMaterial = obj.material != null;
1010
+ if (!radioButton.hadMaterial)
1011
+ {
1012
+ obj.material = new cMaterial();
1013
+ }
1014
+
7881015 radioButton.SetObject(obj);
7891016 radioButton.layout = sevenButton;
7901017 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -796,6 +1023,8 @@
7961023
7971024 void SetupViews(ObjEditor oe)
7981025 {
1026
+ theFrame = this;
1027
+
7991028 oe.SetupViews();
8001029
8011030 System.out.println("SetupViews");
....@@ -804,23 +1033,28 @@
8041033 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
8051034 }
8061035
807
- JCheckBox liveCB;
808
- JCheckBox supportCB;
809
- JCheckBox localCB;
810
- JCheckBox crowdCB;
811
- JCheckBox smoothCB;
812
- JCheckBox fastCB;
813
- JCheckBox slowCB;
814
- JCheckBox boxCB;
815
- JCheckBox zoomBoxCB;
816
- JCheckBox trackCB;
817
- JCheckBox smoothfocusCB;
1036
+ cToggleButton liveCB;
1037
+ cCheckBox supportCB;
1038
+ cCheckBox localCB;
1039
+ cCheckBox crowdCB;
1040
+ cCheckBox smoothCB;
1041
+ cToggleButton fastCB;
1042
+ cCheckBox slowCB;
1043
+ cCheckBox boxCB;
1044
+ cCheckBox zoomBoxCB;
1045
+ cCheckBox freezeCB;
1046
+ //cToggleButton trackCB;
1047
+ cCheckBox trackCB;
1048
+ cCheckBox smoothfocusCB;
8181049 // JCheckBox speakerMocapCB;
819
- JCheckBox speakerCameraCB;
820
- JCheckBox speakerFocusCB;
821
- JCheckBox debugCB;
822
- JCheckBox oeilCB;
823
- JCheckBox lookAtCB;
1050
+ cCheckBox speakerCameraCB;
1051
+ cCheckBox speakerFocusCB;
1052
+ cCheckBox debugCB;
1053
+
1054
+ cCheckBox oeilCB;
1055
+ cCheckBox shadowCB;
1056
+ cCheckBox autokeepCB;
1057
+ cCheckBox lookAtCB;
8241058
8251059 // static int COLOR = 1;
8261060 // static int MATERIAL = 2;
....@@ -828,9 +1062,9 @@
8281062
8291063 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
8301064
831
- JCheckBox colorCB;
832
- JCheckBox materialCB;
833
- JCheckBox textureCB;
1065
+ cCheckBox colorCB;
1066
+ cCheckBox materialCB;
1067
+ cCheckBox textureCB;
8341068
8351069 public void itemStateChanged(ItemEvent e)
8361070 {
....@@ -858,6 +1092,7 @@
8581092 } else if(e.getSource() == liveCB)
8591093 {
8601094 cameraView.ToggleLive();
1095
+ refreshContents(false);
8611096 }
8621097 else if(e.getSource() == supportCB)
8631098 {
....@@ -922,6 +1157,18 @@
9221157 {
9231158 cameraView.ToggleOeil();
9241159 }
1160
+ else if(e.getSource() == shadowCB)
1161
+ {
1162
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1163
+ }
1164
+ else if(e.getSource() == freezeCB)
1165
+ {
1166
+ Globals.FREEZEONMOVE ^= true;
1167
+ }
1168
+ else if(e.getSource() == autokeepCB)
1169
+ {
1170
+ Globals.REPLACEONMAKE ^= true;
1171
+ }
9251172 else if(e.getSource() == lookAtCB)
9261173 {
9271174 cameraView.ToggleLookAt();
....@@ -938,7 +1185,8 @@
9381185
9391186 /**/
9401187 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
941
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1188
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1189
+ TreePath path = objEditor.jTree.getSelectionPath();
9421190 if ((path == null) || (path.getPathCount() <= 1)) {
9431191 // We can't move the root node or an empty selection
9441192 return;
....@@ -1001,8 +1249,6 @@
10011249 }
10021250 }
10031251
1004
- String string = (String) object;
1005
-
10061252 System.out.println("Transfer = " + object + "; drop : " + target);
10071253 // if( object instanceof java.io.File[])
10081254 // {
....@@ -1010,6 +1256,8 @@
10101256 // objEditor.DropFile((java.io.File[]) object, true);
10111257 // return;
10121258 // }
1259
+
1260
+ String string = object.toString();
10131261
10141262 // File path for Mac and Windows
10151263 if (string.charAt(0) == '/' || string.charAt(1) == ':')
....@@ -1055,23 +1303,33 @@
10551303
10561304 assert target == objEditor.jTree;
10571305 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1306
+ Object3D destinationLeaf;
10581307 try {
1059
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1308
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
10601309 } catch (Exception e) {
10611310 System.out.println("destinationPath : " + destinationPath);
10621311 return;
10631312 }
10641313
1065
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1314
+ for (int i=group.selection.size(); --i>=0;)
10661315 {
1316
+ Object3D child = (Object3D)group.selection.elementAt(i);
1317
+
1318
+ // Cannot move into itself
1319
+ if (child == destinationLeaf)
1320
+ return;
1321
+ }
1322
+
1323
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1324
+// {
10671325 loadClipboard(true);
10681326 objEditor.jTree.setSelectionPath(destinationPath);
10691327 pasteInto(false, false);
1070
- } else {
1071
- loadClipboard(false);
1072
- objEditor.jTree.setSelectionPath(destinationPath);
1073
- pasteInto(false, false); // true); // ???
1074
- }
1328
+// } else {
1329
+// loadClipboard(false);
1330
+// objEditor.jTree.setSelectionPath(destinationPath);
1331
+// pasteInto(false, false); // true); // ???
1332
+// }
10751333 }
10761334 public void dropActionChanged(DropTargetDragEvent dtde)
10771335 // Called if the user has modified the current drop gesture
....@@ -1176,22 +1434,30 @@
11761434 {
11771435 //heightFieldItem = menu.add(new MenuItem("Height Field"));
11781436 //heightFieldItem.addActionListener(this);
1179
- gridItem = menu.add(new MenuItem("Grid"));
1180
- gridItem.addActionListener(this);
1181
- rectoidItem = menu.add(new MenuItem("Box"));
1182
- rectoidItem.addActionListener(this);
1183
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1184
- ellipsoidItem.addActionListener(this);
1185
- coneItem = menu.add(new MenuItem("Cone"));
1186
- coneItem.addActionListener(this);
1187
- torusItem = menu.add(new MenuItem("Torus"));
1188
- torusItem.addActionListener(this);
1189
- superItem = menu.add(new MenuItem("Superellipsoid"));
1190
- superItem.addActionListener(this);
1437
+// gridItem = menu.add(new MenuItem("Grid"));
1438
+// gridItem.addActionListener(this);
1439
+// rectoidItem = menu.add(new MenuItem("Box"));
1440
+// rectoidItem.addActionListener(this);
1441
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1442
+// ellipsoidItem.addActionListener(this);
1443
+// coneItem = menu.add(new MenuItem("Cone"));
1444
+// coneItem.addActionListener(this);
1445
+// torusItem = menu.add(new MenuItem("Torus"));
1446
+// torusItem.addActionListener(this);
1447
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1448
+// superItem.addActionListener(this);
1449
+
1450
+ cameraItem = menu.add(new MenuItem("Camera"));
1451
+ cameraItem.addActionListener(this);
1452
+
1453
+ if (!Globals.ADVANCED)
1454
+ {
11911455 kleinItem = menu.add(new MenuItem("Klein Bottle"));
11921456 kleinItem.addActionListener(this);
1193
- particleItem = menu.add(new MenuItem("Particle system"));
1194
- particleItem.addActionListener(this);
1457
+ }
1458
+
1459
+// particleItem = menu.add(new MenuItem("Particle system"));
1460
+// particleItem.addActionListener(this);
11951461 if (Globals.ADVANCED)
11961462 {
11971463 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1217,15 +1483,15 @@
12171483 }
12181484 bezierItem = menu.add(new MenuItem("Bezier Patch"));
12191485 bezierItem.addActionListener(this);
1220
- overlayItem = menu.add(new MenuItem("Overlay"));
1221
- overlayItem.addActionListener(this);
1222
- lightItem = menu.add(new MenuItem("Light"));
1223
- lightItem.addActionListener(this);
1486
+// overlayItem = menu.add(new MenuItem("Overlay"));
1487
+// overlayItem.addActionListener(this);
1488
+// lightItem = menu.add(new MenuItem("Light"));
1489
+// lightItem.addActionListener(this);
12241490 menu.add("-");
12251491 //superLoopItem = menu.add(new MenuItem("Super Loop"));
12261492 //superLoopItem.addActionListener(this);
1227
- loopItem = menu.add(new MenuItem("Loop"));
1228
- loopItem.addActionListener(this);
1493
+// loopItem = menu.add(new MenuItem("Loop"));
1494
+// loopItem.addActionListener(this);
12291495 doubleItem = menu.add(new MenuItem("Fork"));
12301496 doubleItem.addActionListener(this);
12311497 if (Globals.ADVANCED)
....@@ -1241,6 +1507,9 @@
12411507 animationItem.addItemListener(this);
12421508 animationItem.setState(Globals.ANIMATION);
12431509
1510
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1511
+ archiveItem.addActionListener(this);
1512
+
12441513 menu.add("-");
12451514 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
12461515 parseverticesItem.addActionListener(this);
....@@ -1253,6 +1522,8 @@
12531522 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
12541523 reduce34MorphItem.addActionListener(this);
12551524 menu.add("-");
1525
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1526
+ memoryItem.addActionListener(this);
12561527 menu.add(computeAOItem = new MenuItem("Compute AO"));
12571528 computeAOItem.addActionListener(this);
12581529
....@@ -1261,11 +1532,9 @@
12611532 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
12621533 mirrorItem.addActionListener(this);
12631534 menu.add("-");
1264
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1265
- memoryItem.addActionListener(this);
12661535 menu.add(analyzeItem = new MenuItem("Analyze"));
12671536 analyzeItem.addActionListener(this);
1268
- menu.add(dumpItem = new MenuItem("Dump"));
1537
+ menu.add(dumpItem = new MenuItem("Print"));
12691538 dumpItem.addActionListener(this);
12701539 // menu.add(pathItem = new MenuItem("From-to path"));
12711540 // pathItem.addActionListener(this);
....@@ -1406,9 +1675,24 @@
14061675 shadow.material = new cMaterial(obj.material);
14071676 shadow.material.diffuse = 0.0001f;
14081677 shadow.material.specular = 0.0001f;
1678
+ //shadow.projectedVertices[1].x = 300;
14091679
14101680 makeSomething(shadow);
14111681 }
1682
+
1683
+ private void ClearUnpinned()
1684
+ {
1685
+ //for (Object3D obj : listUI)
1686
+ for (int i=listUI.size(); --i>=0;)
1687
+ {
1688
+ Object3D obj = listUI.elementAt(i);
1689
+ if (!obj.pinned)
1690
+ {
1691
+ obj.CloseUI();
1692
+ listUI.remove(i);
1693
+ }
1694
+ }
1695
+ }
14121696
14131697 /**
14141698 * applyExample
....@@ -1653,7 +1937,7 @@
16531937 {
16541938 ScreenFit();
16551939 } else
1656
- if (source == switchItem)
1940
+ if (source == switchViewItem)
16571941 {
16581942 cVector v1 = new cVector();
16591943 cVector v2 = new cVector();
....@@ -1662,11 +1946,11 @@
16621946 objEditor.cameraView.renderCamera.setAim(v2, v1);
16631947 objEditor.cameraView.repaint();
16641948 } else
1665
- if (source == rectoidItem)
1949
+ if (source == rectoidItem || source == boxButton)
16661950 {
16671951 makeSomething(new Box());
16681952 } else
1669
- if (source == particleItem)
1953
+ if (source == particleItem || source == particlesButton)
16701954 {
16711955 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
16721956 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1745,27 +2029,27 @@
17452029
17462030 makeSomething(obj);
17472031 } else
1748
- if (source == gridItem)
2032
+ if (source == gridItem || source == gridButton)
17492033 {
17502034 makeSomething(new Grid());
17512035 } else
1752
- if (source == ellipsoidItem)
2036
+ if (source == ellipsoidItem || source == sphereButton)
17532037 {
17542038 makeSomething(new Sphere());
17552039 } else
1756
- if (source == coneItem)
2040
+ if (source == coneItem || source == coneButton)
17572041 {
17582042 makeSomething(new Cone());
17592043 } else
1760
- if (source == torusItem)
2044
+ if (source == torusItem || source == torusButton)
17612045 {
17622046 makeSomething(new Torus());
17632047 } else
1764
- if (source == superItem)
2048
+ if (source == superItem || source == superButton)
17652049 {
17662050 makeSomething(new Superellipsoid());
17672051 } else
1768
- if (source == kleinItem)
2052
+ if (source == kleinItem || source == kleinButton)
17692053 {
17702054 makeSomething(new Klein());
17712055 } else
....@@ -1785,7 +2069,7 @@
17852069 {
17862070 makeSomething(new BezierSurface());
17872071 } else
1788
- if (source == overlayItem)
2072
+ if (source == overlayItem || source == overlayButton)
17892073 {
17902074 /*
17912075 Object3D obj = new BezierSurface(5,8);
....@@ -1833,7 +2117,7 @@
18332117 s.setup();
18342118 makeSomething(s);
18352119 } else
1836
- if (source == lightItem)
2120
+ if (source == lightItem || source == lightButton)
18372121 {
18382122 makeSomething(new Light());
18392123 } else
....@@ -1883,30 +2167,30 @@
18832167
18842168 group(g);
18852169 } else
1886
- if (source == loopItem)
2170
+ if (source == loopItem || source == loopButton)
18872171 {
18882172 Composite csg = new GroupLeaf();
18892173 csg.count = 5;
18902174 group(csg);
1891
- Composite child = new cGroup();
2175
+ Composite child = new cGroup("Branch");
18922176 csg.addChild(child);
18932177 child.addChild(csg);
18942178 } else
18952179 if (source == doubleItem)
18962180 {
1897
- Composite csg = new GroupLeaf();
2181
+ Composite csg = new GroupLeaf("Fork");
18982182 csg.count = 5;
18992183 group(csg);
1900
- Composite child = new cGroup();
2184
+ Composite child = new cGroup("Branch A");
19012185 csg.addChild(child);
19022186 child.addChild(csg);
1903
- child = new cGroup();
2187
+ child = new cGroup("Branch B");
19042188 csg.addChild(child);
19052189 child.addChild(csg);
19062190 } else
19072191 if (source == tripleItem)
19082192 {
1909
- Composite csg = new GroupLeaf();
2193
+ Composite csg = new GroupLeaf("Trident");
19102194 csg.count = 4;
19112195 group(csg);
19122196 Composite child = new cGroup();
....@@ -1956,6 +2240,46 @@
19562240 {
19572241 DumpObject();
19582242 } else
2243
+ if (source == minButton)
2244
+ {
2245
+ Minimize();
2246
+ } else
2247
+ if (source == maxButton)
2248
+ {
2249
+ Maximize();
2250
+ } else
2251
+ if (source == fullButton)
2252
+ {
2253
+ ToggleFullScreen();
2254
+ } else
2255
+ if (source == undoButton)
2256
+ {
2257
+ // Go to previous version
2258
+ //if (!Undo())
2259
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2260
+ Undo();
2261
+ } else
2262
+ if (source == restoreButton)
2263
+ {
2264
+ // Restore current version
2265
+ Restore();
2266
+ } else
2267
+ if (source == replaceButton)
2268
+ {
2269
+ // Overwrite current version
2270
+ Replace();
2271
+ } else
2272
+ if (source == redoButton)
2273
+ {
2274
+ // Go to next version
2275
+ Redo();
2276
+ } else
2277
+ if (source == saveButton)
2278
+ {
2279
+ // Save a new version
2280
+ if (!Save(true))
2281
+ java.awt.Toolkit.getDefaultToolkit().beep();
2282
+ } else
19592283 if (source == oneStepButton)
19602284 {
19612285 Globals.ONESTEP = true;
....@@ -1963,17 +2287,14 @@
19632287 } else
19642288 if (source == screenfitButton)
19652289 {
1966
- //Reload(lastConverter, lastFilename, true);
19672290 ScreenFit();
19682291 } else
19692292 if (source == screenfitpointButton)
19702293 {
1971
- //Reload(lastConverter, lastFilename, true);
19722294 ScreenFitPoint();
19732295 } else
19742296 if (source == snapobjectButton)
19752297 {
1976
- //Reload(lastConverter, lastFilename, true);
19772298 SnapObject();
19782299 } else
19792300 // if (event.getSource() == recompileButton)
....@@ -2349,9 +2670,9 @@
23492670 {
23502671 ClearSelection(true);
23512672 } else
2352
- if (source == grabItem)
2673
+ if (source == grabItem || source == groupButton)
23532674 {
2354
- group(new cGroup(), true);
2675
+ group(new cGroup(), false); // true);
23552676 } else
23562677 if (source == hideItem)
23572678 {
....@@ -2369,11 +2690,11 @@
23692690 {
23702691 makeSomething(new Camera());
23712692 } else
2372
- if (source == compositeItem)
2693
+ if (source == compositeItem || source == compositeButton)
23732694 {
23742695 group(new Composite());
23752696 } else
2376
- if (source == randomItem)
2697
+ if (source == switchItem || source == switchButton)
23772698 {
23782699 RandomNode random = new RandomNode();
23792700 group(random);
....@@ -2475,7 +2796,7 @@
24752796 {
24762797 group(new cLinker());
24772798 } else
2478
- if (source == textureItem)
2799
+ if (source == textureItem || source == textureButton)
24792800 {
24802801 group(new TextureNode());
24812802 } else
....@@ -2495,17 +2816,30 @@
24952816 {
24962817 CastShadow(2);
24972818 } else
2498
- if (source == ungroupItem)
2819
+ if (source == ungroupItem || source == ungroupButton)
24992820 {
2500
- //ungroup();
2821
+ boolean hasRoot = false;
2822
+
25012823 for (int i=0; i<group.selection.size(); i++)
25022824 {
2503
- Ungroup(group.selection.get(i));
2825
+ if (group.selection.get(i) == group)
2826
+ {
2827
+ hasRoot = true;
2828
+ break;
2829
+ }
25042830 }
25052831
2506
- ClearSelection(false);
2507
-
2508
- refreshContents();
2832
+ if (!hasRoot)
2833
+ {
2834
+ for (int i=0; i<group.selection.size(); i++)
2835
+ {
2836
+ Ungroup(group.selection.get(i));
2837
+ }
2838
+
2839
+ ClearSelection(false);
2840
+
2841
+ refreshContents();
2842
+ }
25092843 } else
25102844 if (source == genUVItem)
25112845 {
....@@ -2517,7 +2851,7 @@
25172851 } else
25182852 if (source == genNormalsMESHItem)
25192853 {
2520
- GenNormals(true); // TODO
2854
+ GenNormalsMESH();
25212855 } else
25222856 if (source == genNormalsORGANItem)
25232857 {
....@@ -2582,6 +2916,22 @@
25822916 if (source == unmarkleavesItem)
25832917 {
25842918 MarkLeaves(false);
2919
+ } else
2920
+ if (source == rewindleavesItem)
2921
+ {
2922
+ RewindLeaves(true);
2923
+ } else
2924
+ if (source == unrewindleavesItem)
2925
+ {
2926
+ RewindLeaves(false);
2927
+ } else
2928
+ if (source == randomleavesItem)
2929
+ {
2930
+ RandomLeaves(true);
2931
+ } else
2932
+ if (source == unrandomleavesItem)
2933
+ {
2934
+ RandomLeaves(false);
25852935 } else
25862936 if (source == flipVItem)
25872937 {
....@@ -2817,6 +3167,10 @@
28173167 if (source == twoButton)
28183168 {
28193169 radio.layout = twoButton;
3170
+
3171
+ if (CameraPane.FULLSCREEN)
3172
+ fullscreenLayout = radio.layout;
3173
+
28203174 // bug
28213175 //gridPanel.setDividerLocation(1.0);
28223176 //bigPanel.setDividerLocation(0.0);
....@@ -2849,10 +3203,31 @@
28493203 bigThree.ClearUI();
28503204 bigThree.add(centralPanel);
28513205 bigThree.FlushUI();
3206
+
3207
+ cameraView.requestFocusInWindow();
3208
+
3209
+// refreshContents(true);
3210
+//
3211
+// try
3212
+// {
3213
+// java.awt.Robot bot = new java.awt.Robot();
3214
+// int mask = InputEvent.BUTTON1_MASK;
3215
+// bot.mouseMove(100, 100);
3216
+// bot.mousePress(mask);
3217
+// bot.mouseRelease(mask);
3218
+// }
3219
+// catch (Exception e)
3220
+// {
3221
+//
3222
+// }
3223
+
28523224 } else
28533225 if (source == threeButton)
28543226 {
28553227 radio.layout = threeButton;
3228
+
3229
+ if (CameraPane.FULLSCREEN)
3230
+ fullscreenLayout = radio.layout;
28563231
28573232 // bigThree.remove(scenePanel);
28583233 // bigThree.remove(centralPanel);
....@@ -2885,10 +3260,15 @@
28853260 bigThree.add(centralPanel);
28863261 bigThree.add(XYZPanel);
28873262 bigThree.FlushUI();
3263
+
3264
+ cameraView.requestFocusInWindow();
28883265 } else
28893266 if (source == fourButton)
28903267 {
28913268 radio.layout = fourButton;
3269
+
3270
+ if (CameraPane.FULLSCREEN)
3271
+ fullscreenLayout = radio.layout;
28923272
28933273 // bigThree.remove(scenePanel);
28943274 // bigThree.remove(centralPanel);
....@@ -2920,10 +3300,15 @@
29203300 bigThree.ClearUI();
29213301 bigThree.add(scenePanel);
29223302 bigThree.FlushUI();
3303
+
3304
+ cameraView.requestFocusInWindow();
29233305 } else
29243306 if (source == sixButton)
29253307 {
29263308 radio.layout = sixButton;
3309
+
3310
+ if (CameraPane.FULLSCREEN)
3311
+ fullscreenLayout = radio.layout;
29273312
29283313 // bigThree.remove(scenePanel);
29293314 // bigThree.remove(centralPanel);
....@@ -2956,10 +3341,15 @@
29563341 bigThree.add(scenePanel);
29573342 bigThree.add(centralPanel);
29583343 bigThree.FlushUI();
3344
+
3345
+ cameraView.requestFocusInWindow();
29593346 } else
29603347 if (source == sevenButton)
29613348 {
29623349 radio.layout = sevenButton;
3350
+
3351
+ if (CameraPane.FULLSCREEN)
3352
+ fullscreenLayout = radio.layout;
29633353
29643354 // bigThree.remove(scenePanel);
29653355 // bigThree.remove(centralPanel);
....@@ -2993,6 +3383,8 @@
29933383 bigThree.add(centralPanel);
29943384 bigThree.add(XYZPanel);
29953385 bigThree.FlushUI();
3386
+
3387
+ cameraView.requestFocusInWindow();
29963388 } else
29973389 if (source == rootButton)
29983390 {
....@@ -3004,6 +3396,7 @@
30043396 EditObject(obj);
30053397 }
30063398
3399
+ cameraView.requestFocusInWindow();
30073400 refreshContents(true);
30083401 } else
30093402 if (source == closeButton)
....@@ -3013,22 +3406,37 @@
30133406 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
30143407 {
30153408 ab = (cRadio)e.nextElement();
3016
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3409
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
30173410 {
3411
+ // Patch to avoid bug with transparency.
3412
+ if (!ab.hadMaterial)
3413
+ {
3414
+ ab.object.material = null;
3415
+ }
3416
+
30183417 buttonGroup.remove(ab);
30193418 radioPanel.remove(ab);
30203419
3021
- ab.GetObject().editWindow = null;
3420
+ //ab.GetObject().editWindow = null;
3421
+ ab.GetObject().manipWindow = null;
30223422 // ab.GetObject().objectUI = null; // ?????????
30233423
30243424 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
30253425 break;
30263426 }
30273427 }
3428
+
3429
+ cameraView.requestFocusInWindow();
30283430 refreshContents(true);
30293431 } else
30303432 if (source == editItem || source == editButton)
30313433 {
3434
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3435
+ {
3436
+ Object3D child = (Object3D)e.nextElement();
3437
+ child.pinned = true;
3438
+ }
3439
+
30323440 EditSelection(false);
30333441 } else
30343442 if (source == uneditButton)
....@@ -3038,10 +3446,11 @@
30383446 Object3D child = (Object3D)e.nextElement();
30393447 if(child.editWindow != null)
30403448 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3449
+ child.pinned = false;
30413450 child.CloseUI();
30423451 listUI.remove(child);
30433452
3044
- child.editWindow = null; // ???????????
3453
+ //child.editWindow = null; // ???????????
30453454 }
30463455 objEditor.ctrlPanel.FlushUI();
30473456 //objEditor.jTree.clearSelection();
....@@ -3054,6 +3463,7 @@
30543463 //copy.ClearUI();
30553464 for (Object3D obj : listUI)
30563465 {
3466
+ obj.pinned = false;
30573467 obj.CloseUI();
30583468 }
30593469 listUI.clear();
....@@ -3063,7 +3473,7 @@
30633473 {
30643474 assert(copy == group);
30653475
3066
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3476
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
30673477
30683478 for (Object3D obj : listUI)
30693479 {
....@@ -3112,6 +3522,9 @@
31123522 }
31133523
31143524 copy = group;
3525
+
3526
+ SetUndoStates();
3527
+
31153528 //Globals.theRenderer.object = group;
31163529 if(!useclient)
31173530 {
....@@ -3128,7 +3541,9 @@
31283541 sideView.object = group;
31293542 }
31303543
3131
-// fix "+" issue group.editWindow = this;
3544
+// fix "+" issue
3545
+ //group.editWindow = this;
3546
+ group.manipWindow = this;
31323547
31333548 /*
31343549 currentLayout = radio.layout;
....@@ -3136,18 +3551,27 @@
31363551 currentLayout = sevenButton;
31373552 */
31383553 radio.layout.doClick();
3554
+
3555
+ ClearUnpinned();
3556
+ Grafreed.Assert(group != null);
3557
+ Grafreed.Assert(group.selection != null);
3558
+ SetPinStates(group.selection.size() > 0);
3559
+ if (group.selection.size() == 1)
3560
+ EditSelection(false);
31393561 keepparent = group.parent;
31403562 // PARENT = NULL or not???
31413563 //group.parent = null; // ROOT
31423564 //group.attributes = -1;
31433565 ResetModel();
3566
+
3567
+ cameraView.requestFocusInWindow();
31443568 refreshContents(true);
31453569 } else if (event.getSource() == editCameraItem)
31463570 {
31473571 cameraView.ProtectCamera();
31483572 cameraView.repaint();
31493573 return;
3150
- } else if (event.getSource() == revertCameraItem)
3574
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
31513575 {
31523576 cameraView.RevertCamera();
31533577 cameraView.repaint();
....@@ -3164,7 +3588,6 @@
31643588 }
31653589
31663590 boolean useclient = false;
3167
- cRadio radio;
31683591
31693592 void ToggleRoot()
31703593 {
....@@ -3403,7 +3826,8 @@
34033826
34043827 int size = obj.MemorySize();
34053828
3406
- System.err.println((size/1024) + " KB is the size of " + obj);
3829
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3830
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
34073831 }
34083832 }
34093833 catch (Exception e)
....@@ -3484,6 +3908,13 @@
34843908 void GenNormals(boolean crease)
34853909 {
34863910 group.GenNormalsS(crease);
3911
+
3912
+ refreshContents();
3913
+ }
3914
+
3915
+ void GenNormalsMESH()
3916
+ {
3917
+ group.GenNormalsMeshS();
34873918
34883919 refreshContents();
34893920 }
....@@ -4111,6 +4542,18 @@
41114542 refreshContents();
41124543 }
41134544
4545
+ void RewindLeaves(boolean hide)
4546
+ {
4547
+ group.selection.RewindLeaves(hide);
4548
+ refreshContents();
4549
+ }
4550
+
4551
+ void RandomLeaves(boolean hide)
4552
+ {
4553
+ group.selection.RandomLeaves(hide);
4554
+ refreshContents();
4555
+ }
4556
+
41144557 void SetTexRes(int tr)
41154558 {
41164559 group.selection.SetTexRes(tr);
....@@ -4182,10 +4625,6 @@
41824625 // }
41834626 // }
41844627
4185
- static boolean allparams = true;
4186
-
4187
- static Vector<Object3D> listUI = new Vector<Object3D>();
4188
-
41894628 void EditSelection(boolean newWindow)
41904629 {
41914630 // aConstraints.gridy = 0;
....@@ -4193,7 +4632,7 @@
41934632 {
41944633 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
41954634 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4196
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4635
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
41974636
41984637 Object3D elem = (Object3D)group.selection.elementAt(i);
41994638 if(elem != group || !newWindow)
....@@ -4278,7 +4717,8 @@
42784717 //new Exception().printStackTrace();
42794718
42804719 freezemodel = true;
4281
-
4720
+ ClearUnpinned();
4721
+
42824722 /**/
42834723 //switch (event.id)
42844724 {
....@@ -4286,7 +4726,6 @@
42864726 //case 702: // Event.LIST_DESELECT
42874727 group.deselectAll();
42884728 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4289
- objEditor.ClearInfo(); // .GetMaterial());
42904729 if (tps != null)
42914730 {
42924731 for (int i=0; i < tps.length; i++)
....@@ -4295,10 +4734,8 @@
42954734
42964735 //if (child.parent != null)
42974736 //child.parent.addSelectee(child);
4737
+ objEditor.SetMaterial(child);
42984738 group.addSelectee(child);
4299
- objEditor.SetMaterial(child); // .GetMaterial());
4300
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4301
- System.err.println("info : " + child.GetPath());
43024739 }
43034740 }
43044741 // else
....@@ -4308,17 +4745,13 @@
43084745 // System.err.println("info : " + group.GetPath());
43094746 // }
43104747
4311
- objEditor.SetText(); // jan 2014
4312
-
4313
- Object3D object = (Object3D) tps[0].getLastPathComponent();
4314
-
4315
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(object instanceof Camera))
4748
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
43164749 CameraPane.flash = true;
43174750
4318
- if (tps != null && tps.length > 0 && object instanceof Camera)
4751
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
43194752 // a camera
43204753 {
4321
- if (object != Globals.theRenderer.LightCamera())
4754
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
43224755 {
43234756 CameraPane.camerachangeframe = 0; // don't refuse it
43244757 Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
....@@ -4327,6 +4760,13 @@
43274760 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
43284761 }
43294762
4763
+ if (tps != null && tps.length == 1)
4764
+ {
4765
+ EditSelection(false);
4766
+ }
4767
+
4768
+ SetPinStates(tps != null && tps.length > 0);
4769
+
43304770 refreshContents();
43314771 //return true;
43324772 }
....@@ -4335,6 +4775,35 @@
43354775
43364776 freezemodel = false;
43374777 }
4778
+
4779
+ void SetPinStates(boolean enabled)
4780
+ {
4781
+ editButton.setEnabled(enabled);
4782
+ uneditButton.setEnabled(enabled);
4783
+ unselectButton.setEnabled(enabled);
4784
+ flashSelectionButton.setEnabled(enabled);
4785
+ }
4786
+
4787
+ void refreshContents(boolean cp)
4788
+ {
4789
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4790
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
4791
+ {
4792
+ objEditor.ClearInfo(); // .GetMaterial());
4793
+
4794
+ for (int i=0; i < group.selection.Size(); i++)
4795
+ {
4796
+ Object3D child = (Object3D) group.selection.get(i);
4797
+
4798
+ objEditor.AddInfo(child, this, true);
4799
+ System.err.println("info : " + child.GetPath());
4800
+ }
4801
+
4802
+ objEditor.SetText(); // jan 2014
4803
+ }
4804
+
4805
+ super.refreshContents(cp);
4806
+ }
43384807
43394808 void linkSomething(Object3D thing)
43404809 {
....@@ -4406,6 +4875,7 @@
44064875 {
44074876 if (group.selection.isEmpty())
44084877 return;
4878
+
44094879 Grafreed.clipboardIsTempGroup = false;
44104880 Composite tGroup = null;
44114881 if (group.selection.size() > 0) // 1)
....@@ -4416,6 +4886,8 @@
44164886
44174887 if (cut)
44184888 {
4889
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4890
+// Save();
44194891 //int indices[] = jList.getSelectedIndices();
44204892 //for (int i = indices.length - 1; i >= 0; i--)
44214893 //jList.remove(indices[i]);
....@@ -4505,8 +4977,10 @@
45054977 }
45064978
45074979 }
4980
+
45084981 if (Grafreed.clipboardIsTempGroup)
45094982 Grafreed.clipboard = tGroup;
4983
+
45104984 if (cut)
45114985 {
45124986 ResetModel();
....@@ -4516,6 +4990,10 @@
45164990
45174991 void paste(boolean expand)
45184992 {
4993
+ if (Globals.REPLACEONMAKE)
4994
+ Save();
4995
+ boolean keep = Globals.REPLACEONMAKE;
4996
+ Globals.REPLACEONMAKE = false;
45194997 // if (GrafreeD.clipboard == null)
45204998 // return;
45214999 boolean first = true;
....@@ -4575,6 +5053,7 @@
45755053 Grafreed.clipboard.get(0).parent = keepparent;
45765054 }
45775055
5056
+ Globals.REPLACEONMAKE = keep;
45785057 ResetModel();
45795058 refreshContents();
45805059 }
....@@ -4710,6 +5189,10 @@
47105189
47115190 void group(Object3D csg, boolean grab)
47125191 {
5192
+ if (Globals.REPLACEONMAKE)
5193
+ Save();
5194
+ boolean keep = Globals.REPLACEONMAKE;
5195
+ Globals.REPLACEONMAKE = false;
47135196 if (//false) // why??
47145197 !group.selection.isEmpty())
47155198 {
....@@ -4823,10 +5306,15 @@
48235306 //node.add(csg);
48245307 //makeSomething(node);
48255308 makeSomething(csg);
5309
+ Globals.REPLACEONMAKE = keep;
48265310 }
48275311
48285312 void Ungroup(Object3D g)
48295313 {
5314
+ if (Globals.REPLACEONMAKE)
5315
+ Save();
5316
+ boolean keep = Globals.REPLACEONMAKE;
5317
+ Globals.REPLACEONMAKE = false;
48305318 if (g instanceof HiddenObject)
48315319 {
48325320 HiddenObject h = (HiddenObject) g;
....@@ -4843,6 +5331,7 @@
48435331 objEditor.makeSomething(g.get(i), false);
48445332 }
48455333 }
5334
+ Globals.REPLACEONMAKE = keep;
48465335 }
48475336
48485337 void ungroup()
....@@ -5131,7 +5620,28 @@
51315620 cButton clearpanelButton;
51325621 cButton unselectButton;
51335622
5623
+ cButton restoreCameraButton;
5624
+
5625
+ cButton saveButton;
51345626 cButton oneStepButton;
5627
+
5628
+ cButton groupButton;
5629
+ cButton ungroupButton;
5630
+ cButton compositeButton;
5631
+ cButton switchButton;
5632
+ cButton loopButton;
5633
+ cButton textureButton;
5634
+
5635
+ cButton gridButton;
5636
+ cButton boxButton;
5637
+ cButton sphereButton;
5638
+ cButton coneButton;
5639
+ cButton torusButton;
5640
+ cButton superButton;
5641
+ cButton kleinButton;
5642
+ cButton particlesButton;
5643
+ cButton overlayButton;
5644
+ cButton lightButton;
51355645
51365646 cButton screenfitButton;
51375647 cButton screenfitpointButton;
....@@ -5144,14 +5654,6 @@
51445654
51455655 cButton setsupportButton;
51465656
5147
- cButton twoButton;
5148
- cButton sixButton;
5149
- cButton threeButton;
5150
- cButton sevenButton;
5151
- cButton fourButton; // full panel
5152
- cButton oneButton; // full XYZ
5153
- //cButton currentLayout;
5154
-
51555657 //
51565658 //Composite
51575659 Object3D // to do !!
....@@ -5161,11 +5663,11 @@
51615663 //JTree jTree;
51625664 private MenuItem lookAtItem;
51635665 private MenuItem lookFromItem;
5164
- private MenuItem switchItem;
5666
+ private MenuItem switchViewItem;
51655667 private MenuItem cutItem;
51665668 private MenuItem undoItem;
51675669 private MenuItem redoItem;
5168
- private MenuItem duplicateItem;
5670
+ private JMenuItem duplicateItem;
51695671 private MenuItem cloneItem;
51705672 private MenuItem cloneSupportItem;
51715673 private MenuItem overwriteGeoItem;
....@@ -5228,6 +5730,10 @@
52285730 private MenuItem showleavesItem;
52295731 private MenuItem markleavesItem;
52305732 private MenuItem unmarkleavesItem;
5733
+ private MenuItem rewindleavesItem;
5734
+ private MenuItem unrewindleavesItem;
5735
+ private MenuItem randomleavesItem;
5736
+ private MenuItem unrandomleavesItem;
52315737
52325738 private MenuItem flipVItem;
52335739 private MenuItem unflipVItem;
....@@ -5249,7 +5755,7 @@
52495755 private MenuItem frontItem;
52505756 private MenuItem cameraItem;
52515757 private MenuItem compositeItem;
5252
- private MenuItem randomItem;
5758
+ private MenuItem switchItem;
52535759 private MenuItem physicsItem;
52545760 private MenuItem frameselectorItem;
52555761 private MenuItem scriptNodeItem;
....@@ -5323,5 +5829,5 @@
53235829
53245830 Menu cameraMenu;
53255831 MenuItem editCameraItem;
5326
- MenuItem revertCameraItem;
5832
+ MenuItem restoreCameraItem;
53275833 }