Jalview-JS/JAL-3253-applet adds shell JalviewJSApi methods to Jalview
[jalview.git] / src / jalview / bin / Jalview.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3  * Copyright (C) $$Year-Rel$$ The Jalview Authors
4  * 
5  * This file is part of Jalview.
6  * 
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.
11  *  
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.
16  * 
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.
20  */
21 package jalview.bin;
22
23 import jalview.api.AlignViewportI;
24 import jalview.api.JalviewApp;
25 import jalview.bin.ApplicationSingletonProvider.ApplicationSingletonI;
26 import jalview.datamodel.PDBEntry;
27 import jalview.datamodel.SequenceI;
28 import jalview.ext.so.SequenceOntology;
29 import jalview.gui.AlignFrame;
30 import jalview.gui.AlignViewport;
31 import jalview.gui.Desktop;
32 import jalview.gui.Preferences;
33 import jalview.gui.PromptUserConfig;
34 import jalview.gui.StructureViewer;
35 import jalview.io.AppletFormatAdapter;
36 import jalview.io.BioJsHTMLOutput;
37 import jalview.io.DataSourceType;
38 import jalview.io.FileFormat;
39 import jalview.io.FileFormatException;
40 import jalview.io.FileFormatI;
41 import jalview.io.FileFormats;
42 import jalview.io.FileLoader;
43 import jalview.io.HtmlSvgOutput;
44 import jalview.io.IdentifyFile;
45 import jalview.io.NewickFile;
46 import jalview.io.gff.SequenceOntologyFactory;
47 import jalview.javascript.JalviewLiteJsApi;
48 import jalview.schemes.ColourSchemeI;
49 import jalview.schemes.ColourSchemeProperty;
50 import jalview.util.MessageManager;
51 import jalview.util.Platform;
52 import jalview.ws.jws2.Jws2Discoverer;
53
54 import java.io.BufferedReader;
55 import java.io.File;
56 import java.io.FileOutputStream;
57 import java.io.IOException;
58 import java.io.InputStreamReader;
59 import java.io.OutputStreamWriter;
60 import java.io.PrintWriter;
61 import java.net.MalformedURLException;
62 import java.net.URI;
63 import java.net.URISyntaxException;
64 import java.net.URL;
65 import java.security.AllPermission;
66 import java.security.CodeSource;
67 import java.security.PermissionCollection;
68 import java.security.Permissions;
69 import java.security.Policy;
70 import java.util.HashMap;
71 import java.util.Map;
72 import java.util.Vector;
73 import java.util.logging.ConsoleHandler;
74 import java.util.logging.Level;
75 import java.util.logging.Logger;
76
77 import javax.swing.LookAndFeel;
78 import javax.swing.UIManager;
79
80 import groovy.lang.Binding;
81 import groovy.util.GroovyScriptEngine;
82
83 /**
84  * Main class for Jalview Application <br>
85  * <br>
86  * start with: java -classpath "$PATH_TO_LIB$/*:$PATH_TO_CLASSES$" \
87  * jalview.bin.Jalview
88  * 
89  * or on Windows: java -classpath "$PATH_TO_LIB$/*;$PATH_TO_CLASSES$" \
90  * jalview.bin.Jalview jalview.bin.Jalview
91  * 
92  * (ensure -classpath arg is quoted to avoid shell expansion of '*' and do not
93  * embellish '*' to e.g. '*.jar')
94  * 
95  * @author $author$
96  * @version $Revision$
97  */
98 public class Jalview implements ApplicationSingletonI, JalviewLiteJsApi
99 {
100
101   public static Jalview getInstance()
102   {
103     return (Jalview) ApplicationSingletonProvider
104             .getInstance(Jalview.class);
105   }
106
107   private Jalview()
108   {
109   }
110
111   static
112   {
113     Platform.getURLCommandArguments();
114   }
115
116   private boolean headless;
117
118   public static boolean isHeadlessMode()
119   {
120     return getInstance().headless;
121   }
122
123   private Desktop desktop;
124
125   private AlignFrame currentAlignFrame;
126
127   public boolean isJavaAppletTag;
128
129   public String appletResourcePath;
130
131   public static AlignFrame getCurrentAlignFrame()
132   {
133     return getInstance().currentAlignFrame;
134   }
135
136   public static void setCurrentAlignFrame(AlignFrame currentAlignFrame)
137   {
138     getInstance().currentAlignFrame = currentAlignFrame;
139   }
140
141   static
142   {
143     if (!Platform.isJS())
144     /**
145      * Java only
146      * 
147      * @j2sIgnore
148      */
149     {
150       // grab all the rights we can for the JVM
151       Policy.setPolicy(new Policy()
152       {
153         @Override
154         public PermissionCollection getPermissions(CodeSource codesource)
155         {
156           Permissions perms = new Permissions();
157           perms.add(new AllPermission());
158           return (perms);
159         }
160
161         @Override
162         public void refresh()
163         {
164         }
165       });
166     }
167   }
168
169   /**
170    * keep track of feature fetching tasks.
171    * 
172    * @author JimP
173    * 
174    */
175   class FeatureFetcher
176   {
177     /*
178      * TODO: generalise to track all jalview events to orchestrate batch
179      * processing events.
180      */
181
182     private int queued = 0;
183
184     private int running = 0;
185
186     public FeatureFetcher()
187     {
188
189     }
190
191     public void addFetcher(final AlignFrame af,
192             final Vector<String> dasSources)
193     {
194       final long id = System.currentTimeMillis();
195       queued++;
196       final FeatureFetcher us = this;
197       new Thread(new Runnable()
198       {
199
200         @Override
201         public void run()
202         {
203           synchronized (us)
204           {
205             queued--;
206             running++;
207           }
208
209           af.setProgressBar(MessageManager
210                   .getString("status.das_features_being_retrived"), id);
211           af.featureSettings_actionPerformed(null);
212           af.setProgressBar(null, id);
213           synchronized (us)
214           {
215             running--;
216           }
217         }
218       }).start();
219     }
220
221     public synchronized boolean allFinished()
222     {
223       return queued == 0 && running == 0;
224     }
225
226   }
227
228   /**
229    * main class for Jalview application
230    * 
231    * @param args
232    *          open <em>filename</em>
233    */
234   public static void main(String[] args)
235   {
236     // setLogging(); // BH - for event debugging in JavaScript
237     getInstance().doMain(args);
238   }
239
240   private static void logClass(String name)
241   {
242     // BH - for event debugging in JavaScript
243     ConsoleHandler consoleHandler = new ConsoleHandler();
244     consoleHandler.setLevel(Level.ALL);
245     Logger logger = Logger.getLogger(name);
246     logger.setLevel(Level.ALL);
247     logger.addHandler(consoleHandler);
248   }
249
250   @SuppressWarnings("unused")
251   private static void setLogging()
252   {
253
254     /**
255      * @j2sIgnore
256      * 
257      */
258     {
259       System.out.println("not in js");
260     }
261
262     // BH - for event debugging in JavaScript (Java mode only)
263     if (!Platform.isJS())
264     /**
265      * Java only
266      * 
267      * @j2sIgnore
268      */
269     {
270       Logger.getLogger("").setLevel(Level.ALL);
271       logClass("java.awt.EventDispatchThread");
272       logClass("java.awt.EventQueue");
273       logClass("java.awt.Component");
274       logClass("java.awt.focus.Component");
275       logClass("java.awt.focus.DefaultKeyboardFocusManager");
276     }
277
278   }
279
280   /**
281    * @param args
282    */
283   void doMain(String[] args)
284   {
285
286     boolean isJS = Platform.isJS();
287     if (!isJS)
288     {
289       System.setSecurityManager(null);
290     }
291
292     System.out
293             .println("Java version: " + System.getProperty("java.version"));
294     System.out.println(System.getProperty("os.arch") + " "
295             + System.getProperty("os.name") + " "
296             + System.getProperty("os.version"));
297
298     ArgsParser aparser = new ArgsParser(args);
299
300     String usrPropsFile = aparser.getValue(ArgsParser.PROPS);
301     Cache.loadProperties(usrPropsFile);
302     if (isJS)
303     {
304       isJavaAppletTag = aparser.isApplet();
305       if (isJavaAppletTag)
306       {
307         Preferences.setAppletDefaults();
308         Cache.loadProperties(usrPropsFile); // again, because we
309         // might be changing defaults here?
310       }
311       System.out.println(
312               "<Applet> found: " + aparser.getValue("Info.j2sAppletID"));
313       appletResourcePath = aparser.getValue("Info.resourcePath");
314     }
315     else
316     /**
317      * Java only
318      * 
319      * @j2sIgnore
320      */
321     {
322       if (usrPropsFile != null)
323       {
324         System.out.println(
325                 "CMD [-props " + usrPropsFile + "] executed successfully!");
326       }
327
328       if (aparser.contains("help") || aparser.contains("h"))
329       {
330         showUsage();
331         System.exit(0);
332       }
333       if (aparser.contains(ArgsParser.NODISPLAY)
334               || aparser.contains(ArgsParser.NOGUI)
335               || aparser.contains(ArgsParser.HEADLESS)
336               || "true".equals(System.getProperty("java.awt.headless")))
337       {
338         headless = true;
339       }
340
341       // anything else!
342
343       final String jabawsUrl = aparser.getValue(ArgsParser.JABAWS);
344       if (jabawsUrl != null)
345       {
346         try
347         {
348           Jws2Discoverer.getInstance().setPreferredUrl(jabawsUrl);
349           System.out.println(
350                   "CMD [-jabaws " + jabawsUrl + "] executed successfully!");
351         } catch (MalformedURLException e)
352         {
353           System.err.println(
354                   "Invalid jabaws parameter: " + jabawsUrl + " ignored");
355         }
356       }
357
358     }
359     // check for property setting
360     String defs = aparser.getValue(ArgsParser.SETPROP);
361     while (defs != null)
362     {
363       int p = defs.indexOf('=');
364       if (p == -1)
365       {
366         System.err.println("Ignoring invalid setprop argument : " + defs);
367       }
368       else
369       {
370         System.out.println("Executing setprop argument: " + defs);
371         if (isJS)
372         {
373           Cache.setProperty(defs.substring(0, p), defs.substring(p + 1));
374         }
375       }
376       defs = aparser.getValue(ArgsParser.SETPROP);
377     }
378     System.setProperty("http.agent",
379             "Jalview Desktop/" + Cache.getDefault("VERSION", "Unknown"));
380     try
381     {
382       Cache.initLogger();
383     } catch (NoClassDefFoundError error)
384     {
385       error.printStackTrace();
386       System.out.println("\nEssential logging libraries not found."
387               + "\nUse: java -classpath \"$PATH_TO_LIB$/*:$PATH_TO_CLASSES$\" jalview.bin.Jalview");
388       System.exit(0);
389     }
390
391     desktop = null;
392
393     try
394     {
395       UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
396     } catch (Exception ex)
397     {
398       System.err.println("Unexpected Look and Feel Exception");
399       ex.printStackTrace();
400     }
401     if (Platform.isAMacAndNotJS())
402     {
403
404       LookAndFeel lookAndFeel = ch.randelshofer.quaqua.QuaquaManager
405               .getLookAndFeel();
406       System.setProperty("com.apple.mrj.application.apple.menu.about.name",
407               "Jalview");
408       System.setProperty("apple.laf.useScreenMenuBar", "true");
409       if (lookAndFeel != null)
410       {
411         try
412         {
413           UIManager.setLookAndFeel(lookAndFeel);
414         } catch (Throwable e)
415         {
416           System.err.println(
417                   "Failed to set QuaQua look and feel: " + e.toString());
418         }
419       }
420       if (lookAndFeel == null
421               || !(lookAndFeel.getClass().isAssignableFrom(
422                       UIManager.getLookAndFeel().getClass()))
423               || !UIManager.getLookAndFeel().getClass().toString()
424                       .toLowerCase().contains("quaqua"))
425       {
426         try
427         {
428           System.err.println(
429                   "Quaqua LaF not available on this plaform. Using VAqua(4).\nSee https://issues.jalview.org/browse/JAL-2976");
430           UIManager.setLookAndFeel("org.violetlib.aqua.AquaLookAndFeel");
431         } catch (Throwable e)
432         {
433           System.err.println(
434                   "Failed to reset look and feel: " + e.toString());
435         }
436       }
437     }
438
439     /*
440      * configure 'full' SO model if preferences say to, 
441      * else use the default (SO Lite)
442      */
443     if (Cache.getDefault(Preferences.USE_FULL_SO, false))
444     {
445       SequenceOntologyFactory.setSequenceOntology(new SequenceOntology());
446     }
447
448     if (!headless)
449     {
450       desktop = Desktop.getInstance();
451       desktop.setInBatchMode(true); // indicate we are starting up
452       desktop.setVisible(true);
453
454       if (!isJS)
455       /**
456        * Java only
457        * 
458        * @j2sIgnore
459        */
460       {
461         desktop.startServiceDiscovery();
462         if (!aparser.contains(ArgsParser.NOUSAGESTATS))
463         {
464           startUsageStats(desktop);
465         }
466         else
467         {
468           System.err.println("CMD [-nousagestats] executed successfully!");
469         }
470
471         if (!aparser.contains(ArgsParser.NOQUESTIONNAIRE))
472         {
473           String url = aparser.getValue(ArgsParser.QUESTIONNAIRE);
474           if (url != null)
475           {
476             // Start the desktop questionnaire prompter with the specified
477             // questionnaire
478             Cache.log.debug("Starting questionnaire url at " + url);
479             desktop.checkForQuestionnaire(url);
480             System.out.println("CMD questionnaire[-" + url
481                     + "] executed successfully!");
482           }
483           else
484           {
485             if (Cache.getProperty(Preferences.NOQUESTIONNAIRES) == null)
486             {
487               // Start the desktop questionnaire prompter with the specified
488               // questionnaire
489               // String defurl =
490               // "http://anaplog.compbio.dundee.ac.uk/cgi-bin/questionnaire.pl";
491               // //
492               String defurl = "http://www.jalview.org/cgi-bin/questionnaire.pl";
493               Cache.log.debug(
494                       "Starting questionnaire with default url: " + defurl);
495               desktop.checkForQuestionnaire(defurl);
496             }
497           }
498         }
499         else
500         {
501           System.err
502                   .println("CMD [-noquestionnaire] executed successfully!");
503         }
504
505         if (!aparser.contains(ArgsParser.NONEWS))
506         {
507           desktop.checkForNews();
508         }
509
510         BioJsHTMLOutput.updateBioJS();
511       }
512     }
513
514     // script to execute after all loading is
515     // completed one way or another
516     // extract groovy argument and execute if necessary
517     String groovyscript = (isJS ? null
518             : aparser.getValue(ArgsParser.GROOVY, true));
519     String file = aparser.getValue(ArgsParser.OPEN, true);
520     // BH this here to allow split frame; not working as of 5/17/2019
521     String file2 = aparser.getValue(ArgsParser.OPEN2, true);
522     String fileFormat = (isJavaAppletTag
523             ? aparser.getAppletValue("format", null)
524             : null);
525
526     FileFormatI format = null;
527     DataSourceType protocol = null;
528
529     if (file == null && desktop == null)
530     {
531       System.out.println("No files to open!");
532       System.exit(1);
533     }
534     boolean haveImport = checkStartVamas(aparser);
535     // Finally, deal with the remaining input data.
536     long progress = -1;
537     if (file == null && isJavaAppletTag)
538     {
539       // Maybe the sequences are added as parameters
540       StringBuffer data = new StringBuffer("PASTE");
541       int i = 1;
542       while ((file = aparser.getAppletValue("sequence" + i, null)) != null)
543       {
544         data.append(file.toString() + "\n");
545         i++;
546       }
547       if (data.length() > 5)
548       {
549         file = data.toString();
550       }
551     }
552
553     if (file != null)
554     {
555       if (!headless)
556       {
557         desktop.setProgressBar(
558                 MessageManager
559                         .getString("status.processing_commandline_args"),
560                 progress = System.currentTimeMillis());
561       }
562
563       if (!isJS)
564       /**
565        * ignore in JavaScript -- can't just check file existence - could load
566        * it?
567        * 
568        * @j2sIgnore
569        */
570       {
571         if (!file.startsWith("http://") && !file.startsWith("https://"))
572         // BH 2019 added https check for Java
573         {
574           if (!(new File(file)).exists())
575           {
576             System.out.println("Can't find " + file);
577             if (headless)
578             {
579               System.exit(1);
580             }
581           }
582         }
583       }
584
585       protocol = AppletFormatAdapter.checkProtocol(file);
586
587       try
588       {
589         format = (isJavaAppletTag && fileFormat != null
590                 ? FileFormats.getInstance().forName(fileFormat)
591                 : null);
592         if (format == null)
593         {
594           format = new IdentifyFile().identify(file, protocol);
595         }
596       } catch (FileFormatException e1)
597       {
598         // TODO ?
599       }
600
601       AlignFrame af = new FileLoader(!headless).loadFileWaitTillLoaded(file,
602               protocol, format);
603       if (af == null)
604       {
605         System.out.println("error");
606       }
607       else
608       {
609         System.out
610                 .println("CMD [-open " + file + "] executed successfully!");
611         if (file2 != null)
612         {
613           protocol = AppletFormatAdapter.checkProtocol(file2);
614           try
615           {
616             format = new IdentifyFile().identify(file2, protocol);
617           } catch (FileFormatException e1)
618           {
619             // TODO ?
620           }
621           AlignFrame af2 = new FileLoader(!headless)
622                   .loadFileWaitTillLoaded(file2, protocol, format);
623           if (af2 == null)
624           {
625             System.out.println("error");
626           }
627           else
628           {
629             AlignViewport.openLinkedAlignmentAs(af,
630                     af.getViewport().getAlignment(),
631                     af2.getViewport().getAlignment(), "",
632                     AlignViewport.SPLIT_FRAME);
633             System.out.println(
634                     "CMD [-open2 " + file2 + "] executed successfully!");
635           }
636         }
637
638         setCurrentAlignFrame(af);
639
640         // TODO: file2 How to implement file2 for the applet spit screen?
641
642         String data = aparser.getValue(ArgsParser.COLOUR, true);
643         if (data != null)
644         {
645           data.replaceAll("%20", " ");
646
647           ColourSchemeI cs = ColourSchemeProperty.getColourScheme(
648                   af.getViewport(), af.getViewport().getAlignment(), data);
649
650           if (cs != null)
651           {
652             System.out.println(
653                     "CMD [-color " + data + "] executed successfully!");
654           }
655           af.changeColour(cs);
656         }
657
658         // Must maintain ability to use the groups flag
659         data = aparser.getValue(ArgsParser.GROUPS, true);
660         if (data != null)
661         {
662           af.parseFeaturesFile(data,
663                   AppletFormatAdapter.checkProtocol(data));
664           // System.out.println("Added " + data);
665           System.out.println(
666                   "CMD groups[-" + data + "]  executed successfully!");
667         }
668         data = aparser.getValue(ArgsParser.FEATURES, true);
669         if (data != null)
670         {
671           af.parseFeaturesFile(data,
672                   AppletFormatAdapter.checkProtocol(data));
673           // System.out.println("Added " + data);
674           System.out.println(
675                   "CMD [-features " + data + "]  executed successfully!");
676         }
677
678         data = aparser.getValue(ArgsParser.ANNOTATIONS, true);
679         if (data != null)
680         {
681           af.loadJalviewDataFile(data, null, null, null);
682           // System.out.println("Added " + data);
683           System.out.println(
684                   "CMD [-annotations " + data + "] executed successfully!");
685         }
686         // set or clear the sortbytree flag.
687         if (aparser.contains(ArgsParser.SORTBYTREE))
688         {
689           af.getViewport().setSortByTree(true);
690           if (af.getViewport().getSortByTree())
691           {
692             System.out.println("CMD [-sortbytree] executed successfully!");
693           }
694         }
695         if (aparser.contains(ArgsParser.NOANNOTATION)
696                 || aparser.contains(ArgsParser.NOANNOTATION2))
697         {
698           af.getViewport().setShowAnnotation(false);
699           if (!af.getViewport().isShowAnnotation())
700           {
701             System.out.println("CMD no-annotation executed successfully!");
702           }
703         }
704         if (aparser.contains(ArgsParser.NOSORTBYTREE))
705         {
706           af.getViewport().setSortByTree(false);
707           if (!af.getViewport().getSortByTree())
708           {
709             System.out
710                     .println("CMD [-nosortbytree] executed successfully!");
711           }
712         }
713         data = aparser.getValue(ArgsParser.TREE, true);
714         if (data != null)
715         {
716           try
717           {
718             System.out.println(
719                     "CMD [-tree " + data + "] executed successfully!");
720             NewickFile nf = new NewickFile(data,
721                     AppletFormatAdapter.checkProtocol(data));
722             af.getViewport()
723                     .setCurrentTree(af.showNewickTree(nf, data).getTree());
724           } catch (IOException ex)
725           {
726             System.err.println("Couldn't add tree " + data);
727             ex.printStackTrace(System.err);
728           }
729         }
730         // TODO - load PDB structure(s) to alignment JAL-629
731         // (associate with identical sequence in alignment, or a specified
732         // sequence)
733         if (isJavaAppletTag)
734         {
735           loadAppletParams(aparser, af);
736         }
737         else if (!isJS)
738         /**
739          * Java only
740          * 
741          * @j2sIgnore
742          */
743         {
744           if (groovyscript != null)
745           {
746             // Execute the groovy script after we've done all the rendering
747             // stuff
748             // and before any images or figures are generated.
749             System.out.println("Executing script " + groovyscript);
750             executeGroovyScript(groovyscript, af);
751             System.out.println("CMD groovy[" + groovyscript
752                     + "] executed successfully!");
753             groovyscript = null;
754           }
755           checkOutputFile(aparser, af, format);
756           while (aparser.getSize() > 0)
757           {
758             System.out.println("Unknown arg: " + aparser.nextValue());
759           }
760         }
761       }
762     }
763     AlignFrame startUpAlframe = null;
764     // We'll only open the default file if the desktop is visible.
765     // And the user
766     // ////////////////////
767
768     if (!isJS && !headless && file == null && !haveImport
769             && jalview.bin.Cache.getDefault("SHOW_STARTUP_FILE", true))
770     /**
771      * Java only
772      * 
773      * @j2sIgnore
774      */
775     {
776       file = jalview.bin.Cache.getDefault("STARTUP_FILE",
777               jalview.bin.Cache.getDefault("www.jalview.org",
778                       "http://www.jalview.org")
779                       + "/examples/exampleFile_2_7.jar");
780       if (file.equals(
781               "http://www.jalview.org/examples/exampleFile_2_3.jar"))
782       {
783         // hardwire upgrade of the startup file
784         file.replace("_2_3.jar", "_2_7.jar");
785         // and remove the stale setting
786         jalview.bin.Cache.removeProperty("STARTUP_FILE");
787       }
788
789       protocol = DataSourceType.FILE;
790
791       if (file.indexOf("http:") > -1)
792       {
793         protocol = DataSourceType.URL;
794       }
795
796       if (file.endsWith(".jar"))
797       {
798         format = FileFormat.Jalview;
799       }
800       else
801       {
802         try
803         {
804           format = new IdentifyFile().identify(file, protocol);
805         } catch (FileFormatException e)
806         {
807           // TODO what?
808         }
809       }
810
811       startUpAlframe = new FileLoader(!headless)
812               .loadFileWaitTillLoaded(file, protocol, format);
813       // extract groovy arguments before anything else.
814     }
815
816     // Once all other stuff is done, execute any groovy scripts (in order)
817     if (groovyscript != null)
818     {
819       if (Cache.groovyJarsPresent())
820       {
821         System.out.println("Executing script " + groovyscript);
822         executeGroovyScript(groovyscript, startUpAlframe);
823       }
824       else
825       {
826         System.err.println(
827                 "Sorry. Groovy Support is not available, so ignoring the provided groovy script "
828                         + groovyscript);
829       }
830     }
831     // and finally, turn off batch mode indicator - if the desktop still exists
832     if (desktop != null)
833     {
834       if (progress != -1)
835       {
836         desktop.setProgressBar(null, progress);
837       }
838       desktop.setInBatchMode(false);
839     }
840   }
841
842   private boolean checkStartVamas(ArgsParser aparser)
843   {
844     String vamsasImport = aparser.getValue(ArgsParser.VDOC);
845     String vamsasSession = aparser.getValue(ArgsParser.VSESS);
846     if (vamsasImport == null && vamsasSession == null)
847     {
848       return false;
849     }
850     if (desktop == null || headless)
851     {
852       System.out.println(
853               "Headless vamsas sessions not yet supported. Sorry.");
854       System.exit(1);
855     }
856     boolean haveImport = (vamsasImport != null);
857     if (haveImport)
858     {
859       // if we have a file, start a new session and import it.
860       boolean inSession = false;
861       try
862       {
863         DataSourceType viprotocol = AppletFormatAdapter
864                 .checkProtocol(vamsasImport);
865         if (viprotocol == DataSourceType.FILE)
866         {
867           inSession = desktop.vamsasImport(new File(vamsasImport));
868         }
869         else if (viprotocol == DataSourceType.URL)
870         {
871           inSession = desktop.vamsasImport(new URL(vamsasImport));
872         }
873
874       } catch (Exception e)
875       {
876         System.err.println("Exeption when importing " + vamsasImport
877                 + " as a vamsas document.");
878         e.printStackTrace();
879       }
880       if (!inSession)
881       {
882         System.err.println("Failed to import " + vamsasImport
883                 + " as a vamsas document.");
884       }
885       else
886       {
887         System.out.println("Imported Successfully into new session "
888                 + desktop.getVamsasApplication().getCurrentSession());
889       }
890     }
891     if (vamsasSession != null)
892     {
893       if (vamsasImport != null)
894       {
895         // close the newly imported session and import the Jalview specific
896         // remnants into the new session later on.
897         desktop.vamsasStop_actionPerformed(null);
898       }
899       // now join the new session
900       try
901       {
902         if (desktop.joinVamsasSession(vamsasSession))
903         {
904           System.out.println(
905                   "Successfully joined vamsas session " + vamsasSession);
906         }
907         else
908         {
909           System.err.println("WARNING: Failed to join vamsas session "
910                   + vamsasSession);
911         }
912       } catch (Exception e)
913       {
914         System.err.println(
915                 "ERROR: Failed to join vamsas session " + vamsasSession);
916         e.printStackTrace();
917       }
918       if (vamsasImport != null)
919       {
920         // the Jalview specific remnants can now be imported into the new
921         // session at the user's leisure.
922         Cache.log.info(
923                 "Skipping Push for import of data into existing vamsas session."); // TODO:
924         // enable
925         // this
926         // when
927         // debugged
928         // desktop.getVamsasApplication().push_update();
929       }
930     }
931     return haveImport;
932   }
933
934   private void checkOutputFile(ArgsParser aparser, AlignFrame af,
935           FileFormatI format)
936   {
937     String imageName = "unnamed.png";
938     while (aparser.getSize() > 1)
939     {
940       // PNG filename
941       // SVG filename
942       // HTML filename
943       // biojsmsa filename
944       String outputFormat = aparser.nextValue();
945       String file = aparser.nextValue();
946       if (outputFormat.equalsIgnoreCase("png"))
947       {
948         af.createPNG(new File(file));
949         imageName = (new File(file)).getName();
950         System.out.println("Creating PNG image: " + file);
951         continue;
952       }
953       else if (outputFormat.equalsIgnoreCase("svg"))
954       {
955         File imageFile = new File(file);
956         imageName = imageFile.getName();
957         af.createSVG(imageFile);
958         System.out.println("Creating SVG image: " + file);
959         continue;
960       }
961       else if (outputFormat.equalsIgnoreCase("html"))
962       {
963         File imageFile = new File(file);
964         imageName = imageFile.getName();
965         HtmlSvgOutput htmlSVG = new HtmlSvgOutput(af.alignPanel);
966         htmlSVG.exportHTML(file);
967
968         System.out.println("Creating HTML image: " + file);
969         continue;
970       }
971       else if (outputFormat.equalsIgnoreCase("biojsmsa"))
972       {
973         if (file == null)
974         {
975           System.err.println("The output html file must not be null");
976           return;
977         }
978         try
979         {
980           BioJsHTMLOutput.refreshVersionInfo(
981                   BioJsHTMLOutput.BJS_TEMPLATES_LOCAL_DIRECTORY);
982         } catch (URISyntaxException e)
983         {
984           e.printStackTrace();
985         }
986         BioJsHTMLOutput bjs = new BioJsHTMLOutput(af.alignPanel);
987         bjs.exportHTML(file);
988         System.out.println("Creating BioJS MSA Viwer HTML file: " + file);
989         continue;
990       }
991       else if (outputFormat.equalsIgnoreCase("imgMap"))
992       {
993         af.createImageMap(new File(file), imageName);
994         System.out.println("Creating image map: " + file);
995         continue;
996       }
997       else if (outputFormat.equalsIgnoreCase("eps"))
998       {
999         File outputFile = new File(file);
1000         System.out.println(
1001                 "Creating EPS file: " + outputFile.getAbsolutePath());
1002         af.createEPS(outputFile);
1003         continue;
1004       }
1005
1006       af.saveAlignment(file, format);
1007       if (af.isSaveAlignmentSuccessful())
1008       {
1009         System.out.println(
1010                 "Written alignment in " + format + " format to " + file);
1011       }
1012       else
1013       {
1014         System.out.println("Error writing file " + file + " in " + format
1015                 + " format!!");
1016       }
1017
1018     }
1019   }
1020
1021   private static void showUsage()
1022   {
1023     System.out.println(
1024             "Usage: jalview -open [FILE] [OUTPUT_FORMAT] [OUTPUT_FILE]\n\n"
1025                     + "-nodisplay\tRun Jalview without User Interface.\n"
1026                     + "-props FILE\tUse the given Jalview properties file instead of users default.\n"
1027                     + "-colour COLOURSCHEME\tThe colourscheme to be applied to the alignment\n"
1028                     + "-annotations FILE\tAdd precalculated annotations to the alignment.\n"
1029                     + "-tree FILE\tLoad the given newick format tree file onto the alignment\n"
1030                     + "-features FILE\tUse the given file to mark features on the alignment.\n"
1031                     + "-fasta FILE\tCreate alignment file FILE in Fasta format.\n"
1032                     + "-clustal FILE\tCreate alignment file FILE in Clustal format.\n"
1033                     + "-pfam FILE\tCreate alignment file FILE in PFAM format.\n"
1034                     + "-msf FILE\tCreate alignment file FILE in MSF format.\n"
1035                     + "-pileup FILE\tCreate alignment file FILE in Pileup format\n"
1036                     + "-pir FILE\tCreate alignment file FILE in PIR format.\n"
1037                     + "-blc FILE\tCreate alignment file FILE in BLC format.\n"
1038                     + "-json FILE\tCreate alignment file FILE in JSON format.\n"
1039                     + "-jalview FILE\tCreate alignment file FILE in Jalview format.\n"
1040                     + "-png FILE\tCreate PNG image FILE from alignment.\n"
1041                     + "-svg FILE\tCreate SVG image FILE from alignment.\n"
1042                     + "-html FILE\tCreate HTML file from alignment.\n"
1043                     + "-biojsMSA FILE\tCreate BioJS MSA Viewer HTML file from alignment.\n"
1044                     + "-imgMap FILE\tCreate HTML file FILE with image map of PNG image.\n"
1045                     + "-eps FILE\tCreate EPS file FILE from alignment.\n"
1046                     + "-questionnaire URL\tQueries the given URL for information about any Jalview user questionnaires.\n"
1047                     + "-noquestionnaire\tTurn off questionnaire check.\n"
1048                     + "-nonews\tTurn off check for Jalview news.\n"
1049                     + "-nousagestats\tTurn off google analytics tracking for this session.\n"
1050                     + "-sortbytree OR -nosortbytree\tEnable or disable sorting of the given alignment by the given tree\n"
1051                     // +
1052                     // "-setprop PROPERTY=VALUE\tSet the given Jalview property,
1053                     // after all other properties files have been read\n\t
1054                     // (quote the 'PROPERTY=VALUE' pair to ensure spaces are
1055                     // passed in correctly)"
1056                     + "-jabaws URL\tSpecify URL for Jabaws services (e.g. for a local installation).\n"
1057                     + "-fetchfrom nickname\tQuery nickname for features for the alignments and display them.\n"
1058                     // +
1059                     // "-vdoc vamsas-document\tImport vamsas document into new
1060                     // session or join existing session with same URN\n"
1061                     // + "-vses vamsas-session\tJoin session with given URN\n"
1062                     + "-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"
1063                     + "\n~Read documentation in Application or visit http://www.jalview.org for description of Features and Annotations file~\n\n");
1064   }
1065
1066   private static void startUsageStats(final Desktop desktop)
1067   {
1068     /**
1069      * start a User Config prompt asking if we can log usage statistics.
1070      */
1071     PromptUserConfig prompter = new PromptUserConfig(
1072             Desktop.getDesktopPane(), "USAGESTATS",
1073             "Jalview Usage Statistics",
1074             "Do you want to help make Jalview better by enabling "
1075                     + "the collection of usage statistics with Google Analytics ?"
1076                     + "\n\n(you can enable or disable usage tracking in the preferences)",
1077             new Runnable()
1078             {
1079               @Override
1080               public void run()
1081               {
1082                 Cache.log.debug(
1083                         "Initialising googletracker for usage stats.");
1084                 Cache.initGoogleTracker();
1085                 Cache.log.debug("Tracking enabled.");
1086               }
1087             }, new Runnable()
1088             {
1089               @Override
1090               public void run()
1091               {
1092                 Cache.log.debug("Not enabling Google Tracking.");
1093               }
1094             }, null, true);
1095     desktop.addDialogThread(prompter);
1096   }
1097
1098   /**
1099    * Locate the given string as a file and pass it to the groovy interpreter.
1100    * 
1101    * @param groovyscript
1102    *          the script to execute
1103    * @param jalviewContext
1104    *          the Jalview Desktop object passed in to the groovy binding as the
1105    *          'Jalview' object.
1106    */
1107   private void executeGroovyScript(String groovyscript, AlignFrame af)
1108   {
1109     /**
1110      * for scripts contained in files
1111      */
1112     File tfile = null;
1113     /**
1114      * script's URI
1115      */
1116     URL sfile = null;
1117     if (groovyscript.trim().equals("STDIN"))
1118     {
1119       // read from stdin into a tempfile and execute it
1120       try
1121       {
1122         tfile = File.createTempFile("jalview", "groovy");
1123         PrintWriter outfile = new PrintWriter(
1124                 new OutputStreamWriter(new FileOutputStream(tfile)));
1125         BufferedReader br = new BufferedReader(
1126                 new InputStreamReader(System.in));
1127         String line = null;
1128         while ((line = br.readLine()) != null)
1129         {
1130           outfile.write(line + "\n");
1131         }
1132         br.close();
1133         outfile.flush();
1134         outfile.close();
1135
1136       } catch (Exception ex)
1137       {
1138         System.err.println("Failed to read from STDIN into tempfile "
1139                 + ((tfile == null) ? "(tempfile wasn't created)"
1140                         : tfile.toString()));
1141         ex.printStackTrace();
1142         return;
1143       }
1144       try
1145       {
1146         sfile = tfile.toURI().toURL();
1147       } catch (Exception x)
1148       {
1149         System.err.println(
1150                 "Unexpected Malformed URL Exception for temporary file created from STDIN: "
1151                         + tfile.toURI());
1152         x.printStackTrace();
1153         return;
1154       }
1155     }
1156     else
1157     {
1158       try
1159       {
1160         sfile = new URI(groovyscript).toURL();
1161       } catch (Exception x)
1162       {
1163         tfile = new File(groovyscript);
1164         if (!tfile.exists())
1165         {
1166           System.err.println("File '" + groovyscript + "' does not exist.");
1167           return;
1168         }
1169         if (!tfile.canRead())
1170         {
1171           System.err.println("File '" + groovyscript + "' cannot be read.");
1172           return;
1173         }
1174         if (tfile.length() < 1)
1175         {
1176           System.err.println("File '" + groovyscript + "' is empty.");
1177           return;
1178         }
1179         try
1180         {
1181           sfile = tfile.getAbsoluteFile().toURI().toURL();
1182         } catch (Exception ex)
1183         {
1184           System.err.println("Failed to create a file URL for "
1185                   + tfile.getAbsoluteFile());
1186           return;
1187         }
1188       }
1189     }
1190     try
1191     {
1192       Map<String, Object> vbinding = new HashMap<>();
1193       vbinding.put("Jalview", this);
1194       if (af != null)
1195       {
1196         vbinding.put("currentAlFrame", af);
1197       }
1198       Binding gbinding = new Binding(vbinding);
1199       GroovyScriptEngine gse = new GroovyScriptEngine(new URL[] { sfile });
1200       gse.run(sfile.toString(), gbinding);
1201       if ("STDIN".equals(groovyscript))
1202       {
1203         // delete temp file that we made -
1204         // only if it was successfully executed
1205         tfile.delete();
1206       }
1207     } catch (Exception e)
1208     {
1209       System.err.println("Exception Whilst trying to execute file " + sfile
1210               + " as a groovy script.");
1211       e.printStackTrace(System.err);
1212
1213     }
1214   }
1215
1216   public AlignFrame[] getAlignFrames()
1217   {
1218     return desktop == null ? new AlignFrame[] { getCurrentAlignFrame() }
1219             : Desktop.getAlignFrames();
1220
1221   }
1222
1223   /**
1224    * Quit method delegates to Desktop.quit - unless running in headless mode
1225    * when it just ends the JVM
1226    */
1227   public void quit()
1228   {
1229     if (desktop != null)
1230     {
1231       desktop.quit();
1232     }
1233     else
1234     {
1235       System.exit(0);
1236     }
1237   }
1238
1239   /**
1240    * Get the SwingJS applet ID and combine that with the frameType
1241    * 
1242    * @param frameType
1243    *          "alignment", "desktop", etc., or null
1244    * @return
1245    */
1246   public static String getAppID(String frameType)
1247   {
1248     String id = Cache.getProperty("Info.j2sAppletID");
1249     if (id == null)
1250     {
1251       id = "jalview";
1252     }
1253     return id + (frameType == null ? "" : "-" + frameType);
1254   }
1255
1256   /**
1257    * Handle all JalviewLite applet parameters
1258    * 
1259    * @param aparser
1260    * @param af
1261    */
1262   private void loadAppletParams(ArgsParser aparser, AlignFrame af)
1263   {
1264     JalviewApp app = new JalviewApp()
1265     {
1266
1267       private boolean alignPDBStructures; // From JalviewLite; not implemented
1268
1269       @Override
1270       public String getParameter(String name)
1271       {
1272         return aparser.getAppletValue(name, null);
1273       }
1274
1275       @Override
1276       public boolean getDefaultParameter(String name, boolean def)
1277       {
1278         String stn;
1279         return ((stn = getParameter(name)) == null ? def
1280                 : "true".equalsIgnoreCase(stn));
1281       }
1282
1283       /**
1284        * Get the applet-like document base even though this is an application.
1285        */
1286       @Override
1287       public URL getDocumentBase()
1288       {
1289         return Platform.getDocumentBase();
1290       }
1291
1292       /**
1293        * Get the applet-like code base even though this is an application.
1294        */
1295       @Override
1296       public URL getCodeBase()
1297       {
1298         return Platform.getCodeBase();
1299       }
1300
1301       @Override
1302       public AlignViewportI getViewport()
1303       {
1304         return af.getViewport();
1305       }
1306
1307       /**
1308        * features
1309        * 
1310        */
1311       @Override
1312       public boolean parseFeaturesFile(String filename,
1313               DataSourceType protocol)
1314       {
1315         return af.parseFeaturesFile(filename, protocol);
1316       }
1317
1318       /**
1319        * scorefile
1320        * 
1321        */
1322       @Override
1323       public boolean loadScoreFile(String sScoreFile) throws IOException
1324       {
1325         af.loadJalviewDataFile(sScoreFile, null, null, null);
1326         return true;
1327       }
1328
1329       /**
1330        * annotations, jpredfile, jnetfile
1331        * 
1332        */
1333       @Override
1334       public void updateForAnnotations()
1335       {
1336         af.updateForAnnotations();
1337       }
1338
1339       @Override
1340       public void loadTree(NewickFile fin, String treeFile)
1341               throws IOException
1342       {
1343         // n/a -- already done by standard Jalview command line processing
1344       }
1345
1346       @Override
1347       public void setAlignPdbStructures(boolean defaultParameter)
1348       {
1349         alignPDBStructures = true;
1350       }
1351
1352       @Override
1353       public void newStructureView(PDBEntry pdb, SequenceI[] seqs,
1354               String[] chains, DataSourceType protocol)
1355       {
1356         StructureViewer.launchStructureViewer(af.alignPanel, pdb, seqs);
1357       }
1358
1359       @Override
1360       public void setFeatureGroupState(String[] groups, boolean state)
1361       {
1362         af.setFeatureGroupState(groups, state);
1363       }
1364
1365       @Override
1366       public void alignedStructureView(PDBEntry[] pdb, SequenceI[][] seqs,
1367               String[][] chains, String[] protocols)
1368       {
1369         System.err.println(
1370                 "Jalview applet interface alignedStructureView not implemented");
1371       }
1372
1373       @Override
1374       public void newFeatureSettings()
1375       {
1376         System.err.println(
1377                 "Jalview applet interface newFeatureSettings not implemented");
1378       }
1379
1380     };
1381
1382     new JalviewAppLoader(true).load(app);
1383   }
1384
1385   @Override
1386   public String getSelectedSequences()
1387   {
1388     // TODO Auto-generated method stub
1389     return null;
1390   }
1391
1392   @Override
1393   public String getSelectedSequences(String sep)
1394   {
1395     // TODO Auto-generated method stub
1396     return null;
1397   }
1398
1399   @Override
1400   public String getSelectedSequencesFrom(jalview.appletgui.AlignFrame alf)
1401   {
1402     // TODO Auto-generated method stub
1403     return null;
1404   }
1405
1406   @Override
1407   public String getSelectedSequencesFrom(jalview.appletgui.AlignFrame alf,
1408           String sep)
1409   {
1410     // TODO Auto-generated method stub
1411     return null;
1412   }
1413
1414   @Override
1415   public void highlight(String sequenceId, String position,
1416           String alignedPosition)
1417   {
1418     // TODO Auto-generated method stub
1419
1420   }
1421
1422   @Override
1423   public void highlightIn(jalview.appletgui.AlignFrame alf,
1424           String sequenceId, String position, String alignedPosition)
1425   {
1426     // TODO Auto-generated method stub
1427
1428   }
1429
1430   @Override
1431   public void select(String sequenceIds, String columns)
1432   {
1433     // TODO Auto-generated method stub
1434
1435   }
1436
1437   @Override
1438   public void select(String sequenceIds, String columns, String sep)
1439   {
1440     // TODO Auto-generated method stub
1441
1442   }
1443
1444   @Override
1445   public void selectIn(jalview.appletgui.AlignFrame alf, String sequenceIds,
1446           String columns)
1447   {
1448     // TODO Auto-generated method stub
1449
1450   }
1451
1452   @Override
1453   public void selectIn(jalview.appletgui.AlignFrame alf, String sequenceIds,
1454           String columns, String sep)
1455   {
1456     // TODO Auto-generated method stub
1457
1458   }
1459
1460   @Override
1461   public String getSelectedSequencesAsAlignment(String format,
1462           String suffix)
1463   {
1464     // TODO Auto-generated method stub
1465     return null;
1466   }
1467
1468   @Override
1469   public String getSelectedSequencesAsAlignmentFrom(
1470           jalview.appletgui.AlignFrame alf, String format, String suffix)
1471   {
1472     // TODO Auto-generated method stub
1473     return null;
1474   }
1475
1476   @Override
1477   public String getAlignmentOrder()
1478   {
1479     // TODO Auto-generated method stub
1480     return null;
1481   }
1482
1483   @Override
1484   public String getAlignmentOrderFrom(jalview.appletgui.AlignFrame alf)
1485   {
1486     // TODO Auto-generated method stub
1487     return null;
1488   }
1489
1490   @Override
1491   public String getAlignmentOrderFrom(jalview.appletgui.AlignFrame alf,
1492           String sep)
1493   {
1494     // TODO Auto-generated method stub
1495     return null;
1496   }
1497
1498   @Override
1499   public String orderBy(String order, String undoName)
1500   {
1501     // TODO Auto-generated method stub
1502     return null;
1503   }
1504
1505   @Override
1506   public String orderBy(String order, String undoName, String sep)
1507   {
1508     // TODO Auto-generated method stub
1509     return null;
1510   }
1511
1512   @Override
1513   public String orderAlignmentBy(jalview.appletgui.AlignFrame alf,
1514           String order, String undoName, String sep)
1515   {
1516     // TODO Auto-generated method stub
1517     return null;
1518   }
1519
1520   @Override
1521   public String getAlignment(String format)
1522   {
1523     // TODO Auto-generated method stub
1524     return null;
1525   }
1526
1527   @Override
1528   public String getAlignmentFrom(jalview.appletgui.AlignFrame alf,
1529           String format)
1530   {
1531     // TODO Auto-generated method stub
1532     return null;
1533   }
1534
1535   @Override
1536   public String getAlignment(String format, String suffix)
1537   {
1538     // TODO Auto-generated method stub
1539     return null;
1540   }
1541
1542   @Override
1543   public String getAlignmentFrom(jalview.appletgui.AlignFrame alf,
1544           String format, String suffix)
1545   {
1546     // TODO Auto-generated method stub
1547     return null;
1548   }
1549
1550   @Override
1551   public void loadAnnotation(String annotation)
1552   {
1553     // TODO Auto-generated method stub
1554
1555   }
1556
1557   @Override
1558   public void loadAnnotationFrom(jalview.appletgui.AlignFrame alf,
1559           String annotation)
1560   {
1561     // TODO Auto-generated method stub
1562
1563   }
1564
1565   @Override
1566   public void loadFeatures(String features, boolean autoenabledisplay)
1567   {
1568     // TODO Auto-generated method stub
1569
1570   }
1571
1572   @Override
1573   public boolean loadFeaturesFrom(jalview.appletgui.AlignFrame alf,
1574           String features, boolean autoenabledisplay)
1575   {
1576     // TODO Auto-generated method stub
1577     return false;
1578   }
1579
1580   @Override
1581   public String getFeatures(String format)
1582   {
1583     // TODO Auto-generated method stub
1584     return null;
1585   }
1586
1587   @Override
1588   public String getFeaturesFrom(jalview.appletgui.AlignFrame alf,
1589           String format)
1590   {
1591     // TODO Auto-generated method stub
1592     return null;
1593   }
1594
1595   @Override
1596   public String getAnnotation()
1597   {
1598     // TODO Auto-generated method stub
1599     return null;
1600   }
1601
1602   @Override
1603   public String getAnnotationFrom(jalview.appletgui.AlignFrame alf)
1604   {
1605     // TODO Auto-generated method stub
1606     return null;
1607   }
1608
1609   @Override
1610   public jalview.appletgui.AlignFrame newView()
1611   {
1612     // TODO Auto-generated method stub
1613     return null;
1614   }
1615
1616   @Override
1617   public jalview.appletgui.AlignFrame newView(String name)
1618   {
1619     // TODO Auto-generated method stub
1620     return null;
1621   }
1622
1623   @Override
1624   public jalview.appletgui.AlignFrame newViewFrom(
1625           jalview.appletgui.AlignFrame alf)
1626   {
1627     // TODO Auto-generated method stub
1628     return null;
1629   }
1630
1631   @Override
1632   public jalview.appletgui.AlignFrame newViewFrom(
1633           jalview.appletgui.AlignFrame alf, String name)
1634   {
1635     // TODO Auto-generated method stub
1636     return null;
1637   }
1638
1639   @Override
1640   public jalview.appletgui.AlignFrame loadAlignment(String text,
1641           String title)
1642   {
1643     // TODO Auto-generated method stub
1644     return null;
1645   }
1646
1647   @Override
1648   public void setMouseoverListener(String listener)
1649   {
1650     // TODO Auto-generated method stub
1651
1652   }
1653
1654   @Override
1655   public void setMouseoverListener(jalview.appletgui.AlignFrame af,
1656           String listener)
1657   {
1658     // TODO Auto-generated method stub
1659
1660   }
1661
1662   @Override
1663   public void setSelectionListener(String listener)
1664   {
1665     // TODO Auto-generated method stub
1666
1667   }
1668
1669   @Override
1670   public void setSelectionListener(jalview.appletgui.AlignFrame af,
1671           String listener)
1672   {
1673     // TODO Auto-generated method stub
1674
1675   }
1676
1677   @Override
1678   public void setStructureListener(String listener, String modelSet)
1679   {
1680     // TODO Auto-generated method stub
1681
1682   }
1683
1684   @Override
1685   public void removeJavascriptListener(jalview.appletgui.AlignFrame af,
1686           String listener)
1687   {
1688     // TODO Auto-generated method stub
1689
1690   }
1691
1692   @Override
1693   public void mouseOverStructure(String pdbResNum, String chain,
1694           String pdbfile)
1695   {
1696     // TODO Auto-generated method stub
1697
1698   }
1699
1700   @Override
1701   public boolean addPdbFile(jalview.appletgui.AlignFrame alFrame,
1702           String sequenceId, String pdbEntryString, String pdbFile)
1703   {
1704     // TODO Auto-generated method stub
1705     return false;
1706   }
1707
1708   @Override
1709   public void scrollViewToIn(jalview.appletgui.AlignFrame alf,
1710           String topRow, String leftHandColumn)
1711   {
1712     // TODO Auto-generated method stub
1713
1714   }
1715
1716   @Override
1717   public void scrollViewToRowIn(jalview.appletgui.AlignFrame alf,
1718           String topRow)
1719   {
1720     // TODO Auto-generated method stub
1721
1722   }
1723
1724   @Override
1725   public void scrollViewToColumnIn(jalview.appletgui.AlignFrame alf,
1726           String leftHandColumn)
1727   {
1728     // TODO Auto-generated method stub
1729
1730   }
1731
1732   @Override
1733   public String getFeatureGroups()
1734   {
1735     // TODO Auto-generated method stub
1736     return null;
1737   }
1738
1739   @Override
1740   public String getFeatureGroupsOn(jalview.appletgui.AlignFrame alf)
1741   {
1742     // TODO Auto-generated method stub
1743     return null;
1744   }
1745
1746   @Override
1747   public String getFeatureGroupsOfState(boolean visible)
1748   {
1749     // TODO Auto-generated method stub
1750     return null;
1751   }
1752
1753   @Override
1754   public String getFeatureGroupsOfStateOn(jalview.appletgui.AlignFrame alf,
1755           boolean visible)
1756   {
1757     // TODO Auto-generated method stub
1758     return null;
1759   }
1760
1761   @Override
1762   public void setFeatureGroupStateOn(jalview.appletgui.AlignFrame alf,
1763           String groups, boolean state)
1764   {
1765     // TODO Auto-generated method stub
1766
1767   }
1768
1769   @Override
1770   public void setFeatureGroupState(String groups, boolean state)
1771   {
1772     // TODO Auto-generated method stub
1773
1774   }
1775
1776   @Override
1777   public String getSeparator()
1778   {
1779     // TODO Auto-generated method stub
1780     return null;
1781   }
1782
1783   @Override
1784   public void setSeparator(String separator)
1785   {
1786     // TODO Auto-generated method stub
1787
1788   }
1789
1790   @Override
1791   public String getJsMessage(String messageclass, String viewId)
1792   {
1793     // TODO Auto-generated method stub
1794     return null;
1795   }
1796
1797 }