*/
package jalview.gui;
-import jalview.api.AlignViewportI;
-import jalview.api.AlignmentViewPanel;
-import jalview.bin.Cache;
-import jalview.bin.Jalview;
-import jalview.gui.ImageExporter.ImageWriterI;
-import jalview.io.BackupFiles;
-import jalview.io.DataSourceType;
-import jalview.io.FileFormat;
-import jalview.io.FileFormatException;
-import jalview.io.FileFormatI;
-import jalview.io.FileFormats;
-import jalview.io.FileLoader;
-import jalview.io.FormatAdapter;
-import jalview.io.IdentifyFile;
-import jalview.io.JalviewFileChooser;
-import jalview.io.JalviewFileView;
-import jalview.jbgui.GSplitFrame;
-import jalview.jbgui.GStructureViewer;
-import jalview.project.Jalview2XML;
-import jalview.structure.StructureSelectionManager;
-import jalview.urls.IdOrgSettings;
-import jalview.util.BrowserLauncher;
-import jalview.util.ImageMaker.TYPE;
-import jalview.util.MessageManager;
-import jalview.util.Platform;
-import jalview.util.ShortcutKeyMaskExWrapper;
-import jalview.util.UrlConstants;
-import jalview.viewmodel.AlignmentViewport;
-import jalview.ws.params.ParamManager;
-import jalview.ws.utils.UrlDownloadClient;
-
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FontMetrics;
import java.awt.Graphics;
+import java.awt.Graphics2D;
import java.awt.GridLayout;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
+import java.awt.geom.AffineTransform;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.File;
import org.stackoverflowusers.file.WindowsShortcut;
+import jalview.api.AlignViewportI;
+import jalview.api.AlignmentViewPanel;
+import jalview.bin.Cache;
+import jalview.bin.Jalview;
+import jalview.gui.ImageExporter.ImageWriterI;
+import jalview.io.BackupFiles;
+import jalview.io.DataSourceType;
+import jalview.io.FileFormat;
+import jalview.io.FileFormatException;
+import jalview.io.FileFormatI;
+import jalview.io.FileFormats;
+import jalview.io.FileLoader;
+import jalview.io.FormatAdapter;
+import jalview.io.IdentifyFile;
+import jalview.io.JalviewFileChooser;
+import jalview.io.JalviewFileView;
+import jalview.jbgui.GSplitFrame;
+import jalview.jbgui.GStructureViewer;
+import jalview.project.Jalview2XML;
+import jalview.structure.StructureSelectionManager;
+import jalview.urls.IdOrgSettings;
+import jalview.util.BrowserLauncher;
+import jalview.util.ChannelProperties;
+import jalview.util.ImageMaker.TYPE;
+import jalview.util.MessageManager;
+import jalview.util.Platform;
+import jalview.util.ShortcutKeyMaskExWrapper;
+import jalview.util.UrlConstants;
+import jalview.viewmodel.AlignmentViewport;
+import jalview.ws.params.ParamManager;
+import jalview.ws.utils.UrlDownloadClient;
+
/**
* Jalview Desktop
*
implements DropTargetListener, ClipboardOwner, IProgressIndicator,
jalview.api.StructureSelectionManagerProvider
{
+ private static final String CITATION = "<br><br>Development managed by The Barton Group, University of Dundee, Scotland, UK.<br>"
+ + "<br><br>For help, see the FAQ at <a href=\"http://www.jalview.org/faq\">www.jalview.org/faq</a> and/or join the jalview-discuss@jalview.org mailing list"
+ + "<br><br>If you use Jalview, please cite:"
+ + "<br>Waterhouse, A.M., Procter, J.B., Martin, D.M.A, Clamp, M. and Barton, G. J. (2009)"
+ + "<br>Jalview Version 2 - a multiple sequence alignment editor and analysis workbench"
+ + "<br>Bioinformatics doi: 10.1093/bioinformatics/btp033";
+
+ private static final String DEFAULT_AUTHORS = "The Jalview Authors (See AUTHORS file for current list)";
+
private static int DEFAULT_MIN_WIDTH = 300;
private static int DEFAULT_MIN_HEIGHT = 250;
protected static final String CONFIRM_KEYBOARD_QUIT = "CONFIRM_KEYBOARD_QUIT";
- public static HashMap<String, FileWriter> savingFiles = new HashMap<>();
+ public static HashMap<String, FileWriter> savingFiles = new HashMap<String, FileWriter>();
private JalviewChangeSupport changeSupport = new JalviewChangeSupport();
+ public static boolean nosplash = false;
+
/**
* news reader - null if it was never started.
*/
instance = this;
doConfigureStructurePrefs();
- setTitle("Jalview " + Cache.getProperty("VERSION"));
+ setTitle(ChannelProperties.getProperty("app_name") + " "
+ + Cache.getProperty("VERSION"));
/*
if (!Platform.isAMac())
{
try
{
APQHandlers.setAPQHandlers(this);
- } catch (Exception e)
- {
- System.out.println("Cannot set APQHandlers");
- // e.printStackTrace();
} catch (Throwable t)
{
- System.out.println("Cannot set APQHandlers");
+ System.out.println("Error setting APQHandlers: " + t.toString());
// t.printStackTrace();
}
-
addWindowListener(new WindowAdapter()
{
}
});
- boolean selmemusage = Cache.getDefault("SHOW_MEMUSAGE",
- false);
+ boolean selmemusage = Cache.getDefault("SHOW_MEMUSAGE", false);
- boolean showjconsole = Cache.getDefault("SHOW_JAVA_CONSOLE",
- false);
+ boolean showjconsole = Cache.getDefault("SHOW_JAVA_CONSOLE", false);
desktop = new MyDesktopPane(selmemusage);
showMemusage.setSelected(selmemusage);
* @j2sIgnore
*/
{
-
jconsole = new Console(this, showjconsole);
- // add essential build information
- jconsole.setHeader("Jalview Version: "
- + Cache.getProperty("VERSION") + "\n"
- + "Jalview Installation: "
- + Cache.getDefault("INSTALLATION", "unknown")
- + "\n" + "Build Date: "
- + Cache.getDefault("BUILD_DATE", "unknown") + "\n"
- + "Java version: " + System.getProperty("java.version") + "\n"
- + System.getProperty("os.arch") + " "
- + System.getProperty("os.name") + " "
- + System.getProperty("os.version"));
-
+ jconsole.setHeader(Cache.getVersionDetailsForConsole());
showConsole(showjconsole);
showNews.setVisible(false);
checkURLLinks();
// Spawn a thread that shows the splashscreen
-
- SwingUtilities.invokeLater(new Runnable()
+ if (!nosplash)
{
- @Override
- public void run()
+ SwingUtilities.invokeLater(new Runnable()
{
- new SplashScreen();
- }
- });
+ @Override
+ public void run()
+ {
+ new SplashScreen(true);
+ }
+ });
+ }
// Thread off a new instance of the file chooser - this reduces the time
// it
}
});
desktop.addMouseListener(ma);
-
}
/**
.getStructureSelectionManager(this);
if (Cache.getDefault(Preferences.ADD_SS_ANN, true))
{
- ssm.setAddTempFacAnnot(Cache
- .getDefault(Preferences.ADD_TEMPFACT_ANN, true));
- ssm.setProcessSecondaryStructure(Cache
- .getDefault(Preferences.STRUCT_FROM_PDB, true));
+ ssm.setAddTempFacAnnot(
+ Cache.getDefault(Preferences.ADD_TEMPFACT_ANN, true));
+ ssm.setProcessSecondaryStructure(
+ Cache.getDefault(Preferences.STRUCT_FROM_PDB, true));
ssm.setSecStructServices(
Cache.getDefault(Preferences.USE_RNAVIEW, true));
}
}
}
}).start();
-
+
}
@Override
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
String x = Cache.getProperty(windowName + "SCREEN_X");
String y = Cache.getProperty(windowName + "SCREEN_Y");
- String width = Cache
- .getProperty(windowName + "SCREEN_WIDTH");
- String height = Cache
- .getProperty(windowName + "SCREEN_HEIGHT");
+ String width = Cache.getProperty(windowName + "SCREEN_WIDTH");
+ String height = Cache.getProperty(windowName + "SCREEN_HEIGHT");
if ((x != null) && (y != null) && (width != null) && (height != null))
{
int ix = Integer.parseInt(x), iy = Integer.parseInt(y),
// attempt #1 - try to cope with change in screen geometry - this
// version doesn't preserve original jv aspect ratio.
// take ratio of current screen size vs original screen size.
- double sw = ((1f * screenSize.width) / (1f * Integer.parseInt(
- Cache.getProperty("SCREENGEOMETRY_WIDTH"))));
- double sh = ((1f * screenSize.height) / (1f * Integer.parseInt(
- Cache.getProperty("SCREENGEOMETRY_HEIGHT"))));
+ double sw = ((1f * screenSize.width) / (1f * Integer
+ .parseInt(Cache.getProperty("SCREENGEOMETRY_WIDTH"))));
+ double sh = ((1f * screenSize.height) / (1f * Integer
+ .parseInt(Cache.getProperty("SCREENGEOMETRY_HEIGHT"))));
// rescale the bounds depending upon the current screen geometry.
ix = (int) (ix * sw);
iw = (int) (iw * sw);
}
/**
- * Add key bindings to a JInternalFrame so that Ctrl-W and Cmd-W will close the
- * window
+ * Add key bindings to a JInternalFrame so that Ctrl-W and Cmd-W will close
+ * the window
*
* @param frame
*/
public void inputLocalFileMenuItem_actionPerformed(AlignViewport viewport)
{
String fileFormat = Cache.getProperty("DEFAULT_FILE_FORMAT");
- JalviewFileChooser chooser = JalviewFileChooser
- .forRead(Cache.getProperty("LAST_DIRECTORY"), fileFormat, BackupFiles.getEnabled());
+ JalviewFileChooser chooser = JalviewFileChooser.forRead(
+ Cache.getProperty("LAST_DIRECTORY"), fileFormat,
+ BackupFiles.getEnabled());
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle(
public void quit()
{
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
- Cache.setProperty("SCREENGEOMETRY_WIDTH",
- screen.width + "");
- Cache.setProperty("SCREENGEOMETRY_HEIGHT",
- screen.height + "");
+ Cache.setProperty("SCREENGEOMETRY_WIDTH", screen.width + "");
+ Cache.setProperty("SCREENGEOMETRY_HEIGHT", screen.height + "");
storeLastKnownDimensions("", new Rectangle(getBounds().x, getBounds().y,
getWidth(), getHeight()));
private void storeLastKnownDimensions(String string, Rectangle jc)
{
- Cache.log.debug("Storing last known dimensions for "
- + string + ": x:" + jc.x + " y:" + jc.y + " width:" + jc.width
- + " height:" + jc.height);
+ Cache.log.debug("Storing last known dimensions for " + string + ": x:"
+ + jc.x + " y:" + jc.y + " width:" + jc.width + " height:"
+ + jc.height);
Cache.setProperty(string + "SCREEN_X", jc.x + "");
Cache.setProperty(string + "SCREEN_Y", jc.y + "");
@Override
public void aboutMenuItem_actionPerformed(ActionEvent e)
{
- // StringBuffer message = getAboutMessage(false);
- // JvOptionPane.showInternalMessageDialog(Desktop.desktop,
- //
- // message.toString(), "About Jalview", JvOptionPane.INFORMATION_MESSAGE);
new Thread(new Runnable()
{
@Override
public void run()
{
- new SplashScreen(true);
+ new SplashScreen(false);
}
}).start();
}
- public StringBuffer getAboutMessage(boolean shortv)
+ /**
+ * Returns the html text for the About screen, including any available version
+ * number, build details, author details and citation reference, but without
+ * the enclosing {@code html} tags
+ *
+ * @return
+ */
+ public String getAboutMessage()
{
- StringBuffer message = new StringBuffer();
- message.append("<html>");
- if (shortv)
- {
- message.append("<h1><strong>Version: "
- + Cache.getProperty("VERSION")
- + "</strong></h1>");
- message.append("<strong>Built: <em>"
- + Cache.getDefault("BUILD_DATE", "unknown") + "</em> from "
- + Cache.getBuildDetailsForSplash()
- + "</strong>");
+ StringBuilder message = new StringBuilder(1024);
+ message.append("<h1><strong>Version: ")
+ .append(Cache.getProperty("VERSION")).append("</strong></h1>")
+ .append("<strong>Built: <em>")
+ .append(Cache.getDefault("BUILD_DATE", "unknown"))
+ .append("</em> from ").append(Cache.getBuildDetailsForSplash())
+ .append("</strong>");
- }
- else
- {
-
- message.append("<strong>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("<br>...Checking latest version...</br>");
}
- 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()
message.append("<div style=\"color: #FF0000;font-style: bold;\">");
}
- message.append("<br>!! Version "
- + Cache.getDefault("LATEST_VERSION",
- "..Checking..")
- + " is available for download from "
- + Cache.getDefault("www.jalview.org",
- "http://www.jalview.org")
- + " !!");
+ message.append("<br>!! 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("</div>");
}
}
- message.append("<br>Authors: " + Cache.getDefault(
- "AUTHORFNAMES",
- "The Jalview Authors (See AUTHORS file for current list)")
- + "<br><br>Development managed by The Barton Group, University of Dundee, Scotland, UK.<br>"
- + "<br><br>For help, see the FAQ at <a href=\"http://www.jalview.org/faq\">www.jalview.org/faq</a> and/or join the jalview-discuss@jalview.org mailing list"
- + "<br><br>If you use Jalview, please cite:"
- + "<br>Waterhouse, A.M., Procter, J.B., Martin, D.M.A, Clamp, M. and Barton, G. J. (2009)"
- + "<br>Jalview Version 2 - a multiple sequence alignment editor and analysis workbench"
- + "<br>Bioinformatics doi: 10.1093/bioinformatics/btp033"
- + "</html>");
- return message;
+ message.append("<br>Authors: ");
+ message.append(Cache.getDefault("AUTHORFNAMES", DEFAULT_AUTHORS));
+ message.append(CITATION);
+
+ return message.toString();
}
/**
@Override
protected void preferences_actionPerformed(ActionEvent e)
{
- new Preferences();
+ Preferences.openPreferences();
}
/**
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)
{
setProgressBar(null, chosenFile.hashCode());
}
}).start();
- }
+ }
}
@Override
"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()
@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);
}
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)
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);
/**
* 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
*/
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)
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()
/**
* 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;
10, getHeight() - fm.getHeight());
}
}
+
+ // output debug scale message. Important for jalview.bin.HiDPISettingTest2
+ Desktop.debugScaleMessage(Desktop.getDesktop().getGraphics());
}
}
}
/**
- * 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()
{
@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)
{
}
/**
- * 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
/**
* 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.
*
Transferable t) throws Exception
{
- // BH 2018 changed List<String> to List<Object> to allow for File from SwingJS
+ // BH 2018 changed List<String> to List<Object> to allow for File from
+ // SwingJS
// DataFlavor[] flavors = t.getTransferDataFlavors();
// for (int i = 0; i < flavors.length; i++) {
// byte[] data = getDroppedFileBytes(file);
// fileName.setText(file.getName() + " - " + data.length + " " +
// evt.getLocation());
- // JTextArea target = (JTextArea) ((DropTarget) evt.getSource()).getComponent();
+ // JTextArea target = (JTextArea) ((DropTarget)
+ // evt.getSource()).getComponent();
// target.setText(new String(data));
// }
// dtde.dropComplete(true);
}
/**
- * Answers a (possibly empty) list of any structure viewer frames (currently for
- * either Jmol or Chimera) which are currently open. This may optionally be
- * restricted to viewers of a specified class, or viewers linked to a specified
- * alignment panel.
+ * Answers a (possibly empty) list of any structure viewer frames (currently
+ * for either Jmol or Chimera) which are currently open. This may optionally
+ * be restricted to viewers of a specified class, or viewers linked to a
+ * specified alignment panel.
*
* @param apanel
* if not null, only return viewers linked to this panel
}
return result;
}
+
+ public static final String debugScaleMessage = "Desktop graphics transform scale=";
+
+ private static boolean debugScaleMessageDone = false;
+
+ public static void debugScaleMessage(Graphics g)
+ {
+ if (debugScaleMessageDone)
+ {
+ return;
+ }
+ // output used by tests to check HiDPI scaling settings in action
+ try
+ {
+ Graphics2D gg = (Graphics2D) g;
+ if (gg != null)
+ {
+ AffineTransform t = gg.getTransform();
+ double scaleX = t.getScaleX();
+ double scaleY = t.getScaleY();
+ Cache.debug(debugScaleMessage + scaleX + " (X)");
+ Cache.debug(debugScaleMessage + scaleY + " (Y)");
+ debugScaleMessageDone = true;
+ }
+ else
+ {
+ Cache.debug("Desktop graphics null");
+ }
+ } catch (Exception e)
+ {
+ Cache.debug(Cache.getStackTraceString(e));
+ }
+ }
}