<condition property="java9">
<equals arg1="${ant.java.version}" arg2="9"/>
</condition>
+ <!-- Java 10 JVM args -->
+ <condition property="java10">
+ <equals arg1="${ant.java.version}" arg2="10"/>
+ </condition>
+ <!-- Java 11 JVM args -->
+ <condition property="java11">
+ <equals arg1="${ant.java.version}" arg2="11"/>
+ </condition>
+ <echo message="java version is ${ant.java.version}"/>
+ <echo message="java9 is ${java9}"/>
+ <echo message="java10 is ${java10}"/>
+ <echo message="java11 is ${java11}"/>
<!-- Don't change anything below here unless you know what you are doing! -->
<!-- Url path for WebStart in JNLP file -->
<!-- build directory configuration -->
<property name="libDir" value="lib" />
+ <property name="j11libDir" value="j11lib" />
<property name="resourceDir" value="resources" />
<property name="helpDir" value="help" />
<property name="docDir" value="doc" />
<include name="*.jar" />
<include name="**/*.jar" />
</fileset>
+ <fileset dir="${j11libDir}">
+ <include name="*.jar" />
+ <include name="**/*.jar" />
+ </fileset>
<fileset dir="${libDir}">
<include name="*.jar" />
<include name="**/*.jar" />
*/
package jalview.gui;
-import static jalview.util.UrlConstants.SEQUENCE_ID;
-
import jalview.api.AlignViewportI;
import jalview.api.AlignmentViewPanel;
import jalview.bin.Cache;
import java.awt.datatransfer.ClipboardOwner;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
+import java.awt.desktop.AboutEvent;
+import java.awt.desktop.AboutHandler;
+import java.awt.desktop.PreferencesEvent;
+import java.awt.desktop.PreferencesHandler;
+import java.awt.desktop.QuitEvent;
+import java.awt.desktop.QuitHandler;
+import java.awt.desktop.QuitResponse;
import java.awt.dnd.DnDConstants;
import java.awt.dnd.DropTargetDragEvent;
import java.awt.dnd.DropTargetDropEvent;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
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
*
doConfigureStructurePrefs();
setTitle("Jalview " + jalview.bin.Cache.getProperty("VERSION"));
// setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ /* comments
+ * galore
+ * to
+ * change the line numbers
+ */
+
if (!Platform.isAMac())
{
- this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
+ // this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
}
else
{
- this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
- this.addQuitHandler();
+ // this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
+ java.awt.Desktop desktop = java.awt.Desktop.getDesktop();
+ desktop.setAboutHandler(new AboutHandler()
+ {
+ @Override
+ public void handleAbout(AboutEvent e)
+ {
+ aboutMenuItem_actionPerformed(null);
+ }
+ });
+ desktop.setPreferencesHandler(new PreferencesHandler()
+ {
+ @Override
+ public void handlePreferences(PreferencesEvent e)
+ {
+ preferences_actionPerformed(null);
+ }
+ });
+ desktop.setQuitHandler(new QuitHandler()
+ {
+ @Override
+ public void handleQuitRequestWith(QuitEvent e, QuitResponse r)
+ {
+ int n = JOptionPane.showConfirmDialog(null,
+ MessageManager.getString("label.quit_jalview"),
+ MessageManager.getString("action.quit"),
+ JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE,
+ null);
+ if (n == JOptionPane.OK_OPTION)
+ {
+ System.out.println("Shortcut Quit confirmed by user");
+ quit();
+ }
+ else
+ {
+ System.out.println("Shortcut Quit cancelled by user");
+ }
+ }
+ });
+
+ addWindowListener(new WindowAdapter()
+ {
+
+ @Override
+ public void windowClosing(WindowEvent ev)
+ {
+ quit();
+ }
+ });
}
+
boolean selmemusage = jalview.bin.Cache.getDefault("SHOW_MEMUSAGE",
false);
+
boolean showjconsole = jalview.bin.Cache.getDefault("SHOW_JAVA_CONSOLE",
false);
desktop = new MyDesktopPane(selmemusage);
showMemusage.setSelected(selmemusage);
desktop.setBackground(Color.white);
+
getContentPane().setLayout(new BorderLayout());
// alternate config - have scrollbars - see notes in JAL-153
// JScrollPane sp = new JScrollPane();
// This line prevents Windows Look&Feel resizing all new windows to maximum
// if previous window was maximised
- desktop.setDesktopManager(
- new MyDesktopManager(
- (Platform.isWindows() ? new DefaultDesktopManager()
- : Platform.isAMac()
- ? new AquaInternalFrameManager(
- desktop.getDesktopManager())
- : desktop.getDesktopManager())));
+ desktop.setDesktopManager(new MyDesktopManager(
+ (Platform.isWindows() ? new DefaultDesktopManager()
+ : Platform.isAMac()
+ ? new AquaInternalFrameManager(
+ desktop.getDesktopManager())
+ : desktop.getDesktopManager())));
Rectangle dims = getLastKnownDimensions("");
if (dims != null)
while (li.hasNext())
{
String link = li.next();
- if (link.contains(SEQUENCE_ID)
+ if (link.contains(jalview.util.UrlConstants.SEQUENCE_ID)
&& !UrlConstants.isDefaultString(link))
{
check = true;
}
}
-
/**
* Accessor method to quickly get all the AlignmentFrames loaded.
*
try
{
- java.net.URL url = (URL) t.getTransferData(urlFlavour);
+ java.net.URL url = (URL) t.getTransferData(urlFlavour);
// nb: java 8 osx bug https://bugs.openjdk.java.net/browse/JDK-8156099
// means url may be null.
- if (url != null)
- {
- protocols.add(DataSourceType.URL);
- files.add(url.toString());
- Cache.log.debug("Drop handled as URL dataflavor "
- + files.get(files.size() - 1));
+ if (url != null)
+ {
+ protocols.add(DataSourceType.URL);
+ files.add(url.toString());
+ Cache.log.debug("Drop handled as URL dataflavor "
+ + files.get(files.size() - 1));
return;
}
else
"Please ignore plist error - occurs due to problem with java 8 on OSX");
}
;
- }
+ }
} catch (Throwable ex)
{
Cache.log.debug("URL drop handler failed.", ex);
&& (source.endsWith(".lnk") || source.endsWith(".url")
|| source.endsWith(".site")))
{
- try {
+ try
+ {
File lf = new File(files.get(f));
// process link file to get a URL
Cache.log.debug("Found potential link file: " + lf);
files.set(f, fullname);
Cache.log.debug("Parsed real filename " + fullname
+ " to extract protocol: " + protocols.get(f));
- }
- catch (Exception ex)
+ } catch (Exception ex)
{
- Cache.log.error("Couldn't parse "+files.get(f)+" as a link file.",ex);
+ Cache.log.error(
+ "Couldn't parse " + files.get(f) + " as a link file.",
+ ex);
}
}
}