JAL-1807 test
[jalviewjs.git] / bin / jalview / bin / JalviewLite.js
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 () {
4 this.embedded = false;
5 this.enableSplitFrame = false;
6 this.showButton = true;
7 this.checkForJmol = true;
8 this.jalviewServletURL = null;
9 this.startupFile = "No file";
10 this.helpUrl = null;
11 this.externalstructureviewer = null;
12 this.sep = null;
13 this.rgb = null;
14 this.labelColour = null;
15 this.initjscallback = null;
16 this.pdbFile = null;
17 this.sequence = null;
18 this.jnetFile = null;
19 this.annotations = null;
20 this.hideFeatureGroups = null;
21 this.showFeatureGroups = null;
22 this.features = null;
23 this.showFeatureSettings = null;
24 this.scoreFile = null;
25 this.treeFile = null;
26 this.windowWidth = null;
27 this.windowHeight = null;
28 this.defaultColour = null;
29 this.sortBy = null;
30 this.wrap = null;
31 this.centrecolumnlabels = null;
32 this.userDefinedColour = null;
33 this.widthScale = null;
34 this.heightScale = null;
35 this.upperCase = null;
36 this.file2 = null;
37 this.javascriptListeners = null;
38 this.jsFunctionExec = null;
39 this.fileFound = true;
40 this.launcher = null;
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$ ();
50 }
51 if (!Clazz.isClassDefined ("jalview.bin.JalviewLite.LoadingThread")) {
52 jalview.bin.JalviewLite.$JalviewLite$LoadingThread$ ();
53 }
54 this.separator = "\u00ac";
55 this.jsfallbackEnabled = false;
56 this.jshashes = null;
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 ();
67 });
68 Clazz.defineMethod (c$, "setParams", 
69 ($fz = function () {
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");
105 }, $fz.isPrivate = true, $fz));
106 Clazz.defineMethod (c$, "getDefaultParameter", 
107 function (name, def) {
108 var stn;
109 if ((stn = this.getParameter (name)) == null) {
110 return def;
111 }if (stn.toLowerCase ().equals ("true")) {
112 return true;
113 }return false;
114 }, "~S,~B");
115 Clazz.defineMethod (c$, "getLinkParams", 
116 function (links) {
117 var label;
118 var url;
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);
124 }}
125 }, "java.util.Vector");
126 Clazz.defineMethod (c$, "getStructureSelectionManager", 
127 function () {
128 return jalview.structure.StructureSelectionManager.getStructureSelectionManager (this);
129 });
130 Clazz.defineMethod (c$, "getSelectedSequences", 
131 function () {
132 return this.getSelectedSequencesFrom (this.getDefaultTargetFrame ());
133 });
134 Clazz.defineMethod (c$, "getSelectedSequences", 
135 function (sep) {
136 return this.getSelectedSequencesFrom (this.getDefaultTargetFrame (), sep);
137 }, "~S");
138 Clazz.defineMethod (c$, "getSelectedSequencesFrom", 
139 function (alf) {
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 ());
151 result.append (sep);
152 }
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);
158 }, "~S,~S,~S");
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);
163 if (sq != null) {
164 var apos = -1;
165 try {
166 apos =  new Integer (position).intValue ();
167 apos--;
168 } catch (ex) {
169 if (Clazz.exceptionOf (ex, NumberFormatException)) {
170 return;
171 } else {
172 throw ex;
173 }
174 }
175 var me = this;
176 var pos = apos;
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))));
179 } else {
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);
185 }, "~S,~S");
186 Clazz.defineMethod (c$, "select", 
187 function (sequenceIds, columns, sep) {
188 this.selectIn (this.getDefaultTargetFrame (), sequenceIds, columns, sep);
189 }, "~S,~S,~S");
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;
198 } else {
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 ());
207 var start = 0;
208 var end = al.getWidth ();
209 var alw = al.getWidth ();
210 var seqsfound = true;
211 if (ids != null && ids.length > 0) {
212 seqsfound = false;
213 for (var i = 0; i < ids.length; i++) {
214 if (ids[i].trim ().length == 0) {
215 continue;
216 }var sq = matcher.findIdMatch (ids[i]);
217 if (sq != null) {
218 seqsfound = true;
219 sel.addSequence (sq, false);
220 }}
221 }var inseqpos = false;
222 if (cols != null && cols.length > 0) {
223 var seset = false;
224 for (var i = 0; i < cols.length; i++) {
225 var cl = cols[i].trim ();
226 if (cl.length == 0) {
227 continue;
228 }var p;
229 if ((p = cl.indexOf ("-")) > -1) {
230 var from = -1;
231 var to = -1;
232 try {
233 from =  new Integer (cl.substring (0, p)).intValue ();
234 from--;
235 } catch (ex) {
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'");
238 return;
239 } else {
240 throw ex;
241 }
242 }
243 try {
244 to =  new Integer (cl.substring (p + 1)).intValue ();
245 to--;
246 } catch (ex) {
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'");
249 return;
250 } else {
251 throw ex;
252 }
253 }
254 if (from >= 0 && to >= 0) {
255 if (from < to) {
256 var t = to;
257 to = from;
258 to = t;
259 }if (!seset) {
260 start = from;
261 end = to;
262 seset = true;
263 } else {
264 if (start > from) {
265 start = from;
266 }if (end < to) {
267 end = to;
268 }}for (var r = from; r <= to; r++) {
269 if (r >= 0 && r < alw) {
270 csel.addElement (r);
271 }}
272 if (jalview.bin.JalviewLite.debug) {
273 System.err.println ("Range '" + cl + "' deparsed as [" + from + "," + to + "]");
274 }} else {
275 System.err.println ("ERROR: Invalid Range '" + cl + "' deparsed as [" + from + "," + to + "]");
276 }} else {
277 var r = -1;
278 try {
279 r =  new Integer (cl).intValue ();
280 r--;
281 } catch (ex) {
282 if (Clazz.exceptionOf (ex, NumberFormatException)) {
283 if (cl.toLowerCase ().equals ("sequence")) {
284 inseqpos = true;
285 } else {
286 System.err.println ("ERROR: Couldn't parse integer from point selection element of column selection string '" + cl + "'");
287 return;
288 }} else {
289 throw ex;
290 }
291 }
292 if (r >= 0 && r <= alw) {
293 if (!seset) {
294 start = r;
295 end = r;
296 seset = true;
297 } else {
298 if (start > r) {
299 start = r;
300 }if (end < r) {
301 end = r;
302 }}csel.addElement (r);
303 if (jalview.bin.JalviewLite.debug) {
304 System.err.println ("Point selection '" + cl + "' deparsed as [" + r + "]");
305 }} else {
306 System.err.println ("ERROR: Invalid Point selection '" + cl + "' deparsed as [" + r + "]");
307 }}}
308 }if (seqsfound) {
309 if (inseqpos && sel.getSize () > 0) {
310 var rs = sel.getSequenceAt (0);
311 start = rs.findIndex (start);
312 end = rs.findIndex (end);
313 if (csel != null) {
314 var cs = csel.getSelected ();
315 csel.clear ();
316 for (var selectedCol, $selectedCol = cs.iterator (); $selectedCol.hasNext () && ((selectedCol = $selectedCol.next ()) || true);) {
317 csel.addElement (rs.findIndex ((selectedCol).intValue ()));
318 }
319 }}sel.setStartRes (start);
320 sel.setEndRes (end);
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);
326 }, "~S,~S");
327 Clazz.overrideMethod (c$, "getSelectedSequencesAsAlignmentFrom", 
328 function (alf, format, suffix) {
329 try {
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);
333 return reply;
334 }} catch (ex) {
335 if (Clazz.exceptionOf (ex, Exception)) {
336 ex.printStackTrace ();
337 return "Error retrieving alignment in " + format + " format. ";
338 } else {
339 throw ex;
340 }
341 }
342 return "";
343 }, "jalview.appletgui.AlignFrame,~S,~S");
344 Clazz.overrideMethod (c$, "getAlignmentOrder", 
345 function () {
346 return this.getAlignmentOrderFrom (this.getDefaultTargetFrame ());
347 });
348 Clazz.defineMethod (c$, "getAlignmentOrderFrom", 
349 function (alf) {
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 ();
358 }
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);
364 }, "~S,~S");
365 Clazz.defineMethod (c$, "orderBy", 
366 function (order, undoName, sep) {
367 return this.orderAlignmentBy (this.getDefaultTargetFrame (), order, undoName, sep);
368 }, "~S,~S,~S");
369 Clazz.overrideMethod (c$, "orderAlignmentBy", 
370 function (alf, order, undoName, sep) {
371 var ids = this.separatorListToArray (order, sep);
372 var sqs = null;
373 if (ids != null && ids.length > 0) {
374 var matcher =  new jalview.analysis.SequenceIdMatcher (alf.viewport.getAlignment ().getSequencesArray ());
375 var s = 0;
376 sqs =  new Array (ids.length);
377 for (var i = 0; i < ids.length; i++) {
378 if (ids[i].trim ().length == 0) {
379 continue;
380 }var sq = matcher.findIdMatch (ids[i]);
381 if (sq != null) {
382 sqs[s++] = sq;
383 }}
384 if (s > 0) {
385 var sqq =  new Array (s);
386 System.arraycopy (sqs, 0, sqq, 0, s);
387 sqs = sqq;
388 } else {
389 sqs = null;
390 }}if (sqs == null) {
391 return "";
392 };var aorder =  new jalview.datamodel.AlignmentOrder (sqs);
393 if (undoName != null && undoName.trim ().length == 0) {
394 undoName = null;
395 }var _undoName = undoName;
396 return alf.sortBy (aorder, _undoName) ? "true" : "";
397 }, "jalview.appletgui.AlignFrame,~S,~S,~S");
398 Clazz.defineMethod (c$, "getAlignment", 
399 function (format) {
400 return this.getAlignmentFrom (this.getDefaultTargetFrame (), format, "true");
401 }, "~S");
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);
409 }, "~S,~S");
410 Clazz.defineMethod (c$, "getAlignmentFrom", 
411 function (alf, format, suffix) {
412 try {
413 var seqlimits = suffix.equalsIgnoreCase ("true");
414 var reply =  new jalview.io.AppletFormatAdapter ().formatSequences (format, alf.viewport.getAlignment (), seqlimits);
415 return reply;
416 } catch (ex) {
417 if (Clazz.exceptionOf (ex, Exception)) {
418 ex.printStackTrace ();
419 return "Error retrieving alignment in " + format + " format. ";
420 } else {
421 throw ex;
422 }
423 }
424 }, "jalview.appletgui.AlignFrame,~S,~S");
425 Clazz.overrideMethod (c$, "loadAnnotation", 
426 function (annotation) {
427 this.loadAnnotationFrom (this.getDefaultTargetFrame (), annotation);
428 }, "~S");
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);
434 } else {
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);
440 }, "~S,~B");
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", 
446 function (format) {
447 return this.getFeaturesFrom (this.getDefaultTargetFrame (), format);
448 }, "~S");
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", 
454 function () {
455 return this.getAnnotationFrom (this.getDefaultTargetFrame ());
456 });
457 Clazz.overrideMethod (c$, "getAnnotationFrom", 
458 function (alf) {
459 return alf.outputAnnotations (false);
460 }, "jalview.appletgui.AlignFrame");
461 Clazz.defineMethod (c$, "newView", 
462 function () {
463 return this.newViewFrom (this.getDefaultTargetFrame ());
464 });
465 Clazz.defineMethod (c$, "newView", 
466 function (name) {
467 return this.newViewFrom (this.getDefaultTargetFrame (), name);
468 }, "~S");
469 Clazz.defineMethod (c$, "newViewFrom", 
470 function (alf) {
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) {
479 var al = null;
480 var format =  new jalview.io.IdentifyFile ().Identify (text, jalview.io.AppletFormatAdapter.PASTE);
481 try {
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);
485 }} catch (ex) {
486 if (Clazz.exceptionOf (ex, java.io.IOException)) {
487 ex.printStackTrace ();
488 } else {
489 throw ex;
490 }
491 }
492 return null;
493 }, "~S,~S");
494 Clazz.defineMethod (c$, "setMouseoverListener", 
495 function (listener) {
496 this.setMouseoverListener (this.currentAlignFrame, listener);
497 }, "~S");
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.");
504 return;
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);
515 }, "~S");
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.");
522 return;
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.");
536 return;
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.");
543 }}, "~S,~S");
544 Clazz.overrideMethod (c$, "removeJavascriptListener", 
545 function (af, listener) {
546 if (listener != null) {
547 listener = listener.trim ();
548 if (listener.length == 0) {
549 listener = null;
550 }}var rprt = false;
551 for (var ms = 0, msSize = this.javascriptListeners.size (); ms < msSize; ) {
552 var lstn = this.javascriptListeners.elementAt (ms);
553 var lstner = lstn;
554 if ((af == null || lstner.getAlignFrame () === af) && (listener == null || lstner.getListenerFunction ().equals (listener))) {
555 this.javascriptListeners.removeElement (lstner);
556 msSize--;
557 if (Clazz.instanceOf (lstner, jalview.structure.SelectionListener)) {
558 jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).removeSelectionListener (lstner);
559 } else {
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 + "'");
564 }} else {
565 ms++;
566 }}
567 if (rprt) {
568 System.err.println ("There are now " + this.javascriptListeners.size () + " listeners in total.");
569 }}, "jalview.appletgui.AlignFrame,~S");
570 Clazz.overrideMethod (c$, "stop", 
571 function () {
572 System.err.println ("Applet " + this.getName () + " stop().");
573 this.tidyUp ();
574 });
575 Clazz.overrideMethod (c$, "destroy", 
576 function () {
577 System.err.println ("Applet " + this.getName () + " destroy().");
578 this.tidyUp ();
579 });
580 Clazz.defineMethod (c$, "tidyUp", 
581 ($fz = function () {
582 this.removeAll ();
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 ();
586 av.applet = null;
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);
594 } else {
595 jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).removeStructureViewerListener (mol, null);
596 }mol.jvlite = null;
597 }
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);
605 }, $fz.isPrivate = true, $fz));
606 Clazz.overrideMethod (c$, "mouseOverStructure", 
607 function (pdbResNum, chain, pdbfile) {
608 var me = this;
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))));
610 }, "~S,~S,~S");
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", 
624 ($fz = function () {
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");
630 if (url != null) {
631 try {
632 var reader =  new java.io.BufferedReader ( new java.io.InputStreamReader (url.openStream ()));
633 var line;
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);
641 }}
642 } catch (ex) {
643 if (Clazz.exceptionOf (ex, Exception)) {
644 ex.printStackTrace ();
645 } else {
646 throw ex;
647 }
648 }
649 }}}, $fz.isPrivate = true, $fz));
650 c$.getBuildDate = Clazz.defineMethod (c$, "getBuildDate", 
651 function () {
652 jalview.bin.JalviewLite.initBuildDetails ();
653 return jalview.bin.JalviewLite.builddate;
654 });
655 c$.getInstallation = Clazz.defineMethod (c$, "getInstallation", 
656 function () {
657 jalview.bin.JalviewLite.initBuildDetails ();
658 return jalview.bin.JalviewLite.installation;
659 });
660 c$.getVersion = Clazz.defineMethod (c$, "getVersion", 
661 function () {
662 jalview.bin.JalviewLite.initBuildDetails ();
663 return jalview.bin.JalviewLite.version;
664 });
665 Clazz.overrideMethod (c$, "init", 
666 function () {
667 this.setParams ();
668 try {
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.");
674 }} catch (ex) {
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 ();
679 }} else {
680 throw ex;
681 }
682 }
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 + "'");
694 }} else {
695 throw  new Error (jalview.util.MessageManager.getString ("error.invalid_separator_parameter"));
696 }}var r = 255;
697 var g = 255;
698 var b = 255;
699 if (this.rgb != null) {
700 try {
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);
704 } catch (ex) {
705 if (Clazz.exceptionOf (ex, Exception)) {
706 r = 255;
707 g = 255;
708 b = 255;
709 } else {
710 throw ex;
711 }
712 }
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");
719 var i = 1;
720 while ((this.startupFile = this.getParameter ("sequence" + i)) != null) {
721 data.append (this.startupFile.toString () + "\n");
722 i++;
723 }
724 if (data.length () > 5) {
725 this.startupFile = data.toString ();
726 }}if (!this.enableSplitFrame) {
727 this.file2 = null;
728 }if (this.embedded) {
729 var loader = Clazz.innerTypeInstance (jalview.bin.JalviewLite.LoadingThread, this, null, this.startupFile, this.file2, this);
730 {
731 loader.run();
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);
735 loader.start ();
736 } else {
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)));
739 }} else {
740 this.startupFile = "NO FILE";
741 this.fileFound = false;
742 this.callInitCallback ();
743 }});
744 Clazz.defineMethod (c$, "initLiveConnect", 
745 ($fz = function () {
746 var notFailed = false;
747 var tries = 0;
748 while (!notFailed && tries < 10) {
749 if (tries > 0) {
750 System.err.println ("LiveConnect request thread going to sleep.");
751 }try {
752 Thread.sleep (700 * (1 + tries));
753 } catch (q) {
754 if (Clazz.exceptionOf (q, InterruptedException)) {
755 } else {
756 throw q;
757 }
758 }
759 ;if (tries++ > 0) {
760 System.err.println ("LiveConnect request thread woken up.");
761 }try {
762 var scriptObject = netscape.javascript.JSObject.getWindow (this);
763 if (scriptObject.eval ("navigator") != null) {
764 notFailed = true;
765 }} catch (jsex) {
766 if (Clazz.exceptionOf (jsex, Exception)) {
767 System.err.println ("Attempt " + tries + " to access LiveConnect javascript failed.");
768 } else {
769 throw jsex;
770 }
771 }
772 }
773 }, $fz.isPrivate = true, $fz));
774 Clazz.defineMethod (c$, "callInitCallback", 
775 ($fz = function () {
776 if (this.initjscallback == null) {
777 return;
778 }this.initjscallback = this.initjscallback.trim ();
779 if (this.initjscallback.length > 0) {
780 var scriptObject = null;
781 try {
782 scriptObject = netscape.javascript.JSObject.getWindow (this);
783 } catch (ex) {
784 if (Clazz.exceptionOf (ex, Exception)) {
785 } else {
786 throw ex;
787 }
788 }
789 ;this.initLiveConnect ();
790 if (scriptObject != null) {
791 try {
792  new jalview.javascript.JSFunctionExec (this).executeJavascriptFunction (true, this.initjscallback, null, "Calling oninit callback '" + this.initjscallback + "'.");
793 } catch (e) {
794 if (Clazz.exceptionOf (e, Exception)) {
795 System.err.println ("Exception when executing _oninit callback '" + this.initjscallback + "'.");
796 e.printStackTrace ();
797 } else {
798 throw e;
799 }
800 }
801 } else {
802 System.err.println ("Not executing _oninit callback '" + this.initjscallback + "' - no scripting allowed.");
803 }}}, $fz.isPrivate = true, $fz));
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", 
815 function (g) {
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", 
831 function (class1) {
832 var wnds =  new java.util.Vector ();
833 var cmp = this.getComponents ();
834 if (cmp != null) {
835 for (var i = 0; i < cmp.length; i++) {
836 if (class1.isAssignableFrom (cmp[i].getClass ())) {
837 wnds.addElement (cmp);
838 }}
839 }return wnds;
840 }, "Class");
841 Clazz.defineMethod (c$, "getDefaultTargetFrame", 
842 function () {
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.");
848 return null;
849 });
850 Clazz.defineMethod (c$, "separatorListToArray", 
851 function (list) {
852 return this.separatorListToArray (list, this.separator);
853 }, "~S");
854 Clazz.defineMethod (c$, "separatorListToArray", 
855 function (list, separator) {
856 var seplen = separator.length;
857 if (list == null || list.equals ("") || list.equals (separator)) {
858 return null;
859 }var jv =  new java.util.Vector ();
860 var cp = 0;
861 var pos;
862 while ((pos = list.indexOf (separator, cp)) > cp) {
863 jv.addElement (list.substring (cp, pos));
864 cp = pos + seplen;
865 }
866 if (cp < list.length) {
867 var c = list.substring (cp);
868 if (!c.equals (separator)) {
869 jv.addElement (c);
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);
874 }
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] + "'");
880 }
881 }return v;
882 }if (jalview.bin.JalviewLite.debug) {
883 System.err.println ("Empty Array from '" + separator + "' separated List");
884 }return null;
885 }, "~S,~S");
886 Clazz.defineMethod (c$, "arrayToSeparatorList", 
887 function (list) {
888 return this.arrayToSeparatorList (list, this.separator);
889 }, "~A");
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) {
896 if (i > 0) {
897 v.append (separator);
898 }v.append (list[i]);
899 }}
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;
907 }, "~A,~S");
908 Clazz.overrideMethod (c$, "getFeatureGroups", 
909 function () {
910 var lst = this.arrayToSeparatorList (this.getDefaultTargetFrame ().getFeatureGroups ());
911 return lst;
912 });
913 Clazz.overrideMethod (c$, "getFeatureGroupsOn", 
914 function (alf) {
915 var lst = this.arrayToSeparatorList (alf.getFeatureGroups ());
916 return lst;
917 }, "jalview.appletgui.AlignFrame");
918 Clazz.overrideMethod (c$, "getFeatureGroupsOfState", 
919 function (visible) {
920 return this.arrayToSeparatorList (this.getDefaultTargetFrame ().getFeatureGroupsOfState (visible));
921 }, "~B");
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) {
928 var st = 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);
934 }, "~S,~B");
935 Clazz.overrideMethod (c$, "getSeparator", 
936 function () {
937 return this.separator;
938 });
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 + "'");
946 }}, "~S");
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;
954 }, "~B");
955 Clazz.defineMethod (c$, "isAlignPdbStructures", 
956 function () {
957 return this.alignPdbStructures;
958 });
959 Clazz.overrideMethod (c$, "start", 
960 function () {
961 });
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 ();
972 }
973 this.jshashes.put (messageclass + "|" + viewId, l);
974 }, "~S,~S,~A");
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);
980 if (msgs != null) {
981 for (var i = 0; i < msgs.length; i++) {
982 if (msgs[i] != null) {
983 var m = msgs[i];
984 msgs[i] = null;
985 return m;
986 }}
987 }}return "";
988 }, "~S,~S");
989 Clazz.defineMethod (c$, "isJsMessageSetChanged", 
990 function (string, string2, colcommands) {
991 var l = this.jshashes.get (string + "|" + string2);
992 if (l == null && colcommands != null) {
993 return true;
994 }for (var i = 0; i < colcommands.length; i++) {
995 if (l[i] != colcommands[i].hashCode ()) {
996 return true;
997 }}
998 return false;
999 }, "~S,~S,~A");
1000 Clazz.defineMethod (c$, "getJsExecQueue", 
1001 function () {
1002 return this.jsExecQueue;
1003 });
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) {
1012 return defcolour;
1013 }var col = jalview.schemes.ColourSchemeProperty.getAWTColorFromName (colprop);
1014 if (col == null) {
1015 try {
1016 col =  new jalview.schemes.UserColourScheme (colprop).findColour ('A');
1017 } catch (ex) {
1018 if (Clazz.exceptionOf (ex, Exception)) {
1019 System.err.println ("Couldn't parse '" + colprop + "' as a colour for " + colparam);
1020 col = null;
1021 } else {
1022 throw ex;
1023 }
1024 }
1025 }return (col == null) ? defcolour : col;
1026 }, "~S,java.awt.Color");
1027 Clazz.defineMethod (c$, "openJalviewHelpUrl", 
1028 function () {
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");
1032 });
1033 Clazz.defineMethod (c$, "resolveUrlForLocalOrAbsolute", 
1034 ($fz = 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 }, $fz.isPrivate = true, $fz), "~S,java.net.URL");
1045 Clazz.defineMethod (c$, "showURL", 
1046 function (url, target) {
1047 try {
1048 if (url.indexOf (":") == -1) {
1049 var prepend;
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);
1053 }} else {
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));
1058 } else {
1059 this.getAppletContext ().showDocument ( new java.net.URL (url), target);
1060 }} catch (ex) {
1061 if (Clazz.exceptionOf (ex, Exception)) {
1062 ex.printStackTrace ();
1063 } else {
1064 throw ex;
1065 }
1066 }
1067 }, "~S,~S");
1068 c$.$JalviewLite$LoadJmolThread$ = function () {
1069 Clazz.pu$h ();
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", 
1076 function () {
1077 if (this.running || this.b$["jalview.bin.JalviewLite"].checkedForJmol) {
1078 return;
1079 }this.running = true;
1080 if (this.b$["jalview.bin.JalviewLite"].checkForJmol) {
1081 try {
1082 if (!System.getProperty ("java.version").startsWith ("1.1")) {
1083 Class.forName ("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");
1087 }} catch (ex) {
1088 if (Clazz.exceptionOf (ex, ClassNotFoundException)) {
1089 } else {
1090 throw ex;
1091 }
1092 }
1093 } else {
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;
1099 });
1100 Clazz.defineMethod (c$, "notFinished", 
1101 function () {
1102 return this.running || !this.b$["jalview.bin.JalviewLite"].checkedForJmol;
1103 });
1104 c$ = Clazz.p0p ();
1105 };
1106 c$.$JalviewLite$LoadingThread$ = function () {
1107 Clazz.pu$h ();
1108 c$ = Clazz.decorateAsClass (function () {
1109 Clazz.prepareCallback (this, arguments);
1110 this.protocol = null;
1111 this._file = null;
1112 this._file2 = null;
1113 this.applet = null;
1114 Clazz.instantialize (this, arguments);
1115 }, jalview.bin.JalviewLite, "LoadingThread", Thread);
1116 Clazz.defineMethod (c$, "dbgMsg", 
1117 ($fz = function (a) {
1118 if (jalview.bin.JalviewLite.debug) {
1119 System.err.println (a);
1120 }}, $fz.isPrivate = true, $fz), "~S");
1121 Clazz.defineMethod (c$, "setProtocolState", 
1122 function (a) {
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;
1128 } else {
1129 a = this.addProtocol (a);
1130 this.protocol = jalview.io.AppletFormatAdapter.URL;
1131 }this.dbgMsg ("Protocol identified as '" + this.protocol + "'");
1132 return a;
1133 }, "~S");
1134 Clazz.makeConstructor (c$, 
1135 function (a, b, c) {
1136 Clazz.superConstructor (this, jalview.bin.JalviewLite.LoadingThread, []);
1137 this._file = a;
1138 this._file2 = b;
1139 this.applet = c;
1140 }, "~S,~S,jalview.bin.JalviewLite");
1141 Clazz.overrideMethod (c$, "run", 
1142 function () {
1143 {
1144 System.out.println("BYPASSING JMOL LOADING FOR NOW. THIS WILL BE DONE ANOTHER WAY")
1145 }this.startLoading ();
1146 });
1147 Clazz.defineMethod (c$, "startLoading", 
1148 ($fz = function () {
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);
1153 if (a != null) {
1154 this.addToDisplay (a, b);
1155 this.loadTree (a);
1156 this.loadScoreFile (a);
1157 this.loadFeatures (a);
1158 this.loadAnnotations (a);
1159 this.loadJnetFile (a);
1160 this.loadPdbFiles (a);
1161 } else {
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 ();
1166 }, $fz.isPrivate = true, $fz));
1167 Clazz.defineMethod (c$, "addToDisplay", 
1168 function (a, b) {
1169 if (b == null) {
1170 a.addToDisplay (this.b$["jalview.bin.JalviewLite"].embedded);
1171 } else {
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", 
1176 function (a) {
1177 if (a == null) {
1178 return null;
1179 }var b = this.setProtocolState (a);
1180 var c =  new jalview.io.IdentifyFile ().Identify (b, this.protocol);
1181 this.dbgMsg ("File identified as '" + c + "'");
1182 var d = null;
1183 try {
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);
1189 e.setTitle (b);
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])));
1196 return e;
1197 }} catch (ex) {
1198 if (Clazz.exceptionOf (ex, java.io.IOException)) {
1199 this.dbgMsg ("File load exception.");
1200 ex.printStackTrace ();
1201 if (jalview.bin.JalviewLite.debug) {
1202 try {
1203 var e =  new jalview.io.FileParse (b, this.protocol);
1204 var f = null;
1205 this.dbgMsg (">>>Dumping contents of '" + b + "' " + "(" + this.protocol + ")");
1206 while ((f = e.nextLine ()) != null) {
1207 this.dbgMsg (f);
1208 }
1209 this.dbgMsg (">>>Dump finished.");
1210 } catch (e) {
1211 if (Clazz.exceptionOf (e, Exception)) {
1212 System.err.println ("Exception when trying to dump the content of the file parameter.");
1213 e.printStackTrace ();
1214 } else {
1215 throw e;
1216 }
1217 }
1218 }} else {
1219 throw ex;
1220 }
1221 }
1222 return null;
1223 }, "~S");
1224 Clazz.defineMethod (c$, "loadPdbFiles", 
1225 function (a) {
1226 var b = false;
1227 this.applet.setAlignPdbStructures (this.b$["jalview.bin.JalviewLite"].getDefaultParameter ("alignpdbfiles", false));
1228 var c = 0;
1229 var d =  new java.util.Vector ();
1230 var e = (this.applet.getDefaultParameter ("relaxedidmatch", false)) ?  new jalview.analysis.SequenceIdMatcher (a.getAlignViewport ().getAlignment ().getSequencesArray ()) : null;
1231 var f;
1232 do {
1233 if (c > 0) {
1234 f = this.applet.getParameter ("PDBFILE" + c);
1235 } else {
1236 f = this.b$["jalview.bin.JalviewLite"].pdbFile;
1237 }if (f != null) {
1238 var g =  new jalview.datamodel.PDBEntry ();
1239 var h;
1240 var i = null;
1241 var j = null;
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)]);
1246 }} else {
1247 f = k.nextToken ();
1248 var l =  new java.util.Vector ();
1249 var m =  new java.util.Vector ();
1250 while (k.hasMoreTokens ()) {
1251 h = k.nextToken ();
1252 var n =  new java.util.StringTokenizer (h, "=");
1253 if (n.countTokens () > 1) {
1254 m.addElement (n.nextToken ());
1255 h = n.nextToken ();
1256 }l.addElement (e == null ? a.getAlignViewport ().getAlignment ().findName (h) : e.findIdMatch (h));
1257 }
1258 i =  new Array (l.size ());
1259 l.copyInto (i);
1260 if (m.size () == l.size ()) {
1261 j =  new Array (m.size ());
1262 m.copyInto (j);
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);
1267 }g.setFile (f);
1268 if (i != null) {
1269 for (var l = 0; l < i.length; l++) {
1270 if (i[l] != null) {
1271 (i[l]).addPDBId (g);
1272 jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.applet).registerPDBEntry (g);
1273 } else {
1274 if (jalview.bin.JalviewLite.debug) {
1275 System.err.println ("Warning: Possible input parsing error: Null sequence for attachment of PDB (sequence " + l + ")");
1276 }}}
1277 if (!this.b$["jalview.bin.JalviewLite"].alignPdbStructures) {
1278 a.newStructureView (this.applet, g, i, j, this.protocol);
1279 } else {
1280 d.addElement ( Clazz.newArray (-1, [g, i, j,  String.instantialize (this.protocol)]));
1281 }}}c++;
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);
1290 h[k] = m[0];
1291 g[k] = m[1];
1292 i[k] = m[2];
1293 j[k] = m[3];
1294 }
1295 a.alignedStructureView (this.applet, h, g, i, j);
1296 b = true;
1297 }return b;
1298 }, "jalview.appletgui.AlignFrame");
1299 Clazz.defineMethod (c$, "loadJnetFile", 
1300 function (a) {
1301 var b = false;
1302 var c = this.b$["jalview.bin.JalviewLite"].jnetFile;
1303 if (c != null) {
1304 try {
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);
1315 b = true;
1316 } catch (ex) {
1317 if (Clazz.exceptionOf (ex, Exception)) {
1318 ex.printStackTrace ();
1319 } else {
1320 throw ex;
1321 }
1322 }
1323 }return b;
1324 }, "jalview.appletgui.AlignFrame");
1325 Clazz.defineMethod (c$, "loadAnnotations", 
1326 function (a) {
1327 var b = false;
1328 var c = this.b$["jalview.bin.JalviewLite"].annotations;
1329 if (c != null) {
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);
1334 b = true;
1335 } else {
1336 System.err.println ("Annotations were not added from annotation file '" + c + "'");
1337 }}return b;
1338 }, "jalview.appletgui.AlignFrame");
1339 Clazz.defineMethod (c$, "loadFeatures", 
1340 function (a) {
1341 var b = false;
1342 var c = this.b$["jalview.bin.JalviewLite"].hideFeatureGroups;
1343 if (c != null) {
1344 a.setFeatureGroupState (this.b$["jalview.bin.JalviewLite"].separatorListToArray (c), false);
1345 }c = this.b$["jalview.bin.JalviewLite"].showFeatureGroups;
1346 if (c != null) {
1347 a.setFeatureGroupState (this.b$["jalview.bin.JalviewLite"].separatorListToArray (c), true);
1348 }c = this.b$["jalview.bin.JalviewLite"].features;
1349 if (c != null) {
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);
1356 }return b;
1357 }, "jalview.appletgui.AlignFrame");
1358 Clazz.defineMethod (c$, "loadScoreFile", 
1359 function (a) {
1360 var b = false;
1361 if (this.b$["jalview.bin.JalviewLite"].scoreFile != null && !"".equals (this.b$["jalview.bin.JalviewLite"].scoreFile)) {
1362 try {
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);
1366 if (!b) {
1367 System.err.println ("Failed to parse T-COFFEE parameter as a valid score file ('" + this.b$["jalview.bin.JalviewLite"].scoreFile + "')");
1368 }} catch (e) {
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 ()]);
1371 } else {
1372 throw e;
1373 }
1374 }
1375 }return b;
1376 }, "jalview.appletgui.AlignFrame");
1377 Clazz.defineMethod (c$, "loadTree", 
1378 function (a) {
1379 var b = false;
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) {
1383 try {
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);
1386 c.parse ();
1387 if (c.getTree () != null) {
1388 a.loadTree (c, this.b$["jalview.bin.JalviewLite"].treeFile);
1389 b = true;
1390 this.dbgMsg ("Successfully imported tree.");
1391 } else {
1392 this.dbgMsg ("Tree parameter did not resolve to a valid tree.");
1393 }} catch (ex) {
1394 if (Clazz.exceptionOf (ex, Exception)) {
1395 ex.printStackTrace ();
1396 } else {
1397 throw ex;
1398 }
1399 }
1400 }return b;
1401 }, "jalview.appletgui.AlignFrame");
1402 Clazz.defineMethod (c$, "inArchive", 
1403 function (a) {
1404 try {
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.");
1408 }return b;
1409 } catch (ex) {
1410 if (Clazz.exceptionOf (ex, Exception)) {
1411 System.out.println ("Exception checking resources: " + a + " " + ex);
1412 return false;
1413 } else {
1414 throw ex;
1415 }
1416 }
1417 }, "~S");
1418 Clazz.defineMethod (c$, "addProtocol", 
1419 function (a) {
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 + "'");
1425 }return b;
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 + "'");
1430 }return b;
1431 }}return a;
1432 }, "~S");
1433 Clazz.defineMethod (c$, "urlExists", 
1434 ($fz = function (a) {
1435 var b = null;
1436 try {
1437 b =  new java.net.URL (a).openStream ();
1438 if (b != null) {
1439 return true;
1440 }} catch (x) {
1441 if (Clazz.exceptionOf (x, Exception)) {
1442 } else {
1443 throw x;
1444 }
1445 } finally {
1446 if (b != null) {
1447 try {
1448 b.close ();
1449 } catch (e) {
1450 if (Clazz.exceptionOf (e, java.io.IOException)) {
1451 } else {
1452 throw e;
1453 }
1454 }
1455 }}
1456 return false;
1457 }, $fz.isPrivate = true, $fz), "~S");
1458 c$ = Clazz.p0p ();
1459 };
1460 c$.$JalviewLite$1$ = function () {
1461 Clazz.pu$h ();
1462 c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$1", null, Runnable);
1463 Clazz.overrideMethod (c$, "run", 
1464 function () {
1465 jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.f$.me).mouseOverVamsasSequence (this.f$.sq, this.f$.sq.findIndex (this.f$.pos), null);
1466 });
1467 c$ = Clazz.p0p ();
1468 };
1469 c$.$JalviewLite$2$ = function () {
1470 Clazz.pu$h ();
1471 c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$2", null, Runnable);
1472 Clazz.overrideMethod (c$, "run", 
1473 function () {
1474 jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.f$.me).mouseOverVamsasSequence (this.f$.sq, this.f$.pos, null);
1475 });
1476 c$ = Clazz.p0p ();
1477 };
1478 c$.$JalviewLite$3$ = function () {
1479 Clazz.pu$h ();
1480 c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$3", null, Runnable);
1481 Clazz.overrideMethod (c$, "run", 
1482 function () {
1483 this.f$.alf.select (this.f$.sel, this.f$.csel);
1484 });
1485 c$ = Clazz.p0p ();
1486 };
1487 c$.$JalviewLite$4$ = function () {
1488 Clazz.pu$h ();
1489 c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$4", null, Runnable);
1490 Clazz.overrideMethod (c$, "run", 
1491 function () {
1492 try {
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 + "'");
1496 }} catch (e) {
1497 if (Clazz.exceptionOf (e, NumberFormatException)) {
1498 System.err.println ("Ignoring invalid residue number string '" + this.f$.pdbResNum + "'");
1499 } else {
1500 throw e;
1501 }
1502 }
1503 });
1504 c$ = Clazz.p0p ();
1505 };
1506 c$.$JalviewLite$5$ = function () {
1507 Clazz.pu$h ();
1508 c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$5", null, Runnable);
1509 Clazz.overrideMethod (c$, "run", 
1510 function () {
1511 try {
1512 this.f$.alf.scrollTo ( new Integer (this.f$.topRow).intValue (),  new Integer (this.f$.leftHandColumn).intValue ());
1513 } catch (ex) {
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 ();
1517 } else {
1518 throw ex;
1519 }
1520 }
1521 });
1522 c$ = Clazz.p0p ();
1523 };
1524 c$.$JalviewLite$6$ = function () {
1525 Clazz.pu$h ();
1526 c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$6", null, Runnable);
1527 Clazz.overrideMethod (c$, "run", 
1528 function () {
1529 try {
1530 this.f$.alf.scrollToRow ( new Integer (this.f$.topRow).intValue ());
1531 } catch (ex) {
1532 if (Clazz.exceptionOf (ex, Exception)) {
1533 System.err.println ("Couldn't parse integer arguments (topRow='" + this.f$.topRow + "')");
1534 ex.printStackTrace ();
1535 } else {
1536 throw ex;
1537 }
1538 }
1539 });
1540 c$ = Clazz.p0p ();
1541 };
1542 c$.$JalviewLite$7$ = function () {
1543 Clazz.pu$h ();
1544 c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$7", null, Runnable);
1545 Clazz.overrideMethod (c$, "run", 
1546 function () {
1547 try {
1548 this.f$.alf.scrollToColumn ( new Integer (this.f$.leftHandColumn).intValue ());
1549 } catch (ex) {
1550 if (Clazz.exceptionOf (ex, Exception)) {
1551 System.err.println ("Couldn't parse integer arguments (leftHandColumn='" + this.f$.leftHandColumn + "')");
1552 ex.printStackTrace ();
1553 } else {
1554 throw ex;
1555 }
1556 }
1557 });
1558 c$ = Clazz.p0p ();
1559 };
1560 c$.$JalviewLite$8$ = function () {
1561 Clazz.pu$h ();
1562 c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$8", null, java.awt.event.ActionListener);
1563 Clazz.overrideMethod (c$, "actionPerformed", 
1564 function (e) {
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"]);
1566 loader.start ();
1567 }, "java.awt.event.ActionEvent");
1568 c$ = Clazz.p0p ();
1569 };
1570 c$.$JalviewLite$9$ = function () {
1571 Clazz.pu$h ();
1572 c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$9", java.awt.event.WindowAdapter);
1573 Clazz.overrideMethod (c$, "windowClosing", 
1574 function (e) {
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;
1580 }vp.applet = null;
1581 vp = 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", 
1590 function (e) {
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");
1597 c$ = Clazz.p0p ();
1598 };
1599 c$.$JalviewLite$10$ = function () {
1600 Clazz.pu$h ();
1601 c$ = Clazz.declareAnonymous (jalview.bin, "JalviewLite$10", null, Runnable);
1602 Clazz.overrideMethod (c$, "run", 
1603 function () {
1604 this.f$.alf.setFeatureGroupState (this.b$["jalview.bin.JalviewLite"].separatorListToArray (this.f$.groups), this.f$.st);
1605 });
1606 c$ = Clazz.p0p ();
1607 };
1608 Clazz.defineStatics (c$,
1609 "TRUE", "true",
1610 "FALSE", "false",
1611 "debug", false,
1612 "lastFrameX", 200,
1613 "lastFrameY", 200,
1614 "builddate", null,
1615 "version", null,
1616 "installation", null);
1617 });