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 groovy.lang.Binding;
24 import groovy.util.GroovyScriptEngine;
26 import jalview.gui.AlignFrame;
27 import jalview.gui.Desktop;
28 import jalview.gui.PromptUserConfig;
29 import jalview.io.AppletFormatAdapter;
30 import jalview.io.BioJsHTMLOutput;
31 import jalview.io.FileLoader;
32 import jalview.io.FormatAdapter;
33 import jalview.io.HtmlSvgOutput;
34 import jalview.io.IdentifyFile;
35 import jalview.io.NewickFile;
36 import jalview.schemes.ColourSchemeI;
37 import jalview.schemes.ColourSchemeProperty;
38 import jalview.schemes.UserColourScheme;
39 import jalview.util.MessageManager;
40 import jalview.util.Platform;
41 import jalview.ws.jws2.Jws2Discoverer;
43 import java.io.BufferedReader;
45 import java.io.FileOutputStream;
46 import java.io.IOException;
47 import java.io.InputStreamReader;
48 import java.io.OutputStreamWriter;
49 import java.io.PrintWriter;
50 import java.net.MalformedURLException;
53 import java.security.AllPermission;
54 import java.security.CodeSource;
55 import java.security.PermissionCollection;
56 import java.security.Permissions;
57 import java.security.Policy;
58 import java.util.HashMap;
60 import java.util.Vector;
62 import javax.swing.UIManager;
65 * Main class for Jalview Application <br>
67 * start with java -Djava.ext.dirs=$PATH_TO_LIB$ jalview.bin.Jalview
75 * singleton instance of this class
77 private static Jalview instance;
79 private Desktop desktop;
81 public static AlignFrame currentAlignFrame;
85 // grab all the rights we can the JVM
86 Policy.setPolicy(new Policy()
89 public PermissionCollection getPermissions(CodeSource codesource)
91 Permissions perms = new Permissions();
92 perms.add(new AllPermission());
104 * keep track of feature fetching tasks.
112 * TODO: generalise to track all jalview events to orchestrate batch
116 private int queued = 0;
118 private int running = 0;
120 public FeatureFetcher()
125 public void addFetcher(final AlignFrame af,
126 final Vector<String> dasSources)
128 final long id = System.currentTimeMillis();
130 final FeatureFetcher us = this;
131 new Thread(new Runnable()
143 af.setProgressBar(MessageManager
144 .getString("status.das_features_being_retrived"), id);
145 af.featureSettings_actionPerformed(null);
146 af.featureSettings.fetchDasFeatures(dasSources, true);
147 af.setProgressBar(null, id);
156 public synchronized boolean allFinished()
158 return queued == 0 && running == 0;
163 public static Jalview getInstance()
169 * main class for Jalview application
172 * open <em>filename</em>
174 public static void main(String[] args)
176 instance = new Jalview();
177 instance.doMain(args);
183 void doMain(String[] args)
185 System.setSecurityManager(null);
186 System.out.println("Java version: "
187 + System.getProperty("java.version"));
188 System.out.println(System.getProperty("os.arch") + " "
189 + System.getProperty("os.name") + " "
190 + System.getProperty("os.version"));
192 ArgsParser aparser = new ArgsParser(args);
193 boolean headless = false;
195 if (aparser.contains("help") || aparser.contains("h"))
200 if (aparser.contains("nodisplay") || aparser.contains("nogui")
201 || aparser.contains("headless"))
203 System.setProperty("java.awt.headless", "true");
206 String usrPropsFile = aparser.getValue("props");
207 Cache.loadProperties(usrPropsFile); // must do this before
208 if (usrPropsFile != null)
210 System.out.println("CMD [-props " + usrPropsFile
211 + "] executed successfully!");
216 final String jabawsUrl = aparser.getValue("jabaws");
217 if (jabawsUrl != null)
221 Jws2Discoverer.getDiscoverer().setPreferredUrl(jabawsUrl);
222 System.out.println("CMD [-jabaws " + jabawsUrl
223 + "] executed successfully!");
224 } catch (MalformedURLException e)
226 System.err.println("Invalid jabaws parameter: " + jabawsUrl
231 String defs = aparser.getValue("setprop");
234 int p = defs.indexOf('=');
237 System.err.println("Ignoring invalid setprop argument : " + defs);
241 System.out.println("Executing setprop argument: " + defs);
242 // DISABLED FOR SECURITY REASONS
243 // TODO: add a property to allow properties to be overriden by cli args
244 // Cache.setProperty(defs.substring(0,p), defs.substring(p+1));
246 defs = aparser.getValue("setprop");
248 if (System.getProperty("java.awt.headless") != null
249 && System.getProperty("java.awt.headless").equals("true"))
253 System.setProperty("http.agent",
254 "Jalview Desktop/" + Cache.getDefault("VERSION", "Unknown"));
258 } catch (NoClassDefFoundError error)
260 error.printStackTrace();
262 .println("\nEssential logging libraries not found."
263 + "\nUse: java -Djava.ext.dirs=$PATH_TO_LIB$ jalview.bin.Jalview");
271 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
272 } catch (Exception ex)
275 if (Platform.isAMac())
277 System.setProperty("com.apple.mrj.application.apple.menu.about.name",
279 System.setProperty("apple.laf.useScreenMenuBar", "true");
282 UIManager.setLookAndFeel(ch.randelshofer.quaqua.QuaquaManager
284 } catch (Throwable e)
286 System.err.println("Failed to set QuaQua look and feel: "
293 desktop = new Desktop();
294 desktop.setInBatchMode(true); // indicate we are starting up
295 desktop.setVisible(true);
296 desktop.startServiceDiscovery();
297 if (!aparser.contains("nousagestats"))
299 startUsageStats(desktop);
303 System.err.println("CMD [-nousagestats] executed successfully!");
306 if (!aparser.contains("noquestionnaire"))
308 String url = aparser.getValue("questionnaire");
311 // Start the desktop questionnaire prompter with the specified
313 Cache.log.debug("Starting questionnaire url at " + url);
314 desktop.checkForQuestionnaire(url);
315 System.out.println("CMD questionnaire[-" + url
316 + "] executed successfully!");
320 if (Cache.getProperty("NOQUESTIONNAIRES") == null)
322 // Start the desktop questionnaire prompter with the specified
325 // "http://anaplog.compbio.dundee.ac.uk/cgi-bin/questionnaire.pl";
327 String defurl = "http://www.jalview.org/cgi-bin/questionnaire.pl";
328 Cache.log.debug("Starting questionnaire with default url: "
330 desktop.checkForQuestionnaire(defurl);
337 System.err.println("CMD [-noquestionnaire] executed successfully!");
339 if (!aparser.contains("nonews"))
341 desktop.checkForNews();
345 if (!isHeadlessMode())
347 BioJsHTMLOutput.updateBioJS();
350 String file = null, protocol = null, format = null, data = null;
351 FileLoader fileLoader = new FileLoader(!headless);
352 Vector<String> getFeatures = null; // vector of das source nicknames to
356 String groovyscript = null; // script to execute after all loading is
357 // completed one way or another
358 // extract groovy argument and execute if necessary
359 groovyscript = aparser.getValue("groovy", true);
360 file = aparser.getValue("open", true);
362 if (file == null && desktop == null)
364 System.out.println("No files to open!");
367 String vamsasImport = aparser.getValue("vdoc");
368 String vamsasSession = aparser.getValue("vsess");
369 if (vamsasImport != null || vamsasSession != null)
371 if (desktop == null || headless)
374 .println("Headless vamsas sessions not yet supported. Sorry.");
377 // if we have a file, start a new session and import it.
378 boolean inSession = false;
379 if (vamsasImport != null)
383 String viprotocol = AppletFormatAdapter
384 .checkProtocol(vamsasImport);
385 if (viprotocol == jalview.io.FormatAdapter.FILE)
387 inSession = desktop.vamsasImport(new File(vamsasImport));
389 else if (viprotocol == FormatAdapter.URL)
391 inSession = desktop.vamsasImport(new URL(vamsasImport));
394 } catch (Exception e)
396 System.err.println("Exeption when importing " + vamsasImport
397 + " as a vamsas document.");
402 System.err.println("Failed to import " + vamsasImport
403 + " as a vamsas document.");
407 System.out.println("Imported Successfully into new session "
408 + desktop.getVamsasApplication().getCurrentSession());
411 if (vamsasSession != null)
413 if (vamsasImport != null)
415 // close the newly imported session and import the Jalview specific
416 // remnants into the new session later on.
417 desktop.vamsasStop_actionPerformed(null);
419 // now join the new session
422 if (desktop.joinVamsasSession(vamsasSession))
424 System.out.println("Successfully joined vamsas session "
429 System.err.println("WARNING: Failed to join vamsas session "
432 } catch (Exception e)
434 System.err.println("ERROR: Failed to join vamsas session "
438 if (vamsasImport != null)
440 // the Jalview specific remnants can now be imported into the new
441 // session at the user's leisure.
443 .info("Skipping Push for import of data into existing vamsas session."); // TODO:
448 // desktop.getVamsasApplication().push_update();
453 // Finally, deal with the remaining input data.
458 desktop.setProgressBar(MessageManager
459 .getString("status.processing_commandline_args"),
460 progress = System.currentTimeMillis());
462 System.out.println("CMD [-open " + file + "] executed successfully!");
464 if (!file.startsWith("http://"))
466 if (!(new File(file)).exists())
468 System.out.println("Can't find " + file);
476 protocol = AppletFormatAdapter.checkProtocol(file);
478 format = new IdentifyFile().identify(file, protocol);
480 AlignFrame af = fileLoader.LoadFileWaitTillLoaded(file, protocol,
484 System.out.println("error");
488 setCurrentAlignFrame(af);
489 data = aparser.getValue("colour", true);
492 data.replaceAll("%20", " ");
494 ColourSchemeI cs = ColourSchemeProperty.getColour(af
495 .getViewport().getAlignment(), data);
499 UserColourScheme ucs = new UserColourScheme("white");
500 ucs.parseAppletParameter(data);
505 System.out.println("CMD [-color " + data
506 + "] executed successfully!");
511 // Must maintain ability to use the groups flag
512 data = aparser.getValue("groups", true);
515 af.parseFeaturesFile(data,
516 AppletFormatAdapter.checkProtocol(data));
517 // System.out.println("Added " + data);
518 System.out.println("CMD groups[-" + data
519 + "] executed successfully!");
521 data = aparser.getValue("features", true);
524 af.parseFeaturesFile(data,
525 AppletFormatAdapter.checkProtocol(data));
526 // System.out.println("Added " + data);
527 System.out.println("CMD [-features " + data
528 + "] executed successfully!");
531 data = aparser.getValue("annotations", true);
534 af.loadJalviewDataFile(data, null, null, null);
535 // System.out.println("Added " + data);
536 System.out.println("CMD [-annotations " + data
537 + "] executed successfully!");
539 // set or clear the sortbytree flag.
540 if (aparser.contains("sortbytree"))
542 af.getViewport().setSortByTree(true);
543 if (af.getViewport().getSortByTree())
545 System.out.println("CMD [-sortbytree] executed successfully!");
548 if (aparser.contains("no-annotation"))
550 af.getViewport().setShowAnnotation(false);
551 if (!af.getViewport().isShowAnnotation())
553 System.out.println("CMD no-annotation executed successfully!");
556 if (aparser.contains("nosortbytree"))
558 af.getViewport().setSortByTree(false);
559 if (!af.getViewport().getSortByTree())
562 .println("CMD [-nosortbytree] executed successfully!");
565 data = aparser.getValue("tree", true);
568 jalview.io.NewickFile fin = null;
571 System.out.println("CMD [-tree " + data
572 + "] executed successfully!");
573 fin = new NewickFile(data,
574 AppletFormatAdapter.checkProtocol(data));
577 af.getViewport().setCurrentTree(
578 af.ShowNewickTree(fin, data).getTree());
580 } catch (IOException ex)
582 System.err.println("Couldn't add tree " + data);
583 ex.printStackTrace(System.err);
586 // TODO - load PDB structure(s) to alignment JAL-629
587 // (associate with identical sequence in alignment, or a specified
590 getFeatures = checkDasArguments(aparser);
591 if (af != null && getFeatures != null)
593 FeatureFetcher ff = startFeatureFetching(getFeatures);
596 while (!ff.allFinished() || af.operationInProgress())
598 // wait around until fetching is finished.
602 } catch (Exception e)
608 getFeatures = null; // have retrieved features - forget them now.
610 if (groovyscript != null)
612 // Execute the groovy script after we've done all the rendering stuff
613 // and before any images or figures are generated.
614 System.out.println("Executing script " + groovyscript);
615 executeGroovyScript(groovyscript, af);
616 System.out.println("CMD groovy[" + groovyscript
617 + "] executed successfully!");
620 String imageName = "unnamed.png";
621 while (aparser.getSize() > 1)
623 format = aparser.nextValue();
624 file = aparser.nextValue();
626 if (format.equalsIgnoreCase("png"))
628 af.createPNG(new File(file));
629 imageName = (new File(file)).getName();
630 System.out.println("Creating PNG image: " + file);
633 else if (format.equalsIgnoreCase("svg"))
635 File imageFile = new File(file);
636 imageName = imageFile.getName();
637 af.createSVG(imageFile);
638 System.out.println("Creating SVG image: " + file);
641 else if (format.equalsIgnoreCase("html"))
643 File imageFile = new File(file);
644 imageName = imageFile.getName();
645 new HtmlSvgOutput(new File(file), af.alignPanel);
646 System.out.println("Creating HTML image: " + file);
649 else if (format.equalsIgnoreCase("imgMap"))
651 af.createImageMap(new File(file), imageName);
652 System.out.println("Creating image map: " + file);
655 else if (format.equalsIgnoreCase("eps"))
657 File outputFile = new File(file);
658 System.out.println("Creating EPS file: "
659 + outputFile.getAbsolutePath());
660 af.createEPS(outputFile);
664 if (af.saveAlignment(file, format))
666 System.out.println("Written alignment in " + format
667 + " format to " + file);
671 System.out.println("Error writing file " + file + " in "
672 + format + " format!!");
677 while (aparser.getSize() > 0)
679 System.out.println("Unknown arg: " + aparser.nextValue());
683 AlignFrame startUpAlframe = null;
684 // We'll only open the default file if the desktop is visible.
686 // ////////////////////
688 if (!headless && file == null && vamsasImport == null
689 && jalview.bin.Cache.getDefault("SHOW_STARTUP_FILE", true))
691 file = jalview.bin.Cache.getDefault(
693 jalview.bin.Cache.getDefault("www.jalview.org",
694 "http://www.jalview.org")
695 + "/examples/exampleFile_2_7.jar");
696 if (file.equals("http://www.jalview.org/examples/exampleFile_2_3.jar"))
698 // hardwire upgrade of the startup file
699 file.replace("_2_3.jar", "_2_7.jar");
700 // and remove the stale setting
701 jalview.bin.Cache.removeProperty("STARTUP_FILE");
706 if (file.indexOf("http:") > -1)
711 if (file.endsWith(".jar"))
717 format = new IdentifyFile().identify(file, protocol);
720 startUpAlframe = fileLoader.LoadFileWaitTillLoaded(file, protocol,
722 getFeatures = checkDasArguments(aparser);
723 // extract groovy arguments before anything else.
725 // If the user has specified features to be retrieved,
726 // or a groovy script to be executed, do them if they
727 // haven't been done already
728 // fetch features for the default alignment
729 if (getFeatures != null)
731 if (startUpAlframe != null)
733 startFeatureFetching(getFeatures);
736 // Once all other stuff is done, execute any groovy scripts (in order)
737 if (groovyscript != null)
739 if (Cache.groovyJarsPresent())
741 System.out.println("Executing script " + groovyscript);
742 executeGroovyScript(groovyscript, startUpAlframe);
747 .println("Sorry. Groovy Support is not available, so ignoring the provided groovy script "
751 // and finally, turn off batch mode indicator - if the desktop still exists
756 desktop.setProgressBar(null, progress);
758 desktop.setInBatchMode(false);
762 private static void showUsage()
765 .println("Usage: jalview -open [FILE] [OUTPUT_FORMAT] [OUTPUT_FILE]\n\n"
766 + "-nodisplay\tRun Jalview without User Interface.\n"
767 + "-props FILE\tUse the given Jalview properties file instead of users default.\n"
768 + "-colour COLOURSCHEME\tThe colourscheme to be applied to the alignment\n"
769 + "-annotations FILE\tAdd precalculated annotations to the alignment.\n"
770 + "-tree FILE\tLoad the given newick format tree file onto the alignment\n"
771 + "-features FILE\tUse the given file to mark features on the alignment.\n"
772 + "-fasta FILE\tCreate alignment file FILE in Fasta format.\n"
773 + "-clustal FILE\tCreate alignment file FILE in Clustal format.\n"
774 + "-pfam FILE\tCreate alignment file FILE in PFAM format.\n"
775 + "-msf FILE\tCreate alignment file FILE in MSF format.\n"
776 + "-pileup FILE\tCreate alignment file FILE in Pileup format\n"
777 + "-pir FILE\tCreate alignment file FILE in PIR format.\n"
778 + "-blc FILE\tCreate alignment file FILE in BLC format.\n"
779 + "-json FILE\tCreate alignment file FILE in JSON format.\n"
780 + "-jalview FILE\tCreate alignment file FILE in Jalview format.\n"
781 + "-png FILE\tCreate PNG image FILE from alignment.\n"
782 + "-svg FILE\tCreate SVG image FILE from alignment.\n"
783 + "-html FILE\tCreate HTML file from alignment.\n"
784 + "-imgMap FILE\tCreate HTML file FILE with image map of PNG image.\n"
785 + "-eps FILE\tCreate EPS file FILE from alignment.\n"
786 + "-questionnaire URL\tQueries the given URL for information about any Jalview user questionnaires.\n"
787 + "-noquestionnaire\tTurn off questionnaire check.\n"
788 + "-nousagestats\tTurn off google analytics tracking for this session.\n"
789 + "-sortbytree OR -nosortbytree\tEnable or disable sorting of the given alignment by the given tree\n"
791 // "-setprop PROPERTY=VALUE\tSet the given Jalview property, after all other properties files have been read\n\t (quote the 'PROPERTY=VALUE' pair to ensure spaces are passed in correctly)"
792 + "-jabaws URL\tSpecify URL for Jabaws services (e.g. for a local installation).\n"
793 + "-dasserver nickname=URL\tAdd and enable a das server with given nickname\n\t\t\t(alphanumeric or underscores only) for retrieval of features for all alignments.\n"
794 + "\t\t\tSources that also support the sequence command may be specified by prepending the URL with sequence:\n"
795 + "\t\t\t e.g. sequence:http://localdas.somewhere.org/das/source)\n"
796 + "-fetchfrom nickname\tQuery nickname for features for the alignments and display them.\n"
798 // "-vdoc vamsas-document\tImport vamsas document into new session or join existing session with same URN\n"
799 // + "-vses vamsas-session\tJoin session with given URN\n"
800 + "-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"
801 + "\n~Read documentation in Application or visit http://www.jalview.org for description of Features and Annotations file~\n\n");
804 private static void startUsageStats(final Desktop desktop)
807 * start a User Config prompt asking if we can log usage statistics.
809 PromptUserConfig prompter = new PromptUserConfig(
812 "Jalview Usage Statistics",
813 "Do you want to help make Jalview better by enabling "
814 + "the collection of usage statistics with Google Analytics ?"
815 + "\n\n(you can enable or disable usage tracking in the preferences)",
822 .debug("Initialising googletracker for usage stats.");
823 Cache.initGoogleTracker();
824 Cache.log.debug("Tracking enabled.");
831 Cache.log.debug("Not enabling Google Tracking.");
834 desktop.addDialogThread(prompter);
838 * Locate the given string as a file and pass it to the groovy interpreter.
840 * @param groovyscript
841 * the script to execute
842 * @param jalviewContext
843 * the Jalview Desktop object passed in to the groovy binding as the
846 private void executeGroovyScript(String groovyscript, AlignFrame af)
849 * for scripts contained in files
856 if (groovyscript.trim().equals("STDIN"))
858 // read from stdin into a tempfile and execute it
861 tfile = File.createTempFile("jalview", "groovy");
862 PrintWriter outfile = new PrintWriter(new OutputStreamWriter(
863 new FileOutputStream(tfile)));
864 BufferedReader br = new BufferedReader(new InputStreamReader(
867 while ((line = br.readLine()) != null)
869 outfile.write(line + "\n");
875 } catch (Exception ex)
877 System.err.println("Failed to read from STDIN into tempfile "
878 + ((tfile == null) ? "(tempfile wasn't created)" : tfile
880 ex.printStackTrace();
885 sfile = tfile.toURI().toURL();
886 } catch (Exception x)
889 .println("Unexpected Malformed URL Exception for temporary file created from STDIN: "
899 sfile = new URI(groovyscript).toURL();
900 } catch (Exception x)
902 tfile = new File(groovyscript);
905 System.err.println("File '" + groovyscript + "' does not exist.");
908 if (!tfile.canRead())
910 System.err.println("File '" + groovyscript + "' cannot be read.");
913 if (tfile.length() < 1)
915 System.err.println("File '" + groovyscript + "' is empty.");
920 sfile = tfile.getAbsoluteFile().toURI().toURL();
921 } catch (Exception ex)
923 System.err.println("Failed to create a file URL for "
924 + tfile.getAbsoluteFile());
931 Map<String, Object> vbinding = new HashMap<String, Object>();
932 vbinding.put("Jalview", this);
935 vbinding.put("currentAlFrame", af);
937 Binding gbinding = new Binding(vbinding);
938 GroovyScriptEngine gse = new GroovyScriptEngine(new URL[] { sfile });
939 gse.run(sfile.toString(), gbinding);
940 if ("STDIN".equals(groovyscript))
942 // delete temp file that we made -
943 // only if it was successfully executed
946 } catch (Exception e)
948 System.err.println("Exception Whilst trying to execute file " + sfile
949 + " as a groovy script.");
950 e.printStackTrace(System.err);
956 * Check commandline for any das server definitions or any fetchfrom switches
958 * @return vector of DAS source nicknames to retrieve from
960 private static Vector<String> checkDasArguments(ArgsParser aparser)
962 Vector<String> source = null;
964 String locsources = Cache.getProperty(Cache.DAS_LOCAL_SOURCE);
965 while ((data = aparser.getValue("dasserver", true)) != null)
967 String nickname = null;
969 int pos = data.indexOf('=');
970 // determine capabilities
973 nickname = data.substring(0, pos);
975 url = data.substring(pos + 1);
977 && (url.startsWith("http:") || url
978 .startsWith("sequence:http:")))
980 if (nickname == null)
984 if (locsources == null)
992 locsources = locsources + nickname + "|" + url;
994 .println("NOTE! dasserver parameter not yet really supported (got args of "
995 + nickname + "|" + url);
998 source = new Vector<String>();
1000 source.addElement(nickname);
1002 System.out.println("CMD [-dasserver " + data
1003 + "] executed successfully!");
1004 } // loop until no more server entries are found.
1005 if (locsources != null && locsources.indexOf('|') > -1)
1007 Cache.log.debug("Setting local source list in properties file to:\n"
1009 Cache.setProperty(Cache.DAS_LOCAL_SOURCE, locsources);
1011 while ((data = aparser.getValue("fetchfrom", true)) != null)
1013 System.out.println("adding source '" + data + "'");
1016 source = new Vector<String>();
1018 source.addElement(data);
1024 * start a feature fetcher for every alignment frame
1028 private FeatureFetcher startFeatureFetching(
1029 final Vector<String> dasSources)
1031 FeatureFetcher ff = new FeatureFetcher();
1032 AlignFrame afs[] = Desktop.getAlignFrames();
1033 if (afs == null || afs.length == 0)
1037 for (int i = 0; i < afs.length; i++)
1039 ff.addFetcher(afs[i], dasSources);
1044 public static boolean isHeadlessMode()
1046 String isheadless = System.getProperty("java.awt.headless");
1047 if (isheadless != null && isheadless.equalsIgnoreCase("true"))
1054 public AlignFrame[] getAlignFrames()
1056 return desktop == null ? new AlignFrame[] { getCurrentAlignFrame() }
1057 : Desktop.getAlignFrames();
1062 * Quit method delegates to Desktop.quit - unless running in headless mode
1063 * when it just ends the JVM
1067 if (desktop != null)
1077 public static AlignFrame getCurrentAlignFrame()
1079 return Jalview.currentAlignFrame;
1082 public static void setCurrentAlignFrame(AlignFrame currentAlignFrame)
1084 Jalview.currentAlignFrame = currentAlignFrame;