From bc829f47837b5a001f911542140b0b8e63c2bb0c Mon Sep 17 00:00:00 2001
From: Normand Briere <nbriere@noware.ca>
Date: Sun, 14 Jul 2019 19:47:03 -0400
Subject: [PATCH] Fix extract big data.

---
 GroupEditor.java |   36 ++++++++++++++++++++++++++++--------
 1 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/GroupEditor.java b/GroupEditor.java
index 84ed69e..ec26bdb 100644
--- a/GroupEditor.java
+++ b/GroupEditor.java
@@ -84,6 +84,10 @@
 
     void CloneSelection(boolean supports)
     {
+        if (Globals.SAVEONMAKE)
+            Save();
+        boolean keep = Globals.SAVEONMAKE;
+        Globals.SAVEONMAKE = false;
         //   Object3D keep = GrafreeD.clipboard;
            //Object3D obj;
            for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
@@ -94,6 +98,7 @@
                
                makeSomething(clone, i==group.selection.size()-1);
            }
+        Globals.SAVEONMAKE = keep;
     }
 
     void CloneClipboard(boolean supports)
@@ -380,14 +385,14 @@
 		shadowYItem.addActionListener(this);
                 shadowZItem = menu.add(new MenuItem("Shadow Blue"));
 		shadowZItem.addActionListener(this);
+		attributeItem = menu.add(new MenuItem("Attribute"));
+		attributeItem.addActionListener(this);
                 
         if (Globals.ADVANCED)
         {
 		menu.add("-");
 		linkerItem = menu.add(new MenuItem("Linker"));
 		linkerItem.addActionListener(this);
-		attributeItem = menu.add(new MenuItem("Attribute"));
-		attributeItem.addActionListener(this);
 		templateItem = menu.add(new MenuItem("Template"));
 		templateItem.addActionListener(this);
 		pointflowItem = menu.add(new MenuItem("Point Flow"));
@@ -971,7 +976,7 @@
         {
             cRadio radioButton = new cRadio(obj.name);
             
-            // Patch to avoid bug with transparency.
+            // June 2019. Patch to avoid bug with transparency.
             radioButton.hadMaterial = obj.material != null;
             if (!radioButton.hadMaterial)
             {
@@ -1223,7 +1228,7 @@
 //                        return;
 //                    }
                     
-                    String string = (String) object;
+                    String string = object.toString();
                     
                     // File path for Mac and Windows
                     if (string.charAt(0) == '/' || string.charAt(1) == ':')
@@ -1488,6 +1493,8 @@
 		reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
 		reduce34MorphItem.addActionListener(this);
 		menu.add("-");
+		menu.add(memoryItem = new MenuItem("Memory Usage"));
+		memoryItem.addActionListener(this);
 		menu.add(computeAOItem = new MenuItem("Compute AO"));
 		computeAOItem.addActionListener(this);
                 
@@ -1496,8 +1503,6 @@
 		mirrorItem = menu.add(new MenuItem("Mirror Poses"));
 		mirrorItem.addActionListener(this);
 		menu.add("-");
-		menu.add(memoryItem = new MenuItem("Memory Usage"));
-		memoryItem.addActionListener(this);
 		menu.add(analyzeItem = new MenuItem("Analyze"));
 		analyzeItem.addActionListener(this);
 		menu.add(dumpItem = new MenuItem("Print"));
@@ -4833,8 +4838,8 @@
                 
 		if (cut)
 		{
-        if (Globals.SAVEONMAKE)
-                    Save();
+//        if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
+//                    Save();
 			//int indices[] = jList.getSelectedIndices();
 			//for (int i = indices.length - 1; i >= 0; i--)
 			//jList.remove(indices[i]);
@@ -4937,6 +4942,10 @@
 	
 	void paste(boolean expand)
 	{
+        if (Globals.SAVEONMAKE)
+            Save();
+        boolean keep = Globals.SAVEONMAKE;
+        Globals.SAVEONMAKE = false;
 	//	if (GrafreeD.clipboard == null)
 	//		return;
 		boolean first = true;
@@ -4996,6 +5005,7 @@
                         Grafreed.clipboard.get(0).parent = keepparent;
 		}
 		
+        Globals.SAVEONMAKE = keep;
 		ResetModel();
 		refreshContents();
 	}
@@ -5131,6 +5141,10 @@
         
 	void group(Object3D csg, boolean grab)
 	{
+        if (Globals.SAVEONMAKE)
+            Save();
+        boolean keep = Globals.SAVEONMAKE;
+        Globals.SAVEONMAKE = false;
 		if (//false) // why??
                     !group.selection.isEmpty())
                 {
@@ -5244,10 +5258,15 @@
                 //node.add(csg);
 		//makeSomething(node);
 		makeSomething(csg);
+        Globals.SAVEONMAKE = keep;
 	}
 	
         void Ungroup(Object3D g)
         {
+        if (Globals.SAVEONMAKE)
+            Save();
+        boolean keep = Globals.SAVEONMAKE;
+        Globals.SAVEONMAKE = false;
             if (g instanceof HiddenObject)
             {
                 HiddenObject h = (HiddenObject) g;
@@ -5264,6 +5283,7 @@
                     objEditor.makeSomething(g.get(i), false);
                 }
             }
+        Globals.SAVEONMAKE = keep;
         }
         
 	void ungroup()

--
Gitblit v1.6.2