*/
package jalview.gui;
-import jalview.api.AlignViewportI;
-import jalview.api.AlignmentViewPanel;
-import jalview.bin.Cache;
-import jalview.bin.Jalview;
-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.ImageMaker;
-import jalview.util.MessageManager;
-import jalview.util.Platform;
-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.io.File;
import java.io.FileWriter;
import java.io.IOException;
+import java.lang.reflect.Field;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import org.stackoverflowusers.file.WindowsShortcut;
+import jalview.api.AlignViewportI;
+import jalview.api.AlignmentViewPanel;
+import jalview.bin.Cache;
+import jalview.bin.Jalview;
+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.ImageMaker;
+import jalview.util.MessageManager;
+import jalview.util.Platform;
+import jalview.util.UrlConstants;
+import jalview.viewmodel.AlignmentViewport;
+import jalview.ws.params.ParamManager;
+import jalview.ws.utils.UrlDownloadClient;
+
/**
* Jalview Desktop
*
instance = this;
doConfigureStructurePrefs();
- setTitle("Jalview " + jalview.bin.Cache.getProperty("VERSION"));
+ String title = "Jalview " + Cache.getProperty("VERSION");
+ setTitle(title);
/*
if (!Platform.isAMac())
{
// t.printStackTrace();
}
+ if (Platform.isLinux())
+ {
+ try
+ {
+ Toolkit xToolkit = Toolkit.getDefaultToolkit();
+ Field awtAppClassNameField = xToolkit.getClass()
+ .getDeclaredField("awtAppClassName");
+ awtAppClassNameField.setAccessible(true);
+ awtAppClassNameField.set(xToolkit, "Jalview");
+ } catch (Exception e)
+ {
+ Cache.log.debug("Could not set awtAppClassName");
+ }
+ }
addWindowListener(new WindowAdapter()
{
KeyStroke ctrlWKey = KeyStroke.getKeyStroke(KeyEvent.VK_W,
InputEvent.CTRL_DOWN_MASK);
KeyStroke cmdWKey = KeyStroke.getKeyStroke(KeyEvent.VK_W,
- jalview.util.ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx());
+ jalview.util.ShortcutKeyMaskExWrapper
+ .getMenuShortcutKeyMaskEx());
InputMap inputMap = frame
.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
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(
"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"));
// FIXME: ideally should use UI interface API
FeatureSettings viewFeatureSettings = (af.featureSettings != null
- && af.featureSettings.isOpen())
- ? af.featureSettings
- : null;
+ && af.featureSettings.isOpen()) ? af.featureSettings : null;
Rectangle fsBounds = af.getFeatureSettingsGeometry();
for (int i = 0; i < size; i++)
{
addInternalFrame(newaf, af.getTitle(), AlignFrame.DEFAULT_WIDTH,
AlignFrame.DEFAULT_HEIGHT);
- // and materialise a new feature settings dialog instance for the new alignframe
+ // 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()
}
}
// refresh the feature setting UI for the source frame if it exists
- if (source.featureSettings != null
- && source.featureSettings.isOpen())
+ if (source.featureSettings != null && source.featureSettings.isOpen())
{
source.showFeatureSettingsUI();
}
*/
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()
{
*/
public void startServiceDiscovery(boolean blocking)
{
- startServiceDiscovery(blocking,false);
+ startServiceDiscovery(blocking, false);
}
/**