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,16 +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
- 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"));
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"));
163171 duplicateItem.addActionListener(this);
164172 cloneItem = menu.add(new MenuItem("Clone"));
165173 cloneItem.addActionListener(this);
....@@ -175,7 +183,6 @@
175183 copyItem.addActionListener(this);
176184 pasteItem = menu.add(new MenuItem("Paste"));
177185 pasteItem.addActionListener(this);
178
- menu.add("-");
179186
180187 menu.add("-");
181188 pasteIntoItem = menu.add(new MenuItem("Paste into"));
....@@ -202,23 +209,23 @@
202209 //zBufferItem.addActionListener(this);
203210 //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
204211 //normalLensItem.addActionListener(this);
205
- cameraMenu.add(revertCameraItem = new MenuItem("Restore Camera"));
206
- revertCameraItem.addActionListener(this);
212
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
213
+ restoreCameraItem.addActionListener(this);
207214
208
- cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
209
- toggleFullScreenItem.addItemListener(this);
210
- toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
211
- 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);
212227
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"));
228
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
222229 toggleHandleItem.addItemListener(this);
223230 toggleHandleItem.setState(CameraPane.HANDLES);
224231
....@@ -245,7 +252,7 @@
245252
246253 cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
247254 toggleDebugItem.addItemListener(this);
248
- toggleDebugItem.setState(CameraPane.DEBUG);
255
+ toggleDebugItem.setState(Globals.DEBUG);
249256
250257 cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
251258 toggleFrustumItem.addItemListener(this);
....@@ -266,14 +273,14 @@
266273 // animationItem.addItemListener(this);
267274 // animationItem.setState(CameraPane.ANIMATION);
268275 cameraMenu.add("-");
269
- cameraMenu.add(editCameraItem = new MenuItem("Save Camera"));
276
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
270277 editCameraItem.addActionListener(this);
271278
272279 if (Globals.ADVANCED)
273280 {
274281 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
275282 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
276
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
283
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
277284 editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
278285 oe.cameraMenu.add("-");
279286 openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
....@@ -281,7 +288,7 @@
281288 editLeafItem.addActionListener(this);
282289 lookAtItem.addActionListener(this);
283290 //lookFromItem.addActinoListener(this);
284
- //switchItem.addActionListener(this);
291
+ //switchViewItem.addActionListener(this);
285292 }
286293
287294 oe.menuBar.add(menu = new Menu("Setting"));
....@@ -326,21 +333,29 @@
326333 }
327334
328335 oe.menuBar.add(menu = new Menu("Group"));
329
- grabItem = menu.add(new MenuItem("Grab"));
330
- grabItem.addActionListener(this);
336
+// grabItem = menu.add(new MenuItem("Grab"));
337
+// grabItem.addActionListener(this);
331338 backItem = menu.add(new MenuItem("Back"));
332339 backItem.addActionListener(this);
333340 frontItem = menu.add(new MenuItem("Front"));
334341 frontItem.addActionListener(this);
335
- compositeItem = menu.add(new MenuItem("Composite"));
336
- compositeItem.addActionListener(this);
342
+// compositeItem = menu.add(new MenuItem("Composite"));
343
+// compositeItem.addActionListener(this);
344
+
345
+ if (Globals.ADVANCED)
346
+ {
337347 hideItem = menu.add(new MenuItem("Hidden Group"));
338348 hideItem.addActionListener(this);
349
+ }
339350 ungroupItem = menu.add(new MenuItem("Ungroup"));
340351 ungroupItem.addActionListener(this);
341
- menu.add("-");
342
- randomItem = menu.add(new MenuItem("Switch node"));
343
- 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
+ {
344359 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
345360 switchGeoItem.addActionListener(this);
346361 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
....@@ -348,8 +363,6 @@
348363 morphItem = menu.add(new MenuItem("Morph Group"));
349364 morphItem.addActionListener(this);
350365
351
- if (Globals.ADVANCED)
352
- {
353366 menu.add("-");
354367 physicsItem = menu.add(new MenuItem("Physics"));
355368 physicsItem.addActionListener(this);
....@@ -357,30 +370,29 @@
357370 frameselectorItem.addActionListener(this);
358371 scriptNodeItem = menu.add(new MenuItem("Script Node"));
359372 scriptNodeItem.addActionListener(this);
360
- cameraItem = menu.add(new MenuItem("Camera"));
361
- cameraItem.addActionListener(this);
362373 }
363374
364375 oe.menuBar.add(menu = new Menu("Object"));
365
- textureItem = menu.add(new MenuItem("Texture"));
366
- textureItem.addActionListener(this);
376
+// textureItem = menu.add(new MenuItem("Texture"));
377
+// textureItem.addActionListener(this);
367378 billboardItem = menu.add(new MenuItem("Billboard"));
368379 billboardItem.addActionListener(this);
369380 csgItem = menu.add(new MenuItem("CSG"));
370381 csgItem.addActionListener(this);
371
- shadowXItem = menu.add(new MenuItem("Shadow X"));
382
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
372383 shadowXItem.addActionListener(this);
373
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
384
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
374385 shadowYItem.addActionListener(this);
375
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
386
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
376387 shadowZItem.addActionListener(this);
388
+ attributeItem = menu.add(new MenuItem("Attribute"));
389
+ attributeItem.addActionListener(this);
390
+
377391 if (Globals.ADVANCED)
378392 {
379393 menu.add("-");
380394 linkerItem = menu.add(new MenuItem("Linker"));
381395 linkerItem.addActionListener(this);
382
- attributeItem = menu.add(new MenuItem("Attribute"));
383
- attributeItem.addActionListener(this);
384396 templateItem = menu.add(new MenuItem("Template"));
385397 templateItem.addActionListener(this);
386398 pointflowItem = menu.add(new MenuItem("Point Flow"));
....@@ -469,6 +481,14 @@
469481 markleavesItem.addActionListener(this);
470482 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
471483 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);
472492 menu.add("-");
473493 flipVItem = menu.add(new MenuItem("Flip V"));
474494 flipVItem.addActionListener(this);
....@@ -524,8 +544,21 @@
524544 buildToolsMenu(menu);
525545 }
526546
547
+
527548 void SetupUI2(ObjEditor oe)
528549 {
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
+
529562 //new Exception().printStackTrace();
530563
531564 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -554,27 +587,79 @@
554587 oe.radioPanel.add(dummyButton);
555588 oe.buttonGroup.add(dummyButton);
556589 */
590
+ cGridBag copyOptionsPanel = new cGridBag();
591
+
592
+ copyOptionsPanel.preferredHeight = 1;
593
+
557594 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
558595
559
- 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);
560647 liveCB.setToolTipText("Enable animation");
561648 liveCB.addItemListener(this);
562649
563
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
650
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
564651 oneStepButton.setToolTipText("Animate one step forward");
565652 oneStepButton.addActionListener(this);
566653
567
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
654
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
568655 fastCB.setToolTipText("Fast mode");
569656 fastCB.addItemListener(this);
570657
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);
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);
578663
579664 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
580665 // screenfitpointButton.addActionListener(this);
....@@ -586,65 +671,145 @@
586671 snapobjectButton.setToolTipText("Snap Object");
587672 }
588673
589
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
590
- flashSelectionButton.setToolTipText("Show selection");
591
- flashSelectionButton.addActionListener(this);
674
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
592675
593
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
594
-
595
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
676
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596677 twoButton.setToolTipText("Show center view only");
597678 twoButton.addActionListener(this);
598
- 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);
599682 fourButton.addActionListener(this);
600683 fourButton.setToolTipText("Show left panel only");
601
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
684
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602685 sixButton.setToolTipText("2-column layout left");
603686 sixButton.addActionListener(this);
604
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
687
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
605688 threeButton.setToolTipText("2-column layout right");
606689 threeButton.addActionListener(this);
607
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
690
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608691 sevenButton.setToolTipText("3-column layout");
609692 sevenButton.addActionListener(this);
610693 //
611694
612
- 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);
613696 rootButton.setToolTipText("Edit selection in new tab");
614697 rootButton.addActionListener(this);
615698
616
- 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);
617700 closeButton.setToolTipText("Close tab");
618701 closeButton.addActionListener(this);
619702 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
620703 //clearButton.addActionListener(this);
621
-
622
- 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
+ }
623736
624
- commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
625
- 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");
626786 editButton.addActionListener(this);
627787
628
- commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629
- uneditButton.setToolTipText("Unedit selection");
788
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
789
+ uneditButton.setToolTipText("Remove selection controls");
630790 uneditButton.addActionListener(this);
631791
632
- commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
633
- allParamsButton.setToolTipText("Edit all params");
792
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
793
+ allParamsButton.setToolTipText("Show all controle");
634794 allParamsButton.addActionListener(this);
635795
636
- commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
796
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
637797 clearPanelButton.setToolTipText("Clear edit panel");
638798 clearPanelButton.addActionListener(this);
639799
640
- commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
800
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
641801 unselectButton.setToolTipText("Unselect");
642802 unselectButton.addActionListener(this);
643803
644
- 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);
645807
646
- oe.treePanel.add(commandsPanel);
647
- oe.treePanel.Return();
808
+ editCommandsPanel.preferredHeight = 1;
809
+
810
+ SetPinStates(false);
811
+// oe.treePanel.add(commandsPanel);
812
+// oe.treePanel.Return();
648813
649814 // oe.aConstraints.gridx += 1;
650815 // oe.aConstraints.weighty = 0;
....@@ -661,29 +826,17 @@
661826
662827 JScrollPane jSP;
663828 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
664
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
829
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
665830 ResetModel();
666831
667832 oe.treePanel.add(jSPPanel);
668833 oe.treePanel.Return();
669834
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;
685835 oe.treePanel.add(copyOptionsPanel);
686836 oe.treePanel.Return();
837
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 10, 0);
838
+ versionField = (cNumberSlider)sliderPane.getComponent(1);
839
+ sliderPane.preferredHeight = 1;
687840
688841 // mainPanel.setDividerLocation(0.5); //1.0);
689842 // mainPanel.setResizeWeight(0.5);
....@@ -712,23 +865,43 @@
712865
713866 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
714867 {
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
+
715882 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
716883 boxCB.setToolTipText("Display bounding boxes");
717884 boxCB.addItemListener(this);
718885
719886 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
720
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
887
+ zoomBoxCB.setToolTipText("Display only for wheel");
721888 zoomBoxCB.addItemListener(this);
722889
723890 if (true) // Globals.ADVANCED)
724891 {
725
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
726
- supportCB.setToolTipText("Enable rigging");
727
- 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);
728899
729900 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
730901 // localCB.addItemListener(this);
731902
903
+ panel.Return();
904
+
732905 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
733906 crowdCB.setToolTipText("Used for crowds");
734907 crowdCB.addItemListener(this);
....@@ -745,6 +918,8 @@
745918 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
746919 // speakerMocapCB.addItemListener(this);
747920
921
+ panel.Return();
922
+
748923 if (false)
749924 {
750925 // handled in scripts
....@@ -759,32 +934,72 @@
759934 //constraints.gridy += 1;
760935 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
761936 smoothfocusCB.addItemListener(this);
937
+ panel.Return();
762938 }
763939
764940 //constraints.gridx += 1;
765941 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
766942 // debugCB.addItemListener(this);
767943
944
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
945
+ trackCB.setToolTipText("Enable tracking target");
946
+ trackCB.addItemListener(this);
947
+
768948 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
949
+ oeilCB.setToolTipText("Move camera when tracking");
769950 oeilCB.addItemListener(this);
770951
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
+ {
771972 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
772973 lookAtCB.setToolTipText("Look-at target");
773974 lookAtCB.addItemListener(this);
975
+ }
774976
775977 }
776978
777979 cGridBag fill = new cGridBag();
778
-
779980 fill.preferredHeight = 200;
981
+ cGridBag fill2 = new cGridBag();
982
+ fill2.preferredHeight = 200;
983
+ cGridBag fill3 = new cGridBag();
984
+ fill3.preferredHeight = 200;
780985
781986 panel.add(fill);
987
+ panel.add(fill2);
988
+ panel.add(fill3);
782989
783990 }
784991
785992 void EditObject(Object3D obj)
786993 {
787994 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
+
7881003 radioButton.SetObject(obj);
7891004 radioButton.layout = sevenButton;
7901005 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -796,6 +1011,8 @@
7961011
7971012 void SetupViews(ObjEditor oe)
7981013 {
1014
+ theFrame = this;
1015
+
7991016 oe.SetupViews();
8001017
8011018 System.out.println("SetupViews");
....@@ -804,23 +1021,28 @@
8041021 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
8051022 }
8061023
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;
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;
8181037 // JCheckBox speakerMocapCB;
819
- JCheckBox speakerCameraCB;
820
- JCheckBox speakerFocusCB;
821
- JCheckBox debugCB;
822
- JCheckBox oeilCB;
823
- JCheckBox lookAtCB;
1038
+ cCheckBox speakerCameraCB;
1039
+ cCheckBox speakerFocusCB;
1040
+ cCheckBox debugCB;
1041
+
1042
+ cCheckBox oeilCB;
1043
+ cCheckBox shadowCB;
1044
+ cCheckBox autokeepCB;
1045
+ cCheckBox lookAtCB;
8241046
8251047 // static int COLOR = 1;
8261048 // static int MATERIAL = 2;
....@@ -828,9 +1050,9 @@
8281050
8291051 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
8301052
831
- JCheckBox colorCB;
832
- JCheckBox materialCB;
833
- JCheckBox textureCB;
1053
+ cCheckBox colorCB;
1054
+ cCheckBox materialCB;
1055
+ cCheckBox textureCB;
8341056
8351057 public void itemStateChanged(ItemEvent e)
8361058 {
....@@ -858,6 +1080,7 @@
8581080 } else if(e.getSource() == liveCB)
8591081 {
8601082 cameraView.ToggleLive();
1083
+ refreshContents(false);
8611084 }
8621085 else if(e.getSource() == supportCB)
8631086 {
....@@ -922,6 +1145,18 @@
9221145 {
9231146 cameraView.ToggleOeil();
9241147 }
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
+ }
9251160 else if(e.getSource() == lookAtCB)
9261161 {
9271162 cameraView.ToggleLookAt();
....@@ -938,7 +1173,8 @@
9381173
9391174 /**/
9401175 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
941
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1176
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1177
+ TreePath path = objEditor.jTree.getSelectionPath();
9421178 if ((path == null) || (path.getPathCount() <= 1)) {
9431179 // We can't move the root node or an empty selection
9441180 return;
....@@ -1001,8 +1237,6 @@
10011237 }
10021238 }
10031239
1004
- String string = (String) object;
1005
-
10061240 System.out.println("Transfer = " + object + "; drop : " + target);
10071241 // if( object instanceof java.io.File[])
10081242 // {
....@@ -1010,6 +1244,8 @@
10101244 // objEditor.DropFile((java.io.File[]) object, true);
10111245 // return;
10121246 // }
1247
+
1248
+ String string = object.toString();
10131249
10141250 // File path for Mac and Windows
10151251 if (string.charAt(0) == '/' || string.charAt(1) == ':')
....@@ -1055,23 +1291,33 @@
10551291
10561292 assert target == objEditor.jTree;
10571293 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1294
+ Object3D destinationLeaf;
10581295 try {
1059
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1296
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
10601297 } catch (Exception e) {
10611298 System.out.println("destinationPath : " + destinationPath);
10621299 return;
10631300 }
10641301
1065
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1302
+ for (int i=group.selection.size(); --i>=0;)
10661303 {
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
+// {
10671313 loadClipboard(true);
10681314 objEditor.jTree.setSelectionPath(destinationPath);
10691315 pasteInto(false, false);
1070
- } else {
1071
- loadClipboard(false);
1072
- objEditor.jTree.setSelectionPath(destinationPath);
1073
- pasteInto(false, false); // true); // ???
1074
- }
1316
+// } else {
1317
+// loadClipboard(false);
1318
+// objEditor.jTree.setSelectionPath(destinationPath);
1319
+// pasteInto(false, false); // true); // ???
1320
+// }
10751321 }
10761322 public void dropActionChanged(DropTargetDragEvent dtde)
10771323 // Called if the user has modified the current drop gesture
....@@ -1176,22 +1422,30 @@
11761422 {
11771423 //heightFieldItem = menu.add(new MenuItem("Height Field"));
11781424 //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);
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
+ {
11911443 kleinItem = menu.add(new MenuItem("Klein Bottle"));
11921444 kleinItem.addActionListener(this);
1193
- particleItem = menu.add(new MenuItem("Particle system"));
1194
- particleItem.addActionListener(this);
1445
+ }
1446
+
1447
+// particleItem = menu.add(new MenuItem("Particle system"));
1448
+// particleItem.addActionListener(this);
11951449 if (Globals.ADVANCED)
11961450 {
11971451 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1217,15 +1471,15 @@
12171471 }
12181472 bezierItem = menu.add(new MenuItem("Bezier Patch"));
12191473 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);
1474
+// overlayItem = menu.add(new MenuItem("Overlay"));
1475
+// overlayItem.addActionListener(this);
1476
+// lightItem = menu.add(new MenuItem("Light"));
1477
+// lightItem.addActionListener(this);
12241478 menu.add("-");
12251479 //superLoopItem = menu.add(new MenuItem("Super Loop"));
12261480 //superLoopItem.addActionListener(this);
1227
- loopItem = menu.add(new MenuItem("Loop"));
1228
- loopItem.addActionListener(this);
1481
+// loopItem = menu.add(new MenuItem("Loop"));
1482
+// loopItem.addActionListener(this);
12291483 doubleItem = menu.add(new MenuItem("Fork"));
12301484 doubleItem.addActionListener(this);
12311485 if (Globals.ADVANCED)
....@@ -1241,6 +1495,9 @@
12411495 animationItem.addItemListener(this);
12421496 animationItem.setState(Globals.ANIMATION);
12431497
1498
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1499
+ archiveItem.addActionListener(this);
1500
+
12441501 menu.add("-");
12451502 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
12461503 parseverticesItem.addActionListener(this);
....@@ -1253,6 +1510,8 @@
12531510 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
12541511 reduce34MorphItem.addActionListener(this);
12551512 menu.add("-");
1513
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1514
+ memoryItem.addActionListener(this);
12561515 menu.add(computeAOItem = new MenuItem("Compute AO"));
12571516 computeAOItem.addActionListener(this);
12581517
....@@ -1261,11 +1520,9 @@
12611520 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
12621521 mirrorItem.addActionListener(this);
12631522 menu.add("-");
1264
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1265
- memoryItem.addActionListener(this);
12661523 menu.add(analyzeItem = new MenuItem("Analyze"));
12671524 analyzeItem.addActionListener(this);
1268
- menu.add(dumpItem = new MenuItem("Dump"));
1525
+ menu.add(dumpItem = new MenuItem("Print"));
12691526 dumpItem.addActionListener(this);
12701527 // menu.add(pathItem = new MenuItem("From-to path"));
12711528 // pathItem.addActionListener(this);
....@@ -1406,9 +1663,24 @@
14061663 shadow.material = new cMaterial(obj.material);
14071664 shadow.material.diffuse = 0.0001f;
14081665 shadow.material.specular = 0.0001f;
1666
+ //shadow.projectedVertices[1].x = 300;
14091667
14101668 makeSomething(shadow);
14111669 }
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
+ }
14121684
14131685 /**
14141686 * applyExample
....@@ -1653,7 +1925,7 @@
16531925 {
16541926 ScreenFit();
16551927 } else
1656
- if (source == switchItem)
1928
+ if (source == switchViewItem)
16571929 {
16581930 cVector v1 = new cVector();
16591931 cVector v2 = new cVector();
....@@ -1662,11 +1934,11 @@
16621934 objEditor.cameraView.renderCamera.setAim(v2, v1);
16631935 objEditor.cameraView.repaint();
16641936 } else
1665
- if (source == rectoidItem)
1937
+ if (source == rectoidItem || source == boxButton)
16661938 {
16671939 makeSomething(new Box());
16681940 } else
1669
- if (source == particleItem)
1941
+ if (source == particleItem || source == particlesButton)
16701942 {
16711943 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
16721944 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1745,27 +2017,27 @@
17452017
17462018 makeSomething(obj);
17472019 } else
1748
- if (source == gridItem)
2020
+ if (source == gridItem || source == gridButton)
17492021 {
17502022 makeSomething(new Grid());
17512023 } else
1752
- if (source == ellipsoidItem)
2024
+ if (source == ellipsoidItem || source == sphereButton)
17532025 {
17542026 makeSomething(new Sphere());
17552027 } else
1756
- if (source == coneItem)
2028
+ if (source == coneItem || source == coneButton)
17572029 {
17582030 makeSomething(new Cone());
17592031 } else
1760
- if (source == torusItem)
2032
+ if (source == torusItem || source == torusButton)
17612033 {
17622034 makeSomething(new Torus());
17632035 } else
1764
- if (source == superItem)
2036
+ if (source == superItem || source == superButton)
17652037 {
17662038 makeSomething(new Superellipsoid());
17672039 } else
1768
- if (source == kleinItem)
2040
+ if (source == kleinItem || source == kleinButton)
17692041 {
17702042 makeSomething(new Klein());
17712043 } else
....@@ -1785,7 +2057,7 @@
17852057 {
17862058 makeSomething(new BezierSurface());
17872059 } else
1788
- if (source == overlayItem)
2060
+ if (source == overlayItem || source == overlayButton)
17892061 {
17902062 /*
17912063 Object3D obj = new BezierSurface(5,8);
....@@ -1833,7 +2105,7 @@
18332105 s.setup();
18342106 makeSomething(s);
18352107 } else
1836
- if (source == lightItem)
2108
+ if (source == lightItem || source == lightButton)
18372109 {
18382110 makeSomething(new Light());
18392111 } else
....@@ -1883,30 +2155,30 @@
18832155
18842156 group(g);
18852157 } else
1886
- if (source == loopItem)
2158
+ if (source == loopItem || source == loopButton)
18872159 {
18882160 Composite csg = new GroupLeaf();
18892161 csg.count = 5;
18902162 group(csg);
1891
- Composite child = new cGroup();
2163
+ Composite child = new cGroup("Branch");
18922164 csg.addChild(child);
18932165 child.addChild(csg);
18942166 } else
18952167 if (source == doubleItem)
18962168 {
1897
- Composite csg = new GroupLeaf();
2169
+ Composite csg = new GroupLeaf("Fork");
18982170 csg.count = 5;
18992171 group(csg);
1900
- Composite child = new cGroup();
2172
+ Composite child = new cGroup("Branch A");
19012173 csg.addChild(child);
19022174 child.addChild(csg);
1903
- child = new cGroup();
2175
+ child = new cGroup("Branch B");
19042176 csg.addChild(child);
19052177 child.addChild(csg);
19062178 } else
19072179 if (source == tripleItem)
19082180 {
1909
- Composite csg = new GroupLeaf();
2181
+ Composite csg = new GroupLeaf("Trident");
19102182 csg.count = 4;
19112183 group(csg);
19122184 Composite child = new cGroup();
....@@ -1956,6 +2228,46 @@
19562228 {
19572229 DumpObject();
19582230 } 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
19592271 if (source == oneStepButton)
19602272 {
19612273 Globals.ONESTEP = true;
....@@ -1963,17 +2275,14 @@
19632275 } else
19642276 if (source == screenfitButton)
19652277 {
1966
- //Reload(lastConverter, lastFilename, true);
19672278 ScreenFit();
19682279 } else
19692280 if (source == screenfitpointButton)
19702281 {
1971
- //Reload(lastConverter, lastFilename, true);
19722282 ScreenFitPoint();
19732283 } else
19742284 if (source == snapobjectButton)
19752285 {
1976
- //Reload(lastConverter, lastFilename, true);
19772286 SnapObject();
19782287 } else
19792288 // if (event.getSource() == recompileButton)
....@@ -2349,9 +2658,9 @@
23492658 {
23502659 ClearSelection(true);
23512660 } else
2352
- if (source == grabItem)
2661
+ if (source == grabItem || source == groupButton)
23532662 {
2354
- group(new cGroup(), true);
2663
+ group(new cGroup(), false); // true);
23552664 } else
23562665 if (source == hideItem)
23572666 {
....@@ -2369,11 +2678,11 @@
23692678 {
23702679 makeSomething(new Camera());
23712680 } else
2372
- if (source == compositeItem)
2681
+ if (source == compositeItem || source == compositeButton)
23732682 {
23742683 group(new Composite());
23752684 } else
2376
- if (source == randomItem)
2685
+ if (source == switchItem || source == switchButton)
23772686 {
23782687 RandomNode random = new RandomNode();
23792688 group(random);
....@@ -2475,7 +2784,7 @@
24752784 {
24762785 group(new cLinker());
24772786 } else
2478
- if (source == textureItem)
2787
+ if (source == textureItem || source == textureButton)
24792788 {
24802789 group(new TextureNode());
24812790 } else
....@@ -2495,17 +2804,30 @@
24952804 {
24962805 CastShadow(2);
24972806 } else
2498
- if (source == ungroupItem)
2807
+ if (source == ungroupItem || source == ungroupButton)
24992808 {
2500
- //ungroup();
2809
+ boolean hasRoot = false;
2810
+
25012811 for (int i=0; i<group.selection.size(); i++)
25022812 {
2503
- Ungroup(group.selection.get(i));
2813
+ if (group.selection.get(i) == group)
2814
+ {
2815
+ hasRoot = true;
2816
+ break;
2817
+ }
25042818 }
25052819
2506
- ClearSelection(false);
2507
-
2508
- 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
+ }
25092831 } else
25102832 if (source == genUVItem)
25112833 {
....@@ -2517,7 +2839,7 @@
25172839 } else
25182840 if (source == genNormalsMESHItem)
25192841 {
2520
- GenNormals(true); // TODO
2842
+ GenNormalsMESH();
25212843 } else
25222844 if (source == genNormalsORGANItem)
25232845 {
....@@ -2582,6 +2904,22 @@
25822904 if (source == unmarkleavesItem)
25832905 {
25842906 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);
25852923 } else
25862924 if (source == flipVItem)
25872925 {
....@@ -2817,6 +3155,10 @@
28173155 if (source == twoButton)
28183156 {
28193157 radio.layout = twoButton;
3158
+
3159
+ if (CameraPane.FULLSCREEN)
3160
+ fullscreenLayout = radio.layout;
3161
+
28203162 // bug
28213163 //gridPanel.setDividerLocation(1.0);
28223164 //bigPanel.setDividerLocation(0.0);
....@@ -2849,10 +3191,31 @@
28493191 bigThree.ClearUI();
28503192 bigThree.add(centralPanel);
28513193 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
+
28523212 } else
28533213 if (source == threeButton)
28543214 {
28553215 radio.layout = threeButton;
3216
+
3217
+ if (CameraPane.FULLSCREEN)
3218
+ fullscreenLayout = radio.layout;
28563219
28573220 // bigThree.remove(scenePanel);
28583221 // bigThree.remove(centralPanel);
....@@ -2885,10 +3248,15 @@
28853248 bigThree.add(centralPanel);
28863249 bigThree.add(XYZPanel);
28873250 bigThree.FlushUI();
3251
+
3252
+ cameraView.requestFocusInWindow();
28883253 } else
28893254 if (source == fourButton)
28903255 {
28913256 radio.layout = fourButton;
3257
+
3258
+ if (CameraPane.FULLSCREEN)
3259
+ fullscreenLayout = radio.layout;
28923260
28933261 // bigThree.remove(scenePanel);
28943262 // bigThree.remove(centralPanel);
....@@ -2920,10 +3288,15 @@
29203288 bigThree.ClearUI();
29213289 bigThree.add(scenePanel);
29223290 bigThree.FlushUI();
3291
+
3292
+ cameraView.requestFocusInWindow();
29233293 } else
29243294 if (source == sixButton)
29253295 {
29263296 radio.layout = sixButton;
3297
+
3298
+ if (CameraPane.FULLSCREEN)
3299
+ fullscreenLayout = radio.layout;
29273300
29283301 // bigThree.remove(scenePanel);
29293302 // bigThree.remove(centralPanel);
....@@ -2956,10 +3329,15 @@
29563329 bigThree.add(scenePanel);
29573330 bigThree.add(centralPanel);
29583331 bigThree.FlushUI();
3332
+
3333
+ cameraView.requestFocusInWindow();
29593334 } else
29603335 if (source == sevenButton)
29613336 {
29623337 radio.layout = sevenButton;
3338
+
3339
+ if (CameraPane.FULLSCREEN)
3340
+ fullscreenLayout = radio.layout;
29633341
29643342 // bigThree.remove(scenePanel);
29653343 // bigThree.remove(centralPanel);
....@@ -2993,6 +3371,8 @@
29933371 bigThree.add(centralPanel);
29943372 bigThree.add(XYZPanel);
29953373 bigThree.FlushUI();
3374
+
3375
+ cameraView.requestFocusInWindow();
29963376 } else
29973377 if (source == rootButton)
29983378 {
....@@ -3004,6 +3384,7 @@
30043384 EditObject(obj);
30053385 }
30063386
3387
+ cameraView.requestFocusInWindow();
30073388 refreshContents(true);
30083389 } else
30093390 if (source == closeButton)
....@@ -3013,22 +3394,37 @@
30133394 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
30143395 {
30153396 ab = (cRadio)e.nextElement();
3016
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3397
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
30173398 {
3399
+ // Patch to avoid bug with transparency.
3400
+ if (!ab.hadMaterial)
3401
+ {
3402
+ ab.object.material = null;
3403
+ }
3404
+
30183405 buttonGroup.remove(ab);
30193406 radioPanel.remove(ab);
30203407
3021
- ab.GetObject().editWindow = null;
3408
+ //ab.GetObject().editWindow = null;
3409
+ ab.GetObject().manipWindow = null;
30223410 // ab.GetObject().objectUI = null; // ?????????
30233411
30243412 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
30253413 break;
30263414 }
30273415 }
3416
+
3417
+ cameraView.requestFocusInWindow();
30283418 refreshContents(true);
30293419 } else
30303420 if (source == editItem || source == editButton)
30313421 {
3422
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3423
+ {
3424
+ Object3D child = (Object3D)e.nextElement();
3425
+ child.pinned = true;
3426
+ }
3427
+
30323428 EditSelection(false);
30333429 } else
30343430 if (source == uneditButton)
....@@ -3038,10 +3434,11 @@
30383434 Object3D child = (Object3D)e.nextElement();
30393435 if(child.editWindow != null)
30403436 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3437
+ child.pinned = false;
30413438 child.CloseUI();
30423439 listUI.remove(child);
30433440
3044
- child.editWindow = null; // ???????????
3441
+ //child.editWindow = null; // ???????????
30453442 }
30463443 objEditor.ctrlPanel.FlushUI();
30473444 //objEditor.jTree.clearSelection();
....@@ -3054,6 +3451,7 @@
30543451 //copy.ClearUI();
30553452 for (Object3D obj : listUI)
30563453 {
3454
+ obj.pinned = false;
30573455 obj.CloseUI();
30583456 }
30593457 listUI.clear();
....@@ -3063,7 +3461,7 @@
30633461 {
30643462 assert(copy == group);
30653463
3066
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3464
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
30673465
30683466 for (Object3D obj : listUI)
30693467 {
....@@ -3112,6 +3510,9 @@
31123510 }
31133511
31143512 copy = group;
3513
+
3514
+ SetUndoStates();
3515
+
31153516 //Globals.theRenderer.object = group;
31163517 if(!useclient)
31173518 {
....@@ -3128,7 +3529,9 @@
31283529 sideView.object = group;
31293530 }
31303531
3131
-// fix "+" issue group.editWindow = this;
3532
+// fix "+" issue
3533
+ //group.editWindow = this;
3534
+ group.manipWindow = this;
31323535
31333536 /*
31343537 currentLayout = radio.layout;
....@@ -3136,18 +3539,25 @@
31363539 currentLayout = sevenButton;
31373540 */
31383541 radio.layout.doClick();
3542
+
3543
+ ClearUnpinned();
3544
+ SetPinStates(group.selection.size() > 0);
3545
+ if (group.selection.size() == 1)
3546
+ EditSelection(false);
31393547 keepparent = group.parent;
31403548 // PARENT = NULL or not???
31413549 //group.parent = null; // ROOT
31423550 //group.attributes = -1;
31433551 ResetModel();
3552
+
3553
+ cameraView.requestFocusInWindow();
31443554 refreshContents(true);
31453555 } else if (event.getSource() == editCameraItem)
31463556 {
31473557 cameraView.ProtectCamera();
31483558 cameraView.repaint();
31493559 return;
3150
- } else if (event.getSource() == revertCameraItem)
3560
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
31513561 {
31523562 cameraView.RevertCamera();
31533563 cameraView.repaint();
....@@ -3164,7 +3574,6 @@
31643574 }
31653575
31663576 boolean useclient = false;
3167
- cRadio radio;
31683577
31693578 void ToggleRoot()
31703579 {
....@@ -3403,7 +3812,8 @@
34033812
34043813 int size = obj.MemorySize();
34053814
3406
- 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)");
34073817 }
34083818 }
34093819 catch (Exception e)
....@@ -3484,6 +3894,13 @@
34843894 void GenNormals(boolean crease)
34853895 {
34863896 group.GenNormalsS(crease);
3897
+
3898
+ refreshContents();
3899
+ }
3900
+
3901
+ void GenNormalsMESH()
3902
+ {
3903
+ group.GenNormalsMeshS();
34873904
34883905 refreshContents();
34893906 }
....@@ -4111,6 +4528,18 @@
41114528 refreshContents();
41124529 }
41134530
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
+
41144543 void SetTexRes(int tr)
41154544 {
41164545 group.selection.SetTexRes(tr);
....@@ -4182,10 +4611,6 @@
41824611 // }
41834612 // }
41844613
4185
- static boolean allparams = true;
4186
-
4187
- static Vector<Object3D> listUI = new Vector<Object3D>();
4188
-
41894614 void EditSelection(boolean newWindow)
41904615 {
41914616 // aConstraints.gridy = 0;
....@@ -4193,7 +4618,7 @@
41934618 {
41944619 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
41954620 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4196
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4621
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
41974622
41984623 Object3D elem = (Object3D)group.selection.elementAt(i);
41994624 if(elem != group || !newWindow)
....@@ -4278,7 +4703,8 @@
42784703 //new Exception().printStackTrace();
42794704
42804705 freezemodel = true;
4281
-
4706
+ ClearUnpinned();
4707
+
42824708 /**/
42834709 //switch (event.id)
42844710 {
....@@ -4286,7 +4712,6 @@
42864712 //case 702: // Event.LIST_DESELECT
42874713 group.deselectAll();
42884714 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4289
- objEditor.ClearInfo(); // .GetMaterial());
42904715 if (tps != null)
42914716 {
42924717 for (int i=0; i < tps.length; i++)
....@@ -4295,10 +4720,8 @@
42954720
42964721 //if (child.parent != null)
42974722 //child.parent.addSelectee(child);
4723
+ objEditor.SetMaterial(child);
42984724 group.addSelectee(child);
4299
- objEditor.SetMaterial(child); // .GetMaterial());
4300
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4301
- System.err.println("info : " + child.GetPath());
43024725 }
43034726 }
43044727 // else
....@@ -4308,17 +4731,13 @@
43084731 // System.err.println("info : " + group.GetPath());
43094732 // }
43104733
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))
4734
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
43164735 CameraPane.flash = true;
43174736
4318
- if (tps != null && tps.length > 0 && object instanceof Camera)
4737
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
43194738 // a camera
43204739 {
4321
- if (object != Globals.theRenderer.LightCamera())
4740
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
43224741 {
43234742 CameraPane.camerachangeframe = 0; // don't refuse it
43244743 Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
....@@ -4327,6 +4746,13 @@
43274746 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
43284747 }
43294748
4749
+ if (tps != null && tps.length == 1)
4750
+ {
4751
+ EditSelection(false);
4752
+ }
4753
+
4754
+ SetPinStates(tps != null && tps.length > 0);
4755
+
43304756 refreshContents();
43314757 //return true;
43324758 }
....@@ -4335,6 +4761,35 @@
43354761
43364762 freezemodel = false;
43374763 }
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
+ }
43384793
43394794 void linkSomething(Object3D thing)
43404795 {
....@@ -4406,6 +4861,7 @@
44064861 {
44074862 if (group.selection.isEmpty())
44084863 return;
4864
+
44094865 Grafreed.clipboardIsTempGroup = false;
44104866 Composite tGroup = null;
44114867 if (group.selection.size() > 0) // 1)
....@@ -4416,6 +4872,8 @@
44164872
44174873 if (cut)
44184874 {
4875
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4876
+// Save();
44194877 //int indices[] = jList.getSelectedIndices();
44204878 //for (int i = indices.length - 1; i >= 0; i--)
44214879 //jList.remove(indices[i]);
....@@ -4505,8 +4963,10 @@
45054963 }
45064964
45074965 }
4966
+
45084967 if (Grafreed.clipboardIsTempGroup)
45094968 Grafreed.clipboard = tGroup;
4969
+
45104970 if (cut)
45114971 {
45124972 ResetModel();
....@@ -4516,6 +4976,10 @@
45164976
45174977 void paste(boolean expand)
45184978 {
4979
+ if (Globals.REPLACEONMAKE)
4980
+ Save();
4981
+ boolean keep = Globals.REPLACEONMAKE;
4982
+ Globals.REPLACEONMAKE = false;
45194983 // if (GrafreeD.clipboard == null)
45204984 // return;
45214985 boolean first = true;
....@@ -4575,6 +5039,7 @@
45755039 Grafreed.clipboard.get(0).parent = keepparent;
45765040 }
45775041
5042
+ Globals.REPLACEONMAKE = keep;
45785043 ResetModel();
45795044 refreshContents();
45805045 }
....@@ -4710,6 +5175,10 @@
47105175
47115176 void group(Object3D csg, boolean grab)
47125177 {
5178
+ if (Globals.REPLACEONMAKE)
5179
+ Save();
5180
+ boolean keep = Globals.REPLACEONMAKE;
5181
+ Globals.REPLACEONMAKE = false;
47135182 if (//false) // why??
47145183 !group.selection.isEmpty())
47155184 {
....@@ -4823,10 +5292,15 @@
48235292 //node.add(csg);
48245293 //makeSomething(node);
48255294 makeSomething(csg);
5295
+ Globals.REPLACEONMAKE = keep;
48265296 }
48275297
48285298 void Ungroup(Object3D g)
48295299 {
5300
+ if (Globals.REPLACEONMAKE)
5301
+ Save();
5302
+ boolean keep = Globals.REPLACEONMAKE;
5303
+ Globals.REPLACEONMAKE = false;
48305304 if (g instanceof HiddenObject)
48315305 {
48325306 HiddenObject h = (HiddenObject) g;
....@@ -4843,6 +5317,7 @@
48435317 objEditor.makeSomething(g.get(i), false);
48445318 }
48455319 }
5320
+ Globals.REPLACEONMAKE = keep;
48465321 }
48475322
48485323 void ungroup()
....@@ -5131,7 +5606,28 @@
51315606 cButton clearpanelButton;
51325607 cButton unselectButton;
51335608
5609
+ cButton restoreCameraButton;
5610
+
5611
+ cButton saveButton;
51345612 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;
51355631
51365632 cButton screenfitButton;
51375633 cButton screenfitpointButton;
....@@ -5144,14 +5640,6 @@
51445640
51455641 cButton setsupportButton;
51465642
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
-
51555643 //
51565644 //Composite
51575645 Object3D // to do !!
....@@ -5161,11 +5649,11 @@
51615649 //JTree jTree;
51625650 private MenuItem lookAtItem;
51635651 private MenuItem lookFromItem;
5164
- private MenuItem switchItem;
5652
+ private MenuItem switchViewItem;
51655653 private MenuItem cutItem;
51665654 private MenuItem undoItem;
51675655 private MenuItem redoItem;
5168
- private MenuItem duplicateItem;
5656
+ private JMenuItem duplicateItem;
51695657 private MenuItem cloneItem;
51705658 private MenuItem cloneSupportItem;
51715659 private MenuItem overwriteGeoItem;
....@@ -5228,6 +5716,10 @@
52285716 private MenuItem showleavesItem;
52295717 private MenuItem markleavesItem;
52305718 private MenuItem unmarkleavesItem;
5719
+ private MenuItem rewindleavesItem;
5720
+ private MenuItem unrewindleavesItem;
5721
+ private MenuItem randomleavesItem;
5722
+ private MenuItem unrandomleavesItem;
52315723
52325724 private MenuItem flipVItem;
52335725 private MenuItem unflipVItem;
....@@ -5249,7 +5741,7 @@
52495741 private MenuItem frontItem;
52505742 private MenuItem cameraItem;
52515743 private MenuItem compositeItem;
5252
- private MenuItem randomItem;
5744
+ private MenuItem switchItem;
52535745 private MenuItem physicsItem;
52545746 private MenuItem frameselectorItem;
52555747 private MenuItem scriptNodeItem;
....@@ -5323,5 +5815,5 @@
53235815
53245816 Menu cameraMenu;
53255817 MenuItem editCameraItem;
5326
- MenuItem revertCameraItem;
5818
+ MenuItem restoreCameraItem;
53275819 }