Normand Briere
2019-07-18 d7a17c35c443e2cb6c09eaa3cfeaf590a571faa1
GroupEditor.java
....@@ -60,6 +60,12 @@
6060 this.copy = this.group = group;
6161 //selectees = this.group.selectees;
6262
63
+ if (copy.versions == null)
64
+ {
65
+ copy.versions = new byte[100][];
66
+ copy.versionindex = -1;
67
+ }
68
+
6369 if(ui)
6470 SetupUI(objEditor);
6571 }
....@@ -74,6 +80,12 @@
7480 this.copy = this.group = copy;
7581 //selectees = this.group.selectees;
7682
83
+ if (copy.versions == null)
84
+ {
85
+ copy.versions = new byte[100][];
86
+ copy.versionindex = -1;
87
+ }
88
+
7789 SetupMenu2(this); //objEditor);
7890 SetupUI2(objEditor);
7991 objEditor.SetupUI(true);
....@@ -84,6 +96,10 @@
8496
8597 void CloneSelection(boolean supports)
8698 {
99
+ if (Globals.REPLACEONMAKE)
100
+ Save();
101
+ boolean keep = Globals.REPLACEONMAKE;
102
+ Globals.REPLACEONMAKE = false;
87103 // Object3D keep = GrafreeD.clipboard;
88104 //Object3D obj;
89105 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -94,6 +110,7 @@
94110
95111 makeSomething(clone, i==group.selection.size()-1);
96112 }
113
+ Globals.REPLACEONMAKE = keep;
97114 }
98115
99116 void CloneClipboard(boolean supports)
....@@ -220,7 +237,7 @@
220237 // toggleSwitchItem.addItemListener(this);
221238 // toggleSwitchItem.setState(CameraPane.SWITCH);
222239
223
- cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
240
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
224241 toggleHandleItem.addItemListener(this);
225242 toggleHandleItem.setState(CameraPane.HANDLES);
226243
....@@ -380,13 +397,14 @@
380397 shadowYItem.addActionListener(this);
381398 shadowZItem = menu.add(new MenuItem("Shadow Blue"));
382399 shadowZItem.addActionListener(this);
400
+ attributeItem = menu.add(new MenuItem("Attribute"));
401
+ attributeItem.addActionListener(this);
402
+
383403 if (Globals.ADVANCED)
384404 {
385405 menu.add("-");
386406 linkerItem = menu.add(new MenuItem("Linker"));
387407 linkerItem.addActionListener(this);
388
- attributeItem = menu.add(new MenuItem("Attribute"));
389
- attributeItem.addActionListener(this);
390408 templateItem = menu.add(new MenuItem("Template"));
391409 templateItem.addActionListener(this);
392410 pointflowItem = menu.add(new MenuItem("Point Flow"));
....@@ -538,6 +556,7 @@
538556 buildToolsMenu(menu);
539557 }
540558
559
+
541560 void SetupUI2(ObjEditor oe)
542561 {
543562 // June 2019
....@@ -582,7 +601,7 @@
582601 */
583602 cGridBag copyOptionsPanel = new cGridBag();
584603
585
- copyOptionsPanel.preferredHeight = 2;
604
+ copyOptionsPanel.preferredHeight = 1;
586605
587606 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
588607
....@@ -590,50 +609,66 @@
590609 //minButton.setToolTipText("Minimize window");
591610 //minButton.addActionListener(this);
592611
593
- oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
594
- maxButton.setToolTipText("Maximize window");
595
- maxButton.addActionListener(this);
612
+ if (Globals.ADVANCED)
613
+ {
614
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
615
+ maxButton.setToolTipText("Maximize window");
616
+ maxButton.addActionListener(this);
617
+ }
596618
597619 oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
598620 fullButton.setToolTipText("Full-screen window");
599621 fullButton.addActionListener(this);
600622
623
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
624
+ screenfitButton.setToolTipText("Screen fit");
625
+ screenfitButton.addActionListener(this);
626
+
601627 oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602628 restoreCameraButton.setToolTipText("Restore viewpoint");
603629 restoreCameraButton.addActionListener(this);
604630
631
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
632
+ saveButton.setToolTipText("New version");
633
+ saveButton.addActionListener(this);
634
+
605635 copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
606
- undoButton.setToolTipText("Undo changes");
636
+ undoButton.setToolTipText("Previous version");
607637 undoButton.addActionListener(this);
608638 undoButton.setEnabled(false);
609639
640
+ cGridBag updown = new cGridBag().setVertical(true);
641
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
642
+ restoreButton.setToolTipText("Restore current");
643
+ restoreButton.addActionListener(this);
644
+ restoreButton.setEnabled(false);
645
+
646
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
647
+ replaceButton.setToolTipText("Replace current");
648
+ replaceButton.addActionListener(this);
649
+ replaceButton.setEnabled(false);
650
+
651
+ copyOptionsPanel.add(updown);
652
+
610653 copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
611
- redoButton.setToolTipText("Redo changes");
654
+ redoButton.setToolTipText("Next version");
612655 redoButton.addActionListener(this);
613656 redoButton.setEnabled(false);
614657
615
- copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
616
- saveButton.setToolTipText("Save changes");
617
- saveButton.addActionListener(this);
618
-
619
- copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
658
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
620659 liveCB.setToolTipText("Enable animation");
621660 liveCB.addItemListener(this);
622661
623
- copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
662
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
624663 oneStepButton.setToolTipText("Animate one step forward");
625664 oneStepButton.addActionListener(this);
626665
627
- copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
666
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
628667 fastCB.setToolTipText("Fast mode");
629668 fastCB.addItemListener(this);
630669
631670 //oe.toolboxPanel.Return();
632671
633
- copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
- screenfitButton.setToolTipText("Screen fit");
635
- screenfitButton.addActionListener(this);
636
-
637672 // copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
638673 // trackCB.setToolTipText("Enable tracking");
639674 // trackCB.addItemListener(this);
....@@ -726,7 +761,7 @@
726761 compositeButton.addActionListener(this);
727762
728763 oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
729
- switchButton.setToolTipText("Create switch");
764
+ switchButton.setToolTipText("Create item switcher");
730765 switchButton.addActionListener(this);
731766
732767 oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -758,16 +793,16 @@
758793 }
759794
760795 // EDIT panel
761
- editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
762
- editButton.setToolTipText("Edit selection");
796
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
797
+ editButton.setToolTipText("Pin selection controls");
763798 editButton.addActionListener(this);
764799
765
- editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
766
- uneditButton.setToolTipText("Unedit selection");
800
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
801
+ uneditButton.setToolTipText("Remove selection controls");
767802 uneditButton.addActionListener(this);
768803
769804 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
770
- allParamsButton.setToolTipText("Edit all params");
805
+ allParamsButton.setToolTipText("Show all controle");
771806 allParamsButton.addActionListener(this);
772807
773808 editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -784,6 +819,7 @@
784819
785820 editCommandsPanel.preferredHeight = 1;
786821
822
+ SetPinStates(false);
787823 // oe.treePanel.add(commandsPanel);
788824 // oe.treePanel.Return();
789825
....@@ -810,6 +846,9 @@
810846
811847 oe.treePanel.add(copyOptionsPanel);
812848 oe.treePanel.Return();
849
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
850
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
851
+ sliderPane.preferredHeight = 1;
813852
814853 // mainPanel.setDividerLocation(0.5); //1.0);
815854 // mainPanel.setResizeWeight(0.5);
....@@ -857,14 +896,18 @@
857896 boxCB.addItemListener(this);
858897
859898 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
860
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
899
+ zoomBoxCB.setToolTipText("Display only for wheel");
861900 zoomBoxCB.addItemListener(this);
862901
863902 if (true) // Globals.ADVANCED)
864903 {
865
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
866
- supportCB.setToolTipText("Enable rigging");
867
- supportCB.addItemListener(this);
904
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
905
+// supportCB.setToolTipText("Enable rigging");
906
+// supportCB.addItemListener(this);
907
+
908
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
909
+ freezeCB.setToolTipText("Fast moving camera");
910
+ freezeCB.addItemListener(this);
868911
869912 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
870913 // localCB.addItemListener(this);
....@@ -919,7 +962,7 @@
919962 oeilCB.addItemListener(this);
920963
921964 panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
922
- shadowCB.setToolTipText("Compute shadows when live");
965
+ shadowCB.setToolTipText("When live compute shadows");
923966 shadowCB.addItemListener(this);
924967
925968 panel.Return();
....@@ -928,12 +971,12 @@
928971 toggleTextureCB.addItemListener(this);
929972
930973 panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
931
- toggleSwitchCB.setToolTipText("Use switch");
974
+ toggleSwitchCB.setToolTipText("Choose a single item");
932975 toggleSwitchCB.addItemListener(this);
933976
934
- panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
935
- autosaveCB.setToolTipText("Auto-save on structure change");
936
- autosaveCB.addItemListener(this);
977
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
978
+ autokeepCB.setToolTipText("On structure change");
979
+ autokeepCB.addItemListener(this);
937980
938981 panel.Return();
939982 if (Globals.ADVANCED)
....@@ -962,7 +1005,7 @@
9621005 {
9631006 cRadio radioButton = new cRadio(obj.name);
9641007
965
- // Patch to avoid bug with transparency.
1008
+ // June 2019. Patch to avoid bug with transparency.
9661009 radioButton.hadMaterial = obj.material != null;
9671010 if (!radioButton.hadMaterial)
9681011 {
....@@ -999,6 +1042,7 @@
9991042 cCheckBox slowCB;
10001043 cCheckBox boxCB;
10011044 cCheckBox zoomBoxCB;
1045
+ cCheckBox freezeCB;
10021046 //cToggleButton trackCB;
10031047 cCheckBox trackCB;
10041048 cCheckBox smoothfocusCB;
....@@ -1009,7 +1053,7 @@
10091053
10101054 cCheckBox oeilCB;
10111055 cCheckBox shadowCB;
1012
- cCheckBox autosaveCB;
1056
+ cCheckBox autokeepCB;
10131057 cCheckBox lookAtCB;
10141058
10151059 // static int COLOR = 1;
....@@ -1117,9 +1161,13 @@
11171161 {
11181162 Globals.COMPUTESHADOWWHENLIVE ^= true;
11191163 }
1120
- else if(e.getSource() == autosaveCB)
1164
+ else if(e.getSource() == freezeCB)
11211165 {
1122
- Globals.SAVEONMAKE ^= true;
1166
+ Globals.FREEZEONMOVE ^= true;
1167
+ }
1168
+ else if(e.getSource() == autokeepCB)
1169
+ {
1170
+ Globals.REPLACEONMAKE ^= true;
11231171 }
11241172 else if(e.getSource() == lookAtCB)
11251173 {
....@@ -1201,8 +1249,6 @@
12011249 }
12021250 }
12031251
1204
- String string = (String) object;
1205
-
12061252 System.out.println("Transfer = " + object + "; drop : " + target);
12071253 // if( object instanceof java.io.File[])
12081254 // {
....@@ -1210,6 +1256,8 @@
12101256 // objEditor.DropFile((java.io.File[]) object, true);
12111257 // return;
12121258 // }
1259
+
1260
+ String string = object.toString();
12131261
12141262 // File path for Mac and Windows
12151263 if (string.charAt(0) == '/' || string.charAt(1) == ':')
....@@ -1459,6 +1507,9 @@
14591507 animationItem.addItemListener(this);
14601508 animationItem.setState(Globals.ANIMATION);
14611509
1510
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1511
+ archiveItem.addActionListener(this);
1512
+
14621513 menu.add("-");
14631514 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
14641515 parseverticesItem.addActionListener(this);
....@@ -1471,6 +1522,8 @@
14711522 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
14721523 reduce34MorphItem.addActionListener(this);
14731524 menu.add("-");
1525
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1526
+ memoryItem.addActionListener(this);
14741527 menu.add(computeAOItem = new MenuItem("Compute AO"));
14751528 computeAOItem.addActionListener(this);
14761529
....@@ -1479,8 +1532,6 @@
14791532 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
14801533 mirrorItem.addActionListener(this);
14811534 menu.add("-");
1482
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1483
- memoryItem.addActionListener(this);
14841535 menu.add(analyzeItem = new MenuItem("Analyze"));
14851536 analyzeItem.addActionListener(this);
14861537 menu.add(dumpItem = new MenuItem("Print"));
....@@ -1628,6 +1679,20 @@
16281679
16291680 makeSomething(shadow);
16301681 }
1682
+
1683
+ private void ClearUnpinned()
1684
+ {
1685
+ //for (Object3D obj : listUI)
1686
+ for (int i=listUI.size(); --i>=0;)
1687
+ {
1688
+ Object3D obj = listUI.elementAt(i);
1689
+ if (!obj.pinned)
1690
+ {
1691
+ obj.CloseUI();
1692
+ listUI.remove(i);
1693
+ }
1694
+ }
1695
+ }
16311696
16321697 /**
16331698 * applyExample
....@@ -2107,25 +2172,25 @@
21072172 Composite csg = new GroupLeaf();
21082173 csg.count = 5;
21092174 group(csg);
2110
- Composite child = new cGroup();
2175
+ Composite child = new cGroup("Branch");
21112176 csg.addChild(child);
21122177 child.addChild(csg);
21132178 } else
21142179 if (source == doubleItem)
21152180 {
2116
- Composite csg = new GroupLeaf();
2181
+ Composite csg = new GroupLeaf("Fork");
21172182 csg.count = 5;
21182183 group(csg);
2119
- Composite child = new cGroup();
2184
+ Composite child = new cGroup("Branch A");
21202185 csg.addChild(child);
21212186 child.addChild(csg);
2122
- child = new cGroup();
2187
+ child = new cGroup("Branch B");
21232188 csg.addChild(child);
21242189 child.addChild(csg);
21252190 } else
21262191 if (source == tripleItem)
21272192 {
2128
- Composite csg = new GroupLeaf();
2193
+ Composite csg = new GroupLeaf("Trident");
21292194 csg.count = 4;
21302195 group(csg);
21312196 Composite child = new cGroup();
....@@ -2189,15 +2254,31 @@
21892254 } else
21902255 if (source == undoButton)
21912256 {
2257
+ // Go to previous version
2258
+ //if (!Undo())
2259
+ //java.awt.Toolkit.getDefaultToolkit().beep();
21922260 Undo();
2261
+ } else
2262
+ if (source == restoreButton)
2263
+ {
2264
+ // Restore current version
2265
+ Restore();
2266
+ } else
2267
+ if (source == replaceButton)
2268
+ {
2269
+ // Overwrite current version
2270
+ Replace();
21932271 } else
21942272 if (source == redoButton)
21952273 {
2274
+ // Go to next version
21962275 Redo();
21972276 } else
21982277 if (source == saveButton)
21992278 {
2200
- Save();
2279
+ // Save a new version
2280
+ if (!Save(true))
2281
+ java.awt.Toolkit.getDefaultToolkit().beep();
22012282 } else
22022283 if (source == oneStepButton)
22032284 {
....@@ -2206,17 +2287,14 @@
22062287 } else
22072288 if (source == screenfitButton)
22082289 {
2209
- //Reload(lastConverter, lastFilename, true);
22102290 ScreenFit();
22112291 } else
22122292 if (source == screenfitpointButton)
22132293 {
2214
- //Reload(lastConverter, lastFilename, true);
22152294 ScreenFitPoint();
22162295 } else
22172296 if (source == snapobjectButton)
22182297 {
2219
- //Reload(lastConverter, lastFilename, true);
22202298 SnapObject();
22212299 } else
22222300 // if (event.getSource() == recompileButton)
....@@ -2740,15 +2818,28 @@
27402818 } else
27412819 if (source == ungroupItem || source == ungroupButton)
27422820 {
2743
- //ungroup();
2821
+ boolean hasRoot = false;
2822
+
27442823 for (int i=0; i<group.selection.size(); i++)
27452824 {
2746
- Ungroup(group.selection.get(i));
2825
+ if (group.selection.get(i) == group)
2826
+ {
2827
+ hasRoot = true;
2828
+ break;
2829
+ }
27472830 }
27482831
2749
- ClearSelection(false);
2750
-
2751
- refreshContents();
2832
+ if (!hasRoot)
2833
+ {
2834
+ for (int i=0; i<group.selection.size(); i++)
2835
+ {
2836
+ Ungroup(group.selection.get(i));
2837
+ }
2838
+
2839
+ ClearSelection(false);
2840
+
2841
+ refreshContents();
2842
+ }
27522843 } else
27532844 if (source == genUVItem)
27542845 {
....@@ -3372,7 +3463,7 @@
33723463 //copy.ClearUI();
33733464 for (Object3D obj : listUI)
33743465 {
3375
- obj.pinned = true;
3466
+ obj.pinned = false;
33763467 obj.CloseUI();
33773468 }
33783469 listUI.clear();
....@@ -3431,6 +3522,9 @@
34313522 }
34323523
34333524 copy = group;
3525
+
3526
+ SetUndoStates();
3527
+
34343528 //Globals.theRenderer.object = group;
34353529 if(!useclient)
34363530 {
....@@ -3457,6 +3551,13 @@
34573551 currentLayout = sevenButton;
34583552 */
34593553 radio.layout.doClick();
3554
+
3555
+ ClearUnpinned();
3556
+ Grafreed.Assert(group != null);
3557
+ Grafreed.Assert(group.selection != null);
3558
+ SetPinStates(group.selection.size() > 0);
3559
+ if (group.selection.size() == 1)
3560
+ EditSelection(false);
34603561 keepparent = group.parent;
34613562 // PARENT = NULL or not???
34623563 //group.parent = null; // ROOT
....@@ -4616,17 +4717,7 @@
46164717 //new Exception().printStackTrace();
46174718
46184719 freezemodel = true;
4619
-
4620
- //for (Object3D obj : listUI)
4621
- for (int i=listUI.size(); --i>=0;)
4622
- {
4623
- Object3D obj = listUI.elementAt(i);
4624
- if (!obj.pinned)
4625
- {
4626
- obj.CloseUI();
4627
- listUI.remove(i);
4628
- }
4629
- }
4720
+ ClearUnpinned();
46304721
46314722 /**/
46324723 //switch (event.id)
....@@ -4689,12 +4780,14 @@
46894780 {
46904781 editButton.setEnabled(enabled);
46914782 uneditButton.setEnabled(enabled);
4783
+ unselectButton.setEnabled(enabled);
4784
+ flashSelectionButton.setEnabled(enabled);
46924785 }
46934786
46944787 void refreshContents(boolean cp)
46954788 {
46964789 if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info"))
4697
- if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING)
4790
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
46984791 {
46994792 objEditor.ClearInfo(); // .GetMaterial());
47004793
....@@ -4793,8 +4886,8 @@
47934886
47944887 if (cut)
47954888 {
4796
- if (Globals.SAVEONMAKE)
4797
- Save();
4889
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4890
+// Save();
47984891 //int indices[] = jList.getSelectedIndices();
47994892 //for (int i = indices.length - 1; i >= 0; i--)
48004893 //jList.remove(indices[i]);
....@@ -4897,6 +4990,10 @@
48974990
48984991 void paste(boolean expand)
48994992 {
4993
+ if (Globals.REPLACEONMAKE)
4994
+ Save();
4995
+ boolean keep = Globals.REPLACEONMAKE;
4996
+ Globals.REPLACEONMAKE = false;
49004997 // if (GrafreeD.clipboard == null)
49014998 // return;
49024999 boolean first = true;
....@@ -4956,6 +5053,7 @@
49565053 Grafreed.clipboard.get(0).parent = keepparent;
49575054 }
49585055
5056
+ Globals.REPLACEONMAKE = keep;
49595057 ResetModel();
49605058 refreshContents();
49615059 }
....@@ -5091,6 +5189,10 @@
50915189
50925190 void group(Object3D csg, boolean grab)
50935191 {
5192
+ if (Globals.REPLACEONMAKE)
5193
+ Save();
5194
+ boolean keep = Globals.REPLACEONMAKE;
5195
+ Globals.REPLACEONMAKE = false;
50945196 if (//false) // why??
50955197 !group.selection.isEmpty())
50965198 {
....@@ -5204,10 +5306,15 @@
52045306 //node.add(csg);
52055307 //makeSomething(node);
52065308 makeSomething(csg);
5309
+ Globals.REPLACEONMAKE = keep;
52075310 }
52085311
52095312 void Ungroup(Object3D g)
52105313 {
5314
+ if (Globals.REPLACEONMAKE)
5315
+ Save();
5316
+ boolean keep = Globals.REPLACEONMAKE;
5317
+ Globals.REPLACEONMAKE = false;
52115318 if (g instanceof HiddenObject)
52125319 {
52135320 HiddenObject h = (HiddenObject) g;
....@@ -5224,6 +5331,7 @@
52245331 objEditor.makeSomething(g.get(i), false);
52255332 }
52265333 }
5334
+ Globals.REPLACEONMAKE = keep;
52275335 }
52285336
52295337 void ungroup()
....@@ -5514,9 +5622,6 @@
55145622
55155623 cButton restoreCameraButton;
55165624
5517
- cButton minButton;
5518
- cButton maxButton;
5519
- cButton fullButton;
55205625 cButton saveButton;
55215626 cButton oneStepButton;
55225627