X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=bin%2Fjalview%2Fbin%2FJalviewLite.js;h=1049dcbb29aa7136a7861b48923011deb8396d80;hp=23d66b7d048be292944e430035029b32a81bfa33;hb=8ffd05b3abe52c0b6b79b011c0966361f82d5fe6;hpb=6154cb57a6eac3bb1344b8342495f5bb701ee921 diff --git a/bin/jalview/bin/JalviewLite.js b/bin/jalview/bin/JalviewLite.js index 23d66b7..1049dcb 100644 --- a/bin/jalview/bin/JalviewLite.js +++ b/bin/jalview/bin/JalviewLite.js @@ -1,1617 +1,1617 @@ -Clazz.declarePackage ("jalview.bin"); -Clazz.load (["jalview.api.StructureSelectionManagerProvider", "jalview.javascript.JalviewLiteJsApi", "java.lang.Thread", "javax.swing.JApplet", "jalview.util.MessageManager", "java.util.Hashtable", "$.Vector", "javax.swing.JButton"], "jalview.bin.JalviewLite", ["jalview.analysis.SequenceIdMatcher", "jalview.appletgui.AlignFrame", "$.EmbmenuFrame", "$.FeatureSettings", "$.SplitFrame", "jalview.datamodel.Alignment", "$.AlignmentOrder", "$.ColumnSelection", "$.PDBEntry", "$.SequenceGroup", "jalview.io.AnnotationFile", "$.AppletFormatAdapter", "$.FileParse", "$.IdentifyFile", "$.JnetAnnotationMaker", "$.NewickFile", "jalview.javascript.JSFunctionExec", "$.JsSelectionSender", "$.MouseOverListener", "$.MouseOverStructureListener", "jalview.jsdev.GenericFileAdapter", "jalview.schemes.ColourSchemeProperty", "$.UserColourScheme", "jalview.structure.SelectionListener", "$.StructureSelectionManager", "java.awt.Color", "$.EventQueue", "$.Font", "java.awt.event.ActionListener", "$.WindowAdapter", "java.io.BufferedReader", "$.InputStreamReader", "java.lang.Error", "$.StringBuffer", "java.net.URL", "java.util.StringTokenizer", "netscape.javascript.JSObject"], function () { -c$ = Clazz.decorateAsClass (function () { -this.embedded = false; -this.enableSplitFrame = false; -this.showButton = true; -this.checkForJmol = true; -this.jalviewServletURL = null; -this.startupFile = "No file"; -this.helpUrl = null; -this.externalstructureviewer = null; -this.sep = null; -this.rgb = null; -this.labelColour = null; -this.initjscallback = null; -this.pdbFile = null; -this.sequence = null; -this.jnetFile = null; -this.annotations = null; -this.hideFeatureGroups = null; -this.showFeatureGroups = null; -this.features = null; -this.showFeatureSettings = null; -this.scoreFile = null; -this.treeFile = null; -this.windowWidth = null; -this.windowHeight = null; -this.defaultColour = null; -this.sortBy = null; -this.wrap = null; -this.centrecolumnlabels = null; -this.userDefinedColour = null; -this.widthScale = null; -this.heightScale = null; -this.upperCase = null; -this.file2 = null; -this.javascriptListeners = null; -this.jsFunctionExec = null; -this.fileFound = true; -this.launcher = null; -this.currentAlignFrame = null; -this.initialAlignFrame = null; -this.checkedForJmol = false; -this.jmolAvailable = false; -this.alignPdbStructures = false; -this.useXtrnalSviewer = false; -this.haveShownLoadMessage = false; -if (!Clazz.isClassDefined ("jalview.bin.JalviewLite.LoadJmolThread")) { -jalview.bin.JalviewLite.$JalviewLite$LoadJmolThread$ (); -} -if (!Clazz.isClassDefined ("jalview.bin.JalviewLite.LoadingThread")) { -jalview.bin.JalviewLite.$JalviewLite$LoadingThread$ (); -} -this.separator = "\u00ac"; -this.jsfallbackEnabled = false; -this.jshashes = null; -this.jsmessages = null; -this.jsExecQueue = null; -Clazz.instantialize (this, arguments); -}, jalview.bin, "JalviewLite", javax.swing.JApplet, [jalview.api.StructureSelectionManagerProvider, jalview.javascript.JalviewLiteJsApi]); -Clazz.prepareFields (c$, function () { -this.javascriptListeners = new java.util.Vector (); -this.launcher = new javax.swing.JButton (jalview.util.MessageManager.getString ("label.start_jalview")); -this.jshashes = new java.util.Hashtable (); -this.jsmessages = new java.util.Hashtable (); -this.jsExecQueue = new java.util.Vector (); -}); -Clazz.defineMethod (c$, "setParams", -($fz = function () { -jalview.bin.JalviewLite.debug = "true".equalsIgnoreCase (this.getParameter ("debug")); -this.enableSplitFrame = "true".equalsIgnoreCase (this.getParameter ("enableSplitFrame")); -this.embedded = "true".equalsIgnoreCase (this.getParameter ("embedded")); -this.showButton = !"false".equalsIgnoreCase (this.getParameter ("showbutton")); -this.jalviewServletURL = this.getParameter ("APPLICATION_URL"); -this.startupFile = this.getParameter ("file"); -this.helpUrl = this.getParameter ("jalviewhelpurl"); -this.externalstructureviewer = this.getParameter ("externalstructureviewer"); -this.checkForJmol = !"true".equals (this.getParameter ("nojmol")); -this.sep = this.getParameter ("separator"); -this.rgb = this.getParameter ("RGB"); -this.labelColour = this.getParameter ("label"); -this.initjscallback = this.getParameter ("oninit"); -this.pdbFile = this.getParameter ("PDBFILE"); -this.sequence = this.getParameter ("PDBSEQ"); -this.jnetFile = this.getParameter ("jnetfile"); -this.annotations = this.getParameter ("annotations"); -this.hideFeatureGroups = this.getParameter ("hidefeaturegroups"); -this.showFeatureGroups = this.getParameter ("showfeaturegroups"); -this.features = this.getParameter ("features"); -this.showFeatureSettings = this.getParameter ("showFeatureSettings"); -this.scoreFile = this.getParameter ("scoreFile"); -this.treeFile = this.getParameter ("tree"); -if (this.treeFile == null) this.treeFile = this.getParameter ("treeFile"); -this.windowWidth = this.getParameter ("windowWidth"); -this.windowHeight = this.getParameter ("windowHeight"); -this.defaultColour = this.getParameter ("defaultColour"); -this.sortBy = this.getParameter ("sortBy"); -this.wrap = this.getParameter ("wrap"); -this.centrecolumnlabels = this.getParameter ("centrecolumnlabels"); -this.userDefinedColour = this.getParameter ("userDefinedColour"); -this.widthScale = this.getParameter ("widthScale"); -this.heightScale = this.getParameter ("heightScale"); -this.upperCase = this.getParameter ("upperCase"); -this.file2 = this.getParameter ("file2"); -}, $fz.isPrivate = true, $fz)); -Clazz.defineMethod (c$, "getDefaultParameter", -function (name, def) { -var stn; -if ((stn = this.getParameter (name)) == null) { -return def; -}if (stn.toLowerCase ().equals ("true")) { -return true; -}return false; -}, "~S,~B"); -Clazz.defineMethod (c$, "getLinkParams", -function (links) { -var label; -var url; -for (var i = 1; i < 10; i++) { -label = this.getParameter ("linkLabel_" + i); -url = this.getParameter ("linkURL_" + i); -if (label != null && url != null) { -links.addElement (label + "|" + url); -}} -}, "java.util.Vector"); -Clazz.defineMethod (c$, "getStructureSelectionManager", -function () { -return jalview.structure.StructureSelectionManager.getStructureSelectionManager (this); -}); -Clazz.defineMethod (c$, "getSelectedSequences", -function () { -return this.getSelectedSequencesFrom (this.getDefaultTargetFrame ()); -}); -Clazz.defineMethod (c$, "getSelectedSequences", -function (sep) { -return this.getSelectedSequencesFrom (this.getDefaultTargetFrame (), sep); -}, "~S"); -Clazz.defineMethod (c$, "getSelectedSequencesFrom", -function (alf) { -return this.getSelectedSequencesFrom (alf, this.separator); -}, "jalview.appletgui.AlignFrame"); -Clazz.defineMethod (c$, "getSelectedSequencesFrom", -function (alf, sep) { -var result = new StringBuffer (""); -if (sep == null || sep.length == 0) { -sep = this.separator; -}if (alf.viewport.getSelectionGroup () != null) { -var seqs = alf.viewport.getSelectionGroup ().getSequencesInOrder (alf.viewport.getAlignment ()); -for (var i = 0; i < seqs.length; i++) { -result.append (seqs[i].getName ()); -result.append (sep); -} -}return result.toString (); -}, "jalview.appletgui.AlignFrame,~S"); -Clazz.overrideMethod (c$, "highlight", -function (sequenceId, position, alignedPosition) { -this.highlightIn (this.getDefaultTargetFrame (), sequenceId, position, alignedPosition); -}, "~S,~S,~S"); -Clazz.overrideMethod (c$, "highlightIn", -function (alf, sequenceId, position, alignedPosition) { -var matcher = new jalview.analysis.SequenceIdMatcher (alf.viewport.getAlignment ().getSequencesArray ()); -var sq = matcher.findIdMatch (sequenceId); -if (sq != null) { -var apos = -1; -try { -apos = new Integer (position).intValue (); -apos--; -} catch (ex) { -if (Clazz.exceptionOf (ex, NumberFormatException)) { -return; -} else { -throw ex; -} -} -var me = this; -var pos = apos; -if (alignedPosition != null && (alignedPosition.trim ().length == 0 || alignedPosition.toLowerCase ().indexOf ("false") > -1)) { -java.awt.EventQueue.invokeLater (((Clazz.isClassDefined ("jalview.bin.JalviewLite$1") ? 0 : jalview.bin.JalviewLite.$JalviewLite$1$ ()), Clazz.innerTypeInstance (jalview.bin.JalviewLite$1, this, Clazz.cloneFinals ("me", me, "sq", sq, "pos", pos)))); -} else { -java.awt.EventQueue.invokeLater (((Clazz.isClassDefined ("jalview.bin.JalviewLite$2") ? 0 : jalview.bin.JalviewLite.$JalviewLite$2$ ()), Clazz.innerTypeInstance (jalview.bin.JalviewLite$2, this, Clazz.cloneFinals ("me", me, "sq", sq, "pos", pos)))); -}}}, "jalview.appletgui.AlignFrame,~S,~S,~S"); -Clazz.defineMethod (c$, "select", -function (sequenceIds, columns) { -this.selectIn (this.getDefaultTargetFrame (), sequenceIds, columns, this.separator); -}, "~S,~S"); -Clazz.defineMethod (c$, "select", -function (sequenceIds, columns, sep) { -this.selectIn (this.getDefaultTargetFrame (), sequenceIds, columns, sep); -}, "~S,~S,~S"); -Clazz.defineMethod (c$, "selectIn", -function (alf, sequenceIds, columns) { -this.selectIn (alf, sequenceIds, columns, this.separator); -}, "jalview.appletgui.AlignFrame,~S,~S"); -Clazz.defineMethod (c$, "selectIn", -function (alf, sequenceIds, columns, sep) { -if (sep == null || sep.length == 0) { -sep = this.separator; -} else { -if (jalview.bin.JalviewLite.debug) { -System.err.println ("Selecting region using separator string '" + this.separator + "'"); -}}var ids = this.separatorListToArray (sequenceIds, sep); -var cols = this.separatorListToArray (columns, sep); -var sel = new jalview.datamodel.SequenceGroup (); -var csel = new jalview.datamodel.ColumnSelection (); -var al = alf.viewport.getAlignment (); -var matcher = new jalview.analysis.SequenceIdMatcher (alf.viewport.getAlignment ().getSequencesArray ()); -var start = 0; -var end = al.getWidth (); -var alw = al.getWidth (); -var seqsfound = true; -if (ids != null && ids.length > 0) { -seqsfound = false; -for (var i = 0; i < ids.length; i++) { -if (ids[i].trim ().length == 0) { -continue; -}var sq = matcher.findIdMatch (ids[i]); -if (sq != null) { -seqsfound = true; -sel.addSequence (sq, false); -}} -}var inseqpos = false; -if (cols != null && cols.length > 0) { -var seset = false; -for (var i = 0; i < cols.length; i++) { -var cl = cols[i].trim (); -if (cl.length == 0) { -continue; -}var p; -if ((p = cl.indexOf ("-")) > -1) { -var from = -1; -var to = -1; -try { -from = new Integer (cl.substring (0, p)).intValue (); -from--; -} catch (ex) { -if (Clazz.exceptionOf (ex, NumberFormatException)) { -System.err.println ("ERROR: Couldn't parse first integer in range element column selection string '" + cl + "' - format is 'from-to'"); -return; -} else { -throw ex; -} -} -try { -to = new Integer (cl.substring (p + 1)).intValue (); -to--; -} catch (ex) { -if (Clazz.exceptionOf (ex, NumberFormatException)) { -System.err.println ("ERROR: Couldn't parse second integer in range element column selection string '" + cl + "' - format is 'from-to'"); -return; -} else { -throw ex; -} -} -if (from >= 0 && to >= 0) { -if (from < to) { -var t = to; -to = from; -to = t; -}if (!seset) { -start = from; -end = to; -seset = true; -} else { -if (start > from) { -start = from; -}if (end < to) { -end = to; -}}for (var r = from; r <= to; r++) { -if (r >= 0 && r < alw) { -csel.addElement (r); -}} -if (jalview.bin.JalviewLite.debug) { -System.err.println ("Range '" + cl + "' deparsed as [" + from + "," + to + "]"); -}} else { -System.err.println ("ERROR: Invalid Range '" + cl + "' deparsed as [" + from + "," + to + "]"); -}} else { -var r = -1; -try { -r = new Integer (cl).intValue (); -r--; -} catch (ex) { -if (Clazz.exceptionOf (ex, NumberFormatException)) { -if (cl.toLowerCase ().equals ("sequence")) { -inseqpos = true; -} else { -System.err.println ("ERROR: Couldn't parse integer from point selection element of column selection string '" + cl + "'"); -return; -}} else { -throw ex; -} -} -if (r >= 0 && r <= alw) { -if (!seset) { -start = r; -end = r; -seset = true; -} else { -if (start > r) { -start = r; -}if (end < r) { -end = r; -}}csel.addElement (r); -if (jalview.bin.JalviewLite.debug) { -System.err.println ("Point selection '" + cl + "' deparsed as [" + r + "]"); -}} else { -System.err.println ("ERROR: Invalid Point selection '" + cl + "' deparsed as [" + r + "]"); -}}} -}if (seqsfound) { -if (inseqpos && sel.getSize () > 0) { -var rs = sel.getSequenceAt (0); -start = rs.findIndex (start); -end = rs.findIndex (end); -if (csel != null) { -var cs = csel.getSelected (); -csel.clear (); -for (var selectedCol, $selectedCol = cs.iterator (); $selectedCol.hasNext () && ((selectedCol = $selectedCol.next ()) || true);) { -csel.addElement (rs.findIndex ((selectedCol).intValue ())); -} -}}sel.setStartRes (start); -sel.setEndRes (end); -java.awt.EventQueue.invokeLater (((Clazz.isClassDefined ("jalview.bin.JalviewLite$3") ? 0 : jalview.bin.JalviewLite.$JalviewLite$3$ ()), Clazz.innerTypeInstance (jalview.bin.JalviewLite$3, this, Clazz.cloneFinals ("alf", alf, "sel", sel, "csel", csel)))); -}}, "jalview.appletgui.AlignFrame,~S,~S,~S"); -Clazz.overrideMethod (c$, "getSelectedSequencesAsAlignment", -function (format, suffix) { -return this.getSelectedSequencesAsAlignmentFrom (this.getDefaultTargetFrame (), format, suffix); -}, "~S,~S"); -Clazz.overrideMethod (c$, "getSelectedSequencesAsAlignmentFrom", -function (alf, format, suffix) { -try { -var seqlimits = suffix.equalsIgnoreCase ("true"); -if (alf.viewport.getSelectionGroup () != null) { -var reply = new jalview.io.AppletFormatAdapter ().formatSequences (format, new jalview.datamodel.Alignment (alf.viewport.getSelectionAsNewSequence ()), seqlimits); -return reply; -}} catch (ex) { -if (Clazz.exceptionOf (ex, Exception)) { -ex.printStackTrace (); -return "Error retrieving alignment in " + format + " format. "; -} else { -throw ex; -} -} -return ""; -}, "jalview.appletgui.AlignFrame,~S,~S"); -Clazz.overrideMethod (c$, "getAlignmentOrder", -function () { -return this.getAlignmentOrderFrom (this.getDefaultTargetFrame ()); -}); -Clazz.defineMethod (c$, "getAlignmentOrderFrom", -function (alf) { -return this.getAlignmentOrderFrom (alf, this.separator); -}, "jalview.appletgui.AlignFrame"); -Clazz.defineMethod (c$, "getAlignmentOrderFrom", -function (alf, sep) { -var alorder = alf.getAlignViewport ().getAlignment (); -var order = new Array (alorder.getHeight ()); -for (var i = 0; i < order.length; i++) { -order[i] = alorder.getSequenceAt (i).getName (); -} -return this.arrayToSeparatorList (order); -}, "jalview.appletgui.AlignFrame,~S"); -Clazz.defineMethod (c$, "orderBy", -function (order, undoName) { -return this.orderBy (order, undoName, this.separator); -}, "~S,~S"); -Clazz.defineMethod (c$, "orderBy", -function (order, undoName, sep) { -return this.orderAlignmentBy (this.getDefaultTargetFrame (), order, undoName, sep); -}, "~S,~S,~S"); -Clazz.overrideMethod (c$, "orderAlignmentBy", -function (alf, order, undoName, sep) { -var ids = this.separatorListToArray (order, sep); -var sqs = null; -if (ids != null && ids.length > 0) { -var matcher = new jalview.analysis.SequenceIdMatcher (alf.viewport.getAlignment ().getSequencesArray ()); -var s = 0; -sqs = new Array (ids.length); -for (var i = 0; i < ids.length; i++) { -if (ids[i].trim ().length == 0) { -continue; -}var sq = matcher.findIdMatch (ids[i]); -if (sq != null) { -sqs[s++] = sq; -}} -if (s > 0) { -var sqq = new Array (s); -System.arraycopy (sqs, 0, sqq, 0, s); -sqs = sqq; -} else { -sqs = null; -}}if (sqs == null) { -return ""; -};var aorder = new jalview.datamodel.AlignmentOrder (sqs); -if (undoName != null && undoName.trim ().length == 0) { -undoName = null; -}var _undoName = undoName; -return alf.sortBy (aorder, _undoName) ? "true" : ""; -}, "jalview.appletgui.AlignFrame,~S,~S,~S"); -Clazz.defineMethod (c$, "getAlignment", -function (format) { -return this.getAlignmentFrom (this.getDefaultTargetFrame (), format, "true"); -}, "~S"); -Clazz.defineMethod (c$, "getAlignmentFrom", -function (alf, format) { -return this.getAlignmentFrom (alf, format, "true"); -}, "jalview.appletgui.AlignFrame,~S"); -Clazz.defineMethod (c$, "getAlignment", -function (format, suffix) { -return this.getAlignmentFrom (this.getDefaultTargetFrame (), format, suffix); -}, "~S,~S"); -Clazz.defineMethod (c$, "getAlignmentFrom", -function (alf, format, suffix) { -try { -var seqlimits = suffix.equalsIgnoreCase ("true"); -var reply = new jalview.io.AppletFormatAdapter ().formatSequences (format, alf.viewport.getAlignment (), seqlimits); -return reply; -} catch (ex) { -if (Clazz.exceptionOf (ex, Exception)) { -ex.printStackTrace (); -return "Error retrieving alignment in " + format + " format. "; -} else { -throw ex; -} -} -}, "jalview.appletgui.AlignFrame,~S,~S"); -Clazz.overrideMethod (c$, "loadAnnotation", -function (annotation) { -this.loadAnnotationFrom (this.getDefaultTargetFrame (), annotation); -}, "~S"); -Clazz.overrideMethod (c$, "loadAnnotationFrom", -function (alf, annotation) { -if ( new jalview.io.AnnotationFile ().annotateAlignmentView (alf.getAlignViewport (), annotation, jalview.io.AppletFormatAdapter.PASTE)) { -alf.alignPanel.fontChanged (); -alf.alignPanel.setScrollValues (0, 0); -} else { -alf.parseFeaturesFile (annotation, jalview.io.AppletFormatAdapter.PASTE); -}}, "jalview.appletgui.AlignFrame,~S"); -Clazz.overrideMethod (c$, "loadFeatures", -function (features, autoenabledisplay) { -this.loadFeaturesFrom (this.getDefaultTargetFrame (), features, autoenabledisplay); -}, "~S,~B"); -Clazz.overrideMethod (c$, "loadFeaturesFrom", -function (alf, features, autoenabledisplay) { -return alf.parseFeaturesFile (features, jalview.io.AppletFormatAdapter.PASTE, autoenabledisplay); -}, "jalview.appletgui.AlignFrame,~S,~B"); -Clazz.overrideMethod (c$, "getFeatures", -function (format) { -return this.getFeaturesFrom (this.getDefaultTargetFrame (), format); -}, "~S"); -Clazz.overrideMethod (c$, "getFeaturesFrom", -function (alf, format) { -return alf.outputFeatures (false, format); -}, "jalview.appletgui.AlignFrame,~S"); -Clazz.overrideMethod (c$, "getAnnotation", -function () { -return this.getAnnotationFrom (this.getDefaultTargetFrame ()); -}); -Clazz.overrideMethod (c$, "getAnnotationFrom", -function (alf) { -return alf.outputAnnotations (false); -}, "jalview.appletgui.AlignFrame"); -Clazz.defineMethod (c$, "newView", -function () { -return this.newViewFrom (this.getDefaultTargetFrame ()); -}); -Clazz.defineMethod (c$, "newView", -function (name) { -return this.newViewFrom (this.getDefaultTargetFrame (), name); -}, "~S"); -Clazz.defineMethod (c$, "newViewFrom", -function (alf) { -return alf.newView (null); -}, "jalview.appletgui.AlignFrame"); -Clazz.defineMethod (c$, "newViewFrom", -function (alf, name) { -return alf.newView (name); -}, "jalview.appletgui.AlignFrame,~S"); -Clazz.overrideMethod (c$, "loadAlignment", -function (text, title) { -var al = null; -var format = new jalview.io.IdentifyFile ().Identify (text, jalview.io.AppletFormatAdapter.PASTE); -try { -al = new jalview.io.AppletFormatAdapter ().readFile (text, jalview.io.AppletFormatAdapter.PASTE, format); -if (al.getHeight () > 0) { -return new jalview.appletgui.AlignFrame (al, this, title, false); -}} catch (ex) { -if (Clazz.exceptionOf (ex, java.io.IOException)) { -ex.printStackTrace (); -} else { -throw ex; -} -} -return null; -}, "~S,~S"); -Clazz.defineMethod (c$, "setMouseoverListener", -function (listener) { -this.setMouseoverListener (this.currentAlignFrame, listener); -}, "~S"); -Clazz.defineMethod (c$, "setMouseoverListener", -function (af, listener) { -if (listener != null) { -listener = listener.trim (); -if (listener.length == 0) { -System.err.println ("jalview Javascript error: Ignoring empty function for mouseover listener."); -return; -}}var mol = new jalview.javascript.MouseOverListener (this, af, listener); -this.javascriptListeners.addElement (mol); -jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).addStructureViewerListener (mol); -if (jalview.bin.JalviewLite.debug) { -System.err.println ("Added a mouseover listener for " + ((af == null) ? "All frames" : "Just views for " + af.getAlignViewport ().getSequenceSetId ())); -System.err.println ("There are now " + this.javascriptListeners.size () + " listeners in total."); -}}, "jalview.appletgui.AlignFrame,~S"); -Clazz.defineMethod (c$, "setSelectionListener", -function (listener) { -this.setSelectionListener (null, listener); -}, "~S"); -Clazz.defineMethod (c$, "setSelectionListener", -function (af, listener) { -if (listener != null) { -listener = listener.trim (); -if (listener.length == 0) { -System.err.println ("jalview Javascript error: Ignoring empty function for selection listener."); -return; -}}var mol = new jalview.javascript.JsSelectionSender (this, af, listener); -this.javascriptListeners.addElement (mol); -jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).addSelectionListener (mol); -if (jalview.bin.JalviewLite.debug) { -System.err.println ("Added a selection listener for " + ((af == null) ? "All frames" : "Just views for " + af.getAlignViewport ().getSequenceSetId ())); -System.err.println ("There are now " + this.javascriptListeners.size () + " listeners in total."); -}}, "jalview.appletgui.AlignFrame,~S"); -Clazz.overrideMethod (c$, "setStructureListener", -function (listener, modelSet) { -if (listener != null) { -listener = listener.trim (); -if (listener.length == 0) { -System.err.println ("jalview Javascript error: Ignoring empty function for selection listener."); -return; -}}var mol = new jalview.javascript.MouseOverStructureListener (this, listener, this.separatorListToArray (modelSet)); -this.javascriptListeners.addElement (mol); -jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).addStructureViewerListener (mol); -if (jalview.bin.JalviewLite.debug) { -System.err.println ("Added a javascript structure viewer listener '" + listener + "'"); -System.err.println ("There are now " + this.javascriptListeners.size () + " listeners in total."); -}}, "~S,~S"); -Clazz.overrideMethod (c$, "removeJavascriptListener", -function (af, listener) { -if (listener != null) { -listener = listener.trim (); -if (listener.length == 0) { -listener = null; -}}var rprt = false; -for (var ms = 0, msSize = this.javascriptListeners.size (); ms < msSize; ) { -var lstn = this.javascriptListeners.elementAt (ms); -var lstner = lstn; -if ((af == null || lstner.getAlignFrame () === af) && (listener == null || lstner.getListenerFunction ().equals (listener))) { -this.javascriptListeners.removeElement (lstner); -msSize--; -if (Clazz.instanceOf (lstner, jalview.structure.SelectionListener)) { -jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).removeSelectionListener (lstner); -} else { -jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).removeStructureViewerListener (lstner, null); -}rprt = jalview.bin.JalviewLite.debug; -if (jalview.bin.JalviewLite.debug) { -System.err.println ("Removed listener '" + listener + "'"); -}} else { -ms++; -}} -if (rprt) { -System.err.println ("There are now " + this.javascriptListeners.size () + " listeners in total."); -}}, "jalview.appletgui.AlignFrame,~S"); -Clazz.overrideMethod (c$, "stop", -function () { -System.err.println ("Applet " + this.getName () + " stop()."); -this.tidyUp (); -}); -Clazz.overrideMethod (c$, "destroy", -function () { -System.err.println ("Applet " + this.getName () + " destroy()."); -this.tidyUp (); -}); -Clazz.defineMethod (c$, "tidyUp", -($fz = function () { -this.removeAll (); -if (this.currentAlignFrame != null && this.currentAlignFrame.viewport != null && this.currentAlignFrame.viewport.applet != null) { -var av = this.currentAlignFrame.viewport; -this.currentAlignFrame.closeMenuItem_actionPerformed (); -av.applet = null; -this.currentAlignFrame = null; -}if (this.javascriptListeners != null) { -while (this.javascriptListeners.size () > 0) { -var mol = this.javascriptListeners.elementAt (0); -this.javascriptListeners.removeElement (mol); -if (Clazz.instanceOf (mol, jalview.structure.SelectionListener)) { -jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).removeSelectionListener (mol); -} else { -jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).removeStructureViewerListener (mol, null); -}mol.jvlite = null; -} -}if (this.jsFunctionExec != null) { -this.jsFunctionExec.stopQueue (); -this.jsFunctionExec.jvlite = null; -}this.initialAlignFrame = null; -this.jsFunctionExec = null; -this.javascriptListeners = null; -jalview.structure.StructureSelectionManager.release (this); -}, $fz.isPrivate = true, $fz)); -Clazz.overrideMethod (c$, "mouseOverStructure", -function (pdbResNum, chain, pdbfile) { -var me = this; -java.awt.EventQueue.invokeLater (((Clazz.isClassDefined ("jalview.bin.JalviewLite$4") ? 0 : jalview.bin.JalviewLite.$JalviewLite$4$ ()), Clazz.innerTypeInstance (jalview.bin.JalviewLite$4, this, Clazz.cloneFinals ("me", me, "pdbResNum", pdbResNum, "chain", chain, "pdbfile", pdbfile)))); -}, "~S,~S,~S"); -Clazz.overrideMethod (c$, "scrollViewToIn", -function (alf, topRow, leftHandColumn) { -java.awt.EventQueue.invokeLater (((Clazz.isClassDefined ("jalview.bin.JalviewLite$5") ? 0 : jalview.bin.JalviewLite.$JalviewLite$5$ ()), Clazz.innerTypeInstance (jalview.bin.JalviewLite$5, this, Clazz.cloneFinals ("alf", alf, "topRow", topRow, "leftHandColumn", leftHandColumn)))); -}, "jalview.appletgui.AlignFrame,~S,~S"); -Clazz.overrideMethod (c$, "scrollViewToRowIn", -function (alf, topRow) { -java.awt.EventQueue.invokeLater (((Clazz.isClassDefined ("jalview.bin.JalviewLite$6") ? 0 : jalview.bin.JalviewLite.$JalviewLite$6$ ()), Clazz.innerTypeInstance (jalview.bin.JalviewLite$6, this, Clazz.cloneFinals ("alf", alf, "topRow", topRow)))); -}, "jalview.appletgui.AlignFrame,~S"); -Clazz.overrideMethod (c$, "scrollViewToColumnIn", -function (alf, leftHandColumn) { -java.awt.EventQueue.invokeLater (((Clazz.isClassDefined ("jalview.bin.JalviewLite$7") ? 0 : jalview.bin.JalviewLite.$JalviewLite$7$ ()), Clazz.innerTypeInstance (jalview.bin.JalviewLite$7, this, Clazz.cloneFinals ("alf", alf, "leftHandColumn", leftHandColumn)))); -}, "jalview.appletgui.AlignFrame,~S"); -c$.initBuildDetails = Clazz.defineMethod (c$, "initBuildDetails", -($fz = function () { -if (jalview.bin.JalviewLite.builddate == null) { -jalview.bin.JalviewLite.builddate = "unknown"; -jalview.bin.JalviewLite.version = "test"; -jalview.bin.JalviewLite.installation = "Webstart"; -var url = jalview.bin.JalviewLite.getResource ("/.build_properties"); -if (url != null) { -try { -var reader = new java.io.BufferedReader ( new java.io.InputStreamReader (url.openStream ())); -var line; -while ((line = reader.readLine ()) != null) { -if (line.indexOf ("VERSION") > -1) { -jalview.bin.JalviewLite.version = line.substring (line.indexOf ("=") + 1); -}if (line.indexOf ("BUILD_DATE") > -1) { -jalview.bin.JalviewLite.builddate = line.substring (line.indexOf ("=") + 1); -}if (line.indexOf ("INSTALLATION") > -1) { -jalview.bin.JalviewLite.installation = line.substring (line.indexOf ("=") + 1); -}} -} catch (ex) { -if (Clazz.exceptionOf (ex, Exception)) { -ex.printStackTrace (); -} else { -throw ex; -} -} -}}}, $fz.isPrivate = true, $fz)); -c$.getBuildDate = Clazz.defineMethod (c$, "getBuildDate", -function () { -jalview.bin.JalviewLite.initBuildDetails (); -return jalview.bin.JalviewLite.builddate; -}); -c$.getInstallation = Clazz.defineMethod (c$, "getInstallation", -function () { -jalview.bin.JalviewLite.initBuildDetails (); -return jalview.bin.JalviewLite.installation; -}); -c$.getVersion = Clazz.defineMethod (c$, "getVersion", -function () { -jalview.bin.JalviewLite.initBuildDetails (); -return jalview.bin.JalviewLite.version; -}); -Clazz.overrideMethod (c$, "init", -function () { -this.setParams (); -try { -if (jalview.bin.JalviewLite.debug) { -System.err.println ("Applet context is '" + this.getAppletContext ().getClass ().toString () + "'"); -}var scriptObject = netscape.javascript.JSObject.getWindow (this); -if (jalview.bin.JalviewLite.debug && scriptObject != null) { -System.err.println ("Applet has Javascript callback support."); -}} catch (ex) { -if (Clazz.exceptionOf (ex, Exception)) { -System.err.println ("Warning: No JalviewLite javascript callbacks available."); -if (jalview.bin.JalviewLite.debug) { -ex.printStackTrace (); -}} else { -throw ex; -} -} -if (jalview.bin.JalviewLite.debug) { -System.err.println ("JalviewLite Version " + jalview.bin.JalviewLite.getVersion ()); -System.err.println ("Build Date : " + jalview.bin.JalviewLite.getBuildDate ()); -System.err.println ("Installation : " + jalview.bin.JalviewLite.getInstallation ()); -}if (this.externalstructureviewer != null) { -this.useXtrnalSviewer = this.externalstructureviewer.trim ().toLowerCase ().equals ("true"); -}if (this.sep != null) { -if (this.sep.length > 0) { -this.separator = this.sep; -if (jalview.bin.JalviewLite.debug) { -System.err.println ("Separator set to '" + this.separator + "'"); -}} else { -throw new Error (jalview.util.MessageManager.getString ("error.invalid_separator_parameter")); -}}var r = 255; -var g = 255; -var b = 255; -if (this.rgb != null) { -try { -r = Integer.parseInt (this.rgb.substring (0, 2), 16); -g = Integer.parseInt (this.rgb.substring (2, 4), 16); -b = Integer.parseInt (this.rgb.substring (4, 6), 16); -} catch (ex) { -if (Clazz.exceptionOf (ex, Exception)) { -r = 255; -g = 255; -b = 255; -} else { -throw ex; -} -} -}this.rgb = this.labelColour; -if (this.rgb != null) { -this.launcher.setLabel (this.rgb); -}this.setBackground ( new java.awt.Color (r, g, b)); -if (this.startupFile == null) { -var data = new StringBuffer ("PASTE"); -var i = 1; -while ((this.startupFile = this.getParameter ("sequence" + i)) != null) { -data.append (this.startupFile.toString () + "\n"); -i++; -} -if (data.length () > 5) { -this.startupFile = data.toString (); -}}if (!this.enableSplitFrame) { -this.file2 = null; -}if (this.embedded) { -var loader = Clazz.innerTypeInstance (jalview.bin.JalviewLite.LoadingThread, this, null, this.startupFile, this.file2, this); -{ -loader.run(); -}} else if (this.startupFile != null) { -if (!this.showButton) { -var loader = Clazz.innerTypeInstance (jalview.bin.JalviewLite.LoadingThread, this, null, this.startupFile, this.file2, this); -loader.start (); -} else { -this.add (this.launcher); -this.launcher.addActionListener (((Clazz.isClassDefined ("jalview.bin.JalviewLite$8") ? 0 : jalview.bin.JalviewLite.$JalviewLite$8$ ()), Clazz.innerTypeInstance (jalview.bin.JalviewLite$8, this, null))); -}} else { -this.startupFile = "NO FILE"; -this.fileFound = false; -this.callInitCallback (); -}}); -Clazz.defineMethod (c$, "initLiveConnect", -($fz = function () { -var notFailed = false; -var tries = 0; -while (!notFailed && tries < 10) { -if (tries > 0) { -System.err.println ("LiveConnect request thread going to sleep."); -}try { -Thread.sleep (700 * (1 + tries)); -} catch (q) { -if (Clazz.exceptionOf (q, InterruptedException)) { -} else { -throw q; -} -} -;if (tries++ > 0) { -System.err.println ("LiveConnect request thread woken up."); -}try { -var scriptObject = netscape.javascript.JSObject.getWindow (this); -if (scriptObject.eval ("navigator") != null) { -notFailed = true; -}} catch (jsex) { -if (Clazz.exceptionOf (jsex, Exception)) { -System.err.println ("Attempt " + tries + " to access LiveConnect javascript failed."); -} else { -throw jsex; -} -} -} -}, $fz.isPrivate = true, $fz)); -Clazz.defineMethod (c$, "callInitCallback", -($fz = function () { -if (this.initjscallback == null) { -return; -}this.initjscallback = this.initjscallback.trim (); -if (this.initjscallback.length > 0) { -var scriptObject = null; -try { -scriptObject = netscape.javascript.JSObject.getWindow (this); -} catch (ex) { -if (Clazz.exceptionOf (ex, Exception)) { -} else { -throw ex; -} -} -;this.initLiveConnect (); -if (scriptObject != null) { -try { - new jalview.javascript.JSFunctionExec (this).executeJavascriptFunction (true, this.initjscallback, null, "Calling oninit callback '" + this.initjscallback + "'."); -} catch (e) { -if (Clazz.exceptionOf (e, Exception)) { -System.err.println ("Exception when executing _oninit callback '" + this.initjscallback + "'."); -e.printStackTrace (); -} else { -throw e; -} -} -} else { -System.err.println ("Not executing _oninit callback '" + this.initjscallback + "' - no scripting allowed."); -}}}, $fz.isPrivate = true, $fz)); -c$.addFrame = Clazz.defineMethod (c$, "addFrame", -function (frame, title, width, height) { -frame.setLocation (jalview.bin.JalviewLite.lastFrameX, jalview.bin.JalviewLite.lastFrameY); -jalview.bin.JalviewLite.lastFrameX += 40; -jalview.bin.JalviewLite.lastFrameY += 40; -frame.setSize (width, height); -frame.setTitle (title); -frame.addWindowListener (((Clazz.isClassDefined ("jalview.bin.JalviewLite$9") ? 0 : jalview.bin.JalviewLite.$JalviewLite$9$ ()), Clazz.innerTypeInstance (jalview.bin.JalviewLite$9, this, Clazz.cloneFinals ("frame", frame)))); -frame.setVisible (true); -}, "javax.swing.JFrame,~S,~N,~N"); -Clazz.defineMethod (c$, "paintComponent", -function (g) { -if (!this.fileFound) { -g.setColor ( new java.awt.Color (200, 200, 200)); -g.setColor (java.awt.Color.cyan); -g.fillRect (0, 0, this.getSize ().width, this.getSize ().height); -g.setColor (java.awt.Color.red); -g.drawString (jalview.util.MessageManager.getString ("label.jalview_cannot_open_file"), 5, 15); -g.drawString ("\"" + this.startupFile + "\"", 5, 30); -} else if (this.embedded && !this.haveShownLoadMessage) { -g.setColor (java.awt.Color.black); -g.setFont ( new java.awt.Font ("Arial", 1, 24)); -g.drawString (jalview.util.MessageManager.getString ("label.jalview_applet"), 50, Clazz.doubleToInt (this.getSize ().height / 2) - 30); -g.drawString (jalview.util.MessageManager.getString ("label.loading_data") + "...", 50, Clazz.doubleToInt (this.getSize ().height / 2)); -this.haveShownLoadMessage = true; -}}, "java.awt.Graphics"); -Clazz.defineMethod (c$, "getAppletWindow", -function (class1) { -var wnds = new java.util.Vector (); -var cmp = this.getComponents (); -if (cmp != null) { -for (var i = 0; i < cmp.length; i++) { -if (class1.isAssignableFrom (cmp[i].getClass ())) { -wnds.addElement (cmp); -}} -}return wnds; -}, "Class"); -Clazz.defineMethod (c$, "getDefaultTargetFrame", -function () { -if (this.currentAlignFrame != null) { -return this.currentAlignFrame; -}if (this.initialAlignFrame != null) { -return this.initialAlignFrame; -}System.err.println ("Implementation error: Jalview Applet API cannot work out which AlignFrame to use."); -return null; -}); -Clazz.defineMethod (c$, "separatorListToArray", -function (list) { -return this.separatorListToArray (list, this.separator); -}, "~S"); -Clazz.defineMethod (c$, "separatorListToArray", -function (list, separator) { -var seplen = separator.length; -if (list == null || list.equals ("") || list.equals (separator)) { -return null; -}var jv = new java.util.Vector (); -var cp = 0; -var pos; -while ((pos = list.indexOf (separator, cp)) > cp) { -jv.addElement (list.substring (cp, pos)); -cp = pos + seplen; -} -if (cp < list.length) { -var c = list.substring (cp); -if (!c.equals (separator)) { -jv.addElement (c); -}}if (jv.size () > 0) { -var v = new Array (jv.size ()); -for (var i = 0; i < v.length; i++) { -v[i] = jv.elementAt (i); -} -jv.removeAllElements (); -if (jalview.bin.JalviewLite.debug) { -System.err.println ("Array from '" + separator + "' separated List:\n" + v.length); -for (var i = 0; i < v.length; i++) { -System.err.println ("item " + i + " '" + v[i] + "'"); -} -}return v; -}if (jalview.bin.JalviewLite.debug) { -System.err.println ("Empty Array from '" + separator + "' separated List"); -}return null; -}, "~S,~S"); -Clazz.defineMethod (c$, "arrayToSeparatorList", -function (list) { -return this.arrayToSeparatorList (list, this.separator); -}, "~A"); -Clazz.defineMethod (c$, "arrayToSeparatorList", -function (list, separator) { -var v = new StringBuffer (); -if (list != null && list.length > 0) { -for (var i = 0, iSize = list.length; i < iSize; i++) { -if (list[i] != null) { -if (i > 0) { -v.append (separator); -}v.append (list[i]); -}} -if (jalview.bin.JalviewLite.debug) { -System.err.println ("Returning '" + separator + "' separated List:\n"); -System.err.println (v); -}return v.toString (); -}if (jalview.bin.JalviewLite.debug) { -System.err.println ("Returning empty '" + separator + "' separated List\n"); -}return "" + separator; -}, "~A,~S"); -Clazz.overrideMethod (c$, "getFeatureGroups", -function () { -var lst = this.arrayToSeparatorList (this.getDefaultTargetFrame ().getFeatureGroups ()); -return lst; -}); -Clazz.overrideMethod (c$, "getFeatureGroupsOn", -function (alf) { -var lst = this.arrayToSeparatorList (alf.getFeatureGroups ()); -return lst; -}, "jalview.appletgui.AlignFrame"); -Clazz.overrideMethod (c$, "getFeatureGroupsOfState", -function (visible) { -return this.arrayToSeparatorList (this.getDefaultTargetFrame ().getFeatureGroupsOfState (visible)); -}, "~B"); -Clazz.overrideMethod (c$, "getFeatureGroupsOfStateOn", -function (alf, visible) { -return this.arrayToSeparatorList (alf.getFeatureGroupsOfState (visible)); -}, "jalview.appletgui.AlignFrame,~B"); -Clazz.overrideMethod (c$, "setFeatureGroupStateOn", -function (alf, groups, state) { -var st = state; -java.awt.EventQueue.invokeLater (((Clazz.isClassDefined ("jalview.bin.JalviewLite$10") ? 0 : jalview.bin.JalviewLite.$JalviewLite$10$ ()), Clazz.innerTypeInstance (jalview.bin.JalviewLite$10, this, Clazz.cloneFinals ("alf", alf, "groups", groups, "st", st)))); -}, "jalview.appletgui.AlignFrame,~S,~B"); -Clazz.overrideMethod (c$, "setFeatureGroupState", -function (groups, state) { -this.setFeatureGroupStateOn (this.getDefaultTargetFrame (), groups, state); -}, "~S,~B"); -Clazz.overrideMethod (c$, "getSeparator", -function () { -return this.separator; -}); -Clazz.overrideMethod (c$, "setSeparator", -function (separator) { -if (separator == null || separator.length < 1) { -separator = "\u00ac"; -}this.separator = separator; -if (jalview.bin.JalviewLite.debug) { -System.err.println ("Default Separator now: '" + separator + "'"); -}}, "~S"); -Clazz.overrideMethod (c$, "addPdbFile", -function (alFrame, sequenceId, pdbEntryString, pdbFile) { -return alFrame.addPdbFile (sequenceId, pdbEntryString, pdbFile); -}, "jalview.appletgui.AlignFrame,~S,~S,~S"); -Clazz.defineMethod (c$, "setAlignPdbStructures", -function (alignPdbStructures) { -this.alignPdbStructures = alignPdbStructures; -}, "~B"); -Clazz.defineMethod (c$, "isAlignPdbStructures", -function () { -return this.alignPdbStructures; -}); -Clazz.overrideMethod (c$, "start", -function () { -}); -Clazz.defineMethod (c$, "setJsMessageSet", -function (messageclass, viewId, colcommands) { -var msgset = this.jsmessages.get (messageclass); -if (msgset == null) { -msgset = new java.util.Hashtable (); -this.jsmessages.put (messageclass, msgset); -}msgset.put (viewId, colcommands); -var l = Clazz.newLongArray (colcommands.length, 0); -for (var i = 0; i < colcommands.length; i++) { -l[i] = colcommands[i].hashCode (); -} -this.jshashes.put (messageclass + "|" + viewId, l); -}, "~S,~S,~A"); -Clazz.overrideMethod (c$, "getJsMessage", -function (messageclass, viewId) { -var msgset = this.jsmessages.get (messageclass); -if (msgset != null) { -var msgs = msgset.get (viewId); -if (msgs != null) { -for (var i = 0; i < msgs.length; i++) { -if (msgs[i] != null) { -var m = msgs[i]; -msgs[i] = null; -return m; -}} -}}return ""; -}, "~S,~S"); -Clazz.defineMethod (c$, "isJsMessageSetChanged", -function (string, string2, colcommands) { -var l = this.jshashes.get (string + "|" + string2); -if (l == null && colcommands != null) { -return true; -}for (var i = 0; i < colcommands.length; i++) { -if (l[i] != colcommands[i].hashCode ()) { -return true; -}} -return false; -}, "~S,~S,~A"); -Clazz.defineMethod (c$, "getJsExecQueue", -function () { -return this.jsExecQueue; -}); -Clazz.defineMethod (c$, "setExecutor", -function (jsFunctionExec2) { -this.jsFunctionExec = jsFunctionExec2; -}, "jalview.javascript.JSFunctionExec"); -Clazz.defineMethod (c$, "getDefaultColourParameter", -function (colparam, defcolour) { -var colprop = this.getParameter (colparam); -if (colprop == null || colprop.trim ().length == 0) { -return defcolour; -}var col = jalview.schemes.ColourSchemeProperty.getAWTColorFromName (colprop); -if (col == null) { -try { -col = new jalview.schemes.UserColourScheme (colprop).findColour ('A'); -} catch (ex) { -if (Clazz.exceptionOf (ex, Exception)) { -System.err.println ("Couldn't parse '" + colprop + "' as a colour for " + colparam); -col = null; -} else { -throw ex; -} -} -}return (col == null) ? defcolour : col; -}, "~S,java.awt.Color"); -Clazz.defineMethod (c$, "openJalviewHelpUrl", -function () { -if (this.helpUrl == null || this.helpUrl.trim ().length < 5) { -this.helpUrl = "http://www.jalview.org/help.html"; -}this.showURL (this.helpUrl, "HELP"); -}); -Clazz.defineMethod (c$, "resolveUrlForLocalOrAbsolute", -($fz = function (url, localref) { -var codebase = localref.toString (); -var pt = codebase.indexOf ("?"); -if (pt < 0) pt = codebase.length; -codebase = codebase.substring (0, pt); -codebase = codebase.substring (0, codebase.lastIndexOf ("/") + 1); -if (url.indexOf ("/") == 0 && !localref.getProtocol ().equals ("file")) { -pt = codebase.indexOf ("/", 8); -return codebase.substring (0, pt) + url; -}return codebase + url; -}, $fz.isPrivate = true, $fz), "~S,java.net.URL"); -Clazz.defineMethod (c$, "showURL", -function (url, target) { -try { -if (url.indexOf (":") == -1) { -var prepend; -url = this.resolveUrlForLocalOrAbsolute (url, prepend = this.getDefaultParameter ("resolvetocodebase", false) ? this.getDocumentBase () : this.getCodeBase ()); -if (jalview.bin.JalviewLite.debug) { -System.err.println ("Show url (prepended " + prepend + " - toggle resolvetocodebase if code/docbase resolution is wrong): " + url); -}} else { -if (jalview.bin.JalviewLite.debug) { -System.err.println ("Show url: " + url); -}}if (url.indexOf ("javascript:") == 0) { -this.getAppletContext ().showDocument ( new java.net.URL (url)); -} else { -this.getAppletContext ().showDocument ( new java.net.URL (url), target); -}} catch (ex) { -if (Clazz.exceptionOf (ex, Exception)) { -ex.printStackTrace (); -} else { -throw ex; -} -} -}, "~S,~S"); -c$.$JalviewLite$LoadJmolThread$ = function () { -Clazz.pu$h (); -c$ = Clazz.decorateAsClass (function () { -Clazz.prepareCallback (this, arguments); -this.running = false; -Clazz.instantialize (this, arguments); -}, jalview.bin.JalviewLite, "LoadJmolThread", Thread); -Clazz.overrideMethod (c$, "run", -function () { -if (this.running || this.b$["jalview.bin.JalviewLite"].checkedForJmol) { -return; -}this.running = true; -if (this.b$["jalview.bin.JalviewLite"].checkForJmol) { -try { -if (!System.getProperty ("java.version").startsWith ("1.1")) { -Class.forName ("org.jmol.adapter.smarter.SmarterJmolAdapter"); -this.b$["jalview.bin.JalviewLite"].jmolAvailable = true; -}if (!this.b$["jalview.bin.JalviewLite"].jmolAvailable) { -System.out.println ("Jmol not available - Using MCview for structures"); -}} catch (ex) { -if (Clazz.exceptionOf (ex, ClassNotFoundException)) { -} else { -throw ex; -} -} -} else { -this.b$["jalview.bin.JalviewLite"].jmolAvailable = false; -if (jalview.bin.JalviewLite.debug) { -System.err.println ("Skipping Jmol check. Will use MCView (probably)"); -}}this.b$["jalview.bin.JalviewLite"].checkedForJmol = true; -this.running = false; -}); -Clazz.defineMethod (c$, "notFinished", -function () { -return this.running || !this.b$["jalview.bin.JalviewLite"].checkedForJmol; -}); -c$ = Clazz.p0p (); -}; -c$.$JalviewLite$LoadingThread$ = function () { -Clazz.pu$h (); -c$ = Clazz.decorateAsClass (function () { -Clazz.prepareCallback (this, arguments); -this.protocol = null; -this._file = null; -this._file2 = null; -this.applet = null; -Clazz.instantialize (this, arguments); -}, jalview.bin.JalviewLite, "LoadingThread", Thread); -Clazz.defineMethod (c$, "dbgMsg", -($fz = function (a) { -if (jalview.bin.JalviewLite.debug) { -System.err.println (a); -}}, $fz.isPrivate = true, $fz), "~S"); -Clazz.defineMethod (c$, "setProtocolState", -function (a) { -if (a.startsWith ("PASTE")) { -a = a.substring (5); -this.protocol = jalview.io.AppletFormatAdapter.PASTE; -} else if (this.inArchive (a)) { -this.protocol = jalview.io.AppletFormatAdapter.CLASSLOADER; -} else { -a = this.addProtocol (a); -this.protocol = jalview.io.AppletFormatAdapter.URL; -}this.dbgMsg ("Protocol identified as '" + this.protocol + "'"); -return a; -}, "~S"); -Clazz.makeConstructor (c$, -function (a, b, c) { -Clazz.superConstructor (this, jalview.bin.JalviewLite.LoadingThread, []); -this._file = a; -this._file2 = b; -this.applet = c; -}, "~S,~S,jalview.bin.JalviewLite"); -Clazz.overrideMethod (c$, "run", -function () { -{ -System.out.println("BYPASSING JMOL LOADING FOR NOW. THIS WILL BE DONE ANOTHER WAY") -}this.startLoading (); -}); -Clazz.defineMethod (c$, "startLoading", -($fz = function () { -this.dbgMsg ("Loading thread started with:\n>>file\n" + this._file + ">>endfile"); -this.dbgMsg ("Loading started."); -var a = this.readAlignment (this._file); -var b = this.readAlignment (this._file2); -if (a != null) { -this.addToDisplay (a, b); -this.loadTree (a); -this.loadScoreFile (a); -this.loadFeatures (a); -this.loadAnnotations (a); -this.loadJnetFile (a); -this.loadPdbFiles (a); -} else { -this.b$["jalview.bin.JalviewLite"].fileFound = false; -this.applet.remove (this.b$["jalview.bin.JalviewLite"].launcher); -this.applet.repaint (); -}this.b$["jalview.bin.JalviewLite"].callInitCallback (); -}, $fz.isPrivate = true, $fz)); -Clazz.defineMethod (c$, "addToDisplay", -function (a, b) { -if (b == null) { -a.addToDisplay (this.b$["jalview.bin.JalviewLite"].embedded); -} else { -var c = new jalview.appletgui.SplitFrame (a, b); -c.addToDisplay (this.b$["jalview.bin.JalviewLite"].embedded, this.b$["jalview.bin.JalviewLite"]); -}}, "jalview.appletgui.AlignFrame,jalview.appletgui.AlignFrame"); -Clazz.defineMethod (c$, "readAlignment", -function (a) { -if (a == null) { -return null; -}var b = this.setProtocolState (a); -var c = new jalview.io.IdentifyFile ().Identify (b, this.protocol); -this.dbgMsg ("File identified as '" + c + "'"); -var d = null; -try { -d = new jalview.io.AppletFormatAdapter ().readFile (b, this.protocol, c); -if ((d != null) && (d.getHeight () > 0)) { -this.dbgMsg ("Successfully loaded file."); -d.setDataset (null); -var e = new jalview.appletgui.AlignFrame (d, this.applet, b, this.b$["jalview.bin.JalviewLite"].embedded, false); -e.setTitle (b); -if (this.b$["jalview.bin.JalviewLite"].initialAlignFrame == null) { -this.b$["jalview.bin.JalviewLite"].initialAlignFrame = e; -}this.b$["jalview.bin.JalviewLite"].currentAlignFrame = e; -if (this.protocol === jalview.io.AppletFormatAdapter.PASTE) { -e.setTitle (jalview.util.MessageManager.formatMessage ("label.sequences_from", Clazz.newArray (-1, [this.applet.getDocumentBase ().toString ()]))); -}e.setStatus (jalview.util.MessageManager.formatMessage ("label.successfully_loaded_file", Clazz.newArray (-1, [b]))); -return e; -}} catch (ex) { -if (Clazz.exceptionOf (ex, java.io.IOException)) { -this.dbgMsg ("File load exception."); -ex.printStackTrace (); -if (jalview.bin.JalviewLite.debug) { -try { -var e = new jalview.io.FileParse (b, this.protocol); -var f = null; -this.dbgMsg (">>>Dumping contents of '" + b + "' " + "(" + this.protocol + ")"); -while ((f = e.nextLine ()) != null) { -this.dbgMsg (f); -} -this.dbgMsg (">>>Dump finished."); -} catch (e) { -if (Clazz.exceptionOf (e, Exception)) { -System.err.println ("Exception when trying to dump the content of the file parameter."); -e.printStackTrace (); -} else { -throw e; -} -} -}} else { -throw ex; -} -} -return null; -}, "~S"); -Clazz.defineMethod (c$, "loadPdbFiles", -function (a) { -var b = false; -this.applet.setAlignPdbStructures (this.b$["jalview.bin.JalviewLite"].getDefaultParameter ("alignpdbfiles", false)); -var c = 0; -var d = new java.util.Vector (); -var e = (this.applet.getDefaultParameter ("relaxedidmatch", false)) ? new jalview.analysis.SequenceIdMatcher (a.getAlignViewport ().getAlignment ().getSequencesArray ()) : null; -var f; -do { -if (c > 0) { -f = this.applet.getParameter ("PDBFILE" + c); -} else { -f = this.b$["jalview.bin.JalviewLite"].pdbFile; -}if (f != null) { -var g = new jalview.datamodel.PDBEntry (); -var h; -var i = null; -var j = null; -var k = new java.util.StringTokenizer (f, " "); -if (k.countTokens () < 2) { -if (this.b$["jalview.bin.JalviewLite"].sequence != null) { -i = Clazz.newArray (-1, [e == null ? a.getAlignViewport ().getAlignment ().findName (this.b$["jalview.bin.JalviewLite"].sequence) : e.findIdMatch (this.b$["jalview.bin.JalviewLite"].sequence)]); -}} else { -f = k.nextToken (); -var l = new java.util.Vector (); -var m = new java.util.Vector (); -while (k.hasMoreTokens ()) { -h = k.nextToken (); -var n = new java.util.StringTokenizer (h, "="); -if (n.countTokens () > 1) { -m.addElement (n.nextToken ()); -h = n.nextToken (); -}l.addElement (e == null ? a.getAlignViewport ().getAlignment ().findName (h) : e.findIdMatch (h)); -} -i = new Array (l.size ()); -l.copyInto (i); -if (m.size () == l.size ()) { -j = new Array (m.size ()); -m.copyInto (j); -}}f = this.setProtocolState (f); -if (this.protocol === jalview.io.AppletFormatAdapter.CLASSLOADER && !this.b$["jalview.bin.JalviewLite"].useXtrnalSviewer) { -this.protocol = jalview.io.AppletFormatAdapter.URL; -f = this.addProtocol (f); -}g.setFile (f); -if (i != null) { -for (var l = 0; l < i.length; l++) { -if (i[l] != null) { -(i[l]).addPDBId (g); -jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.applet).registerPDBEntry (g); -} else { -if (jalview.bin.JalviewLite.debug) { -System.err.println ("Warning: Possible input parsing error: Null sequence for attachment of PDB (sequence " + l + ")"); -}}} -if (!this.b$["jalview.bin.JalviewLite"].alignPdbStructures) { -a.newStructureView (this.applet, g, i, j, this.protocol); -} else { -d.addElement ( Clazz.newArray (-1, [g, i, j, String.instantialize (this.protocol)])); -}}}c++; -} while (f != null || c < 10); -if (d.size () > 0) { -var g = new Array (d.size ()); -var h = new Array (d.size ()); -var i = new Array (d.size ()); -var j = new Array (d.size ()); -for (var k = 0, l = d.size (); k < l; k++) { -var m = d.elementAt (k); -h[k] = m[0]; -g[k] = m[1]; -i[k] = m[2]; -j[k] = m[3]; -} -a.alignedStructureView (this.applet, h, g, i, j); -b = true; -}return b; -}, "jalview.appletgui.AlignFrame"); -Clazz.defineMethod (c$, "loadJnetFile", -function (a) { -var b = false; -var c = this.b$["jalview.bin.JalviewLite"].jnetFile; -if (c != null) { -try { -c = this.setProtocolState (c); -var d = jalview.jsdev.GenericFileAdapter.getFile ("JPredFile", [c, this.protocol]); -jalview.io.JnetAnnotationMaker.add_annotation (d, a.viewport.getAlignment (), 0, false); -var e = a.viewport.getAlignment ().getSequenceAt (0); -a.viewport.getAlignment ().setSeqrep (e); -var f = new jalview.datamodel.ColumnSelection (); -f.hideInsertionsFor (e); -a.viewport.setColumnSelection (f); -a.alignPanel.fontChanged (); -a.alignPanel.setScrollValues (0, 0); -b = true; -} catch (ex) { -if (Clazz.exceptionOf (ex, Exception)) { -ex.printStackTrace (); -} else { -throw ex; -} -} -}return b; -}, "jalview.appletgui.AlignFrame"); -Clazz.defineMethod (c$, "loadAnnotations", -function (a) { -var b = false; -var c = this.b$["jalview.bin.JalviewLite"].annotations; -if (c != null) { -c = this.setProtocolState (c); -if ( new jalview.io.AnnotationFile ().annotateAlignmentView (a.viewport, c, this.protocol)) { -a.alignPanel.fontChanged (); -a.alignPanel.setScrollValues (0, 0); -b = true; -} else { -System.err.println ("Annotations were not added from annotation file '" + c + "'"); -}}return b; -}, "jalview.appletgui.AlignFrame"); -Clazz.defineMethod (c$, "loadFeatures", -function (a) { -var b = false; -var c = this.b$["jalview.bin.JalviewLite"].hideFeatureGroups; -if (c != null) { -a.setFeatureGroupState (this.b$["jalview.bin.JalviewLite"].separatorListToArray (c), false); -}c = this.b$["jalview.bin.JalviewLite"].showFeatureGroups; -if (c != null) { -a.setFeatureGroupState (this.b$["jalview.bin.JalviewLite"].separatorListToArray (c), true); -}c = this.b$["jalview.bin.JalviewLite"].features; -if (c != null) { -c = this.setProtocolState (c); -b = a.parseFeaturesFile (c, this.protocol); -}c = this.b$["jalview.bin.JalviewLite"].showFeatureSettings; -if (c != null && c.equalsIgnoreCase ("true")) { -a.viewport.setShowSequenceFeatures (true); - new jalview.appletgui.FeatureSettings (a.alignPanel); -}return b; -}, "jalview.appletgui.AlignFrame"); -Clazz.defineMethod (c$, "loadScoreFile", -function (a) { -var b = false; -if (this.b$["jalview.bin.JalviewLite"].scoreFile != null && !"".equals (this.b$["jalview.bin.JalviewLite"].scoreFile)) { -try { -if (jalview.bin.JalviewLite.debug) { -System.err.println ("Attempting to load T-COFFEE score file from the scoreFile parameter"); -}b = a.loadScoreFile (this.b$["jalview.bin.JalviewLite"].scoreFile); -if (!b) { -System.err.println ("Failed to parse T-COFFEE parameter as a valid score file ('" + this.b$["jalview.bin.JalviewLite"].scoreFile + "')"); -}} catch (e) { -if (Clazz.exceptionOf (e, Exception)) { -System.err.printf ("Cannot read score file: '%s'. Cause: %s \n", [this.b$["jalview.bin.JalviewLite"].scoreFile, e.getMessage ()]); -} else { -throw e; -} -} -}return b; -}, "jalview.appletgui.AlignFrame"); -Clazz.defineMethod (c$, "loadTree", -function (a) { -var b = false; -if (this.b$["jalview.bin.JalviewLite"].treeFile == null) { -this.b$["jalview.bin.JalviewLite"].treeFile = this.applet.getParameter ("treeFile"); -}if (this.b$["jalview.bin.JalviewLite"].treeFile != null) { -try { -this.b$["jalview.bin.JalviewLite"].treeFile = this.setProtocolState (this.b$["jalview.bin.JalviewLite"].treeFile); -var c = new jalview.io.NewickFile (this.b$["jalview.bin.JalviewLite"].treeFile, this.protocol); -c.parse (); -if (c.getTree () != null) { -a.loadTree (c, this.b$["jalview.bin.JalviewLite"].treeFile); -b = true; -this.dbgMsg ("Successfully imported tree."); -} else { -this.dbgMsg ("Tree parameter did not resolve to a valid tree."); -}} catch (ex) { -if (Clazz.exceptionOf (ex, Exception)) { -ex.printStackTrace (); -} else { -throw ex; -} -} -}return b; -}, "jalview.appletgui.AlignFrame"); -Clazz.defineMethod (c$, "inArchive", -function (a) { -try { -var b = (this.getClass ().getResourceAsStream ("/" + a) != null); -if (jalview.bin.JalviewLite.debug) { -System.err.println ("Resource '" + a + "' was " + (b ? "" : "not") + " located by classloader."); -}return b; -} catch (ex) { -if (Clazz.exceptionOf (ex, Exception)) { -System.out.println ("Exception checking resources: " + a + " " + ex); -return false; -} else { -throw ex; -} -} -}, "~S"); -Clazz.defineMethod (c$, "addProtocol", -function (a) { -if (a.indexOf ("://") == -1) { -var b = this.applet.resolveUrlForLocalOrAbsolute (a, this.b$["jalview.bin.JalviewLite"].getDocumentBase ()); -if (this.urlExists (b)) { -if (jalview.bin.JalviewLite.debug) { -System.err.println ("Prepended document base for resource: '" + a + "'"); -}return b; -}b = this.applet.resolveUrlForLocalOrAbsolute (a, this.b$["jalview.bin.JalviewLite"].getCodeBase ()); -if (this.urlExists (b)) { -if (jalview.bin.JalviewLite.debug) { -System.err.println ("Prepended codebase for resource: '" + a + "'"); -}return b; -}}return a; -}, "~S"); -Clazz.defineMethod (c$, "urlExists", -($fz = function (a) { -var b = null; -try { -b = new java.net.URL (a).openStream (); -if (b != null) { -return true; -}} catch (x) { -if (Clazz.exceptionOf (x, Exception)) { -} else { -throw x; -} -} finally { -if (b != null) { -try { -b.close (); -} catch (e) { -if (Clazz.exceptionOf (e, java.io.IOException)) { -} else { -throw e; -} -} -}} -return false; -}, $fz.isPrivate = true, $fz), "~S"); -c$ = Clazz.p0p (); -}; -c$.$JalviewLite$1$ = function () { -Clazz.pu$h (); -c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$1", null, Runnable); -Clazz.overrideMethod (c$, "run", -function () { -jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.f$.me).mouseOverVamsasSequence (this.f$.sq, this.f$.sq.findIndex (this.f$.pos), null); -}); -c$ = Clazz.p0p (); -}; -c$.$JalviewLite$2$ = function () { -Clazz.pu$h (); -c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$2", null, Runnable); -Clazz.overrideMethod (c$, "run", -function () { -jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.f$.me).mouseOverVamsasSequence (this.f$.sq, this.f$.pos, null); -}); -c$ = Clazz.p0p (); -}; -c$.$JalviewLite$3$ = function () { -Clazz.pu$h (); -c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$3", null, Runnable); -Clazz.overrideMethod (c$, "run", -function () { -this.f$.alf.select (this.f$.sel, this.f$.csel); -}); -c$ = Clazz.p0p (); -}; -c$.$JalviewLite$4$ = function () { -Clazz.pu$h (); -c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$4", null, Runnable); -Clazz.overrideMethod (c$, "run", -function () { -try { -jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.f$.me).mouseOverStructure ( new Integer (this.f$.pdbResNum).intValue (), this.f$.chain, this.f$.pdbfile); -if (jalview.bin.JalviewLite.debug) { -System.err.println ("mouseOver for '" + this.f$.pdbResNum + "' in chain '" + this.f$.chain + "' in structure '" + this.f$.pdbfile + "'"); -}} catch (e) { -if (Clazz.exceptionOf (e, NumberFormatException)) { -System.err.println ("Ignoring invalid residue number string '" + this.f$.pdbResNum + "'"); -} else { -throw e; -} -} -}); -c$ = Clazz.p0p (); -}; -c$.$JalviewLite$5$ = function () { -Clazz.pu$h (); -c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$5", null, Runnable); -Clazz.overrideMethod (c$, "run", -function () { -try { -this.f$.alf.scrollTo ( new Integer (this.f$.topRow).intValue (), new Integer (this.f$.leftHandColumn).intValue ()); -} catch (ex) { -if (Clazz.exceptionOf (ex, Exception)) { -System.err.println ("Couldn't parse integer arguments (topRow='" + this.f$.topRow + "' and leftHandColumn='" + this.f$.leftHandColumn + "')"); -ex.printStackTrace (); -} else { -throw ex; -} -} -}); -c$ = Clazz.p0p (); -}; -c$.$JalviewLite$6$ = function () { -Clazz.pu$h (); -c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$6", null, Runnable); -Clazz.overrideMethod (c$, "run", -function () { -try { -this.f$.alf.scrollToRow ( new Integer (this.f$.topRow).intValue ()); -} catch (ex) { -if (Clazz.exceptionOf (ex, Exception)) { -System.err.println ("Couldn't parse integer arguments (topRow='" + this.f$.topRow + "')"); -ex.printStackTrace (); -} else { -throw ex; -} -} -}); -c$ = Clazz.p0p (); -}; -c$.$JalviewLite$7$ = function () { -Clazz.pu$h (); -c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$7", null, Runnable); -Clazz.overrideMethod (c$, "run", -function () { -try { -this.f$.alf.scrollToColumn ( new Integer (this.f$.leftHandColumn).intValue ()); -} catch (ex) { -if (Clazz.exceptionOf (ex, Exception)) { -System.err.println ("Couldn't parse integer arguments (leftHandColumn='" + this.f$.leftHandColumn + "')"); -ex.printStackTrace (); -} else { -throw ex; -} -} -}); -c$ = Clazz.p0p (); -}; -c$.$JalviewLite$8$ = function () { -Clazz.pu$h (); -c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$8", null, java.awt.event.ActionListener); -Clazz.overrideMethod (c$, "actionPerformed", -function (e) { -var loader = Clazz.innerTypeInstance (jalview.bin.JalviewLite.LoadingThread, this, null, this.b$["jalview.bin.JalviewLite"].startupFile, this.b$["jalview.bin.JalviewLite"].file2, this.b$["jalview.bin.JalviewLite"]); -loader.start (); -}, "java.awt.event.ActionEvent"); -c$ = Clazz.p0p (); -}; -c$.$JalviewLite$9$ = function () { -Clazz.pu$h (); -c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$9", java.awt.event.WindowAdapter); -Clazz.overrideMethod (c$, "windowClosing", -function (e) { -if (Clazz.instanceOf (this.f$.frame, jalview.appletgui.AlignFrame)) { -var vp = (this.f$.frame).viewport; -(this.f$.frame).closeMenuItem_actionPerformed (); -if (vp.applet.currentAlignFrame === this.f$.frame) { -vp.applet.currentAlignFrame = null; -}vp.applet = null; -vp = null; -}jalview.bin.JalviewLite.lastFrameX -= 40; -jalview.bin.JalviewLite.lastFrameY -= 40; -if (Clazz.instanceOf (this.f$.frame, jalview.appletgui.EmbmenuFrame)) { -(this.f$.frame).destroyMenus (); -}this.f$.frame.setMenuBar (null); -this.f$.frame.dispose (); -}, "java.awt.event.WindowEvent"); -Clazz.defineMethod (c$, "windowActivated", -function (e) { -if (Clazz.instanceOf (this.f$.frame, jalview.appletgui.AlignFrame)) { -(this.f$.frame).viewport.applet.currentAlignFrame = this.f$.frame; -if (jalview.bin.JalviewLite.debug) { -System.err.println ("Activated window " + this.f$.frame); -}}Clazz.superCall (this, jalview.bin.JalviewLite$9, "windowActivated", [e]); -}, "java.awt.event.WindowEvent"); -c$ = Clazz.p0p (); -}; -c$.$JalviewLite$10$ = function () { -Clazz.pu$h (); -c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$10", null, Runnable); -Clazz.overrideMethod (c$, "run", -function () { -this.f$.alf.setFeatureGroupState (this.b$["jalview.bin.JalviewLite"].separatorListToArray (this.f$.groups), this.f$.st); -}); -c$ = Clazz.p0p (); -}; -Clazz.defineStatics (c$, -"TRUE", "true", -"FALSE", "false", -"debug", false, -"lastFrameX", 200, -"lastFrameY", 200, -"builddate", null, -"version", null, -"installation", null); -}); +Clazz.declarePackage ("jalview.bin"); +Clazz.load (["jalview.api.StructureSelectionManagerProvider", "jalview.javascript.JalviewLiteJsApi", "java.lang.Thread", "javax.swing.JApplet", "jalview.util.MessageManager", "java.util.Hashtable", "$.Vector", "javax.swing.JButton"], "jalview.bin.JalviewLite", ["jalview.analysis.SequenceIdMatcher", "jalview.appletgui.AlignFrame", "$.EmbmenuFrame", "$.FeatureSettings", "$.SplitFrame", "jalview.datamodel.Alignment", "$.AlignmentOrder", "$.ColumnSelection", "$.PDBEntry", "$.SequenceGroup", "jalview.io.AnnotationFile", "$.AppletFormatAdapter", "$.FileParse", "$.IdentifyFile", "$.JnetAnnotationMaker", "$.NewickFile", "jalview.javascript.JSFunctionExec", "$.JsSelectionSender", "$.MouseOverListener", "$.MouseOverStructureListener", "jalview.jsdev.GenericFileAdapter", "jalview.schemes.ColourSchemeProperty", "$.UserColourScheme", "jalview.structure.SelectionListener", "$.StructureSelectionManager", "java.awt.Color", "$.EventQueue", "$.Font", "java.awt.event.ActionListener", "$.WindowAdapter", "java.io.BufferedReader", "$.InputStreamReader", "java.lang.Error", "$.StringBuffer", "java.net.URL", "java.util.StringTokenizer", "netscape.javascript.JSObject"], function () { +c$ = Clazz.decorateAsClass (function () { +this.embedded = false; +this.enableSplitFrame = false; +this.showButton = true; +this.checkForJmol = true; +this.jalviewServletURL = null; +this.startupFile = "No file"; +this.helpUrl = null; +this.externalstructureviewer = null; +this.sep = null; +this.rgb = null; +this.labelColour = null; +this.initjscallback = null; +this.pdbFile = null; +this.sequence = null; +this.jnetFile = null; +this.annotations = null; +this.hideFeatureGroups = null; +this.showFeatureGroups = null; +this.features = null; +this.showFeatureSettings = null; +this.scoreFile = null; +this.treeFile = null; +this.windowWidth = null; +this.windowHeight = null; +this.defaultColour = null; +this.sortBy = null; +this.wrap = null; +this.centrecolumnlabels = null; +this.userDefinedColour = null; +this.widthScale = null; +this.heightScale = null; +this.upperCase = null; +this.file2 = null; +this.javascriptListeners = null; +this.jsFunctionExec = null; +this.fileFound = true; +this.launcher = null; +this.currentAlignFrame = null; +this.initialAlignFrame = null; +this.checkedForJmol = false; +this.jmolAvailable = false; +this.alignPdbStructures = false; +this.useXtrnalSviewer = false; +this.haveShownLoadMessage = false; +if (!Clazz.isClassDefined ("jalview.bin.JalviewLite.LoadJmolThread")) { +jalview.bin.JalviewLite.$JalviewLite$LoadJmolThread$ (); +} +if (!Clazz.isClassDefined ("jalview.bin.JalviewLite.LoadingThread")) { +jalview.bin.JalviewLite.$JalviewLite$LoadingThread$ (); +} +this.separator = "\u00ac"; +this.jsfallbackEnabled = false; +this.jshashes = null; +this.jsmessages = null; +this.jsExecQueue = null; +Clazz.instantialize (this, arguments); +}, jalview.bin, "JalviewLite", javax.swing.JApplet, [jalview.api.StructureSelectionManagerProvider, jalview.javascript.JalviewLiteJsApi]); +Clazz.prepareFields (c$, function () { +this.javascriptListeners = new java.util.Vector (); +this.launcher = new javax.swing.JButton (jalview.util.MessageManager.getString ("label.start_jalview")); +this.jshashes = new java.util.Hashtable (); +this.jsmessages = new java.util.Hashtable (); +this.jsExecQueue = new java.util.Vector (); +}); +Clazz.defineMethod (c$, "setParams", +($fz = function () { +jalview.bin.JalviewLite.debug = "true".equalsIgnoreCase (this.getParameter ("debug")); +this.enableSplitFrame = "true".equalsIgnoreCase (this.getParameter ("enableSplitFrame")); +this.embedded = "true".equalsIgnoreCase (this.getParameter ("embedded")); +this.showButton = !"false".equalsIgnoreCase (this.getParameter ("showbutton")); +this.jalviewServletURL = this.getParameter ("APPLICATION_URL"); +this.startupFile = this.getParameter ("file"); +this.helpUrl = this.getParameter ("jalviewhelpurl"); +this.externalstructureviewer = this.getParameter ("externalstructureviewer"); +this.checkForJmol = !"true".equals (this.getParameter ("nojmol")); +this.sep = this.getParameter ("separator"); +this.rgb = this.getParameter ("RGB"); +this.labelColour = this.getParameter ("label"); +this.initjscallback = this.getParameter ("oninit"); +this.pdbFile = this.getParameter ("PDBFILE"); +this.sequence = this.getParameter ("PDBSEQ"); +this.jnetFile = this.getParameter ("jnetfile"); +this.annotations = this.getParameter ("annotations"); +this.hideFeatureGroups = this.getParameter ("hidefeaturegroups"); +this.showFeatureGroups = this.getParameter ("showfeaturegroups"); +this.features = this.getParameter ("features"); +this.showFeatureSettings = this.getParameter ("showFeatureSettings"); +this.scoreFile = this.getParameter ("scoreFile"); +this.treeFile = this.getParameter ("tree"); +if (this.treeFile == null) this.treeFile = this.getParameter ("treeFile"); +this.windowWidth = this.getParameter ("windowWidth"); +this.windowHeight = this.getParameter ("windowHeight"); +this.defaultColour = this.getParameter ("defaultColour"); +this.sortBy = this.getParameter ("sortBy"); +this.wrap = this.getParameter ("wrap"); +this.centrecolumnlabels = this.getParameter ("centrecolumnlabels"); +this.userDefinedColour = this.getParameter ("userDefinedColour"); +this.widthScale = this.getParameter ("widthScale"); +this.heightScale = this.getParameter ("heightScale"); +this.upperCase = this.getParameter ("upperCase"); +this.file2 = this.getParameter ("file2"); +}, $fz.isPrivate = true, $fz)); +Clazz.defineMethod (c$, "getDefaultParameter", +function (name, def) { +var stn; +if ((stn = this.getParameter (name)) == null) { +return def; +}if (stn.toLowerCase ().equals ("true")) { +return true; +}return false; +}, "~S,~B"); +Clazz.defineMethod (c$, "getLinkParams", +function (links) { +var label; +var url; +for (var i = 1; i < 10; i++) { +label = this.getParameter ("linkLabel_" + i); +url = this.getParameter ("linkURL_" + i); +if (label != null && url != null) { +links.addElement (label + "|" + url); +}} +}, "java.util.Vector"); +Clazz.defineMethod (c$, "getStructureSelectionManager", +function () { +return jalview.structure.StructureSelectionManager.getStructureSelectionManager (this); +}); +Clazz.defineMethod (c$, "getSelectedSequences", +function () { +return this.getSelectedSequencesFrom (this.getDefaultTargetFrame ()); +}); +Clazz.defineMethod (c$, "getSelectedSequences", +function (sep) { +return this.getSelectedSequencesFrom (this.getDefaultTargetFrame (), sep); +}, "~S"); +Clazz.defineMethod (c$, "getSelectedSequencesFrom", +function (alf) { +return this.getSelectedSequencesFrom (alf, this.separator); +}, "jalview.appletgui.AlignFrame"); +Clazz.defineMethod (c$, "getSelectedSequencesFrom", +function (alf, sep) { +var result = new StringBuffer (""); +if (sep == null || sep.length == 0) { +sep = this.separator; +}if (alf.viewport.getSelectionGroup () != null) { +var seqs = alf.viewport.getSelectionGroup ().getSequencesInOrder (alf.viewport.getAlignment ()); +for (var i = 0; i < seqs.length; i++) { +result.append (seqs[i].getName ()); +result.append (sep); +} +}return result.toString (); +}, "jalview.appletgui.AlignFrame,~S"); +Clazz.overrideMethod (c$, "highlight", +function (sequenceId, position, alignedPosition) { +this.highlightIn (this.getDefaultTargetFrame (), sequenceId, position, alignedPosition); +}, "~S,~S,~S"); +Clazz.overrideMethod (c$, "highlightIn", +function (alf, sequenceId, position, alignedPosition) { +var matcher = new jalview.analysis.SequenceIdMatcher (alf.viewport.getAlignment ().getSequencesArray ()); +var sq = matcher.findIdMatch (sequenceId); +if (sq != null) { +var apos = -1; +try { +apos = new Integer (position).intValue (); +apos--; +} catch (ex) { +if (Clazz.exceptionOf (ex, NumberFormatException)) { +return; +} else { +throw ex; +} +} +var me = this; +var pos = apos; +if (alignedPosition != null && (alignedPosition.trim ().length == 0 || alignedPosition.toLowerCase ().indexOf ("false") > -1)) { +java.awt.EventQueue.invokeLater (((Clazz.isClassDefined ("jalview.bin.JalviewLite$1") ? 0 : jalview.bin.JalviewLite.$JalviewLite$1$ ()), Clazz.innerTypeInstance (jalview.bin.JalviewLite$1, this, Clazz.cloneFinals ("me", me, "sq", sq, "pos", pos)))); +} else { +java.awt.EventQueue.invokeLater (((Clazz.isClassDefined ("jalview.bin.JalviewLite$2") ? 0 : jalview.bin.JalviewLite.$JalviewLite$2$ ()), Clazz.innerTypeInstance (jalview.bin.JalviewLite$2, this, Clazz.cloneFinals ("me", me, "sq", sq, "pos", pos)))); +}}}, "jalview.appletgui.AlignFrame,~S,~S,~S"); +Clazz.defineMethod (c$, "select", +function (sequenceIds, columns) { +this.selectIn (this.getDefaultTargetFrame (), sequenceIds, columns, this.separator); +}, "~S,~S"); +Clazz.defineMethod (c$, "select", +function (sequenceIds, columns, sep) { +this.selectIn (this.getDefaultTargetFrame (), sequenceIds, columns, sep); +}, "~S,~S,~S"); +Clazz.defineMethod (c$, "selectIn", +function (alf, sequenceIds, columns) { +this.selectIn (alf, sequenceIds, columns, this.separator); +}, "jalview.appletgui.AlignFrame,~S,~S"); +Clazz.defineMethod (c$, "selectIn", +function (alf, sequenceIds, columns, sep) { +if (sep == null || sep.length == 0) { +sep = this.separator; +} else { +if (jalview.bin.JalviewLite.debug) { +System.err.println ("Selecting region using separator string '" + this.separator + "'"); +}}var ids = this.separatorListToArray (sequenceIds, sep); +var cols = this.separatorListToArray (columns, sep); +var sel = new jalview.datamodel.SequenceGroup (); +var csel = new jalview.datamodel.ColumnSelection (); +var al = alf.viewport.getAlignment (); +var matcher = new jalview.analysis.SequenceIdMatcher (alf.viewport.getAlignment ().getSequencesArray ()); +var start = 0; +var end = al.getWidth (); +var alw = al.getWidth (); +var seqsfound = true; +if (ids != null && ids.length > 0) { +seqsfound = false; +for (var i = 0; i < ids.length; i++) { +if (ids[i].trim ().length == 0) { +continue; +}var sq = matcher.findIdMatch (ids[i]); +if (sq != null) { +seqsfound = true; +sel.addSequence (sq, false); +}} +}var inseqpos = false; +if (cols != null && cols.length > 0) { +var seset = false; +for (var i = 0; i < cols.length; i++) { +var cl = cols[i].trim (); +if (cl.length == 0) { +continue; +}var p; +if ((p = cl.indexOf ("-")) > -1) { +var from = -1; +var to = -1; +try { +from = new Integer (cl.substring (0, p)).intValue (); +from--; +} catch (ex) { +if (Clazz.exceptionOf (ex, NumberFormatException)) { +System.err.println ("ERROR: Couldn't parse first integer in range element column selection string '" + cl + "' - format is 'from-to'"); +return; +} else { +throw ex; +} +} +try { +to = new Integer (cl.substring (p + 1)).intValue (); +to--; +} catch (ex) { +if (Clazz.exceptionOf (ex, NumberFormatException)) { +System.err.println ("ERROR: Couldn't parse second integer in range element column selection string '" + cl + "' - format is 'from-to'"); +return; +} else { +throw ex; +} +} +if (from >= 0 && to >= 0) { +if (from < to) { +var t = to; +to = from; +to = t; +}if (!seset) { +start = from; +end = to; +seset = true; +} else { +if (start > from) { +start = from; +}if (end < to) { +end = to; +}}for (var r = from; r <= to; r++) { +if (r >= 0 && r < alw) { +csel.addElement (r); +}} +if (jalview.bin.JalviewLite.debug) { +System.err.println ("Range '" + cl + "' deparsed as [" + from + "," + to + "]"); +}} else { +System.err.println ("ERROR: Invalid Range '" + cl + "' deparsed as [" + from + "," + to + "]"); +}} else { +var r = -1; +try { +r = new Integer (cl).intValue (); +r--; +} catch (ex) { +if (Clazz.exceptionOf (ex, NumberFormatException)) { +if (cl.toLowerCase ().equals ("sequence")) { +inseqpos = true; +} else { +System.err.println ("ERROR: Couldn't parse integer from point selection element of column selection string '" + cl + "'"); +return; +}} else { +throw ex; +} +} +if (r >= 0 && r <= alw) { +if (!seset) { +start = r; +end = r; +seset = true; +} else { +if (start > r) { +start = r; +}if (end < r) { +end = r; +}}csel.addElement (r); +if (jalview.bin.JalviewLite.debug) { +System.err.println ("Point selection '" + cl + "' deparsed as [" + r + "]"); +}} else { +System.err.println ("ERROR: Invalid Point selection '" + cl + "' deparsed as [" + r + "]"); +}}} +}if (seqsfound) { +if (inseqpos && sel.getSize () > 0) { +var rs = sel.getSequenceAt (0); +start = rs.findIndex (start); +end = rs.findIndex (end); +if (csel != null) { +var cs = csel.getSelected (); +csel.clear (); +for (var selectedCol, $selectedCol = cs.iterator (); $selectedCol.hasNext () && ((selectedCol = $selectedCol.next ()) || true);) { +csel.addElement (rs.findIndex ((selectedCol).intValue ())); +} +}}sel.setStartRes (start); +sel.setEndRes (end); +java.awt.EventQueue.invokeLater (((Clazz.isClassDefined ("jalview.bin.JalviewLite$3") ? 0 : jalview.bin.JalviewLite.$JalviewLite$3$ ()), Clazz.innerTypeInstance (jalview.bin.JalviewLite$3, this, Clazz.cloneFinals ("alf", alf, "sel", sel, "csel", csel)))); +}}, "jalview.appletgui.AlignFrame,~S,~S,~S"); +Clazz.overrideMethod (c$, "getSelectedSequencesAsAlignment", +function (format, suffix) { +return this.getSelectedSequencesAsAlignmentFrom (this.getDefaultTargetFrame (), format, suffix); +}, "~S,~S"); +Clazz.overrideMethod (c$, "getSelectedSequencesAsAlignmentFrom", +function (alf, format, suffix) { +try { +var seqlimits = suffix.equalsIgnoreCase ("true"); +if (alf.viewport.getSelectionGroup () != null) { +var reply = new jalview.io.AppletFormatAdapter ().formatSequences (format, new jalview.datamodel.Alignment (alf.viewport.getSelectionAsNewSequence ()), seqlimits); +return reply; +}} catch (ex) { +if (Clazz.exceptionOf (ex, Exception)) { +ex.printStackTrace (); +return "Error retrieving alignment in " + format + " format. "; +} else { +throw ex; +} +} +return ""; +}, "jalview.appletgui.AlignFrame,~S,~S"); +Clazz.overrideMethod (c$, "getAlignmentOrder", +function () { +return this.getAlignmentOrderFrom (this.getDefaultTargetFrame ()); +}); +Clazz.defineMethod (c$, "getAlignmentOrderFrom", +function (alf) { +return this.getAlignmentOrderFrom (alf, this.separator); +}, "jalview.appletgui.AlignFrame"); +Clazz.defineMethod (c$, "getAlignmentOrderFrom", +function (alf, sep) { +var alorder = alf.getAlignViewport ().getAlignment (); +var order = new Array (alorder.getHeight ()); +for (var i = 0; i < order.length; i++) { +order[i] = alorder.getSequenceAt (i).getName (); +} +return this.arrayToSeparatorList (order); +}, "jalview.appletgui.AlignFrame,~S"); +Clazz.defineMethod (c$, "orderBy", +function (order, undoName) { +return this.orderBy (order, undoName, this.separator); +}, "~S,~S"); +Clazz.defineMethod (c$, "orderBy", +function (order, undoName, sep) { +return this.orderAlignmentBy (this.getDefaultTargetFrame (), order, undoName, sep); +}, "~S,~S,~S"); +Clazz.overrideMethod (c$, "orderAlignmentBy", +function (alf, order, undoName, sep) { +var ids = this.separatorListToArray (order, sep); +var sqs = null; +if (ids != null && ids.length > 0) { +var matcher = new jalview.analysis.SequenceIdMatcher (alf.viewport.getAlignment ().getSequencesArray ()); +var s = 0; +sqs = new Array (ids.length); +for (var i = 0; i < ids.length; i++) { +if (ids[i].trim ().length == 0) { +continue; +}var sq = matcher.findIdMatch (ids[i]); +if (sq != null) { +sqs[s++] = sq; +}} +if (s > 0) { +var sqq = new Array (s); +System.arraycopy (sqs, 0, sqq, 0, s); +sqs = sqq; +} else { +sqs = null; +}}if (sqs == null) { +return ""; +};var aorder = new jalview.datamodel.AlignmentOrder (sqs); +if (undoName != null && undoName.trim ().length == 0) { +undoName = null; +}var _undoName = undoName; +return alf.sortBy (aorder, _undoName) ? "true" : ""; +}, "jalview.appletgui.AlignFrame,~S,~S,~S"); +Clazz.defineMethod (c$, "getAlignment", +function (format) { +return this.getAlignmentFrom (this.getDefaultTargetFrame (), format, "true"); +}, "~S"); +Clazz.defineMethod (c$, "getAlignmentFrom", +function (alf, format) { +return this.getAlignmentFrom (alf, format, "true"); +}, "jalview.appletgui.AlignFrame,~S"); +Clazz.defineMethod (c$, "getAlignment", +function (format, suffix) { +return this.getAlignmentFrom (this.getDefaultTargetFrame (), format, suffix); +}, "~S,~S"); +Clazz.defineMethod (c$, "getAlignmentFrom", +function (alf, format, suffix) { +try { +var seqlimits = suffix.equalsIgnoreCase ("true"); +var reply = new jalview.io.AppletFormatAdapter ().formatSequences (format, alf.viewport.getAlignment (), seqlimits); +return reply; +} catch (ex) { +if (Clazz.exceptionOf (ex, Exception)) { +ex.printStackTrace (); +return "Error retrieving alignment in " + format + " format. "; +} else { +throw ex; +} +} +}, "jalview.appletgui.AlignFrame,~S,~S"); +Clazz.overrideMethod (c$, "loadAnnotation", +function (annotation) { +this.loadAnnotationFrom (this.getDefaultTargetFrame (), annotation); +}, "~S"); +Clazz.overrideMethod (c$, "loadAnnotationFrom", +function (alf, annotation) { +if ( new jalview.io.AnnotationFile ().annotateAlignmentView (alf.getAlignViewport (), annotation, jalview.io.AppletFormatAdapter.PASTE)) { +alf.alignPanel.fontChanged (); +alf.alignPanel.setScrollValues (0, 0); +} else { +alf.parseFeaturesFile (annotation, jalview.io.AppletFormatAdapter.PASTE); +}}, "jalview.appletgui.AlignFrame,~S"); +Clazz.overrideMethod (c$, "loadFeatures", +function (features, autoenabledisplay) { +this.loadFeaturesFrom (this.getDefaultTargetFrame (), features, autoenabledisplay); +}, "~S,~B"); +Clazz.overrideMethod (c$, "loadFeaturesFrom", +function (alf, features, autoenabledisplay) { +return alf.parseFeaturesFile (features, jalview.io.AppletFormatAdapter.PASTE, autoenabledisplay); +}, "jalview.appletgui.AlignFrame,~S,~B"); +Clazz.overrideMethod (c$, "getFeatures", +function (format) { +return this.getFeaturesFrom (this.getDefaultTargetFrame (), format); +}, "~S"); +Clazz.overrideMethod (c$, "getFeaturesFrom", +function (alf, format) { +return alf.outputFeatures (false, format); +}, "jalview.appletgui.AlignFrame,~S"); +Clazz.overrideMethod (c$, "getAnnotation", +function () { +return this.getAnnotationFrom (this.getDefaultTargetFrame ()); +}); +Clazz.overrideMethod (c$, "getAnnotationFrom", +function (alf) { +return alf.outputAnnotations (false); +}, "jalview.appletgui.AlignFrame"); +Clazz.defineMethod (c$, "newView", +function () { +return this.newViewFrom (this.getDefaultTargetFrame ()); +}); +Clazz.defineMethod (c$, "newView", +function (name) { +return this.newViewFrom (this.getDefaultTargetFrame (), name); +}, "~S"); +Clazz.defineMethod (c$, "newViewFrom", +function (alf) { +return alf.newView (null); +}, "jalview.appletgui.AlignFrame"); +Clazz.defineMethod (c$, "newViewFrom", +function (alf, name) { +return alf.newView (name); +}, "jalview.appletgui.AlignFrame,~S"); +Clazz.overrideMethod (c$, "loadAlignment", +function (text, title) { +var al = null; +var format = new jalview.io.IdentifyFile ().Identify (text, jalview.io.AppletFormatAdapter.PASTE); +try { +al = new jalview.io.AppletFormatAdapter ().readFile (text, jalview.io.AppletFormatAdapter.PASTE, format); +if (al.getHeight () > 0) { +return new jalview.appletgui.AlignFrame (al, this, title, false); +}} catch (ex) { +if (Clazz.exceptionOf (ex, java.io.IOException)) { +ex.printStackTrace (); +} else { +throw ex; +} +} +return null; +}, "~S,~S"); +Clazz.defineMethod (c$, "setMouseoverListener", +function (listener) { +this.setMouseoverListener (this.currentAlignFrame, listener); +}, "~S"); +Clazz.defineMethod (c$, "setMouseoverListener", +function (af, listener) { +if (listener != null) { +listener = listener.trim (); +if (listener.length == 0) { +System.err.println ("jalview Javascript error: Ignoring empty function for mouseover listener."); +return; +}}var mol = new jalview.javascript.MouseOverListener (this, af, listener); +this.javascriptListeners.addElement (mol); +jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).addStructureViewerListener (mol); +if (jalview.bin.JalviewLite.debug) { +System.err.println ("Added a mouseover listener for " + ((af == null) ? "All frames" : "Just views for " + af.getAlignViewport ().getSequenceSetId ())); +System.err.println ("There are now " + this.javascriptListeners.size () + " listeners in total."); +}}, "jalview.appletgui.AlignFrame,~S"); +Clazz.defineMethod (c$, "setSelectionListener", +function (listener) { +this.setSelectionListener (null, listener); +}, "~S"); +Clazz.defineMethod (c$, "setSelectionListener", +function (af, listener) { +if (listener != null) { +listener = listener.trim (); +if (listener.length == 0) { +System.err.println ("jalview Javascript error: Ignoring empty function for selection listener."); +return; +}}var mol = new jalview.javascript.JsSelectionSender (this, af, listener); +this.javascriptListeners.addElement (mol); +jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).addSelectionListener (mol); +if (jalview.bin.JalviewLite.debug) { +System.err.println ("Added a selection listener for " + ((af == null) ? "All frames" : "Just views for " + af.getAlignViewport ().getSequenceSetId ())); +System.err.println ("There are now " + this.javascriptListeners.size () + " listeners in total."); +}}, "jalview.appletgui.AlignFrame,~S"); +Clazz.overrideMethod (c$, "setStructureListener", +function (listener, modelSet) { +if (listener != null) { +listener = listener.trim (); +if (listener.length == 0) { +System.err.println ("jalview Javascript error: Ignoring empty function for selection listener."); +return; +}}var mol = new jalview.javascript.MouseOverStructureListener (this, listener, this.separatorListToArray (modelSet)); +this.javascriptListeners.addElement (mol); +jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).addStructureViewerListener (mol); +if (jalview.bin.JalviewLite.debug) { +System.err.println ("Added a javascript structure viewer listener '" + listener + "'"); +System.err.println ("There are now " + this.javascriptListeners.size () + " listeners in total."); +}}, "~S,~S"); +Clazz.overrideMethod (c$, "removeJavascriptListener", +function (af, listener) { +if (listener != null) { +listener = listener.trim (); +if (listener.length == 0) { +listener = null; +}}var rprt = false; +for (var ms = 0, msSize = this.javascriptListeners.size (); ms < msSize; ) { +var lstn = this.javascriptListeners.elementAt (ms); +var lstner = lstn; +if ((af == null || lstner.getAlignFrame () === af) && (listener == null || lstner.getListenerFunction ().equals (listener))) { +this.javascriptListeners.removeElement (lstner); +msSize--; +if (Clazz.instanceOf (lstner, jalview.structure.SelectionListener)) { +jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).removeSelectionListener (lstner); +} else { +jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).removeStructureViewerListener (lstner, null); +}rprt = jalview.bin.JalviewLite.debug; +if (jalview.bin.JalviewLite.debug) { +System.err.println ("Removed listener '" + listener + "'"); +}} else { +ms++; +}} +if (rprt) { +System.err.println ("There are now " + this.javascriptListeners.size () + " listeners in total."); +}}, "jalview.appletgui.AlignFrame,~S"); +Clazz.overrideMethod (c$, "stop", +function () { +System.err.println ("Applet " + this.getName () + " stop()."); +this.tidyUp (); +}); +Clazz.overrideMethod (c$, "destroy", +function () { +System.err.println ("Applet " + this.getName () + " destroy()."); +this.tidyUp (); +}); +Clazz.defineMethod (c$, "tidyUp", +($fz = function () { +this.removeAll (); +if (this.currentAlignFrame != null && this.currentAlignFrame.viewport != null && this.currentAlignFrame.viewport.applet != null) { +var av = this.currentAlignFrame.viewport; +this.currentAlignFrame.closeMenuItem_actionPerformed (); +av.applet = null; +this.currentAlignFrame = null; +}if (this.javascriptListeners != null) { +while (this.javascriptListeners.size () > 0) { +var mol = this.javascriptListeners.elementAt (0); +this.javascriptListeners.removeElement (mol); +if (Clazz.instanceOf (mol, jalview.structure.SelectionListener)) { +jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).removeSelectionListener (mol); +} else { +jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).removeStructureViewerListener (mol, null); +}mol.jvlite = null; +} +}if (this.jsFunctionExec != null) { +this.jsFunctionExec.stopQueue (); +this.jsFunctionExec.jvlite = null; +}this.initialAlignFrame = null; +this.jsFunctionExec = null; +this.javascriptListeners = null; +jalview.structure.StructureSelectionManager.release (this); +}, $fz.isPrivate = true, $fz)); +Clazz.overrideMethod (c$, "mouseOverStructure", +function (pdbResNum, chain, pdbfile) { +var me = this; +java.awt.EventQueue.invokeLater (((Clazz.isClassDefined ("jalview.bin.JalviewLite$4") ? 0 : jalview.bin.JalviewLite.$JalviewLite$4$ ()), Clazz.innerTypeInstance (jalview.bin.JalviewLite$4, this, Clazz.cloneFinals ("me", me, "pdbResNum", pdbResNum, "chain", chain, "pdbfile", pdbfile)))); +}, "~S,~S,~S"); +Clazz.overrideMethod (c$, "scrollViewToIn", +function (alf, topRow, leftHandColumn) { +java.awt.EventQueue.invokeLater (((Clazz.isClassDefined ("jalview.bin.JalviewLite$5") ? 0 : jalview.bin.JalviewLite.$JalviewLite$5$ ()), Clazz.innerTypeInstance (jalview.bin.JalviewLite$5, this, Clazz.cloneFinals ("alf", alf, "topRow", topRow, "leftHandColumn", leftHandColumn)))); +}, "jalview.appletgui.AlignFrame,~S,~S"); +Clazz.overrideMethod (c$, "scrollViewToRowIn", +function (alf, topRow) { +java.awt.EventQueue.invokeLater (((Clazz.isClassDefined ("jalview.bin.JalviewLite$6") ? 0 : jalview.bin.JalviewLite.$JalviewLite$6$ ()), Clazz.innerTypeInstance (jalview.bin.JalviewLite$6, this, Clazz.cloneFinals ("alf", alf, "topRow", topRow)))); +}, "jalview.appletgui.AlignFrame,~S"); +Clazz.overrideMethod (c$, "scrollViewToColumnIn", +function (alf, leftHandColumn) { +java.awt.EventQueue.invokeLater (((Clazz.isClassDefined ("jalview.bin.JalviewLite$7") ? 0 : jalview.bin.JalviewLite.$JalviewLite$7$ ()), Clazz.innerTypeInstance (jalview.bin.JalviewLite$7, this, Clazz.cloneFinals ("alf", alf, "leftHandColumn", leftHandColumn)))); +}, "jalview.appletgui.AlignFrame,~S"); +c$.initBuildDetails = Clazz.defineMethod (c$, "initBuildDetails", +($fz = function () { +if (jalview.bin.JalviewLite.builddate == null) { +jalview.bin.JalviewLite.builddate = "unknown"; +jalview.bin.JalviewLite.version = "test"; +jalview.bin.JalviewLite.installation = "Webstart"; +var url = jalview.bin.JalviewLite.getResource ("/.build_properties"); +if (url != null) { +try { +var reader = new java.io.BufferedReader ( new java.io.InputStreamReader (url.openStream ())); +var line; +while ((line = reader.readLine ()) != null) { +if (line.indexOf ("VERSION") > -1) { +jalview.bin.JalviewLite.version = line.substring (line.indexOf ("=") + 1); +}if (line.indexOf ("BUILD_DATE") > -1) { +jalview.bin.JalviewLite.builddate = line.substring (line.indexOf ("=") + 1); +}if (line.indexOf ("INSTALLATION") > -1) { +jalview.bin.JalviewLite.installation = line.substring (line.indexOf ("=") + 1); +}} +} catch (ex) { +if (Clazz.exceptionOf (ex, Exception)) { +ex.printStackTrace (); +} else { +throw ex; +} +} +}}}, $fz.isPrivate = true, $fz)); +c$.getBuildDate = Clazz.defineMethod (c$, "getBuildDate", +function () { +jalview.bin.JalviewLite.initBuildDetails (); +return jalview.bin.JalviewLite.builddate; +}); +c$.getInstallation = Clazz.defineMethod (c$, "getInstallation", +function () { +jalview.bin.JalviewLite.initBuildDetails (); +return jalview.bin.JalviewLite.installation; +}); +c$.getVersion = Clazz.defineMethod (c$, "getVersion", +function () { +jalview.bin.JalviewLite.initBuildDetails (); +return jalview.bin.JalviewLite.version; +}); +Clazz.overrideMethod (c$, "init", +function () { +this.setParams (); +try { +if (jalview.bin.JalviewLite.debug) { +System.err.println ("Applet context is '" + this.getAppletContext ().getClass ().toString () + "'"); +}var scriptObject = netscape.javascript.JSObject.getWindow (this); +if (jalview.bin.JalviewLite.debug && scriptObject != null) { +System.err.println ("Applet has Javascript callback support."); +}} catch (ex) { +if (Clazz.exceptionOf (ex, Exception)) { +System.err.println ("Warning: No JalviewLite javascript callbacks available."); +if (jalview.bin.JalviewLite.debug) { +ex.printStackTrace (); +}} else { +throw ex; +} +} +if (jalview.bin.JalviewLite.debug) { +System.err.println ("JalviewLite Version " + jalview.bin.JalviewLite.getVersion ()); +System.err.println ("Build Date : " + jalview.bin.JalviewLite.getBuildDate ()); +System.err.println ("Installation : " + jalview.bin.JalviewLite.getInstallation ()); +}if (this.externalstructureviewer != null) { +this.useXtrnalSviewer = this.externalstructureviewer.trim ().toLowerCase ().equals ("true"); +}if (this.sep != null) { +if (this.sep.length > 0) { +this.separator = this.sep; +if (jalview.bin.JalviewLite.debug) { +System.err.println ("Separator set to '" + this.separator + "'"); +}} else { +throw new Error (jalview.util.MessageManager.getString ("error.invalid_separator_parameter")); +}}var r = 255; +var g = 255; +var b = 255; +if (this.rgb != null) { +try { +r = Integer.parseInt (this.rgb.substring (0, 2), 16); +g = Integer.parseInt (this.rgb.substring (2, 4), 16); +b = Integer.parseInt (this.rgb.substring (4, 6), 16); +} catch (ex) { +if (Clazz.exceptionOf (ex, Exception)) { +r = 255; +g = 255; +b = 255; +} else { +throw ex; +} +} +}this.rgb = this.labelColour; +if (this.rgb != null) { +this.launcher.setLabel (this.rgb); +}this.setBackground ( new java.awt.Color (r, g, b)); +if (this.startupFile == null) { +var data = new StringBuffer ("PASTE"); +var i = 1; +while ((this.startupFile = this.getParameter ("sequence" + i)) != null) { +data.append (this.startupFile.toString () + "\n"); +i++; +} +if (data.length () > 5) { +this.startupFile = data.toString (); +}}if (!this.enableSplitFrame) { +this.file2 = null; +}if (this.embedded) { +var loader = Clazz.innerTypeInstance (jalview.bin.JalviewLite.LoadingThread, this, null, this.startupFile, this.file2, this); +{ +loader.run(); +}} else if (this.startupFile != null) { +if (!this.showButton) { +var loader = Clazz.innerTypeInstance (jalview.bin.JalviewLite.LoadingThread, this, null, this.startupFile, this.file2, this); +loader.start (); +} else { +this.add (this.launcher); +this.launcher.addActionListener (((Clazz.isClassDefined ("jalview.bin.JalviewLite$8") ? 0 : jalview.bin.JalviewLite.$JalviewLite$8$ ()), Clazz.innerTypeInstance (jalview.bin.JalviewLite$8, this, null))); +}} else { +this.startupFile = "NO FILE"; +this.fileFound = false; +this.callInitCallback (); +}}); +Clazz.defineMethod (c$, "initLiveConnect", +($fz = function () { +var notFailed = false; +var tries = 0; +while (!notFailed && tries < 10) { +if (tries > 0) { +System.err.println ("LiveConnect request thread going to sleep."); +}try { +Thread.sleep (700 * (1 + tries)); +} catch (q) { +if (Clazz.exceptionOf (q, InterruptedException)) { +} else { +throw q; +} +} +;if (tries++ > 0) { +System.err.println ("LiveConnect request thread woken up."); +}try { +var scriptObject = netscape.javascript.JSObject.getWindow (this); +if (scriptObject.eval ("navigator") != null) { +notFailed = true; +}} catch (jsex) { +if (Clazz.exceptionOf (jsex, Exception)) { +System.err.println ("Attempt " + tries + " to access LiveConnect javascript failed."); +} else { +throw jsex; +} +} +} +}, $fz.isPrivate = true, $fz)); +Clazz.defineMethod (c$, "callInitCallback", +($fz = function () { +if (this.initjscallback == null) { +return; +}this.initjscallback = this.initjscallback.trim (); +if (this.initjscallback.length > 0) { +var scriptObject = null; +try { +scriptObject = netscape.javascript.JSObject.getWindow (this); +} catch (ex) { +if (Clazz.exceptionOf (ex, Exception)) { +} else { +throw ex; +} +} +;this.initLiveConnect (); +if (scriptObject != null) { +try { + new jalview.javascript.JSFunctionExec (this).executeJavascriptFunction (true, this.initjscallback, null, "Calling oninit callback '" + this.initjscallback + "'."); +} catch (e) { +if (Clazz.exceptionOf (e, Exception)) { +System.err.println ("Exception when executing _oninit callback '" + this.initjscallback + "'."); +e.printStackTrace (); +} else { +throw e; +} +} +} else { +System.err.println ("Not executing _oninit callback '" + this.initjscallback + "' - no scripting allowed."); +}}}, $fz.isPrivate = true, $fz)); +c$.addFrame = Clazz.defineMethod (c$, "addFrame", +function (frame, title, width, height) { +frame.setLocation (jalview.bin.JalviewLite.lastFrameX, jalview.bin.JalviewLite.lastFrameY); +jalview.bin.JalviewLite.lastFrameX += 40; +jalview.bin.JalviewLite.lastFrameY += 40; +frame.setSize (width, height); +frame.setTitle (title); +frame.addWindowListener (((Clazz.isClassDefined ("jalview.bin.JalviewLite$9") ? 0 : jalview.bin.JalviewLite.$JalviewLite$9$ ()), Clazz.innerTypeInstance (jalview.bin.JalviewLite$9, this, Clazz.cloneFinals ("frame", frame)))); +frame.setVisible (true); +}, "javax.swing.JFrame,~S,~N,~N"); +Clazz.defineMethod (c$, "paintComponent", +function (g) { +if (!this.fileFound) { +g.setColor ( new java.awt.Color (200, 200, 200)); +g.setColor (java.awt.Color.cyan); +g.fillRect (0, 0, this.getSize ().width, this.getSize ().height); +g.setColor (java.awt.Color.red); +g.drawString (jalview.util.MessageManager.getString ("label.jalview_cannot_open_file"), 5, 15); +g.drawString ("\"" + this.startupFile + "\"", 5, 30); +} else if (this.embedded && !this.haveShownLoadMessage) { +g.setColor (java.awt.Color.black); +g.setFont ( new java.awt.Font ("Arial", 1, 24)); +g.drawString (jalview.util.MessageManager.getString ("label.jalview_applet"), 50, Clazz.doubleToInt (this.getSize ().height / 2) - 30); +g.drawString (jalview.util.MessageManager.getString ("label.loading_data") + "...", 50, Clazz.doubleToInt (this.getSize ().height / 2)); +this.haveShownLoadMessage = true; +}}, "java.awt.Graphics"); +Clazz.defineMethod (c$, "getAppletWindow", +function (class1) { +var wnds = new java.util.Vector (); +var cmp = this.getComponents (); +if (cmp != null) { +for (var i = 0; i < cmp.length; i++) { +if (class1.isAssignableFrom (cmp[i].getClass ())) { +wnds.addElement (cmp); +}} +}return wnds; +}, "Class"); +Clazz.defineMethod (c$, "getDefaultTargetFrame", +function () { +if (this.currentAlignFrame != null) { +return this.currentAlignFrame; +}if (this.initialAlignFrame != null) { +return this.initialAlignFrame; +}System.err.println ("Implementation error: Jalview Applet API cannot work out which AlignFrame to use."); +return null; +}); +Clazz.defineMethod (c$, "separatorListToArray", +function (list) { +return this.separatorListToArray (list, this.separator); +}, "~S"); +Clazz.defineMethod (c$, "separatorListToArray", +function (list, separator) { +var seplen = separator.length; +if (list == null || list.equals ("") || list.equals (separator)) { +return null; +}var jv = new java.util.Vector (); +var cp = 0; +var pos; +while ((pos = list.indexOf (separator, cp)) > cp) { +jv.addElement (list.substring (cp, pos)); +cp = pos + seplen; +} +if (cp < list.length) { +var c = list.substring (cp); +if (!c.equals (separator)) { +jv.addElement (c); +}}if (jv.size () > 0) { +var v = new Array (jv.size ()); +for (var i = 0; i < v.length; i++) { +v[i] = jv.elementAt (i); +} +jv.removeAllElements (); +if (jalview.bin.JalviewLite.debug) { +System.err.println ("Array from '" + separator + "' separated List:\n" + v.length); +for (var i = 0; i < v.length; i++) { +System.err.println ("item " + i + " '" + v[i] + "'"); +} +}return v; +}if (jalview.bin.JalviewLite.debug) { +System.err.println ("Empty Array from '" + separator + "' separated List"); +}return null; +}, "~S,~S"); +Clazz.defineMethod (c$, "arrayToSeparatorList", +function (list) { +return this.arrayToSeparatorList (list, this.separator); +}, "~A"); +Clazz.defineMethod (c$, "arrayToSeparatorList", +function (list, separator) { +var v = new StringBuffer (); +if (list != null && list.length > 0) { +for (var i = 0, iSize = list.length; i < iSize; i++) { +if (list[i] != null) { +if (i > 0) { +v.append (separator); +}v.append (list[i]); +}} +if (jalview.bin.JalviewLite.debug) { +System.err.println ("Returning '" + separator + "' separated List:\n"); +System.err.println (v); +}return v.toString (); +}if (jalview.bin.JalviewLite.debug) { +System.err.println ("Returning empty '" + separator + "' separated List\n"); +}return "" + separator; +}, "~A,~S"); +Clazz.overrideMethod (c$, "getFeatureGroups", +function () { +var lst = this.arrayToSeparatorList (this.getDefaultTargetFrame ().getFeatureGroups ()); +return lst; +}); +Clazz.overrideMethod (c$, "getFeatureGroupsOn", +function (alf) { +var lst = this.arrayToSeparatorList (alf.getFeatureGroups ()); +return lst; +}, "jalview.appletgui.AlignFrame"); +Clazz.overrideMethod (c$, "getFeatureGroupsOfState", +function (visible) { +return this.arrayToSeparatorList (this.getDefaultTargetFrame ().getFeatureGroupsOfState (visible)); +}, "~B"); +Clazz.overrideMethod (c$, "getFeatureGroupsOfStateOn", +function (alf, visible) { +return this.arrayToSeparatorList (alf.getFeatureGroupsOfState (visible)); +}, "jalview.appletgui.AlignFrame,~B"); +Clazz.overrideMethod (c$, "setFeatureGroupStateOn", +function (alf, groups, state) { +var st = state; +java.awt.EventQueue.invokeLater (((Clazz.isClassDefined ("jalview.bin.JalviewLite$10") ? 0 : jalview.bin.JalviewLite.$JalviewLite$10$ ()), Clazz.innerTypeInstance (jalview.bin.JalviewLite$10, this, Clazz.cloneFinals ("alf", alf, "groups", groups, "st", st)))); +}, "jalview.appletgui.AlignFrame,~S,~B"); +Clazz.overrideMethod (c$, "setFeatureGroupState", +function (groups, state) { +this.setFeatureGroupStateOn (this.getDefaultTargetFrame (), groups, state); +}, "~S,~B"); +Clazz.overrideMethod (c$, "getSeparator", +function () { +return this.separator; +}); +Clazz.overrideMethod (c$, "setSeparator", +function (separator) { +if (separator == null || separator.length < 1) { +separator = "\u00ac"; +}this.separator = separator; +if (jalview.bin.JalviewLite.debug) { +System.err.println ("Default Separator now: '" + separator + "'"); +}}, "~S"); +Clazz.overrideMethod (c$, "addPdbFile", +function (alFrame, sequenceId, pdbEntryString, pdbFile) { +return alFrame.addPdbFile (sequenceId, pdbEntryString, pdbFile); +}, "jalview.appletgui.AlignFrame,~S,~S,~S"); +Clazz.defineMethod (c$, "setAlignPdbStructures", +function (alignPdbStructures) { +this.alignPdbStructures = alignPdbStructures; +}, "~B"); +Clazz.defineMethod (c$, "isAlignPdbStructures", +function () { +return this.alignPdbStructures; +}); +Clazz.overrideMethod (c$, "start", +function () { +}); +Clazz.defineMethod (c$, "setJsMessageSet", +function (messageclass, viewId, colcommands) { +var msgset = this.jsmessages.get (messageclass); +if (msgset == null) { +msgset = new java.util.Hashtable (); +this.jsmessages.put (messageclass, msgset); +}msgset.put (viewId, colcommands); +var l = Clazz.newLongArray (colcommands.length, 0); +for (var i = 0; i < colcommands.length; i++) { +l[i] = colcommands[i].hashCode (); +} +this.jshashes.put (messageclass + "|" + viewId, l); +}, "~S,~S,~A"); +Clazz.overrideMethod (c$, "getJsMessage", +function (messageclass, viewId) { +var msgset = this.jsmessages.get (messageclass); +if (msgset != null) { +var msgs = msgset.get (viewId); +if (msgs != null) { +for (var i = 0; i < msgs.length; i++) { +if (msgs[i] != null) { +var m = msgs[i]; +msgs[i] = null; +return m; +}} +}}return ""; +}, "~S,~S"); +Clazz.defineMethod (c$, "isJsMessageSetChanged", +function (string, string2, colcommands) { +var l = this.jshashes.get (string + "|" + string2); +if (l == null && colcommands != null) { +return true; +}for (var i = 0; i < colcommands.length; i++) { +if (l[i] != colcommands[i].hashCode ()) { +return true; +}} +return false; +}, "~S,~S,~A"); +Clazz.defineMethod (c$, "getJsExecQueue", +function () { +return this.jsExecQueue; +}); +Clazz.defineMethod (c$, "setExecutor", +function (jsFunctionExec2) { +this.jsFunctionExec = jsFunctionExec2; +}, "jalview.javascript.JSFunctionExec"); +Clazz.defineMethod (c$, "getDefaultColourParameter", +function (colparam, defcolour) { +var colprop = this.getParameter (colparam); +if (colprop == null || colprop.trim ().length == 0) { +return defcolour; +}var col = jalview.schemes.ColourSchemeProperty.getAWTColorFromName (colprop); +if (col == null) { +try { +col = new jalview.schemes.UserColourScheme (colprop).findColour ('A'); +} catch (ex) { +if (Clazz.exceptionOf (ex, Exception)) { +System.err.println ("Couldn't parse '" + colprop + "' as a colour for " + colparam); +col = null; +} else { +throw ex; +} +} +}return (col == null) ? defcolour : col; +}, "~S,java.awt.Color"); +Clazz.defineMethod (c$, "openJalviewHelpUrl", +function () { +if (this.helpUrl == null || this.helpUrl.trim ().length < 5) { +this.helpUrl = "http://www.jalview.org/help.html"; +}this.showURL (this.helpUrl, "HELP"); +}); +Clazz.defineMethod (c$, "resolveUrlForLocalOrAbsolute", +($fz = function (url, localref) { +var codebase = localref.toString (); +var pt = codebase.indexOf ("?"); +if (pt < 0) pt = codebase.length; +codebase = codebase.substring (0, pt); +codebase = codebase.substring (0, codebase.lastIndexOf ("/") + 1); +if (url.indexOf ("/") == 0 && !localref.getProtocol ().equals ("file")) { +pt = codebase.indexOf ("/", 8); +return codebase.substring (0, pt) + url; +}return codebase + url; +}, $fz.isPrivate = true, $fz), "~S,java.net.URL"); +Clazz.defineMethod (c$, "showURL", +function (url, target) { +try { +if (url.indexOf (":") == -1) { +var prepend; +url = this.resolveUrlForLocalOrAbsolute (url, prepend = this.getDefaultParameter ("resolvetocodebase", false) ? this.getDocumentBase () : this.getCodeBase ()); +if (jalview.bin.JalviewLite.debug) { +System.err.println ("Show url (prepended " + prepend + " - toggle resolvetocodebase if code/docbase resolution is wrong): " + url); +}} else { +if (jalview.bin.JalviewLite.debug) { +System.err.println ("Show url: " + url); +}}if (url.indexOf ("javascript:") == 0) { +this.getAppletContext ().showDocument ( new java.net.URL (url)); +} else { +this.getAppletContext ().showDocument ( new java.net.URL (url), target); +}} catch (ex) { +if (Clazz.exceptionOf (ex, Exception)) { +ex.printStackTrace (); +} else { +throw ex; +} +} +}, "~S,~S"); +c$.$JalviewLite$LoadJmolThread$ = function () { +Clazz.pu$h (); +c$ = Clazz.decorateAsClass (function () { +Clazz.prepareCallback (this, arguments); +this.running = false; +Clazz.instantialize (this, arguments); +}, jalview.bin.JalviewLite, "LoadJmolThread", Thread); +Clazz.overrideMethod (c$, "run", +function () { +if (this.running || this.b$["jalview.bin.JalviewLite"].checkedForJmol) { +return; +}this.running = true; +if (this.b$["jalview.bin.JalviewLite"].checkForJmol) { +try { +if (!System.getProperty ("java.version").startsWith ("1.1")) { +Class.forName ("org.jmol.adapter.smarter.SmarterJmolAdapter"); +this.b$["jalview.bin.JalviewLite"].jmolAvailable = true; +}if (!this.b$["jalview.bin.JalviewLite"].jmolAvailable) { +System.out.println ("Jmol not available - Using MCview for structures"); +}} catch (ex) { +if (Clazz.exceptionOf (ex, ClassNotFoundException)) { +} else { +throw ex; +} +} +} else { +this.b$["jalview.bin.JalviewLite"].jmolAvailable = false; +if (jalview.bin.JalviewLite.debug) { +System.err.println ("Skipping Jmol check. Will use MCView (probably)"); +}}this.b$["jalview.bin.JalviewLite"].checkedForJmol = true; +this.running = false; +}); +Clazz.defineMethod (c$, "notFinished", +function () { +return this.running || !this.b$["jalview.bin.JalviewLite"].checkedForJmol; +}); +c$ = Clazz.p0p (); +}; +c$.$JalviewLite$LoadingThread$ = function () { +Clazz.pu$h (); +c$ = Clazz.decorateAsClass (function () { +Clazz.prepareCallback (this, arguments); +this.protocol = null; +this._file = null; +this._file2 = null; +this.applet = null; +Clazz.instantialize (this, arguments); +}, jalview.bin.JalviewLite, "LoadingThread", Thread); +Clazz.defineMethod (c$, "dbgMsg", +($fz = function (a) { +if (jalview.bin.JalviewLite.debug) { +System.err.println (a); +}}, $fz.isPrivate = true, $fz), "~S"); +Clazz.defineMethod (c$, "setProtocolState", +function (a) { +if (a.startsWith ("PASTE")) { +a = a.substring (5); +this.protocol = jalview.io.AppletFormatAdapter.PASTE; +} else if (this.inArchive (a)) { +this.protocol = jalview.io.AppletFormatAdapter.CLASSLOADER; +} else { +a = this.addProtocol (a); +this.protocol = jalview.io.AppletFormatAdapter.URL; +}this.dbgMsg ("Protocol identified as '" + this.protocol + "'"); +return a; +}, "~S"); +Clazz.makeConstructor (c$, +function (a, b, c) { +Clazz.superConstructor (this, jalview.bin.JalviewLite.LoadingThread, []); +this._file = a; +this._file2 = b; +this.applet = c; +}, "~S,~S,jalview.bin.JalviewLite"); +Clazz.overrideMethod (c$, "run", +function () { +{ +System.out.println("BYPASSING JMOL LOADING FOR NOW. THIS WILL BE DONE ANOTHER WAY") +}this.startLoading (); +}); +Clazz.defineMethod (c$, "startLoading", +($fz = function () { +this.dbgMsg ("Loading thread started with:\n>>file\n" + this._file + ">>endfile"); +this.dbgMsg ("Loading started."); +var a = this.readAlignment (this._file); +var b = this.readAlignment (this._file2); +if (a != null) { +this.addToDisplay (a, b); +this.loadTree (a); +this.loadScoreFile (a); +this.loadFeatures (a); +this.loadAnnotations (a); +this.loadJnetFile (a); +this.loadPdbFiles (a); +} else { +this.b$["jalview.bin.JalviewLite"].fileFound = false; +this.applet.remove (this.b$["jalview.bin.JalviewLite"].launcher); +this.applet.repaint (); +}this.b$["jalview.bin.JalviewLite"].callInitCallback (); +}, $fz.isPrivate = true, $fz)); +Clazz.defineMethod (c$, "addToDisplay", +function (a, b) { +if (b == null) { +a.addToDisplay (this.b$["jalview.bin.JalviewLite"].embedded); +} else { +var c = new jalview.appletgui.SplitFrame (a, b); +c.addToDisplay (this.b$["jalview.bin.JalviewLite"].embedded, this.b$["jalview.bin.JalviewLite"]); +}}, "jalview.appletgui.AlignFrame,jalview.appletgui.AlignFrame"); +Clazz.defineMethod (c$, "readAlignment", +function (a) { +if (a == null) { +return null; +}var b = this.setProtocolState (a); +var c = new jalview.io.IdentifyFile ().Identify (b, this.protocol); +this.dbgMsg ("File identified as '" + c + "'"); +var d = null; +try { +d = new jalview.io.AppletFormatAdapter ().readFile (b, this.protocol, c); +if ((d != null) && (d.getHeight () > 0)) { +this.dbgMsg ("Successfully loaded file."); +d.setDataset (null); +var e = new jalview.appletgui.AlignFrame (d, this.applet, b, this.b$["jalview.bin.JalviewLite"].embedded, false); +e.setTitle (b); +if (this.b$["jalview.bin.JalviewLite"].initialAlignFrame == null) { +this.b$["jalview.bin.JalviewLite"].initialAlignFrame = e; +}this.b$["jalview.bin.JalviewLite"].currentAlignFrame = e; +if (this.protocol === jalview.io.AppletFormatAdapter.PASTE) { +e.setTitle (jalview.util.MessageManager.formatMessage ("label.sequences_from", Clazz.newArray (-1, [this.applet.getDocumentBase ().toString ()]))); +}e.setStatus (jalview.util.MessageManager.formatMessage ("label.successfully_loaded_file", Clazz.newArray (-1, [b]))); +return e; +}} catch (ex) { +if (Clazz.exceptionOf (ex, java.io.IOException)) { +this.dbgMsg ("File load exception."); +ex.printStackTrace (); +if (jalview.bin.JalviewLite.debug) { +try { +var e = new jalview.io.FileParse (b, this.protocol); +var f = null; +this.dbgMsg (">>>Dumping contents of '" + b + "' " + "(" + this.protocol + ")"); +while ((f = e.nextLine ()) != null) { +this.dbgMsg (f); +} +this.dbgMsg (">>>Dump finished."); +} catch (e) { +if (Clazz.exceptionOf (e, Exception)) { +System.err.println ("Exception when trying to dump the content of the file parameter."); +e.printStackTrace (); +} else { +throw e; +} +} +}} else { +throw ex; +} +} +return null; +}, "~S"); +Clazz.defineMethod (c$, "loadPdbFiles", +function (a) { +var b = false; +this.applet.setAlignPdbStructures (this.b$["jalview.bin.JalviewLite"].getDefaultParameter ("alignpdbfiles", false)); +var c = 0; +var d = new java.util.Vector (); +var e = (this.applet.getDefaultParameter ("relaxedidmatch", false)) ? new jalview.analysis.SequenceIdMatcher (a.getAlignViewport ().getAlignment ().getSequencesArray ()) : null; +var f; +do { +if (c > 0) { +f = this.applet.getParameter ("PDBFILE" + c); +} else { +f = this.b$["jalview.bin.JalviewLite"].pdbFile; +}if (f != null) { +var g = new jalview.datamodel.PDBEntry (); +var h; +var i = null; +var j = null; +var k = new java.util.StringTokenizer (f, " "); +if (k.countTokens () < 2) { +if (this.b$["jalview.bin.JalviewLite"].sequence != null) { +i = Clazz.newArray (-1, [e == null ? a.getAlignViewport ().getAlignment ().findName (this.b$["jalview.bin.JalviewLite"].sequence) : e.findIdMatch (this.b$["jalview.bin.JalviewLite"].sequence)]); +}} else { +f = k.nextToken (); +var l = new java.util.Vector (); +var m = new java.util.Vector (); +while (k.hasMoreTokens ()) { +h = k.nextToken (); +var n = new java.util.StringTokenizer (h, "="); +if (n.countTokens () > 1) { +m.addElement (n.nextToken ()); +h = n.nextToken (); +}l.addElement (e == null ? a.getAlignViewport ().getAlignment ().findName (h) : e.findIdMatch (h)); +} +i = new Array (l.size ()); +l.copyInto (i); +if (m.size () == l.size ()) { +j = new Array (m.size ()); +m.copyInto (j); +}}f = this.setProtocolState (f); +if (this.protocol === jalview.io.AppletFormatAdapter.CLASSLOADER && !this.b$["jalview.bin.JalviewLite"].useXtrnalSviewer) { +this.protocol = jalview.io.AppletFormatAdapter.URL; +f = this.addProtocol (f); +}g.setFile (f); +if (i != null) { +for (var l = 0; l < i.length; l++) { +if (i[l] != null) { +(i[l]).addPDBId (g); +jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.applet).registerPDBEntry (g); +} else { +if (jalview.bin.JalviewLite.debug) { +System.err.println ("Warning: Possible input parsing error: Null sequence for attachment of PDB (sequence " + l + ")"); +}}} +if (!this.b$["jalview.bin.JalviewLite"].alignPdbStructures) { +a.newStructureView (this.applet, g, i, j, this.protocol); +} else { +d.addElement ( Clazz.newArray (-1, [g, i, j, String.instantialize (this.protocol)])); +}}}c++; +} while (f != null || c < 10); +if (d.size () > 0) { +var g = new Array (d.size ()); +var h = new Array (d.size ()); +var i = new Array (d.size ()); +var j = new Array (d.size ()); +for (var k = 0, l = d.size (); k < l; k++) { +var m = d.elementAt (k); +h[k] = m[0]; +g[k] = m[1]; +i[k] = m[2]; +j[k] = m[3]; +} +a.alignedStructureView (this.applet, h, g, i, j); +b = true; +}return b; +}, "jalview.appletgui.AlignFrame"); +Clazz.defineMethod (c$, "loadJnetFile", +function (a) { +var b = false; +var c = this.b$["jalview.bin.JalviewLite"].jnetFile; +if (c != null) { +try { +c = this.setProtocolState (c); +var d = jalview.jsdev.GenericFileAdapter.getFile ("JPredFile", [c, this.protocol]); +jalview.io.JnetAnnotationMaker.add_annotation (d, a.viewport.getAlignment (), 0, false); +var e = a.viewport.getAlignment ().getSequenceAt (0); +a.viewport.getAlignment ().setSeqrep (e); +var f = new jalview.datamodel.ColumnSelection (); +f.hideInsertionsFor (e); +a.viewport.setColumnSelection (f); +a.alignPanel.fontChanged (); +a.alignPanel.setScrollValues (0, 0); +b = true; +} catch (ex) { +if (Clazz.exceptionOf (ex, Exception)) { +ex.printStackTrace (); +} else { +throw ex; +} +} +}return b; +}, "jalview.appletgui.AlignFrame"); +Clazz.defineMethod (c$, "loadAnnotations", +function (a) { +var b = false; +var c = this.b$["jalview.bin.JalviewLite"].annotations; +if (c != null) { +c = this.setProtocolState (c); +if ( new jalview.io.AnnotationFile ().annotateAlignmentView (a.viewport, c, this.protocol)) { +a.alignPanel.fontChanged (); +a.alignPanel.setScrollValues (0, 0); +b = true; +} else { +System.err.println ("Annotations were not added from annotation file '" + c + "'"); +}}return b; +}, "jalview.appletgui.AlignFrame"); +Clazz.defineMethod (c$, "loadFeatures", +function (a) { +var b = false; +var c = this.b$["jalview.bin.JalviewLite"].hideFeatureGroups; +if (c != null) { +a.setFeatureGroupState (this.b$["jalview.bin.JalviewLite"].separatorListToArray (c), false); +}c = this.b$["jalview.bin.JalviewLite"].showFeatureGroups; +if (c != null) { +a.setFeatureGroupState (this.b$["jalview.bin.JalviewLite"].separatorListToArray (c), true); +}c = this.b$["jalview.bin.JalviewLite"].features; +if (c != null) { +c = this.setProtocolState (c); +b = a.parseFeaturesFile (c, this.protocol); +}c = this.b$["jalview.bin.JalviewLite"].showFeatureSettings; +if (c != null && c.equalsIgnoreCase ("true")) { +a.viewport.setShowSequenceFeatures (true); + new jalview.appletgui.FeatureSettings (a.alignPanel); +}return b; +}, "jalview.appletgui.AlignFrame"); +Clazz.defineMethod (c$, "loadScoreFile", +function (a) { +var b = false; +if (this.b$["jalview.bin.JalviewLite"].scoreFile != null && !"".equals (this.b$["jalview.bin.JalviewLite"].scoreFile)) { +try { +if (jalview.bin.JalviewLite.debug) { +System.err.println ("Attempting to load T-COFFEE score file from the scoreFile parameter"); +}b = a.loadScoreFile (this.b$["jalview.bin.JalviewLite"].scoreFile); +if (!b) { +System.err.println ("Failed to parse T-COFFEE parameter as a valid score file ('" + this.b$["jalview.bin.JalviewLite"].scoreFile + "')"); +}} catch (e) { +if (Clazz.exceptionOf (e, Exception)) { +System.err.printf ("Cannot read score file: '%s'. Cause: %s \n", [this.b$["jalview.bin.JalviewLite"].scoreFile, e.getMessage ()]); +} else { +throw e; +} +} +}return b; +}, "jalview.appletgui.AlignFrame"); +Clazz.defineMethod (c$, "loadTree", +function (a) { +var b = false; +if (this.b$["jalview.bin.JalviewLite"].treeFile == null) { +this.b$["jalview.bin.JalviewLite"].treeFile = this.applet.getParameter ("treeFile"); +}if (this.b$["jalview.bin.JalviewLite"].treeFile != null) { +try { +this.b$["jalview.bin.JalviewLite"].treeFile = this.setProtocolState (this.b$["jalview.bin.JalviewLite"].treeFile); +var c = new jalview.io.NewickFile (this.b$["jalview.bin.JalviewLite"].treeFile, this.protocol); +c.parse (); +if (c.getTree () != null) { +a.loadTree (c, this.b$["jalview.bin.JalviewLite"].treeFile); +b = true; +this.dbgMsg ("Successfully imported tree."); +} else { +this.dbgMsg ("Tree parameter did not resolve to a valid tree."); +}} catch (ex) { +if (Clazz.exceptionOf (ex, Exception)) { +ex.printStackTrace (); +} else { +throw ex; +} +} +}return b; +}, "jalview.appletgui.AlignFrame"); +Clazz.defineMethod (c$, "inArchive", +function (a) { +try { +var b = (this.getClass ().getResourceAsStream ("/" + a) != null); +if (jalview.bin.JalviewLite.debug) { +System.err.println ("Resource '" + a + "' was " + (b ? "" : "not") + " located by classloader."); +}return b; +} catch (ex) { +if (Clazz.exceptionOf (ex, Exception)) { +System.out.println ("Exception checking resources: " + a + " " + ex); +return false; +} else { +throw ex; +} +} +}, "~S"); +Clazz.defineMethod (c$, "addProtocol", +function (a) { +if (a.indexOf ("://") == -1) { +var b = this.applet.resolveUrlForLocalOrAbsolute (a, this.b$["jalview.bin.JalviewLite"].getDocumentBase ()); +if (this.urlExists (b)) { +if (jalview.bin.JalviewLite.debug) { +System.err.println ("Prepended document base for resource: '" + a + "'"); +}return b; +}b = this.applet.resolveUrlForLocalOrAbsolute (a, this.b$["jalview.bin.JalviewLite"].getCodeBase ()); +if (this.urlExists (b)) { +if (jalview.bin.JalviewLite.debug) { +System.err.println ("Prepended codebase for resource: '" + a + "'"); +}return b; +}}return a; +}, "~S"); +Clazz.defineMethod (c$, "urlExists", +($fz = function (a) { +var b = null; +try { +b = new java.net.URL (a).openStream (); +if (b != null) { +return true; +}} catch (x) { +if (Clazz.exceptionOf (x, Exception)) { +} else { +throw x; +} +} finally { +if (b != null) { +try { +b.close (); +} catch (e) { +if (Clazz.exceptionOf (e, java.io.IOException)) { +} else { +throw e; +} +} +}} +return false; +}, $fz.isPrivate = true, $fz), "~S"); +c$ = Clazz.p0p (); +}; +c$.$JalviewLite$1$ = function () { +Clazz.pu$h (); +c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$1", null, Runnable); +Clazz.overrideMethod (c$, "run", +function () { +jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.f$.me).mouseOverVamsasSequence (this.f$.sq, this.f$.sq.findIndex (this.f$.pos), null); +}); +c$ = Clazz.p0p (); +}; +c$.$JalviewLite$2$ = function () { +Clazz.pu$h (); +c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$2", null, Runnable); +Clazz.overrideMethod (c$, "run", +function () { +jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.f$.me).mouseOverVamsasSequence (this.f$.sq, this.f$.pos, null); +}); +c$ = Clazz.p0p (); +}; +c$.$JalviewLite$3$ = function () { +Clazz.pu$h (); +c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$3", null, Runnable); +Clazz.overrideMethod (c$, "run", +function () { +this.f$.alf.select (this.f$.sel, this.f$.csel); +}); +c$ = Clazz.p0p (); +}; +c$.$JalviewLite$4$ = function () { +Clazz.pu$h (); +c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$4", null, Runnable); +Clazz.overrideMethod (c$, "run", +function () { +try { +jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.f$.me).mouseOverStructure ( new Integer (this.f$.pdbResNum).intValue (), this.f$.chain, this.f$.pdbfile); +if (jalview.bin.JalviewLite.debug) { +System.err.println ("mouseOver for '" + this.f$.pdbResNum + "' in chain '" + this.f$.chain + "' in structure '" + this.f$.pdbfile + "'"); +}} catch (e) { +if (Clazz.exceptionOf (e, NumberFormatException)) { +System.err.println ("Ignoring invalid residue number string '" + this.f$.pdbResNum + "'"); +} else { +throw e; +} +} +}); +c$ = Clazz.p0p (); +}; +c$.$JalviewLite$5$ = function () { +Clazz.pu$h (); +c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$5", null, Runnable); +Clazz.overrideMethod (c$, "run", +function () { +try { +this.f$.alf.scrollTo ( new Integer (this.f$.topRow).intValue (), new Integer (this.f$.leftHandColumn).intValue ()); +} catch (ex) { +if (Clazz.exceptionOf (ex, Exception)) { +System.err.println ("Couldn't parse integer arguments (topRow='" + this.f$.topRow + "' and leftHandColumn='" + this.f$.leftHandColumn + "')"); +ex.printStackTrace (); +} else { +throw ex; +} +} +}); +c$ = Clazz.p0p (); +}; +c$.$JalviewLite$6$ = function () { +Clazz.pu$h (); +c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$6", null, Runnable); +Clazz.overrideMethod (c$, "run", +function () { +try { +this.f$.alf.scrollToRow ( new Integer (this.f$.topRow).intValue ()); +} catch (ex) { +if (Clazz.exceptionOf (ex, Exception)) { +System.err.println ("Couldn't parse integer arguments (topRow='" + this.f$.topRow + "')"); +ex.printStackTrace (); +} else { +throw ex; +} +} +}); +c$ = Clazz.p0p (); +}; +c$.$JalviewLite$7$ = function () { +Clazz.pu$h (); +c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$7", null, Runnable); +Clazz.overrideMethod (c$, "run", +function () { +try { +this.f$.alf.scrollToColumn ( new Integer (this.f$.leftHandColumn).intValue ()); +} catch (ex) { +if (Clazz.exceptionOf (ex, Exception)) { +System.err.println ("Couldn't parse integer arguments (leftHandColumn='" + this.f$.leftHandColumn + "')"); +ex.printStackTrace (); +} else { +throw ex; +} +} +}); +c$ = Clazz.p0p (); +}; +c$.$JalviewLite$8$ = function () { +Clazz.pu$h (); +c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$8", null, java.awt.event.ActionListener); +Clazz.overrideMethod (c$, "actionPerformed", +function (e) { +var loader = Clazz.innerTypeInstance (jalview.bin.JalviewLite.LoadingThread, this, null, this.b$["jalview.bin.JalviewLite"].startupFile, this.b$["jalview.bin.JalviewLite"].file2, this.b$["jalview.bin.JalviewLite"]); +loader.start (); +}, "java.awt.event.ActionEvent"); +c$ = Clazz.p0p (); +}; +c$.$JalviewLite$9$ = function () { +Clazz.pu$h (); +c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$9", java.awt.event.WindowAdapter); +Clazz.overrideMethod (c$, "windowClosing", +function (e) { +if (Clazz.instanceOf (this.f$.frame, jalview.appletgui.AlignFrame)) { +var vp = (this.f$.frame).viewport; +(this.f$.frame).closeMenuItem_actionPerformed (); +if (vp.applet.currentAlignFrame === this.f$.frame) { +vp.applet.currentAlignFrame = null; +}vp.applet = null; +vp = null; +}jalview.bin.JalviewLite.lastFrameX -= 40; +jalview.bin.JalviewLite.lastFrameY -= 40; +if (Clazz.instanceOf (this.f$.frame, jalview.appletgui.EmbmenuFrame)) { +(this.f$.frame).destroyMenus (); +}this.f$.frame.setMenuBar (null); +this.f$.frame.dispose (); +}, "java.awt.event.WindowEvent"); +Clazz.defineMethod (c$, "windowActivated", +function (e) { +if (Clazz.instanceOf (this.f$.frame, jalview.appletgui.AlignFrame)) { +(this.f$.frame).viewport.applet.currentAlignFrame = this.f$.frame; +if (jalview.bin.JalviewLite.debug) { +System.err.println ("Activated window " + this.f$.frame); +}}Clazz.superCall (this, jalview.bin.JalviewLite$9, "windowActivated", [e]); +}, "java.awt.event.WindowEvent"); +c$ = Clazz.p0p (); +}; +c$.$JalviewLite$10$ = function () { +Clazz.pu$h (); +c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$10", null, Runnable); +Clazz.overrideMethod (c$, "run", +function () { +this.f$.alf.setFeatureGroupState (this.b$["jalview.bin.JalviewLite"].separatorListToArray (this.f$.groups), this.f$.st); +}); +c$ = Clazz.p0p (); +}; +Clazz.defineStatics (c$, +"TRUE", "true", +"FALSE", "false", +"debug", false, +"lastFrameX", 200, +"lastFrameY", 200, +"builddate", null, +"version", null, +"installation", null); +});