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 |   56 ++++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 38 insertions(+), 18 deletions(-)

diff --git a/GroupEditor.java b/GroupEditor.java
index dab62a9..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,13 +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"));
@@ -601,6 +607,10 @@
                 fullButton.setToolTipText("Full-screen window");
 		fullButton.addActionListener(this);
                 
+		oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
+                screenfitButton.setToolTipText("Screen fit");
+		screenfitButton.addActionListener(this);
+
 		oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
                 restoreCameraButton.setToolTipText("Restore viewpoint");
 		restoreCameraButton.addActionListener(this);
@@ -633,10 +643,6 @@
                                 
                 //oe.toolboxPanel.Return();
                 
-		copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
-                screenfitButton.setToolTipText("Screen fit");
-		screenfitButton.addActionListener(this);
-
 //                copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
 //                trackCB.setToolTipText("Enable tracking");
 //                                trackCB.addItemListener(this);
@@ -970,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)
             {
@@ -1214,8 +1220,6 @@
                         }
                     }
                     
-                    String string = (String) object;
-                    
                     System.out.println("Transfer = " + object + "; drop : " + target);
 //                    if( object instanceof java.io.File[])
 //                    {
@@ -1223,6 +1227,8 @@
 //                        objEditor.DropFile((java.io.File[]) object, true);
 //                        return;
 //                    }
+                    
+                    String string = object.toString();
                     
                     // File path for Mac and Windows
                     if (string.charAt(0) == '/' || string.charAt(1) == ':')
@@ -1487,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);
                 
@@ -1495,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"));
@@ -2219,7 +2225,8 @@
 		} else
 		if (source == undoButton)
 		{
-			Undo();
+			if (!Undo())
+                            java.awt.Toolkit.getDefaultToolkit().beep();
 		} else
 		if (source == redoButton)
 		{
@@ -2227,7 +2234,8 @@
 		} else
 		if (source == saveButton)
 		{
-			Save();
+			if (!Save(true))
+                            java.awt.Toolkit.getDefaultToolkit().beep();
 		} else
 		if (source == oneStepButton)
 		{
@@ -2236,17 +2244,14 @@
 		} else
 		if (source == screenfitButton)
 		{
-			//Reload(lastConverter, lastFilename, true);
                     ScreenFit();
 		} else
 		if (source == screenfitpointButton)
 		{
-			//Reload(lastConverter, lastFilename, true);
                     ScreenFitPoint();
 		} else
 		if (source == snapobjectButton)
 		{
-			//Reload(lastConverter, lastFilename, true);
                     SnapObject();
 		} else
 //		if (event.getSource() == recompileButton)
@@ -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