Normand Briere
2019-07-14 bc829f47837b5a001f911542140b0b8e63c2bb0c
GroupEditor.java
....@@ -84,6 +84,10 @@
8484
8585 void CloneSelection(boolean supports)
8686 {
87
+ if (Globals.SAVEONMAKE)
88
+ Save();
89
+ boolean keep = Globals.SAVEONMAKE;
90
+ Globals.SAVEONMAKE = 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.SAVEONMAKE = keep;
97102 }
98103
99104 void CloneClipboard(boolean supports)
....@@ -380,14 +385,14 @@
380385 shadowYItem.addActionListener(this);
381386 shadowZItem = menu.add(new MenuItem("Shadow Blue"));
382387 shadowZItem.addActionListener(this);
388
+ attributeItem = menu.add(new MenuItem("Attribute"));
389
+ attributeItem.addActionListener(this);
383390
384391 if (Globals.ADVANCED)
385392 {
386393 menu.add("-");
387394 linkerItem = menu.add(new MenuItem("Linker"));
388395 linkerItem.addActionListener(this);
389
- attributeItem = menu.add(new MenuItem("Attribute"));
390
- attributeItem.addActionListener(this);
391396 templateItem = menu.add(new MenuItem("Template"));
392397 templateItem.addActionListener(this);
393398 pointflowItem = menu.add(new MenuItem("Point Flow"));
....@@ -971,7 +976,7 @@
971976 {
972977 cRadio radioButton = new cRadio(obj.name);
973978
974
- // Patch to avoid bug with transparency.
979
+ // June 2019. Patch to avoid bug with transparency.
975980 radioButton.hadMaterial = obj.material != null;
976981 if (!radioButton.hadMaterial)
977982 {
....@@ -1223,7 +1228,7 @@
12231228 // return;
12241229 // }
12251230
1226
- String string = (String) object;
1231
+ String string = object.toString();
12271232
12281233 // File path for Mac and Windows
12291234 if (string.charAt(0) == '/' || string.charAt(1) == ':')
....@@ -1488,6 +1493,8 @@
14881493 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
14891494 reduce34MorphItem.addActionListener(this);
14901495 menu.add("-");
1496
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1497
+ memoryItem.addActionListener(this);
14911498 menu.add(computeAOItem = new MenuItem("Compute AO"));
14921499 computeAOItem.addActionListener(this);
14931500
....@@ -1496,8 +1503,6 @@
14961503 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
14971504 mirrorItem.addActionListener(this);
14981505 menu.add("-");
1499
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1500
- memoryItem.addActionListener(this);
15011506 menu.add(analyzeItem = new MenuItem("Analyze"));
15021507 analyzeItem.addActionListener(this);
15031508 menu.add(dumpItem = new MenuItem("Print"));
....@@ -4833,8 +4838,8 @@
48334838
48344839 if (cut)
48354840 {
4836
- if (Globals.SAVEONMAKE)
4837
- Save();
4841
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4842
+// Save();
48384843 //int indices[] = jList.getSelectedIndices();
48394844 //for (int i = indices.length - 1; i >= 0; i--)
48404845 //jList.remove(indices[i]);
....@@ -4937,6 +4942,10 @@
49374942
49384943 void paste(boolean expand)
49394944 {
4945
+ if (Globals.SAVEONMAKE)
4946
+ Save();
4947
+ boolean keep = Globals.SAVEONMAKE;
4948
+ Globals.SAVEONMAKE = false;
49404949 // if (GrafreeD.clipboard == null)
49414950 // return;
49424951 boolean first = true;
....@@ -4996,6 +5005,7 @@
49965005 Grafreed.clipboard.get(0).parent = keepparent;
49975006 }
49985007
5008
+ Globals.SAVEONMAKE = keep;
49995009 ResetModel();
50005010 refreshContents();
50015011 }
....@@ -5131,6 +5141,10 @@
51315141
51325142 void group(Object3D csg, boolean grab)
51335143 {
5144
+ if (Globals.SAVEONMAKE)
5145
+ Save();
5146
+ boolean keep = Globals.SAVEONMAKE;
5147
+ Globals.SAVEONMAKE = false;
51345148 if (//false) // why??
51355149 !group.selection.isEmpty())
51365150 {
....@@ -5244,10 +5258,15 @@
52445258 //node.add(csg);
52455259 //makeSomething(node);
52465260 makeSomething(csg);
5261
+ Globals.SAVEONMAKE = keep;
52475262 }
52485263
52495264 void Ungroup(Object3D g)
52505265 {
5266
+ if (Globals.SAVEONMAKE)
5267
+ Save();
5268
+ boolean keep = Globals.SAVEONMAKE;
5269
+ Globals.SAVEONMAKE = false;
52515270 if (g instanceof HiddenObject)
52525271 {
52535272 HiddenObject h = (HiddenObject) g;
....@@ -5264,6 +5283,7 @@
52645283 objEditor.makeSomething(g.get(i), false);
52655284 }
52665285 }
5286
+ Globals.SAVEONMAKE = keep;
52675287 }
52685288
52695289 void ungroup()