1 Clazz.declarePackage ("jalview.bin");
2 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 () {
3 c$ = Clazz.decorateAsClass (function () {
5 this.enableSplitFrame = false;
6 this.showButton = true;
7 this.checkForJmol = true;
8 this.jalviewServletURL = null;
9 this.startupFile = "No file";
11 this.externalstructureviewer = null;
14 this.labelColour = null;
15 this.initjscallback = null;
19 this.annotations = null;
20 this.hideFeatureGroups = null;
21 this.showFeatureGroups = null;
23 this.showFeatureSettings = null;
24 this.scoreFile = null;
26 this.windowWidth = null;
27 this.windowHeight = null;
28 this.defaultColour = null;
31 this.centrecolumnlabels = null;
32 this.userDefinedColour = null;
33 this.widthScale = null;
34 this.heightScale = null;
35 this.upperCase = null;
37 this.javascriptListeners = null;
38 this.jsFunctionExec = null;
39 this.fileFound = true;
41 this.currentAlignFrame = null;
42 this.initialAlignFrame = null;
43 this.checkedForJmol = false;
44 this.jmolAvailable = false;
45 this.alignPdbStructures = false;
46 this.useXtrnalSviewer = false;
47 this.haveShownLoadMessage = false;
48 if (!Clazz.isClassDefined ("jalview.bin.JalviewLite.LoadJmolThread")) {
49 jalview.bin.JalviewLite.$JalviewLite$LoadJmolThread$ ();
51 if (!Clazz.isClassDefined ("jalview.bin.JalviewLite.LoadingThread")) {
52 jalview.bin.JalviewLite.$JalviewLite$LoadingThread$ ();
54 this.separator = "\u00ac";
55 this.jsfallbackEnabled = false;
57 this.jsmessages = null;
58 this.jsExecQueue = null;
59 Clazz.instantialize (this, arguments);
60 }, jalview.bin, "JalviewLite", javax.swing.JApplet, [jalview.api.StructureSelectionManagerProvider, jalview.javascript.JalviewLiteJsApi]);
61 Clazz.prepareFields (c$, function () {
62 this.javascriptListeners = new java.util.Vector ();
63 this.launcher = new javax.swing.JButton (jalview.util.MessageManager.getString ("label.start_jalview"));
64 this.jshashes = new java.util.Hashtable ();
65 this.jsmessages = new java.util.Hashtable ();
66 this.jsExecQueue = new java.util.Vector ();
68 Clazz.defineMethod (c$, "setParams",
70 jalview.bin.JalviewLite.debug = "true".equalsIgnoreCase (this.getParameter ("debug"));
71 this.enableSplitFrame = "true".equalsIgnoreCase (this.getParameter ("enableSplitFrame"));
72 this.embedded = "true".equalsIgnoreCase (this.getParameter ("embedded"));
73 this.showButton = !"false".equalsIgnoreCase (this.getParameter ("showbutton"));
74 this.jalviewServletURL = this.getParameter ("APPLICATION_URL");
75 this.startupFile = this.getParameter ("file");
76 this.helpUrl = this.getParameter ("jalviewhelpurl");
77 this.externalstructureviewer = this.getParameter ("externalstructureviewer");
78 this.checkForJmol = !"true".equals (this.getParameter ("nojmol"));
79 this.sep = this.getParameter ("separator");
80 this.rgb = this.getParameter ("RGB");
81 this.labelColour = this.getParameter ("label");
82 this.initjscallback = this.getParameter ("oninit");
83 this.pdbFile = this.getParameter ("PDBFILE");
84 this.sequence = this.getParameter ("PDBSEQ");
85 this.jnetFile = this.getParameter ("jnetfile");
86 this.annotations = this.getParameter ("annotations");
87 this.hideFeatureGroups = this.getParameter ("hidefeaturegroups");
88 this.showFeatureGroups = this.getParameter ("showfeaturegroups");
89 this.features = this.getParameter ("features");
90 this.showFeatureSettings = this.getParameter ("showFeatureSettings");
91 this.scoreFile = this.getParameter ("scoreFile");
92 this.treeFile = this.getParameter ("tree");
93 if (this.treeFile == null) this.treeFile = this.getParameter ("treeFile");
94 this.windowWidth = this.getParameter ("windowWidth");
95 this.windowHeight = this.getParameter ("windowHeight");
96 this.defaultColour = this.getParameter ("defaultColour");
97 this.sortBy = this.getParameter ("sortBy");
98 this.wrap = this.getParameter ("wrap");
99 this.centrecolumnlabels = this.getParameter ("centrecolumnlabels");
100 this.userDefinedColour = this.getParameter ("userDefinedColour");
101 this.widthScale = this.getParameter ("widthScale");
102 this.heightScale = this.getParameter ("heightScale");
103 this.upperCase = this.getParameter ("upperCase");
104 this.file2 = this.getParameter ("file2");
106 Clazz.defineMethod (c$, "getDefaultParameter",
107 function (name, def) {
109 if ((stn = this.getParameter (name)) == null) {
111 }if (stn.toLowerCase ().equals ("true")) {
115 Clazz.defineMethod (c$, "getLinkParams",
119 for (var i = 1; i < 10; i++) {
120 label = this.getParameter ("linkLabel_" + i);
121 url = this.getParameter ("linkURL_" + i);
122 if (label != null && url != null) {
123 links.addElement (label + "|" + url);
125 }, "java.util.Vector");
126 Clazz.defineMethod (c$, "getStructureSelectionManager",
128 return jalview.structure.StructureSelectionManager.getStructureSelectionManager (this);
130 Clazz.defineMethod (c$, "getSelectedSequences",
132 return this.getSelectedSequencesFrom (this.getDefaultTargetFrame ());
134 Clazz.defineMethod (c$, "getSelectedSequences",
136 return this.getSelectedSequencesFrom (this.getDefaultTargetFrame (), sep);
138 Clazz.defineMethod (c$, "getSelectedSequencesFrom",
140 return this.getSelectedSequencesFrom (alf, this.separator);
141 }, "jalview.appletgui.AlignFrame");
142 Clazz.defineMethod (c$, "getSelectedSequencesFrom",
143 function (alf, sep) {
144 var result = new StringBuffer ("");
145 if (sep == null || sep.length == 0) {
146 sep = this.separator;
147 }if (alf.viewport.getSelectionGroup () != null) {
148 var seqs = alf.viewport.getSelectionGroup ().getSequencesInOrder (alf.viewport.getAlignment ());
149 for (var i = 0; i < seqs.length; i++) {
150 result.append (seqs[i].getName ());
153 }return result.toString ();
154 }, "jalview.appletgui.AlignFrame,~S");
155 Clazz.overrideMethod (c$, "highlight",
156 function (sequenceId, position, alignedPosition) {
157 this.highlightIn (this.getDefaultTargetFrame (), sequenceId, position, alignedPosition);
159 Clazz.overrideMethod (c$, "highlightIn",
160 function (alf, sequenceId, position, alignedPosition) {
161 var matcher = new jalview.analysis.SequenceIdMatcher (alf.viewport.getAlignment ().getSequencesArray ());
162 var sq = matcher.findIdMatch (sequenceId);
166 apos = new Integer (position).intValue ();
169 if (Clazz.exceptionOf (ex, NumberFormatException)) {
177 if (alignedPosition != null && (alignedPosition.trim ().length == 0 || alignedPosition.toLowerCase ().indexOf ("false") > -1)) {
178 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))));
180 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))));
181 }}}, "jalview.appletgui.AlignFrame,~S,~S,~S");
182 Clazz.defineMethod (c$, "select",
183 function (sequenceIds, columns) {
184 this.selectIn (this.getDefaultTargetFrame (), sequenceIds, columns, this.separator);
186 Clazz.defineMethod (c$, "select",
187 function (sequenceIds, columns, sep) {
188 this.selectIn (this.getDefaultTargetFrame (), sequenceIds, columns, sep);
190 Clazz.defineMethod (c$, "selectIn",
191 function (alf, sequenceIds, columns) {
192 this.selectIn (alf, sequenceIds, columns, this.separator);
193 }, "jalview.appletgui.AlignFrame,~S,~S");
194 Clazz.defineMethod (c$, "selectIn",
195 function (alf, sequenceIds, columns, sep) {
196 if (sep == null || sep.length == 0) {
197 sep = this.separator;
199 if (jalview.bin.JalviewLite.debug) {
200 System.err.println ("Selecting region using separator string '" + this.separator + "'");
201 }}var ids = this.separatorListToArray (sequenceIds, sep);
202 var cols = this.separatorListToArray (columns, sep);
203 var sel = new jalview.datamodel.SequenceGroup ();
204 var csel = new jalview.datamodel.ColumnSelection ();
205 var al = alf.viewport.getAlignment ();
206 var matcher = new jalview.analysis.SequenceIdMatcher (alf.viewport.getAlignment ().getSequencesArray ());
208 var end = al.getWidth ();
209 var alw = al.getWidth ();
210 var seqsfound = true;
211 if (ids != null && ids.length > 0) {
213 for (var i = 0; i < ids.length; i++) {
214 if (ids[i].trim ().length == 0) {
216 }var sq = matcher.findIdMatch (ids[i]);
219 sel.addSequence (sq, false);
221 }var inseqpos = false;
222 if (cols != null && cols.length > 0) {
224 for (var i = 0; i < cols.length; i++) {
225 var cl = cols[i].trim ();
226 if (cl.length == 0) {
229 if ((p = cl.indexOf ("-")) > -1) {
233 from = new Integer (cl.substring (0, p)).intValue ();
236 if (Clazz.exceptionOf (ex, NumberFormatException)) {
237 System.err.println ("ERROR: Couldn't parse first integer in range element column selection string '" + cl + "' - format is 'from-to'");
244 to = new Integer (cl.substring (p + 1)).intValue ();
247 if (Clazz.exceptionOf (ex, NumberFormatException)) {
248 System.err.println ("ERROR: Couldn't parse second integer in range element column selection string '" + cl + "' - format is 'from-to'");
254 if (from >= 0 && to >= 0) {
268 }}for (var r = from; r <= to; r++) {
269 if (r >= 0 && r < alw) {
272 if (jalview.bin.JalviewLite.debug) {
273 System.err.println ("Range '" + cl + "' deparsed as [" + from + "," + to + "]");
275 System.err.println ("ERROR: Invalid Range '" + cl + "' deparsed as [" + from + "," + to + "]");
279 r = new Integer (cl).intValue ();
282 if (Clazz.exceptionOf (ex, NumberFormatException)) {
283 if (cl.toLowerCase ().equals ("sequence")) {
286 System.err.println ("ERROR: Couldn't parse integer from point selection element of column selection string '" + cl + "'");
292 if (r >= 0 && r <= alw) {
302 }}csel.addElement (r);
303 if (jalview.bin.JalviewLite.debug) {
304 System.err.println ("Point selection '" + cl + "' deparsed as [" + r + "]");
306 System.err.println ("ERROR: Invalid Point selection '" + cl + "' deparsed as [" + r + "]");
309 if (inseqpos && sel.getSize () > 0) {
310 var rs = sel.getSequenceAt (0);
311 start = rs.findIndex (start);
312 end = rs.findIndex (end);
314 var cs = csel.getSelected ();
316 for (var selectedCol, $selectedCol = cs.iterator (); $selectedCol.hasNext () && ((selectedCol = $selectedCol.next ()) || true);) {
317 csel.addElement (rs.findIndex ((selectedCol).intValue ()));
319 }}sel.setStartRes (start);
321 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))));
322 }}, "jalview.appletgui.AlignFrame,~S,~S,~S");
323 Clazz.overrideMethod (c$, "getSelectedSequencesAsAlignment",
324 function (format, suffix) {
325 return this.getSelectedSequencesAsAlignmentFrom (this.getDefaultTargetFrame (), format, suffix);
327 Clazz.overrideMethod (c$, "getSelectedSequencesAsAlignmentFrom",
328 function (alf, format, suffix) {
330 var seqlimits = suffix.equalsIgnoreCase ("true");
331 if (alf.viewport.getSelectionGroup () != null) {
332 var reply = new jalview.io.AppletFormatAdapter ().formatSequences (format, new jalview.datamodel.Alignment (alf.viewport.getSelectionAsNewSequence ()), seqlimits);
335 if (Clazz.exceptionOf (ex, Exception)) {
336 ex.printStackTrace ();
337 return "Error retrieving alignment in " + format + " format. ";
343 }, "jalview.appletgui.AlignFrame,~S,~S");
344 Clazz.overrideMethod (c$, "getAlignmentOrder",
346 return this.getAlignmentOrderFrom (this.getDefaultTargetFrame ());
348 Clazz.defineMethod (c$, "getAlignmentOrderFrom",
350 return this.getAlignmentOrderFrom (alf, this.separator);
351 }, "jalview.appletgui.AlignFrame");
352 Clazz.defineMethod (c$, "getAlignmentOrderFrom",
353 function (alf, sep) {
354 var alorder = alf.getAlignViewport ().getAlignment ();
355 var order = new Array (alorder.getHeight ());
356 for (var i = 0; i < order.length; i++) {
357 order[i] = alorder.getSequenceAt (i).getName ();
359 return this.arrayToSeparatorList (order);
360 }, "jalview.appletgui.AlignFrame,~S");
361 Clazz.defineMethod (c$, "orderBy",
362 function (order, undoName) {
363 return this.orderBy (order, undoName, this.separator);
365 Clazz.defineMethod (c$, "orderBy",
366 function (order, undoName, sep) {
367 return this.orderAlignmentBy (this.getDefaultTargetFrame (), order, undoName, sep);
369 Clazz.overrideMethod (c$, "orderAlignmentBy",
370 function (alf, order, undoName, sep) {
371 var ids = this.separatorListToArray (order, sep);
373 if (ids != null && ids.length > 0) {
374 var matcher = new jalview.analysis.SequenceIdMatcher (alf.viewport.getAlignment ().getSequencesArray ());
376 sqs = new Array (ids.length);
377 for (var i = 0; i < ids.length; i++) {
378 if (ids[i].trim ().length == 0) {
380 }var sq = matcher.findIdMatch (ids[i]);
385 var sqq = new Array (s);
386 System.arraycopy (sqs, 0, sqq, 0, s);
392 };var aorder = new jalview.datamodel.AlignmentOrder (sqs);
393 if (undoName != null && undoName.trim ().length == 0) {
395 }var _undoName = undoName;
396 return alf.sortBy (aorder, _undoName) ? "true" : "";
397 }, "jalview.appletgui.AlignFrame,~S,~S,~S");
398 Clazz.defineMethod (c$, "getAlignment",
400 return this.getAlignmentFrom (this.getDefaultTargetFrame (), format, "true");
402 Clazz.defineMethod (c$, "getAlignmentFrom",
403 function (alf, format) {
404 return this.getAlignmentFrom (alf, format, "true");
405 }, "jalview.appletgui.AlignFrame,~S");
406 Clazz.defineMethod (c$, "getAlignment",
407 function (format, suffix) {
408 return this.getAlignmentFrom (this.getDefaultTargetFrame (), format, suffix);
410 Clazz.defineMethod (c$, "getAlignmentFrom",
411 function (alf, format, suffix) {
413 var seqlimits = suffix.equalsIgnoreCase ("true");
414 var reply = new jalview.io.AppletFormatAdapter ().formatSequences (format, alf.viewport.getAlignment (), seqlimits);
417 if (Clazz.exceptionOf (ex, Exception)) {
418 ex.printStackTrace ();
419 return "Error retrieving alignment in " + format + " format. ";
424 }, "jalview.appletgui.AlignFrame,~S,~S");
425 Clazz.overrideMethod (c$, "loadAnnotation",
426 function (annotation) {
427 this.loadAnnotationFrom (this.getDefaultTargetFrame (), annotation);
429 Clazz.overrideMethod (c$, "loadAnnotationFrom",
430 function (alf, annotation) {
431 if ( new jalview.io.AnnotationFile ().annotateAlignmentView (alf.getAlignViewport (), annotation, jalview.io.AppletFormatAdapter.PASTE)) {
432 alf.alignPanel.fontChanged ();
433 alf.alignPanel.setScrollValues (0, 0);
435 alf.parseFeaturesFile (annotation, jalview.io.AppletFormatAdapter.PASTE);
436 }}, "jalview.appletgui.AlignFrame,~S");
437 Clazz.overrideMethod (c$, "loadFeatures",
438 function (features, autoenabledisplay) {
439 this.loadFeaturesFrom (this.getDefaultTargetFrame (), features, autoenabledisplay);
441 Clazz.overrideMethod (c$, "loadFeaturesFrom",
442 function (alf, features, autoenabledisplay) {
443 return alf.parseFeaturesFile (features, jalview.io.AppletFormatAdapter.PASTE, autoenabledisplay);
444 }, "jalview.appletgui.AlignFrame,~S,~B");
445 Clazz.overrideMethod (c$, "getFeatures",
447 return this.getFeaturesFrom (this.getDefaultTargetFrame (), format);
449 Clazz.overrideMethod (c$, "getFeaturesFrom",
450 function (alf, format) {
451 return alf.outputFeatures (false, format);
452 }, "jalview.appletgui.AlignFrame,~S");
453 Clazz.overrideMethod (c$, "getAnnotation",
455 return this.getAnnotationFrom (this.getDefaultTargetFrame ());
457 Clazz.overrideMethod (c$, "getAnnotationFrom",
459 return alf.outputAnnotations (false);
460 }, "jalview.appletgui.AlignFrame");
461 Clazz.defineMethod (c$, "newView",
463 return this.newViewFrom (this.getDefaultTargetFrame ());
465 Clazz.defineMethod (c$, "newView",
467 return this.newViewFrom (this.getDefaultTargetFrame (), name);
469 Clazz.defineMethod (c$, "newViewFrom",
471 return alf.newView (null);
472 }, "jalview.appletgui.AlignFrame");
473 Clazz.defineMethod (c$, "newViewFrom",
474 function (alf, name) {
475 return alf.newView (name);
476 }, "jalview.appletgui.AlignFrame,~S");
477 Clazz.overrideMethod (c$, "loadAlignment",
478 function (text, title) {
480 var format = new jalview.io.IdentifyFile ().Identify (text, jalview.io.AppletFormatAdapter.PASTE);
482 al = new jalview.io.AppletFormatAdapter ().readFile (text, jalview.io.AppletFormatAdapter.PASTE, format);
483 if (al.getHeight () > 0) {
484 return new jalview.appletgui.AlignFrame (al, this, title, false);
486 if (Clazz.exceptionOf (ex, java.io.IOException)) {
487 ex.printStackTrace ();
494 Clazz.defineMethod (c$, "setMouseoverListener",
495 function (listener) {
496 this.setMouseoverListener (this.currentAlignFrame, listener);
498 Clazz.defineMethod (c$, "setMouseoverListener",
499 function (af, listener) {
500 if (listener != null) {
501 listener = listener.trim ();
502 if (listener.length == 0) {
503 System.err.println ("jalview Javascript error: Ignoring empty function for mouseover listener.");
505 }}var mol = new jalview.javascript.MouseOverListener (this, af, listener);
506 this.javascriptListeners.addElement (mol);
507 jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).addStructureViewerListener (mol);
508 if (jalview.bin.JalviewLite.debug) {
509 System.err.println ("Added a mouseover listener for " + ((af == null) ? "All frames" : "Just views for " + af.getAlignViewport ().getSequenceSetId ()));
510 System.err.println ("There are now " + this.javascriptListeners.size () + " listeners in total.");
511 }}, "jalview.appletgui.AlignFrame,~S");
512 Clazz.defineMethod (c$, "setSelectionListener",
513 function (listener) {
514 this.setSelectionListener (null, listener);
516 Clazz.defineMethod (c$, "setSelectionListener",
517 function (af, listener) {
518 if (listener != null) {
519 listener = listener.trim ();
520 if (listener.length == 0) {
521 System.err.println ("jalview Javascript error: Ignoring empty function for selection listener.");
523 }}var mol = new jalview.javascript.JsSelectionSender (this, af, listener);
524 this.javascriptListeners.addElement (mol);
525 jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).addSelectionListener (mol);
526 if (jalview.bin.JalviewLite.debug) {
527 System.err.println ("Added a selection listener for " + ((af == null) ? "All frames" : "Just views for " + af.getAlignViewport ().getSequenceSetId ()));
528 System.err.println ("There are now " + this.javascriptListeners.size () + " listeners in total.");
529 }}, "jalview.appletgui.AlignFrame,~S");
530 Clazz.overrideMethod (c$, "setStructureListener",
531 function (listener, modelSet) {
532 if (listener != null) {
533 listener = listener.trim ();
534 if (listener.length == 0) {
535 System.err.println ("jalview Javascript error: Ignoring empty function for selection listener.");
537 }}var mol = new jalview.javascript.MouseOverStructureListener (this, listener, this.separatorListToArray (modelSet));
538 this.javascriptListeners.addElement (mol);
539 jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).addStructureViewerListener (mol);
540 if (jalview.bin.JalviewLite.debug) {
541 System.err.println ("Added a javascript structure viewer listener '" + listener + "'");
542 System.err.println ("There are now " + this.javascriptListeners.size () + " listeners in total.");
544 Clazz.overrideMethod (c$, "removeJavascriptListener",
545 function (af, listener) {
546 if (listener != null) {
547 listener = listener.trim ();
548 if (listener.length == 0) {
551 for (var ms = 0, msSize = this.javascriptListeners.size (); ms < msSize; ) {
552 var lstn = this.javascriptListeners.elementAt (ms);
554 if ((af == null || lstner.getAlignFrame () === af) && (listener == null || lstner.getListenerFunction ().equals (listener))) {
555 this.javascriptListeners.removeElement (lstner);
557 if (Clazz.instanceOf (lstner, jalview.structure.SelectionListener)) {
558 jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).removeSelectionListener (lstner);
560 jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).removeStructureViewerListener (lstner, null);
561 }rprt = jalview.bin.JalviewLite.debug;
562 if (jalview.bin.JalviewLite.debug) {
563 System.err.println ("Removed listener '" + listener + "'");
568 System.err.println ("There are now " + this.javascriptListeners.size () + " listeners in total.");
569 }}, "jalview.appletgui.AlignFrame,~S");
570 Clazz.overrideMethod (c$, "stop",
572 System.err.println ("Applet " + this.getName () + " stop().");
575 Clazz.overrideMethod (c$, "destroy",
577 System.err.println ("Applet " + this.getName () + " destroy().");
580 Clazz.defineMethod (c$, "tidyUp",
583 if (this.currentAlignFrame != null && this.currentAlignFrame.viewport != null && this.currentAlignFrame.viewport.applet != null) {
584 var av = this.currentAlignFrame.viewport;
585 this.currentAlignFrame.closeMenuItem_actionPerformed ();
587 this.currentAlignFrame = null;
588 }if (this.javascriptListeners != null) {
589 while (this.javascriptListeners.size () > 0) {
590 var mol = this.javascriptListeners.elementAt (0);
591 this.javascriptListeners.removeElement (mol);
592 if (Clazz.instanceOf (mol, jalview.structure.SelectionListener)) {
593 jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).removeSelectionListener (mol);
595 jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).removeStructureViewerListener (mol, null);
598 }if (this.jsFunctionExec != null) {
599 this.jsFunctionExec.stopQueue ();
600 this.jsFunctionExec.jvlite = null;
601 }this.initialAlignFrame = null;
602 this.jsFunctionExec = null;
603 this.javascriptListeners = null;
604 jalview.structure.StructureSelectionManager.release (this);
606 Clazz.overrideMethod (c$, "mouseOverStructure",
607 function (pdbResNum, chain, pdbfile) {
609 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))));
611 Clazz.overrideMethod (c$, "scrollViewToIn",
612 function (alf, topRow, leftHandColumn) {
613 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))));
614 }, "jalview.appletgui.AlignFrame,~S,~S");
615 Clazz.overrideMethod (c$, "scrollViewToRowIn",
616 function (alf, topRow) {
617 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))));
618 }, "jalview.appletgui.AlignFrame,~S");
619 Clazz.overrideMethod (c$, "scrollViewToColumnIn",
620 function (alf, leftHandColumn) {
621 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))));
622 }, "jalview.appletgui.AlignFrame,~S");
623 c$.initBuildDetails = Clazz.defineMethod (c$, "initBuildDetails",
625 if (jalview.bin.JalviewLite.builddate == null) {
626 jalview.bin.JalviewLite.builddate = "unknown";
627 jalview.bin.JalviewLite.version = "test";
628 jalview.bin.JalviewLite.installation = "Webstart";
629 var url = jalview.bin.JalviewLite.getResource ("/.build_properties");
632 var reader = new java.io.BufferedReader ( new java.io.InputStreamReader (url.openStream ()));
634 while ((line = reader.readLine ()) != null) {
635 if (line.indexOf ("VERSION") > -1) {
636 jalview.bin.JalviewLite.version = line.substring (line.indexOf ("=") + 1);
637 }if (line.indexOf ("BUILD_DATE") > -1) {
638 jalview.bin.JalviewLite.builddate = line.substring (line.indexOf ("=") + 1);
639 }if (line.indexOf ("INSTALLATION") > -1) {
640 jalview.bin.JalviewLite.installation = line.substring (line.indexOf ("=") + 1);
643 if (Clazz.exceptionOf (ex, Exception)) {
644 ex.printStackTrace ();
650 c$.getBuildDate = Clazz.defineMethod (c$, "getBuildDate",
652 jalview.bin.JalviewLite.initBuildDetails ();
653 return jalview.bin.JalviewLite.builddate;
655 c$.getInstallation = Clazz.defineMethod (c$, "getInstallation",
657 jalview.bin.JalviewLite.initBuildDetails ();
658 return jalview.bin.JalviewLite.installation;
660 c$.getVersion = Clazz.defineMethod (c$, "getVersion",
662 jalview.bin.JalviewLite.initBuildDetails ();
663 return jalview.bin.JalviewLite.version;
665 Clazz.overrideMethod (c$, "init",
669 if (jalview.bin.JalviewLite.debug) {
670 System.err.println ("Applet context is '" + this.getAppletContext ().getClass ().toString () + "'");
671 }var scriptObject = netscape.javascript.JSObject.getWindow (this);
672 if (jalview.bin.JalviewLite.debug && scriptObject != null) {
673 System.err.println ("Applet has Javascript callback support.");
675 if (Clazz.exceptionOf (ex, Exception)) {
676 System.err.println ("Warning: No JalviewLite javascript callbacks available.");
677 if (jalview.bin.JalviewLite.debug) {
678 ex.printStackTrace ();
683 if (jalview.bin.JalviewLite.debug) {
684 System.err.println ("JalviewLite Version " + jalview.bin.JalviewLite.getVersion ());
685 System.err.println ("Build Date : " + jalview.bin.JalviewLite.getBuildDate ());
686 System.err.println ("Installation : " + jalview.bin.JalviewLite.getInstallation ());
687 }if (this.externalstructureviewer != null) {
688 this.useXtrnalSviewer = this.externalstructureviewer.trim ().toLowerCase ().equals ("true");
689 }if (this.sep != null) {
690 if (this.sep.length > 0) {
691 this.separator = this.sep;
692 if (jalview.bin.JalviewLite.debug) {
693 System.err.println ("Separator set to '" + this.separator + "'");
695 throw new Error (jalview.util.MessageManager.getString ("error.invalid_separator_parameter"));
699 if (this.rgb != null) {
701 r = Integer.parseInt (this.rgb.substring (0, 2), 16);
702 g = Integer.parseInt (this.rgb.substring (2, 4), 16);
703 b = Integer.parseInt (this.rgb.substring (4, 6), 16);
705 if (Clazz.exceptionOf (ex, Exception)) {
713 }this.rgb = this.labelColour;
714 if (this.rgb != null) {
715 this.launcher.setLabel (this.rgb);
716 }this.setBackground ( new java.awt.Color (r, g, b));
717 if (this.startupFile == null) {
718 var data = new StringBuffer ("PASTE");
720 while ((this.startupFile = this.getParameter ("sequence" + i)) != null) {
721 data.append (this.startupFile.toString () + "\n");
724 if (data.length () > 5) {
725 this.startupFile = data.toString ();
726 }}if (!this.enableSplitFrame) {
728 }if (this.embedded) {
729 var loader = Clazz.innerTypeInstance (jalview.bin.JalviewLite.LoadingThread, this, null, this.startupFile, this.file2, this);
732 }} else if (this.startupFile != null) {
733 if (!this.showButton) {
734 var loader = Clazz.innerTypeInstance (jalview.bin.JalviewLite.LoadingThread, this, null, this.startupFile, this.file2, this);
737 this.add (this.launcher);
738 this.launcher.addActionListener (((Clazz.isClassDefined ("jalview.bin.JalviewLite$8") ? 0 : jalview.bin.JalviewLite.$JalviewLite$8$ ()), Clazz.innerTypeInstance (jalview.bin.JalviewLite$8, this, null)));
740 this.startupFile = "NO FILE";
741 this.fileFound = false;
742 this.callInitCallback ();
744 Clazz.defineMethod (c$, "initLiveConnect",
746 var notFailed = false;
748 while (!notFailed && tries < 10) {
750 System.err.println ("LiveConnect request thread going to sleep.");
752 Thread.sleep (700 * (1 + tries));
754 if (Clazz.exceptionOf (q, InterruptedException)) {
760 System.err.println ("LiveConnect request thread woken up.");
762 var scriptObject = netscape.javascript.JSObject.getWindow (this);
763 if (scriptObject.eval ("navigator") != null) {
766 if (Clazz.exceptionOf (jsex, Exception)) {
767 System.err.println ("Attempt " + tries + " to access LiveConnect javascript failed.");
774 Clazz.defineMethod (c$, "callInitCallback",
776 if (this.initjscallback == null) {
778 }this.initjscallback = this.initjscallback.trim ();
779 if (this.initjscallback.length > 0) {
780 var scriptObject = null;
782 scriptObject = netscape.javascript.JSObject.getWindow (this);
784 if (Clazz.exceptionOf (ex, Exception)) {
789 ;this.initLiveConnect ();
790 if (scriptObject != null) {
792 new jalview.javascript.JSFunctionExec (this).executeJavascriptFunction (true, this.initjscallback, null, "Calling oninit callback '" + this.initjscallback + "'.");
794 if (Clazz.exceptionOf (e, Exception)) {
795 System.err.println ("Exception when executing _oninit callback '" + this.initjscallback + "'.");
796 e.printStackTrace ();
802 System.err.println ("Not executing _oninit callback '" + this.initjscallback + "' - no scripting allowed.");
804 c$.addFrame = Clazz.defineMethod (c$, "addFrame",
805 function (frame, title, width, height) {
806 frame.setLocation (jalview.bin.JalviewLite.lastFrameX, jalview.bin.JalviewLite.lastFrameY);
807 jalview.bin.JalviewLite.lastFrameX += 40;
808 jalview.bin.JalviewLite.lastFrameY += 40;
809 frame.setSize (width, height);
810 frame.setTitle (title);
811 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))));
812 frame.setVisible (true);
813 }, "javax.swing.JFrame,~S,~N,~N");
814 Clazz.defineMethod (c$, "paintComponent",
816 if (!this.fileFound) {
817 g.setColor ( new java.awt.Color (200, 200, 200));
818 g.setColor (java.awt.Color.cyan);
819 g.fillRect (0, 0, this.getSize ().width, this.getSize ().height);
820 g.setColor (java.awt.Color.red);
821 g.drawString (jalview.util.MessageManager.getString ("label.jalview_cannot_open_file"), 5, 15);
822 g.drawString ("\"" + this.startupFile + "\"", 5, 30);
823 } else if (this.embedded && !this.haveShownLoadMessage) {
824 g.setColor (java.awt.Color.black);
825 g.setFont ( new java.awt.Font ("Arial", 1, 24));
826 g.drawString (jalview.util.MessageManager.getString ("label.jalview_applet"), 50, Clazz.doubleToInt (this.getSize ().height / 2) - 30);
827 g.drawString (jalview.util.MessageManager.getString ("label.loading_data") + "...", 50, Clazz.doubleToInt (this.getSize ().height / 2));
828 this.haveShownLoadMessage = true;
829 }}, "java.awt.Graphics");
830 Clazz.defineMethod (c$, "getAppletWindow",
832 var wnds = new java.util.Vector ();
833 var cmp = this.getComponents ();
835 for (var i = 0; i < cmp.length; i++) {
836 if (class1.isAssignableFrom (cmp[i].getClass ())) {
837 wnds.addElement (cmp);
841 Clazz.defineMethod (c$, "getDefaultTargetFrame",
843 if (this.currentAlignFrame != null) {
844 return this.currentAlignFrame;
845 }if (this.initialAlignFrame != null) {
846 return this.initialAlignFrame;
847 }System.err.println ("Implementation error: Jalview Applet API cannot work out which AlignFrame to use.");
850 Clazz.defineMethod (c$, "separatorListToArray",
852 return this.separatorListToArray (list, this.separator);
854 Clazz.defineMethod (c$, "separatorListToArray",
855 function (list, separator) {
856 var seplen = separator.length;
857 if (list == null || list.equals ("") || list.equals (separator)) {
859 }var jv = new java.util.Vector ();
862 while ((pos = list.indexOf (separator, cp)) > cp) {
863 jv.addElement (list.substring (cp, pos));
866 if (cp < list.length) {
867 var c = list.substring (cp);
868 if (!c.equals (separator)) {
870 }}if (jv.size () > 0) {
871 var v = new Array (jv.size ());
872 for (var i = 0; i < v.length; i++) {
873 v[i] = jv.elementAt (i);
875 jv.removeAllElements ();
876 if (jalview.bin.JalviewLite.debug) {
877 System.err.println ("Array from '" + separator + "' separated List:\n" + v.length);
878 for (var i = 0; i < v.length; i++) {
879 System.err.println ("item " + i + " '" + v[i] + "'");
882 }if (jalview.bin.JalviewLite.debug) {
883 System.err.println ("Empty Array from '" + separator + "' separated List");
886 Clazz.defineMethod (c$, "arrayToSeparatorList",
888 return this.arrayToSeparatorList (list, this.separator);
890 Clazz.defineMethod (c$, "arrayToSeparatorList",
891 function (list, separator) {
892 var v = new StringBuffer ();
893 if (list != null && list.length > 0) {
894 for (var i = 0, iSize = list.length; i < iSize; i++) {
895 if (list[i] != null) {
897 v.append (separator);
900 if (jalview.bin.JalviewLite.debug) {
901 System.err.println ("Returning '" + separator + "' separated List:\n");
902 System.err.println (v);
903 }return v.toString ();
904 }if (jalview.bin.JalviewLite.debug) {
905 System.err.println ("Returning empty '" + separator + "' separated List\n");
906 }return "" + separator;
908 Clazz.overrideMethod (c$, "getFeatureGroups",
910 var lst = this.arrayToSeparatorList (this.getDefaultTargetFrame ().getFeatureGroups ());
913 Clazz.overrideMethod (c$, "getFeatureGroupsOn",
915 var lst = this.arrayToSeparatorList (alf.getFeatureGroups ());
917 }, "jalview.appletgui.AlignFrame");
918 Clazz.overrideMethod (c$, "getFeatureGroupsOfState",
920 return this.arrayToSeparatorList (this.getDefaultTargetFrame ().getFeatureGroupsOfState (visible));
922 Clazz.overrideMethod (c$, "getFeatureGroupsOfStateOn",
923 function (alf, visible) {
924 return this.arrayToSeparatorList (alf.getFeatureGroupsOfState (visible));
925 }, "jalview.appletgui.AlignFrame,~B");
926 Clazz.overrideMethod (c$, "setFeatureGroupStateOn",
927 function (alf, groups, state) {
929 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))));
930 }, "jalview.appletgui.AlignFrame,~S,~B");
931 Clazz.overrideMethod (c$, "setFeatureGroupState",
932 function (groups, state) {
933 this.setFeatureGroupStateOn (this.getDefaultTargetFrame (), groups, state);
935 Clazz.overrideMethod (c$, "getSeparator",
937 return this.separator;
939 Clazz.overrideMethod (c$, "setSeparator",
940 function (separator) {
941 if (separator == null || separator.length < 1) {
942 separator = "\u00ac";
943 }this.separator = separator;
944 if (jalview.bin.JalviewLite.debug) {
945 System.err.println ("Default Separator now: '" + separator + "'");
947 Clazz.overrideMethod (c$, "addPdbFile",
948 function (alFrame, sequenceId, pdbEntryString, pdbFile) {
949 return alFrame.addPdbFile (sequenceId, pdbEntryString, pdbFile);
950 }, "jalview.appletgui.AlignFrame,~S,~S,~S");
951 Clazz.defineMethod (c$, "setAlignPdbStructures",
952 function (alignPdbStructures) {
953 this.alignPdbStructures = alignPdbStructures;
955 Clazz.defineMethod (c$, "isAlignPdbStructures",
957 return this.alignPdbStructures;
959 Clazz.overrideMethod (c$, "start",
962 Clazz.defineMethod (c$, "setJsMessageSet",
963 function (messageclass, viewId, colcommands) {
964 var msgset = this.jsmessages.get (messageclass);
965 if (msgset == null) {
966 msgset = new java.util.Hashtable ();
967 this.jsmessages.put (messageclass, msgset);
968 }msgset.put (viewId, colcommands);
969 var l = Clazz.newLongArray (colcommands.length, 0);
970 for (var i = 0; i < colcommands.length; i++) {
971 l[i] = colcommands[i].hashCode ();
973 this.jshashes.put (messageclass + "|" + viewId, l);
975 Clazz.overrideMethod (c$, "getJsMessage",
976 function (messageclass, viewId) {
977 var msgset = this.jsmessages.get (messageclass);
978 if (msgset != null) {
979 var msgs = msgset.get (viewId);
981 for (var i = 0; i < msgs.length; i++) {
982 if (msgs[i] != null) {
989 Clazz.defineMethod (c$, "isJsMessageSetChanged",
990 function (string, string2, colcommands) {
991 var l = this.jshashes.get (string + "|" + string2);
992 if (l == null && colcommands != null) {
994 }for (var i = 0; i < colcommands.length; i++) {
995 if (l[i] != colcommands[i].hashCode ()) {
1000 Clazz.defineMethod (c$, "getJsExecQueue",
1002 return this.jsExecQueue;
1004 Clazz.defineMethod (c$, "setExecutor",
1005 function (jsFunctionExec2) {
1006 this.jsFunctionExec = jsFunctionExec2;
1007 }, "jalview.javascript.JSFunctionExec");
1008 Clazz.defineMethod (c$, "getDefaultColourParameter",
1009 function (colparam, defcolour) {
1010 var colprop = this.getParameter (colparam);
1011 if (colprop == null || colprop.trim ().length == 0) {
1013 }var col = jalview.schemes.ColourSchemeProperty.getAWTColorFromName (colprop);
1016 col = new jalview.schemes.UserColourScheme (colprop).findColour ('A');
1018 if (Clazz.exceptionOf (ex, Exception)) {
1019 System.err.println ("Couldn't parse '" + colprop + "' as a colour for " + colparam);
1025 }return (col == null) ? defcolour : col;
1026 }, "~S,java.awt.Color");
1027 Clazz.defineMethod (c$, "openJalviewHelpUrl",
1029 if (this.helpUrl == null || this.helpUrl.trim ().length < 5) {
1030 this.helpUrl = "http://www.jalview.org/help.html";
1031 }this.showURL (this.helpUrl, "HELP");
1033 Clazz.defineMethod (c$, "resolveUrlForLocalOrAbsolute",
1034 function (url, localref) {
1035 var codebase = localref.toString ();
1036 var pt = codebase.indexOf ("?");
1037 if (pt < 0) pt = codebase.length;
1038 codebase = codebase.substring (0, pt);
1039 codebase = codebase.substring (0, codebase.lastIndexOf ("/") + 1);
1040 if (url.indexOf ("/") == 0 && !localref.getProtocol ().equals ("file")) {
1041 pt = codebase.indexOf ("/", 8);
1042 return codebase.substring (0, pt) + url;
1043 }return codebase + url;
1044 }, "~S,java.net.URL");
1045 Clazz.defineMethod (c$, "showURL",
1046 function (url, target) {
1048 if (url.indexOf (":") == -1) {
1050 url = this.resolveUrlForLocalOrAbsolute (url, prepend = this.getDefaultParameter ("resolvetocodebase", false) ? this.getDocumentBase () : this.getCodeBase ());
1051 if (jalview.bin.JalviewLite.debug) {
1052 System.err.println ("Show url (prepended " + prepend + " - toggle resolvetocodebase if code/docbase resolution is wrong): " + url);
1054 if (jalview.bin.JalviewLite.debug) {
1055 System.err.println ("Show url: " + url);
1056 }}if (url.indexOf ("javascript:") == 0) {
1057 this.getAppletContext ().showDocument ( new java.net.URL (url));
1059 this.getAppletContext ().showDocument ( new java.net.URL (url), target);
1061 if (Clazz.exceptionOf (ex, Exception)) {
1062 ex.printStackTrace ();
1068 c$.$JalviewLite$LoadJmolThread$ = function () {
1069 Clazz.pu$h(self.c$);
1070 c$ = Clazz.decorateAsClass (function () {
1071 Clazz.prepareCallback (this, arguments);
1072 this.running = false;
1073 Clazz.instantialize (this, arguments);
1074 }, jalview.bin.JalviewLite, "LoadJmolThread", Thread);
1075 Clazz.overrideMethod (c$, "run",
1077 if (this.running || this.b$["jalview.bin.JalviewLite"].checkedForJmol) {
1079 }this.running = true;
1080 if (this.b$["jalview.bin.JalviewLite"].checkForJmol) {
1082 if (!System.getProperty ("java.version").startsWith ("1.1")) {
1083 Clazz._4Name ("org.jmol.adapter.smarter.SmarterJmolAdapter");
1084 this.b$["jalview.bin.JalviewLite"].jmolAvailable = true;
1085 }if (!this.b$["jalview.bin.JalviewLite"].jmolAvailable) {
1086 System.out.println ("Jmol not available - Using MCview for structures");
1088 if (Clazz.exceptionOf (ex, ClassNotFoundException)) {
1094 this.b$["jalview.bin.JalviewLite"].jmolAvailable = false;
1095 if (jalview.bin.JalviewLite.debug) {
1096 System.err.println ("Skipping Jmol check. Will use MCView (probably)");
1097 }}this.b$["jalview.bin.JalviewLite"].checkedForJmol = true;
1098 this.running = false;
1100 Clazz.defineMethod (c$, "notFinished",
1102 return this.running || !this.b$["jalview.bin.JalviewLite"].checkedForJmol;
1106 c$.$JalviewLite$LoadingThread$ = function () {
1107 Clazz.pu$h(self.c$);
1108 c$ = Clazz.decorateAsClass (function () {
1109 Clazz.prepareCallback (this, arguments);
1110 this.protocol = null;
1114 Clazz.instantialize (this, arguments);
1115 }, jalview.bin.JalviewLite, "LoadingThread", Thread);
1116 Clazz.defineMethod (c$, "dbgMsg",
1118 if (jalview.bin.JalviewLite.debug) {
1119 System.err.println (a);
1121 Clazz.defineMethod (c$, "setProtocolState",
1123 if (a.startsWith ("PASTE")) {
1124 a = a.substring (5);
1125 this.protocol = jalview.io.AppletFormatAdapter.PASTE;
1126 } else if (this.inArchive (a)) {
1127 this.protocol = jalview.io.AppletFormatAdapter.CLASSLOADER;
1129 a = this.addProtocol (a);
1130 this.protocol = jalview.io.AppletFormatAdapter.URL;
1131 }this.dbgMsg ("Protocol identified as '" + this.protocol + "'");
1134 Clazz.makeConstructor (c$,
1135 function (a, b, c) {
1136 Clazz.superConstructor (this, jalview.bin.JalviewLite.LoadingThread, []);
1140 }, "~S,~S,jalview.bin.JalviewLite");
1141 Clazz.overrideMethod (c$, "run",
1144 System.out.println("BYPASSING JMOL LOADING FOR NOW. THIS WILL BE DONE ANOTHER WAY")
1145 }this.startLoading ();
1147 Clazz.defineMethod (c$, "startLoading",
1149 this.dbgMsg ("Loading thread started with:\n>>file\n" + this._file + ">>endfile");
1150 this.dbgMsg ("Loading started.");
1151 var a = this.readAlignment (this._file);
1152 var b = this.readAlignment (this._file2);
1154 this.addToDisplay (a, b);
1156 this.loadScoreFile (a);
1157 this.loadFeatures (a);
1158 this.loadAnnotations (a);
1159 this.loadJnetFile (a);
1160 this.loadPdbFiles (a);
1162 this.b$["jalview.bin.JalviewLite"].fileFound = false;
1163 this.applet.remove (this.b$["jalview.bin.JalviewLite"].launcher);
1164 this.applet.repaint ();
1165 }this.b$["jalview.bin.JalviewLite"].callInitCallback ();
1167 Clazz.defineMethod (c$, "addToDisplay",
1170 a.addToDisplay (this.b$["jalview.bin.JalviewLite"].embedded);
1172 var c = new jalview.appletgui.SplitFrame (a, b);
1173 c.addToDisplay (this.b$["jalview.bin.JalviewLite"].embedded, this.b$["jalview.bin.JalviewLite"]);
1174 }}, "jalview.appletgui.AlignFrame,jalview.appletgui.AlignFrame");
1175 Clazz.defineMethod (c$, "readAlignment",
1179 }var b = this.setProtocolState (a);
1180 var c = new jalview.io.IdentifyFile ().Identify (b, this.protocol);
1181 this.dbgMsg ("File identified as '" + c + "'");
1184 d = new jalview.io.AppletFormatAdapter ().readFile (b, this.protocol, c);
1185 if ((d != null) && (d.getHeight () > 0)) {
1186 this.dbgMsg ("Successfully loaded file.");
1187 d.setDataset (null);
1188 var e = new jalview.appletgui.AlignFrame (d, this.applet, b, this.b$["jalview.bin.JalviewLite"].embedded, false);
1190 if (this.b$["jalview.bin.JalviewLite"].initialAlignFrame == null) {
1191 this.b$["jalview.bin.JalviewLite"].initialAlignFrame = e;
1192 }this.b$["jalview.bin.JalviewLite"].currentAlignFrame = e;
1193 if (this.protocol === jalview.io.AppletFormatAdapter.PASTE) {
1194 e.setTitle (jalview.util.MessageManager.formatMessage ("label.sequences_from", Clazz.newArray (-1, [this.applet.getDocumentBase ().toString ()])));
1195 }e.setStatus (jalview.util.MessageManager.formatMessage ("label.successfully_loaded_file", Clazz.newArray (-1, [b])));
1198 if (Clazz.exceptionOf (ex, java.io.IOException)) {
1199 this.dbgMsg ("File load exception.");
1200 ex.printStackTrace ();
1201 if (jalview.bin.JalviewLite.debug) {
1203 var e = new jalview.io.FileParse (b, this.protocol);
1205 this.dbgMsg (">>>Dumping contents of '" + b + "' " + "(" + this.protocol + ")");
1206 while ((f = e.nextLine ()) != null) {
1209 this.dbgMsg (">>>Dump finished.");
1211 if (Clazz.exceptionOf (e, Exception)) {
1212 System.err.println ("Exception when trying to dump the content of the file parameter.");
1213 e.printStackTrace ();
1224 Clazz.defineMethod (c$, "loadPdbFiles",
1227 this.applet.setAlignPdbStructures (this.b$["jalview.bin.JalviewLite"].getDefaultParameter ("alignpdbfiles", false));
1229 var d = new java.util.Vector ();
1230 var e = (this.applet.getDefaultParameter ("relaxedidmatch", false)) ? new jalview.analysis.SequenceIdMatcher (a.getAlignViewport ().getAlignment ().getSequencesArray ()) : null;
1234 f = this.applet.getParameter ("PDBFILE" + c);
1236 f = this.b$["jalview.bin.JalviewLite"].pdbFile;
1238 var g = new jalview.datamodel.PDBEntry ();
1242 var k = new java.util.StringTokenizer (f, " ");
1243 if (k.countTokens () < 2) {
1244 if (this.b$["jalview.bin.JalviewLite"].sequence != null) {
1245 i = Clazz.newArray (-1, [e == null ? a.getAlignViewport ().getAlignment ().findName (this.b$["jalview.bin.JalviewLite"].sequence) : e.findIdMatch (this.b$["jalview.bin.JalviewLite"].sequence)]);
1248 var l = new java.util.Vector ();
1249 var m = new java.util.Vector ();
1250 while (k.hasMoreTokens ()) {
1252 var n = new java.util.StringTokenizer (h, "=");
1253 if (n.countTokens () > 1) {
1254 m.addElement (n.nextToken ());
1256 }l.addElement (e == null ? a.getAlignViewport ().getAlignment ().findName (h) : e.findIdMatch (h));
1258 i = new Array (l.size ());
1260 if (m.size () == l.size ()) {
1261 j = new Array (m.size ());
1263 }}f = this.setProtocolState (f);
1264 if (this.protocol === jalview.io.AppletFormatAdapter.CLASSLOADER && !this.b$["jalview.bin.JalviewLite"].useXtrnalSviewer) {
1265 this.protocol = jalview.io.AppletFormatAdapter.URL;
1266 f = this.addProtocol (f);
1269 for (var l = 0; l < i.length; l++) {
1271 (i[l]).addPDBId (g);
1272 jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.applet).registerPDBEntry (g);
1274 if (jalview.bin.JalviewLite.debug) {
1275 System.err.println ("Warning: Possible input parsing error: Null sequence for attachment of PDB (sequence " + l + ")");
1277 if (!this.b$["jalview.bin.JalviewLite"].alignPdbStructures) {
1278 a.newStructureView (this.applet, g, i, j, this.protocol);
1280 d.addElement ( Clazz.newArray (-1, [g, i, j, String.instantialize (this.protocol)]));
1282 } while (f != null || c < 10);
1283 if (d.size () > 0) {
1284 var g = new Array (d.size ());
1285 var h = new Array (d.size ());
1286 var i = new Array (d.size ());
1287 var j = new Array (d.size ());
1288 for (var k = 0, l = d.size (); k < l; k++) {
1289 var m = d.elementAt (k);
1295 a.alignedStructureView (this.applet, h, g, i, j);
1298 }, "jalview.appletgui.AlignFrame");
1299 Clazz.defineMethod (c$, "loadJnetFile",
1302 var c = this.b$["jalview.bin.JalviewLite"].jnetFile;
1305 c = this.setProtocolState (c);
1306 var d = jalview.jsdev.GenericFileAdapter.getFile ("JPredFile", [c, this.protocol]);
1307 jalview.io.JnetAnnotationMaker.add_annotation (d, a.viewport.getAlignment (), 0, false);
1308 var e = a.viewport.getAlignment ().getSequenceAt (0);
1309 a.viewport.getAlignment ().setSeqrep (e);
1310 var f = new jalview.datamodel.ColumnSelection ();
1311 f.hideInsertionsFor (e);
1312 a.viewport.setColumnSelection (f);
1313 a.alignPanel.fontChanged ();
1314 a.alignPanel.setScrollValues (0, 0);
1317 if (Clazz.exceptionOf (ex, Exception)) {
1318 ex.printStackTrace ();
1324 }, "jalview.appletgui.AlignFrame");
1325 Clazz.defineMethod (c$, "loadAnnotations",
1328 var c = this.b$["jalview.bin.JalviewLite"].annotations;
1330 c = this.setProtocolState (c);
1331 if ( new jalview.io.AnnotationFile ().annotateAlignmentView (a.viewport, c, this.protocol)) {
1332 a.alignPanel.fontChanged ();
1333 a.alignPanel.setScrollValues (0, 0);
1336 System.err.println ("Annotations were not added from annotation file '" + c + "'");
1338 }, "jalview.appletgui.AlignFrame");
1339 Clazz.defineMethod (c$, "loadFeatures",
1342 var c = this.b$["jalview.bin.JalviewLite"].hideFeatureGroups;
1344 a.setFeatureGroupState (this.b$["jalview.bin.JalviewLite"].separatorListToArray (c), false);
1345 }c = this.b$["jalview.bin.JalviewLite"].showFeatureGroups;
1347 a.setFeatureGroupState (this.b$["jalview.bin.JalviewLite"].separatorListToArray (c), true);
1348 }c = this.b$["jalview.bin.JalviewLite"].features;
1350 c = this.setProtocolState (c);
1351 b = a.parseFeaturesFile (c, this.protocol);
1352 }c = this.b$["jalview.bin.JalviewLite"].showFeatureSettings;
1353 if (c != null && c.equalsIgnoreCase ("true")) {
1354 a.viewport.setShowSequenceFeatures (true);
1355 new jalview.appletgui.FeatureSettings (a.alignPanel);
1357 }, "jalview.appletgui.AlignFrame");
1358 Clazz.defineMethod (c$, "loadScoreFile",
1361 if (this.b$["jalview.bin.JalviewLite"].scoreFile != null && !"".equals (this.b$["jalview.bin.JalviewLite"].scoreFile)) {
1363 if (jalview.bin.JalviewLite.debug) {
1364 System.err.println ("Attempting to load T-COFFEE score file from the scoreFile parameter");
1365 }b = a.loadScoreFile (this.b$["jalview.bin.JalviewLite"].scoreFile);
1367 System.err.println ("Failed to parse T-COFFEE parameter as a valid score file ('" + this.b$["jalview.bin.JalviewLite"].scoreFile + "')");
1369 if (Clazz.exceptionOf (e, Exception)) {
1370 System.err.printf ("Cannot read score file: '%s'. Cause: %s \n", [this.b$["jalview.bin.JalviewLite"].scoreFile, e.getMessage ()]);
1376 }, "jalview.appletgui.AlignFrame");
1377 Clazz.defineMethod (c$, "loadTree",
1380 if (this.b$["jalview.bin.JalviewLite"].treeFile == null) {
1381 this.b$["jalview.bin.JalviewLite"].treeFile = this.applet.getParameter ("treeFile");
1382 }if (this.b$["jalview.bin.JalviewLite"].treeFile != null) {
1384 this.b$["jalview.bin.JalviewLite"].treeFile = this.setProtocolState (this.b$["jalview.bin.JalviewLite"].treeFile);
1385 var c = new jalview.io.NewickFile (this.b$["jalview.bin.JalviewLite"].treeFile, this.protocol);
1387 if (c.getTree () != null) {
1388 a.loadTree (c, this.b$["jalview.bin.JalviewLite"].treeFile);
1390 this.dbgMsg ("Successfully imported tree.");
1392 this.dbgMsg ("Tree parameter did not resolve to a valid tree.");
1394 if (Clazz.exceptionOf (ex, Exception)) {
1395 ex.printStackTrace ();
1401 }, "jalview.appletgui.AlignFrame");
1402 Clazz.defineMethod (c$, "inArchive",
1405 var b = (this.getClass ().getResourceAsStream ("/" + a) != null);
1406 if (jalview.bin.JalviewLite.debug) {
1407 System.err.println ("Resource '" + a + "' was " + (b ? "" : "not") + " located by classloader.");
1410 if (Clazz.exceptionOf (ex, Exception)) {
1411 System.out.println ("Exception checking resources: " + a + " " + ex);
1418 Clazz.defineMethod (c$, "addProtocol",
1420 if (a.indexOf ("://") == -1) {
1421 var b = this.applet.resolveUrlForLocalOrAbsolute (a, this.b$["jalview.bin.JalviewLite"].getDocumentBase ());
1422 if (this.urlExists (b)) {
1423 if (jalview.bin.JalviewLite.debug) {
1424 System.err.println ("Prepended document base for resource: '" + a + "'");
1426 }b = this.applet.resolveUrlForLocalOrAbsolute (a, this.b$["jalview.bin.JalviewLite"].getCodeBase ());
1427 if (this.urlExists (b)) {
1428 if (jalview.bin.JalviewLite.debug) {
1429 System.err.println ("Prepended codebase for resource: '" + a + "'");
1433 Clazz.defineMethod (c$, "urlExists",
1437 b = new java.net.URL (a).openStream ();
1441 if (Clazz.exceptionOf (x, Exception)) {
1450 if (Clazz.exceptionOf (e, java.io.IOException)) {
1460 c$.$JalviewLite$1$ = function () {
1461 Clazz.pu$h(self.c$);
1462 c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$1", null, Runnable);
1463 Clazz.overrideMethod (c$, "run",
1465 jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.f$.me).mouseOverVamsasSequence (this.f$.sq, this.f$.sq.findIndex (this.f$.pos), null);
1469 c$.$JalviewLite$2$ = function () {
1470 Clazz.pu$h(self.c$);
1471 c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$2", null, Runnable);
1472 Clazz.overrideMethod (c$, "run",
1474 jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.f$.me).mouseOverVamsasSequence (this.f$.sq, this.f$.pos, null);
1478 c$.$JalviewLite$3$ = function () {
1479 Clazz.pu$h(self.c$);
1480 c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$3", null, Runnable);
1481 Clazz.overrideMethod (c$, "run",
1483 this.f$.alf.select (this.f$.sel, this.f$.csel);
1487 c$.$JalviewLite$4$ = function () {
1488 Clazz.pu$h(self.c$);
1489 c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$4", null, Runnable);
1490 Clazz.overrideMethod (c$, "run",
1493 jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.f$.me).mouseOverStructure ( new Integer (this.f$.pdbResNum).intValue (), this.f$.chain, this.f$.pdbfile);
1494 if (jalview.bin.JalviewLite.debug) {
1495 System.err.println ("mouseOver for '" + this.f$.pdbResNum + "' in chain '" + this.f$.chain + "' in structure '" + this.f$.pdbfile + "'");
1497 if (Clazz.exceptionOf (e, NumberFormatException)) {
1498 System.err.println ("Ignoring invalid residue number string '" + this.f$.pdbResNum + "'");
1506 c$.$JalviewLite$5$ = function () {
1507 Clazz.pu$h(self.c$);
1508 c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$5", null, Runnable);
1509 Clazz.overrideMethod (c$, "run",
1512 this.f$.alf.scrollTo ( new Integer (this.f$.topRow).intValue (), new Integer (this.f$.leftHandColumn).intValue ());
1514 if (Clazz.exceptionOf (ex, Exception)) {
1515 System.err.println ("Couldn't parse integer arguments (topRow='" + this.f$.topRow + "' and leftHandColumn='" + this.f$.leftHandColumn + "')");
1516 ex.printStackTrace ();
1524 c$.$JalviewLite$6$ = function () {
1525 Clazz.pu$h(self.c$);
1526 c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$6", null, Runnable);
1527 Clazz.overrideMethod (c$, "run",
1530 this.f$.alf.scrollToRow ( new Integer (this.f$.topRow).intValue ());
1532 if (Clazz.exceptionOf (ex, Exception)) {
1533 System.err.println ("Couldn't parse integer arguments (topRow='" + this.f$.topRow + "')");
1534 ex.printStackTrace ();
1542 c$.$JalviewLite$7$ = function () {
1543 Clazz.pu$h(self.c$);
1544 c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$7", null, Runnable);
1545 Clazz.overrideMethod (c$, "run",
1548 this.f$.alf.scrollToColumn ( new Integer (this.f$.leftHandColumn).intValue ());
1550 if (Clazz.exceptionOf (ex, Exception)) {
1551 System.err.println ("Couldn't parse integer arguments (leftHandColumn='" + this.f$.leftHandColumn + "')");
1552 ex.printStackTrace ();
1560 c$.$JalviewLite$8$ = function () {
1561 Clazz.pu$h(self.c$);
1562 c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$8", null, java.awt.event.ActionListener);
1563 Clazz.overrideMethod (c$, "actionPerformed",
1565 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"]);
1567 }, "java.awt.event.ActionEvent");
1570 c$.$JalviewLite$9$ = function () {
1571 Clazz.pu$h(self.c$);
1572 c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$9", java.awt.event.WindowAdapter);
1573 Clazz.overrideMethod (c$, "windowClosing",
1575 if (Clazz.instanceOf (this.f$.frame, jalview.appletgui.AlignFrame)) {
1576 var vp = (this.f$.frame).viewport;
1577 (this.f$.frame).closeMenuItem_actionPerformed ();
1578 if (vp.applet.currentAlignFrame === this.f$.frame) {
1579 vp.applet.currentAlignFrame = null;
1582 }jalview.bin.JalviewLite.lastFrameX -= 40;
1583 jalview.bin.JalviewLite.lastFrameY -= 40;
1584 if (Clazz.instanceOf (this.f$.frame, jalview.appletgui.EmbmenuFrame)) {
1585 (this.f$.frame).destroyMenus ();
1586 }this.f$.frame.setMenuBar (null);
1587 this.f$.frame.dispose ();
1588 }, "java.awt.event.WindowEvent");
1589 Clazz.defineMethod (c$, "windowActivated",
1591 if (Clazz.instanceOf (this.f$.frame, jalview.appletgui.AlignFrame)) {
1592 (this.f$.frame).viewport.applet.currentAlignFrame = this.f$.frame;
1593 if (jalview.bin.JalviewLite.debug) {
1594 System.err.println ("Activated window " + this.f$.frame);
1595 }}Clazz.superCall (this, jalview.bin.JalviewLite$9, "windowActivated", [e]);
1596 }, "java.awt.event.WindowEvent");
1599 c$.$JalviewLite$10$ = function () {
1600 Clazz.pu$h(self.c$);
1601 c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$10", null, Runnable);
1602 Clazz.overrideMethod (c$, "run",
1604 this.f$.alf.setFeatureGroupState (this.b$["jalview.bin.JalviewLite"].separatorListToArray (this.f$.groups), this.f$.st);
1608 Clazz.defineStatics (c$,
1616 "installation", null);