Normand Briere
2019-07-17 a5580a47d246c1272b10adba68070f6e13da5e41
GroupEditor.java
....@@ -84,6 +84,10 @@
8484
8585 void CloneSelection(boolean supports)
8686 {
87
+ if (Globals.REPLACEONMAKE)
88
+ Save();
89
+ boolean keep = Globals.REPLACEONMAKE;
90
+ Globals.REPLACEONMAKE = false;
8791 // Object3D keep = GrafreeD.clipboard;
8892 //Object3D obj;
8993 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -94,6 +98,7 @@
9498
9599 makeSomething(clone, i==group.selection.size()-1);
96100 }
101
+ Globals.REPLACEONMAKE = keep;
97102 }
98103
99104 void CloneClipboard(boolean supports)
....@@ -150,11 +155,19 @@
150155
151156 void SetupMenu2(GroupEditor oe)
152157 {
158
+ oe.jTree = new cTree();
159
+
153160 Menu menu;
154161 oe.menuBar.add(menu = new Menu("Edit"));
155162 //editItem = menu.add(new MenuItem("Edit"));
156163 //editItem.addActionListener(this);
157
- duplicateItem = menu.add(new MenuItem("Duplicate"));
164
+
165
+// undoItem = menu.add(new MenuItem("Undo"));
166
+// undoItem.addActionListener(this);
167
+// redoItem = menu.add(new MenuItem("Redo"));
168
+// redoItem.addActionListener(this);
169
+// menu.add("-");
170
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
158171 duplicateItem.addActionListener(this);
159172 cloneItem = menu.add(new MenuItem("Clone"));
160173 cloneItem.addActionListener(this);
....@@ -170,7 +183,6 @@
170183 copyItem.addActionListener(this);
171184 pasteItem = menu.add(new MenuItem("Paste"));
172185 pasteItem.addActionListener(this);
173
- menu.add("-");
174186
175187 menu.add("-");
176188 pasteIntoItem = menu.add(new MenuItem("Paste into"));
....@@ -197,23 +209,23 @@
197209 //zBufferItem.addActionListener(this);
198210 //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
199211 //normalLensItem.addActionListener(this);
200
- cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
201
- revertCameraItem.addActionListener(this);
212
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
213
+ restoreCameraItem.addActionListener(this);
202214
203
- cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
204
- toggleFullScreenItem.addItemListener(this);
205
- toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
206
- cameraMenu.add("-");
215
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
216
+// toggleFullScreenItem.addItemListener(this);
217
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
218
+// cameraMenu.add("-");
219
+//
220
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
221
+// toggleTextureItem.addItemListener(this);
222
+// toggleTextureItem.setState(CameraPane.textureon);
223
+//
224
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
225
+// toggleSwitchItem.addItemListener(this);
226
+// toggleSwitchItem.setState(CameraPane.SWITCH);
207227
208
- cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
209
- toggleTextureItem.addItemListener(this);
210
- toggleTextureItem.setState(CameraPane.textureon);
211
-
212
- cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
213
- toggleSwitchItem.addItemListener(this);
214
- toggleSwitchItem.setState(CameraPane.SWITCH);
215
-
216
- cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
228
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
217229 toggleHandleItem.addItemListener(this);
218230 toggleHandleItem.setState(CameraPane.HANDLES);
219231
....@@ -240,7 +252,7 @@
240252
241253 cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
242254 toggleDebugItem.addItemListener(this);
243
- toggleDebugItem.setState(CameraPane.DEBUG);
255
+ toggleDebugItem.setState(Globals.DEBUG);
244256
245257 cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
246258 toggleFrustumItem.addItemListener(this);
....@@ -261,14 +273,14 @@
261273 // animationItem.addItemListener(this);
262274 // animationItem.setState(CameraPane.ANIMATION);
263275 cameraMenu.add("-");
264
- cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera"));
276
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
265277 editCameraItem.addActionListener(this);
266278
267279 if (Globals.ADVANCED)
268280 {
269281 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
270282 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
271
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
283
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
272284 editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
273285 oe.cameraMenu.add("-");
274286 openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
....@@ -276,7 +288,7 @@
276288 editLeafItem.addActionListener(this);
277289 lookAtItem.addActionListener(this);
278290 //lookFromItem.addActinoListener(this);
279
- //switchItem.addActionListener(this);
291
+ //switchViewItem.addActionListener(this);
280292 }
281293
282294 oe.menuBar.add(menu = new Menu("Setting"));
....@@ -321,21 +333,29 @@
321333 }
322334
323335 oe.menuBar.add(menu = new Menu("Group"));
324
- grabItem = menu.add(new MenuItem("Grab"));
325
- grabItem.addActionListener(this);
336
+// grabItem = menu.add(new MenuItem("Grab"));
337
+// grabItem.addActionListener(this);
326338 backItem = menu.add(new MenuItem("Back"));
327339 backItem.addActionListener(this);
328340 frontItem = menu.add(new MenuItem("Front"));
329341 frontItem.addActionListener(this);
330
- compositeItem = menu.add(new MenuItem("Composite"));
331
- compositeItem.addActionListener(this);
342
+// compositeItem = menu.add(new MenuItem("Composite"));
343
+// compositeItem.addActionListener(this);
344
+
345
+ if (Globals.ADVANCED)
346
+ {
332347 hideItem = menu.add(new MenuItem("Hidden Group"));
333348 hideItem.addActionListener(this);
349
+ }
334350 ungroupItem = menu.add(new MenuItem("Ungroup"));
335351 ungroupItem.addActionListener(this);
336
- menu.add("-");
337
- randomItem = menu.add(new MenuItem("Switch node"));
338
- randomItem.addActionListener(this);
352
+
353
+// menu.add("-");
354
+//
355
+// switchItem = menu.add(new MenuItem("Switch node"));
356
+// switchItem.addActionListener(this);
357
+ if (Globals.ADVANCED)
358
+ {
339359 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
340360 switchGeoItem.addActionListener(this);
341361 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
....@@ -343,8 +363,6 @@
343363 morphItem = menu.add(new MenuItem("Morph Group"));
344364 morphItem.addActionListener(this);
345365
346
- if (Globals.ADVANCED)
347
- {
348366 menu.add("-");
349367 physicsItem = menu.add(new MenuItem("Physics"));
350368 physicsItem.addActionListener(this);
....@@ -352,30 +370,29 @@
352370 frameselectorItem.addActionListener(this);
353371 scriptNodeItem = menu.add(new MenuItem("Script Node"));
354372 scriptNodeItem.addActionListener(this);
355
- cameraItem = menu.add(new MenuItem("Camera"));
356
- cameraItem.addActionListener(this);
357373 }
358374
359375 oe.menuBar.add(menu = new Menu("Object"));
360
- textureItem = menu.add(new MenuItem("Texture"));
361
- textureItem.addActionListener(this);
376
+// textureItem = menu.add(new MenuItem("Texture"));
377
+// textureItem.addActionListener(this);
362378 billboardItem = menu.add(new MenuItem("Billboard"));
363379 billboardItem.addActionListener(this);
364380 csgItem = menu.add(new MenuItem("CSG"));
365381 csgItem.addActionListener(this);
366
- shadowXItem = menu.add(new MenuItem("Shadow X"));
382
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
367383 shadowXItem.addActionListener(this);
368
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
384
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
369385 shadowYItem.addActionListener(this);
370
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
386
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
371387 shadowZItem.addActionListener(this);
388
+ attributeItem = menu.add(new MenuItem("Attribute"));
389
+ attributeItem.addActionListener(this);
390
+
372391 if (Globals.ADVANCED)
373392 {
374393 menu.add("-");
375394 linkerItem = menu.add(new MenuItem("Linker"));
376395 linkerItem.addActionListener(this);
377
- attributeItem = menu.add(new MenuItem("Attribute"));
378
- attributeItem.addActionListener(this);
379396 templateItem = menu.add(new MenuItem("Template"));
380397 templateItem.addActionListener(this);
381398 pointflowItem = menu.add(new MenuItem("Point Flow"));
....@@ -464,6 +481,14 @@
464481 markleavesItem.addActionListener(this);
465482 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
466483 unmarkleavesItem.addActionListener(this);
484
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
485
+ rewindleavesItem.addActionListener(this);
486
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
487
+ unrewindleavesItem.addActionListener(this);
488
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
489
+ randomleavesItem.addActionListener(this);
490
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
491
+ unrandomleavesItem.addActionListener(this);
467492 menu.add("-");
468493 flipVItem = menu.add(new MenuItem("Flip V"));
469494 flipVItem.addActionListener(this);
....@@ -519,8 +544,21 @@
519544 buildToolsMenu(menu);
520545 }
521546
547
+
522548 void SetupUI2(ObjEditor oe)
523549 {
550
+ // June 2019
551
+ if (oe == null)
552
+ {
553
+ //super.SetupUI2(this);
554
+ //return;
555
+ }
556
+
557
+ if (copy != group)
558
+ {
559
+ //super.SetupUI2(this);
560
+ }
561
+
524562 //new Exception().printStackTrace();
525563
526564 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -549,27 +587,79 @@
549587 oe.radioPanel.add(dummyButton);
550588 oe.buttonGroup.add(dummyButton);
551589 */
590
+ cGridBag copyOptionsPanel = new cGridBag();
591
+
592
+ copyOptionsPanel.preferredHeight = 1;
593
+
552594 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
553595
554
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
596
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
597
+ //minButton.setToolTipText("Minimize window");
598
+ //minButton.addActionListener(this);
599
+
600
+ if (Globals.ADVANCED)
601
+ {
602
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
603
+ maxButton.setToolTipText("Maximize window");
604
+ maxButton.addActionListener(this);
605
+ }
606
+
607
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
+ fullButton.setToolTipText("Full-screen window");
609
+ fullButton.addActionListener(this);
610
+
611
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
612
+ screenfitButton.setToolTipText("Screen fit");
613
+ screenfitButton.addActionListener(this);
614
+
615
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
616
+ restoreCameraButton.setToolTipText("Restore viewpoint");
617
+ restoreCameraButton.addActionListener(this);
618
+
619
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620
+ saveButton.setToolTipText("New version");
621
+ saveButton.addActionListener(this);
622
+
623
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
624
+ undoButton.setToolTipText("Previous version");
625
+ undoButton.addActionListener(this);
626
+ undoButton.setEnabled(false);
627
+
628
+ cGridBag updown = new cGridBag().setVertical(true);
629
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
630
+ restoreButton.setToolTipText("Restore current");
631
+ restoreButton.addActionListener(this);
632
+ restoreButton.setEnabled(false);
633
+
634
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
635
+ replaceButton.setToolTipText("Replace current");
636
+ replaceButton.addActionListener(this);
637
+ replaceButton.setEnabled(false);
638
+
639
+ copyOptionsPanel.add(updown);
640
+
641
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
642
+ redoButton.setToolTipText("Next version");
643
+ redoButton.addActionListener(this);
644
+ redoButton.setEnabled(false);
645
+
646
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
555647 liveCB.setToolTipText("Enable animation");
556648 liveCB.addItemListener(this);
557649
558
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
559651 oneStepButton.setToolTipText("Animate one step forward");
560652 oneStepButton.addActionListener(this);
561653
562
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
654
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
563655 fastCB.setToolTipText("Fast mode");
564656 fastCB.addItemListener(this);
565657
566
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
567
- trackCB.setToolTipText("Enable tracking");
568
- trackCB.addItemListener(this);
569
-
570
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
571
- screenfitButton.setToolTipText("Screen fit");
572
- screenfitButton.addActionListener(this);
658
+ //oe.toolboxPanel.Return();
659
+
660
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
661
+// trackCB.setToolTipText("Enable tracking");
662
+// trackCB.addItemListener(this);
573663
574664 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
575665 // screenfitpointButton.addActionListener(this);
....@@ -581,65 +671,145 @@
581671 snapobjectButton.setToolTipText("Snap Object");
582672 }
583673
584
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
585
- flashSelectionButton.setToolTipText("Show selection");
586
- flashSelectionButton.addActionListener(this);
674
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
587675
588
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
589
-
590
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
676
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
591677 twoButton.setToolTipText("Show center view only");
592678 twoButton.addActionListener(this);
593
- oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
679
+ this.fullscreenLayout = twoButton;
680
+
681
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
594682 fourButton.addActionListener(this);
595683 fourButton.setToolTipText("Show left panel only");
596
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
684
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
597685 sixButton.setToolTipText("2-column layout left");
598686 sixButton.addActionListener(this);
599
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
687
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600688 threeButton.setToolTipText("2-column layout right");
601689 threeButton.addActionListener(this);
602
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
690
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
603691 sevenButton.setToolTipText("3-column layout");
604692 sevenButton.addActionListener(this);
605693 //
606694
607
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
695
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608696 rootButton.setToolTipText("Edit selection in new tab");
609697 rootButton.addActionListener(this);
610698
611
- oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
699
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
612700 closeButton.setToolTipText("Close tab");
613701 closeButton.addActionListener(this);
614702 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
615703 //clearButton.addActionListener(this);
616
-
617
- cGridBag commandsPanel = new cGridBag();
704
+
705
+ // INSERT
706
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
707
+ gridButton.setToolTipText("Create grid");
708
+ gridButton.addActionListener(this);
709
+
710
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
711
+ boxButton.setToolTipText("Create box");
712
+ boxButton.addActionListener(this);
713
+
714
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
715
+ sphereButton.setToolTipText("Create sphere");
716
+ sphereButton.addActionListener(this);
717
+
718
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
719
+ coneButton.setToolTipText("Create cone");
720
+ coneButton.addActionListener(this);
721
+
722
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
723
+ torusButton.setToolTipText("Create torus");
724
+ torusButton.addActionListener(this);
725
+
726
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
727
+ superButton.setToolTipText("Create superellipsoid");
728
+ superButton.addActionListener(this);
729
+
730
+ if (Globals.ADVANCED)
731
+ {
732
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
733
+ kleinButton.setToolTipText("Create Klein bottle");
734
+ kleinButton.addActionListener(this);
735
+ }
618736
619
- commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620
- editButton.setToolTipText("Edit selection");
737
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
738
+ particlesButton.setToolTipText("Create particle system");
739
+ particlesButton.addActionListener(this);
740
+
741
+ oe.toolboxPanel.Return();
742
+
743
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
744
+ groupButton.setToolTipText("Create group");
745
+ groupButton.addActionListener(this);
746
+
747
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
748
+ compositeButton.setToolTipText("Create composite");
749
+ compositeButton.addActionListener(this);
750
+
751
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
752
+ switchButton.setToolTipText("Create item switcher");
753
+ switchButton.addActionListener(this);
754
+
755
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
756
+ loopButton.setToolTipText("Create loop");
757
+ loopButton.addActionListener(this);
758
+
759
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
760
+ textureButton.setToolTipText("Create texture");
761
+ textureButton.addActionListener(this);
762
+
763
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
764
+ overlayButton.setToolTipText("Create overlay");
765
+ overlayButton.addActionListener(this);
766
+
767
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
768
+ lightButton.setToolTipText("Create light");
769
+ lightButton.addActionListener(this);
770
+
771
+ for (int i=6; --i>=0;)
772
+ {
773
+ oe.toolboxPanel.Return();
774
+ oe.toolboxPanel.add(new cGridBag());
775
+ oe.toolboxPanel.add(new cGridBag());
776
+ oe.toolboxPanel.add(new cGridBag());
777
+ oe.toolboxPanel.add(new cGridBag());
778
+ oe.toolboxPanel.add(new cGridBag());
779
+ oe.toolboxPanel.add(new cGridBag());
780
+ oe.toolboxPanel.add(new cGridBag());
781
+ }
782
+
783
+ // EDIT panel
784
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
785
+ editButton.setToolTipText("Pin selection controls");
621786 editButton.addActionListener(this);
622787
623
- commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
624
- uneditButton.setToolTipText("Unedit selection");
788
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
789
+ uneditButton.setToolTipText("Remove selection controls");
625790 uneditButton.addActionListener(this);
626791
627
- commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
628
- allParamsButton.setToolTipText("Edit all params");
792
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
793
+ allParamsButton.setToolTipText("Show all controle");
629794 allParamsButton.addActionListener(this);
630795
631
- commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
796
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
632797 clearPanelButton.setToolTipText("Clear edit panel");
633798 clearPanelButton.addActionListener(this);
634799
635
- commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
800
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
636801 unselectButton.setToolTipText("Unselect");
637802 unselectButton.addActionListener(this);
638803
639
- commandsPanel.preferredHeight = 1;
804
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
805
+ flashSelectionButton.setToolTipText("Highlight selection");
806
+ flashSelectionButton.addActionListener(this);
640807
641
- oe.treePanel.add(commandsPanel);
642
- oe.treePanel.Return();
808
+ editCommandsPanel.preferredHeight = 1;
809
+
810
+ SetPinStates(false);
811
+// oe.treePanel.add(commandsPanel);
812
+// oe.treePanel.Return();
643813
644814 // oe.aConstraints.gridx += 1;
645815 // oe.aConstraints.weighty = 0;
....@@ -656,29 +826,17 @@
656826
657827 JScrollPane jSP;
658828 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
659
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
829
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
660830 ResetModel();
661831
662832 oe.treePanel.add(jSPPanel);
663833 oe.treePanel.Return();
664834
665
- cGridBag copyOptionsPanel = new cGridBag();
666
-
667
- copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
668
- colorCB.setToolTipText("Copy color when dropped");
669
- colorCB.addItemListener(this);
670
-
671
- copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
672
- materialCB.setToolTipText("Copy material when dropped");
673
- materialCB.addItemListener(this);
674
-
675
- copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
676
- textureCB.setToolTipText("Copy texture when dropped");
677
- textureCB.addItemListener(this);
678
-
679
- copyOptionsPanel.preferredHeight = 1;
680835 oe.treePanel.add(copyOptionsPanel);
681836 oe.treePanel.Return();
837
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 10, 0);
838
+ versionField = (cNumberSlider)sliderPane.getComponent(1);
839
+ sliderPane.preferredHeight = 1;
682840
683841 // mainPanel.setDividerLocation(0.5); //1.0);
684842 // mainPanel.setResizeWeight(0.5);
....@@ -707,23 +865,43 @@
707865
708866 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
709867 {
868
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
869
+ colorCB.setToolTipText("Copy color when dropped");
870
+ colorCB.addItemListener(this);
871
+
872
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
873
+ materialCB.setToolTipText("Copy material when dropped");
874
+ materialCB.addItemListener(this);
875
+
876
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
877
+ textureCB.setToolTipText("Copy texture when dropped");
878
+ textureCB.addItemListener(this);
879
+
880
+ panel.Return();
881
+
710882 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
711883 boxCB.setToolTipText("Display bounding boxes");
712884 boxCB.addItemListener(this);
713885
714886 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
715
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
887
+ zoomBoxCB.setToolTipText("Display only for wheel");
716888 zoomBoxCB.addItemListener(this);
717889
718890 if (true) // Globals.ADVANCED)
719891 {
720
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
721
- supportCB.setToolTipText("Enable rigging");
722
- supportCB.addItemListener(this);
892
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
893
+// supportCB.setToolTipText("Enable rigging");
894
+// supportCB.addItemListener(this);
895
+
896
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
897
+ freezeCB.setToolTipText("Fast moving camera");
898
+ freezeCB.addItemListener(this);
723899
724900 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
725901 // localCB.addItemListener(this);
726902
903
+ panel.Return();
904
+
727905 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
728906 crowdCB.setToolTipText("Used for crowds");
729907 crowdCB.addItemListener(this);
....@@ -740,6 +918,8 @@
740918 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
741919 // speakerMocapCB.addItemListener(this);
742920
921
+ panel.Return();
922
+
743923 if (false)
744924 {
745925 // handled in scripts
....@@ -754,32 +934,72 @@
754934 //constraints.gridy += 1;
755935 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
756936 smoothfocusCB.addItemListener(this);
937
+ panel.Return();
757938 }
758939
759940 //constraints.gridx += 1;
760941 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
761942 // debugCB.addItemListener(this);
762943
944
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
945
+ trackCB.setToolTipText("Enable tracking target");
946
+ trackCB.addItemListener(this);
947
+
763948 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
949
+ oeilCB.setToolTipText("Move camera when tracking");
764950 oeilCB.addItemListener(this);
765951
952
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
953
+ shadowCB.setToolTipText("When live compute shadows");
954
+ shadowCB.addItemListener(this);
955
+
956
+ panel.Return();
957
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
958
+ toggleTextureCB.setToolTipText("Load textures");
959
+ toggleTextureCB.addItemListener(this);
960
+
961
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
962
+ toggleSwitchCB.setToolTipText("Choose a single item");
963
+ toggleSwitchCB.addItemListener(this);
964
+
965
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
966
+ autokeepCB.setToolTipText("On structure change");
967
+ autokeepCB.addItemListener(this);
968
+
969
+ panel.Return();
970
+ if (Globals.ADVANCED)
971
+ {
766972 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
767973 lookAtCB.setToolTipText("Look-at target");
768974 lookAtCB.addItemListener(this);
975
+ }
769976
770977 }
771978
772979 cGridBag fill = new cGridBag();
773
-
774980 fill.preferredHeight = 200;
981
+ cGridBag fill2 = new cGridBag();
982
+ fill2.preferredHeight = 200;
983
+ cGridBag fill3 = new cGridBag();
984
+ fill3.preferredHeight = 200;
775985
776986 panel.add(fill);
987
+ panel.add(fill2);
988
+ panel.add(fill3);
777989
778990 }
779991
780992 void EditObject(Object3D obj)
781993 {
782994 cRadio radioButton = new cRadio(obj.name);
995
+
996
+ // June 2019. Patch to avoid bug with transparency.
997
+ radioButton.hadMaterial = obj.material != null;
998
+ if (!radioButton.hadMaterial)
999
+ {
1000
+ obj.material = new cMaterial();
1001
+ }
1002
+
7831003 radioButton.SetObject(obj);
7841004 radioButton.layout = sevenButton;
7851005 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -791,6 +1011,8 @@
7911011
7921012 void SetupViews(ObjEditor oe)
7931013 {
1014
+ theFrame = this;
1015
+
7941016 oe.SetupViews();
7951017
7961018 System.out.println("SetupViews");
....@@ -799,23 +1021,28 @@
7991021 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
8001022 }
8011023
802
- JCheckBox liveCB;
803
- JCheckBox supportCB;
804
- JCheckBox localCB;
805
- JCheckBox crowdCB;
806
- JCheckBox smoothCB;
807
- JCheckBox fastCB;
808
- JCheckBox slowCB;
809
- JCheckBox boxCB;
810
- JCheckBox zoomBoxCB;
811
- JCheckBox trackCB;
812
- JCheckBox smoothfocusCB;
1024
+ cToggleButton liveCB;
1025
+ cCheckBox supportCB;
1026
+ cCheckBox localCB;
1027
+ cCheckBox crowdCB;
1028
+ cCheckBox smoothCB;
1029
+ cToggleButton fastCB;
1030
+ cCheckBox slowCB;
1031
+ cCheckBox boxCB;
1032
+ cCheckBox zoomBoxCB;
1033
+ cCheckBox freezeCB;
1034
+ //cToggleButton trackCB;
1035
+ cCheckBox trackCB;
1036
+ cCheckBox smoothfocusCB;
8131037 // JCheckBox speakerMocapCB;
814
- JCheckBox speakerCameraCB;
815
- JCheckBox speakerFocusCB;
816
- JCheckBox debugCB;
817
- JCheckBox oeilCB;
818
- JCheckBox lookAtCB;
1038
+ cCheckBox speakerCameraCB;
1039
+ cCheckBox speakerFocusCB;
1040
+ cCheckBox debugCB;
1041
+
1042
+ cCheckBox oeilCB;
1043
+ cCheckBox shadowCB;
1044
+ cCheckBox autokeepCB;
1045
+ cCheckBox lookAtCB;
8191046
8201047 // static int COLOR = 1;
8211048 // static int MATERIAL = 2;
....@@ -823,9 +1050,9 @@
8231050
8241051 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
8251052
826
- JCheckBox colorCB;
827
- JCheckBox materialCB;
828
- JCheckBox textureCB;
1053
+ cCheckBox colorCB;
1054
+ cCheckBox materialCB;
1055
+ cCheckBox textureCB;
8291056
8301057 public void itemStateChanged(ItemEvent e)
8311058 {
....@@ -853,6 +1080,7 @@
8531080 } else if(e.getSource() == liveCB)
8541081 {
8551082 cameraView.ToggleLive();
1083
+ refreshContents(false);
8561084 }
8571085 else if(e.getSource() == supportCB)
8581086 {
....@@ -917,6 +1145,18 @@
9171145 {
9181146 cameraView.ToggleOeil();
9191147 }
1148
+ else if(e.getSource() == shadowCB)
1149
+ {
1150
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1151
+ }
1152
+ else if(e.getSource() == freezeCB)
1153
+ {
1154
+ Globals.FREEZEONMOVE ^= true;
1155
+ }
1156
+ else if(e.getSource() == autokeepCB)
1157
+ {
1158
+ Globals.REPLACEONMAKE ^= true;
1159
+ }
9201160 else if(e.getSource() == lookAtCB)
9211161 {
9221162 cameraView.ToggleLookAt();
....@@ -933,7 +1173,8 @@
9331173
9341174 /**/
9351175 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
936
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1176
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1177
+ TreePath path = objEditor.jTree.getSelectionPath();
9371178 if ((path == null) || (path.getPathCount() <= 1)) {
9381179 // We can't move the root node or an empty selection
9391180 return;
....@@ -996,8 +1237,6 @@
9961237 }
9971238 }
9981239
999
- String string = (String) object;
1000
-
10011240 System.out.println("Transfer = " + object + "; drop : " + target);
10021241 // if( object instanceof java.io.File[])
10031242 // {
....@@ -1005,6 +1244,8 @@
10051244 // objEditor.DropFile((java.io.File[]) object, true);
10061245 // return;
10071246 // }
1247
+
1248
+ String string = object.toString();
10081249
10091250 // File path for Mac and Windows
10101251 if (string.charAt(0) == '/' || string.charAt(1) == ':')
....@@ -1050,23 +1291,33 @@
10501291
10511292 assert target == objEditor.jTree;
10521293 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1294
+ Object3D destinationLeaf;
10531295 try {
1054
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1296
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
10551297 } catch (Exception e) {
10561298 System.out.println("destinationPath : " + destinationPath);
10571299 return;
10581300 }
10591301
1060
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1302
+ for (int i=group.selection.size(); --i>=0;)
10611303 {
1304
+ Object3D child = (Object3D)group.selection.elementAt(i);
1305
+
1306
+ // Cannot move into itself
1307
+ if (child == destinationLeaf)
1308
+ return;
1309
+ }
1310
+
1311
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1312
+// {
10621313 loadClipboard(true);
10631314 objEditor.jTree.setSelectionPath(destinationPath);
10641315 pasteInto(false, false);
1065
- } else {
1066
- loadClipboard(false);
1067
- objEditor.jTree.setSelectionPath(destinationPath);
1068
- pasteInto(false, false); // true); // ???
1069
- }
1316
+// } else {
1317
+// loadClipboard(false);
1318
+// objEditor.jTree.setSelectionPath(destinationPath);
1319
+// pasteInto(false, false); // true); // ???
1320
+// }
10701321 }
10711322 public void dropActionChanged(DropTargetDragEvent dtde)
10721323 // Called if the user has modified the current drop gesture
....@@ -1171,22 +1422,30 @@
11711422 {
11721423 //heightFieldItem = menu.add(new MenuItem("Height Field"));
11731424 //heightFieldItem.addActionListener(this);
1174
- gridItem = menu.add(new MenuItem("Grid"));
1175
- gridItem.addActionListener(this);
1176
- rectoidItem = menu.add(new MenuItem("Box"));
1177
- rectoidItem.addActionListener(this);
1178
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1179
- ellipsoidItem.addActionListener(this);
1180
- coneItem = menu.add(new MenuItem("Cone"));
1181
- coneItem.addActionListener(this);
1182
- torusItem = menu.add(new MenuItem("Torus"));
1183
- torusItem.addActionListener(this);
1184
- superItem = menu.add(new MenuItem("Superellipsoid"));
1185
- superItem.addActionListener(this);
1425
+// gridItem = menu.add(new MenuItem("Grid"));
1426
+// gridItem.addActionListener(this);
1427
+// rectoidItem = menu.add(new MenuItem("Box"));
1428
+// rectoidItem.addActionListener(this);
1429
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1430
+// ellipsoidItem.addActionListener(this);
1431
+// coneItem = menu.add(new MenuItem("Cone"));
1432
+// coneItem.addActionListener(this);
1433
+// torusItem = menu.add(new MenuItem("Torus"));
1434
+// torusItem.addActionListener(this);
1435
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1436
+// superItem.addActionListener(this);
1437
+
1438
+ cameraItem = menu.add(new MenuItem("Camera"));
1439
+ cameraItem.addActionListener(this);
1440
+
1441
+ if (!Globals.ADVANCED)
1442
+ {
11861443 kleinItem = menu.add(new MenuItem("Klein Bottle"));
11871444 kleinItem.addActionListener(this);
1188
- particleItem = menu.add(new MenuItem("Particle system"));
1189
- particleItem.addActionListener(this);
1445
+ }
1446
+
1447
+// particleItem = menu.add(new MenuItem("Particle system"));
1448
+// particleItem.addActionListener(this);
11901449 if (Globals.ADVANCED)
11911450 {
11921451 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1212,15 +1471,15 @@
12121471 }
12131472 bezierItem = menu.add(new MenuItem("Bezier Patch"));
12141473 bezierItem.addActionListener(this);
1215
- overlayItem = menu.add(new MenuItem("Overlay"));
1216
- overlayItem.addActionListener(this);
1217
- lightItem = menu.add(new MenuItem("Light"));
1218
- lightItem.addActionListener(this);
1474
+// overlayItem = menu.add(new MenuItem("Overlay"));
1475
+// overlayItem.addActionListener(this);
1476
+// lightItem = menu.add(new MenuItem("Light"));
1477
+// lightItem.addActionListener(this);
12191478 menu.add("-");
12201479 //superLoopItem = menu.add(new MenuItem("Super Loop"));
12211480 //superLoopItem.addActionListener(this);
1222
- loopItem = menu.add(new MenuItem("Loop"));
1223
- loopItem.addActionListener(this);
1481
+// loopItem = menu.add(new MenuItem("Loop"));
1482
+// loopItem.addActionListener(this);
12241483 doubleItem = menu.add(new MenuItem("Fork"));
12251484 doubleItem.addActionListener(this);
12261485 if (Globals.ADVANCED)
....@@ -1236,6 +1495,9 @@
12361495 animationItem.addItemListener(this);
12371496 animationItem.setState(Globals.ANIMATION);
12381497
1498
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1499
+ archiveItem.addActionListener(this);
1500
+
12391501 menu.add("-");
12401502 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
12411503 parseverticesItem.addActionListener(this);
....@@ -1248,6 +1510,8 @@
12481510 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
12491511 reduce34MorphItem.addActionListener(this);
12501512 menu.add("-");
1513
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1514
+ memoryItem.addActionListener(this);
12511515 menu.add(computeAOItem = new MenuItem("Compute AO"));
12521516 computeAOItem.addActionListener(this);
12531517
....@@ -1256,11 +1520,9 @@
12561520 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
12571521 mirrorItem.addActionListener(this);
12581522 menu.add("-");
1259
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1260
- memoryItem.addActionListener(this);
12611523 menu.add(analyzeItem = new MenuItem("Analyze"));
12621524 analyzeItem.addActionListener(this);
1263
- menu.add(dumpItem = new MenuItem("Dump"));
1525
+ menu.add(dumpItem = new MenuItem("Print"));
12641526 dumpItem.addActionListener(this);
12651527 // menu.add(pathItem = new MenuItem("From-to path"));
12661528 // pathItem.addActionListener(this);
....@@ -1401,9 +1663,24 @@
14011663 shadow.material = new cMaterial(obj.material);
14021664 shadow.material.diffuse = 0.0001f;
14031665 shadow.material.specular = 0.0001f;
1666
+ //shadow.projectedVertices[1].x = 300;
14041667
14051668 makeSomething(shadow);
14061669 }
1670
+
1671
+ private void ClearUnpinned()
1672
+ {
1673
+ //for (Object3D obj : listUI)
1674
+ for (int i=listUI.size(); --i>=0;)
1675
+ {
1676
+ Object3D obj = listUI.elementAt(i);
1677
+ if (!obj.pinned)
1678
+ {
1679
+ obj.CloseUI();
1680
+ listUI.remove(i);
1681
+ }
1682
+ }
1683
+ }
14071684
14081685 /**
14091686 * applyExample
....@@ -1648,7 +1925,7 @@
16481925 {
16491926 ScreenFit();
16501927 } else
1651
- if (source == switchItem)
1928
+ if (source == switchViewItem)
16521929 {
16531930 cVector v1 = new cVector();
16541931 cVector v2 = new cVector();
....@@ -1657,11 +1934,11 @@
16571934 objEditor.cameraView.renderCamera.setAim(v2, v1);
16581935 objEditor.cameraView.repaint();
16591936 } else
1660
- if (source == rectoidItem)
1937
+ if (source == rectoidItem || source == boxButton)
16611938 {
16621939 makeSomething(new Box());
16631940 } else
1664
- if (source == particleItem)
1941
+ if (source == particleItem || source == particlesButton)
16651942 {
16661943 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
16671944 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1740,27 +2017,27 @@
17402017
17412018 makeSomething(obj);
17422019 } else
1743
- if (source == gridItem)
2020
+ if (source == gridItem || source == gridButton)
17442021 {
17452022 makeSomething(new Grid());
17462023 } else
1747
- if (source == ellipsoidItem)
2024
+ if (source == ellipsoidItem || source == sphereButton)
17482025 {
17492026 makeSomething(new Sphere());
17502027 } else
1751
- if (source == coneItem)
2028
+ if (source == coneItem || source == coneButton)
17522029 {
17532030 makeSomething(new Cone());
17542031 } else
1755
- if (source == torusItem)
2032
+ if (source == torusItem || source == torusButton)
17562033 {
17572034 makeSomething(new Torus());
17582035 } else
1759
- if (source == superItem)
2036
+ if (source == superItem || source == superButton)
17602037 {
17612038 makeSomething(new Superellipsoid());
17622039 } else
1763
- if (source == kleinItem)
2040
+ if (source == kleinItem || source == kleinButton)
17642041 {
17652042 makeSomething(new Klein());
17662043 } else
....@@ -1780,7 +2057,7 @@
17802057 {
17812058 makeSomething(new BezierSurface());
17822059 } else
1783
- if (source == overlayItem)
2060
+ if (source == overlayItem || source == overlayButton)
17842061 {
17852062 /*
17862063 Object3D obj = new BezierSurface(5,8);
....@@ -1828,7 +2105,7 @@
18282105 s.setup();
18292106 makeSomething(s);
18302107 } else
1831
- if (source == lightItem)
2108
+ if (source == lightItem || source == lightButton)
18322109 {
18332110 makeSomething(new Light());
18342111 } else
....@@ -1878,30 +2155,30 @@
18782155
18792156 group(g);
18802157 } else
1881
- if (source == loopItem)
2158
+ if (source == loopItem || source == loopButton)
18822159 {
18832160 Composite csg = new GroupLeaf();
18842161 csg.count = 5;
18852162 group(csg);
1886
- Composite child = new cGroup();
2163
+ Composite child = new cGroup("Branch");
18872164 csg.addChild(child);
18882165 child.addChild(csg);
18892166 } else
18902167 if (source == doubleItem)
18912168 {
1892
- Composite csg = new GroupLeaf();
2169
+ Composite csg = new GroupLeaf("Fork");
18932170 csg.count = 5;
18942171 group(csg);
1895
- Composite child = new cGroup();
2172
+ Composite child = new cGroup("Branch A");
18962173 csg.addChild(child);
18972174 child.addChild(csg);
1898
- child = new cGroup();
2175
+ child = new cGroup("Branch B");
18992176 csg.addChild(child);
19002177 child.addChild(csg);
19012178 } else
19022179 if (source == tripleItem)
19032180 {
1904
- Composite csg = new GroupLeaf();
2181
+ Composite csg = new GroupLeaf("Trident");
19052182 csg.count = 4;
19062183 group(csg);
19072184 Composite child = new cGroup();
....@@ -1951,6 +2228,46 @@
19512228 {
19522229 DumpObject();
19532230 } else
2231
+ if (source == minButton)
2232
+ {
2233
+ Minimize();
2234
+ } else
2235
+ if (source == maxButton)
2236
+ {
2237
+ Maximize();
2238
+ } else
2239
+ if (source == fullButton)
2240
+ {
2241
+ ToggleFullScreen();
2242
+ } else
2243
+ if (source == undoButton)
2244
+ {
2245
+ // Go to previous version
2246
+ //if (!Undo())
2247
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2248
+ Undo();
2249
+ } else
2250
+ if (source == restoreButton)
2251
+ {
2252
+ // Restore current version
2253
+ Restore();
2254
+ } else
2255
+ if (source == replaceButton)
2256
+ {
2257
+ // Overwrite current version
2258
+ Replace();
2259
+ } else
2260
+ if (source == redoButton)
2261
+ {
2262
+ // Go to next version
2263
+ Redo();
2264
+ } else
2265
+ if (source == saveButton)
2266
+ {
2267
+ // Save a new version
2268
+ if (!Save(true))
2269
+ java.awt.Toolkit.getDefaultToolkit().beep();
2270
+ } else
19542271 if (source == oneStepButton)
19552272 {
19562273 Globals.ONESTEP = true;
....@@ -1958,17 +2275,14 @@
19582275 } else
19592276 if (source == screenfitButton)
19602277 {
1961
- //Reload(lastConverter, lastFilename, true);
19622278 ScreenFit();
19632279 } else
19642280 if (source == screenfitpointButton)
19652281 {
1966
- //Reload(lastConverter, lastFilename, true);
19672282 ScreenFitPoint();
19682283 } else
19692284 if (source == snapobjectButton)
19702285 {
1971
- //Reload(lastConverter, lastFilename, true);
19722286 SnapObject();
19732287 } else
19742288 // if (event.getSource() == recompileButton)
....@@ -2004,6 +2318,14 @@
20042318 if (source == cutItem || source == clearButton)
20052319 {
20062320 loadClipboard(true);
2321
+ } else
2322
+ if (source == undoItem)
2323
+ {
2324
+ Undo();
2325
+ } else
2326
+ if (source == redoItem)
2327
+ {
2328
+ Redo();
20072329 } else
20082330 if (source == duplicateItem)
20092331 {
....@@ -2336,9 +2658,9 @@
23362658 {
23372659 ClearSelection(true);
23382660 } else
2339
- if (source == grabItem)
2661
+ if (source == grabItem || source == groupButton)
23402662 {
2341
- group(new cGroup(), true);
2663
+ group(new cGroup(), false); // true);
23422664 } else
23432665 if (source == hideItem)
23442666 {
....@@ -2356,11 +2678,11 @@
23562678 {
23572679 makeSomething(new Camera());
23582680 } else
2359
- if (source == compositeItem)
2681
+ if (source == compositeItem || source == compositeButton)
23602682 {
23612683 group(new Composite());
23622684 } else
2363
- if (source == randomItem)
2685
+ if (source == switchItem || source == switchButton)
23642686 {
23652687 RandomNode random = new RandomNode();
23662688 group(random);
....@@ -2462,7 +2784,7 @@
24622784 {
24632785 group(new cLinker());
24642786 } else
2465
- if (source == textureItem)
2787
+ if (source == textureItem || source == textureButton)
24662788 {
24672789 group(new TextureNode());
24682790 } else
....@@ -2482,17 +2804,30 @@
24822804 {
24832805 CastShadow(2);
24842806 } else
2485
- if (source == ungroupItem)
2807
+ if (source == ungroupItem || source == ungroupButton)
24862808 {
2487
- //ungroup();
2809
+ boolean hasRoot = false;
2810
+
24882811 for (int i=0; i<group.selection.size(); i++)
24892812 {
2490
- Ungroup(group.selection.get(i));
2813
+ if (group.selection.get(i) == group)
2814
+ {
2815
+ hasRoot = true;
2816
+ break;
2817
+ }
24912818 }
24922819
2493
- ClearSelection(false);
2494
-
2495
- refreshContents();
2820
+ if (!hasRoot)
2821
+ {
2822
+ for (int i=0; i<group.selection.size(); i++)
2823
+ {
2824
+ Ungroup(group.selection.get(i));
2825
+ }
2826
+
2827
+ ClearSelection(false);
2828
+
2829
+ refreshContents();
2830
+ }
24962831 } else
24972832 if (source == genUVItem)
24982833 {
....@@ -2504,7 +2839,7 @@
25042839 } else
25052840 if (source == genNormalsMESHItem)
25062841 {
2507
- GenNormals(true); // TODO
2842
+ GenNormalsMESH();
25082843 } else
25092844 if (source == genNormalsORGANItem)
25102845 {
....@@ -2569,6 +2904,22 @@
25692904 if (source == unmarkleavesItem)
25702905 {
25712906 MarkLeaves(false);
2907
+ } else
2908
+ if (source == rewindleavesItem)
2909
+ {
2910
+ RewindLeaves(true);
2911
+ } else
2912
+ if (source == unrewindleavesItem)
2913
+ {
2914
+ RewindLeaves(false);
2915
+ } else
2916
+ if (source == randomleavesItem)
2917
+ {
2918
+ RandomLeaves(true);
2919
+ } else
2920
+ if (source == unrandomleavesItem)
2921
+ {
2922
+ RandomLeaves(false);
25722923 } else
25732924 if (source == flipVItem)
25742925 {
....@@ -2804,6 +3155,10 @@
28043155 if (source == twoButton)
28053156 {
28063157 radio.layout = twoButton;
3158
+
3159
+ if (CameraPane.FULLSCREEN)
3160
+ fullscreenLayout = radio.layout;
3161
+
28073162 // bug
28083163 //gridPanel.setDividerLocation(1.0);
28093164 //bigPanel.setDividerLocation(0.0);
....@@ -2836,10 +3191,31 @@
28363191 bigThree.ClearUI();
28373192 bigThree.add(centralPanel);
28383193 bigThree.FlushUI();
3194
+
3195
+ cameraView.requestFocusInWindow();
3196
+
3197
+// refreshContents(true);
3198
+//
3199
+// try
3200
+// {
3201
+// java.awt.Robot bot = new java.awt.Robot();
3202
+// int mask = InputEvent.BUTTON1_MASK;
3203
+// bot.mouseMove(100, 100);
3204
+// bot.mousePress(mask);
3205
+// bot.mouseRelease(mask);
3206
+// }
3207
+// catch (Exception e)
3208
+// {
3209
+//
3210
+// }
3211
+
28393212 } else
28403213 if (source == threeButton)
28413214 {
28423215 radio.layout = threeButton;
3216
+
3217
+ if (CameraPane.FULLSCREEN)
3218
+ fullscreenLayout = radio.layout;
28433219
28443220 // bigThree.remove(scenePanel);
28453221 // bigThree.remove(centralPanel);
....@@ -2872,10 +3248,15 @@
28723248 bigThree.add(centralPanel);
28733249 bigThree.add(XYZPanel);
28743250 bigThree.FlushUI();
3251
+
3252
+ cameraView.requestFocusInWindow();
28753253 } else
28763254 if (source == fourButton)
28773255 {
28783256 radio.layout = fourButton;
3257
+
3258
+ if (CameraPane.FULLSCREEN)
3259
+ fullscreenLayout = radio.layout;
28793260
28803261 // bigThree.remove(scenePanel);
28813262 // bigThree.remove(centralPanel);
....@@ -2907,10 +3288,15 @@
29073288 bigThree.ClearUI();
29083289 bigThree.add(scenePanel);
29093290 bigThree.FlushUI();
3291
+
3292
+ cameraView.requestFocusInWindow();
29103293 } else
29113294 if (source == sixButton)
29123295 {
29133296 radio.layout = sixButton;
3297
+
3298
+ if (CameraPane.FULLSCREEN)
3299
+ fullscreenLayout = radio.layout;
29143300
29153301 // bigThree.remove(scenePanel);
29163302 // bigThree.remove(centralPanel);
....@@ -2943,10 +3329,15 @@
29433329 bigThree.add(scenePanel);
29443330 bigThree.add(centralPanel);
29453331 bigThree.FlushUI();
3332
+
3333
+ cameraView.requestFocusInWindow();
29463334 } else
29473335 if (source == sevenButton)
29483336 {
29493337 radio.layout = sevenButton;
3338
+
3339
+ if (CameraPane.FULLSCREEN)
3340
+ fullscreenLayout = radio.layout;
29503341
29513342 // bigThree.remove(scenePanel);
29523343 // bigThree.remove(centralPanel);
....@@ -2980,6 +3371,8 @@
29803371 bigThree.add(centralPanel);
29813372 bigThree.add(XYZPanel);
29823373 bigThree.FlushUI();
3374
+
3375
+ cameraView.requestFocusInWindow();
29833376 } else
29843377 if (source == rootButton)
29853378 {
....@@ -2991,6 +3384,7 @@
29913384 EditObject(obj);
29923385 }
29933386
3387
+ cameraView.requestFocusInWindow();
29943388 refreshContents(true);
29953389 } else
29963390 if (source == closeButton)
....@@ -3000,22 +3394,37 @@
30003394 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
30013395 {
30023396 ab = (cRadio)e.nextElement();
3003
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3397
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
30043398 {
3399
+ // Patch to avoid bug with transparency.
3400
+ if (!ab.hadMaterial)
3401
+ {
3402
+ ab.object.material = null;
3403
+ }
3404
+
30053405 buttonGroup.remove(ab);
30063406 radioPanel.remove(ab);
30073407
3008
- ab.GetObject().editWindow = null;
3408
+ //ab.GetObject().editWindow = null;
3409
+ ab.GetObject().manipWindow = null;
30093410 // ab.GetObject().objectUI = null; // ?????????
30103411
30113412 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
30123413 break;
30133414 }
30143415 }
3416
+
3417
+ cameraView.requestFocusInWindow();
30153418 refreshContents(true);
30163419 } else
30173420 if (source == editItem || source == editButton)
30183421 {
3422
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3423
+ {
3424
+ Object3D child = (Object3D)e.nextElement();
3425
+ child.pinned = true;
3426
+ }
3427
+
30193428 EditSelection(false);
30203429 } else
30213430 if (source == uneditButton)
....@@ -3025,10 +3434,11 @@
30253434 Object3D child = (Object3D)e.nextElement();
30263435 if(child.editWindow != null)
30273436 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3437
+ child.pinned = false;
30283438 child.CloseUI();
30293439 listUI.remove(child);
30303440
3031
- child.editWindow = null; // ???????????
3441
+ //child.editWindow = null; // ???????????
30323442 }
30333443 objEditor.ctrlPanel.FlushUI();
30343444 //objEditor.jTree.clearSelection();
....@@ -3041,6 +3451,7 @@
30413451 //copy.ClearUI();
30423452 for (Object3D obj : listUI)
30433453 {
3454
+ obj.pinned = false;
30443455 obj.CloseUI();
30453456 }
30463457 listUI.clear();
....@@ -3050,7 +3461,7 @@
30503461 {
30513462 assert(copy == group);
30523463
3053
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3464
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
30543465
30553466 for (Object3D obj : listUI)
30563467 {
....@@ -3099,6 +3510,9 @@
30993510 }
31003511
31013512 copy = group;
3513
+
3514
+ SetUndoStates();
3515
+
31023516 //Globals.theRenderer.object = group;
31033517 if(!useclient)
31043518 {
....@@ -3115,7 +3529,9 @@
31153529 sideView.object = group;
31163530 }
31173531
3118
-// fix "+" issue group.editWindow = this;
3532
+// fix "+" issue
3533
+ //group.editWindow = this;
3534
+ group.manipWindow = this;
31193535
31203536 /*
31213537 currentLayout = radio.layout;
....@@ -3123,18 +3539,25 @@
31233539 currentLayout = sevenButton;
31243540 */
31253541 radio.layout.doClick();
3542
+
3543
+ ClearUnpinned();
3544
+ SetPinStates(group.selection.size() > 0);
3545
+ if (group.selection.size() == 1)
3546
+ EditSelection(false);
31263547 keepparent = group.parent;
31273548 // PARENT = NULL or not???
31283549 //group.parent = null; // ROOT
31293550 //group.attributes = -1;
31303551 ResetModel();
3552
+
3553
+ cameraView.requestFocusInWindow();
31313554 refreshContents(true);
31323555 } else if (event.getSource() == editCameraItem)
31333556 {
31343557 cameraView.ProtectCamera();
31353558 cameraView.repaint();
31363559 return;
3137
- } else if (event.getSource() == revertCameraItem)
3560
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
31383561 {
31393562 cameraView.RevertCamera();
31403563 cameraView.repaint();
....@@ -3151,7 +3574,6 @@
31513574 }
31523575
31533576 boolean useclient = false;
3154
- cRadio radio;
31553577
31563578 void ToggleRoot()
31573579 {
....@@ -3390,7 +3812,8 @@
33903812
33913813 int size = obj.MemorySize();
33923814
3393
- System.err.println((size/1024) + " KB is the size of " + obj);
3815
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3816
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
33943817 }
33953818 }
33963819 catch (Exception e)
....@@ -3471,6 +3894,13 @@
34713894 void GenNormals(boolean crease)
34723895 {
34733896 group.GenNormalsS(crease);
3897
+
3898
+ refreshContents();
3899
+ }
3900
+
3901
+ void GenNormalsMESH()
3902
+ {
3903
+ group.GenNormalsMeshS();
34743904
34753905 refreshContents();
34763906 }
....@@ -4098,6 +4528,18 @@
40984528 refreshContents();
40994529 }
41004530
4531
+ void RewindLeaves(boolean hide)
4532
+ {
4533
+ group.selection.RewindLeaves(hide);
4534
+ refreshContents();
4535
+ }
4536
+
4537
+ void RandomLeaves(boolean hide)
4538
+ {
4539
+ group.selection.RandomLeaves(hide);
4540
+ refreshContents();
4541
+ }
4542
+
41014543 void SetTexRes(int tr)
41024544 {
41034545 group.selection.SetTexRes(tr);
....@@ -4169,10 +4611,6 @@
41694611 // }
41704612 // }
41714613
4172
- static boolean allparams = true;
4173
-
4174
- static Vector<Object3D> listUI = new Vector<Object3D>();
4175
-
41764614 void EditSelection(boolean newWindow)
41774615 {
41784616 // aConstraints.gridy = 0;
....@@ -4180,7 +4618,7 @@
41804618 {
41814619 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
41824620 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4183
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4621
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
41844622
41854623 Object3D elem = (Object3D)group.selection.elementAt(i);
41864624 if(elem != group || !newWindow)
....@@ -4265,7 +4703,8 @@
42654703 //new Exception().printStackTrace();
42664704
42674705 freezemodel = true;
4268
-
4706
+ ClearUnpinned();
4707
+
42694708 /**/
42704709 //switch (event.id)
42714710 {
....@@ -4273,7 +4712,6 @@
42734712 //case 702: // Event.LIST_DESELECT
42744713 group.deselectAll();
42754714 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4276
- objEditor.ClearInfo(); // .GetMaterial());
42774715 if (tps != null)
42784716 {
42794717 for (int i=0; i < tps.length; i++)
....@@ -4282,10 +4720,8 @@
42824720
42834721 //if (child.parent != null)
42844722 //child.parent.addSelectee(child);
4723
+ objEditor.SetMaterial(child);
42854724 group.addSelectee(child);
4286
- objEditor.SetMaterial(child); // .GetMaterial());
4287
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4288
- System.err.println("info : " + child.GetPath());
42894725 }
42904726 }
42914727 // else
....@@ -4295,20 +4731,28 @@
42954731 // System.err.println("info : " + group.GetPath());
42964732 // }
42974733
4298
- objEditor.SetText(); // jan 2014
4299
-
4300
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4734
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
43014735 CameraPane.flash = true;
43024736
4303
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4737
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
43044738 // a camera
43054739 {
4306
- CameraPane.camerachangeframe = 0; // don't refuse it
4307
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4740
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
4741
+ {
4742
+ CameraPane.camerachangeframe = 0; // don't refuse it
4743
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4744
+ }
43084745 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
43094746 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
43104747 }
43114748
4749
+ if (tps != null && tps.length == 1)
4750
+ {
4751
+ EditSelection(false);
4752
+ }
4753
+
4754
+ SetPinStates(tps != null && tps.length > 0);
4755
+
43124756 refreshContents();
43134757 //return true;
43144758 }
....@@ -4317,6 +4761,35 @@
43174761
43184762 freezemodel = false;
43194763 }
4764
+
4765
+ void SetPinStates(boolean enabled)
4766
+ {
4767
+ editButton.setEnabled(enabled);
4768
+ uneditButton.setEnabled(enabled);
4769
+ unselectButton.setEnabled(enabled);
4770
+ flashSelectionButton.setEnabled(enabled);
4771
+ }
4772
+
4773
+ void refreshContents(boolean cp)
4774
+ {
4775
+ if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4776
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
4777
+ {
4778
+ objEditor.ClearInfo(); // .GetMaterial());
4779
+
4780
+ for (int i=0; i < group.selection.Size(); i++)
4781
+ {
4782
+ Object3D child = (Object3D) group.selection.get(i);
4783
+
4784
+ objEditor.AddInfo(child, this, true);
4785
+ System.err.println("info : " + child.GetPath());
4786
+ }
4787
+
4788
+ objEditor.SetText(); // jan 2014
4789
+ }
4790
+
4791
+ super.refreshContents(cp);
4792
+ }
43204793
43214794 void linkSomething(Object3D thing)
43224795 {
....@@ -4388,6 +4861,7 @@
43884861 {
43894862 if (group.selection.isEmpty())
43904863 return;
4864
+
43914865 Grafreed.clipboardIsTempGroup = false;
43924866 Composite tGroup = null;
43934867 if (group.selection.size() > 0) // 1)
....@@ -4398,6 +4872,8 @@
43984872
43994873 if (cut)
44004874 {
4875
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4876
+// Save();
44014877 //int indices[] = jList.getSelectedIndices();
44024878 //for (int i = indices.length - 1; i >= 0; i--)
44034879 //jList.remove(indices[i]);
....@@ -4487,8 +4963,10 @@
44874963 }
44884964
44894965 }
4966
+
44904967 if (Grafreed.clipboardIsTempGroup)
44914968 Grafreed.clipboard = tGroup;
4969
+
44924970 if (cut)
44934971 {
44944972 ResetModel();
....@@ -4498,6 +4976,10 @@
44984976
44994977 void paste(boolean expand)
45004978 {
4979
+ if (Globals.REPLACEONMAKE)
4980
+ Save();
4981
+ boolean keep = Globals.REPLACEONMAKE;
4982
+ Globals.REPLACEONMAKE = false;
45014983 // if (GrafreeD.clipboard == null)
45024984 // return;
45034985 boolean first = true;
....@@ -4557,6 +5039,7 @@
45575039 Grafreed.clipboard.get(0).parent = keepparent;
45585040 }
45595041
5042
+ Globals.REPLACEONMAKE = keep;
45605043 ResetModel();
45615044 refreshContents();
45625045 }
....@@ -4692,6 +5175,10 @@
46925175
46935176 void group(Object3D csg, boolean grab)
46945177 {
5178
+ if (Globals.REPLACEONMAKE)
5179
+ Save();
5180
+ boolean keep = Globals.REPLACEONMAKE;
5181
+ Globals.REPLACEONMAKE = false;
46955182 if (//false) // why??
46965183 !group.selection.isEmpty())
46975184 {
....@@ -4805,10 +5292,15 @@
48055292 //node.add(csg);
48065293 //makeSomething(node);
48075294 makeSomething(csg);
5295
+ Globals.REPLACEONMAKE = keep;
48085296 }
48095297
48105298 void Ungroup(Object3D g)
48115299 {
5300
+ if (Globals.REPLACEONMAKE)
5301
+ Save();
5302
+ boolean keep = Globals.REPLACEONMAKE;
5303
+ Globals.REPLACEONMAKE = false;
48125304 if (g instanceof HiddenObject)
48135305 {
48145306 HiddenObject h = (HiddenObject) g;
....@@ -4825,6 +5317,7 @@
48255317 objEditor.makeSomething(g.get(i), false);
48265318 }
48275319 }
5320
+ Globals.REPLACEONMAKE = keep;
48285321 }
48295322
48305323 void ungroup()
....@@ -5113,7 +5606,28 @@
51135606 cButton clearpanelButton;
51145607 cButton unselectButton;
51155608
5609
+ cButton restoreCameraButton;
5610
+
5611
+ cButton saveButton;
51165612 cButton oneStepButton;
5613
+
5614
+ cButton groupButton;
5615
+ cButton ungroupButton;
5616
+ cButton compositeButton;
5617
+ cButton switchButton;
5618
+ cButton loopButton;
5619
+ cButton textureButton;
5620
+
5621
+ cButton gridButton;
5622
+ cButton boxButton;
5623
+ cButton sphereButton;
5624
+ cButton coneButton;
5625
+ cButton torusButton;
5626
+ cButton superButton;
5627
+ cButton kleinButton;
5628
+ cButton particlesButton;
5629
+ cButton overlayButton;
5630
+ cButton lightButton;
51175631
51185632 cButton screenfitButton;
51195633 cButton screenfitpointButton;
....@@ -5126,14 +5640,6 @@
51265640
51275641 cButton setsupportButton;
51285642
5129
- cButton twoButton;
5130
- cButton sixButton;
5131
- cButton threeButton;
5132
- cButton sevenButton;
5133
- cButton fourButton; // full panel
5134
- cButton oneButton; // full XYZ
5135
- //cButton currentLayout;
5136
-
51375643 //
51385644 //Composite
51395645 Object3D // to do !!
....@@ -5143,9 +5649,11 @@
51435649 //JTree jTree;
51445650 private MenuItem lookAtItem;
51455651 private MenuItem lookFromItem;
5146
- private MenuItem switchItem;
5652
+ private MenuItem switchViewItem;
51475653 private MenuItem cutItem;
5148
- private MenuItem duplicateItem;
5654
+ private MenuItem undoItem;
5655
+ private MenuItem redoItem;
5656
+ private JMenuItem duplicateItem;
51495657 private MenuItem cloneItem;
51505658 private MenuItem cloneSupportItem;
51515659 private MenuItem overwriteGeoItem;
....@@ -5208,6 +5716,10 @@
52085716 private MenuItem showleavesItem;
52095717 private MenuItem markleavesItem;
52105718 private MenuItem unmarkleavesItem;
5719
+ private MenuItem rewindleavesItem;
5720
+ private MenuItem unrewindleavesItem;
5721
+ private MenuItem randomleavesItem;
5722
+ private MenuItem unrandomleavesItem;
52115723
52125724 private MenuItem flipVItem;
52135725 private MenuItem unflipVItem;
....@@ -5229,7 +5741,7 @@
52295741 private MenuItem frontItem;
52305742 private MenuItem cameraItem;
52315743 private MenuItem compositeItem;
5232
- private MenuItem randomItem;
5744
+ private MenuItem switchItem;
52335745 private MenuItem physicsItem;
52345746 private MenuItem frameselectorItem;
52355747 private MenuItem scriptNodeItem;
....@@ -5303,5 +5815,5 @@
53035815
53045816 Menu cameraMenu;
53055817 MenuItem editCameraItem;
5306
- MenuItem revertCameraItem;
5818
+ MenuItem restoreCameraItem;
53075819 }