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.awt.Image;
45 import java.awt.Taskbar;
46 import java.io.BufferedReader;
48 import java.io.FileOutputStream;
49 import java.io.IOException;
50 import java.io.InputStreamReader;
51 import java.io.OutputStreamWriter;
52 import java.io.PrintWriter;
53 import java.net.MalformedURLException;
55 import java.net.URISyntaxException;
57 import java.security.AllPermission;
58 import java.security.CodeSource;
59 import java.security.PermissionCollection;
60 import java.security.Permissions;
61 import java.security.Policy;
62 import java.util.HashMap;
64 import java.util.Vector;
66 import javax.swing.LookAndFeel;
67 import javax.swing.UIManager;
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 ArgsParser aparser = new ArgsParser(args);
207 boolean headless = false;
209 if (aparser.contains("help") || aparser.contains("h"))
214 if (aparser.contains("nodisplay") || aparser.contains("nogui")
215 || aparser.contains("headless"))
217 System.setProperty("java.awt.headless", "true");
220 String usrPropsFile = aparser.getValue("props");
221 Cache.loadProperties(usrPropsFile); // must do this before
222 if (usrPropsFile != null)
225 "CMD [-props " + usrPropsFile + "] executed successfully!");
230 final String jabawsUrl = aparser.getValue("jabaws");
231 if (jabawsUrl != null)
235 Jws2Discoverer.getDiscoverer().setPreferredUrl(jabawsUrl);
237 "CMD [-jabaws " + jabawsUrl + "] executed successfully!");
238 } catch (MalformedURLException e)
241 "Invalid jabaws parameter: " + jabawsUrl + " ignored");
245 String defs = aparser.getValue("setprop");
248 int p = defs.indexOf('=');
251 System.err.println("Ignoring invalid setprop argument : " + defs);
255 System.out.println("Executing setprop argument: " + defs);
256 // DISABLED FOR SECURITY REASONS
257 // TODO: add a property to allow properties to be overriden by cli args
258 // Cache.setProperty(defs.substring(0,p), defs.substring(p+1));
260 defs = aparser.getValue("setprop");
262 if (System.getProperty("java.awt.headless") != null
263 && System.getProperty("java.awt.headless").equals("true"))
267 System.setProperty("http.agent",
268 "Jalview Desktop/" + Cache.getDefault("VERSION", "Unknown"));
272 } catch (NoClassDefFoundError error)
274 error.printStackTrace();
275 System.out.println("\nEssential logging libraries not found."
276 + "\nUse: java -classpath \"$PATH_TO_LIB$/*:$PATH_TO_CLASSES$\" jalview.bin.Jalview");
284 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
285 } catch (Exception ex)
287 System.err.println("Unexpected Look and Feel Exception");
288 ex.printStackTrace();
290 if (Platform.isAMac())
293 LookAndFeel lookAndFeel = ch.randelshofer.quaqua.QuaquaManager
295 System.setProperty("com.apple.mrj.application.apple.menu.about.name",
297 System.setProperty("apple.laf.useScreenMenuBar", "true");
298 if (lookAndFeel != null)
302 UIManager.setLookAndFeel(lookAndFeel);
303 } catch (Throwable e)
306 "Failed to set QuaQua look and feel: " + e.toString());
309 if (lookAndFeel == null || !(lookAndFeel.getClass()
310 .isAssignableFrom(UIManager.getLookAndFeel().getClass()))
311 || !UIManager.getLookAndFeel().getClass().toString()
312 .toLowerCase().contains("quaqua"))
317 "Quaqua LaF not available on this plaform. Using VAqua(4).\nSee https://issues.jalview.org/browse/JAL-2976");
318 UIManager.setLookAndFeel("org.violetlib.aqua.AquaLookAndFeel");
319 } catch (Throwable e)
322 "Failed to reset look and feel: " + e.toString());
328 * configure 'full' SO model if preferences say to,
329 * else use the default (SO Lite)
331 if (Cache.getDefault("USE_FULL_SO", false))
333 SequenceOntologyFactory.setInstance(new SequenceOntology());
338 desktop = new Desktop();
339 desktop.setInBatchMode(true); // indicate we are starting up
341 if (Taskbar.isTaskbarSupported())
343 Taskbar tb = Taskbar.getTaskbar();
344 if (tb.isSupported(Taskbar.Feature.ICON_IMAGE))
348 java.net.URL url = getClass()
349 .getResource("/images/JalviewLogo_Huge.png");
352 Image image = java.awt.Toolkit.getDefaultToolkit()
354 tb.setIconImage(image);
356 } catch (Exception e)
363 desktop.setVisible(true);
364 desktop.startServiceDiscovery();
365 if (!aparser.contains("nousagestats"))
367 startUsageStats(desktop);
371 System.err.println("CMD [-nousagestats] executed successfully!");
374 if (!aparser.contains("noquestionnaire"))
376 String url = aparser.getValue("questionnaire");
379 // Start the desktop questionnaire prompter with the specified
381 Cache.log.debug("Starting questionnaire url at " + url);
382 desktop.checkForQuestionnaire(url);
384 "CMD questionnaire[-" + url + "] executed successfully!");
388 if (Cache.getProperty("NOQUESTIONNAIRES") == null)
390 // Start the desktop questionnaire prompter with the specified
393 // "http://anaplog.compbio.dundee.ac.uk/cgi-bin/questionnaire.pl";
395 String defurl = "http://www.jalview.org/cgi-bin/questionnaire.pl";
397 "Starting questionnaire with default url: " + defurl);
398 desktop.checkForQuestionnaire(defurl);
404 System.err.println("CMD [-noquestionnaire] executed successfully!");
407 if (!aparser.contains("nonews"))
409 desktop.checkForNews();
412 BioJsHTMLOutput.updateBioJS();
415 String file = null, data = null;
416 FileFormatI format = null;
417 DataSourceType protocol = null;
418 FileLoader fileLoader = new FileLoader(!headless);
420 String groovyscript = null; // script to execute after all loading is
421 // completed one way or another
422 // extract groovy argument and execute if necessary
423 groovyscript = aparser.getValue("groovy", true);
424 file = aparser.getValue("open", true);
426 if (file == null && desktop == null)
428 System.out.println("No files to open!");
431 String vamsasImport = aparser.getValue("vdoc");
432 String vamsasSession = aparser.getValue("vsess");
433 if (vamsasImport != null || vamsasSession != null)
435 if (desktop == null || headless)
438 "Headless vamsas sessions not yet supported. Sorry.");
441 // if we have a file, start a new session and import it.
442 boolean inSession = false;
443 if (vamsasImport != null)
447 DataSourceType viprotocol = AppletFormatAdapter
448 .checkProtocol(vamsasImport);
449 if (viprotocol == DataSourceType.FILE)
451 inSession = desktop.vamsasImport(new File(vamsasImport));
453 else if (viprotocol == DataSourceType.URL)
455 inSession = desktop.vamsasImport(new URL(vamsasImport));
458 } catch (Exception e)
460 System.err.println("Exeption when importing " + vamsasImport
461 + " as a vamsas document.");
466 System.err.println("Failed to import " + vamsasImport
467 + " as a vamsas document.");
471 System.out.println("Imported Successfully into new session "
472 + desktop.getVamsasApplication().getCurrentSession());
475 if (vamsasSession != null)
477 if (vamsasImport != null)
479 // close the newly imported session and import the Jalview specific
480 // remnants into the new session later on.
481 desktop.vamsasStop_actionPerformed(null);
483 // now join the new session
486 if (desktop.joinVamsasSession(vamsasSession))
489 "Successfully joined vamsas session " + vamsasSession);
493 System.err.println("WARNING: Failed to join vamsas session "
496 } catch (Exception e)
499 "ERROR: Failed to join vamsas session " + vamsasSession);
502 if (vamsasImport != null)
504 // the Jalview specific remnants can now be imported into the new
505 // session at the user's leisure.
507 "Skipping Push for import of data into existing vamsas session."); // TODO:
512 // desktop.getVamsasApplication().push_update();
517 // Finally, deal with the remaining input data.
522 desktop.setProgressBar(
524 .getString("status.processing_commandline_args"),
525 progress = System.currentTimeMillis());
527 System.out.println("CMD [-open " + file + "] executed successfully!");
529 if (!file.startsWith("http://"))
531 if (!(new File(file)).exists())
533 System.out.println("Can't find " + file);
541 protocol = AppletFormatAdapter.checkProtocol(file);
545 format = new IdentifyFile().identify(file, protocol);
546 } catch (FileFormatException e1)
551 AlignFrame af = fileLoader.LoadFileWaitTillLoaded(file, protocol,
555 System.out.println("error");
559 setCurrentAlignFrame(af);
560 data = aparser.getValue("colour", true);
563 data.replaceAll("%20", " ");
565 ColourSchemeI cs = ColourSchemeProperty
566 .getColourScheme(af.getViewport(),
567 af.getViewport().getAlignment(), data);
572 "CMD [-color " + data + "] executed successfully!");
577 // Must maintain ability to use the groups flag
578 data = aparser.getValue("groups", true);
581 af.parseFeaturesFile(data,
582 AppletFormatAdapter.checkProtocol(data));
583 // System.out.println("Added " + data);
585 "CMD groups[-" + data + "] executed successfully!");
587 data = aparser.getValue("features", true);
590 af.parseFeaturesFile(data,
591 AppletFormatAdapter.checkProtocol(data));
592 // System.out.println("Added " + data);
594 "CMD [-features " + data + "] executed successfully!");
597 data = aparser.getValue("annotations", true);
600 af.loadJalviewDataFile(data, null, null, null);
601 // System.out.println("Added " + data);
603 "CMD [-annotations " + data + "] executed successfully!");
605 // set or clear the sortbytree flag.
606 if (aparser.contains("sortbytree"))
608 af.getViewport().setSortByTree(true);
609 if (af.getViewport().getSortByTree())
611 System.out.println("CMD [-sortbytree] executed successfully!");
614 if (aparser.contains("no-annotation"))
616 af.getViewport().setShowAnnotation(false);
617 if (!af.getViewport().isShowAnnotation())
619 System.out.println("CMD no-annotation executed successfully!");
622 if (aparser.contains("nosortbytree"))
624 af.getViewport().setSortByTree(false);
625 if (!af.getViewport().getSortByTree())
628 .println("CMD [-nosortbytree] executed successfully!");
631 data = aparser.getValue("tree", true);
637 "CMD [-tree " + data + "] executed successfully!");
638 NewickFile nf = new NewickFile(data,
639 AppletFormatAdapter.checkProtocol(data));
641 .setCurrentTree(af.showNewickTree(nf, data).getTree());
642 } catch (IOException ex)
644 System.err.println("Couldn't add tree " + data);
645 ex.printStackTrace(System.err);
648 // TODO - load PDB structure(s) to alignment JAL-629
649 // (associate with identical sequence in alignment, or a specified
651 if (groovyscript != null)
653 // Execute the groovy script after we've done all the rendering stuff
654 // and before any images or figures are generated.
655 System.out.println("Executing script " + groovyscript);
656 executeGroovyScript(groovyscript, af);
657 System.out.println("CMD groovy[" + groovyscript
658 + "] executed successfully!");
661 String imageName = "unnamed.png";
662 while (aparser.getSize() > 1)
664 String outputFormat = aparser.nextValue();
665 file = aparser.nextValue();
667 if (outputFormat.equalsIgnoreCase("png"))
669 af.createPNG(new File(file));
670 imageName = (new File(file)).getName();
671 System.out.println("Creating PNG image: " + file);
674 else if (outputFormat.equalsIgnoreCase("svg"))
676 File imageFile = new File(file);
677 imageName = imageFile.getName();
678 af.createSVG(imageFile);
679 System.out.println("Creating SVG image: " + file);
682 else if (outputFormat.equalsIgnoreCase("html"))
684 File imageFile = new File(file);
685 imageName = imageFile.getName();
686 HtmlSvgOutput htmlSVG = new HtmlSvgOutput(af.alignPanel);
687 htmlSVG.exportHTML(file);
689 System.out.println("Creating HTML image: " + file);
692 else if (outputFormat.equalsIgnoreCase("biojsmsa"))
696 System.err.println("The output html file must not be null");
701 BioJsHTMLOutput.refreshVersionInfo(
702 BioJsHTMLOutput.BJS_TEMPLATES_LOCAL_DIRECTORY);
703 } catch (URISyntaxException e)
707 BioJsHTMLOutput bjs = new BioJsHTMLOutput(af.alignPanel);
708 bjs.exportHTML(file);
710 .println("Creating BioJS MSA Viwer HTML file: " + file);
713 else if (outputFormat.equalsIgnoreCase("imgMap"))
715 af.createImageMap(new File(file), imageName);
716 System.out.println("Creating image map: " + file);
719 else if (outputFormat.equalsIgnoreCase("eps"))
721 File outputFile = new File(file);
723 "Creating EPS file: " + outputFile.getAbsolutePath());
724 af.createEPS(outputFile);
728 if (af.saveAlignment(file, format))
730 System.out.println("Written alignment in " + format
731 + " format to " + file);
735 System.out.println("Error writing file " + file + " in "
736 + format + " format!!");
741 while (aparser.getSize() > 0)
743 System.out.println("Unknown arg: " + aparser.nextValue());
747 AlignFrame startUpAlframe = null;
748 // We'll only open the default file if the desktop is visible.
750 // ////////////////////
752 if (!headless && file == null && vamsasImport == null
753 && jalview.bin.Cache.getDefault("SHOW_STARTUP_FILE", true))
755 file = jalview.bin.Cache.getDefault("STARTUP_FILE",
756 jalview.bin.Cache.getDefault("www.jalview.org",
757 "http://www.jalview.org")
758 + "/examples/exampleFile_2_7.jar");
760 "http://www.jalview.org/examples/exampleFile_2_3.jar"))
762 // hardwire upgrade of the startup file
763 file.replace("_2_3.jar", "_2_7.jar");
764 // and remove the stale setting
765 jalview.bin.Cache.removeProperty("STARTUP_FILE");
768 protocol = DataSourceType.FILE;
770 if (file.indexOf("http:") > -1)
772 protocol = DataSourceType.URL;
775 if (file.endsWith(".jar"))
777 format = FileFormat.Jalview;
783 format = new IdentifyFile().identify(file, protocol);
784 } catch (FileFormatException e)
790 startUpAlframe = fileLoader.LoadFileWaitTillLoaded(file, protocol,
792 // extract groovy arguments before anything else.
795 // Once all other stuff is done, execute any groovy scripts (in order)
796 if (groovyscript != null)
798 if (Cache.groovyJarsPresent())
800 System.out.println("Executing script " + groovyscript);
801 executeGroovyScript(groovyscript, startUpAlframe);
806 "Sorry. Groovy Support is not available, so ignoring the provided groovy script "
810 // and finally, turn off batch mode indicator - if the desktop still exists
815 desktop.setProgressBar(null, progress);
817 desktop.setInBatchMode(false);
821 private static void showUsage()
824 "Usage: jalview -open [FILE] [OUTPUT_FORMAT] [OUTPUT_FILE]\n\n"
825 + "-nodisplay\tRun Jalview without User Interface.\n"
826 + "-props FILE\tUse the given Jalview properties file instead of users default.\n"
827 + "-colour COLOURSCHEME\tThe colourscheme to be applied to the alignment\n"
828 + "-annotations FILE\tAdd precalculated annotations to the alignment.\n"
829 + "-tree FILE\tLoad the given newick format tree file onto the alignment\n"
830 + "-features FILE\tUse the given file to mark features on the alignment.\n"
831 + "-fasta FILE\tCreate alignment file FILE in Fasta format.\n"
832 + "-clustal FILE\tCreate alignment file FILE in Clustal format.\n"
833 + "-pfam FILE\tCreate alignment file FILE in PFAM format.\n"
834 + "-msf FILE\tCreate alignment file FILE in MSF format.\n"
835 + "-pileup FILE\tCreate alignment file FILE in Pileup format\n"
836 + "-pir FILE\tCreate alignment file FILE in PIR format.\n"
837 + "-blc FILE\tCreate alignment file FILE in BLC format.\n"
838 + "-json FILE\tCreate alignment file FILE in JSON format.\n"
839 + "-jalview FILE\tCreate alignment file FILE in Jalview format.\n"
840 + "-png FILE\tCreate PNG image FILE from alignment.\n"
841 + "-svg FILE\tCreate SVG image FILE from alignment.\n"
842 + "-html FILE\tCreate HTML file from alignment.\n"
843 + "-biojsMSA FILE\tCreate BioJS MSA Viewer HTML file from alignment.\n"
844 + "-imgMap FILE\tCreate HTML file FILE with image map of PNG image.\n"
845 + "-eps FILE\tCreate EPS file FILE from alignment.\n"
846 + "-questionnaire URL\tQueries the given URL for information about any Jalview user questionnaires.\n"
847 + "-noquestionnaire\tTurn off questionnaire check.\n"
848 + "-nonews\tTurn off check for Jalview news.\n"
849 + "-nousagestats\tTurn off google analytics tracking for this session.\n"
850 + "-sortbytree OR -nosortbytree\tEnable or disable sorting of the given alignment by the given tree\n"
852 // "-setprop PROPERTY=VALUE\tSet the given Jalview property,
853 // after all other properties files have been read\n\t
854 // (quote the 'PROPERTY=VALUE' pair to ensure spaces are
855 // passed in correctly)"
856 + "-jabaws URL\tSpecify URL for Jabaws services (e.g. for a local installation).\n"
857 + "-fetchfrom nickname\tQuery nickname for features for the alignments and display them.\n"
859 // "-vdoc vamsas-document\tImport vamsas document into new
860 // session or join existing session with same URN\n"
861 // + "-vses vamsas-session\tJoin session with given URN\n"
862 + "-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"
863 + "\n~Read documentation in Application or visit http://www.jalview.org for description of Features and Annotations file~\n\n");
866 private static void startUsageStats(final Desktop desktop)
869 * start a User Config prompt asking if we can log usage statistics.
871 PromptUserConfig prompter = new PromptUserConfig(Desktop.desktop,
872 "USAGESTATS", "Jalview Usage Statistics",
873 "Do you want to help make Jalview better by enabling "
874 + "the collection of usage statistics with Google Analytics ?"
875 + "\n\n(you can enable or disable usage tracking in the preferences)",
882 "Initialising googletracker for usage stats.");
883 Cache.initGoogleTracker();
884 Cache.log.debug("Tracking enabled.");
891 Cache.log.debug("Not enabling Google Tracking.");
894 desktop.addDialogThread(prompter);
898 * Locate the given string as a file and pass it to the groovy interpreter.
900 * @param groovyscript
901 * the script to execute
902 * @param jalviewContext
903 * the Jalview Desktop object passed in to the groovy binding as the
906 private void executeGroovyScript(String groovyscript, AlignFrame af)
909 * for scripts contained in files
916 if (groovyscript.trim().equals("STDIN"))
918 // read from stdin into a tempfile and execute it
921 tfile = File.createTempFile("jalview", "groovy");
922 PrintWriter outfile = new PrintWriter(
923 new OutputStreamWriter(new FileOutputStream(tfile)));
924 BufferedReader br = new BufferedReader(
925 new InputStreamReader(System.in));
927 while ((line = br.readLine()) != null)
929 outfile.write(line + "\n");
935 } catch (Exception ex)
937 System.err.println("Failed to read from STDIN into tempfile "
938 + ((tfile == null) ? "(tempfile wasn't created)"
939 : tfile.toString()));
940 ex.printStackTrace();
945 sfile = tfile.toURI().toURL();
946 } catch (Exception x)
949 "Unexpected Malformed URL Exception for temporary file created from STDIN: "
959 sfile = new URI(groovyscript).toURL();
960 } catch (Exception x)
962 tfile = new File(groovyscript);
965 System.err.println("File '" + groovyscript + "' does not exist.");
968 if (!tfile.canRead())
970 System.err.println("File '" + groovyscript + "' cannot be read.");
973 if (tfile.length() < 1)
975 System.err.println("File '" + groovyscript + "' is empty.");
980 sfile = tfile.getAbsoluteFile().toURI().toURL();
981 } catch (Exception ex)
983 System.err.println("Failed to create a file URL for "
984 + tfile.getAbsoluteFile());
991 Map<String, Object> vbinding = new HashMap<>();
992 vbinding.put("Jalview", this);
995 vbinding.put("currentAlFrame", af);
997 Binding gbinding = new Binding(vbinding);
998 GroovyScriptEngine gse = new GroovyScriptEngine(new URL[] { sfile });
999 gse.run(sfile.toString(), gbinding);
1000 if ("STDIN".equals(groovyscript))
1002 // delete temp file that we made -
1003 // only if it was successfully executed
1006 } catch (Exception e)
1008 System.err.println("Exception Whilst trying to execute file " + sfile
1009 + " as a groovy script.");
1010 e.printStackTrace(System.err);
1015 public static boolean isHeadlessMode()
1017 String isheadless = System.getProperty("java.awt.headless");
1018 if (isheadless != null && isheadless.equalsIgnoreCase("true"))
1025 public AlignFrame[] getAlignFrames()
1027 return desktop == null ? new AlignFrame[] { getCurrentAlignFrame() }
1028 : Desktop.getAlignFrames();
1033 * Quit method delegates to Desktop.quit - unless running in headless mode
1034 * when it just ends the JVM
1038 if (desktop != null)
1048 public static AlignFrame getCurrentAlignFrame()
1050 return Jalview.currentAlignFrame;
1053 public static void setCurrentAlignFrame(AlignFrame currentAlignFrame)
1055 Jalview.currentAlignFrame = currentAlignFrame;