import jalview.api.AlignViewportI;
import jalview.api.AlignmentViewPanel;
+import jalview.api.structures.JalviewStructureDisplayI;
import jalview.bin.Cache;
import jalview.bin.Jalview;
import jalview.gui.ImageExporter.ImageWriterI;
// This line prevents Windows Look&Feel resizing all new windows to maximum
// if previous window was maximised
desktop.setDesktopManager(new MyDesktopManager(
- /*
- (Platform.isWindowsAndNotJS() ? new DefaultDesktopManager()
-
- : Platform.isAMacAndNotJS()
- ? new AquaInternalFrameManager(
- desktop.getDesktopManager())
- : desktop.getDesktopManager())));
- */
- new DefaultDesktopManager()));
+ Platform.isJS() ? desktop.getDesktopManager()
+ : new DefaultDesktopManager()));
+ /*
+ (Platform.isWindowsAndNotJS() ? new DefaultDesktopManager()
+ : Platform.isAMacAndNotJS()
+ ? new AquaInternalFrameManager(
+ desktop.getDesktopManager())
+ : desktop.getDesktopManager())));
+ */
Rectangle dims = getLastKnownDimensions("");
if (dims != null)
if (jvnews != null)
{
storeLastKnownDimensions("JALVIEW_RSS_WINDOW_", jvnews.getBounds());
+ }
+
+ // Frames should all close automatically. Keeping external
+ // viewers open should already be decided by user.
+ closeAll_actionPerformed(null);
+ // check for aborted quit
+ if (QuitHandler.quitCancelled())
+ {
+ jalview.bin.Console.debug("Desktop aborting quit");
+ return null;
}
if (dialogExecutor != null)
dialogExecutor.shutdownNow();
}
- closeAll_actionPerformed(null);
-
if (groovyConsole != null)
{
// suppress a possible repeat prompt to save script
// this will run the shutdownHook but QuitHandler.getQuitResponse() should
// not run a second time if gotQuitResponse flag has been set (i.e. user
// confirmed quit of some kind).
- System.exit(0);
+ Jalview.exit("Desktop exiting.", 0);
}
private void storeLastKnownDimensions(String string, Rectangle jc)
}
}
+ public int structureViewersStillRunningCount()
+ {
+ int count = 0;
+ JInternalFrame[] frames = desktop.getAllFrames();
+ for (int i = 0; i < frames.length; i++)
+ {
+ if (frames[i] != null
+ && frames[i] instanceof JalviewStructureDisplayI)
+ {
+ if (((JalviewStructureDisplayI) frames[i]).stillRunning())
+ count++;
+ }
+ }
+ return count;
+ }
+
@Override
public void raiseRelated_actionPerformed(ActionEvent e)
{
}
for (AlignFrame af : frames)
{
+ System.out.println("###### frames=" + frames);
+ System.out.println("###### af=" + af);
+ System.out.println("###### af.alignPanels=" + af.alignPanels);
for (AlignmentPanel ap : af.alignPanels)
{
if (alignmentId == null
/**
* single thread that handles display of dialogs to user.
*/
- ExecutorService dialogExecutor = Executors.newSingleThreadExecutor();
+ ExecutorService dialogExecutor = Executors.newFixedThreadPool(3);
/**
* flag indicating if dialogExecutor should try to acquire a permit