")
+ .append("Built: ")
+ .append(Cache.getDefault("BUILD_DATE", "unknown"))
+ .append(" from ").append(Cache.getBuildDetailsForSplash())
+ .append("");
- }
- else
- {
-
- message.append("Version "
- + Cache.getProperty("VERSION")
- + "; last updated: "
- + Cache.getDefault("BUILD_DATE", "unknown"));
- }
-
- if (Cache.getDefault("LATEST_VERSION", "Checking")
- .equals("Checking"))
+ String latestVersion = Cache.getDefault("LATEST_VERSION", "Checking");
+ if (latestVersion.equals("Checking"))
{
// JBP removed this message for 2.11: May be reinstated in future version
// message.append(" ...Checking latest version...");
}
- else if (!Cache.getDefault("LATEST_VERSION", "Checking")
- .equals(Cache.getProperty("VERSION")))
+ else if (!latestVersion.equals(Cache.getProperty("VERSION")))
{
boolean red = false;
if (Cache.getProperty("VERSION").toLowerCase()
@@ -1408,29 +1388,22 @@ public class Desktop extends jalview.jbgui.GDesktop
message.append("
");
}
- message.append(" !! Version "
- + Cache.getDefault("LATEST_VERSION",
- "..Checking..")
- + " is available for download from "
- + Cache.getDefault("www.jalview.org",
- "http://www.jalview.org")
- + " !!");
+ message.append(" !! Version ")
+ .append(Cache.getDefault("LATEST_VERSION", "..Checking.."))
+ .append(" is available for download from ")
+ .append(Cache.getDefault("www.jalview.org",
+ "http://www.jalview.org"))
+ .append(" !!");
if (red)
{
message.append("
");
}
}
- message.append(" Authors: " + Cache.getDefault(
- "AUTHORFNAMES",
- "The Jalview Authors (See AUTHORS file for current list)")
- + "
Development managed by The Barton Group, University of Dundee, Scotland, UK. "
- + "
For help, see the FAQ at www.jalview.org/faq and/or join the jalview-discuss@jalview.org mailing list"
- + "
If you use Jalview, please cite:"
- + " Waterhouse, A.M., Procter, J.B., Martin, D.M.A, Clamp, M. and Barton, G. J. (2009)"
- + " Jalview Version 2 - a multiple sequence alignment editor and analysis workbench"
- + " Bioinformatics doi: 10.1093/bioinformatics/btp033"
- + "");
- return message;
+ message.append(" Authors: ");
+ message.append(Cache.getDefault("AUTHORFNAMES", DEFAULT_AUTHORS));
+ message.append(CITATION);
+
+ return message.toString();
}
/**
@@ -1652,7 +1625,7 @@ public class Desktop extends jalview.jbgui.GDesktop
@Override
protected void preferences_actionPerformed(ActionEvent e)
{
- new Preferences();
+ Preferences.openPreferences();
}
/**
@@ -1708,16 +1681,17 @@ public class Desktop extends jalview.jbgui.GDesktop
setProgressBar(MessageManager.formatMessage(
"label.saving_jalview_project", new Object[]
{ chosenFile.getName() }), chosenFile.hashCode());
- Cache.setProperty("LAST_DIRECTORY",
- chosenFile.getParent());
+ Cache.setProperty("LAST_DIRECTORY", chosenFile.getParent());
// TODO catch and handle errors for savestate
// TODO prevent user from messing with the Desktop whilst we're saving
try
{
- boolean doBackup = BackupFiles.getEnabled();
- BackupFiles backupfiles = doBackup ? new BackupFiles(chosenFile) : null;
+ boolean doBackup = BackupFiles.getEnabled();
+ BackupFiles backupfiles = doBackup ? new BackupFiles(chosenFile)
+ : null;
- new Jalview2XML().saveState(doBackup ? backupfiles.getTempFile() : chosenFile);
+ new Jalview2XML().saveState(
+ doBackup ? backupfiles.getTempFile() : chosenFile);
if (doBackup)
{
@@ -1743,7 +1717,7 @@ public class Desktop extends jalview.jbgui.GDesktop
setProgressBar(null, chosenFile.hashCode());
}
}).start();
- }
+ }
}
@Override
@@ -1774,8 +1748,10 @@ public class Desktop extends jalview.jbgui.GDesktop
"Jalview Project (old)" };
JalviewFileChooser chooser = new JalviewFileChooser(
Cache.getProperty("LAST_DIRECTORY"), suffix, desc,
- "Jalview Project", true, BackupFiles.getEnabled()); // last two booleans: allFiles,
- // allowBackupFiles
+ "Jalview Project", true, BackupFiles.getEnabled()); // last two
+ // booleans:
+ // allFiles,
+ // allowBackupFiles
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle(MessageManager.getString("label.restore_state"));
chooser.setResponseHandler(0, new Runnable()
@@ -1792,29 +1768,30 @@ public class Desktop extends jalview.jbgui.GDesktop
@Override
public void run()
{
- try
+ try
{
- new Jalview2XML().loadJalviewAlign(choice);
+ new Jalview2XML().loadJalviewAlign(selectedFile);
} catch (OutOfMemoryError oom)
- {
- new OOMWarning("Whilst loading project from " + choice, oom);
- } catch (Exception ex)
- {
- Cache.log.error(
- "Problems whilst loading project from " + choice, ex);
- JvOptionPane.showMessageDialog(Desktop.desktop,
- MessageManager.formatMessage(
- "label.error_whilst_loading_project_from",
- new Object[]
- { choice }),
- MessageManager.getString("label.couldnt_load_project"),
- JvOptionPane.WARNING_MESSAGE);
- }
+ {
+ new OOMWarning("Whilst loading project from " + choice, oom);
+ } catch (Exception ex)
+ {
+ Cache.log.error(
+ "Problems whilst loading project from " + choice, ex);
+ JvOptionPane.showMessageDialog(Desktop.desktop,
+ MessageManager.formatMessage(
+ "label.error_whilst_loading_project_from",
+ new Object[]
+ { choice }),
+ MessageManager
+ .getString("label.couldnt_load_project"),
+ JvOptionPane.WARNING_MESSAGE);
+ }
}
- }).start();
+ }, "Project Loader").start();
}
});
-
+
chooser.showOpenDialog(this);
}
@@ -2001,11 +1978,26 @@ public class Desktop extends jalview.jbgui.GDesktop
return;
}
+ // FIXME: ideally should use UI interface API
+ FeatureSettings viewFeatureSettings = (af.featureSettings != null
+ && af.featureSettings.isOpen()) ? af.featureSettings : null;
+ Rectangle fsBounds = af.getFeatureSettingsGeometry();
for (int i = 0; i < size; i++)
{
AlignmentPanel ap = af.alignPanels.get(i);
+
AlignFrame newaf = new AlignFrame(ap);
+ // transfer reference for existing feature settings to new alignFrame
+ if (ap == af.alignPanel)
+ {
+ if (viewFeatureSettings != null && viewFeatureSettings.fr.ap == ap)
+ {
+ newaf.featureSettings = viewFeatureSettings;
+ }
+ newaf.setFeatureSettingsGeometry(fsBounds);
+ }
+
/*
* Restore the view's last exploded frame geometry if known. Multiple
* views from one exploded frame share and restore the same (frame)
@@ -2021,8 +2013,18 @@ public class Desktop extends jalview.jbgui.GDesktop
addInternalFrame(newaf, af.getTitle(), AlignFrame.DEFAULT_WIDTH,
AlignFrame.DEFAULT_HEIGHT);
+ // and materialise a new feature settings dialog instance for the new
+ // alignframe
+ // (closes the old as if 'OK' was pressed)
+ if (ap == af.alignPanel && newaf.featureSettings != null
+ && newaf.featureSettings.isOpen()
+ && af.alignPanel.getAlignViewport().isShowSequenceFeatures())
+ {
+ newaf.showFeatureSettingsUI();
+ }
}
+ af.featureSettings = null;
af.alignPanels.clear();
af.closeMenuItem_actionPerformed(true);
@@ -2030,9 +2032,9 @@ public class Desktop extends jalview.jbgui.GDesktop
/**
* Gather expanded views (separate AlignFrame's) with the same sequence set
- * identifier back in to this frame as additional views, and close the expanded
- * views. Note the expanded frames may themselves have multiple views. We take
- * the lot.
+ * identifier back in to this frame as additional views, and close the
+ * expanded views. Note the expanded frames may themselves have multiple
+ * views. We take the lot.
*
* @param source
*/
@@ -2042,7 +2044,6 @@ public class Desktop extends jalview.jbgui.GDesktop
source.viewport.setExplodedGeometry(source.getBounds());
JInternalFrame[] frames = desktop.getAllFrames();
String viewId = source.viewport.getSequenceSetId();
-
for (int t = 0; t < frames.length; t++)
{
if (frames[t] instanceof AlignFrame && frames[t] != source)
@@ -2063,11 +2064,32 @@ public class Desktop extends jalview.jbgui.GDesktop
if (gatherThis)
{
+ if (af.featureSettings != null && af.featureSettings.isOpen())
+ {
+ if (source.featureSettings == null)
+ {
+ // preserve the feature settings geometry for this frame
+ source.featureSettings = af.featureSettings;
+ source.setFeatureSettingsGeometry(
+ af.getFeatureSettingsGeometry());
+ }
+ else
+ {
+ // close it and forget
+ af.featureSettings.close();
+ }
+ }
af.alignPanels.clear();
af.closeMenuItem_actionPerformed(true);
}
}
}
+
+ // refresh the feature setting UI for the source frame if it exists
+ if (source.featureSettings != null && source.featureSettings.isOpen())
+ {
+ source.showFeatureSettingsUI();
+ }
}
public JInternalFrame[] getAllFrames()
@@ -2169,12 +2191,12 @@ public class Desktop extends jalview.jbgui.GDesktop
/**
* Proxy class for JDesktopPane which optionally displays the current memory
- * usage and highlights the desktop area with a red bar if free memory runs low.
+ * usage and highlights the desktop area with a red bar if free memory runs
+ * low.
*
* @author AMW
*/
- public class MyDesktopPane extends JDesktopPane
- implements Runnable
+ public class MyDesktopPane extends JDesktopPane implements Runnable
{
private static final float ONE_MB = 1048576f;
@@ -2261,6 +2283,9 @@ public class Desktop extends jalview.jbgui.GDesktop
10, getHeight() - fm.getHeight());
}
}
+
+ // output debug scale message. Important for jalview.bin.HiDPISettingTest2
+ Desktop.debugScaleMessage(Desktop.getDesktop().getGraphics());
}
}
@@ -2411,14 +2436,17 @@ public class Desktop extends jalview.jbgui.GDesktop
}
/**
- * Bind Ctrl/Cmd-Q to Quit - for reset as Groovy Console takes over this binding
- * when opened
+ * Bind Ctrl/Cmd-Q to Quit - for reset as Groovy Console takes over this
+ * binding when opened
*/
protected void addQuitHandler()
{
- getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW)
- .put(KeyStroke.getKeyStroke(KeyEvent.VK_Q,
- jalview.util.ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx()),
+ getRootPane()
+ .getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
+ KeyStroke
+ .getKeyStroke(KeyEvent.VK_Q,
+ jalview.util.ShortcutKeyMaskExWrapper
+ .getMenuShortcutKeyMaskEx()),
"Quit");
getRootPane().getActionMap().put("Quit", new AbstractAction()
{
@@ -2469,7 +2497,7 @@ public class Desktop extends jalview.jbgui.GDesktop
@Override
public void setProgressBar(String message, long id)
{
- Platform.timeCheck("Desktop " + message, Platform.TIME_MARK);
+ // Platform.timeCheck("Desktop " + message, Platform.TIME_MARK);
if (progressBars == null)
{
@@ -2547,8 +2575,9 @@ public class Desktop extends jalview.jbgui.GDesktop
}
/**
- * This will return the first AlignFrame holding the given viewport instance. It
- * will break if there are more than one AlignFrames viewing a particular av.
+ * This will return the first AlignFrame holding the given viewport instance.
+ * It will break if there are more than one AlignFrames viewing a particular
+ * av.
*
* @param viewport
* @return alignFrame for viewport
@@ -2925,8 +2954,8 @@ public class Desktop extends jalview.jbgui.GDesktop
/**
* Explode the views in the given SplitFrame into separate SplitFrame windows.
- * This respects (remembers) any previous 'exploded geometry' i.e. the size and
- * location last time the view was expanded (if any). However it does not
+ * This respects (remembers) any previous 'exploded geometry' i.e. the size
+ * and location last time the view was expanded (if any). However it does not
* remember the split pane divider location - this is set to match the
* 'exploding' frame.
*
@@ -3097,7 +3126,8 @@ public class Desktop extends jalview.jbgui.GDesktop
Transferable t) throws Exception
{
- // BH 2018 changed List to List