From: Ben Soares Date: Mon, 5 Nov 2018 16:47:41 +0000 (+0000) Subject: JAL-1988 Investigating... X-Git-Tag: Release_2_11_0~17^2~7^2~58^2~24 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=7abb00c4c412101c88d28fa1770c16c0600362f8;p=jalview.git JAL-1988 Investigating... --- diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 94b38ed..96b7960 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -1188,9 +1188,26 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { try { - PrintWriter out = new PrintWriter(new FileWriter(file)); + // PrintWriter out = new PrintWriter(new FileWriter(file)); + PrintWriter out = new PrintWriter(new FileWriter(file), true); + // TESTING code here + boolean TESTING = true; + if (TESTING) + { + out.print("; TESTSTART\n"); + int count = 20; + for (int i = 0; i < count; i++) + { + Thread.sleep(1000); + out.println("; TEST: " + (count - 1 - i)); + } + } out.print(output); + if (TESTING) + { + out.print("; TESTEND\n"); + } out.close(); this.setTitle(file); statusBar.setText(MessageManager.formatMessage( diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index 8d9e366..41dba91 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -80,9 +80,11 @@ import java.beans.PropertyChangeListener; import java.io.BufferedInputStream; import java.io.File; import java.io.FileOutputStream; +import java.io.FileWriter; import java.io.IOException; import java.net.URL; import java.util.ArrayList; +import java.util.HashMap; import java.util.Hashtable; import java.util.List; import java.util.ListIterator; @@ -105,7 +107,6 @@ import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JComponent; import javax.swing.JDesktopPane; -import javax.swing.JFrame; import javax.swing.JInternalFrame; import javax.swing.JLabel; import javax.swing.JMenuItem; @@ -114,6 +115,7 @@ import javax.swing.JPopupMenu; import javax.swing.JProgressBar; import javax.swing.KeyStroke; import javax.swing.SwingUtilities; +import javax.swing.WindowConstants; import javax.swing.event.HyperlinkEvent; import javax.swing.event.HyperlinkEvent.EventType; import javax.swing.event.InternalFrameAdapter; @@ -122,7 +124,6 @@ import javax.swing.event.MenuEvent; import javax.swing.event.MenuListener; import org.stackoverflowusers.file.WindowsShortcut; - /** * Jalview Desktop * @@ -144,6 +145,8 @@ public class Desktop extends jalview.jbgui.GDesktop private static final String EXPERIMENTAL_FEATURES = "EXPERIMENTAL_FEATURES"; + public static HashMap savingFiles = new HashMap<>(); + private JalviewChangeSupport changeSupport = new JalviewChangeSupport(); /** @@ -345,7 +348,17 @@ public class Desktop extends jalview.jbgui.GDesktop doConfigureStructurePrefs(); setTitle("Jalview " + jalview.bin.Cache.getProperty("VERSION")); - setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + // setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + if (!Platform.isAMac()) + { + this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); + } + else + { + this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); + this.addQuitHandler(); + + } boolean selmemusage = jalview.bin.Cache.getDefault("SHOW_MEMUSAGE", false); boolean showjconsole = jalview.bin.Cache.getDefault("SHOW_JAVA_CONSOLE", @@ -1251,6 +1264,8 @@ public class Desktop extends jalview.jbgui.GDesktop @Override public void quit() { + System.out.println("********** Desktop.quit()"); + System.out.println(savingFiles.toString()); Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); jalview.bin.Cache.setProperty("SCREENGEOMETRY_WIDTH", screen.width + ""); diff --git a/src/jalview/jbgui/GDesktop.java b/src/jalview/jbgui/GDesktop.java index a4afb74..1e51541 100755 --- a/src/jalview/jbgui/GDesktop.java +++ b/src/jalview/jbgui/GDesktop.java @@ -538,6 +538,7 @@ public class GDesktop extends JFrame */ protected void quit() { + System.out.println("********** GDesktop.quit()"); } /**