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 | 61 +++++++++++++++++++++--------- 1 files changed, 42 insertions(+), 19 deletions(-) diff --git a/GroupEditor.java b/GroupEditor.java index 776ef38..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) == ':') @@ -1472,6 +1478,9 @@ animationItem.addItemListener(this); animationItem.setState(Globals.ANIMATION); + menu.add(archiveItem = new MenuItem("Archive3D...")); + archiveItem.addActionListener(this); + menu.add("-"); parseverticesItem = menu.add(new MenuItem("Multiplicity")); parseverticesItem.addActionListener(this); @@ -1484,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); @@ -1492,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")); @@ -2216,7 +2225,8 @@ } else if (source == undoButton) { - Undo(); + if (!Undo()) + java.awt.Toolkit.getDefaultToolkit().beep(); } else if (source == redoButton) { @@ -2224,7 +2234,8 @@ } else if (source == saveButton) { - Save(); + if (!Save(true)) + java.awt.Toolkit.getDefaultToolkit().beep(); } else if (source == oneStepButton) { @@ -2233,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) @@ -4731,7 +4739,7 @@ void refreshContents(boolean cp) { if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) - if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING) + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) { objEditor.ClearInfo(); // .GetMaterial()); @@ -4830,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]); @@ -4934,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; @@ -4993,6 +5005,7 @@ Grafreed.clipboard.get(0).parent = keepparent; } + Globals.SAVEONMAKE = keep; ResetModel(); refreshContents(); } @@ -5128,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()) { @@ -5241,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; @@ -5261,6 +5283,7 @@ objEditor.makeSomething(g.get(i), false); } } + Globals.SAVEONMAKE = keep; } void ungroup() -- Gitblit v1.6.2