2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
23 import jalview.ext.so.SequenceOntology;
24 import jalview.gui.AlignFrame;
25 import jalview.gui.Desktop;
26 import jalview.gui.PromptUserConfig;
27 import jalview.io.AppletFormatAdapter;
28 import jalview.io.BioJsHTMLOutput;
29 import jalview.io.DataSourceType;
30 import jalview.io.FileFormat;
31 import jalview.io.FileFormatException;
32 import jalview.io.FileFormatI;
33 import jalview.io.FileLoader;
34 import jalview.io.HtmlSvgOutput;
35 import jalview.io.IdentifyFile;
36 import jalview.io.NewickFile;
37 import jalview.io.gff.SequenceOntologyFactory;
38 import jalview.schemes.ColourSchemeI;
39 import jalview.schemes.ColourSchemeProperty;
40 import jalview.util.MessageManager;
41 import jalview.util.Platform;
42 import jalview.ws.jws2.Jws2Discoverer;
44 import java.io.BufferedReader;
46 import java.io.FileOutputStream;
47 import java.io.IOException;
48 import java.io.InputStreamReader;
49 import java.io.OutputStreamWriter;
50 import java.io.PrintWriter;
51 import java.net.MalformedURLException;
53 import java.net.URISyntaxException;
55 import java.security.AllPermission;
56 import java.security.CodeSource;
57 import java.security.PermissionCollection;
58 import java.security.Permissions;
59 import java.security.Policy;
60 import java.util.HashMap;
62 import java.util.Vector;
64 import javax.swing.LookAndFeel;
65 import javax.swing.UIManager;
67 import com.threerings.getdown.util.LaunchUtil;
69 import groovy.lang.Binding;
70 import groovy.util.GroovyScriptEngine;
73 * Main class for Jalview Application <br>
75 * start with: java -classpath "$PATH_TO_LIB$/*:$PATH_TO_CLASSES$" \
78 * or on Windows: java -classpath "$PATH_TO_LIB$/*;$PATH_TO_CLASSES$" \
79 * jalview.bin.Jalview jalview.bin.Jalview
81 * (ensure -classpath arg is quoted to avoid shell expansion of '*' and do not
82 * embellish '*' to e.g. '*.jar')
90 * singleton instance of this class
92 private static Jalview instance;
94 private Desktop desktop;
96 public static AlignFrame currentAlignFrame;
100 // grab all the rights we can the JVM
101 Policy.setPolicy(new Policy()
104 public PermissionCollection getPermissions(CodeSource codesource)
106 Permissions perms = new Permissions();
107 perms.add(new AllPermission());
112 public void refresh()
119 * keep track of feature fetching tasks.
127 * TODO: generalise to track all jalview events to orchestrate batch
131 private int queued = 0;
133 private int running = 0;
135 public FeatureFetcher()
140 public void addFetcher(final AlignFrame af,
141 final Vector<String> dasSources)
143 final long id = System.currentTimeMillis();
145 final FeatureFetcher us = this;
146 new Thread(new Runnable()
158 af.setProgressBar(MessageManager
159 .getString("status.das_features_being_retrived"), id);
160 af.featureSettings_actionPerformed(null);
161 af.setProgressBar(null, id);
170 public synchronized boolean allFinished()
172 return queued == 0 && running == 0;
177 public static Jalview getInstance()
183 * main class for Jalview application
186 * open <em>filename</em>
188 public static void main(String[] args)
190 instance = new Jalview();
191 instance.doMain(args);
197 void doMain(String[] args)
199 System.setSecurityManager(null);
201 .println("Java version: " + System.getProperty("java.version"));
202 System.out.println(System.getProperty("os.arch") + " "
203 + System.getProperty("os.name") + " "
204 + System.getProperty("os.version"));
206 String appdirString = System.getProperty("getdownappdir");
207 if (appdirString != null && appdirString.length() > 0)
209 final File appdir = new File(appdirString);
215 LaunchUtil.upgradeGetdown(
216 new File(appdir, "getdown-launcher-old.jar"),
217 new File(appdir, "getdown-launcher.jar"),
218 new File(appdir, "getdown-launcher-new.jar"));
223 ArgsParser aparser = new ArgsParser(args);
224 boolean headless = false;
226 if (aparser.contains("help") || aparser.contains("h"))
231 if (aparser.contains("nodisplay") || aparser.contains("nogui")
232 || aparser.contains("headless"))
234 System.setProperty("java.awt.headless", "true");
237 String usrPropsFile = aparser.getValue("props");
238 Cache.loadProperties(usrPropsFile); // must do this before
239 if (usrPropsFile != null)
242 "CMD [-props " + usrPropsFile + "] executed successfully!");
247 final String jabawsUrl = aparser.getValue("jabaws");
248 if (jabawsUrl != null)
252 Jws2Discoverer.getDiscoverer().setPreferredUrl(jabawsUrl);
254 "CMD [-jabaws " + jabawsUrl + "] executed successfully!");
255 } catch (MalformedURLException e)
258 "Invalid jabaws parameter: " + jabawsUrl + " ignored");
262 String defs = aparser.getValue("setprop");
265 int p = defs.indexOf('=');
268 System.err.println("Ignoring invalid setprop argument : " + defs);
272 System.out.println("Executing setprop argument: " + defs);
273 // DISABLED FOR SECURITY REASONS
274 // TODO: add a property to allow properties to be overriden by cli args
275 // Cache.setProperty(defs.substring(0,p), defs.substring(p+1));
277 defs = aparser.getValue("setprop");
279 if (System.getProperty("java.awt.headless") != null
280 && System.getProperty("java.awt.headless").equals("true"))
284 System.setProperty("http.agent",
285 "Jalview Desktop/" + Cache.getDefault("VERSION", "Unknown"));
289 } catch (NoClassDefFoundError error)
291 error.printStackTrace();
292 System.out.println("\nEssential logging libraries not found."
293 + "\nUse: java -classpath \"$PATH_TO_LIB$/*:$PATH_TO_CLASSES$\" jalview.bin.Jalview");
301 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
302 } catch (Exception ex)
304 System.err.println("Unexpected Look and Feel Exception");
305 ex.printStackTrace();
307 if (Platform.isAMac())
310 LookAndFeel lookAndFeel = ch.randelshofer.quaqua.QuaquaManager
312 System.setProperty("com.apple.mrj.application.apple.menu.about.name",
314 System.setProperty("apple.laf.useScreenMenuBar", "true");
315 if (lookAndFeel != null)
319 UIManager.setLookAndFeel(lookAndFeel);
320 } catch (Throwable e)
323 "Failed to set QuaQua look and feel: " + e.toString());
326 if (lookAndFeel == null || !(lookAndFeel.getClass()
327 .isAssignableFrom(UIManager.getLookAndFeel().getClass()))
328 || !UIManager.getLookAndFeel().getClass().toString()
329 .toLowerCase().contains("quaqua"))
334 "Quaqua LaF not available on this plaform. Using VAqua(4).\nSee https://issues.jalview.org/browse/JAL-2976");
335 UIManager.setLookAndFeel("org.violetlib.aqua.AquaLookAndFeel");
336 } catch (Throwable e)
339 "Failed to reset look and feel: " + e.toString());
345 * configure 'full' SO model if preferences say to,
346 * else use the default (SO Lite)
348 if (Cache.getDefault("USE_FULL_SO", false))
350 SequenceOntologyFactory.setInstance(new SequenceOntology());
355 desktop = new Desktop();
356 desktop.setInBatchMode(true); // indicate we are starting up
360 JalviewTaskbar.setTaskbar(this);
361 } catch (Exception e)
364 } catch (Throwable t)
369 desktop.setVisible(true);
370 desktop.startServiceDiscovery();
371 if (!aparser.contains("nousagestats"))
373 startUsageStats(desktop);
377 System.err.println("CMD [-nousagestats] executed successfully!");
380 if (!aparser.contains("noquestionnaire"))
382 String url = aparser.getValue("questionnaire");
385 // Start the desktop questionnaire prompter with the specified
387 Cache.log.debug("Starting questionnaire url at " + url);
388 desktop.checkForQuestionnaire(url);
390 "CMD questionnaire[-" + url + "] executed successfully!");
394 if (Cache.getProperty("NOQUESTIONNAIRES") == null)
396 // Start the desktop questionnaire prompter with the specified
399 // "http://anaplog.compbio.dundee.ac.uk/cgi-bin/questionnaire.pl";
401 String defurl = "http://www.jalview.org/cgi-bin/questionnaire.pl";
403 "Starting questionnaire with default url: " + defurl);
404 desktop.checkForQuestionnaire(defurl);
410 System.err.println("CMD [-noquestionnaire] executed successfully!");
413 if (!aparser.contains("nonews"))
415 desktop.checkForNews();
418 BioJsHTMLOutput.updateBioJS();
421 String file = null, data = null;
422 FileFormatI format = null;
423 DataSourceType protocol = null;
424 FileLoader fileLoader = new FileLoader(!headless);
426 String groovyscript = null; // script to execute after all loading is
427 // completed one way or another
428 // extract groovy argument and execute if necessary
429 groovyscript = aparser.getValue("groovy", true);
430 file = aparser.getValue("open", true);
432 if (file == null && desktop == null)
434 System.out.println("No files to open!");
437 String vamsasImport = aparser.getValue("vdoc");
438 String vamsasSession = aparser.getValue("vsess");
439 if (vamsasImport != null || vamsasSession != null)
441 if (desktop == null || headless)
444 "Headless vamsas sessions not yet supported. Sorry.");
447 // if we have a file, start a new session and import it.
448 boolean inSession = false;
449 if (vamsasImport != null)
453 DataSourceType viprotocol = AppletFormatAdapter
454 .checkProtocol(vamsasImport);
455 if (viprotocol == DataSourceType.FILE)
457 inSession = desktop.vamsasImport(new File(vamsasImport));
459 else if (viprotocol == DataSourceType.URL)
461 inSession = desktop.vamsasImport(new URL(vamsasImport));
464 } catch (Exception e)
466 System.err.println("Exeption when importing " + vamsasImport
467 + " as a vamsas document.");
472 System.err.println("Failed to import " + vamsasImport
473 + " as a vamsas document.");
477 System.out.println("Imported Successfully into new session "
478 + desktop.getVamsasApplication().getCurrentSession());
481 if (vamsasSession != null)
483 if (vamsasImport != null)
485 // close the newly imported session and import the Jalview specific
486 // remnants into the new session later on.
487 desktop.vamsasStop_actionPerformed(null);
489 // now join the new session
492 if (desktop.joinVamsasSession(vamsasSession))
495 "Successfully joined vamsas session " + vamsasSession);
499 System.err.println("WARNING: Failed to join vamsas session "
502 } catch (Exception e)
505 "ERROR: Failed to join vamsas session " + vamsasSession);
508 if (vamsasImport != null)
510 // the Jalview specific remnants can now be imported into the new
511 // session at the user's leisure.
513 "Skipping Push for import of data into existing vamsas session."); // TODO:
518 // desktop.getVamsasApplication().push_update();
523 // Finally, deal with the remaining input data.
528 desktop.setProgressBar(
530 .getString("status.processing_commandline_args"),
531 progress = System.currentTimeMillis());
533 System.out.println("CMD [-open " + file + "] executed successfully!");
535 if (!file.startsWith("http://"))
537 if (!(new File(file)).exists())
539 System.out.println("Can't find " + file);
547 protocol = AppletFormatAdapter.checkProtocol(file);
551 format = new IdentifyFile().identify(file, protocol);
552 } catch (FileFormatException e1)
557 AlignFrame af = fileLoader.LoadFileWaitTillLoaded(file, protocol,
561 System.out.println("error");
565 setCurrentAlignFrame(af);
566 data = aparser.getValue("colour", true);
569 data.replaceAll("%20", " ");
571 ColourSchemeI cs = ColourSchemeProperty
572 .getColourScheme(af.getViewport(),
573 af.getViewport().getAlignment(), data);
578 "CMD [-color " + data + "] executed successfully!");
583 // Must maintain ability to use the groups flag
584 data = aparser.getValue("groups", true);
587 af.parseFeaturesFile(data,
588 AppletFormatAdapter.checkProtocol(data));
589 // System.out.println("Added " + data);
591 "CMD groups[-" + data + "] executed successfully!");
593 data = aparser.getValue("features", true);
596 af.parseFeaturesFile(data,
597 AppletFormatAdapter.checkProtocol(data));
598 // System.out.println("Added " + data);
600 "CMD [-features " + data + "] executed successfully!");
603 data = aparser.getValue("annotations", true);
606 af.loadJalviewDataFile(data, null, null, null);
607 // System.out.println("Added " + data);
609 "CMD [-annotations " + data + "] executed successfully!");
611 // set or clear the sortbytree flag.
612 if (aparser.contains("sortbytree"))
614 af.getViewport().setSortByTree(true);
615 if (af.getViewport().getSortByTree())
617 System.out.println("CMD [-sortbytree] executed successfully!");
620 if (aparser.contains("no-annotation"))
622 af.getViewport().setShowAnnotation(false);
623 if (!af.getViewport().isShowAnnotation())
625 System.out.println("CMD no-annotation executed successfully!");
628 if (aparser.contains("nosortbytree"))
630 af.getViewport().setSortByTree(false);
631 if (!af.getViewport().getSortByTree())
634 .println("CMD [-nosortbytree] executed successfully!");
637 data = aparser.getValue("tree", true);
643 "CMD [-tree " + data + "] executed successfully!");
644 NewickFile nf = new NewickFile(data,
645 AppletFormatAdapter.checkProtocol(data));
647 .setCurrentTree(af.showNewickTree(nf, data).getTree());
648 } catch (IOException ex)
650 System.err.println("Couldn't add tree " + data);
651 ex.printStackTrace(System.err);
654 // TODO - load PDB structure(s) to alignment JAL-629
655 // (associate with identical sequence in alignment, or a specified
657 if (groovyscript != null)
659 // Execute the groovy script after we've done all the rendering stuff
660 // and before any images or figures are generated.
661 System.out.println("Executing script " + groovyscript);
662 executeGroovyScript(groovyscript, af);
663 System.out.println("CMD groovy[" + groovyscript
664 + "] executed successfully!");
667 String imageName = "unnamed.png";
668 while (aparser.getSize() > 1)
670 String outputFormat = aparser.nextValue();
671 file = aparser.nextValue();
673 if (outputFormat.equalsIgnoreCase("png"))
675 af.createPNG(new File(file));
676 imageName = (new File(file)).getName();
677 System.out.println("Creating PNG image: " + file);
680 else if (outputFormat.equalsIgnoreCase("svg"))
682 File imageFile = new File(file);
683 imageName = imageFile.getName();
684 af.createSVG(imageFile);
685 System.out.println("Creating SVG image: " + file);
688 else if (outputFormat.equalsIgnoreCase("html"))
690 File imageFile = new File(file);
691 imageName = imageFile.getName();
692 HtmlSvgOutput htmlSVG = new HtmlSvgOutput(af.alignPanel);
693 htmlSVG.exportHTML(file);
695 System.out.println("Creating HTML image: " + file);
698 else if (outputFormat.equalsIgnoreCase("biojsmsa"))
702 System.err.println("The output html file must not be null");
707 BioJsHTMLOutput.refreshVersionInfo(
708 BioJsHTMLOutput.BJS_TEMPLATES_LOCAL_DIRECTORY);
709 } catch (URISyntaxException e)
713 BioJsHTMLOutput bjs = new BioJsHTMLOutput(af.alignPanel);
714 bjs.exportHTML(file);
716 .println("Creating BioJS MSA Viwer HTML file: " + file);
719 else if (outputFormat.equalsIgnoreCase("imgMap"))
721 af.createImageMap(new File(file), imageName);
722 System.out.println("Creating image map: " + file);
725 else if (outputFormat.equalsIgnoreCase("eps"))
727 File outputFile = new File(file);
729 "Creating EPS file: " + outputFile.getAbsolutePath());
730 af.createEPS(outputFile);
734 if (af.saveAlignment(file, format))
736 System.out.println("Written alignment in " + format
737 + " format to " + file);
741 System.out.println("Error writing file " + file + " in "
742 + format + " format!!");
747 while (aparser.getSize() > 0)
749 System.out.println("Unknown arg: " + aparser.nextValue());
753 AlignFrame startUpAlframe = null;
754 // We'll only open the default file if the desktop is visible.
756 // ////////////////////
758 if (!headless && file == null && vamsasImport == null
759 && jalview.bin.Cache.getDefault("SHOW_STARTUP_FILE", true))
761 file = jalview.bin.Cache.getDefault("STARTUP_FILE",
762 jalview.bin.Cache.getDefault("www.jalview.org",
763 "http://www.jalview.org")
764 + "/examples/exampleFile_2_7.jar");
766 "http://www.jalview.org/examples/exampleFile_2_3.jar"))
768 // hardwire upgrade of the startup file
769 file.replace("_2_3.jar", "_2_7.jar");
770 // and remove the stale setting
771 jalview.bin.Cache.removeProperty("STARTUP_FILE");
774 protocol = DataSourceType.FILE;
776 if (file.indexOf("http:") > -1)
778 protocol = DataSourceType.URL;
781 if (file.endsWith(".jar"))
783 format = FileFormat.Jalview;
789 format = new IdentifyFile().identify(file, protocol);
790 } catch (FileFormatException e)
796 startUpAlframe = fileLoader.LoadFileWaitTillLoaded(file, protocol,
798 // extract groovy arguments before anything else.
801 // Once all other stuff is done, execute any groovy scripts (in order)
802 if (groovyscript != null)
804 if (Cache.groovyJarsPresent())
806 System.out.println("Executing script " + groovyscript);
807 executeGroovyScript(groovyscript, startUpAlframe);
812 "Sorry. Groovy Support is not available, so ignoring the provided groovy script "
816 // and finally, turn off batch mode indicator - if the desktop still exists
821 desktop.setProgressBar(null, progress);
823 desktop.setInBatchMode(false);
827 private static void showUsage()
830 "Usage: jalview -open [FILE] [OUTPUT_FORMAT] [OUTPUT_FILE]\n\n"
831 + "-nodisplay\tRun Jalview without User Interface.\n"
832 + "-props FILE\tUse the given Jalview properties file instead of users default.\n"
833 + "-colour COLOURSCHEME\tThe colourscheme to be applied to the alignment\n"
834 + "-annotations FILE\tAdd precalculated annotations to the alignment.\n"
835 + "-tree FILE\tLoad the given newick format tree file onto the alignment\n"
836 + "-features FILE\tUse the given file to mark features on the alignment.\n"
837 + "-fasta FILE\tCreate alignment file FILE in Fasta format.\n"
838 + "-clustal FILE\tCreate alignment file FILE in Clustal format.\n"
839 + "-pfam FILE\tCreate alignment file FILE in PFAM format.\n"
840 + "-msf FILE\tCreate alignment file FILE in MSF format.\n"
841 + "-pileup FILE\tCreate alignment file FILE in Pileup format\n"
842 + "-pir FILE\tCreate alignment file FILE in PIR format.\n"
843 + "-blc FILE\tCreate alignment file FILE in BLC format.\n"
844 + "-json FILE\tCreate alignment file FILE in JSON format.\n"
845 + "-jalview FILE\tCreate alignment file FILE in Jalview format.\n"
846 + "-png FILE\tCreate PNG image FILE from alignment.\n"
847 + "-svg FILE\tCreate SVG image FILE from alignment.\n"
848 + "-html FILE\tCreate HTML file from alignment.\n"
849 + "-biojsMSA FILE\tCreate BioJS MSA Viewer HTML file from alignment.\n"
850 + "-imgMap FILE\tCreate HTML file FILE with image map of PNG image.\n"
851 + "-eps FILE\tCreate EPS file FILE from alignment.\n"
852 + "-questionnaire URL\tQueries the given URL for information about any Jalview user questionnaires.\n"
853 + "-noquestionnaire\tTurn off questionnaire check.\n"
854 + "-nonews\tTurn off check for Jalview news.\n"
855 + "-nousagestats\tTurn off google analytics tracking for this session.\n"
856 + "-sortbytree OR -nosortbytree\tEnable or disable sorting of the given alignment by the given tree\n"
858 // "-setprop PROPERTY=VALUE\tSet the given Jalview property,
859 // after all other properties files have been read\n\t
860 // (quote the 'PROPERTY=VALUE' pair to ensure spaces are
861 // passed in correctly)"
862 + "-jabaws URL\tSpecify URL for Jabaws services (e.g. for a local installation).\n"
863 + "-fetchfrom nickname\tQuery nickname for features for the alignments and display them.\n"
865 // "-vdoc vamsas-document\tImport vamsas document into new
866 // session or join existing session with same URN\n"
867 // + "-vses vamsas-session\tJoin session with given URN\n"
868 + "-groovy FILE\tExecute groovy script in FILE, after all other arguments have been processed (if FILE is the text 'STDIN' then the file will be read from STDIN)\n"
869 + "\n~Read documentation in Application or visit http://www.jalview.org for description of Features and Annotations file~\n\n");
872 private static void startUsageStats(final Desktop desktop)
875 * start a User Config prompt asking if we can log usage statistics.
877 PromptUserConfig prompter = new PromptUserConfig(Desktop.desktop,
878 "USAGESTATS", "Jalview Usage Statistics",
879 "Do you want to help make Jalview better by enabling "
880 + "the collection of usage statistics with Google Analytics ?"
881 + "\n\n(you can enable or disable usage tracking in the preferences)",
888 "Initialising googletracker for usage stats.");
889 Cache.initGoogleTracker();
890 Cache.log.debug("Tracking enabled.");
897 Cache.log.debug("Not enabling Google Tracking.");
900 desktop.addDialogThread(prompter);
904 * Locate the given string as a file and pass it to the groovy interpreter.
906 * @param groovyscript
907 * the script to execute
908 * @param jalviewContext
909 * the Jalview Desktop object passed in to the groovy binding as the
912 private void executeGroovyScript(String groovyscript, AlignFrame af)
915 * for scripts contained in files
922 if (groovyscript.trim().equals("STDIN"))
924 // read from stdin into a tempfile and execute it
927 tfile = File.createTempFile("jalview", "groovy");
928 PrintWriter outfile = new PrintWriter(
929 new OutputStreamWriter(new FileOutputStream(tfile)));
930 BufferedReader br = new BufferedReader(
931 new InputStreamReader(System.in));
933 while ((line = br.readLine()) != null)
935 outfile.write(line + "\n");
941 } catch (Exception ex)
943 System.err.println("Failed to read from STDIN into tempfile "
944 + ((tfile == null) ? "(tempfile wasn't created)"
945 : tfile.toString()));
946 ex.printStackTrace();
951 sfile = tfile.toURI().toURL();
952 } catch (Exception x)
955 "Unexpected Malformed URL Exception for temporary file created from STDIN: "
965 sfile = new URI(groovyscript).toURL();
966 } catch (Exception x)
968 tfile = new File(groovyscript);
971 System.err.println("File '" + groovyscript + "' does not exist.");
974 if (!tfile.canRead())
976 System.err.println("File '" + groovyscript + "' cannot be read.");
979 if (tfile.length() < 1)
981 System.err.println("File '" + groovyscript + "' is empty.");
986 sfile = tfile.getAbsoluteFile().toURI().toURL();
987 } catch (Exception ex)
989 System.err.println("Failed to create a file URL for "
990 + tfile.getAbsoluteFile());
997 Map<String, java.lang.Object> vbinding = new HashMap<>();
998 vbinding.put("Jalview", this);
1001 vbinding.put("currentAlFrame", af);
1003 Binding gbinding = new Binding(vbinding);
1004 GroovyScriptEngine gse = new GroovyScriptEngine(new URL[] { sfile });
1005 gse.run(sfile.toString(), gbinding);
1006 if ("STDIN".equals(groovyscript))
1008 // delete temp file that we made -
1009 // only if it was successfully executed
1012 } catch (Exception e)
1014 System.err.println("Exception Whilst trying to execute file " + sfile
1015 + " as a groovy script.");
1016 e.printStackTrace(System.err);
1021 public static boolean isHeadlessMode()
1023 String isheadless = System.getProperty("java.awt.headless");
1024 if (isheadless != null && isheadless.equalsIgnoreCase("true"))
1031 public AlignFrame[] getAlignFrames()
1033 return desktop == null ? new AlignFrame[] { getCurrentAlignFrame() }
1034 : Desktop.getAlignFrames();
1039 * Quit method delegates to Desktop.quit - unless running in headless mode
1040 * when it just ends the JVM
1044 if (desktop != null)
1054 public static AlignFrame getCurrentAlignFrame()
1056 return Jalview.currentAlignFrame;
1059 public static void setCurrentAlignFrame(AlignFrame currentAlignFrame)
1061 Jalview.currentAlignFrame = currentAlignFrame;