{
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(
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;
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;
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;
import javax.swing.event.MenuListener;
import org.stackoverflowusers.file.WindowsShortcut;
-
/**
* Jalview Desktop
*
private static final String EXPERIMENTAL_FEATURES = "EXPERIMENTAL_FEATURES";
+ public static HashMap<String, FileWriter> savingFiles = new HashMap<>();
+
private JalviewChangeSupport changeSupport = new JalviewChangeSupport();
/**
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",
@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 + "");