X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fbin%2FJalview.java;h=84fec4569df2aad30c78c0ea9171e28f16861235;hb=4ba1c57b4ce0b3708b245633a109442dc88f586c;hp=9e3382af429652ca477c0fc1d298380fc3faff8a;hpb=208f2c3de82e3327c4f930ab7d04f5b812ccd277;p=jalview.git diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index 9e3382a..84fec45 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -20,45 +20,49 @@ */ package jalview.bin; -import jalview.analysis.AlignmentSorter; -import jalview.analysis.scoremodels.ScoreModels; +import jalview.api.AlignFrameI; +import jalview.api.AlignViewportI; +import jalview.api.JalviewApp; import jalview.api.StructureSelectionManagerProvider; -import jalview.ext.ensembl.EnsemblInfo; +import jalview.bin.ApplicationSingletonProvider.ApplicationSingletonI; +import jalview.datamodel.ColumnSelection; +import jalview.datamodel.HiddenColumns; +import jalview.datamodel.PDBEntry; +import jalview.datamodel.SequenceGroup; +import jalview.datamodel.SequenceI; import jalview.ext.so.SequenceOntology; -import jalview.fts.service.pdb.PDBFTSRestClient; -import jalview.fts.service.uniprot.UniProtFTSRestClient; import jalview.gui.AlignFrame; +import jalview.gui.AlignViewport; +import jalview.gui.AlignmentPanel; import jalview.gui.Desktop; +import jalview.gui.Preferences; import jalview.gui.PromptUserConfig; -import jalview.httpserver.HttpServer; +import jalview.gui.StructureViewer; import jalview.io.AppletFormatAdapter; import jalview.io.BioJsHTMLOutput; import jalview.io.DataSourceType; import jalview.io.FileFormat; import jalview.io.FileFormatException; import jalview.io.FileFormatI; +import jalview.io.FileFormats; import jalview.io.FileLoader; import jalview.io.HtmlSvgOutput; import jalview.io.IdentifyFile; import jalview.io.NewickFile; import jalview.io.gff.SequenceOntologyFactory; -import jalview.io.gff.SequenceOntologyI; -import jalview.rest.RestHandler; +import jalview.javascript.JSFunctionExec; +import jalview.javascript.JalviewLiteJsApi; +import jalview.javascript.MouseOverStructureListener; +import jalview.renderer.seqfeatures.FeatureRenderer; import jalview.schemes.ColourSchemeI; import jalview.schemes.ColourSchemeProperty; -import jalview.structure.StructureImportSettings; -import jalview.structure.StructureSelectionManager; -import jalview.urls.IdOrgSettings; +import jalview.structure.SelectionSource; +import jalview.structure.VamsasSource; import jalview.util.MessageManager; import jalview.util.Platform; -import jalview.ws.SequenceFetcher; -import jalview.ws.jws1.Discoverer; import jalview.ws.jws2.Jws2Discoverer; -import jalview.ws.jws2.jabaws2.Jws2InstanceFactory; -import jalview.ws.rest.RestClient; -import jalview.ws.sifts.SiftsSettings; -import java.awt.Color; +import java.applet.AppletContext; import java.io.BufferedReader; import java.io.File; import java.io.FileOutputStream; @@ -76,7 +80,7 @@ import java.security.PermissionCollection; import java.security.Permissions; import java.security.Policy; import java.util.HashMap; -import java.util.IdentityHashMap; +import java.util.Hashtable; import java.util.Map; import java.util.Vector; import java.util.logging.ConsoleHandler; @@ -88,6 +92,7 @@ import javax.swing.UIManager; import groovy.lang.Binding; import groovy.util.GroovyScriptEngine; +import netscape.javascript.JSObject; /** * Main class for Jalview Application
@@ -104,8 +109,19 @@ import groovy.util.GroovyScriptEngine; * @author $author$ * @version $Revision$ */ -public class Jalview +public class Jalview implements ApplicationSingletonI, JalviewLiteJsApi { + + public static Jalview getInstance() + { + return (Jalview) ApplicationSingletonProvider + .getInstance(Jalview.class); + } + + private Jalview() + { + } + static { Platform.getURLCommandArguments(); @@ -118,41 +134,17 @@ public class Jalview return getInstance().headless; } - /** - * singleton instance of this class in Java only - */ + private Desktop desktop; - private static Jalview instance; + private AlignFrame currentAlignFrame; - public static Jalview getInstance() - { - Jalview j; - @SuppressWarnings("unused") - ThreadGroup g = Thread.currentThread().getThreadGroup(); - /** - * @j2sNative j = g._jalviewInstance; - */ - { - j = instance; - } - return j; - } + public boolean isJavaAppletTag; - private static void setInstance(Jalview j) - { - @SuppressWarnings("unused") - ThreadGroup g = Thread.currentThread().getThreadGroup(); - /** - * @j2sNative g._jalviewInstance = j; - */ - { - instance = j; - } - } + public String appletResourcePath; - private Desktop desktop; + private JalviewAppLoader appLoader; - private AlignFrame currentAlignFrame; + protected JSFunctionExec jsFunctionExec; public static AlignFrame getCurrentAlignFrame() { @@ -260,7 +252,6 @@ public class Jalview public static void main(String[] args) { // setLogging(); // BH - for event debugging in JavaScript - setInstance(new Jalview()); getInstance().doMain(args); } @@ -310,7 +301,8 @@ public class Jalview void doMain(String[] args) { - if (!Platform.isJS()) + boolean isJS = Platform.isJS(); + if (!isJS) { System.setSecurityManager(null); } @@ -325,19 +317,32 @@ public class Jalview String usrPropsFile = aparser.getValue(ArgsParser.PROPS); Cache.loadProperties(usrPropsFile); - if (usrPropsFile != null) + if (isJS) { + isJavaAppletTag = aparser.isApplet(); + if (isJavaAppletTag) + { + Preferences.setAppletDefaults(); + Cache.loadProperties(usrPropsFile); // again, because we + // might be changing defaults here? + } System.out.println( - "CMD [-props " + usrPropsFile + "] executed successfully!"); + " found: " + aparser.getValue("Info.j2sAppletID")); + appletResourcePath = aparser.getValue("Info.resourcePath"); } - - if (!Platform.isJS()) + else /** * Java only * * @j2sIgnore */ { + if (usrPropsFile != null) + { + System.out.println( + "CMD [-props " + usrPropsFile + "] executed successfully!"); + } + if (aparser.contains("help") || aparser.contains("h")) { showUsage(); @@ -358,7 +363,7 @@ public class Jalview { try { - Jws2Discoverer.getDiscoverer().setPreferredUrl(jabawsUrl); + Jws2Discoverer.getInstance().setPreferredUrl(jabawsUrl); System.out.println( "CMD [-jabaws " + jabawsUrl + "] executed successfully!"); } catch (MalformedURLException e) @@ -381,7 +386,7 @@ public class Jalview else { System.out.println("Executing setprop argument: " + defs); - if (Platform.isJS()) + if (isJS) { Cache.setProperty(defs.substring(0, p), defs.substring(p + 1)); } @@ -453,18 +458,18 @@ public class Jalview * configure 'full' SO model if preferences say to, * else use the default (SO Lite) */ - if (Cache.getDefault("USE_FULL_SO", false)) + if (Cache.getDefault(Preferences.USE_FULL_SO, false)) { - SequenceOntologyFactory.setInstance(new SequenceOntology()); + SequenceOntologyFactory.setSequenceOntology(new SequenceOntology()); } if (!headless) { - desktop = new Desktop(); + desktop = Desktop.getInstance(); desktop.setInBatchMode(true); // indicate we are starting up desktop.setVisible(true); - if (!Platform.isJS()) + if (!isJS) /** * Java only * @@ -495,7 +500,7 @@ public class Jalview } else { - if (Cache.getProperty("NOQUESTIONNAIRES") == null) + if (Cache.getProperty(Preferences.NOQUESTIONNAIRES) == null) { // Start the desktop questionnaire prompter with the specified // questionnaire @@ -524,109 +529,45 @@ public class Jalview } } - String data = null; - FileFormatI format = null; - DataSourceType protocol = null; - FileLoader fileLoader = new FileLoader(!headless); - // script to execute after all loading is // completed one way or another // extract groovy argument and execute if necessary - String groovyscript = aparser.getValue(ArgsParser.GROOVY, true); + String groovyscript = (isJS ? null + : aparser.getValue(ArgsParser.GROOVY, true)); String file = aparser.getValue(ArgsParser.OPEN, true); + // BH this here to allow split frame; not working as of 5/17/2019 + String file2 = aparser.getValue(ArgsParser.OPEN2, true); + String fileFormat = (isJavaAppletTag + ? aparser.getAppletValue("format", null) + : null); + + FileFormatI format = null; + DataSourceType protocol = null; if (file == null && desktop == null) { System.out.println("No files to open!"); System.exit(1); } - String vamsasImport = aparser.getValue(ArgsParser.VDOC); - String vamsasSession = aparser.getValue(ArgsParser.VSESS); - if (vamsasImport != null || vamsasSession != null) + boolean haveImport = checkStartVamas(aparser); + // Finally, deal with the remaining input data. + long progress = -1; + if (file == null && isJavaAppletTag) { - if (desktop == null || headless) + // Maybe the sequences are added as parameters + StringBuffer data = new StringBuffer("PASTE"); + int i = 1; + while ((file = aparser.getAppletValue("sequence" + i, null)) != null) { - System.out.println( - "Headless vamsas sessions not yet supported. Sorry."); - System.exit(1); - } - // if we have a file, start a new session and import it. - boolean inSession = false; - if (vamsasImport != null) - { - try - { - DataSourceType viprotocol = AppletFormatAdapter - .checkProtocol(vamsasImport); - if (viprotocol == DataSourceType.FILE) - { - inSession = desktop.vamsasImport(new File(vamsasImport)); - } - else if (viprotocol == DataSourceType.URL) - { - inSession = desktop.vamsasImport(new URL(vamsasImport)); - } - - } catch (Exception e) - { - System.err.println("Exeption when importing " + vamsasImport - + " as a vamsas document."); - e.printStackTrace(); - } - if (!inSession) - { - System.err.println("Failed to import " + vamsasImport - + " as a vamsas document."); - } - else - { - System.out.println("Imported Successfully into new session " - + desktop.getVamsasApplication().getCurrentSession()); - } + data.append(file.toString() + "\n"); + i++; } - if (vamsasSession != null) + if (data.length() > 5) { - if (vamsasImport != null) - { - // close the newly imported session and import the Jalview specific - // remnants into the new session later on. - desktop.vamsasStop_actionPerformed(null); - } - // now join the new session - try - { - if (desktop.joinVamsasSession(vamsasSession)) - { - System.out.println( - "Successfully joined vamsas session " + vamsasSession); - } - else - { - System.err.println("WARNING: Failed to join vamsas session " - + vamsasSession); - } - } catch (Exception e) - { - System.err.println( - "ERROR: Failed to join vamsas session " + vamsasSession); - e.printStackTrace(); - } - if (vamsasImport != null) - { - // the Jalview specific remnants can now be imported into the new - // session at the user's leisure. - Cache.log.info( - "Skipping Push for import of data into existing vamsas session."); // TODO: - // enable - // this - // when - // debugged - // desktop.getVamsasApplication().push_update(); - } + file = data.toString(); } } - long progress = -1; - // Finally, deal with the remaining input data. + if (file != null) { if (!headless) @@ -636,9 +577,8 @@ public class Jalview .getString("status.processing_commandline_args"), progress = System.currentTimeMillis()); } - System.out.println("CMD [-open " + file + "] executed successfully!"); - if (!Platform.isJS()) + if (!isJS) /** * ignore in JavaScript -- can't just check file existence - could load * it? @@ -664,22 +604,60 @@ public class Jalview try { - format = new IdentifyFile().identify(file, protocol); + format = (isJavaAppletTag && fileFormat != null + ? FileFormats.getInstance().forName(fileFormat) + : null); + if (format == null) + { + format = new IdentifyFile().identify(file, protocol); + } } catch (FileFormatException e1) { // TODO ? } - AlignFrame af = fileLoader.LoadFileWaitTillLoaded(file, protocol, - format); + AlignFrame af = new FileLoader(!headless).loadFileWaitTillLoaded(file, + protocol, format); if (af == null) { System.out.println("error"); } else { + System.out + .println("CMD [-open " + file + "] executed successfully!"); + if (file2 != null) + { + protocol = AppletFormatAdapter.checkProtocol(file2); + try + { + format = new IdentifyFile().identify(file2, protocol); + } catch (FileFormatException e1) + { + // TODO ? + } + AlignFrame af2 = new FileLoader(!headless) + .loadFileWaitTillLoaded(file2, protocol, format); + if (af2 == null) + { + System.out.println("error"); + } + else + { + AlignViewport.openLinkedAlignmentAs(af, + af.getViewport().getAlignment(), + af2.getViewport().getAlignment(), "", + AlignViewport.SPLIT_FRAME); + System.out.println( + "CMD [-open2 " + file2 + "] executed successfully!"); + } + } + setCurrentAlignFrame(af); - data = aparser.getValue(ArgsParser.COLOUR, true); + + // TODO: file2 How to implement file2 for the applet spit screen? + + String data = aparser.getValue(ArgsParser.COLOUR, true); if (data != null) { data.replaceAll("%20", " "); @@ -770,104 +748,33 @@ public class Jalview // TODO - load PDB structure(s) to alignment JAL-629 // (associate with identical sequence in alignment, or a specified // sequence) - if (groovyscript != null) + if (isJavaAppletTag) { - // Execute the groovy script after we've done all the rendering stuff - // and before any images or figures are generated. - System.out.println("Executing script " + groovyscript); - executeGroovyScript(groovyscript, af); - System.out.println("CMD groovy[" + groovyscript - + "] executed successfully!"); - groovyscript = null; + loadAppletParams(aparser, af); } - String imageName = "unnamed.png"; - while (aparser.getSize() > 1) + else if (!isJS) + /** + * Java only + * + * @j2sIgnore + */ { - // PNG filename - // SVG filename - // HTML filename - // biojsmsa filename - String outputFormat = aparser.nextValue(); - file = aparser.nextValue(); - - if (outputFormat.equalsIgnoreCase("png")) - { - af.createPNG(new File(file)); - imageName = (new File(file)).getName(); - System.out.println("Creating PNG image: " + file); - continue; - } - else if (outputFormat.equalsIgnoreCase("svg")) - { - File imageFile = new File(file); - imageName = imageFile.getName(); - af.createSVG(imageFile); - System.out.println("Creating SVG image: " + file); - continue; - } - else if (outputFormat.equalsIgnoreCase("html")) - { - File imageFile = new File(file); - imageName = imageFile.getName(); - HtmlSvgOutput htmlSVG = new HtmlSvgOutput(af.alignPanel); - htmlSVG.exportHTML(file); - - System.out.println("Creating HTML image: " + file); - continue; - } - else if (outputFormat.equalsIgnoreCase("biojsmsa")) - { - if (file == null) - { - System.err.println("The output html file must not be null"); - return; - } - try - { - BioJsHTMLOutput.refreshVersionInfo( - BioJsHTMLOutput.BJS_TEMPLATES_LOCAL_DIRECTORY); - } catch (URISyntaxException e) - { - e.printStackTrace(); - } - BioJsHTMLOutput bjs = new BioJsHTMLOutput(af.alignPanel); - bjs.exportHTML(file); - System.out - .println("Creating BioJS MSA Viwer HTML file: " + file); - continue; - } - else if (outputFormat.equalsIgnoreCase("imgMap")) - { - af.createImageMap(new File(file), imageName); - System.out.println("Creating image map: " + file); - continue; - } - else if (outputFormat.equalsIgnoreCase("eps")) - { - File outputFile = new File(file); - System.out.println( - "Creating EPS file: " + outputFile.getAbsolutePath()); - af.createEPS(outputFile); - continue; - } - - af.saveAlignment(file, format); - if (af.isSaveAlignmentSuccessful()) + if (groovyscript != null) { - System.out.println("Written alignment in " + format - + " format to " + file); + // Execute the groovy script after we've done all the rendering + // stuff + // and before any images or figures are generated. + System.out.println("Executing script " + groovyscript); + executeGroovyScript(groovyscript, af); + System.out.println("CMD groovy[" + groovyscript + + "] executed successfully!"); + groovyscript = null; } - else + checkOutputFile(aparser, af, format); + while (aparser.getSize() > 0) { - System.out.println("Error writing file " + file + " in " - + format + " format!!"); + System.out.println("Unknown arg: " + aparser.nextValue()); } - - } - - while (aparser.getSize() > 0) - { - System.out.println("Unknown arg: " + aparser.nextValue()); } } } @@ -876,8 +783,7 @@ public class Jalview // And the user // //////////////////// - if (!Platform.isJS() && !headless && file == null - && vamsasImport == null + if (!isJS && !headless && file == null && !haveImport && jalview.bin.Cache.getDefault("SHOW_STARTUP_FILE", true)) /** * Java only @@ -920,8 +826,8 @@ public class Jalview } } - startUpAlframe = fileLoader.LoadFileWaitTillLoaded(file, protocol, - format); + startUpAlframe = new FileLoader(!headless) + .loadFileWaitTillLoaded(file, protocol, format); // extract groovy arguments before anything else. } @@ -951,6 +857,185 @@ public class Jalview } } + private boolean checkStartVamas(ArgsParser aparser) + { + String vamsasImport = aparser.getValue(ArgsParser.VDOC); + String vamsasSession = aparser.getValue(ArgsParser.VSESS); + if (vamsasImport == null && vamsasSession == null) + { + return false; + } + if (desktop == null || headless) + { + System.out.println( + "Headless vamsas sessions not yet supported. Sorry."); + System.exit(1); + } + boolean haveImport = (vamsasImport != null); + if (haveImport) + { + // if we have a file, start a new session and import it. + boolean inSession = false; + try + { + DataSourceType viprotocol = AppletFormatAdapter + .checkProtocol(vamsasImport); + if (viprotocol == DataSourceType.FILE) + { + inSession = desktop.vamsasImport(new File(vamsasImport)); + } + else if (viprotocol == DataSourceType.URL) + { + inSession = desktop.vamsasImport(new URL(vamsasImport)); + } + + } catch (Exception e) + { + System.err.println("Exeption when importing " + vamsasImport + + " as a vamsas document."); + e.printStackTrace(); + } + if (!inSession) + { + System.err.println("Failed to import " + vamsasImport + + " as a vamsas document."); + } + else + { + System.out.println("Imported Successfully into new session " + + desktop.getVamsasApplication().getCurrentSession()); + } + } + if (vamsasSession != null) + { + if (vamsasImport != null) + { + // close the newly imported session and import the Jalview specific + // remnants into the new session later on. + desktop.vamsasStop_actionPerformed(null); + } + // now join the new session + try + { + if (desktop.joinVamsasSession(vamsasSession)) + { + System.out.println( + "Successfully joined vamsas session " + vamsasSession); + } + else + { + System.err.println("WARNING: Failed to join vamsas session " + + vamsasSession); + } + } catch (Exception e) + { + System.err.println( + "ERROR: Failed to join vamsas session " + vamsasSession); + e.printStackTrace(); + } + if (vamsasImport != null) + { + // the Jalview specific remnants can now be imported into the new + // session at the user's leisure. + Cache.log.info( + "Skipping Push for import of data into existing vamsas session."); // TODO: + // enable + // this + // when + // debugged + // desktop.getVamsasApplication().push_update(); + } + } + return haveImport; + } + + private void checkOutputFile(ArgsParser aparser, AlignFrame af, + FileFormatI format) + { + String imageName = "unnamed.png"; + while (aparser.getSize() > 1) + { + // PNG filename + // SVG filename + // HTML filename + // biojsmsa filename + String outputFormat = aparser.nextValue(); + String file = aparser.nextValue(); + if (outputFormat.equalsIgnoreCase("png")) + { + af.createPNG(new File(file)); + imageName = (new File(file)).getName(); + System.out.println("Creating PNG image: " + file); + continue; + } + else if (outputFormat.equalsIgnoreCase("svg")) + { + File imageFile = new File(file); + imageName = imageFile.getName(); + af.createSVG(imageFile); + System.out.println("Creating SVG image: " + file); + continue; + } + else if (outputFormat.equalsIgnoreCase("html")) + { + File imageFile = new File(file); + imageName = imageFile.getName(); + HtmlSvgOutput htmlSVG = new HtmlSvgOutput(af.alignPanel); + htmlSVG.exportHTML(file); + + System.out.println("Creating HTML image: " + file); + continue; + } + else if (outputFormat.equalsIgnoreCase("biojsmsa")) + { + if (file == null) + { + System.err.println("The output html file must not be null"); + return; + } + try + { + BioJsHTMLOutput.refreshVersionInfo( + BioJsHTMLOutput.BJS_TEMPLATES_LOCAL_DIRECTORY); + } catch (URISyntaxException e) + { + e.printStackTrace(); + } + BioJsHTMLOutput bjs = new BioJsHTMLOutput(af.alignPanel); + bjs.exportHTML(file); + System.out.println("Creating BioJS MSA Viwer HTML file: " + file); + continue; + } + else if (outputFormat.equalsIgnoreCase("imgMap")) + { + af.createImageMap(new File(file), imageName); + System.out.println("Creating image map: " + file); + continue; + } + else if (outputFormat.equalsIgnoreCase("eps")) + { + File outputFile = new File(file); + System.out.println( + "Creating EPS file: " + outputFile.getAbsolutePath()); + af.createEPS(outputFile); + continue; + } + + af.saveAlignment(file, format); + if (af.isSaveAlignmentSuccessful()) + { + System.out.println( + "Written alignment in " + format + " format to " + file); + } + else + { + System.out.println("Error writing file " + file + " in " + format + + " format!!"); + } + + } + } + private static void showUsage() { System.out.println( @@ -1159,6 +1244,12 @@ public class Jalview */ public void quit() { + if (jsFunctionExec != null) + { + jsFunctionExec.tidyUp(); + jsFunctionExec = null; + } + if (desktop != null) { desktop.quit(); @@ -1169,46 +1260,667 @@ public class Jalview } } - // singleton instances + /** + * Get the SwingJS applet ID and combine that with the frameType + * + * @param frameType + * "alignment", "desktop", etc., or null + * @return + */ + public static String getAppID(String frameType) + { + String id = Cache.getProperty("Info.j2sAppletID"); + if (id == null) + { + id = "jalview"; + } + return id + (frameType == null ? "" : "-" + frameType); + } - public Cache cache; + /** + * Handle all JalviewLite applet parameters + * + * @param aparser + * @param af + */ + private void loadAppletParams(ArgsParser aparser, AlignFrame af) + { + JalviewApp app = new JalviewApp() + { - public AlignmentSorter alignmentSorter; + private boolean alignPDBStructures; // From JalviewLite; not implemented - public EnsemblInfo ensemblInfo; + private Hashtable> jsmessages; - public HttpServer httpServer; + private Hashtable jshashes; - public IdentityHashMap structureSelections; + @Override + public String getParameter(String name) + { + return aparser.getAppletValue(name, null); + } - public PDBFTSRestClient pdbFTSRestClient; + @Override + public boolean getDefaultParameter(String name, boolean def) + { + String stn; + return ((stn = getParameter(name)) == null ? def + : "true".equalsIgnoreCase(stn)); + } - public RestHandler restHandler; + /** + * Get the applet-like document base even though this is an application. + */ + @Override + public URL getDocumentBase() + { + return Platform.getDocumentBase(); + } - public ScoreModels scoreModels; + /** + * Get the applet-like code base even though this is an application. + */ + @Override + public URL getCodeBase() + { + return Platform.getCodeBase(); + } - public SequenceFetcher sequenceFetcher; + @Override + public AlignViewportI getViewport() + { + return af.getViewport(); + } - public SequenceOntologyI sequenceOntology; + /** + * features + * + */ + @Override + public boolean parseFeaturesFile(String filename, + DataSourceType protocol) + { + return af.parseFeaturesFile(filename, protocol); + } - public UniProtFTSRestClient uniprotFTSRestClient; + /** + * scorefile + * + */ + @Override + public boolean loadScoreFile(String sScoreFile) throws IOException + { + af.loadJalviewDataFile(sScoreFile, null, null, null); + return true; + } + + /** + * annotations, jpredfile, jnetfile + * + */ + @Override + public void updateForAnnotations() + { + af.updateForAnnotations(); + } + + @Override + public void loadTree(NewickFile fin, String treeFile) + throws IOException + { + // n/a -- already done by standard Jalview command line processing + } + + @Override + public void setAlignPdbStructures(boolean defaultParameter) + { + alignPDBStructures = true; + } + + @Override + public void newStructureView(PDBEntry pdb, SequenceI[] seqs, + String[] chains, DataSourceType protocol) + { + StructureViewer.launchStructureViewer(af.alignPanel, pdb, seqs); + } + + @Override + public void setFeatureGroupState(String[] groups, boolean state) + { + af.setFeatureGroupState(groups, state); + } + + @Override + public void alignedStructureView(PDBEntry[] pdb, SequenceI[][] seqs, + String[][] chains, String[] protocols) + { + System.err.println( + "Jalview applet interface alignedStructureView not implemented"); + } + + @Override + public void newFeatureSettings() + { + System.err.println( + "Jalview applet interface newFeatureSettings not implemented"); + } + + private Vector jsExecQueue; + + @Override + public Vector getJsExecQueue(JSFunctionExec exec) + { + jsFunctionExec = exec; + return (jsExecQueue == null ? (jsExecQueue = new Vector<>()) + : jsExecQueue); + } + + @Override + public AppletContext getAppletContext() + { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean isJsfallbackEnabled() + { + // TODO Auto-generated method stub + return false; + } + + @Override + public JSObject getJSObject() + { + // TODO Auto-generated method stub + return null; + } + + @Override + public StructureSelectionManagerProvider getStructureSelectionManagerProvider() + { + // TODO Auto-generated method stub + return null; + } + + @Override + public void updateColoursFromMouseOver(Object source, + MouseOverStructureListener mouseOverStructureListener) + { + // TODO Auto-generated method stub + + } + + @Override + public Object[] getSelectionForListener(SequenceGroup seqsel, + ColumnSelection colsel, HiddenColumns hidden, + SelectionSource source, Object alignFrame) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public String arrayToSeparatorList(String[] array) + { + return appLoader.arrayToSeparatorList(array); + } + + @Override + public Hashtable getJSHashes() + { + return (jshashes == null + ? (jshashes = new Hashtable<>()) + : jshashes); + } + + @Override + public Hashtable> getJSMessages() + { + return (jsmessages == null + ? (jsmessages = new Hashtable<>()) + : jsmessages); + } + + @Override + public Object getFrameForSource(VamsasSource source) + { + if (source != null) + { + AlignFrame af; + if (source instanceof jalview.gui.AlignViewport + && source == (af = getCurrentAlignFrame()).getViewport()) + { + // should be valid if it just generated an event! + return af; + } + // TODO: ensure that if '_af' is specified along with a handler + // function, then only events from that alignFrame are sent to that + // function + } + return null; + } + + @Override + public FeatureRenderer getNewFeatureRenderer(AlignViewportI vp) + { + return new jalview.gui.FeatureRenderer((AlignmentPanel) vp); + } + + }; + + appLoader = new JalviewAppLoader(true); + appLoader.load(app); + } + + @Override + public String getSelectedSequences() + { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getSelectedSequences(String sep) + { + // TODO Auto-generated method stub + return null; + } - public StructureSelectionManager nullProvider; + @Override + public String getSelectedSequencesFrom(AlignFrameI alf) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getSelectedSequencesFrom(AlignFrameI alf, + String sep) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public void highlight(String sequenceId, String position, + String alignedPosition) + { + // TODO Auto-generated method stub + + } - public Color[] rnaHelices = null; + @Override + public void highlightIn(AlignFrameI alf, + String sequenceId, String position, String alignedPosition) + { + // TODO Auto-generated method stub - public StructureImportSettings structureImportSettings; + } - public IdOrgSettings idOrgSettings; + @Override + public void select(String sequenceIds, String columns) + { + // TODO Auto-generated method stub - public SiftsSettings siftsSettings; + } - public RestClient restClient; + @Override + public void select(String sequenceIds, String columns, String sep) + { + // TODO Auto-generated method stub - public Jws2Discoverer j2s2discoverer; + } - public Jws2InstanceFactory jws2InstanceFactory; + @Override + public void selectIn(AlignFrameI alf, String sequenceIds, + String columns) + { + // TODO Auto-generated method stub - public Discoverer discoverer; + } + + @Override + public void selectIn(AlignFrameI alf, String sequenceIds, + String columns, String sep) + { + // TODO Auto-generated method stub + + } + + @Override + public String getSelectedSequencesAsAlignment(String format, + String suffix) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getSelectedSequencesAsAlignmentFrom( + AlignFrameI alf, String format, String suffix) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getAlignmentOrder() + { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getAlignmentOrderFrom(AlignFrameI alf) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getAlignmentOrderFrom(AlignFrameI alf, + String sep) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public String orderBy(String order, String undoName) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public String orderBy(String order, String undoName, String sep) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public String orderAlignmentBy(AlignFrameI alf, + String order, String undoName, String sep) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getAlignment(String format) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getAlignmentFrom(AlignFrameI alf, + String format) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getAlignment(String format, String suffix) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getAlignmentFrom(AlignFrameI alf, + String format, String suffix) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public void loadAnnotation(String annotation) + { + // TODO Auto-generated method stub + + } + + @Override + public void loadAnnotationFrom(AlignFrameI alf, + String annotation) + { + // TODO Auto-generated method stub + + } + + @Override + public void loadFeatures(String features, boolean autoenabledisplay) + { + // TODO Auto-generated method stub + + } + + @Override + public boolean loadFeaturesFrom(AlignFrameI alf, + String features, boolean autoenabledisplay) + { + // TODO Auto-generated method stub + return false; + } + + @Override + public String getFeatures(String format) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getFeaturesFrom(AlignFrameI alf, + String format) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getAnnotation() + { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getAnnotationFrom(AlignFrameI alf) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public AlignFrameI newView() + { + // TODO Auto-generated method stub + return null; + } + + @Override + public AlignFrameI newView(String name) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public AlignFrameI newViewFrom(AlignFrameI alf) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public AlignFrameI newViewFrom(AlignFrameI alf, String name) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public AlignFrameI loadAlignment(String text, + String title) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setMouseoverListener(String listener) + { + // TODO Auto-generated method stub + + } + + @Override + public void setMouseoverListener(AlignFrameI af, + String listener) + { + // TODO Auto-generated method stub + + } + + @Override + public void setSelectionListener(String listener) + { + // TODO Auto-generated method stub + + } + + @Override + public void setSelectionListener(AlignFrameI af, + String listener) + { + // TODO Auto-generated method stub + + } + + @Override + public void setStructureListener(String listener, String modelSet) + { + // TODO Auto-generated method stub + + } + + @Override + public void removeJavascriptListener(AlignFrameI af, + String listener) + { + // TODO Auto-generated method stub + + } + + @Override + public void mouseOverStructure(String pdbResNum, String chain, + String pdbfile) + { + // TODO Auto-generated method stub + + } + + @Override + public boolean addPdbFile(AlignFrameI alFrame, + String sequenceId, String pdbEntryString, String pdbFile) + { + // TODO Auto-generated method stub + return false; + } + + @Override + public void scrollViewToIn(AlignFrameI alf, + String topRow, String leftHandColumn) + { + // TODO Auto-generated method stub + + } + + @Override + public void scrollViewToRowIn(AlignFrameI alf, + String topRow) + { + // TODO Auto-generated method stub + + } + + @Override + public void scrollViewToColumnIn(AlignFrameI alf, + String leftHandColumn) + { + // TODO Auto-generated method stub + + } + + @Override + public String getFeatureGroups() + { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getFeatureGroupsOn(AlignFrameI alf) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getFeatureGroupsOfState(boolean visible) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getFeatureGroupsOfStateOn(AlignFrameI alf, + boolean visible) + { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setFeatureGroupStateOn(AlignFrameI alf, + String groups, boolean state) + { + // TODO Auto-generated method stub + + } + + @Override + public void setFeatureGroupState(String groups, boolean state) + { + // TODO Auto-generated method stub + + } + + @Override + public String getSeparator() + { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setSeparator(String separator) + { + // TODO Auto-generated method stub + + } + + @Override + public String getJsMessage(String messageclass, String viewId) + { + // TODO Auto-generated method stub + return null; + } }