JAL-1807 Bob
[jalviewjs.git] / site / j2s / core / corejalview.js
1 (function(Clazz
2 ,Clazz_getClassName
3 ,Clazz_newLongArray
4 ,Clazz_doubleToByte
5 ,Clazz_doubleToInt
6 ,Clazz_doubleToLong
7 ,Clazz_declarePackage
8 ,Clazz_instanceOf
9 ,Clazz_load
10 ,Clazz_instantialize
11 ,Clazz_decorateAsClass
12 ,Clazz_floatToInt
13 ,Clazz_floatToLong
14 ,Clazz_makeConstructor
15 ,Clazz_defineEnumConstant
16 ,Clazz_exceptionOf
17 ,Clazz_newIntArray
18 ,Clazz_defineStatics
19 ,Clazz_newFloatArray
20 ,Clazz_declareType
21 ,Clazz_prepareFields
22 ,Clazz_superConstructor
23 ,Clazz_newByteArray
24 ,Clazz_declareInterface
25 ,Clazz_p0p
26 ,Clazz_pu$h
27 ,Clazz_newShortArray
28 ,Clazz_innerTypeInstance
29 ,Clazz_isClassDefined
30 ,Clazz_prepareCallback
31 ,Clazz_newArray
32 ,Clazz_castNullAs
33 ,Clazz_floatToShort
34 ,Clazz_superCall
35 ,Clazz_decorateAsType
36 ,Clazz_newBooleanArray
37 ,Clazz_newCharArray
38 ,Clazz_implementOf
39 ,Clazz_newDoubleArray
40 ,Clazz_overrideConstructor
41 ,Clazz_clone
42 ,Clazz_doubleToShort
43 ,Clazz_getInheritedLevel
44 ,Clazz_getParamsType
45 ,Clazz_isAF
46 ,Clazz_isAI
47 ,Clazz_isAS
48 ,Clazz_isASS
49 ,Clazz_isAP
50 ,Clazz_isAFloat
51 ,Clazz_isAII
52 ,Clazz_isAFF
53 ,Clazz_isAFFF
54 ,Clazz_tryToSearchAndExecute
55 ,Clazz_getStackTrace
56 ,Clazz_inheritArgs
57 ,Clazz_alert
58 ,Clazz_defineMethod
59 ,Clazz_overrideMethod
60 ,Clazz_declareAnonymous
61 ,Clazz_checkPrivateMethod
62 ,Clazz_cloneFinals
63 ){
64 var $t$;
65 //var c$;
66 Clazz_load (["java.io.Reader"], "java.io.InputStreamReader", ["java.lang.NullPointerException"], function () {
67 c$ = Clazz_decorateAsClass (function () {
68 this.$in = null;
69 this.isOpen = true;
70 this.charsetName = null;
71 this.isUTF8 = false;
72 this.bytearr = null;
73 this.pos = 0;
74 Clazz_instantialize (this, arguments);
75 }, java.io, "InputStreamReader", java.io.Reader);
76 Clazz_makeConstructor (c$, 
77 function ($in) {
78 //just sets lock Clazz_superConstructor (this, java.io.InputStreamReader, [$in]);
79 this.$in = $in;
80 var charsetName = (arguments.length > 1 ? arguments[1] : "UTF-8");
81
82 this.charsetName = charsetName;
83 if (!(this.isUTF8 = "UTF-8".equals (charsetName)) && !"ISO-8859-1".equals (charsetName)) throw  new NullPointerException ("charsetName");
84 }, "java.io.InputStream");
85 Clazz_defineMethod (c$, "getEncoding", 
86 function () {
87 return this.charsetName;
88 });
89 Clazz_overrideMethod (c$, "read", 
90 function (cbuf, offset, length) {
91 if (this.bytearr == null || this.bytearr.length < length) this.bytearr =  Clazz_newByteArray (length, 0);
92 var c;
93 var char2;
94 var char3;
95 var byteCount = 0;
96 var charCount = offset;
97 var byteLen = this.$in.read (this.bytearr, this.pos, length - this.pos);
98 var nAvail = this.$in.available ();
99 if (byteLen < 0) return -1;
100 var nMax = byteLen;
101 while (byteCount < nMax) {
102 c = this.bytearr[byteCount] & 0xff;
103 if (this.isUTF8) switch (c >> 4) {
104 case 0xC:
105 case 0xD:
106 if (byteCount + 1 >= byteLen) {
107 if (nAvail >= 1) {
108 nMax = byteCount;
109 continue;
110 }} else if (((char2 = this.bytearr[byteCount + 1]) & 0xC0) == 0x80) {
111 cbuf[charCount++] = String.fromCharCode (((c & 0x1F) << 6) | (char2 & 0x3F));
112 byteCount += 2;
113 continue;
114 }this.isUTF8 = false;
115 break;
116 case 0xE:
117 if (byteCount + 2 >= byteLen) {
118 if (nAvail >= 2) {
119 nMax = byteCount;
120 continue;
121 }} else if (((char2 = this.bytearr[byteCount + 1]) & 0xC0) == 0x80 && ((char3 = this.bytearr[byteCount + 2]) & 0xC0) == 0x80) {
122 cbuf[charCount++] = String.fromCharCode (((c & 0x0F) << 12) | ((char2 & 0x3F) << 6) | (char3 & 0x3F));
123 byteCount += 3;
124 continue;
125 }this.isUTF8 = false;
126 break;
127 }
128 byteCount++;
129 cbuf[charCount++] = String.fromCharCode (c);
130 }
131 this.pos = byteLen - byteCount;
132 for (var i = 0; i < this.pos; i++) {
133 this.bytearr[i] = this.bytearr[byteCount++];
134 }
135 return charCount - offset;
136 }, "~A,~N,~N");
137 Clazz_overrideMethod (c$, "ready", 
138 function () {
139 return this.isOpen;
140 });
141 Clazz_overrideMethod (c$, "close", 
142 function () {
143 this.$in.close ();
144 this.isOpen = false;
145 });
146 });
147 Clazz_declarePackage ("javax.swing.text");
148 Clazz_load (["java.awt.event.FocusListener", "$.MouseListener", "javax.swing.ActionMap", "$.InputMap", "$.JComponent", "$.Scrollable", "javax.swing.event.CaretEvent", "$.ChangeListener", "javax.swing.text.Keymap", "javax.swing.DropMode"], "javax.swing.text.JTextComponent", ["java.io.IOException", "java.lang.Boolean", "$.Character", "$.IllegalArgumentException", "java.util.HashMap", "$.Hashtable", "$.Vector", "java.awt.Point", "javax.swing.Action", "$.JViewport", "$.UIManager", "javax.swing.event.CaretListener", "javax.swing.text.DefaultEditorKit", "$.JSMinimalAbstractDocument", "jssun.awt.AppContext", "swingjs.JSToolkit"], function () {
149 c$ = Clazz_decorateAsClass (function () {
150 this.model = null;
151 this.caret = null;
152 this.navigationFilter = null;
153 this.highlighter = null;
154 this.keymap = null;
155 this.caretEvent = null;
156 this.caretColor = null;
157 this.selectionColor = null;
158 this.selectedTextColor = null;
159 this.disabledTextColor = null;
160 this.editable = false;
161 this.margin = null;
162 this.focusAccelerator = '\0';
163 this.dragEnabled = false;
164 this.dropMode = null;
165 this.composedTextAttribute = null;
166 this.composedTextContent = null;
167 this.composedTextStart = null;
168 this.composedTextEnd = null;
169 Clazz_instantialize (this, arguments);
170 }, javax.swing.text, "JTextComponent", javax.swing.JComponent, javax.swing.Scrollable);
171 Clazz_prepareFields (c$, function () {
172 this.dropMode = javax.swing.DropMode.USE_SELECTION;
173 });
174 Clazz_makeConstructor (c$, 
175 function () {
176 Clazz_superConstructor (this, javax.swing.text.JTextComponent);
177 this.enableEvents (2056);
178 this.caretEvent =  new javax.swing.text.JTextComponent.MutableCaretEvent (this);
179 this.addMouseListener (this.caretEvent);
180 this.addFocusListener (this.caretEvent);
181 this.setEditable (true);
182 this.setDragEnabled (false);
183 this.setLayout (null);
184 this.updateUI ();
185 });
186 Clazz_overrideMethod (c$, "getUI", 
187 function () {
188 return this.ui;
189 });
190 Clazz_overrideMethod (c$, "updateUI", 
191 function () {
192 this.setUI (javax.swing.UIManager.getUI (this));
193 this.invalidate ();
194 });
195 Clazz_defineMethod (c$, "addCaretListener", 
196 function (listener) {
197 this.listenerList.add (javax.swing.event.CaretListener, listener);
198 }, "javax.swing.event.CaretListener");
199 Clazz_defineMethod (c$, "removeCaretListener", 
200 function (listener) {
201 this.listenerList.remove (javax.swing.event.CaretListener, listener);
202 }, "javax.swing.event.CaretListener");
203 Clazz_defineMethod (c$, "getCaretListeners", 
204 function () {
205 return this.listenerList.getListeners (javax.swing.event.CaretListener);
206 });
207 Clazz_defineMethod (c$, "fireCaretUpdate", 
208 function (e) {
209 var listeners = this.listenerList.getListenerList ();
210 for (var i = listeners.length - 2; i >= 0; i -= 2) {
211 if (listeners[i] === javax.swing.event.CaretListener) {
212 (listeners[i + 1]).caretUpdate (e);
213 }}
214 }, "javax.swing.event.CaretEvent");
215 Clazz_defineMethod (c$, "setDocument", 
216 function (doc) {
217 var old = this.model;
218 try {
219 this.model = doc;
220 this.firePropertyChangeObject ("document", old, doc);
221 } finally {
222 }
223 this.revalidate ();
224 this.repaint ();
225 }, "javax.swing.text.Document");
226 Clazz_defineMethod (c$, "getDocument", 
227 function () {
228 return this.model;
229 });
230 Clazz_defineMethod (c$, "getActions", 
231 function () {
232 if (this.getUI () == null) return null;
233 return this.getUI ().getEditorKit (this).getActions ();
234 });
235 Clazz_defineMethod (c$, "setMargin", 
236 function (m) {
237 var old = this.margin;
238 this.margin = m;
239 this.firePropertyChangeObject ("margin", old, m);
240 this.invalidate ();
241 }, "java.awt.Insets");
242 Clazz_defineMethod (c$, "getMargin", 
243 function () {
244 return this.margin;
245 });
246 Clazz_defineMethod (c$, "setNavigationFilter", 
247 function (filter) {
248 this.navigationFilter = filter;
249 }, "javax.swing.text.NavigationFilter");
250 Clazz_defineMethod (c$, "getNavigationFilter", 
251 function () {
252 return this.navigationFilter;
253 });
254 Clazz_defineMethod (c$, "getCaret", 
255 function () {
256 return this.caret;
257 });
258 Clazz_defineMethod (c$, "setCaret", 
259 function (c) {
260 if (this.caret != null) {
261 this.caret.removeChangeListener (this.caretEvent);
262 this.caret.deinstall (this);
263 }var old = this.caret;
264 this.caret = c;
265 if (this.caret != null) {
266 this.caret.install (this);
267 this.caret.addChangeListener (this.caretEvent);
268 }this.firePropertyChangeObject ("caret", old, this.caret);
269 }, "javax.swing.text.Caret");
270 Clazz_defineMethod (c$, "getHighlighter", 
271 function () {
272 return this.highlighter;
273 });
274 Clazz_defineMethod (c$, "setHighlighter", 
275 function (h) {
276 if (this.highlighter != null) {
277 this.highlighter.deinstall (this);
278 }var old = this.highlighter;
279 this.highlighter = h;
280 if (this.highlighter != null) {
281 this.highlighter.install (this);
282 }this.firePropertyChangeObject ("highlighter", old, h);
283 }, "javax.swing.text.Highlighter");
284 Clazz_defineMethod (c$, "setKeymap", 
285 function (map) {
286 var old = this.keymap;
287 this.keymap = map;
288 this.firePropertyChangeObject ("keymap", old, this.keymap);
289 this.updateInputMap (old, map);
290 }, "javax.swing.text.Keymap");
291 Clazz_defineMethod (c$, "setDragEnabled", 
292 function (b) {
293 this.dragEnabled = b;
294 }, "~B");
295 Clazz_defineMethod (c$, "getDragEnabled", 
296 function () {
297 return this.dragEnabled;
298 });
299 Clazz_defineMethod (c$, "setDropMode", 
300 function (dropMode) {
301 if (dropMode != null) {
302 switch (dropMode) {
303 case javax.swing.DropMode.USE_SELECTION:
304 case javax.swing.DropMode.INSERT:
305 this.dropMode = dropMode;
306 return;
307 }
308 }throw  new IllegalArgumentException (dropMode + ": Unsupported drop mode for text");
309 }, "javax.swing.DropMode");
310 Clazz_defineMethod (c$, "getDropMode", 
311 function () {
312 return this.dropMode;
313 });
314 Clazz_defineMethod (c$, "updateInputMap", 
315 function (oldKm, newKm) {
316 var km = this.getInputMap (0);
317 var last = km;
318 while (km != null && !(Clazz_instanceOf (km, javax.swing.text.JTextComponent.KeymapWrapper))) {
319 last = km;
320 km = km.getParent ();
321 }
322 if (km != null) {
323 if (newKm == null) {
324 if (last !== km) {
325 last.setParent (km.getParent ());
326 } else {
327 last.setParent (null);
328 }} else {
329 var newKM =  new javax.swing.text.JTextComponent.KeymapWrapper (newKm);
330 last.setParent (newKM);
331 if (last !== km) {
332 newKM.setParent (km.getParent ());
333 }}} else if (newKm != null) {
334 km = this.getInputMap (0);
335 if (km != null) {
336 var newKM =  new javax.swing.text.JTextComponent.KeymapWrapper (newKm);
337 newKM.setParent (km.getParent ());
338 km.setParent (newKM);
339 }}var am = this.getActionMap ();
340 var lastAM = am;
341 while (am != null && !(Clazz_instanceOf (am, javax.swing.text.JTextComponent.KeymapActionMap))) {
342 lastAM = am;
343 am = am.getParent ();
344 }
345 if (am != null) {
346 if (newKm == null) {
347 if (lastAM !== am) {
348 lastAM.setParent (am.getParent ());
349 } else {
350 lastAM.setParent (null);
351 }} else {
352 var newAM =  new javax.swing.text.JTextComponent.KeymapActionMap (newKm);
353 lastAM.setParent (newAM);
354 if (lastAM !== am) {
355 newAM.setParent (am.getParent ());
356 }}} else if (newKm != null) {
357 am = this.getActionMap ();
358 if (am != null) {
359 var newAM =  new javax.swing.text.JTextComponent.KeymapActionMap (newKm);
360 newAM.setParent (am.getParent ());
361 am.setParent (newAM);
362 }}}, "javax.swing.text.Keymap,javax.swing.text.Keymap");
363 Clazz_defineMethod (c$, "getKeymap", 
364 function () {
365 return this.keymap;
366 });
367 c$.addKeymap = Clazz_defineMethod (c$, "addKeymap", 
368 function (nm, parent) {
369 var map =  new javax.swing.text.JTextComponent.DefaultKeymap (nm, parent);
370 if (nm != null) {
371 javax.swing.text.JTextComponent.getKeymapTable ().put (nm, map);
372 }return map;
373 }, "~S,javax.swing.text.Keymap");
374 c$.removeKeymap = Clazz_defineMethod (c$, "removeKeymap", 
375 function (nm) {
376 return javax.swing.text.JTextComponent.getKeymapTable ().remove (nm);
377 }, "~S");
378 c$.getKeymap = Clazz_defineMethod (c$, "getKeymap", 
379 function (nm) {
380 return javax.swing.text.JTextComponent.getKeymapTable ().get (nm);
381 }, "~S");
382 c$.getKeymapTable = Clazz_defineMethod (c$, "getKeymapTable", 
383  function () {
384 {
385 var appContext = jssun.awt.AppContext.getAppContext ();
386 var keymapTable = appContext.get (javax.swing.text.JTextComponent.KEYMAP_TABLE);
387 if (keymapTable == null) {
388 keymapTable =  new java.util.HashMap (17);
389 appContext.put (javax.swing.text.JTextComponent.KEYMAP_TABLE, keymapTable);
390 var binding = javax.swing.text.JTextComponent.addKeymap ("default", null);
391 binding.setDefaultAction ( new javax.swing.text.DefaultEditorKit.DefaultKeyTypedAction ());
392 }return keymapTable;
393 }});
394 c$.loadKeymap = Clazz_defineMethod (c$, "loadKeymap", 
395 function (map, bindings, actions) {
396 var h =  new java.util.Hashtable ();
397 for (var i = 0; i < actions.length; i++) {
398 var a = actions[i];
399 var value = a.getValue ("Name");
400 h.put ((value != null ? value : ""), a);
401 }
402 for (var i = 0; i < bindings.length; i++) {
403 var a = h.get (bindings[i].actionName);
404 if (a != null) {
405 map.addActionForKeyStroke (bindings[i].key, a);
406 }}
407 }, "javax.swing.text.Keymap,~A,~A");
408 Clazz_defineMethod (c$, "getCaretColor", 
409 function () {
410 return this.caretColor;
411 });
412 Clazz_defineMethod (c$, "setCaretColor", 
413 function (c) {
414 var old = this.caretColor;
415 this.caretColor = c;
416 this.firePropertyChangeObject ("caretColor", old, this.caretColor);
417 }, "java.awt.Color");
418 Clazz_defineMethod (c$, "getSelectionColor", 
419 function () {
420 return this.selectionColor;
421 });
422 Clazz_defineMethod (c$, "setSelectionColor", 
423 function (c) {
424 var old = this.selectionColor;
425 this.selectionColor = c;
426 this.firePropertyChangeObject ("selectionColor", old, this.selectionColor);
427 }, "java.awt.Color");
428 Clazz_defineMethod (c$, "getSelectedTextColor", 
429 function () {
430 return this.selectedTextColor;
431 });
432 Clazz_defineMethod (c$, "setSelectedTextColor", 
433 function (c) {
434 var old = this.selectedTextColor;
435 this.selectedTextColor = c;
436 this.firePropertyChangeObject ("selectedTextColor", old, this.selectedTextColor);
437 }, "java.awt.Color");
438 Clazz_defineMethod (c$, "getDisabledTextColor", 
439 function () {
440 return this.disabledTextColor;
441 });
442 Clazz_defineMethod (c$, "setDisabledTextColor", 
443 function (c) {
444 var old = this.disabledTextColor;
445 this.disabledTextColor = c;
446 this.firePropertyChangeObject ("disabledTextColor", old, this.disabledTextColor);
447 }, "java.awt.Color");
448 Clazz_defineMethod (c$, "replaceSelection", 
449 function (content) {
450 var doc = this.getDocument ();
451 if (doc != null) {
452 try {
453 var composedTextSaved = this.saveComposedText (this.caret.getDot ());
454 var p0 = Math.min (this.caret.getDot (), this.caret.getMark ());
455 var p1 = Math.max (this.caret.getDot (), this.caret.getMark ());
456 if (Clazz_instanceOf (doc, javax.swing.text.JSMinimalAbstractDocument)) {
457 (doc).replace (p0, p1 - p0, content, null);
458 } else {
459 if (p0 != p1) {
460 doc.remove (p0, p1 - p0);
461 }if (content != null && content.length > 0) {
462 doc.insertString (p0, content, null);
463 }}if (composedTextSaved) {
464 this.restoreComposedText ();
465 }} catch (e) {
466 if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
467 swingjs.JSToolkit.alert ("SWINGJS BAD LOCATION EXCEPTION (replace):" + e.getMessage () + swingjs.JSToolkit.getStackTrace (-10));
468 } else {
469 throw e;
470 }
471 }
472 }}, "~S");
473 Clazz_defineMethod (c$, "getText", 
474 function (offs, len) {
475 return this.getDocument ().getText (offs, len);
476 }, "~N,~N");
477 Clazz_defineMethod (c$, "modelToView", 
478 function (pos) {
479 return this.getUI ().modelToView (this, pos);
480 }, "~N");
481 Clazz_defineMethod (c$, "viewToModel", 
482 function (pt) {
483 return this.getUI ().viewToModel (this, pt);
484 }, "java.awt.Point");
485 Clazz_defineMethod (c$, "cut", 
486 function () {
487 });
488 Clazz_defineMethod (c$, "copy", 
489 function () {
490 });
491 Clazz_defineMethod (c$, "paste", 
492 function () {
493 });
494 Clazz_defineMethod (c$, "moveCaretPosition", 
495 function (pos) {
496 var doc = this.getDocument ();
497 if (doc != null) {
498 if (pos > doc.getLength () || pos < 0) {
499 throw  new IllegalArgumentException ("bad position: " + pos);
500 }this.caret.moveDot (pos);
501 }}, "~N");
502 Clazz_defineMethod (c$, "setFocusAccelerator", 
503 function (aKey) {
504 aKey = Character.toUpperCase (aKey);
505 var old = this.focusAccelerator;
506 this.focusAccelerator = aKey;
507 this.firePropertyChange ("focusAcceleratorKey", old, this.focusAccelerator);
508 this.firePropertyChange ("focusAccelerator", old, this.focusAccelerator);
509 }, "~S");
510 Clazz_defineMethod (c$, "getFocusAccelerator", 
511 function () {
512 return this.focusAccelerator;
513 });
514 Clazz_defineMethod (c$, "read", 
515 function ($in, desc) {
516 var kit = this.getUI ().getEditorKit (this);
517 var doc = kit.createDefaultDocument ();
518 if (desc != null) {
519 doc.putProperty ("stream", desc);
520 }try {
521 kit.read ($in, doc, 0);
522 this.setDocument (doc);
523 } catch (e) {
524 if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
525 throw  new java.io.IOException (e.getMessage ());
526 } else {
527 throw e;
528 }
529 }
530 }, "java.io.Reader,~O");
531 Clazz_defineMethod (c$, "write", 
532 function (out) {
533 var doc = this.getDocument ();
534 try {
535 this.getUI ().getEditorKit (this).write (out, doc, 0, doc.getLength ());
536 } catch (e) {
537 if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
538 throw  new java.io.IOException (e.getMessage ());
539 } else {
540 throw e;
541 }
542 }
543 }, "java.io.Writer");
544 Clazz_defineMethod (c$, "removeNotify", 
545 function () {
546 Clazz_superCall (this, javax.swing.text.JTextComponent, "removeNotify", []);
547 if (javax.swing.text.JTextComponent.getFocusedComponent () === this) {
548 jssun.awt.AppContext.getAppContext ().remove (javax.swing.text.JTextComponent.FOCUSED_COMPONENT);
549 }});
550 Clazz_defineMethod (c$, "setCaretPosition", 
551 function (position) {
552 var doc = this.getDocument ();
553 if (doc != null) {
554 if (position > doc.getLength () || position < 0) {
555 throw  new IllegalArgumentException ("bad position: " + position);
556 }this.caret.setDot (position);
557 }}, "~N");
558 Clazz_defineMethod (c$, "getCaretPosition", 
559 function () {
560 return this.caret.getDot ();
561 });
562 Clazz_defineMethod (c$, "setText", 
563 function (t) {
564 try {
565 var doc = this.getDocument ();
566 if (Clazz_instanceOf (doc, javax.swing.text.JSMinimalAbstractDocument)) {
567 (doc).replace (0, doc.getLength (), t, null);
568 } else {
569 doc.remove (0, doc.getLength ());
570 doc.insertString (0, t, null);
571 }} catch (e) {
572 if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
573 swingjs.JSToolkit.alert ("SWINGJS BAD LOCATION EXCEPTION (setText):" + e.getMessage () + swingjs.JSToolkit.getStackTrace (-10));
574 } else {
575 throw e;
576 }
577 }
578 }, "~S");
579 Clazz_defineMethod (c$, "getText", 
580 function () {
581 var doc = this.getDocument ();
582 var txt;
583 try {
584 txt = doc.getText (0, doc.getLength ());
585 } catch (e) {
586 if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
587 txt = null;
588 } else {
589 throw e;
590 }
591 }
592 return txt;
593 });
594 Clazz_defineMethod (c$, "getSelectedText", 
595 function () {
596 var txt = null;
597 var p0 = Math.min (this.caret.getDot (), this.caret.getMark ());
598 var p1 = Math.max (this.caret.getDot (), this.caret.getMark ());
599 if (p0 != p1) {
600 try {
601 var doc = this.getDocument ();
602 txt = doc.getText (p0, p1 - p0);
603 } catch (e) {
604 if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
605 throw  new IllegalArgumentException (e.getMessage ());
606 } else {
607 throw e;
608 }
609 }
610 }return txt;
611 });
612 Clazz_defineMethod (c$, "isEditable", 
613 function () {
614 return this.editable;
615 });
616 Clazz_defineMethod (c$, "setEditable", 
617 function (b) {
618 if (b != this.editable) {
619 var oldVal = this.editable;
620 this.editable = b;
621 this.firePropertyChangeObject ("editable", Boolean.$valueOf (oldVal), Boolean.$valueOf (this.editable));
622 this.repaint ();
623 }}, "~B");
624 Clazz_defineMethod (c$, "getSelectionStart", 
625 function () {
626 var start = Math.min (this.caret.getDot (), this.caret.getMark ());
627 return start;
628 });
629 Clazz_defineMethod (c$, "setSelectionStart", 
630 function (selectionStart) {
631 this.select (selectionStart, this.getSelectionEnd ());
632 }, "~N");
633 Clazz_defineMethod (c$, "getSelectionEnd", 
634 function () {
635 var end = Math.max (this.caret.getDot (), this.caret.getMark ());
636 return end;
637 });
638 Clazz_defineMethod (c$, "setSelectionEnd", 
639 function (selectionEnd) {
640 this.select (this.getSelectionStart (), selectionEnd);
641 }, "~N");
642 Clazz_defineMethod (c$, "select", 
643 function (selectionStart, selectionEnd) {
644 var docLength = this.getDocument ().getLength ();
645 if (selectionStart < 0) {
646 selectionStart = 0;
647 }if (selectionStart > docLength) {
648 selectionStart = docLength;
649 }if (selectionEnd > docLength) {
650 selectionEnd = docLength;
651 }if (selectionEnd < selectionStart) {
652 selectionEnd = selectionStart;
653 }this.setCaretPosition (selectionStart);
654 this.moveCaretPosition (selectionEnd);
655 }, "~N,~N");
656 Clazz_defineMethod (c$, "selectAll", 
657 function () {
658 var doc = this.getDocument ();
659 if (doc != null) {
660 this.setCaretPosition (0);
661 this.moveCaretPosition (doc.getLength ());
662 }});
663 Clazz_defineMethod (c$, "getToolTipText", 
664 function (event) {
665 var retValue = Clazz_superCall (this, javax.swing.text.JTextComponent, "getToolTipText", [event]);
666 if (retValue == null) {
667 var ui = this.getUI ();
668 if (ui != null) {
669 retValue = ui.getToolTipText (this,  new java.awt.Point (event.getX (), event.getY ()));
670 }}return retValue;
671 }, "java.awt.event.MouseEvent");
672 Clazz_overrideMethod (c$, "getPreferredScrollableViewportSize", 
673 function () {
674 return this.getPreferredSize ();
675 });
676 Clazz_overrideMethod (c$, "getScrollableUnitIncrement", 
677 function (visibleRect, orientation, direction) {
678 switch (orientation) {
679 case 1:
680 return Clazz_doubleToInt (visibleRect.height / 10);
681 case 0:
682 return Clazz_doubleToInt (visibleRect.width / 10);
683 default:
684 throw  new IllegalArgumentException ("Invalid orientation: " + orientation);
685 }
686 }, "java.awt.Rectangle,~N,~N");
687 Clazz_overrideMethod (c$, "getScrollableBlockIncrement", 
688 function (visibleRect, orientation, direction) {
689 switch (orientation) {
690 case 1:
691 return visibleRect.height;
692 case 0:
693 return visibleRect.width;
694 default:
695 throw  new IllegalArgumentException ("Invalid orientation: " + orientation);
696 }
697 }, "java.awt.Rectangle,~N,~N");
698 Clazz_overrideMethod (c$, "getScrollableTracksViewportWidth", 
699 function () {
700 if (Clazz_instanceOf (this.getParent (), javax.swing.JViewport)) {
701 return ((this.getParent ()).getWidth () > this.getPreferredSize ().width);
702 }return false;
703 });
704 Clazz_overrideMethod (c$, "getScrollableTracksViewportHeight", 
705 function () {
706 if (Clazz_instanceOf (this.getParent (), javax.swing.JViewport)) {
707 return ((this.getParent ()).getHeight () > this.getPreferredSize ().height);
708 }return false;
709 });
710 Clazz_defineMethod (c$, "paramString", 
711 function () {
712 var editableString = (this.editable ? "true" : "false");
713 var caretColorString = (this.caretColor != null ? this.caretColor.toString () : "");
714 var selectionColorString = (this.selectionColor != null ? this.selectionColor.toString () : "");
715 var selectedTextColorString = (this.selectedTextColor != null ? this.selectedTextColor.toString () : "");
716 var disabledTextColorString = (this.disabledTextColor != null ? this.disabledTextColor.toString () : "");
717 var marginString = (this.margin != null ? this.margin.toString () : "");
718 return Clazz_superCall (this, javax.swing.text.JTextComponent, "paramString", []) + ",caretColor=" + caretColorString + ",disabledTextColor=" + disabledTextColorString + ",editable=" + editableString + ",margin=" + marginString + ",selectedTextColor=" + selectedTextColorString + ",selectionColor=" + selectionColorString;
719 });
720 c$.getFocusedComponent = Clazz_defineMethod (c$, "getFocusedComponent", 
721 function () {
722 return jssun.awt.AppContext.getAppContext ().get (javax.swing.text.JTextComponent.FOCUSED_COMPONENT);
723 });
724 Clazz_defineMethod (c$, "addInputMethodListener", 
725 function (l) {
726 Clazz_superCall (this, javax.swing.text.JTextComponent, "addInputMethodListener", [l]);
727 if (l != null) {
728 }}, "java.awt.event.InputMethodListener");
729 Clazz_defineMethod (c$, "saveComposedText", 
730  function (pos) {
731 if (this.composedTextExists ()) {
732 var start = this.composedTextStart.getOffset ();
733 var len = this.composedTextEnd.getOffset () - this.composedTextStart.getOffset ();
734 if (pos >= start && pos <= start + len) {
735 try {
736 this.getDocument ().remove (start, len);
737 return true;
738 } catch (ble) {
739 if (Clazz_exceptionOf (ble, javax.swing.text.BadLocationException)) {
740 } else {
741 throw ble;
742 }
743 }
744 }}return false;
745 }, "~N");
746 Clazz_defineMethod (c$, "restoreComposedText", 
747  function () {
748 var doc = this.getDocument ();
749 try {
750 doc.insertString (this.caret.getDot (), this.composedTextContent, this.composedTextAttribute);
751 this.composedTextStart = doc.createPosition (this.caret.getDot () - this.composedTextContent.length);
752 this.composedTextEnd = doc.createPosition (this.caret.getDot ());
753 } catch (ble) {
754 if (Clazz_exceptionOf (ble, javax.swing.text.BadLocationException)) {
755 } else {
756 throw ble;
757 }
758 }
759 });
760 Clazz_defineMethod (c$, "composedTextExists", 
761 function () {
762 return (this.composedTextStart != null);
763 });
764 Clazz_pu$h(self.c$);
765 c$ = Clazz_decorateAsClass (function () {
766 this.key = null;
767 this.actionName = null;
768 Clazz_instantialize (this, arguments);
769 }, javax.swing.text.JTextComponent, "KeyBinding");
770 Clazz_makeConstructor (c$, 
771 function (a, b) {
772 this.key = a;
773 this.actionName = b;
774 }, "javax.swing.KeyStroke,~S");
775 c$ = Clazz_p0p ();
776 Clazz_pu$h(self.c$);
777 c$ = Clazz_decorateAsClass (function () {
778 this.nm = null;
779 this.parent = null;
780 this.bindings = null;
781 this.defaultAction = null;
782 Clazz_instantialize (this, arguments);
783 }, javax.swing.text.JTextComponent, "DefaultKeymap", null, javax.swing.text.Keymap);
784 Clazz_makeConstructor (c$, 
785 function (a, b) {
786 this.nm = a;
787 this.parent = b;
788 this.bindings =  new java.util.Hashtable ();
789 }, "~S,javax.swing.text.Keymap");
790 Clazz_defineMethod (c$, "getDefaultAction", 
791 function () {
792 if (this.defaultAction != null) {
793 return this.defaultAction;
794 }return (this.parent != null) ? this.parent.getDefaultAction () : null;
795 });
796 Clazz_overrideMethod (c$, "setDefaultAction", 
797 function (a) {
798 this.defaultAction = a;
799 }, "javax.swing.Action");
800 Clazz_overrideMethod (c$, "getName", 
801 function () {
802 return this.nm;
803 });
804 Clazz_defineMethod (c$, "getAction", 
805 function (a) {
806 var b = this.bindings.get (a);
807 if ((b == null) && (this.parent != null)) {
808 b = this.parent.getAction (a);
809 }return b;
810 }, "javax.swing.KeyStroke");
811 Clazz_overrideMethod (c$, "getBoundKeyStrokes", 
812 function () {
813 var a =  new Array (this.bindings.size ());
814 var b = 0;
815 for (var c = this.bindings.keys (); c.hasMoreElements (); ) {
816 a[b++] = c.nextElement ();
817 }
818 return a;
819 });
820 Clazz_overrideMethod (c$, "getBoundActions", 
821 function () {
822 var a =  new Array (this.bindings.size ());
823 var b = 0;
824 for (var c = this.bindings.elements (); c.hasMoreElements (); ) {
825 a[b++] = c.nextElement ();
826 }
827 return a;
828 });
829 Clazz_defineMethod (c$, "getKeyStrokesForAction", 
830 function (a) {
831 if (a == null) {
832 return null;
833 }var b = null;
834 var c = null;
835 for (var d = this.bindings.keys (); d.hasMoreElements (); ) {
836 var e = d.nextElement ();
837 if (this.bindings.get (e) === a) {
838 if (c == null) {
839 c =  new java.util.Vector ();
840 }c.addElement (e);
841 }}
842 if (this.parent != null) {
843 var e = this.parent.getKeyStrokesForAction (a);
844 if (e != null) {
845 var f = 0;
846 for (var g = e.length - 1; g >= 0; g--) {
847 if (this.isLocallyDefined (e[g])) {
848 e[g] = null;
849 f++;
850 }}
851 if (f > 0 && f < e.length) {
852 if (c == null) {
853 c =  new java.util.Vector ();
854 }for (var h = e.length - 1; h >= 0; h--) {
855 if (e[h] != null) {
856 c.addElement (e[h]);
857 }}
858 } else if (f == 0) {
859 if (c == null) {
860 b = e;
861 } else {
862 b =  new Array (c.size () + e.length);
863 c.copyInto (b);
864 System.arraycopy (e, 0, b, c.size (), e.length);
865 c = null;
866 }}}}if (c != null) {
867 b =  new Array (c.size ());
868 c.copyInto (b);
869 }return b;
870 }, "javax.swing.Action");
871 Clazz_overrideMethod (c$, "isLocallyDefined", 
872 function (a) {
873 return this.bindings.containsKey (a);
874 }, "javax.swing.KeyStroke");
875 Clazz_overrideMethod (c$, "addActionForKeyStroke", 
876 function (a, b) {
877 this.bindings.put (a, b);
878 }, "javax.swing.KeyStroke,javax.swing.Action");
879 Clazz_overrideMethod (c$, "removeKeyStrokeBinding", 
880 function (a) {
881 this.bindings.remove (a);
882 }, "javax.swing.KeyStroke");
883 Clazz_overrideMethod (c$, "removeBindings", 
884 function () {
885 this.bindings.clear ();
886 });
887 Clazz_overrideMethod (c$, "getResolveParent", 
888 function () {
889 return this.parent;
890 });
891 Clazz_overrideMethod (c$, "setResolveParent", 
892 function (a) {
893 this.parent = a;
894 }, "javax.swing.text.Keymap");
895 Clazz_overrideMethod (c$, "toString", 
896 function () {
897 return "Keymap[" + this.nm + "]" + this.bindings;
898 });
899 c$ = Clazz_p0p ();
900 Clazz_pu$h(self.c$);
901 c$ = Clazz_decorateAsClass (function () {
902 this.keymap = null;
903 Clazz_instantialize (this, arguments);
904 }, javax.swing.text.JTextComponent, "KeymapWrapper", javax.swing.InputMap);
905 Clazz_makeConstructor (c$, 
906 function (a) {
907 Clazz_superConstructor (this, javax.swing.text.JTextComponent.KeymapWrapper, []);
908 this.keymap = a;
909 }, "javax.swing.text.Keymap");
910 Clazz_defineMethod (c$, "keys", 
911 function () {
912 var a = Clazz_superCall (this, javax.swing.text.JTextComponent.KeymapWrapper, "keys", []);
913 var b = this.keymap.getBoundKeyStrokes ();
914 var c = (a == null) ? 0 : a.length;
915 var d = (b == null) ? 0 : b.length;
916 if (c == 0) {
917 return b;
918 }if (d == 0) {
919 return a;
920 }var e =  new Array (c + d);
921 System.arraycopy (a, 0, e, 0, c);
922 System.arraycopy (b, 0, e, c, d);
923 return e;
924 });
925 Clazz_defineMethod (c$, "size", 
926 function () {
927 var a = this.keymap.getBoundKeyStrokes ();
928 var b = (a == null) ? 0 : a.length;
929 return Clazz_superCall (this, javax.swing.text.JTextComponent.KeymapWrapper, "size", []) + b;
930 });
931 Clazz_defineMethod (c$, "get", 
932 function (a) {
933 var b = this.keymap.getAction (a);
934 if (b == null) {
935 b = Clazz_superCall (this, javax.swing.text.JTextComponent.KeymapWrapper, "get", [a]);
936 if (b == null && a.getKeyChar () != '\uffff' && this.keymap.getDefaultAction () != null) {
937 b = javax.swing.text.JTextComponent.KeymapWrapper.DefaultActionKey;
938 }}return b;
939 }, "javax.swing.KeyStroke");
940 c$.DefaultActionKey = c$.prototype.DefaultActionKey =  new Clazz._O ();
941 c$ = Clazz_p0p ();
942 Clazz_pu$h(self.c$);
943 c$ = Clazz_decorateAsClass (function () {
944 this.keymap = null;
945 Clazz_instantialize (this, arguments);
946 }, javax.swing.text.JTextComponent, "KeymapActionMap", javax.swing.ActionMap);
947 Clazz_makeConstructor (c$, 
948 function (a) {
949 Clazz_superConstructor (this, javax.swing.text.JTextComponent.KeymapActionMap, []);
950 this.keymap = a;
951 }, "javax.swing.text.Keymap");
952 Clazz_defineMethod (c$, "keys", 
953 function () {
954 var a = Clazz_superCall (this, javax.swing.text.JTextComponent.KeymapActionMap, "keys", []);
955 var b = this.keymap.getBoundActions ();
956 var c = (a == null) ? 0 : a.length;
957 var d = (b == null) ? 0 : b.length;
958 var e = (this.keymap.getDefaultAction () != null);
959 if (e) {
960 d++;
961 }if (c == 0) {
962 if (e) {
963 var f =  new Array (d);
964 if (d > 1) {
965 System.arraycopy (b, 0, f, 0, d - 1);
966 }f[d - 1] = javax.swing.text.JTextComponent.KeymapWrapper.DefaultActionKey;
967 return f;
968 }return b;
969 }if (d == 0) {
970 return a;
971 }var f =  new Array (c + d);
972 System.arraycopy (a, 0, f, 0, c);
973 if (e) {
974 if (d > 1) {
975 System.arraycopy (b, 0, f, c, d - 1);
976 }f[c + d - 1] = javax.swing.text.JTextComponent.KeymapWrapper.DefaultActionKey;
977 } else {
978 System.arraycopy (b, 0, f, c, d);
979 }return f;
980 });
981 Clazz_defineMethod (c$, "size", 
982 function () {
983 var a = this.keymap.getBoundActions ();
984 var b = (a == null) ? 0 : a.length;
985 if (this.keymap.getDefaultAction () != null) {
986 b++;
987 }return Clazz_superCall (this, javax.swing.text.JTextComponent.KeymapActionMap, "size", []) + b;
988 });
989 Clazz_defineMethod (c$, "get", 
990 function (a) {
991 var b = Clazz_superCall (this, javax.swing.text.JTextComponent.KeymapActionMap, "get", [a]);
992 if (b == null) {
993 if (a === javax.swing.text.JTextComponent.KeymapWrapper.DefaultActionKey) {
994 b = this.keymap.getDefaultAction ();
995 } else if (Clazz_instanceOf (a, javax.swing.Action)) {
996 b = a;
997 }}return b;
998 }, "~O");
999 c$ = Clazz_p0p ();
1000 Clazz_pu$h(self.c$);
1001 c$ = Clazz_decorateAsClass (function () {
1002 this.dragActive = false;
1003 this.dot = 0;
1004 this.mark = 0;
1005 Clazz_instantialize (this, arguments);
1006 }, javax.swing.text.JTextComponent, "MutableCaretEvent", javax.swing.event.CaretEvent, [javax.swing.event.ChangeListener, java.awt.event.FocusListener, java.awt.event.MouseListener]);
1007 Clazz_defineMethod (c$, "fire", 
1008 function () {
1009 var a = this.getSource ();
1010 if (a != null) {
1011 var b = a.getCaret ();
1012 if (b != null) {
1013 this.dot = b.getDot ();
1014 this.mark = b.getMark ();
1015 a.fireCaretUpdate (this);
1016 }}});
1017 Clazz_overrideMethod (c$, "toString", 
1018 function () {
1019 return "dot=" + this.dot + "," + "mark=" + this.mark;
1020 });
1021 Clazz_overrideMethod (c$, "getDot", 
1022 function () {
1023 return this.dot;
1024 });
1025 Clazz_overrideMethod (c$, "getMark", 
1026 function () {
1027 return this.mark;
1028 });
1029 Clazz_overrideMethod (c$, "stateChanged", 
1030 function (a) {
1031 if (!this.dragActive) {
1032 this.fire ();
1033 }}, "javax.swing.event.ChangeEvent");
1034 Clazz_overrideMethod (c$, "focusGained", 
1035 function (a) {
1036 jssun.awt.AppContext.getAppContext ().put (javax.swing.text.JTextComponent.FOCUSED_COMPONENT, a.getSource ());
1037 }, "java.awt.event.FocusEvent");
1038 Clazz_overrideMethod (c$, "focusLost", 
1039 function (a) {
1040 }, "java.awt.event.FocusEvent");
1041 Clazz_overrideMethod (c$, "mousePressed", 
1042 function (a) {
1043 this.dragActive = true;
1044 }, "java.awt.event.MouseEvent");
1045 Clazz_overrideMethod (c$, "mouseReleased", 
1046 function (a) {
1047 this.dragActive = false;
1048 this.fire ();
1049 }, "java.awt.event.MouseEvent");
1050 Clazz_overrideMethod (c$, "mouseClicked", 
1051 function (a) {
1052 }, "java.awt.event.MouseEvent");
1053 Clazz_overrideMethod (c$, "mouseEntered", 
1054 function (a) {
1055 }, "java.awt.event.MouseEvent");
1056 Clazz_overrideMethod (c$, "mouseExited", 
1057 function (a) {
1058 }, "java.awt.event.MouseEvent");
1059 c$ = Clazz_p0p ();
1060 Clazz_defineStatics (c$,
1061 "FOCUS_ACCELERATOR_KEY", "focusAcceleratorKey");
1062 c$.KEYMAP_TABLE = c$.prototype.KEYMAP_TABLE =  new Clazz._O ();
1063 c$.FOCUSED_COMPONENT = c$.prototype.FOCUSED_COMPONENT =  new Clazz._O ();
1064 Clazz_defineStatics (c$,
1065 "DEFAULT_KEYMAP", "default");
1066 });
1067 Clazz_declarePackage ("javax.swing.text");
1068 Clazz_declareInterface (javax.swing.text, "Keymap");
1069 Clazz_declarePackage ("javax.swing.text");
1070 Clazz_load (["javax.swing.text.EditorKit", "$.TextAction"], "javax.swing.text.DefaultEditorKit", ["java.io.InputStreamReader", "$.OutputStreamWriter", "java.awt.ComponentOrientation", "$.Point", "$.Rectangle", "javax.swing.UIManager", "javax.swing.text.BadLocationException", "$.DefaultCaret", "$.Position", "$.Segment", "$.Utilities", "swingjs.JSPlainDocument"], function () {
1071 c$ = Clazz_declareType (javax.swing.text, "DefaultEditorKit", javax.swing.text.EditorKit);
1072 Clazz_makeConstructor (c$, 
1073 function () {
1074 Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit, []);
1075 });
1076 Clazz_overrideMethod (c$, "getContentType", 
1077 function () {
1078 return "text/plain";
1079 });
1080 Clazz_overrideMethod (c$, "getViewFactory", 
1081 function () {
1082 return null;
1083 });
1084 Clazz_overrideMethod (c$, "getActions", 
1085 function () {
1086 return javax.swing.text.DefaultEditorKit.defaultActions;
1087 });
1088 Clazz_overrideMethod (c$, "createCaret", 
1089 function () {
1090 return null;
1091 });
1092 Clazz_overrideMethod (c$, "createDefaultDocument", 
1093 function () {
1094 return  new swingjs.JSPlainDocument ();
1095 });
1096 Clazz_defineMethod (c$, "read", 
1097 function ($in, doc, pos) {
1098 this.read ( new java.io.InputStreamReader ($in), doc, pos);
1099 }, "java.io.InputStream,javax.swing.text.Document,~N");
1100 Clazz_defineMethod (c$, "write", 
1101 function (out, doc, pos, len) {
1102 var osw =  new java.io.OutputStreamWriter (out);
1103 this.write (osw, doc, pos, len);
1104 osw.flush ();
1105 }, "java.io.OutputStream,javax.swing.text.Document,~N,~N");
1106 Clazz_defineMethod (c$, "getInputAttributes", 
1107 function () {
1108 return null;
1109 });
1110 Clazz_defineMethod (c$, "read", 
1111 function ($in, doc, pos) {
1112 var buff =  Clazz_newCharArray (4096, '\0');
1113 var nch;
1114 var lastWasCR = false;
1115 var isCRLF = false;
1116 var isCR = false;
1117 var last;
1118 var wasEmpty = (doc.getLength () == 0);
1119 var attr = this.getInputAttributes ();
1120 while ((nch = $in.read (buff, 0, buff.length)) != -1) {
1121 last = 0;
1122 for (var counter = 0; counter < nch; counter++) {
1123 switch (buff[counter]) {
1124 case '\r':
1125 if (lastWasCR) {
1126 isCR = true;
1127 if (counter == 0) {
1128 doc.insertString (pos, "\n", attr);
1129 pos++;
1130 } else {
1131 buff[counter - 1] = '\n';
1132 }} else {
1133 lastWasCR = true;
1134 }break;
1135 case '\n':
1136 if (lastWasCR) {
1137 if (counter > (last + 1)) {
1138 doc.insertString (pos,  String.instantialize (buff, last, counter - last - 1), attr);
1139 pos += (counter - last - 1);
1140 }lastWasCR = false;
1141 last = counter;
1142 isCRLF = true;
1143 }break;
1144 default:
1145 if (lastWasCR) {
1146 isCR = true;
1147 if (counter == 0) {
1148 doc.insertString (pos, "\n", attr);
1149 pos++;
1150 } else {
1151 buff[counter - 1] = '\n';
1152 }lastWasCR = false;
1153 }break;
1154 }
1155 }
1156 if (last < nch) {
1157 if (lastWasCR) {
1158 if (last < (nch - 1)) {
1159 doc.insertString (pos,  String.instantialize (buff, last, nch - last - 1), attr);
1160 pos += (nch - last - 1);
1161 }} else {
1162 doc.insertString (pos,  String.instantialize (buff, last, nch - last), attr);
1163 pos += (nch - last);
1164 }}}
1165 if (lastWasCR) {
1166 doc.insertString (pos, "\n", attr);
1167 isCR = true;
1168 }if (wasEmpty) {
1169 if (isCRLF) {
1170 doc.putProperty ("__EndOfLine__", "\r\n");
1171 } else if (isCR) {
1172 doc.putProperty ("__EndOfLine__", "\r");
1173 } else {
1174 doc.putProperty ("__EndOfLine__", "\n");
1175 }}}, "java.io.Reader,javax.swing.text.Document,~N");
1176 Clazz_defineMethod (c$, "write", 
1177 function (out, doc, pos, len) {
1178 if ((pos < 0) || ((pos + len) > doc.getLength ())) {
1179 throw  new javax.swing.text.BadLocationException ("DefaultEditorKit.write", pos);
1180 }var data =  new javax.swing.text.Segment ();
1181 var nleft = len;
1182 var offs = pos;
1183 var endOfLineProperty = doc.getProperty ("__EndOfLine__");
1184 if (endOfLineProperty == null) {
1185 try {
1186 endOfLineProperty = System.getProperty ("line.separator");
1187 } catch (se) {
1188 if (Clazz_exceptionOf (se, SecurityException)) {
1189 } else {
1190 throw se;
1191 }
1192 }
1193 }var endOfLine;
1194 if (Clazz_instanceOf (endOfLineProperty, String)) {
1195 endOfLine = endOfLineProperty;
1196 } else {
1197 endOfLine = null;
1198 }if (endOfLineProperty != null && !endOfLine.equals ("\n")) {
1199 while (nleft > 0) {
1200 var n = Math.min (nleft, 4096);
1201 doc.getText (offs, n, data);
1202 var last = data.offset;
1203 var array = data.array;
1204 var maxCounter = last + data.count;
1205 for (var counter = last; counter < maxCounter; counter++) {
1206 if (array[counter] == '\n') {
1207 if (counter > last) {
1208 out.write (array, last, counter - last);
1209 }out.write (endOfLine);
1210 last = counter + 1;
1211 }}
1212 if (maxCounter > last) {
1213 out.write (array, last, maxCounter - last);
1214 }offs += n;
1215 nleft -= n;
1216 }
1217 } else {
1218 while (nleft > 0) {
1219 var n = Math.min (nleft, 4096);
1220 doc.getText (offs, n, data);
1221 out.write (data.array, data.offset, data.count);
1222 offs += n;
1223 nleft -= n;
1224 }
1225 }out.flush ();
1226 }, "java.io.Writer,javax.swing.text.Document,~N,~N");
1227 Clazz_pu$h(self.c$);
1228 c$ = Clazz_declareType (javax.swing.text.DefaultEditorKit, "DefaultKeyTypedAction", javax.swing.text.TextAction);
1229 Clazz_makeConstructor (c$, 
1230 function () {
1231 Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.DefaultKeyTypedAction, ["default-typed"]);
1232 });
1233 Clazz_overrideMethod (c$, "actionPerformed", 
1234 function (a) {
1235 var b = this.getTextComponent (a);
1236 if ((b != null) && (a != null)) {
1237 if ((!b.isEditable ()) || (!b.isEnabled ())) {
1238 return;
1239 }var c = a.getActionCommand ();
1240 var d = a.getModifiers ();
1241 if ((c != null) && (c.length > 0) && ((d & 8) == (d & 2))) {
1242 var e = c.charAt (0);
1243 if ((e.charCodeAt (0) >= 0x20) && (e.charCodeAt (0) != 0x7F)) {
1244 b.replaceSelection (c);
1245 }}}}, "java.awt.event.ActionEvent");
1246 c$ = Clazz_p0p ();
1247 Clazz_pu$h(self.c$);
1248 c$ = Clazz_declareType (javax.swing.text.DefaultEditorKit, "InsertContentAction", javax.swing.text.TextAction);
1249 Clazz_makeConstructor (c$, 
1250 function () {
1251 Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.InsertContentAction, ["insert-content"]);
1252 });
1253 Clazz_overrideMethod (c$, "actionPerformed", 
1254 function (a) {
1255 var b = this.getTextComponent (a);
1256 if ((b != null) && (a != null)) {
1257 if ((!b.isEditable ()) || (!b.isEnabled ())) {
1258 javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (b);
1259 return;
1260 }var c = a.getActionCommand ();
1261 if (c != null) {
1262 b.replaceSelection (c);
1263 } else {
1264 javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (b);
1265 }}}, "java.awt.event.ActionEvent");
1266 c$ = Clazz_p0p ();
1267 Clazz_pu$h(self.c$);
1268 c$ = Clazz_declareType (javax.swing.text.DefaultEditorKit, "InsertBreakAction", javax.swing.text.TextAction);
1269 Clazz_makeConstructor (c$, 
1270 function () {
1271 Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.InsertBreakAction, ["insert-break"]);
1272 });
1273 Clazz_overrideMethod (c$, "actionPerformed", 
1274 function (a) {
1275 var b = this.getTextComponent (a);
1276 if (b != null) {
1277 if ((!b.isEditable ()) || (!b.isEnabled ())) {
1278 javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (b);
1279 return;
1280 }b.replaceSelection ("\n");
1281 }}, "java.awt.event.ActionEvent");
1282 c$ = Clazz_p0p ();
1283 Clazz_pu$h(self.c$);
1284 c$ = Clazz_declareType (javax.swing.text.DefaultEditorKit, "InsertTabAction", javax.swing.text.TextAction);
1285 Clazz_makeConstructor (c$, 
1286 function () {
1287 Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.InsertTabAction, ["insert-tab"]);
1288 });
1289 Clazz_overrideMethod (c$, "actionPerformed", 
1290 function (a) {
1291 var b = this.getTextComponent (a);
1292 if (b != null) {
1293 if ((!b.isEditable ()) || (!b.isEnabled ())) {
1294 javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (b);
1295 return;
1296 }b.replaceSelection ("\t");
1297 }}, "java.awt.event.ActionEvent");
1298 c$ = Clazz_p0p ();
1299 Clazz_pu$h(self.c$);
1300 c$ = Clazz_declareType (javax.swing.text.DefaultEditorKit, "DeletePrevCharAction", javax.swing.text.TextAction);
1301 Clazz_makeConstructor (c$, 
1302 function () {
1303 Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.DeletePrevCharAction, ["delete-previous"]);
1304 });
1305 Clazz_overrideMethod (c$, "actionPerformed", 
1306 function (a) {
1307 var b = this.getTextComponent (a);
1308 var c = true;
1309 if ((b != null) && (b.isEditable ())) {
1310 try {
1311 var d = b.getDocument ();
1312 var e = b.getCaret ();
1313 var f = e.getDot ();
1314 var g = e.getMark ();
1315 if (f != g) {
1316 d.remove (Math.min (f, g), Math.abs (f - g));
1317 c = false;
1318 } else if (f > 0) {
1319 var h = 1;
1320 if (f > 1) {
1321 var i = d.getText (f - 2, 2);
1322 var j = i.charAt (0);
1323 var k = i.charAt (1);
1324 if (j >= '\uD800' && j <= '\uDBFF' && k >= '\uDC00' && k <= '\uDFFF') {
1325 h = 2;
1326 }}d.remove (f - h, h);
1327 c = false;
1328 }} catch (bl) {
1329 if (Clazz_exceptionOf (bl, javax.swing.text.BadLocationException)) {
1330 } else {
1331 throw bl;
1332 }
1333 }
1334 }if (c) {
1335 javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (b);
1336 }}, "java.awt.event.ActionEvent");
1337 c$ = Clazz_p0p ();
1338 Clazz_pu$h(self.c$);
1339 c$ = Clazz_declareType (javax.swing.text.DefaultEditorKit, "DeleteNextCharAction", javax.swing.text.TextAction);
1340 Clazz_makeConstructor (c$, 
1341 function () {
1342 Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.DeleteNextCharAction, ["delete-next"]);
1343 });
1344 Clazz_overrideMethod (c$, "actionPerformed", 
1345 function (a) {
1346 var b = this.getTextComponent (a);
1347 var c = true;
1348 if ((b != null) && (b.isEditable ())) {
1349 try {
1350 var d = b.getDocument ();
1351 var e = b.getCaret ();
1352 var f = e.getDot ();
1353 var g = e.getMark ();
1354 if (f != g) {
1355 d.remove (Math.min (f, g), Math.abs (f - g));
1356 c = false;
1357 } else if (f < d.getLength ()) {
1358 var h = 1;
1359 if (f < d.getLength () - 1) {
1360 var i = d.getText (f, 2);
1361 var j = i.charAt (0);
1362 var k = i.charAt (1);
1363 if (j >= '\uD800' && j <= '\uDBFF' && k >= '\uDC00' && k <= '\uDFFF') {
1364 h = 2;
1365 }}d.remove (f, h);
1366 c = false;
1367 }} catch (bl) {
1368 if (Clazz_exceptionOf (bl, javax.swing.text.BadLocationException)) {
1369 } else {
1370 throw bl;
1371 }
1372 }
1373 }if (c) {
1374 javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (b);
1375 }}, "java.awt.event.ActionEvent");
1376 c$ = Clazz_p0p ();
1377 Clazz_pu$h(self.c$);
1378 c$ = Clazz_declareType (javax.swing.text.DefaultEditorKit, "ReadOnlyAction", javax.swing.text.TextAction);
1379 Clazz_makeConstructor (c$, 
1380 function () {
1381 Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.ReadOnlyAction, ["set-read-only"]);
1382 });
1383 Clazz_overrideMethod (c$, "actionPerformed", 
1384 function (a) {
1385 var b = this.getTextComponent (a);
1386 if (b != null) {
1387 b.setEditable (false);
1388 }}, "java.awt.event.ActionEvent");
1389 c$ = Clazz_p0p ();
1390 Clazz_pu$h(self.c$);
1391 c$ = Clazz_declareType (javax.swing.text.DefaultEditorKit, "WritableAction", javax.swing.text.TextAction);
1392 Clazz_makeConstructor (c$, 
1393 function () {
1394 Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.WritableAction, ["set-writable"]);
1395 });
1396 Clazz_overrideMethod (c$, "actionPerformed", 
1397 function (a) {
1398 var b = this.getTextComponent (a);
1399 if (b != null) {
1400 b.setEditable (true);
1401 }}, "java.awt.event.ActionEvent");
1402 c$ = Clazz_p0p ();
1403 Clazz_pu$h(self.c$);
1404 c$ = Clazz_declareType (javax.swing.text.DefaultEditorKit, "CutAction", javax.swing.text.TextAction);
1405 Clazz_makeConstructor (c$, 
1406 function () {
1407 Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.CutAction, ["cut-to-clipboard"]);
1408 });
1409 Clazz_overrideMethod (c$, "actionPerformed", 
1410 function (a) {
1411 var b = this.getTextComponent (a);
1412 if (b != null) {
1413 b.cut ();
1414 }}, "java.awt.event.ActionEvent");
1415 c$ = Clazz_p0p ();
1416 Clazz_pu$h(self.c$);
1417 c$ = Clazz_declareType (javax.swing.text.DefaultEditorKit, "CopyAction", javax.swing.text.TextAction);
1418 Clazz_makeConstructor (c$, 
1419 function () {
1420 Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.CopyAction, ["copy-to-clipboard"]);
1421 });
1422 Clazz_overrideMethod (c$, "actionPerformed", 
1423 function (a) {
1424 var b = this.getTextComponent (a);
1425 if (b != null) {
1426 b.copy ();
1427 }}, "java.awt.event.ActionEvent");
1428 c$ = Clazz_p0p ();
1429 Clazz_pu$h(self.c$);
1430 c$ = Clazz_declareType (javax.swing.text.DefaultEditorKit, "PasteAction", javax.swing.text.TextAction);
1431 Clazz_makeConstructor (c$, 
1432 function () {
1433 Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.PasteAction, ["paste-from-clipboard"]);
1434 });
1435 Clazz_overrideMethod (c$, "actionPerformed", 
1436 function (a) {
1437 var b = this.getTextComponent (a);
1438 if (b != null) {
1439 b.paste ();
1440 }}, "java.awt.event.ActionEvent");
1441 c$ = Clazz_p0p ();
1442 Clazz_pu$h(self.c$);
1443 c$ = Clazz_declareType (javax.swing.text.DefaultEditorKit, "BeepAction", javax.swing.text.TextAction);
1444 Clazz_makeConstructor (c$, 
1445 function () {
1446 Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.BeepAction, ["beep"]);
1447 });
1448 Clazz_overrideMethod (c$, "actionPerformed", 
1449 function (a) {
1450 var b = this.getTextComponent (a);
1451 javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (b);
1452 }, "java.awt.event.ActionEvent");
1453 c$ = Clazz_p0p ();
1454 Clazz_pu$h(self.c$);
1455 c$ = Clazz_decorateAsClass (function () {
1456 this.select = false;
1457 this.direction = 0;
1458 Clazz_instantialize (this, arguments);
1459 }, javax.swing.text.DefaultEditorKit, "VerticalPageAction", javax.swing.text.TextAction);
1460 Clazz_makeConstructor (c$, 
1461 function (a, b, c) {
1462 Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.VerticalPageAction, [a]);
1463 this.select = c;
1464 this.direction = b;
1465 }, "~S,~N,~B");
1466 Clazz_overrideMethod (c$, "actionPerformed", 
1467 function (a) {
1468 var b = this.getTextComponent (a);
1469 if (b != null) {
1470 var c = b.getVisibleRect ();
1471 var d =  new java.awt.Rectangle (c);
1472 var e = b.getCaretPosition ();
1473 var f = this.direction * b.getScrollableBlockIncrement (c, 1, this.direction);
1474 var g = c.y;
1475 var h = b.getCaret ();
1476 var i = h.getMagicCaretPosition ();
1477 if (e != -1) {
1478 try {
1479 var j = b.modelToView (e);
1480 var k = (i != null) ? i.x : j.x;
1481 var l = j.height;
1482 if (l > 0) {
1483 f = Clazz_doubleToInt (f / l) * l;
1484 }d.y = this.constrainY (b, g + f, c.height);
1485 var m;
1486 if (c.contains (j.x, j.y)) {
1487 m = b.viewToModel ( new java.awt.Point (k, this.constrainY (b, j.y + f, 0)));
1488 } else {
1489 if (this.direction == -1) {
1490 m = b.viewToModel ( new java.awt.Point (k, d.y));
1491 } else {
1492 m = b.viewToModel ( new java.awt.Point (k, d.y + c.height));
1493 }}m = this.constrainOffset (b, m);
1494 if (m != e) {
1495 this.adjustScrollIfNecessary (b, d, g, m);
1496 if (this.select) {
1497 b.moveCaretPosition (m);
1498 } else {
1499 b.setCaretPosition (m);
1500 }}} catch (ble) {
1501 if (Clazz_exceptionOf (ble, javax.swing.text.BadLocationException)) {
1502 } else {
1503 throw ble;
1504 }
1505 }
1506 } else {
1507 d.y = this.constrainY (b, g + f, c.height);
1508 }if (i != null) {
1509 h.setMagicCaretPosition (i);
1510 }b.scrollRectToVisible (d);
1511 }}, "java.awt.event.ActionEvent");
1512 Clazz_defineMethod (c$, "constrainY", 
1513  function (a, b, c) {
1514 if (b < 0) {
1515 b = 0;
1516 } else if (b + c > a.getHeight ()) {
1517 b = Math.max (0, a.getHeight () - c);
1518 }return b;
1519 }, "javax.swing.text.JTextComponent,~N,~N");
1520 Clazz_defineMethod (c$, "constrainOffset", 
1521  function (a, b) {
1522 var c = a.getDocument ();
1523 if ((b != 0) && (b > c.getLength ())) {
1524 b = c.getLength ();
1525 }if (b < 0) {
1526 b = 0;
1527 }return b;
1528 }, "javax.swing.text.JTextComponent,~N");
1529 Clazz_defineMethod (c$, "adjustScrollIfNecessary", 
1530  function (a, b, c, d) {
1531 try {
1532 var e = a.modelToView (d);
1533 if (e.y < b.y || (e.y > (b.y + b.height)) || (e.y + e.height) > (b.y + b.height)) {
1534 var f;
1535 if (e.y < b.y) {
1536 f = e.y;
1537 } else {
1538 f = e.y + e.height - b.height;
1539 }if ((this.direction == -1 && f < c) || (this.direction == 1 && f > c)) {
1540 b.y = f;
1541 }}} catch (ble) {
1542 if (Clazz_exceptionOf (ble, javax.swing.text.BadLocationException)) {
1543 } else {
1544 throw ble;
1545 }
1546 }
1547 }, "javax.swing.text.JTextComponent,java.awt.Rectangle,~N,~N");
1548 c$ = Clazz_p0p ();
1549 Clazz_pu$h(self.c$);
1550 c$ = Clazz_decorateAsClass (function () {
1551 this.select = false;
1552 this.left = false;
1553 Clazz_instantialize (this, arguments);
1554 }, javax.swing.text.DefaultEditorKit, "PageAction", javax.swing.text.TextAction);
1555 Clazz_makeConstructor (c$, 
1556 function (a, b, c) {
1557 Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.PageAction, [a]);
1558 this.select = c;
1559 this.left = b;
1560 }, "~S,~B,~B");
1561 Clazz_overrideMethod (c$, "actionPerformed", 
1562 function (a) {
1563 var b = this.getTextComponent (a);
1564 if (b != null) {
1565 var c;
1566 var d =  new java.awt.Rectangle ();
1567 b.computeVisibleRect (d);
1568 if (this.left) {
1569 d.x = Math.max (0, d.x - d.width);
1570 } else {
1571 d.x += d.width;
1572 }c = b.getCaretPosition ();
1573 if (c != -1) {
1574 if (this.left) {
1575 c = b.viewToModel ( new java.awt.Point (d.x, d.y));
1576 } else {
1577 c = b.viewToModel ( new java.awt.Point (d.x + d.width - 1, d.y + d.height - 1));
1578 }var e = b.getDocument ();
1579 if ((c != 0) && (c > (e.getLength () - 1))) {
1580 c = e.getLength () - 1;
1581 } else if (c < 0) {
1582 c = 0;
1583 }if (this.select) b.moveCaretPosition (c);
1584  else b.setCaretPosition (c);
1585 }}}, "java.awt.event.ActionEvent");
1586 c$ = Clazz_p0p ();
1587 Clazz_pu$h(self.c$);
1588 c$ = Clazz_decorateAsClass (function () {
1589 this.select = false;
1590 this.direction = 0;
1591 Clazz_instantialize (this, arguments);
1592 }, javax.swing.text.DefaultEditorKit, "NextVisualPositionAction", javax.swing.text.TextAction);
1593 Clazz_makeConstructor (c$, 
1594 function (a, b, c) {
1595 Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.NextVisualPositionAction, [a]);
1596 this.select = b;
1597 this.direction = c;
1598 }, "~S,~B,~N");
1599 Clazz_overrideMethod (c$, "actionPerformed", 
1600 function (a) {
1601 var b = this.getTextComponent (a);
1602 if (b != null) {
1603 var c = b.getCaret ();
1604 var d = (Clazz_instanceOf (c, javax.swing.text.DefaultCaret)) ? c : null;
1605 var e = c.getDot ();
1606 var f =  new Array (1);
1607 var g = c.getMagicCaretPosition ();
1608 try {
1609 if (g == null && (this.direction == 1 || this.direction == 5)) {
1610 var h = (d != null) ? b.getUI ().modelToView (b, e, d.getDotBias ()) : b.modelToView (e);
1611 g =  new java.awt.Point (h.x, h.y);
1612 }var h = b.getNavigationFilter ();
1613 if (h != null) {
1614 e = h.getNextVisualPositionFrom (b, e, (d != null) ? d.getDotBias () : javax.swing.text.Position.Bias.Forward, this.direction, f);
1615 } else {
1616 e = b.getUI ().getNextVisualPositionFrom (b, e, (d != null) ? d.getDotBias () : javax.swing.text.Position.Bias.Forward, this.direction, f);
1617 }if (f[0] == null) {
1618 f[0] = javax.swing.text.Position.Bias.Forward;
1619 }if (d != null) {
1620 if (this.select) {
1621 d.moveDot (e, f[0]);
1622 } else {
1623 d.setDot (e, f[0]);
1624 }} else {
1625 if (this.select) {
1626 c.moveDot (e);
1627 } else {
1628 c.setDot (e);
1629 }}if (g != null && (this.direction == 1 || this.direction == 5)) {
1630 b.getCaret ().setMagicCaretPosition (g);
1631 }} catch (ex) {
1632 if (Clazz_exceptionOf (ex, javax.swing.text.BadLocationException)) {
1633 } else {
1634 throw ex;
1635 }
1636 }
1637 }}, "java.awt.event.ActionEvent");
1638 c$ = Clazz_p0p ();
1639 Clazz_pu$h(self.c$);
1640 c$ = Clazz_decorateAsClass (function () {
1641 this.select = false;
1642 Clazz_instantialize (this, arguments);
1643 }, javax.swing.text.DefaultEditorKit, "BeginWordAction", javax.swing.text.TextAction);
1644 Clazz_makeConstructor (c$, 
1645 function (a, b) {
1646 Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.BeginWordAction, [a]);
1647 this.select = b;
1648 }, "~S,~B");
1649 Clazz_overrideMethod (c$, "actionPerformed", 
1650 function (a) {
1651 var b = this.getTextComponent (a);
1652 if (b != null) {
1653 try {
1654 var c = b.getCaretPosition ();
1655 var d = javax.swing.text.Utilities.getWordStart (b, c);
1656 if (this.select) {
1657 b.moveCaretPosition (d);
1658 } else {
1659 b.setCaretPosition (d);
1660 }} catch (bl) {
1661 if (Clazz_exceptionOf (bl, javax.swing.text.BadLocationException)) {
1662 javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (b);
1663 } else {
1664 throw bl;
1665 }
1666 }
1667 }}, "java.awt.event.ActionEvent");
1668 c$ = Clazz_p0p ();
1669 Clazz_pu$h(self.c$);
1670 c$ = Clazz_decorateAsClass (function () {
1671 this.select = false;
1672 Clazz_instantialize (this, arguments);
1673 }, javax.swing.text.DefaultEditorKit, "EndWordAction", javax.swing.text.TextAction);
1674 Clazz_makeConstructor (c$, 
1675 function (a, b) {
1676 Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.EndWordAction, [a]);
1677 this.select = b;
1678 }, "~S,~B");
1679 Clazz_overrideMethod (c$, "actionPerformed", 
1680 function (a) {
1681 var b = this.getTextComponent (a);
1682 if (b != null) {
1683 try {
1684 var c = b.getCaretPosition ();
1685 var d = javax.swing.text.Utilities.getWordEnd (b, c);
1686 if (this.select) {
1687 b.moveCaretPosition (d);
1688 } else {
1689 b.setCaretPosition (d);
1690 }} catch (bl) {
1691 if (Clazz_exceptionOf (bl, javax.swing.text.BadLocationException)) {
1692 javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (b);
1693 } else {
1694 throw bl;
1695 }
1696 }
1697 }}, "java.awt.event.ActionEvent");
1698 c$ = Clazz_p0p ();
1699 Clazz_pu$h(self.c$);
1700 c$ = Clazz_decorateAsClass (function () {
1701 this.select = false;
1702 Clazz_instantialize (this, arguments);
1703 }, javax.swing.text.DefaultEditorKit, "PreviousWordAction", javax.swing.text.TextAction);
1704 Clazz_makeConstructor (c$, 
1705 function (a, b) {
1706 Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.PreviousWordAction, [a]);
1707 this.select = b;
1708 }, "~S,~B");
1709 Clazz_overrideMethod (c$, "actionPerformed", 
1710 function (a) {
1711 var b = this.getTextComponent (a);
1712 if (b != null) {
1713 var c = b.getCaretPosition ();
1714 var d = false;
1715 try {
1716 var e = javax.swing.text.Utilities.getParagraphElement (b, c);
1717 c = javax.swing.text.Utilities.getPreviousWord (b, c);
1718 if (c < e.getStartOffset ()) {
1719 c = javax.swing.text.Utilities.getParagraphElement (b, c).getEndOffset () - 1;
1720 }} catch (bl) {
1721 if (Clazz_exceptionOf (bl, javax.swing.text.BadLocationException)) {
1722 if (c != 0) {
1723 c = 0;
1724 } else {
1725 d = true;
1726 }} else {
1727 throw bl;
1728 }
1729 }
1730 if (!d) {
1731 if (this.select) {
1732 b.moveCaretPosition (c);
1733 } else {
1734 b.setCaretPosition (c);
1735 }} else {
1736 javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (b);
1737 }}}, "java.awt.event.ActionEvent");
1738 c$ = Clazz_p0p ();
1739 Clazz_pu$h(self.c$);
1740 c$ = Clazz_decorateAsClass (function () {
1741 this.select = false;
1742 Clazz_instantialize (this, arguments);
1743 }, javax.swing.text.DefaultEditorKit, "NextWordAction", javax.swing.text.TextAction);
1744 Clazz_makeConstructor (c$, 
1745 function (a, b) {
1746 Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.NextWordAction, [a]);
1747 this.select = b;
1748 }, "~S,~B");
1749 Clazz_overrideMethod (c$, "actionPerformed", 
1750 function (a) {
1751 var b = this.getTextComponent (a);
1752 if (b != null) {
1753 var c = b.getCaretPosition ();
1754 var d = false;
1755 var e = c;
1756 var f = javax.swing.text.Utilities.getParagraphElement (b, c);
1757 try {
1758 c = javax.swing.text.Utilities.getNextWord (b, c);
1759 if (c >= f.getEndOffset () && e != f.getEndOffset () - 1) {
1760 c = f.getEndOffset () - 1;
1761 }} catch (bl) {
1762 if (Clazz_exceptionOf (bl, javax.swing.text.BadLocationException)) {
1763 var g = b.getDocument ().getLength ();
1764 if (c != g) {
1765 if (e != f.getEndOffset () - 1) {
1766 c = f.getEndOffset () - 1;
1767 } else {
1768 c = g;
1769 }} else {
1770 d = true;
1771 }} else {
1772 throw bl;
1773 }
1774 }
1775 if (!d) {
1776 if (this.select) {
1777 b.moveCaretPosition (c);
1778 } else {
1779 b.setCaretPosition (c);
1780 }} else {
1781 javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (b);
1782 }}}, "java.awt.event.ActionEvent");
1783 c$ = Clazz_p0p ();
1784 Clazz_pu$h(self.c$);
1785 c$ = Clazz_decorateAsClass (function () {
1786 this.select = false;
1787 Clazz_instantialize (this, arguments);
1788 }, javax.swing.text.DefaultEditorKit, "BeginLineAction", javax.swing.text.TextAction);
1789 Clazz_makeConstructor (c$, 
1790 function (a, b) {
1791 Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.BeginLineAction, [a]);
1792 this.select = b;
1793 }, "~S,~B");
1794 Clazz_overrideMethod (c$, "actionPerformed", 
1795 function (a) {
1796 var b = this.getTextComponent (a);
1797 if (b != null) {
1798 try {
1799 var c = b.getCaretPosition ();
1800 var d = javax.swing.text.Utilities.getRowStart (b, c);
1801 if (this.select) {
1802 b.moveCaretPosition (d);
1803 } else {
1804 b.setCaretPosition (d);
1805 }} catch (bl) {
1806 if (Clazz_exceptionOf (bl, javax.swing.text.BadLocationException)) {
1807 javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (b);
1808 } else {
1809 throw bl;
1810 }
1811 }
1812 }}, "java.awt.event.ActionEvent");
1813 c$ = Clazz_p0p ();
1814 Clazz_pu$h(self.c$);
1815 c$ = Clazz_decorateAsClass (function () {
1816 this.select = false;
1817 Clazz_instantialize (this, arguments);
1818 }, javax.swing.text.DefaultEditorKit, "EndLineAction", javax.swing.text.TextAction);
1819 Clazz_makeConstructor (c$, 
1820 function (a, b) {
1821 Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.EndLineAction, [a]);
1822 this.select = b;
1823 }, "~S,~B");
1824 Clazz_overrideMethod (c$, "actionPerformed", 
1825 function (a) {
1826 var b = this.getTextComponent (a);
1827 if (b != null) {
1828 try {
1829 var c = b.getCaretPosition ();
1830 var d = javax.swing.text.Utilities.getRowEnd (b, c);
1831 if (this.select) {
1832 b.moveCaretPosition (d);
1833 } else {
1834 b.setCaretPosition (d);
1835 }} catch (bl) {
1836 if (Clazz_exceptionOf (bl, javax.swing.text.BadLocationException)) {
1837 javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (b);
1838 } else {
1839 throw bl;
1840 }
1841 }
1842 }}, "java.awt.event.ActionEvent");
1843 c$ = Clazz_p0p ();
1844 Clazz_pu$h(self.c$);
1845 c$ = Clazz_decorateAsClass (function () {
1846 this.select = false;
1847 Clazz_instantialize (this, arguments);
1848 }, javax.swing.text.DefaultEditorKit, "BeginParagraphAction", javax.swing.text.TextAction);
1849 Clazz_makeConstructor (c$, 
1850 function (a, b) {
1851 Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.BeginParagraphAction, [a]);
1852 this.select = b;
1853 }, "~S,~B");
1854 Clazz_overrideMethod (c$, "actionPerformed", 
1855 function (a) {
1856 var b = this.getTextComponent (a);
1857 if (b != null) {
1858 var c = b.getCaretPosition ();
1859 var d = javax.swing.text.Utilities.getParagraphElement (b, c);
1860 c = d.getStartOffset ();
1861 if (this.select) {
1862 b.moveCaretPosition (c);
1863 } else {
1864 b.setCaretPosition (c);
1865 }}}, "java.awt.event.ActionEvent");
1866 c$ = Clazz_p0p ();
1867 Clazz_pu$h(self.c$);
1868 c$ = Clazz_decorateAsClass (function () {
1869 this.select = false;
1870 Clazz_instantialize (this, arguments);
1871 }, javax.swing.text.DefaultEditorKit, "EndParagraphAction", javax.swing.text.TextAction);
1872 Clazz_makeConstructor (c$, 
1873 function (a, b) {
1874 Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.EndParagraphAction, [a]);
1875 this.select = b;
1876 }, "~S,~B");
1877 Clazz_overrideMethod (c$, "actionPerformed", 
1878 function (a) {
1879 var b = this.getTextComponent (a);
1880 if (b != null) {
1881 var c = b.getCaretPosition ();
1882 var d = javax.swing.text.Utilities.getParagraphElement (b, c);
1883 c = Math.min (b.getDocument ().getLength (), d.getEndOffset ());
1884 if (this.select) {
1885 b.moveCaretPosition (c);
1886 } else {
1887 b.setCaretPosition (c);
1888 }}}, "java.awt.event.ActionEvent");
1889 c$ = Clazz_p0p ();
1890 Clazz_pu$h(self.c$);
1891 c$ = Clazz_decorateAsClass (function () {
1892 this.select = false;
1893 Clazz_instantialize (this, arguments);
1894 }, javax.swing.text.DefaultEditorKit, "BeginAction", javax.swing.text.TextAction);
1895 Clazz_makeConstructor (c$, 
1896 function (a, b) {
1897 Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.BeginAction, [a]);
1898 this.select = b;
1899 }, "~S,~B");
1900 Clazz_overrideMethod (c$, "actionPerformed", 
1901 function (a) {
1902 var b = this.getTextComponent (a);
1903 if (b != null) {
1904 if (this.select) {
1905 b.moveCaretPosition (0);
1906 } else {
1907 b.setCaretPosition (0);
1908 }}}, "java.awt.event.ActionEvent");
1909 c$ = Clazz_p0p ();
1910 Clazz_pu$h(self.c$);
1911 c$ = Clazz_decorateAsClass (function () {
1912 this.select = false;
1913 Clazz_instantialize (this, arguments);
1914 }, javax.swing.text.DefaultEditorKit, "EndAction", javax.swing.text.TextAction);
1915 Clazz_makeConstructor (c$, 
1916 function (a, b) {
1917 Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.EndAction, [a]);
1918 this.select = b;
1919 }, "~S,~B");
1920 Clazz_overrideMethod (c$, "actionPerformed", 
1921 function (a) {
1922 var b = this.getTextComponent (a);
1923 if (b != null) {
1924 var c = b.getDocument ();
1925 var d = c.getLength ();
1926 if (this.select) {
1927 b.moveCaretPosition (d);
1928 } else {
1929 b.setCaretPosition (d);
1930 }}}, "java.awt.event.ActionEvent");
1931 c$ = Clazz_p0p ();
1932 Clazz_pu$h(self.c$);
1933 c$ = Clazz_decorateAsClass (function () {
1934 this.start = null;
1935 this.end = null;
1936 Clazz_instantialize (this, arguments);
1937 }, javax.swing.text.DefaultEditorKit, "SelectWordAction", javax.swing.text.TextAction);
1938 Clazz_makeConstructor (c$, 
1939 function () {
1940 Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.SelectWordAction, ["select-word"]);
1941 this.start =  new javax.swing.text.DefaultEditorKit.BeginWordAction ("pigdog", false);
1942 this.end =  new javax.swing.text.DefaultEditorKit.EndWordAction ("pigdog", true);
1943 });
1944 Clazz_defineMethod (c$, "actionPerformed", 
1945 function (a) {
1946 this.start.actionPerformed (a);
1947 this.end.actionPerformed (a);
1948 }, "java.awt.event.ActionEvent");
1949 c$ = Clazz_p0p ();
1950 Clazz_pu$h(self.c$);
1951 c$ = Clazz_decorateAsClass (function () {
1952 this.start = null;
1953 this.end = null;
1954 Clazz_instantialize (this, arguments);
1955 }, javax.swing.text.DefaultEditorKit, "SelectLineAction", javax.swing.text.TextAction);
1956 Clazz_makeConstructor (c$, 
1957 function () {
1958 Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.SelectLineAction, ["select-line"]);
1959 this.start =  new javax.swing.text.DefaultEditorKit.BeginLineAction ("pigdog", false);
1960 this.end =  new javax.swing.text.DefaultEditorKit.EndLineAction ("pigdog", true);
1961 });
1962 Clazz_defineMethod (c$, "actionPerformed", 
1963 function (a) {
1964 this.start.actionPerformed (a);
1965 this.end.actionPerformed (a);
1966 }, "java.awt.event.ActionEvent");
1967 c$ = Clazz_p0p ();
1968 Clazz_pu$h(self.c$);
1969 c$ = Clazz_decorateAsClass (function () {
1970 this.start = null;
1971 this.end = null;
1972 Clazz_instantialize (this, arguments);
1973 }, javax.swing.text.DefaultEditorKit, "SelectParagraphAction", javax.swing.text.TextAction);
1974 Clazz_makeConstructor (c$, 
1975 function () {
1976 Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.SelectParagraphAction, ["select-paragraph"]);
1977 this.start =  new javax.swing.text.DefaultEditorKit.BeginParagraphAction ("pigdog", false);
1978 this.end =  new javax.swing.text.DefaultEditorKit.EndParagraphAction ("pigdog", true);
1979 });
1980 Clazz_defineMethod (c$, "actionPerformed", 
1981 function (a) {
1982 this.start.actionPerformed (a);
1983 this.end.actionPerformed (a);
1984 }, "java.awt.event.ActionEvent");
1985 c$ = Clazz_p0p ();
1986 Clazz_pu$h(self.c$);
1987 c$ = Clazz_declareType (javax.swing.text.DefaultEditorKit, "SelectAllAction", javax.swing.text.TextAction);
1988 Clazz_makeConstructor (c$, 
1989 function () {
1990 Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.SelectAllAction, ["select-all"]);
1991 });
1992 Clazz_overrideMethod (c$, "actionPerformed", 
1993 function (a) {
1994 var b = this.getTextComponent (a);
1995 if (b != null) {
1996 var c = b.getDocument ();
1997 b.setCaretPosition (0);
1998 b.moveCaretPosition (c.getLength ());
1999 }}, "java.awt.event.ActionEvent");
2000 c$ = Clazz_p0p ();
2001 Clazz_pu$h(self.c$);
2002 c$ = Clazz_declareType (javax.swing.text.DefaultEditorKit, "UnselectAction", javax.swing.text.TextAction);
2003 Clazz_makeConstructor (c$, 
2004 function () {
2005 Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.UnselectAction, ["unselect"]);
2006 });
2007 Clazz_overrideMethod (c$, "actionPerformed", 
2008 function (a) {
2009 var b = this.getTextComponent (a);
2010 if (b != null) {
2011 b.setCaretPosition (b.getCaretPosition ());
2012 }}, "java.awt.event.ActionEvent");
2013 c$ = Clazz_p0p ();
2014 Clazz_pu$h(self.c$);
2015 c$ = Clazz_declareType (javax.swing.text.DefaultEditorKit, "ToggleComponentOrientationAction", javax.swing.text.TextAction);
2016 Clazz_makeConstructor (c$, 
2017 function () {
2018 Clazz_superConstructor (this, javax.swing.text.DefaultEditorKit.ToggleComponentOrientationAction, ["toggle-componentOrientation"]);
2019 });
2020 Clazz_overrideMethod (c$, "actionPerformed", 
2021 function (a) {
2022 var b = this.getTextComponent (a);
2023 if (b != null) {
2024 var c = b.getComponentOrientation ();
2025 var d;
2026 if (c === java.awt.ComponentOrientation.RIGHT_TO_LEFT) d = java.awt.ComponentOrientation.LEFT_TO_RIGHT;
2027  else d = java.awt.ComponentOrientation.RIGHT_TO_LEFT;
2028 b.setComponentOrientation (d);
2029 b.repaint ();
2030 }}, "java.awt.event.ActionEvent");
2031 c$ = Clazz_p0p ();
2032 Clazz_defineStatics (c$,
2033 "EndOfLineStringProperty", "__EndOfLine__",
2034 "insertContentAction", "insert-content",
2035 "insertBreakAction", "insert-break",
2036 "insertTabAction", "insert-tab",
2037 "deletePrevCharAction", "delete-previous",
2038 "deleteNextCharAction", "delete-next",
2039 "deleteNextWordAction", "delete-next-word",
2040 "deletePrevWordAction", "delete-previous-word",
2041 "readOnlyAction", "set-read-only",
2042 "writableAction", "set-writable",
2043 "cutAction", "cut-to-clipboard",
2044 "copyAction", "copy-to-clipboard",
2045 "pasteAction", "paste-from-clipboard",
2046 "beepAction", "beep",
2047 "pageUpAction", "page-up",
2048 "pageDownAction", "page-down",
2049 "selectionPageUpAction", "selection-page-up",
2050 "selectionPageDownAction", "selection-page-down",
2051 "selectionPageLeftAction", "selection-page-left",
2052 "selectionPageRightAction", "selection-page-right",
2053 "forwardAction", "caret-forward",
2054 "backwardAction", "caret-backward",
2055 "selectionForwardAction", "selection-forward",
2056 "selectionBackwardAction", "selection-backward",
2057 "upAction", "caret-up",
2058 "downAction", "caret-down",
2059 "selectionUpAction", "selection-up",
2060 "selectionDownAction", "selection-down",
2061 "beginWordAction", "caret-begin-word",
2062 "endWordAction", "caret-end-word",
2063 "selectionBeginWordAction", "selection-begin-word",
2064 "selectionEndWordAction", "selection-end-word",
2065 "previousWordAction", "caret-previous-word",
2066 "nextWordAction", "caret-next-word",
2067 "selectionPreviousWordAction", "selection-previous-word",
2068 "selectionNextWordAction", "selection-next-word",
2069 "beginLineAction", "caret-begin-line",
2070 "endLineAction", "caret-end-line",
2071 "selectionBeginLineAction", "selection-begin-line",
2072 "selectionEndLineAction", "selection-end-line",
2073 "beginParagraphAction", "caret-begin-paragraph",
2074 "endParagraphAction", "caret-end-paragraph",
2075 "selectionBeginParagraphAction", "selection-begin-paragraph",
2076 "selectionEndParagraphAction", "selection-end-paragraph",
2077 "beginAction", "caret-begin",
2078 "endAction", "caret-end",
2079 "selectionBeginAction", "selection-begin",
2080 "selectionEndAction", "selection-end",
2081 "selectWordAction", "select-word",
2082 "selectLineAction", "select-line",
2083 "selectParagraphAction", "select-paragraph",
2084 "selectAllAction", "select-all",
2085 "unselectAction", "unselect",
2086 "toggleComponentOrientationAction", "toggle-componentOrientation",
2087 "defaultKeyTypedAction", "default-typed");
2088 c$.defaultActions = c$.prototype.defaultActions =  Clazz_newArray (-1, [ new javax.swing.text.DefaultEditorKit.InsertContentAction (),  new javax.swing.text.DefaultEditorKit.DeletePrevCharAction (),  new javax.swing.text.DefaultEditorKit.DeleteNextCharAction (),  new javax.swing.text.DefaultEditorKit.ReadOnlyAction (),  new javax.swing.text.DefaultEditorKit.WritableAction (),  new javax.swing.text.DefaultEditorKit.CutAction (),  new javax.swing.text.DefaultEditorKit.CopyAction (),  new javax.swing.text.DefaultEditorKit.PasteAction (),  new javax.swing.text.DefaultEditorKit.VerticalPageAction ("page-up", -1, false),  new javax.swing.text.DefaultEditorKit.VerticalPageAction ("page-down", 1, false),  new javax.swing.text.DefaultEditorKit.VerticalPageAction ("selection-page-up", -1, true),  new javax.swing.text.DefaultEditorKit.VerticalPageAction ("selection-page-down", 1, true),  new javax.swing.text.DefaultEditorKit.PageAction ("selection-page-left", true, true),  new javax.swing.text.DefaultEditorKit.PageAction ("selection-page-right", false, true),  new javax.swing.text.DefaultEditorKit.InsertBreakAction (),  new javax.swing.text.DefaultEditorKit.BeepAction (),  new javax.swing.text.DefaultEditorKit.NextVisualPositionAction ("caret-forward", false, 3),  new javax.swing.text.DefaultEditorKit.NextVisualPositionAction ("caret-backward", false, 7),  new javax.swing.text.DefaultEditorKit.NextVisualPositionAction ("selection-forward", true, 3),  new javax.swing.text.DefaultEditorKit.NextVisualPositionAction ("selection-backward", true, 7),  new javax.swing.text.DefaultEditorKit.NextVisualPositionAction ("caret-up", false, 1),  new javax.swing.text.DefaultEditorKit.NextVisualPositionAction ("caret-down", false, 5),  new javax.swing.text.DefaultEditorKit.NextVisualPositionAction ("selection-up", true, 1),  new javax.swing.text.DefaultEditorKit.NextVisualPositionAction ("selection-down", true, 5),  new javax.swing.text.DefaultEditorKit.BeginWordAction ("caret-begin-word", false),  new javax.swing.text.DefaultEditorKit.EndWordAction ("caret-end-word", false),  new javax.swing.text.DefaultEditorKit.BeginWordAction ("selection-begin-word", true),  new javax.swing.text.DefaultEditorKit.EndWordAction ("selection-end-word", true),  new javax.swing.text.DefaultEditorKit.PreviousWordAction ("caret-previous-word", false),  new javax.swing.text.DefaultEditorKit.NextWordAction ("caret-next-word", false),  new javax.swing.text.DefaultEditorKit.PreviousWordAction ("selection-previous-word", true),  new javax.swing.text.DefaultEditorKit.NextWordAction ("selection-next-word", true),  new javax.swing.text.DefaultEditorKit.BeginLineAction ("caret-begin-line", false),  new javax.swing.text.DefaultEditorKit.EndLineAction ("caret-end-line", false),  new javax.swing.text.DefaultEditorKit.BeginLineAction ("selection-begin-line", true),  new javax.swing.text.DefaultEditorKit.EndLineAction ("selection-end-line", true),  new javax.swing.text.DefaultEditorKit.BeginParagraphAction ("caret-begin-paragraph", false),  new javax.swing.text.DefaultEditorKit.EndParagraphAction ("caret-end-paragraph", false),  new javax.swing.text.DefaultEditorKit.BeginParagraphAction ("selection-begin-paragraph", true),  new javax.swing.text.DefaultEditorKit.EndParagraphAction ("selection-end-paragraph", true),  new javax.swing.text.DefaultEditorKit.BeginAction ("caret-begin", false),  new javax.swing.text.DefaultEditorKit.EndAction ("caret-end", false),  new javax.swing.text.DefaultEditorKit.BeginAction ("selection-begin", true),  new javax.swing.text.DefaultEditorKit.EndAction ("selection-end", true),  new javax.swing.text.DefaultEditorKit.DefaultKeyTypedAction (),  new javax.swing.text.DefaultEditorKit.InsertTabAction (),  new javax.swing.text.DefaultEditorKit.SelectWordAction (),  new javax.swing.text.DefaultEditorKit.SelectLineAction (),  new javax.swing.text.DefaultEditorKit.SelectParagraphAction (),  new javax.swing.text.DefaultEditorKit.SelectAllAction (),  new javax.swing.text.DefaultEditorKit.UnselectAction (),  new javax.swing.text.DefaultEditorKit.ToggleComponentOrientationAction ()]);
2089 });
2090 Clazz_declarePackage ("javax.swing.text");
2091 c$ = Clazz_declareType (javax.swing.text, "EditorKit", null, Cloneable);
2092 Clazz_makeConstructor (c$, 
2093 function () {
2094 });
2095 Clazz_defineMethod (c$, "clone", 
2096 function () {
2097 var o;
2098 try {
2099 o = Clazz_superCall (this, javax.swing.text.EditorKit, "clone", []);
2100 } catch (cnse) {
2101 if (Clazz_exceptionOf (cnse, CloneNotSupportedException)) {
2102 o = null;
2103 } else {
2104 throw cnse;
2105 }
2106 }
2107 return o;
2108 });
2109 Clazz_defineMethod (c$, "install", 
2110 function (c) {
2111 }, "javax.swing.JEditorPane");
2112 Clazz_defineMethod (c$, "deinstall", 
2113 function (c) {
2114 }, "javax.swing.JEditorPane");
2115 Clazz_declarePackage ("javax.swing.text");
2116 Clazz_load (["javax.swing.AbstractAction"], "javax.swing.text.TextAction", ["java.util.Hashtable", "javax.swing.text.JTextComponent"], function () {
2117 c$ = Clazz_declareType (javax.swing.text, "TextAction", javax.swing.AbstractAction);
2118 Clazz_defineMethod (c$, "getTextComponent", 
2119 function (e) {
2120 if (e != null) {
2121 var o = e.getSource ();
2122 if (Clazz_instanceOf (o, javax.swing.text.JTextComponent)) {
2123 return o;
2124 }}return this.getFocusedComponent ();
2125 }, "java.awt.event.ActionEvent");
2126 c$.augmentList = Clazz_defineMethod (c$, "augmentList", 
2127 function (list1, list2) {
2128 var h =  new java.util.Hashtable ();
2129 if (list1 != null) for (var i = 0; i < list1.length; i++) {
2130 var a = list1[i];
2131 var value = a.getValue ("Name");
2132 h.put ((value != null ? value : ""), a);
2133 }
2134 for (var i = 0; i < list2.length; i++) {
2135 var a = list2[i];
2136 var value = a.getValue ("Name");
2137 h.put ((value != null ? value : ""), a);
2138 }
2139 var actions =  new Array (h.size ());
2140 var index = 0;
2141 for (var e = h.elements (); e.hasMoreElements (); ) {
2142 actions[index++] = e.nextElement ();
2143 }
2144 return actions;
2145 }, "~A,~A");
2146 Clazz_defineMethod (c$, "getFocusedComponent", 
2147 function () {
2148 return javax.swing.text.JTextComponent.getFocusedComponent ();
2149 });
2150 });
2151 Clazz_declarePackage ("javax.swing.text");
2152 Clazz_load (["java.lang.Exception"], "javax.swing.text.BadLocationException", null, function () {
2153 c$ = Clazz_decorateAsClass (function () {
2154 this.offs = 0;
2155 Clazz_instantialize (this, arguments);
2156 }, javax.swing.text, "BadLocationException", Exception);
2157 Clazz_makeConstructor (c$, 
2158 function (s, offs) {
2159 Clazz_superConstructor (this, javax.swing.text.BadLocationException, [s]);
2160 this.offs = offs;
2161 }, "~S,~N");
2162 Clazz_defineMethod (c$, "offsetRequested", 
2163 function () {
2164 return this.offs;
2165 });
2166 });
2167 Clazz_declarePackage ("javax.swing.text");
2168 Clazz_load (["java.awt.Rectangle", "java.awt.event.ActionListener", "$.FocusListener", "$.MouseListener", "$.MouseMotionListener", "java.beans.PropertyChangeListener", "javax.swing.event.DocumentListener", "javax.swing.text.Caret", "$.NavigationFilter", "javax.swing.event.EventListenerList"], "javax.swing.text.DefaultCaret", ["java.lang.Boolean", "$.IllegalArgumentException", "java.awt.Point", "java.awt.event.ActionEvent", "javax.swing.SwingUtilities", "javax.swing.event.ChangeEvent", "$.ChangeListener", "javax.swing.text.AbstractDocument", "javax.swing.text.AbstractDocument.UndoRedoDocumentEvent", "javax.swing.text.DefaultEditorKit", "$.DefaultHighlighter", "$.Document", "$.Position", "$.Segment", "$.StateInvariantError"], function () {
2169 c$ = Clazz_decorateAsClass (function () {
2170 this.listenerList = null;
2171 this.changeEvent = null;
2172 this.component = null;
2173 this.updatePolicy = 0;
2174 this.visible = false;
2175 this.active = false;
2176 this.dot = 0;
2177 this.mark = 0;
2178 this.selectionTag = null;
2179 this.selectionVisible = false;
2180 this.magicCaretPosition = null;
2181 this.dotBias = null;
2182 this.markBias = null;
2183 this.dotLTR = false;
2184 this.markLTR = false;
2185 this.handler = null;
2186 this.flagXPoints = null;
2187 this.flagYPoints = null;
2188 this.filterBypass = null;
2189 this.ownsSelection = false;
2190 this.forceCaretPositionChange = false;
2191 this.shouldHandleRelease = false;
2192 this.selectedWordEvent = null;
2193 this.caretWidth = -1;
2194 this.aspectRatio = -1;
2195 if (!Clazz_isClassDefined ("javax.swing.text.DefaultCaret.SafeScroller")) {
2196 javax.swing.text.DefaultCaret.$DefaultCaret$SafeScroller$ ();
2197 }
2198 if (!Clazz_isClassDefined ("javax.swing.text.DefaultCaret.Handler")) {
2199 javax.swing.text.DefaultCaret.$DefaultCaret$Handler$ ();
2200 }
2201 if (!Clazz_isClassDefined ("javax.swing.text.DefaultCaret.DefaultFilterBypass")) {
2202 javax.swing.text.DefaultCaret.$DefaultCaret$DefaultFilterBypass$ ();
2203 }
2204 Clazz_instantialize (this, arguments);
2205 }, javax.swing.text, "DefaultCaret", java.awt.Rectangle, [javax.swing.text.Caret, java.awt.event.FocusListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener]);
2206 Clazz_prepareFields (c$, function () {
2207 this.listenerList =  new javax.swing.event.EventListenerList ();
2208 this.handler = Clazz_innerTypeInstance (javax.swing.text.DefaultCaret.Handler, this, null);
2209 this.flagXPoints =  Clazz_newIntArray (3, 0);
2210 this.flagYPoints =  Clazz_newIntArray (3, 0);
2211 });
2212 Clazz_makeConstructor (c$, 
2213 function () {
2214 Clazz_superConstructor (this, javax.swing.text.DefaultCaret, []);
2215 });
2216 Clazz_defineMethod (c$, "setUpdatePolicy", 
2217 function (policy) {
2218 this.updatePolicy = policy;
2219 }, "~N");
2220 Clazz_defineMethod (c$, "getUpdatePolicy", 
2221 function () {
2222 return this.updatePolicy;
2223 });
2224 Clazz_defineMethod (c$, "getComponent", 
2225 function () {
2226 return this.component;
2227 });
2228 Clazz_defineMethod (c$, "repaint", 
2229 function () {
2230 if (this.component != null) {
2231 this.component.repaint (this.x, this.y, this.width, this.height);
2232 }});
2233 Clazz_defineMethod (c$, "damage", 
2234 function (r) {
2235 if (r != null) {
2236 var damageWidth = this.getCaretWidth (r.height);
2237 this.x = r.x - 4 - (damageWidth >> 1);
2238 this.y = r.y;
2239 this.width = 9 + damageWidth;
2240 this.height = r.height;
2241 this.repaint ();
2242 }}, "java.awt.Rectangle");
2243 Clazz_defineMethod (c$, "adjustVisibility", 
2244 function (nloc) {
2245 if (this.component == null) {
2246 return;
2247 }if (javax.swing.SwingUtilities.isEventDispatchThread ()) {
2248 this.component.scrollRectToVisible (nloc);
2249 } else {
2250 javax.swing.SwingUtilities.invokeLater (Clazz_innerTypeInstance (javax.swing.text.DefaultCaret.SafeScroller, this, null, nloc));
2251 }}, "java.awt.Rectangle");
2252 Clazz_defineMethod (c$, "getSelectionPainter", 
2253 function () {
2254 return javax.swing.text.DefaultHighlighter.DefaultPainter;
2255 });
2256 Clazz_defineMethod (c$, "positionCaret", 
2257 function (e) {
2258 var pt =  new java.awt.Point (e.getX (), e.getY ());
2259 var biasRet =  new Array (1);
2260 var pos = this.component.getUI ().viewToModel (this.component, pt, biasRet);
2261 if (biasRet[0] == null) biasRet[0] = javax.swing.text.Position.Bias.Forward;
2262 if (pos >= 0) {
2263 this.setDot (pos, biasRet[0]);
2264 }}, "java.awt.event.MouseEvent");
2265 Clazz_defineMethod (c$, "moveCaret", 
2266 function (e) {
2267 var pt =  new java.awt.Point (e.getX (), e.getY ());
2268 var biasRet =  new Array (1);
2269 var pos = this.component.getUI ().viewToModel (this.component, pt, biasRet);
2270 if (biasRet[0] == null) biasRet[0] = javax.swing.text.Position.Bias.Forward;
2271 if (pos >= 0) {
2272 this.moveDot (pos, biasRet[0]);
2273 }}, "java.awt.event.MouseEvent");
2274 Clazz_overrideMethod (c$, "focusGained", 
2275 function (e) {
2276 if (this.component.isEnabled ()) {
2277 if (this.component.isEditable ()) {
2278 this.setVisible (true);
2279 }this.setSelectionVisible (true);
2280 }}, "java.awt.event.FocusEvent");
2281 Clazz_overrideMethod (c$, "focusLost", 
2282 function (e) {
2283 this.setVisible (false);
2284 this.setSelectionVisible (this.ownsSelection || e.isTemporary ());
2285 }, "java.awt.event.FocusEvent");
2286 Clazz_overrideMethod (c$, "mouseClicked", 
2287 function (e) {
2288 var nclicks = e.getClickCount ();
2289 if (!e.isConsumed ()) {
2290 if (javax.swing.SwingUtilities.isLeftMouseButton (e)) {
2291 if (nclicks == 1) {
2292 this.selectedWordEvent = null;
2293 }} else if (javax.swing.SwingUtilities.isMiddleMouseButton (e)) {
2294 }}}, "java.awt.event.MouseEvent");
2295 Clazz_overrideMethod (c$, "mousePressed", 
2296 function (e) {
2297 if (javax.swing.SwingUtilities.isLeftMouseButton (e)) {
2298 if (e.isConsumed ()) {
2299 this.shouldHandleRelease = true;
2300 } else {
2301 this.shouldHandleRelease = false;
2302 this.adjustCaretAndFocus (e);
2303 }}}, "java.awt.event.MouseEvent");
2304 Clazz_defineMethod (c$, "adjustCaretAndFocus", 
2305 function (e) {
2306 this.adjustCaret (e);
2307 this.adjustFocus (false);
2308 }, "java.awt.event.MouseEvent");
2309 Clazz_defineMethod (c$, "adjustCaret", 
2310  function (e) {
2311 if ((e.getModifiers () & 1) != 0 && this.getDot () != -1) {
2312 this.moveCaret (e);
2313 } else {
2314 this.positionCaret (e);
2315 }}, "java.awt.event.MouseEvent");
2316 Clazz_defineMethod (c$, "adjustFocus", 
2317  function (inWindow) {
2318 if ((this.component != null) && this.component.isEnabled () && this.component.isRequestFocusEnabled ()) {
2319 if (inWindow) {
2320 this.component.requestFocusInWindow ();
2321 } else {
2322 this.component.requestFocus ();
2323 }}}, "~B");
2324 Clazz_overrideMethod (c$, "mouseReleased", 
2325 function (e) {
2326 if (!e.isConsumed () && this.shouldHandleRelease && javax.swing.SwingUtilities.isLeftMouseButton (e)) {
2327 this.adjustCaretAndFocus (e);
2328 }}, "java.awt.event.MouseEvent");
2329 Clazz_overrideMethod (c$, "mouseEntered", 
2330 function (e) {
2331 }, "java.awt.event.MouseEvent");
2332 Clazz_overrideMethod (c$, "mouseExited", 
2333 function (e) {
2334 }, "java.awt.event.MouseEvent");
2335 Clazz_overrideMethod (c$, "mouseDragged", 
2336 function (e) {
2337 if ((!e.isConsumed ()) && javax.swing.SwingUtilities.isLeftMouseButton (e)) {
2338 this.moveCaret (e);
2339 }}, "java.awt.event.MouseEvent");
2340 Clazz_overrideMethod (c$, "mouseMoved", 
2341 function (e) {
2342 }, "java.awt.event.MouseEvent");
2343 Clazz_overrideMethod (c$, "paint", 
2344 function (g) {
2345 if (this.isVisible ()) {
2346 try {
2347 var mapper = this.component.getUI ();
2348 var r = mapper.modelToView (this.component, this.dot, this.dotBias);
2349 if ((r == null) || ((r.width == 0) && (r.height == 0))) {
2350 return;
2351 }if (this.width > 0 && this.height > 0 && !this._contains (r.x, r.y, r.width, r.height)) {
2352 var clip = g.getClipBounds ();
2353 if (clip != null && !clip.contains (this)) {
2354 this.repaint ();
2355 }this.damage (r);
2356 }g.setColor (this.component.getCaretColor ());
2357 var paintWidth = this.getCaretWidth (r.height);
2358 r.x -= paintWidth >> 1;
2359 g.fillRect (r.x, r.y, paintWidth, r.height);
2360 var doc = this.component.getDocument ();
2361 if (Clazz_instanceOf (doc, javax.swing.text.AbstractDocument)) {
2362 var bidi = (doc).getBidiRootElement ();
2363 if ((bidi != null) && (bidi.getElementCount () > 1)) {
2364 this.flagXPoints[0] = r.x + ((this.dotLTR) ? paintWidth : 0);
2365 this.flagYPoints[0] = r.y;
2366 this.flagXPoints[1] = this.flagXPoints[0];
2367 this.flagYPoints[1] = this.flagYPoints[0] + 4;
2368 this.flagXPoints[2] = this.flagXPoints[0] + ((this.dotLTR) ? 4 : -4);
2369 this.flagYPoints[2] = this.flagYPoints[0];
2370 g.fillPolygon (this.flagXPoints, this.flagYPoints, 3);
2371 }}} catch (e) {
2372 if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
2373 } else {
2374 throw e;
2375 }
2376 }
2377 }}, "java.awt.Graphics");
2378 Clazz_overrideMethod (c$, "install", 
2379 function (c) {
2380 this.component = c;
2381 var doc = c.getDocument ();
2382 this.dot = this.mark = 0;
2383 this.dotLTR = this.markLTR = true;
2384 this.dotBias = this.markBias = javax.swing.text.Position.Bias.Forward;
2385 if (doc != null) {
2386 doc.addDocumentListener (this.handler);
2387 }c.addPropertyChangeListener (this.handler);
2388 c.addFocusListener (this);
2389 c.addMouseListener (this);
2390 c.addMouseMotionListener (this);
2391 if (this.component.hasFocus ()) {
2392 this.focusGained (null);
2393 }var ratio = c.getClientProperty ("caretAspectRatio");
2394 if (ratio != null) {
2395 this.aspectRatio = ratio.floatValue ();
2396 } else {
2397 this.aspectRatio = -1;
2398 }var width = c.getClientProperty ("caretWidth");
2399 if (width != null) {
2400 this.caretWidth = width.intValue ();
2401 } else {
2402 this.caretWidth = -1;
2403 }}, "javax.swing.text.JTextComponent");
2404 Clazz_overrideMethod (c$, "deinstall", 
2405 function (c) {
2406 c.removeMouseListener (this);
2407 c.removeMouseMotionListener (this);
2408 c.removeFocusListener (this);
2409 c.removePropertyChangeListener (this.handler);
2410 var doc = c.getDocument ();
2411 if (doc != null) {
2412 doc.removeDocumentListener (this.handler);
2413 }{
2414 this.component = null;
2415 }}, "javax.swing.text.JTextComponent");
2416 Clazz_overrideMethod (c$, "addChangeListener", 
2417 function (l) {
2418 this.listenerList.add (javax.swing.event.ChangeListener, l);
2419 }, "javax.swing.event.ChangeListener");
2420 Clazz_overrideMethod (c$, "removeChangeListener", 
2421 function (l) {
2422 this.listenerList.remove (javax.swing.event.ChangeListener, l);
2423 }, "javax.swing.event.ChangeListener");
2424 Clazz_defineMethod (c$, "getChangeListeners", 
2425 function () {
2426 return this.listenerList.getListeners (javax.swing.event.ChangeListener);
2427 });
2428 Clazz_defineMethod (c$, "fireStateChanged", 
2429 function () {
2430 var listeners = this.listenerList.getListenerList ();
2431 for (var i = listeners.length - 2; i >= 0; i -= 2) {
2432 if (listeners[i] === javax.swing.event.ChangeListener) {
2433 if (this.changeEvent == null) this.changeEvent =  new javax.swing.event.ChangeEvent (this);
2434 (listeners[i + 1]).stateChanged (this.changeEvent);
2435 }}
2436 });
2437 Clazz_defineMethod (c$, "getListeners", 
2438 function (listenerType) {
2439 return this.listenerList.getListeners (listenerType);
2440 }, "Class");
2441 Clazz_overrideMethod (c$, "setSelectionVisible", 
2442 function (vis) {
2443 if (vis != this.selectionVisible) {
2444 this.selectionVisible = vis;
2445 if (this.selectionVisible) {
2446 var h = this.component.getHighlighter ();
2447 if ((this.dot != this.mark) && (h != null) && (this.selectionTag == null)) {
2448 var p0 = Math.min (this.dot, this.mark);
2449 var p1 = Math.max (this.dot, this.mark);
2450 var p = this.getSelectionPainter ();
2451 try {
2452 this.selectionTag = h.addHighlight (p0, p1, p);
2453 } catch (bl) {
2454 if (Clazz_exceptionOf (bl, javax.swing.text.BadLocationException)) {
2455 this.selectionTag = null;
2456 } else {
2457 throw bl;
2458 }
2459 }
2460 }} else {
2461 if (this.selectionTag != null) {
2462 var h = this.component.getHighlighter ();
2463 h.removeHighlight (this.selectionTag);
2464 this.selectionTag = null;
2465 }}}}, "~B");
2466 Clazz_overrideMethod (c$, "isSelectionVisible", 
2467 function () {
2468 return this.selectionVisible;
2469 });
2470 Clazz_defineMethod (c$, "isActive", 
2471 function () {
2472 return this.active;
2473 });
2474 Clazz_overrideMethod (c$, "isVisible", 
2475 function () {
2476 return this.visible;
2477 });
2478 Clazz_overrideMethod (c$, "setVisible", 
2479 function (e) {
2480 if (this.component != null) {
2481 this.active = e;
2482 var mapper = this.component.getUI ();
2483 if (this.visible != e) {
2484 this.visible = e;
2485 try {
2486 var loc = mapper.modelToView (this.component, this.dot, this.dotBias);
2487 this.damage (loc);
2488 } catch (badloc) {
2489 if (Clazz_exceptionOf (badloc, javax.swing.text.BadLocationException)) {
2490 } else {
2491 throw badloc;
2492 }
2493 }
2494 }}}, "~B");
2495 Clazz_overrideMethod (c$, "setBlinkRate", 
2496 function (rate) {
2497 }, "~N");
2498 Clazz_overrideMethod (c$, "getBlinkRate", 
2499 function () {
2500 return 0;
2501 });
2502 Clazz_overrideMethod (c$, "getDot", 
2503 function () {
2504 return this.dot;
2505 });
2506 Clazz_overrideMethod (c$, "getMark", 
2507 function () {
2508 return this.mark;
2509 });
2510 Clazz_defineMethod (c$, "setDot", 
2511 function (dot) {
2512 this.setDot (dot, javax.swing.text.Position.Bias.Forward);
2513 }, "~N");
2514 Clazz_defineMethod (c$, "moveDot", 
2515 function (dot) {
2516 this.moveDot (dot, javax.swing.text.Position.Bias.Forward);
2517 }, "~N");
2518 Clazz_defineMethod (c$, "moveDot", 
2519 function (dot, dotBias) {
2520 if (dotBias == null) {
2521 throw  new IllegalArgumentException ("null bias");
2522 }if (!this.component.isEnabled ()) {
2523 this.setDot (dot, dotBias);
2524 return;
2525 }if (dot != this.dot) {
2526 var filter = this.component.getNavigationFilter ();
2527 if (filter != null) {
2528 filter.moveDot (this.getFilterBypass (), dot, dotBias);
2529 } else {
2530 this.handleMoveDot (dot, dotBias);
2531 }}}, "~N,javax.swing.text.Position.Bias");
2532 Clazz_defineMethod (c$, "handleMoveDot", 
2533 function (dot, dotBias) {
2534 this.changeCaretPosition (dot, dotBias);
2535 if (this.selectionVisible) {
2536 var h = this.component.getHighlighter ();
2537 if (h != null) {
2538 var p0 = Math.min (dot, this.mark);
2539 var p1 = Math.max (dot, this.mark);
2540 if (p0 == p1) {
2541 if (this.selectionTag != null) {
2542 h.removeHighlight (this.selectionTag);
2543 this.selectionTag = null;
2544 }} else {
2545 try {
2546 if (this.selectionTag != null) {
2547 h.changeHighlight (this.selectionTag, p0, p1);
2548 } else {
2549 var p = this.getSelectionPainter ();
2550 this.selectionTag = h.addHighlight (p0, p1, p);
2551 }} catch (e) {
2552 if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
2553 throw  new javax.swing.text.StateInvariantError ("Bad caret position");
2554 } else {
2555 throw e;
2556 }
2557 }
2558 }}}}, "~N,javax.swing.text.Position.Bias");
2559 Clazz_defineMethod (c$, "setDot", 
2560 function (dot, dotBias) {
2561 if (dotBias == null) {
2562 throw  new IllegalArgumentException ("null bias");
2563 }var filter = this.component.getNavigationFilter ();
2564 if (filter != null) {
2565 filter.setDot (this.getFilterBypass (), dot, dotBias);
2566 } else {
2567 this.handleSetDot (dot, dotBias);
2568 }}, "~N,javax.swing.text.Position.Bias");
2569 Clazz_defineMethod (c$, "handleSetDot", 
2570 function (dot, dotBias) {
2571 var doc = this.component.getDocument ();
2572 if (doc != null) {
2573 dot = Math.min (dot, doc.getLength ());
2574 }dot = Math.max (dot, 0);
2575 if (dot == 0) dotBias = javax.swing.text.Position.Bias.Forward;
2576 this.mark = dot;
2577 if (this.dot != dot || this.dotBias !== dotBias || this.selectionTag != null || this.forceCaretPositionChange) {
2578 this.changeCaretPosition (dot, dotBias);
2579 }this.markBias = this.dotBias;
2580 this.markLTR = this.dotLTR;
2581 var h = this.component.getHighlighter ();
2582 if ((h != null) && (this.selectionTag != null)) {
2583 h.removeHighlight (this.selectionTag);
2584 this.selectionTag = null;
2585 }}, "~N,javax.swing.text.Position.Bias");
2586 Clazz_defineMethod (c$, "getDotBias", 
2587 function () {
2588 return this.dotBias;
2589 });
2590 Clazz_defineMethod (c$, "getMarkBias", 
2591 function () {
2592 return this.markBias;
2593 });
2594 Clazz_defineMethod (c$, "isDotLeftToRight", 
2595 function () {
2596 return this.dotLTR;
2597 });
2598 Clazz_defineMethod (c$, "isMarkLeftToRight", 
2599 function () {
2600 return this.markLTR;
2601 });
2602 Clazz_defineMethod (c$, "isPositionLTR", 
2603 function (position, bias) {
2604 var doc = this.component.getDocument ();
2605 if (Clazz_instanceOf (doc, javax.swing.text.AbstractDocument)) {
2606 if (bias === javax.swing.text.Position.Bias.Backward && --position < 0) position = 0;
2607 return (doc).isLeftToRight (position, position);
2608 }return true;
2609 }, "~N,javax.swing.text.Position.Bias");
2610 Clazz_defineMethod (c$, "guessBiasForOffset", 
2611 function (offset, lastBias, lastLTR) {
2612 if (lastLTR != this.isPositionLTR (offset, lastBias)) {
2613 lastBias = javax.swing.text.Position.Bias.Backward;
2614 } else if (lastBias !== javax.swing.text.Position.Bias.Backward && lastLTR != this.isPositionLTR (offset, javax.swing.text.Position.Bias.Backward)) {
2615 lastBias = javax.swing.text.Position.Bias.Backward;
2616 }if (lastBias === javax.swing.text.Position.Bias.Backward && offset > 0) {
2617 try {
2618 var s =  new javax.swing.text.Segment ();
2619 this.component.getDocument ().getText (offset - 1, 1, s);
2620 if (s.count > 0 && s.array[s.offset] == '\n') {
2621 lastBias = javax.swing.text.Position.Bias.Forward;
2622 }} catch (ble) {
2623 if (Clazz_exceptionOf (ble, javax.swing.text.BadLocationException)) {
2624 } else {
2625 throw ble;
2626 }
2627 }
2628 }return lastBias;
2629 }, "~N,javax.swing.text.Position.Bias,~B");
2630 Clazz_defineMethod (c$, "changeCaretPosition", 
2631 function (dot, dotBias) {
2632 this.repaint ();
2633 this.dot = dot;
2634 this.dotBias = dotBias;
2635 this.dotLTR = this.isPositionLTR (dot, dotBias);
2636 this.fireStateChanged ();
2637 this.updateSystemSelection ();
2638 this.setMagicCaretPosition (null);
2639 var callRepaintNewCaret = ((Clazz_isClassDefined ("javax.swing.text.DefaultCaret$1") ? 0 : javax.swing.text.DefaultCaret.$DefaultCaret$1$ ()), Clazz_innerTypeInstance (javax.swing.text.DefaultCaret$1, this, null));
2640 javax.swing.SwingUtilities.invokeLater (callRepaintNewCaret);
2641 }, "~N,javax.swing.text.Position.Bias");
2642 Clazz_defineMethod (c$, "repaintNewCaret", 
2643 function () {
2644 if (this.component != null) {
2645 var mapper = this.component.getUI ();
2646 var doc = this.component.getDocument ();
2647 if ((mapper != null) && (doc != null)) {
2648 var newLoc;
2649 try {
2650 newLoc = mapper.modelToView (this.component, this.dot, this.dotBias);
2651 } catch (e) {
2652 if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
2653 newLoc = null;
2654 } else {
2655 throw e;
2656 }
2657 }
2658 if (newLoc != null) {
2659 this.adjustVisibility (newLoc);
2660 if (this.getMagicCaretPosition () == null) {
2661 this.setMagicCaretPosition ( new java.awt.Point (newLoc.x, newLoc.y));
2662 }}this.damage (newLoc);
2663 }}});
2664 Clazz_defineMethod (c$, "updateSystemSelection", 
2665  function () {
2666 });
2667 Clazz_defineMethod (c$, "ensureValidPosition", 
2668  function () {
2669 var length = this.component.getDocument ().getLength ();
2670 if (this.dot > length || this.mark > length) {
2671 this.handleSetDot (length, javax.swing.text.Position.Bias.Forward);
2672 }});
2673 Clazz_overrideMethod (c$, "setMagicCaretPosition", 
2674 function (p) {
2675 this.magicCaretPosition = p;
2676 }, "java.awt.Point");
2677 Clazz_overrideMethod (c$, "getMagicCaretPosition", 
2678 function () {
2679 return this.magicCaretPosition;
2680 });
2681 Clazz_overrideMethod (c$, "equals", 
2682 function (obj) {
2683 return (this === obj);
2684 }, "~O");
2685 Clazz_overrideMethod (c$, "toString", 
2686 function () {
2687 var s = "Dot=(" + this.dot + ", " + this.dotBias + ")";
2688 s += " Mark=(" + this.mark + ", " + this.markBias + ")";
2689 return s;
2690 });
2691 Clazz_defineMethod (c$, "getFilterBypass", 
2692  function () {
2693 if (this.filterBypass == null) {
2694 this.filterBypass = Clazz_innerTypeInstance (javax.swing.text.DefaultCaret.DefaultFilterBypass, this, null);
2695 }return this.filterBypass;
2696 });
2697 Clazz_defineMethod (c$, "_contains", 
2698  function (X, Y, W, H) {
2699 var w = this.width;
2700 var h = this.height;
2701 if ((w | h | W | H) < 0) {
2702 return false;
2703 }var x = this.x;
2704 var y = this.y;
2705 if (X < x || Y < y) {
2706 return false;
2707 }if (W > 0) {
2708 w += x;
2709 W += X;
2710 if (W <= X) {
2711 if (w >= x || W > w) return false;
2712 } else {
2713 if (w >= x && W > w) return false;
2714 }} else if ((x + w) < X) {
2715 return false;
2716 }if (H > 0) {
2717 h += y;
2718 H += Y;
2719 if (H <= Y) {
2720 if (h >= y || H > h) return false;
2721 } else {
2722 if (h >= y && H > h) return false;
2723 }} else if ((y + h) < Y) {
2724 return false;
2725 }return true;
2726 }, "~N,~N,~N,~N");
2727 Clazz_defineMethod (c$, "getCaretWidth", 
2728 function (height) {
2729 if (this.aspectRatio > -1) {
2730 return Clazz_floatToInt (this.aspectRatio * height) + 1;
2731 }if (this.caretWidth > -1) {
2732 return this.caretWidth;
2733 }return 1;
2734 }, "~N");
2735 c$.$DefaultCaret$SafeScroller$ = function () {
2736 Clazz_pu$h(self.c$);
2737 c$ = Clazz_decorateAsClass (function () {
2738 Clazz_prepareCallback (this, arguments);
2739 this.r = null;
2740 Clazz_instantialize (this, arguments);
2741 }, javax.swing.text.DefaultCaret, "SafeScroller", null, Runnable);
2742 Clazz_makeConstructor (c$, 
2743 function (a) {
2744 this.r = a;
2745 }, "java.awt.Rectangle");
2746 Clazz_overrideMethod (c$, "run", 
2747 function () {
2748 if (this.b$["javax.swing.text.DefaultCaret"].component != null) {
2749 this.b$["javax.swing.text.DefaultCaret"].component.scrollRectToVisible (this.r);
2750 }});
2751 c$ = Clazz_p0p ();
2752 };
2753 c$.$DefaultCaret$Handler$ = function () {
2754 Clazz_pu$h(self.c$);
2755 c$ = Clazz_decorateAsClass (function () {
2756 Clazz_prepareCallback (this, arguments);
2757 Clazz_instantialize (this, arguments);
2758 }, javax.swing.text.DefaultCaret, "Handler", null, [java.beans.PropertyChangeListener, javax.swing.event.DocumentListener, java.awt.event.ActionListener]);
2759 Clazz_overrideMethod (c$, "actionPerformed", 
2760 function (a) {
2761 if (this.b$["javax.swing.text.DefaultCaret"].width == 0 || this.b$["javax.swing.text.DefaultCaret"].height == 0) {
2762 if (this.b$["javax.swing.text.DefaultCaret"].component != null) {
2763 var b = this.b$["javax.swing.text.DefaultCaret"].component.getUI ();
2764 try {
2765 var c = b.modelToView (this.b$["javax.swing.text.DefaultCaret"].component, this.b$["javax.swing.text.DefaultCaret"].dot, this.b$["javax.swing.text.DefaultCaret"].dotBias);
2766 if (c != null && c.width != 0 && c.height != 0) {
2767 this.b$["javax.swing.text.DefaultCaret"].damage (c);
2768 }} catch (ble) {
2769 if (Clazz_exceptionOf (ble, javax.swing.text.BadLocationException)) {
2770 } else {
2771 throw ble;
2772 }
2773 }
2774 }}this.b$["javax.swing.text.DefaultCaret"].visible = !this.b$["javax.swing.text.DefaultCaret"].visible;
2775 this.b$["javax.swing.text.DefaultCaret"].repaint ();
2776 }, "java.awt.event.ActionEvent");
2777 Clazz_overrideMethod (c$, "insertUpdate", 
2778 function (a) {
2779 if (this.b$["javax.swing.text.DefaultCaret"].getUpdatePolicy () == 1 || (this.b$["javax.swing.text.DefaultCaret"].getUpdatePolicy () == 0 && !javax.swing.SwingUtilities.isEventDispatchThread ())) {
2780 if ((a.getOffset () <= this.b$["javax.swing.text.DefaultCaret"].dot || a.getOffset () <= this.b$["javax.swing.text.DefaultCaret"].mark) && this.b$["javax.swing.text.DefaultCaret"].selectionTag != null) {
2781 try {
2782 this.b$["javax.swing.text.DefaultCaret"].component.getHighlighter ().changeHighlight (this.b$["javax.swing.text.DefaultCaret"].selectionTag, Math.min (this.b$["javax.swing.text.DefaultCaret"].dot, this.b$["javax.swing.text.DefaultCaret"].mark), Math.max (this.b$["javax.swing.text.DefaultCaret"].dot, this.b$["javax.swing.text.DefaultCaret"].mark));
2783 } catch (e1) {
2784 if (Clazz_exceptionOf (e1, javax.swing.text.BadLocationException)) {
2785 e1.printStackTrace ();
2786 } else {
2787 throw e1;
2788 }
2789 }
2790 }return;
2791 }var b = 0;
2792 var c = a.getOffset ();
2793 var d = a.getLength ();
2794 var e = this.b$["javax.swing.text.DefaultCaret"].dot;
2795 var f = 0;
2796 if (Clazz_instanceOf (a, javax.swing.text.AbstractDocument.UndoRedoDocumentEvent)) {
2797 this.b$["javax.swing.text.DefaultCaret"].setDot (c + d);
2798 return;
2799 }if (e >= c) {
2800 e += d;
2801 f |= 1;
2802 }var g = this.b$["javax.swing.text.DefaultCaret"].mark;
2803 if (g >= c) {
2804 g += d;
2805 f |= 2;
2806 }if (f != 0) {
2807 var h = this.b$["javax.swing.text.DefaultCaret"].dotBias;
2808 if (this.b$["javax.swing.text.DefaultCaret"].dot == c) {
2809 var i = this.b$["javax.swing.text.DefaultCaret"].component.getDocument ();
2810 var j;
2811 try {
2812 var k =  new javax.swing.text.Segment ();
2813 i.getText (e - 1, 1, k);
2814 j = (k.count > 0 && k.array[k.offset] == '\n');
2815 } catch (ble) {
2816 if (Clazz_exceptionOf (ble, javax.swing.text.BadLocationException)) {
2817 j = false;
2818 } else {
2819 throw ble;
2820 }
2821 }
2822 if (j) {
2823 h = javax.swing.text.Position.Bias.Forward;
2824 } else {
2825 h = javax.swing.text.Position.Bias.Backward;
2826 }}if (g == e) {
2827 this.b$["javax.swing.text.DefaultCaret"].setDot (e, h);
2828 this.b$["javax.swing.text.DefaultCaret"].ensureValidPosition ();
2829 } else {
2830 this.b$["javax.swing.text.DefaultCaret"].setDot (g, this.b$["javax.swing.text.DefaultCaret"].markBias);
2831 if (this.b$["javax.swing.text.DefaultCaret"].getDot () == g) {
2832 this.b$["javax.swing.text.DefaultCaret"].moveDot (e, h);
2833 }this.b$["javax.swing.text.DefaultCaret"].ensureValidPosition ();
2834 }}}, "javax.swing.event.DocumentEvent");
2835 Clazz_overrideMethod (c$, "removeUpdate", 
2836 function (a) {
2837 if (this.b$["javax.swing.text.DefaultCaret"].getUpdatePolicy () == 1 || (this.b$["javax.swing.text.DefaultCaret"].getUpdatePolicy () == 0 && !javax.swing.SwingUtilities.isEventDispatchThread ())) {
2838 var b = this.b$["javax.swing.text.DefaultCaret"].component.getDocument ().getLength ();
2839 this.b$["javax.swing.text.DefaultCaret"].dot = Math.min (this.b$["javax.swing.text.DefaultCaret"].dot, b);
2840 this.b$["javax.swing.text.DefaultCaret"].mark = Math.min (this.b$["javax.swing.text.DefaultCaret"].mark, b);
2841 if ((a.getOffset () < this.b$["javax.swing.text.DefaultCaret"].dot || a.getOffset () < this.b$["javax.swing.text.DefaultCaret"].mark) && this.b$["javax.swing.text.DefaultCaret"].selectionTag != null) {
2842 try {
2843 this.b$["javax.swing.text.DefaultCaret"].component.getHighlighter ().changeHighlight (this.b$["javax.swing.text.DefaultCaret"].selectionTag, Math.min (this.b$["javax.swing.text.DefaultCaret"].dot, this.b$["javax.swing.text.DefaultCaret"].mark), Math.max (this.b$["javax.swing.text.DefaultCaret"].dot, this.b$["javax.swing.text.DefaultCaret"].mark));
2844 } catch (e1) {
2845 if (Clazz_exceptionOf (e1, javax.swing.text.BadLocationException)) {
2846 e1.printStackTrace ();
2847 } else {
2848 throw e1;
2849 }
2850 }
2851 }return;
2852 }var b = a.getOffset ();
2853 var c = b + a.getLength ();
2854 var d = 0;
2855 var e = this.b$["javax.swing.text.DefaultCaret"].dot;
2856 var f = false;
2857 var g = this.b$["javax.swing.text.DefaultCaret"].mark;
2858 var h = false;
2859 if (Clazz_instanceOf (a, javax.swing.text.AbstractDocument.UndoRedoDocumentEvent)) {
2860 this.b$["javax.swing.text.DefaultCaret"].setDot (b);
2861 return;
2862 }if (e >= c) {
2863 e -= (c - b);
2864 if (e == c) {
2865 f = true;
2866 }} else if (e >= b) {
2867 e = b;
2868 f = true;
2869 }if (g >= c) {
2870 g -= (c - b);
2871 if (g == c) {
2872 h = true;
2873 }} else if (g >= b) {
2874 g = b;
2875 h = true;
2876 }if (g == e) {
2877 this.b$["javax.swing.text.DefaultCaret"].forceCaretPositionChange = true;
2878 try {
2879 this.b$["javax.swing.text.DefaultCaret"].setDot (e, this.b$["javax.swing.text.DefaultCaret"].guessBiasForOffset (e, this.b$["javax.swing.text.DefaultCaret"].dotBias, this.b$["javax.swing.text.DefaultCaret"].dotLTR));
2880 } finally {
2881 this.b$["javax.swing.text.DefaultCaret"].forceCaretPositionChange = false;
2882 }
2883 this.b$["javax.swing.text.DefaultCaret"].ensureValidPosition ();
2884 } else {
2885 var i = this.b$["javax.swing.text.DefaultCaret"].dotBias;
2886 var j = this.b$["javax.swing.text.DefaultCaret"].markBias;
2887 if (f) {
2888 i = this.b$["javax.swing.text.DefaultCaret"].guessBiasForOffset (e, i, this.b$["javax.swing.text.DefaultCaret"].dotLTR);
2889 }if (h) {
2890 j = this.b$["javax.swing.text.DefaultCaret"].guessBiasForOffset (this.b$["javax.swing.text.DefaultCaret"].mark, j, this.b$["javax.swing.text.DefaultCaret"].markLTR);
2891 }this.b$["javax.swing.text.DefaultCaret"].setDot (g, j);
2892 if (this.b$["javax.swing.text.DefaultCaret"].getDot () == g) {
2893 this.b$["javax.swing.text.DefaultCaret"].moveDot (e, i);
2894 }this.b$["javax.swing.text.DefaultCaret"].ensureValidPosition ();
2895 }}, "javax.swing.event.DocumentEvent");
2896 Clazz_overrideMethod (c$, "changedUpdate", 
2897 function (a) {
2898 if (this.b$["javax.swing.text.DefaultCaret"].getUpdatePolicy () == 1 || (this.b$["javax.swing.text.DefaultCaret"].getUpdatePolicy () == 0 && !javax.swing.SwingUtilities.isEventDispatchThread ())) {
2899 return;
2900 }if (Clazz_instanceOf (a, javax.swing.text.AbstractDocument.UndoRedoDocumentEvent)) {
2901 this.b$["javax.swing.text.DefaultCaret"].setDot (a.getOffset () + a.getLength ());
2902 }}, "javax.swing.event.DocumentEvent");
2903 Clazz_overrideMethod (c$, "propertyChange", 
2904 function (a) {
2905 var b = a.getOldValue ();
2906 var c = a.getNewValue ();
2907 if ((Clazz_instanceOf (b, javax.swing.text.Document)) || (Clazz_instanceOf (c, javax.swing.text.Document))) {
2908 this.b$["javax.swing.text.DefaultCaret"].setDot (0);
2909 if (b != null) {
2910 (b).removeDocumentListener (this);
2911 }if (c != null) {
2912 (c).addDocumentListener (this);
2913 }} else if ("enabled".equals (a.getPropertyName ())) {
2914 var d = a.getNewValue ();
2915 if (this.b$["javax.swing.text.DefaultCaret"].component.isFocusOwner ()) {
2916 if (d === Boolean.TRUE) {
2917 if (this.b$["javax.swing.text.DefaultCaret"].component.isEditable ()) {
2918 this.b$["javax.swing.text.DefaultCaret"].setVisible (true);
2919 }this.b$["javax.swing.text.DefaultCaret"].setSelectionVisible (true);
2920 } else {
2921 this.b$["javax.swing.text.DefaultCaret"].setVisible (false);
2922 this.b$["javax.swing.text.DefaultCaret"].setSelectionVisible (false);
2923 }}} else if ("caretWidth".equals (a.getPropertyName ())) {
2924 var d = a.getNewValue ();
2925 if (d != null) {
2926 this.b$["javax.swing.text.DefaultCaret"].caretWidth = d.intValue ();
2927 } else {
2928 this.b$["javax.swing.text.DefaultCaret"].caretWidth = -1;
2929 }this.b$["javax.swing.text.DefaultCaret"].repaint ();
2930 } else if ("caretAspectRatio".equals (a.getPropertyName ())) {
2931 var d = a.getNewValue ();
2932 if (d != null) {
2933 this.b$["javax.swing.text.DefaultCaret"].aspectRatio = d.floatValue ();
2934 } else {
2935 this.b$["javax.swing.text.DefaultCaret"].aspectRatio = -1;
2936 }this.b$["javax.swing.text.DefaultCaret"].repaint ();
2937 }}, "java.beans.PropertyChangeEvent");
2938 c$ = Clazz_p0p ();
2939 };
2940 c$.$DefaultCaret$DefaultFilterBypass$ = function () {
2941 Clazz_pu$h(self.c$);
2942 c$ = Clazz_decorateAsClass (function () {
2943 Clazz_prepareCallback (this, arguments);
2944 Clazz_instantialize (this, arguments);
2945 }, javax.swing.text.DefaultCaret, "DefaultFilterBypass", javax.swing.text.NavigationFilter.FilterBypass);
2946 Clazz_overrideMethod (c$, "getCaret", 
2947 function () {
2948 return this.b$["javax.swing.text.DefaultCaret"];
2949 });
2950 Clazz_overrideMethod (c$, "setDot", 
2951 function (a, b) {
2952 this.b$["javax.swing.text.DefaultCaret"].handleSetDot (a, b);
2953 }, "~N,javax.swing.text.Position.Bias");
2954 Clazz_overrideMethod (c$, "moveDot", 
2955 function (a, b) {
2956 this.b$["javax.swing.text.DefaultCaret"].handleMoveDot (a, b);
2957 }, "~N,javax.swing.text.Position.Bias");
2958 c$ = Clazz_p0p ();
2959 };
2960 c$.$DefaultCaret$1$ = function () {
2961 Clazz_pu$h(self.c$);
2962 c$ = Clazz_declareAnonymous (javax.swing.text, "DefaultCaret$1", null, Runnable);
2963 Clazz_overrideMethod (c$, "run", 
2964 function () {
2965 this.b$["javax.swing.text.DefaultCaret"].repaintNewCaret ();
2966 });
2967 c$ = Clazz_p0p ();
2968 };
2969 Clazz_defineStatics (c$,
2970 "UPDATE_WHEN_ON_EDT", 0,
2971 "NEVER_UPDATE", 1,
2972 "ALWAYS_UPDATE", 2,
2973 "$selectWord", null,
2974 "selectLine", null);
2975 });
2976 Clazz_declarePackage ("javax.swing.text");
2977 Clazz_declareInterface (javax.swing.text, "Caret");
2978 Clazz_declarePackage ("javax.swing.text");
2979 c$ = Clazz_declareType (javax.swing.text, "NavigationFilter");
2980 Clazz_defineMethod (c$, "setDot", 
2981 function (fb, dot, bias) {
2982 fb.setDot (dot, bias);
2983 }, "javax.swing.text.NavigationFilter.FilterBypass,~N,javax.swing.text.Position.Bias");
2984 Clazz_defineMethod (c$, "moveDot", 
2985 function (fb, dot, bias) {
2986 fb.moveDot (dot, bias);
2987 }, "javax.swing.text.NavigationFilter.FilterBypass,~N,javax.swing.text.Position.Bias");
2988 Clazz_defineMethod (c$, "getNextVisualPositionFrom", 
2989 function (text, pos, bias, direction, biasRet) {
2990 return text.getUI ().getNextVisualPositionFrom (text, pos, bias, direction, biasRet);
2991 }, "javax.swing.text.JTextComponent,~N,javax.swing.text.Position.Bias,~N,~A");
2992 Clazz_pu$h(self.c$);
2993 c$ = Clazz_declareType (javax.swing.text.NavigationFilter, "FilterBypass");
2994 c$ = Clazz_p0p ();
2995 Clazz_declarePackage ("javax.swing.text");
2996 Clazz_load (["javax.swing.event.DocumentEvent", "javax.swing.text.DocumentFilter", "$.Element", "$.JSMinimalAbstractDocument", "$.MutableAttributeSet", "javax.swing.tree.TreeNode", "javax.swing.undo.AbstractUndoableEdit", "$.CompoundEdit", "javax.swing.event.EventListenerList"], "javax.swing.text.AbstractDocument", ["java.lang.Boolean", "java.util.Hashtable", "$.Vector", "javax.swing.UIManager", "javax.swing.event.DocumentEvent.ElementChange", "javax.swing.event.DocumentListener", "$.UndoableEditEvent", "$.UndoableEditListener", "javax.swing.text.BadLocationException", "$.SegmentCache", "$.StateInvariantError", "$.StyleConstants", "$.StyleContext", "$.Utilities"], function () {
2997 c$ = Clazz_decorateAsClass (function () {
2998 this.documentProperties = null;
2999 this.listenerList = null;
3000 this.data = null;
3001 this.context = null;
3002 this.bidiRoot = null;
3003 this.documentFilter = null;
3004 this.filterBypass = null;
3005 if (!Clazz_isClassDefined ("javax.swing.text.AbstractDocument.AbstractElement")) {
3006 javax.swing.text.AbstractDocument.$AbstractDocument$AbstractElement$ ();
3007 }
3008 if (!Clazz_isClassDefined ("javax.swing.text.AbstractDocument.BranchElement")) {
3009 javax.swing.text.AbstractDocument.$AbstractDocument$BranchElement$ ();
3010 }
3011 if (!Clazz_isClassDefined ("javax.swing.text.AbstractDocument.LeafElement")) {
3012 javax.swing.text.AbstractDocument.$AbstractDocument$LeafElement$ ();
3013 }
3014 if (!Clazz_isClassDefined ("javax.swing.text.AbstractDocument.DefaultDocumentEvent")) {
3015 javax.swing.text.AbstractDocument.$AbstractDocument$DefaultDocumentEvent$ ();
3016 }
3017 if (!Clazz_isClassDefined ("javax.swing.text.AbstractDocument.UndoRedoDocumentEvent")) {
3018 javax.swing.text.AbstractDocument.$AbstractDocument$UndoRedoDocumentEvent$ ();
3019 }
3020 if (!Clazz_isClassDefined ("javax.swing.text.AbstractDocument.DefaultFilterBypass")) {
3021 javax.swing.text.AbstractDocument.$AbstractDocument$DefaultFilterBypass$ ();
3022 }
3023 Clazz_instantialize (this, arguments);
3024 }, javax.swing.text, "AbstractDocument", null, javax.swing.text.JSMinimalAbstractDocument);
3025 Clazz_prepareFields (c$, function () {
3026 this.listenerList =  new javax.swing.event.EventListenerList ();
3027 });
3028 Clazz_makeConstructor (c$, 
3029 function (data) {
3030 this.construct (data, javax.swing.text.StyleContext.getDefaultStyleContext ());
3031 }, "javax.swing.text.AbstractDocument.Content");
3032 Clazz_makeConstructor (c$, 
3033 function (data, context) {
3034 this.data = data;
3035 this.context = context;
3036 }, "javax.swing.text.AbstractDocument.Content,javax.swing.text.AbstractDocument.AttributeContext");
3037 Clazz_defineMethod (c$, "getDocumentProperties", 
3038 function () {
3039 if (this.documentProperties == null) {
3040 this.documentProperties =  new java.util.Hashtable (2);
3041 }return this.documentProperties;
3042 });
3043 Clazz_defineMethod (c$, "setDocumentProperties", 
3044 function (x) {
3045 this.documentProperties = x;
3046 }, "java.util.Dictionary");
3047 Clazz_defineMethod (c$, "fireInsertUpdate", 
3048 function (e) {
3049 try {
3050 var listeners = this.listenerList.getListenerList ();
3051 for (var i = listeners.length - 2; i >= 0; i -= 2) {
3052 if (listeners[i] === javax.swing.event.DocumentListener) {
3053 (listeners[i + 1]).insertUpdate (e);
3054 }}
3055 } finally {
3056 }
3057 }, "javax.swing.event.DocumentEvent");
3058 Clazz_defineMethod (c$, "fireChangedUpdate", 
3059 function (e) {
3060 try {
3061 var listeners = this.listenerList.getListenerList ();
3062 for (var i = listeners.length - 2; i >= 0; i -= 2) {
3063 if (listeners[i] === javax.swing.event.DocumentListener) {
3064 (listeners[i + 1]).changedUpdate (e);
3065 }}
3066 } finally {
3067 }
3068 }, "javax.swing.event.DocumentEvent");
3069 Clazz_defineMethod (c$, "fireRemoveUpdate", 
3070 function (e) {
3071 try {
3072 var listeners = this.listenerList.getListenerList ();
3073 for (var i = listeners.length - 2; i >= 0; i -= 2) {
3074 if (listeners[i] === javax.swing.event.DocumentListener) {
3075 (listeners[i + 1]).removeUpdate (e);
3076 }}
3077 } finally {
3078 }
3079 }, "javax.swing.event.DocumentEvent");
3080 Clazz_defineMethod (c$, "fireUndoableEditUpdate", 
3081 function (e) {
3082 var listeners = this.listenerList.getListenerList ();
3083 for (var i = listeners.length - 2; i >= 0; i -= 2) {
3084 if (listeners[i] === javax.swing.event.UndoableEditListener) {
3085 (listeners[i + 1]).undoableEditHappened (e);
3086 }}
3087 }, "javax.swing.event.UndoableEditEvent");
3088 Clazz_defineMethod (c$, "getListeners", 
3089 function (listenerType) {
3090 return this.listenerList.getListeners (listenerType);
3091 }, "Class");
3092 Clazz_overrideMethod (c$, "getAsynchronousLoadPriority", 
3093 function () {
3094 var loadPriority = this.getProperty ("load priority");
3095 if (loadPriority != null) {
3096 return loadPriority.intValue ();
3097 }return -1;
3098 });
3099 Clazz_defineMethod (c$, "setAsynchronousLoadPriority", 
3100 function (p) {
3101 var loadPriority = (p >= 0) ?  new Integer (p) : null;
3102 this.putProperty ("load priority", loadPriority);
3103 }, "~N");
3104 Clazz_overrideMethod (c$, "setDocumentFilter", 
3105 function (filter) {
3106 this.documentFilter = filter;
3107 }, "javax.swing.text.DocumentFilter");
3108 Clazz_defineMethod (c$, "getDocumentFilter", 
3109 function () {
3110 return this.documentFilter;
3111 });
3112 Clazz_overrideMethod (c$, "getLength", 
3113 function () {
3114 return this.data.length () - 1;
3115 });
3116 Clazz_overrideMethod (c$, "addDocumentListener", 
3117 function (listener) {
3118 this.listenerList.add (javax.swing.event.DocumentListener, listener);
3119 }, "javax.swing.event.DocumentListener");
3120 Clazz_overrideMethod (c$, "removeDocumentListener", 
3121 function (listener) {
3122 this.listenerList.remove (javax.swing.event.DocumentListener, listener);
3123 }, "javax.swing.event.DocumentListener");
3124 Clazz_defineMethod (c$, "getDocumentListeners", 
3125 function () {
3126 return this.listenerList.getListeners (javax.swing.event.DocumentListener);
3127 });
3128 Clazz_overrideMethod (c$, "addUndoableEditListener", 
3129 function (listener) {
3130 this.listenerList.add (javax.swing.event.UndoableEditListener, listener);
3131 }, "javax.swing.event.UndoableEditListener");
3132 Clazz_overrideMethod (c$, "removeUndoableEditListener", 
3133 function (listener) {
3134 this.listenerList.remove (javax.swing.event.UndoableEditListener, listener);
3135 }, "javax.swing.event.UndoableEditListener");
3136 Clazz_defineMethod (c$, "getUndoableEditListeners", 
3137 function () {
3138 return this.listenerList.getListeners (javax.swing.event.UndoableEditListener);
3139 });
3140 Clazz_overrideMethod (c$, "getProperty", 
3141 function (key) {
3142 return this.getDocumentProperties ().get (key);
3143 }, "~O");
3144 Clazz_overrideMethod (c$, "putProperty", 
3145 function (key, value) {
3146 if (value != null) {
3147 this.getDocumentProperties ().put (key, value);
3148 } else {
3149 this.getDocumentProperties ().remove (key);
3150 }}, "~O,~O");
3151 Clazz_overrideMethod (c$, "remove", 
3152 function (offs, len) {
3153 var filter = this.getDocumentFilter ();
3154 this.writeLock ();
3155 try {
3156 if (filter != null) {
3157 filter.remove (this.getFilterBypass (), offs, len);
3158 } else {
3159 this.handleRemove (offs, len);
3160 }} finally {
3161 this.writeUnlock ();
3162 }
3163 }, "~N,~N");
3164 Clazz_defineMethod (c$, "handleRemove", 
3165 function (offs, len) {
3166 if (len > 0) {
3167 if (offs < 0 || (offs + len) > this.getLength ()) {
3168 throw  new javax.swing.text.BadLocationException ("Invalid remove", this.getLength () + 1);
3169 }var chng = Clazz_innerTypeInstance (javax.swing.text.AbstractDocument.DefaultDocumentEvent, this, null, offs, len, javax.swing.event.DocumentEvent.EventType.REMOVE);
3170 var isComposedTextElement = false;
3171 isComposedTextElement = javax.swing.text.Utilities.isComposedTextElement (this, offs);
3172 this.removeUpdate (chng);
3173 var u = this.data.remove (offs, len);
3174 if (u != null) {
3175 chng.addEdit (u);
3176 }this.postRemoveUpdate (chng);
3177 chng.end ();
3178 this.fireRemoveUpdate (chng);
3179 if ((u != null) && !isComposedTextElement) {
3180 this.fireUndoableEditUpdate ( new javax.swing.event.UndoableEditEvent (this, chng));
3181 }}}, "~N,~N");
3182 Clazz_overrideMethod (c$, "replace", 
3183 function (offset, length, text, attrs) {
3184 if (length == 0 && (text == null || text.length == 0)) {
3185 return;
3186 }var filter = this.getDocumentFilter ();
3187 this.writeLock ();
3188 try {
3189 if (filter != null) {
3190 filter.replace (this.getFilterBypass (), offset, length, text, attrs);
3191 } else {
3192 if (length > 0) {
3193 this.remove (offset, length);
3194 }if (text != null && text.length > 0) {
3195 this.insertString (offset, text, attrs);
3196 }}} finally {
3197 this.writeUnlock ();
3198 }
3199 }, "~N,~N,~S,javax.swing.text.AttributeSet");
3200 Clazz_overrideMethod (c$, "insertString", 
3201 function (offs, str, a) {
3202 if ((str == null) || (str.length == 0)) {
3203 return;
3204 }var filter = this.getDocumentFilter ();
3205 this.writeLock ();
3206 try {
3207 if (filter != null) {
3208 filter.insertString (this.getFilterBypass (), offs, str, a);
3209 } else {
3210 this.handleInsertString (offs, str, a);
3211 }} finally {
3212 this.writeUnlock ();
3213 }
3214 }, "~N,~S,javax.swing.text.AttributeSet");
3215 Clazz_defineMethod (c$, "handleInsertString", 
3216 function (offs, str, a) {
3217 if ((str == null) || (str.length == 0)) {
3218 return;
3219 }var u = this.data.insertString (offs, str);
3220 var e = Clazz_innerTypeInstance (javax.swing.text.AbstractDocument.DefaultDocumentEvent, this, null, offs, str.length, javax.swing.event.DocumentEvent.EventType.INSERT);
3221 if (u != null) {
3222 e.addEdit (u);
3223 }if (this.getProperty ("i18n").equals (Boolean.FALSE)) {
3224 }this.insertUpdate (e, a);
3225 e.end ();
3226 this.fireInsertUpdate (e);
3227 if (u != null && (a == null || !a.isDefined (javax.swing.text.StyleConstants.ComposedTextAttribute))) {
3228 this.fireUndoableEditUpdate ( new javax.swing.event.UndoableEditEvent (this, e));
3229 }}, "~N,~S,javax.swing.text.AttributeSet");
3230 Clazz_defineMethod (c$, "getText", 
3231 function (offset, length) {
3232 if (length < 0) {
3233 throw  new javax.swing.text.BadLocationException ("Length must be positive", length);
3234 }var str = this.data.getString (offset, length);
3235 return str;
3236 }, "~N,~N");
3237 Clazz_defineMethod (c$, "getText", 
3238 function (offset, length, txt) {
3239 if (length < 0) {
3240 throw  new javax.swing.text.BadLocationException ("Length must be positive", length);
3241 }this.data.getChars (offset, length, txt);
3242 }, "~N,~N,javax.swing.text.Segment");
3243 Clazz_overrideMethod (c$, "createPosition", 
3244 function (offs) {
3245 return this.data.createPosition (offs);
3246 }, "~N");
3247 Clazz_overrideMethod (c$, "getStartPosition", 
3248 function () {
3249 var p;
3250 try {
3251 p = this.createPosition (0);
3252 } catch (bl) {
3253 if (Clazz_exceptionOf (bl, javax.swing.text.BadLocationException)) {
3254 p = null;
3255 } else {
3256 throw bl;
3257 }
3258 }
3259 return p;
3260 });
3261 Clazz_overrideMethod (c$, "getEndPosition", 
3262 function () {
3263 var p;
3264 try {
3265 p = this.createPosition (this.data.length ());
3266 } catch (bl) {
3267 if (Clazz_exceptionOf (bl, javax.swing.text.BadLocationException)) {
3268 p = null;
3269 } else {
3270 throw bl;
3271 }
3272 }
3273 return p;
3274 });
3275 Clazz_overrideMethod (c$, "getRootElements", 
3276 function () {
3277 var elems =  new Array (2);
3278 elems[0] = this.getDefaultRootElement ();
3279 elems[1] = this.getBidiRootElement ();
3280 return elems;
3281 });
3282 Clazz_defineMethod (c$, "getFilterBypass", 
3283  function () {
3284 if (this.filterBypass == null) {
3285 this.filterBypass = Clazz_innerTypeInstance (javax.swing.text.AbstractDocument.DefaultFilterBypass, this, null);
3286 }return this.filterBypass;
3287 });
3288 Clazz_defineMethod (c$, "getBidiRootElement", 
3289 function () {
3290 return this.bidiRoot;
3291 });
3292 Clazz_defineMethod (c$, "isLeftToRight", 
3293 function (p0, p1) {
3294 if (!this.getProperty ("i18n").equals (Boolean.TRUE)) {
3295 return true;
3296 }var bidiRoot = this.getBidiRootElement ();
3297 var index = bidiRoot.getElementIndex (p0);
3298 var bidiElem = bidiRoot.getElement (index);
3299 if (bidiElem.getEndOffset () >= p1) {
3300 var bidiAttrs = bidiElem.getAttributes ();
3301 return ((javax.swing.text.StyleConstants.getBidiLevel (bidiAttrs) % 2) == 0);
3302 }return true;
3303 }, "~N,~N");
3304 Clazz_defineMethod (c$, "getAttributeContext", 
3305 function () {
3306 return this.context;
3307 });
3308 Clazz_defineMethod (c$, "insertUpdate", 
3309 function (chng, attr) {
3310 if (chng.type === javax.swing.event.DocumentEvent.EventType.INSERT && chng.getLength () > 0 && !Boolean.TRUE.equals (this.getProperty (javax.swing.text.AbstractDocument.MultiByteProperty))) {
3311 var segment = javax.swing.text.SegmentCache.getSharedSegment ();
3312 try {
3313 this.getText (chng.getOffset (), chng.getLength (), segment);
3314 segment.first ();
3315 do {
3316 if ((segment.current ()).charCodeAt (0) > 255) {
3317 this.putProperty (javax.swing.text.AbstractDocument.MultiByteProperty, Boolean.TRUE);
3318 break;
3319 }} while (segment.next () != '\uffff');
3320 } catch (ble) {
3321 if (Clazz_exceptionOf (ble, javax.swing.text.BadLocationException)) {
3322 } else {
3323 throw ble;
3324 }
3325 }
3326 javax.swing.text.SegmentCache.releaseSharedSegment (segment);
3327 }}, "javax.swing.text.AbstractDocument.DefaultDocumentEvent,javax.swing.text.AttributeSet");
3328 Clazz_defineMethod (c$, "removeUpdate", 
3329 function (chng) {
3330 }, "javax.swing.text.AbstractDocument.DefaultDocumentEvent");
3331 Clazz_defineMethod (c$, "postRemoveUpdate", 
3332 function (chng) {
3333 }, "javax.swing.text.AbstractDocument.DefaultDocumentEvent");
3334 Clazz_defineMethod (c$, "getContent", 
3335 function () {
3336 return this.data;
3337 });
3338 Clazz_defineMethod (c$, "createLeafElement", 
3339 function (parent, a, p0, p1) {
3340 return Clazz_innerTypeInstance (javax.swing.text.AbstractDocument.LeafElement, this, null, parent, a, p0, p1);
3341 }, "javax.swing.text.Element,javax.swing.text.AttributeSet,~N,~N");
3342 Clazz_defineMethod (c$, "createBranchElement", 
3343 function (parent, a) {
3344 return Clazz_innerTypeInstance (javax.swing.text.AbstractDocument.BranchElement, this, null, parent, a);
3345 }, "javax.swing.text.Element,javax.swing.text.AttributeSet");
3346 Clazz_defineMethod (c$, "writeLock", 
3347 function () {
3348 });
3349 Clazz_defineMethod (c$, "writeUnlock", 
3350 function () {
3351 });
3352 Clazz_defineMethod (c$, "readLock", 
3353 function () {
3354 });
3355 Clazz_defineMethod (c$, "readUnlock", 
3356 function () {
3357 });
3358 c$.$AbstractDocument$AbstractElement$ = function () {
3359 Clazz_pu$h(self.c$);
3360 c$ = Clazz_decorateAsClass (function () {
3361 Clazz_prepareCallback (this, arguments);
3362 this.parent = null;
3363 this.attributes = null;
3364 Clazz_instantialize (this, arguments);
3365 }, javax.swing.text.AbstractDocument, "AbstractElement", null, [javax.swing.text.Element, javax.swing.text.MutableAttributeSet, javax.swing.tree.TreeNode]);
3366 Clazz_makeConstructor (c$, 
3367 function (a, b) {
3368 this.parent = a;
3369 this.attributes = this.b$["javax.swing.text.AbstractDocument"].getAttributeContext ().getEmptySet ();
3370 if (b != null) {
3371 this.addAttributes (b);
3372 }}, "javax.swing.text.Element,javax.swing.text.AttributeSet");
3373 Clazz_defineMethod (c$, "getAttributeCount", 
3374 function () {
3375 return this.attributes.getAttributeCount ();
3376 });
3377 Clazz_defineMethod (c$, "isDefined", 
3378 function (a) {
3379 return this.attributes.isDefined (a);
3380 }, "~O");
3381 Clazz_defineMethod (c$, "isEqual", 
3382 function (a) {
3383 return this.attributes.isEqual (a);
3384 }, "javax.swing.text.AttributeSet");
3385 Clazz_defineMethod (c$, "copyAttributes", 
3386 function () {
3387 return this.attributes.copyAttributes ();
3388 });
3389 Clazz_defineMethod (c$, "getAttribute", 
3390 function (a) {
3391 var b = this.attributes.getAttribute (a);
3392 if (b == null) {
3393 var c = (this.parent != null) ? this.parent.getAttributes () : null;
3394 if (c != null) {
3395 b = c.getAttribute (a);
3396 }}return b;
3397 }, "~O");
3398 Clazz_defineMethod (c$, "getAttributeNames", 
3399 function () {
3400 return this.attributes.getAttributeNames ();
3401 });
3402 Clazz_defineMethod (c$, "containsAttribute", 
3403 function (a, b) {
3404 return this.attributes.containsAttribute (a, b);
3405 }, "~O,~O");
3406 Clazz_defineMethod (c$, "containsAttributes", 
3407 function (a) {
3408 return this.attributes.containsAttributes (a);
3409 }, "javax.swing.text.AttributeSet");
3410 Clazz_defineMethod (c$, "getResolveParent", 
3411 function () {
3412 var a = this.attributes.getResolveParent ();
3413 if ((a == null) && (this.parent != null)) {
3414 a = this.parent.getAttributes ();
3415 }return a;
3416 });
3417 Clazz_overrideMethod (c$, "addAttribute", 
3418 function (a, b) {
3419 this.checkForIllegalCast ();
3420 var c = this.b$["javax.swing.text.AbstractDocument"].getAttributeContext ();
3421 this.attributes = c.addAttribute (this.attributes, a, b);
3422 }, "~O,~O");
3423 Clazz_overrideMethod (c$, "addAttributes", 
3424 function (a) {
3425 this.checkForIllegalCast ();
3426 var b = this.b$["javax.swing.text.AbstractDocument"].getAttributeContext ();
3427 this.attributes = b.addAttributes (this.attributes, a);
3428 }, "javax.swing.text.AttributeSet");
3429 Clazz_overrideMethod (c$, "removeAttribute", 
3430 function (a) {
3431 this.checkForIllegalCast ();
3432 var b = this.b$["javax.swing.text.AbstractDocument"].getAttributeContext ();
3433 this.attributes = b.removeAttribute (this.attributes, a);
3434 }, "~O");
3435 Clazz_defineMethod (c$, "removeAttributes", 
3436 function (a) {
3437 this.checkForIllegalCast ();
3438 var b = this.b$["javax.swing.text.AbstractDocument"].getAttributeContext ();
3439 this.attributes = b.removeAttributes (this.attributes, a);
3440 }, "java.util.Enumeration");
3441 Clazz_defineMethod (c$, "removeAttributes", 
3442 function (a) {
3443 this.checkForIllegalCast ();
3444 var b = this.b$["javax.swing.text.AbstractDocument"].getAttributeContext ();
3445 if (a === this) {
3446 this.attributes = b.getEmptySet ();
3447 } else {
3448 this.attributes = b.removeAttributes (this.attributes, a);
3449 }}, "javax.swing.text.AttributeSet");
3450 Clazz_overrideMethod (c$, "setResolveParent", 
3451 function (a) {
3452 this.checkForIllegalCast ();
3453 var b = this.b$["javax.swing.text.AbstractDocument"].getAttributeContext ();
3454 if (a != null) {
3455 this.attributes = b.addAttribute (this.attributes, javax.swing.text.StyleConstants.ResolveAttribute, a);
3456 } else {
3457 this.attributes = b.removeAttribute (this.attributes, javax.swing.text.StyleConstants.ResolveAttribute);
3458 }}, "javax.swing.text.AttributeSet");
3459 Clazz_defineMethod (c$, "checkForIllegalCast", 
3460  function () {
3461 });
3462 Clazz_overrideMethod (c$, "getDocument", 
3463 function () {
3464 return this.b$["javax.swing.text.AbstractDocument"];
3465 });
3466 Clazz_overrideMethod (c$, "getParentElement", 
3467 function () {
3468 return this.parent;
3469 });
3470 Clazz_defineMethod (c$, "getAttributes", 
3471 function () {
3472 return this;
3473 });
3474 Clazz_overrideMethod (c$, "getName", 
3475 function () {
3476 if (this.attributes.isDefined ("$ename")) {
3477 return this.attributes.getAttribute ("$ename");
3478 }return null;
3479 });
3480 Clazz_overrideMethod (c$, "getChildAt", 
3481 function (a) {
3482 return this.getElement (a);
3483 }, "~N");
3484 Clazz_overrideMethod (c$, "getChildCount", 
3485 function () {
3486 return this.getElementCount ();
3487 });
3488 Clazz_overrideMethod (c$, "getParent", 
3489 function () {
3490 return this.getParentElement ();
3491 });
3492 Clazz_overrideMethod (c$, "getIndex", 
3493 function (a) {
3494 for (var b = this.getChildCount () - 1; b >= 0; b--) if (this.getChildAt (b) === a) return b;
3495
3496 return -1;
3497 }, "javax.swing.tree.TreeNode");
3498 c$ = Clazz_p0p ();
3499 };
3500 c$.$AbstractDocument$BranchElement$ = function () {
3501 Clazz_pu$h(self.c$);
3502 c$ = Clazz_decorateAsClass (function () {
3503 Clazz_prepareCallback (this, arguments);
3504 this.$children = null;
3505 this.nchildren = 0;
3506 this.lastIndex = 0;
3507 Clazz_instantialize (this, arguments);
3508 }, javax.swing.text.AbstractDocument, "BranchElement", javax.swing.text.AbstractDocument.AbstractElement, null, Clazz_innerTypeInstance (javax.swing.text.AbstractDocument.AbstractElement, this, null, Clazz_inheritArgs));
3509 Clazz_makeConstructor (c$, 
3510 function (a, b) {
3511 Clazz_superConstructor (this, javax.swing.text.AbstractDocument.BranchElement, [a, b]);
3512 this.$children =  new Array (1);
3513 this.nchildren = 0;
3514 this.lastIndex = -1;
3515 }, "javax.swing.text.Element,javax.swing.text.AttributeSet");
3516 Clazz_defineMethod (c$, "positionToElement", 
3517 function (a) {
3518 var b = this.getElementIndex (a);
3519 var c = this.$children[b];
3520 var d = c.getStartOffset ();
3521 var e = c.getEndOffset ();
3522 if ((a >= d) && (a < e)) {
3523 return c;
3524 }return null;
3525 }, "~N");
3526 Clazz_defineMethod (c$, "replace", 
3527 function (a, b, c) {
3528 var d = c.length - b;
3529 var e = a + b;
3530 var f = this.nchildren - e;
3531 var g = e + d;
3532 if ((this.nchildren + d) >= this.$children.length) {
3533 var h = Math.max (2 * this.$children.length, this.nchildren + d);
3534 var i =  new Array (h);
3535 System.arraycopy (this.$children, 0, i, 0, a);
3536 System.arraycopy (c, 0, i, a, c.length);
3537 System.arraycopy (this.$children, e, i, g, f);
3538 this.$children = i;
3539 } else {
3540 System.arraycopy (this.$children, e, this.$children, g, f);
3541 System.arraycopy (c, 0, this.$children, a, c.length);
3542 }this.nchildren = this.nchildren + d;
3543 }, "~N,~N,~A");
3544 Clazz_overrideMethod (c$, "toString", 
3545 function () {
3546 return "BranchElement(" + this.getName () + ") " + this.getStartOffset () + "," + this.getEndOffset () + "\n";
3547 });
3548 Clazz_defineMethod (c$, "getName", 
3549 function () {
3550 var a = Clazz_superCall (this, javax.swing.text.AbstractDocument.BranchElement, "getName", []);
3551 if (a == null) {
3552 a = "paragraph";
3553 }return a;
3554 });
3555 Clazz_defineMethod (c$, "getStartOffset", 
3556 function () {
3557 return this.$children[0].getStartOffset ();
3558 });
3559 Clazz_overrideMethod (c$, "getEndOffset", 
3560 function () {
3561 var a = (this.nchildren > 0) ? this.$children[this.nchildren - 1] : this.$children[0];
3562 return a.getEndOffset ();
3563 });
3564 Clazz_overrideMethod (c$, "getElement", 
3565 function (a) {
3566 if (a < this.nchildren) {
3567 return this.$children[a];
3568 }return null;
3569 }, "~N");
3570 Clazz_overrideMethod (c$, "getElementCount", 
3571 function () {
3572 return this.nchildren;
3573 });
3574 Clazz_overrideMethod (c$, "getElementIndex", 
3575 function (a) {
3576 var b;
3577 var c = 0;
3578 var d = this.nchildren - 1;
3579 var e = 0;
3580 var f = this.getStartOffset ();
3581 var g;
3582 if (this.nchildren == 0) {
3583 return 0;
3584 }if (a >= this.getEndOffset ()) {
3585 return this.nchildren - 1;
3586 }if ((this.lastIndex >= c) && (this.lastIndex <= d)) {
3587 var h = this.$children[this.lastIndex];
3588 f = h.getStartOffset ();
3589 g = h.getEndOffset ();
3590 if ((a >= f) && (a < g)) {
3591 return this.lastIndex;
3592 }if (a < f) {
3593 d = this.lastIndex;
3594 } else {
3595 c = this.lastIndex;
3596 }}while (c <= d) {
3597 e = c + (Clazz_doubleToInt ((d - c) / 2));
3598 var h = this.$children[e];
3599 f = h.getStartOffset ();
3600 g = h.getEndOffset ();
3601 if ((a >= f) && (a < g)) {
3602 b = e;
3603 this.lastIndex = b;
3604 return b;
3605 } else if (a < f) {
3606 d = e - 1;
3607 } else {
3608 c = e + 1;
3609 }}
3610 if (a < f) {
3611 b = e;
3612 } else {
3613 b = e + 1;
3614 }this.lastIndex = b;
3615 return b;
3616 }, "~N");
3617 Clazz_overrideMethod (c$, "isLeaf", 
3618 function () {
3619 return false;
3620 });
3621 Clazz_overrideMethod (c$, "getAllowsChildren", 
3622 function () {
3623 return true;
3624 });
3625 Clazz_overrideMethod (c$, "children", 
3626 function () {
3627 if (this.nchildren == 0) return null;
3628 var a =  new java.util.Vector (this.nchildren);
3629 for (var b = 0; b < this.nchildren; b++) a.addElement (this.$children[b]);
3630
3631 return a.elements ();
3632 });
3633 c$ = Clazz_p0p ();
3634 };
3635 c$.$AbstractDocument$LeafElement$ = function () {
3636 Clazz_pu$h(self.c$);
3637 c$ = Clazz_decorateAsClass (function () {
3638 Clazz_prepareCallback (this, arguments);
3639 this.p0 = null;
3640 this.p1 = null;
3641 Clazz_instantialize (this, arguments);
3642 }, javax.swing.text.AbstractDocument, "LeafElement", javax.swing.text.AbstractDocument.AbstractElement, null, Clazz_innerTypeInstance (javax.swing.text.AbstractDocument.AbstractElement, this, null, Clazz_inheritArgs));
3643 Clazz_makeConstructor (c$, 
3644 function (a, b, c, d) {
3645 Clazz_superConstructor (this, javax.swing.text.AbstractDocument.LeafElement, [a, b]);
3646 try {
3647 this.p0 = this.b$["javax.swing.text.AbstractDocument"].createPosition (c);
3648 this.p1 = this.b$["javax.swing.text.AbstractDocument"].createPosition (d);
3649 } catch (e) {
3650 if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
3651 this.p0 = null;
3652 this.p1 = null;
3653 throw  new javax.swing.text.StateInvariantError ("Can't create Position references");
3654 } else {
3655 throw e;
3656 }
3657 }
3658 }, "javax.swing.text.Element,javax.swing.text.AttributeSet,~N,~N");
3659 Clazz_overrideMethod (c$, "toString", 
3660 function () {
3661 return "LeafElement(" + this.getName () + ") " + this.p0 + "," + this.p1 + "\n";
3662 });
3663 Clazz_overrideMethod (c$, "getStartOffset", 
3664 function () {
3665 return this.p0.getOffset ();
3666 });
3667 Clazz_overrideMethod (c$, "getEndOffset", 
3668 function () {
3669 return this.p1.getOffset ();
3670 });
3671 Clazz_defineMethod (c$, "getName", 
3672 function () {
3673 var a = Clazz_superCall (this, javax.swing.text.AbstractDocument.LeafElement, "getName", []);
3674 if (a == null) {
3675 a = "content";
3676 }return a;
3677 });
3678 Clazz_overrideMethod (c$, "getElementIndex", 
3679 function (a) {
3680 return -1;
3681 }, "~N");
3682 Clazz_overrideMethod (c$, "getElement", 
3683 function (a) {
3684 return null;
3685 }, "~N");
3686 Clazz_overrideMethod (c$, "getElementCount", 
3687 function () {
3688 return 0;
3689 });
3690 Clazz_overrideMethod (c$, "isLeaf", 
3691 function () {
3692 return true;
3693 });
3694 Clazz_overrideMethod (c$, "getAllowsChildren", 
3695 function () {
3696 return false;
3697 });
3698 Clazz_overrideMethod (c$, "children", 
3699 function () {
3700 return null;
3701 });
3702 c$ = Clazz_p0p ();
3703 };
3704 c$.$AbstractDocument$DefaultDocumentEvent$ = function () {
3705 Clazz_pu$h(self.c$);
3706 c$ = Clazz_decorateAsClass (function () {
3707 Clazz_prepareCallback (this, arguments);
3708 this.offset = 0;
3709 this.length = 0;
3710 this.changeLookup = null;
3711 this.type = null;
3712 Clazz_instantialize (this, arguments);
3713 }, javax.swing.text.AbstractDocument, "DefaultDocumentEvent", javax.swing.undo.CompoundEdit, javax.swing.event.DocumentEvent);
3714 Clazz_makeConstructor (c$, 
3715 function (a, b, c) {
3716 Clazz_superConstructor (this, javax.swing.text.AbstractDocument.DefaultDocumentEvent);
3717 this.offset = a;
3718 this.length = b;
3719 this.type = c;
3720 }, "~N,~N,javax.swing.event.DocumentEvent.EventType");
3721 Clazz_overrideMethod (c$, "toString", 
3722 function () {
3723 return this.edits.toString ();
3724 });
3725 Clazz_defineMethod (c$, "addEdit", 
3726 function (a) {
3727 if ((this.changeLookup == null) && (this.edits.size () > 10)) {
3728 this.changeLookup =  new java.util.Hashtable ();
3729 var b = this.edits.size ();
3730 for (var c = 0; c < b; c++) {
3731 var d = this.edits.elementAt (c);
3732 if (Clazz_instanceOf (d, javax.swing.event.DocumentEvent.ElementChange)) {
3733 var e = d;
3734 this.changeLookup.put (e.getElement (), e);
3735 }}
3736 }if ((this.changeLookup != null) && (Clazz_instanceOf (a, javax.swing.event.DocumentEvent.ElementChange))) {
3737 var b = a;
3738 this.changeLookup.put (b.getElement (), b);
3739 }return Clazz_superCall (this, javax.swing.text.AbstractDocument.DefaultDocumentEvent, "addEdit", [a]);
3740 }, "javax.swing.undo.UndoableEdit");
3741 Clazz_defineMethod (c$, "redo", 
3742 function () {
3743 this.b$["javax.swing.text.AbstractDocument"].writeLock ();
3744 try {
3745 Clazz_superCall (this, javax.swing.text.AbstractDocument.DefaultDocumentEvent, "redo", []);
3746 var a = Clazz_innerTypeInstance (javax.swing.text.AbstractDocument.UndoRedoDocumentEvent, this, null, this, false);
3747 if (this.type === javax.swing.event.DocumentEvent.EventType.INSERT) {
3748 this.b$["javax.swing.text.AbstractDocument"].fireInsertUpdate (a);
3749 } else if (this.type === javax.swing.event.DocumentEvent.EventType.REMOVE) {
3750 this.b$["javax.swing.text.AbstractDocument"].fireRemoveUpdate (a);
3751 } else {
3752 this.b$["javax.swing.text.AbstractDocument"].fireChangedUpdate (a);
3753 }} finally {
3754 this.b$["javax.swing.text.AbstractDocument"].writeUnlock ();
3755 }
3756 });
3757 Clazz_defineMethod (c$, "undo", 
3758 function () {
3759 this.b$["javax.swing.text.AbstractDocument"].writeLock ();
3760 try {
3761 Clazz_superCall (this, javax.swing.text.AbstractDocument.DefaultDocumentEvent, "undo", []);
3762 var a = Clazz_innerTypeInstance (javax.swing.text.AbstractDocument.UndoRedoDocumentEvent, this, null, this, true);
3763 if (this.type === javax.swing.event.DocumentEvent.EventType.REMOVE) {
3764 this.b$["javax.swing.text.AbstractDocument"].fireInsertUpdate (a);
3765 } else if (this.type === javax.swing.event.DocumentEvent.EventType.INSERT) {
3766 this.b$["javax.swing.text.AbstractDocument"].fireRemoveUpdate (a);
3767 } else {
3768 this.b$["javax.swing.text.AbstractDocument"].fireChangedUpdate (a);
3769 }} finally {
3770 this.b$["javax.swing.text.AbstractDocument"].writeUnlock ();
3771 }
3772 });
3773 Clazz_overrideMethod (c$, "isSignificant", 
3774 function () {
3775 return true;
3776 });
3777 Clazz_overrideMethod (c$, "getPresentationName", 
3778 function () {
3779 var a = this.getType ();
3780 if (a === javax.swing.event.DocumentEvent.EventType.INSERT) return javax.swing.UIManager.getString ("AbstractDocument.additionText");
3781 if (a === javax.swing.event.DocumentEvent.EventType.REMOVE) return javax.swing.UIManager.getString ("AbstractDocument.deletionText");
3782 return javax.swing.UIManager.getString ("AbstractDocument.styleChangeText");
3783 });
3784 Clazz_overrideMethod (c$, "getUndoPresentationName", 
3785 function () {
3786 return javax.swing.UIManager.getString ("AbstractDocument.undoText") + " " + this.getPresentationName ();
3787 });
3788 Clazz_overrideMethod (c$, "getRedoPresentationName", 
3789 function () {
3790 return javax.swing.UIManager.getString ("AbstractDocument.redoText") + " " + this.getPresentationName ();
3791 });
3792 Clazz_overrideMethod (c$, "getType", 
3793 function () {
3794 return this.type;
3795 });
3796 Clazz_overrideMethod (c$, "getOffset", 
3797 function () {
3798 return this.offset;
3799 });
3800 Clazz_overrideMethod (c$, "getLength", 
3801 function () {
3802 return this.length;
3803 });
3804 Clazz_overrideMethod (c$, "getDocument", 
3805 function () {
3806 return this.b$["javax.swing.text.AbstractDocument"];
3807 });
3808 Clazz_overrideMethod (c$, "getChange", 
3809 function (a) {
3810 if (this.changeLookup != null) {
3811 return this.changeLookup.get (a);
3812 }var b = this.edits.size ();
3813 for (var c = 0; c < b; c++) {
3814 var d = this.edits.elementAt (c);
3815 if (Clazz_instanceOf (d, javax.swing.event.DocumentEvent.ElementChange)) {
3816 var e = d;
3817 if (a.equals (e.getElement ())) {
3818 return e;
3819 }}}
3820 return null;
3821 }, "javax.swing.text.Element");
3822 c$ = Clazz_p0p ();
3823 };
3824 c$.$AbstractDocument$UndoRedoDocumentEvent$ = function () {
3825 Clazz_pu$h(self.c$);
3826 c$ = Clazz_decorateAsClass (function () {
3827 Clazz_prepareCallback (this, arguments);
3828 this.src = null;
3829 this.type = null;
3830 Clazz_instantialize (this, arguments);
3831 }, javax.swing.text.AbstractDocument, "UndoRedoDocumentEvent", null, javax.swing.event.DocumentEvent);
3832 Clazz_makeConstructor (c$, 
3833 function (a, b) {
3834 this.src = a;
3835 if (b) {
3836 if (a.getType ().equals (javax.swing.event.DocumentEvent.EventType.INSERT)) {
3837 this.type = javax.swing.event.DocumentEvent.EventType.REMOVE;
3838 } else if (a.getType ().equals (javax.swing.event.DocumentEvent.EventType.REMOVE)) {
3839 this.type = javax.swing.event.DocumentEvent.EventType.INSERT;
3840 } else {
3841 this.type = a.getType ();
3842 }} else {
3843 this.type = a.getType ();
3844 }}, "javax.swing.text.AbstractDocument.DefaultDocumentEvent,~B");
3845 Clazz_defineMethod (c$, "getSource", 
3846 function () {
3847 return this.src;
3848 });
3849 Clazz_overrideMethod (c$, "getOffset", 
3850 function () {
3851 return this.src.getOffset ();
3852 });
3853 Clazz_overrideMethod (c$, "getLength", 
3854 function () {
3855 return this.src.getLength ();
3856 });
3857 Clazz_overrideMethod (c$, "getDocument", 
3858 function () {
3859 return this.src.getDocument ();
3860 });
3861 Clazz_overrideMethod (c$, "getType", 
3862 function () {
3863 return this.type;
3864 });
3865 Clazz_overrideMethod (c$, "getChange", 
3866 function (a) {
3867 return this.src.getChange (a);
3868 }, "javax.swing.text.Element");
3869 c$ = Clazz_p0p ();
3870 };
3871 c$.$AbstractDocument$DefaultFilterBypass$ = function () {
3872 Clazz_pu$h(self.c$);
3873 c$ = Clazz_decorateAsClass (function () {
3874 Clazz_prepareCallback (this, arguments);
3875 Clazz_instantialize (this, arguments);
3876 }, javax.swing.text.AbstractDocument, "DefaultFilterBypass", javax.swing.text.DocumentFilter.FilterBypass);
3877 Clazz_overrideMethod (c$, "getDocument", 
3878 function () {
3879 return this.b$["javax.swing.text.AbstractDocument"];
3880 });
3881 Clazz_overrideMethod (c$, "remove", 
3882 function (a, b) {
3883 this.b$["javax.swing.text.AbstractDocument"].handleRemove (a, b);
3884 }, "~N,~N");
3885 Clazz_overrideMethod (c$, "insertString", 
3886 function (a, b, c) {
3887 this.b$["javax.swing.text.AbstractDocument"].handleInsertString (a, b, c);
3888 }, "~N,~S,javax.swing.text.AttributeSet");
3889 Clazz_overrideMethod (c$, "replace", 
3890 function (a, b, c, d) {
3891 this.b$["javax.swing.text.AbstractDocument"].handleRemove (a, b);
3892 this.b$["javax.swing.text.AbstractDocument"].handleInsertString (a, c, d);
3893 }, "~N,~N,~S,javax.swing.text.AttributeSet");
3894 c$ = Clazz_p0p ();
3895 };
3896 Clazz_declareInterface (javax.swing.text.AbstractDocument, "Content");
3897 Clazz_declareInterface (javax.swing.text.AbstractDocument, "AttributeContext");
3898 Clazz_pu$h(self.c$);
3899 c$ = Clazz_decorateAsClass (function () {
3900 this.e = null;
3901 this.index = 0;
3902 this.removed = null;
3903 this.added = null;
3904 Clazz_instantialize (this, arguments);
3905 }, javax.swing.text.AbstractDocument, "ElementEdit", javax.swing.undo.AbstractUndoableEdit, javax.swing.event.DocumentEvent.ElementChange);
3906 Clazz_makeConstructor (c$, 
3907 function (a, b, c, d) {
3908 Clazz_superConstructor (this, javax.swing.text.AbstractDocument.ElementEdit);
3909 this.e = a;
3910 this.index = b;
3911 this.removed = c;
3912 this.added = d;
3913 }, "javax.swing.text.Element,~N,~A,~A");
3914 Clazz_overrideMethod (c$, "getElement", 
3915 function () {
3916 return this.e;
3917 });
3918 Clazz_overrideMethod (c$, "getIndex", 
3919 function () {
3920 return this.index;
3921 });
3922 Clazz_overrideMethod (c$, "getChildrenRemoved", 
3923 function () {
3924 return this.removed;
3925 });
3926 Clazz_overrideMethod (c$, "getChildrenAdded", 
3927 function () {
3928 return this.added;
3929 });
3930 Clazz_defineMethod (c$, "redo", 
3931 function () {
3932 Clazz_superCall (this, javax.swing.text.AbstractDocument.ElementEdit, "redo", []);
3933 var a = this.removed;
3934 this.removed = this.added;
3935 this.added = a;
3936 (this.e).replace (this.index, this.removed.length, this.added);
3937 });
3938 Clazz_defineMethod (c$, "undo", 
3939 function () {
3940 Clazz_superCall (this, javax.swing.text.AbstractDocument.ElementEdit, "undo", []);
3941 (this.e).replace (this.index, this.added.length, this.removed);
3942 var a = this.removed;
3943 this.removed = this.added;
3944 this.added = a;
3945 });
3946 c$ = Clazz_p0p ();
3947 Clazz_defineStatics (c$,
3948 "BAD_LOCATION", "document location failure",
3949 "ParagraphElementName", "paragraph",
3950 "ContentElementName", "content",
3951 "SectionElementName", "section",
3952 "BidiElementName", "bidi level",
3953 "ElementNameAttribute", "$ename",
3954 "I18NProperty", "i18n",
3955 "MultiByteProperty", "multiByte",
3956 "AsyncLoadPriority", "load priority");
3957 });
3958 Clazz_declarePackage ("javax.swing.event");
3959 Clazz_declareInterface (javax.swing.event, "DocumentEvent");
3960 Clazz_pu$h(self.c$);
3961 c$ = Clazz_decorateAsClass (function () {
3962 this.typeString = null;
3963 Clazz_instantialize (this, arguments);
3964 }, javax.swing.event.DocumentEvent, "EventType");
3965 Clazz_makeConstructor (c$, 
3966  function (a) {
3967 this.typeString = a;
3968 }, "~S");
3969 Clazz_overrideMethod (c$, "toString", 
3970 function () {
3971 return this.typeString;
3972 });
3973 c$.INSERT = c$.prototype.INSERT =  new javax.swing.event.DocumentEvent.EventType ("INSERT");
3974 c$.REMOVE = c$.prototype.REMOVE =  new javax.swing.event.DocumentEvent.EventType ("REMOVE");
3975 c$.CHANGE = c$.prototype.CHANGE =  new javax.swing.event.DocumentEvent.EventType ("CHANGE");
3976 c$ = Clazz_p0p ();
3977 Clazz_declareInterface (javax.swing.event.DocumentEvent, "ElementChange");
3978 Clazz_declarePackage ("javax.swing.text");
3979 c$ = Clazz_declareType (javax.swing.text, "DocumentFilter");
3980 Clazz_defineMethod (c$, "remove", 
3981 function (fb, offset, length) {
3982 fb.remove (offset, length);
3983 }, "javax.swing.text.DocumentFilter.FilterBypass,~N,~N");
3984 Clazz_defineMethod (c$, "insertString", 
3985 function (fb, offset, string, attr) {
3986 fb.insertString (offset, string, attr);
3987 }, "javax.swing.text.DocumentFilter.FilterBypass,~N,~S,javax.swing.text.AttributeSet");
3988 Clazz_defineMethod (c$, "replace", 
3989 function (fb, offset, length, text, attrs) {
3990 fb.replace (offset, length, text, attrs);
3991 }, "javax.swing.text.DocumentFilter.FilterBypass,~N,~N,~S,javax.swing.text.AttributeSet");
3992 Clazz_pu$h(self.c$);
3993 c$ = Clazz_declareType (javax.swing.text.DocumentFilter, "FilterBypass");
3994 c$ = Clazz_p0p ();
3995 Clazz_declarePackage ("javax.swing.text");
3996 Clazz_declareInterface (javax.swing.text, "Element");
3997 Clazz_declarePackage ("javax.swing.text");
3998 Clazz_load (["javax.swing.text.Document"], "javax.swing.text.JSMinimalAbstractDocument", null, function () {
3999 Clazz_declareInterface (javax.swing.text, "JSMinimalAbstractDocument", javax.swing.text.Document);
4000 });
4001 Clazz_declarePackage ("javax.swing.text");
4002 c$ = Clazz_declareInterface (javax.swing.text, "Document");
4003 Clazz_defineStatics (c$,
4004 "StreamDescriptionProperty", "stream",
4005 "TitleProperty", "title");
4006 Clazz_declarePackage ("javax.swing.text");
4007 Clazz_load (["javax.swing.text.AttributeSet"], "javax.swing.text.MutableAttributeSet", null, function () {
4008 Clazz_declareInterface (javax.swing.text, "MutableAttributeSet", javax.swing.text.AttributeSet);
4009 });
4010 Clazz_declarePackage ("javax.swing.text");
4011 Clazz_declareInterface (javax.swing.text, "AttributeSet");
4012 Clazz_declareInterface (javax.swing.text.AttributeSet, "FontAttribute");
4013 Clazz_declareInterface (javax.swing.text.AttributeSet, "ColorAttribute");
4014 Clazz_declareInterface (javax.swing.text.AttributeSet, "CharacterAttribute");
4015 Clazz_declareInterface (javax.swing.text.AttributeSet, "ParagraphAttribute");
4016 Clazz_declarePackage ("javax.swing.tree");
4017 Clazz_declareInterface (javax.swing.tree, "TreeNode");
4018 Clazz_declarePackage ("javax.swing.undo");
4019 Clazz_load (["javax.swing.undo.UndoableEdit"], "javax.swing.undo.AbstractUndoableEdit", ["javax.swing.UIManager", "javax.swing.undo.CannotRedoException", "$.CannotUndoException"], function () {
4020 c$ = Clazz_decorateAsClass (function () {
4021 this.hasBeenDone = false;
4022 this.alive = false;
4023 Clazz_instantialize (this, arguments);
4024 }, javax.swing.undo, "AbstractUndoableEdit", null, javax.swing.undo.UndoableEdit);
4025 Clazz_makeConstructor (c$, 
4026 function () {
4027 this.hasBeenDone = true;
4028 this.alive = true;
4029 });
4030 Clazz_overrideMethod (c$, "die", 
4031 function () {
4032 this.alive = false;
4033 });
4034 Clazz_overrideMethod (c$, "undo", 
4035 function () {
4036 if (!this.canUndo ()) {
4037 throw  new javax.swing.undo.CannotUndoException ();
4038 }this.hasBeenDone = false;
4039 });
4040 Clazz_overrideMethod (c$, "canUndo", 
4041 function () {
4042 return this.alive && this.hasBeenDone;
4043 });
4044 Clazz_overrideMethod (c$, "redo", 
4045 function () {
4046 if (!this.canRedo ()) {
4047 throw  new javax.swing.undo.CannotRedoException ();
4048 }this.hasBeenDone = true;
4049 });
4050 Clazz_overrideMethod (c$, "canRedo", 
4051 function () {
4052 return this.alive && !this.hasBeenDone;
4053 });
4054 Clazz_overrideMethod (c$, "addEdit", 
4055 function (anEdit) {
4056 return false;
4057 }, "javax.swing.undo.UndoableEdit");
4058 Clazz_overrideMethod (c$, "replaceEdit", 
4059 function (anEdit) {
4060 return false;
4061 }, "javax.swing.undo.UndoableEdit");
4062 Clazz_overrideMethod (c$, "isSignificant", 
4063 function () {
4064 return true;
4065 });
4066 Clazz_overrideMethod (c$, "getPresentationName", 
4067 function () {
4068 return "";
4069 });
4070 Clazz_overrideMethod (c$, "getUndoPresentationName", 
4071 function () {
4072 var name = this.getPresentationName ();
4073 if (!"".equals (name)) {
4074 name = javax.swing.UIManager.getString ("AbstractUndoableEdit.undoText") + " " + name;
4075 } else {
4076 name = javax.swing.UIManager.getString ("AbstractUndoableEdit.undoText");
4077 }return name;
4078 });
4079 Clazz_overrideMethod (c$, "getRedoPresentationName", 
4080 function () {
4081 var name = this.getPresentationName ();
4082 if (!"".equals (name)) {
4083 name = javax.swing.UIManager.getString ("AbstractUndoableEdit.redoText") + " " + name;
4084 } else {
4085 name = javax.swing.UIManager.getString ("AbstractUndoableEdit.redoText");
4086 }return name;
4087 });
4088 Clazz_defineMethod (c$, "toString", 
4089 function () {
4090 return Clazz_superCall (this, javax.swing.undo.AbstractUndoableEdit, "toString", []) + " hasBeenDone: " + this.hasBeenDone + " alive: " + this.alive;
4091 });
4092 Clazz_defineStatics (c$,
4093 "UndoName", "Undo",
4094 "RedoName", "Redo");
4095 });
4096 Clazz_declarePackage ("javax.swing.undo");
4097 Clazz_declareInterface (javax.swing.undo, "UndoableEdit");
4098 Clazz_declarePackage ("javax.swing.undo");
4099 Clazz_load (["java.lang.RuntimeException"], "javax.swing.undo.CannotRedoException", null, function () {
4100 c$ = Clazz_declareType (javax.swing.undo, "CannotRedoException", RuntimeException);
4101 });
4102 Clazz_declarePackage ("javax.swing.undo");
4103 Clazz_load (["java.lang.RuntimeException"], "javax.swing.undo.CannotUndoException", null, function () {
4104 c$ = Clazz_declareType (javax.swing.undo, "CannotUndoException", RuntimeException);
4105 });
4106 Clazz_declarePackage ("javax.swing.undo");
4107 Clazz_load (["javax.swing.undo.AbstractUndoableEdit"], "javax.swing.undo.CompoundEdit", ["java.util.Vector"], function () {
4108 c$ = Clazz_decorateAsClass (function () {
4109 this.inProgress = false;
4110 this.edits = null;
4111 Clazz_instantialize (this, arguments);
4112 }, javax.swing.undo, "CompoundEdit", javax.swing.undo.AbstractUndoableEdit);
4113 Clazz_makeConstructor (c$, 
4114 function () {
4115 Clazz_superConstructor (this, javax.swing.undo.CompoundEdit);
4116 this.inProgress = true;
4117 this.edits =  new java.util.Vector ();
4118 });
4119 Clazz_defineMethod (c$, "undo", 
4120 function () {
4121 Clazz_superCall (this, javax.swing.undo.CompoundEdit, "undo", []);
4122 var i = this.edits.size ();
4123 while (i-- > 0) {
4124 var e = this.edits.elementAt (i);
4125 e.undo ();
4126 }
4127 });
4128 Clazz_defineMethod (c$, "redo", 
4129 function () {
4130 Clazz_superCall (this, javax.swing.undo.CompoundEdit, "redo", []);
4131 var cursor = this.edits.elements ();
4132 while (cursor.hasMoreElements ()) {
4133 (cursor.nextElement ()).redo ();
4134 }
4135 });
4136 Clazz_defineMethod (c$, "lastEdit", 
4137 function () {
4138 var count = this.edits.size ();
4139 if (count > 0) return this.edits.elementAt (count - 1);
4140  else return null;
4141 });
4142 Clazz_defineMethod (c$, "die", 
4143 function () {
4144 var size = this.edits.size ();
4145 for (var i = size - 1; i >= 0; i--) {
4146 var e = this.edits.elementAt (i);
4147 e.die ();
4148 }
4149 Clazz_superCall (this, javax.swing.undo.CompoundEdit, "die", []);
4150 });
4151 Clazz_overrideMethod (c$, "addEdit", 
4152 function (anEdit) {
4153 if (!this.inProgress) {
4154 return false;
4155 } else {
4156 var last = this.lastEdit ();
4157 if (last == null) {
4158 this.edits.addElement (anEdit);
4159 } else if (!last.addEdit (anEdit)) {
4160 if (anEdit.replaceEdit (last)) {
4161 this.edits.removeElementAt (this.edits.size () - 1);
4162 }this.edits.addElement (anEdit);
4163 }return true;
4164 }}, "javax.swing.undo.UndoableEdit");
4165 Clazz_defineMethod (c$, "end", 
4166 function () {
4167 this.inProgress = false;
4168 });
4169 Clazz_defineMethod (c$, "canUndo", 
4170 function () {
4171 return !this.isInProgress () && Clazz_superCall (this, javax.swing.undo.CompoundEdit, "canUndo", []);
4172 });
4173 Clazz_defineMethod (c$, "canRedo", 
4174 function () {
4175 return !this.isInProgress () && Clazz_superCall (this, javax.swing.undo.CompoundEdit, "canRedo", []);
4176 });
4177 Clazz_defineMethod (c$, "isInProgress", 
4178 function () {
4179 return this.inProgress;
4180 });
4181 Clazz_overrideMethod (c$, "isSignificant", 
4182 function () {
4183 var cursor = this.edits.elements ();
4184 while (cursor.hasMoreElements ()) {
4185 if ((cursor.nextElement ()).isSignificant ()) {
4186 return true;
4187 }}
4188 return false;
4189 });
4190 Clazz_defineMethod (c$, "getPresentationName", 
4191 function () {
4192 var last = this.lastEdit ();
4193 if (last != null) {
4194 return last.getPresentationName ();
4195 } else {
4196 return Clazz_superCall (this, javax.swing.undo.CompoundEdit, "getPresentationName", []);
4197 }});
4198 Clazz_defineMethod (c$, "getUndoPresentationName", 
4199 function () {
4200 var last = this.lastEdit ();
4201 if (last != null) {
4202 return last.getUndoPresentationName ();
4203 } else {
4204 return Clazz_superCall (this, javax.swing.undo.CompoundEdit, "getUndoPresentationName", []);
4205 }});
4206 Clazz_defineMethod (c$, "getRedoPresentationName", 
4207 function () {
4208 var last = this.lastEdit ();
4209 if (last != null) {
4210 return last.getRedoPresentationName ();
4211 } else {
4212 return Clazz_superCall (this, javax.swing.undo.CompoundEdit, "getRedoPresentationName", []);
4213 }});
4214 Clazz_defineMethod (c$, "toString", 
4215 function () {
4216 return Clazz_superCall (this, javax.swing.undo.CompoundEdit, "toString", []) + " inProgress: " + this.inProgress + " edits: " + this.edits;
4217 });
4218 });
4219 Clazz_declarePackage ("javax.swing.event");
4220 Clazz_load (["java.util.EventObject"], "javax.swing.event.UndoableEditEvent", null, function () {
4221 c$ = Clazz_decorateAsClass (function () {
4222 this.myEdit = null;
4223 Clazz_instantialize (this, arguments);
4224 }, javax.swing.event, "UndoableEditEvent", java.util.EventObject);
4225 Clazz_makeConstructor (c$, 
4226 function (source, edit) {
4227 Clazz_superConstructor (this, javax.swing.event.UndoableEditEvent, [source]);
4228 this.myEdit = edit;
4229 }, "~O,javax.swing.undo.UndoableEdit");
4230 Clazz_defineMethod (c$, "getEdit", 
4231 function () {
4232 return this.myEdit;
4233 });
4234 });
4235 Clazz_declarePackage ("javax.swing.event");
4236 Clazz_load (["java.util.EventListener"], "javax.swing.event.UndoableEditListener", null, function () {
4237 Clazz_declareInterface (javax.swing.event, "UndoableEditListener", java.util.EventListener);
4238 });
4239 Clazz_declarePackage ("javax.swing.text");
4240 Clazz_load (["javax.swing.text.Segment"], "javax.swing.text.SegmentCache", ["java.util.ArrayList"], function () {
4241 c$ = Clazz_decorateAsClass (function () {
4242 this.segments = null;
4243 Clazz_instantialize (this, arguments);
4244 }, javax.swing.text, "SegmentCache");
4245 c$.getSharedInstance = Clazz_defineMethod (c$, "getSharedInstance", 
4246 function () {
4247 return javax.swing.text.SegmentCache.sharedCache;
4248 });
4249 c$.getSharedSegment = Clazz_defineMethod (c$, "getSharedSegment", 
4250 function () {
4251 return javax.swing.text.SegmentCache.getSharedInstance ().getSegment ();
4252 });
4253 c$.releaseSharedSegment = Clazz_defineMethod (c$, "releaseSharedSegment", 
4254 function (segment) {
4255 javax.swing.text.SegmentCache.getSharedInstance ().releaseSegment (segment);
4256 }, "javax.swing.text.Segment");
4257 Clazz_makeConstructor (c$, 
4258 function () {
4259 this.segments =  new java.util.ArrayList (11);
4260 });
4261 Clazz_defineMethod (c$, "getSegment", 
4262 function () {
4263 {
4264 var size = this.segments.size ();
4265 if (size > 0) {
4266 return this.segments.remove (size - 1);
4267 }}return  new javax.swing.text.SegmentCache.CachedSegment ();
4268 });
4269 Clazz_defineMethod (c$, "releaseSegment", 
4270 function (segment) {
4271 if (Clazz_instanceOf (segment, javax.swing.text.SegmentCache.CachedSegment)) {
4272 {
4273 segment.array = null;
4274 segment.count = 0;
4275 this.segments.add (segment);
4276 }}}, "javax.swing.text.Segment");
4277 Clazz_pu$h(self.c$);
4278 c$ = Clazz_declareType (javax.swing.text.SegmentCache, "CachedSegment", javax.swing.text.Segment);
4279 c$ = Clazz_p0p ();
4280 c$.sharedCache = c$.prototype.sharedCache =  new javax.swing.text.SegmentCache ();
4281 });
4282 Clazz_declarePackage ("javax.swing.text");
4283 Clazz_load (["java.text.CharacterIterator"], "javax.swing.text.Segment", ["java.lang.IllegalArgumentException", "$.StringIndexOutOfBoundsException"], function () {
4284 c$ = Clazz_decorateAsClass (function () {
4285 this.array = null;
4286 this.offset = 0;
4287 this.count = 0;
4288 this.partialReturn = false;
4289 this.pos = 0;
4290 Clazz_instantialize (this, arguments);
4291 }, javax.swing.text, "Segment", null, [Cloneable, java.text.CharacterIterator, CharSequence]);
4292 Clazz_makeConstructor (c$, 
4293 function () {
4294 this.construct (null, 0, 0);
4295 });
4296 Clazz_makeConstructor (c$, 
4297 function (array, offset, count) {
4298 this.array = array;
4299 this.offset = offset;
4300 this.count = count;
4301 this.partialReturn = false;
4302 }, "~A,~N,~N");
4303 Clazz_defineMethod (c$, "setPartialReturn", 
4304 function (p) {
4305 this.partialReturn = p;
4306 }, "~B");
4307 Clazz_defineMethod (c$, "isPartialReturn", 
4308 function () {
4309 return this.partialReturn;
4310 });
4311 Clazz_overrideMethod (c$, "toString", 
4312 function () {
4313 if (this.array != null) {
4314 return  String.instantialize (this.array, this.offset, this.count);
4315 }return  String.instantialize ();
4316 });
4317 Clazz_overrideMethod (c$, "first", 
4318 function () {
4319 this.pos = this.offset;
4320 if (this.count != 0) {
4321 return this.array[this.pos];
4322 }return '\uffff';
4323 });
4324 Clazz_overrideMethod (c$, "last", 
4325 function () {
4326 this.pos = this.offset + this.count;
4327 if (this.count != 0) {
4328 this.pos -= 1;
4329 return this.array[this.pos];
4330 }return '\uffff';
4331 });
4332 Clazz_overrideMethod (c$, "current", 
4333 function () {
4334 if (this.count != 0 && this.pos < this.offset + this.count) {
4335 return this.array[this.pos];
4336 }return '\uffff';
4337 });
4338 Clazz_overrideMethod (c$, "next", 
4339 function () {
4340 this.pos += 1;
4341 var end = this.offset + this.count;
4342 if (this.pos >= end) {
4343 this.pos = end;
4344 return '\uffff';
4345 }return this.current ();
4346 });
4347 Clazz_overrideMethod (c$, "previous", 
4348 function () {
4349 if (this.pos == this.offset) {
4350 return '\uffff';
4351 }this.pos -= 1;
4352 return this.current ();
4353 });
4354 Clazz_overrideMethod (c$, "setIndex", 
4355 function (position) {
4356 var end = this.offset + this.count;
4357 if ((position < this.offset) || (position > end)) {
4358 throw  new IllegalArgumentException ("bad position: " + position);
4359 }this.pos = position;
4360 if ((this.pos != end) && (this.count != 0)) {
4361 return this.array[this.pos];
4362 }return '\uffff';
4363 }, "~N");
4364 Clazz_overrideMethod (c$, "getBeginIndex", 
4365 function () {
4366 return this.offset;
4367 });
4368 Clazz_overrideMethod (c$, "getEndIndex", 
4369 function () {
4370 return this.offset + this.count;
4371 });
4372 Clazz_overrideMethod (c$, "getIndex", 
4373 function () {
4374 return this.pos;
4375 });
4376 Clazz_overrideMethod (c$, "charAt", 
4377 function (index) {
4378 if (index < 0 || index >= this.count) {
4379 throw  new StringIndexOutOfBoundsException (index);
4380 }return this.array[this.offset + index];
4381 }, "~N");
4382 Clazz_overrideMethod (c$, "length", 
4383 function () {
4384 return this.count;
4385 });
4386 Clazz_overrideMethod (c$, "subSequence", 
4387 function (start, end) {
4388 if (start < 0) {
4389 throw  new StringIndexOutOfBoundsException (start);
4390 }if (end > this.count) {
4391 throw  new StringIndexOutOfBoundsException (end);
4392 }if (start > end) {
4393 throw  new StringIndexOutOfBoundsException (end - start);
4394 }var segment =  new javax.swing.text.Segment ();
4395 segment.array = this.array;
4396 segment.offset = this.offset + start;
4397 segment.count = end - start;
4398 return segment;
4399 }, "~N,~N");
4400 Clazz_overrideMethod (c$, "clone", 
4401 function () {
4402 var o;
4403 try {
4404 o = Clazz_superCall (this, javax.swing.text.Segment, "clone", []);
4405 } catch (cnse) {
4406 if (Clazz_exceptionOf (cnse, CloneNotSupportedException)) {
4407 o = null;
4408 } else {
4409 throw cnse;
4410 }
4411 }
4412 return o;
4413 });
4414 });
4415 Clazz_declarePackage ("javax.swing.text");
4416 Clazz_load (["java.lang.Error"], "javax.swing.text.StateInvariantError", null, function () {
4417 c$ = Clazz_declareType (javax.swing.text, "StateInvariantError", Error);
4418 });
4419 Clazz_declarePackage ("javax.swing.text");
4420 Clazz_load (["javax.swing.text.AttributeSet"], "javax.swing.text.StyleConstants", ["java.lang.Boolean", "$.Float", "java.awt.Color"], function () {
4421 c$ = Clazz_decorateAsClass (function () {
4422 this.representation = null;
4423 Clazz_instantialize (this, arguments);
4424 }, javax.swing.text, "StyleConstants");
4425 Clazz_overrideMethod (c$, "toString", 
4426 function () {
4427 return this.representation;
4428 });
4429 c$.getBidiLevel = Clazz_defineMethod (c$, "getBidiLevel", 
4430 function (a) {
4431 var o = a.getAttribute (javax.swing.text.StyleConstants.BidiLevel);
4432 if (o != null) {
4433 return o.intValue ();
4434 }return 0;
4435 }, "javax.swing.text.AttributeSet");
4436 c$.setBidiLevel = Clazz_defineMethod (c$, "setBidiLevel", 
4437 function (a, o) {
4438 a.addAttribute (javax.swing.text.StyleConstants.BidiLevel,  new Integer (o));
4439 }, "javax.swing.text.MutableAttributeSet,~N");
4440 c$.getComponent = Clazz_defineMethod (c$, "getComponent", 
4441 function (a) {
4442 return a.getAttribute (javax.swing.text.StyleConstants.ComponentAttribute);
4443 }, "javax.swing.text.AttributeSet");
4444 c$.setComponent = Clazz_defineMethod (c$, "setComponent", 
4445 function (a, c) {
4446 a.addAttribute ("$ename", "component");
4447 a.addAttribute (javax.swing.text.StyleConstants.ComponentAttribute, c);
4448 }, "javax.swing.text.MutableAttributeSet,java.awt.Component");
4449 c$.getIcon = Clazz_defineMethod (c$, "getIcon", 
4450 function (a) {
4451 return a.getAttribute (javax.swing.text.StyleConstants.IconAttribute);
4452 }, "javax.swing.text.AttributeSet");
4453 c$.setIcon = Clazz_defineMethod (c$, "setIcon", 
4454 function (a, c) {
4455 a.addAttribute ("$ename", "icon");
4456 a.addAttribute (javax.swing.text.StyleConstants.IconAttribute, c);
4457 }, "javax.swing.text.MutableAttributeSet,javax.swing.Icon");
4458 c$.getFontFamily = Clazz_defineMethod (c$, "getFontFamily", 
4459 function (a) {
4460 var family = a.getAttribute (javax.swing.text.StyleConstants.FontFamily);
4461 if (family == null) {
4462 family = "Monospaced";
4463 }return family;
4464 }, "javax.swing.text.AttributeSet");
4465 c$.setFontFamily = Clazz_defineMethod (c$, "setFontFamily", 
4466 function (a, fam) {
4467 a.addAttribute (javax.swing.text.StyleConstants.FontFamily, fam);
4468 }, "javax.swing.text.MutableAttributeSet,~S");
4469 c$.getFontSize = Clazz_defineMethod (c$, "getFontSize", 
4470 function (a) {
4471 var size = a.getAttribute (javax.swing.text.StyleConstants.FontSize);
4472 if (size != null) {
4473 return size.intValue ();
4474 }return 12;
4475 }, "javax.swing.text.AttributeSet");
4476 c$.setFontSize = Clazz_defineMethod (c$, "setFontSize", 
4477 function (a, s) {
4478 a.addAttribute (javax.swing.text.StyleConstants.FontSize,  new Integer (s));
4479 }, "javax.swing.text.MutableAttributeSet,~N");
4480 c$.isBold = Clazz_defineMethod (c$, "isBold", 
4481 function (a) {
4482 var bold = a.getAttribute (javax.swing.text.StyleConstants.Bold);
4483 if (bold != null) {
4484 return bold.booleanValue ();
4485 }return false;
4486 }, "javax.swing.text.AttributeSet");
4487 c$.setBold = Clazz_defineMethod (c$, "setBold", 
4488 function (a, b) {
4489 a.addAttribute (javax.swing.text.StyleConstants.Bold, Boolean.$valueOf (b));
4490 }, "javax.swing.text.MutableAttributeSet,~B");
4491 c$.isItalic = Clazz_defineMethod (c$, "isItalic", 
4492 function (a) {
4493 var italic = a.getAttribute (javax.swing.text.StyleConstants.Italic);
4494 if (italic != null) {
4495 return italic.booleanValue ();
4496 }return false;
4497 }, "javax.swing.text.AttributeSet");
4498 c$.setItalic = Clazz_defineMethod (c$, "setItalic", 
4499 function (a, b) {
4500 a.addAttribute (javax.swing.text.StyleConstants.Italic, Boolean.$valueOf (b));
4501 }, "javax.swing.text.MutableAttributeSet,~B");
4502 c$.isUnderline = Clazz_defineMethod (c$, "isUnderline", 
4503 function (a) {
4504 var underline = a.getAttribute (javax.swing.text.StyleConstants.Underline);
4505 if (underline != null) {
4506 return underline.booleanValue ();
4507 }return false;
4508 }, "javax.swing.text.AttributeSet");
4509 c$.isStrikeThrough = Clazz_defineMethod (c$, "isStrikeThrough", 
4510 function (a) {
4511 var strike = a.getAttribute (javax.swing.text.StyleConstants.StrikeThrough);
4512 if (strike != null) {
4513 return strike.booleanValue ();
4514 }return false;
4515 }, "javax.swing.text.AttributeSet");
4516 c$.isSuperscript = Clazz_defineMethod (c$, "isSuperscript", 
4517 function (a) {
4518 var superscript = a.getAttribute (javax.swing.text.StyleConstants.Superscript);
4519 if (superscript != null) {
4520 return superscript.booleanValue ();
4521 }return false;
4522 }, "javax.swing.text.AttributeSet");
4523 c$.isSubscript = Clazz_defineMethod (c$, "isSubscript", 
4524 function (a) {
4525 var subscript = a.getAttribute (javax.swing.text.StyleConstants.Subscript);
4526 if (subscript != null) {
4527 return subscript.booleanValue ();
4528 }return false;
4529 }, "javax.swing.text.AttributeSet");
4530 c$.setUnderline = Clazz_defineMethod (c$, "setUnderline", 
4531 function (a, b) {
4532 a.addAttribute (javax.swing.text.StyleConstants.Underline, Boolean.$valueOf (b));
4533 }, "javax.swing.text.MutableAttributeSet,~B");
4534 c$.setStrikeThrough = Clazz_defineMethod (c$, "setStrikeThrough", 
4535 function (a, b) {
4536 a.addAttribute (javax.swing.text.StyleConstants.StrikeThrough, Boolean.$valueOf (b));
4537 }, "javax.swing.text.MutableAttributeSet,~B");
4538 c$.setSuperscript = Clazz_defineMethod (c$, "setSuperscript", 
4539 function (a, b) {
4540 a.addAttribute (javax.swing.text.StyleConstants.Superscript, Boolean.$valueOf (b));
4541 }, "javax.swing.text.MutableAttributeSet,~B");
4542 c$.setSubscript = Clazz_defineMethod (c$, "setSubscript", 
4543 function (a, b) {
4544 a.addAttribute (javax.swing.text.StyleConstants.Subscript, Boolean.$valueOf (b));
4545 }, "javax.swing.text.MutableAttributeSet,~B");
4546 c$.getForeground = Clazz_defineMethod (c$, "getForeground", 
4547 function (a) {
4548 var fg = a.getAttribute (javax.swing.text.StyleConstants.Foreground);
4549 if (fg == null) {
4550 fg = java.awt.Color.black;
4551 }return fg;
4552 }, "javax.swing.text.AttributeSet");
4553 c$.setForeground = Clazz_defineMethod (c$, "setForeground", 
4554 function (a, fg) {
4555 a.addAttribute (javax.swing.text.StyleConstants.Foreground, fg);
4556 }, "javax.swing.text.MutableAttributeSet,java.awt.Color");
4557 c$.getBackground = Clazz_defineMethod (c$, "getBackground", 
4558 function (a) {
4559 var fg = a.getAttribute (javax.swing.text.StyleConstants.Background);
4560 if (fg == null) {
4561 fg = java.awt.Color.black;
4562 }return fg;
4563 }, "javax.swing.text.AttributeSet");
4564 c$.setBackground = Clazz_defineMethod (c$, "setBackground", 
4565 function (a, fg) {
4566 a.addAttribute (javax.swing.text.StyleConstants.Background, fg);
4567 }, "javax.swing.text.MutableAttributeSet,java.awt.Color");
4568 c$.getFirstLineIndent = Clazz_defineMethod (c$, "getFirstLineIndent", 
4569 function (a) {
4570 var indent = a.getAttribute (javax.swing.text.StyleConstants.FirstLineIndent);
4571 if (indent != null) {
4572 return indent.floatValue ();
4573 }return 0;
4574 }, "javax.swing.text.AttributeSet");
4575 c$.setFirstLineIndent = Clazz_defineMethod (c$, "setFirstLineIndent", 
4576 function (a, i) {
4577 a.addAttribute (javax.swing.text.StyleConstants.FirstLineIndent,  new Float (i));
4578 }, "javax.swing.text.MutableAttributeSet,~N");
4579 c$.getRightIndent = Clazz_defineMethod (c$, "getRightIndent", 
4580 function (a) {
4581 var indent = a.getAttribute (javax.swing.text.StyleConstants.RightIndent);
4582 if (indent != null) {
4583 return indent.floatValue ();
4584 }return 0;
4585 }, "javax.swing.text.AttributeSet");
4586 c$.setRightIndent = Clazz_defineMethod (c$, "setRightIndent", 
4587 function (a, i) {
4588 a.addAttribute (javax.swing.text.StyleConstants.RightIndent,  new Float (i));
4589 }, "javax.swing.text.MutableAttributeSet,~N");
4590 c$.getLeftIndent = Clazz_defineMethod (c$, "getLeftIndent", 
4591 function (a) {
4592 var indent = a.getAttribute (javax.swing.text.StyleConstants.LeftIndent);
4593 if (indent != null) {
4594 return indent.floatValue ();
4595 }return 0;
4596 }, "javax.swing.text.AttributeSet");
4597 c$.setLeftIndent = Clazz_defineMethod (c$, "setLeftIndent", 
4598 function (a, i) {
4599 a.addAttribute (javax.swing.text.StyleConstants.LeftIndent,  new Float (i));
4600 }, "javax.swing.text.MutableAttributeSet,~N");
4601 c$.getLineSpacing = Clazz_defineMethod (c$, "getLineSpacing", 
4602 function (a) {
4603 var space = a.getAttribute (javax.swing.text.StyleConstants.LineSpacing);
4604 if (space != null) {
4605 return space.floatValue ();
4606 }return 0;
4607 }, "javax.swing.text.AttributeSet");
4608 c$.setLineSpacing = Clazz_defineMethod (c$, "setLineSpacing", 
4609 function (a, i) {
4610 a.addAttribute (javax.swing.text.StyleConstants.LineSpacing,  new Float (i));
4611 }, "javax.swing.text.MutableAttributeSet,~N");
4612 c$.getSpaceAbove = Clazz_defineMethod (c$, "getSpaceAbove", 
4613 function (a) {
4614 var space = a.getAttribute (javax.swing.text.StyleConstants.SpaceAbove);
4615 if (space != null) {
4616 return space.floatValue ();
4617 }return 0;
4618 }, "javax.swing.text.AttributeSet");
4619 c$.setSpaceAbove = Clazz_defineMethod (c$, "setSpaceAbove", 
4620 function (a, i) {
4621 a.addAttribute (javax.swing.text.StyleConstants.SpaceAbove,  new Float (i));
4622 }, "javax.swing.text.MutableAttributeSet,~N");
4623 c$.getSpaceBelow = Clazz_defineMethod (c$, "getSpaceBelow", 
4624 function (a) {
4625 var space = a.getAttribute (javax.swing.text.StyleConstants.SpaceBelow);
4626 if (space != null) {
4627 return space.floatValue ();
4628 }return 0;
4629 }, "javax.swing.text.AttributeSet");
4630 c$.setSpaceBelow = Clazz_defineMethod (c$, "setSpaceBelow", 
4631 function (a, i) {
4632 a.addAttribute (javax.swing.text.StyleConstants.SpaceBelow,  new Float (i));
4633 }, "javax.swing.text.MutableAttributeSet,~N");
4634 c$.getAlignment = Clazz_defineMethod (c$, "getAlignment", 
4635 function (a) {
4636 var align = a.getAttribute (javax.swing.text.StyleConstants.Alignment);
4637 if (align != null) {
4638 return align.intValue ();
4639 }return 0;
4640 }, "javax.swing.text.AttributeSet");
4641 c$.setAlignment = Clazz_defineMethod (c$, "setAlignment", 
4642 function (a, align) {
4643 a.addAttribute (javax.swing.text.StyleConstants.Alignment,  new Integer (align));
4644 }, "javax.swing.text.MutableAttributeSet,~N");
4645 c$.getTabSet = Clazz_defineMethod (c$, "getTabSet", 
4646 function (a) {
4647 var tabs = a.getAttribute (javax.swing.text.StyleConstants.TabSet);
4648 return tabs;
4649 }, "javax.swing.text.AttributeSet");
4650 c$.setTabSet = Clazz_defineMethod (c$, "setTabSet", 
4651 function (a, tabs) {
4652 a.addAttribute (javax.swing.text.StyleConstants.TabSet, tabs);
4653 }, "javax.swing.text.MutableAttributeSet,javax.swing.text.TabSet");
4654 Clazz_makeConstructor (c$, 
4655 function (representation) {
4656 this.representation = representation;
4657 }, "~S");
4658 Clazz_pu$h(self.c$);
4659 c$ = Clazz_declareType (javax.swing.text.StyleConstants, "ParagraphConstants", javax.swing.text.StyleConstants, javax.swing.text.AttributeSet.ParagraphAttribute);
4660 c$ = Clazz_p0p ();
4661 Clazz_pu$h(self.c$);
4662 c$ = Clazz_declareType (javax.swing.text.StyleConstants, "CharacterConstants", javax.swing.text.StyleConstants, javax.swing.text.AttributeSet.CharacterAttribute);
4663 c$ = Clazz_p0p ();
4664 Clazz_pu$h(self.c$);
4665 c$ = Clazz_declareType (javax.swing.text.StyleConstants, "ColorConstants", javax.swing.text.StyleConstants, [javax.swing.text.AttributeSet.ColorAttribute, javax.swing.text.AttributeSet.CharacterAttribute]);
4666 c$ = Clazz_p0p ();
4667 Clazz_pu$h(self.c$);
4668 c$ = Clazz_declareType (javax.swing.text.StyleConstants, "FontConstants", javax.swing.text.StyleConstants, [javax.swing.text.AttributeSet.FontAttribute, javax.swing.text.AttributeSet.CharacterAttribute]);
4669 c$ = Clazz_p0p ();
4670 Clazz_defineStatics (c$,
4671 "ComponentElementName", "component",
4672 "IconElementName", "icon");
4673 c$.NameAttribute = c$.prototype.NameAttribute =  new javax.swing.text.StyleConstants ("name");
4674 c$.ResolveAttribute = c$.prototype.ResolveAttribute =  new javax.swing.text.StyleConstants ("resolver");
4675 c$.ModelAttribute = c$.prototype.ModelAttribute =  new javax.swing.text.StyleConstants ("model");
4676 c$.BidiLevel = c$.prototype.BidiLevel =  new javax.swing.text.StyleConstants.CharacterConstants ("bidiLevel");
4677 c$.FontFamily = c$.prototype.FontFamily =  new javax.swing.text.StyleConstants.FontConstants ("family");
4678 c$.Family = c$.prototype.Family = javax.swing.text.StyleConstants.FontFamily;
4679 c$.FontSize = c$.prototype.FontSize =  new javax.swing.text.StyleConstants.FontConstants ("size");
4680 c$.Size = c$.prototype.Size = javax.swing.text.StyleConstants.FontSize;
4681 c$.Bold = c$.prototype.Bold =  new javax.swing.text.StyleConstants.FontConstants ("bold");
4682 c$.Italic = c$.prototype.Italic =  new javax.swing.text.StyleConstants.FontConstants ("italic");
4683 c$.Underline = c$.prototype.Underline =  new javax.swing.text.StyleConstants.CharacterConstants ("underline");
4684 c$.StrikeThrough = c$.prototype.StrikeThrough =  new javax.swing.text.StyleConstants.CharacterConstants ("strikethrough");
4685 c$.Superscript = c$.prototype.Superscript =  new javax.swing.text.StyleConstants.CharacterConstants ("superscript");
4686 c$.Subscript = c$.prototype.Subscript =  new javax.swing.text.StyleConstants.CharacterConstants ("subscript");
4687 c$.Foreground = c$.prototype.Foreground =  new javax.swing.text.StyleConstants.ColorConstants ("foreground");
4688 c$.Background = c$.prototype.Background =  new javax.swing.text.StyleConstants.ColorConstants ("background");
4689 c$.ComponentAttribute = c$.prototype.ComponentAttribute =  new javax.swing.text.StyleConstants.CharacterConstants ("component");
4690 c$.IconAttribute = c$.prototype.IconAttribute =  new javax.swing.text.StyleConstants.CharacterConstants ("icon");
4691 c$.ComposedTextAttribute = c$.prototype.ComposedTextAttribute =  new javax.swing.text.StyleConstants ("composed text");
4692 c$.FirstLineIndent = c$.prototype.FirstLineIndent =  new javax.swing.text.StyleConstants.ParagraphConstants ("FirstLineIndent");
4693 c$.LeftIndent = c$.prototype.LeftIndent =  new javax.swing.text.StyleConstants.ParagraphConstants ("LeftIndent");
4694 c$.RightIndent = c$.prototype.RightIndent =  new javax.swing.text.StyleConstants.ParagraphConstants ("RightIndent");
4695 c$.LineSpacing = c$.prototype.LineSpacing =  new javax.swing.text.StyleConstants.ParagraphConstants ("LineSpacing");
4696 c$.SpaceAbove = c$.prototype.SpaceAbove =  new javax.swing.text.StyleConstants.ParagraphConstants ("SpaceAbove");
4697 c$.SpaceBelow = c$.prototype.SpaceBelow =  new javax.swing.text.StyleConstants.ParagraphConstants ("SpaceBelow");
4698 c$.Alignment = c$.prototype.Alignment =  new javax.swing.text.StyleConstants.ParagraphConstants ("Alignment");
4699 c$.TabSet = c$.prototype.TabSet =  new javax.swing.text.StyleConstants.ParagraphConstants ("TabSet");
4700 c$.Orientation = c$.prototype.Orientation =  new javax.swing.text.StyleConstants.ParagraphConstants ("Orientation");
4701 Clazz_defineStatics (c$,
4702 "ALIGN_LEFT", 0,
4703 "ALIGN_CENTER", 1,
4704 "ALIGN_RIGHT", 2,
4705 "ALIGN_JUSTIFIED", 3);
4706 c$.keys = c$.prototype.keys =  Clazz_newArray (-1, [javax.swing.text.StyleConstants.NameAttribute, javax.swing.text.StyleConstants.ResolveAttribute, javax.swing.text.StyleConstants.BidiLevel, javax.swing.text.StyleConstants.FontFamily, javax.swing.text.StyleConstants.FontSize, javax.swing.text.StyleConstants.Bold, javax.swing.text.StyleConstants.Italic, javax.swing.text.StyleConstants.Underline, javax.swing.text.StyleConstants.StrikeThrough, javax.swing.text.StyleConstants.Superscript, javax.swing.text.StyleConstants.Subscript, javax.swing.text.StyleConstants.Foreground, javax.swing.text.StyleConstants.Background, javax.swing.text.StyleConstants.ComponentAttribute, javax.swing.text.StyleConstants.IconAttribute, javax.swing.text.StyleConstants.FirstLineIndent, javax.swing.text.StyleConstants.LeftIndent, javax.swing.text.StyleConstants.RightIndent, javax.swing.text.StyleConstants.LineSpacing, javax.swing.text.StyleConstants.SpaceAbove, javax.swing.text.StyleConstants.SpaceBelow, javax.swing.text.StyleConstants.Alignment, javax.swing.text.StyleConstants.TabSet, javax.swing.text.StyleConstants.Orientation, javax.swing.text.StyleConstants.ModelAttribute, javax.swing.text.StyleConstants.ComposedTextAttribute]);
4707 });
4708 Clazz_declarePackage ("javax.swing.text");
4709 Clazz_load (["java.util.Enumeration", "javax.swing.text.AbstractDocument", "$.AttributeSet", "$.Style", "java.util.Collections", "$.HashMap", "$.Hashtable", "$.Vector", "javax.swing.event.EventListenerList", "javax.swing.text.SimpleAttributeSet"], "javax.swing.text.StyleContext", ["java.util.NoSuchElementException", "java.awt.Font", "$.Toolkit", "javax.swing.SwingUtilities", "javax.swing.event.ChangeEvent", "$.ChangeListener", "javax.swing.text.MutableAttributeSet", "$.StyleConstants"], function () {
4710 c$ = Clazz_decorateAsClass (function () {
4711 this.styles = null;
4712 this.fontSearch = null;
4713 this.fontTable = null;
4714 this.attributesPool = null;
4715 this.search = null;
4716 if (!Clazz_isClassDefined ("javax.swing.text.StyleContext.SmallAttributeSet")) {
4717 javax.swing.text.StyleContext.$StyleContext$SmallAttributeSet$ ();
4718 }
4719 if (!Clazz_isClassDefined ("javax.swing.text.StyleContext.KeyEnumeration")) {
4720 javax.swing.text.StyleContext.$StyleContext$KeyEnumeration$ ();
4721 }
4722 if (!Clazz_isClassDefined ("javax.swing.text.StyleContext.KeyBuilder")) {
4723 javax.swing.text.StyleContext.$StyleContext$KeyBuilder$ ();
4724 }
4725 if (!Clazz_isClassDefined ("javax.swing.text.StyleContext.NamedStyle")) {
4726 javax.swing.text.StyleContext.$StyleContext$NamedStyle$ ();
4727 }
4728 Clazz_instantialize (this, arguments);
4729 }, javax.swing.text, "StyleContext", null, javax.swing.text.AbstractDocument.AttributeContext);
4730 Clazz_prepareFields (c$, function () {
4731 this.fontSearch =  new javax.swing.text.StyleContext.FontKey (null, 0, 0);
4732 this.fontTable =  new java.util.Hashtable ();
4733 this.attributesPool = java.util.Collections.synchronizedMap ( new java.util.HashMap ());
4734 this.search =  new javax.swing.text.SimpleAttributeSet ();
4735 });
4736 c$.getDefaultStyleContext = Clazz_defineMethod (c$, "getDefaultStyleContext", 
4737 function () {
4738 if (javax.swing.text.StyleContext.defaultContext == null) {
4739 javax.swing.text.StyleContext.defaultContext =  new javax.swing.text.StyleContext ();
4740 }return javax.swing.text.StyleContext.defaultContext;
4741 });
4742 Clazz_makeConstructor (c$, 
4743 function () {
4744 this.styles = Clazz_innerTypeInstance (javax.swing.text.StyleContext.NamedStyle, this, null, null);
4745 this.addStyle ("default", null);
4746 });
4747 Clazz_defineMethod (c$, "addStyle", 
4748 function (nm, parent) {
4749 var style = Clazz_innerTypeInstance (javax.swing.text.StyleContext.NamedStyle, this, null, nm, parent);
4750 if (nm != null) {
4751 this.styles.addAttribute (nm, style);
4752 }return style;
4753 }, "~S,javax.swing.text.Style");
4754 Clazz_defineMethod (c$, "removeStyle", 
4755 function (nm) {
4756 this.styles.removeAttribute (nm);
4757 }, "~S");
4758 Clazz_defineMethod (c$, "getStyle", 
4759 function (nm) {
4760 return this.styles.getAttribute (nm);
4761 }, "~S");
4762 Clazz_defineMethod (c$, "getStyleNames", 
4763 function () {
4764 return this.styles.getAttributeNames ();
4765 });
4766 Clazz_defineMethod (c$, "addChangeListener", 
4767 function (l) {
4768 this.styles.addChangeListener (l);
4769 }, "javax.swing.event.ChangeListener");
4770 Clazz_defineMethod (c$, "removeChangeListener", 
4771 function (l) {
4772 this.styles.removeChangeListener (l);
4773 }, "javax.swing.event.ChangeListener");
4774 Clazz_defineMethod (c$, "getChangeListeners", 
4775 function () {
4776 return (this.styles).getChangeListeners ();
4777 });
4778 Clazz_defineMethod (c$, "getFont", 
4779 function (attr) {
4780 var style = 0;
4781 if (javax.swing.text.StyleConstants.isBold (attr)) {
4782 style |= 1;
4783 }if (javax.swing.text.StyleConstants.isItalic (attr)) {
4784 style |= 2;
4785 }var family = javax.swing.text.StyleConstants.getFontFamily (attr);
4786 var size = javax.swing.text.StyleConstants.getFontSize (attr);
4787 if (javax.swing.text.StyleConstants.isSuperscript (attr) || javax.swing.text.StyleConstants.isSubscript (attr)) {
4788 size -= 2;
4789 }return this.getFont (family, style, size);
4790 }, "javax.swing.text.AttributeSet");
4791 Clazz_defineMethod (c$, "getForeground", 
4792 function (attr) {
4793 return javax.swing.text.StyleConstants.getForeground (attr);
4794 }, "javax.swing.text.AttributeSet");
4795 Clazz_defineMethod (c$, "getBackground", 
4796 function (attr) {
4797 return javax.swing.text.StyleConstants.getBackground (attr);
4798 }, "javax.swing.text.AttributeSet");
4799 Clazz_defineMethod (c$, "getFont", 
4800 function (family, style, size) {
4801 this.fontSearch.setValue (family, style, size);
4802 var f = this.fontTable.get (this.fontSearch);
4803 if (f == null) {
4804 var defaultStyle = this.getStyle ("default");
4805 if (defaultStyle != null) {
4806 var FONT_ATTRIBUTE_KEY = "FONT_ATTRIBUTE_KEY";
4807 var defaultFont = defaultStyle.getAttribute ("FONT_ATTRIBUTE_KEY");
4808 if (defaultFont != null && defaultFont.getFamily ().equalsIgnoreCase (family)) {
4809 f = defaultFont.deriveFont (style, size);
4810 }}if (f == null) {
4811 f =  new java.awt.Font (family, style, size);
4812 }var key =  new javax.swing.text.StyleContext.FontKey (family, style, size);
4813 this.fontTable.put (key, f);
4814 }return f;
4815 }, "~S,~N,~N");
4816 Clazz_defineMethod (c$, "getFontMetrics", 
4817 function (f) {
4818 return java.awt.Toolkit.getDefaultToolkit ().getFontMetrics (f);
4819 }, "java.awt.Font");
4820 Clazz_overrideMethod (c$, "addAttribute", 
4821 function (old, name, value) {
4822 if ((old.getAttributeCount () + 1) <= this.getCompressionThreshold ()) {
4823 this.search.removeAttributes (this.search);
4824 this.search.addAttributes (old);
4825 this.search.addAttribute (name, value);
4826 this.reclaim (old);
4827 return this.getImmutableUniqueSet ();
4828 }var ma = this.getMutableAttributeSet (old);
4829 ma.addAttribute (name, value);
4830 return ma;
4831 }, "javax.swing.text.AttributeSet,~O,~O");
4832 Clazz_overrideMethod (c$, "addAttributes", 
4833 function (old, attr) {
4834 if ((old.getAttributeCount () + attr.getAttributeCount ()) <= this.getCompressionThreshold ()) {
4835 this.search.removeAttributes (this.search);
4836 this.search.addAttributes (old);
4837 this.search.addAttributes (attr);
4838 this.reclaim (old);
4839 return this.getImmutableUniqueSet ();
4840 }var ma = this.getMutableAttributeSet (old);
4841 ma.addAttributes (attr);
4842 return ma;
4843 }, "javax.swing.text.AttributeSet,javax.swing.text.AttributeSet");
4844 Clazz_overrideMethod (c$, "removeAttribute", 
4845 function (old, name) {
4846 if ((old.getAttributeCount () - 1) <= this.getCompressionThreshold ()) {
4847 this.search.removeAttributes (this.search);
4848 this.search.addAttributes (old);
4849 this.search.removeAttribute (name);
4850 this.reclaim (old);
4851 return this.getImmutableUniqueSet ();
4852 }var ma = this.getMutableAttributeSet (old);
4853 ma.removeAttribute (name);
4854 return ma;
4855 }, "javax.swing.text.AttributeSet,~O");
4856 Clazz_defineMethod (c$, "removeAttributes", 
4857 function (old, names) {
4858 if (old.getAttributeCount () <= this.getCompressionThreshold ()) {
4859 this.search.removeAttributes (this.search);
4860 this.search.addAttributes (old);
4861 this.search.removeAttributes (names);
4862 this.reclaim (old);
4863 return this.getImmutableUniqueSet ();
4864 }var ma = this.getMutableAttributeSet (old);
4865 ma.removeAttributes (names);
4866 return ma;
4867 }, "javax.swing.text.AttributeSet,java.util.Enumeration");
4868 Clazz_defineMethod (c$, "removeAttributes", 
4869 function (old, attrs) {
4870 if (old.getAttributeCount () <= this.getCompressionThreshold ()) {
4871 this.search.removeAttributes (this.search);
4872 this.search.addAttributes (old);
4873 this.search.removeAttributes (attrs);
4874 this.reclaim (old);
4875 return this.getImmutableUniqueSet ();
4876 }var ma = this.getMutableAttributeSet (old);
4877 ma.removeAttributes (attrs);
4878 return ma;
4879 }, "javax.swing.text.AttributeSet,javax.swing.text.AttributeSet");
4880 Clazz_overrideMethod (c$, "getEmptySet", 
4881 function () {
4882 return javax.swing.text.SimpleAttributeSet.EMPTY;
4883 });
4884 Clazz_overrideMethod (c$, "reclaim", 
4885 function (a) {
4886 if (javax.swing.SwingUtilities.isEventDispatchThread ()) {
4887 this.attributesPool.size ();
4888 }}, "javax.swing.text.AttributeSet");
4889 Clazz_defineMethod (c$, "getCompressionThreshold", 
4890 function () {
4891 return 9;
4892 });
4893 Clazz_defineMethod (c$, "createSmallAttributeSet", 
4894 function (a) {
4895 return Clazz_innerTypeInstance (javax.swing.text.StyleContext.SmallAttributeSet, this, null, a);
4896 }, "javax.swing.text.AttributeSet");
4897 Clazz_defineMethod (c$, "createLargeAttributeSet", 
4898 function (a) {
4899 return  new javax.swing.text.SimpleAttributeSet (a);
4900 }, "javax.swing.text.AttributeSet");
4901 Clazz_defineMethod (c$, "removeUnusedSets", 
4902 function () {
4903 this.attributesPool.size ();
4904 });
4905 Clazz_defineMethod (c$, "getImmutableUniqueSet", 
4906 function () {
4907 return null;
4908 });
4909 Clazz_defineMethod (c$, "getMutableAttributeSet", 
4910 function (a) {
4911 if (Clazz_instanceOf (a, javax.swing.text.MutableAttributeSet) && a !== javax.swing.text.SimpleAttributeSet.EMPTY) {
4912 return a;
4913 }return this.createLargeAttributeSet (a);
4914 }, "javax.swing.text.AttributeSet");
4915 Clazz_defineMethod (c$, "toString", 
4916 function () {
4917 this.removeUnusedSets ();
4918 var s = "";
4919 var iterator = this.attributesPool.keySet ().iterator ();
4920 while (iterator.hasNext ()) {
4921 var set = iterator.next ();
4922 s = s + set + "\n";
4923 }
4924 return s;
4925 });
4926 c$.registerStaticAttributeKey = Clazz_defineMethod (c$, "registerStaticAttributeKey", 
4927 function (key) {
4928 var ioFmt = key.getClass ().getName () + "." + key.toString ();
4929 if (javax.swing.text.StyleContext.freezeKeyMap == null) {
4930 javax.swing.text.StyleContext.freezeKeyMap =  new java.util.Hashtable ();
4931 javax.swing.text.StyleContext.thawKeyMap =  new java.util.Hashtable ();
4932 }javax.swing.text.StyleContext.freezeKeyMap.put (key, ioFmt);
4933 javax.swing.text.StyleContext.thawKeyMap.put (ioFmt, key);
4934 }, "~O");
4935 c$.getStaticAttribute = Clazz_defineMethod (c$, "getStaticAttribute", 
4936 function (key) {
4937 if (javax.swing.text.StyleContext.thawKeyMap == null || key == null) {
4938 return null;
4939 }return javax.swing.text.StyleContext.thawKeyMap.get (key);
4940 }, "~O");
4941 c$.getStaticAttributeKey = Clazz_defineMethod (c$, "getStaticAttributeKey", 
4942 function (key) {
4943 return key.getClass ().getName () + "." + key.toString ();
4944 }, "~O");
4945 c$.$StyleContext$SmallAttributeSet$ = function () {
4946 Clazz_pu$h(self.c$);
4947 c$ = Clazz_decorateAsClass (function () {
4948 Clazz_prepareCallback (this, arguments);
4949 this.attributes = null;
4950 this.resolveParent = null;
4951 Clazz_instantialize (this, arguments);
4952 }, javax.swing.text.StyleContext, "SmallAttributeSet", null, javax.swing.text.AttributeSet);
4953 Clazz_makeConstructor (c$, 
4954 function (a) {
4955 this.attributes = a;
4956 this.updateResolveParent ();
4957 }, "~A");
4958 Clazz_makeConstructor (c$, 
4959 function (a) {
4960 var b = a.getAttributeCount ();
4961 var c =  new Array (2 * b);
4962 var d = a.getAttributeNames ();
4963 var e = 0;
4964 while (d.hasMoreElements ()) {
4965 c[e] = d.nextElement ();
4966 c[e + 1] = a.getAttribute (c[e]);
4967 e += 2;
4968 }
4969 this.attributes = c;
4970 this.updateResolveParent ();
4971 }, "javax.swing.text.AttributeSet");
4972 Clazz_defineMethod (c$, "updateResolveParent", 
4973  function () {
4974 this.resolveParent = null;
4975 var a = this.attributes;
4976 for (var b = 0; b < a.length; b += 2) {
4977 if (a[b] === javax.swing.text.StyleConstants.ResolveAttribute) {
4978 this.resolveParent = a[b + 1];
4979 break;
4980 }}
4981 });
4982 Clazz_defineMethod (c$, "getLocalAttribute", 
4983 function (a) {
4984 if (a === javax.swing.text.StyleConstants.ResolveAttribute) {
4985 return this.resolveParent;
4986 }var b = this.attributes;
4987 for (var c = 0; c < b.length; c += 2) {
4988 if (a.equals (b[c])) {
4989 return b[c + 1];
4990 }}
4991 return null;
4992 }, "~O");
4993 Clazz_overrideMethod (c$, "toString", 
4994 function () {
4995 var a = "{";
4996 var b = this.attributes;
4997 for (var c = 0; c < b.length; c += 2) {
4998 if (Clazz_instanceOf (b[c + 1], javax.swing.text.AttributeSet)) {
4999 a = a + b[c] + "=" + "AttributeSet" + ",";
5000 } else {
5001 a = a + b[c] + "=" + b[c + 1] + ",";
5002 }}
5003 a = a + "}";
5004 return a;
5005 });
5006 Clazz_defineMethod (c$, "hashCode", 
5007 function () {
5008 var a = 0;
5009 var b = this.attributes;
5010 for (var c = 1; c < b.length; c += 2) {
5011 a ^= b[c].hashCode ();
5012 }
5013 return a;
5014 });
5015 Clazz_defineMethod (c$, "equals", 
5016 function (a) {
5017 if (Clazz_instanceOf (a, javax.swing.text.AttributeSet)) {
5018 var b = a;
5019 return ((this.getAttributeCount () == b.getAttributeCount ()) && this.containsAttributes (b));
5020 }return false;
5021 }, "~O");
5022 Clazz_overrideMethod (c$, "clone", 
5023 function () {
5024 return this;
5025 });
5026 Clazz_defineMethod (c$, "getAttributeCount", 
5027 function () {
5028 return Clazz_doubleToInt (this.attributes.length / 2);
5029 });
5030 Clazz_overrideMethod (c$, "isDefined", 
5031 function (a) {
5032 var b = this.attributes;
5033 var c = b.length;
5034 for (var d = 0; d < c; d += 2) {
5035 if (a.equals (b[d])) {
5036 return true;
5037 }}
5038 return false;
5039 }, "~O");
5040 Clazz_overrideMethod (c$, "isEqual", 
5041 function (a) {
5042 if (Clazz_instanceOf (a, javax.swing.text.StyleContext.SmallAttributeSet)) {
5043 return a === this;
5044 }return ((this.getAttributeCount () == a.getAttributeCount ()) && this.containsAttributes (a));
5045 }, "javax.swing.text.AttributeSet");
5046 Clazz_overrideMethod (c$, "copyAttributes", 
5047 function () {
5048 return this;
5049 });
5050 Clazz_defineMethod (c$, "getAttribute", 
5051 function (a) {
5052 var b = this.getLocalAttribute (a);
5053 if (b == null) {
5054 var c = this.getResolveParent ();
5055 if (c != null) b = c.getAttribute (a);
5056 }return b;
5057 }, "~O");
5058 Clazz_defineMethod (c$, "getAttributeNames", 
5059 function () {
5060 return Clazz_innerTypeInstance (javax.swing.text.StyleContext.KeyEnumeration, this, null, this.attributes);
5061 });
5062 Clazz_overrideMethod (c$, "containsAttribute", 
5063 function (a, b) {
5064 return b.equals (this.getAttribute (a));
5065 }, "~O,~O");
5066 Clazz_overrideMethod (c$, "containsAttributes", 
5067 function (a) {
5068 var b = true;
5069 var c = a.getAttributeNames ();
5070 while (b && c.hasMoreElements ()) {
5071 var d = c.nextElement ();
5072 b = a.getAttribute (d).equals (this.getAttribute (d));
5073 }
5074 return b;
5075 }, "javax.swing.text.AttributeSet");
5076 Clazz_overrideMethod (c$, "getResolveParent", 
5077 function () {
5078 return this.resolveParent;
5079 });
5080 c$ = Clazz_p0p ();
5081 };
5082 c$.$StyleContext$KeyEnumeration$ = function () {
5083 Clazz_pu$h(self.c$);
5084 c$ = Clazz_decorateAsClass (function () {
5085 Clazz_prepareCallback (this, arguments);
5086 this.attr = null;
5087 this.i = 0;
5088 Clazz_instantialize (this, arguments);
5089 }, javax.swing.text.StyleContext, "KeyEnumeration", null, java.util.Enumeration);
5090 Clazz_makeConstructor (c$, 
5091 function (a) {
5092 this.attr = a;
5093 this.i = 0;
5094 }, "~A");
5095 Clazz_overrideMethod (c$, "hasMoreElements", 
5096 function () {
5097 return this.i < this.attr.length;
5098 });
5099 Clazz_overrideMethod (c$, "nextElement", 
5100 function () {
5101 if (this.i < this.attr.length) {
5102 var a = this.attr[this.i];
5103 this.i += 2;
5104 return a;
5105 }throw  new java.util.NoSuchElementException ();
5106 });
5107 c$ = Clazz_p0p ();
5108 };
5109 c$.$StyleContext$KeyBuilder$ = function () {
5110 Clazz_pu$h(self.c$);
5111 c$ = Clazz_decorateAsClass (function () {
5112 Clazz_prepareCallback (this, arguments);
5113 this.keys = null;
5114 this.data = null;
5115 Clazz_instantialize (this, arguments);
5116 }, javax.swing.text.StyleContext, "KeyBuilder");
5117 Clazz_prepareFields (c$, function () {
5118 this.keys =  new java.util.Vector ();
5119 this.data =  new java.util.Vector ();
5120 });
5121 Clazz_defineMethod (c$, "initialize", 
5122 function (a) {
5123 if (Clazz_instanceOf (a, javax.swing.text.StyleContext.SmallAttributeSet)) {
5124 this.initialize ((a).attributes);
5125 } else {
5126 this.keys.removeAllElements ();
5127 this.data.removeAllElements ();
5128 var b = a.getAttributeNames ();
5129 while (b.hasMoreElements ()) {
5130 var c = b.nextElement ();
5131 this.addAttribute (c, a.getAttribute (c));
5132 }
5133 }}, "javax.swing.text.AttributeSet");
5134 Clazz_defineMethod (c$, "initialize", 
5135  function (a) {
5136 this.keys.removeAllElements ();
5137 this.data.removeAllElements ();
5138 var b = a.length;
5139 for (var c = 0; c < b; c += 2) {
5140 this.keys.addElement (a[c]);
5141 this.data.addElement (a[c + 1]);
5142 }
5143 }, "~A");
5144 Clazz_defineMethod (c$, "createTable", 
5145 function () {
5146 var a = this.keys.size ();
5147 var b =  new Array (2 * a);
5148 for (var c = 0; c < a; c++) {
5149 var d = 2 * c;
5150 b[d] = this.keys.elementAt (c);
5151 b[d + 1] = this.data.elementAt (c);
5152 }
5153 return b;
5154 });
5155 Clazz_defineMethod (c$, "getCount", 
5156 function () {
5157 return this.keys.size ();
5158 });
5159 Clazz_defineMethod (c$, "addAttribute", 
5160 function (a, b) {
5161 this.keys.addElement (a);
5162 this.data.addElement (b);
5163 }, "~O,~O");
5164 Clazz_defineMethod (c$, "addAttributes", 
5165 function (a) {
5166 if (Clazz_instanceOf (a, javax.swing.text.StyleContext.SmallAttributeSet)) {
5167 var b = (a).attributes;
5168 var c = b.length;
5169 for (var d = 0; d < c; d += 2) {
5170 this.addAttribute (b[d], b[d + 1]);
5171 }
5172 } else {
5173 var b = a.getAttributeNames ();
5174 while (b.hasMoreElements ()) {
5175 var c = b.nextElement ();
5176 this.addAttribute (c, a.getAttribute (c));
5177 }
5178 }}, "javax.swing.text.AttributeSet");
5179 Clazz_defineMethod (c$, "removeAttribute", 
5180 function (a) {
5181 var b = this.keys.size ();
5182 for (var c = 0; c < b; c++) {
5183 if (this.keys.elementAt (c).equals (a)) {
5184 this.keys.removeElementAt (c);
5185 this.data.removeElementAt (c);
5186 return;
5187 }}
5188 }, "~O");
5189 Clazz_defineMethod (c$, "removeAttributes", 
5190 function (a) {
5191 while (a.hasMoreElements ()) {
5192 var b = a.nextElement ();
5193 this.removeAttribute (b);
5194 }
5195 }, "java.util.Enumeration");
5196 Clazz_defineMethod (c$, "removeAttributes", 
5197 function (a) {
5198 var b = a.getAttributeNames ();
5199 while (b.hasMoreElements ()) {
5200 var c = b.nextElement ();
5201 var d = a.getAttribute (c);
5202 this.removeSearchAttribute (c, d);
5203 }
5204 }, "javax.swing.text.AttributeSet");
5205 Clazz_defineMethod (c$, "removeSearchAttribute", 
5206  function (a, b) {
5207 var c = this.keys.size ();
5208 for (var d = 0; d < c; d++) {
5209 if (this.keys.elementAt (d).equals (a)) {
5210 if (this.data.elementAt (d).equals (b)) {
5211 this.keys.removeElementAt (d);
5212 this.data.removeElementAt (d);
5213 }return;
5214 }}
5215 }, "~O,~O");
5216 c$ = Clazz_p0p ();
5217 };
5218 c$.$StyleContext$NamedStyle$ = function () {
5219 Clazz_pu$h(self.c$);
5220 c$ = Clazz_decorateAsClass (function () {
5221 Clazz_prepareCallback (this, arguments);
5222 this.listenerList = null;
5223 this.changeEvent = null;
5224 this.attributes = null;
5225 Clazz_instantialize (this, arguments);
5226 }, javax.swing.text.StyleContext, "NamedStyle", null, javax.swing.text.Style);
5227 Clazz_prepareFields (c$, function () {
5228 this.listenerList =  new javax.swing.event.EventListenerList ();
5229 });
5230 Clazz_makeConstructor (c$, 
5231 function (a, b) {
5232 this.attributes = this.b$["javax.swing.text.StyleContext"].getEmptySet ();
5233 if (a != null) {
5234 this.setName (a);
5235 }if (b != null) {
5236 this.setResolveParent (b);
5237 }}, "~S,javax.swing.text.Style");
5238 Clazz_makeConstructor (c$, 
5239 function (a) {
5240 this.construct (null, a);
5241 }, "javax.swing.text.Style");
5242 Clazz_makeConstructor (c$, 
5243 function () {
5244 this.attributes = this.b$["javax.swing.text.StyleContext"].getEmptySet ();
5245 });
5246 Clazz_defineMethod (c$, "toString", 
5247 function () {
5248 return "NamedStyle:" + this.getName () + " " + this.attributes;
5249 });
5250 Clazz_overrideMethod (c$, "getName", 
5251 function () {
5252 if (this.isDefined (javax.swing.text.StyleConstants.NameAttribute)) {
5253 return this.getAttribute (javax.swing.text.StyleConstants.NameAttribute).toString ();
5254 }return null;
5255 });
5256 Clazz_defineMethod (c$, "setName", 
5257 function (a) {
5258 if (a != null) {
5259 this.addAttribute (javax.swing.text.StyleConstants.NameAttribute, a);
5260 }}, "~S");
5261 Clazz_overrideMethod (c$, "addChangeListener", 
5262 function (a) {
5263 this.listenerList.add (javax.swing.event.ChangeListener, a);
5264 }, "javax.swing.event.ChangeListener");
5265 Clazz_overrideMethod (c$, "removeChangeListener", 
5266 function (a) {
5267 this.listenerList.remove (javax.swing.event.ChangeListener, a);
5268 }, "javax.swing.event.ChangeListener");
5269 Clazz_defineMethod (c$, "getChangeListeners", 
5270 function () {
5271 return this.listenerList.getListeners (javax.swing.event.ChangeListener);
5272 });
5273 Clazz_defineMethod (c$, "fireStateChanged", 
5274 function () {
5275 var a = this.listenerList.getListenerList ();
5276 for (var b = a.length - 2; b >= 0; b -= 2) {
5277 if (a[b] === javax.swing.event.ChangeListener) {
5278 if (this.changeEvent == null) this.changeEvent =  new javax.swing.event.ChangeEvent (this);
5279 (a[b + 1]).stateChanged (this.changeEvent);
5280 }}
5281 });
5282 Clazz_defineMethod (c$, "getListeners", 
5283 function (a) {
5284 return this.listenerList.getListeners (a);
5285 }, "Class");
5286 Clazz_defineMethod (c$, "getAttributeCount", 
5287 function () {
5288 return this.attributes.getAttributeCount ();
5289 });
5290 Clazz_defineMethod (c$, "isDefined", 
5291 function (a) {
5292 return this.attributes.isDefined (a);
5293 }, "~O");
5294 Clazz_defineMethod (c$, "isEqual", 
5295 function (a) {
5296 return this.attributes.isEqual (a);
5297 }, "javax.swing.text.AttributeSet");
5298 Clazz_defineMethod (c$, "copyAttributes", 
5299 function () {
5300 var a = Clazz_innerTypeInstance (javax.swing.text.StyleContext.NamedStyle, this, null);
5301 a.attributes = this.attributes.copyAttributes ();
5302 return a;
5303 });
5304 Clazz_defineMethod (c$, "getAttribute", 
5305 function (a) {
5306 return this.attributes.getAttribute (a);
5307 }, "~O");
5308 Clazz_defineMethod (c$, "getAttributeNames", 
5309 function () {
5310 return this.attributes.getAttributeNames ();
5311 });
5312 Clazz_defineMethod (c$, "containsAttribute", 
5313 function (a, b) {
5314 return this.attributes.containsAttribute (a, b);
5315 }, "~O,~O");
5316 Clazz_defineMethod (c$, "containsAttributes", 
5317 function (a) {
5318 return this.attributes.containsAttributes (a);
5319 }, "javax.swing.text.AttributeSet");
5320 Clazz_defineMethod (c$, "getResolveParent", 
5321 function () {
5322 return this.attributes.getResolveParent ();
5323 });
5324 Clazz_overrideMethod (c$, "addAttribute", 
5325 function (a, b) {
5326 var c = this.b$["javax.swing.text.StyleContext"];
5327 this.attributes = c.addAttribute (this.attributes, a, b);
5328 this.fireStateChanged ();
5329 }, "~O,~O");
5330 Clazz_overrideMethod (c$, "addAttributes", 
5331 function (a) {
5332 var b = this.b$["javax.swing.text.StyleContext"];
5333 this.attributes = b.addAttributes (this.attributes, a);
5334 this.fireStateChanged ();
5335 }, "javax.swing.text.AttributeSet");
5336 Clazz_overrideMethod (c$, "removeAttribute", 
5337 function (a) {
5338 var b = this.b$["javax.swing.text.StyleContext"];
5339 this.attributes = b.removeAttribute (this.attributes, a);
5340 this.fireStateChanged ();
5341 }, "~O");
5342 Clazz_defineMethod (c$, "removeAttributes", 
5343 function (a) {
5344 var b = this.b$["javax.swing.text.StyleContext"];
5345 this.attributes = b.removeAttributes (this.attributes, a);
5346 this.fireStateChanged ();
5347 }, "java.util.Enumeration");
5348 Clazz_defineMethod (c$, "removeAttributes", 
5349 function (a) {
5350 var b = this.b$["javax.swing.text.StyleContext"];
5351 if (a === this) {
5352 this.attributes = b.getEmptySet ();
5353 } else {
5354 this.attributes = b.removeAttributes (this.attributes, a);
5355 }this.fireStateChanged ();
5356 }, "javax.swing.text.AttributeSet");
5357 Clazz_overrideMethod (c$, "setResolveParent", 
5358 function (a) {
5359 if (a != null) {
5360 this.addAttribute (javax.swing.text.StyleConstants.ResolveAttribute, a);
5361 } else {
5362 this.removeAttribute (javax.swing.text.StyleConstants.ResolveAttribute);
5363 }}, "javax.swing.text.AttributeSet");
5364 c$ = Clazz_p0p ();
5365 };
5366 Clazz_pu$h(self.c$);
5367 c$ = Clazz_decorateAsClass (function () {
5368 this.family = null;
5369 this.style = 0;
5370 this.size = 0;
5371 Clazz_instantialize (this, arguments);
5372 }, javax.swing.text.StyleContext, "FontKey");
5373 Clazz_makeConstructor (c$, 
5374 function (a, b, c) {
5375 this.setValue (a, b, c);
5376 }, "~S,~N,~N");
5377 Clazz_defineMethod (c$, "setValue", 
5378 function (a, b, c) {
5379 this.family = (a != null) ? a.intern () : null;
5380 this.style = b;
5381 this.size = c;
5382 }, "~S,~N,~N");
5383 Clazz_overrideMethod (c$, "hashCode", 
5384 function () {
5385 var a = (this.family != null) ? this.family.hashCode () : 0;
5386 return a ^ this.style ^ this.size;
5387 });
5388 Clazz_overrideMethod (c$, "equals", 
5389 function (a) {
5390 if (Clazz_instanceOf (a, javax.swing.text.StyleContext.FontKey)) {
5391 var b = a;
5392 return (this.size == b.size) && (this.style == b.style) && (this.family === b.family);
5393 }return false;
5394 }, "~O");
5395 c$ = Clazz_p0p ();
5396 Clazz_defineStatics (c$,
5397 "defaultContext", null,
5398 "DEFAULT_STYLE", "default",
5399 "freezeKeyMap", null,
5400 "thawKeyMap", null,
5401 "THRESHOLD", 9);
5402 {
5403 }});
5404 Clazz_declarePackage ("javax.swing.text");
5405 Clazz_load (["javax.swing.text.MutableAttributeSet"], "javax.swing.text.Style", null, function () {
5406 Clazz_declareInterface (javax.swing.text, "Style", javax.swing.text.MutableAttributeSet);
5407 });
5408 Clazz_declarePackage ("javax.swing.text");
5409 Clazz_load (["javax.swing.text.AttributeSet", "$.MutableAttributeSet", "java.util.Hashtable"], "javax.swing.text.SimpleAttributeSet", ["java.util.Enumeration", "$.NoSuchElementException", "javax.swing.text.StyleConstants"], function () {
5410 c$ = Clazz_decorateAsClass (function () {
5411 this.table = null;
5412 Clazz_instantialize (this, arguments);
5413 }, javax.swing.text, "SimpleAttributeSet", null, [javax.swing.text.MutableAttributeSet, Cloneable]);
5414 Clazz_prepareFields (c$, function () {
5415 this.table =  new java.util.Hashtable (3);
5416 });
5417 Clazz_makeConstructor (c$, 
5418 function () {
5419 });
5420 Clazz_makeConstructor (c$, 
5421 function (source) {
5422 this.addAttributes (source);
5423 }, "javax.swing.text.AttributeSet");
5424 Clazz_defineMethod (c$, "isEmpty", 
5425 function () {
5426 return this.table.isEmpty ();
5427 });
5428 Clazz_defineMethod (c$, "getAttributeCount", 
5429 function () {
5430 return this.table.size ();
5431 });
5432 Clazz_overrideMethod (c$, "isDefined", 
5433 function (attrName) {
5434 return this.table.containsKey (attrName);
5435 }, "~O");
5436 Clazz_overrideMethod (c$, "isEqual", 
5437 function (attr) {
5438 return ((this.getAttributeCount () == attr.getAttributeCount ()) && this.containsAttributes (attr));
5439 }, "javax.swing.text.AttributeSet");
5440 Clazz_overrideMethod (c$, "copyAttributes", 
5441 function () {
5442 return this.clone ();
5443 });
5444 Clazz_defineMethod (c$, "getAttributeNames", 
5445 function () {
5446 return this.table.keys ();
5447 });
5448 Clazz_defineMethod (c$, "getAttribute", 
5449 function (name) {
5450 var value = this.table.get (name);
5451 if (value == null) {
5452 var parent = this.getResolveParent ();
5453 if (parent != null) {
5454 value = parent.getAttribute (name);
5455 }}return value;
5456 }, "~O");
5457 Clazz_overrideMethod (c$, "containsAttribute", 
5458 function (name, value) {
5459 return value.equals (this.getAttribute (name));
5460 }, "~O,~O");
5461 Clazz_overrideMethod (c$, "containsAttributes", 
5462 function (attributes) {
5463 var result = true;
5464 var names = attributes.getAttributeNames ();
5465 while (result && names.hasMoreElements ()) {
5466 var name = names.nextElement ();
5467 result = attributes.getAttribute (name).equals (this.getAttribute (name));
5468 }
5469 return result;
5470 }, "javax.swing.text.AttributeSet");
5471 Clazz_overrideMethod (c$, "addAttribute", 
5472 function (name, value) {
5473 this.table.put (name, value);
5474 }, "~O,~O");
5475 Clazz_overrideMethod (c$, "addAttributes", 
5476 function (attributes) {
5477 var names = attributes.getAttributeNames ();
5478 while (names.hasMoreElements ()) {
5479 var name = names.nextElement ();
5480 this.addAttribute (name, attributes.getAttribute (name));
5481 }
5482 }, "javax.swing.text.AttributeSet");
5483 Clazz_overrideMethod (c$, "removeAttribute", 
5484 function (name) {
5485 this.table.remove (name);
5486 }, "~O");
5487 Clazz_defineMethod (c$, "removeAttributes", 
5488 function (names) {
5489 while (names.hasMoreElements ()) this.removeAttribute (names.nextElement ());
5490
5491 }, "java.util.Enumeration");
5492 Clazz_defineMethod (c$, "removeAttributes", 
5493 function (attributes) {
5494 if (attributes === this) {
5495 this.table.clear ();
5496 } else {
5497 var names = attributes.getAttributeNames ();
5498 while (names.hasMoreElements ()) {
5499 var name = names.nextElement ();
5500 var value = attributes.getAttribute (name);
5501 if (value.equals (this.getAttribute (name))) this.removeAttribute (name);
5502 }
5503 }}, "javax.swing.text.AttributeSet");
5504 Clazz_overrideMethod (c$, "getResolveParent", 
5505 function () {
5506 return this.table.get (javax.swing.text.StyleConstants.ResolveAttribute);
5507 });
5508 Clazz_overrideMethod (c$, "setResolveParent", 
5509 function (parent) {
5510 this.addAttribute (javax.swing.text.StyleConstants.ResolveAttribute, parent);
5511 }, "javax.swing.text.AttributeSet");
5512 Clazz_defineMethod (c$, "clone", 
5513 function () {
5514 var attr;
5515 try {
5516 attr = Clazz_superCall (this, javax.swing.text.SimpleAttributeSet, "clone", []);
5517 attr.table = this.table.clone ();
5518 } catch (cnse) {
5519 if (Clazz_exceptionOf (cnse, CloneNotSupportedException)) {
5520 attr = null;
5521 } else {
5522 throw cnse;
5523 }
5524 }
5525 return attr;
5526 });
5527 Clazz_overrideMethod (c$, "hashCode", 
5528 function () {
5529 return this.table.hashCode ();
5530 });
5531 Clazz_defineMethod (c$, "equals", 
5532 function (obj) {
5533 if (this === obj) {
5534 return true;
5535 }if (Clazz_instanceOf (obj, javax.swing.text.AttributeSet)) {
5536 var attrs = obj;
5537 return this.isEqual (attrs);
5538 }return false;
5539 }, "~O");
5540 Clazz_overrideMethod (c$, "toString", 
5541 function () {
5542 var s = "";
5543 var names = this.getAttributeNames ();
5544 while (names.hasMoreElements ()) {
5545 var key = names.nextElement ();
5546 var value = this.getAttribute (key);
5547 if (Clazz_instanceOf (value, javax.swing.text.AttributeSet)) {
5548 s = s + key + "=**AttributeSet** ";
5549 } else {
5550 s = s + key + "=" + value + " ";
5551 }}
5552 return s;
5553 });
5554 Clazz_pu$h(self.c$);
5555 c$ = Clazz_declareType (javax.swing.text.SimpleAttributeSet, "EmptyAttributeSet", null, javax.swing.text.AttributeSet);
5556 Clazz_defineMethod (c$, "getAttributeCount", 
5557 function () {
5558 return 0;
5559 });
5560 Clazz_overrideMethod (c$, "isDefined", 
5561 function (a) {
5562 return false;
5563 }, "~O");
5564 Clazz_overrideMethod (c$, "isEqual", 
5565 function (a) {
5566 return (a.getAttributeCount () == 0);
5567 }, "javax.swing.text.AttributeSet");
5568 Clazz_overrideMethod (c$, "copyAttributes", 
5569 function () {
5570 return this;
5571 });
5572 Clazz_overrideMethod (c$, "getAttribute", 
5573 function (a) {
5574 return null;
5575 }, "~O");
5576 Clazz_overrideMethod (c$, "getAttributeNames", 
5577 function () {
5578 return ((Clazz_isClassDefined ("javax.swing.text.SimpleAttributeSet$EmptyAttributeSet$1") ? 0 : javax.swing.text.SimpleAttributeSet.EmptyAttributeSet.$SimpleAttributeSet$EmptyAttributeSet$1$ ()), Clazz_innerTypeInstance (javax.swing.text.SimpleAttributeSet$EmptyAttributeSet$1, this, null));
5579 });
5580 Clazz_overrideMethod (c$, "containsAttribute", 
5581 function (a, b) {
5582 return false;
5583 }, "~O,~O");
5584 Clazz_overrideMethod (c$, "containsAttributes", 
5585 function (a) {
5586 return (a.getAttributeCount () == 0);
5587 }, "javax.swing.text.AttributeSet");
5588 Clazz_overrideMethod (c$, "getResolveParent", 
5589 function () {
5590 return null;
5591 });
5592 Clazz_overrideMethod (c$, "equals", 
5593 function (a) {
5594 if (this === a) {
5595 return true;
5596 }return ((Clazz_instanceOf (a, javax.swing.text.AttributeSet)) && ((a).getAttributeCount () == 0));
5597 }, "~O");
5598 Clazz_overrideMethod (c$, "hashCode", 
5599 function () {
5600 return 0;
5601 });
5602 c$.$SimpleAttributeSet$EmptyAttributeSet$1$ = function () {
5603 Clazz_pu$h(self.c$);
5604 c$ = Clazz_declareAnonymous (javax.swing.text, "SimpleAttributeSet$EmptyAttributeSet$1", null, java.util.Enumeration);
5605 Clazz_overrideMethod (c$, "hasMoreElements", 
5606 function () {
5607 return false;
5608 });
5609 Clazz_overrideMethod (c$, "nextElement", 
5610 function () {
5611 throw  new java.util.NoSuchElementException ();
5612 });
5613 c$ = Clazz_p0p ();
5614 };
5615 c$ = Clazz_p0p ();
5616 c$.EMPTY = c$.prototype.EMPTY =  new javax.swing.text.SimpleAttributeSet.EmptyAttributeSet ();
5617 });
5618 Clazz_declarePackage ("javax.swing.text");
5619 Clazz_load (null, "javax.swing.text.Utilities", ["javax.swing.JComponent", "javax.swing.text.CompositeView", "$.Position", "$.StyleConstants", "$.StyledDocument"], function () {
5620 c$ = Clazz_declareType (javax.swing.text, "Utilities");
5621 c$.getJComponent = Clazz_defineMethod (c$, "getJComponent", 
5622 function (view) {
5623 if (view != null) {
5624 var component = view.getContainer ();
5625 if (Clazz_instanceOf (component, javax.swing.JComponent)) {
5626 return component;
5627 }}return null;
5628 }, "javax.swing.text.View");
5629 c$.getTabbedTextWidth = Clazz_defineMethod (c$, "getTabbedTextWidth", 
5630 function (s, metrics, x, e, startOffset) {
5631 return javax.swing.text.Utilities.getTabbedTextWidth (null, s, metrics, x, e, startOffset, null);
5632 }, "javax.swing.text.Segment,java.awt.FontMetrics,~N,javax.swing.text.TabExpander,~N");
5633 c$.getTabbedTextWidth = Clazz_defineMethod (c$, "getTabbedTextWidth", 
5634 function (view, s, metrics, x, e, startOffset, justificationData) {
5635 var nextX = x;
5636 var txt = s.array;
5637 var txtOffset = s.offset;
5638 var n = s.offset + s.count;
5639 var charCount = 0;
5640 var spaceAddon = 0;
5641 var spaceAddonLeftoverEnd = -1;
5642 var startJustifiableContent = 0;
5643 var endJustifiableContent = 0;
5644 if (justificationData != null) {
5645 var offset = -startOffset + txtOffset;
5646 var parent = null;
5647 if (view != null && (parent = view.getParent ()) != null) {
5648 offset += parent.getStartOffset ();
5649 }spaceAddon = justificationData[0];
5650 spaceAddonLeftoverEnd = justificationData[1] + offset;
5651 startJustifiableContent = justificationData[2] + offset;
5652 endJustifiableContent = justificationData[3] + offset;
5653 }for (var i = txtOffset; i < n; i++) {
5654 if (txt[i] == '\t' || ((spaceAddon != 0 || i <= spaceAddonLeftoverEnd) && (txt[i] == ' ') && startJustifiableContent <= i && i <= endJustifiableContent)) {
5655 nextX += metrics.charsWidth (txt, i - charCount, charCount);
5656 charCount = 0;
5657 if (txt[i] == '\t') {
5658 if (e != null) {
5659 nextX = Clazz_floatToInt (e.nextTabStop (nextX, startOffset + i - txtOffset));
5660 } else {
5661 nextX += metrics.charWidth (' ');
5662 }} else if (txt[i] == ' ') {
5663 nextX += metrics.charWidth (' ') + spaceAddon;
5664 if (i <= spaceAddonLeftoverEnd) {
5665 nextX++;
5666 }}} else if (txt[i] == '\n') {
5667 nextX += metrics.charsWidth (txt, i - charCount, charCount);
5668 charCount = 0;
5669 } else {
5670 charCount++;
5671 }}
5672 nextX += metrics.charsWidth (txt, n - charCount, charCount);
5673 return nextX - x;
5674 }, "javax.swing.text.View,javax.swing.text.Segment,java.awt.FontMetrics,~N,javax.swing.text.TabExpander,~N,~A");
5675 c$.getTabbedTextOffset = Clazz_defineMethod (c$, "getTabbedTextOffset", 
5676 function (s, metrics, x0, x, e, startOffset) {
5677 return javax.swing.text.Utilities.getTabbedTextOffset (s, metrics, x0, x, e, startOffset, true);
5678 }, "javax.swing.text.Segment,java.awt.FontMetrics,~N,~N,javax.swing.text.TabExpander,~N");
5679 c$.getTabbedTextOffset = Clazz_defineMethod (c$, "getTabbedTextOffset", 
5680 function (view, s, metrics, x0, x, e, startOffset, justificationData) {
5681 return javax.swing.text.Utilities.getTabbedTextOffset (view, s, metrics, x0, x, e, startOffset, true, justificationData);
5682 }, "javax.swing.text.View,javax.swing.text.Segment,java.awt.FontMetrics,~N,~N,javax.swing.text.TabExpander,~N,~A");
5683 c$.getTabbedTextOffset = Clazz_defineMethod (c$, "getTabbedTextOffset", 
5684 function (s, metrics, x0, x, e, startOffset, round) {
5685 return javax.swing.text.Utilities.getTabbedTextOffset (null, s, metrics, x0, x, e, startOffset, round, null);
5686 }, "javax.swing.text.Segment,java.awt.FontMetrics,~N,~N,javax.swing.text.TabExpander,~N,~B");
5687 c$.getTabbedTextOffset = Clazz_defineMethod (c$, "getTabbedTextOffset", 
5688 function (view, s, metrics, x0, x, e, startOffset, round, justificationData) {
5689 if (x0 >= x) {
5690 return 0;
5691 }var currX = x0;
5692 var nextX = currX;
5693 var txt = s.array;
5694 var txtOffset = s.offset;
5695 var txtCount = s.count;
5696 var spaceAddon = 0;
5697 var spaceAddonLeftoverEnd = -1;
5698 var startJustifiableContent = 0;
5699 var endJustifiableContent = 0;
5700 if (justificationData != null) {
5701 var offset = -startOffset + txtOffset;
5702 var parent = null;
5703 if (view != null && (parent = view.getParent ()) != null) {
5704 offset += parent.getStartOffset ();
5705 }spaceAddon = justificationData[0];
5706 spaceAddonLeftoverEnd = justificationData[1] + offset;
5707 startJustifiableContent = justificationData[2] + offset;
5708 endJustifiableContent = justificationData[3] + offset;
5709 }var n = s.offset + s.count;
5710 for (var i = s.offset; i < n; i++) {
5711 if (txt[i] == '\t' || ((spaceAddon != 0 || i <= spaceAddonLeftoverEnd) && (txt[i] == ' ') && startJustifiableContent <= i && i <= endJustifiableContent)) {
5712 if (txt[i] == '\t') {
5713 if (e != null) {
5714 nextX = Clazz_floatToInt (e.nextTabStop (nextX, startOffset + i - txtOffset));
5715 } else {
5716 nextX += metrics.charWidth (' ');
5717 }} else if (txt[i] == ' ') {
5718 nextX += metrics.charWidth (' ') + spaceAddon;
5719 if (i <= spaceAddonLeftoverEnd) {
5720 nextX++;
5721 }}} else {
5722 nextX += metrics.charWidth (txt[i]);
5723 }if ((x >= currX) && (x < nextX)) {
5724 if ((round == false) || ((x - currX) < (nextX - x))) {
5725 return i - txtOffset;
5726 } else {
5727 return i + 1 - txtOffset;
5728 }}currX = nextX;
5729 }
5730 return txtCount;
5731 }, "javax.swing.text.View,javax.swing.text.Segment,java.awt.FontMetrics,~N,~N,javax.swing.text.TabExpander,~N,~B,~A");
5732 c$.getBreakLocation = Clazz_defineMethod (c$, "getBreakLocation", 
5733 function (s, metrics, x0, x, e, startOffset) {
5734 return 0;
5735 }, "javax.swing.text.Segment,java.awt.FontMetrics,~N,~N,javax.swing.text.TabExpander,~N");
5736 c$.getRowStart = Clazz_defineMethod (c$, "getRowStart", 
5737 function (c, offs) {
5738 var r = c.modelToView (offs);
5739 if (r == null) {
5740 return -1;
5741 }var lastOffs = offs;
5742 var y = r.y;
5743 while ((r != null) && (y == r.y)) {
5744 if (r.height != 0) {
5745 offs = lastOffs;
5746 }lastOffs -= 1;
5747 r = (lastOffs >= 0) ? c.modelToView (lastOffs) : null;
5748 }
5749 return offs;
5750 }, "javax.swing.text.JTextComponent,~N");
5751 c$.getRowEnd = Clazz_defineMethod (c$, "getRowEnd", 
5752 function (c, offs) {
5753 var r = c.modelToView (offs);
5754 if (r == null) {
5755 return -1;
5756 }var n = c.getDocument ().getLength ();
5757 var lastOffs = offs;
5758 var y = r.y;
5759 while ((r != null) && (y == r.y)) {
5760 if (r.height != 0) {
5761 offs = lastOffs;
5762 }lastOffs += 1;
5763 r = (lastOffs <= n) ? c.modelToView (lastOffs) : null;
5764 }
5765 return offs;
5766 }, "javax.swing.text.JTextComponent,~N");
5767 c$.getPositionAbove = Clazz_defineMethod (c$, "getPositionAbove", 
5768 function (c, offs, x) {
5769 var lastOffs = javax.swing.text.Utilities.getRowStart (c, offs) - 1;
5770 if (lastOffs < 0) {
5771 return -1;
5772 }var bestSpan = 2147483647;
5773 var y = 0;
5774 var r = null;
5775 if (lastOffs >= 0) {
5776 r = c.modelToView (lastOffs);
5777 y = r.y;
5778 }while ((r != null) && (y == r.y)) {
5779 var span = Math.abs (r.x - x);
5780 if (span < bestSpan) {
5781 offs = lastOffs;
5782 bestSpan = span;
5783 }lastOffs -= 1;
5784 r = (lastOffs >= 0) ? c.modelToView (lastOffs) : null;
5785 }
5786 return offs;
5787 }, "javax.swing.text.JTextComponent,~N,~N");
5788 c$.getPositionBelow = Clazz_defineMethod (c$, "getPositionBelow", 
5789 function (c, offs, x) {
5790 var lastOffs = javax.swing.text.Utilities.getRowEnd (c, offs) + 1;
5791 if (lastOffs <= 0) {
5792 return -1;
5793 }var bestSpan = 2147483647;
5794 var n = c.getDocument ().getLength ();
5795 var y = 0;
5796 var r = null;
5797 if (lastOffs <= n) {
5798 r = c.modelToView (lastOffs);
5799 y = r.y;
5800 }while ((r != null) && (y == r.y)) {
5801 var span = Math.abs (x - r.x);
5802 if (span < bestSpan) {
5803 offs = lastOffs;
5804 bestSpan = span;
5805 }lastOffs += 1;
5806 r = (lastOffs <= n) ? c.modelToView (lastOffs) : null;
5807 }
5808 return offs;
5809 }, "javax.swing.text.JTextComponent,~N,~N");
5810 c$.getWordStart = Clazz_defineMethod (c$, "getWordStart", 
5811 function (c, offs) {
5812 return 0;
5813 }, "javax.swing.text.JTextComponent,~N");
5814 c$.getWordEnd = Clazz_defineMethod (c$, "getWordEnd", 
5815 function (c, offs) {
5816 return 0;
5817 }, "javax.swing.text.JTextComponent,~N");
5818 c$.getNextWord = Clazz_defineMethod (c$, "getNextWord", 
5819 function (c, offs) {
5820 var nextWord;
5821 var line = javax.swing.text.Utilities.getParagraphElement (c, offs);
5822 for (nextWord = javax.swing.text.Utilities.getNextWordInParagraph (c, line, offs, false); nextWord == -1; nextWord = javax.swing.text.Utilities.getNextWordInParagraph (c, line, offs, true)) {
5823 offs = line.getEndOffset ();
5824 line = javax.swing.text.Utilities.getParagraphElement (c, offs);
5825 }
5826 return nextWord;
5827 }, "javax.swing.text.JTextComponent,~N");
5828 c$.getNextWordInParagraph = Clazz_defineMethod (c$, "getNextWordInParagraph", 
5829 function (c, line, offs, first) {
5830 return 0;
5831 }, "javax.swing.text.JTextComponent,javax.swing.text.Element,~N,~B");
5832 c$.getPreviousWord = Clazz_defineMethod (c$, "getPreviousWord", 
5833 function (c, offs) {
5834 var prevWord;
5835 var line = javax.swing.text.Utilities.getParagraphElement (c, offs);
5836 for (prevWord = javax.swing.text.Utilities.getPrevWordInParagraph (c, line, offs); prevWord == -1; prevWord = javax.swing.text.Utilities.getPrevWordInParagraph (c, line, offs)) {
5837 offs = line.getStartOffset () - 1;
5838 line = javax.swing.text.Utilities.getParagraphElement (c, offs);
5839 }
5840 return prevWord;
5841 }, "javax.swing.text.JTextComponent,~N");
5842 c$.getPrevWordInParagraph = Clazz_defineMethod (c$, "getPrevWordInParagraph", 
5843 function (c, line, offs) {
5844 return 0;
5845 }, "javax.swing.text.JTextComponent,javax.swing.text.Element,~N");
5846 c$.getParagraphElement = Clazz_defineMethod (c$, "getParagraphElement", 
5847 function (c, offs) {
5848 var doc = c.getDocument ();
5849 if (Clazz_instanceOf (doc, javax.swing.text.StyledDocument)) {
5850 return (doc).getParagraphElement (offs);
5851 }var map = doc.getDefaultRootElement ();
5852 var index = map.getElementIndex (offs);
5853 var paragraph = map.getElement (index);
5854 if ((offs >= paragraph.getStartOffset ()) && (offs < paragraph.getEndOffset ())) {
5855 return paragraph;
5856 }return null;
5857 }, "javax.swing.text.JTextComponent,~N");
5858 c$.isComposedTextElement = Clazz_defineMethod (c$, "isComposedTextElement", 
5859 function (doc, offset) {
5860 var elem = doc.getDefaultRootElement ();
5861 while (!elem.isLeaf ()) {
5862 elem = elem.getElement (elem.getElementIndex (offset));
5863 }
5864 return javax.swing.text.Utilities.isComposedTextElement (elem);
5865 }, "javax.swing.text.Document,~N");
5866 c$.isComposedTextElement = Clazz_defineMethod (c$, "isComposedTextElement", 
5867 function (elem) {
5868 var as = elem.getAttributes ();
5869 return javax.swing.text.Utilities.isComposedTextAttributeDefined (as);
5870 }, "javax.swing.text.Element");
5871 c$.isComposedTextAttributeDefined = Clazz_defineMethod (c$, "isComposedTextAttributeDefined", 
5872 function (as) {
5873 return ((as != null) && (as.isDefined (javax.swing.text.StyleConstants.ComposedTextAttribute)));
5874 }, "javax.swing.text.AttributeSet");
5875 c$.isLeftToRight = Clazz_defineMethod (c$, "isLeftToRight", 
5876 function (c) {
5877 return c.getComponentOrientation ().isLeftToRight ();
5878 }, "java.awt.Component");
5879 c$.getNextVisualPositionFrom = Clazz_defineMethod (c$, "getNextVisualPositionFrom", 
5880 function (v, pos, b, alloc, direction, biasRet) {
5881 if (v.getViewCount () == 0) {
5882 return pos;
5883 }var top = (direction == 1 || direction == 7);
5884 var retValue;
5885 if (pos == -1) {
5886 var childIndex = (top) ? v.getViewCount () - 1 : 0;
5887 var child = v.getView (childIndex);
5888 var childBounds = v.getChildAllocation (childIndex, alloc);
5889 retValue = child.getNextVisualPositionFrom (pos, b, childBounds, direction, biasRet);
5890 if (retValue == -1 && !top && v.getViewCount () > 1) {
5891 child = v.getView (1);
5892 childBounds = v.getChildAllocation (1, alloc);
5893 retValue = child.getNextVisualPositionFrom (-1, biasRet[0], childBounds, direction, biasRet);
5894 }} else {
5895 var increment = (top) ? -1 : 1;
5896 var childIndex;
5897 if (b === javax.swing.text.Position.Bias.Backward && pos > 0) {
5898 childIndex = v.getViewIndex (pos - 1, javax.swing.text.Position.Bias.Forward);
5899 } else {
5900 childIndex = v.getViewIndex (pos, javax.swing.text.Position.Bias.Forward);
5901 }var child = v.getView (childIndex);
5902 var childBounds = v.getChildAllocation (childIndex, alloc);
5903 retValue = child.getNextVisualPositionFrom (pos, b, childBounds, direction, biasRet);
5904 if ((direction == 3 || direction == 7) && (Clazz_instanceOf (v, javax.swing.text.CompositeView)) && (v).flipEastAndWestAtEnds (pos, b)) {
5905 increment *= -1;
5906 }childIndex += increment;
5907 if (retValue == -1 && childIndex >= 0 && childIndex < v.getViewCount ()) {
5908 child = v.getView (childIndex);
5909 childBounds = v.getChildAllocation (childIndex, alloc);
5910 retValue = child.getNextVisualPositionFrom (-1, b, childBounds, direction, biasRet);
5911 if (retValue == pos && biasRet[0] !== b) {
5912 return javax.swing.text.Utilities.getNextVisualPositionFrom (v, pos, biasRet[0], alloc, direction, biasRet);
5913 }} else if (retValue != -1 && biasRet[0] !== b && ((increment == 1 && child.getEndOffset () == retValue) || (increment == -1 && child.getStartOffset () == retValue)) && childIndex >= 0 && childIndex < v.getViewCount ()) {
5914 child = v.getView (childIndex);
5915 childBounds = v.getChildAllocation (childIndex, alloc);
5916 var originalBias = biasRet[0];
5917 var nextPos = child.getNextVisualPositionFrom (-1, b, childBounds, direction, biasRet);
5918 if (biasRet[0] === b) {
5919 retValue = nextPos;
5920 } else {
5921 biasRet[0] = originalBias;
5922 }}}return retValue;
5923 }, "javax.swing.text.View,~N,javax.swing.text.Position.Bias,java.awt.Shape,~N,~A");
5924 });
5925 Clazz_declarePackage ("javax.swing.text");
5926 Clazz_load (["javax.swing.text.View"], "javax.swing.text.CompositeView", ["java.lang.IllegalArgumentException", "java.awt.Rectangle", "javax.swing.text.BadLocationException", "$.Position", "$.StyleConstants", "$.Utilities"], function () {
5927 c$ = Clazz_decorateAsClass (function () {
5928 this.children = null;
5929 this.nchildren = 0;
5930 this.left = 0;
5931 this.right = 0;
5932 this.top = 0;
5933 this.bottom = 0;
5934 this.childAlloc = null;
5935 Clazz_instantialize (this, arguments);
5936 }, javax.swing.text, "CompositeView", javax.swing.text.View);
5937 Clazz_makeConstructor (c$, 
5938 function (elem) {
5939 Clazz_superConstructor (this, javax.swing.text.CompositeView, [elem]);
5940 this.children =  new Array (1);
5941 this.nchildren = 0;
5942 this.childAlloc =  new java.awt.Rectangle ();
5943 }, "javax.swing.text.Element");
5944 Clazz_defineMethod (c$, "loadChildren", 
5945 function (f) {
5946 if (f == null) {
5947 return;
5948 }var e = this.getElement ();
5949 var n = e.getElementCount ();
5950 if (n > 0) {
5951 var added =  new Array (n);
5952 for (var i = 0; i < n; i++) {
5953 added[i] = f.create (e.getElement (i));
5954 }
5955 this.replace (0, 0, added);
5956 }}, "javax.swing.text.ViewFactory");
5957 Clazz_defineMethod (c$, "setParent", 
5958 function (parent) {
5959 Clazz_superCall (this, javax.swing.text.CompositeView, "setParent", [parent]);
5960 if ((parent != null) && (this.nchildren == 0)) {
5961 var f = this.getViewFactory ();
5962 this.loadChildren (f);
5963 }}, "javax.swing.text.View");
5964 Clazz_overrideMethod (c$, "getViewCount", 
5965 function () {
5966 return this.nchildren;
5967 });
5968 Clazz_overrideMethod (c$, "getView", 
5969 function (n) {
5970 return this.children[n];
5971 }, "~N");
5972 Clazz_overrideMethod (c$, "replace", 
5973 function (offset, length, views) {
5974 if (views == null) {
5975 views = javax.swing.text.CompositeView.ZERO;
5976 }for (var i = offset; i < offset + length; i++) {
5977 if (this.children[i].getParent () === this) {
5978 this.children[i].setParent (null);
5979 }this.children[i] = null;
5980 }
5981 var delta = views.length - length;
5982 var src = offset + length;
5983 var nmove = this.nchildren - src;
5984 var dest = src + delta;
5985 if ((this.nchildren + delta) >= this.children.length) {
5986 var newLength = Math.max (2 * this.children.length, this.nchildren + delta);
5987 var newChildren =  new Array (newLength);
5988 System.arraycopy (this.children, 0, newChildren, 0, offset);
5989 System.arraycopy (views, 0, newChildren, offset, views.length);
5990 System.arraycopy (this.children, src, newChildren, dest, nmove);
5991 this.children = newChildren;
5992 } else {
5993 System.arraycopy (this.children, src, this.children, dest, nmove);
5994 System.arraycopy (views, 0, this.children, offset, views.length);
5995 }this.nchildren = this.nchildren + delta;
5996 for (var i = 0; i < views.length; i++) {
5997 views[i].setParent (this);
5998 }
5999 }, "~N,~N,~A");
6000 Clazz_overrideMethod (c$, "getChildAllocation", 
6001 function (index, a) {
6002 var alloc = this.getInsideAllocation (a);
6003 this.childAllocation (index, alloc);
6004 return alloc;
6005 }, "~N,java.awt.Shape");
6006 Clazz_defineMethod (c$, "modelToView", 
6007 function (pos, a, b) {
6008 var isBackward = (b === javax.swing.text.Position.Bias.Backward);
6009 var testPos = (isBackward) ? Math.max (0, pos - 1) : pos;
6010 if (isBackward && testPos < this.getStartOffset ()) {
6011 return null;
6012 }var vIndex = this.getViewIndexAtPosition (testPos);
6013 if ((vIndex != -1) && (vIndex < this.getViewCount ())) {
6014 var v = this.getView (vIndex);
6015 if (v != null && testPos >= v.getStartOffset () && testPos < v.getEndOffset ()) {
6016 var childShape = this.getChildAllocation (vIndex, a);
6017 if (childShape == null) {
6018 return null;
6019 }var retShape = v.modelToView (pos, childShape, b);
6020 if (retShape == null && v.getEndOffset () == pos) {
6021 if (++vIndex < this.getViewCount ()) {
6022 v = this.getView (vIndex);
6023 retShape = v.modelToView (pos, this.getChildAllocation (vIndex, a), b);
6024 }}return retShape;
6025 }}throw  new javax.swing.text.BadLocationException ("Position not represented by view", pos);
6026 }, "~N,java.awt.Shape,javax.swing.text.Position.Bias");
6027 Clazz_defineMethod (c$, "modelToView", 
6028 function (p0, b0, p1, b1, a) {
6029 if (p0 == this.getStartOffset () && p1 == this.getEndOffset ()) {
6030 return a;
6031 }var alloc = this.getInsideAllocation (a);
6032 var r0 =  new java.awt.Rectangle (alloc);
6033 var v0 = this.getViewAtPosition ((b0 === javax.swing.text.Position.Bias.Backward) ? Math.max (0, p0 - 1) : p0, r0);
6034 var r1 =  new java.awt.Rectangle (alloc);
6035 var v1 = this.getViewAtPosition ((b1 === javax.swing.text.Position.Bias.Backward) ? Math.max (0, p1 - 1) : p1, r1);
6036 if (v0 === v1) {
6037 if (v0 == null) {
6038 return a;
6039 }return v0.modelToView (p0, b0, p1, b1, r0);
6040 }var viewCount = this.getViewCount ();
6041 var counter = 0;
6042 while (counter < viewCount) {
6043 var v;
6044 if ((v = this.getView (counter)) === v0 || v === v1) {
6045 var endView;
6046 var retRect;
6047 var tempRect =  new java.awt.Rectangle ();
6048 if (v === v0) {
6049 retRect = v0.modelToView (p0, b0, v0.getEndOffset (), javax.swing.text.Position.Bias.Backward, r0).getBounds ();
6050 endView = v1;
6051 } else {
6052 retRect = v1.modelToView (v1.getStartOffset (), javax.swing.text.Position.Bias.Forward, p1, b1, r1).getBounds ();
6053 endView = v0;
6054 }while (++counter < viewCount && (v = this.getView (counter)) !== endView) {
6055 tempRect.setBounds (alloc);
6056 this.childAllocation (counter, tempRect);
6057 retRect.add (tempRect);
6058 }
6059 if (endView != null) {
6060 var endShape;
6061 if (endView === v1) {
6062 endShape = v1.modelToView (v1.getStartOffset (), javax.swing.text.Position.Bias.Forward, p1, b1, r1);
6063 } else {
6064 endShape = v0.modelToView (p0, b0, v0.getEndOffset (), javax.swing.text.Position.Bias.Backward, r0);
6065 }if (Clazz_instanceOf (endShape, java.awt.Rectangle)) {
6066 retRect.add (endShape);
6067 } else {
6068 retRect.add (endShape.getBounds ());
6069 }}return retRect;
6070 }counter++;
6071 }
6072 throw  new javax.swing.text.BadLocationException ("Position not represented by view", p0);
6073 }, "~N,javax.swing.text.Position.Bias,~N,javax.swing.text.Position.Bias,java.awt.Shape");
6074 Clazz_defineMethod (c$, "viewToModel", 
6075 function (x, y, a, bias) {
6076 var alloc = this.getInsideAllocation (a);
6077 if (this.isBefore (Clazz_floatToInt (x), Clazz_floatToInt (y), alloc)) {
6078 var retValue = -1;
6079 try {
6080 retValue = this.getNextVisualPositionFrom (-1, javax.swing.text.Position.Bias.Forward, a, 3, bias);
6081 } catch (e$$) {
6082 if (Clazz_exceptionOf (e$$, javax.swing.text.BadLocationException)) {
6083 var ble = e$$;
6084 {
6085 }
6086 } else if (Clazz_exceptionOf (e$$, IllegalArgumentException)) {
6087 var iae = e$$;
6088 {
6089 }
6090 } else {
6091 throw e$$;
6092 }
6093 }
6094 if (retValue == -1) {
6095 retValue = this.getStartOffset ();
6096 bias[0] = javax.swing.text.Position.Bias.Forward;
6097 }return retValue;
6098 } else if (this.isAfter (Clazz_floatToInt (x), Clazz_floatToInt (y), alloc)) {
6099 var retValue = -1;
6100 try {
6101 retValue = this.getNextVisualPositionFrom (-1, javax.swing.text.Position.Bias.Forward, a, 7, bias);
6102 } catch (e$$) {
6103 if (Clazz_exceptionOf (e$$, javax.swing.text.BadLocationException)) {
6104 var ble = e$$;
6105 {
6106 }
6107 } else if (Clazz_exceptionOf (e$$, IllegalArgumentException)) {
6108 var iae = e$$;
6109 {
6110 }
6111 } else {
6112 throw e$$;
6113 }
6114 }
6115 if (retValue == -1) {
6116 retValue = this.getEndOffset () - 1;
6117 bias[0] = javax.swing.text.Position.Bias.Forward;
6118 }return retValue;
6119 } else {
6120 var v = this.getViewAtPoint (Clazz_floatToInt (x), Clazz_floatToInt (y), alloc);
6121 if (v != null) {
6122 return v.viewToModel (x, y, alloc, bias);
6123 }}return -1;
6124 }, "~N,~N,java.awt.Shape,~A");
6125 Clazz_overrideMethod (c$, "getNextVisualPositionFrom", 
6126 function (pos, b, a, direction, biasRet) {
6127 switch (direction) {
6128 case 1:
6129 return this.getNextNorthSouthVisualPositionFrom (pos, b, a, direction, biasRet);
6130 case 5:
6131 return this.getNextNorthSouthVisualPositionFrom (pos, b, a, direction, biasRet);
6132 case 3:
6133 return this.getNextEastWestVisualPositionFrom (pos, b, a, direction, biasRet);
6134 case 7:
6135 return this.getNextEastWestVisualPositionFrom (pos, b, a, direction, biasRet);
6136 default:
6137 throw  new IllegalArgumentException ("Bad direction: " + direction);
6138 }
6139 }, "~N,javax.swing.text.Position.Bias,java.awt.Shape,~N,~A");
6140 Clazz_defineMethod (c$, "getViewIndex", 
6141 function (pos, b) {
6142 if (b === javax.swing.text.Position.Bias.Backward) {
6143 pos -= 1;
6144 }if ((pos >= this.getStartOffset ()) && (pos < this.getEndOffset ())) {
6145 return this.getViewIndexAtPosition (pos);
6146 }return -1;
6147 }, "~N,javax.swing.text.Position.Bias");
6148 Clazz_defineMethod (c$, "getViewAtPosition", 
6149 function (pos, a) {
6150 var index = this.getViewIndexAtPosition (pos);
6151 if ((index >= 0) && (index < this.getViewCount ())) {
6152 var v = this.getView (index);
6153 if (a != null) {
6154 this.childAllocation (index, a);
6155 }return v;
6156 }return null;
6157 }, "~N,java.awt.Rectangle");
6158 Clazz_defineMethod (c$, "getViewIndexAtPosition", 
6159 function (pos) {
6160 var elem = this.getElement ();
6161 return elem.getElementIndex (pos);
6162 }, "~N");
6163 Clazz_defineMethod (c$, "getInsideAllocation", 
6164 function (a) {
6165 if (a != null) {
6166 var alloc;
6167 if (Clazz_instanceOf (a, java.awt.Rectangle)) {
6168 alloc = a;
6169 } else {
6170 alloc = a.getBounds ();
6171 }this.childAlloc.setBounds (alloc);
6172 this.childAlloc.x += this.getLeftInset ();
6173 this.childAlloc.y += this.getTopInset ();
6174 this.childAlloc.width -= this.getLeftInset () + this.getRightInset ();
6175 this.childAlloc.height -= this.getTopInset () + this.getBottomInset ();
6176 return this.childAlloc;
6177 }return null;
6178 }, "java.awt.Shape");
6179 Clazz_defineMethod (c$, "setParagraphInsets", 
6180 function (attr) {
6181 this.top = Clazz_floatToShort (javax.swing.text.StyleConstants.getSpaceAbove (attr));
6182 this.left = Clazz_floatToShort (javax.swing.text.StyleConstants.getLeftIndent (attr));
6183 this.bottom = Clazz_floatToShort (javax.swing.text.StyleConstants.getSpaceBelow (attr));
6184 this.right = Clazz_floatToShort (javax.swing.text.StyleConstants.getRightIndent (attr));
6185 }, "javax.swing.text.AttributeSet");
6186 Clazz_defineMethod (c$, "setInsets", 
6187 function (top, left, bottom, right) {
6188 this.top = top;
6189 this.left = left;
6190 this.right = right;
6191 this.bottom = bottom;
6192 }, "~N,~N,~N,~N");
6193 Clazz_defineMethod (c$, "getLeftInset", 
6194 function () {
6195 return this.left;
6196 });
6197 Clazz_defineMethod (c$, "getRightInset", 
6198 function () {
6199 return this.right;
6200 });
6201 Clazz_defineMethod (c$, "getTopInset", 
6202 function () {
6203 return this.top;
6204 });
6205 Clazz_defineMethod (c$, "getBottomInset", 
6206 function () {
6207 return this.bottom;
6208 });
6209 Clazz_defineMethod (c$, "getNextNorthSouthVisualPositionFrom", 
6210 function (pos, b, a, direction, biasRet) {
6211 return javax.swing.text.Utilities.getNextVisualPositionFrom (this, pos, b, a, direction, biasRet);
6212 }, "~N,javax.swing.text.Position.Bias,java.awt.Shape,~N,~A");
6213 Clazz_defineMethod (c$, "getNextEastWestVisualPositionFrom", 
6214 function (pos, b, a, direction, biasRet) {
6215 return javax.swing.text.Utilities.getNextVisualPositionFrom (this, pos, b, a, direction, biasRet);
6216 }, "~N,javax.swing.text.Position.Bias,java.awt.Shape,~N,~A");
6217 Clazz_defineMethod (c$, "flipEastAndWestAtEnds", 
6218 function (position, bias) {
6219 return false;
6220 }, "~N,javax.swing.text.Position.Bias");
6221 c$.ZERO = c$.prototype.ZERO =  new Array (0);
6222 });
6223 Clazz_declarePackage ("javax.swing.text");
6224 Clazz_load (["javax.swing.SwingConstants"], "javax.swing.text.View", ["java.lang.IllegalArgumentException", "java.awt.Rectangle", "javax.swing.event.DocumentEvent", "javax.swing.text.Position", "$.Utilities"], function () {
6225 c$ = Clazz_decorateAsClass (function () {
6226 this.parent = null;
6227 this.elem = null;
6228 Clazz_instantialize (this, arguments);
6229 }, javax.swing.text, "View", null, javax.swing.SwingConstants);
6230 Clazz_makeConstructor (c$, 
6231 function (elem) {
6232 this.elem = elem;
6233 }, "javax.swing.text.Element");
6234 Clazz_defineMethod (c$, "getParent", 
6235 function () {
6236 return this.parent;
6237 });
6238 Clazz_defineMethod (c$, "isVisible", 
6239 function () {
6240 return true;
6241 });
6242 Clazz_defineMethod (c$, "getMinimumSpan", 
6243 function (axis) {
6244 var w = this.getResizeWeight (axis);
6245 if (w == 0) {
6246 return this.getPreferredSpan (axis);
6247 }return 0;
6248 }, "~N");
6249 Clazz_defineMethod (c$, "getMaximumSpan", 
6250 function (axis) {
6251 var w = this.getResizeWeight (axis);
6252 if (w == 0) {
6253 return this.getPreferredSpan (axis);
6254 }return 2147483647;
6255 }, "~N");
6256 Clazz_defineMethod (c$, "preferenceChanged", 
6257 function (child, width, height) {
6258 var parent = this.getParent ();
6259 if (parent != null) {
6260 parent.preferenceChanged (this, width, height);
6261 }}, "javax.swing.text.View,~B,~B");
6262 Clazz_defineMethod (c$, "getAlignment", 
6263 function (axis) {
6264 return 0.5;
6265 }, "~N");
6266 Clazz_defineMethod (c$, "setParent", 
6267 function (parent) {
6268 if (parent == null) {
6269 for (var i = 0; i < this.getViewCount (); i++) {
6270 if (this.getView (i).getParent () === this) {
6271 this.getView (i).setParent (null);
6272 }}
6273 }this.parent = parent;
6274 }, "javax.swing.text.View");
6275 Clazz_defineMethod (c$, "getViewCount", 
6276 function () {
6277 return 0;
6278 });
6279 Clazz_defineMethod (c$, "getView", 
6280 function (n) {
6281 return null;
6282 }, "~N");
6283 Clazz_defineMethod (c$, "removeAll", 
6284 function () {
6285 this.replace (0, this.getViewCount (), null);
6286 });
6287 Clazz_defineMethod (c$, "remove", 
6288 function (i) {
6289 this.replace (i, 1, null);
6290 }, "~N");
6291 Clazz_defineMethod (c$, "insert", 
6292 function (offs, v) {
6293 var one =  new Array (1);
6294 one[0] = v;
6295 this.replace (offs, 0, one);
6296 }, "~N,javax.swing.text.View");
6297 Clazz_defineMethod (c$, "append", 
6298 function (v) {
6299 var one =  new Array (1);
6300 one[0] = v;
6301 this.replace (this.getViewCount (), 0, one);
6302 }, "javax.swing.text.View");
6303 Clazz_defineMethod (c$, "replace", 
6304 function (offset, length, views) {
6305 }, "~N,~N,~A");
6306 Clazz_defineMethod (c$, "getViewIndex", 
6307 function (pos, b) {
6308 return -1;
6309 }, "~N,javax.swing.text.Position.Bias");
6310 Clazz_defineMethod (c$, "getChildAllocation", 
6311 function (index, a) {
6312 return null;
6313 }, "~N,java.awt.Shape");
6314 Clazz_defineMethod (c$, "getNextVisualPositionFrom", 
6315 function (pos, b, a, direction, biasRet) {
6316 biasRet[0] = javax.swing.text.Position.Bias.Forward;
6317 switch (direction) {
6318 case 1:
6319 case 5:
6320 {
6321 if (pos == -1) {
6322 pos = (direction == 1) ? Math.max (0, this.getEndOffset () - 1) : this.getStartOffset ();
6323 break;
6324 }var target = this.getContainer ();
6325 var c = (target != null) ? target.getCaret () : null;
6326 var mcp;
6327 if (c != null) {
6328 mcp = c.getMagicCaretPosition ();
6329 } else {
6330 mcp = null;
6331 }var x;
6332 if (mcp == null) {
6333 var loc = target.modelToView (pos);
6334 x = (loc == null) ? 0 : loc.x;
6335 } else {
6336 x = mcp.x;
6337 }if (direction == 1) {
6338 pos = javax.swing.text.Utilities.getPositionAbove (target, pos, x);
6339 } else {
6340 pos = javax.swing.text.Utilities.getPositionBelow (target, pos, x);
6341 }}break;
6342 case 7:
6343 if (pos == -1) {
6344 pos = Math.max (0, this.getEndOffset () - 1);
6345 } else {
6346 pos = Math.max (0, pos - 1);
6347 }break;
6348 case 3:
6349 if (pos == -1) {
6350 pos = this.getStartOffset ();
6351 } else {
6352 pos = Math.min (pos + 1, this.getDocument ().getLength ());
6353 }break;
6354 default:
6355 throw  new IllegalArgumentException ("Bad direction: " + direction);
6356 }
6357 return pos;
6358 }, "~N,javax.swing.text.Position.Bias,java.awt.Shape,~N,~A");
6359 Clazz_defineMethod (c$, "modelToView", 
6360 function (p0, b0, p1, b1, a) {
6361 var s0 = this.modelToView (p0, a, b0);
6362 var s1;
6363 if (p1 == this.getEndOffset ()) {
6364 try {
6365 s1 = this.modelToView (p1, a, b1);
6366 } catch (ble) {
6367 if (Clazz_exceptionOf (ble, javax.swing.text.BadLocationException)) {
6368 s1 = null;
6369 } else {
6370 throw ble;
6371 }
6372 }
6373 if (s1 == null) {
6374 var alloc = (Clazz_instanceOf (a, java.awt.Rectangle)) ? a : a.getBounds ();
6375 s1 =  new java.awt.Rectangle (alloc.x + alloc.width - 1, alloc.y, 1, alloc.height);
6376 }} else {
6377 s1 = this.modelToView (p1, a, b1);
6378 }var r0 = s0.getBounds ();
6379 var r1 = (Clazz_instanceOf (s1, java.awt.Rectangle)) ? s1 : s1.getBounds ();
6380 if (r0.y != r1.y) {
6381 var alloc = (Clazz_instanceOf (a, java.awt.Rectangle)) ? a : a.getBounds ();
6382 r0.x = alloc.x;
6383 r0.width = alloc.width;
6384 }r0.add (r1);
6385 return r0;
6386 }, "~N,javax.swing.text.Position.Bias,~N,javax.swing.text.Position.Bias,java.awt.Shape");
6387 Clazz_defineMethod (c$, "insertUpdate", 
6388 function (e, a, f) {
6389 if (this.getViewCount () > 0) {
6390 var elem = this.getElement ();
6391 var ec = e.getChange (elem);
6392 if (ec != null) {
6393 if (!this.updateChildren (ec, e, f)) {
6394 ec = null;
6395 }}this.forwardUpdate (ec, e, a, f);
6396 this.updateLayout (ec, e, a);
6397 }}, "javax.swing.event.DocumentEvent,java.awt.Shape,javax.swing.text.ViewFactory");
6398 Clazz_defineMethod (c$, "removeUpdate", 
6399 function (e, a, f) {
6400 if (this.getViewCount () > 0) {
6401 var elem = this.getElement ();
6402 var ec = e.getChange (elem);
6403 if (ec != null) {
6404 if (!this.updateChildren (ec, e, f)) {
6405 ec = null;
6406 }}this.forwardUpdate (ec, e, a, f);
6407 this.updateLayout (ec, e, a);
6408 }}, "javax.swing.event.DocumentEvent,java.awt.Shape,javax.swing.text.ViewFactory");
6409 Clazz_defineMethod (c$, "changedUpdate", 
6410 function (e, a, f) {
6411 if (this.getViewCount () > 0) {
6412 var elem = this.getElement ();
6413 var ec = e.getChange (elem);
6414 if (ec != null) {
6415 if (!this.updateChildren (ec, e, f)) {
6416 ec = null;
6417 }}this.forwardUpdate (ec, e, a, f);
6418 this.updateLayout (ec, e, a);
6419 }}, "javax.swing.event.DocumentEvent,java.awt.Shape,javax.swing.text.ViewFactory");
6420 Clazz_defineMethod (c$, "getDocument", 
6421 function () {
6422 return this.elem.getDocument ();
6423 });
6424 Clazz_defineMethod (c$, "getStartOffset", 
6425 function () {
6426 return this.elem.getStartOffset ();
6427 });
6428 Clazz_defineMethod (c$, "getEndOffset", 
6429 function () {
6430 return this.elem.getEndOffset ();
6431 });
6432 Clazz_defineMethod (c$, "getElement", 
6433 function () {
6434 return this.elem;
6435 });
6436 Clazz_defineMethod (c$, "getGraphics", 
6437 function () {
6438 var c = this.getContainer ();
6439 return c.getGraphics ();
6440 });
6441 Clazz_defineMethod (c$, "getAttributes", 
6442 function () {
6443 return this.elem.getAttributes ();
6444 });
6445 Clazz_defineMethod (c$, "breakView", 
6446 function (axis, offset, pos, len) {
6447 return this;
6448 }, "~N,~N,~N,~N");
6449 Clazz_defineMethod (c$, "createFragment", 
6450 function (p0, p1) {
6451 return this;
6452 }, "~N,~N");
6453 Clazz_defineMethod (c$, "getBreakWeight", 
6454 function (axis, pos, len) {
6455 if (len > this.getPreferredSpan (axis)) {
6456 return 1000;
6457 }return 0;
6458 }, "~N,~N,~N");
6459 Clazz_defineMethod (c$, "getResizeWeight", 
6460 function (axis) {
6461 return 0;
6462 }, "~N");
6463 Clazz_defineMethod (c$, "setSize", 
6464 function (width, height) {
6465 }, "~N,~N");
6466 Clazz_defineMethod (c$, "getContainer", 
6467 function () {
6468 var v = this.getParent ();
6469 return (v != null) ? v.getContainer () : null;
6470 });
6471 Clazz_defineMethod (c$, "getViewFactory", 
6472 function () {
6473 var v = this.getParent ();
6474 return (v != null) ? v.getViewFactory () : null;
6475 });
6476 Clazz_defineMethod (c$, "getToolTipText", 
6477 function (x, y, allocation) {
6478 var viewIndex = this.getViewIndex (x, y, allocation);
6479 if (viewIndex >= 0) {
6480 allocation = this.getChildAllocation (viewIndex, allocation);
6481 var rect = (Clazz_instanceOf (allocation, java.awt.Rectangle)) ? allocation : allocation.getBounds ();
6482 if (rect.contains (x, y)) {
6483 return this.getView (viewIndex).getToolTipText (x, y, allocation);
6484 }}return null;
6485 }, "~N,~N,java.awt.Shape");
6486 Clazz_defineMethod (c$, "getViewIndex", 
6487 function (x, y, allocation) {
6488 for (var counter = this.getViewCount () - 1; counter >= 0; counter--) {
6489 var childAllocation = this.getChildAllocation (counter, allocation);
6490 if (childAllocation != null) {
6491 var rect = (Clazz_instanceOf (childAllocation, java.awt.Rectangle)) ? childAllocation : childAllocation.getBounds ();
6492 if (rect.contains (x, y)) {
6493 return counter;
6494 }}}
6495 return -1;
6496 }, "~N,~N,java.awt.Shape");
6497 Clazz_defineMethod (c$, "updateChildren", 
6498 function (ec, e, f) {
6499 var removedElems = ec.getChildrenRemoved ();
6500 var addedElems = ec.getChildrenAdded ();
6501 var added = null;
6502 if (addedElems != null) {
6503 added =  new Array (addedElems.length);
6504 for (var i = 0; i < addedElems.length; i++) {
6505 added[i] = f.create (addedElems[i]);
6506 }
6507 }var nremoved = 0;
6508 var index = ec.getIndex ();
6509 if (removedElems != null) {
6510 nremoved = removedElems.length;
6511 }this.replace (index, nremoved, added);
6512 return true;
6513 }, "javax.swing.event.DocumentEvent.ElementChange,javax.swing.event.DocumentEvent,javax.swing.text.ViewFactory");
6514 Clazz_defineMethod (c$, "forwardUpdate", 
6515 function (ec, e, a, f) {
6516 var elem = this.getElement ();
6517 var pos = e.getOffset ();
6518 var index0 = this.getViewIndex (pos, javax.swing.text.Position.Bias.Forward);
6519 if (index0 == -1 && e.getType () === javax.swing.event.DocumentEvent.EventType.REMOVE && pos >= this.getEndOffset ()) {
6520 index0 = this.getViewCount () - 1;
6521 }var index1 = index0;
6522 var v = (index0 >= 0) ? this.getView (index0) : null;
6523 if (v != null) {
6524 if ((v.getStartOffset () == pos) && (pos > 0)) {
6525 index0 = Math.max (index0 - 1, 0);
6526 }}if (e.getType () !== javax.swing.event.DocumentEvent.EventType.REMOVE) {
6527 index1 = this.getViewIndex (pos + e.getLength (), javax.swing.text.Position.Bias.Forward);
6528 if (index1 < 0) {
6529 index1 = this.getViewCount () - 1;
6530 }}var hole0 = index1 + 1;
6531 var hole1 = hole0;
6532 var addedElems = (ec != null) ? ec.getChildrenAdded () : null;
6533 if ((addedElems != null) && (addedElems.length > 0)) {
6534 hole0 = ec.getIndex ();
6535 hole1 = hole0 + addedElems.length - 1;
6536 }index0 = Math.max (index0, 0);
6537 for (var i = index0; i <= index1; i++) {
6538 if (!((i >= hole0) && (i <= hole1))) {
6539 v = this.getView (i);
6540 if (v != null) {
6541 var childAlloc = this.getChildAllocation (i, a);
6542 this.forwardUpdateToView (v, e, childAlloc, f);
6543 }}}
6544 }, "javax.swing.event.DocumentEvent.ElementChange,javax.swing.event.DocumentEvent,java.awt.Shape,javax.swing.text.ViewFactory");
6545 Clazz_defineMethod (c$, "forwardUpdateToView", 
6546 function (v, e, a, f) {
6547 var type = e.getType ();
6548 if (type === javax.swing.event.DocumentEvent.EventType.INSERT) {
6549 v.insertUpdate (e, a, f);
6550 } else if (type === javax.swing.event.DocumentEvent.EventType.REMOVE) {
6551 v.removeUpdate (e, a, f);
6552 } else {
6553 v.changedUpdate (e, a, f);
6554 }}, "javax.swing.text.View,javax.swing.event.DocumentEvent,java.awt.Shape,javax.swing.text.ViewFactory");
6555 Clazz_defineMethod (c$, "updateLayout", 
6556 function (ec, e, a) {
6557 if ((ec != null) && (a != null)) {
6558 this.preferenceChanged (null, true, true);
6559 var host = this.getContainer ();
6560 if (host != null) {
6561 host.repaint ();
6562 }}}, "javax.swing.event.DocumentEvent.ElementChange,javax.swing.event.DocumentEvent,java.awt.Shape");
6563 Clazz_defineMethod (c$, "modelToView", 
6564 function (pos, a) {
6565 return this.modelToView (pos, a, javax.swing.text.Position.Bias.Forward);
6566 }, "~N,java.awt.Shape");
6567 Clazz_defineMethod (c$, "viewToModel", 
6568 function (x, y, a) {
6569 javax.swing.text.View.sharedBiasReturn[0] = javax.swing.text.Position.Bias.Forward;
6570 return this.viewToModel (x, y, a, javax.swing.text.View.sharedBiasReturn);
6571 }, "~N,~N,java.awt.Shape");
6572 Clazz_defineStatics (c$,
6573 "BadBreakWeight", 0,
6574 "GoodBreakWeight", 1000,
6575 "ExcellentBreakWeight", 2000,
6576 "ForcedBreakWeight", 3000,
6577 "X_AXIS", 0,
6578 "Y_AXIS", 1);
6579 c$.sharedBiasReturn = c$.prototype.sharedBiasReturn =  new Array (1);
6580 });
6581 Clazz_declarePackage ("javax.swing.text");
6582 Clazz_declareInterface (javax.swing.text, "Position");
6583 Clazz_pu$h(self.c$);
6584 c$ = Clazz_decorateAsClass (function () {
6585 this.name = null;
6586 Clazz_instantialize (this, arguments);
6587 }, javax.swing.text.Position, "Bias");
6588 Clazz_overrideMethod (c$, "toString", 
6589 function () {
6590 return this.name;
6591 });
6592 Clazz_makeConstructor (c$, 
6593  function (a) {
6594 this.name = a;
6595 }, "~S");
6596 c$.Forward = c$.prototype.Forward =  new javax.swing.text.Position.Bias ("Forward");
6597 c$.Backward = c$.prototype.Backward =  new javax.swing.text.Position.Bias ("Backward");
6598 c$ = Clazz_p0p ();
6599 Clazz_declarePackage ("javax.swing.text");
6600 Clazz_load (["javax.swing.text.Document"], "javax.swing.text.StyledDocument", null, function () {
6601 Clazz_declareInterface (javax.swing.text, "StyledDocument", javax.swing.text.Document);
6602 });
6603 Clazz_declarePackage ("javax.swing.text");
6604 Clazz_load (["javax.swing.text.Highlighter", "$.LayeredHighlighter", "java.util.Vector"], "javax.swing.text.DefaultHighlighter", ["java.awt.Rectangle", "javax.swing.SwingUtilities", "javax.swing.text.LayeredHighlighter.LayerPainter", "javax.swing.text.Position"], function () {
6605 c$ = Clazz_decorateAsClass (function () {
6606 this.highlights = null;
6607 this.component = null;
6608 this.drawsLayeredHighlights = false;
6609 this.safeDamager = null;
6610 if (!Clazz_isClassDefined ("javax.swing.text.DefaultHighlighter.HighlightInfo")) {
6611 javax.swing.text.DefaultHighlighter.$DefaultHighlighter$HighlightInfo$ ();
6612 }
6613 if (!Clazz_isClassDefined ("javax.swing.text.DefaultHighlighter.LayeredHighlightInfo")) {
6614 javax.swing.text.DefaultHighlighter.$DefaultHighlighter$LayeredHighlightInfo$ ();
6615 }
6616 if (!Clazz_isClassDefined ("javax.swing.text.DefaultHighlighter.SafeDamager")) {
6617 javax.swing.text.DefaultHighlighter.$DefaultHighlighter$SafeDamager$ ();
6618 }
6619 Clazz_instantialize (this, arguments);
6620 }, javax.swing.text, "DefaultHighlighter", javax.swing.text.LayeredHighlighter);
6621 Clazz_prepareFields (c$, function () {
6622 this.highlights =  new java.util.Vector ();
6623 this.safeDamager = Clazz_innerTypeInstance (javax.swing.text.DefaultHighlighter.SafeDamager, this, null);
6624 });
6625 Clazz_makeConstructor (c$, 
6626 function () {
6627 Clazz_superConstructor (this, javax.swing.text.DefaultHighlighter, []);
6628 this.drawsLayeredHighlights = true;
6629 });
6630 Clazz_overrideMethod (c$, "paint", 
6631 function (g) {
6632 var len = this.highlights.size ();
6633 for (var i = 0; i < len; i++) {
6634 var info = this.highlights.elementAt (i);
6635 if (!(Clazz_instanceOf (info, javax.swing.text.DefaultHighlighter.LayeredHighlightInfo))) {
6636 var a = this.component.getBounds ();
6637 var insets = this.component.getInsets ();
6638 a.x = insets.left;
6639 a.y = insets.top;
6640 a.width -= insets.left + insets.right;
6641 a.height -= insets.top + insets.bottom;
6642 for (; i < len; i++) {
6643 info = this.highlights.elementAt (i);
6644 if (!(Clazz_instanceOf (info, javax.swing.text.DefaultHighlighter.LayeredHighlightInfo))) {
6645 var p = info.getPainter ();
6646 p.paint (g, info.getStartOffset (), info.getEndOffset (), a, this.component);
6647 }}
6648 }}
6649 }, "java.awt.Graphics");
6650 Clazz_overrideMethod (c$, "install", 
6651 function (c) {
6652 this.component = c;
6653 this.removeAllHighlights ();
6654 }, "javax.swing.text.JTextComponent");
6655 Clazz_overrideMethod (c$, "deinstall", 
6656 function (c) {
6657 this.component = null;
6658 }, "javax.swing.text.JTextComponent");
6659 Clazz_overrideMethod (c$, "addHighlight", 
6660 function (p0, p1, p) {
6661 var doc = this.component.getDocument ();
6662 var i = (this.getDrawsLayeredHighlights () && (Clazz_instanceOf (p, javax.swing.text.LayeredHighlighter.LayerPainter))) ? Clazz_innerTypeInstance (javax.swing.text.DefaultHighlighter.LayeredHighlightInfo, this, null) : Clazz_innerTypeInstance (javax.swing.text.DefaultHighlighter.HighlightInfo, this, null);
6663 i.painter = p;
6664 i.p0 = doc.createPosition (p0);
6665 i.p1 = doc.createPosition (p1);
6666 this.highlights.addElement (i);
6667 this.safeDamageRange (p0, p1);
6668 return i;
6669 }, "~N,~N,javax.swing.text.Highlighter.HighlightPainter");
6670 Clazz_overrideMethod (c$, "removeHighlight", 
6671 function (tag) {
6672 if (Clazz_instanceOf (tag, javax.swing.text.DefaultHighlighter.LayeredHighlightInfo)) {
6673 var lhi = tag;
6674 if (lhi.width > 0 && lhi.height > 0) {
6675 this.component.repaint (lhi.x, lhi.y, lhi.width, lhi.height);
6676 }} else {
6677 var info = tag;
6678 this.safeDamageRange (info.p0, info.p1);
6679 }this.highlights.removeElement (tag);
6680 }, "~O");
6681 Clazz_overrideMethod (c$, "removeAllHighlights", 
6682 function () {
6683 var mapper = this.component.getUI ();
6684 if (this.getDrawsLayeredHighlights ()) {
6685 var len = this.highlights.size ();
6686 if (len != 0) {
6687 var minX = 0;
6688 var minY = 0;
6689 var maxX = 0;
6690 var maxY = 0;
6691 var p0 = -1;
6692 var p1 = -1;
6693 for (var i = 0; i < len; i++) {
6694 var hi = this.highlights.elementAt (i);
6695 if (Clazz_instanceOf (hi, javax.swing.text.DefaultHighlighter.LayeredHighlightInfo)) {
6696 var info = hi;
6697 minX = Math.min (minX, info.x);
6698 minY = Math.min (minY, info.y);
6699 maxX = Math.max (maxX, info.x + info.width);
6700 maxY = Math.max (maxY, info.y + info.height);
6701 } else {
6702 if (p0 == -1) {
6703 p0 = hi.p0.getOffset ();
6704 p1 = hi.p1.getOffset ();
6705 } else {
6706 p0 = Math.min (p0, hi.p0.getOffset ());
6707 p1 = Math.max (p1, hi.p1.getOffset ());
6708 }}}
6709 if (minX != maxX && minY != maxY) {
6710 this.component.repaint (minX, minY, maxX - minX, maxY - minY);
6711 }if (p0 != -1) {
6712 try {
6713 this.safeDamageRange (p0, p1);
6714 } catch (e) {
6715 if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
6716 } else {
6717 throw e;
6718 }
6719 }
6720 }this.highlights.removeAllElements ();
6721 }} else if (mapper != null) {
6722 var len = this.highlights.size ();
6723 if (len != 0) {
6724 var p0 = 2147483647;
6725 var p1 = 0;
6726 for (var i = 0; i < len; i++) {
6727 var info = this.highlights.elementAt (i);
6728 p0 = Math.min (p0, info.p0.getOffset ());
6729 p1 = Math.max (p1, info.p1.getOffset ());
6730 }
6731 try {
6732 this.safeDamageRange (p0, p1);
6733 } catch (e) {
6734 if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
6735 } else {
6736 throw e;
6737 }
6738 }
6739 this.highlights.removeAllElements ();
6740 }}});
6741 Clazz_overrideMethod (c$, "changeHighlight", 
6742 function (tag, p0, p1) {
6743 var doc = this.component.getDocument ();
6744 if (Clazz_instanceOf (tag, javax.swing.text.DefaultHighlighter.LayeredHighlightInfo)) {
6745 var lhi = tag;
6746 if (lhi.width > 0 && lhi.height > 0) {
6747 this.component.repaint (lhi.x, lhi.y, lhi.width, lhi.height);
6748 }lhi.width = lhi.height = 0;
6749 lhi.p0 = doc.createPosition (p0);
6750 lhi.p1 = doc.createPosition (p1);
6751 this.safeDamageRange (Math.min (p0, p1), Math.max (p0, p1));
6752 } else {
6753 var info = tag;
6754 var oldP0 = info.p0.getOffset ();
6755 var oldP1 = info.p1.getOffset ();
6756 if (p0 == oldP0) {
6757 this.safeDamageRange (Math.min (oldP1, p1), Math.max (oldP1, p1));
6758 } else if (p1 == oldP1) {
6759 this.safeDamageRange (Math.min (p0, oldP0), Math.max (p0, oldP0));
6760 } else {
6761 this.safeDamageRange (oldP0, oldP1);
6762 this.safeDamageRange (p0, p1);
6763 }info.p0 = doc.createPosition (p0);
6764 info.p1 = doc.createPosition (p1);
6765 }}, "~O,~N,~N");
6766 Clazz_overrideMethod (c$, "getHighlights", 
6767 function () {
6768 var size = this.highlights.size ();
6769 if (size == 0) {
6770 return javax.swing.text.DefaultHighlighter.noHighlights;
6771 }var h =  new Array (size);
6772 this.highlights.copyInto (h);
6773 return h;
6774 });
6775 Clazz_overrideMethod (c$, "paintLayeredHighlights", 
6776 function (g, p0, p1, viewBounds, editor, view) {
6777 for (var counter = this.highlights.size () - 1; counter >= 0; counter--) {
6778 var tag = this.highlights.elementAt (counter);
6779 if (Clazz_instanceOf (tag, javax.swing.text.DefaultHighlighter.LayeredHighlightInfo)) {
6780 var lhi = tag;
6781 var start = lhi.getStartOffset ();
6782 var end = lhi.getEndOffset ();
6783 if ((p0 < start && p1 > start) || (p0 >= start && p0 < end)) {
6784 lhi.paintLayeredHighlights (g, p0, p1, viewBounds, editor, view);
6785 }}}
6786 }, "java.awt.Graphics,~N,~N,java.awt.Shape,javax.swing.text.JTextComponent,javax.swing.text.View");
6787 Clazz_defineMethod (c$, "safeDamageRange", 
6788  function (p0, p1) {
6789 this.safeDamager.damageRange (p0, p1);
6790 }, "javax.swing.text.Position,javax.swing.text.Position");
6791 Clazz_defineMethod (c$, "safeDamageRange", 
6792  function (a0, a1) {
6793 var doc = this.component.getDocument ();
6794 this.safeDamageRange (doc.createPosition (a0), doc.createPosition (a1));
6795 }, "~N,~N");
6796 Clazz_defineMethod (c$, "setDrawsLayeredHighlights", 
6797 function (newValue) {
6798 this.drawsLayeredHighlights = newValue;
6799 }, "~B");
6800 Clazz_defineMethod (c$, "getDrawsLayeredHighlights", 
6801 function () {
6802 return this.drawsLayeredHighlights;
6803 });
6804 c$.$DefaultHighlighter$HighlightInfo$ = function () {
6805 Clazz_pu$h(self.c$);
6806 c$ = Clazz_decorateAsClass (function () {
6807 Clazz_prepareCallback (this, arguments);
6808 this.p0 = null;
6809 this.p1 = null;
6810 this.painter = null;
6811 Clazz_instantialize (this, arguments);
6812 }, javax.swing.text.DefaultHighlighter, "HighlightInfo", null, javax.swing.text.Highlighter.Highlight);
6813 Clazz_overrideMethod (c$, "getStartOffset", 
6814 function () {
6815 return this.p0.getOffset ();
6816 });
6817 Clazz_overrideMethod (c$, "getEndOffset", 
6818 function () {
6819 return this.p1.getOffset ();
6820 });
6821 Clazz_overrideMethod (c$, "getPainter", 
6822 function () {
6823 return this.painter;
6824 });
6825 c$ = Clazz_p0p ();
6826 };
6827 c$.$DefaultHighlighter$LayeredHighlightInfo$ = function () {
6828 Clazz_pu$h(self.c$);
6829 c$ = Clazz_decorateAsClass (function () {
6830 Clazz_prepareCallback (this, arguments);
6831 this.x = 0;
6832 this.y = 0;
6833 this.width = 0;
6834 this.height = 0;
6835 Clazz_instantialize (this, arguments);
6836 }, javax.swing.text.DefaultHighlighter, "LayeredHighlightInfo", javax.swing.text.DefaultHighlighter.HighlightInfo, null, Clazz_innerTypeInstance (javax.swing.text.DefaultHighlighter.HighlightInfo, this, null, Clazz_inheritArgs));
6837 Clazz_defineMethod (c$, "union", 
6838 function (a) {
6839 if (a == null) return;
6840 var b;
6841 if (Clazz_instanceOf (a, java.awt.Rectangle)) {
6842 b = a;
6843 } else {
6844 b = a.getBounds ();
6845 }if (this.width == 0 || this.height == 0) {
6846 this.x = b.x;
6847 this.y = b.y;
6848 this.width = b.width;
6849 this.height = b.height;
6850 } else {
6851 this.width = Math.max (this.x + this.width, b.x + b.width);
6852 this.height = Math.max (this.y + this.height, b.y + b.height);
6853 this.x = Math.min (this.x, b.x);
6854 this.width -= this.x;
6855 this.y = Math.min (this.y, b.y);
6856 this.height -= this.y;
6857 }}, "java.awt.Shape");
6858 Clazz_defineMethod (c$, "paintLayeredHighlights", 
6859 function (a, b, c, d, e, f) {
6860 var g = this.getStartOffset ();
6861 var h = this.getEndOffset ();
6862 b = Math.max (g, b);
6863 c = Math.min (h, c);
6864 this.union ((this.painter).paintLayer (a, b, c, d, e, f));
6865 }, "java.awt.Graphics,~N,~N,java.awt.Shape,javax.swing.text.JTextComponent,javax.swing.text.View");
6866 c$ = Clazz_p0p ();
6867 };
6868 c$.$DefaultHighlighter$SafeDamager$ = function () {
6869 Clazz_pu$h(self.c$);
6870 c$ = Clazz_decorateAsClass (function () {
6871 Clazz_prepareCallback (this, arguments);
6872 this.p0 = null;
6873 this.p1 = null;
6874 this.lastDoc = null;
6875 Clazz_instantialize (this, arguments);
6876 }, javax.swing.text.DefaultHighlighter, "SafeDamager", null, Runnable);
6877 Clazz_prepareFields (c$, function () {
6878 this.p0 =  new java.util.Vector (10);
6879 this.p1 =  new java.util.Vector (10);
6880 });
6881 Clazz_overrideMethod (c$, "run", 
6882 function () {
6883 if (this.b$["javax.swing.text.DefaultHighlighter"].component != null) {
6884 var a = this.b$["javax.swing.text.DefaultHighlighter"].component.getUI ();
6885 if (a != null && this.lastDoc === this.b$["javax.swing.text.DefaultHighlighter"].component.getDocument ()) {
6886 var b = this.p0.size ();
6887 for (var c = 0; c < b; c++) {
6888 a.damageRange (this.b$["javax.swing.text.DefaultHighlighter"].component, (this.p0.get (c)).getOffset (), (this.p1.get (c)).getOffset ());
6889 }
6890 }}this.p0.clear ();
6891 this.p1.clear ();
6892 this.lastDoc = null;
6893 });
6894 Clazz_defineMethod (c$, "damageRange", 
6895 function (a, b) {
6896 if (this.b$["javax.swing.text.DefaultHighlighter"].component == null) {
6897 this.p0.clear ();
6898 this.lastDoc = null;
6899 return;
6900 }var c = this.p0.isEmpty ();
6901 var d = this.b$["javax.swing.text.DefaultHighlighter"].component.getDocument ();
6902 if (d !== this.lastDoc) {
6903 if (!this.p0.isEmpty ()) {
6904 this.p0.clear ();
6905 this.p1.clear ();
6906 }this.lastDoc = d;
6907 }this.p0.add (a);
6908 this.p1.add (b);
6909 if (c) {
6910 javax.swing.SwingUtilities.invokeLater (this);
6911 }}, "javax.swing.text.Position,javax.swing.text.Position");
6912 c$ = Clazz_p0p ();
6913 };
6914 Clazz_pu$h(self.c$);
6915 c$ = Clazz_decorateAsClass (function () {
6916 this.color = null;
6917 Clazz_instantialize (this, arguments);
6918 }, javax.swing.text.DefaultHighlighter, "DefaultHighlightPainter", javax.swing.text.LayeredHighlighter.LayerPainter);
6919 Clazz_makeConstructor (c$, 
6920 function (a) {
6921 Clazz_superConstructor (this, javax.swing.text.DefaultHighlighter.DefaultHighlightPainter, []);
6922 this.color = a;
6923 }, "java.awt.Color");
6924 Clazz_defineMethod (c$, "getColor", 
6925 function () {
6926 return this.color;
6927 });
6928 Clazz_overrideMethod (c$, "paint", 
6929 function (a, b, c, d, e) {
6930 var f = d.getBounds ();
6931 try {
6932 var g = e.getUI ();
6933 var h = g.modelToView (e, b);
6934 var i = g.modelToView (e, c);
6935 var j = this.getColor ();
6936 if (j == null) {
6937 a.setColor (e.getSelectionColor ());
6938 } else {
6939 a.setColor (j);
6940 }if (h.y == i.y) {
6941 var k = h.union (i);
6942 a.fillRect (k.x, k.y, k.width, k.height);
6943 } else {
6944 var k = f.x + f.width - h.x;
6945 a.fillRect (h.x, h.y, k, h.height);
6946 if ((h.y + h.height) != i.y) {
6947 a.fillRect (f.x, h.y + h.height, f.width, i.y - (h.y + h.height));
6948 }a.fillRect (f.x, i.y, (i.x - f.x), i.height);
6949 }} catch (e) {
6950 if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
6951 } else {
6952 throw e;
6953 }
6954 }
6955 }, "java.awt.Graphics,~N,~N,java.awt.Shape,javax.swing.text.JTextComponent");
6956 Clazz_overrideMethod (c$, "paintLayer", 
6957 function (a, b, c, d, e, f) {
6958 var g = this.getColor ();
6959 if (g == null) {
6960 a.setColor (e.getSelectionColor ());
6961 } else {
6962 a.setColor (g);
6963 }var h;
6964 if (b == f.getStartOffset () && c == f.getEndOffset ()) {
6965 if (Clazz_instanceOf (d, java.awt.Rectangle)) {
6966 h = d;
6967 } else {
6968 h = d.getBounds ();
6969 }} else {
6970 try {
6971 var i = f.modelToView (b, javax.swing.text.Position.Bias.Forward, c, javax.swing.text.Position.Bias.Backward, d);
6972 h = (Clazz_instanceOf (i, java.awt.Rectangle)) ? i : i.getBounds ();
6973 } catch (e) {
6974 if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
6975 h = null;
6976 } else {
6977 throw e;
6978 }
6979 }
6980 }if (h != null) {
6981 h.width = Math.max (h.width, 1);
6982 a.fillRect (h.x, h.y, h.width, h.height);
6983 }return h;
6984 }, "java.awt.Graphics,~N,~N,java.awt.Shape,javax.swing.text.JTextComponent,javax.swing.text.View");
6985 c$ = Clazz_p0p ();
6986 c$.noHighlights = c$.prototype.noHighlights =  new Array (0);
6987 c$.DefaultPainter = c$.prototype.DefaultPainter =  new javax.swing.text.DefaultHighlighter.DefaultHighlightPainter (null);
6988 });
6989 Clazz_declarePackage ("javax.swing.text");
6990 Clazz_declareInterface (javax.swing.text, "Highlighter");
6991 Clazz_declareInterface (javax.swing.text.Highlighter, "HighlightPainter");
6992 Clazz_declareInterface (javax.swing.text.Highlighter, "Highlight");
6993 Clazz_declarePackage ("javax.swing.text");
6994 Clazz_load (["javax.swing.text.Highlighter"], "javax.swing.text.LayeredHighlighter", null, function () {
6995 c$ = Clazz_declareType (javax.swing.text, "LayeredHighlighter", null, javax.swing.text.Highlighter);
6996 Clazz_pu$h(self.c$);
6997 c$ = Clazz_declareType (javax.swing.text.LayeredHighlighter, "LayerPainter", null, javax.swing.text.Highlighter.HighlightPainter);
6998 c$ = Clazz_p0p ();
6999 });
7000 Clazz_declarePackage ("swingjs");
7001 Clazz_load (["swingjs.JSAbstractDocument"], "swingjs.JSPlainDocument", ["java.util.Hashtable", "JU.SB", "swingjs.JSPosition"], function () {
7002 c$ = Clazz_declareType (swingjs, "JSPlainDocument", swingjs.JSAbstractDocument);
7003 Clazz_makeConstructor (c$, 
7004 function () {
7005 Clazz_superConstructor (this, swingjs.JSPlainDocument);
7006 this.sb =  new JU.SB ();
7007 this.root = Clazz_innerTypeInstance (swingjs.JSAbstractDocument.JSElement, this, null);
7008 });
7009 Clazz_overrideMethod (c$, "getLength", 
7010 function () {
7011 return this.sb.length ();
7012 });
7013 Clazz_defineMethod (c$, "getText", 
7014 function (offset, length) {
7015 this.checkLoc (offset, offset + length);
7016 return this.sb.substring2 (offset, offset + length);
7017 }, "~N,~N");
7018 Clazz_defineMethod (c$, "getText", 
7019 function (offset, length, chars) {
7020 this.checkLoc (offset, offset + length);
7021 if (this.tempChar == null) {
7022 this.tempChar =  Clazz_newCharArray (this.sb.length (), '\0');
7023 for (var i = this.tempChar.length; --i >= 0; ) this.tempChar[i] = this.sb.charAt (i);
7024
7025 }chars.array = this.tempChar;
7026 chars.offset = offset;
7027 chars.count = length;
7028 }, "~N,~N,javax.swing.text.Segment");
7029 Clazz_overrideMethod (c$, "getStartPosition", 
7030 function () {
7031 return  new swingjs.JSPosition (0);
7032 });
7033 Clazz_overrideMethod (c$, "getEndPosition", 
7034 function () {
7035 return  new swingjs.JSPosition (this.sb.length ());
7036 });
7037 Clazz_overrideMethod (c$, "createPosition", 
7038 function (offs) {
7039 this.checkLoc (offs, offs);
7040 var i = Integer.$valueOf (offs);
7041 if (this.positions == null) this.positions =  new java.util.Hashtable ();
7042 var p = this.positions.get (i);
7043 if (p == null) this.positions.put (i, p =  new swingjs.JSPosition (offs));
7044 return p;
7045 }, "~N");
7046 Clazz_overrideMethod (c$, "getDefaultRootElement", 
7047 function () {
7048 return this.root;
7049 });
7050 Clazz_overrideMethod (c$, "render", 
7051 function (r) {
7052 }, "Runnable");
7053 Clazz_defineStatics (c$,
7054 "tabSizeAttribute", "tabSize",
7055 "lineLimitAttribute", "lineLimit");
7056 });
7057 Clazz_declarePackage ("swingjs");
7058 Clazz_load (["javax.swing.text.DocumentFilter", "$.Element", "$.JSMinimalAbstractDocument"], "swingjs.JSAbstractDocument", ["java.lang.IllegalStateException", "java.util.HashMap", "JU.AU", "javax.swing.event.DocumentEvent", "$.DocumentListener", "$.EventListenerList", "javax.swing.text.BadLocationException", "swingjs.JSDocumentEvent"], function () {
7059 c$ = Clazz_decorateAsClass (function () {
7060 this.props = null;
7061 this.root = null;
7062 this.positions = null;
7063 this.listenerList = null;
7064 this.notifyingListeners = false;
7065 this.filterBypass = null;
7066 this.me = null;
7067 this.sb = null;
7068 this.tempChar = null;
7069 this.filter = null;
7070 if (!Clazz_isClassDefined ("swingjs.JSAbstractDocument.DefaultFilterBypass")) {
7071 swingjs.JSAbstractDocument.$JSAbstractDocument$DefaultFilterBypass$ ();
7072 }
7073 if (!Clazz_isClassDefined ("swingjs.JSAbstractDocument.JSElement")) {
7074 swingjs.JSAbstractDocument.$JSAbstractDocument$JSElement$ ();
7075 }
7076 Clazz_instantialize (this, arguments);
7077 }, swingjs, "JSAbstractDocument", null, javax.swing.text.JSMinimalAbstractDocument);
7078 Clazz_makeConstructor (c$, 
7079 function () {
7080 this.me = this;
7081 this.props =  new java.util.HashMap ();
7082 });
7083 Clazz_overrideMethod (c$, "getRootElements", 
7084 function () {
7085 return  Clazz_newArray (-1, [this.root, null]);
7086 });
7087 Clazz_defineMethod (c$, "checkLoc", 
7088 function (start, end) {
7089 if (start < 0 || end > this.getLength ()) throw  new javax.swing.text.BadLocationException ("JSAbstractDocument: out of range", (start < 0 ? start : end));
7090 }, "~N,~N");
7091 Clazz_defineMethod (c$, "fixPositions", 
7092 function (offset, length, isInsert) {
7093 if (this.positions == null || this.positions.isEmpty ()) return;
7094 if (isInsert) {
7095 for (var i, $i = this.positions.keySet ().iterator (); $i.hasNext () && ((i = $i.next ()) || true);) {
7096 var pos = i.intValue ();
7097 if (pos > offset) this.positions.get (i).pos += length;
7098 }
7099 return;
7100 }for (var i, $i = this.positions.keySet ().iterator (); $i.hasNext () && ((i = $i.next ()) || true);) {
7101 var pos = i.intValue ();
7102 if (pos <= offset) continue;
7103 if (pos >= offset + length) this.positions.get (i).pos -= length;
7104  else this.positions.get (i).pos = offset;
7105 }
7106 }, "~N,~N,~B");
7107 Clazz_defineMethod (c$, "getFilterBypass", 
7108  function () {
7109 if (this.filterBypass == null) {
7110 this.filterBypass = Clazz_innerTypeInstance (swingjs.JSAbstractDocument.DefaultFilterBypass, this, null);
7111 }return this.filterBypass;
7112 });
7113 Clazz_overrideMethod (c$, "remove", 
7114 function (offs, len) {
7115 var filter = this.getDocumentFilter ();
7116 if (filter == null) this.handleRemove (offs, len);
7117  else filter.remove (this.getFilterBypass (), offs, len);
7118 }, "~N,~N");
7119 Clazz_overrideMethod (c$, "insertString", 
7120 function (offset, str, a) {
7121 var filter = this.getDocumentFilter ();
7122 if (filter == null) this.handleInsertString (offset, str, a);
7123  else filter.insertString (this.getFilterBypass (), offset, str, a);
7124 }, "~N,~S,javax.swing.text.AttributeSet");
7125 Clazz_overrideMethod (c$, "replace", 
7126 function (offset, length, text, attrs) {
7127 if (length == 0 && (text == null || text.length == 0)) return;
7128 var filter = this.getDocumentFilter ();
7129 if (filter != null) {
7130 filter.replace (this.getFilterBypass (), offset, length, text, attrs);
7131 } else {
7132 if (length > 0) this.remove (offset, length);
7133 if (text != null && text.length > 0) this.insertString (offset, text, attrs);
7134 }}, "~N,~N,~S,javax.swing.text.AttributeSet");
7135 Clazz_defineMethod (c$, "taint", 
7136  function () {
7137 this.tempChar = null;
7138 });
7139 Clazz_defineMethod (c$, "setLines", 
7140  function () {
7141 this.root = Clazz_innerTypeInstance (swingjs.JSAbstractDocument.JSElement, this, null);
7142 var s = this.sb.toString ();
7143 if (s.lastIndexOf ('\n') != s.length - 1) s += "\n";
7144 var ilast = 0;
7145 for (var i = 0; i < s.length; i++) {
7146 if (s.charAt (i) != '\n') continue;
7147 var e = Clazz_innerTypeInstance (swingjs.JSAbstractDocument.JSElement, this, null);
7148 e.start = ilast;
7149 e.end = i;
7150 ilast = i + 1;
7151 this.root.addChild (e);
7152 }
7153 });
7154 Clazz_defineMethod (c$, "handleInsertString", 
7155 function (offs, str, a) {
7156 if ((str == null) || (str.length == 0)) {
7157 return;
7158 }this.checkLoc (offs, offs);
7159 this.taint ();
7160 this.sb.insert (offs, str);
7161 this.fixPositions (offs, str.length, true);
7162 if (str.indexOf ('\n') >= 0) this.setLines ();
7163 var e =  new swingjs.JSDocumentEvent (this, offs, str.length, javax.swing.event.DocumentEvent.EventType.INSERT);
7164 this.fireInsertUpdate (e);
7165 }, "~N,~S,javax.swing.text.AttributeSet");
7166 Clazz_defineMethod (c$, "handleRemove", 
7167 function (offs, len) {
7168 this.checkLoc (offs, offs + len);
7169 this.taint ();
7170 var str = this.sb.substring2 (offs, offs + len);
7171 this.sb.replace (offs, offs + len, "");
7172 this.fixPositions (offs, offs + len, false);
7173 if (str.indexOf ('\n') >= 0) this.setLines ();
7174 if (len > 0) {
7175 var chng =  new swingjs.JSDocumentEvent (this, offs, len, javax.swing.event.DocumentEvent.EventType.REMOVE);
7176 this.fireRemoveUpdate (chng);
7177 }}, "~N,~N");
7178 Clazz_defineMethod (c$, "fireInsertUpdate", 
7179 function (e) {
7180 if (this.listenerList == null) return;
7181 this.checkAlreadyNotifying ();
7182 this.notifyingListeners = true;
7183 try {
7184 var listeners = this.listenerList.getListenerList ();
7185 for (var i = listeners.length - 2; i >= 0; i -= 2) {
7186 if (listeners[i] === javax.swing.event.DocumentListener) {
7187 (listeners[i + 1]).insertUpdate (e);
7188 }}
7189 } finally {
7190 this.notifyingListeners = false;
7191 }
7192 }, "javax.swing.event.DocumentEvent");
7193 Clazz_defineMethod (c$, "fireChangedUpdate", 
7194 function (e) {
7195 if (this.listenerList == null) return;
7196 this.checkAlreadyNotifying ();
7197 this.notifyingListeners = true;
7198 try {
7199 var listeners = this.listenerList.getListenerList ();
7200 for (var i = listeners.length - 2; i >= 0; i -= 2) {
7201 if (listeners[i] === javax.swing.event.DocumentListener) {
7202 (listeners[i + 1]).changedUpdate (e);
7203 }}
7204 } finally {
7205 this.notifyingListeners = false;
7206 }
7207 }, "javax.swing.event.DocumentEvent");
7208 Clazz_defineMethod (c$, "fireRemoveUpdate", 
7209 function (e) {
7210 if (this.listenerList == null) return;
7211 this.checkAlreadyNotifying ();
7212 this.notifyingListeners = true;
7213 try {
7214 var listeners = this.listenerList.getListenerList ();
7215 for (var i = listeners.length - 2; i >= 0; i -= 2) {
7216 if (listeners[i] === javax.swing.event.DocumentListener) {
7217 (listeners[i + 1]).removeUpdate (e);
7218 }}
7219 } finally {
7220 this.notifyingListeners = false;
7221 }
7222 }, "javax.swing.event.DocumentEvent");
7223 Clazz_defineMethod (c$, "checkAlreadyNotifying", 
7224  function () {
7225 if (this.notifyingListeners) throw  new IllegalStateException ("One of the document listeners modifed the document. This is not allowed.");
7226 });
7227 Clazz_overrideMethod (c$, "addDocumentListener", 
7228 function (listener) {
7229 if (this.listenerList == null) this.listenerList =  new javax.swing.event.EventListenerList ();
7230 this.listenerList.add (javax.swing.event.DocumentListener, listener);
7231 }, "javax.swing.event.DocumentListener");
7232 Clazz_overrideMethod (c$, "removeDocumentListener", 
7233 function (listener) {
7234 if (this.listenerList != null) this.listenerList.remove (javax.swing.event.DocumentListener, listener);
7235 }, "javax.swing.event.DocumentListener");
7236 Clazz_overrideMethod (c$, "addUndoableEditListener", 
7237 function (listener) {
7238 }, "javax.swing.event.UndoableEditListener");
7239 Clazz_overrideMethod (c$, "removeUndoableEditListener", 
7240 function (listener) {
7241 }, "javax.swing.event.UndoableEditListener");
7242 Clazz_overrideMethod (c$, "getProperty", 
7243 function (key) {
7244 return this.props.get (key);
7245 }, "~O");
7246 Clazz_overrideMethod (c$, "putProperty", 
7247 function (key, value) {
7248 this.props.put (key, value);
7249 }, "~O,~O");
7250 Clazz_overrideMethod (c$, "getAsynchronousLoadPriority", 
7251 function () {
7252 return -1;
7253 });
7254 Clazz_overrideMethod (c$, "setDocumentFilter", 
7255 function (filter) {
7256 this.filter = filter;
7257 }, "javax.swing.text.DocumentFilter");
7258 Clazz_defineMethod (c$, "getDocumentFilter", 
7259 function () {
7260 return this.filter;
7261 });
7262 c$.$JSAbstractDocument$DefaultFilterBypass$ = function () {
7263 Clazz_pu$h(self.c$);
7264 c$ = Clazz_decorateAsClass (function () {
7265 Clazz_prepareCallback (this, arguments);
7266 Clazz_instantialize (this, arguments);
7267 }, swingjs.JSAbstractDocument, "DefaultFilterBypass", javax.swing.text.DocumentFilter.FilterBypass);
7268 Clazz_overrideMethod (c$, "getDocument", 
7269 function () {
7270 return this.b$["swingjs.JSAbstractDocument"].me;
7271 });
7272 Clazz_overrideMethod (c$, "remove", 
7273 function (a, b) {
7274 this.b$["swingjs.JSAbstractDocument"].handleRemove (a, b);
7275 }, "~N,~N");
7276 Clazz_overrideMethod (c$, "insertString", 
7277 function (a, b, c) {
7278 this.b$["swingjs.JSAbstractDocument"].handleInsertString (a, b, c);
7279 }, "~N,~S,javax.swing.text.AttributeSet");
7280 Clazz_overrideMethod (c$, "replace", 
7281 function (a, b, c, d) {
7282 this.b$["swingjs.JSAbstractDocument"].handleRemove (a, b);
7283 this.b$["swingjs.JSAbstractDocument"].handleInsertString (a, c, d);
7284 }, "~N,~N,~S,javax.swing.text.AttributeSet");
7285 c$ = Clazz_p0p ();
7286 };
7287 c$.$JSAbstractDocument$JSElement$ = function () {
7288 Clazz_pu$h(self.c$);
7289 c$ = Clazz_decorateAsClass (function () {
7290 Clazz_prepareCallback (this, arguments);
7291 this.parent = null;
7292 this.attributeSet = null;
7293 this.start = 0;
7294 this.end = 0;
7295 this.nchildren = 0;
7296 this.children = null;
7297 this.lastIndex = 0;
7298 Clazz_instantialize (this, arguments);
7299 }, swingjs.JSAbstractDocument, "JSElement", null, javax.swing.text.Element);
7300 Clazz_makeConstructor (c$, 
7301 function () {
7302 this.children = null;
7303 this.nchildren = 0;
7304 this.lastIndex = -1;
7305 });
7306 Clazz_defineMethod (c$, "addChild", 
7307 function (a) {
7308 if (this.children == null) this.children =  new Array (10);
7309  else if (this.nchildren == this.children.length) this.children = JU.AU.doubleLength (this.children);
7310 this.children[this.nchildren++] = a;
7311 }, "swingjs.JSAbstractDocument.JSElement");
7312 Clazz_overrideMethod (c$, "getDocument", 
7313 function () {
7314 return this.b$["swingjs.JSAbstractDocument"].me;
7315 });
7316 Clazz_overrideMethod (c$, "getParentElement", 
7317 function () {
7318 return this.parent;
7319 });
7320 Clazz_overrideMethod (c$, "getName", 
7321 function () {
7322 return this.getName ();
7323 });
7324 Clazz_overrideMethod (c$, "getAttributes", 
7325 function () {
7326 return this.attributeSet;
7327 });
7328 Clazz_defineMethod (c$, "getStartOffset", 
7329 function () {
7330 return this.start;
7331 });
7332 Clazz_defineMethod (c$, "getEndOffset", 
7333 function () {
7334 return this.end;
7335 });
7336 Clazz_overrideMethod (c$, "getElementIndex", 
7337 function (a) {
7338 var b;
7339 var c = 0;
7340 var d = this.nchildren - 1;
7341 var e = 0;
7342 var f = this.getStartOffset ();
7343 var g;
7344 if (this.nchildren == 0) {
7345 return 0;
7346 }if (a >= this.getEndOffset ()) {
7347 return this.nchildren - 1;
7348 }if ((this.lastIndex >= c) && (this.lastIndex <= d)) {
7349 var h = this.children[this.lastIndex];
7350 f = h.getStartOffset ();
7351 g = h.getEndOffset ();
7352 if ((a >= f) && (a < g)) {
7353 return this.lastIndex;
7354 }if (a < f) {
7355 d = this.lastIndex;
7356 } else {
7357 c = this.lastIndex;
7358 }}while (c <= d) {
7359 e = c + (Clazz_doubleToInt ((d - c) / 2));
7360 var h = this.children[e];
7361 f = h.getStartOffset ();
7362 g = h.getEndOffset ();
7363 if ((a >= f) && (a < g)) {
7364 b = e;
7365 this.lastIndex = b;
7366 return b;
7367 } else if (a < f) {
7368 d = e - 1;
7369 } else {
7370 c = e + 1;
7371 }}
7372 if (a < f) {
7373 b = e;
7374 } else {
7375 b = e + 1;
7376 }this.lastIndex = b;
7377 return b;
7378 }, "~N");
7379 Clazz_overrideMethod (c$, "getElementCount", 
7380 function () {
7381 return this.nchildren;
7382 });
7383 Clazz_overrideMethod (c$, "getElement", 
7384 function (a) {
7385 return (a >= this.nchildren ? null : this.children[a]);
7386 }, "~N");
7387 Clazz_overrideMethod (c$, "isLeaf", 
7388 function () {
7389 return (this.parent != null);
7390 });
7391 c$ = Clazz_p0p ();
7392 };
7393 Clazz_defineStatics (c$,
7394 "ParagraphElementName", "paragraph",
7395 "ContentElementName", "content");
7396 });
7397 Clazz_declarePackage ("swingjs");
7398 Clazz_load (["javax.swing.event.DocumentEvent"], "swingjs.JSDocumentEvent", ["swingjs.JSToolkit"], function () {
7399 c$ = Clazz_decorateAsClass (function () {
7400 this.off = 0;
7401 this.len = 0;
7402 this.type = null;
7403 this.doc = null;
7404 Clazz_instantialize (this, arguments);
7405 }, swingjs, "JSDocumentEvent", null, javax.swing.event.DocumentEvent);
7406 Clazz_makeConstructor (c$, 
7407 function (doc, offs, len, eventType) {
7408 this.off = offs;
7409 this.len = len;
7410 this.type = eventType;
7411 this.doc = doc;
7412 }, "swingjs.JSAbstractDocument,~N,~N,javax.swing.event.DocumentEvent.EventType");
7413 Clazz_overrideMethod (c$, "getOffset", 
7414 function () {
7415 return this.off;
7416 });
7417 Clazz_overrideMethod (c$, "getLength", 
7418 function () {
7419 return this.len;
7420 });
7421 Clazz_overrideMethod (c$, "getDocument", 
7422 function () {
7423 return this.doc;
7424 });
7425 Clazz_overrideMethod (c$, "getType", 
7426 function () {
7427 return this.type;
7428 });
7429 Clazz_overrideMethod (c$, "getChange", 
7430 function (elem) {
7431 swingjs.JSToolkit.notImplemented ("");
7432 return null;
7433 }, "javax.swing.text.Element");
7434 });
7435 Clazz_declarePackage ("swingjs");
7436 Clazz_load (["javax.swing.text.Position"], "swingjs.JSPosition", null, function () {
7437 c$ = Clazz_decorateAsClass (function () {
7438 this.pos = 0;
7439 Clazz_instantialize (this, arguments);
7440 }, swingjs, "JSPosition", null, javax.swing.text.Position);
7441 Clazz_makeConstructor (c$, 
7442 function (offset) {
7443 this.pos = offset;
7444 }, "~N");
7445 Clazz_overrideMethod (c$, "getOffset", 
7446 function () {
7447 return this.pos;
7448 });
7449 });
7450 Clazz_declarePackage ("swingjs.api");
7451 c$ = Clazz_declareType (swingjs.api, "HTML5CanvasContext2D");
7452 c$.stretchImage = Clazz_defineMethod (c$, "stretchImage", 
7453 function (ctx, img, sx, sy, swidth, sheight, dx, dy, dwidth, dheight) {
7454 {
7455 ctx.drawImage(img, sx, sy, swidth, sheight, dx, dy, dwidth, dheight);
7456 }}, "swingjs.api.HTML5CanvasContext2D,swingjs.api.DOMNode,~N,~N,~N,~N,~N,~N,~N,~N");
7457 Clazz_declarePackage ("javax.swing");
7458 Clazz_load (["javax.swing.JLabel", "$.ListCellRenderer", "javax.swing.plaf.UIResource", "javax.swing.border.EmptyBorder"], "javax.swing.DefaultListCellRenderer", ["javax.swing.Icon", "jssun.swing.DefaultLookup"], function () {
7459 c$ = Clazz_declareType (javax.swing, "DefaultListCellRenderer", javax.swing.JLabel, javax.swing.ListCellRenderer);
7460 Clazz_makeConstructor (c$, 
7461 function () {
7462 Clazz_superConstructor (this, javax.swing.DefaultListCellRenderer);
7463 this.setOpaque (true);
7464 this.setBorder (this.getNoFocusBorder ());
7465 this.setName ("List.cellRenderer");
7466 });
7467 Clazz_defineMethod (c$, "getNoFocusBorder", 
7468  function () {
7469 var border = jssun.swing.DefaultLookup.getBorder (this, this.ui, "List.cellNoFocusBorder");
7470 if (System.getSecurityManager () != null) {
7471 if (border != null) return border;
7472 return javax.swing.DefaultListCellRenderer.SAFE_NO_FOCUS_BORDER;
7473 } else {
7474 if (border != null && (javax.swing.DefaultListCellRenderer.noFocusBorder == null || javax.swing.DefaultListCellRenderer.noFocusBorder === javax.swing.DefaultListCellRenderer.DEFAULT_NO_FOCUS_BORDER)) {
7475 return border;
7476 }return javax.swing.DefaultListCellRenderer.noFocusBorder;
7477 }});
7478 Clazz_overrideMethod (c$, "getListCellRendererComponent", 
7479 function (list, value, index, isSelected, cellHasFocus) {
7480 this.setComponentOrientation (list.getComponentOrientation ());
7481 var bg = null;
7482 var fg = null;
7483 if (isSelected) {
7484 this.setBackground (bg == null ? list.getSelectionBackground () : bg);
7485 this.setForeground (fg == null ? list.getSelectionForeground () : fg);
7486 } else {
7487 this.setBackground (list.getBackground ());
7488 this.setForeground (list.getForeground ());
7489 }if (Clazz_instanceOf (value, javax.swing.Icon)) {
7490 this.setIcon (value);
7491 this.setText ("");
7492 } else {
7493 this.setIcon (null);
7494 this.setText ((value == null) ? "" : value.toString ());
7495 }this.setEnabled (list.isEnabled ());
7496 this.setFont (list.getFont ());
7497 var border = null;
7498 if (cellHasFocus) {
7499 if (isSelected) {
7500 border = jssun.swing.DefaultLookup.getBorder (this, this.ui, "List.focusSelectedCellHighlightBorder");
7501 }if (border == null) {
7502 border = jssun.swing.DefaultLookup.getBorder (this, this.ui, "List.focusCellHighlightBorder");
7503 }} else {
7504 border = this.getNoFocusBorder ();
7505 }this.setBorder (border);
7506 return this;
7507 }, "javax.swing.JList,~O,~N,~B,~B");
7508 Clazz_defineMethod (c$, "isOpaque", 
7509 function () {
7510 var back = this.getBackground ();
7511 var p = this.getParent ();
7512 if (p != null) {
7513 p = p.getParent ();
7514 }var colorMatch = (back != null) && (p != null) && back.equals (p.getBackground ()) && p.isOpaque ();
7515 return !colorMatch && Clazz_superCall (this, javax.swing.DefaultListCellRenderer, "isOpaque", []);
7516 });
7517 Clazz_overrideMethod (c$, "validate", 
7518 function () {
7519 });
7520 Clazz_overrideMethod (c$, "invalidate", 
7521 function () {
7522 });
7523 Clazz_defineMethod (c$, "repaint", 
7524 function () {
7525 });
7526 Clazz_overrideMethod (c$, "revalidate", 
7527 function () {
7528 });
7529 Clazz_defineMethod (c$, "repaint", 
7530 function (tm, x, y, width, height) {
7531 }, "~N,~N,~N,~N,~N");
7532 Clazz_defineMethod (c$, "repaint", 
7533 function (r) {
7534 }, "java.awt.Rectangle");
7535 Clazz_overrideMethod (c$, "firePropertyChangeObject", 
7536 function (propertyName, oldValue, newValue) {
7537 }, "~S,~O,~O");
7538 Clazz_overrideMethod (c$, "firePropertyChangeByte", 
7539 function (propertyName, oldValue, newValue) {
7540 }, "~S,~N,~N");
7541 Clazz_overrideMethod (c$, "firePropertyChangeChar", 
7542 function (propertyName, oldValue, newValue) {
7543 }, "~S,~S,~S");
7544 Clazz_overrideMethod (c$, "firePropertyChangeShort", 
7545 function (propertyName, oldValue, newValue) {
7546 }, "~S,~N,~N");
7547 Clazz_overrideMethod (c$, "firePropertyChangeInt", 
7548 function (propertyName, oldValue, newValue) {
7549 }, "~S,~N,~N");
7550 Clazz_overrideMethod (c$, "firePropertyChangeLong", 
7551 function (propertyName, oldValue, newValue) {
7552 }, "~S,~N,~N");
7553 Clazz_overrideMethod (c$, "firePropertyChangeFloat", 
7554 function (propertyName, oldValue, newValue) {
7555 }, "~S,~N,~N");
7556 Clazz_overrideMethod (c$, "firePropertyChangeDouble", 
7557 function (propertyName, oldValue, newValue) {
7558 }, "~S,~N,~N");
7559 Clazz_overrideMethod (c$, "firePropertyChangeBool", 
7560 function (propertyName, oldValue, newValue) {
7561 }, "~S,~B,~B");
7562 Clazz_pu$h(self.c$);
7563 c$ = Clazz_declareType (javax.swing.DefaultListCellRenderer, "UIResource", javax.swing.DefaultListCellRenderer, javax.swing.plaf.UIResource);
7564 c$ = Clazz_p0p ();
7565 c$.SAFE_NO_FOCUS_BORDER = c$.prototype.SAFE_NO_FOCUS_BORDER =  new javax.swing.border.EmptyBorder (1, 1, 1, 1);
7566 c$.DEFAULT_NO_FOCUS_BORDER = c$.prototype.DEFAULT_NO_FOCUS_BORDER =  new javax.swing.border.EmptyBorder (1, 1, 1, 1);
7567 c$.noFocusBorder = c$.prototype.noFocusBorder = javax.swing.DefaultListCellRenderer.DEFAULT_NO_FOCUS_BORDER;
7568 });
7569 Clazz_declarePackage ("javax.swing");
7570 Clazz_declareInterface (javax.swing, "ListCellRenderer");
7571 Clazz_declarePackage ("javax.swing.border");
7572 Clazz_load (["javax.swing.border.AbstractBorder"], "javax.swing.border.EmptyBorder", ["java.awt.Insets"], function () {
7573 c$ = Clazz_decorateAsClass (function () {
7574 this.left = 0;
7575 this.right = 0;
7576 this.top = 0;
7577 this.bottom = 0;
7578 Clazz_instantialize (this, arguments);
7579 }, javax.swing.border, "EmptyBorder", javax.swing.border.AbstractBorder);
7580 Clazz_makeConstructor (c$, 
7581 function (top, left, bottom, right) {
7582 Clazz_superConstructor (this, javax.swing.border.EmptyBorder, []);
7583 this.top = top;
7584 this.right = right;
7585 this.bottom = bottom;
7586 this.left = left;
7587 }, "~N,~N,~N,~N");
7588 Clazz_makeConstructor (c$, 
7589 function (borderInsets) {
7590 Clazz_superConstructor (this, javax.swing.border.EmptyBorder, []);
7591 this.top = borderInsets.top;
7592 this.right = borderInsets.right;
7593 this.bottom = borderInsets.bottom;
7594 this.left = borderInsets.left;
7595 }, "java.awt.Insets");
7596 Clazz_overrideMethod (c$, "paintBorder", 
7597 function (c, g, x, y, width, height) {
7598 }, "java.awt.Component,java.awt.Graphics,~N,~N,~N,~N");
7599 Clazz_defineMethod (c$, "getBorderInsets", 
7600 function (c) {
7601 return this.getBorderInsets ();
7602 }, "java.awt.Component");
7603 Clazz_defineMethod (c$, "getBorderInsets", 
7604 function (c, insets) {
7605 insets.left = this.left;
7606 insets.top = this.top;
7607 insets.right = this.right;
7608 insets.bottom = this.bottom;
7609 return insets;
7610 }, "java.awt.Component,java.awt.Insets");
7611 Clazz_defineMethod (c$, "getBorderInsets", 
7612 function () {
7613 return  new java.awt.Insets (this.top, this.left, this.bottom, this.right);
7614 });
7615 Clazz_overrideMethod (c$, "isBorderOpaque", 
7616 function () {
7617 return false;
7618 });
7619 });
7620 Clazz_declarePackage ("jssun.swing");
7621 Clazz_load (null, "jssun.swing.DefaultLookup", ["java.lang.Boolean", "$.Number", "$.Thread", "java.awt.Color", "$.Insets", "javax.swing.Icon", "$.UIManager", "javax.swing.border.Border", "jssun.awt.AppContext"], function () {
7622 c$ = Clazz_declareType (jssun.swing, "DefaultLookup");
7623 c$.setDefaultLookup = Clazz_defineMethod (c$, "setDefaultLookup", 
7624 function (lookup) {
7625 {
7626 if (!jssun.swing.DefaultLookup.isLookupSet && lookup == null) {
7627 return;
7628 } else if (lookup == null) {
7629 lookup =  new jssun.swing.DefaultLookup ();
7630 }jssun.swing.DefaultLookup.isLookupSet = true;
7631 jssun.awt.AppContext.getAppContext ().put (jssun.swing.DefaultLookup.DEFAULT_LOOKUP_KEY, lookup);
7632 jssun.swing.DefaultLookup.currentDefaultThread = Thread.currentThread ();
7633 jssun.swing.DefaultLookup.currentDefaultLookup = lookup;
7634 }}, "jssun.swing.DefaultLookup");
7635 c$.get = Clazz_defineMethod (c$, "get", 
7636 function (c, ui, key) {
7637 var lookupSet;
7638 {
7639 lookupSet = jssun.swing.DefaultLookup.isLookupSet;
7640 }if (!lookupSet) {
7641 return javax.swing.UIManager.get (key, c.getLocale ());
7642 }var thisThread = Thread.currentThread ();
7643 var lookup;
7644 {
7645 if (thisThread === jssun.swing.DefaultLookup.currentDefaultThread) {
7646 lookup = jssun.swing.DefaultLookup.currentDefaultLookup;
7647 } else {
7648 lookup = jssun.awt.AppContext.getAppContext ().get (jssun.swing.DefaultLookup.DEFAULT_LOOKUP_KEY);
7649 if (lookup == null) {
7650 lookup =  new jssun.swing.DefaultLookup ();
7651 jssun.awt.AppContext.getAppContext ().put (jssun.swing.DefaultLookup.DEFAULT_LOOKUP_KEY, lookup);
7652 }jssun.swing.DefaultLookup.currentDefaultThread = thisThread;
7653 jssun.swing.DefaultLookup.currentDefaultLookup = lookup;
7654 }}return lookup.getDefault (c, ui, key);
7655 }, "javax.swing.JComponent,javax.swing.plaf.ComponentUI,~S");
7656 c$.getInt = Clazz_defineMethod (c$, "getInt", 
7657 function (c, ui, key, defaultValue) {
7658 var iValue = jssun.swing.DefaultLookup.get (c, ui, key);
7659 if (iValue == null || !(Clazz_instanceOf (iValue, Number))) {
7660 return defaultValue;
7661 }return (iValue).intValue ();
7662 }, "javax.swing.JComponent,javax.swing.plaf.ComponentUI,~S,~N");
7663 c$.getInt = Clazz_defineMethod (c$, "getInt", 
7664 function (c, ui, key) {
7665 return jssun.swing.DefaultLookup.getInt (c, ui, key, -1);
7666 }, "javax.swing.JComponent,javax.swing.plaf.ComponentUI,~S");
7667 c$.getInsets = Clazz_defineMethod (c$, "getInsets", 
7668 function (c, ui, key, defaultValue) {
7669 var iValue = jssun.swing.DefaultLookup.get (c, ui, key);
7670 if (iValue == null || !(Clazz_instanceOf (iValue, java.awt.Insets))) {
7671 return defaultValue;
7672 }return iValue;
7673 }, "javax.swing.JComponent,javax.swing.plaf.ComponentUI,~S,java.awt.Insets");
7674 c$.getInsets = Clazz_defineMethod (c$, "getInsets", 
7675 function (c, ui, key) {
7676 return jssun.swing.DefaultLookup.getInsets (c, ui, key, null);
7677 }, "javax.swing.JComponent,javax.swing.plaf.ComponentUI,~S");
7678 c$.getBoolean = Clazz_defineMethod (c$, "getBoolean", 
7679 function (c, ui, key, defaultValue) {
7680 var iValue = jssun.swing.DefaultLookup.get (c, ui, key);
7681 if (iValue == null || !(Clazz_instanceOf (iValue, Boolean))) {
7682 return defaultValue;
7683 }return (iValue).booleanValue ();
7684 }, "javax.swing.JComponent,javax.swing.plaf.ComponentUI,~S,~B");
7685 c$.getBoolean = Clazz_defineMethod (c$, "getBoolean", 
7686 function (c, ui, key) {
7687 return jssun.swing.DefaultLookup.getBoolean (c, ui, key, false);
7688 }, "javax.swing.JComponent,javax.swing.plaf.ComponentUI,~S");
7689 c$.getColor = Clazz_defineMethod (c$, "getColor", 
7690 function (c, ui, key, defaultValue) {
7691 var iValue = jssun.swing.DefaultLookup.get (c, ui, key);
7692 if (iValue == null || !(Clazz_instanceOf (iValue, java.awt.Color))) {
7693 return defaultValue;
7694 }return iValue;
7695 }, "javax.swing.JComponent,javax.swing.plaf.ComponentUI,~S,java.awt.Color");
7696 c$.getColor = Clazz_defineMethod (c$, "getColor", 
7697 function (c, ui, key) {
7698 return jssun.swing.DefaultLookup.getColor (c, ui, key, null);
7699 }, "javax.swing.JComponent,javax.swing.plaf.ComponentUI,~S");
7700 c$.getIcon = Clazz_defineMethod (c$, "getIcon", 
7701 function (c, ui, key, defaultValue) {
7702 var iValue = jssun.swing.DefaultLookup.get (c, ui, key);
7703 if (iValue == null || !(Clazz_instanceOf (iValue, javax.swing.Icon))) {
7704 return defaultValue;
7705 }return iValue;
7706 }, "javax.swing.JComponent,javax.swing.plaf.ComponentUI,~S,javax.swing.Icon");
7707 c$.getIcon = Clazz_defineMethod (c$, "getIcon", 
7708 function (c, ui, key) {
7709 return jssun.swing.DefaultLookup.getIcon (c, ui, key, null);
7710 }, "javax.swing.JComponent,javax.swing.plaf.ComponentUI,~S");
7711 c$.getBorder = Clazz_defineMethod (c$, "getBorder", 
7712 function (c, ui, key, defaultValue) {
7713 var iValue = jssun.swing.DefaultLookup.get (c, ui, key);
7714 if (iValue == null || !(Clazz_instanceOf (iValue, javax.swing.border.Border))) {
7715 return defaultValue;
7716 }return iValue;
7717 }, "javax.swing.JComponent,javax.swing.plaf.ComponentUI,~S,javax.swing.border.Border");
7718 c$.getBorder = Clazz_defineMethod (c$, "getBorder", 
7719 function (c, ui, key) {
7720 return jssun.swing.DefaultLookup.getBorder (c, ui, key, null);
7721 }, "javax.swing.JComponent,javax.swing.plaf.ComponentUI,~S");
7722 Clazz_defineMethod (c$, "getDefault", 
7723 function (c, ui, key) {
7724 return javax.swing.UIManager.get (key, c.getLocale ());
7725 }, "javax.swing.JComponent,javax.swing.plaf.ComponentUI,~S");
7726 c$.DEFAULT_LOOKUP_KEY = c$.prototype.DEFAULT_LOOKUP_KEY =  new Clazz._O ();
7727 Clazz_defineStatics (c$,
7728 "currentDefaultThread", null,
7729 "currentDefaultLookup", null,
7730 "isLookupSet", false);
7731 });
7732 Clazz_declarePackage ("javax.swing.plaf");
7733 Clazz_load (["java.awt.Dimension", "javax.swing.plaf.UIResource"], "javax.swing.plaf.DimensionUIResource", null, function () {
7734 c$ = Clazz_declareType (javax.swing.plaf, "DimensionUIResource", java.awt.Dimension, javax.swing.plaf.UIResource);
7735 });
7736 Clazz_declarePackage ("javax.swing.plaf");
7737 Clazz_load (["java.awt.Insets", "javax.swing.plaf.UIResource"], "javax.swing.plaf.InsetsUIResource", null, function () {
7738 c$ = Clazz_declareType (javax.swing.plaf, "InsetsUIResource", java.awt.Insets, javax.swing.plaf.UIResource);
7739 });
7740 Clazz_declarePackage ("swingjs.plaf");
7741 Clazz_declareInterface (swingjs.plaf, "JSEventHandler");
7742 Clazz_declarePackage ("JU");
7743 Clazz_load (["java.net.URLStreamHandlerFactory", "java.util.Hashtable"], "JU.AjaxURLStreamHandlerFactory", ["JU.AjaxURLStreamHandler"], function () {
7744 c$ = Clazz_decorateAsClass (function () {
7745 this.htFactories = null;
7746 Clazz_instantialize (this, arguments);
7747 }, JU, "AjaxURLStreamHandlerFactory", null, java.net.URLStreamHandlerFactory);
7748 Clazz_prepareFields (c$, function () {
7749 this.htFactories =  new java.util.Hashtable ();
7750 });
7751 Clazz_overrideMethod (c$, "createURLStreamHandler", 
7752 function (protocol) {
7753 var fac = this.htFactories.get (protocol);
7754 if (fac == null) this.htFactories.put (protocol, fac =  new JU.AjaxURLStreamHandler (protocol));
7755 return (fac.protocol == null ? null : fac);
7756 }, "~S");
7757 });
7758 Clazz_declarePackage ("java.net");
7759 Clazz_declareInterface (java.net, "URLStreamHandlerFactory");
7760 Clazz_declarePackage ("JU");
7761 Clazz_load (["java.net.URLStreamHandler"], "JU.AjaxURLStreamHandler", ["JU.AjaxURLConnection", "$.SB"], function () {
7762 c$ = Clazz_decorateAsClass (function () {
7763 this.protocol = null;
7764 Clazz_instantialize (this, arguments);
7765 }, JU, "AjaxURLStreamHandler", java.net.URLStreamHandler);
7766 Clazz_makeConstructor (c$, 
7767 function (protocol) {
7768 Clazz_superConstructor (this, JU.AjaxURLStreamHandler, []);
7769 this.protocol = protocol;
7770 }, "~S");
7771 Clazz_overrideMethod (c$, "openConnection", 
7772 function (url) {
7773 return  new JU.AjaxURLConnection (url);
7774 }, "java.net.URL");
7775 Clazz_overrideMethod (c$, "toExternalForm", 
7776 function (u) {
7777 var result =  new JU.SB ();
7778 result.append (u.getProtocol ());
7779 result.append (":");
7780 if (u.getAuthority () != null && u.getAuthority ().length > 0) {
7781 result.append ("//");
7782 result.append (u.getAuthority ());
7783 }if (u.getPath () != null) {
7784 result.append (u.getPath ());
7785 }if (u.getQuery () != null) {
7786 result.append ("?");
7787 result.append (u.getQuery ());
7788 }if (u.getRef () != null) {
7789 result.append ("#");
7790 result.append (u.getRef ());
7791 }return result.toString ();
7792 }, "java.net.URL");
7793 });
7794 Clazz_declarePackage ("java.net");
7795 Clazz_load (null, "java.net.URLStreamHandler", ["java.lang.IllegalArgumentException", "$.SecurityException", "$.UnsupportedOperationException"], function () {
7796 c$ = Clazz_declareType (java.net, "URLStreamHandler");
7797 Clazz_defineMethod (c$, "openConnectionProxy", 
7798 function (u, p) {
7799 throw  new UnsupportedOperationException ("Method not implemented.");
7800 }, "java.net.URL,java.net.Proxy");
7801 Clazz_defineMethod (c$, "parseURL", 
7802 function (u, spec, start, limit) {
7803 var protocol = u.getProtocol ();
7804 var authority = u.getAuthority ();
7805 var userInfo = u.getUserInfo ();
7806 var host = u.getHost ();
7807 var port = u.getPort ();
7808 var path = u.getPath ();
7809 var query = u.getQuery ();
7810 var ref = u.getRef ();
7811 var isRelPath = false;
7812 var queryOnly = false;
7813 if (start < limit) {
7814 var queryStart = spec.indexOf ('?');
7815 queryOnly = queryStart == start;
7816 if ((queryStart != -1) && (queryStart < limit)) {
7817 query = spec.substring (queryStart + 1, limit);
7818 if (limit > queryStart) limit = queryStart;
7819 spec = spec.substring (0, queryStart);
7820 }}var i = 0;
7821 var isUNCName = (start <= limit - 4) && (spec.charAt (start) == '/') && (spec.charAt (start + 1) == '/') && (spec.charAt (start + 2) == '/') && (spec.charAt (start + 3) == '/');
7822 if (!isUNCName && (start <= limit - 2) && (spec.charAt (start) == '/') && (spec.charAt (start + 1) == '/')) {
7823 start += 2;
7824 i = spec.indexOf ('/', start);
7825 if (i < 0) {
7826 i = spec.indexOf ('?', start);
7827 if (i < 0) i = limit;
7828 }host = authority = spec.substring (start, i);
7829 var ind = authority.indexOf ('@');
7830 if (ind != -1) {
7831 userInfo = authority.substring (0, ind);
7832 host = authority.substring (ind + 1);
7833 } else {
7834 userInfo = null;
7835 }if (host != null) {
7836 if (host.length > 0 && (host.charAt (0) == '[')) {
7837 throw  new IllegalArgumentException ("Invalid host: " + host);
7838 }ind = host.indexOf (':');
7839 port = -1;
7840 if (ind >= 0) {
7841 if (host.length > (ind + 1)) {
7842 port = Integer.parseInt (host.substring (ind + 1));
7843 }host = host.substring (0, ind);
7844 }} else {
7845 host = "";
7846 }if (port < -1) throw  new IllegalArgumentException ("Invalid port number :" + port);
7847 start = i;
7848 if (authority.length > 0) path = "";
7849 }if (host == null) {
7850 host = "";
7851 }if (start < limit) {
7852 if (spec.charAt (start) == '/') {
7853 path = spec.substring (start, limit);
7854 } else if (path != null && path.length > 0) {
7855 isRelPath = true;
7856 var ind = path.lastIndexOf ('/');
7857 var seperator = "";
7858 if (ind == -1 && authority != null) seperator = "/";
7859 path = path.substring (0, ind + 1) + seperator + spec.substring (start, limit);
7860 } else {
7861 var seperator = (authority != null) ? "/" : "";
7862 path = seperator + spec.substring (start, limit);
7863 }} else if (queryOnly && path != null) {
7864 var ind = path.lastIndexOf ('/');
7865 if (ind < 0) ind = 0;
7866 path = path.substring (0, ind) + "/";
7867 }if (path == null) path = "";
7868 if (isRelPath) {
7869 while ((i = path.indexOf ("/./")) >= 0) {
7870 path = path.substring (0, i) + path.substring (i + 2);
7871 }
7872 i = 0;
7873 while ((i = path.indexOf ("/../", i)) >= 0) {
7874 if (i > 0 && (limit = path.lastIndexOf ('/', i - 1)) >= 0 && (path.indexOf ("/../", limit) != 0)) {
7875 path = path.substring (0, limit) + path.substring (i + 3);
7876 i = 0;
7877 } else {
7878 i = i + 3;
7879 }}
7880 while (path.endsWith ("/..")) {
7881 i = path.indexOf ("/..");
7882 if ((limit = path.lastIndexOf ('/', i - 1)) >= 0) {
7883 path = path.substring (0, limit + 1);
7884 } else {
7885 break;
7886 }}
7887 if (path.startsWith ("./") && path.length > 2) path = path.substring (2);
7888 if (path.endsWith ("/.")) path = path.substring (0, path.length - 1);
7889 }this.setURL (u, protocol, host, port, authority, userInfo, path, query, ref);
7890 }, "java.net.URL,~S,~N,~N");
7891 Clazz_defineMethod (c$, "getDefaultPort", 
7892 function () {
7893 return -1;
7894 });
7895 Clazz_defineMethod (c$, "equals2", 
7896 function (u1, u2) {
7897 var ref1 = u1.getRef ();
7898 var ref2 = u2.getRef ();
7899 return (ref1 === ref2 || (ref1 != null && ref1.equals (ref2))) && this.sameFile (u1, u2);
7900 }, "java.net.URL,java.net.URL");
7901 Clazz_defineMethod (c$, "hashCode", 
7902 function (u) {
7903 var h = 0;
7904 var protocol = u.getProtocol ();
7905 if (protocol != null) h += protocol.hashCode ();
7906 h += u.toString ().hashCode ();
7907 var file = u.getFile ();
7908 if (file != null) h += file.hashCode ();
7909 if (u.getPort () == -1) h += this.getDefaultPort ();
7910  else h += u.getPort ();
7911 var ref = u.getRef ();
7912 if (ref != null) h += ref.hashCode ();
7913 return h;
7914 }, "java.net.URL");
7915 Clazz_defineMethod (c$, "sameFile", 
7916 function (u1, u2) {
7917 if (!((u1.getProtocol () === u2.getProtocol ()) || (u1.getProtocol () != null && u1.getProtocol ().equalsIgnoreCase (u2.getProtocol ())))) return false;
7918 if (!(u1.getFile () === u2.getFile () || (u1.getFile () != null && u1.getFile ().equals (u2.getFile ())))) return false;
7919 var port1;
7920 var port2;
7921 port1 = (u1.getPort () != -1) ? u1.getPort () : u1.handler.getDefaultPort ();
7922 port2 = (u2.getPort () != -1) ? u2.getPort () : u2.handler.getDefaultPort ();
7923 if (port1 != port2) return false;
7924 if (!this.hostsEqual (u1, u2)) return false;
7925 return true;
7926 }, "java.net.URL,java.net.URL");
7927 Clazz_defineMethod (c$, "hostsEqual", 
7928 function (u1, u2) {
7929 if (u1.getHost () != null && u2.getHost () != null) return u1.getHost ().equalsIgnoreCase (u2.getHost ());
7930 return u1.getHost () == null && u2.getHost () == null;
7931 }, "java.net.URL,java.net.URL");
7932 Clazz_defineMethod (c$, "toExternalForm", 
7933 function (u) {
7934 return "";
7935 }, "java.net.URL");
7936 Clazz_defineMethod (c$, "setURL", 
7937 function (u, protocol, host, port, authority, userInfo, path, query, ref) {
7938 if (this !== u.handler) {
7939 throw  new SecurityException ("handler for url different from this handler");
7940 }u.set (u.getProtocol (), host, port, authority, userInfo, path, query, ref);
7941 }, "java.net.URL,~S,~S,~N,~S,~S,~S,~S,~S");
7942 Clazz_defineMethod (c$, "setURLDeprecated", 
7943 function (u, protocol, host, port, file, ref) {
7944 var authority = null;
7945 var userInfo = null;
7946 if (host != null && host.length != 0) {
7947 authority = (port == -1) ? host : host + ":" + port;
7948 var at = host.lastIndexOf ('@');
7949 if (at != -1) {
7950 userInfo = host.substring (0, at);
7951 host = host.substring (at + 1);
7952 }}var path = null;
7953 var query = null;
7954 if (file != null) {
7955 var q = file.lastIndexOf ('?');
7956 if (q != -1) {
7957 query = file.substring (q + 1);
7958 path = file.substring (0, q);
7959 } else path = file;
7960 }this.setURL (u, protocol, host, port, authority, userInfo, path, query, ref);
7961 }, "java.net.URL,~S,~S,~N,~S,~S");
7962 });
7963 Clazz_declarePackage ("JU");
7964 Clazz_load (["java.net.URLConnection"], "JU.AjaxURLConnection", ["JU.AU", "$.Rdr", "$.SB"], function () {
7965 c$ = Clazz_decorateAsClass (function () {
7966 this.bytesOut = null;
7967 this.postOut = "";
7968 Clazz_instantialize (this, arguments);
7969 }, JU, "AjaxURLConnection", java.net.URLConnection);
7970 Clazz_defineMethod (c$, "doAjax", 
7971  function () {
7972 {
7973 return Jmol._doAjax(this.url, this.postOut, this.bytesOut);
7974 }});
7975 Clazz_overrideMethod (c$, "connect", 
7976 function () {
7977 });
7978 Clazz_defineMethod (c$, "outputBytes", 
7979 function (bytes) {
7980 this.bytesOut = bytes;
7981 }, "~A");
7982 Clazz_defineMethod (c$, "outputString", 
7983 function (post) {
7984 this.postOut = post;
7985 }, "~S");
7986 Clazz_overrideMethod (c$, "getInputStream", 
7987 function () {
7988 var is = null;
7989 var o = this.doAjax ();
7990 if (JU.AU.isAB (o)) is = JU.Rdr.getBIS (o);
7991  else if (Clazz_instanceOf (o, JU.SB)) is = JU.Rdr.getBIS (JU.Rdr.getBytesFromSB (o));
7992  else if (Clazz_instanceOf (o, String)) is = JU.Rdr.getBIS ((o).getBytes ());
7993 return is;
7994 });
7995 Clazz_defineMethod (c$, "getContents", 
7996 function () {
7997 return this.doAjax ();
7998 });
7999 });
8000 Clazz_declarePackage ("java.net");
8001 Clazz_load (null, "java.net.URLConnection", ["java.lang.IllegalStateException", "$.NullPointerException", "java.net.UnknownServiceException", "JU.Lst"], function () {
8002 c$ = Clazz_decorateAsClass (function () {
8003 this.url = null;
8004 this.doInput = true;
8005 this.doOutput = false;
8006 this.connected = false;
8007 this.requests = null;
8008 Clazz_instantialize (this, arguments);
8009 }, java.net, "URLConnection");
8010 Clazz_defineMethod (c$, "setDoInput", 
8011 function (doinput) {
8012 if (this.connected) throw  new IllegalStateException ("Already connected");
8013 this.doInput = doinput;
8014 }, "~B");
8015 Clazz_defineMethod (c$, "getDoInput", 
8016 function () {
8017 return this.doInput;
8018 });
8019 Clazz_defineMethod (c$, "setDoOutput", 
8020 function (dooutput) {
8021 if (this.connected) throw  new IllegalStateException ("Already connected");
8022 this.doOutput = dooutput;
8023 }, "~B");
8024 Clazz_defineMethod (c$, "getDoOutput", 
8025 function () {
8026 return this.doOutput;
8027 });
8028 Clazz_makeConstructor (c$, 
8029 function (url) {
8030 this.url = url;
8031 }, "java.net.URL");
8032 Clazz_defineMethod (c$, "getURL", 
8033 function () {
8034 return this.url;
8035 });
8036 Clazz_defineMethod (c$, "getInputStream", 
8037 function () {
8038 throw  new java.net.UnknownServiceException ("protocol doesn't support input");
8039 });
8040 Clazz_defineMethod (c$, "getOutputStream", 
8041 function () {
8042 throw  new java.net.UnknownServiceException ("protocol doesn't support output");
8043 });
8044 Clazz_defineMethod (c$, "setRequestProperty", 
8045 function (key, value) {
8046 if (this.connected) throw  new IllegalStateException ("Already connected");
8047 if (key == null) throw  new NullPointerException ("key is null");
8048 if (this.requests == null) this.requests =  new JU.Lst ();
8049 for (var i = this.requests.size (); --i >= 0; ) if (this.requests.get (i)[0].equals (key)) {
8050 this.requests.get (i)[1] = value;
8051 return;
8052 }
8053 this.requests.addLast ( Clazz_newArray (-1, [key, value]));
8054 }, "~S,~S");
8055 });
8056 Clazz_declarePackage ("java.net");
8057 Clazz_load (["java.io.IOException"], "java.net.UnknownServiceException", null, function () {
8058 c$ = Clazz_declareType (java.net, "UnknownServiceException", java.io.IOException);
8059 Clazz_makeConstructor (c$, 
8060 function () {
8061 Clazz_superConstructor (this, java.net.UnknownServiceException, []);
8062 });
8063 });
8064 Clazz_declarePackage ("jalview.bin");
8065 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", ["awt2swing.Util", "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 () {
8066 c$ = Clazz_decorateAsClass (function () {
8067 this.embedded = false;
8068 this.enableSplitFrame = false;
8069 this.showButton = true;
8070 this.checkForJmol = true;
8071 this.jalviewServletURL = null;
8072 this.startupFile = "No file";
8073 this.helpUrl = null;
8074 this.externalstructureviewer = null;
8075 this.sep = null;
8076 this.rgb = null;
8077 this.labelColour = null;
8078 this.initjscallback = null;
8079 this.pdbFile = null;
8080 this.sequence = null;
8081 this.jnetFile = null;
8082 this.annotations = null;
8083 this.hideFeatureGroups = null;
8084 this.showFeatureGroups = null;
8085 this.features = null;
8086 this.showFeatureSettings = null;
8087 this.scoreFile = null;
8088 this.treeFile = null;
8089 this.windowWidth = null;
8090 this.windowHeight = null;
8091 this.defaultColour = null;
8092 this.sortBy = null;
8093 this.wrap = null;
8094 this.centrecolumnlabels = null;
8095 this.userDefinedColour = null;
8096 this.widthScale = null;
8097 this.heightScale = null;
8098 this.upperCase = null;
8099 this.file2 = null;
8100 this.javascriptListeners = null;
8101 this.jsFunctionExec = null;
8102 this.fileFound = true;
8103 this.launcher = null;
8104 this.currentAlignFrame = null;
8105 this.initialAlignFrame = null;
8106 this.checkedForJmol = false;
8107 this.jmolAvailable = false;
8108 this.alignPdbStructures = false;
8109 this.useXtrnalSviewer = false;
8110 this.haveShownLoadMessage = false;
8111 if (!Clazz_isClassDefined ("jalview.bin.JalviewLite.LoadJmolThread")) {
8112 jalview.bin.JalviewLite.$JalviewLite$LoadJmolThread$ ();
8113 }
8114 if (!Clazz_isClassDefined ("jalview.bin.JalviewLite.LoadingThread")) {
8115 jalview.bin.JalviewLite.$JalviewLite$LoadingThread$ ();
8116 }
8117 this.separator = "\u00ac";
8118 this.jsfallbackEnabled = false;
8119 this.jshashes = null;
8120 this.jsmessages = null;
8121 this.jsExecQueue = null;
8122 Clazz_instantialize (this, arguments);
8123 }, jalview.bin, "JalviewLite", javax.swing.JApplet, [jalview.api.StructureSelectionManagerProvider, jalview.javascript.JalviewLiteJsApi]);
8124 Clazz_prepareFields (c$, function () {
8125 this.javascriptListeners =  new java.util.Vector ();
8126 this.launcher =  new javax.swing.JButton (jalview.util.MessageManager.getString ("label.start_jalview"));
8127 this.jshashes =  new java.util.Hashtable ();
8128 this.jsmessages =  new java.util.Hashtable ();
8129 this.jsExecQueue =  new java.util.Vector ();
8130 });
8131 Clazz_defineMethod (c$, "setParams", 
8132  function () {
8133 jalview.bin.JalviewLite.debug = "true".equalsIgnoreCase (this.getParameter ("debug"));
8134 this.enableSplitFrame = "true".equalsIgnoreCase (this.getParameter ("enableSplitFrame"));
8135 this.embedded = "true".equalsIgnoreCase (this.getParameter ("embedded"));
8136 this.showButton = !"false".equalsIgnoreCase (this.getParameter ("showbutton"));
8137 this.jalviewServletURL = this.getParameter ("APPLICATION_URL");
8138 this.startupFile = this.getParameter ("file");
8139 this.helpUrl = this.getParameter ("jalviewhelpurl");
8140 this.externalstructureviewer = this.getParameter ("externalstructureviewer");
8141 this.checkForJmol = !"true".equals (this.getParameter ("nojmol"));
8142 this.sep = this.getParameter ("separator");
8143 this.rgb = this.getParameter ("RGB");
8144 this.labelColour = this.getParameter ("label");
8145 this.initjscallback = this.getParameter ("oninit");
8146 this.pdbFile = this.getParameter ("PDBFILE");
8147 this.sequence = this.getParameter ("PDBSEQ");
8148 this.jnetFile = this.getParameter ("jnetfile");
8149 this.annotations = this.getParameter ("annotations");
8150 this.hideFeatureGroups = this.getParameter ("hidefeaturegroups");
8151 this.showFeatureGroups = this.getParameter ("showfeaturegroups");
8152 this.features = this.getParameter ("features");
8153 this.showFeatureSettings = this.getParameter ("showFeatureSettings");
8154 this.scoreFile = this.getParameter ("scoreFile");
8155 this.treeFile = this.getParameter ("tree");
8156 if (this.treeFile == null) this.treeFile = this.getParameter ("treeFile");
8157 this.windowWidth = this.getParameter ("windowWidth");
8158 this.windowHeight = this.getParameter ("windowHeight");
8159 this.defaultColour = this.getParameter ("defaultColour");
8160 this.sortBy = this.getParameter ("sortBy");
8161 this.wrap = this.getParameter ("wrap");
8162 this.centrecolumnlabels = this.getParameter ("centrecolumnlabels");
8163 this.userDefinedColour = this.getParameter ("userDefinedColour");
8164 this.widthScale = this.getParameter ("widthScale");
8165 this.heightScale = this.getParameter ("heightScale");
8166 this.upperCase = this.getParameter ("upperCase");
8167 this.file2 = this.getParameter ("file2");
8168 });
8169 Clazz_defineMethod (c$, "getDefaultParameter", 
8170 function (name, def) {
8171 var stn;
8172 if ((stn = this.getParameter (name)) == null) {
8173 return def;
8174 }if (stn.toLowerCase ().equals ("true")) {
8175 return true;
8176 }return false;
8177 }, "~S,~B");
8178 Clazz_defineMethod (c$, "getLinkParams", 
8179 function (links) {
8180 var label;
8181 var url;
8182 for (var i = 1; i < 10; i++) {
8183 label = this.getParameter ("linkLabel_" + i);
8184 url = this.getParameter ("linkURL_" + i);
8185 if (label != null && url != null) {
8186 links.addElement (label + "|" + url);
8187 }}
8188 }, "java.util.Vector");
8189 Clazz_defineMethod (c$, "getStructureSelectionManager", 
8190 function () {
8191 return jalview.structure.StructureSelectionManager.getStructureSelectionManager (this);
8192 });
8193 Clazz_defineMethod (c$, "getSelectedSequences", 
8194 function () {
8195 return this.getSelectedSequencesFrom (this.getDefaultTargetFrame ());
8196 });
8197 Clazz_defineMethod (c$, "getSelectedSequences", 
8198 function (sep) {
8199 return this.getSelectedSequencesFrom (this.getDefaultTargetFrame (), sep);
8200 }, "~S");
8201 Clazz_defineMethod (c$, "getSelectedSequencesFrom", 
8202 function (alf) {
8203 return this.getSelectedSequencesFrom (alf, this.separator);
8204 }, "jalview.appletgui.AlignFrame");
8205 Clazz_defineMethod (c$, "getSelectedSequencesFrom", 
8206 function (alf, sep) {
8207 var result =  new StringBuffer ("");
8208 if (sep == null || sep.length == 0) {
8209 sep = this.separator;
8210 }if (alf.viewport.getSelectionGroup () != null) {
8211 var seqs = alf.viewport.getSelectionGroup ().getSequencesInOrder (alf.viewport.getAlignment ());
8212 for (var i = 0; i < seqs.length; i++) {
8213 result.append (seqs[i].getName ());
8214 result.append (sep);
8215 }
8216 }return result.toString ();
8217 }, "jalview.appletgui.AlignFrame,~S");
8218 Clazz_overrideMethod (c$, "highlight", 
8219 function (sequenceId, position, alignedPosition) {
8220 this.highlightIn (this.getDefaultTargetFrame (), sequenceId, position, alignedPosition);
8221 }, "~S,~S,~S");
8222 Clazz_overrideMethod (c$, "highlightIn", 
8223 function (alf, sequenceId, position, alignedPosition) {
8224 var matcher =  new jalview.analysis.SequenceIdMatcher (alf.viewport.getAlignment ().getSequencesArray ());
8225 var sq = matcher.findIdMatch (sequenceId);
8226 if (sq != null) {
8227 var apos = -1;
8228 try {
8229 apos =  new Integer (position).intValue ();
8230 apos--;
8231 } catch (ex) {
8232 if (Clazz_exceptionOf (ex, NumberFormatException)) {
8233 return;
8234 } else {
8235 throw ex;
8236 }
8237 }
8238 var me = this;
8239 var pos = apos;
8240 if (alignedPosition != null && (alignedPosition.trim ().length == 0 || alignedPosition.toLowerCase ().indexOf ("false") > -1)) {
8241 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))));
8242 } else {
8243 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))));
8244 }}}, "jalview.appletgui.AlignFrame,~S,~S,~S");
8245 Clazz_defineMethod (c$, "select", 
8246 function (sequenceIds, columns) {
8247 this.selectIn (this.getDefaultTargetFrame (), sequenceIds, columns, this.separator);
8248 }, "~S,~S");
8249 Clazz_defineMethod (c$, "select", 
8250 function (sequenceIds, columns, sep) {
8251 this.selectIn (this.getDefaultTargetFrame (), sequenceIds, columns, sep);
8252 }, "~S,~S,~S");
8253 Clazz_defineMethod (c$, "selectIn", 
8254 function (alf, sequenceIds, columns) {
8255 this.selectIn (alf, sequenceIds, columns, this.separator);
8256 }, "jalview.appletgui.AlignFrame,~S,~S");
8257 Clazz_defineMethod (c$, "selectIn", 
8258 function (alf, sequenceIds, columns, sep) {
8259 if (sep == null || sep.length == 0) {
8260 sep = this.separator;
8261 } else {
8262 if (jalview.bin.JalviewLite.debug) {
8263 System.err.println ("Selecting region using separator string '" + this.separator + "'");
8264 }}var ids = this.separatorListToArray (sequenceIds, sep);
8265 var cols = this.separatorListToArray (columns, sep);
8266 var sel =  new jalview.datamodel.SequenceGroup ();
8267 var csel =  new jalview.datamodel.ColumnSelection ();
8268 var al = alf.viewport.getAlignment ();
8269 var matcher =  new jalview.analysis.SequenceIdMatcher (alf.viewport.getAlignment ().getSequencesArray ());
8270 var start = 0;
8271 var end = al.getWidth ();
8272 var alw = al.getWidth ();
8273 var seqsfound = true;
8274 if (ids != null && ids.length > 0) {
8275 seqsfound = false;
8276 for (var i = 0; i < ids.length; i++) {
8277 if (ids[i].trim ().length == 0) {
8278 continue;
8279 }var sq = matcher.findIdMatch (ids[i]);
8280 if (sq != null) {
8281 seqsfound = true;
8282 sel.addSequence (sq, false);
8283 }}
8284 }var inseqpos = false;
8285 if (cols != null && cols.length > 0) {
8286 var seset = false;
8287 for (var i = 0; i < cols.length; i++) {
8288 var cl = cols[i].trim ();
8289 if (cl.length == 0) {
8290 continue;
8291 }var p;
8292 if ((p = cl.indexOf ("-")) > -1) {
8293 var from = -1;
8294 var to = -1;
8295 try {
8296 from =  new Integer (cl.substring (0, p)).intValue ();
8297 from--;
8298 } catch (ex) {
8299 if (Clazz_exceptionOf (ex, NumberFormatException)) {
8300 System.err.println ("ERROR: Couldn't parse first integer in range element column selection string '" + cl + "' - format is 'from-to'");
8301 return;
8302 } else {
8303 throw ex;
8304 }
8305 }
8306 try {
8307 to =  new Integer (cl.substring (p + 1)).intValue ();
8308 to--;
8309 } catch (ex) {
8310 if (Clazz_exceptionOf (ex, NumberFormatException)) {
8311 System.err.println ("ERROR: Couldn't parse second integer in range element column selection string '" + cl + "' - format is 'from-to'");
8312 return;
8313 } else {
8314 throw ex;
8315 }
8316 }
8317 if (from >= 0 && to >= 0) {
8318 if (from < to) {
8319 var t = to;
8320 to = from;
8321 to = t;
8322 }if (!seset) {
8323 start = from;
8324 end = to;
8325 seset = true;
8326 } else {
8327 if (start > from) {
8328 start = from;
8329 }if (end < to) {
8330 end = to;
8331 }}for (var r = from; r <= to; r++) {
8332 if (r >= 0 && r < alw) {
8333 csel.addElement (r);
8334 }}
8335 if (jalview.bin.JalviewLite.debug) {
8336 System.err.println ("Range '" + cl + "' deparsed as [" + from + "," + to + "]");
8337 }} else {
8338 System.err.println ("ERROR: Invalid Range '" + cl + "' deparsed as [" + from + "," + to + "]");
8339 }} else {
8340 var r = -1;
8341 try {
8342 r =  new Integer (cl).intValue ();
8343 r--;
8344 } catch (ex) {
8345 if (Clazz_exceptionOf (ex, NumberFormatException)) {
8346 if (cl.toLowerCase ().equals ("sequence")) {
8347 inseqpos = true;
8348 } else {
8349 System.err.println ("ERROR: Couldn't parse integer from point selection element of column selection string '" + cl + "'");
8350 return;
8351 }} else {
8352 throw ex;
8353 }
8354 }
8355 if (r >= 0 && r <= alw) {
8356 if (!seset) {
8357 start = r;
8358 end = r;
8359 seset = true;
8360 } else {
8361 if (start > r) {
8362 start = r;
8363 }if (end < r) {
8364 end = r;
8365 }}csel.addElement (r);
8366 if (jalview.bin.JalviewLite.debug) {
8367 System.err.println ("Point selection '" + cl + "' deparsed as [" + r + "]");
8368 }} else {
8369 System.err.println ("ERROR: Invalid Point selection '" + cl + "' deparsed as [" + r + "]");
8370 }}}
8371 }if (seqsfound) {
8372 if (inseqpos && sel.getSize () > 0) {
8373 var rs = sel.getSequenceAt (0);
8374 start = rs.findIndex (start);
8375 end = rs.findIndex (end);
8376 if (csel != null) {
8377 var cs = csel.getSelected ();
8378 csel.clear ();
8379 for (var selectedCol, $selectedCol = cs.iterator (); $selectedCol.hasNext () && ((selectedCol = $selectedCol.next ()) || true);) {
8380 csel.addElement (rs.findIndex ((selectedCol).intValue ()));
8381 }
8382 }}sel.setStartRes (start);
8383 sel.setEndRes (end);
8384 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))));
8385 }}, "jalview.appletgui.AlignFrame,~S,~S,~S");
8386 Clazz_overrideMethod (c$, "getSelectedSequencesAsAlignment", 
8387 function (format, suffix) {
8388 return this.getSelectedSequencesAsAlignmentFrom (this.getDefaultTargetFrame (), format, suffix);
8389 }, "~S,~S");
8390 Clazz_overrideMethod (c$, "getSelectedSequencesAsAlignmentFrom", 
8391 function (alf, format, suffix) {
8392 try {
8393 var seqlimits = suffix.equalsIgnoreCase ("true");
8394 if (alf.viewport.getSelectionGroup () != null) {
8395 var reply =  new jalview.io.AppletFormatAdapter ().formatSequences (format,  new jalview.datamodel.Alignment (alf.viewport.getSelectionAsNewSequence ()), seqlimits);
8396 return reply;
8397 }} catch (ex) {
8398 if (Clazz_exceptionOf (ex, Exception)) {
8399 ex.printStackTrace ();
8400 return "Error retrieving alignment in " + format + " format. ";
8401 } else {
8402 throw ex;
8403 }
8404 }
8405 return "";
8406 }, "jalview.appletgui.AlignFrame,~S,~S");
8407 Clazz_overrideMethod (c$, "getAlignmentOrder", 
8408 function () {
8409 return this.getAlignmentOrderFrom (this.getDefaultTargetFrame ());
8410 });
8411 Clazz_defineMethod (c$, "getAlignmentOrderFrom", 
8412 function (alf) {
8413 return this.getAlignmentOrderFrom (alf, this.separator);
8414 }, "jalview.appletgui.AlignFrame");
8415 Clazz_defineMethod (c$, "getAlignmentOrderFrom", 
8416 function (alf, sep) {
8417 var alorder = alf.getAlignViewport ().getAlignment ();
8418 var order =  new Array (alorder.getHeight ());
8419 for (var i = 0; i < order.length; i++) {
8420 order[i] = alorder.getSequenceAt (i).getName ();
8421 }
8422 return this.arrayToSeparatorList (order);
8423 }, "jalview.appletgui.AlignFrame,~S");
8424 Clazz_defineMethod (c$, "orderBy", 
8425 function (order, undoName) {
8426 return this.orderBy (order, undoName, this.separator);
8427 }, "~S,~S");
8428 Clazz_defineMethod (c$, "orderBy", 
8429 function (order, undoName, sep) {
8430 return this.orderAlignmentBy (this.getDefaultTargetFrame (), order, undoName, sep);
8431 }, "~S,~S,~S");
8432 Clazz_overrideMethod (c$, "orderAlignmentBy", 
8433 function (alf, order, undoName, sep) {
8434 var ids = this.separatorListToArray (order, sep);
8435 var sqs = null;
8436 if (ids != null && ids.length > 0) {
8437 var matcher =  new jalview.analysis.SequenceIdMatcher (alf.viewport.getAlignment ().getSequencesArray ());
8438 var s = 0;
8439 sqs =  new Array (ids.length);
8440 for (var i = 0; i < ids.length; i++) {
8441 if (ids[i].trim ().length == 0) {
8442 continue;
8443 }var sq = matcher.findIdMatch (ids[i]);
8444 if (sq != null) {
8445 sqs[s++] = sq;
8446 }}
8447 if (s > 0) {
8448 var sqq =  new Array (s);
8449 System.arraycopy (sqs, 0, sqq, 0, s);
8450 sqs = sqq;
8451 } else {
8452 sqs = null;
8453 }}if (sqs == null) {
8454 return "";
8455 };var aorder =  new jalview.datamodel.AlignmentOrder (sqs);
8456 if (undoName != null && undoName.trim ().length == 0) {
8457 undoName = null;
8458 }var _undoName = undoName;
8459 return alf.sortBy (aorder, _undoName) ? "true" : "";
8460 }, "jalview.appletgui.AlignFrame,~S,~S,~S");
8461 Clazz_defineMethod (c$, "getAlignment", 
8462 function (format) {
8463 return this.getAlignmentFrom (this.getDefaultTargetFrame (), format, "true");
8464 }, "~S");
8465 Clazz_defineMethod (c$, "getAlignmentFrom", 
8466 function (alf, format) {
8467 return this.getAlignmentFrom (alf, format, "true");
8468 }, "jalview.appletgui.AlignFrame,~S");
8469 Clazz_defineMethod (c$, "getAlignment", 
8470 function (format, suffix) {
8471 return this.getAlignmentFrom (this.getDefaultTargetFrame (), format, suffix);
8472 }, "~S,~S");
8473 Clazz_defineMethod (c$, "getAlignmentFrom", 
8474 function (alf, format, suffix) {
8475 try {
8476 var seqlimits = suffix.equalsIgnoreCase ("true");
8477 var reply =  new jalview.io.AppletFormatAdapter ().formatSequences (format, alf.viewport.getAlignment (), seqlimits);
8478 return reply;
8479 } catch (ex) {
8480 if (Clazz_exceptionOf (ex, Exception)) {
8481 ex.printStackTrace ();
8482 return "Error retrieving alignment in " + format + " format. ";
8483 } else {
8484 throw ex;
8485 }
8486 }
8487 }, "jalview.appletgui.AlignFrame,~S,~S");
8488 Clazz_overrideMethod (c$, "loadAnnotation", 
8489 function (annotation) {
8490 this.loadAnnotationFrom (this.getDefaultTargetFrame (), annotation);
8491 }, "~S");
8492 Clazz_overrideMethod (c$, "loadAnnotationFrom", 
8493 function (alf, annotation) {
8494 if ( new jalview.io.AnnotationFile ().annotateAlignmentView (alf.getAlignViewport (), annotation, jalview.io.AppletFormatAdapter.PASTE)) {
8495 alf.alignPanel.fontChanged ();
8496 alf.alignPanel.setScrollValues (0, 0);
8497 } else {
8498 alf.parseFeaturesFile (annotation, jalview.io.AppletFormatAdapter.PASTE);
8499 }}, "jalview.appletgui.AlignFrame,~S");
8500 Clazz_overrideMethod (c$, "loadFeatures", 
8501 function (features, autoenabledisplay) {
8502 this.loadFeaturesFrom (this.getDefaultTargetFrame (), features, autoenabledisplay);
8503 }, "~S,~B");
8504 Clazz_overrideMethod (c$, "loadFeaturesFrom", 
8505 function (alf, features, autoenabledisplay) {
8506 return alf.parseFeaturesFile (features, jalview.io.AppletFormatAdapter.PASTE, autoenabledisplay);
8507 }, "jalview.appletgui.AlignFrame,~S,~B");
8508 Clazz_overrideMethod (c$, "getFeatures", 
8509 function (format) {
8510 return this.getFeaturesFrom (this.getDefaultTargetFrame (), format);
8511 }, "~S");
8512 Clazz_overrideMethod (c$, "getFeaturesFrom", 
8513 function (alf, format) {
8514 return alf.outputFeatures (false, format);
8515 }, "jalview.appletgui.AlignFrame,~S");
8516 Clazz_overrideMethod (c$, "getAnnotation", 
8517 function () {
8518 return this.getAnnotationFrom (this.getDefaultTargetFrame ());
8519 });
8520 Clazz_overrideMethod (c$, "getAnnotationFrom", 
8521 function (alf) {
8522 return alf.outputAnnotations (false);
8523 }, "jalview.appletgui.AlignFrame");
8524 Clazz_defineMethod (c$, "newView", 
8525 function () {
8526 return this.newViewFrom (this.getDefaultTargetFrame ());
8527 });
8528 Clazz_defineMethod (c$, "newView", 
8529 function (name) {
8530 return this.newViewFrom (this.getDefaultTargetFrame (), name);
8531 }, "~S");
8532 Clazz_defineMethod (c$, "newViewFrom", 
8533 function (alf) {
8534 return alf.newView (null);
8535 }, "jalview.appletgui.AlignFrame");
8536 Clazz_defineMethod (c$, "newViewFrom", 
8537 function (alf, name) {
8538 return alf.newView (name);
8539 }, "jalview.appletgui.AlignFrame,~S");
8540 Clazz_overrideMethod (c$, "loadAlignment", 
8541 function (text, title) {
8542 var al = null;
8543 var format =  new jalview.io.IdentifyFile ().Identify (text, jalview.io.AppletFormatAdapter.PASTE);
8544 try {
8545 al =  new jalview.io.AppletFormatAdapter ().readFile (text, jalview.io.AppletFormatAdapter.PASTE, format);
8546 if (al.getHeight () > 0) {
8547 return  new jalview.appletgui.AlignFrame (al, this, title, false);
8548 }} catch (ex) {
8549 if (Clazz_exceptionOf (ex, java.io.IOException)) {
8550 ex.printStackTrace ();
8551 } else {
8552 throw ex;
8553 }
8554 }
8555 return null;
8556 }, "~S,~S");
8557 Clazz_defineMethod (c$, "setMouseoverListener", 
8558 function (listener) {
8559 this.setMouseoverListener (this.currentAlignFrame, listener);
8560 }, "~S");
8561 Clazz_defineMethod (c$, "setMouseoverListener", 
8562 function (af, listener) {
8563 if (listener != null) {
8564 listener = listener.trim ();
8565 if (listener.length == 0) {
8566 System.err.println ("jalview Javascript error: Ignoring empty function for mouseover listener.");
8567 return;
8568 }}var mol =  new jalview.javascript.MouseOverListener (this, af, listener);
8569 this.javascriptListeners.addElement (mol);
8570 jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).addStructureViewerListener (mol);
8571 if (jalview.bin.JalviewLite.debug) {
8572 System.err.println ("Added a mouseover listener for " + ((af == null) ? "All frames" : "Just views for " + af.getAlignViewport ().getSequenceSetId ()));
8573 System.err.println ("There are now " + this.javascriptListeners.size () + " listeners in total.");
8574 }}, "jalview.appletgui.AlignFrame,~S");
8575 Clazz_defineMethod (c$, "setSelectionListener", 
8576 function (listener) {
8577 this.setSelectionListener (null, listener);
8578 }, "~S");
8579 Clazz_defineMethod (c$, "setSelectionListener", 
8580 function (af, listener) {
8581 if (listener != null) {
8582 listener = listener.trim ();
8583 if (listener.length == 0) {
8584 System.err.println ("jalview Javascript error: Ignoring empty function for selection listener.");
8585 return;
8586 }}var mol =  new jalview.javascript.JsSelectionSender (this, af, listener);
8587 this.javascriptListeners.addElement (mol);
8588 jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).addSelectionListener (mol);
8589 if (jalview.bin.JalviewLite.debug) {
8590 System.err.println ("Added a selection listener for " + ((af == null) ? "All frames" : "Just views for " + af.getAlignViewport ().getSequenceSetId ()));
8591 System.err.println ("There are now " + this.javascriptListeners.size () + " listeners in total.");
8592 }}, "jalview.appletgui.AlignFrame,~S");
8593 Clazz_overrideMethod (c$, "setStructureListener", 
8594 function (listener, modelSet) {
8595 if (listener != null) {
8596 listener = listener.trim ();
8597 if (listener.length == 0) {
8598 System.err.println ("jalview Javascript error: Ignoring empty function for selection listener.");
8599 return;
8600 }}var mol =  new jalview.javascript.MouseOverStructureListener (this, listener, this.separatorListToArray (modelSet));
8601 this.javascriptListeners.addElement (mol);
8602 jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).addStructureViewerListener (mol);
8603 if (jalview.bin.JalviewLite.debug) {
8604 System.err.println ("Added a javascript structure viewer listener '" + listener + "'");
8605 System.err.println ("There are now " + this.javascriptListeners.size () + " listeners in total.");
8606 }}, "~S,~S");
8607 Clazz_overrideMethod (c$, "removeJavascriptListener", 
8608 function (af, listener) {
8609 if (listener != null) {
8610 listener = listener.trim ();
8611 if (listener.length == 0) {
8612 listener = null;
8613 }}var rprt = false;
8614 for (var ms = 0, msSize = this.javascriptListeners.size (); ms < msSize; ) {
8615 var lstn = this.javascriptListeners.elementAt (ms);
8616 var lstner = lstn;
8617 if ((af == null || lstner.getAlignFrame () === af) && (listener == null || lstner.getListenerFunction ().equals (listener))) {
8618 this.javascriptListeners.removeElement (lstner);
8619 msSize--;
8620 if (Clazz_instanceOf (lstner, jalview.structure.SelectionListener)) {
8621 jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).removeSelectionListener (lstner);
8622 } else {
8623 jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).removeStructureViewerListener (lstner, null);
8624 }rprt = jalview.bin.JalviewLite.debug;
8625 if (jalview.bin.JalviewLite.debug) {
8626 System.err.println ("Removed listener '" + listener + "'");
8627 }} else {
8628 ms++;
8629 }}
8630 if (rprt) {
8631 System.err.println ("There are now " + this.javascriptListeners.size () + " listeners in total.");
8632 }}, "jalview.appletgui.AlignFrame,~S");
8633 Clazz_overrideMethod (c$, "stop", 
8634 function () {
8635 System.err.println ("Applet " + this.getName () + " stop().");
8636 this.tidyUp ();
8637 });
8638 Clazz_overrideMethod (c$, "destroy", 
8639 function () {
8640 System.err.println ("Applet " + this.getName () + " destroy().");
8641 this.tidyUp ();
8642 });
8643 Clazz_defineMethod (c$, "tidyUp", 
8644  function () {
8645 this.removeAll ();
8646 if (this.currentAlignFrame != null && this.currentAlignFrame.viewport != null && this.currentAlignFrame.viewport.applet != null) {
8647 var av = this.currentAlignFrame.viewport;
8648 this.currentAlignFrame.closeMenuItem_actionPerformed ();
8649 av.applet = null;
8650 this.currentAlignFrame = null;
8651 }if (this.javascriptListeners != null) {
8652 while (this.javascriptListeners.size () > 0) {
8653 var mol = this.javascriptListeners.elementAt (0);
8654 this.javascriptListeners.removeElement (mol);
8655 if (Clazz_instanceOf (mol, jalview.structure.SelectionListener)) {
8656 jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).removeSelectionListener (mol);
8657 } else {
8658 jalview.structure.StructureSelectionManager.getStructureSelectionManager (this).removeStructureViewerListener (mol, null);
8659 }mol.jvlite = null;
8660 }
8661 }if (this.jsFunctionExec != null) {
8662 this.jsFunctionExec.stopQueue ();
8663 this.jsFunctionExec.jvlite = null;
8664 }this.initialAlignFrame = null;
8665 this.jsFunctionExec = null;
8666 this.javascriptListeners = null;
8667 jalview.structure.StructureSelectionManager.release (this);
8668 });
8669 Clazz_overrideMethod (c$, "mouseOverStructure", 
8670 function (pdbResNum, chain, pdbfile) {
8671 var me = this;
8672 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))));
8673 }, "~S,~S,~S");
8674 Clazz_overrideMethod (c$, "scrollViewToIn", 
8675 function (alf, topRow, leftHandColumn) {
8676 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))));
8677 }, "jalview.appletgui.AlignFrame,~S,~S");
8678 Clazz_overrideMethod (c$, "scrollViewToRowIn", 
8679 function (alf, topRow) {
8680 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))));
8681 }, "jalview.appletgui.AlignFrame,~S");
8682 Clazz_overrideMethod (c$, "scrollViewToColumnIn", 
8683 function (alf, leftHandColumn) {
8684 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))));
8685 }, "jalview.appletgui.AlignFrame,~S");
8686 c$.initBuildDetails = Clazz_defineMethod (c$, "initBuildDetails", 
8687  function () {
8688 if (jalview.bin.JalviewLite.builddate == null) {
8689 jalview.bin.JalviewLite.builddate = "unknown";
8690 jalview.bin.JalviewLite.version = "test";
8691 jalview.bin.JalviewLite.installation = "Webstart";
8692 var url = jalview.bin.JalviewLite.getResource ("/.build_properties");
8693 if (url != null) {
8694 try {
8695 var reader =  new java.io.BufferedReader ( new java.io.InputStreamReader (url.openStream ()));
8696 var line;
8697 while ((line = reader.readLine ()) != null) {
8698 if (line.indexOf ("VERSION") > -1) {
8699 jalview.bin.JalviewLite.version = line.substring (line.indexOf ("=") + 1);
8700 }if (line.indexOf ("BUILD_DATE") > -1) {
8701 jalview.bin.JalviewLite.builddate = line.substring (line.indexOf ("=") + 1);
8702 }if (line.indexOf ("INSTALLATION") > -1) {
8703 jalview.bin.JalviewLite.installation = line.substring (line.indexOf ("=") + 1);
8704 }}
8705 } catch (ex) {
8706 if (Clazz_exceptionOf (ex, Exception)) {
8707 ex.printStackTrace ();
8708 } else {
8709 throw ex;
8710 }
8711 }
8712 }}});
8713 c$.getBuildDate = Clazz_defineMethod (c$, "getBuildDate", 
8714 function () {
8715 jalview.bin.JalviewLite.initBuildDetails ();
8716 return jalview.bin.JalviewLite.builddate;
8717 });
8718 c$.getInstallation = Clazz_defineMethod (c$, "getInstallation", 
8719 function () {
8720 jalview.bin.JalviewLite.initBuildDetails ();
8721 return jalview.bin.JalviewLite.installation;
8722 });
8723 c$.getVersion = Clazz_defineMethod (c$, "getVersion", 
8724 function () {
8725 jalview.bin.JalviewLite.initBuildDetails ();
8726 return jalview.bin.JalviewLite.version;
8727 });
8728 Clazz_overrideMethod (c$, "init", 
8729 function () {
8730 this.setParams ();
8731 try {
8732 if (jalview.bin.JalviewLite.debug) {
8733 System.err.println ("Applet context is '" + this.getAppletContext ().getClass ().toString () + "'");
8734 }var scriptObject = netscape.javascript.JSObject.getWindow (this);
8735 if (jalview.bin.JalviewLite.debug && scriptObject != null) {
8736 System.err.println ("Applet has Javascript callback support.");
8737 }} catch (ex) {
8738 if (Clazz_exceptionOf (ex, Exception)) {
8739 System.err.println ("Warning: No JalviewLite javascript callbacks available.");
8740 if (jalview.bin.JalviewLite.debug) {
8741 ex.printStackTrace ();
8742 }} else {
8743 throw ex;
8744 }
8745 }
8746 if (jalview.bin.JalviewLite.debug) {
8747 System.err.println ("JalviewLite Version " + jalview.bin.JalviewLite.getVersion ());
8748 System.err.println ("Build Date : " + jalview.bin.JalviewLite.getBuildDate ());
8749 System.err.println ("Installation : " + jalview.bin.JalviewLite.getInstallation ());
8750 }if (this.externalstructureviewer != null) {
8751 this.useXtrnalSviewer = this.externalstructureviewer.trim ().toLowerCase ().equals ("true");
8752 }if (this.sep != null) {
8753 if (this.sep.length > 0) {
8754 this.separator = this.sep;
8755 if (jalview.bin.JalviewLite.debug) {
8756 System.err.println ("Separator set to '" + this.separator + "'");
8757 }} else {
8758 throw  new Error (jalview.util.MessageManager.getString ("error.invalid_separator_parameter"));
8759 }}var r = 255;
8760 var g = 255;
8761 var b = 255;
8762 if (this.rgb != null) {
8763 try {
8764 r = Integer.parseInt (this.rgb.substring (0, 2), 16);
8765 g = Integer.parseInt (this.rgb.substring (2, 4), 16);
8766 b = Integer.parseInt (this.rgb.substring (4, 6), 16);
8767 } catch (ex) {
8768 if (Clazz_exceptionOf (ex, Exception)) {
8769 r = 255;
8770 g = 255;
8771 b = 255;
8772 } else {
8773 throw ex;
8774 }
8775 }
8776 }this.rgb = this.labelColour;
8777 if (this.rgb != null) {
8778 this.launcher.setLabel (this.rgb);
8779 }this.setBackground ( new java.awt.Color (r, g, b));
8780 if (this.startupFile == null) {
8781 var data =  new StringBuffer ("PASTE");
8782 var i = 1;
8783 while ((this.startupFile = this.getParameter ("sequence" + i)) != null) {
8784 data.append (this.startupFile.toString () + "\n");
8785 i++;
8786 }
8787 if (data.length () > 5) {
8788 this.startupFile = data.toString ();
8789 }}if (!this.enableSplitFrame) {
8790 this.file2 = null;
8791 }if (this.embedded) {
8792 var loader = Clazz_innerTypeInstance (jalview.bin.JalviewLite.LoadingThread, this, null, this.startupFile, this.file2, this);
8793 {
8794 loader.run();
8795 }} else if (this.startupFile != null) {
8796 if (!this.showButton) {
8797 var loader = Clazz_innerTypeInstance (jalview.bin.JalviewLite.LoadingThread, this, null, this.startupFile, this.file2, this);
8798 loader.start ();
8799 } else {
8800 this.add (this.launcher);
8801 this.launcher.addActionListener (((Clazz_isClassDefined ("jalview.bin.JalviewLite$8") ? 0 : jalview.bin.JalviewLite.$JalviewLite$8$ ()), Clazz_innerTypeInstance (jalview.bin.JalviewLite$8, this, null)));
8802 }} else {
8803 this.startupFile = "NO FILE";
8804 this.fileFound = false;
8805 this.callInitCallback ();
8806 }});
8807 Clazz_defineMethod (c$, "initLiveConnect", 
8808  function () {
8809 var notFailed = false;
8810 var tries = 0;
8811 while (!notFailed && tries < 10) {
8812 if (tries > 0) {
8813 System.err.println ("LiveConnect request thread going to sleep.");
8814 }try {
8815 Thread.sleep (700 * (1 + tries));
8816 } catch (q) {
8817 if (Clazz_exceptionOf (q, InterruptedException)) {
8818 } else {
8819 throw q;
8820 }
8821 }
8822 ;if (tries++ > 0) {
8823 System.err.println ("LiveConnect request thread woken up.");
8824 }try {
8825 var scriptObject = netscape.javascript.JSObject.getWindow (this);
8826 if (scriptObject.eval ("navigator") != null) {
8827 notFailed = true;
8828 }} catch (jsex) {
8829 if (Clazz_exceptionOf (jsex, Exception)) {
8830 System.err.println ("Attempt " + tries + " to access LiveConnect javascript failed.");
8831 } else {
8832 throw jsex;
8833 }
8834 }
8835 }
8836 });
8837 Clazz_defineMethod (c$, "callInitCallback", 
8838  function () {
8839 if (this.initjscallback == null) {
8840 return;
8841 }this.initjscallback = this.initjscallback.trim ();
8842 if (this.initjscallback.length > 0) {
8843 var scriptObject = null;
8844 try {
8845 scriptObject = netscape.javascript.JSObject.getWindow (this);
8846 } catch (ex) {
8847 if (Clazz_exceptionOf (ex, Exception)) {
8848 } else {
8849 throw ex;
8850 }
8851 }
8852 ;this.initLiveConnect ();
8853 if (scriptObject != null) {
8854 try {
8855  new jalview.javascript.JSFunctionExec (this).executeJavascriptFunction (true, this.initjscallback, null, "Calling oninit callback '" + this.initjscallback + "'.");
8856 } catch (e) {
8857 if (Clazz_exceptionOf (e, Exception)) {
8858 System.err.println ("Exception when executing _oninit callback '" + this.initjscallback + "'.");
8859 e.printStackTrace ();
8860 } else {
8861 throw e;
8862 }
8863 }
8864 } else {
8865 System.err.println ("Not executing _oninit callback '" + this.initjscallback + "' - no scripting allowed.");
8866 }}});
8867 c$.addFrame = Clazz_defineMethod (c$, "addFrame", 
8868 function (frame, title, width, height) {
8869 frame.setLocation (jalview.bin.JalviewLite.lastFrameX, jalview.bin.JalviewLite.lastFrameY);
8870 jalview.bin.JalviewLite.lastFrameX += 40;
8871 jalview.bin.JalviewLite.lastFrameY += 40;
8872 frame.setSize (width, height);
8873 frame.setTitle (title);
8874 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))));
8875 frame.setVisible (true);
8876 }, "javax.swing.JFrame,~S,~N,~N");
8877 Clazz_defineMethod (c$, "paintComponent", 
8878 function (g) {
8879 if (!this.fileFound) {
8880 g.setColor ( new java.awt.Color (200, 200, 200));
8881 g.setColor (java.awt.Color.cyan);
8882 g.fillRect (0, 0, this.getSize ().width, this.getSize ().height);
8883 g.setColor (java.awt.Color.red);
8884 awt2swing.Util.drawString (g, jalview.util.MessageManager.getString ("label.jalview_cannot_open_file"), 5, 15);
8885 awt2swing.Util.drawString (g, "\"" + this.startupFile + "\"", 5, 30);
8886 } else if (this.embedded && !this.haveShownLoadMessage) {
8887 g.setColor (java.awt.Color.black);
8888 g.setFont ( new java.awt.Font ("Arial", 1, 24));
8889 awt2swing.Util.drawString (g, jalview.util.MessageManager.getString ("label.jalview_applet"), 50, Clazz_doubleToInt (this.getSize ().height / 2) - 30);
8890 awt2swing.Util.drawString (g, jalview.util.MessageManager.getString ("label.loading_data") + "...", 50, Clazz_doubleToInt (this.getSize ().height / 2));
8891 this.haveShownLoadMessage = true;
8892 }}, "java.awt.Graphics");
8893 Clazz_defineMethod (c$, "getAppletWindow", 
8894 function (class1) {
8895 var wnds =  new java.util.Vector ();
8896 var cmp = this.getComponents ();
8897 if (cmp != null) {
8898 for (var i = 0; i < cmp.length; i++) {
8899 if (class1.isAssignableFrom (cmp[i].getClass ())) {
8900 wnds.addElement (cmp);
8901 }}
8902 }return wnds;
8903 }, "Class");
8904 Clazz_defineMethod (c$, "getDefaultTargetFrame", 
8905 function () {
8906 if (this.currentAlignFrame != null) {
8907 return this.currentAlignFrame;
8908 }if (this.initialAlignFrame != null) {
8909 return this.initialAlignFrame;
8910 }System.err.println ("Implementation error: Jalview Applet API cannot work out which AlignFrame to use.");
8911 return null;
8912 });
8913 Clazz_defineMethod (c$, "separatorListToArray", 
8914 function (list) {
8915 return this.separatorListToArray (list, this.separator);
8916 }, "~S");
8917 Clazz_defineMethod (c$, "separatorListToArray", 
8918 function (list, separator) {
8919 var seplen = separator.length;
8920 if (list == null || list.equals ("") || list.equals (separator)) {
8921 return null;
8922 }var jv =  new java.util.Vector ();
8923 var cp = 0;
8924 var pos;
8925 while ((pos = list.indexOf (separator, cp)) > cp) {
8926 jv.addElement (list.substring (cp, pos));
8927 cp = pos + seplen;
8928 }
8929 if (cp < list.length) {
8930 var c = list.substring (cp);
8931 if (!c.equals (separator)) {
8932 jv.addElement (c);
8933 }}if (jv.size () > 0) {
8934 var v =  new Array (jv.size ());
8935 for (var i = 0; i < v.length; i++) {
8936 v[i] = jv.elementAt (i);
8937 }
8938 jv.removeAllElements ();
8939 if (jalview.bin.JalviewLite.debug) {
8940 System.err.println ("Array from '" + separator + "' separated List:\n" + v.length);
8941 for (var i = 0; i < v.length; i++) {
8942 System.err.println ("item " + i + " '" + v[i] + "'");
8943 }
8944 }return v;
8945 }if (jalview.bin.JalviewLite.debug) {
8946 System.err.println ("Empty Array from '" + separator + "' separated List");
8947 }return null;
8948 }, "~S,~S");
8949 Clazz_defineMethod (c$, "arrayToSeparatorList", 
8950 function (list) {
8951 return this.arrayToSeparatorList (list, this.separator);
8952 }, "~A");
8953 Clazz_defineMethod (c$, "arrayToSeparatorList", 
8954 function (list, separator) {
8955 var v =  new StringBuffer ();
8956 if (list != null && list.length > 0) {
8957 for (var i = 0, iSize = list.length; i < iSize; i++) {
8958 if (list[i] != null) {
8959 if (i > 0) {
8960 v.append (separator);
8961 }v.append (list[i]);
8962 }}
8963 if (jalview.bin.JalviewLite.debug) {
8964 System.err.println ("Returning '" + separator + "' separated List:\n");
8965 System.err.println (v);
8966 }return v.toString ();
8967 }if (jalview.bin.JalviewLite.debug) {
8968 System.err.println ("Returning empty '" + separator + "' separated List\n");
8969 }return "" + separator;
8970 }, "~A,~S");
8971 Clazz_overrideMethod (c$, "getFeatureGroups", 
8972 function () {
8973 var lst = this.arrayToSeparatorList (this.getDefaultTargetFrame ().getFeatureGroups ());
8974 return lst;
8975 });
8976 Clazz_overrideMethod (c$, "getFeatureGroupsOn", 
8977 function (alf) {
8978 var lst = this.arrayToSeparatorList (alf.getFeatureGroups ());
8979 return lst;
8980 }, "jalview.appletgui.AlignFrame");
8981 Clazz_overrideMethod (c$, "getFeatureGroupsOfState", 
8982 function (visible) {
8983 return this.arrayToSeparatorList (this.getDefaultTargetFrame ().getFeatureGroupsOfState (visible));
8984 }, "~B");
8985 Clazz_overrideMethod (c$, "getFeatureGroupsOfStateOn", 
8986 function (alf, visible) {
8987 return this.arrayToSeparatorList (alf.getFeatureGroupsOfState (visible));
8988 }, "jalview.appletgui.AlignFrame,~B");
8989 Clazz_overrideMethod (c$, "setFeatureGroupStateOn", 
8990 function (alf, groups, state) {
8991 var st = state;
8992 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))));
8993 }, "jalview.appletgui.AlignFrame,~S,~B");
8994 Clazz_overrideMethod (c$, "setFeatureGroupState", 
8995 function (groups, state) {
8996 this.setFeatureGroupStateOn (this.getDefaultTargetFrame (), groups, state);
8997 }, "~S,~B");
8998 Clazz_overrideMethod (c$, "getSeparator", 
8999 function () {
9000 return this.separator;
9001 });
9002 Clazz_overrideMethod (c$, "setSeparator", 
9003 function (separator) {
9004 if (separator == null || separator.length < 1) {
9005 separator = "\u00ac";
9006 }this.separator = separator;
9007 if (jalview.bin.JalviewLite.debug) {
9008 System.err.println ("Default Separator now: '" + separator + "'");
9009 }}, "~S");
9010 Clazz_overrideMethod (c$, "addPdbFile", 
9011 function (alFrame, sequenceId, pdbEntryString, pdbFile) {
9012 return alFrame.addPdbFile (sequenceId, pdbEntryString, pdbFile);
9013 }, "jalview.appletgui.AlignFrame,~S,~S,~S");
9014 Clazz_defineMethod (c$, "setAlignPdbStructures", 
9015 function (alignPdbStructures) {
9016 this.alignPdbStructures = alignPdbStructures;
9017 }, "~B");
9018 Clazz_defineMethod (c$, "isAlignPdbStructures", 
9019 function () {
9020 return this.alignPdbStructures;
9021 });
9022 Clazz_overrideMethod (c$, "start", 
9023 function () {
9024 });
9025 Clazz_defineMethod (c$, "setJsMessageSet", 
9026 function (messageclass, viewId, colcommands) {
9027 var msgset = this.jsmessages.get (messageclass);
9028 if (msgset == null) {
9029 msgset =  new java.util.Hashtable ();
9030 this.jsmessages.put (messageclass, msgset);
9031 }msgset.put (viewId, colcommands);
9032 var l =  Clazz_newLongArray (colcommands.length, 0);
9033 for (var i = 0; i < colcommands.length; i++) {
9034 l[i] = colcommands[i].hashCode ();
9035 }
9036 this.jshashes.put (messageclass + "|" + viewId, l);
9037 }, "~S,~S,~A");
9038 Clazz_overrideMethod (c$, "getJsMessage", 
9039 function (messageclass, viewId) {
9040 var msgset = this.jsmessages.get (messageclass);
9041 if (msgset != null) {
9042 var msgs = msgset.get (viewId);
9043 if (msgs != null) {
9044 for (var i = 0; i < msgs.length; i++) {
9045 if (msgs[i] != null) {
9046 var m = msgs[i];
9047 msgs[i] = null;
9048 return m;
9049 }}
9050 }}return "";
9051 }, "~S,~S");
9052 Clazz_defineMethod (c$, "isJsMessageSetChanged", 
9053 function (string, string2, colcommands) {
9054 var l = this.jshashes.get (string + "|" + string2);
9055 if (l == null && colcommands != null) {
9056 return true;
9057 }for (var i = 0; i < colcommands.length; i++) {
9058 if (l[i] != colcommands[i].hashCode ()) {
9059 return true;
9060 }}
9061 return false;
9062 }, "~S,~S,~A");
9063 Clazz_defineMethod (c$, "getJsExecQueue", 
9064 function () {
9065 return this.jsExecQueue;
9066 });
9067 Clazz_defineMethod (c$, "setExecutor", 
9068 function (jsFunctionExec2) {
9069 this.jsFunctionExec = jsFunctionExec2;
9070 }, "jalview.javascript.JSFunctionExec");
9071 Clazz_defineMethod (c$, "getDefaultColourParameter", 
9072 function (colparam, defcolour) {
9073 var colprop = this.getParameter (colparam);
9074 if (colprop == null || colprop.trim ().length == 0) {
9075 return defcolour;
9076 }var col = jalview.schemes.ColourSchemeProperty.getAWTColorFromName (colprop);
9077 if (col == null) {
9078 try {
9079 col =  new jalview.schemes.UserColourScheme (colprop).findColour ('A');
9080 } catch (ex) {
9081 if (Clazz_exceptionOf (ex, Exception)) {
9082 System.err.println ("Couldn't parse '" + colprop + "' as a colour for " + colparam);
9083 col = null;
9084 } else {
9085 throw ex;
9086 }
9087 }
9088 }return (col == null) ? defcolour : col;
9089 }, "~S,java.awt.Color");
9090 Clazz_defineMethod (c$, "openJalviewHelpUrl", 
9091 function () {
9092 if (this.helpUrl == null || this.helpUrl.trim ().length < 5) {
9093 this.helpUrl = "http://www.jalview.org/help.html";
9094 }this.showURL (this.helpUrl, "HELP");
9095 });
9096 Clazz_defineMethod (c$, "resolveUrlForLocalOrAbsolute", 
9097  function (url, localref) {
9098 var codebase = localref.toString ();
9099 var pt = codebase.indexOf ("?");
9100 if (pt < 0) pt = codebase.length;
9101 codebase = codebase.substring (0, pt);
9102 codebase = codebase.substring (0, codebase.lastIndexOf ("/") + 1);
9103 if (url.indexOf ("/") == 0 && !localref.getProtocol ().equals ("file")) {
9104 pt = codebase.indexOf ("/", 8);
9105 return codebase.substring (0, pt) + url;
9106 }return codebase + url;
9107 }, "~S,java.net.URL");
9108 Clazz_defineMethod (c$, "showURL", 
9109 function (url, target) {
9110 try {
9111 if (url.indexOf (":") == -1) {
9112 var prepend;
9113 url = this.resolveUrlForLocalOrAbsolute (url, prepend = this.getDefaultParameter ("resolvetocodebase", false) ? this.getDocumentBase () : this.getCodeBase ());
9114 if (jalview.bin.JalviewLite.debug) {
9115 System.err.println ("Show url (prepended " + prepend + " - toggle resolvetocodebase if code/docbase resolution is wrong): " + url);
9116 }} else {
9117 if (jalview.bin.JalviewLite.debug) {
9118 System.err.println ("Show url: " + url);
9119 }}if (url.indexOf ("javascript:") == 0) {
9120 this.getAppletContext ().showDocument ( new java.net.URL (url));
9121 } else {
9122 this.getAppletContext ().showDocument ( new java.net.URL (url), target);
9123 }} catch (ex) {
9124 if (Clazz_exceptionOf (ex, Exception)) {
9125 ex.printStackTrace ();
9126 } else {
9127 throw ex;
9128 }
9129 }
9130 }, "~S,~S");
9131 c$.$JalviewLite$LoadJmolThread$ = function () {
9132 Clazz_pu$h(self.c$);
9133 c$ = Clazz_decorateAsClass (function () {
9134 Clazz_prepareCallback (this, arguments);
9135 this.running = false;
9136 Clazz_instantialize (this, arguments);
9137 }, jalview.bin.JalviewLite, "LoadJmolThread", Thread);
9138 Clazz_overrideMethod (c$, "run", 
9139 function () {
9140 if (this.running || this.b$["jalview.bin.JalviewLite"].checkedForJmol) {
9141 return;
9142 }this.running = true;
9143 if (this.b$["jalview.bin.JalviewLite"].checkForJmol) {
9144 try {
9145 if (!System.getProperty ("java.version").startsWith ("1.1")) {
9146 Clazz._4Name ("org.jmol.adapter.smarter.SmarterJmolAdapter");
9147 this.b$["jalview.bin.JalviewLite"].jmolAvailable = true;
9148 }if (!this.b$["jalview.bin.JalviewLite"].jmolAvailable) {
9149 System.out.println ("Jmol not available - Using MCview for structures");
9150 }} catch (ex) {
9151 if (Clazz_exceptionOf (ex, ClassNotFoundException)) {
9152 } else {
9153 throw ex;
9154 }
9155 }
9156 } else {
9157 this.b$["jalview.bin.JalviewLite"].jmolAvailable = false;
9158 if (jalview.bin.JalviewLite.debug) {
9159 System.err.println ("Skipping Jmol check. Will use MCView (probably)");
9160 }}this.b$["jalview.bin.JalviewLite"].checkedForJmol = true;
9161 this.running = false;
9162 });
9163 Clazz_defineMethod (c$, "notFinished", 
9164 function () {
9165 return this.running || !this.b$["jalview.bin.JalviewLite"].checkedForJmol;
9166 });
9167 c$ = Clazz_p0p ();
9168 };
9169 c$.$JalviewLite$LoadingThread$ = function () {
9170 Clazz_pu$h(self.c$);
9171 c$ = Clazz_decorateAsClass (function () {
9172 Clazz_prepareCallback (this, arguments);
9173 this.protocol = null;
9174 this._file = null;
9175 this._file2 = null;
9176 this.applet = null;
9177 Clazz_instantialize (this, arguments);
9178 }, jalview.bin.JalviewLite, "LoadingThread", Thread);
9179 Clazz_defineMethod (c$, "dbgMsg", 
9180  function (a) {
9181 if (jalview.bin.JalviewLite.debug) {
9182 System.err.println (a);
9183 }}, "~S");
9184 Clazz_defineMethod (c$, "setProtocolState", 
9185 function (a) {
9186 if (a.startsWith ("PASTE")) {
9187 a = a.substring (5);
9188 this.protocol = jalview.io.AppletFormatAdapter.PASTE;
9189 } else if (this.inArchive (a)) {
9190 this.protocol = jalview.io.AppletFormatAdapter.CLASSLOADER;
9191 } else {
9192 a = this.addProtocol (a);
9193 this.protocol = jalview.io.AppletFormatAdapter.URL;
9194 }this.dbgMsg ("Protocol identified as '" + this.protocol + "'");
9195 return a;
9196 }, "~S");
9197 Clazz_makeConstructor (c$, 
9198 function (a, b, c) {
9199 Clazz_superConstructor (this, jalview.bin.JalviewLite.LoadingThread, []);
9200 this._file = a;
9201 this._file2 = b;
9202 this.applet = c;
9203 }, "~S,~S,jalview.bin.JalviewLite");
9204 Clazz_overrideMethod (c$, "run", 
9205 function () {
9206 {
9207 System.out.println("BYPASSING JMOL LOADING FOR NOW. THIS WILL BE DONE ANOTHER WAY")
9208 }this.startLoading ();
9209 });
9210 Clazz_defineMethod (c$, "startLoading", 
9211  function () {
9212 this.dbgMsg ("Loading thread started with:\n>>file\n" + this._file + ">>endfile");
9213 this.dbgMsg ("Loading started.");
9214 var a = this.readAlignment (this._file);
9215 var b = this.readAlignment (this._file2);
9216 if (a != null) {
9217 this.addToDisplay (a, b);
9218 this.loadTree (a);
9219 this.loadScoreFile (a);
9220 this.loadFeatures (a);
9221 this.loadAnnotations (a);
9222 this.loadJnetFile (a);
9223 this.loadPdbFiles (a);
9224 } else {
9225 this.b$["jalview.bin.JalviewLite"].fileFound = false;
9226 this.applet.remove (this.b$["jalview.bin.JalviewLite"].launcher);
9227 this.applet.repaint ();
9228 }this.b$["jalview.bin.JalviewLite"].callInitCallback ();
9229 });
9230 Clazz_defineMethod (c$, "addToDisplay", 
9231 function (a, b) {
9232 if (b == null) {
9233 a.addToDisplay (this.b$["jalview.bin.JalviewLite"].embedded);
9234 } else {
9235 var c =  new jalview.appletgui.SplitFrame (a, b);
9236 c.addToDisplay (this.b$["jalview.bin.JalviewLite"].embedded, this.b$["jalview.bin.JalviewLite"]);
9237 }}, "jalview.appletgui.AlignFrame,jalview.appletgui.AlignFrame");
9238 Clazz_defineMethod (c$, "readAlignment", 
9239 function (a) {
9240 if (a == null) {
9241 return null;
9242 }var b = this.setProtocolState (a);
9243 var c =  new jalview.io.IdentifyFile ().Identify (b, this.protocol);
9244 this.dbgMsg ("File identified as '" + c + "'");
9245 var d = null;
9246 try {
9247 d =  new jalview.io.AppletFormatAdapter ().readFile (b, this.protocol, c);
9248 if ((d != null) && (d.getHeight () > 0)) {
9249 this.dbgMsg ("Successfully loaded file.");
9250 d.setDataset (null);
9251 var e =  new jalview.appletgui.AlignFrame (d, this.applet, b, this.b$["jalview.bin.JalviewLite"].embedded, false);
9252 e.setTitle (b);
9253 if (this.b$["jalview.bin.JalviewLite"].initialAlignFrame == null) {
9254 this.b$["jalview.bin.JalviewLite"].initialAlignFrame = e;
9255 }this.b$["jalview.bin.JalviewLite"].currentAlignFrame = e;
9256 if (this.protocol === jalview.io.AppletFormatAdapter.PASTE) {
9257 e.setTitle (jalview.util.MessageManager.formatMessage ("label.sequences_from",  Clazz_newArray (-1, [this.applet.getDocumentBase ().toString ()])));
9258 }e.setStatus (jalview.util.MessageManager.formatMessage ("label.successfully_loaded_file",  Clazz_newArray (-1, [b])));
9259 return e;
9260 }} catch (ex) {
9261 if (Clazz_exceptionOf (ex, java.io.IOException)) {
9262 this.dbgMsg ("File load exception.");
9263 ex.printStackTrace ();
9264 if (jalview.bin.JalviewLite.debug) {
9265 try {
9266 var e =  new jalview.io.FileParse (b, this.protocol);
9267 var f = null;
9268 this.dbgMsg (">>>Dumping contents of '" + b + "' " + "(" + this.protocol + ")");
9269 while ((f = e.nextLine ()) != null) {
9270 this.dbgMsg (f);
9271 }
9272 this.dbgMsg (">>>Dump finished.");
9273 } catch (e) {
9274 if (Clazz_exceptionOf (e, Exception)) {
9275 System.err.println ("Exception when trying to dump the content of the file parameter.");
9276 e.printStackTrace ();
9277 } else {
9278 throw e;
9279 }
9280 }
9281 }} else {
9282 throw ex;
9283 }
9284 }
9285 return null;
9286 }, "~S");
9287 Clazz_defineMethod (c$, "loadPdbFiles", 
9288 function (a) {
9289 var b = false;
9290 this.applet.setAlignPdbStructures (this.b$["jalview.bin.JalviewLite"].getDefaultParameter ("alignpdbfiles", false));
9291 var c = 0;
9292 var d =  new java.util.Vector ();
9293 var e = (this.applet.getDefaultParameter ("relaxedidmatch", false)) ?  new jalview.analysis.SequenceIdMatcher (a.getAlignViewport ().getAlignment ().getSequencesArray ()) : null;
9294 var f;
9295 do {
9296 if (c > 0) {
9297 f = this.applet.getParameter ("PDBFILE" + c);
9298 } else {
9299 f = this.b$["jalview.bin.JalviewLite"].pdbFile;
9300 }if (f != null) {
9301 var g =  new jalview.datamodel.PDBEntry ();
9302 var h;
9303 var i = null;
9304 var j = null;
9305 var k =  new java.util.StringTokenizer (f, " ");
9306 if (k.countTokens () < 2) {
9307 if (this.b$["jalview.bin.JalviewLite"].sequence != null) {
9308 i =  Clazz_newArray (-1, [e == null ? a.getAlignViewport ().getAlignment ().findName (this.b$["jalview.bin.JalviewLite"].sequence) : e.findIdMatch (this.b$["jalview.bin.JalviewLite"].sequence)]);
9309 }} else {
9310 f = k.nextToken ();
9311 var l =  new java.util.Vector ();
9312 var m =  new java.util.Vector ();
9313 while (k.hasMoreTokens ()) {
9314 h = k.nextToken ();
9315 var n =  new java.util.StringTokenizer (h, "=");
9316 if (n.countTokens () > 1) {
9317 m.addElement (n.nextToken ());
9318 h = n.nextToken ();
9319 }l.addElement (e == null ? a.getAlignViewport ().getAlignment ().findName (h) : e.findIdMatch (h));
9320 }
9321 i =  new Array (l.size ());
9322 l.copyInto (i);
9323 if (m.size () == l.size ()) {
9324 j =  new Array (m.size ());
9325 m.copyInto (j);
9326 }}f = this.setProtocolState (f);
9327 if (this.protocol === jalview.io.AppletFormatAdapter.CLASSLOADER && !this.b$["jalview.bin.JalviewLite"].useXtrnalSviewer) {
9328 this.protocol = jalview.io.AppletFormatAdapter.URL;
9329 f = this.addProtocol (f);
9330 }g.setFile (f);
9331 if (i != null) {
9332 for (var l = 0; l < i.length; l++) {
9333 if (i[l] != null) {
9334 (i[l]).addPDBId (g);
9335 jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.applet).registerPDBEntry (g);
9336 } else {
9337 if (jalview.bin.JalviewLite.debug) {
9338 System.err.println ("Warning: Possible input parsing error: Null sequence for attachment of PDB (sequence " + l + ")");
9339 }}}
9340 if (!this.b$["jalview.bin.JalviewLite"].alignPdbStructures) {
9341 a.newStructureView (this.applet, g, i, j, this.protocol);
9342 } else {
9343 d.addElement ( Clazz_newArray (-1, [g, i, j,  String.instantialize (this.protocol)]));
9344 }}}c++;
9345 } while (f != null || c < 10);
9346 if (d.size () > 0) {
9347 var g =  new Array (d.size ());
9348 var h =  new Array (d.size ());
9349 var i =  new Array (d.size ());
9350 var j =  new Array (d.size ());
9351 for (var k = 0, l = d.size (); k < l; k++) {
9352 var m = d.elementAt (k);
9353 h[k] = m[0];
9354 g[k] = m[1];
9355 i[k] = m[2];
9356 j[k] = m[3];
9357 }
9358 a.alignedStructureView (this.applet, h, g, i, j);
9359 b = true;
9360 }return b;
9361 }, "jalview.appletgui.AlignFrame");
9362 Clazz_defineMethod (c$, "loadJnetFile", 
9363 function (a) {
9364 var b = false;
9365 var c = this.b$["jalview.bin.JalviewLite"].jnetFile;
9366 if (c != null) {
9367 try {
9368 c = this.setProtocolState (c);
9369 var d = jalview.jsdev.GenericFileAdapter.getFile ("JPredFile", [c, this.protocol]);
9370 jalview.io.JnetAnnotationMaker.add_annotation (d, a.viewport.getAlignment (), 0, false);
9371 var e = a.viewport.getAlignment ().getSequenceAt (0);
9372 a.viewport.getAlignment ().setSeqrep (e);
9373 var f =  new jalview.datamodel.ColumnSelection ();
9374 f.hideInsertionsFor (e);
9375 a.viewport.setColumnSelection (f);
9376 a.alignPanel.fontChanged ();
9377 a.alignPanel.setScrollValues (0, 0);
9378 b = true;
9379 } catch (ex) {
9380 if (Clazz_exceptionOf (ex, Exception)) {
9381 ex.printStackTrace ();
9382 } else {
9383 throw ex;
9384 }
9385 }
9386 }return b;
9387 }, "jalview.appletgui.AlignFrame");
9388 Clazz_defineMethod (c$, "loadAnnotations", 
9389 function (a) {
9390 var b = false;
9391 var c = this.b$["jalview.bin.JalviewLite"].annotations;
9392 if (c != null) {
9393 c = this.setProtocolState (c);
9394 if ( new jalview.io.AnnotationFile ().annotateAlignmentView (a.viewport, c, this.protocol)) {
9395 a.alignPanel.fontChanged ();
9396 a.alignPanel.setScrollValues (0, 0);
9397 b = true;
9398 } else {
9399 System.err.println ("Annotations were not added from annotation file '" + c + "'");
9400 }}return b;
9401 }, "jalview.appletgui.AlignFrame");
9402 Clazz_defineMethod (c$, "loadFeatures", 
9403 function (a) {
9404 var b = false;
9405 var c = this.b$["jalview.bin.JalviewLite"].hideFeatureGroups;
9406 if (c != null) {
9407 a.setFeatureGroupState (this.b$["jalview.bin.JalviewLite"].separatorListToArray (c), false);
9408 }c = this.b$["jalview.bin.JalviewLite"].showFeatureGroups;
9409 if (c != null) {
9410 a.setFeatureGroupState (this.b$["jalview.bin.JalviewLite"].separatorListToArray (c), true);
9411 }c = this.b$["jalview.bin.JalviewLite"].features;
9412 if (c != null) {
9413 c = this.setProtocolState (c);
9414 b = a.parseFeaturesFile (c, this.protocol);
9415 }c = this.b$["jalview.bin.JalviewLite"].showFeatureSettings;
9416 if (c != null && c.equalsIgnoreCase ("true")) {
9417 a.viewport.setShowSequenceFeatures (true);
9418  new jalview.appletgui.FeatureSettings (a.alignPanel);
9419 }return b;
9420 }, "jalview.appletgui.AlignFrame");
9421 Clazz_defineMethod (c$, "loadScoreFile", 
9422 function (a) {
9423 var b = false;
9424 if (this.b$["jalview.bin.JalviewLite"].scoreFile != null && !"".equals (this.b$["jalview.bin.JalviewLite"].scoreFile)) {
9425 try {
9426 if (jalview.bin.JalviewLite.debug) {
9427 System.err.println ("Attempting to load T-COFFEE score file from the scoreFile parameter");
9428 }b = a.loadScoreFile (this.b$["jalview.bin.JalviewLite"].scoreFile);
9429 if (!b) {
9430 System.err.println ("Failed to parse T-COFFEE parameter as a valid score file ('" + this.b$["jalview.bin.JalviewLite"].scoreFile + "')");
9431 }} catch (e) {
9432 if (Clazz_exceptionOf (e, Exception)) {
9433 System.err.printf ("Cannot read score file: '%s'. Cause: %s \n", [this.b$["jalview.bin.JalviewLite"].scoreFile, e.getMessage ()]);
9434 } else {
9435 throw e;
9436 }
9437 }
9438 }return b;
9439 }, "jalview.appletgui.AlignFrame");
9440 Clazz_defineMethod (c$, "loadTree", 
9441 function (a) {
9442 var b = false;
9443 if (this.b$["jalview.bin.JalviewLite"].treeFile == null) {
9444 this.b$["jalview.bin.JalviewLite"].treeFile = this.applet.getParameter ("treeFile");
9445 }if (this.b$["jalview.bin.JalviewLite"].treeFile != null) {
9446 try {
9447 this.b$["jalview.bin.JalviewLite"].treeFile = this.setProtocolState (this.b$["jalview.bin.JalviewLite"].treeFile);
9448 var c =  new jalview.io.NewickFile (this.b$["jalview.bin.JalviewLite"].treeFile, this.protocol);
9449 c.parse ();
9450 if (c.getTree () != null) {
9451 a.loadTree (c, this.b$["jalview.bin.JalviewLite"].treeFile);
9452 b = true;
9453 this.dbgMsg ("Successfully imported tree.");
9454 } else {
9455 this.dbgMsg ("Tree parameter did not resolve to a valid tree.");
9456 }} catch (ex) {
9457 if (Clazz_exceptionOf (ex, Exception)) {
9458 ex.printStackTrace ();
9459 } else {
9460 throw ex;
9461 }
9462 }
9463 }return b;
9464 }, "jalview.appletgui.AlignFrame");
9465 Clazz_defineMethod (c$, "inArchive", 
9466 function (a) {
9467 try {
9468 var b = (this.getClass ().getResourceAsStream ("/" + a) != null);
9469 if (jalview.bin.JalviewLite.debug) {
9470 System.err.println ("Resource '" + a + "' was " + (b ? "" : "not") + " located by classloader.");
9471 }return b;
9472 } catch (ex) {
9473 if (Clazz_exceptionOf (ex, Exception)) {
9474 System.out.println ("Exception checking resources: " + a + " " + ex);
9475 return false;
9476 } else {
9477 throw ex;
9478 }
9479 }
9480 }, "~S");
9481 Clazz_defineMethod (c$, "addProtocol", 
9482 function (a) {
9483 if (a.indexOf ("://") == -1) {
9484 var b = this.applet.resolveUrlForLocalOrAbsolute (a, this.b$["jalview.bin.JalviewLite"].getDocumentBase ());
9485 if (this.urlExists (b)) {
9486 if (jalview.bin.JalviewLite.debug) {
9487 System.err.println ("Prepended document base for resource: '" + a + "'");
9488 }return b;
9489 }b = this.applet.resolveUrlForLocalOrAbsolute (a, this.b$["jalview.bin.JalviewLite"].getCodeBase ());
9490 if (this.urlExists (b)) {
9491 if (jalview.bin.JalviewLite.debug) {
9492 System.err.println ("Prepended codebase for resource: '" + a + "'");
9493 }return b;
9494 }}return a;
9495 }, "~S");
9496 Clazz_defineMethod (c$, "urlExists", 
9497  function (a) {
9498 var b = null;
9499 try {
9500 b =  new java.net.URL (a).openStream ();
9501 if (b != null) {
9502 return true;
9503 }} catch (x) {
9504 if (Clazz_exceptionOf (x, Exception)) {
9505 } else {
9506 throw x;
9507 }
9508 } finally {
9509 if (b != null) {
9510 try {
9511 b.close ();
9512 } catch (e) {
9513 if (Clazz_exceptionOf (e, java.io.IOException)) {
9514 } else {
9515 throw e;
9516 }
9517 }
9518 }}
9519 return false;
9520 }, "~S");
9521 c$ = Clazz_p0p ();
9522 };
9523 c$.$JalviewLite$1$ = function () {
9524 Clazz_pu$h(self.c$);
9525 c$ = Clazz_declareAnonymous (jalview.bin, "JalviewLite$1", null, Runnable);
9526 Clazz_overrideMethod (c$, "run", 
9527 function () {
9528 jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.f$.me).mouseOverVamsasSequence (this.f$.sq, this.f$.sq.findIndex (this.f$.pos), null);
9529 });
9530 c$ = Clazz_p0p ();
9531 };
9532 c$.$JalviewLite$2$ = function () {
9533 Clazz_pu$h(self.c$);
9534 c$ = Clazz_declareAnonymous (jalview.bin, "JalviewLite$2", null, Runnable);
9535 Clazz_overrideMethod (c$, "run", 
9536 function () {
9537 jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.f$.me).mouseOverVamsasSequence (this.f$.sq, this.f$.pos, null);
9538 });
9539 c$ = Clazz_p0p ();
9540 };
9541 c$.$JalviewLite$3$ = function () {
9542 Clazz_pu$h(self.c$);
9543 c$ = Clazz_declareAnonymous (jalview.bin, "JalviewLite$3", null, Runnable);
9544 Clazz_overrideMethod (c$, "run", 
9545 function () {
9546 this.f$.alf.select (this.f$.sel, this.f$.csel);
9547 });
9548 c$ = Clazz_p0p ();
9549 };
9550 c$.$JalviewLite$4$ = function () {
9551 Clazz_pu$h(self.c$);
9552 c$ = Clazz_declareAnonymous (jalview.bin, "JalviewLite$4", null, Runnable);
9553 Clazz_overrideMethod (c$, "run", 
9554 function () {
9555 try {
9556 jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.f$.me).mouseOverStructure ( new Integer (this.f$.pdbResNum).intValue (), this.f$.chain, this.f$.pdbfile);
9557 if (jalview.bin.JalviewLite.debug) {
9558 System.err.println ("mouseOver for '" + this.f$.pdbResNum + "' in chain '" + this.f$.chain + "' in structure '" + this.f$.pdbfile + "'");
9559 }} catch (e) {
9560 if (Clazz_exceptionOf (e, NumberFormatException)) {
9561 System.err.println ("Ignoring invalid residue number string '" + this.f$.pdbResNum + "'");
9562 } else {
9563 throw e;
9564 }
9565 }
9566 });
9567 c$ = Clazz_p0p ();
9568 };
9569 c$.$JalviewLite$5$ = function () {
9570 Clazz_pu$h(self.c$);
9571 c$ = Clazz_declareAnonymous (jalview.bin, "JalviewLite$5", null, Runnable);
9572 Clazz_overrideMethod (c$, "run", 
9573 function () {
9574 try {
9575 this.f$.alf.scrollTo ( new Integer (this.f$.topRow).intValue (),  new Integer (this.f$.leftHandColumn).intValue ());
9576 } catch (ex) {
9577 if (Clazz_exceptionOf (ex, Exception)) {
9578 System.err.println ("Couldn't parse integer arguments (topRow='" + this.f$.topRow + "' and leftHandColumn='" + this.f$.leftHandColumn + "')");
9579 ex.printStackTrace ();
9580 } else {
9581 throw ex;
9582 }
9583 }
9584 });
9585 c$ = Clazz_p0p ();
9586 };
9587 c$.$JalviewLite$6$ = function () {
9588 Clazz_pu$h(self.c$);
9589 c$ = Clazz_declareAnonymous (jalview.bin, "JalviewLite$6", null, Runnable);
9590 Clazz_overrideMethod (c$, "run", 
9591 function () {
9592 try {
9593 this.f$.alf.scrollToRow ( new Integer (this.f$.topRow).intValue ());
9594 } catch (ex) {
9595 if (Clazz_exceptionOf (ex, Exception)) {
9596 System.err.println ("Couldn't parse integer arguments (topRow='" + this.f$.topRow + "')");
9597 ex.printStackTrace ();
9598 } else {
9599 throw ex;
9600 }
9601 }
9602 });
9603 c$ = Clazz_p0p ();
9604 };
9605 c$.$JalviewLite$7$ = function () {
9606 Clazz_pu$h(self.c$);
9607 c$ = Clazz_declareAnonymous (jalview.bin, "JalviewLite$7", null, Runnable);
9608 Clazz_overrideMethod (c$, "run", 
9609 function () {
9610 try {
9611 this.f$.alf.scrollToColumn ( new Integer (this.f$.leftHandColumn).intValue ());
9612 } catch (ex) {
9613 if (Clazz_exceptionOf (ex, Exception)) {
9614 System.err.println ("Couldn't parse integer arguments (leftHandColumn='" + this.f$.leftHandColumn + "')");
9615 ex.printStackTrace ();
9616 } else {
9617 throw ex;
9618 }
9619 }
9620 });
9621 c$ = Clazz_p0p ();
9622 };
9623 c$.$JalviewLite$8$ = function () {
9624 Clazz_pu$h(self.c$);
9625 c$ = Clazz_declareAnonymous (jalview.bin, "JalviewLite$8", null, java.awt.event.ActionListener);
9626 Clazz_overrideMethod (c$, "actionPerformed", 
9627 function (e) {
9628 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"]);
9629 loader.start ();
9630 }, "java.awt.event.ActionEvent");
9631 c$ = Clazz_p0p ();
9632 };
9633 c$.$JalviewLite$9$ = function () {
9634 Clazz_pu$h(self.c$);
9635 c$ = Clazz_declareAnonymous (jalview.bin, "JalviewLite$9", java.awt.event.WindowAdapter);
9636 Clazz_overrideMethod (c$, "windowClosing", 
9637 function (e) {
9638 if (Clazz_instanceOf (this.f$.frame, jalview.appletgui.AlignFrame)) {
9639 var vp = (this.f$.frame).viewport;
9640 (this.f$.frame).closeMenuItem_actionPerformed ();
9641 if (vp.applet.currentAlignFrame === this.f$.frame) {
9642 vp.applet.currentAlignFrame = null;
9643 }vp.applet = null;
9644 vp = null;
9645 }jalview.bin.JalviewLite.lastFrameX -= 40;
9646 jalview.bin.JalviewLite.lastFrameY -= 40;
9647 if (Clazz_instanceOf (this.f$.frame, jalview.appletgui.EmbmenuFrame)) {
9648 (this.f$.frame).destroyMenus ();
9649 }this.f$.frame.setMenuBar (null);
9650 this.f$.frame.dispose ();
9651 }, "java.awt.event.WindowEvent");
9652 Clazz_defineMethod (c$, "windowActivated", 
9653 function (e) {
9654 if (Clazz_instanceOf (this.f$.frame, jalview.appletgui.AlignFrame)) {
9655 (this.f$.frame).viewport.applet.currentAlignFrame = this.f$.frame;
9656 if (jalview.bin.JalviewLite.debug) {
9657 System.err.println ("Activated window " + this.f$.frame);
9658 }}Clazz_superCall (this, jalview.bin.JalviewLite$9, "windowActivated", [e]);
9659 }, "java.awt.event.WindowEvent");
9660 c$ = Clazz_p0p ();
9661 };
9662 c$.$JalviewLite$10$ = function () {
9663 Clazz_pu$h(self.c$);
9664 c$ = Clazz_declareAnonymous (jalview.bin, "JalviewLite$10", null, Runnable);
9665 Clazz_overrideMethod (c$, "run", 
9666 function () {
9667 this.f$.alf.setFeatureGroupState (this.b$["jalview.bin.JalviewLite"].separatorListToArray (this.f$.groups), this.f$.st);
9668 });
9669 c$ = Clazz_p0p ();
9670 };
9671 Clazz_defineStatics (c$,
9672 "TRUE", "true",
9673 "FALSE", "false",
9674 "debug", false,
9675 "lastFrameX", 200,
9676 "lastFrameY", 200,
9677 "builddate", null,
9678 "version", null,
9679 "installation", null);
9680 });
9681 Clazz_declarePackage ("javax.swing");
9682 Clazz_load (["javax.swing.AbstractButton"], "javax.swing.JButton", ["javax.swing.DefaultButtonModel", "$.SwingUtilities", "$.UIManager"], function () {
9683 c$ = Clazz_declareType (javax.swing, "JButton", javax.swing.AbstractButton);
9684 Clazz_makeConstructor (c$, 
9685 function () {
9686 this.construct (null, null);
9687 });
9688 Clazz_makeConstructor (c$, 
9689 function (icon) {
9690 this.construct (null, icon);
9691 }, "javax.swing.Icon");
9692 Clazz_makeConstructor (c$, 
9693 function (text) {
9694 this.construct (text, null);
9695 }, "~S");
9696 Clazz_makeConstructor (c$, 
9697 function (a) {
9698 this.construct ();
9699 this.setAction (a);
9700 }, "javax.swing.Action");
9701 Clazz_makeConstructor (c$, 
9702 function (text, icon) {
9703 Clazz_superConstructor (this, javax.swing.JButton, []);
9704 this.setModel ( new javax.swing.DefaultButtonModel ());
9705 this.init (text, icon);
9706 }, "~S,javax.swing.Icon");
9707 Clazz_overrideMethod (c$, "updateUI", 
9708 function () {
9709 this.setUI (javax.swing.UIManager.getUI (this));
9710 });
9711 Clazz_overrideMethod (c$, "getUIClassID", 
9712 function () {
9713 return "ButtonUI";
9714 });
9715 Clazz_defineMethod (c$, "isDefaultButton", 
9716 function () {
9717 var root = javax.swing.SwingUtilities.getRootPane (this);
9718 if (root != null) {
9719 return root.getDefaultButton () === this;
9720 }return false;
9721 });
9722 Clazz_defineMethod (c$, "isDefaultCapable", 
9723 function () {
9724 return this.defaultCapable;
9725 });
9726 Clazz_defineMethod (c$, "setDefaultCapable", 
9727 function (defaultCapable) {
9728 var oldDefaultCapable = this.defaultCapable;
9729 this.defaultCapable = defaultCapable;
9730 this.firePropertyChangeBool ("defaultCapable", oldDefaultCapable, defaultCapable);
9731 }, "~B");
9732 Clazz_defineMethod (c$, "removeNotify", 
9733 function () {
9734 var root = javax.swing.SwingUtilities.getRootPane (this);
9735 if (root != null && root.getDefaultButton () === this) {
9736 root.setDefaultButton (null);
9737 }Clazz_superCall (this, javax.swing.JButton, "removeNotify", []);
9738 });
9739 Clazz_defineMethod (c$, "paramString", 
9740 function () {
9741 var defaultCapableString = (this.defaultCapable ? "true" : "false");
9742 return Clazz_superCall (this, javax.swing.JButton, "paramString", []) + ",defaultCapable=" + defaultCapableString;
9743 });
9744 Clazz_defineStatics (c$,
9745 "$uiClassID", "ButtonUI");
9746 });
9747 Clazz_declarePackage ("jalview.util");
9748 Clazz_load (["java.text.MessageFormat", "java.util.logging.Logger"], "jalview.util.MessageManager", ["java.util.Locale", "$.ResourceBundle", "java.util.logging.Level"], function () {
9749 c$ = Clazz_declareType (jalview.util, "MessageManager");
9750 c$.getString = Clazz_defineMethod (c$, "getString", 
9751 function (key) {
9752 var value = "[missing key] " + key;
9753 try {
9754 value = jalview.util.MessageManager.rb.getString (key);
9755 } catch (e) {
9756 if (Clazz_exceptionOf (e, Exception)) {
9757 jalview.util.MessageManager.log.warning ("I18N missing: " + jalview.util.MessageManager.loc + "\t" + key);
9758 } else {
9759 throw e;
9760 }
9761 }
9762 return value;
9763 }, "~S");
9764 c$.getLocale = Clazz_defineMethod (c$, "getLocale", 
9765 function () {
9766 return jalview.util.MessageManager.loc;
9767 });
9768 c$.formatMessage = Clazz_defineMethod (c$, "formatMessage", 
9769 function (key, params) {
9770 return java.text.MessageFormat.format (jalview.util.MessageManager.getString (key), params);
9771 }, "~S,~A");
9772 c$.formatMessage = Clazz_defineMethod (c$, "formatMessage", 
9773 function (key, params) {
9774 return java.text.MessageFormat.format (jalview.util.MessageManager.getString (key), params);
9775 }, "~S,~A");
9776 c$.getStringOrReturn = Clazz_defineMethod (c$, "getStringOrReturn", 
9777 function (keyroot, name) {
9778 var smkey = keyroot + name.toLowerCase ().replaceAll (" ", "");
9779 try {
9780 name = jalview.util.MessageManager.rb.getString (smkey);
9781 } catch (x) {
9782 if (Clazz_exceptionOf (x, Exception)) {
9783 jalview.util.MessageManager.log.finest ("I18N missing key with root " + keyroot + ": " + jalview.util.MessageManager.loc + "\t" + smkey);
9784 } else {
9785 throw x;
9786 }
9787 }
9788 return name;
9789 }, "~S,~S");
9790 Clazz_defineStatics (c$,
9791 "rb", null);
9792 c$.log = c$.prototype.log = java.util.logging.Logger.getLogger (jalview.util.MessageManager.getCanonicalName ());
9793 Clazz_defineStatics (c$,
9794 "loc", null);
9795 {
9796 try {
9797 jalview.util.MessageManager.loc = java.util.Locale.getDefault ();
9798 jalview.util.MessageManager.log.info ("Getting messages for lang: " + jalview.util.MessageManager.loc);
9799 jalview.util.MessageManager.rb = java.util.ResourceBundle.getBundle ("lang.Messages", jalview.util.MessageManager.loc);
9800 if (jalview.util.MessageManager.rb == null || jalview.util.MessageManager.log.isLoggable (java.util.logging.Level.FINEST)) {
9801 jalview.util.MessageManager.log.finest ("Language keys: " + jalview.util.MessageManager.rb.keySet ());
9802 }} catch (e$$) {
9803 if (Clazz_exceptionOf (e$$, Exception)) {
9804 var q = e$$;
9805 {
9806 jalview.util.MessageManager.log.warning ("Exception when initting Locale for i18n messages\n" + q.getMessage ());
9807 q.printStackTrace ();
9808 }
9809 } else if (Clazz_exceptionOf (e$$, Error)) {
9810 var v = e$$;
9811 {
9812 jalview.util.MessageManager.log.warning ("Error when initting Locale for i18n messages\n" + v.getMessage ());
9813 v.printStackTrace ();
9814 }
9815 } else {
9816 throw e$$;
9817 }
9818 }
9819 }});
9820 Clazz_declarePackage ("java.util.logging");
9821 Clazz_load (["java.util.Hashtable", "java.util.logging.Level", "$.LogRecord"], "java.util.logging.Logger", null, function () {
9822 c$ = Clazz_decorateAsClass (function () {
9823 this.name = null;
9824 this.levelObject = null;
9825 this.levelValue = 0;
9826 Clazz_instantialize (this, arguments);
9827 }, java.util.logging, "Logger");
9828 Clazz_makeConstructor (c$, 
9829 function (name, resourceBundleName) {
9830 this.construct (name, resourceBundleName, null, false);
9831 }, "~S,~S");
9832 Clazz_makeConstructor (c$, 
9833 function (name, resourceBundleName, caller, isSystemLogger) {
9834 this.name = name;
9835 this.levelValue = java.util.logging.Level.INFO.intValue ();
9836 }, "~S,~S,Class,~B");
9837 Clazz_makeConstructor (c$, 
9838  function (name) {
9839 this.name = name;
9840 this.levelValue = java.util.logging.Level.INFO.intValue ();
9841 }, "~S");
9842 c$.getLogger = Clazz_defineMethod (c$, "getLogger", 
9843 function (name) {
9844 var log = java.util.logging.Logger.loggers.get (name);
9845 if (log == null) java.util.logging.Logger.loggers.put (name, log =  new java.util.logging.Logger (name));
9846 return log;
9847 }, "~S");
9848 c$.getLogger = Clazz_defineMethod (c$, "getLogger", 
9849 function (name, resourceBundleName) {
9850 return java.util.logging.Logger.getLogger (name);
9851 }, "~S,~S");
9852 c$.getAnonymousLogger = Clazz_defineMethod (c$, "getAnonymousLogger", 
9853 function () {
9854 return java.util.logging.Logger.getAnonymousLogger (null);
9855 });
9856 c$.getAnonymousLogger = Clazz_defineMethod (c$, "getAnonymousLogger", 
9857 function (resourceBundleName) {
9858 return java.util.logging.Logger.global;
9859 }, "~S");
9860 Clazz_defineMethod (c$, "log", 
9861 function (record) {
9862 if (record.getLevel ().intValue () < this.levelValue || this.levelValue == java.util.logging.Logger.offValue) {
9863 return;
9864 }System.out.println (record.getLoggerName () + ": " + record.getMessage ());
9865 }, "java.util.logging.LogRecord");
9866 Clazz_defineMethod (c$, "doLog", 
9867  function (lr) {
9868 lr.setLoggerName (this.name);
9869 this.log (lr);
9870 }, "java.util.logging.LogRecord");
9871 Clazz_defineMethod (c$, "log", 
9872 function (level, msg) {
9873 if (level.intValue () < this.levelValue || this.levelValue == java.util.logging.Logger.offValue) {
9874 return;
9875 }var lr =  new java.util.logging.LogRecord (level, msg);
9876 this.doLog (lr);
9877 }, "java.util.logging.Level,~S");
9878 Clazz_defineMethod (c$, "log", 
9879 function (level, msg, param1) {
9880 if (level.intValue () < this.levelValue || this.levelValue == java.util.logging.Logger.offValue) {
9881 return;
9882 }var lr =  new java.util.logging.LogRecord (level, msg);
9883 var params =  Clazz_newArray (-1, [param1]);
9884 lr.setParameters (params);
9885 this.doLog (lr);
9886 }, "java.util.logging.Level,~S,~O");
9887 Clazz_defineMethod (c$, "log", 
9888 function (level, msg, params) {
9889 if (level.intValue () < this.levelValue || this.levelValue == java.util.logging.Logger.offValue) {
9890 return;
9891 }var lr =  new java.util.logging.LogRecord (level, msg);
9892 lr.setParameters (params);
9893 this.doLog (lr);
9894 }, "java.util.logging.Level,~S,~A");
9895 Clazz_defineMethod (c$, "log", 
9896 function (level, msg, thrown) {
9897 if (level.intValue () < this.levelValue || this.levelValue == java.util.logging.Logger.offValue) {
9898 return;
9899 }var lr =  new java.util.logging.LogRecord (level, msg);
9900 lr.setThrown (thrown);
9901 this.doLog (lr);
9902 }, "java.util.logging.Level,~S,Throwable");
9903 Clazz_defineMethod (c$, "logp", 
9904 function (level, sourceClass, sourceMethod, msg) {
9905 if (level.intValue () < this.levelValue || this.levelValue == java.util.logging.Logger.offValue) {
9906 return;
9907 }var lr =  new java.util.logging.LogRecord (level, msg);
9908 lr.setSourceClassName (sourceClass);
9909 lr.setSourceMethodName (sourceMethod);
9910 this.doLog (lr);
9911 }, "java.util.logging.Level,~S,~S,~S");
9912 Clazz_defineMethod (c$, "logp", 
9913 function (level, sourceClass, sourceMethod, msg, param1) {
9914 if (level.intValue () < this.levelValue || this.levelValue == java.util.logging.Logger.offValue) {
9915 return;
9916 }var lr =  new java.util.logging.LogRecord (level, msg);
9917 lr.setSourceClassName (sourceClass);
9918 lr.setSourceMethodName (sourceMethod);
9919 var params =  Clazz_newArray (-1, [param1]);
9920 lr.setParameters (params);
9921 this.doLog (lr);
9922 }, "java.util.logging.Level,~S,~S,~S,~O");
9923 Clazz_defineMethod (c$, "logp", 
9924 function (level, sourceClass, sourceMethod, msg, params) {
9925 if (level.intValue () < this.levelValue || this.levelValue == java.util.logging.Logger.offValue) {
9926 return;
9927 }var lr =  new java.util.logging.LogRecord (level, msg);
9928 lr.setSourceClassName (sourceClass);
9929 lr.setSourceMethodName (sourceMethod);
9930 lr.setParameters (params);
9931 this.doLog (lr);
9932 }, "java.util.logging.Level,~S,~S,~S,~A");
9933 Clazz_defineMethod (c$, "logp", 
9934 function (level, sourceClass, sourceMethod, msg, thrown) {
9935 if (level.intValue () < this.levelValue || this.levelValue == java.util.logging.Logger.offValue) {
9936 return;
9937 }var lr =  new java.util.logging.LogRecord (level, msg);
9938 lr.setSourceClassName (sourceClass);
9939 lr.setSourceMethodName (sourceMethod);
9940 lr.setThrown (thrown);
9941 this.doLog (lr);
9942 }, "java.util.logging.Level,~S,~S,~S,Throwable");
9943 Clazz_defineMethod (c$, "entering", 
9944 function (sourceClass, sourceMethod) {
9945 if (java.util.logging.Level.FINER.intValue () < this.levelValue) {
9946 return;
9947 }this.logp (java.util.logging.Level.FINER, sourceClass, sourceMethod, "ENTRY");
9948 }, "~S,~S");
9949 Clazz_defineMethod (c$, "entering", 
9950 function (sourceClass, sourceMethod, param1) {
9951 if (java.util.logging.Level.FINER.intValue () < this.levelValue) {
9952 return;
9953 }var params =  Clazz_newArray (-1, [param1]);
9954 this.logp (java.util.logging.Level.FINER, sourceClass, sourceMethod, "ENTRY {0}", params);
9955 }, "~S,~S,~O");
9956 Clazz_defineMethod (c$, "entering", 
9957 function (sourceClass, sourceMethod, params) {
9958 if (java.util.logging.Level.FINER.intValue () < this.levelValue) {
9959 return;
9960 }var msg = "ENTRY";
9961 if (params == null) {
9962 this.logp (java.util.logging.Level.FINER, sourceClass, sourceMethod, msg);
9963 return;
9964 }for (var i = 0; i < params.length; i++) {
9965 msg = msg + " {" + i + "}";
9966 }
9967 this.logp (java.util.logging.Level.FINER, sourceClass, sourceMethod, msg, params);
9968 }, "~S,~S,~A");
9969 Clazz_defineMethod (c$, "exiting", 
9970 function (sourceClass, sourceMethod) {
9971 if (java.util.logging.Level.FINER.intValue () < this.levelValue) {
9972 return;
9973 }this.logp (java.util.logging.Level.FINER, sourceClass, sourceMethod, "RETURN");
9974 }, "~S,~S");
9975 Clazz_defineMethod (c$, "exiting", 
9976 function (sourceClass, sourceMethod, result) {
9977 if (java.util.logging.Level.FINER.intValue () < this.levelValue) {
9978 return;
9979 }this.logp (java.util.logging.Level.FINER, sourceClass, sourceMethod, "RETURN {0}", result);
9980 }, "~S,~S,~O");
9981 Clazz_defineMethod (c$, "throwing", 
9982 function (sourceClass, sourceMethod, thrown) {
9983 if (java.util.logging.Level.FINER.intValue () < this.levelValue || this.levelValue == java.util.logging.Logger.offValue) {
9984 return;
9985 }var lr =  new java.util.logging.LogRecord (java.util.logging.Level.FINER, "THROW");
9986 lr.setSourceClassName (sourceClass);
9987 lr.setSourceMethodName (sourceMethod);
9988 lr.setThrown (thrown);
9989 this.doLog (lr);
9990 }, "~S,~S,Throwable");
9991 Clazz_defineMethod (c$, "severe", 
9992 function (msg) {
9993 if (java.util.logging.Level.SEVERE.intValue () < this.levelValue) {
9994 return;
9995 }this.log (java.util.logging.Level.SEVERE, msg);
9996 }, "~S");
9997 Clazz_defineMethod (c$, "warning", 
9998 function (msg) {
9999 if (java.util.logging.Level.WARNING.intValue () < this.levelValue) {
10000 return;
10001 }this.log (java.util.logging.Level.WARNING, msg);
10002 }, "~S");
10003 Clazz_defineMethod (c$, "info", 
10004 function (msg) {
10005 if (java.util.logging.Level.INFO.intValue () < this.levelValue) {
10006 return;
10007 }this.log (java.util.logging.Level.INFO, msg);
10008 }, "~S");
10009 Clazz_defineMethod (c$, "config", 
10010 function (msg) {
10011 if (java.util.logging.Level.CONFIG.intValue () < this.levelValue) {
10012 return;
10013 }this.log (java.util.logging.Level.CONFIG, msg);
10014 }, "~S");
10015 Clazz_defineMethod (c$, "fine", 
10016 function (msg) {
10017 if (java.util.logging.Level.FINE.intValue () < this.levelValue) {
10018 return;
10019 }this.log (java.util.logging.Level.FINE, msg);
10020 }, "~S");
10021 Clazz_defineMethod (c$, "finer", 
10022 function (msg) {
10023 if (java.util.logging.Level.FINER.intValue () < this.levelValue) {
10024 return;
10025 }this.log (java.util.logging.Level.FINER, msg);
10026 }, "~S");
10027 Clazz_defineMethod (c$, "finest", 
10028 function (msg) {
10029 if (java.util.logging.Level.FINEST.intValue () < this.levelValue) {
10030 return;
10031 }this.log (java.util.logging.Level.FINEST, msg);
10032 }, "~S");
10033 Clazz_defineMethod (c$, "setLevel", 
10034 function (newLevel) {
10035 this.levelObject = newLevel;
10036 this.updateEffectiveLevel ();
10037 }, "java.util.logging.Level");
10038 Clazz_defineMethod (c$, "getLevel", 
10039 function () {
10040 return this.levelObject;
10041 });
10042 Clazz_defineMethod (c$, "isLoggable", 
10043 function (level) {
10044 if (level.intValue () < this.levelValue || this.levelValue == java.util.logging.Logger.offValue) {
10045 return false;
10046 }return true;
10047 }, "java.util.logging.Level");
10048 Clazz_defineMethod (c$, "getName", 
10049 function () {
10050 return this.name;
10051 });
10052 Clazz_defineMethod (c$, "updateEffectiveLevel", 
10053  function () {
10054 var newLevelValue;
10055 if (this.levelObject != null) {
10056 newLevelValue = this.levelObject.intValue ();
10057 } else {
10058 newLevelValue = java.util.logging.Level.INFO.intValue ();
10059 }if (this.levelValue == newLevelValue) {
10060 return;
10061 }this.levelValue = newLevelValue;
10062 });
10063 c$.offValue = c$.prototype.offValue = java.util.logging.Level.OFF.intValue ();
10064 Clazz_defineStatics (c$,
10065 "GLOBAL_LOGGER_NAME", "global");
10066 c$.global = c$.prototype.global =  new java.util.logging.Logger ("global");
10067 c$.loggers = c$.prototype.loggers =  new java.util.Hashtable ();
10068 {
10069 java.util.logging.Logger.loggers.put ("global", java.util.logging.Logger.global);
10070 }});
10071 Clazz_declarePackage ("java.util.logging");
10072 Clazz_load (null, "java.util.logging.LogRecord", ["java.lang.NullPointerException", "$.Throwable"], function () {
10073 c$ = Clazz_decorateAsClass (function () {
10074 this.level = null;
10075 this.sequenceNumber = 0;
10076 this.sourceClassName = null;
10077 this.sourceMethodName = null;
10078 this.message = null;
10079 this.threadID = 0;
10080 this.millis = 0;
10081 this.thrown = null;
10082 this.loggerName = null;
10083 this.resourceBundleName = null;
10084 this.needToInferCaller = false;
10085 this.parameters = null;
10086 this.resourceBundle = null;
10087 Clazz_instantialize (this, arguments);
10088 }, java.util.logging, "LogRecord", null, java.io.Serializable);
10089 Clazz_makeConstructor (c$, 
10090 function (level, msg) {
10091 level.getClass ();
10092 this.level = level;
10093 this.message = msg;
10094 this.millis = System.currentTimeMillis ();
10095 this.needToInferCaller = true;
10096 }, "java.util.logging.Level,~S");
10097 Clazz_defineMethod (c$, "getLoggerName", 
10098 function () {
10099 return this.loggerName;
10100 });
10101 Clazz_defineMethod (c$, "setLoggerName", 
10102 function (name) {
10103 this.loggerName = name;
10104 }, "~S");
10105 Clazz_defineMethod (c$, "getResourceBundle", 
10106 function () {
10107 return this.resourceBundle;
10108 });
10109 Clazz_defineMethod (c$, "setResourceBundle", 
10110 function (bundle) {
10111 this.resourceBundle = bundle;
10112 }, "java.util.ResourceBundle");
10113 Clazz_defineMethod (c$, "getResourceBundleName", 
10114 function () {
10115 return this.resourceBundleName;
10116 });
10117 Clazz_defineMethod (c$, "setResourceBundleName", 
10118 function (name) {
10119 this.resourceBundleName = name;
10120 }, "~S");
10121 Clazz_defineMethod (c$, "getLevel", 
10122 function () {
10123 return this.level;
10124 });
10125 Clazz_defineMethod (c$, "setLevel", 
10126 function (level) {
10127 if (level == null) {
10128 throw  new NullPointerException ();
10129 }this.level = level;
10130 }, "java.util.logging.Level");
10131 Clazz_defineMethod (c$, "getSequenceNumber", 
10132 function () {
10133 return this.sequenceNumber;
10134 });
10135 Clazz_defineMethod (c$, "setSequenceNumber", 
10136 function (seq) {
10137 this.sequenceNumber = seq;
10138 }, "~N");
10139 Clazz_defineMethod (c$, "getSourceClassName", 
10140 function () {
10141 if (this.needToInferCaller) {
10142 this.inferCaller ();
10143 }return this.sourceClassName;
10144 });
10145 Clazz_defineMethod (c$, "setSourceClassName", 
10146 function (sourceClassName) {
10147 this.sourceClassName = sourceClassName;
10148 this.needToInferCaller = false;
10149 }, "~S");
10150 Clazz_defineMethod (c$, "getSourceMethodName", 
10151 function () {
10152 if (this.needToInferCaller) {
10153 this.inferCaller ();
10154 }return this.sourceMethodName;
10155 });
10156 Clazz_defineMethod (c$, "setSourceMethodName", 
10157 function (sourceMethodName) {
10158 this.sourceMethodName = sourceMethodName;
10159 this.needToInferCaller = false;
10160 }, "~S");
10161 Clazz_defineMethod (c$, "getMessage", 
10162 function () {
10163 return this.message;
10164 });
10165 Clazz_defineMethod (c$, "setMessage", 
10166 function (message) {
10167 this.message = message;
10168 }, "~S");
10169 Clazz_defineMethod (c$, "getParameters", 
10170 function () {
10171 return this.parameters;
10172 });
10173 Clazz_defineMethod (c$, "setParameters", 
10174 function (parameters) {
10175 this.parameters = parameters;
10176 }, "~A");
10177 Clazz_defineMethod (c$, "getThreadID", 
10178 function () {
10179 return this.threadID;
10180 });
10181 Clazz_defineMethod (c$, "setThreadID", 
10182 function (threadID) {
10183 this.threadID = threadID;
10184 }, "~N");
10185 Clazz_defineMethod (c$, "getMillis", 
10186 function () {
10187 return this.millis;
10188 });
10189 Clazz_defineMethod (c$, "setMillis", 
10190 function (millis) {
10191 this.millis = millis;
10192 }, "~N");
10193 Clazz_defineMethod (c$, "getThrown", 
10194 function () {
10195 return this.thrown;
10196 });
10197 Clazz_defineMethod (c$, "setThrown", 
10198 function (thrown) {
10199 this.thrown = thrown;
10200 }, "Throwable");
10201 Clazz_defineMethod (c$, "inferCaller", 
10202  function () {
10203 this.needToInferCaller = false;
10204 var stack = ( new Throwable ()).getStackTrace ();
10205 var ix = 0;
10206 while (ix < stack.length) {
10207 var frame = stack[ix];
10208 var cname = frame.getClassName ();
10209 if (cname.equals ("java.util.logging.Logger")) {
10210 break;
10211 }ix++;
10212 }
10213 while (ix < stack.length) {
10214 var frame = stack[ix];
10215 var cname = frame.getClassName ();
10216 if (!cname.equals ("java.util.logging.Logger")) {
10217 this.setSourceClassName (cname);
10218 this.setSourceMethodName (frame.getMethodName ());
10219 return;
10220 }ix++;
10221 }
10222 });
10223 Clazz_defineStatics (c$,
10224 "globalSequenceNumber", 0);
10225 });
10226 Clazz_declarePackage ("java.util.logging");
10227 Clazz_load (["java.util.HashMap"], "java.util.logging.Level", ["java.lang.IllegalArgumentException", "$.NullPointerException", "java.util.ArrayList", "$.ResourceBundle"], function () {
10228 c$ = Clazz_decorateAsClass (function () {
10229 this.name = null;
10230 this.value = 0;
10231 this.resourceBundleName = null;
10232 this.localizedLevelName = null;
10233 Clazz_instantialize (this, arguments);
10234 }, java.util.logging, "Level", null, java.io.Serializable);
10235 Clazz_makeConstructor (c$, 
10236 function (name, value) {
10237 this.construct (name, value, null);
10238 }, "~S,~N");
10239 Clazz_makeConstructor (c$, 
10240 function (name, value, resourceBundleName) {
10241 if (name == null) {
10242 throw  new NullPointerException ();
10243 }this.name = name;
10244 this.value = value;
10245 this.resourceBundleName = resourceBundleName;
10246 this.localizedLevelName = resourceBundleName == null ? name : null;
10247 java.util.logging.Level.KnownLevel.add (this);
10248 }, "~S,~N,~S");
10249 Clazz_defineMethod (c$, "getResourceBundleName", 
10250 function () {
10251 return this.resourceBundleName;
10252 });
10253 Clazz_defineMethod (c$, "getName", 
10254 function () {
10255 return this.name;
10256 });
10257 Clazz_defineMethod (c$, "getLocalizedName", 
10258 function () {
10259 return this.getLocalizedLevelName ();
10260 });
10261 Clazz_defineMethod (c$, "getLevelName", 
10262 function () {
10263 return this.name;
10264 });
10265 Clazz_defineMethod (c$, "getLocalizedLevelName", 
10266 function () {
10267 if (this.localizedLevelName != null) {
10268 return this.localizedLevelName;
10269 }try {
10270 var rb = java.util.ResourceBundle.getBundle (this.resourceBundleName);
10271 this.localizedLevelName = rb.getString (this.name);
10272 } catch (ex) {
10273 if (Clazz_exceptionOf (ex, Exception)) {
10274 this.localizedLevelName = this.name;
10275 } else {
10276 throw ex;
10277 }
10278 }
10279 return this.localizedLevelName;
10280 });
10281 c$.findLevel = Clazz_defineMethod (c$, "findLevel", 
10282 function (name) {
10283 if (name == null) {
10284 throw  new NullPointerException ();
10285 }var level;
10286 level = java.util.logging.Level.KnownLevel.findByName (name);
10287 if (level != null) {
10288 return level.mirroredLevel;
10289 }try {
10290 var x = Integer.parseInt (name);
10291 level = java.util.logging.Level.KnownLevel.findByValue (x);
10292 if (level == null) {
10293 var levelObject =  new java.util.logging.Level (name, x);
10294 level = java.util.logging.Level.KnownLevel.findByValue (x);
10295 }return level.mirroredLevel;
10296 } catch (ex) {
10297 if (Clazz_exceptionOf (ex, NumberFormatException)) {
10298 } else {
10299 throw ex;
10300 }
10301 }
10302 level = java.util.logging.Level.KnownLevel.findByLocalizedLevelName (name);
10303 if (level != null) {
10304 return level.mirroredLevel;
10305 }return null;
10306 }, "~S");
10307 Clazz_overrideMethod (c$, "toString", 
10308 function () {
10309 return this.name;
10310 });
10311 Clazz_defineMethod (c$, "intValue", 
10312 function () {
10313 return this.value;
10314 });
10315 c$.parse = Clazz_defineMethod (c$, "parse", 
10316 function (name) {
10317 name.length;
10318 var level;
10319 level = java.util.logging.Level.KnownLevel.findByName (name);
10320 if (level != null) {
10321 return level.levelObject;
10322 }try {
10323 var x = Integer.parseInt (name);
10324 level = java.util.logging.Level.KnownLevel.findByValue (x);
10325 if (level == null) {
10326 var levelObject =  new java.util.logging.Level (name, x);
10327 level = java.util.logging.Level.KnownLevel.findByValue (x);
10328 }return level.levelObject;
10329 } catch (ex) {
10330 if (Clazz_exceptionOf (ex, NumberFormatException)) {
10331 } else {
10332 throw ex;
10333 }
10334 }
10335 level = java.util.logging.Level.KnownLevel.findByLocalizedName (name);
10336 if (level != null) {
10337 return level.levelObject;
10338 }throw  new IllegalArgumentException ("Bad level \"" + name + "\"");
10339 }, "~S");
10340 Clazz_overrideMethod (c$, "equals", 
10341 function (ox) {
10342 try {
10343 var lx = ox;
10344 return (lx.value == this.value);
10345 } catch (ex) {
10346 if (Clazz_exceptionOf (ex, Exception)) {
10347 return false;
10348 } else {
10349 throw ex;
10350 }
10351 }
10352 }, "~O");
10353 Clazz_overrideMethod (c$, "hashCode", 
10354 function () {
10355 return this.value;
10356 });
10357 Clazz_pu$h(self.c$);
10358 c$ = Clazz_decorateAsClass (function () {
10359 this.levelObject = null;
10360 this.mirroredLevel = null;
10361 Clazz_instantialize (this, arguments);
10362 }, java.util.logging.Level, "KnownLevel");
10363 Clazz_makeConstructor (c$, 
10364 function (a) {
10365 this.levelObject = a;
10366 if (a.getClass () === java.util.logging.Level) {
10367 this.mirroredLevel = a;
10368 } else {
10369 this.mirroredLevel =  new java.util.logging.Level (a.name, a.value, a.resourceBundleName);
10370 }}, "java.util.logging.Level");
10371 c$.add = Clazz_defineMethod (c$, "add", 
10372 function (a) {
10373 var b =  new java.util.logging.Level.KnownLevel (a);
10374 var c = java.util.logging.Level.KnownLevel.nameToLevels.get (a.name);
10375 if (c == null) {
10376 c =  new java.util.ArrayList ();
10377 java.util.logging.Level.KnownLevel.nameToLevels.put (a.name, c);
10378 }c.add (b);
10379 c = java.util.logging.Level.KnownLevel.intToLevels.get (new Integer (a.value));
10380 if (c == null) {
10381 c =  new java.util.ArrayList ();
10382 java.util.logging.Level.KnownLevel.intToLevels.put (new Integer (a.value), c);
10383 }c.add (b);
10384 }, "java.util.logging.Level");
10385 c$.findByName = Clazz_defineMethod (c$, "findByName", 
10386 function (a) {
10387 var b = java.util.logging.Level.KnownLevel.nameToLevels.get (a);
10388 if (b != null) {
10389 return b.get (0);
10390 }return null;
10391 }, "~S");
10392 c$.findByValue = Clazz_defineMethod (c$, "findByValue", 
10393 function (a) {
10394 var b = java.util.logging.Level.KnownLevel.intToLevels.get (new Integer (a));
10395 if (b != null) {
10396 return b.get (0);
10397 }return null;
10398 }, "~N");
10399 c$.findByLocalizedLevelName = Clazz_defineMethod (c$, "findByLocalizedLevelName", 
10400 function (a) {
10401 for (var levels, $levels = java.util.logging.Level.KnownLevel.nameToLevels.values ().iterator (); $levels.hasNext () && ((levels = $levels.next ()) || true);) {
10402 for (var l, $l = levels.iterator (); $l.hasNext () && ((l = $l.next ()) || true);) {
10403 var b = l.levelObject.getLocalizedLevelName ();
10404 if (a.equals (b)) {
10405 return l;
10406 }}
10407 }
10408 return null;
10409 }, "~S");
10410 c$.findByLocalizedName = Clazz_defineMethod (c$, "findByLocalizedName", 
10411 function (a) {
10412 for (var levels, $levels = java.util.logging.Level.KnownLevel.nameToLevels.values ().iterator (); $levels.hasNext () && ((levels = $levels.next ()) || true);) {
10413 for (var l, $l = levels.iterator (); $l.hasNext () && ((l = $l.next ()) || true);) {
10414 var b = l.levelObject.getLocalizedName ();
10415 if (a.equals (b)) {
10416 return l;
10417 }}
10418 }
10419 return null;
10420 }, "~S");
10421 c$.matches = Clazz_defineMethod (c$, "matches", 
10422 function (a) {
10423 var b = java.util.logging.Level.KnownLevel.nameToLevels.get (a.name);
10424 if (b != null) {
10425 for (var level, $level = b.iterator (); $level.hasNext () && ((level = $level.next ()) || true);) {
10426 var c = level.mirroredLevel;
10427 if (a.value == c.value && (a.resourceBundleName === c.resourceBundleName || (a.resourceBundleName != null && a.resourceBundleName.equals (c.resourceBundleName)))) {
10428 return level;
10429 }}
10430 }return null;
10431 }, "java.util.logging.Level");
10432 c$.nameToLevels = c$.prototype.nameToLevels =  new java.util.HashMap ();
10433 c$.intToLevels = c$.prototype.intToLevels =  new java.util.HashMap ();
10434 c$ = Clazz_p0p ();
10435 Clazz_defineStatics (c$,
10436 "defaultBundle", "sun.util.logging.resources.logging");
10437 c$.OFF = c$.prototype.OFF =  new java.util.logging.Level ("OFF", 2147483647, java.util.logging.Level.defaultBundle);
10438 c$.SEVERE = c$.prototype.SEVERE =  new java.util.logging.Level ("SEVERE", 1000, java.util.logging.Level.defaultBundle);
10439 c$.WARNING = c$.prototype.WARNING =  new java.util.logging.Level ("WARNING", 900, java.util.logging.Level.defaultBundle);
10440 c$.INFO = c$.prototype.INFO =  new java.util.logging.Level ("INFO", 800, java.util.logging.Level.defaultBundle);
10441 c$.CONFIG = c$.prototype.CONFIG =  new java.util.logging.Level ("CONFIG", 700, java.util.logging.Level.defaultBundle);
10442 c$.FINE = c$.prototype.FINE =  new java.util.logging.Level ("FINE", 500, java.util.logging.Level.defaultBundle);
10443 c$.FINER = c$.prototype.FINER =  new java.util.logging.Level ("FINER", 400, java.util.logging.Level.defaultBundle);
10444 c$.FINEST = c$.prototype.FINEST =  new java.util.logging.Level ("FINEST", 300, java.util.logging.Level.defaultBundle);
10445 c$.ALL = c$.prototype.ALL =  new java.util.logging.Level ("ALL", -2147483648, java.util.logging.Level.defaultBundle);
10446 });
10447 Clazz_declarePackage("java.text");
10448 c$=Clazz_decorateAsClass(function(){
10449 this.pattern=null;
10450 Clazz_instantialize(this,arguments);
10451 },java.text,"MessageFormat");
10452 Clazz_makeConstructor(c$,
10453 function(pattern){
10454 this.pattern=pattern;
10455 },"~S");
10456 Clazz_makeConstructor(c$,
10457 function(pattern,locale){
10458 this.pattern=pattern;
10459 },"~S,java.util.Locale");
10460 c$.format=Clazz_defineMethod(c$,"format",
10461 function(pattern,args){
10462 return pattern.replace(/\{(\d+)\}/g,function($0,$1){
10463 var i=parseInt($1);
10464 if(args==null)return null;
10465 return args[i];
10466 });
10467 },"~S,~A");
10468 Clazz_defineMethod(c$,"format",
10469 function(obj){
10470 return java.text.MessageFormat.format(this.pattern,[obj]);
10471 },"~O");
10472 Clazz_declarePackage ("java.util");
10473 Clazz_load (["java.util.ResourceBundle"], "java.util.PropertyResourceBundle", ["java.lang.NullPointerException", "java.util.HashMap", "java.util.Properties", "jssun.util.ResourceBundleEnumeration"], function () {
10474 c$ = Clazz_decorateAsClass (function () {
10475 this.lookup = null;
10476 Clazz_instantialize (this, arguments);
10477 }, java.util, "PropertyResourceBundle", java.util.ResourceBundle);
10478 Clazz_makeConstructor (c$, 
10479 function (stream) {
10480 Clazz_superConstructor (this, java.util.PropertyResourceBundle, []);
10481 this.setStream (stream);
10482 }, "java.io.InputStream");
10483 Clazz_defineMethod (c$, "setStream", 
10484 function (stream) {
10485 var properties =  new java.util.Properties ();
10486 properties.load (stream);
10487 this.lookup =  new java.util.HashMap (properties);
10488 return this;
10489 }, "java.io.InputStream");
10490 Clazz_makeConstructor (c$, 
10491 function (reader) {
10492 Clazz_superConstructor (this, java.util.PropertyResourceBundle, []);
10493 var properties =  new java.util.Properties ();
10494 properties.load (reader);
10495 this.lookup =  new java.util.HashMap (properties);
10496 }, "java.io.Reader");
10497 Clazz_makeConstructor (c$, 
10498 function () {
10499 Clazz_superConstructor (this, java.util.PropertyResourceBundle, []);
10500 });
10501 Clazz_overrideMethod (c$, "handleGetObject", 
10502 function (key) {
10503 if (key == null) {
10504 throw  new NullPointerException ();
10505 }return this.lookup.get (key);
10506 }, "~S");
10507 Clazz_defineMethod (c$, "getKeys", 
10508 function () {
10509 var parent = this.parent;
10510 return  new jssun.util.ResourceBundleEnumeration (this.lookup.keySet (), (parent != null) ? parent.getKeys () : null);
10511 });
10512 Clazz_overrideMethod (c$, "handleKeySet", 
10513 function () {
10514 return this.lookup.keySet ();
10515 });
10516 });
10517 Clazz_declarePackage ("jalview.javascript");
10518 Clazz_declareInterface (jalview.javascript, "JalviewLiteJsApi");
10519 Clazz_declarePackage ("jalview.api");
10520 Clazz_declareInterface (jalview.api, "StructureSelectionManagerProvider");
10521 Clazz_declarePackage ("awt2swing");
10522 c$ = Clazz_declareType (awt2swing, "Util");
10523 c$.drawString = Clazz_defineMethod (c$, "drawString", 
10524 function (g, text, x, y) {
10525 {
10526 g.drawStringUnique(text, x, y);
10527 }}, "java.awt.Graphics,~S,~N,~N");
10528 Clazz_declarePackage ("jalview.analysis");
10529 Clazz_load (null, "jalview.analysis.SequenceIdMatcher", ["java.util.ArrayList", "$.Arrays", "$.HashMap", "$.Vector"], function () {
10530 c$ = Clazz_decorateAsClass (function () {
10531 this.names = null;
10532 if (!Clazz_isClassDefined ("jalview.analysis.SequenceIdMatcher.SeqIdName")) {
10533 jalview.analysis.SequenceIdMatcher.$SequenceIdMatcher$SeqIdName$ ();
10534 }
10535 Clazz_instantialize (this, arguments);
10536 }, jalview.analysis, "SequenceIdMatcher");
10537 Clazz_makeConstructor (c$, 
10538 function (seqs) {
10539 this.names =  new java.util.HashMap ();
10540 this.addAll (seqs);
10541 }, "java.util.List");
10542 Clazz_defineMethod (c$, "addAll", 
10543 function (seqs) {
10544 for (var seq, $seq = seqs.iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
10545 this.names.put (Clazz_innerTypeInstance (jalview.analysis.SequenceIdMatcher.SeqIdName, this, null, seq.getDisplayId (true)), seq);
10546 var dbseq = seq;
10547 while (dbseq.getDatasetSequence () != null) {
10548 dbseq = dbseq.getDatasetSequence ();
10549 }
10550 if (dbseq.getDBRef () != null) {
10551 var dbr = dbseq.getDBRef ();
10552 var sid = null;
10553 for (var r = 0; r < dbr.length; r++) {
10554 sid = Clazz_innerTypeInstance (jalview.analysis.SequenceIdMatcher.SeqIdName, this, null, dbr[r].getAccessionId ());
10555 if (!this.names.containsKey (sid)) {
10556 this.names.put (sid, seq);
10557 }}
10558 }}
10559 }, "java.util.List");
10560 Clazz_makeConstructor (c$, 
10561 function (sequences) {
10562 this.construct (java.util.Arrays.asList (sequences));
10563 }, "~A");
10564 Clazz_defineMethod (c$, "pickbestMatch", 
10565  function (candName, matches) {
10566 var st = this.pickbestMatches (candName, matches);
10567 return st == null || st.size () == 0 ? null : st.get (0);
10568 }, "jalview.analysis.SequenceIdMatcher.SeqIdName,java.util.List");
10569 Clazz_defineMethod (c$, "pickbestMatches", 
10570  function (candName, matches) {
10571 var best =  new java.util.ArrayList ();
10572 if (candName == null || matches == null || matches.size () == 0) {
10573 return null;
10574 }var match = matches.remove (0);
10575 best.add (match);
10576 this.names.put (Clazz_innerTypeInstance (jalview.analysis.SequenceIdMatcher.SeqIdName, this, null, match.getName ()), match);
10577 var matchlen = match.getName ().length;
10578 var namlen = candName.id.length;
10579 while (matches.size () > 0) {
10580 var cand = matches.remove (0);
10581 this.names.put (Clazz_innerTypeInstance (jalview.analysis.SequenceIdMatcher.SeqIdName, this, null, cand.getName ()), cand);
10582 var q;
10583 var w;
10584 var candlen = cand.getName ().length;
10585 if ((q = Math.abs (matchlen - namlen)) > (w = Math.abs (candlen - namlen)) && candlen > matchlen) {
10586 best.clear ();
10587 match = cand;
10588 matchlen = candlen;
10589 best.add (match);
10590 }if (q == w && candlen == matchlen) {
10591 best.add (cand);
10592 }}
10593 if (best.size () == 0) {
10594 return null;
10595 };return best;
10596 }, "jalview.analysis.SequenceIdMatcher.SeqIdName,java.util.List");
10597 Clazz_defineMethod (c$, "findIdMatch", 
10598 function (seq) {
10599 var nam = Clazz_innerTypeInstance (jalview.analysis.SequenceIdMatcher.SeqIdName, this, null, seq.getName ());
10600 return this.findIdMatch (nam);
10601 }, "jalview.datamodel.SequenceI");
10602 Clazz_defineMethod (c$, "findIdMatch", 
10603 function (seqnam) {
10604 var nam = Clazz_innerTypeInstance (jalview.analysis.SequenceIdMatcher.SeqIdName, this, null, seqnam);
10605 return this.findIdMatch (nam);
10606 }, "~S");
10607 Clazz_defineMethod (c$, "findAllIdMatches", 
10608 function (seqnam) {
10609 var nam = Clazz_innerTypeInstance (jalview.analysis.SequenceIdMatcher.SeqIdName, this, null, seqnam);
10610 var m = this.findAllIdMatches (nam);
10611 if (m != null) {
10612 return m.toArray ( new Array (m.size ()));
10613 }return null;
10614 }, "~S");
10615 Clazz_defineMethod (c$, "findIdMatch", 
10616 function (seqs) {
10617 var namedseqs = null;
10618 var i = 0;
10619 var nam;
10620 if (seqs.length > 0) {
10621 namedseqs =  new Array (seqs.length);
10622 do {
10623 nam = Clazz_innerTypeInstance (jalview.analysis.SequenceIdMatcher.SeqIdName, this, null, seqs[i].getName ());
10624 if (this.names.containsKey (nam)) {
10625 namedseqs[i] = this.findIdMatch (nam);
10626 } else {
10627 namedseqs[i] = null;
10628 }} while (++i < seqs.length);
10629 }return namedseqs;
10630 }, "~A");
10631 Clazz_defineMethod (c$, "findIdMatch", 
10632  function (nam) {
10633 var matches =  new java.util.Vector ();
10634 while (this.names.containsKey (nam)) {
10635 matches.addElement (this.names.remove (nam));
10636 }
10637 return this.pickbestMatch (nam, matches);
10638 }, "jalview.analysis.SequenceIdMatcher.SeqIdName");
10639 Clazz_defineMethod (c$, "findAllIdMatches", 
10640  function (nam) {
10641 var matches =  new java.util.ArrayList ();
10642 while (this.names.containsKey (nam)) {
10643 matches.add (this.names.remove (nam));
10644 }
10645 var r = this.pickbestMatches (nam, matches);
10646 return r;
10647 }, "jalview.analysis.SequenceIdMatcher.SeqIdName");
10648 c$.$SequenceIdMatcher$SeqIdName$ = function () {
10649 Clazz_pu$h(self.c$);
10650 c$ = Clazz_decorateAsClass (function () {
10651 Clazz_prepareCallback (this, arguments);
10652 this.id = null;
10653 this.WORD_SEP = "~. |#\\/<>!\"\u00a4$%^*)}[@\',?_";
10654 Clazz_instantialize (this, arguments);
10655 }, jalview.analysis.SequenceIdMatcher, "SeqIdName");
10656 Clazz_makeConstructor (c$, 
10657 function (a) {
10658 if (a != null) {
10659 this.id =  String.instantialize (a);
10660 } else {
10661 this.id = "";
10662 }}, "~S");
10663 Clazz_overrideMethod (c$, "hashCode", 
10664 function () {
10665 return ((this.id.length >= 4) ? this.id.substring (0, 4).hashCode () : this.id.hashCode ());
10666 });
10667 Clazz_defineMethod (c$, "equals", 
10668 function (a) {
10669 if (a == null) {
10670 return false;
10671 }if (Clazz_instanceOf (a, jalview.analysis.SequenceIdMatcher.SeqIdName)) {
10672 return this.equals (a);
10673 } else {
10674 if (Clazz_instanceOf (a, String)) {
10675 return this.equals (a);
10676 }}return false;
10677 }, "~O");
10678 Clazz_defineMethod (c$, "equals", 
10679 function (a) {
10680 if (this.id.length > a.id.length) {
10681 return this.id.startsWith (a.id) ? (this.WORD_SEP.indexOf (this.id.charAt (a.id.length)) > -1) : false;
10682 } else {
10683 return a.id.startsWith (this.id) ? (a.id.equals (this.id) ? true : (this.WORD_SEP.indexOf (a.id.charAt (this.id.length)) > -1)) : false;
10684 }}, "jalview.analysis.SequenceIdMatcher.SeqIdName");
10685 Clazz_defineMethod (c$, "equals", 
10686 function (a) {
10687 if (this.id.length > a.length) {
10688 return this.id.startsWith (a) ? (this.WORD_SEP.indexOf (this.id.charAt (a.length)) > -1) : false;
10689 } else {
10690 return a.startsWith (this.id) ? (a.equals (this.id) ? true : (this.WORD_SEP.indexOf (a.charAt (this.id.length)) > -1)) : false;
10691 }}, "~S");
10692 c$ = Clazz_p0p ();
10693 };
10694 });
10695 Clazz_declarePackage ("jalview.appletgui");
10696 Clazz_load (["awt2swing.Canvas", "jalview.api.AlignViewControllerGuiI", "jalview.appletgui.EmbmenuFrame", "java.awt.event.ActionListener", "$.ItemListener", "$.KeyListener", "awt2swing.CheckboxMenuItem", "$.Label", "$.Menu", "$.MenuBar", "$.MenuItem", "jalview.util.MessageManager", "java.awt.BorderLayout"], "jalview.appletgui.AlignFrame", ["awt2swing.Frame", "$.Util", "jalview.analysis.AlignmentSorter", "$.AnnotationSorter", "jalview.appletgui.AlignViewport", "$.AlignmentPanel", "$.AnnotationColourChooser", "$.AnnotationColumnChooser", "$.AppletJmol", "$.CutAndPasteTransfer", "$.FeatureSettings", "$.Finder", "$.FontChooser", "$.OverviewPanel", "$.PCAPanel", "$.PaintRefresher", "$.PairwiseAlignPanel", "$.RedundancyPanel", "$.SliderPanel", "$.TreePanel", "$.UserDefinedColours", "jalview.bin.JalviewLite", "jalview.commands.EditCommand", "$.OrderCommand", "$.RemoveGapColCommand", "$.RemoveGapsCommand", "$.SlideSequencesCommand", "$.TrimRegionCommand", "jalview.controller.AlignViewController", "jalview.datamodel.Alignment", "$.PDBEntry", "$.Sequence", "$.SequenceGroup", "jalview.io.AlignmentProperties", "$.AnnotationFile", "$.AppletFormatAdapter", "$.FeaturesFile", "jalview.jsdev.GenericFileAdapter", "jalview.schemes.Blosum62ColourScheme", "$.BuriedColourScheme", "$.ClustalxColourScheme", "$.HelixColourScheme", "$.HydrophobicColourScheme", "$.NucleotideColourScheme", "$.PIDColourScheme", "$.PurinePyrimidineColourScheme", "$.RNAHelicesColourChooser", "$.RNAInteractionColourScheme", "$.StrandColourScheme", "$.TCoffeeColourScheme", "$.TaylorColourScheme", "$.TurnColourScheme", "$.ZappoColourScheme", "jalview.structure.StructureSelectionManager", "jalview.util.Comparison", "$.MappingUtils", "java.awt.Color", "$.Font", "java.awt.event.FocusListener", "$.WindowAdapter", "java.lang.Character", "$.StringBuffer", "java.net.URL", "$.URLEncoder", "java.util.Arrays", "$.HashMap", "$.Hashtable", "$.StringTokenizer", "$.Vector"], function () {
10697 c$ = Clazz_decorateAsClass (function () {
10698 this.avc = null;
10699 this.alignPanel = null;
10700 this.viewport = null;
10701 this.frameWidth = 700;
10702 this.frameHeight = 500;
10703 this.jalviewServletURL = null;
10704 this.showAutoCalculatedAbove = false;
10705 this.annotationSortOrder = null;
10706 this.alignFrameMenuBar = null;
10707 this.fileMenu = null;
10708 this.loadApplication = null;
10709 this.$loadTree = null;
10710 this.$loadAnnotations = null;
10711 this.$outputFeatures = null;
10712 this.$outputAnnotations = null;
10713 this.closeMenuItem = null;
10714 this.selectAllSequenceMenuItem = null;
10715 this.deselectAllSequenceMenuItem = null;
10716 this.invertSequenceMenuItem = null;
10717 this.remove2LeftMenuItem = null;
10718 this.remove2RightMenuItem = null;
10719 this.removeGappedColumnMenuItem = null;
10720 this.removeAllGapsMenuItem = null;
10721 this.viewBoxesMenuItem = null;
10722 this.viewTextMenuItem = null;
10723 this.sortPairwiseMenuItem = null;
10724 this.sortIDMenuItem = null;
10725 this.sortLengthMenuItem = null;
10726 this.sortGroupMenuItem = null;
10727 this.removeRedundancyMenuItem = null;
10728 this.pairwiseAlignmentMenuItem = null;
10729 this.PCAMenuItem = null;
10730 this.averageDistanceTreeMenuItem = null;
10731 this.neighbourTreeMenuItem = null;
10732 this.borderLayout1 = null;
10733 this.statusBar = null;
10734 this.clustalColour = null;
10735 this.zappoColour = null;
10736 this.taylorColour = null;
10737 this.hydrophobicityColour = null;
10738 this.helixColour = null;
10739 this.strandColour = null;
10740 this.turnColour = null;
10741 this.buriedColour = null;
10742 this.purinePyrimidineColour = null;
10743 this.RNAInteractionColour = null;
10744 this.RNAHelixColour = null;
10745 this.userDefinedColour = null;
10746 this.PIDColour = null;
10747 this.BLOSUM62Colour = null;
10748 this.tcoffeeColour = null;
10749 this.njTreeBlosumMenuItem = null;
10750 this.avDistanceTreeBlosumMenuItem = null;
10751 this.annotationPanelMenuItem = null;
10752 this.colourTextMenuItem = null;
10753 this.displayNonconservedMenuItem = null;
10754 this.alProperties = null;
10755 this.overviewMenuItem = null;
10756 this.undoMenuItem = null;
10757 this.redoMenuItem = null;
10758 this.conservationMenuItem = null;
10759 this.noColourmenuItem = null;
10760 this.wrapMenuItem = null;
10761 this.renderGapsMenuItem = null;
10762 this.findMenuItem = null;
10763 this.abovePIDThreshold = null;
10764 this.nucleotideColour = null;
10765 this.deleteGroups = null;
10766 this.grpsFromSelection = null;
10767 this.createGroup = null;
10768 this.unGroup = null;
10769 this.$delete = null;
10770 this.copy = null;
10771 this.cut = null;
10772 this.pasteMenu = null;
10773 this.pasteNew = null;
10774 this.pasteThis = null;
10775 this.applyToAllGroups = null;
10776 this.$font = null;
10777 this.scaleAbove = null;
10778 this.scaleLeft = null;
10779 this.scaleRight = null;
10780 this.modifyPID = null;
10781 this.modifyConservation = null;
10782 this.autoCalculate = null;
10783 this.$sortByTree = null;
10784 this.sortByTreeMenu = null;
10785 this.inputText = null;
10786 this.documentation = null;
10787 this.about = null;
10788 this.seqLimits = null;
10789 this.centreColumnLabelFlag = null;
10790 this.followMouseOverFlag = null;
10791 this.showSequenceLogo = null;
10792 this.applyAutoAnnotationSettings = null;
10793 this.showConsensusHistogram = null;
10794 this.showGroupConsensus = null;
10795 this.showGroupConservation = null;
10796 this.normSequenceLogo = null;
10797 this.featureSettings = null;
10798 this.sequenceFeatures = null;
10799 this.annotationColour = null;
10800 this.annotationColumnSelection = null;
10801 this.invertColSel = null;
10802 this.showColumns = null;
10803 this.showSeqs = null;
10804 this.hideColumns = null;
10805 this.hideSequences = null;
10806 this.hideAllButSelection = null;
10807 this.hideAllSelection = null;
10808 this.showAllHidden = null;
10809 this.$newView = null;
10810 this.showAlignmentAnnotations = null;
10811 this.showSequenceAnnotations = null;
10812 this.sortAnnBySequence = null;
10813 this.sortAnnByLabel = null;
10814 this.showAutoFirst = null;
10815 this.showAutoLast = null;
10816 this.splitFrame = null;
10817 Clazz_instantialize (this, arguments);
10818 }, jalview.appletgui, "AlignFrame", jalview.appletgui.EmbmenuFrame, [java.awt.event.ActionListener, java.awt.event.ItemListener, java.awt.event.KeyListener, jalview.api.AlignViewControllerGuiI]);
10819 Clazz_prepareFields (c$, function () {
10820 this.alignFrameMenuBar =  new awt2swing.MenuBar ();
10821 this.fileMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("action.file"));
10822 this.loadApplication =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.view_full_application"));
10823 this.$loadTree =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.load_associated_tree"));
10824 this.$loadAnnotations =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.load_features_annotations"));
10825 this.$outputFeatures =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.export_features").concat ("..."));
10826 this.$outputAnnotations =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.export_annotations").concat ("..."));
10827 this.closeMenuItem =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("action.close"));
10828 this.selectAllSequenceMenuItem =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("action.select_all"));
10829 this.deselectAllSequenceMenuItem =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("action.deselect_all"));
10830 this.invertSequenceMenuItem =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("action.invert_selection"));
10831 this.remove2LeftMenuItem =  new awt2swing.MenuItem ();
10832 this.remove2RightMenuItem =  new awt2swing.MenuItem ();
10833 this.removeGappedColumnMenuItem =  new awt2swing.MenuItem ();
10834 this.removeAllGapsMenuItem =  new awt2swing.MenuItem ();
10835 this.viewBoxesMenuItem =  new awt2swing.CheckboxMenuItem ();
10836 this.viewTextMenuItem =  new awt2swing.CheckboxMenuItem ();
10837 this.sortPairwiseMenuItem =  new awt2swing.MenuItem ();
10838 this.sortIDMenuItem =  new awt2swing.MenuItem ();
10839 this.sortLengthMenuItem =  new awt2swing.MenuItem ();
10840 this.sortGroupMenuItem =  new awt2swing.MenuItem ();
10841 this.removeRedundancyMenuItem =  new awt2swing.MenuItem ();
10842 this.pairwiseAlignmentMenuItem =  new awt2swing.MenuItem ();
10843 this.PCAMenuItem =  new awt2swing.MenuItem ();
10844 this.averageDistanceTreeMenuItem =  new awt2swing.MenuItem ();
10845 this.neighbourTreeMenuItem =  new awt2swing.MenuItem ();
10846 this.borderLayout1 =  new java.awt.BorderLayout ();
10847 this.statusBar =  new awt2swing.Label ();
10848 this.clustalColour =  new awt2swing.MenuItem ();
10849 this.zappoColour =  new awt2swing.MenuItem ();
10850 this.taylorColour =  new awt2swing.MenuItem ();
10851 this.hydrophobicityColour =  new awt2swing.MenuItem ();
10852 this.helixColour =  new awt2swing.MenuItem ();
10853 this.strandColour =  new awt2swing.MenuItem ();
10854 this.turnColour =  new awt2swing.MenuItem ();
10855 this.buriedColour =  new awt2swing.MenuItem ();
10856 this.purinePyrimidineColour =  new awt2swing.MenuItem ();
10857 this.RNAInteractionColour =  new awt2swing.MenuItem ();
10858 this.RNAHelixColour =  new awt2swing.MenuItem ();
10859 this.userDefinedColour =  new awt2swing.MenuItem ();
10860 this.PIDColour =  new awt2swing.MenuItem ();
10861 this.BLOSUM62Colour =  new awt2swing.MenuItem ();
10862 this.tcoffeeColour =  new awt2swing.MenuItem ();
10863 this.njTreeBlosumMenuItem =  new awt2swing.MenuItem ();
10864 this.avDistanceTreeBlosumMenuItem =  new awt2swing.MenuItem ();
10865 this.annotationPanelMenuItem =  new awt2swing.CheckboxMenuItem ();
10866 this.colourTextMenuItem =  new awt2swing.CheckboxMenuItem ();
10867 this.displayNonconservedMenuItem =  new awt2swing.CheckboxMenuItem ();
10868 this.alProperties =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.alignment_props"));
10869 this.overviewMenuItem =  new awt2swing.MenuItem ();
10870 this.undoMenuItem =  new awt2swing.MenuItem ();
10871 this.redoMenuItem =  new awt2swing.MenuItem ();
10872 this.conservationMenuItem =  new awt2swing.CheckboxMenuItem ();
10873 this.noColourmenuItem =  new awt2swing.MenuItem ();
10874 this.wrapMenuItem =  new awt2swing.CheckboxMenuItem ();
10875 this.renderGapsMenuItem =  new awt2swing.CheckboxMenuItem ();
10876 this.findMenuItem =  new awt2swing.MenuItem ();
10877 this.abovePIDThreshold =  new awt2swing.CheckboxMenuItem ();
10878 this.nucleotideColour =  new awt2swing.MenuItem ();
10879 this.deleteGroups =  new awt2swing.MenuItem ();
10880 this.grpsFromSelection =  new awt2swing.MenuItem ();
10881 this.createGroup =  new awt2swing.MenuItem ();
10882 this.unGroup =  new awt2swing.MenuItem ();
10883 this.$delete =  new awt2swing.MenuItem ();
10884 this.copy =  new awt2swing.MenuItem ();
10885 this.cut =  new awt2swing.MenuItem ();
10886 this.pasteMenu =  new awt2swing.Menu ();
10887 this.pasteNew =  new awt2swing.MenuItem ();
10888 this.pasteThis =  new awt2swing.MenuItem ();
10889 this.applyToAllGroups =  new awt2swing.CheckboxMenuItem ();
10890 this.$font =  new awt2swing.MenuItem ();
10891 this.scaleAbove =  new awt2swing.CheckboxMenuItem ();
10892 this.scaleLeft =  new awt2swing.CheckboxMenuItem ();
10893 this.scaleRight =  new awt2swing.CheckboxMenuItem ();
10894 this.modifyPID =  new awt2swing.MenuItem ();
10895 this.modifyConservation =  new awt2swing.MenuItem ();
10896 this.$sortByTree =  new awt2swing.CheckboxMenuItem ("Sort Alignment With New Tree", true);
10897 this.sortByTreeMenu =  new awt2swing.Menu ();
10898 this.inputText =  new awt2swing.MenuItem ();
10899 this.documentation =  new awt2swing.MenuItem ();
10900 this.about =  new awt2swing.MenuItem ();
10901 this.seqLimits =  new awt2swing.CheckboxMenuItem ();
10902 this.centreColumnLabelFlag =  new awt2swing.CheckboxMenuItem ();
10903 this.followMouseOverFlag =  new awt2swing.CheckboxMenuItem ();
10904 this.showSequenceLogo =  new awt2swing.CheckboxMenuItem ();
10905 this.applyAutoAnnotationSettings =  new awt2swing.CheckboxMenuItem ();
10906 this.showConsensusHistogram =  new awt2swing.CheckboxMenuItem ();
10907 this.showGroupConsensus =  new awt2swing.CheckboxMenuItem ();
10908 this.showGroupConservation =  new awt2swing.CheckboxMenuItem ();
10909 this.normSequenceLogo =  new awt2swing.CheckboxMenuItem ();
10910 this.featureSettings =  new awt2swing.MenuItem ();
10911 this.sequenceFeatures =  new awt2swing.CheckboxMenuItem ();
10912 this.annotationColour =  new awt2swing.MenuItem ();
10913 this.annotationColumnSelection =  new awt2swing.MenuItem ();
10914 this.invertColSel =  new awt2swing.MenuItem ();
10915 this.showColumns =  new awt2swing.MenuItem ();
10916 this.showSeqs =  new awt2swing.MenuItem ();
10917 this.hideColumns =  new awt2swing.MenuItem ();
10918 this.hideSequences =  new awt2swing.MenuItem ();
10919 this.hideAllButSelection =  new awt2swing.MenuItem ();
10920 this.hideAllSelection =  new awt2swing.MenuItem ();
10921 this.showAllHidden =  new awt2swing.MenuItem ();
10922 this.$newView =  new awt2swing.MenuItem ();
10923 });
10924 Clazz_makeConstructor (c$, 
10925 function (al, applet, title, embedded) {
10926 this.construct (al, applet, title, embedded, true);
10927 }, "jalview.datamodel.AlignmentI,jalview.bin.JalviewLite,~S,~B");
10928 Clazz_makeConstructor (c$, 
10929 function (al, applet, title, embedded, addToDisplay) {
10930 this.construct (al, null, null, applet, title, embedded, addToDisplay);
10931 }, "jalview.datamodel.AlignmentI,jalview.bin.JalviewLite,~S,~B,~B");
10932 Clazz_makeConstructor (c$, 
10933 function (al, hiddenSeqs, columnSelection, applet, title, embedded) {
10934 this.construct (al, hiddenSeqs, columnSelection, applet, title, embedded, true);
10935 }, "jalview.datamodel.AlignmentI,~A,jalview.datamodel.ColumnSelection,jalview.bin.JalviewLite,~S,~B");
10936 Clazz_makeConstructor (c$, 
10937 function (al, hiddenSeqs, columnSelection, applet, title, embedded, addToDisplay) {
10938 Clazz_superConstructor (this, jalview.appletgui.AlignFrame, []);
10939 if (applet != null) {
10940 this.jalviewServletURL = applet.jalviewServletURL;
10941 }try {
10942 this.jbInit ();
10943 } catch (ex) {
10944 if (Clazz_exceptionOf (ex, Exception)) {
10945 ex.printStackTrace ();
10946 } else {
10947 throw ex;
10948 }
10949 }
10950 if (applet != null) {
10951 var param;
10952 try {
10953 param = applet.windowWidth;
10954 if (param != null) {
10955 var width = Integer.parseInt (param);
10956 this.frameWidth = width;
10957 }param = applet.windowHeight;
10958 if (param != null) {
10959 var height = Integer.parseInt (param);
10960 this.frameHeight = height;
10961 }} catch (ex) {
10962 if (Clazz_exceptionOf (ex, Exception)) {
10963 } else {
10964 throw ex;
10965 }
10966 }
10967 }this.viewport =  new jalview.appletgui.AlignViewport (al, applet);
10968 if (hiddenSeqs != null && hiddenSeqs.length > 0) {
10969 this.viewport.hideSequence (hiddenSeqs);
10970 }if (columnSelection != null) {
10971 this.viewport.setColumnSelection (columnSelection);
10972 }this.alignPanel =  new jalview.appletgui.AlignmentPanel (this, this.viewport);
10973 this.avc =  new jalview.controller.AlignViewController (this, this.viewport, this.alignPanel);
10974 this.viewport.updateConservation (this.alignPanel);
10975 this.viewport.updateConsensus (this.alignPanel);
10976 this.displayNonconservedMenuItem.setState (this.viewport.getShowUnconserved ());
10977 this.followMouseOverFlag.setState (this.viewport.isFollowHighlight ());
10978 this.showGroupConsensus.setState (this.viewport.isShowGroupConsensus ());
10979 this.showGroupConservation.setState (this.viewport.isShowGroupConservation ());
10980 this.showConsensusHistogram.setState (this.viewport.isShowConsensusHistogram ());
10981 this.showSequenceLogo.setState (this.viewport.isShowSequenceLogo ());
10982 this.normSequenceLogo.setState (this.viewport.isNormaliseSequenceLogo ());
10983 this.applyToAllGroups.setState (this.viewport.getColourAppliesToAllGroups ());
10984 this.annotationPanelMenuItem.setState (this.viewport.isShowAnnotation ());
10985 this.showAlignmentAnnotations.setState (this.viewport.isShowAnnotation ());
10986 this.showSequenceAnnotations.setState (this.viewport.isShowAnnotation ());
10987 this.seqLimits.setState (this.viewport.getShowJVSuffix ());
10988 if (applet != null) {
10989 var param = applet.sortBy;
10990 if (param != null) {
10991 if (param.equalsIgnoreCase ("Id")) {
10992 this.sortIDMenuItem_actionPerformed ();
10993 } else if (param.equalsIgnoreCase ("Pairwise Identity")) {
10994 this.sortPairwiseMenuItem_actionPerformed ();
10995 } else if (param.equalsIgnoreCase ("Length")) {
10996 this.sortLengthMenuItem_actionPerformed ();
10997 }}param = applet.wrap;
10998 if (param != null) {
10999 if (param.equalsIgnoreCase ("true")) {
11000 this.wrapMenuItem.setState (true);
11001 this.wrapMenuItem_actionPerformed ();
11002 }}param = applet.centrecolumnlabels;
11003 if (param != null) {
11004 this.centreColumnLabelFlag.setState (true);
11005 this.centreColumnLabelFlag_stateChanged ();
11006 }}if (this.viewport.getAlignment ().isNucleotide ()) {
11007 this.viewport.updateStrucConsensus (this.alignPanel);
11008 if (this.viewport.getAlignment ().hasRNAStructure ()) {
11009 this.RNAHelixColour.setEnabled (true);
11010 } else {
11011 this.RNAHelixColour.setEnabled (false);
11012 }} else {
11013 this.RNAHelixColour.setEnabled (false);
11014 this.purinePyrimidineColour.setEnabled (false);
11015 }this.addKeyListener (this);
11016 this.alignPanel.seqPanel.seqCanvas.addKeyListener (this);
11017 this.alignPanel.idPanel.idCanvas.addKeyListener (this);
11018 this.alignPanel.scalePanel.addKeyListener (this);
11019 this.alignPanel.annotationPanel.addKeyListener (this);
11020 this.alignPanel.annotationPanelHolder.addKeyListener (this);
11021 this.alignPanel.annotationSpaceFillerHolder.addKeyListener (this);
11022 this.alignPanel.alabels.addKeyListener (this);
11023 if (addToDisplay) {
11024 this.addToDisplay (embedded);
11025 }}, "jalview.datamodel.AlignmentI,~A,jalview.datamodel.ColumnSelection,jalview.bin.JalviewLite,~S,~B,~B");
11026 Clazz_defineMethod (c$, "addToDisplay", 
11027 function (embedded) {
11028 this.createAlignFrameWindow (embedded);
11029 this.validate ();
11030 this.alignPanel.adjustAnnotationHeight ();
11031 this.alignPanel.paintAlignment (true);
11032 }, "~B");
11033 Clazz_defineMethod (c$, "getAlignViewport", 
11034 function () {
11035 return this.viewport;
11036 });
11037 Clazz_defineMethod (c$, "getSeqcanvas", 
11038 function () {
11039 return this.alignPanel.seqPanel.seqCanvas;
11040 });
11041 Clazz_defineMethod (c$, "parseFeaturesFile", 
11042 function (file, type) {
11043 return this.parseFeaturesFile (file, type, true);
11044 }, "~S,~S");
11045 Clazz_defineMethod (c$, "parseFeaturesFile", 
11046 function (file, type, autoenabledisplay) {
11047 var featureLinks =  new java.util.Hashtable ();
11048 var featuresFile = false;
11049 try {
11050 featuresFile =  new jalview.io.FeaturesFile (file, type).parse (this.viewport.getAlignment (), this.alignPanel.seqPanel.seqCanvas.getFeatureRenderer ().getFeatureColours (), featureLinks, true, this.viewport.applet.getDefaultParameter ("relaxedidmatch", false));
11051 } catch (ex) {
11052 if (Clazz_exceptionOf (ex, Exception)) {
11053 ex.printStackTrace ();
11054 } else {
11055 throw ex;
11056 }
11057 }
11058 if (featuresFile) {
11059 if (featureLinks.size () > 0) {
11060 this.alignPanel.seqPanel.seqCanvas.getFeatureRenderer ().featureLinks = featureLinks;
11061 }if (autoenabledisplay) {
11062 this.viewport.setShowSequenceFeatures (true);
11063 this.sequenceFeatures.setState (true);
11064 }if (this.alignPanel.seqPanel.seqCanvas.fr != null) {
11065 this.alignPanel.seqPanel.seqCanvas.fr.findAllFeatures (true);
11066 }if (this.viewport.featureSettings != null) {
11067 this.viewport.featureSettings.refreshTable ();
11068 }this.alignPanel.paintAlignment (true);
11069 this.setStatus (jalview.util.MessageManager.getString ("label.successfully_added_features_alignment"));
11070 }return featuresFile;
11071 }, "~S,~S,~B");
11072 Clazz_overrideMethod (c$, "keyPressed", 
11073 function (evt) {
11074 if (this.viewport.cursorMode && ((evt.getKeyCode () >= 48 && evt.getKeyCode () <= 57) || (evt.getKeyCode () >= 96 && evt.getKeyCode () <= 105)) && Character.isDigit (evt.getKeyChar ())) {
11075 this.alignPanel.seqPanel.numberPressed (evt.getKeyChar ());
11076 }switch (evt.getKeyCode ()) {
11077 case 27:
11078 this.deselectAllSequenceMenuItem_actionPerformed ();
11079 this.alignPanel.alabels.cancelDrag ();
11080 break;
11081 case 88:
11082 if (evt.isControlDown () || evt.isMetaDown ()) {
11083 this.cut_actionPerformed ();
11084 }break;
11085 case 67:
11086 if (this.viewport.cursorMode && !evt.isControlDown ()) {
11087 this.alignPanel.seqPanel.setCursorColumn ();
11088 }if (evt.isControlDown () || evt.isMetaDown ()) {
11089 this.copy_actionPerformed ();
11090 }break;
11091 case 86:
11092 if (evt.isControlDown ()) {
11093 this.paste (evt.isShiftDown ());
11094 }break;
11095 case 65:
11096 if (evt.isControlDown () || evt.isMetaDown ()) {
11097 this.selectAllSequenceMenuItem_actionPerformed ();
11098 }break;
11099 case 40:
11100 if (this.viewport.cursorMode) {
11101 this.alignPanel.seqPanel.moveCursor (0, 1);
11102 } else {
11103 this.moveSelectedSequences (false);
11104 }break;
11105 case 38:
11106 if (this.viewport.cursorMode) {
11107 this.alignPanel.seqPanel.moveCursor (0, -1);
11108 } else {
11109 this.moveSelectedSequences (true);
11110 }break;
11111 case 37:
11112 if (evt.isAltDown () || !this.viewport.cursorMode) {
11113 this.slideSequences (false, this.alignPanel.seqPanel.getKeyboardNo1 ());
11114 } else {
11115 this.alignPanel.seqPanel.moveCursor (-1, 0);
11116 }break;
11117 case 39:
11118 if (evt.isAltDown () || !this.viewport.cursorMode) {
11119 this.slideSequences (true, this.alignPanel.seqPanel.getKeyboardNo1 ());
11120 } else {
11121 this.alignPanel.seqPanel.moveCursor (1, 0);
11122 }break;
11123 case 32:
11124 if (this.viewport.cursorMode) {
11125 this.alignPanel.seqPanel.insertGapAtCursor (evt.isControlDown () || evt.isShiftDown () || evt.isAltDown ());
11126 }break;
11127 case 127:
11128 case 8:
11129 if (this.viewport.cursorMode) {
11130 this.alignPanel.seqPanel.deleteGapAtCursor (evt.isControlDown () || evt.isShiftDown () || evt.isAltDown ());
11131 } else {
11132 this.cut_actionPerformed ();
11133 this.alignPanel.seqPanel.seqCanvas.repaint ();
11134 }break;
11135 case 83:
11136 if (this.viewport.cursorMode) {
11137 this.alignPanel.seqPanel.setCursorRow ();
11138 }break;
11139 case 80:
11140 if (this.viewport.cursorMode) {
11141 this.alignPanel.seqPanel.setCursorPosition ();
11142 }break;
11143 case 10:
11144 case 44:
11145 if (this.viewport.cursorMode) {
11146 this.alignPanel.seqPanel.setCursorRowAndColumn ();
11147 }break;
11148 case 81:
11149 if (this.viewport.cursorMode) {
11150 this.alignPanel.seqPanel.setSelectionAreaAtCursor (true);
11151 }break;
11152 case 77:
11153 if (this.viewport.cursorMode) {
11154 this.alignPanel.seqPanel.setSelectionAreaAtCursor (false);
11155 }break;
11156 case 113:
11157 this.viewport.cursorMode = !this.viewport.cursorMode;
11158 this.setStatus (jalview.util.MessageManager.formatMessage ("label.keyboard_editing_mode",  Clazz_newArray (-1, [(this.viewport.cursorMode ? "on" : "off")])));
11159 if (this.viewport.cursorMode) {
11160 this.alignPanel.seqPanel.seqCanvas.cursorX = this.viewport.startRes;
11161 this.alignPanel.seqPanel.seqCanvas.cursorY = this.viewport.startSeq;
11162 }break;
11163 case 70:
11164 if (evt.isControlDown ()) {
11165 this.findMenuItem_actionPerformed ();
11166 }break;
11167 case 72:
11168 {
11169 var toggleSeqs = !evt.isControlDown ();
11170 var toggleCols = !evt.isShiftDown ();
11171 this.toggleHiddenRegions (toggleSeqs, toggleCols);
11172 break;
11173 }case 33:
11174 if (this.viewport.getWrapAlignment ()) {
11175 this.alignPanel.scrollUp (true);
11176 } else {
11177 this.alignPanel.setScrollValues (this.viewport.startRes, this.viewport.startSeq - this.viewport.endSeq + this.viewport.startSeq);
11178 }break;
11179 case 34:
11180 if (this.viewport.getWrapAlignment ()) {
11181 this.alignPanel.scrollUp (false);
11182 } else {
11183 this.alignPanel.setScrollValues (this.viewport.startRes, this.viewport.startSeq + this.viewport.endSeq - this.viewport.startSeq);
11184 }break;
11185 case 90:
11186 if (evt.isControlDown ()) {
11187 this.undoMenuItem_actionPerformed ();
11188 }break;
11189 case 89:
11190 if (evt.isControlDown ()) {
11191 this.redoMenuItem_actionPerformed ();
11192 }break;
11193 case 76:
11194 if (evt.isControlDown ()) {
11195 this.trimAlignment (true);
11196 }break;
11197 case 82:
11198 if (evt.isControlDown ()) {
11199 this.trimAlignment (false);
11200 }break;
11201 case 69:
11202 if (evt.isControlDown ()) {
11203 if (evt.isShiftDown ()) {
11204 this.removeAllGapsMenuItem_actionPerformed ();
11205 } else {
11206 this.removeGappedColumnMenuItem_actionPerformed ();
11207 }}break;
11208 case 73:
11209 if (evt.isControlDown ()) {
11210 if (evt.isAltDown ()) {
11211 this.invertColSel_actionPerformed ();
11212 } else {
11213 this.invertSequenceMenuItem_actionPerformed ();
11214 }}break;
11215 case 71:
11216 if (evt.isControlDown ()) {
11217 if (evt.isShiftDown ()) {
11218 this.unGroup_actionPerformed ();
11219 } else {
11220 this.createGroup_actionPerformed ();
11221 }}break;
11222 case 85:
11223 if (evt.isControlDown ()) {
11224 this.deleteGroups_actionPerformed ();
11225 }break;
11226 case 84:
11227 if (evt.isControlDown ()) {
11228 this.newView (null);
11229 }break;
11230 }
11231 this.alignPanel.paintAlignment (true);
11232 }, "java.awt.event.KeyEvent");
11233 Clazz_defineMethod (c$, "toggleHiddenRegions", 
11234  function (toggleSeqs, toggleCols) {
11235 var hide = false;
11236 var sg = this.viewport.getSelectionGroup ();
11237 if (!toggleSeqs && !toggleCols) {
11238 if ((this.viewport.getColumnSelection () != null && this.viewport.getColumnSelection ().getSelected () != null && this.viewport.getColumnSelection ().getSelected ().size () > 0) || (sg != null && sg.getSize () > 0 && sg.getStartRes () <= sg.getEndRes ())) {
11239 if (sg != null) {
11240 this.invertSequenceMenuItem_actionPerformed ();
11241 sg = this.viewport.getSelectionGroup ();
11242 toggleSeqs = true;
11243 }this.viewport.expandColSelection (sg, true);
11244 this.invertColSel_actionPerformed ();
11245 toggleCols = true;
11246 }}if (toggleSeqs) {
11247 if (sg != null && sg.getSize () != this.viewport.getAlignment ().getHeight ()) {
11248 hide = true;
11249 this.viewport.hideAllSelectedSeqs ();
11250 } else if (!(toggleCols && this.viewport.getColumnSelection ().getSelected ().size () > 0)) {
11251 this.viewport.showAllHiddenSeqs ();
11252 }}if (toggleCols) {
11253 if (this.viewport.getColumnSelection ().getSelected ().size () > 0) {
11254 this.viewport.hideSelectedColumns ();
11255 if (!toggleSeqs) {
11256 this.viewport.setSelectionGroup (sg);
11257 }} else if (!hide) {
11258 this.viewport.showAllHiddenColumns ();
11259 }}}, "~B,~B");
11260 Clazz_overrideMethod (c$, "keyReleased", 
11261 function (evt) {
11262 }, "java.awt.event.KeyEvent");
11263 Clazz_overrideMethod (c$, "keyTyped", 
11264 function (evt) {
11265 }, "java.awt.event.KeyEvent");
11266 Clazz_overrideMethod (c$, "itemStateChanged", 
11267 function (evt) {
11268 var source = evt.getSource ();
11269 if (source === this.displayNonconservedMenuItem) {
11270 this.displayNonconservedMenuItem_actionPerformed ();
11271 } else if (source === this.colourTextMenuItem) {
11272 this.colourTextMenuItem_actionPerformed ();
11273 } else if (source === this.wrapMenuItem) {
11274 this.wrapMenuItem_actionPerformed ();
11275 } else if (source === this.scaleAbove) {
11276 this.viewport.setScaleAboveWrapped (this.scaleAbove.getState ());
11277 } else if (source === this.scaleLeft) {
11278 this.viewport.setScaleLeftWrapped (this.scaleLeft.getState ());
11279 } else if (source === this.scaleRight) {
11280 this.viewport.setScaleRightWrapped (this.scaleRight.getState ());
11281 } else if (source === this.seqLimits) {
11282 this.seqLimits_itemStateChanged ();
11283 } else if (source === this.viewBoxesMenuItem) {
11284 this.viewport.setShowBoxes (this.viewBoxesMenuItem.getState ());
11285 } else if (source === this.viewTextMenuItem) {
11286 this.viewport.setShowText (this.viewTextMenuItem.getState ());
11287 } else if (source === this.renderGapsMenuItem) {
11288 this.viewport.setRenderGaps (this.renderGapsMenuItem.getState ());
11289 } else if (source === this.annotationPanelMenuItem) {
11290 this.viewport.setShowAnnotation (this.annotationPanelMenuItem.getState ());
11291 this.alignPanel.setAnnotationVisible (this.annotationPanelMenuItem.getState ());
11292 } else if (source === this.sequenceFeatures) {
11293 this.viewport.setShowSequenceFeatures (this.sequenceFeatures.getState ());
11294 this.alignPanel.seqPanel.seqCanvas.repaint ();
11295 } else if (source === this.showAlignmentAnnotations) {
11296 this.setAnnotationsVisibility ();
11297 } else if (source === this.showSequenceAnnotations) {
11298 this.setAnnotationsVisibility ();
11299 } else if (source === this.sortAnnBySequence) {
11300 var newState = this.sortAnnBySequence.getState ();
11301 this.sortAnnByLabel.setState (false);
11302 this.setAnnotationSortOrder (newState ? jalview.analysis.AnnotationSorter.SequenceAnnotationOrder.SEQUENCE_AND_LABEL : jalview.analysis.AnnotationSorter.SequenceAnnotationOrder.NONE);
11303 this.setViewportAnnotationOrder ();
11304 } else if (source === this.sortAnnByLabel) {
11305 var newState = this.sortAnnByLabel.getState ();
11306 this.sortAnnBySequence.setState (false);
11307 this.setAnnotationSortOrder (newState ? jalview.analysis.AnnotationSorter.SequenceAnnotationOrder.LABEL_AND_SEQUENCE : jalview.analysis.AnnotationSorter.SequenceAnnotationOrder.NONE);
11308 this.setViewportAnnotationOrder ();
11309 } else if (source === this.showAutoFirst) {
11310 this.showAutoLast.setState (!this.showAutoFirst.getState ());
11311 this.setShowAutoCalculatedAbove (this.showAutoFirst.getState ());
11312 this.setViewportAnnotationOrder ();
11313 } else if (source === this.showAutoLast) {
11314 this.showAutoFirst.setState (!this.showAutoLast.getState ());
11315 this.setShowAutoCalculatedAbove (this.showAutoFirst.getState ());
11316 this.setViewportAnnotationOrder ();
11317 } else if (source === this.conservationMenuItem) {
11318 this.conservationMenuItem_actionPerformed ();
11319 } else if (source === this.abovePIDThreshold) {
11320 this.abovePIDThreshold_actionPerformed ();
11321 } else if (source === this.applyToAllGroups) {
11322 this.viewport.setColourAppliesToAllGroups (this.applyToAllGroups.getState ());
11323 } else if (source === this.autoCalculate) {
11324 this.viewport.autoCalculateConsensus = this.autoCalculate.getState ();
11325 } else if (source === this.$sortByTree) {
11326 this.viewport.sortByTree = this.$sortByTree.getState ();
11327 } else if (source === this.centreColumnLabelFlag) {
11328 this.centreColumnLabelFlag_stateChanged ();
11329 } else if (source === this.followMouseOverFlag) {
11330 this.mouseOverFlag_stateChanged ();
11331 } else if (source === this.showGroupConsensus) {
11332 this.showGroupConsensus_actionPerformed ();
11333 } else if (source === this.showGroupConservation) {
11334 this.showGroupConservation_actionPerformed ();
11335 } else if (source === this.showSequenceLogo) {
11336 this.showSequenceLogo_actionPerformed ();
11337 } else if (source === this.normSequenceLogo) {
11338 this.normSequenceLogo_actionPerformed ();
11339 } else if (source === this.showConsensusHistogram) {
11340 this.showConsensusHistogram_actionPerformed ();
11341 } else if (source === this.applyAutoAnnotationSettings) {
11342 this.applyAutoAnnotationSettings_actionPerformed ();
11343 }this.alignPanel.paintAlignment (true);
11344 }, "java.awt.event.ItemEvent");
11345 Clazz_defineMethod (c$, "setAnnotationsVisibility", 
11346  function () {
11347 var showForAlignment = this.showAlignmentAnnotations.getState ();
11348 var showForSequences = this.showSequenceAnnotations.getState ();
11349 for (var aa, $aa = 0, $$aa = this.alignPanel.getAlignment ().getAlignmentAnnotation (); $aa < $$aa.length && ((aa = $$aa[$aa]) || true); $aa++) {
11350 var visible = (aa.sequenceRef == null ? showForAlignment : showForSequences);
11351 aa.visible = visible;
11352 }
11353 this.alignPanel.validateAnnotationDimensions (true);
11354 this.validate ();
11355 this.repaint ();
11356 });
11357 Clazz_defineMethod (c$, "setAnnotationSortOrder", 
11358  function (order) {
11359 this.annotationSortOrder = order;
11360 }, "jalview.analysis.AnnotationSorter.SequenceAnnotationOrder");
11361 Clazz_defineMethod (c$, "setViewportAnnotationOrder", 
11362  function () {
11363 this.alignPanel.av.setSortAnnotationsBy (this.annotationSortOrder);
11364 this.alignPanel.av.setShowAutocalculatedAbove (this.showAutoCalculatedAbove);
11365 });
11366 Clazz_defineMethod (c$, "setShowAutoCalculatedAbove", 
11367  function (showAbove) {
11368 this.showAutoCalculatedAbove = showAbove;
11369 }, "~B");
11370 Clazz_defineMethod (c$, "mouseOverFlag_stateChanged", 
11371  function () {
11372 this.viewport.setFollowHighlight (this.followMouseOverFlag.getState ());
11373 });
11374 Clazz_defineMethod (c$, "centreColumnLabelFlag_stateChanged", 
11375  function () {
11376 this.viewport.centreColumnLabels = this.centreColumnLabelFlag.getState ();
11377 this.alignPanel.annotationPanel.repaint ();
11378 });
11379 Clazz_overrideMethod (c$, "actionPerformed", 
11380 function (evt) {
11381 var source = evt.getSource ();
11382 if (source === this.inputText) {
11383 this.inputText_actionPerformed ();
11384 } else if (source === this.$loadTree) {
11385 this.loadTree_actionPerformed ();
11386 } else if (source === this.loadApplication) {
11387 this.launchFullApplication ();
11388 } else if (source === this.$loadAnnotations) {
11389 this.loadAnnotations ();
11390 } else if (source === this.$outputAnnotations) {
11391 this.outputAnnotations (true);
11392 } else if (source === this.$outputFeatures) {
11393 this.outputFeatures (true, "Jalview");
11394 } else if (source === this.closeMenuItem) {
11395 this.closeMenuItem_actionPerformed ();
11396 } else if (source === this.copy) {
11397 this.copy_actionPerformed ();
11398 } else if (source === this.undoMenuItem) {
11399 this.undoMenuItem_actionPerformed ();
11400 } else if (source === this.redoMenuItem) {
11401 this.redoMenuItem_actionPerformed ();
11402 } else if (source === this.inputText) {
11403 this.inputText_actionPerformed ();
11404 } else if (source === this.closeMenuItem) {
11405 this.closeMenuItem_actionPerformed ();
11406 } else if (source === this.undoMenuItem) {
11407 this.undoMenuItem_actionPerformed ();
11408 } else if (source === this.redoMenuItem) {
11409 this.redoMenuItem_actionPerformed ();
11410 } else if (source === this.copy) {
11411 this.copy_actionPerformed ();
11412 } else if (source === this.pasteNew) {
11413 this.pasteNew_actionPerformed ();
11414 } else if (source === this.pasteThis) {
11415 this.pasteThis_actionPerformed ();
11416 } else if (source === this.cut) {
11417 this.cut_actionPerformed ();
11418 } else if (source === this.$delete) {
11419 this.delete_actionPerformed ();
11420 } else if (source === this.grpsFromSelection) {
11421 this.makeGrpsFromSelection_actionPerformed ();
11422 } else if (source === this.deleteGroups) {
11423 this.deleteGroups_actionPerformed ();
11424 } else if (source === this.selectAllSequenceMenuItem) {
11425 this.selectAllSequenceMenuItem_actionPerformed ();
11426 } else if (source === this.deselectAllSequenceMenuItem) {
11427 this.deselectAllSequenceMenuItem_actionPerformed ();
11428 } else if (source === this.invertSequenceMenuItem) {
11429 this.invertSequenceMenuItem_actionPerformed ();
11430 } else if (source === this.invertColSel) {
11431 this.viewport.invertColumnSelection ();
11432 this.alignPanel.paintAlignment (true);
11433 } else if (source === this.remove2LeftMenuItem) {
11434 this.trimAlignment (true);
11435 } else if (source === this.remove2RightMenuItem) {
11436 this.trimAlignment (false);
11437 } else if (source === this.removeGappedColumnMenuItem) {
11438 this.removeGappedColumnMenuItem_actionPerformed ();
11439 } else if (source === this.removeAllGapsMenuItem) {
11440 this.removeAllGapsMenuItem_actionPerformed ();
11441 } else if (source === this.findMenuItem) {
11442 this.findMenuItem_actionPerformed ();
11443 } else if (source === this.$font) {
11444  new jalview.appletgui.FontChooser (this.alignPanel);
11445 } else if (source === this.$newView) {
11446 this.newView (null);
11447 } else if (source === this.showColumns) {
11448 this.viewport.showAllHiddenColumns ();
11449 this.alignPanel.paintAlignment (true);
11450 } else if (source === this.showSeqs) {
11451 this.viewport.showAllHiddenSeqs ();
11452 this.alignPanel.paintAlignment (true);
11453 } else if (source === this.hideColumns) {
11454 this.viewport.hideSelectedColumns ();
11455 this.alignPanel.paintAlignment (true);
11456 } else if (source === this.hideSequences && this.viewport.getSelectionGroup () != null) {
11457 this.viewport.hideAllSelectedSeqs ();
11458 this.alignPanel.paintAlignment (true);
11459 } else if (source === this.hideAllButSelection) {
11460 this.toggleHiddenRegions (false, false);
11461 this.alignPanel.paintAlignment (true);
11462 } else if (source === this.hideAllSelection) {
11463 var sg = this.viewport.getSelectionGroup ();
11464 this.viewport.expandColSelection (sg, false);
11465 this.viewport.hideAllSelectedSeqs ();
11466 this.viewport.hideSelectedColumns ();
11467 this.alignPanel.paintAlignment (true);
11468 } else if (source === this.showAllHidden) {
11469 this.viewport.showAllHiddenColumns ();
11470 this.viewport.showAllHiddenSeqs ();
11471 this.alignPanel.paintAlignment (true);
11472 } else if (source === this.showGroupConsensus) {
11473 this.showGroupConsensus_actionPerformed ();
11474 } else if (source === this.showGroupConservation) {
11475 this.showGroupConservation_actionPerformed ();
11476 } else if (source === this.showSequenceLogo) {
11477 this.showSequenceLogo_actionPerformed ();
11478 } else if (source === this.normSequenceLogo) {
11479 this.normSequenceLogo_actionPerformed ();
11480 } else if (source === this.showConsensusHistogram) {
11481 this.showConsensusHistogram_actionPerformed ();
11482 } else if (source === this.applyAutoAnnotationSettings) {
11483 this.applyAutoAnnotationSettings_actionPerformed ();
11484 } else if (source === this.featureSettings) {
11485  new jalview.appletgui.FeatureSettings (this.alignPanel);
11486 } else if (source === this.alProperties) {
11487 var contents =  new jalview.io.AlignmentProperties (this.viewport.getAlignment ()).formatAsString ();
11488 var cap =  new jalview.appletgui.CutAndPasteTransfer (false, this);
11489 cap.setText (contents.toString ());
11490 var frame =  new awt2swing.Frame ();
11491 frame.add (cap);
11492 jalview.bin.JalviewLite.addFrame (frame, jalview.util.MessageManager.formatMessage ("label.alignment_properties",  Clazz_newArray (-1, [this.getTitle ()])), 400, 250);
11493 } else if (source === this.overviewMenuItem) {
11494 this.overviewMenuItem_actionPerformed ();
11495 } else if (source === this.noColourmenuItem) {
11496 this.changeColour (null);
11497 } else if (source === this.clustalColour) {
11498 this.abovePIDThreshold.setState (false);
11499 this.changeColour ( new jalview.schemes.ClustalxColourScheme (this.viewport.getAlignment (), null));
11500 } else if (source === this.zappoColour) {
11501 this.changeColour ( new jalview.schemes.ZappoColourScheme ());
11502 } else if (source === this.taylorColour) {
11503 this.changeColour ( new jalview.schemes.TaylorColourScheme ());
11504 } else if (source === this.hydrophobicityColour) {
11505 this.changeColour ( new jalview.schemes.HydrophobicColourScheme ());
11506 } else if (source === this.helixColour) {
11507 this.changeColour ( new jalview.schemes.HelixColourScheme ());
11508 } else if (source === this.strandColour) {
11509 this.changeColour ( new jalview.schemes.StrandColourScheme ());
11510 } else if (source === this.turnColour) {
11511 this.changeColour ( new jalview.schemes.TurnColourScheme ());
11512 } else if (source === this.buriedColour) {
11513 this.changeColour ( new jalview.schemes.BuriedColourScheme ());
11514 } else if (source === this.nucleotideColour) {
11515 this.changeColour ( new jalview.schemes.NucleotideColourScheme ());
11516 } else if (source === this.purinePyrimidineColour) {
11517 this.changeColour ( new jalview.schemes.PurinePyrimidineColourScheme ());
11518 } else if (source === this.RNAInteractionColour) {
11519 this.changeColour ( new jalview.schemes.RNAInteractionColourScheme ());
11520 } else if (source === this.RNAHelixColour) {
11521  new jalview.schemes.RNAHelicesColourChooser (this.viewport, this.alignPanel);
11522 } else if (source === this.modifyPID) {
11523 this.modifyPID_actionPerformed ();
11524 } else if (source === this.modifyConservation) {
11525 this.modifyConservation_actionPerformed ();
11526 } else if (source === this.userDefinedColour) {
11527  new jalview.appletgui.UserDefinedColours (this.alignPanel, null);
11528 } else if (source === this.PIDColour) {
11529 this.changeColour ( new jalview.schemes.PIDColourScheme ());
11530 } else if (source === this.BLOSUM62Colour) {
11531 this.changeColour ( new jalview.schemes.Blosum62ColourScheme ());
11532 } else if (source === this.tcoffeeColour) {
11533 this.changeColour ( new jalview.schemes.TCoffeeColourScheme (this.alignPanel.getAlignment ()));
11534 } else if (source === this.annotationColour) {
11535  new jalview.appletgui.AnnotationColourChooser (this.viewport, this.alignPanel);
11536 } else if (source === this.annotationColumnSelection) {
11537  new jalview.appletgui.AnnotationColumnChooser (this.viewport, this.alignPanel);
11538 } else if (source === this.sortPairwiseMenuItem) {
11539 this.sortPairwiseMenuItem_actionPerformed ();
11540 } else if (source === this.sortIDMenuItem) {
11541 this.sortIDMenuItem_actionPerformed ();
11542 } else if (source === this.sortLengthMenuItem) {
11543 this.sortLengthMenuItem_actionPerformed ();
11544 } else if (source === this.sortGroupMenuItem) {
11545 this.sortGroupMenuItem_actionPerformed ();
11546 } else if (source === this.removeRedundancyMenuItem) {
11547 this.removeRedundancyMenuItem_actionPerformed ();
11548 } else if (source === this.pairwiseAlignmentMenuItem) {
11549 this.pairwiseAlignmentMenuItem_actionPerformed ();
11550 } else if (source === this.PCAMenuItem) {
11551 this.PCAMenuItem_actionPerformed ();
11552 } else if (source === this.averageDistanceTreeMenuItem) {
11553 this.averageDistanceTreeMenuItem_actionPerformed ();
11554 } else if (source === this.neighbourTreeMenuItem) {
11555 this.neighbourTreeMenuItem_actionPerformed ();
11556 } else if (source === this.njTreeBlosumMenuItem) {
11557 this.njTreeBlosumMenuItem_actionPerformed ();
11558 } else if (source === this.avDistanceTreeBlosumMenuItem) {
11559 this.avTreeBlosumMenuItem_actionPerformed ();
11560 } else if (source === this.documentation) {
11561 this.documentation_actionPerformed ();
11562 } else if (source === this.about) {
11563 this.about_actionPerformed ();
11564 }}, "java.awt.event.ActionEvent");
11565 Clazz_defineMethod (c$, "inputText_actionPerformed", 
11566 function () {
11567 var cap =  new jalview.appletgui.CutAndPasteTransfer (true, this);
11568 var frame =  new awt2swing.Frame ();
11569 frame.add (cap);
11570 jalview.bin.JalviewLite.addFrame (frame, jalview.util.MessageManager.getString ("label.input_cut_paste"), 500, 500);
11571 });
11572 Clazz_defineMethod (c$, "outputText_actionPerformed", 
11573 function (e) {
11574 var cap =  new jalview.appletgui.CutAndPasteTransfer (true, this);
11575 var frame =  new awt2swing.Frame ();
11576 frame.add (cap);
11577 jalview.bin.JalviewLite.addFrame (frame, jalview.util.MessageManager.formatMessage ("label.alignment_output_command",  Clazz_newArray (-1, [e.getActionCommand ()])), 600, 500);
11578 var fr = this.alignPanel.cloneFeatureRenderer ();
11579 cap.setText ( new jalview.io.AppletFormatAdapter (this.alignPanel).formatSequences (e.getActionCommand (), this.viewport.getAlignment (), this.viewport.getShowJVSuffix ()));
11580 }, "java.awt.event.ActionEvent");
11581 Clazz_defineMethod (c$, "loadAnnotations", 
11582 function () {
11583 var cap =  new jalview.appletgui.CutAndPasteTransfer (true, this);
11584 cap.setText (jalview.util.MessageManager.getString ("label.paste_features_annotations_Tcoffee_here"));
11585 cap.setAnnotationImport ();
11586 var frame =  new awt2swing.Frame ();
11587 frame.add (cap);
11588 jalview.bin.JalviewLite.addFrame (frame, jalview.util.MessageManager.getString ("action.paste_annotations"), 400, 300);
11589 });
11590 Clazz_defineMethod (c$, "outputAnnotations", 
11591 function (displayTextbox) {
11592 var annotation =  new jalview.io.AnnotationFile ().printAnnotationsForView (this.viewport);
11593 if (displayTextbox) {
11594 var cap =  new jalview.appletgui.CutAndPasteTransfer (false, this);
11595 var frame =  new awt2swing.Frame ();
11596 frame.add (cap);
11597 jalview.bin.JalviewLite.addFrame (frame, jalview.util.MessageManager.getString ("label.annotations"), 600, 500);
11598 cap.setText (annotation);
11599 }return annotation;
11600 }, "~B");
11601 Clazz_defineMethod (c$, "getDisplayedFeatureCols", 
11602  function () {
11603 if (this.alignPanel.getFeatureRenderer () != null && this.viewport.getFeaturesDisplayed () != null) {
11604 return this.alignPanel.getFeatureRenderer ().getDisplayedFeatureCols ();
11605 }return null;
11606 });
11607 Clazz_defineMethod (c$, "outputFeatures", 
11608 function (displayTextbox, format) {
11609 var features;
11610 if (format.equalsIgnoreCase ("Jalview")) {
11611 features =  new jalview.io.FeaturesFile ().printJalviewFormat (this.viewport.getAlignment ().getSequencesArray (), this.getDisplayedFeatureCols ());
11612 } else {
11613 features =  new jalview.io.FeaturesFile ().printGFFFormat (this.viewport.getAlignment ().getSequencesArray (), this.getDisplayedFeatureCols ());
11614 }if (displayTextbox) {
11615 var frimport = false;
11616 if (features == null || features.equals ("No Features Visible")) {
11617 features = "# No features visible - paste some and import them here.";
11618 frimport = true;
11619 }var cap =  new jalview.appletgui.CutAndPasteTransfer (frimport, this);
11620 if (frimport) {
11621 cap.setAnnotationImport ();
11622 }var frame =  new awt2swing.Frame ();
11623 frame.add (cap);
11624 jalview.bin.JalviewLite.addFrame (frame, jalview.util.MessageManager.getString ("label.features"), 600, 500);
11625 cap.setText (features);
11626 } else {
11627 if (features == null) {
11628 features = "";
11629 }}return features;
11630 }, "~B,~S");
11631 Clazz_defineMethod (c$, "launchFullApplication", 
11632 function () {
11633 var url =  new StringBuffer (this.jalviewServletURL);
11634 var firstSep = url.lastIndexOf ("?") > url.lastIndexOf ("/") ? "&" : "?";
11635 url.append (firstSep);
11636 var applet = this.viewport.applet;
11637 var s = applet.startupFile;
11638 url.append ("open=" + this.appendProtocol (s));
11639 if (this.viewport.applet.features != null) {
11640 url.append ("&features=");
11641 url.append (this.appendProtocol (applet.features));
11642 }if (applet.annotations != null) {
11643 url.append ("&annotations=");
11644 url.append (this.appendProtocol (applet.annotations));
11645 }if (applet.jnetFile != null) {
11646 url.append ("&annotations=");
11647 url.append (this.appendProtocol (applet.jnetFile));
11648 }if (applet.defaultColour != null) {
11649 url.append ("&colour=" + this.removeWhiteSpace (applet.defaultColour));
11650 }if (applet.userDefinedColour != null) {
11651 url.append ("&colour=" + this.removeWhiteSpace (applet.userDefinedColour));
11652 }if (applet.treeFile != null) {
11653 url.append ("&tree=" + this.appendProtocol (applet.treeFile));
11654 }this.showURL (url.toString (), "FULL_APP");
11655 });
11656 Clazz_defineMethod (c$, "removeWhiteSpace", 
11657 function (colour) {
11658 var sb =  new StringBuffer ();
11659 for (var i = 0; i < colour.length; i++) {
11660 if (Character.isWhitespace (colour.charAt (i))) {
11661 sb.append ("%20");
11662 } else {
11663 sb.append (colour.charAt (i));
11664 }}
11665 return sb.toString ();
11666 }, "~S");
11667 Clazz_defineMethod (c$, "appendProtocol", 
11668 function (url) {
11669 try {
11670  new java.net.URL (url);
11671 url = java.net.URLEncoder.encode (url);
11672 } catch (ex) {
11673 if (Clazz_exceptionOf (ex, java.net.MalformedURLException)) {
11674 url = this.viewport.applet.getCodeBase () + url;
11675 } else {
11676 throw ex;
11677 }
11678 }
11679 return url;
11680 }, "~S");
11681 Clazz_defineMethod (c$, "closeMenuItem_actionPerformed", 
11682 function () {
11683 jalview.appletgui.PaintRefresher.RemoveComponent (this.alignPanel);
11684 if (this.alignPanel.seqPanel != null && this.alignPanel.seqPanel.seqCanvas != null) {
11685 jalview.appletgui.PaintRefresher.RemoveComponent (this.alignPanel.seqPanel.seqCanvas);
11686 }if (this.alignPanel.idPanel != null && this.alignPanel.idPanel.idCanvas != null) {
11687 jalview.appletgui.PaintRefresher.RemoveComponent (this.alignPanel.idPanel.idCanvas);
11688 }if (jalview.appletgui.PaintRefresher.components.size () == 0 && this.viewport.applet == null) {
11689 System.exit (0);
11690 } else {
11691 }this.viewport = null;
11692 this.alignPanel = null;
11693 this.dispose ();
11694 });
11695 Clazz_defineMethod (c$, "updateEditMenuBar", 
11696 function () {
11697 if (this.viewport.getHistoryList ().size () > 0) {
11698 this.undoMenuItem.setEnabled (true);
11699 var command = this.viewport.getHistoryList ().peek ();
11700 this.undoMenuItem.setLabel (jalview.util.MessageManager.formatMessage ("label.undo_command",  Clazz_newArray (-1, [command.getDescription ()])));
11701 } else {
11702 this.undoMenuItem.setEnabled (false);
11703 this.undoMenuItem.setLabel (jalview.util.MessageManager.getString ("action.undo"));
11704 }if (this.viewport.getRedoList ().size () > 0) {
11705 this.redoMenuItem.setEnabled (true);
11706 var command = this.viewport.getRedoList ().peek ();
11707 this.redoMenuItem.setLabel (jalview.util.MessageManager.formatMessage ("label.redo_command",  Clazz_newArray (-1, [command.getDescription ()])));
11708 } else {
11709 this.redoMenuItem.setEnabled (false);
11710 this.redoMenuItem.setLabel (jalview.util.MessageManager.getString ("action.redo"));
11711 }});
11712 Clazz_overrideMethod (c$, "addHistoryItem", 
11713 function (command) {
11714 if (command.getSize () > 0) {
11715 this.viewport.addToHistoryList (command);
11716 this.viewport.clearRedoList ();
11717 this.updateEditMenuBar ();
11718 this.viewport.updateHiddenColumns ();
11719 }}, "jalview.commands.CommandI");
11720 Clazz_defineMethod (c$, "undoMenuItem_actionPerformed", 
11721 function () {
11722 if (this.viewport.getHistoryList ().isEmpty ()) {
11723 return;
11724 }var command = this.viewport.getHistoryList ().pop ();
11725 this.viewport.addToRedoList (command);
11726 command.undoCommand (null);
11727 var originalSource = this.getOriginatingSource (command);
11728 if (originalSource !== this.viewport) {
11729 System.err.println ("Warning: Viewport object mismatch whilst undoing");
11730 }originalSource.updateHiddenColumns ();
11731 this.updateEditMenuBar ();
11732 originalSource.firePropertyChange ("alignment", null, originalSource.getAlignment ().getSequences ());
11733 });
11734 Clazz_defineMethod (c$, "redoMenuItem_actionPerformed", 
11735 function () {
11736 if (this.viewport.getRedoList ().isEmpty ()) {
11737 return;
11738 }var command = this.viewport.getRedoList ().pop ();
11739 this.viewport.addToHistoryList (command);
11740 command.doCommand (null);
11741 var originalSource = this.getOriginatingSource (command);
11742 if (originalSource !== this.viewport) {
11743 System.err.println ("Warning: Viewport object mismatch whilst re-doing");
11744 }originalSource.updateHiddenColumns ();
11745 this.updateEditMenuBar ();
11746 originalSource.firePropertyChange ("alignment", null, originalSource.getAlignment ().getSequences ());
11747 });
11748 Clazz_defineMethod (c$, "getOriginatingSource", 
11749 function (command) {
11750 var originalSource = null;
11751 var al = null;
11752 if (Clazz_instanceOf (command, jalview.commands.EditCommand)) {
11753 var editCommand = command;
11754 al = editCommand.getAlignment ();
11755 var comps = jalview.appletgui.PaintRefresher.components.get (this.viewport.getSequenceSetId ());
11756 for (var i = 0; i < comps.size (); i++) {
11757 if (Clazz_instanceOf (comps.elementAt (i), jalview.appletgui.AlignmentPanel)) {
11758 if (al === (comps.elementAt (i)).av.getAlignment ()) {
11759 originalSource = (comps.elementAt (i)).av;
11760 break;
11761 }}}
11762 }if (originalSource == null) {
11763 if (al != null) {
11764 jalview.appletgui.PaintRefresher.validateSequences (al, this.viewport.getAlignment ());
11765 }originalSource = this.viewport;
11766 }return originalSource;
11767 }, "jalview.commands.CommandI");
11768 Clazz_defineMethod (c$, "moveSelectedSequences", 
11769 function (up) {
11770 var sg = this.viewport.getSelectionGroup ();
11771 if (sg == null) {
11772 return;
11773 }this.viewport.getAlignment ().moveSelectedSequencesByOne (sg, up ? null : this.viewport.getHiddenRepSequences (), up);
11774 this.alignPanel.paintAlignment (true);
11775 var complement = this.viewport.getCodingComplement ();
11776 if (complement != null) {
11777 var mappedSelection = jalview.util.MappingUtils.mapSequenceGroup (sg, this.viewport, complement);
11778 complement.getAlignment ().moveSelectedSequencesByOne (mappedSelection, up ? null : complement.getHiddenRepSequences (), up);
11779 }}, "~B");
11780 Clazz_defineMethod (c$, "slideSequences", 
11781 function (right, size) {
11782 var sg =  new java.util.Vector ();
11783 if (this.viewport.cursorMode) {
11784 sg.add (this.viewport.getAlignment ().getSequenceAt (this.alignPanel.seqPanel.seqCanvas.cursorY));
11785 } else if (this.viewport.getSelectionGroup () != null && this.viewport.getSelectionGroup ().getSize () != this.viewport.getAlignment ().getHeight ()) {
11786 sg = this.viewport.getSelectionGroup ().getSequences (this.viewport.getHiddenRepSequences ());
11787 }if (sg.size () < 1) {
11788 return;
11789 }var invertGroup =  new java.util.Vector ();
11790 for (var i = 0; i < this.viewport.getAlignment ().getHeight (); i++) {
11791 if (!sg.contains (this.viewport.getAlignment ().getSequenceAt (i))) {
11792 invertGroup.addElement (this.viewport.getAlignment ().getSequenceAt (i));
11793 }}
11794 var seqs1 = sg.toArray ( new Array (sg.size ()));
11795 var seqs2 = invertGroup.toArray ( new Array (invertGroup.size ()));
11796 for (var i = 0; i < invertGroup.size (); i++) {
11797 seqs2[i] = invertGroup.elementAt (i);
11798 }
11799 var ssc;
11800 if (right) {
11801 ssc =  new jalview.commands.SlideSequencesCommand ("Slide Sequences", seqs2, seqs1, size, this.viewport.getGapCharacter ());
11802 } else {
11803 ssc =  new jalview.commands.SlideSequencesCommand ("Slide Sequences", seqs1, seqs2, size, this.viewport.getGapCharacter ());
11804 }var groupAdjustment = 0;
11805 if (ssc.getGapsInsertedBegin () && right) {
11806 if (this.viewport.cursorMode) {
11807 this.alignPanel.seqPanel.moveCursor (size, 0);
11808 } else {
11809 groupAdjustment = size;
11810 }} else if (!ssc.getGapsInsertedBegin () && !right) {
11811 if (this.viewport.cursorMode) {
11812 this.alignPanel.seqPanel.moveCursor (-size, 0);
11813 } else {
11814 groupAdjustment = -size;
11815 }}if (groupAdjustment != 0) {
11816 this.viewport.getSelectionGroup ().setStartRes (this.viewport.getSelectionGroup ().getStartRes () + groupAdjustment);
11817 this.viewport.getSelectionGroup ().setEndRes (this.viewport.getSelectionGroup ().getEndRes () + groupAdjustment);
11818 }var appendHistoryItem = false;
11819 var historyList = this.viewport.getHistoryList ();
11820 if (historyList != null && historyList.size () > 0 && Clazz_instanceOf (historyList.peek (), jalview.commands.SlideSequencesCommand)) {
11821 appendHistoryItem = ssc.appendSlideCommand (historyList.peek ());
11822 }if (!appendHistoryItem) {
11823 this.addHistoryItem (ssc);
11824 }this.repaint ();
11825 }, "~B,~N");
11826 Clazz_defineMethod (c$, "copy_actionPerformed", 
11827 function () {
11828 if (this.viewport.getSelectionGroup () == null) {
11829 return;
11830 }var sg = this.viewport.getSelectionGroup ();
11831 jalview.appletgui.AlignFrame.copiedSequences =  new StringBuffer ();
11832 var orderedSeqs =  new java.util.HashMap ();
11833 for (var i = 0; i < sg.getSize (); i++) {
11834 var seq = sg.getSequenceAt (i);
11835 var index = this.viewport.getAlignment ().findIndex (seq);
11836 orderedSeqs.put (new Integer (index), seq);
11837 }
11838 var index = 0;
11839 var startRes;
11840 var endRes;
11841 var ch;
11842 if (this.viewport.hasHiddenColumns () && this.viewport.getSelectionGroup () != null) {
11843 jalview.appletgui.AlignFrame.copiedHiddenColumns =  new java.util.Vector ();
11844 var hiddenOffset = this.viewport.getSelectionGroup ().getStartRes ();
11845 for (var region, $region = this.viewport.getColumnSelection ().getHiddenColumns ().iterator (); $region.hasNext () && ((region = $region.next ()) || true);) {
11846 jalview.appletgui.AlignFrame.copiedHiddenColumns.addElement ( Clazz_newIntArray (-1, [region[0] - hiddenOffset, region[1] - hiddenOffset]));
11847 }
11848 } else {
11849 jalview.appletgui.AlignFrame.copiedHiddenColumns = null;
11850 }for (var i = 0; i < sg.getSize (); i++) {
11851 var seq = null;
11852 while (seq == null) {
11853 if (orderedSeqs.containsKey (new Integer (index))) {
11854 seq = orderedSeqs.get (new Integer (index));
11855 index++;
11856 break;
11857 } else {
11858 index++;
11859 }}
11860 startRes = seq.findPosition (sg.getStartRes ());
11861 endRes = 0;
11862 for (var j = 0; j < sg.getEndRes () + 1 && j < seq.getLength (); j++) {
11863 ch = seq.getCharAt (j);
11864 if (!jalview.util.Comparison.isGap ((ch))) {
11865 endRes++;
11866 }}
11867 if (endRes > 0) {
11868 endRes += seq.getStart () - 1;
11869 }jalview.appletgui.AlignFrame.copiedSequences.append (seq.getName () + "\t" + startRes + "\t" + endRes + "\t" + seq.getSequenceAsString (sg.getStartRes (), sg.getEndRes () + 1) + "\n");
11870 }
11871 });
11872 Clazz_defineMethod (c$, "pasteNew_actionPerformed", 
11873 function () {
11874 this.paste (true);
11875 });
11876 Clazz_defineMethod (c$, "pasteThis_actionPerformed", 
11877 function () {
11878 this.paste (false);
11879 });
11880 Clazz_defineMethod (c$, "paste", 
11881 function (newAlignment) {
11882 try {
11883 if (jalview.appletgui.AlignFrame.copiedSequences == null) {
11884 return;
11885 }var st =  new java.util.StringTokenizer (jalview.appletgui.AlignFrame.copiedSequences.toString ());
11886 var seqs =  new java.util.Vector ();
11887 while (st.hasMoreElements ()) {
11888 var name = st.nextToken ();
11889 var start = Integer.parseInt (st.nextToken ());
11890 var end = Integer.parseInt (st.nextToken ());
11891 seqs.addElement ( new jalview.datamodel.Sequence (name, st.nextToken (), start, end));
11892 }
11893 var newSeqs =  new Array (seqs.size ());
11894 for (var i = 0; i < seqs.size (); i++) {
11895 newSeqs[i] = seqs.elementAt (i);
11896 }
11897 if (newAlignment) {
11898 var newtitle = jalview.util.MessageManager.getString ("label.copied_sequences");
11899 if (this.getTitle ().startsWith (jalview.util.MessageManager.getString ("label.copied_sequences"))) {
11900 newtitle = this.getTitle ();
11901 } else {
11902 newtitle = newtitle.concat (jalview.util.MessageManager.formatMessage ("label.from_msname",  Clazz_newArray (-1, [this.getTitle ()])));
11903 }var af =  new jalview.appletgui.AlignFrame ( new jalview.datamodel.Alignment (newSeqs), this.viewport.applet, newtitle, false);
11904 if (jalview.appletgui.AlignFrame.copiedHiddenColumns != null) {
11905 for (var i = 0; i < jalview.appletgui.AlignFrame.copiedHiddenColumns.size (); i++) {
11906 var region = jalview.appletgui.AlignFrame.copiedHiddenColumns.elementAt (i);
11907 af.viewport.hideColumns (region[0], region[1]);
11908 }
11909 }jalview.bin.JalviewLite.addFrame (af, newtitle, this.frameWidth, this.frameHeight);
11910 } else {
11911 this.addSequences (newSeqs);
11912 }} catch (ex) {
11913 if (Clazz_exceptionOf (ex, Exception)) {
11914 } else {
11915 throw ex;
11916 }
11917 }
11918 }, "~B");
11919 Clazz_defineMethod (c$, "addSequences", 
11920 function (seqs) {
11921 for (var i = 0; i < seqs.length; i++) {
11922 this.viewport.getAlignment ().addSequence (seqs[i]);
11923 }
11924 this.addHistoryItem ( new jalview.commands.EditCommand (jalview.util.MessageManager.getString ("label.add_sequences"), jalview.commands.EditCommand.Action.PASTE, seqs, 0, this.viewport.getAlignment ().getWidth (), this.viewport.getAlignment ()));
11925 this.viewport.setEndSeq (this.viewport.getAlignment ().getHeight ());
11926 this.viewport.getAlignment ().getWidth ();
11927 this.viewport.firePropertyChange ("alignment", null, this.viewport.getAlignment ().getSequences ());
11928 }, "~A");
11929 Clazz_defineMethod (c$, "cut_actionPerformed", 
11930 function () {
11931 this.copy_actionPerformed ();
11932 this.delete_actionPerformed ();
11933 });
11934 Clazz_defineMethod (c$, "delete_actionPerformed", 
11935 function () {
11936 var sg = this.viewport.getSelectionGroup ();
11937 if (sg == null) {
11938 return;
11939 }var seqs =  new java.util.Vector ();
11940 var seq;
11941 for (var i = 0; i < sg.getSize (); i++) {
11942 seq = sg.getSequenceAt (i);
11943 seqs.addElement (seq);
11944 }
11945 if (sg.getSize () == this.viewport.getAlignment ().getHeight ()) {
11946 this.viewport.getColumnSelection ().removeElements (sg.getStartRes (), sg.getEndRes () + 1);
11947 }var cut =  new Array (seqs.size ());
11948 for (var i = 0; i < seqs.size (); i++) {
11949 cut[i] = seqs.elementAt (i);
11950 }
11951 this.addHistoryItem ( new jalview.commands.EditCommand (jalview.util.MessageManager.getString ("label.cut_sequences"), jalview.commands.EditCommand.Action.CUT, cut, sg.getStartRes (), sg.getEndRes () - sg.getStartRes () + 1, this.viewport.getAlignment ()));
11952 this.viewport.setSelectionGroup (null);
11953 this.viewport.getAlignment ().deleteGroup (sg);
11954 this.viewport.firePropertyChange ("alignment", null, this.viewport.getAlignment ().getSequences ());
11955 if (this.viewport.getAlignment ().getHeight () < 1) {
11956 this.setVisible (false);
11957 }this.viewport.sendSelection ();
11958 });
11959 Clazz_defineMethod (c$, "showGroupConsensus_actionPerformed", 
11960 function () {
11961 this.viewport.setShowGroupConsensus (this.showGroupConsensus.getState ());
11962 this.alignPanel.updateAnnotation (this.applyAutoAnnotationSettings.getState ());
11963 });
11964 Clazz_defineMethod (c$, "showGroupConservation_actionPerformed", 
11965 function () {
11966 this.viewport.setShowGroupConservation (this.showGroupConservation.getState ());
11967 this.alignPanel.updateAnnotation (this.applyAutoAnnotationSettings.getState ());
11968 });
11969 Clazz_defineMethod (c$, "showConsensusHistogram_actionPerformed", 
11970 function () {
11971 this.viewport.setShowConsensusHistogram (this.showConsensusHistogram.getState ());
11972 this.alignPanel.updateAnnotation (this.applyAutoAnnotationSettings.getState ());
11973 });
11974 Clazz_defineMethod (c$, "showSequenceLogo_actionPerformed", 
11975 function () {
11976 this.viewport.setShowSequenceLogo (this.showSequenceLogo.getState ());
11977 this.alignPanel.updateAnnotation (this.applyAutoAnnotationSettings.getState ());
11978 });
11979 Clazz_defineMethod (c$, "normSequenceLogo_actionPerformed", 
11980 function () {
11981 this.showSequenceLogo.setState (true);
11982 this.viewport.setShowSequenceLogo (true);
11983 this.viewport.setNormaliseSequenceLogo (this.normSequenceLogo.getState ());
11984 this.alignPanel.updateAnnotation (this.applyAutoAnnotationSettings.getState ());
11985 });
11986 Clazz_defineMethod (c$, "applyAutoAnnotationSettings_actionPerformed", 
11987 function () {
11988 this.alignPanel.updateAnnotation (this.applyAutoAnnotationSettings.getState ());
11989 });
11990 Clazz_defineMethod (c$, "makeGrpsFromSelection_actionPerformed", 
11991 function () {
11992 if (this.avc.makeGroupsFromSelection ()) {
11993 jalview.appletgui.PaintRefresher.Refresh (this, this.viewport.getSequenceSetId ());
11994 this.alignPanel.updateAnnotation ();
11995 this.alignPanel.paintAlignment (true);
11996 }});
11997 Clazz_defineMethod (c$, "createGroup_actionPerformed", 
11998 function () {
11999 this.avc.createGroup ();
12000 });
12001 Clazz_defineMethod (c$, "unGroup_actionPerformed", 
12002 function () {
12003 if (this.avc.unGroup ()) {
12004 this.alignPanel.alignmentChanged ();
12005 }});
12006 Clazz_defineMethod (c$, "deleteGroups_actionPerformed", 
12007 function () {
12008 if (this.avc.deleteGroups ()) {
12009 this.alignPanel.alignmentChanged ();
12010 }});
12011 Clazz_defineMethod (c$, "selectAllSequenceMenuItem_actionPerformed", 
12012 function () {
12013 var sg =  new jalview.datamodel.SequenceGroup ();
12014 for (var i = 0; i < this.viewport.getAlignment ().getSequences ().size (); i++) {
12015 sg.addSequence (this.viewport.getAlignment ().getSequenceAt (i), false);
12016 }
12017 sg.setEndRes (this.viewport.getAlignment ().getWidth () - 1);
12018 this.viewport.setSelectionGroup (sg);
12019 this.alignPanel.paintAlignment (true);
12020 jalview.appletgui.PaintRefresher.Refresh (this.alignPanel, this.viewport.getSequenceSetId ());
12021 this.viewport.sendSelection ();
12022 });
12023 Clazz_defineMethod (c$, "deselectAllSequenceMenuItem_actionPerformed", 
12024 function () {
12025 if (this.viewport.cursorMode) {
12026 this.alignPanel.seqPanel.keyboardNo1 = null;
12027 this.alignPanel.seqPanel.keyboardNo2 = null;
12028 }this.viewport.setSelectionGroup (null);
12029 this.viewport.getColumnSelection ().clear ();
12030 this.viewport.setSelectionGroup (null);
12031 this.alignPanel.idPanel.idCanvas.searchResults = null;
12032 this.alignPanel.seqPanel.seqCanvas.highlightSearchResults (null);
12033 this.alignPanel.paintAlignment (true);
12034 jalview.appletgui.PaintRefresher.Refresh (this.alignPanel, this.viewport.getSequenceSetId ());
12035 this.viewport.sendSelection ();
12036 });
12037 Clazz_defineMethod (c$, "invertSequenceMenuItem_actionPerformed", 
12038 function () {
12039 var sg = this.viewport.getSelectionGroup ();
12040 for (var i = 0; i < this.viewport.getAlignment ().getSequences ().size (); i++) {
12041 sg.addOrRemove (this.viewport.getAlignment ().getSequenceAt (i), false);
12042 }
12043 jalview.appletgui.PaintRefresher.Refresh (this.alignPanel, this.viewport.getSequenceSetId ());
12044 this.viewport.sendSelection ();
12045 });
12046 Clazz_defineMethod (c$, "invertColSel_actionPerformed", 
12047 function () {
12048 this.viewport.invertColumnSelection ();
12049 this.alignPanel.paintAlignment (true);
12050 jalview.appletgui.PaintRefresher.Refresh (this.alignPanel, this.viewport.getSequenceSetId ());
12051 this.viewport.sendSelection ();
12052 });
12053 Clazz_defineMethod (c$, "trimAlignment", 
12054 function (trimLeft) {
12055 var colSel = this.viewport.getColumnSelection ();
12056 var column;
12057 if (colSel.size () > 0) {
12058 if (trimLeft) {
12059 column = colSel.getMin ();
12060 } else {
12061 column = colSel.getMax ();
12062 }var seqs;
12063 if (this.viewport.getSelectionGroup () != null) {
12064 seqs = this.viewport.getSelectionGroup ().getSequencesAsArray (this.viewport.getHiddenRepSequences ());
12065 } else {
12066 seqs = this.viewport.getAlignment ().getSequencesArray ();
12067 }var trimRegion;
12068 if (trimLeft) {
12069 trimRegion =  new jalview.commands.TrimRegionCommand ("Remove Left", jalview.commands.TrimRegionCommand.TRIM_LEFT, seqs, column, this.viewport.getAlignment (), this.viewport.getColumnSelection (), this.viewport.getSelectionGroup ());
12070 this.viewport.setStartRes (0);
12071 } else {
12072 trimRegion =  new jalview.commands.TrimRegionCommand ("Remove Right", jalview.commands.TrimRegionCommand.TRIM_RIGHT, seqs, column, this.viewport.getAlignment (), this.viewport.getColumnSelection (), this.viewport.getSelectionGroup ());
12073 }this.setStatus (jalview.util.MessageManager.formatMessage ("label.removed_columns",  Clazz_newArray (-1, [Integer.$valueOf (trimRegion.getSize ()).toString ()])));
12074 this.addHistoryItem (trimRegion);
12075 for (var sg, $sg = this.viewport.getAlignment ().getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
12076 if ((trimLeft && !sg.adjustForRemoveLeft (column)) || (!trimLeft && !sg.adjustForRemoveRight (column))) {
12077 this.viewport.getAlignment ().deleteGroup (sg);
12078 }}
12079 this.viewport.firePropertyChange ("alignment", null, this.viewport.getAlignment ().getSequences ());
12080 }}, "~B");
12081 Clazz_defineMethod (c$, "removeGappedColumnMenuItem_actionPerformed", 
12082 function () {
12083 var start = 0;
12084 var end = this.viewport.getAlignment ().getWidth () - 1;
12085 var seqs;
12086 if (this.viewport.getSelectionGroup () != null) {
12087 seqs = this.viewport.getSelectionGroup ().getSequencesAsArray (this.viewport.getHiddenRepSequences ());
12088 start = this.viewport.getSelectionGroup ().getStartRes ();
12089 end = this.viewport.getSelectionGroup ().getEndRes ();
12090 } else {
12091 seqs = this.viewport.getAlignment ().getSequencesArray ();
12092 }var removeGapCols =  new jalview.commands.RemoveGapColCommand ("Remove Gapped Columns", seqs, start, end, this.viewport.getAlignment ());
12093 this.addHistoryItem (removeGapCols);
12094 this.setStatus (jalview.util.MessageManager.formatMessage ("label.removed_empty_columns",  Clazz_newArray (-1, [Integer.$valueOf (removeGapCols.getSize ()).toString ()])));
12095 var seq = this.viewport.getAlignment ().getSequenceAt (0);
12096 var startRes = seq.findPosition (this.viewport.startRes);
12097 this.viewport.setStartRes (seq.findIndex (startRes) - 1);
12098 this.viewport.firePropertyChange ("alignment", null, this.viewport.getAlignment ().getSequences ());
12099 });
12100 Clazz_defineMethod (c$, "removeAllGapsMenuItem_actionPerformed", 
12101 function () {
12102 var start = 0;
12103 var end = this.viewport.getAlignment ().getWidth () - 1;
12104 var seqs;
12105 if (this.viewport.getSelectionGroup () != null) {
12106 seqs = this.viewport.getSelectionGroup ().getSequencesAsArray (this.viewport.getHiddenRepSequences ());
12107 start = this.viewport.getSelectionGroup ().getStartRes ();
12108 end = this.viewport.getSelectionGroup ().getEndRes ();
12109 } else {
12110 seqs = this.viewport.getAlignment ().getSequencesArray ();
12111 }var seq = this.viewport.getAlignment ().getSequenceAt (0);
12112 var startRes = seq.findPosition (this.viewport.startRes);
12113 this.addHistoryItem ( new jalview.commands.RemoveGapsCommand ("Remove Gaps", seqs, start, end, this.viewport.getAlignment ()));
12114 this.viewport.setStartRes (seq.findIndex (startRes) - 1);
12115 this.viewport.firePropertyChange ("alignment", null, this.viewport.getAlignment ().getSequences ());
12116 });
12117 Clazz_defineMethod (c$, "findMenuItem_actionPerformed", 
12118 function () {
12119  new jalview.appletgui.Finder (this.alignPanel);
12120 });
12121 Clazz_defineMethod (c$, "newView", 
12122 function (viewtitle) {
12123 var newal;
12124 if (this.viewport.hasHiddenRows ()) {
12125 newal =  new jalview.datamodel.Alignment (this.viewport.getAlignment ().getHiddenSequences ().getFullAlignment ().getSequencesArray ());
12126 } else {
12127 newal =  new jalview.datamodel.Alignment (this.viewport.getAlignment ().getSequencesArray ());
12128 }if (this.viewport.getAlignment ().getAlignmentAnnotation () != null) {
12129 for (var i = 0; i < this.viewport.getAlignment ().getAlignmentAnnotation ().length; i++) {
12130 if (!this.viewport.getAlignment ().getAlignmentAnnotation ()[i].autoCalculated) {
12131 newal.addAnnotation (this.viewport.getAlignment ().getAlignmentAnnotation ()[i]);
12132 }}
12133 }var newaf =  new jalview.appletgui.AlignFrame (newal, this.viewport.applet, "", false);
12134 newaf.viewport.setSequenceSetId (this.alignPanel.av.getSequenceSetId ());
12135 jalview.appletgui.PaintRefresher.Register (this.alignPanel, this.alignPanel.av.getSequenceSetId ());
12136 jalview.appletgui.PaintRefresher.Register (newaf.alignPanel, newaf.alignPanel.av.getSequenceSetId ());
12137 jalview.appletgui.PaintRefresher.Register (newaf.alignPanel.idPanel.idCanvas, newaf.alignPanel.av.getSequenceSetId ());
12138 jalview.appletgui.PaintRefresher.Register (newaf.alignPanel.seqPanel.seqCanvas, newaf.alignPanel.av.getSequenceSetId ());
12139 var comps = jalview.appletgui.PaintRefresher.components.get (this.viewport.getSequenceSetId ());
12140 var viewSize = -1;
12141 for (var i = 0; i < comps.size (); i++) {
12142 if (Clazz_instanceOf (comps.elementAt (i), jalview.appletgui.AlignmentPanel)) {
12143 viewSize++;
12144 }}
12145 var title =  String.instantialize (this.getTitle ());
12146 if (viewtitle != null) {
12147 title = viewtitle + " ( " + title + ")";
12148 } else {
12149 if (title.indexOf ("(View") > -1) {
12150 title = title.substring (0, title.indexOf ("(View"));
12151 }title += "(View " + viewSize + ")";
12152 }newaf.setTitle (title.toString ());
12153 newaf.viewport.setHistoryList (this.viewport.getHistoryList ());
12154 newaf.viewport.setRedoList (this.viewport.getRedoList ());
12155 return newaf;
12156 }, "~S");
12157 Clazz_defineMethod (c$, "getFeatureGroups", 
12158 function () {
12159 var fr = null;
12160 if (this.alignPanel != null && (fr = this.alignPanel.getFeatureRenderer ()) != null) {
12161 var gps = fr.getFeatureGroups ();
12162 var _gps = gps.toArray ( new Array (gps.size ()));
12163 return _gps;
12164 }return null;
12165 });
12166 Clazz_defineMethod (c$, "getFeatureGroupsOfState", 
12167 function (visible) {
12168 var fr = null;
12169 if (this.alignPanel != null && (fr = this.alignPanel.getFeatureRenderer ()) != null) {
12170 var gps = fr.getGroups (visible);
12171 var _gps = gps.toArray ( new Array (gps.size ()));
12172 return _gps;
12173 }return null;
12174 }, "~B");
12175 Clazz_defineMethod (c$, "setFeatureGroupState", 
12176 function (groups, state) {
12177 var fr = null;
12178 this.sequenceFeatures.setState (true);
12179 this.viewport.setShowSequenceFeatures (true);
12180 if (this.alignPanel != null && (fr = this.alignPanel.getFeatureRenderer ()) != null) {
12181 fr.setGroupVisibility (java.util.Arrays.asList (groups), state);
12182 this.alignPanel.seqPanel.seqCanvas.repaint ();
12183 if (this.alignPanel.overviewPanel != null) {
12184 this.alignPanel.overviewPanel.updateOverviewImage ();
12185 }}}, "~A,~B");
12186 Clazz_defineMethod (c$, "seqLimits_itemStateChanged", 
12187 function () {
12188 this.viewport.setShowJVSuffix (this.seqLimits.getState ());
12189 this.alignPanel.fontChanged ();
12190 this.alignPanel.paintAlignment (true);
12191 });
12192 Clazz_defineMethod (c$, "colourTextMenuItem_actionPerformed", 
12193 function () {
12194 this.viewport.setColourText (this.colourTextMenuItem.getState ());
12195 this.alignPanel.paintAlignment (true);
12196 });
12197 Clazz_defineMethod (c$, "displayNonconservedMenuItem_actionPerformed", 
12198 function () {
12199 this.viewport.setShowUnconserved (this.displayNonconservedMenuItem.getState ());
12200 this.alignPanel.paintAlignment (true);
12201 });
12202 Clazz_defineMethod (c$, "wrapMenuItem_actionPerformed", 
12203 function () {
12204 this.viewport.setWrapAlignment (this.wrapMenuItem.getState ());
12205 this.alignPanel.setWrapAlignment (this.wrapMenuItem.getState ());
12206 this.scaleAbove.setEnabled (this.wrapMenuItem.getState ());
12207 this.scaleLeft.setEnabled (this.wrapMenuItem.getState ());
12208 this.scaleRight.setEnabled (this.wrapMenuItem.getState ());
12209 this.alignPanel.paintAlignment (true);
12210 });
12211 Clazz_defineMethod (c$, "overviewMenuItem_actionPerformed", 
12212 function () {
12213 if (this.alignPanel.overviewPanel != null) {
12214 return;
12215 }var frame =  new awt2swing.Frame ();
12216 var overview =  new jalview.appletgui.OverviewPanel (this.alignPanel);
12217 frame.add (overview);
12218 jalview.bin.JalviewLite.addFrame (frame, jalview.util.MessageManager.formatMessage ("label.overview_params",  Clazz_newArray (-1, [this.getTitle ()])), overview.getPreferredSize ().width, overview.getPreferredSize ().height + 50);
12219 frame.pack ();
12220 var ap = this.alignPanel;
12221 frame.addWindowListener (((Clazz_isClassDefined ("jalview.appletgui.AlignFrame$1") ? 0 : jalview.appletgui.AlignFrame.$AlignFrame$1$ ()), Clazz_innerTypeInstance (jalview.appletgui.AlignFrame$1, this, Clazz_cloneFinals ("ap", ap))));
12222 this.alignPanel.setOverviewPanel (overview);
12223 });
12224 Clazz_overrideMethod (c$, "changeColour", 
12225 function (cs) {
12226 var threshold = 0;
12227 if (cs != null) {
12228 if (this.viewport.getAbovePIDThreshold ()) {
12229 this.viewport.setThreshold (jalview.appletgui.SliderPanel.setPIDSliderSource (this.alignPanel, cs, "Background"));
12230 }if (this.viewport.getConservationSelected ()) {
12231 cs.setConservationApplied (true);
12232 this.viewport.setIncrement (jalview.appletgui.SliderPanel.setConservationSlider (this.alignPanel, cs, "Background"));
12233 } else {
12234 cs.setConservationApplied (false);
12235 }}this.viewport.setGlobalColourScheme (cs);
12236 if (this.alignPanel.getOverviewPanel () != null) {
12237 this.alignPanel.getOverviewPanel ().updateOverviewImage ();
12238 }jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.viewport.applet).sequenceColoursChanged (this.alignPanel);
12239 this.alignPanel.paintAlignment (true);
12240 }, "jalview.schemes.ColourSchemeI");
12241 Clazz_defineMethod (c$, "modifyPID_actionPerformed", 
12242 function () {
12243 if (this.viewport.getAbovePIDThreshold () && this.viewport.getGlobalColourScheme () != null) {
12244 jalview.appletgui.SliderPanel.setPIDSliderSource (this.alignPanel, this.viewport.getGlobalColourScheme (), "Background");
12245 jalview.appletgui.SliderPanel.showPIDSlider ();
12246 }});
12247 Clazz_defineMethod (c$, "modifyConservation_actionPerformed", 
12248 function () {
12249 if (this.viewport.getConservationSelected () && this.viewport.getGlobalColourScheme () != null) {
12250 jalview.appletgui.SliderPanel.setConservationSlider (this.alignPanel, this.viewport.getGlobalColourScheme (), "Background");
12251 jalview.appletgui.SliderPanel.showConservationSlider ();
12252 }});
12253 Clazz_defineMethod (c$, "conservationMenuItem_actionPerformed", 
12254 function () {
12255 this.viewport.setConservationSelected (this.conservationMenuItem.getState ());
12256 this.viewport.setAbovePIDThreshold (false);
12257 this.abovePIDThreshold.setState (false);
12258 this.changeColour (this.viewport.getGlobalColourScheme ());
12259 this.modifyConservation_actionPerformed ();
12260 });
12261 Clazz_defineMethod (c$, "abovePIDThreshold_actionPerformed", 
12262 function () {
12263 this.viewport.setAbovePIDThreshold (this.abovePIDThreshold.getState ());
12264 this.conservationMenuItem.setState (false);
12265 this.viewport.setConservationSelected (false);
12266 this.changeColour (this.viewport.getGlobalColourScheme ());
12267 this.modifyPID_actionPerformed ();
12268 });
12269 Clazz_defineMethod (c$, "sortPairwiseMenuItem_actionPerformed", 
12270 function () {
12271 var oldOrder = this.viewport.getAlignment ().getSequencesArray ();
12272 jalview.analysis.AlignmentSorter.sortByPID (this.viewport.getAlignment (), this.viewport.getAlignment ().getSequenceAt (0), null);
12273 this.addHistoryItem ( new jalview.commands.OrderCommand ("Pairwise Sort", oldOrder, this.viewport.getAlignment ()));
12274 this.alignPanel.paintAlignment (true);
12275 });
12276 Clazz_defineMethod (c$, "sortIDMenuItem_actionPerformed", 
12277 function () {
12278 var oldOrder = this.viewport.getAlignment ().getSequencesArray ();
12279 jalview.analysis.AlignmentSorter.sortByID (this.viewport.getAlignment ());
12280 this.addHistoryItem ( new jalview.commands.OrderCommand ("ID Sort", oldOrder, this.viewport.getAlignment ()));
12281 this.alignPanel.paintAlignment (true);
12282 });
12283 Clazz_defineMethod (c$, "sortLengthMenuItem_actionPerformed", 
12284 function () {
12285 var oldOrder = this.viewport.getAlignment ().getSequencesArray ();
12286 jalview.analysis.AlignmentSorter.sortByLength (this.viewport.getAlignment ());
12287 this.addHistoryItem ( new jalview.commands.OrderCommand ("Length Sort", oldOrder, this.viewport.getAlignment ()));
12288 this.alignPanel.paintAlignment (true);
12289 });
12290 Clazz_defineMethod (c$, "sortGroupMenuItem_actionPerformed", 
12291 function () {
12292 var oldOrder = this.viewport.getAlignment ().getSequencesArray ();
12293 jalview.analysis.AlignmentSorter.sortByGroup (this.viewport.getAlignment ());
12294 this.addHistoryItem ( new jalview.commands.OrderCommand ("Group Sort", oldOrder, this.viewport.getAlignment ()));
12295 this.alignPanel.paintAlignment (true);
12296 });
12297 Clazz_defineMethod (c$, "removeRedundancyMenuItem_actionPerformed", 
12298 function () {
12299  new jalview.appletgui.RedundancyPanel (this.alignPanel);
12300 });
12301 Clazz_defineMethod (c$, "pairwiseAlignmentMenuItem_actionPerformed", 
12302 function () {
12303 if (this.viewport.getSelectionGroup () != null && this.viewport.getSelectionGroup ().getSize () > 1) {
12304 var frame =  new awt2swing.Frame ();
12305 frame.add ( new jalview.appletgui.PairwiseAlignPanel (this.alignPanel));
12306 jalview.bin.JalviewLite.addFrame (frame, jalview.util.MessageManager.getString ("action.pairwise_alignment"), 600, 500);
12307 }});
12308 Clazz_defineMethod (c$, "PCAMenuItem_actionPerformed", 
12309 function () {
12310 if (!this.viewport.getAlignment ().isAligned (false)) {
12311 var current;
12312 var Width = this.viewport.getAlignment ().getWidth ();
12313 for (var i = 0; i < this.viewport.getAlignment ().getSequences ().size (); i++) {
12314 current = this.viewport.getAlignment ().getSequenceAt (i);
12315 if (current.getLength () < Width) {
12316 current.insertCharAt (Width - 1, this.viewport.getGapCharacter ());
12317 }}
12318 this.alignPanel.paintAlignment (true);
12319 }if ((this.viewport.getSelectionGroup () != null && this.viewport.getSelectionGroup ().getSize () < 4 && this.viewport.getSelectionGroup ().getSize () > 0) || this.viewport.getAlignment ().getHeight () < 4) {
12320 return;
12321 }try {
12322  new jalview.appletgui.PCAPanel (this.viewport);
12323 } catch (ex) {
12324 if (Clazz_exceptionOf (ex, OutOfMemoryError)) {
12325 } else {
12326 throw ex;
12327 }
12328 }
12329 });
12330 Clazz_defineMethod (c$, "averageDistanceTreeMenuItem_actionPerformed", 
12331 function () {
12332 this.NewTreePanel ("AV", "PID", "Average distance tree using PID");
12333 });
12334 Clazz_defineMethod (c$, "neighbourTreeMenuItem_actionPerformed", 
12335 function () {
12336 this.NewTreePanel ("NJ", "PID", "Neighbour joining tree using PID");
12337 });
12338 Clazz_defineMethod (c$, "njTreeBlosumMenuItem_actionPerformed", 
12339 function () {
12340 this.NewTreePanel ("NJ", "BL", "Neighbour joining tree using BLOSUM62");
12341 });
12342 Clazz_defineMethod (c$, "avTreeBlosumMenuItem_actionPerformed", 
12343 function () {
12344 this.NewTreePanel ("AV", "BL", "Average distance tree using BLOSUM62");
12345 });
12346 Clazz_defineMethod (c$, "NewTreePanel", 
12347 function (type, pwType, title) {
12348 if (!this.viewport.getAlignment ().isAligned (false)) {
12349 var current;
12350 var Width = this.viewport.getAlignment ().getWidth ();
12351 for (var i = 0; i < this.viewport.getAlignment ().getSequences ().size (); i++) {
12352 current = this.viewport.getAlignment ().getSequenceAt (i);
12353 if (current.getLength () < Width) {
12354 current.insertCharAt (Width - 1, this.viewport.getGapCharacter ());
12355 }}
12356 this.alignPanel.paintAlignment (true);
12357 }if ((this.viewport.getSelectionGroup () != null && this.viewport.getSelectionGroup ().getSize () > 1) || (this.viewport.getAlignment ().getHeight () > 1)) {
12358 var tp =  new jalview.appletgui.TreePanel (this.alignPanel, type, pwType);
12359 this.addTreeMenuItem (tp, title);
12360 jalview.bin.JalviewLite.addFrame (tp, title, 600, 500);
12361 }}, "~S,~S,~S");
12362 Clazz_defineMethod (c$, "loadTree_actionPerformed", 
12363 function () {
12364 var cap =  new jalview.appletgui.CutAndPasteTransfer (true, this);
12365 cap.setText (jalview.util.MessageManager.getString ("label.paste_newick_tree_file"));
12366 cap.setTreeImport ();
12367 var frame =  new awt2swing.Frame ();
12368 frame.add (cap);
12369 jalview.bin.JalviewLite.addFrame (frame, jalview.util.MessageManager.getString ("label.paste_newick_file"), 400, 300);
12370 });
12371 Clazz_defineMethod (c$, "loadTree", 
12372 function (tree, treeFile) {
12373 var tp =  new jalview.appletgui.TreePanel (this.alignPanel, treeFile, jalview.util.MessageManager.getString ("label.load_tree_from_file"), tree);
12374 jalview.bin.JalviewLite.addFrame (tp, treeFile, 600, 500);
12375 this.addTreeMenuItem (tp, treeFile);
12376 }, "jalview.io.NewickFile,~S");
12377 Clazz_defineMethod (c$, "sortByTree", 
12378 function (treePanel, title) {
12379 var oldOrder = this.viewport.getAlignment ().getSequencesArray ();
12380 jalview.analysis.AlignmentSorter.sortByTree (this.viewport.getAlignment (), treePanel.getTree ());
12381 this.addHistoryItem ( new jalview.commands.OrderCommand (jalview.util.MessageManager.formatMessage ("label.order_by_params",  Clazz_newArray (-1, [title])), oldOrder, this.viewport.getAlignment ()));
12382 this.alignPanel.paintAlignment (true);
12383 }, "jalview.appletgui.TreePanel,~S");
12384 Clazz_defineMethod (c$, "addTreeMenuItem", 
12385 function (treePanel, title) {
12386 var item =  new awt2swing.MenuItem (title);
12387 this.sortByTreeMenu.add (item);
12388 item.addActionListener (((Clazz_isClassDefined ("jalview.appletgui.AlignFrame$2") ? 0 : jalview.appletgui.AlignFrame.$AlignFrame$2$ ()), Clazz_innerTypeInstance (jalview.appletgui.AlignFrame$2, this, Clazz_cloneFinals ("treePanel", treePanel, "title", title))));
12389 treePanel.addWindowListener (((Clazz_isClassDefined ("jalview.appletgui.AlignFrame$3") ? 0 : jalview.appletgui.AlignFrame.$AlignFrame$3$ ()), Clazz_innerTypeInstance (jalview.appletgui.AlignFrame$3, this, Clazz_cloneFinals ("treePanel", treePanel, "title", title, "item", item))));
12390 }, "jalview.appletgui.TreePanel,~S");
12391 Clazz_defineMethod (c$, "sortBy", 
12392 function (alorder, undoname) {
12393 var oldOrder = this.viewport.getAlignment ().getSequencesArray ();
12394 if ((this.viewport.applet, jalview.bin.JalviewLite).debug) {
12395 System.err.println ("Sorting " + alorder.getOrder ().size () + " in alignment '" + this.getTitle () + "'");
12396 }jalview.analysis.AlignmentSorter.sortBy (this.viewport.getAlignment (), alorder);
12397 if (undoname != null) {
12398 this.addHistoryItem ( new jalview.commands.OrderCommand (undoname, oldOrder, this.viewport.getAlignment ()));
12399 }this.alignPanel.paintAlignment (true);
12400 return true;
12401 }, "jalview.datamodel.AlignmentOrder,~S");
12402 Clazz_defineMethod (c$, "documentation_actionPerformed", 
12403 function () {
12404 this.alignPanel.av.applet.openJalviewHelpUrl ();
12405 });
12406 Clazz_defineMethod (c$, "about_actionPerformed", 
12407 function () {
12408 if (!Clazz_isClassDefined ("jalview.appletgui.AlignFrame$1AboutPanel")) {
12409 jalview.appletgui.AlignFrame.$AlignFrame$1AboutPanel$ ();
12410 }
12411 var frame =  new awt2swing.Frame ();
12412 frame.add (Clazz_innerTypeInstance (jalview.appletgui.AlignFrame$1AboutPanel, this, null, jalview.bin.JalviewLite.getVersion (), jalview.bin.JalviewLite.getBuildDate ()));
12413 jalview.bin.JalviewLite.addFrame (frame, jalview.util.MessageManager.getString ("label.jalview"), 580, 220);
12414 });
12415 Clazz_defineMethod (c$, "showURL", 
12416 function (url, target) {
12417 if (this.viewport.applet == null) {
12418 System.out.println ("Not running as applet - no browser available.");
12419 } else {
12420 this.viewport.applet.showURL (url, target);
12421 }}, "~S,~S");
12422 Clazz_defineMethod (c$, "jbInit", 
12423  function () {
12424 this.setMenuBar (this.alignFrameMenuBar);
12425 this.inputText.setLabel (jalview.util.MessageManager.getString ("label.input_from_textbox"));
12426 this.inputText.addActionListener (this);
12427 var outputTextboxMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("label.out_to_textbox"));
12428 for (var i = 0; i < jalview.io.AppletFormatAdapter.WRITEABLE_FORMATS.length; i++) {
12429 var item =  new awt2swing.MenuItem (jalview.io.AppletFormatAdapter.WRITEABLE_FORMATS[i]);
12430 item.addActionListener (((Clazz_isClassDefined ("jalview.appletgui.AlignFrame$4") ? 0 : jalview.appletgui.AlignFrame.$AlignFrame$4$ ()), Clazz_innerTypeInstance (jalview.appletgui.AlignFrame$4, this, null)));
12431 outputTextboxMenu.add (item);
12432 }
12433 this.closeMenuItem.addActionListener (this);
12434 this.loadApplication.addActionListener (this);
12435 this.$loadTree.addActionListener (this);
12436 this.$loadAnnotations.addActionListener (this);
12437 this.$outputFeatures.addActionListener (this);
12438 this.$outputAnnotations.addActionListener (this);
12439 this.undoMenuItem.setEnabled (false);
12440 this.undoMenuItem.setLabel (jalview.util.MessageManager.getString ("action.undo"));
12441 this.undoMenuItem.addActionListener (this);
12442 this.redoMenuItem.setEnabled (false);
12443 this.redoMenuItem.setLabel (jalview.util.MessageManager.getString ("action.redo"));
12444 this.redoMenuItem.addActionListener (this);
12445 this.copy.setLabel (jalview.util.MessageManager.getString ("action.copy"));
12446 this.copy.addActionListener (this);
12447 this.cut.setLabel (jalview.util.MessageManager.getString ("action.cut"));
12448 this.cut.addActionListener (this);
12449 this.$delete.setLabel (jalview.util.MessageManager.getString ("action.delete"));
12450 this.$delete.addActionListener (this);
12451 this.pasteMenu.setLabel (jalview.util.MessageManager.getString ("action.paste"));
12452 this.pasteNew.setLabel (jalview.util.MessageManager.getString ("label.to_new_alignment"));
12453 this.pasteNew.addActionListener (this);
12454 this.pasteThis.setLabel (jalview.util.MessageManager.getString ("label.to_this_alignment"));
12455 this.pasteThis.addActionListener (this);
12456 this.remove2LeftMenuItem.setLabel (jalview.util.MessageManager.getString ("action.remove_left"));
12457 this.remove2LeftMenuItem.addActionListener (this);
12458 this.remove2RightMenuItem.setLabel (jalview.util.MessageManager.getString ("action.remove_right"));
12459 this.remove2RightMenuItem.addActionListener (this);
12460 this.removeGappedColumnMenuItem.setLabel (jalview.util.MessageManager.getString ("action.remove_empty_columns"));
12461 this.removeGappedColumnMenuItem.addActionListener (this);
12462 this.removeAllGapsMenuItem.setLabel (jalview.util.MessageManager.getString ("action.remove_all_gaps"));
12463 this.removeAllGapsMenuItem.addActionListener (this);
12464 this.removeRedundancyMenuItem.setLabel (jalview.util.MessageManager.getString ("action.remove_redundancy").concat ("..."));
12465 this.removeRedundancyMenuItem.addActionListener (this);
12466 this.findMenuItem.setLabel (jalview.util.MessageManager.getString ("action.find"));
12467 this.findMenuItem.addActionListener (this);
12468 this.selectAllSequenceMenuItem.addActionListener (this);
12469 this.deselectAllSequenceMenuItem.addActionListener (this);
12470 this.invertSequenceMenuItem.setLabel (jalview.util.MessageManager.getString ("action.invert_sequence_selection"));
12471 this.invertSequenceMenuItem.addActionListener (this);
12472 this.invertColSel.setLabel (jalview.util.MessageManager.getString ("action.invert_column_selection"));
12473 this.invertColSel.addActionListener (this);
12474 this.deleteGroups.setLabel (jalview.util.MessageManager.getString ("action.undefine_groups"));
12475 this.deleteGroups.addActionListener (this);
12476 this.grpsFromSelection.setLabel (jalview.util.MessageManager.getString ("action.make_groups_selection"));
12477 this.grpsFromSelection.addActionListener (this);
12478 this.createGroup.setLabel (jalview.util.MessageManager.getString ("action.create_group"));
12479 this.unGroup.setLabel (jalview.util.MessageManager.getString ("action.remove_group"));
12480 this.annotationColumnSelection.setLabel ("Select by Annotation");
12481 this.annotationColumnSelection.addActionListener (this);
12482 this.$newView.setLabel (jalview.util.MessageManager.getString ("action.new_view"));
12483 this.$newView.addActionListener (this);
12484 var showMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("action.show"));
12485 this.showColumns.setLabel (jalview.util.MessageManager.getString ("label.all_columns"));
12486 this.showSeqs.setLabel (jalview.util.MessageManager.getString ("label.all_sequences"));
12487 var hideMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("action.hide"));
12488 this.hideColumns.setLabel (jalview.util.MessageManager.getString ("label.selected_columns"));
12489 this.hideSequences.setLabel (jalview.util.MessageManager.getString ("label.selected_sequences"));
12490 this.hideAllButSelection.setLabel (jalview.util.MessageManager.getString ("label.all_but_selected_region"));
12491 this.hideAllSelection.setLabel (jalview.util.MessageManager.getString ("label.selected_region"));
12492 this.showAllHidden.setLabel (jalview.util.MessageManager.getString ("label.all_sequences_columns"));
12493 this.showColumns.addActionListener (this);
12494 this.showSeqs.addActionListener (this);
12495 this.hideColumns.addActionListener (this);
12496 this.hideSequences.addActionListener (this);
12497 this.hideAllButSelection.addActionListener (this);
12498 this.hideAllSelection.addActionListener (this);
12499 this.showAllHidden.addActionListener (this);
12500 this.featureSettings.setLabel (jalview.util.MessageManager.getString ("label.feature_settings"));
12501 this.featureSettings.addActionListener (this);
12502 this.sequenceFeatures.setLabel (jalview.util.MessageManager.getString ("label.show_sequence_features"));
12503 this.sequenceFeatures.addItemListener (this);
12504 this.sequenceFeatures.setState (false);
12505 this.followMouseOverFlag.setLabel (jalview.util.MessageManager.getString ("label.automatic_scrolling"));
12506 this.followMouseOverFlag.addItemListener (this);
12507 this.alProperties.addActionListener (this);
12508 this.overviewMenuItem.setLabel (jalview.util.MessageManager.getString ("label.overview_window"));
12509 this.overviewMenuItem.addActionListener (this);
12510 this.annotationPanelMenuItem.setLabel (jalview.util.MessageManager.getString ("label.show_annotations"));
12511 this.annotationPanelMenuItem.addItemListener (this);
12512 this.showGroupConsensus.setLabel (jalview.util.MessageManager.getString ("label.group_consensus"));
12513 this.showGroupConservation.setLabel (jalview.util.MessageManager.getString ("label.group_conservation"));
12514 this.showConsensusHistogram.setLabel (jalview.util.MessageManager.getString ("label.show_consensus_histogram"));
12515 this.showSequenceLogo.setLabel (jalview.util.MessageManager.getString ("label.show_consensus_logo"));
12516 this.normSequenceLogo.setLabel (jalview.util.MessageManager.getString ("label.norm_consensus_logo"));
12517 this.applyAutoAnnotationSettings.setLabel (jalview.util.MessageManager.getString ("label.apply_all_groups"));
12518 this.applyAutoAnnotationSettings.setState (true);
12519 var autoAnnMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("label.autocalculated_annotation"));
12520 this.showGroupConsensus.addItemListener (this);
12521 this.showGroupConservation.addItemListener (this);
12522 this.showConsensusHistogram.addItemListener (this);
12523 this.showSequenceLogo.addItemListener (this);
12524 this.normSequenceLogo.addItemListener (this);
12525 this.applyAutoAnnotationSettings.addItemListener (this);
12526 this.showAlignmentAnnotations =  new awt2swing.CheckboxMenuItem (jalview.util.MessageManager.getString ("label.show_all_al_annotations"));
12527 this.showSequenceAnnotations =  new awt2swing.CheckboxMenuItem (jalview.util.MessageManager.getString ("label.show_all_seq_annotations"));
12528 this.sortAnnBySequence =  new awt2swing.CheckboxMenuItem (jalview.util.MessageManager.getString ("label.sort_annotations_by_sequence"));
12529 this.sortAnnByLabel =  new awt2swing.CheckboxMenuItem (jalview.util.MessageManager.getString ("label.sort_annotations_by_label"));
12530 this.showAutoFirst =  new awt2swing.CheckboxMenuItem (jalview.util.MessageManager.getString ("label.show_first"));
12531 this.showAutoLast =  new awt2swing.CheckboxMenuItem (jalview.util.MessageManager.getString ("label.show_last"));
12532 this.showAlignmentAnnotations.addItemListener (this);
12533 this.showSequenceAnnotations.addItemListener (this);
12534 this.sortAnnBySequence.addItemListener (this);
12535 this.sortAnnByLabel.addItemListener (this);
12536 this.showAutoFirst.addItemListener (this);
12537 this.showAutoLast.addItemListener (this);
12538 this.$font.setLabel (jalview.util.MessageManager.getString ("action.font"));
12539 this.$font.addActionListener (this);
12540 this.scaleAbove.setLabel (jalview.util.MessageManager.getString ("action.scale_above"));
12541 this.scaleAbove.setState (true);
12542 this.scaleAbove.setEnabled (false);
12543 this.scaleAbove.addItemListener (this);
12544 this.scaleLeft.setEnabled (false);
12545 this.scaleLeft.setState (true);
12546 this.scaleLeft.setLabel (jalview.util.MessageManager.getString ("action.scale_left"));
12547 this.scaleLeft.addItemListener (this);
12548 this.scaleRight.setEnabled (false);
12549 this.scaleRight.setState (true);
12550 this.scaleRight.setLabel (jalview.util.MessageManager.getString ("action.scale_right"));
12551 this.scaleRight.addItemListener (this);
12552 this.viewBoxesMenuItem.setLabel (jalview.util.MessageManager.getString ("action.boxes"));
12553 this.viewBoxesMenuItem.setState (true);
12554 this.viewBoxesMenuItem.addItemListener (this);
12555 this.viewTextMenuItem.setLabel (jalview.util.MessageManager.getString ("action.text"));
12556 this.viewTextMenuItem.setState (true);
12557 this.viewTextMenuItem.addItemListener (this);
12558 this.colourTextMenuItem.setLabel (jalview.util.MessageManager.getString ("label.colour_text"));
12559 this.colourTextMenuItem.addItemListener (this);
12560 this.displayNonconservedMenuItem.setLabel (jalview.util.MessageManager.getString ("label.show_non_conversed"));
12561 this.displayNonconservedMenuItem.addItemListener (this);
12562 this.wrapMenuItem.setLabel (jalview.util.MessageManager.getString ("action.wrap"));
12563 this.wrapMenuItem.addItemListener (this);
12564 this.renderGapsMenuItem.setLabel (jalview.util.MessageManager.getString ("action.show_gaps"));
12565 this.renderGapsMenuItem.setState (true);
12566 this.renderGapsMenuItem.addItemListener (this);
12567 this.centreColumnLabelFlag.setLabel (jalview.util.MessageManager.getString ("label.centre_column_labels"));
12568 this.centreColumnLabelFlag.addItemListener (this);
12569 this.seqLimits.setState (true);
12570 this.seqLimits.setLabel (jalview.util.MessageManager.getString ("label.show_sequence_limits"));
12571 this.seqLimits.addItemListener (this);
12572 this.applyToAllGroups.setLabel (jalview.util.MessageManager.getString ("label.apply_colour_to_all_groups"));
12573 this.applyToAllGroups.setState (true);
12574 this.applyToAllGroups.addItemListener (this);
12575 this.clustalColour.setLabel (jalview.util.MessageManager.getString ("label.clustalx"));
12576 this.clustalColour.addActionListener (this);
12577 this.zappoColour.setLabel (jalview.util.MessageManager.getString ("label.zappo"));
12578 this.zappoColour.addActionListener (this);
12579 this.taylorColour.setLabel (jalview.util.MessageManager.getString ("label.taylor"));
12580 this.taylorColour.addActionListener (this);
12581 this.hydrophobicityColour.setLabel (jalview.util.MessageManager.getString ("label.hydrophobicity"));
12582 this.hydrophobicityColour.addActionListener (this);
12583 this.helixColour.setLabel (jalview.util.MessageManager.getString ("label.helix_propensity"));
12584 this.helixColour.addActionListener (this);
12585 this.strandColour.setLabel (jalview.util.MessageManager.getString ("label.strand_propensity"));
12586 this.strandColour.addActionListener (this);
12587 this.turnColour.setLabel (jalview.util.MessageManager.getString ("label.turn_propensity"));
12588 this.turnColour.addActionListener (this);
12589 this.buriedColour.setLabel (jalview.util.MessageManager.getString ("label.buried_index"));
12590 this.buriedColour.addActionListener (this);
12591 this.purinePyrimidineColour.setLabel (jalview.util.MessageManager.getString ("label.purine_pyrimidine"));
12592 this.purinePyrimidineColour.addActionListener (this);
12593 this.RNAInteractionColour.setLabel (jalview.util.MessageManager.getString ("label.rna_interaction"));
12594 this.RNAInteractionColour.addActionListener (this);
12595 this.RNAHelixColour.setLabel (jalview.util.MessageManager.getString ("action.by_rna_helixes"));
12596 this.RNAHelixColour.addActionListener (this);
12597 this.userDefinedColour.setLabel (jalview.util.MessageManager.getString ("action.user_defined"));
12598 this.userDefinedColour.addActionListener (this);
12599 this.PIDColour.setLabel (jalview.util.MessageManager.getString ("label.percentage_identity"));
12600 this.PIDColour.addActionListener (this);
12601 this.BLOSUM62Colour.setLabel (jalview.util.MessageManager.getString ("label.blosum62_score"));
12602 this.BLOSUM62Colour.addActionListener (this);
12603 this.tcoffeeColour.setLabel (jalview.util.MessageManager.getString ("label.tcoffee_scores"));
12604 this.tcoffeeColour.setEnabled (false);
12605 this.tcoffeeColour.addActionListener (this);
12606 this.conservationMenuItem.setLabel (jalview.util.MessageManager.getString ("action.by_conservation"));
12607 this.conservationMenuItem.addItemListener (this);
12608 this.noColourmenuItem.setLabel (jalview.util.MessageManager.getString ("label.none"));
12609 this.noColourmenuItem.addActionListener (this);
12610 this.abovePIDThreshold.setLabel (jalview.util.MessageManager.getString ("label.above_identity_threshold"));
12611 this.abovePIDThreshold.addItemListener (this);
12612 this.nucleotideColour.setLabel (jalview.util.MessageManager.getString ("label.nucleotide"));
12613 this.nucleotideColour.addActionListener (this);
12614 this.modifyPID.setLabel (jalview.util.MessageManager.getString ("label.modify_identity_thereshold"));
12615 this.modifyPID.addActionListener (this);
12616 this.modifyConservation.setLabel (jalview.util.MessageManager.getString ("label.modify_conservation_thereshold"));
12617 this.modifyConservation.addActionListener (this);
12618 this.annotationColour.setLabel (jalview.util.MessageManager.getString ("action.by_annotation"));
12619 this.annotationColour.addActionListener (this);
12620 this.sortPairwiseMenuItem.setLabel (jalview.util.MessageManager.getString ("action.by_pairwise_id"));
12621 this.sortPairwiseMenuItem.addActionListener (this);
12622 this.sortIDMenuItem.setLabel (jalview.util.MessageManager.getString ("action.by_id"));
12623 this.sortIDMenuItem.addActionListener (this);
12624 this.sortLengthMenuItem.setLabel (jalview.util.MessageManager.getString ("action.by_length"));
12625 this.sortLengthMenuItem.addActionListener (this);
12626 this.sortGroupMenuItem.setLabel (jalview.util.MessageManager.getString ("action.by_group"));
12627 this.sortGroupMenuItem.addActionListener (this);
12628 this.pairwiseAlignmentMenuItem.setLabel (jalview.util.MessageManager.getString ("action.pairwise_alignment"));
12629 this.pairwiseAlignmentMenuItem.addActionListener (this);
12630 this.PCAMenuItem.setLabel (jalview.util.MessageManager.getString ("label.principal_component_analysis"));
12631 this.PCAMenuItem.addActionListener (this);
12632 this.autoCalculate =  new awt2swing.CheckboxMenuItem (jalview.util.MessageManager.getString ("label.autocalculate_consensus"), true);
12633 this.averageDistanceTreeMenuItem.setLabel (jalview.util.MessageManager.getString ("label.average_distance_identity"));
12634 this.averageDistanceTreeMenuItem.addActionListener (this);
12635 this.neighbourTreeMenuItem.setLabel (jalview.util.MessageManager.getString ("label.neighbour_joining_identity"));
12636 this.neighbourTreeMenuItem.addActionListener (this);
12637 this.avDistanceTreeBlosumMenuItem.setLabel (jalview.util.MessageManager.getString ("label.average_distance_bloslum62"));
12638 this.avDistanceTreeBlosumMenuItem.addActionListener (this);
12639 this.njTreeBlosumMenuItem.setLabel (jalview.util.MessageManager.getString ("label.neighbour_blosum62"));
12640 this.njTreeBlosumMenuItem.addActionListener (this);
12641 this.sortByTreeMenu.setLabel (jalview.util.MessageManager.getString ("action.by_tree_order"));
12642 var sortMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("action.sort"));
12643 var calculateTreeMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("action.calculate_tree"));
12644 this.autoCalculate.addItemListener (this);
12645 this.$sortByTree.addItemListener (this);
12646 var helpMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("action.help"));
12647 this.documentation.setLabel (jalview.util.MessageManager.getString ("label.documentation"));
12648 this.documentation.addActionListener (this);
12649 this.about.setLabel (jalview.util.MessageManager.getString ("label.about"));
12650 this.about.addActionListener (this);
12651 this.alignFrameMenuBar.add (this.fileMenu);
12652 var editMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("action.edit"));
12653 this.alignFrameMenuBar.add (editMenu);
12654 var selectMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("action.select"));
12655 this.alignFrameMenuBar.add (selectMenu);
12656 var viewMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("action.view"));
12657 this.alignFrameMenuBar.add (viewMenu);
12658 var annotationsMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("action.annotations"));
12659 this.alignFrameMenuBar.add (annotationsMenu);
12660 var formatMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("action.format"));
12661 this.alignFrameMenuBar.add (formatMenu);
12662 var colourMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("action.colour"));
12663 this.alignFrameMenuBar.add (colourMenu);
12664 var calculateMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("action.calculate"));
12665 this.alignFrameMenuBar.add (calculateMenu);
12666 this.alignFrameMenuBar.add (helpMenu);
12667 this.fileMenu.add (this.inputText);
12668 this.fileMenu.add (this.$loadTree);
12669 this.fileMenu.add (this.$loadAnnotations);
12670 this.fileMenu.addSeparator ();
12671 this.fileMenu.add (outputTextboxMenu);
12672 this.fileMenu.add (this.$outputFeatures);
12673 this.fileMenu.add (this.$outputAnnotations);
12674 if (this.jalviewServletURL != null) {
12675 this.fileMenu.add (this.loadApplication);
12676 }this.fileMenu.addSeparator ();
12677 this.fileMenu.add (this.closeMenuItem);
12678 editMenu.add (this.undoMenuItem);
12679 editMenu.add (this.redoMenuItem);
12680 editMenu.add (this.cut);
12681 editMenu.add (this.copy);
12682 this.pasteMenu.add (this.pasteNew);
12683 this.pasteMenu.add (this.pasteThis);
12684 editMenu.add (this.pasteMenu);
12685 editMenu.add (this.$delete);
12686 editMenu.addSeparator ();
12687 editMenu.add (this.remove2LeftMenuItem);
12688 editMenu.add (this.remove2RightMenuItem);
12689 editMenu.add (this.removeGappedColumnMenuItem);
12690 editMenu.add (this.removeAllGapsMenuItem);
12691 editMenu.add (this.removeRedundancyMenuItem);
12692 selectMenu.add (this.findMenuItem);
12693 selectMenu.addSeparator ();
12694 selectMenu.add (this.selectAllSequenceMenuItem);
12695 selectMenu.add (this.deselectAllSequenceMenuItem);
12696 selectMenu.add (this.invertSequenceMenuItem);
12697 selectMenu.add (this.invertColSel);
12698 selectMenu.add (this.createGroup);
12699 selectMenu.add (this.unGroup);
12700 selectMenu.add (this.grpsFromSelection);
12701 selectMenu.add (this.deleteGroups);
12702 selectMenu.add (this.annotationColumnSelection);
12703 viewMenu.add (this.$newView);
12704 viewMenu.addSeparator ();
12705 showMenu.add (this.showColumns);
12706 showMenu.add (this.showSeqs);
12707 showMenu.add (this.showAllHidden);
12708 viewMenu.add (showMenu);
12709 hideMenu.add (this.hideColumns);
12710 hideMenu.add (this.hideSequences);
12711 hideMenu.add (this.hideAllSelection);
12712 hideMenu.add (this.hideAllButSelection);
12713 viewMenu.add (hideMenu);
12714 viewMenu.addSeparator ();
12715 viewMenu.add (this.followMouseOverFlag);
12716 viewMenu.addSeparator ();
12717 viewMenu.add (this.sequenceFeatures);
12718 viewMenu.add (this.featureSettings);
12719 viewMenu.addSeparator ();
12720 viewMenu.add (this.alProperties);
12721 viewMenu.addSeparator ();
12722 viewMenu.add (this.overviewMenuItem);
12723 annotationsMenu.add (this.annotationPanelMenuItem);
12724 annotationsMenu.addSeparator ();
12725 annotationsMenu.add (this.showAlignmentAnnotations);
12726 annotationsMenu.add (this.showSequenceAnnotations);
12727 annotationsMenu.add (this.sortAnnBySequence);
12728 annotationsMenu.add (this.sortAnnByLabel);
12729 annotationsMenu.addSeparator ();
12730 autoAnnMenu.add (this.showAutoFirst);
12731 autoAnnMenu.add (this.showAutoLast);
12732 autoAnnMenu.addSeparator ();
12733 autoAnnMenu.add (this.applyAutoAnnotationSettings);
12734 autoAnnMenu.add (this.showConsensusHistogram);
12735 autoAnnMenu.add (this.showSequenceLogo);
12736 autoAnnMenu.add (this.normSequenceLogo);
12737 autoAnnMenu.addSeparator ();
12738 autoAnnMenu.add (this.showGroupConservation);
12739 autoAnnMenu.add (this.showGroupConsensus);
12740 annotationsMenu.add (autoAnnMenu);
12741 formatMenu.add (this.$font);
12742 formatMenu.add (this.seqLimits);
12743 formatMenu.add (this.wrapMenuItem);
12744 formatMenu.add (this.scaleAbove);
12745 formatMenu.add (this.scaleLeft);
12746 formatMenu.add (this.scaleRight);
12747 formatMenu.add (this.viewBoxesMenuItem);
12748 formatMenu.add (this.viewTextMenuItem);
12749 formatMenu.add (this.colourTextMenuItem);
12750 formatMenu.add (this.displayNonconservedMenuItem);
12751 formatMenu.add (this.renderGapsMenuItem);
12752 formatMenu.add (this.centreColumnLabelFlag);
12753 colourMenu.add (this.applyToAllGroups);
12754 colourMenu.addSeparator ();
12755 colourMenu.add (this.noColourmenuItem);
12756 colourMenu.add (this.clustalColour);
12757 colourMenu.add (this.BLOSUM62Colour);
12758 colourMenu.add (this.PIDColour);
12759 colourMenu.add (this.zappoColour);
12760 colourMenu.add (this.taylorColour);
12761 colourMenu.add (this.hydrophobicityColour);
12762 colourMenu.add (this.helixColour);
12763 colourMenu.add (this.strandColour);
12764 colourMenu.add (this.turnColour);
12765 colourMenu.add (this.buriedColour);
12766 colourMenu.add (this.nucleotideColour);
12767 colourMenu.add (this.purinePyrimidineColour);
12768 colourMenu.add (this.tcoffeeColour);
12769 colourMenu.add (this.userDefinedColour);
12770 colourMenu.addSeparator ();
12771 colourMenu.add (this.conservationMenuItem);
12772 colourMenu.add (this.modifyConservation);
12773 colourMenu.add (this.abovePIDThreshold);
12774 colourMenu.add (this.modifyPID);
12775 colourMenu.add (this.annotationColour);
12776 colourMenu.add (this.RNAHelixColour);
12777 sortMenu.add (this.sortIDMenuItem);
12778 sortMenu.add (this.sortLengthMenuItem);
12779 sortMenu.add (this.sortByTreeMenu);
12780 sortMenu.add (this.sortGroupMenuItem);
12781 sortMenu.add (this.sortPairwiseMenuItem);
12782 calculateMenu.add (sortMenu);
12783 calculateTreeMenu.add (this.averageDistanceTreeMenuItem);
12784 calculateTreeMenu.add (this.neighbourTreeMenuItem);
12785 calculateTreeMenu.add (this.avDistanceTreeBlosumMenuItem);
12786 calculateTreeMenu.add (this.njTreeBlosumMenuItem);
12787 calculateMenu.add (calculateTreeMenu);
12788 calculateMenu.addSeparator ();
12789 calculateMenu.add (this.pairwiseAlignmentMenuItem);
12790 calculateMenu.add (this.PCAMenuItem);
12791 calculateMenu.add (this.autoCalculate);
12792 calculateMenu.add (this.$sortByTree);
12793 helpMenu.add (this.documentation);
12794 helpMenu.add (this.about);
12795 this.statusBar.setBackground (java.awt.Color.white);
12796 this.statusBar.setFont ( new java.awt.Font ("Verdana", 0, 11));
12797 this.setStatus (jalview.util.MessageManager.getString ("label.status_bar"));
12798 this.add (this.statusBar, "South");
12799 });
12800 Clazz_overrideMethod (c$, "setStatus", 
12801 function (string) {
12802 this.statusBar.setText (string);
12803 }, "~S");
12804 Clazz_defineMethod (c$, "createAlignFrameWindow", 
12805 function (reallyEmbedded) {
12806 if (reallyEmbedded) {
12807 this.embedAlignFrameInApplet (this.viewport.applet);
12808 } else {
12809 if (this.embedMenuIfNeeded (this.alignPanel)) {
12810 this.alignPanel.setSize (this.getSize ().width, this.getSize ().height - this.statusBar.getHeight ());
12811 }this.add (this.statusBar, "South");
12812 this.add (this.alignPanel, "Center");
12813 jalview.bin.JalviewLite.addFrame (this, this.getTitle (), this.frameWidth, this.frameHeight);
12814 }}, "~B");
12815 Clazz_defineMethod (c$, "embedAlignFrameInApplet", 
12816 function (theApplet) {
12817 this.fileMenu.remove (this.closeMenuItem);
12818 this.fileMenu.remove (3);
12819 this.embeddedMenu = this.makeEmbeddedPopupMenu (this.alignFrameMenuBar, false, false);
12820 theApplet.setLayout ( new java.awt.BorderLayout ());
12821 theApplet.add (this.embeddedMenu, "North");
12822 theApplet.add (this.statusBar, "South");
12823 this.alignPanel.setSize (theApplet.getSize ().width, theApplet.getSize ().height - this.embeddedMenu.getHeight () - this.statusBar.getHeight ());
12824 theApplet.add (this.alignPanel, "Center");
12825 var me = this;
12826 theApplet.addFocusListener (((Clazz_isClassDefined ("jalview.appletgui.AlignFrame$5") ? 0 : jalview.appletgui.AlignFrame.$AlignFrame$5$ ()), Clazz_innerTypeInstance (jalview.appletgui.AlignFrame$5, this, Clazz_cloneFinals ("theApplet", theApplet, "me", me))));
12827 theApplet.validate ();
12828 }, "jalview.bin.JalviewLite");
12829 Clazz_defineMethod (c$, "addStructureViewInstance", 
12830 function (jmolviewer, sequenceIds) {
12831 return null;
12832 }, "~O,~A");
12833 Clazz_defineMethod (c$, "addPdbFile", 
12834 function (sequenceId, pdbEntryString, pdbFile) {
12835 var toaddpdb = this.viewport.getAlignment ().findName (sequenceId);
12836 var needtoadd = false;
12837 if (toaddpdb != null) {
12838 var pdbe = toaddpdb.getPDBId ();
12839 var pdbentry = null;
12840 if (pdbe != null && pdbe.size () > 0) {
12841 for (var pe = 0, peSize = pdbe.size (); pe < peSize; pe++) {
12842 pdbentry = pdbe.elementAt (pe);
12843 if (!pdbentry.getId ().equals (pdbEntryString) && !pdbentry.getFile ().equals (pdbFile)) {
12844 pdbentry = null;
12845 } else {
12846 continue;
12847 }}
12848 }if (pdbentry == null) {
12849 pdbentry =  new jalview.datamodel.PDBEntry ();
12850 pdbentry.setId (pdbEntryString);
12851 pdbentry.setFile (pdbFile);
12852 needtoadd = true;
12853 }var protocol = jalview.io.AppletFormatAdapter.resolveProtocol (pdbFile, "PDB");
12854 if (protocol == null) {
12855 return false;
12856 }if (needtoadd) {
12857 if (pdbentry.getProperty () == null) {
12858 pdbentry.setProperty ( new java.util.Hashtable ());
12859 }pdbentry.getProperty ().put ("protocol", protocol);
12860 toaddpdb.addPDBId (pdbentry);
12861 this.alignPanel.getStructureSelectionManager ().registerPDBEntry (pdbentry);
12862 }}return true;
12863 }, "~S,~S,~S");
12864 Clazz_defineMethod (c$, "cleanSeqChainArrays", 
12865  function (seqs, chains) {
12866 if (seqs != null) {
12867 var sequences =  new java.util.Vector ();
12868 for (var i = 0; i < seqs.length; i++) {
12869 if (seqs[i] != null) {
12870 sequences.addElement ( Clazz_newArray (-1, [seqs[i], (chains != null) ? chains[i] : null]));
12871 }}
12872 seqs =  new Array (sequences.size ());
12873 chains =  new Array (sequences.size ());
12874 for (var i = 0, isize = sequences.size (); i < isize; i++) {
12875 var oj = sequences.elementAt (i);
12876 seqs[i] = oj[0];
12877 chains[i] = oj[1];
12878 }
12879 }return  Clazz_newArray (-1, [seqs, chains]);
12880 }, "~A,~A");
12881 Clazz_defineMethod (c$, "newStructureView", 
12882 function (applet, pdb, seqs, chains, protocol) {
12883 var sqch = this.cleanSeqChainArrays (seqs, chains);
12884 seqs = sqch[0];
12885 chains = sqch[1];
12886 if (seqs == null || seqs.length == 0) {
12887 System.err.println ("JalviewLite.AlignFrame:newStructureView: No sequence to bind structure to.");
12888 }if (protocol == null || protocol.trim ().length == 0 || protocol.equals ("null")) {
12889 protocol = pdb.getProperty ().get ("protocol");
12890 if (protocol == null) {
12891 System.err.println ("Couldn't work out protocol to open structure: " + pdb.getId ());
12892 return;
12893 }}if (applet.useXtrnalSviewer) {
12894 if (jalview.structure.StructureSelectionManager.getStructureSelectionManager (applet).setMapping (seqs, chains, pdb.getFile (), protocol) == null) {
12895 System.err.println ("Failed to map " + pdb.getFile () + " (" + protocol + ") to any sequences");
12896 }return;
12897 }if (applet.isAlignPdbStructures () && applet.jmolAvailable) {
12898 var ajm = null;
12899 var tajm;
12900 var jmols = applet.getAppletWindow (jalview.appletgui.AppletJmol);
12901 for (var i = 0, iSize = jmols.size (); i < iSize; i++) {
12902 tajm = jmols.elementAt (i);
12903 if (tajm.ap.alignFrame === this) {
12904 ajm = tajm;
12905 break;
12906 }}
12907 if (ajm != null) {
12908 System.err.println ("Incremental adding and aligning structure to existing Jmol view not yet implemented.");
12909 ajm = null;
12910 }} new jalview.appletgui.AppletJmol (pdb, seqs, chains, this.alignPanel, protocol);
12911 jalview.bin.JalviewLite.lastFrameX += 40;
12912 jalview.bin.JalviewLite.lastFrameY += 40;
12913 }, "jalview.bin.JalviewLite,jalview.datamodel.PDBEntry,~A,~A,~S");
12914 Clazz_defineMethod (c$, "alignedStructureView", 
12915 function (applet, pdb, seqs, chains, protocols) {
12916 System.err.println ("Aligned Structure View: Not yet implemented.");
12917 }, "jalview.bin.JalviewLite,~A,~A,~A,~A");
12918 Clazz_defineMethod (c$, "select", 
12919 function (sel, csel) {
12920 this.alignPanel.seqPanel.selection (sel, csel, null);
12921 }, "jalview.datamodel.SequenceGroup,jalview.datamodel.ColumnSelection");
12922 Clazz_defineMethod (c$, "scrollTo", 
12923 function (row, column) {
12924 this.alignPanel.seqPanel.scrollTo (row, column);
12925 }, "~N,~N");
12926 Clazz_defineMethod (c$, "scrollToRow", 
12927 function (row) {
12928 this.alignPanel.seqPanel.scrollToRow (row);
12929 }, "~N");
12930 Clazz_defineMethod (c$, "scrollToColumn", 
12931 function (column) {
12932 this.alignPanel.seqPanel.scrollToColumn (column);
12933 }, "~N");
12934 Clazz_defineMethod (c$, "getSequenceSetId", 
12935 function () {
12936 return this.viewport.getSequenceSetId ();
12937 });
12938 Clazz_defineMethod (c$, "loadScoreFile", 
12939 function (inFile) {
12940 var file = jalview.jsdev.GenericFileAdapter.getFile ("TCoffeeScoreFile", [inFile, jalview.io.AppletFormatAdapter.checkProtocol (inFile)]);
12941 if (!file.isValid ()) {
12942 System.err.println ("Problems parsing T-Coffee scores: " + file.getWarningMessage ());
12943 System.err.println ("Origin was:\n" + inFile);
12944 return false;
12945 }var aln;
12946 if ((aln = this.viewport.getAlignment ()) != null && (aln.getHeight () != file.getHeight () || aln.getWidth () != file.getWidth ())) {
12947 System.err.println ("The scores matrix does not match the alignment dimensions");
12948 }if (file.annotateAlignment (this.alignPanel.getAlignment (), false)) {
12949 this.alignPanel.fontChanged ();
12950 this.tcoffeeColour.setEnabled (true);
12951 this.changeColour ( new jalview.schemes.TCoffeeColourScheme (this.alignPanel.getAlignment ()));
12952 return true;
12953 } else {
12954 System.err.println ("Problems resolving T-Coffee scores:");
12955 if (file.getWarningMessage () != null) {
12956 System.err.println (file.getWarningMessage ());
12957 }}return false;
12958 }, "~S");
12959 Clazz_defineMethod (c$, "getSplitFrame", 
12960 function () {
12961 return this.splitFrame;
12962 });
12963 Clazz_defineMethod (c$, "setSplitFrame", 
12964 function (sf) {
12965 this.splitFrame = sf;
12966 }, "jalview.appletgui.SplitFrame");
12967 Clazz_overrideMethod (c$, "setShowSeqFeatures", 
12968 function (b) {
12969 this.viewport.setShowSequenceFeatures (b);
12970 }, "~B");
12971 Clazz_overrideMethod (c$, "setMenusForViewport", 
12972 function () {
12973 });
12974 Clazz_overrideMethod (c$, "refreshFeatureUI", 
12975 function (enableIfNecessary) {
12976 if (enableIfNecessary) {
12977 this.sequenceFeatures.setState (true);
12978 this.alignPanel.av.setShowSequenceFeatures (true);
12979 }}, "~B");
12980 Clazz_overrideMethod (c$, "getFeatureSettingsUI", 
12981 function () {
12982 return this.alignPanel.av.featureSettings;
12983 });
12984 c$.$AlignFrame$1$ = function () {
12985 Clazz_pu$h(self.c$);
12986 c$ = Clazz_declareAnonymous (jalview.appletgui, "AlignFrame$1", java.awt.event.WindowAdapter);
12987 Clazz_overrideMethod (c$, "windowClosing", 
12988 function (e) {
12989 if (this.f$.ap != null) {
12990 this.f$.ap.setOverviewPanel (null);
12991 }}, "java.awt.event.WindowEvent");
12992 c$ = Clazz_p0p ();
12993 };
12994 c$.$AlignFrame$2$ = function () {
12995 Clazz_pu$h(self.c$);
12996 c$ = Clazz_declareAnonymous (jalview.appletgui, "AlignFrame$2", null, java.awt.event.ActionListener);
12997 Clazz_overrideMethod (c$, "actionPerformed", 
12998 function (evt) {
12999 this.b$["jalview.appletgui.AlignFrame"].sortByTree (this.f$.treePanel, this.f$.title);
13000 }, "java.awt.event.ActionEvent");
13001 c$ = Clazz_p0p ();
13002 };
13003 c$.$AlignFrame$3$ = function () {
13004 Clazz_pu$h(self.c$);
13005 c$ = Clazz_declareAnonymous (jalview.appletgui, "AlignFrame$3", java.awt.event.WindowAdapter);
13006 Clazz_defineMethod (c$, "windowOpened", 
13007 function (e) {
13008 if (this.b$["jalview.appletgui.AlignFrame"].viewport.sortByTree) {
13009 this.b$["jalview.appletgui.AlignFrame"].sortByTree (this.f$.treePanel, this.f$.title);
13010 }Clazz_superCall (this, jalview.appletgui.AlignFrame$3, "windowOpened", [e]);
13011 }, "java.awt.event.WindowEvent");
13012 Clazz_overrideMethod (c$, "windowClosing", 
13013 function (e) {
13014 this.b$["jalview.appletgui.AlignFrame"].sortByTreeMenu.remove (this.f$.item);
13015 }, "java.awt.event.WindowEvent");
13016 c$ = Clazz_p0p ();
13017 };
13018 c$.$AlignFrame$1AboutPanel$ = function () {
13019 Clazz_pu$h(self.c$);
13020 c$ = Clazz_decorateAsClass (function () {
13021 Clazz_prepareCallback (this, arguments);
13022 this.version = null;
13023 this.builddate = null;
13024 Clazz_instantialize (this, arguments);
13025 }, jalview.appletgui, "AlignFrame$1AboutPanel", awt2swing.Canvas);
13026 Clazz_makeConstructor (c$, 
13027 function (a, b) {
13028 Clazz_superConstructor (this, jalview.appletgui.AlignFrame$1AboutPanel, []);
13029 this.version = a;
13030 this.builddate = b;
13031 }, "~S,~S");
13032 Clazz_overrideMethod (c$, "paintComponent", 
13033 function (a) {
13034 a.setColor (java.awt.Color.white);
13035 a.fillRect (0, 0, this.getSize ().width, this.getSize ().height);
13036 a.setFont ( new java.awt.Font ("Helvetica", 0, 12));
13037 var b = a.getFontMetrics ();
13038 var c = b.getHeight ();
13039 var d = 5;
13040 var e = 7;
13041 a.setColor (java.awt.Color.black);
13042 a.setFont ( new java.awt.Font ("Helvetica", 1, 14));
13043 awt2swing.Util.drawString (a, jalview.util.MessageManager.formatMessage ("label.jalviewLite_release",  Clazz_newArray (-1, [this.version])), e, d += c);
13044 a.setFont ( new java.awt.Font ("Helvetica", 1, 12));
13045 awt2swing.Util.drawString (a, jalview.util.MessageManager.formatMessage ("label.jaview_build_date",  Clazz_newArray (-1, [this.builddate])), e, d += c);
13046 a.setFont ( new java.awt.Font ("Helvetica", 0, 12));
13047 awt2swing.Util.drawString (a, jalview.util.MessageManager.getString ("label.jalview_authors_1"), e, d += c * 1.5);
13048 awt2swing.Util.drawString (a, jalview.util.MessageManager.getString ("label.jalview_authors_2"), e + 50, d += c + 8);
13049 awt2swing.Util.drawString (a, jalview.util.MessageManager.getString ("label.jalview_dev_managers"), e, d += c);
13050 awt2swing.Util.drawString (a, jalview.util.MessageManager.getString ("label.jalview_distribution_lists"), e, d += c);
13051 awt2swing.Util.drawString (a, jalview.util.MessageManager.getString ("label.jalview_please_cite"), e, d += c + 8);
13052 awt2swing.Util.drawString (a, jalview.util.MessageManager.getString ("label.jalview_cite_1_authors"), e, d += c);
13053 awt2swing.Util.drawString (a, jalview.util.MessageManager.getString ("label.jalview_cite_1_title"), e, d += c);
13054 awt2swing.Util.drawString (a, jalview.util.MessageManager.getString ("label.jalview_cite_1_ref"), e, d += c);
13055 }, "java.awt.Graphics");
13056 c$ = Clazz_p0p ();
13057 };
13058 c$.$AlignFrame$4$ = function () {
13059 Clazz_pu$h(self.c$);
13060 c$ = Clazz_declareAnonymous (jalview.appletgui, "AlignFrame$4", null, java.awt.event.ActionListener);
13061 Clazz_overrideMethod (c$, "actionPerformed", 
13062 function (e) {
13063 this.b$["jalview.appletgui.AlignFrame"].outputText_actionPerformed (e);
13064 }, "java.awt.event.ActionEvent");
13065 c$ = Clazz_p0p ();
13066 };
13067 c$.$AlignFrame$5$ = function () {
13068 Clazz_pu$h(self.c$);
13069 c$ = Clazz_declareAnonymous (jalview.appletgui, "AlignFrame$5", null, java.awt.event.FocusListener);
13070 Clazz_overrideMethod (c$, "focusLost", 
13071 function (e) {
13072 if (this.f$.theApplet.currentAlignFrame === this.f$.me) {
13073 this.f$.theApplet.currentAlignFrame = null;
13074 }}, "java.awt.event.FocusEvent");
13075 Clazz_overrideMethod (c$, "focusGained", 
13076 function (e) {
13077 this.f$.theApplet.currentAlignFrame = this.f$.me;
13078 }, "java.awt.event.FocusEvent");
13079 c$ = Clazz_p0p ();
13080 };
13081 Clazz_defineStatics (c$,
13082 "copiedSequences", null,
13083 "copiedHiddenColumns", null);
13084 });
13085 Clazz_declarePackage ("awt2swing");
13086 Clazz_load (["awt2swing.Panel"], "awt2swing.Canvas", null, function () {
13087 c$ = Clazz_declareType (awt2swing, "Canvas", awt2swing.Panel);
13088 });
13089 Clazz_declarePackage ("awt2swing");
13090 Clazz_load (["javax.swing.JPanel"], "awt2swing.Panel", null, function () {
13091 c$ = Clazz_declareType (awt2swing, "Panel", javax.swing.JPanel);
13092 Clazz_defineMethod (c$, "setName", 
13093 function (name) {
13094 System.out.println (name);
13095 Clazz_superCall (this, awt2swing.Panel, "setName", [name]);
13096 }, "~S");
13097 });
13098 Clazz_declarePackage ("jalview.api");
13099 Clazz_declareInterface (jalview.api, "AlignViewControllerGuiI");
13100 Clazz_declarePackage ("jalview.appletgui");
13101 Clazz_load (["awt2swing.Frame", "java.awt.event.MouseListener", "java.awt.Font", "java.util.HashMap"], "jalview.appletgui.EmbmenuFrame", ["awt2swing.Label", "$.Panel", "$.PopupMenu", "jalview.util.Platform", "java.awt.Color", "$.FlowLayout"], function () {
13102 c$ = Clazz_decorateAsClass (function () {
13103 this.embeddedPopup = null;
13104 this.embeddedMenu = null;
13105 Clazz_instantialize (this, arguments);
13106 }, jalview.appletgui, "EmbmenuFrame", awt2swing.Frame, java.awt.event.MouseListener);
13107 Clazz_prepareFields (c$, function () {
13108 this.embeddedPopup =  new java.util.HashMap ();
13109 });
13110 Clazz_defineMethod (c$, "embedMenuIfNeeded", 
13111 function (tobeAdjusted) {
13112 var topMenuBar = this.getJMenuBar ();
13113 if (topMenuBar == null) {
13114 return false;
13115 }if (jalview.util.Platform.isAMac ()) {
13116 this.embeddedMenu = this.makeEmbeddedPopupMenu (topMenuBar, true, false);
13117 this.unsetMenuBar ();
13118 this.add (this.embeddedMenu, "North");
13119 tobeAdjusted.setSize (this.getSize ().width, this.getSize ().height - this.embeddedMenu.getHeight ());
13120 return true;
13121 }return false;
13122 }, "awt2swing.Panel");
13123 Clazz_defineMethod (c$, "makeEmbeddedPopupMenu", 
13124 function (menuBar, overrideFonts, append) {
13125 if (!append) {
13126 this.embeddedPopup.clear ();
13127 if (this.embeddedMenu != null) {
13128 this.embeddedMenu.removeAll ();
13129 }}this.embeddedMenu = this.makeEmbeddedPopupMenu (menuBar, jalview.appletgui.EmbmenuFrame.DEFAULT_MENU_FONT, overrideFonts,  new awt2swing.Panel (), this);
13130 return this.embeddedMenu;
13131 }, "awt2swing.MenuBar,~B,~B");
13132 Clazz_defineMethod (c$, "makeEmbeddedPopupMenu", 
13133 function (menuBar, font, overrideFonts, embeddedMenu, clickHandler) {
13134 if (overrideFonts) {
13135 var mbf = menuBar.getFont ();
13136 if (mbf != null) {
13137 font = mbf;
13138 }}if (embeddedMenu == null) {
13139 embeddedMenu =  new awt2swing.Panel ();
13140 }var flowLayout1 =  new java.awt.FlowLayout ();
13141 embeddedMenu.setBackground (java.awt.Color.lightGray);
13142 embeddedMenu.setLayout (flowLayout1);
13143 for (var mbi = 0, nMbi = menuBar.getMenuCount (); mbi < nMbi; mbi++) {
13144 var mi = menuBar.getMenu (mbi);
13145 var elab =  new awt2swing.Label (mi.getLabel ());
13146 elab.setFont (font);
13147 var popup =  new awt2swing.PopupMenu ();
13148 var m;
13149 var mSize = mi.getItemCount ();
13150 for (m = 0; m < mSize; m++) {
13151 if (mi.getItem (m) == null) popup.addSeparator ();
13152  else popup.add (mi.getItem (m));
13153 mSize--;
13154 m--;
13155 }
13156 this.embeddedPopup.put (elab, popup);
13157 embeddedMenu.add (elab);
13158 elab.addMouseListener (clickHandler);
13159 }
13160 flowLayout1.setAlignment (0);
13161 flowLayout1.setHgap (2);
13162 flowLayout1.setVgap (0);
13163 return embeddedMenu;
13164 }, "awt2swing.MenuBar,java.awt.Font,~B,awt2swing.Panel,java.awt.event.MouseListener");
13165 Clazz_overrideMethod (c$, "mousePressed", 
13166 function (evt) {
13167 var popup = null;
13168 var source = evt.getSource ();
13169 popup = this.getPopupMenu (source);
13170 if (popup != null) {
13171 this.embeddedMenu.add (popup);
13172 popup.show (this.embeddedMenu, source.getBounds ().x, source.getBounds ().y + source.getBounds ().getSize ().height);
13173 }}, "java.awt.event.MouseEvent");
13174 Clazz_defineMethod (c$, "getPopupMenu", 
13175 function (source) {
13176 return this.embeddedPopup.get (source);
13177 }, "awt2swing.Label");
13178 Clazz_overrideMethod (c$, "mouseClicked", 
13179 function (evt) {
13180 }, "java.awt.event.MouseEvent");
13181 Clazz_overrideMethod (c$, "mouseReleased", 
13182 function (evt) {
13183 }, "java.awt.event.MouseEvent");
13184 Clazz_overrideMethod (c$, "mouseEntered", 
13185 function (evt) {
13186 }, "java.awt.event.MouseEvent");
13187 Clazz_overrideMethod (c$, "mouseExited", 
13188 function (evt) {
13189 }, "java.awt.event.MouseEvent");
13190 Clazz_defineMethod (c$, "destroyMenus", 
13191 function () {
13192 if (this.embeddedPopup != null) {
13193 for (var lb, $lb = this.embeddedPopup.keySet ().iterator (); $lb.hasNext () && ((lb = $lb.next ()) || true);) {
13194 lb.removeMouseListener (this);
13195 }
13196 this.embeddedPopup.clear ();
13197 }if (this.embeddedMenu != null) {
13198 this.embeddedMenu.removeAll ();
13199 }});
13200 Clazz_defineMethod (c$, "finalize", 
13201 function () {
13202 this.destroyMenus ();
13203 this.embeddedPopup = null;
13204 this.embeddedMenu = null;
13205 Clazz_superCall (this, jalview.appletgui.EmbmenuFrame, "finalize", []);
13206 });
13207 c$.FONT_ARIAL_PLAIN_11 = c$.prototype.FONT_ARIAL_PLAIN_11 =  new java.awt.Font ("Arial", 0, 11);
13208 c$.DEFAULT_MENU_FONT = c$.prototype.DEFAULT_MENU_FONT = jalview.appletgui.EmbmenuFrame.FONT_ARIAL_PLAIN_11;
13209 });
13210 Clazz_declarePackage ("awt2swing");
13211 Clazz_load (["javax.swing.JFrame"], "awt2swing.Frame", null, function () {
13212 c$ = Clazz_declareType (awt2swing, "Frame", javax.swing.JFrame);
13213 Clazz_defineMethod (c$, "remove", 
13214 function (i) {
13215 {
13216 this.removeInt(i);
13217 }}, "~N");
13218 Clazz_defineMethod (c$, "setMenuBar", 
13219 function (m) {
13220 this.setJMenuBar (m);
13221 }, "awt2swing.MenuBar");
13222 Clazz_defineMethod (c$, "unsetMenuBar", 
13223 function () {
13224 this.setJMenuBar (null);
13225 });
13226 Clazz_defineMethod (c$, "getMenubar", 
13227 function () {
13228 return this.getJMenuBar ();
13229 });
13230 });
13231 Clazz_declarePackage ("awt2swing");
13232 Clazz_load (["javax.swing.JLabel"], "awt2swing.Label", null, function () {
13233 c$ = Clazz_declareType (awt2swing, "Label", javax.swing.JLabel);
13234 Clazz_defineMethod (c$, "setAlignment", 
13235 function (alignment) {
13236 this.setAlignmentX (alignment);
13237 }, "~N");
13238 });
13239 Clazz_declarePackage ("awt2swing");
13240 Clazz_load (["javax.swing.JPopupMenu"], "awt2swing.PopupMenu", null, function () {
13241 c$ = Clazz_declareType (awt2swing, "PopupMenu", javax.swing.JPopupMenu);
13242 });
13243 Clazz_declarePackage ("jalview.util");
13244 Clazz_load (null, "jalview.util.Platform", ["java.lang.StringBuffer"], function () {
13245 c$ = Clazz_declareType (jalview.util, "Platform");
13246 c$.isAMac = Clazz_defineMethod (c$, "isAMac", 
13247 function () {
13248 return java.lang.System.getProperty ("os.name").indexOf ("Mac") > -1;
13249 });
13250 c$.isHeadless = Clazz_defineMethod (c$, "isHeadless", 
13251 function () {
13252 var hdls = java.lang.System.getProperty ("java.awt.headless");
13253 return hdls != null && hdls.equals ("true");
13254 });
13255 c$.getMaxCommandLineLength = Clazz_defineMethod (c$, "getMaxCommandLineLength", 
13256 function () {
13257 return 2046;
13258 });
13259 c$.escapeString = Clazz_defineMethod (c$, "escapeString", 
13260 function (file) {
13261 var f =  new StringBuffer ();
13262 var p = 0;
13263 var lastp = 0;
13264 while ((p = file.indexOf ('\\', lastp)) > -1) {
13265 f.append (file.subSequence (lastp, p));
13266 f.append ("\\\\");
13267 lastp = p + 1;
13268 }
13269 f.append (file.substring (lastp));
13270 return f.toString ();
13271 }, "~S");
13272 });
13273 Clazz_declarePackage ("awt2swing");
13274 Clazz_load (["javax.swing.JCheckBoxMenuItem"], "awt2swing.CheckboxMenuItem", null, function () {
13275 c$ = Clazz_declareType (awt2swing, "CheckboxMenuItem", javax.swing.JCheckBoxMenuItem);
13276 Clazz_makeConstructor (c$, 
13277 function () {
13278 Clazz_superConstructor (this, awt2swing.CheckboxMenuItem, []);
13279 });
13280 Clazz_overrideMethod (c$, "getState", 
13281 function () {
13282 return this.isSelected ();
13283 });
13284 Clazz_overrideMethod (c$, "setState", 
13285 function (tf) {
13286 this.setSelected (tf);
13287 }, "~B");
13288 });
13289 Clazz_declarePackage ("awt2swing");
13290 Clazz_load (["javax.swing.JMenu"], "awt2swing.Menu", null, function () {
13291 c$ = Clazz_declareType (awt2swing, "Menu", javax.swing.JMenu);
13292 Clazz_makeConstructor (c$, 
13293 function (title) {
13294 Clazz_superConstructor (this, awt2swing.Menu, [title]);
13295 title = null;
13296 }, "~S");
13297 Clazz_makeConstructor (c$, 
13298 function () {
13299 Clazz_superConstructor (this, awt2swing.Menu);
13300 var s = null;
13301 });
13302 });
13303 Clazz_declarePackage ("awt2swing");
13304 Clazz_load (["javax.swing.JMenuBar"], "awt2swing.MenuBar", null, function () {
13305 c$ = Clazz_declareType (awt2swing, "MenuBar", javax.swing.JMenuBar);
13306 });
13307 Clazz_declarePackage ("awt2swing");
13308 Clazz_load (["javax.swing.JMenuItem"], "awt2swing.MenuItem", null, function () {
13309 c$ = Clazz_declareType (awt2swing, "MenuItem", javax.swing.JMenuItem);
13310 });
13311 Clazz_declarePackage ("jalview.analysis");
13312 Clazz_load (null, "jalview.analysis.AlignmentSorter", ["jalview.datamodel.SequenceI", "jalview.util.Comparison", "$.MessageManager", "$.QuickSort", "java.lang.Error", "$.Float", "$.StringBuffer", "java.util.ArrayList"], function () {
13313 c$ = Clazz_declareType (jalview.analysis, "AlignmentSorter");
13314 c$.sortByPID = Clazz_defineMethod (c$, "sortByPID", 
13315 function (align, s, tosort) {
13316 jalview.analysis.AlignmentSorter.sortByPID (align, s, tosort, 0, -1);
13317 }, "jalview.datamodel.AlignmentI,jalview.datamodel.SequenceI,~A");
13318 c$.sortByPID = Clazz_defineMethod (c$, "sortByPID", 
13319 function (align, s, tosort, start, end) {
13320 var nSeq = align.getHeight ();
13321 var scores =  Clazz_newFloatArray (nSeq, 0);
13322 var seqs =  new Array (nSeq);
13323 for (var i = 0; i < nSeq; i++) {
13324 scores[i] = jalview.util.Comparison.PID (align.getSequenceAt (i).getSequenceAsString (), s.getSequenceAsString ());
13325 seqs[i] = align.getSequenceAt (i);
13326 }
13327 jalview.util.QuickSort.sortFloatObject (scores, seqs);
13328 jalview.analysis.AlignmentSorter.setReverseOrder (align, seqs);
13329 }, "jalview.datamodel.AlignmentI,jalview.datamodel.SequenceI,~A,~N,~N");
13330 c$.setReverseOrder = Clazz_defineMethod (c$, "setReverseOrder", 
13331  function (align, seqs) {
13332 var nSeq = seqs.length;
13333 var len = 0;
13334 if ((nSeq % 2) == 0) {
13335 len = Clazz_doubleToInt (nSeq / 2);
13336 } else {
13337 len = Clazz_doubleToInt ((nSeq + 1) / 2);
13338 }var asq;
13339 {
13340 for (var i = 0; i < len; i++) {
13341 asq.set (i, seqs[nSeq - i - 1]);
13342 asq.set (nSeq - i - 1, seqs[i]);
13343 }
13344 }}, "jalview.datamodel.AlignmentI,~A");
13345 c$.setOrder = Clazz_defineMethod (c$, "setOrder", 
13346  function (align, tmp) {
13347 jalview.analysis.AlignmentSorter.setOrder (align, jalview.analysis.AlignmentSorter.vectorSubsetToArray (tmp, align.getSequences ()));
13348 }, "jalview.datamodel.AlignmentI,java.util.List");
13349 c$.setOrder = Clazz_defineMethod (c$, "setOrder", 
13350 function (align, seqs) {
13351 var algn;
13352 {
13353 var tmp =  new java.util.ArrayList ();
13354 for (var i = 0; i < seqs.length; i++) {
13355 if (algn.contains (seqs[i])) {
13356 tmp.add (seqs[i]);
13357 }}
13358 algn.clear ();
13359 for (var i = 0; i < tmp.size (); i++) {
13360 algn.add (tmp.get (i));
13361 }
13362 }}, "jalview.datamodel.AlignmentI,~A");
13363 c$.sortByID = Clazz_defineMethod (c$, "sortByID", 
13364 function (align) {
13365 var nSeq = align.getHeight ();
13366 var ids =  new Array (nSeq);
13367 var seqs =  new Array (nSeq);
13368 for (var i = 0; i < nSeq; i++) {
13369 ids[i] = align.getSequenceAt (i).getName ();
13370 seqs[i] = align.getSequenceAt (i);
13371 }
13372 jalview.util.QuickSort.sort (ids, seqs);
13373 if (jalview.analysis.AlignmentSorter.sortIdAscending) {
13374 jalview.analysis.AlignmentSorter.setReverseOrder (align, seqs);
13375 } else {
13376 jalview.analysis.AlignmentSorter.setOrder (align, seqs);
13377 }jalview.analysis.AlignmentSorter.sortIdAscending = !jalview.analysis.AlignmentSorter.sortIdAscending;
13378 }, "jalview.datamodel.AlignmentI");
13379 c$.sortByLength = Clazz_defineMethod (c$, "sortByLength", 
13380 function (align) {
13381 var nSeq = align.getHeight ();
13382 var length =  Clazz_newFloatArray (nSeq, 0);
13383 var seqs =  new Array (nSeq);
13384 for (var i = 0; i < nSeq; i++) {
13385 seqs[i] = align.getSequenceAt (i);
13386 length[i] = (seqs[i].getEnd () - seqs[i].getStart ());
13387 }
13388 jalview.util.QuickSort.sortFloatObject (length, seqs);
13389 if (jalview.analysis.AlignmentSorter.sortLengthAscending) {
13390 jalview.analysis.AlignmentSorter.setReverseOrder (align, seqs);
13391 } else {
13392 jalview.analysis.AlignmentSorter.setOrder (align, seqs);
13393 }jalview.analysis.AlignmentSorter.sortLengthAscending = !jalview.analysis.AlignmentSorter.sortLengthAscending;
13394 }, "jalview.datamodel.AlignmentI");
13395 c$.sortByGroup = Clazz_defineMethod (c$, "sortByGroup", 
13396 function (align) {
13397 var groups =  new java.util.ArrayList ();
13398 if (groups.hashCode () != jalview.analysis.AlignmentSorter.lastGroupHash) {
13399 jalview.analysis.AlignmentSorter.sortGroupAscending = true;
13400 jalview.analysis.AlignmentSorter.lastGroupHash = groups.hashCode ();
13401 } else {
13402 jalview.analysis.AlignmentSorter.sortGroupAscending = !jalview.analysis.AlignmentSorter.sortGroupAscending;
13403 }for (var sg, $sg = align.getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
13404 for (var j = 0; j < groups.size (); j++) {
13405 var sg2 = groups.get (j);
13406 if (sg.getSize () > sg2.getSize ()) {
13407 groups.add (j, sg);
13408 break;
13409 }}
13410 if (!groups.contains (sg)) {
13411 groups.add (sg);
13412 }}
13413 var seqs =  new java.util.ArrayList ();
13414 for (var i = 0; i < groups.size (); i++) {
13415 var sg = groups.get (i);
13416 var orderedseqs = sg.getSequencesInOrder (align);
13417 for (var j = 0; j < orderedseqs.length; j++) {
13418 seqs.add (orderedseqs[j]);
13419 }
13420 }
13421 if (jalview.analysis.AlignmentSorter.sortGroupAscending) {
13422 jalview.analysis.AlignmentSorter.setOrder (align, seqs);
13423 } else {
13424 jalview.analysis.AlignmentSorter.setReverseOrder (align, jalview.analysis.AlignmentSorter.vectorSubsetToArray (seqs, align.getSequences ()));
13425 }}, "jalview.datamodel.AlignmentI");
13426 c$.vectorSubsetToArray = Clazz_defineMethod (c$, "vectorSubsetToArray", 
13427  function (tmp, mask) {
13428 var seqs =  new java.util.ArrayList ();
13429 var i;
13430 var idx;
13431 var tmask =  Clazz_newBooleanArray (mask.size (), false);
13432 for (i = 0; i < mask.size (); i++) {
13433 tmask[i] = true;
13434 }
13435 for (i = 0; i < tmp.size (); i++) {
13436 var sq = tmp.get (i);
13437 idx = mask.indexOf (sq);
13438 if (idx > -1 && tmask[idx]) {
13439 tmask[idx] = false;
13440 seqs.add (sq);
13441 }}
13442 for (i = 0; i < tmask.length; i++) {
13443 if (tmask[i]) {
13444 seqs.add (mask.get (i));
13445 }}
13446 return seqs.toArray ( new Array (seqs.size ()));
13447 }, "java.util.List,java.util.List");
13448 c$.sortBy = Clazz_defineMethod (c$, "sortBy", 
13449 function (align, order) {
13450 var tmp = order.getOrder ();
13451 if (jalview.analysis.AlignmentSorter.lastOrder === order) {
13452 jalview.analysis.AlignmentSorter.sortOrderAscending = !jalview.analysis.AlignmentSorter.sortOrderAscending;
13453 } else {
13454 jalview.analysis.AlignmentSorter.sortOrderAscending = true;
13455 }if (jalview.analysis.AlignmentSorter.sortOrderAscending) {
13456 jalview.analysis.AlignmentSorter.setOrder (align, tmp);
13457 } else {
13458 jalview.analysis.AlignmentSorter.setReverseOrder (align, jalview.analysis.AlignmentSorter.vectorSubsetToArray (tmp, align.getSequences ()));
13459 }}, "jalview.datamodel.AlignmentI,jalview.datamodel.AlignmentOrder");
13460 c$.getOrderByTree = Clazz_defineMethod (c$, "getOrderByTree", 
13461  function (align, tree) {
13462 var nSeq = align.getHeight ();
13463 var tmp =  new java.util.ArrayList ();
13464 tmp = jalview.analysis.AlignmentSorter._sortByTree (tree.getTopNode (), tmp, align.getSequences ());
13465 if (tmp.size () != nSeq) {
13466 if (tmp.size () != nSeq) {
13467 jalview.analysis.AlignmentSorter.addStrays (align, tmp);
13468 }if (tmp.size () != nSeq) {
13469 System.err.println ("WARNING: tmp.size()=" + tmp.size () + " != nseq=" + nSeq + " in getOrderByTree - tree contains sequences not in alignment");
13470 }}return tmp;
13471 }, "jalview.datamodel.AlignmentI,jalview.analysis.NJTree");
13472 c$.sortByTree = Clazz_defineMethod (c$, "sortByTree", 
13473 function (align, tree) {
13474 var tmp = jalview.analysis.AlignmentSorter.getOrderByTree (align, tree);
13475 if (jalview.analysis.AlignmentSorter.lastTree !== tree) {
13476 jalview.analysis.AlignmentSorter.sortTreeAscending = true;
13477 jalview.analysis.AlignmentSorter.lastTree = tree;
13478 } else {
13479 jalview.analysis.AlignmentSorter.sortTreeAscending = !jalview.analysis.AlignmentSorter.sortTreeAscending;
13480 }if (jalview.analysis.AlignmentSorter.sortTreeAscending) {
13481 jalview.analysis.AlignmentSorter.setOrder (align, tmp);
13482 } else {
13483 jalview.analysis.AlignmentSorter.setReverseOrder (align, jalview.analysis.AlignmentSorter.vectorSubsetToArray (tmp, align.getSequences ()));
13484 }}, "jalview.datamodel.AlignmentI,jalview.analysis.NJTree");
13485 c$.addStrays = Clazz_defineMethod (c$, "addStrays", 
13486  function (align, tmp) {
13487 var nSeq = align.getHeight ();
13488 for (var i = 0; i < nSeq; i++) {
13489 if (!tmp.contains (align.getSequenceAt (i))) {
13490 tmp.add (align.getSequenceAt (i));
13491 }}
13492 if (nSeq != tmp.size ()) {
13493 System.err.println ("ERROR: Size still not right even after addStrays");
13494 }}, "jalview.datamodel.AlignmentI,java.util.List");
13495 c$._sortByTree = Clazz_defineMethod (c$, "_sortByTree", 
13496  function (node, tmp, seqset) {
13497 if (node == null) {
13498 return tmp;
13499 }var left = node.left ();
13500 var right = node.right ();
13501 if ((left == null) && (right == null)) {
13502 if (!node.isPlaceholder () && (node.element () != null)) {
13503 if (Clazz_instanceOf (node.element (), jalview.datamodel.SequenceI)) {
13504 if (!tmp.contains (node.element ())) {
13505 tmp.add (node.element ());
13506 }}}return tmp;
13507 } else {
13508 jalview.analysis.AlignmentSorter._sortByTree (left, tmp, seqset);
13509 jalview.analysis.AlignmentSorter._sortByTree (right, tmp, seqset);
13510 }return tmp;
13511 }, "jalview.datamodel.SequenceNode,java.util.List,java.util.List");
13512 c$.recoverOrder = Clazz_defineMethod (c$, "recoverOrder", 
13513 function (alignment) {
13514 var ids =  Clazz_newFloatArray (alignment.length, 0);
13515 for (var i = 0; i < alignment.length; i++) {
13516 ids[i] = ( new Float (alignment[i].getName ().substring (8))).floatValue ();
13517 }
13518 jalview.util.QuickSort.sortFloatObject (ids, alignment);
13519 }, "~A");
13520 c$.sortByAnnotationScore = Clazz_defineMethod (c$, "sortByAnnotationScore", 
13521 function (scoreLabel, alignment) {
13522 var seqs = alignment.getSequencesArray ();
13523 var hasScore =  Clazz_newBooleanArray (seqs.length, false);
13524 var hasScores = 0;
13525 var scores =  Clazz_newDoubleArray (seqs.length, 0);
13526 var min = 0;
13527 var max = 0;
13528 for (var i = 0; i < seqs.length; i++) {
13529 var scoreAnn = seqs[i].getAnnotation (scoreLabel);
13530 if (scoreAnn != null) {
13531 hasScores++;
13532 hasScore[i] = true;
13533 scores[i] = scoreAnn[0].getScore ();
13534 if (hasScores == 1) {
13535 max = min = scores[i];
13536 } else {
13537 if (max < scores[i]) {
13538 max = scores[i];
13539 }if (min > scores[i]) {
13540 min = scores[i];
13541 }}} else {
13542 hasScore[i] = false;
13543 }}
13544 if (hasScores == 0) {
13545 return;
13546 }if (hasScores < seqs.length) {
13547 for (var i = 0; i < seqs.length; i++) {
13548 if (!hasScore[i]) {
13549 scores[i] = (max + i + 1.0);
13550 }}
13551 }jalview.util.QuickSort.sortDouble (scores, seqs);
13552 if (jalview.analysis.AlignmentSorter.lastSortByScore !== scoreLabel) {
13553 jalview.analysis.AlignmentSorter.lastSortByScore = scoreLabel;
13554 jalview.analysis.AlignmentSorter.setOrder (alignment, seqs);
13555 } else {
13556 jalview.analysis.AlignmentSorter.setReverseOrder (alignment, seqs);
13557 }}, "~S,jalview.datamodel.AlignmentI");
13558 c$.sortByFeature = Clazz_defineMethod (c$, "sortByFeature", 
13559 function (featureLabel, groupLabel, start, stop, alignment, method) {
13560 jalview.analysis.AlignmentSorter.sortByFeature (featureLabel == null ? null :  Clazz_newArray (-1, [featureLabel]), groupLabel == null ? null :  Clazz_newArray (-1, [groupLabel]), start, stop, alignment, method);
13561 }, "~S,~S,~N,~N,jalview.datamodel.AlignmentI,~S");
13562 c$.containsIgnoreCase = Clazz_defineMethod (c$, "containsIgnoreCase", 
13563  function (lab, labs) {
13564 if (labs == null) {
13565 return true;
13566 }if (lab == null) {
13567 return false;
13568 }for (var q = 0; q < labs.length; q++) {
13569 if (labs[q] != null && lab.equalsIgnoreCase (labs[q])) {
13570 return true;
13571 }}
13572 return false;
13573 }, "~S,~A");
13574 c$.sortByFeature = Clazz_defineMethod (c$, "sortByFeature", 
13575 function (featureLabels, groupLabels, start, stop, alignment, method) {
13576 if (method !== jalview.analysis.AlignmentSorter.FEATURE_SCORE && method !== jalview.analysis.AlignmentSorter.FEATURE_LABEL && method !== jalview.analysis.AlignmentSorter.FEATURE_DENSITY) {
13577 throw  new Error (jalview.util.MessageManager.getString ("error.implementation_error_sortbyfeature"));
13578 }var ignoreScore = method !== jalview.analysis.AlignmentSorter.FEATURE_SCORE;
13579 var scoreLabel =  new StringBuffer ();
13580 scoreLabel.append (start + stop + method);
13581 for (var i = 0; featureLabels != null && i < featureLabels.length; i++) {
13582 scoreLabel.append (featureLabels[i] == null ? "null" : featureLabels[i]);
13583 }
13584 for (var i = 0; groupLabels != null && i < groupLabels.length; i++) {
13585 scoreLabel.append (groupLabels[i] == null ? "null" : groupLabels[i]);
13586 }
13587 var seqs = alignment.getSequencesArray ();
13588 var hasScore =  Clazz_newBooleanArray (seqs.length, false);
13589 var hasScores = 0;
13590 var scores =  Clazz_newDoubleArray (seqs.length, 0);
13591 var seqScores =  Clazz_newIntArray (seqs.length, 0);
13592 var feats =  new Array (seqs.length);
13593 var min = 0;
13594 var max = 0;
13595 for (var i = 0; i < seqs.length; i++) {
13596 var sf = seqs[i].getSequenceFeatures ();
13597 if (sf == null) {
13598 sf =  new Array (0);
13599 } else {
13600 var tmp =  new Array (sf.length);
13601 for (var s = 0; s < tmp.length; s++) {
13602 tmp[s] = sf[s];
13603 }
13604 sf = tmp;
13605 }var sstart = (start == -1) ? start : seqs[i].findPosition (start);
13606 var sstop = (stop == -1) ? stop : seqs[i].findPosition (stop);
13607 seqScores[i] = 0;
13608 scores[i] = 0.0;
13609 var n = sf.length;
13610 for (var f = 0; f < sf.length; f++) {
13611 if ((sf[f].end < sstart || sf[f].begin > sstop) || (featureLabels != null && !jalview.analysis.AlignmentSorter.containsIgnoreCase (sf[f].type, featureLabels)) || (groupLabels != null && (sf[f].getFeatureGroup () != null && !jalview.analysis.AlignmentSorter.containsIgnoreCase (sf[f].getFeatureGroup (), groupLabels)))) {
13612 sf[f] = null;
13613 n--;
13614 } else {
13615 if (!ignoreScore && !Float.isNaN (sf[f].getScore ())) {
13616 if (seqScores[i] == 0) {
13617 hasScores++;
13618 }seqScores[i]++;
13619 hasScore[i] = true;
13620 scores[i] += sf[f].getScore ();
13621 }}}
13622 var fs;
13623 feats[i] = fs =  new Array (n);
13624 if (n > 0) {
13625 n = 0;
13626 for (var f = 0; f < sf.length; f++) {
13627 if (sf[f] != null) {
13628 (feats[i])[n++] = sf[f];
13629 }}
13630 if (method === jalview.analysis.AlignmentSorter.FEATURE_LABEL) {
13631 var labs =  new Array (fs.length);
13632 for (var l = 0; l < labs.length; l++) {
13633 labs[l] = (fs[l].getDescription () != null ? fs[l].getDescription () : fs[l].getType ());
13634 }
13635 jalview.util.QuickSort.sort (labs, (feats[i]));
13636 }}if (hasScore[i]) {
13637 scores[i] /= seqScores[i];
13638 if (hasScores == 1) {
13639 max = min = scores[i];
13640 } else {
13641 if (max < scores[i]) {
13642 max = scores[i];
13643 }if (min > scores[i]) {
13644 min = scores[i];
13645 }}}}
13646 if (method === jalview.analysis.AlignmentSorter.FEATURE_SCORE) {
13647 if (hasScores == 0) {
13648 return;
13649 }if (hasScores < seqs.length) {
13650 for (var i = 0; i < seqs.length; i++) {
13651 if (!hasScore[i]) {
13652 scores[i] = (max + 1 + i);
13653 } else {
13654 var nf = (feats[i] == null) ? 0 : (feats[i]).length;
13655 }}
13656 }jalview.util.QuickSort.sortDouble (scores, seqs);
13657 } else if (method === jalview.analysis.AlignmentSorter.FEATURE_DENSITY) {
13658 var fr = 0.9 / (1.0 * seqs.length);
13659 for (var i = 0; i < seqs.length; i++) {
13660 var nf;
13661 scores[i] = (0.05 + fr * i) + (nf = ((feats[i] == null) ? 0.0 : 1.0 * (feats[i]).length));
13662 }
13663 jalview.util.QuickSort.sortDouble (scores, seqs);
13664 } else {
13665 if (method === jalview.analysis.AlignmentSorter.FEATURE_LABEL) {
13666 throw  new Error (jalview.util.MessageManager.getString ("error.not_yet_implemented"));
13667 }}if (jalview.analysis.AlignmentSorter.lastSortByFeatureScore == null || !scoreLabel.toString ().equals (jalview.analysis.AlignmentSorter.lastSortByFeatureScore)) {
13668 jalview.analysis.AlignmentSorter.sortByFeatureScoreAscending = true;
13669 } else {
13670 jalview.analysis.AlignmentSorter.sortByFeatureScoreAscending = !jalview.analysis.AlignmentSorter.sortByFeatureScoreAscending;
13671 }if (jalview.analysis.AlignmentSorter.sortByFeatureScoreAscending) {
13672 jalview.analysis.AlignmentSorter.setOrder (alignment, seqs);
13673 } else {
13674 jalview.analysis.AlignmentSorter.setReverseOrder (alignment, seqs);
13675 }jalview.analysis.AlignmentSorter.lastSortByFeatureScore = scoreLabel.toString ();
13676 }, "~A,~A,~N,~N,jalview.datamodel.AlignmentI,~S");
13677 Clazz_defineStatics (c$,
13678 "sortIdAscending", true,
13679 "lastGroupHash", 0,
13680 "sortGroupAscending", true,
13681 "lastOrder", null,
13682 "sortOrderAscending", true,
13683 "lastTree", null,
13684 "sortTreeAscending", true,
13685 "lastSortByScore", null,
13686 "sortByScoreAscending", true,
13687 "lastSortByFeatureScore", null,
13688 "sortByFeatureScoreAscending", true,
13689 "sortLengthAscending", false,
13690 "FEATURE_SCORE", "average_score",
13691 "FEATURE_LABEL", "text",
13692 "FEATURE_DENSITY", "density");
13693 });
13694 Clazz_declarePackage ("jalview.datamodel");
13695 Clazz_load (["jalview.datamodel.ASequenceI"], "jalview.datamodel.SequenceI", null, function () {
13696 Clazz_declareInterface (jalview.datamodel, "SequenceI", jalview.datamodel.ASequenceI);
13697 });
13698 Clazz_declarePackage ("jalview.datamodel");
13699 Clazz_declareInterface (jalview.datamodel, "ASequenceI");
13700 Clazz_declarePackage ("jalview.util");
13701 Clazz_load (null, "jalview.util.Comparison", ["java.util.ArrayList"], function () {
13702 c$ = Clazz_declareType (jalview.util, "Comparison");
13703 c$.compare = Clazz_defineMethod (c$, "compare", 
13704 function (ii, jj) {
13705 return jalview.util.Comparison.compare (ii, jj, 0, ii.getLength () - 1);
13706 }, "jalview.datamodel.SequenceI,jalview.datamodel.SequenceI");
13707 c$.compare = Clazz_defineMethod (c$, "compare", 
13708 function (ii, jj, start, end) {
13709 var si = ii.getSequenceAsString ();
13710 var sj = jj.getSequenceAsString ();
13711 var ilen = si.length - 1;
13712 var jlen = sj.length - 1;
13713 while (jalview.util.Comparison.isGap (si.charAt (start + ilen))) {
13714 ilen--;
13715 }
13716 while (jalview.util.Comparison.isGap (sj.charAt (start + jlen))) {
13717 jlen--;
13718 }
13719 var count = 0;
13720 var match = 0;
13721 var pid = -1;
13722 if (ilen > jlen) {
13723 for (var j = 0; j < jlen; j++) {
13724 if (si.substring (start + j, start + j + 1).equals (sj.substring (start + j, start + j + 1))) {
13725 match++;
13726 }count++;
13727 }
13728 pid = match / ilen * 100;
13729 } else {
13730 for (var j = 0; j < jlen; j++) {
13731 if (si.substring (start + j, start + j + 1).equals (sj.substring (start + j, start + j + 1))) {
13732 match++;
13733 }count++;
13734 }
13735 pid = match / jlen * 100;
13736 }return pid;
13737 }, "jalview.datamodel.SequenceI,jalview.datamodel.SequenceI,~N,~N");
13738 c$.PID = Clazz_defineMethod (c$, "PID", 
13739 function (seq1, seq2) {
13740 return jalview.util.Comparison.PID (seq1, seq2, 0, seq1.length);
13741 }, "~S,~S");
13742 c$.PID = Clazz_defineMethod (c$, "PID", 
13743 function (seq1, seq2, start, end) {
13744 return jalview.util.Comparison.PID (seq1, seq2, start, end, true, false);
13745 }, "~S,~S,~N,~N");
13746 c$.PID = Clazz_defineMethod (c$, "PID", 
13747 function (seq1, seq2, start, end, wcGaps, ungappedOnly) {
13748 var s1len = seq1.length;
13749 var s2len = seq2.length;
13750 var len = Math.min (s1len, s2len);
13751 if (end < len) {
13752 len = end;
13753 }if (len < start) {
13754 start = len - 1;
13755 }var elen = len - start;
13756 var bad = 0;
13757 var chr1;
13758 var chr2;
13759 var agap;
13760 for (var i = start; i < len; i++) {
13761 chr1 = seq1.charAt (i);
13762 chr2 = seq2.charAt (i);
13763 agap = jalview.util.Comparison.isGap (chr1) || jalview.util.Comparison.isGap (chr2);
13764 if ('a' <= chr1 && chr1 <= 'z') {
13765 chr1 = String.fromCharCode (chr1.charCodeAt (0) - 32);
13766 }if ('a' <= chr2 && chr2 <= 'z') {
13767 chr2 = String.fromCharCode (chr2.charCodeAt (0) - 32);
13768 }if (chr1 != chr2) {
13769 if (agap) {
13770 if (ungappedOnly) {
13771 elen--;
13772 } else if (!wcGaps) {
13773 bad++;
13774 }} else {
13775 bad++;
13776 }}}
13777 if (elen < 1) {
13778 return 0;
13779 }return (100 * (elen - bad)) / elen;
13780 }, "~S,~S,~N,~N,~B,~B");
13781 c$.isGap = Clazz_defineMethod (c$, "isGap", 
13782 function (c) {
13783 return (c == '-' || c == '.' || c == ' ') ? true : false;
13784 }, "~S");
13785 c$.isNucleotide = Clazz_defineMethod (c$, "isNucleotide", 
13786 function (seqs) {
13787 if (seqs == null) {
13788 return false;
13789 }var ntCount = 0;
13790 var aaCount = 0;
13791 for (var seq, $seq = 0, $$seq = seqs; $seq < $$seq.length && ((seq = $$seq[$seq]) || true); $seq++) {
13792 if (seq == null) {
13793 continue;
13794 }for (var c, $c = 0, $$c = seq.getSequence (); $c < $$c.length && ((c = $$c[$c]) || true); $c++) {
13795 if ('a' <= c && c <= 'z') {
13796 c = String.fromCharCode (c.charCodeAt (0) - 32);
13797 }if (c == 'A' || c == 'G' || c == 'C' || c == 'T' || c == 'U') {
13798 ntCount++;
13799 } else if (!jalview.util.Comparison.isGap (c)) {
13800 aaCount++;
13801 }}
13802 }
13803 if (ntCount * 100 > 85 * (ntCount + aaCount)) {
13804 return true;
13805 } else {
13806 return false;
13807 }}, "~A");
13808 c$.isNucleotide2 = Clazz_defineMethod (c$, "isNucleotide2", 
13809 function (seqs) {
13810 if (seqs == null) {
13811 return false;
13812 }var flattened =  new java.util.ArrayList ();
13813 for (var ss, $ss = 0, $$ss = seqs; $ss < $$ss.length && ((ss = $$ss[$ss]) || true); $ss++) {
13814 for (var s, $s = 0, $$s = ss; $s < $$s.length && ((s = $$s[$s]) || true); $s++) {
13815 flattened.add (s);
13816 }
13817 }
13818 var oneDArray = flattened.toArray ( new Array (flattened.size ()));
13819 return jalview.util.Comparison.isNucleotide (oneDArray);
13820 }, "~A");
13821 Clazz_defineStatics (c$,
13822 "EIGHTY_FIVE", 85,
13823 "TO_UPPER_CASE", 32,
13824 "GAP_SPACE", ' ',
13825 "GAP_DOT", '.',
13826 "GAP_DASH", '-');
13827 c$.GapChars = c$.prototype.GapChars =  String.instantialize ( Clazz_newCharArray (-1, [' ', '.', '-']));
13828 Clazz_defineStatics (c$,
13829 "caseShift", 32);
13830 });
13831 Clazz_declarePackage ("jalview.util");
13832 Clazz_load (null, "jalview.util.QuickSort", ["java.lang.Float", "java.util.Arrays"], function () {
13833 c$ = Clazz_declareType (jalview.util, "QuickSort");
13834 c$.sortInt = Clazz_defineMethod (c$, "sortInt", 
13835 function (arr, s) {
13836 jalview.util.QuickSort.sortInt (arr, 0, arr.length - 1, s);
13837 }, "~A,~A");
13838 c$.sortFloatObject = Clazz_defineMethod (c$, "sortFloatObject", 
13839 function (arr, s) {
13840 jalview.util.QuickSort.sortFloat (arr, 0, arr.length - 1, s);
13841 }, "~A,~A");
13842 c$.sortDouble = Clazz_defineMethod (c$, "sortDouble", 
13843 function (arr, s) {
13844 jalview.util.QuickSort.sortDouble (arr, 0, arr.length - 1, s);
13845 }, "~A,~A");
13846 c$.sort = Clazz_defineMethod (c$, "sort", 
13847 function (arr, s) {
13848 jalview.util.QuickSort.stringSort (arr, 0, arr.length - 1, s);
13849 }, "~A,~A");
13850 c$.stringSort = Clazz_defineMethod (c$, "stringSort", 
13851  function (arr, p, r, s) {
13852 var q;
13853 if (p < r) {
13854 q = jalview.util.QuickSort.stringPartition (arr, p, r, s);
13855 jalview.util.QuickSort.stringSort (arr, p, q, s);
13856 jalview.util.QuickSort.stringSort (arr, q + 1, r, s);
13857 }}, "~A,~N,~N,~A");
13858 c$.sortFloat = Clazz_defineMethod (c$, "sortFloat", 
13859  function (arr, p, r, s) {
13860 var q;
13861 if (p < r) {
13862 q = jalview.util.QuickSort.partitionFloat (arr, p, r, s);
13863 jalview.util.QuickSort.sortFloat (arr, p, q, s);
13864 jalview.util.QuickSort.sortFloat (arr, q + 1, r, s);
13865 }}, "~A,~N,~N,~A");
13866 c$.sortInt = Clazz_defineMethod (c$, "sortInt", 
13867  function (arr, p, r, s) {
13868 var q;
13869 if (p < r) {
13870 q = jalview.util.QuickSort.partitionInt (arr, p, r, s);
13871 jalview.util.QuickSort.sortInt (arr, p, q, s);
13872 jalview.util.QuickSort.sortInt (arr, q + 1, r, s);
13873 }}, "~A,~N,~N,~A");
13874 c$.partitionFloat = Clazz_defineMethod (c$, "partitionFloat", 
13875  function (arr, p, r, s) {
13876 var x = arr[p];
13877 var i = p - 1;
13878 var j = r + 1;
13879 while (true) {
13880 do {
13881 j = j - 1;
13882 } while (arr[j] > x);
13883 do {
13884 i = i + 1;
13885 } while (arr[i] < x);
13886 if (i < j) {
13887 var tmp = arr[i];
13888 arr[i] = arr[j];
13889 arr[j] = tmp;
13890 var tmp2 = s[i];
13891 s[i] = s[j];
13892 s[j] = tmp2;
13893 } else {
13894 return j;
13895 }}
13896 }, "~A,~N,~N,~A");
13897 c$.partitionInt = Clazz_defineMethod (c$, "partitionInt", 
13898  function (arr, p, r, s) {
13899 var x = arr[p];
13900 var i = p - 1;
13901 var j = r + 1;
13902 while (true) {
13903 do {
13904 j = j - 1;
13905 } while (arr[j] > x);
13906 do {
13907 i = i + 1;
13908 } while (arr[i] < x);
13909 if (i < j) {
13910 var tmp = arr[i];
13911 arr[i] = arr[j];
13912 arr[j] = tmp;
13913 var tmp2 = s[i];
13914 s[i] = s[j];
13915 s[j] = tmp2;
13916 } else {
13917 return j;
13918 }}
13919 }, "~A,~N,~N,~A");
13920 c$.stringPartition = Clazz_defineMethod (c$, "stringPartition", 
13921  function (arr, p, r, s) {
13922 var x = arr[p];
13923 var i = p - 1;
13924 var j = r + 1;
13925 while (true) {
13926 do {
13927 j = j - 1;
13928 } while (arr[j].compareTo (x) < 0);
13929 do {
13930 i = i + 1;
13931 } while (arr[i].compareTo (x) > 0);
13932 if (i < j) {
13933 var tmp = arr[i];
13934 arr[i] = arr[j];
13935 arr[j] = tmp;
13936 var tmp2 = s[i];
13937 s[i] = s[j];
13938 s[j] = tmp2;
13939 } else {
13940 return j;
13941 }}
13942 }, "~A,~N,~N,~A");
13943 c$.sortFloatChar = Clazz_defineMethod (c$, "sortFloatChar", 
13944 function (arr, s) {
13945 var f1 =  Clazz_newFloatArray (arr.length, 0);
13946 var s1 =  Clazz_newCharArray (s.length, '\0');
13947 var nextZeroValue = 0;
13948 var nextNonZeroValue = arr.length - 1;
13949 for (var i = 0; i < arr.length; i++) {
13950 var val = arr[i];
13951 if (val > 0) {
13952 f1[nextNonZeroValue] = val;
13953 s1[nextNonZeroValue] = s[i];
13954 nextNonZeroValue--;
13955 } else {
13956 f1[nextZeroValue] = val;
13957 s1[nextZeroValue] = s[i];
13958 nextZeroValue++;
13959 }}
13960 System.arraycopy (f1, 0, arr, 0, nextZeroValue);
13961 System.arraycopy (s1, 0, s, 0, nextZeroValue);
13962 if (nextZeroValue == arr.length) {
13963 return;
13964 }var nonZeroFloats = java.util.Arrays.copyOfRange (f1, nextZeroValue, f1.length);
13965 var nonZeroChars = java.util.Arrays.copyOfRange (s1, nextZeroValue, s1.length);
13966 jalview.util.QuickSort.externalSortFloat (nonZeroFloats, nonZeroChars);
13967 System.arraycopy (nonZeroFloats, 0, arr, nextZeroValue, nonZeroFloats.length);
13968 System.arraycopy (nonZeroChars, 0, s, nextZeroValue, nonZeroChars.length);
13969 }, "~A,~A");
13970 c$.externalSortFloat = Clazz_defineMethod (c$, "externalSortFloat", 
13971  function (arr, s) {
13972 var length = arr.length;
13973 var indices = jalview.util.QuickSort.makeIndexArray (length);
13974 java.util.Arrays.sort (indices,  new jalview.util.QuickSort.FloatComparator (arr));
13975 var sortedFloats =  Clazz_newFloatArray (length, 0);
13976 var sortedChars =  Clazz_newCharArray (s.length, '\0');
13977 for (var i = 0; i < length; i++) {
13978 sortedFloats[i] = arr[indices[i]];
13979 sortedChars[i] = s[indices[i]];
13980 }
13981 System.arraycopy (sortedFloats, 0, arr, 0, length);
13982 System.arraycopy (sortedChars, 0, s, 0, s.length);
13983 }, "~A,~A");
13984 c$.makeIndexArray = Clazz_defineMethod (c$, "makeIndexArray", 
13985  function (length) {
13986 var indices =  new Array (length);
13987 for (var i = 0; i < length; i++) {
13988 indices[i] = new Integer (i);
13989 }
13990 return indices;
13991 }, "~N");
13992 c$.sortIntChar = Clazz_defineMethod (c$, "sortIntChar", 
13993 function (arr, s) {
13994 var f1 =  Clazz_newIntArray (arr.length, 0);
13995 var s1 =  Clazz_newCharArray (s.length, '\0');
13996 var nextZeroValue = 0;
13997 var nextNonZeroValue = arr.length - 1;
13998 for (var i = 0; i < arr.length; i++) {
13999 var val = arr[i];
14000 if (val > 0) {
14001 f1[nextNonZeroValue] = val;
14002 s1[nextNonZeroValue] = s[i];
14003 nextNonZeroValue--;
14004 } else {
14005 f1[nextZeroValue] = val;
14006 s1[nextZeroValue] = s[i];
14007 nextZeroValue++;
14008 }}
14009 System.arraycopy (f1, 0, arr, 0, nextZeroValue);
14010 System.arraycopy (s1, 0, s, 0, nextZeroValue);
14011 if (nextZeroValue == arr.length) {
14012 return;
14013 }var nonZeroInts = java.util.Arrays.copyOfRange (f1, nextZeroValue, f1.length);
14014 var nonZeroChars = java.util.Arrays.copyOfRange (s1, nextZeroValue, s1.length);
14015 jalview.util.QuickSort.externalSortInt (nonZeroInts, nonZeroChars);
14016 System.arraycopy (nonZeroInts, 0, arr, nextZeroValue, nonZeroInts.length);
14017 System.arraycopy (nonZeroChars, 0, s, nextZeroValue, nonZeroChars.length);
14018 }, "~A,~A");
14019 c$.externalSortInt = Clazz_defineMethod (c$, "externalSortInt", 
14020  function (arr, s) {
14021 var length = arr.length;
14022 var indices = jalview.util.QuickSort.makeIndexArray (length);
14023 java.util.Arrays.sort (indices,  new jalview.util.QuickSort.IntComparator (arr));
14024 var sortedInts =  Clazz_newIntArray (length, 0);
14025 var sortedChars =  Clazz_newCharArray (s.length, '\0');
14026 for (var i = 0; i < length; i++) {
14027 sortedInts[i] = arr[indices[i]];
14028 sortedChars[i] = s[indices[i]];
14029 }
14030 System.arraycopy (sortedInts, 0, arr, 0, length);
14031 System.arraycopy (sortedChars, 0, s, 0, s.length);
14032 }, "~A,~A");
14033 Clazz_pu$h(self.c$);
14034 c$ = Clazz_decorateAsClass (function () {
14035 this.values = null;
14036 Clazz_instantialize (this, arguments);
14037 }, jalview.util.QuickSort, "FloatComparator", null, java.util.Comparator);
14038 Clazz_makeConstructor (c$, 
14039 function (a) {
14040 this.values = a;
14041 }, "~A");
14042 Clazz_overrideMethod (c$, "compare", 
14043 function (a, b) {
14044 return Float.compare (this.values[a.intValue ()], this.values[b]);
14045 }, "Integer,Integer");
14046 c$ = Clazz_p0p ();
14047 Clazz_pu$h(self.c$);
14048 c$ = Clazz_decorateAsClass (function () {
14049 this.values = null;
14050 Clazz_instantialize (this, arguments);
14051 }, jalview.util.QuickSort, "IntComparator", null, java.util.Comparator);
14052 Clazz_makeConstructor (c$, 
14053 function (a) {
14054 this.values = a;
14055 }, "~A");
14056 Clazz_overrideMethod (c$, "compare", 
14057 function (a, b) {
14058 return Integer.compare (this.values[a], this.values[b]);
14059 }, "Integer,Integer");
14060 c$ = Clazz_p0p ();
14061 });
14062 Clazz_declarePackage ("jalview.analysis");
14063 Clazz_load (["java.lang.Enum", "java.util.HashMap"], "jalview.analysis.AnnotationSorter", ["jalview.analysis.AlignmentUtils", "java.lang.UnsupportedOperationException", "java.util.Arrays"], function () {
14064 c$ = Clazz_decorateAsClass (function () {
14065 this.alignment = null;
14066 this.showAutocalcAbove = false;
14067 this.sequenceIndices = null;
14068 this.bySequenceAndLabel = null;
14069 this.byLabelAndSequence = null;
14070 this.noSort = null;
14071 Clazz_instantialize (this, arguments);
14072 }, jalview.analysis, "AnnotationSorter");
14073 Clazz_prepareFields (c$, function () {
14074 this.sequenceIndices =  new java.util.HashMap ();
14075 this.bySequenceAndLabel = ((Clazz_isClassDefined ("jalview.analysis.AnnotationSorter$1") ? 0 : jalview.analysis.AnnotationSorter.$AnnotationSorter$1$ ()), Clazz_innerTypeInstance (jalview.analysis.AnnotationSorter$1, this, null));
14076 this.byLabelAndSequence = ((Clazz_isClassDefined ("jalview.analysis.AnnotationSorter$2") ? 0 : jalview.analysis.AnnotationSorter.$AnnotationSorter$2$ ()), Clazz_innerTypeInstance (jalview.analysis.AnnotationSorter$2, this, null));
14077 this.noSort = ((Clazz_isClassDefined ("jalview.analysis.AnnotationSorter$3") ? 0 : jalview.analysis.AnnotationSorter.$AnnotationSorter$3$ ()), Clazz_innerTypeInstance (jalview.analysis.AnnotationSorter$3, this, null));
14078 });
14079 Clazz_makeConstructor (c$, 
14080 function (alignmentI, showAutocalculatedAbove) {
14081 this.alignment = alignmentI;
14082 this.showAutocalcAbove = showAutocalculatedAbove;
14083 }, "jalview.datamodel.AlignmentI,~B");
14084 Clazz_defineMethod (c$, "sort", 
14085 function (alignmentAnnotations, order) {
14086 if (alignmentAnnotations == null) {
14087 return;
14088 }this.saveSequenceIndices (alignmentAnnotations);
14089 var comparator = this.getComparator (order);
14090 if (alignmentAnnotations != null) {
14091 {
14092 java.util.Arrays.sort (alignmentAnnotations, comparator);
14093 }}}, "~A,jalview.analysis.AnnotationSorter.SequenceAnnotationOrder");
14094 Clazz_defineMethod (c$, "saveSequenceIndices", 
14095  function (alignmentAnnotations) {
14096 this.sequenceIndices.clear ();
14097 for (var ann, $ann = 0, $$ann = alignmentAnnotations; $ann < $$ann.length && ((ann = $$ann[$ann]) || true); $ann++) {
14098 var seq = ann.sequenceRef;
14099 if (seq != null) {
14100 var index = jalview.analysis.AlignmentUtils.getSequenceIndex (this.alignment, seq);
14101 this.sequenceIndices.put (seq, new Integer (index));
14102 }}
14103 }, "~A");
14104 Clazz_defineMethod (c$, "getComparator", 
14105  function (order) {
14106 if (order == null) {
14107 return this.noSort;
14108 }switch (order) {
14109 case jalview.analysis.AnnotationSorter.SequenceAnnotationOrder.NONE:
14110 return this.noSort;
14111 case jalview.analysis.AnnotationSorter.SequenceAnnotationOrder.SEQUENCE_AND_LABEL:
14112 return this.bySequenceAndLabel;
14113 case jalview.analysis.AnnotationSorter.SequenceAnnotationOrder.LABEL_AND_SEQUENCE:
14114 return this.byLabelAndSequence;
14115 default:
14116 throw  new UnsupportedOperationException (order.toString ());
14117 }
14118 }, "jalview.analysis.AnnotationSorter.SequenceAnnotationOrder");
14119 Clazz_defineMethod (c$, "compareLabels", 
14120  function (o1, o2) {
14121 if (o1 == null || o2 == null) {
14122 return 0;
14123 }var label1 = o1.label;
14124 var label2 = o2.label;
14125 if (label1 == null && label2 == null) {
14126 return 0;
14127 }if (label1 == null) {
14128 return -1;
14129 }if (label2 == null) {
14130 return 1;
14131 }return label1.toUpperCase ().compareTo (label2.toUpperCase ());
14132 }, "jalview.datamodel.AlignmentAnnotation,jalview.datamodel.AlignmentAnnotation");
14133 Clazz_defineMethod (c$, "compareSequences", 
14134  function (o1, o2) {
14135 var seq1 = o1.sequenceRef;
14136 var seq2 = o2.sequenceRef;
14137 if (seq1 == null && seq2 == null) {
14138 return 0;
14139 }if (seq1 == null) {
14140 return this.showAutocalcAbove ? -1 : 1;
14141 }if (seq2 == null) {
14142 return this.showAutocalcAbove ? 1 : -1;
14143 }var index1 = (this.sequenceIndices.get (seq1)).intValue ();
14144 var index2 = (this.sequenceIndices.get (seq2)).intValue ();
14145 if (index1 == index2) {
14146 return 0;
14147 }if (index1 == -1) {
14148 return -1;
14149 }if (index2 == -1) {
14150 return 1;
14151 }return Integer.compare (index1, index2);
14152 }, "jalview.datamodel.AlignmentAnnotation,jalview.datamodel.AlignmentAnnotation");
14153 c$.$AnnotationSorter$1$ = function () {
14154 Clazz_pu$h(self.c$);
14155 c$ = Clazz_declareAnonymous (jalview.analysis, "AnnotationSorter$1", null, java.util.Comparator);
14156 Clazz_overrideMethod (c$, "compare", 
14157 function (o1, o2) {
14158 if (o1 == null && o2 == null) {
14159 return 0;
14160 }if (o1 == null) {
14161 return -1;
14162 }if (o2 == null) {
14163 return 1;
14164 }if (o1.sequenceRef == null && o2.sequenceRef == null) {
14165 return 0;
14166 }var sequenceOrder = this.b$["jalview.analysis.AnnotationSorter"].compareSequences (o1, o2);
14167 return sequenceOrder == 0 ? this.b$["jalview.analysis.AnnotationSorter"].compareLabels (o1, o2) : sequenceOrder;
14168 }, "jalview.datamodel.AlignmentAnnotation,jalview.datamodel.AlignmentAnnotation");
14169 c$ = Clazz_p0p ();
14170 };
14171 c$.$AnnotationSorter$2$ = function () {
14172 Clazz_pu$h(self.c$);
14173 c$ = Clazz_declareAnonymous (jalview.analysis, "AnnotationSorter$2", null, java.util.Comparator);
14174 Clazz_overrideMethod (c$, "compare", 
14175 function (o1, o2) {
14176 if (o1 == null && o2 == null) {
14177 return 0;
14178 }if (o1 == null) {
14179 return -1;
14180 }if (o2 == null) {
14181 return 1;
14182 }if (o1.sequenceRef == null && o2.sequenceRef == null) {
14183 return 0;
14184 }if (o1.sequenceRef == null) {
14185 return this.b$["jalview.analysis.AnnotationSorter"].showAutocalcAbove ? -1 : 1;
14186 }if (o2.sequenceRef == null) {
14187 return this.b$["jalview.analysis.AnnotationSorter"].showAutocalcAbove ? 1 : -1;
14188 }var labelOrder = this.b$["jalview.analysis.AnnotationSorter"].compareLabels (o1, o2);
14189 return labelOrder == 0 ? this.b$["jalview.analysis.AnnotationSorter"].compareSequences (o1, o2) : labelOrder;
14190 }, "jalview.datamodel.AlignmentAnnotation,jalview.datamodel.AlignmentAnnotation");
14191 c$ = Clazz_p0p ();
14192 };
14193 c$.$AnnotationSorter$3$ = function () {
14194 Clazz_pu$h(self.c$);
14195 c$ = Clazz_declareAnonymous (jalview.analysis, "AnnotationSorter$3", null, java.util.Comparator);
14196 Clazz_overrideMethod (c$, "compare", 
14197 function (o1, o2) {
14198 if (o1 != null && o2 != null) {
14199 if (o1.sequenceRef == null && o2.sequenceRef != null) {
14200 return this.b$["jalview.analysis.AnnotationSorter"].showAutocalcAbove ? -1 : 1;
14201 }if (o1.sequenceRef != null && o2.sequenceRef == null) {
14202 return this.b$["jalview.analysis.AnnotationSorter"].showAutocalcAbove ? 1 : -1;
14203 }}return 0;
14204 }, "jalview.datamodel.AlignmentAnnotation,jalview.datamodel.AlignmentAnnotation");
14205 c$ = Clazz_p0p ();
14206 };
14207 Clazz_pu$h(self.c$);
14208 c$ = Clazz_decorateAsClass (function () {
14209 this.description = null;
14210 Clazz_instantialize (this, arguments);
14211 }, jalview.analysis.AnnotationSorter, "SequenceAnnotationOrder", Enum);
14212 Clazz_makeConstructor (c$, 
14213  function (a) {
14214 this.description = a;
14215 }, "~S");
14216 Clazz_overrideMethod (c$, "toString", 
14217 function () {
14218 return this.description;
14219 });
14220 c$.forDescription = Clazz_defineMethod (c$, "forDescription", 
14221 function (a) {
14222 for (var order, $order = 0, $$order = jalview.analysis.AnnotationSorter.SequenceAnnotationOrder.values (); $order < $$order.length && ((order = $$order[$order]) || true); $order++) {
14223 if (order.toString ().equals (a)) {
14224 return order;
14225 }}
14226 return null;
14227 }, "~S");
14228 Clazz_defineEnumConstant (c$, "SEQUENCE_AND_LABEL", 0, ["Sequence"]);
14229 Clazz_defineEnumConstant (c$, "LABEL_AND_SEQUENCE", 1, ["Label"]);
14230 Clazz_defineEnumConstant (c$, "NONE", 2, ["No sort"]);
14231 c$ = Clazz_p0p ();
14232 });
14233 Clazz_declarePackage ("jalview.analysis");
14234 Clazz_load (null, "jalview.analysis.AlignmentUtils", ["jalview.analysis.CodonComparator", "jalview.datamodel.AlignedCodonFrame", "$.Alignment", "$.AlignmentAnnotation", "$.DBRefEntry", "$.DBRefSource", "$.FeatureProperties", "$.SearchResults", "$.Sequence", "jalview.schemes.ResidueProperties", "jalview.util.DBRefUtils", "$.MapList", "$.MappingUtils", "java.lang.StringBuilder", "java.util.ArrayList", "$.Arrays", "$.HashMap", "$.HashSet", "$.LinkedHashMap", "$.LinkedHashSet", "$.TreeMap"], function () {
14235 c$ = Clazz_declareType (jalview.analysis, "AlignmentUtils");
14236 c$.expandContext = Clazz_defineMethod (c$, "expandContext", 
14237 function (core, flankSize) {
14238 var sq =  new java.util.ArrayList ();
14239 var maxoffset = 0;
14240 for (var s, $s = core.getSequences ().iterator (); $s.hasNext () && ((s = $s.next ()) || true);) {
14241 var newSeq = s.deriveSequence ();
14242 var newSeqStart = newSeq.getStart () - 1;
14243 if (newSeqStart > maxoffset && newSeq.getDatasetSequence ().getStart () < s.getStart ()) {
14244 maxoffset = newSeqStart;
14245 }sq.add (newSeq);
14246 }
14247 if (flankSize > -1) {
14248 maxoffset = Math.min (maxoffset, flankSize);
14249 }for (var s, $s = sq.iterator (); $s.hasNext () && ((s = $s.next ()) || true);) {
14250 var ds = s;
14251 while (ds.getDatasetSequence () != null) {
14252 ds = ds.getDatasetSequence ();
14253 }
14254 var s_end = s.findPosition (s.getStart () + s.getLength ());
14255 var ustream_ds = s.getStart () - ds.getStart ();
14256 var dstream_ds = ds.getEnd () - s_end;
14257 var offset = maxoffset - ustream_ds;
14258 if (flankSize >= 0) {
14259 if (flankSize < ustream_ds) {
14260 offset = maxoffset - flankSize;
14261 ustream_ds = flankSize;
14262 }if (flankSize <= dstream_ds) {
14263 dstream_ds = flankSize - 1;
14264 }}var upstream =  String.instantialize (ds.getSequence (s.getStart () - 1 - ustream_ds, s.getStart () - 1)).toLowerCase ().toCharArray ();
14265 var downstream =  String.instantialize (ds.getSequence (s_end - 1, s_end + dstream_ds)).toLowerCase ().toCharArray ();
14266 var coreseq = s.getSequence ();
14267 var nseq =  Clazz_newCharArray (offset + upstream.length + downstream.length + coreseq.length, '\0');
14268 var c = core.getGapCharacter ();
14269 var p = 0;
14270 for (; p < offset; p++) {
14271 nseq[p] = c;
14272 }
14273 System.arraycopy (upstream, 0, nseq, p, upstream.length);
14274 System.arraycopy (coreseq, 0, nseq, p + upstream.length, coreseq.length);
14275 System.arraycopy (downstream, 0, nseq, p + coreseq.length + upstream.length, downstream.length);
14276 s.setSequence ( String.instantialize (nseq));
14277 s.setStart (s.getStart () - ustream_ds);
14278 s.setEnd (s_end + downstream.length);
14279 }
14280 var newAl =  new jalview.datamodel.Alignment (sq.toArray ( new Array (0)));
14281 for (var s, $s = sq.iterator (); $s.hasNext () && ((s = $s.next ()) || true);) {
14282 if (s.getAnnotation () != null) {
14283 for (var aa, $aa = 0, $$aa = s.getAnnotation (); $aa < $$aa.length && ((aa = $$aa[$aa]) || true); $aa++) {
14284 aa.adjustForAlignment ();
14285 newAl.addAnnotation (aa);
14286 }
14287 }}
14288 newAl.setDataset (core.getDataset ());
14289 return newAl;
14290 }, "jalview.datamodel.AlignmentI,~N");
14291 c$.getSequenceIndex = Clazz_defineMethod (c$, "getSequenceIndex", 
14292 function (al, seq) {
14293 var result = -1;
14294 var pos = 0;
14295 for (var alSeq, $alSeq = al.getSequences ().iterator (); $alSeq.hasNext () && ((alSeq = $alSeq.next ()) || true);) {
14296 if (alSeq === seq) {
14297 result = pos;
14298 break;
14299 }pos++;
14300 }
14301 return result;
14302 }, "jalview.datamodel.AlignmentI,jalview.datamodel.SequenceI");
14303 c$.getSequencesByName = Clazz_defineMethod (c$, "getSequencesByName", 
14304 function (al) {
14305 var theMap =  new java.util.LinkedHashMap ();
14306 for (var seq, $seq = al.getSequences ().iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
14307 var name = seq.getName ();
14308 if (name != null) {
14309 var seqs = theMap.get (name);
14310 if (seqs == null) {
14311 seqs =  new java.util.ArrayList ();
14312 theMap.put (name, seqs);
14313 }seqs.add (seq);
14314 }}
14315 return theMap;
14316 }, "jalview.datamodel.AlignmentI");
14317 c$.mapProteinToCdna = Clazz_defineMethod (c$, "mapProteinToCdna", 
14318 function (proteinAlignment, cdnaAlignment) {
14319 if (proteinAlignment == null || cdnaAlignment == null) {
14320 return false;
14321 }var mappedDna =  new java.util.HashSet ();
14322 var mappedProtein =  new java.util.HashSet ();
14323 var mappingPerformed = jalview.analysis.AlignmentUtils.mapProteinToCdna (proteinAlignment, cdnaAlignment, mappedDna, mappedProtein, true);
14324 mappingPerformed = new Boolean (mappingPerformed | jalview.analysis.AlignmentUtils.mapProteinToCdna (proteinAlignment, cdnaAlignment, mappedDna, mappedProtein, false)).valueOf ();
14325 return mappingPerformed;
14326 }, "jalview.datamodel.AlignmentI,jalview.datamodel.AlignmentI");
14327 c$.mapProteinToCdna = Clazz_defineMethod (c$, "mapProteinToCdna", 
14328 function (proteinAlignment, cdnaAlignment, mappedDna, mappedProtein, xrefsOnly) {
14329 var mappingPerformed = false;
14330 var thisSeqs = proteinAlignment.getSequences ();
14331 for (var aaSeq, $aaSeq = thisSeqs.iterator (); $aaSeq.hasNext () && ((aaSeq = $aaSeq.next ()) || true);) {
14332 var proteinMapped = false;
14333 var acf =  new jalview.datamodel.AlignedCodonFrame ();
14334 for (var cdnaSeq, $cdnaSeq = cdnaAlignment.getSequences ().iterator (); $cdnaSeq.hasNext () && ((cdnaSeq = $cdnaSeq.next ()) || true);) {
14335 if (xrefsOnly && !jalview.analysis.AlignmentUtils.haveCrossRef (aaSeq, cdnaSeq)) {
14336 continue;
14337 }if (!xrefsOnly && (mappedProtein.contains (aaSeq) || mappedDna.contains (cdnaSeq))) {
14338 continue;
14339 }if (!jalview.analysis.AlignmentUtils.mappingExists (proteinAlignment.getCodonFrames (), aaSeq.getDatasetSequence (), cdnaSeq.getDatasetSequence ())) {
14340 var map = jalview.analysis.AlignmentUtils.mapProteinToCdna (aaSeq, cdnaSeq);
14341 if (map != null) {
14342 acf.addMap (cdnaSeq, aaSeq, map);
14343 mappingPerformed = true;
14344 proteinMapped = true;
14345 mappedDna.add (cdnaSeq);
14346 mappedProtein.add (aaSeq);
14347 }}}
14348 if (proteinMapped) {
14349 proteinAlignment.addCodonFrame (acf);
14350 }}
14351 return mappingPerformed;
14352 }, "jalview.datamodel.AlignmentI,jalview.datamodel.AlignmentI,java.util.Set,java.util.Set,~B");
14353 c$.mappingExists = Clazz_defineMethod (c$, "mappingExists", 
14354 function (set, aaSeq, cdnaSeq) {
14355 if (set != null) {
14356 for (var acf, $acf = set.iterator (); $acf.hasNext () && ((acf = $acf.next ()) || true);) {
14357 if (cdnaSeq === acf.getDnaForAaSeq (aaSeq)) {
14358 return true;
14359 }}
14360 }return false;
14361 }, "java.util.Set,jalview.datamodel.SequenceI,jalview.datamodel.SequenceI");
14362 c$.mapProteinToCdna = Clazz_defineMethod (c$, "mapProteinToCdna", 
14363 function (proteinSeq, cdnaSeq) {
14364 var proteinDataset = proteinSeq.getDatasetSequence ();
14365 var aaSeqChars = proteinDataset != null ? proteinDataset.getSequence () : proteinSeq.getSequence ();
14366 var cdnaDataset = cdnaSeq.getDatasetSequence ();
14367 var cdnaSeqChars = cdnaDataset != null ? cdnaDataset.getSequence () : cdnaSeq.getSequence ();
14368 if (aaSeqChars == null || cdnaSeqChars == null) {
14369 return null;
14370 }var mappedLength = 3 * aaSeqChars.length;
14371 var cdnaLength = cdnaSeqChars.length;
14372 var cdnaStart = 1;
14373 var cdnaEnd = cdnaLength;
14374 var proteinStart = 1;
14375 var proteinEnd = aaSeqChars.length;
14376 if (cdnaLength != mappedLength && cdnaLength > 2) {
14377 var lastCodon = String.valueOf (cdnaSeqChars, cdnaLength - 3, 3).toUpperCase ();
14378 for (var stop, $stop = jalview.schemes.ResidueProperties.STOP.iterator (); $stop.hasNext () && ((stop = $stop.next ()) || true);) {
14379 if (lastCodon.equals (stop)) {
14380 cdnaEnd -= 3;
14381 cdnaLength -= 3;
14382 break;
14383 }}
14384 }if (cdnaLength != mappedLength && cdnaLength > 2 && String.valueOf (cdnaSeqChars, 0, 3).toUpperCase ().equals (jalview.schemes.ResidueProperties.START)) {
14385 cdnaStart += 3;
14386 cdnaLength -= 3;
14387 }if (cdnaLength != mappedLength) {
14388 return null;
14389 }if (!jalview.analysis.AlignmentUtils.translatesAs (cdnaSeqChars, cdnaStart - 1, aaSeqChars)) {
14390 return null;
14391 }var map =  new jalview.util.MapList ( Clazz_newIntArray (-1, [cdnaStart, cdnaEnd]),  Clazz_newIntArray (-1, [1, proteinEnd]), 3, 1);
14392 return map;
14393 }, "jalview.datamodel.SequenceI,jalview.datamodel.SequenceI");
14394 c$.translatesAs = Clazz_defineMethod (c$, "translatesAs", 
14395 function (cdnaSeqChars, cdnaStart, aaSeqChars) {
14396 var aaResidue = 0;
14397 for (var i = cdnaStart; i < cdnaSeqChars.length - 2 && aaResidue < aaSeqChars.length; i += 3, aaResidue++) {
14398 var codon = String.valueOf (cdnaSeqChars, i, 3);
14399 var translated = jalview.schemes.ResidueProperties.codonTranslate (codon);
14400 var aaRes = aaSeqChars[aaResidue];
14401 if ((translated == null || "STOP".equals (translated)) && aaRes == 'X') {
14402 continue;
14403 }if (translated == null || !(aaRes == translated.charAt (0))) {
14404 return false;
14405 }}
14406 return (aaResidue == aaSeqChars.length);
14407 }, "~A,~N,~A");
14408 c$.alignSequenceAs = Clazz_defineMethod (c$, "alignSequenceAs", 
14409 function (seq, al, gap, preserveMappedGaps, preserveUnmappedGaps) {
14410 var mappings = al.getCodonFrame (seq);
14411 if (mappings == null || mappings.isEmpty ()) {
14412 return false;
14413 }var alignFrom = null;
14414 var mapping = null;
14415 for (var mp, $mp = mappings.iterator (); $mp.hasNext () && ((mp = $mp.next ()) || true);) {
14416 alignFrom = mp.findAlignedSequence (seq.getDatasetSequence (), al);
14417 if (alignFrom != null) {
14418 mapping = mp;
14419 break;
14420 }}
14421 if (alignFrom == null) {
14422 return false;
14423 }jalview.analysis.AlignmentUtils.alignSequenceAs (seq, alignFrom, mapping, gap, al.getGapCharacter (), preserveMappedGaps, preserveUnmappedGaps);
14424 return true;
14425 }, "jalview.datamodel.SequenceI,jalview.datamodel.AlignmentI,~S,~B,~B");
14426 c$.alignSequenceAs = Clazz_defineMethod (c$, "alignSequenceAs", 
14427 function (alignTo, alignFrom, mapping, myGap, sourceGap, preserveMappedGaps, preserveUnmappedGaps) {
14428 var thisSeq = alignTo.getSequence ();
14429 var thatAligned = alignFrom.getSequence ();
14430 var thisAligned =  new StringBuilder (2 * thisSeq.length);
14431 var thisSeqPos = 0;
14432 var sourceDsPos = 0;
14433 var basesWritten = 0;
14434 var myGapChar = myGap.charAt (0);
14435 var ratio = myGap.length;
14436 var sourceGapMappedLength = 0;
14437 var inExon = false;
14438 for (var sourceChar, $sourceChar = 0, $$sourceChar = thatAligned; $sourceChar < $$sourceChar.length && ((sourceChar = $$sourceChar[$sourceChar]) || true); $sourceChar++) {
14439 if (sourceChar == sourceGap) {
14440 sourceGapMappedLength += ratio;
14441 continue;
14442 }sourceDsPos++;
14443 var mappedPos = mapping.getMappedRegion (alignTo, alignFrom, sourceDsPos);
14444 if (mappedPos == null) {
14445 System.err.println ("Can't align: no codon mapping to residue " + sourceDsPos + "(" + sourceChar + ")");
14446 return;
14447 }var mappedCodonStart = mappedPos[0];
14448 var mappedCodonEnd = mappedPos[mappedPos.length - 1];
14449 var trailingCopiedGap =  new StringBuilder ();
14450 var intronLength = 0;
14451 while (basesWritten < mappedCodonEnd && thisSeqPos < thisSeq.length) {
14452 var c = thisSeq[thisSeqPos++];
14453 if (c != myGapChar) {
14454 basesWritten++;
14455 if (basesWritten < mappedCodonStart) {
14456 if (preserveUnmappedGaps && trailingCopiedGap.length () > 0) {
14457 thisAligned.append (trailingCopiedGap.toString ());
14458 intronLength += trailingCopiedGap.length ();
14459 trailingCopiedGap =  new StringBuilder ();
14460 }intronLength++;
14461 inExon = false;
14462 } else {
14463 var startOfCodon = basesWritten == mappedCodonStart;
14464 var gapsToAdd = jalview.analysis.AlignmentUtils.calculateGapsToInsert (preserveMappedGaps, preserveUnmappedGaps, sourceGapMappedLength, inExon, trailingCopiedGap.length (), intronLength, startOfCodon);
14465 for (var i = 0; i < gapsToAdd; i++) {
14466 thisAligned.append (myGapChar);
14467 }
14468 sourceGapMappedLength = 0;
14469 inExon = true;
14470 }thisAligned.append (c);
14471 trailingCopiedGap =  new StringBuilder ();
14472 } else {
14473 if (inExon && preserveMappedGaps) {
14474 trailingCopiedGap.append (myGapChar);
14475 } else if (!inExon && preserveUnmappedGaps) {
14476 trailingCopiedGap.append (myGapChar);
14477 }}}
14478 }
14479 while (thisSeqPos < thisSeq.length) {
14480 var c = thisSeq[thisSeqPos++];
14481 if (c != myGapChar || preserveUnmappedGaps) {
14482 thisAligned.append (c);
14483 }}
14484 alignTo.setSequence ( String.instantialize (thisAligned));
14485 }, "jalview.datamodel.SequenceI,jalview.datamodel.SequenceI,jalview.datamodel.AlignedCodonFrame,~S,~S,~B,~B");
14486 c$.calculateGapsToInsert = Clazz_defineMethod (c$, "calculateGapsToInsert", 
14487 function (preserveMappedGaps, preserveUnmappedGaps, sourceGapMappedLength, inExon, trailingGapLength, intronLength, startOfCodon) {
14488 var gapsToAdd = 0;
14489 if (startOfCodon) {
14490 if (inExon && !preserveMappedGaps) {
14491 trailingGapLength = 0;
14492 }if (!inExon && !(preserveMappedGaps && preserveUnmappedGaps)) {
14493 trailingGapLength = 0;
14494 }if (inExon) {
14495 gapsToAdd = Math.max (sourceGapMappedLength, trailingGapLength);
14496 } else {
14497 if (intronLength + trailingGapLength <= sourceGapMappedLength) {
14498 gapsToAdd = sourceGapMappedLength - intronLength;
14499 } else {
14500 gapsToAdd = Math.min (intronLength + trailingGapLength - sourceGapMappedLength, trailingGapLength);
14501 }}} else {
14502 if (!preserveMappedGaps) {
14503 trailingGapLength = 0;
14504 }gapsToAdd = Math.max (sourceGapMappedLength, trailingGapLength);
14505 }return gapsToAdd;
14506 }, "~B,~B,~N,~B,~N,~N,~B");
14507 c$.getAlignedTranslation = Clazz_defineMethod (c$, "getAlignedTranslation", 
14508 function (sequences, gapCharacter, mappings) {
14509 var alignedSeqs =  new java.util.ArrayList ();
14510 for (var seq, $seq = sequences.iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
14511 var mapped = jalview.analysis.AlignmentUtils.getAlignedTranslation (seq, gapCharacter, mappings);
14512 alignedSeqs.addAll (mapped);
14513 }
14514 return alignedSeqs;
14515 }, "java.util.List,~S,java.util.Set");
14516 c$.getAlignedTranslation = Clazz_defineMethod (c$, "getAlignedTranslation", 
14517 function (seq, gapCharacter, mappings) {
14518 var result =  new java.util.ArrayList ();
14519 for (var mapping, $mapping = mappings.iterator (); $mapping.hasNext () && ((mapping = $mapping.next ()) || true);) {
14520 if (mapping.involvesSequence (seq)) {
14521 var mapped = jalview.analysis.AlignmentUtils.getAlignedTranslation (seq, gapCharacter, mapping);
14522 if (mapped != null) {
14523 result.add (mapped);
14524 }}}
14525 return result;
14526 }, "jalview.datamodel.SequenceI,~S,java.util.Set");
14527 c$.getAlignedTranslation = Clazz_defineMethod (c$, "getAlignedTranslation", 
14528 function (seq, gapCharacter, mapping) {
14529 var gap = String.valueOf (gapCharacter);
14530 var toDna = false;
14531 var fromRatio = 1;
14532 var mapTo = mapping.getDnaForAaSeq (seq);
14533 if (mapTo != null) {
14534 toDna = true;
14535 gap = String.valueOf ( Clazz_newCharArray (-1, [gapCharacter, gapCharacter, gapCharacter]));
14536 } else {
14537 mapTo = mapping.getAaForDnaSeq (seq);
14538 fromRatio = 3;
14539 }var newseq =  new StringBuilder (seq.getLength () * (toDna ? 3 : 1));
14540 var residueNo = 0;
14541 var phrase =  Clazz_newIntArray (fromRatio, 0);
14542 var phraseOffset = 0;
14543 var gapWidth = 0;
14544 var first = true;
14545 var alignedSeq =  new jalview.datamodel.Sequence ("", "");
14546 for (var c, $c = 0, $$c = seq.getSequence (); $c < $$c.length && ((c = $$c[$c]) || true); $c++) {
14547 if (c == gapCharacter) {
14548 gapWidth++;
14549 if (gapWidth >= fromRatio) {
14550 newseq.append (gap);
14551 gapWidth = 0;
14552 }} else {
14553 phrase[phraseOffset++] = residueNo + 1;
14554 if (phraseOffset == fromRatio) {
14555 var sr =  new jalview.datamodel.SearchResults ();
14556 for (var pos, $pos = 0, $$pos = phrase; $pos < $$pos.length && ((pos = $$pos[$pos]) || true); $pos++) {
14557 mapping.markMappedRegion (seq, pos, sr);
14558 }
14559 newseq.append (sr.toString ());
14560 if (first) {
14561 first = false;
14562 var mappedTo = sr.getResultSequence (0);
14563 alignedSeq.setName (mappedTo.getName ());
14564 alignedSeq.setDescription (mappedTo.getDescription ());
14565 alignedSeq.setDatasetSequence (mappedTo);
14566 }phraseOffset = 0;
14567 }residueNo++;
14568 }}
14569 alignedSeq.setSequence (newseq.toString ());
14570 return alignedSeq;
14571 }, "jalview.datamodel.SequenceI,~S,jalview.datamodel.AlignedCodonFrame");
14572 c$.alignProteinAsDna = Clazz_defineMethod (c$, "alignProteinAsDna", 
14573 function (protein, dna) {
14574 var mappings = protein.getCodonFrames ();
14575 var alignedCodons =  new java.util.TreeMap ( new jalview.analysis.CodonComparator ());
14576 for (var dnaSeq, $dnaSeq = dna.getSequences ().iterator (); $dnaSeq.hasNext () && ((dnaSeq = $dnaSeq.next ()) || true);) {
14577 for (var mapping, $mapping = mappings.iterator (); $mapping.hasNext () && ((mapping = $mapping.next ()) || true);) {
14578 var seqMap = mapping.getMappingForSequence (dnaSeq);
14579 var prot = mapping.findAlignedSequence (dnaSeq.getDatasetSequence (), protein);
14580 if (prot != null) {
14581 jalview.analysis.AlignmentUtils.addCodonPositions (dnaSeq, prot, protein.getGapCharacter (), seqMap, alignedCodons);
14582 }}
14583 }
14584 return jalview.analysis.AlignmentUtils.alignProteinAs (protein, alignedCodons);
14585 }, "jalview.datamodel.AlignmentI,jalview.datamodel.AlignmentI");
14586 c$.alignProteinAs = Clazz_defineMethod (c$, "alignProteinAs", 
14587 function (protein, alignedCodons) {
14588 var alignedWidth = alignedCodons.size ();
14589 var gaps =  Clazz_newCharArray (alignedWidth, '\0');
14590 java.util.Arrays.fill (gaps, protein.getGapCharacter ());
14591 var allGaps = String.valueOf (gaps);
14592 for (var seq, $seq = protein.getSequences ().iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
14593 seq.setSequence (allGaps);
14594 }
14595 var column = 0;
14596 for (var codon, $codon = alignedCodons.keySet ().iterator (); $codon.hasNext () && ((codon = $codon.next ()) || true);) {
14597 var columnResidues = alignedCodons.get (codon);
14598 for (var entry, $entry = columnResidues.entrySet ().iterator (); $entry.hasNext () && ((entry = $entry.next ()) || true);) {
14599 entry.getKey ().getSequence ()[column] = entry.getValue ().charAt (0);
14600 }
14601 column++;
14602 }
14603 return 0;
14604 }, "jalview.datamodel.AlignmentI,java.util.Map");
14605 c$.addCodonPositions = Clazz_defineMethod (c$, "addCodonPositions", 
14606 function (dna, protein, gapChar, seqMap, alignedCodons) {
14607 var codons = seqMap.getCodonIterator (dna, gapChar);
14608 while (codons.hasNext ()) {
14609 var codon = codons.next ();
14610 var seqProduct = alignedCodons.get (codon);
14611 if (seqProduct == null) {
14612 seqProduct =  new java.util.HashMap ();
14613 alignedCodons.put (codon, seqProduct);
14614 }seqProduct.put (protein, codon.product);
14615 }
14616 }, "jalview.datamodel.SequenceI,jalview.datamodel.SequenceI,~S,jalview.datamodel.Mapping,java.util.Map");
14617 c$.isMappable = Clazz_defineMethod (c$, "isMappable", 
14618 function (al1, al2) {
14619 if (al1.isNucleotide () == al2.isNucleotide ()) {
14620 return false;
14621 }var dna = al1.isNucleotide () ? al1 : al2;
14622 var protein = dna === al1 ? al2 : al1;
14623 var mappings = protein.getCodonFrames ();
14624 for (var dnaSeq, $dnaSeq = dna.getSequences ().iterator (); $dnaSeq.hasNext () && ((dnaSeq = $dnaSeq.next ()) || true);) {
14625 for (var proteinSeq, $proteinSeq = protein.getSequences ().iterator (); $proteinSeq.hasNext () && ((proteinSeq = $proteinSeq.next ()) || true);) {
14626 if (jalview.analysis.AlignmentUtils.isMappable (dnaSeq, proteinSeq, mappings)) {
14627 return true;
14628 }}
14629 }
14630 return false;
14631 }, "jalview.datamodel.AlignmentI,jalview.datamodel.AlignmentI");
14632 c$.isMappable = Clazz_defineMethod (c$, "isMappable", 
14633 function (dnaSeq, proteinSeq, mappings) {
14634 var dnaDs = dnaSeq.getDatasetSequence () == null ? dnaSeq : dnaSeq.getDatasetSequence ();
14635 var proteinDs = proteinSeq.getDatasetSequence () == null ? proteinSeq : proteinSeq.getDatasetSequence ();
14636 for (var mapping, $mapping = mappings.iterator (); $mapping.hasNext () && ((mapping = $mapping.next ()) || true);) {
14637 if (proteinDs === mapping.getAaForDnaSeq (dnaDs)) {
14638 return true;
14639 }}
14640 return jalview.analysis.AlignmentUtils.mapProteinToCdna (proteinDs, dnaDs) != null;
14641 }, "jalview.datamodel.SequenceI,jalview.datamodel.SequenceI,java.util.Set");
14642 c$.findAddableReferenceAnnotations = Clazz_defineMethod (c$, "findAddableReferenceAnnotations", 
14643 function (sequenceScope, labelForCalcId, candidates, al) {
14644 if (sequenceScope == null) {
14645 return;
14646 }for (var seq, $seq = sequenceScope.iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
14647 var dataset = seq.getDatasetSequence ();
14648 if (dataset == null) {
14649 continue;
14650 }var datasetAnnotations = dataset.getAnnotation ();
14651 if (datasetAnnotations == null) {
14652 continue;
14653 }var result =  new java.util.ArrayList ();
14654 for (var dsann, $dsann = 0, $$dsann = datasetAnnotations; $dsann < $$dsann.length && ((dsann = $$dsann[$dsann]) || true); $dsann++) {
14655 var matchedAlignmentAnnotations = al.findAnnotations (seq, dsann.getCalcId (), dsann.label);
14656 if (!matchedAlignmentAnnotations.iterator ().hasNext ()) {
14657 result.add (dsann);
14658 if (labelForCalcId != null) {
14659 labelForCalcId.put (dsann.getCalcId (), dsann.label);
14660 }}}
14661 if (!result.isEmpty ()) {
14662 candidates.put (seq, result);
14663 }}
14664 }, "java.util.List,java.util.Map,java.util.Map,jalview.datamodel.AlignmentI");
14665 c$.addReferenceAnnotations = Clazz_defineMethod (c$, "addReferenceAnnotations", 
14666 function (annotations, alignment, selectionGroup) {
14667 for (var seq, $seq = annotations.keySet ().iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
14668 for (var ann, $ann = annotations.get (seq).iterator (); $ann.hasNext () && ((ann = $ann.next ()) || true);) {
14669 var copyAnn =  new jalview.datamodel.AlignmentAnnotation (ann);
14670 var startRes = 0;
14671 var endRes = ann.annotations.length;
14672 if (selectionGroup != null) {
14673 startRes = selectionGroup.getStartRes ();
14674 endRes = selectionGroup.getEndRes ();
14675 }copyAnn.restrict (startRes, endRes);
14676 if (!seq.hasAnnotation (ann)) {
14677 seq.addAlignmentAnnotation (copyAnn);
14678 }copyAnn.adjustForAlignment ();
14679 alignment.addAnnotation (copyAnn);
14680 copyAnn.visible = true;
14681 }
14682 }
14683 }, "java.util.Map,jalview.datamodel.AlignmentI,jalview.datamodel.SequenceGroup");
14684 c$.showOrHideSequenceAnnotations = Clazz_defineMethod (c$, "showOrHideSequenceAnnotations", 
14685 function (al, types, forSequences, anyType, doShow) {
14686 for (var aa, $aa = 0, $$aa = al.getAlignmentAnnotation (); $aa < $$aa.length && ((aa = $$aa[$aa]) || true); $aa++) {
14687 if (anyType || types.contains (aa.label)) {
14688 if ((aa.sequenceRef != null) && (forSequences == null || forSequences.contains (aa.sequenceRef))) {
14689 aa.visible = doShow;
14690 }}}
14691 }, "jalview.datamodel.AlignmentI,java.util.Collection,java.util.List,~B,~B");
14692 c$.haveCrossRef = Clazz_defineMethod (c$, "haveCrossRef", 
14693 function (seq1, seq2) {
14694 return jalview.analysis.AlignmentUtils.hasCrossRef (seq1, seq2) || jalview.analysis.AlignmentUtils.hasCrossRef (seq2, seq1);
14695 }, "jalview.datamodel.SequenceI,jalview.datamodel.SequenceI");
14696 c$.hasCrossRef = Clazz_defineMethod (c$, "hasCrossRef", 
14697 function (seq1, seq2) {
14698 if (seq1 == null || seq2 == null) {
14699 return false;
14700 }var name = seq2.getName ();
14701 var xrefs = seq1.getDBRef ();
14702 if (xrefs != null) {
14703 for (var xref, $xref = 0, $$xref = xrefs; $xref < $$xref.length && ((xref = $$xref[$xref]) || true); $xref++) {
14704 var xrefName = xref.getSource () + "|" + xref.getAccessionId ();
14705 if (xrefName.equalsIgnoreCase (name)) {
14706 return true;
14707 }}
14708 }return false;
14709 }, "jalview.datamodel.SequenceI,jalview.datamodel.SequenceI");
14710 c$.makeExonAlignment = Clazz_defineMethod (c$, "makeExonAlignment", 
14711 function (dna, mappings) {
14712 var newMappings =  new java.util.LinkedHashSet ();
14713 var exonSequences =  new java.util.ArrayList ();
14714 for (var dnaSeq, $dnaSeq = 0, $$dnaSeq = dna; $dnaSeq < $$dnaSeq.length && ((dnaSeq = $$dnaSeq[$dnaSeq]) || true); $dnaSeq++) {
14715 var ds = dnaSeq.getDatasetSequence ();
14716 var seqMappings = jalview.util.MappingUtils.findMappingsForSequence (ds, mappings);
14717 for (var acf, $acf = seqMappings.iterator (); $acf.hasNext () && ((acf = $acf.next ()) || true);) {
14718 var newMapping =  new jalview.datamodel.AlignedCodonFrame ();
14719 var mappedExons = jalview.analysis.AlignmentUtils.makeExonSequences (ds, acf, newMapping);
14720 if (!mappedExons.isEmpty ()) {
14721 exonSequences.addAll (mappedExons);
14722 newMappings.add (newMapping);
14723 }}
14724 }
14725 var al =  new jalview.datamodel.Alignment (exonSequences.toArray ( new Array (exonSequences.size ())));
14726 al.setDataset (null);
14727 mappings.clear ();
14728 mappings.addAll (newMappings);
14729 return al;
14730 }, "~A,java.util.Set");
14731 c$.makeExonSequences = Clazz_defineMethod (c$, "makeExonSequences", 
14732 function (dnaSeq, mapping, newMapping) {
14733 var exonSequences =  new java.util.ArrayList ();
14734 var seqMappings = mapping.getMappingsForSequence (dnaSeq);
14735 var dna = dnaSeq.getSequence ();
14736 for (var seqMapping, $seqMapping = seqMappings.iterator (); $seqMapping.hasNext () && ((seqMapping = $seqMapping.next ()) || true);) {
14737 var newSequence =  new StringBuilder (dnaSeq.getLength ());
14738 var dnaExonRanges = seqMapping.getMap ().getFromRanges ();
14739 for (var range, $range = dnaExonRanges.iterator (); $range.hasNext () && ((range = $range.next ()) || true);) {
14740 for (var pos = range[0]; pos <= range[1]; pos++) {
14741 newSequence.append (dna[pos - 1]);
14742 }
14743 }
14744 var exon =  new jalview.datamodel.Sequence (dnaSeq.getName (), newSequence.toString ());
14745 var cdsAccId = jalview.datamodel.FeatureProperties.getCodingFeature (jalview.datamodel.DBRefSource.EMBL);
14746 var cdsRefs = jalview.util.DBRefUtils.selectRefs (seqMapping.getTo ().getDBRef (), jalview.datamodel.DBRefSource.CODINGDBS);
14747 if (cdsRefs != null) {
14748 for (var cdsRef, $cdsRef = 0, $$cdsRef = cdsRefs; $cdsRef < $$cdsRef.length && ((cdsRef = $$cdsRef[$cdsRef]) || true); $cdsRef++) {
14749 exon.addDBRef ( new jalview.datamodel.DBRefEntry (cdsRef));
14750 cdsAccId = cdsRef.getAccessionId ();
14751 }
14752 }exon.setName (exon.getName () + "|" + cdsAccId);
14753 exon.createDatasetSequence ();
14754 var exonRange =  new java.util.ArrayList ();
14755 exonRange.add ( Clazz_newIntArray (-1, [1, newSequence.length ()]));
14756 var map =  new jalview.util.MapList (exonRange, seqMapping.getMap ().getToRanges (), 3, 1);
14757 newMapping.addMap (exon.getDatasetSequence (), seqMapping.getTo (), map);
14758 var cdsToDnaMap =  new jalview.util.MapList (dnaExonRanges, exonRange, 1, 1);
14759 newMapping.addMap (dnaSeq, exon.getDatasetSequence (), cdsToDnaMap);
14760 exonSequences.add (exon);
14761 }
14762 return exonSequences;
14763 }, "jalview.datamodel.SequenceI,jalview.datamodel.AlignedCodonFrame,jalview.datamodel.AlignedCodonFrame");
14764 });
14765 Clazz_declarePackage ("jalview.analysis");
14766 c$ = Clazz_declareType (jalview.analysis, "CodonComparator", null, java.util.Comparator);
14767 Clazz_overrideMethod (c$, "compare", 
14768 function (ac1, ac2) {
14769 if (ac1 == null || ac2 == null || ac1.equals (ac2)) {
14770 return 0;
14771 }if (ac1.pos1 < ac2.pos1 && ac1.pos3 <= ac2.pos3) {
14772 return -1;
14773 }if (ac2.pos1 < ac1.pos1 && ac2.pos3 <= ac1.pos3) {
14774 return 1;
14775 }if (ac1.pos3 > ac2.pos3 && ac1.pos1 >= ac2.pos1) {
14776 return 1;
14777 }if (ac2.pos3 > ac1.pos3 && ac2.pos1 >= ac1.pos1) {
14778 return -1;
14779 }if (ac1.pos1 == ac2.pos1 && ac1.pos3 == ac2.pos3) {
14780 return Integer.compare (ac1.pos2, ac2.pos2);
14781 }var compareMiddles = Integer.compare (ac1.pos2, ac2.pos2);
14782 if (compareMiddles != 0) {
14783 return compareMiddles;
14784 }return Integer.compare (ac1.pos1, ac2.pos1);
14785 }, "jalview.datamodel.AlignedCodon,jalview.datamodel.AlignedCodon");
14786 Clazz_declarePackage ("jalview.datamodel");
14787 Clazz_load (null, "jalview.datamodel.AlignedCodonFrame", ["jalview.datamodel.Mapping", "jalview.util.MappingUtils", "java.util.ArrayList"], function () {
14788 c$ = Clazz_decorateAsClass (function () {
14789 this.dnaSeqs = null;
14790 this.dnaToProt = null;
14791 Clazz_instantialize (this, arguments);
14792 }, jalview.datamodel, "AlignedCodonFrame");
14793 Clazz_makeConstructor (c$, 
14794 function () {
14795 });
14796 Clazz_defineMethod (c$, "addMap", 
14797 function (dnaseq, aaseq, map) {
14798 var nlen = 1;
14799 if (this.dnaSeqs != null) {
14800 nlen = this.dnaSeqs.length + 1;
14801 }var ndna =  new Array (nlen);
14802 var ndtp =  new Array (nlen);
14803 if (this.dnaSeqs != null) {
14804 System.arraycopy (this.dnaSeqs, 0, ndna, 0, this.dnaSeqs.length);
14805 System.arraycopy (this.dnaToProt, 0, ndtp, 0, this.dnaSeqs.length);
14806 }this.dnaSeqs = ndna;
14807 this.dnaToProt = ndtp;
14808 nlen--;
14809 this.dnaSeqs[nlen] = (dnaseq.getDatasetSequence () == null) ? dnaseq : dnaseq.getDatasetSequence ();
14810 var mp =  new jalview.datamodel.Mapping (map);
14811 mp.to = (aaseq.getDatasetSequence () == null) ? aaseq : aaseq.getDatasetSequence ();
14812 this.dnaToProt[nlen] = mp;
14813 }, "jalview.datamodel.SequenceI,jalview.datamodel.SequenceI,jalview.util.MapList");
14814 Clazz_defineMethod (c$, "getdnaSeqs", 
14815 function () {
14816 return this.dnaSeqs;
14817 });
14818 Clazz_defineMethod (c$, "getAaSeqs", 
14819 function () {
14820 if (this.dnaToProt == null) {
14821 return null;
14822 }var sqs =  new Array (this.dnaToProt.length);
14823 for (var sz = 0; sz < this.dnaToProt.length; sz++) {
14824 sqs[sz] = this.dnaToProt[sz].to;
14825 }
14826 return sqs;
14827 });
14828 Clazz_defineMethod (c$, "getdnaToProt", 
14829 function () {
14830 if (this.dnaToProt == null) {
14831 return null;
14832 }var sqs =  new Array (this.dnaToProt.length);
14833 for (var sz = 0; sz < this.dnaToProt.length; sz++) {
14834 sqs[sz] = this.dnaToProt[sz].map;
14835 }
14836 return sqs;
14837 });
14838 Clazz_defineMethod (c$, "getProtMappings", 
14839 function () {
14840 return this.dnaToProt;
14841 });
14842 Clazz_defineMethod (c$, "getMappingForSequence", 
14843 function (seq) {
14844 if (this.dnaSeqs == null) {
14845 return null;
14846 }var seqDs = seq.getDatasetSequence ();
14847 seqDs = seqDs != null ? seqDs : seq;
14848 for (var ds = 0; ds < this.dnaSeqs.length; ds++) {
14849 if (this.dnaSeqs[ds] === seqDs || this.dnaToProt[ds].to === seqDs) {
14850 return this.dnaToProt[ds];
14851 }}
14852 return null;
14853 }, "jalview.datamodel.SequenceI");
14854 Clazz_defineMethod (c$, "getAaForDnaSeq", 
14855 function (dnaSeqRef) {
14856 if (this.dnaSeqs == null) {
14857 return null;
14858 }var dnads = dnaSeqRef.getDatasetSequence ();
14859 for (var ds = 0; ds < this.dnaSeqs.length; ds++) {
14860 if (this.dnaSeqs[ds] === dnaSeqRef || this.dnaSeqs[ds] === dnads) {
14861 return this.dnaToProt[ds].to;
14862 }}
14863 return null;
14864 }, "jalview.datamodel.SequenceI");
14865 Clazz_defineMethod (c$, "getDnaForAaSeq", 
14866 function (aaSeqRef) {
14867 if (this.dnaToProt == null) {
14868 return null;
14869 }var aads = aaSeqRef.getDatasetSequence ();
14870 for (var as = 0; as < this.dnaToProt.length; as++) {
14871 if (this.dnaToProt[as].to === aaSeqRef || this.dnaToProt[as].to === aads) {
14872 return this.dnaSeqs[as];
14873 }}
14874 return null;
14875 }, "jalview.datamodel.SequenceI");
14876 Clazz_defineMethod (c$, "involvesSequence", 
14877 function (seq) {
14878 return this.getAaForDnaSeq (seq) != null || this.getDnaForAaSeq (seq) != null;
14879 }, "jalview.datamodel.SequenceI");
14880 Clazz_defineMethod (c$, "markMappedRegion", 
14881 function (seq, index, results) {
14882 if (this.dnaToProt == null) {
14883 return;
14884 }var codon;
14885 var ds = seq.getDatasetSequence ();
14886 for (var mi = 0; mi < this.dnaToProt.length; mi++) {
14887 if (this.dnaSeqs[mi] === seq || this.dnaSeqs[mi] === ds) {
14888 codon = this.dnaToProt[mi].map.locateInTo (index, index);
14889 if (codon != null) {
14890 for (var i = 0; i < codon.length; i += 2) {
14891 results.addResult (this.dnaToProt[mi].to, codon[i], codon[i + 1]);
14892 }
14893 }} else if (this.dnaToProt[mi].to === seq || this.dnaToProt[mi].to === ds) {
14894 {
14895 codon = this.dnaToProt[mi].map.locateInFrom (index, index);
14896 if (codon != null) {
14897 for (var i = 0; i < codon.length; i += 2) {
14898 results.addResult (this.dnaSeqs[mi], codon[i], codon[i + 1]);
14899 }
14900 }}}}
14901 }, "jalview.datamodel.SequenceI,~N,jalview.datamodel.SearchResults");
14902 Clazz_defineMethod (c$, "getDnaPosition", 
14903 function (seq, aaPos) {
14904 var ml = null;
14905 for (var i = 0; i < this.dnaToProt.length; i++) {
14906 if (this.dnaSeqs[i] === seq) {
14907 ml = this.getdnaToProt ()[i];
14908 break;
14909 }}
14910 return ml == null ? null : ml.locateInFrom (aaPos, aaPos);
14911 }, "jalview.datamodel.SequenceI,~N");
14912 Clazz_defineMethod (c$, "findAlignedSequence", 
14913 function (seq, al) {
14914 if (this.dnaToProt != null) {
14915 for (var i = 0; i < this.dnaToProt.length; i++) {
14916 if (this.dnaSeqs[i] === seq) {
14917 for (var sourceAligned, $sourceAligned = al.getSequences ().iterator (); $sourceAligned.hasNext () && ((sourceAligned = $sourceAligned.next ()) || true);) {
14918 if (this.dnaToProt[i].to === sourceAligned.getDatasetSequence ()) {
14919 return sourceAligned;
14920 }}
14921 }}
14922 }if (this.dnaToProt != null) {
14923 for (var i = 0; i < this.dnaToProt.length; i++) {
14924 if (this.dnaToProt[i].to === seq) {
14925 for (var sourceAligned, $sourceAligned = al.getSequences ().iterator (); $sourceAligned.hasNext () && ((sourceAligned = $sourceAligned.next ()) || true);) {
14926 if (this.dnaSeqs[i] === sourceAligned.getDatasetSequence ()) {
14927 return sourceAligned;
14928 }}
14929 }}
14930 }return null;
14931 }, "jalview.datamodel.SequenceI,jalview.datamodel.AlignmentI");
14932 Clazz_defineMethod (c$, "getMappedRegion", 
14933 function (mappedFrom, mappedTo, pos) {
14934 var targetDs = mappedFrom.getDatasetSequence () == null ? mappedFrom : mappedFrom.getDatasetSequence ();
14935 var sourceDs = mappedTo.getDatasetSequence () == null ? mappedTo : mappedTo.getDatasetSequence ();
14936 if (targetDs == null || sourceDs == null || this.dnaToProt == null) {
14937 return null;
14938 }for (var mi = 0; mi < this.dnaToProt.length; mi++) {
14939 if (this.dnaSeqs[mi] === targetDs && this.dnaToProt[mi].to === sourceDs) {
14940 var codon = this.dnaToProt[mi].map.locateInFrom (pos, pos);
14941 if (codon != null) {
14942 return codon;
14943 }}}
14944 return null;
14945 }, "jalview.datamodel.SequenceI,jalview.datamodel.SequenceI,~N");
14946 Clazz_defineMethod (c$, "getMappedCodon", 
14947 function (protein, aaPos) {
14948 if (this.dnaToProt == null) {
14949 return null;
14950 }var ml = null;
14951 var dnaSeq = null;
14952 for (var i = 0; i < this.dnaToProt.length; i++) {
14953 if (this.dnaToProt[i].to === protein) {
14954 ml = this.getdnaToProt ()[i];
14955 dnaSeq = this.dnaSeqs[i].getSequence ();
14956 break;
14957 }}
14958 if (ml == null) {
14959 return null;
14960 }var codonPos = ml.locateInFrom (aaPos, aaPos);
14961 if (codonPos == null) {
14962 return null;
14963 }codonPos = jalview.util.MappingUtils.flattenRanges (codonPos);
14964 return  Clazz_newCharArray (-1, [dnaSeq[codonPos[0] - 1], dnaSeq[codonPos[1] - 1], dnaSeq[codonPos[2] - 1]]);
14965 }, "jalview.datamodel.SequenceI,~N");
14966 Clazz_defineMethod (c$, "getMappingsForSequence", 
14967 function (seq) {
14968 var result =  new java.util.ArrayList ();
14969 if (this.dnaSeqs == null) {
14970 return result;
14971 }var related =  new java.util.ArrayList ();
14972 var seqDs = seq.getDatasetSequence ();
14973 seqDs = seqDs != null ? seqDs : seq;
14974 for (var ds = 0; ds < this.dnaSeqs.length; ds++) {
14975 var mapping = this.dnaToProt[ds];
14976 if (this.dnaSeqs[ds] === seqDs || mapping.to === seqDs) {
14977 if (!related.contains (mapping.to)) {
14978 result.add (mapping);
14979 related.add (mapping.to);
14980 }}}
14981 return result;
14982 }, "jalview.datamodel.SequenceI");
14983 });
14984 Clazz_declarePackage ("jalview.datamodel");
14985 Clazz_load (["java.util.Iterator"], "jalview.datamodel.Mapping", ["jalview.datamodel.AlignedCodon", "$.IncompleteCodonException", "$.SequenceFeature", "jalview.util.MapList", "java.util.NoSuchElementException", "$.Vector"], function () {
14986 c$ = Clazz_decorateAsClass (function () {
14987 if (!Clazz_isClassDefined ("jalview.datamodel.Mapping.AlignedCodonIterator")) {
14988 jalview.datamodel.Mapping.$Mapping$AlignedCodonIterator$ ();
14989 }
14990 this.map = null;
14991 this.to = null;
14992 Clazz_instantialize (this, arguments);
14993 }, jalview.datamodel, "Mapping");
14994 Clazz_makeConstructor (c$, 
14995 function (map) {
14996 this.map = map;
14997 }, "jalview.util.MapList");
14998 Clazz_makeConstructor (c$, 
14999 function (to, map) {
15000 this.construct (map);
15001 this.to = to;
15002 }, "jalview.datamodel.SequenceI,jalview.util.MapList");
15003 Clazz_makeConstructor (c$, 
15004 function (to, exon, is, i, j) {
15005 this.construct (to,  new jalview.util.MapList (exon, is, i, j));
15006 }, "jalview.datamodel.SequenceI,~A,~A,~N,~N");
15007 Clazz_makeConstructor (c$, 
15008 function (map2) {
15009 if (map2 !== this && map2 != null) {
15010 if (map2.map != null) {
15011 this.map =  new jalview.util.MapList (map2.map);
15012 }this.to = map2.to;
15013 }}, "jalview.datamodel.Mapping");
15014 Clazz_defineMethod (c$, "getMap", 
15015 function () {
15016 return this.map;
15017 });
15018 Clazz_defineMethod (c$, "setMap", 
15019 function (map) {
15020 this.map = map;
15021 }, "jalview.util.MapList");
15022 Clazz_overrideMethod (c$, "equals", 
15023 function (o) {
15024 if (o == null || !(Clazz_instanceOf (o, jalview.datamodel.Mapping))) {
15025 return false;
15026 }var other = o;
15027 if (other === this) {
15028 return true;
15029 }if (other.to !== this.to) {
15030 return false;
15031 }if ((this.map != null && other.map == null) || (this.map == null && other.map != null)) {
15032 return false;
15033 }if ((this.map == null && other.map == null) || this.map.equals (other.map)) {
15034 return true;
15035 }return false;
15036 }, "~O");
15037 Clazz_defineMethod (c$, "getPosition", 
15038 function (mpos) {
15039 if (this.map != null) {
15040 var mp = this.map.shiftTo (mpos);
15041 if (mp != null) {
15042 return mp[0];
15043 }}return mpos;
15044 }, "~N");
15045 Clazz_defineMethod (c$, "getWord", 
15046 function (mpos) {
15047 if (this.map != null) {
15048 return this.map.getToWord (mpos);
15049 }return null;
15050 }, "~N");
15051 Clazz_defineMethod (c$, "getWidth", 
15052 function () {
15053 if (this.map != null) {
15054 return this.map.getFromRatio ();
15055 }return 1;
15056 });
15057 Clazz_defineMethod (c$, "getMappedWidth", 
15058 function () {
15059 if (this.map != null) {
15060 return this.map.getToRatio ();
15061 }return 1;
15062 });
15063 Clazz_defineMethod (c$, "getMappedPosition", 
15064 function (pos) {
15065 if (this.map != null) {
15066 var mp = this.map.shiftFrom (pos);
15067 if (mp != null) {
15068 return mp[0];
15069 }}return pos;
15070 }, "~N");
15071 Clazz_defineMethod (c$, "getMappedWord", 
15072 function (pos) {
15073 if (this.map != null) {
15074 var mp = this.map.shiftFrom (pos);
15075 if (mp != null) {
15076 return  Clazz_newIntArray (-1, [mp[0], mp[0] + mp[2] * (this.map.getToRatio () - 1)]);
15077 }}return null;
15078 }, "~N");
15079 Clazz_defineMethod (c$, "locateFeature", 
15080 function (f) {
15081 if (true) {
15082 if (this.map != null) {
15083 var frange = this.map.locateInFrom (f.getBegin (), f.getEnd ());
15084 if (frange == null) {
15085 return null;
15086 }var vf =  new Array (Clazz_doubleToInt (frange.length / 2));
15087 for (var i = 0, v = 0; i < frange.length; i += 2, v++) {
15088 vf[v] =  new jalview.datamodel.SequenceFeature (f);
15089 vf[v].setBegin (frange[i]);
15090 vf[v].setEnd (frange[i + 1]);
15091 if (frange.length > 2) {
15092 vf[v].setDescription (f.getDescription () + "\nPart " + (v + 1));
15093 }}
15094 return vf;
15095 }}if (false) {
15096 var word = this.getWord (f.getBegin ());
15097 if (word[0] < word[1]) {
15098 f.setBegin (word[0]);
15099 } else {
15100 f.setBegin (word[1]);
15101 }word = this.getWord (f.getEnd ());
15102 if (word[0] > word[1]) {
15103 f.setEnd (word[0]);
15104 } else {
15105 f.setEnd (word[1]);
15106 }}return  Clazz_newArray (-1, [f]);
15107 }, "jalview.datamodel.SequenceFeature");
15108 Clazz_defineMethod (c$, "locateRange", 
15109 function (from, to) {
15110 if (this.map != null) {
15111 if (from <= to) {
15112 from = (this.map.getToLowest () < from) ? from : this.map.getToLowest ();
15113 to = (this.map.getToHighest () > to) ? to : this.map.getToHighest ();
15114 if (from > to) {
15115 return null;
15116 }} else {
15117 from = (this.map.getToHighest () > from) ? from : this.map.getToHighest ();
15118 to = (this.map.getToLowest () < to) ? to : this.map.getToLowest ();
15119 if (from < to) {
15120 return null;
15121 }}return this.map.locateInFrom (from, to);
15122 }return  Clazz_newIntArray (-1, [from, to]);
15123 }, "~N,~N");
15124 Clazz_defineMethod (c$, "locateMappedRange", 
15125 function (from, to) {
15126 if (this.map != null) {
15127 if (from <= to) {
15128 from = (this.map.getFromLowest () < from) ? from : this.map.getFromLowest ();
15129 to = (this.map.getFromHighest () > to) ? to : this.map.getFromHighest ();
15130 if (from > to) {
15131 return null;
15132 }} else {
15133 from = (this.map.getFromHighest () > from) ? from : this.map.getFromHighest ();
15134 to = (this.map.getFromLowest () < to) ? to : this.map.getFromLowest ();
15135 if (from < to) {
15136 return null;
15137 }}return this.map.locateInTo (from, to);
15138 }return  Clazz_newIntArray (-1, [from, to]);
15139 }, "~N,~N");
15140 Clazz_defineMethod (c$, "intersectVisContigs", 
15141 function (viscontigs) {
15142 var copy =  new jalview.datamodel.Mapping (this);
15143 if (this.map != null) {
15144 var vpos = 0;
15145 var apos = 0;
15146 var toRange =  new java.util.Vector ();
15147 var fromRange =  new java.util.Vector ();
15148 for (var vc = 0; vc < viscontigs.length; vc += 2) {
15149 var mpr = this.locateMappedRange (1 + viscontigs[vc], viscontigs[vc + 1] - 1);
15150 if (mpr != null) {
15151 for (var m = 0; m < mpr.length; m += 2) {
15152 toRange.addElement ( Clazz_newIntArray (-1, [mpr[m], mpr[m + 1]]));
15153 var xpos = this.locateRange (mpr[m], mpr[m + 1]);
15154 for (var x = 0; x < xpos.length; x += 2) {
15155 fromRange.addElement ( Clazz_newIntArray (-1, [xpos[x], xpos[x + 1]]));
15156 }
15157 }
15158 }}
15159 var from =  Clazz_newIntArray (fromRange.size () * 2, 0);
15160 var to =  Clazz_newIntArray (toRange.size () * 2, 0);
15161 var r;
15162 for (var f = 0, fSize = fromRange.size (); f < fSize; f++) {
15163 r = fromRange.elementAt (f);
15164 from[f * 2] = r[0];
15165 from[f * 2 + 1] = r[1];
15166 }
15167 for (var f = 0, fSize = toRange.size (); f < fSize; f++) {
15168 r = toRange.elementAt (f);
15169 to[f * 2] = r[0];
15170 to[f * 2 + 1] = r[1];
15171 }
15172 copy.setMap ( new jalview.util.MapList (from, to, this.map.getFromRatio (), this.map.getToRatio ()));
15173 }return copy;
15174 }, "~A");
15175 Clazz_defineMethod (c$, "getTo", 
15176 function () {
15177 return this.to;
15178 });
15179 Clazz_defineMethod (c$, "setTo", 
15180 function (tto) {
15181 this.to = tto;
15182 }, "jalview.datamodel.SequenceI");
15183 Clazz_defineMethod (c$, "finalize", 
15184 function () {
15185 this.map = null;
15186 this.to = null;
15187 Clazz_superCall (this, jalview.datamodel.Mapping, "finalize", []);
15188 });
15189 Clazz_defineMethod (c$, "getCodonIterator", 
15190 function (seq, gapChar) {
15191 return Clazz_innerTypeInstance (jalview.datamodel.Mapping.AlignedCodonIterator, this, null, seq.getSequence (), gapChar);
15192 }, "jalview.datamodel.SequenceI,~S");
15193 c$.$Mapping$AlignedCodonIterator$ = function () {
15194 Clazz_pu$h(self.c$);
15195 c$ = Clazz_decorateAsClass (function () {
15196 Clazz_prepareCallback (this, arguments);
15197 this.gap = '\0';
15198 this.alignedSeq = null;
15199 this.alignedColumn = 0;
15200 this.alignedBases = 0;
15201 this.fromRanges = null;
15202 this.toRanges = null;
15203 this.currentFromRange = null;
15204 this.currentToRange = null;
15205 this.fromPosition = 0;
15206 this.toPosition = 0;
15207 Clazz_instantialize (this, arguments);
15208 }, jalview.datamodel.Mapping, "AlignedCodonIterator", null, java.util.Iterator);
15209 Clazz_makeConstructor (c$, 
15210 function (a, b) {
15211 this.alignedSeq = a;
15212 this.gap = b;
15213 this.fromRanges = this.b$["jalview.datamodel.Mapping"].map.getFromRanges ().iterator ();
15214 this.toRanges = this.b$["jalview.datamodel.Mapping"].map.getToRanges ().iterator ();
15215 if (this.fromRanges.hasNext ()) {
15216 this.currentFromRange = this.fromRanges.next ();
15217 this.fromPosition = this.currentFromRange[0];
15218 }if (this.toRanges.hasNext ()) {
15219 this.currentToRange = this.toRanges.next ();
15220 this.toPosition = this.currentToRange[0];
15221 }}, "~A,~S");
15222 Clazz_defineMethod (c$, "hasNext", 
15223 function () {
15224 if (this.fromRanges.hasNext ()) {
15225 return true;
15226 }if (this.currentFromRange == null || this.fromPosition >= this.currentFromRange[1]) {
15227 return false;
15228 }return true;
15229 });
15230 Clazz_overrideMethod (c$, "next", 
15231 function () {
15232 if (!this.hasNext ()) {
15233 throw  new java.util.NoSuchElementException ();
15234 }var a = this.getNextCodon ();
15235 var b = this.getAlignedCodon (a);
15236 var c = this.getPeptide ();
15237 return  new jalview.datamodel.AlignedCodon (b[0], b[1], b[2], c);
15238 });
15239 Clazz_defineMethod (c$, "getPeptide", 
15240  function () {
15241 if (this.toPosition <= this.currentToRange[1]) {
15242 var a = this.b$["jalview.datamodel.Mapping"].to.getSequence ()[this.toPosition - 1];
15243 this.toPosition++;
15244 return String.valueOf (a);
15245 }if (!this.toRanges.hasNext ()) {
15246 throw  new java.util.NoSuchElementException ("Ran out of peptide at position " + this.toPosition);
15247 }this.currentToRange = this.toRanges.next ();
15248 this.toPosition = this.currentToRange[0];
15249 return this.getPeptide ();
15250 });
15251 Clazz_defineMethod (c$, "getNextCodon", 
15252  function () {
15253 var a =  Clazz_newIntArray (3, 0);
15254 var b = 0;
15255 while (b < 3) {
15256 if (this.fromPosition <= this.currentFromRange[1]) {
15257 a[b++] = this.fromPosition++;
15258 } else {
15259 if (!this.fromRanges.hasNext ()) {
15260 throw  new jalview.datamodel.IncompleteCodonException ();
15261 }this.currentFromRange = this.fromRanges.next ();
15262 this.fromPosition = this.currentFromRange[0];
15263 }}
15264 return a;
15265 });
15266 Clazz_defineMethod (c$, "getAlignedCodon", 
15267  function (a) {
15268 var b =  Clazz_newIntArray (a.length, 0);
15269 for (var c = 0; c < a.length; c++) {
15270 b[c] = this.getAlignedColumn (a[c]);
15271 }
15272 return b;
15273 }, "~A");
15274 Clazz_defineMethod (c$, "getAlignedColumn", 
15275  function (a) {
15276 while (this.alignedBases < a && this.alignedColumn < this.alignedSeq.length) {
15277 if (this.alignedSeq[this.alignedColumn++] != this.gap) {
15278 this.alignedBases++;
15279 }}
15280 return this.alignedColumn - 1;
15281 }, "~N");
15282 Clazz_overrideMethod (c$, "remove", 
15283 function () {
15284 });
15285 c$ = Clazz_p0p ();
15286 };
15287 });
15288 Clazz_declarePackage ("jalview.datamodel");
15289 Clazz_load (null, "jalview.datamodel.AlignedCodon", ["java.lang.IllegalArgumentException", "$.StringBuilder"], function () {
15290 c$ = Clazz_decorateAsClass (function () {
15291 this.pos1 = 0;
15292 this.pos2 = 0;
15293 this.pos3 = 0;
15294 this.product = null;
15295 Clazz_instantialize (this, arguments);
15296 }, jalview.datamodel, "AlignedCodon");
15297 Clazz_makeConstructor (c$, 
15298 function (i, j, k) {
15299 this.construct (i, j, k, null);
15300 }, "~N,~N,~N");
15301 Clazz_makeConstructor (c$, 
15302 function (i, j, k, prod) {
15303 this.pos1 = i;
15304 this.pos2 = j;
15305 this.pos3 = k;
15306 this.product = prod;
15307 }, "~N,~N,~N,~S");
15308 Clazz_defineMethod (c$, "getBaseColumn", 
15309 function (base) {
15310 if (base < 1 || base > 3) {
15311 throw  new IllegalArgumentException (Integer.toString (base));
15312 }return base == 1 ? this.pos1 : (base == 2 ? this.pos2 : this.pos3);
15313 }, "~N");
15314 Clazz_overrideMethod (c$, "equals", 
15315 function (o) {
15316 if (o == null) {
15317 return true;
15318 }if (!(Clazz_instanceOf (o, jalview.datamodel.AlignedCodon))) {
15319 return false;
15320 }var ac = o;
15321 return (this.pos1 == ac.pos1 && this.pos2 == ac.pos2 && this.pos3 == ac.pos3);
15322 }, "~O");
15323 Clazz_overrideMethod (c$, "toString", 
15324 function () {
15325 var sb =  new StringBuilder ();
15326 sb.append ("[").append (this.pos1).append (", ").append (this.pos2).append (", ").append (this.pos3).append ("]");
15327 return sb.toString ();
15328 });
15329 });
15330 Clazz_declarePackage ("jalview.datamodel");
15331 Clazz_load (["java.lang.RuntimeException"], "jalview.datamodel.IncompleteCodonException", null, function () {
15332 c$ = Clazz_declareType (jalview.datamodel, "IncompleteCodonException", RuntimeException);
15333 });
15334 Clazz_declarePackage ("jalview.datamodel");
15335 Clazz_load (null, "jalview.datamodel.SequenceFeature", ["java.util.Hashtable", "$.Vector"], function () {
15336 c$ = Clazz_decorateAsClass (function () {
15337 this.begin = 0;
15338 this.end = 0;
15339 this.score = 0;
15340 this.type = null;
15341 this.description = null;
15342 this.otherDetails = null;
15343 this.links = null;
15344 this.featureGroup = null;
15345 Clazz_instantialize (this, arguments);
15346 }, jalview.datamodel, "SequenceFeature");
15347 Clazz_makeConstructor (c$, 
15348 function () {
15349 });
15350 Clazz_makeConstructor (c$, 
15351 function (cpy) {
15352 if (cpy != null) {
15353 this.begin = cpy.begin;
15354 this.end = cpy.end;
15355 this.score = cpy.score;
15356 if (cpy.type != null) {
15357 this.type =  String.instantialize (cpy.type);
15358 }if (cpy.description != null) {
15359 this.description =  String.instantialize (cpy.description);
15360 }if (cpy.featureGroup != null) {
15361 this.featureGroup =  String.instantialize (cpy.featureGroup);
15362 }if (cpy.otherDetails != null) {
15363 try {
15364 this.otherDetails = cpy.otherDetails.clone ();
15365 } catch (e) {
15366 if (Clazz_exceptionOf (e, Exception)) {
15367 } else {
15368 throw e;
15369 }
15370 }
15371 }if (cpy.links != null && cpy.links.size () > 0) {
15372 this.links =  new java.util.Vector ();
15373 for (var i = 0, iSize = cpy.links.size (); i < iSize; i++) {
15374 this.links.addElement (cpy.links.elementAt (i));
15375 }
15376 }}}, "jalview.datamodel.SequenceFeature");
15377 Clazz_makeConstructor (c$, 
15378 function (type, desc, status, begin, end, featureGroup) {
15379 this.type = type;
15380 this.description = desc;
15381 this.setValue ("status", status);
15382 this.begin = begin;
15383 this.end = end;
15384 this.featureGroup = featureGroup;
15385 }, "~S,~S,~S,~N,~N,~S");
15386 Clazz_makeConstructor (c$, 
15387 function (type, desc, begin, end, score, featureGroup) {
15388 this.type = type;
15389 this.description = desc;
15390 this.begin = begin;
15391 this.end = end;
15392 this.score = score;
15393 this.featureGroup = featureGroup;
15394 }, "~S,~S,~N,~N,~N,~S");
15395 Clazz_defineMethod (c$, "equals", 
15396 function (sf) {
15397 if (this.begin != sf.begin || this.end != sf.end || this.score != sf.score) {
15398 return false;
15399 }if (!(this.type + this.description + this.featureGroup).equals (sf.type + sf.description + sf.featureGroup)) {
15400 return false;
15401 }return true;
15402 }, "jalview.datamodel.SequenceFeature");
15403 Clazz_defineMethod (c$, "getBegin", 
15404 function () {
15405 return this.begin;
15406 });
15407 Clazz_defineMethod (c$, "setBegin", 
15408 function (start) {
15409 this.begin = start;
15410 }, "~N");
15411 Clazz_defineMethod (c$, "getEnd", 
15412 function () {
15413 return this.end;
15414 });
15415 Clazz_defineMethod (c$, "setEnd", 
15416 function (end) {
15417 this.end = end;
15418 }, "~N");
15419 Clazz_defineMethod (c$, "getType", 
15420 function () {
15421 return this.type;
15422 });
15423 Clazz_defineMethod (c$, "setType", 
15424 function (type) {
15425 this.type = type;
15426 }, "~S");
15427 Clazz_defineMethod (c$, "getDescription", 
15428 function () {
15429 return this.description;
15430 });
15431 Clazz_defineMethod (c$, "setDescription", 
15432 function (desc) {
15433 this.description = desc;
15434 }, "~S");
15435 Clazz_defineMethod (c$, "getFeatureGroup", 
15436 function () {
15437 return this.featureGroup;
15438 });
15439 Clazz_defineMethod (c$, "setFeatureGroup", 
15440 function (featureGroup) {
15441 this.featureGroup = featureGroup;
15442 }, "~S");
15443 Clazz_defineMethod (c$, "addLink", 
15444 function (labelLink) {
15445 if (this.links == null) {
15446 this.links =  new java.util.Vector ();
15447 }this.links.insertElementAt (labelLink, 0);
15448 }, "~S");
15449 Clazz_defineMethod (c$, "getScore", 
15450 function () {
15451 return this.score;
15452 });
15453 Clazz_defineMethod (c$, "setScore", 
15454 function (value) {
15455 this.score = value;
15456 }, "~N");
15457 Clazz_defineMethod (c$, "getValue", 
15458 function (key) {
15459 if (this.otherDetails == null) {
15460 return null;
15461 } else {
15462 return this.otherDetails.get (key);
15463 }}, "~S");
15464 Clazz_defineMethod (c$, "setValue", 
15465 function (key, value) {
15466 if (value != null) {
15467 if (this.otherDetails == null) {
15468 this.otherDetails =  new java.util.Hashtable ();
15469 }this.otherDetails.put (key, value);
15470 }}, "~S,~O");
15471 Clazz_defineMethod (c$, "setStatus", 
15472 function (status) {
15473 this.setValue ("status", status);
15474 }, "~S");
15475 Clazz_defineMethod (c$, "getStatus", 
15476 function () {
15477 if (this.otherDetails != null) {
15478 var stat = this.otherDetails.get ("status");
15479 if (stat != null) {
15480 return  String.instantialize (stat);
15481 }}return null;
15482 });
15483 Clazz_defineMethod (c$, "setPosition", 
15484 function (pos) {
15485 this.begin = pos;
15486 this.end = pos;
15487 }, "~N");
15488 Clazz_defineMethod (c$, "getPosition", 
15489 function () {
15490 return this.begin;
15491 });
15492 Clazz_defineMethod (c$, "getStrand", 
15493 function () {
15494 var str;
15495 if (this.otherDetails == null || (str = this.otherDetails.get ("STRAND").toString ()) == null) {
15496 return 0;
15497 }if (str.equals ("-")) {
15498 return -1;
15499 }if (str.equals ("+")) {
15500 return 1;
15501 }return 0;
15502 });
15503 });
15504 Clazz_declarePackage ("jalview.util");
15505 Clazz_load (["java.util.ArrayList"], "jalview.util.MapList", ["java.lang.StringBuilder", "java.util.Arrays"], function () {
15506 c$ = Clazz_decorateAsClass (function () {
15507 this.fromShifts = null;
15508 this.toShifts = null;
15509 this.fromRatio = 0;
15510 this.toRatio = 0;
15511 this.fromLowest = 0;
15512 this.fromHighest = 0;
15513 this.toLowest = 0;
15514 this.toHighest = 0;
15515 Clazz_instantialize (this, arguments);
15516 }, jalview.util, "MapList");
15517 Clazz_prepareFields (c$, function () {
15518 this.fromShifts =  new java.util.ArrayList ();
15519 this.toShifts =  new java.util.ArrayList ();
15520 });
15521 Clazz_overrideMethod (c$, "equals", 
15522 function (o) {
15523 if (o == null || !(Clazz_instanceOf (o, jalview.util.MapList))) {
15524 return false;
15525 }var obj = o;
15526 if (obj === this) {
15527 return true;
15528 }if (obj.fromRatio != this.fromRatio || obj.toRatio != this.toRatio || obj.fromShifts == null || obj.toShifts == null) {
15529 return false;
15530 }return java.util.Arrays.deepEquals (this.fromShifts.toArray (), obj.fromShifts.toArray ()) && java.util.Arrays.deepEquals (this.toShifts.toArray (), obj.toShifts.toArray ());
15531 }, "~O");
15532 Clazz_defineMethod (c$, "getFromRanges", 
15533 function () {
15534 return this.fromShifts;
15535 });
15536 Clazz_defineMethod (c$, "getToRanges", 
15537 function () {
15538 return this.toShifts;
15539 });
15540 c$.getRanges = Clazz_defineMethod (c$, "getRanges", 
15541 function (shifts) {
15542 var rnges =  Clazz_newIntArray (2 * shifts.size (), 0);
15543 var i = 0;
15544 for (var r, $r = shifts.iterator (); $r.hasNext () && ((r = $r.next ()) || true);) {
15545 rnges[i++] = r[0];
15546 rnges[i++] = r[1];
15547 }
15548 return rnges;
15549 }, "java.util.List");
15550 Clazz_defineMethod (c$, "getFromRatio", 
15551 function () {
15552 return this.fromRatio;
15553 });
15554 Clazz_defineMethod (c$, "getToRatio", 
15555 function () {
15556 return this.toRatio;
15557 });
15558 Clazz_defineMethod (c$, "getFromLowest", 
15559 function () {
15560 return this.fromLowest;
15561 });
15562 Clazz_defineMethod (c$, "getFromHighest", 
15563 function () {
15564 return this.fromHighest;
15565 });
15566 Clazz_defineMethod (c$, "getToLowest", 
15567 function () {
15568 return this.toLowest;
15569 });
15570 Clazz_defineMethod (c$, "getToHighest", 
15571 function () {
15572 return this.toHighest;
15573 });
15574 Clazz_makeConstructor (c$, 
15575 function (from, to, fromRatio, toRatio) {
15576 this.fromRatio = fromRatio;
15577 this.toRatio = toRatio;
15578 this.fromLowest = from[0];
15579 this.fromHighest = from[1];
15580 for (var i = 0; i < from.length; i += 2) {
15581 this.fromLowest = Math.min (this.fromLowest, from[i]);
15582 this.fromHighest = Math.max (this.fromHighest, from[i + 1]);
15583 this.fromShifts.add ( Clazz_newIntArray (-1, [from[i], from[i + 1]]));
15584 }
15585 this.toLowest = to[0];
15586 this.toHighest = to[1];
15587 for (var i = 0; i < to.length; i += 2) {
15588 this.toLowest = Math.min (this.toLowest, to[i]);
15589 this.toHighest = Math.max (this.toHighest, to[i + 1]);
15590 this.toShifts.add ( Clazz_newIntArray (-1, [to[i], to[i + 1]]));
15591 }
15592 }, "~A,~A,~N,~N");
15593 Clazz_makeConstructor (c$, 
15594 function (map) {
15595 this.fromLowest = map.fromLowest;
15596 this.fromHighest = map.fromHighest;
15597 this.toLowest = map.toLowest;
15598 this.toHighest = map.toHighest;
15599 this.fromRatio = map.fromRatio;
15600 this.toRatio = map.toRatio;
15601 if (map.fromShifts != null) {
15602 for (var r, $r = map.fromShifts.iterator (); $r.hasNext () && ((r = $r.next ()) || true);) {
15603 this.fromShifts.add ( Clazz_newIntArray (-1, [r[0], r[1]]));
15604 }
15605 }if (map.toShifts != null) {
15606 for (var r, $r = map.toShifts.iterator (); $r.hasNext () && ((r = $r.next ()) || true);) {
15607 this.toShifts.add ( Clazz_newIntArray (-1, [r[0], r[1]]));
15608 }
15609 }}, "jalview.util.MapList");
15610 Clazz_makeConstructor (c$, 
15611 function (fromRange, toRange, fromRatio, toRatio) {
15612 this.fromShifts = fromRange;
15613 this.toShifts = toRange;
15614 this.fromRatio = fromRatio;
15615 this.toRatio = toRatio;
15616 this.fromLowest = 2147483647;
15617 this.fromHighest = 0;
15618 for (var range, $range = fromRange.iterator (); $range.hasNext () && ((range = $range.next ()) || true);) {
15619 this.fromLowest = Math.min (this.fromLowest, range[0]);
15620 this.fromHighest = Math.max (this.fromHighest, range[1]);
15621 }
15622 this.toLowest = 2147483647;
15623 this.toHighest = 0;
15624 for (var range, $range = toRange.iterator (); $range.hasNext () && ((range = $range.next ()) || true);) {
15625 this.toLowest = Math.min (this.toLowest, range[0]);
15626 this.toHighest = Math.max (this.toHighest, range[1]);
15627 }
15628 }, "java.util.List,java.util.List,~N,~N");
15629 Clazz_defineMethod (c$, "makeFromMap", 
15630 function () {
15631 return this.posMap (this.fromShifts, this.fromRatio, this.toShifts, this.toRatio);
15632 });
15633 Clazz_defineMethod (c$, "makeToMap", 
15634 function () {
15635 return this.posMap (this.toShifts, this.toRatio, this.fromShifts, this.fromRatio);
15636 });
15637 Clazz_defineMethod (c$, "posMap", 
15638  function (shiftTo, ratio, shiftFrom, toRatio) {
15639 var iv = 0;
15640 var ivSize = shiftTo.size ();
15641 if (iv >= ivSize) {
15642 return null;
15643 }var intv = shiftTo.get (iv++);
15644 var from = intv[0];
15645 var to = intv[1];
15646 if (from > to) {
15647 from = intv[1];
15648 to = intv[0];
15649 }while (iv < ivSize) {
15650 intv = shiftTo.get (iv++);
15651 if (intv[0] < from) {
15652 from = intv[0];
15653 }if (intv[1] < from) {
15654 from = intv[1];
15655 }if (intv[0] > to) {
15656 to = intv[0];
15657 }if (intv[1] > to) {
15658 to = intv[1];
15659 }}
15660 var tF = 0;
15661 var tT = 0;
15662 var mp =  Clazz_newIntArray (to - from + 2, 0);
15663 for (var i = 0; i < mp.length; i++) {
15664 var m = jalview.util.MapList.shift (i + from, shiftTo, ratio, shiftFrom, toRatio);
15665 if (m != null) {
15666 if (i == 0) {
15667 tF = tT = m[0];
15668 } else {
15669 if (m[0] < tF) {
15670 tF = m[0];
15671 }if (m[0] > tT) {
15672 tT = m[0];
15673 }}}mp[i] = m;
15674 }
15675 var map =  Clazz_newArray (-1, [ Clazz_newIntArray (-1, [from, to, tF, tT]),  Clazz_newIntArray (to - from + 2, 0)]);
15676 map[0][2] = tF;
15677 map[0][3] = tT;
15678 for (var i = 0; i < mp.length; i++) {
15679 if (mp[i] != null) {
15680 map[1][i] = mp[i][0] - tF;
15681 } else {
15682 map[1][i] = -1;
15683 }}
15684 return map;
15685 }, "java.util.List,~N,java.util.List,~N");
15686 Clazz_defineMethod (c$, "shiftFrom", 
15687 function (pos) {
15688 return jalview.util.MapList.shift (pos, this.fromShifts, this.fromRatio, this.toShifts, this.toRatio);
15689 }, "~N");
15690 Clazz_defineMethod (c$, "shiftTo", 
15691 function (pos) {
15692 return jalview.util.MapList.shift (pos, this.toShifts, this.toRatio, this.fromShifts, this.fromRatio);
15693 }, "~N");
15694 c$.shift = Clazz_defineMethod (c$, "shift", 
15695 function (pos, shiftTo, fromRatio, shiftFrom, toRatio) {
15696 var fromCount = jalview.util.MapList.countPos (shiftTo, pos);
15697 if (fromCount == null) {
15698 return null;
15699 }var fromRemainder = (fromCount[0] - 1) % fromRatio;
15700 var toCount = 1 + ((Clazz_doubleToInt ((fromCount[0] - 1) / fromRatio)) * toRatio);
15701 var toPos = jalview.util.MapList.countToPos (shiftFrom, toCount);
15702 if (toPos == null) {
15703 return null;
15704 }return  Clazz_newIntArray (-1, [toPos[0], fromRemainder, toPos[1]]);
15705 }, "~N,java.util.List,~N,java.util.List,~N");
15706 c$.countPos = Clazz_defineMethod (c$, "countPos", 
15707 function (shiftTo, pos) {
15708 var count = 0;
15709 var intv;
15710 var iv = 0;
15711 var ivSize = shiftTo.size ();
15712 while (iv < ivSize) {
15713 intv = shiftTo.get (iv++);
15714 if (intv[0] <= intv[1]) {
15715 if (pos >= intv[0] && pos <= intv[1]) {
15716 return  Clazz_newIntArray (-1, [count + pos - intv[0] + 1, 1]);
15717 } else {
15718 count += intv[1] - intv[0] + 1;
15719 }} else {
15720 if (pos >= intv[1] && pos <= intv[0]) {
15721 return  Clazz_newIntArray (-1, [count + intv[0] - pos + 1, -1]);
15722 } else {
15723 count += intv[0] - intv[1] + 1;
15724 }}}
15725 return null;
15726 }, "java.util.List,~N");
15727 c$.countToPos = Clazz_defineMethod (c$, "countToPos", 
15728 function (shiftFrom, pos) {
15729 var count = 0;
15730 var diff = 0;
15731 var iv = 0;
15732 var ivSize = shiftFrom.size ();
15733 var intv =  Clazz_newIntArray (-1, [0, 0]);
15734 while (iv < ivSize) {
15735 intv = shiftFrom.get (iv++);
15736 diff = intv[1] - intv[0];
15737 if (diff >= 0) {
15738 if (pos <= count + 1 + diff) {
15739 return  Clazz_newIntArray (-1, [pos - count - 1 + intv[0], 1]);
15740 } else {
15741 count += 1 + diff;
15742 }} else {
15743 if (pos <= count + 1 - diff) {
15744 return  Clazz_newIntArray (-1, [intv[0] - (pos - count - 1), -1]);
15745 } else {
15746 count += 1 - diff;
15747 }}}
15748 return null;
15749 }, "java.util.List,~N");
15750 Clazz_defineMethod (c$, "locateInFrom", 
15751 function (start, end) {
15752 var fromStart = this.shiftTo (start);
15753 var fromEnd = this.shiftTo (end);
15754 return jalview.util.MapList.getIntervals (this.fromShifts, fromStart, fromEnd, this.fromRatio);
15755 }, "~N,~N");
15756 Clazz_defineMethod (c$, "locateInTo", 
15757 function (start, end) {
15758 var toStart = this.shiftFrom (start);
15759 var toEnd = this.shiftFrom (end);
15760 return jalview.util.MapList.getIntervals (this.toShifts, toStart, toEnd, this.toRatio);
15761 }, "~N,~N");
15762 c$.getIntervals = Clazz_defineMethod (c$, "getIntervals", 
15763 function (shiftFrom, fromStart, fromEnd, fromRatio2) {
15764 if (fromStart == null || fromEnd == null) {
15765 return null;
15766 }var startpos;
15767 var endpos;
15768 startpos = fromStart[0];
15769 endpos = fromEnd[0];
15770 var endindx = (fromRatio2 - 1);
15771 var intv = 0;
15772 var intvSize = shiftFrom.size ();
15773 var iv;
15774 var i = 0;
15775 var fs = -1;
15776 var fe_s = -1;
15777 var fe = -1;
15778 while (intv < intvSize && (fs == -1 || fe == -1)) {
15779 iv = shiftFrom.get (intv++);
15780 if (fe_s > -1) {
15781 endpos = iv[0];
15782 endindx--;
15783 }if (iv[0] <= iv[1]) {
15784 if (fs == -1 && startpos >= iv[0] && startpos <= iv[1]) {
15785 fs = i;
15786 }if (endpos >= iv[0] && endpos <= iv[1]) {
15787 if (fe_s == -1) {
15788 fe_s = i;
15789 }if (fe_s != -1) {
15790 if (endpos + endindx <= iv[1]) {
15791 fe = i;
15792 endpos = endpos + endindx;
15793 } else {
15794 endindx -= iv[1] - endpos;
15795 }}}} else {
15796 if (fs == -1 && startpos <= iv[0] && startpos >= iv[1]) {
15797 fs = i;
15798 }if (endpos <= iv[0] && endpos >= iv[1]) {
15799 if (fe_s == -1) {
15800 fe_s = i;
15801 }if (fe_s != -1) {
15802 if (endpos - endindx >= iv[1]) {
15803 fe = i;
15804 endpos = endpos - endindx;
15805 } else {
15806 endindx -= endpos - iv[1];
15807 }}}}i++;
15808 }
15809 if (fs == fe && fe == -1) {
15810 return null;
15811 }var ranges =  new java.util.ArrayList ();
15812 if (fs <= fe) {
15813 intv = fs;
15814 i = fs;
15815 iv = shiftFrom.get (intv++);
15816 iv =  Clazz_newIntArray (-1, [iv[0], iv[1]]);
15817 if (i == fs) {
15818 iv[0] = startpos;
15819 }while (i != fe) {
15820 ranges.add (iv);
15821 iv = shiftFrom.get (intv++);
15822 iv =  Clazz_newIntArray (-1, [iv[0], iv[1]]);
15823 i++;
15824 }
15825 if (i == fe) {
15826 iv[1] = endpos;
15827 }ranges.add (iv);
15828 } else {
15829 i = shiftFrom.size () - 1;
15830 while (i > fs) {
15831 i--;
15832 }
15833 iv = shiftFrom.get (i);
15834 iv =  Clazz_newIntArray (-1, [iv[1], iv[0]]);
15835 if (i == fs) {
15836 iv[0] = startpos;
15837 }while (--i != fe) {
15838 ranges.add (iv);
15839 iv = shiftFrom.get (i);
15840 iv =  Clazz_newIntArray (-1, [iv[1], iv[0]]);
15841 }
15842 if (i == fe) {
15843 iv[1] = endpos;
15844 }ranges.add (iv);
15845 }var range = null;
15846 if (ranges != null && ranges.size () > 0) {
15847 range =  Clazz_newIntArray (ranges.size () * 2, 0);
15848 intv = 0;
15849 intvSize = ranges.size ();
15850 i = 0;
15851 while (intv < intvSize) {
15852 iv = ranges.get (intv);
15853 range[i++] = iv[0];
15854 range[i++] = iv[1];
15855 ranges.set (intv++, null);
15856 }
15857 }return range;
15858 }, "java.util.List,~A,~A,~N");
15859 Clazz_defineMethod (c$, "getToPosition", 
15860 function (mpos) {
15861 var mp = this.shiftTo (mpos);
15862 if (mp != null) {
15863 return mp[0];
15864 }return mpos;
15865 }, "~N");
15866 Clazz_defineMethod (c$, "getToWord", 
15867 function (mpos) {
15868 var mp = this.shiftTo (mpos);
15869 if (mp != null) {
15870 return  Clazz_newIntArray (-1, [mp[0], mp[0] + mp[2] * (this.getFromRatio () - 1)]);
15871 }return null;
15872 }, "~N");
15873 Clazz_defineMethod (c$, "getMappedPosition", 
15874 function (pos) {
15875 var mp = this.shiftFrom (pos);
15876 if (mp != null) {
15877 return mp[0];
15878 }return pos;
15879 }, "~N");
15880 Clazz_defineMethod (c$, "getMappedWord", 
15881 function (pos) {
15882 var mp = this.shiftFrom (pos);
15883 if (mp != null) {
15884 return  Clazz_newIntArray (-1, [mp[0], mp[0] + mp[2] * (this.getToRatio () - 1)]);
15885 }return null;
15886 }, "~N");
15887 Clazz_defineMethod (c$, "getInverse", 
15888 function () {
15889 return  new jalview.util.MapList (this.getToRanges (), this.getFromRanges (), this.getToRatio (), this.getFromRatio ());
15890 });
15891 Clazz_defineMethod (c$, "containsEither", 
15892 function (local, map) {
15893 if (local) {
15894 return ((this.getFromLowest () >= map.getFromLowest () && this.getFromHighest () <= map.getFromHighest ()) || (this.getFromLowest () <= map.getFromLowest () && this.getFromHighest () >= map.getFromHighest ()));
15895 } else {
15896 return ((this.getToLowest () >= map.getToLowest () && this.getToHighest () <= map.getToHighest ()) || (this.getToLowest () <= map.getToLowest () && this.getToHighest () >= map.getToHighest ()));
15897 }}, "~B,jalview.util.MapList");
15898 Clazz_overrideMethod (c$, "toString", 
15899 function () {
15900 var sb =  new StringBuilder (64);
15901 sb.append ("From (").append (this.fromRatio).append (":").append (this.toRatio).append (") [");
15902 for (var shift, $shift = this.fromShifts.iterator (); $shift.hasNext () && ((shift = $shift.next ()) || true);) {
15903 sb.append (" ").append (java.util.Arrays.toString (shift));
15904 }
15905 sb.append (" ] To [");
15906 for (var shift, $shift = this.toShifts.iterator (); $shift.hasNext () && ((shift = $shift.next ()) || true);) {
15907 sb.append (" ").append (java.util.Arrays.toString (shift));
15908 }
15909 sb.append (" ]");
15910 return sb.toString ();
15911 });
15912 });
15913 Clazz_declarePackage ("jalview.util");
15914 Clazz_load (null, "jalview.util.MappingUtils", ["jalview.analysis.AlignmentSorter", "jalview.commands.EditCommand", "$.OrderCommand", "jalview.datamodel.AlignmentOrder", "$.ColumnSelection", "$.SearchResults", "$.Sequence", "$.SequenceGroup", "jalview.util.Comparison", "$.StringUtils", "java.util.ArrayList", "$.Collections", "$.HashMap"], function () {
15915 c$ = Clazz_declareType (jalview.util, "MappingUtils");
15916 c$.mapCutOrPaste = Clazz_defineMethod (c$, "mapCutOrPaste", 
15917 function (edit, undo, targetSeqs, result, mappings) {
15918 var action = edit.getAction ();
15919 if (undo) {
15920 action = action.getUndoAction ();
15921 }System.err.println ("MappingUtils.mapCutOrPaste not yet implemented");
15922 }, "jalview.commands.EditCommand.Edit,~B,java.util.List,jalview.commands.EditCommand,java.util.Set");
15923 c$.mapEditCommand = Clazz_defineMethod (c$, "mapEditCommand", 
15924 function (command, undo, mapTo, gapChar, mappings) {
15925 if (!mapTo.isNucleotide ()) {
15926 return null;
15927 }var targetCopies =  new java.util.HashMap ();
15928 for (var seq, $seq = mapTo.getSequences ().iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
15929 var ds = seq.getDatasetSequence ();
15930 if (ds != null) {
15931 var copy =  new jalview.datamodel.Sequence (seq);
15932 copy.setDatasetSequence (ds);
15933 targetCopies.put (ds, copy);
15934 }}
15935 var originalSequences = command.priorState (undo);
15936 var result =  new jalview.commands.EditCommand ();
15937 var edits = command.getEditIterator (!undo);
15938 while (edits.hasNext ()) {
15939 var edit = edits.next ();
15940 if (edit.getAction () === jalview.commands.EditCommand.Action.CUT || edit.getAction () === jalview.commands.EditCommand.Action.PASTE) {
15941 jalview.util.MappingUtils.mapCutOrPaste (edit, undo, mapTo.getSequences (), result, mappings);
15942 } else if (edit.getAction () === jalview.commands.EditCommand.Action.INSERT_GAP || edit.getAction () === jalview.commands.EditCommand.Action.DELETE_GAP) {
15943 jalview.util.MappingUtils.mapInsertOrDelete (edit, undo, originalSequences, mapTo.getSequences (), targetCopies, gapChar, result, mappings);
15944 }}
15945 return result.getSize () > 0 ? result : null;
15946 }, "jalview.commands.EditCommand,~B,jalview.datamodel.AlignmentI,~S,java.util.Set");
15947 c$.mapInsertOrDelete = Clazz_defineMethod (c$, "mapInsertOrDelete", 
15948 function (edit, undo, originalSequences, targetSeqs, targetCopies, gapChar, result, mappings) {
15949 var action = edit.getAction ();
15950 if (undo) {
15951 action = action.getUndoAction ();
15952 }var count = edit.getNumber ();
15953 var editPos = edit.getPosition ();
15954 for (var seq, $seq = 0, $$seq = edit.getSequences (); $seq < $$seq.length && ((seq = $$seq[$seq]) || true); $seq++) {
15955 var ds = seq.getDatasetSequence ();
15956 if (ds == null) {
15957 continue;
15958 }var actedOn = originalSequences.get (ds);
15959 var seqpos = actedOn.findPosition (editPos);
15960 var sr = jalview.util.MappingUtils.buildSearchResults (seq, seqpos, mappings);
15961 if (!sr.isEmpty ()) {
15962 for (var targetSeq, $targetSeq = targetSeqs.iterator (); $targetSeq.hasNext () && ((targetSeq = $targetSeq.next ()) || true);) {
15963 ds = targetSeq.getDatasetSequence ();
15964 if (ds == null) {
15965 continue;
15966 }var copyTarget = targetCopies.get (ds);
15967 var match = sr.getResults (copyTarget, 0, copyTarget.getLength ());
15968 if (match != null) {
15969 var ratio = 3;
15970 var mappedCount = count * 3;
15971 var mappedEditPos = action === jalview.commands.EditCommand.Action.DELETE_GAP ? match[0] - mappedCount : match[0];
15972 var e = resultClazz_innerTypeInstance (jalview.commands.EditCommand.Edit, this, null, action,  Clazz_newArray (-1, [targetSeq]), mappedEditPos, mappedCount, gapChar);
15973 result.addEdit (e);
15974 if (action === jalview.commands.EditCommand.Action.INSERT_GAP) {
15975 copyTarget.setSequence ( String.instantialize (jalview.util.StringUtils.insertCharAt (copyTarget.getSequence (), mappedEditPos, mappedCount, gapChar)));
15976 } else if (action === jalview.commands.EditCommand.Action.DELETE_GAP) {
15977 copyTarget.setSequence ( String.instantialize (jalview.util.StringUtils.deleteChars (copyTarget.getSequence (), mappedEditPos, mappedEditPos + mappedCount)));
15978 }}}
15979 }if (action === jalview.commands.EditCommand.Action.INSERT_GAP) {
15980 actedOn.setSequence ( String.instantialize (jalview.util.StringUtils.insertCharAt (actedOn.getSequence (), editPos, count, gapChar)));
15981 } else if (action === jalview.commands.EditCommand.Action.DELETE_GAP) {
15982 actedOn.setSequence ( String.instantialize (jalview.util.StringUtils.deleteChars (actedOn.getSequence (), editPos, editPos + count)));
15983 }}
15984 }, "jalview.commands.EditCommand.Edit,~B,java.util.Map,java.util.List,java.util.Map,~S,jalview.commands.EditCommand,java.util.Set");
15985 c$.buildSearchResults = Clazz_defineMethod (c$, "buildSearchResults", 
15986 function (seq, index, seqmappings) {
15987 var results =  new jalview.datamodel.SearchResults ();
15988 jalview.util.MappingUtils.addSearchResults (results, seq, index, seqmappings);
15989 return results;
15990 }, "jalview.datamodel.SequenceI,~N,java.util.Set");
15991 c$.addSearchResults = Clazz_defineMethod (c$, "addSearchResults", 
15992 function (results, seq, index, seqmappings) {
15993 if (index >= seq.getStart () && index <= seq.getEnd ()) {
15994 for (var acf, $acf = seqmappings.iterator (); $acf.hasNext () && ((acf = $acf.next ()) || true);) {
15995 acf.markMappedRegion (seq, index, results);
15996 }
15997 }}, "jalview.datamodel.SearchResults,jalview.datamodel.SequenceI,~N,java.util.Set");
15998 c$.mapSequenceGroup = Clazz_defineMethod (c$, "mapSequenceGroup", 
15999 function (sg, mapFrom, mapTo) {
16000 var targetIsNucleotide = mapTo.isNucleotide ();
16001 var protein = targetIsNucleotide ? mapFrom : mapTo;
16002 var codonFrames = protein.getAlignment ().getCodonFrames ();
16003 var mappedGroup =  new jalview.datamodel.SequenceGroup (sg);
16004 mappedGroup.cs = mapTo.getGlobalColourScheme ();
16005 mappedGroup.clear ();
16006 var minStartCol = -1;
16007 var maxEndCol = -1;
16008 var selectionStartRes = sg.getStartRes ();
16009 var selectionEndRes = sg.getEndRes ();
16010 for (var selected, $selected = sg.getSequences ().iterator (); $selected.hasNext () && ((selected = $selected.next ()) || true);) {
16011 var firstUngappedPos = selectionStartRes;
16012 while (firstUngappedPos <= selectionEndRes && jalview.util.Comparison.isGap (selected.getCharAt (firstUngappedPos))) {
16013 firstUngappedPos++;
16014 }
16015 if (firstUngappedPos > selectionEndRes) {
16016 continue;
16017 }var lastUngappedPos = selectionEndRes;
16018 while (lastUngappedPos >= selectionStartRes && jalview.util.Comparison.isGap (selected.getCharAt (lastUngappedPos))) {
16019 lastUngappedPos--;
16020 }
16021 var startResiduePos = selected.findPosition (firstUngappedPos);
16022 var endResiduePos = selected.findPosition (lastUngappedPos);
16023 for (var acf, $acf = codonFrames.iterator (); $acf.hasNext () && ((acf = $acf.next ()) || true);) {
16024 var mappedSequence = targetIsNucleotide ? acf.getDnaForAaSeq (selected) : acf.getAaForDnaSeq (selected);
16025 if (mappedSequence != null) {
16026 for (var seq, $seq = mapTo.getAlignment ().getSequences ().iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
16027 var mappedStartResidue = 0;
16028 var mappedEndResidue = 0;
16029 if (seq.getDatasetSequence () === mappedSequence) {
16030 var sr = jalview.util.MappingUtils.buildSearchResults (selected, startResiduePos, java.util.Collections.singleton (acf));
16031 for (var m, $m = sr.getResults ().iterator (); $m.hasNext () && ((m = $m.next ()) || true);) {
16032 mappedStartResidue = m.getStart ();
16033 mappedEndResidue = m.getEnd ();
16034 }
16035 sr = jalview.util.MappingUtils.buildSearchResults (selected, endResiduePos, java.util.Collections.singleton (acf));
16036 for (var m, $m = sr.getResults ().iterator (); $m.hasNext () && ((m = $m.next ()) || true);) {
16037 mappedStartResidue = Math.min (mappedStartResidue, m.getStart ());
16038 mappedEndResidue = Math.max (mappedEndResidue, m.getEnd ());
16039 }
16040 var mappedStartCol = seq.findIndex (mappedStartResidue) - 1;
16041 minStartCol = minStartCol == -1 ? mappedStartCol : Math.min (minStartCol, mappedStartCol);
16042 var mappedEndCol = seq.findIndex (mappedEndResidue) - 1;
16043 maxEndCol = maxEndCol == -1 ? mappedEndCol : Math.max (maxEndCol, mappedEndCol);
16044 mappedGroup.addSequence (seq, false);
16045 break;
16046 }}
16047 }}
16048 }
16049 mappedGroup.setStartRes (minStartCol < 0 ? 0 : minStartCol);
16050 mappedGroup.setEndRes (maxEndCol < 0 ? 0 : maxEndCol);
16051 return mappedGroup;
16052 }, "jalview.datamodel.SequenceGroup,jalview.api.AlignViewportI,jalview.api.AlignViewportI");
16053 c$.mapOrderCommand = Clazz_defineMethod (c$, "mapOrderCommand", 
16054 function (command, undo, mapTo, mappings) {
16055 var sortOrder = command.getSequenceOrder (undo);
16056 var mappedOrder =  new java.util.ArrayList ();
16057 var j = 0;
16058 var mappingToNucleotide = mapTo.isNucleotide ();
16059 for (var seq, $seq = 0, $$seq = sortOrder; $seq < $$seq.length && ((seq = $$seq[$seq]) || true); $seq++) {
16060 for (var acf, $acf = mappings.iterator (); $acf.hasNext () && ((acf = $acf.next ()) || true);) {
16061 var mappedSeq = mappingToNucleotide ? acf.getDnaForAaSeq (seq) : acf.getAaForDnaSeq (seq);
16062 if (mappedSeq != null) {
16063 for (var seq2, $seq2 = mapTo.getSequences ().iterator (); $seq2.hasNext () && ((seq2 = $seq2.next ()) || true);) {
16064 if (seq2.getDatasetSequence () === mappedSeq) {
16065 mappedOrder.add (seq2);
16066 j++;
16067 break;
16068 }}
16069 }}
16070 }
16071 if (j == 0) {
16072 return null;
16073 }if (j < mapTo.getHeight ()) {
16074 for (var seq, $seq = mapTo.getSequences ().iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
16075 if (!mappedOrder.contains (seq)) {
16076 mappedOrder.add (seq);
16077 }}
16078 }var mappedOrderArray = mappedOrder.toArray ( new Array (mappedOrder.size ()));
16079 var oldOrder = mapTo.getSequencesArray ();
16080 jalview.analysis.AlignmentSorter.sortBy (mapTo,  new jalview.datamodel.AlignmentOrder (mappedOrderArray));
16081 var result =  new jalview.commands.OrderCommand (command.getDescription (), oldOrder, mapTo);
16082 return result;
16083 }, "jalview.commands.OrderCommand,~B,jalview.datamodel.AlignmentI,java.util.Set");
16084 c$.mapColumnSelection = Clazz_defineMethod (c$, "mapColumnSelection", 
16085 function (colsel, mapFrom, mapTo) {
16086 var targetIsNucleotide = mapTo.isNucleotide ();
16087 var protein = targetIsNucleotide ? mapFrom : mapTo;
16088 var codonFrames = protein.getAlignment ().getCodonFrames ();
16089 var mappedColumns =  new jalview.datamodel.ColumnSelection ();
16090 if (colsel == null) {
16091 return mappedColumns;
16092 }var fromGapChar = mapFrom.getAlignment ().getGapCharacter ();
16093 for (var obj, $obj = colsel.getSelected ().iterator (); $obj.hasNext () && ((obj = $obj.next ()) || true);) {
16094 var col = (obj).intValue ();
16095 var mappedToMin = 2147483647;
16096 var mappedToMax = -2147483648;
16097 for (var fromSeq, $fromSeq = mapFrom.getAlignment ().getSequences ().iterator (); $fromSeq.hasNext () && ((fromSeq = $fromSeq.next ()) || true);) {
16098 if (fromSeq.getCharAt (col) == fromGapChar) {
16099 continue;
16100 }var residuePos = fromSeq.findPosition (col);
16101 var sr = jalview.util.MappingUtils.buildSearchResults (fromSeq, residuePos, codonFrames);
16102 for (var m, $m = sr.getResults ().iterator (); $m.hasNext () && ((m = $m.next ()) || true);) {
16103 var mappedStartResidue = m.getStart ();
16104 var mappedEndResidue = m.getEnd ();
16105 var mappedSeq = m.getSequence ();
16106 for (var toSeq, $toSeq = mapTo.getAlignment ().getSequences ().iterator (); $toSeq.hasNext () && ((toSeq = $toSeq.next ()) || true);) {
16107 if (toSeq.getDatasetSequence () === mappedSeq) {
16108 var mappedStartCol = toSeq.findIndex (mappedStartResidue);
16109 var mappedEndCol = toSeq.findIndex (mappedEndResidue);
16110 mappedToMin = Math.min (mappedToMin, mappedStartCol);
16111 mappedToMax = Math.max (mappedToMax, mappedEndCol);
16112 break;
16113 }}
16114 }
16115 }
16116 for (var i = mappedToMin; i <= mappedToMax; i++) {
16117 mappedColumns.addElement (i - 1);
16118 }
16119 }
16120 return mappedColumns;
16121 }, "jalview.datamodel.ColumnSelection,jalview.api.AlignViewportI,jalview.api.AlignViewportI");
16122 c$.findCodonFor = Clazz_defineMethod (c$, "findCodonFor", 
16123 function (seq, col, mappings) {
16124 var dsPos = seq.findPosition (col);
16125 for (var mapping, $mapping = mappings.iterator (); $mapping.hasNext () && ((mapping = $mapping.next ()) || true);) {
16126 if (mapping.involvesSequence (seq)) {
16127 return mapping.getMappedCodon (seq.getDatasetSequence (), dsPos);
16128 }}
16129 return null;
16130 }, "jalview.datamodel.SequenceI,~N,java.util.Set");
16131 c$.flattenRanges = Clazz_defineMethod (c$, "flattenRanges", 
16132 function (ranges) {
16133 var count = 0;
16134 for (var i = 0; i < ranges.length - 1; i += 2) {
16135 count += ranges[i + 1] - ranges[i] + 1;
16136 }
16137 var result =  Clazz_newIntArray (count, 0);
16138 var k = 0;
16139 for (var i = 0; i < ranges.length - 1; i += 2) {
16140 for (var j = ranges[i]; j <= ranges[i + 1]; j++) {
16141 result[k++] = j;
16142 }
16143 }
16144 return result;
16145 }, "~A");
16146 c$.findMappingsForSequence = Clazz_defineMethod (c$, "findMappingsForSequence", 
16147 function (sequence, mappings) {
16148 var result =  new java.util.ArrayList ();
16149 if (sequence == null || mappings == null) {
16150 return result;
16151 }for (var mapping, $mapping = mappings.iterator (); $mapping.hasNext () && ((mapping = $mapping.next ()) || true);) {
16152 if (mapping.involvesSequence (sequence)) {
16153 result.add (mapping);
16154 }}
16155 return result;
16156 }, "jalview.datamodel.SequenceI,java.util.Set");
16157 });
16158 Clazz_declarePackage ("jalview.commands");
16159 Clazz_load (["jalview.commands.CommandI", "java.lang.Enum", "java.util.ArrayList"], "jalview.commands.EditCommand", ["jalview.analysis.AlignSeq", "jalview.datamodel.AlignmentAnnotation", "$.Annotation", "$.Sequence", "$.SequenceFeature", "jalview.schemes.ResidueProperties", "jalview.util.Comparison", "$.ReverseListIterator", "$.StringUtils", "java.lang.StringBuffer", "java.util.HashMap", "$.Hashtable"], function () {
16160 c$ = Clazz_decorateAsClass (function () {
16161 this.edits = null;
16162 this.description = null;
16163 if (!Clazz_isClassDefined ("jalview.commands.EditCommand.Edit")) {
16164 jalview.commands.EditCommand.$EditCommand$Edit$ ();
16165 }
16166 Clazz_instantialize (this, arguments);
16167 }, jalview.commands, "EditCommand", null, jalview.commands.CommandI);
16168 Clazz_prepareFields (c$, function () {
16169 this.edits =  new java.util.ArrayList ();
16170 });
16171 Clazz_makeConstructor (c$, 
16172 function () {
16173 });
16174 Clazz_makeConstructor (c$, 
16175 function (description) {
16176 this.description = description;
16177 }, "~S");
16178 Clazz_makeConstructor (c$, 
16179 function (description, command, seqs, position, number, al) {
16180 this.description = description;
16181 if (command === jalview.commands.EditCommand.Action.CUT || command === jalview.commands.EditCommand.Action.PASTE) {
16182 this.setEdit (Clazz_innerTypeInstance (jalview.commands.EditCommand.Edit, this, null, command, seqs, position, number, al));
16183 }this.performEdit (0, null);
16184 }, "~S,jalview.commands.EditCommand.Action,~A,~N,~N,jalview.datamodel.AlignmentI");
16185 Clazz_makeConstructor (c$, 
16186 function (description, command, replace, seqs, position, number, al) {
16187 this.description = description;
16188 if (command === jalview.commands.EditCommand.Action.REPLACE) {
16189 this.setEdit (Clazz_innerTypeInstance (jalview.commands.EditCommand.Edit, this, null, command, seqs, position, number, al, replace));
16190 }this.performEdit (0, null);
16191 }, "~S,jalview.commands.EditCommand.Action,~S,~A,~N,~N,jalview.datamodel.AlignmentI");
16192 Clazz_defineMethod (c$, "setEdit", 
16193 function (e) {
16194 this.edits.clear ();
16195 this.edits.add (e);
16196 }, "jalview.commands.EditCommand.Edit");
16197 Clazz_defineMethod (c$, "addEdit", 
16198 function (e) {
16199 if (!jalview.commands.EditCommand.expandEdit (this.edits, e)) {
16200 this.edits.add (e);
16201 }}, "jalview.commands.EditCommand.Edit");
16202 c$.expandEdit = Clazz_defineMethod (c$, "expandEdit", 
16203 function (edits, e) {
16204 if (edits == null || edits.isEmpty ()) {
16205 return false;
16206 }var lastEdit = edits.get (edits.size () - 1);
16207 var action = e.command;
16208 if (lastEdit.command !== action) {
16209 return false;
16210 }if (lastEdit.seqs.length != e.seqs.length) {
16211 return false;
16212 }for (var i = 0; i < e.seqs.length; i++) {
16213 if (lastEdit.seqs[i].getDatasetSequence () !== e.seqs[i].getDatasetSequence ()) {
16214 return false;
16215 }}
16216 var contiguous = (action === jalview.commands.EditCommand.Action.INSERT_GAP && e.position == lastEdit.position + lastEdit.number) || (action === jalview.commands.EditCommand.Action.DELETE_GAP && e.position + e.number == lastEdit.position);
16217 if (contiguous) {
16218 lastEdit.number += e.number;
16219 lastEdit.seqs = e.seqs;
16220 if (action === jalview.commands.EditCommand.Action.DELETE_GAP) {
16221 lastEdit.position--;
16222 }return true;
16223 }return false;
16224 }, "java.util.List,jalview.commands.EditCommand.Edit");
16225 Clazz_defineMethod (c$, "clearEdits", 
16226 function () {
16227 this.edits.clear ();
16228 });
16229 Clazz_defineMethod (c$, "getEdit", 
16230 function (i) {
16231 if (i >= 0 && i < this.edits.size ()) {
16232 return this.edits.get (i);
16233 }return null;
16234 }, "~N");
16235 Clazz_overrideMethod (c$, "getDescription", 
16236 function () {
16237 return this.description;
16238 });
16239 Clazz_overrideMethod (c$, "getSize", 
16240 function () {
16241 return this.edits.size ();
16242 });
16243 Clazz_defineMethod (c$, "getAlignment", 
16244 function () {
16245 return (this.edits.isEmpty () ? null : this.edits.get (0).al);
16246 });
16247 Clazz_defineMethod (c$, "appendEdit", 
16248 function (command, seqs, position, number, al, performEdit) {
16249 this.appendEdit (command, seqs, position, number, al, performEdit, null);
16250 }, "jalview.commands.EditCommand.Action,~A,~N,~N,jalview.datamodel.AlignmentI,~B");
16251 Clazz_defineMethod (c$, "appendEdit", 
16252 function (command, seqs, position, number, al, performEdit, views) {
16253 var edit = Clazz_innerTypeInstance (jalview.commands.EditCommand.Edit, this, null, command, seqs, position, number, al.getGapCharacter ());
16254 if (al.getHeight () == seqs.length) {
16255 edit.al = al;
16256 edit.fullAlignmentHeight = true;
16257 }this.addEdit (edit);
16258 if (performEdit) {
16259 jalview.commands.EditCommand.performEdit (edit, views);
16260 }}, "jalview.commands.EditCommand.Action,~A,~N,~N,jalview.datamodel.AlignmentI,~B,~A");
16261 Clazz_defineMethod (c$, "appendEdit", 
16262 function (edit, al, performEdit, views) {
16263 if (al.getHeight () == edit.seqs.length) {
16264 edit.al = al;
16265 edit.fullAlignmentHeight = true;
16266 }this.addEdit (edit);
16267 if (performEdit) {
16268 jalview.commands.EditCommand.performEdit (edit, views);
16269 }}, "jalview.commands.EditCommand.Edit,jalview.datamodel.AlignmentI,~B,~A");
16270 Clazz_defineMethod (c$, "performEdit", 
16271 function (commandIndex, views) {
16272 var iterator = this.edits.listIterator (commandIndex);
16273 while (iterator.hasNext ()) {
16274 var edit = iterator.next ();
16275 jalview.commands.EditCommand.performEdit (edit, views);
16276 }
16277 }, "~N,~A");
16278 c$.performEdit = Clazz_defineMethod (c$, "performEdit", 
16279 function (edit, views) {
16280 switch (edit.command) {
16281 case jalview.commands.EditCommand.Action.INSERT_GAP:
16282 jalview.commands.EditCommand.insertGap (edit);
16283 break;
16284 case jalview.commands.EditCommand.Action.DELETE_GAP:
16285 jalview.commands.EditCommand.deleteGap (edit);
16286 break;
16287 case jalview.commands.EditCommand.Action.CUT:
16288 jalview.commands.EditCommand.cut (edit, views);
16289 break;
16290 case jalview.commands.EditCommand.Action.PASTE:
16291 jalview.commands.EditCommand.paste (edit, views);
16292 break;
16293 case jalview.commands.EditCommand.Action.REPLACE:
16294 jalview.commands.EditCommand.replace (edit);
16295 break;
16296 case jalview.commands.EditCommand.Action.INSERT_NUC:
16297 break;
16298 default:
16299 break;
16300 }
16301 }, "jalview.commands.EditCommand.Edit,~A");
16302 Clazz_overrideMethod (c$, "doCommand", 
16303 function (views) {
16304 this.performEdit (0, views);
16305 }, "~A");
16306 Clazz_overrideMethod (c$, "undoCommand", 
16307 function (views) {
16308 var iterator = this.edits.listIterator (this.edits.size ());
16309 while (iterator.hasPrevious ()) {
16310 var e = iterator.previous ();
16311 switch (e.command) {
16312 case jalview.commands.EditCommand.Action.INSERT_GAP:
16313 jalview.commands.EditCommand.deleteGap (e);
16314 break;
16315 case jalview.commands.EditCommand.Action.DELETE_GAP:
16316 jalview.commands.EditCommand.insertGap (e);
16317 break;
16318 case jalview.commands.EditCommand.Action.CUT:
16319 jalview.commands.EditCommand.paste (e, views);
16320 break;
16321 case jalview.commands.EditCommand.Action.PASTE:
16322 jalview.commands.EditCommand.cut (e, views);
16323 break;
16324 case jalview.commands.EditCommand.Action.REPLACE:
16325 jalview.commands.EditCommand.replace (e);
16326 break;
16327 case jalview.commands.EditCommand.Action.INSERT_NUC:
16328 break;
16329 default:
16330 break;
16331 }
16332 }
16333 }, "~A");
16334 c$.insertGap = Clazz_defineMethod (c$, "insertGap", 
16335  function (command) {
16336 for (var s = 0; s < command.seqs.length; s++) {
16337 command.seqs[s].insertCharAt (command.position, command.number, command.gapChar);
16338 }
16339 jalview.commands.EditCommand.adjustAnnotations (command, true, false, null);
16340 }, "jalview.commands.EditCommand.Edit");
16341 c$.deleteGap = Clazz_defineMethod (c$, "deleteGap", 
16342  function (command) {
16343 for (var s = 0; s < command.seqs.length; s++) {
16344 command.seqs[s].deleteChars (command.position, command.position + command.number);
16345 }
16346 jalview.commands.EditCommand.adjustAnnotations (command, false, false, null);
16347 }, "jalview.commands.EditCommand.Edit");
16348 c$.cut = Clazz_defineMethod (c$, "cut", 
16349 function (command, views) {
16350 var seqDeleted = false;
16351 command.string =  Clazz_newCharArray (command.seqs.length, '\0');
16352 for (var i = 0; i < command.seqs.length; i++) {
16353 var sequence = command.seqs[i];
16354 if (sequence.getLength () > command.position) {
16355 command.string[i] = sequence.getSequence (command.position, command.position + command.number);
16356 var oldds = sequence.getDatasetSequence ();
16357 if (command.oldds != null && command.oldds[i] != null) {
16358 sequence.setDatasetSequence (null);
16359 }sequence.deleteChars (command.position, command.position + command.number);
16360 if (command.oldds != null && command.oldds[i] != null) {
16361 sequence.setDatasetSequence (command.oldds[i]);
16362 command.oldds[i] = oldds;
16363 } else {
16364 if (oldds !== sequence.getDatasetSequence () || sequence.getSequenceFeatures () != null) {
16365 if (command.oldds == null) {
16366 command.oldds =  new Array (command.seqs.length);
16367 }command.oldds[i] = oldds;
16368 jalview.commands.EditCommand.adjustFeatures (command, i, sequence.findPosition (command.position), sequence.findPosition (command.position + command.number), false);
16369 }}}if (sequence.getLength () < 1) {
16370 command.al.deleteSequence (sequence);
16371 seqDeleted = true;
16372 }}
16373 jalview.commands.EditCommand.adjustAnnotations (command, false, seqDeleted, views);
16374 }, "jalview.commands.EditCommand.Edit,~A");
16375 c$.paste = Clazz_defineMethod (c$, "paste", 
16376 function (command, views) {
16377 var tmp;
16378 var newDSNeeded;
16379 var newDSWasNeeded;
16380 var newstart;
16381 var newend;
16382 var seqWasDeleted = false;
16383 var start = 0;
16384 var end = 0;
16385 for (var i = 0; i < command.seqs.length; i++) {
16386 newDSNeeded = false;
16387 newDSWasNeeded = command.oldds != null && command.oldds[i] != null;
16388 if (command.seqs[i].getLength () < 1) {
16389 if (command.alIndex[i] < command.al.getHeight ()) {
16390 var sequences;
16391 {
16392 if (!(command.alIndex[i] < 0)) {
16393 sequences.add (command.alIndex[i], command.seqs[i]);
16394 }}} else {
16395 command.al.addSequence (command.seqs[i]);
16396 }seqWasDeleted = true;
16397 }newstart = command.seqs[i].getStart ();
16398 newend = command.seqs[i].getEnd ();
16399 tmp =  new StringBuffer ();
16400 tmp.append (command.seqs[i].getSequence ());
16401 if (command.string != null && command.string[i] != null) {
16402 if (command.position >= tmp.length ()) {
16403 var length = command.position - tmp.length ();
16404 while (length > 0) {
16405 tmp.append (command.gapChar);
16406 length--;
16407 }
16408 }tmp.insert (command.position, command.string[i]);
16409 for (var s = 0; s < command.string[i].length; s++) {
16410 if (jalview.schemes.ResidueProperties.aaIndex[command.string[i][s].charCodeAt (0)] != 23) {
16411 if (!newDSNeeded) {
16412 newDSNeeded = true;
16413 start = command.seqs[i].findPosition (command.position);
16414 end = command.seqs[i].findPosition (command.position + command.number);
16415 }if (command.seqs[i].getStart () == start) {
16416 newstart--;
16417 } else {
16418 newend++;
16419 }}}
16420 command.string[i] = null;
16421 }command.seqs[i].setSequence (tmp.toString ());
16422 command.seqs[i].setStart (newstart);
16423 command.seqs[i].setEnd (newend);
16424 if (newDSNeeded) {
16425 if (command.seqs[i].getDatasetSequence () != null) {
16426 var ds;
16427 if (newDSWasNeeded) {
16428 ds = command.oldds[i];
16429 } else {
16430 ds =  new jalview.datamodel.Sequence (command.seqs[i].getName (), jalview.analysis.AlignSeq.extractGaps (jalview.util.Comparison.GapChars, command.seqs[i].getSequenceAsString ()), command.seqs[i].getStart (), command.seqs[i].getEnd ());
16431 ds.setDescription (command.seqs[i].getDescription ());
16432 }if (command.oldds == null) {
16433 command.oldds =  new Array (command.seqs.length);
16434 }command.oldds[i] = command.seqs[i].getDatasetSequence ();
16435 command.seqs[i].setDatasetSequence (ds);
16436 }jalview.commands.EditCommand.adjustFeatures (command, i, start, end, true);
16437 }}
16438 jalview.commands.EditCommand.adjustAnnotations (command, true, seqWasDeleted, views);
16439 command.string = null;
16440 }, "jalview.commands.EditCommand.Edit,~A");
16441 c$.replace = Clazz_defineMethod (c$, "replace", 
16442 function (command) {
16443 var tmp;
16444 var oldstring;
16445 var start = command.position;
16446 var end = command.number;
16447 command.number = start + command.string[0].length;
16448 for (var i = 0; i < command.seqs.length; i++) {
16449 var newDSWasNeeded = command.oldds != null && command.oldds[i] != null;
16450 oldstring = command.seqs[i].getSequenceAsString ();
16451 tmp =  new StringBuffer (oldstring.substring (0, start));
16452 tmp.append (command.string[i]);
16453 var nogaprep = jalview.analysis.AlignSeq.extractGaps (jalview.util.Comparison.GapChars,  String.instantialize (command.string[i]));
16454 var ipos = command.seqs[i].findPosition (start) - command.seqs[i].getStart ();
16455 tmp.append (oldstring.substring (end));
16456 command.seqs[i].setSequence (tmp.toString ());
16457 command.string[i] = oldstring.substring (start, end).toCharArray ();
16458 var nogapold = jalview.analysis.AlignSeq.extractGaps (jalview.util.Comparison.GapChars,  String.instantialize (command.string[i]));
16459 if (!nogaprep.toLowerCase ().equals (nogapold.toLowerCase ())) {
16460 if (newDSWasNeeded) {
16461 var oldds = command.seqs[i].getDatasetSequence ();
16462 command.seqs[i].setDatasetSequence (command.oldds[i]);
16463 command.oldds[i] = oldds;
16464 } else {
16465 if (command.oldds == null) {
16466 command.oldds =  new Array (command.seqs.length);
16467 }command.oldds[i] = command.seqs[i].getDatasetSequence ();
16468 var newds =  new jalview.datamodel.Sequence (command.seqs[i].getDatasetSequence ());
16469 var fullseq;
16470 var osp = newds.getSequenceAsString ();
16471 fullseq = osp.substring (0, ipos) + nogaprep + osp.substring (ipos + nogaprep.length);
16472 newds.setSequence (fullseq.toUpperCase ());
16473 command.seqs[i].setDatasetSequence (newds);
16474 }}tmp = null;
16475 oldstring = null;
16476 }
16477 }, "jalview.commands.EditCommand.Edit");
16478 c$.adjustAnnotations = Clazz_defineMethod (c$, "adjustAnnotations", 
16479 function (command, insert, modifyVisibility, views) {
16480 var annotations = null;
16481 if (modifyVisibility && !insert) {
16482 command.deletedAnnotationRows =  new java.util.Hashtable ();
16483 }if (command.fullAlignmentHeight) {
16484 annotations = command.al.getAlignmentAnnotation ();
16485 } else {
16486 var aSize = 0;
16487 var tmp;
16488 for (var s = 0; s < command.seqs.length; s++) {
16489 if (modifyVisibility) {
16490 if (!insert) {
16491 tmp = command.seqs[s].getAnnotation ();
16492 if (tmp != null) {
16493 var alen = tmp.length;
16494 for (var aa = 0; aa < tmp.length; aa++) {
16495 if (!command.al.deleteAnnotation (tmp[aa])) {
16496 tmp[aa] = null;
16497 alen--;
16498 }}
16499 command.seqs[s].setAlignmentAnnotation (null);
16500 if (alen != tmp.length) {
16501 var saved =  new Array (alen);
16502 for (var aa = 0, aapos = 0; aa < tmp.length; aa++) {
16503 if (tmp[aa] != null) {
16504 saved[aapos++] = tmp[aa];
16505 tmp[aa] = null;
16506 }}
16507 tmp = saved;
16508 command.deletedAnnotationRows.put (command.seqs[s], saved);
16509 for (var alview = 0; views != null && alview < views.length; alview++) {
16510 if (views[alview] !== command.al) {
16511 var toremove = views[alview].getAlignmentAnnotation ();
16512 if (toremove == null || toremove.length == 0) {
16513 continue;
16514 }for (var aa = 0; aa < toremove.length; aa++) {
16515 if (toremove[aa].sequenceRef === command.seqs[s]) {
16516 views[alview].deleteAnnotation (toremove[aa]);
16517 }}
16518 }}
16519 } else {
16520 command.deletedAnnotationRows.put (command.seqs[s], tmp);
16521 }}} else {
16522 if (command.deletedAnnotationRows != null && command.deletedAnnotationRows.containsKey (command.seqs[s])) {
16523 var revealed = command.deletedAnnotationRows.get (command.seqs[s]);
16524 command.seqs[s].setAlignmentAnnotation (revealed);
16525 if (revealed != null) {
16526 for (var aa = 0; aa < revealed.length; aa++) {
16527 command.al.addAnnotation (revealed[aa]);
16528 }
16529 for (var aa = 0; aa < revealed.length; aa++) {
16530 command.al.setAnnotationIndex (revealed[aa], aa);
16531 }
16532 for (var vnum = 0; views != null && vnum < views.length; vnum++) {
16533 if (views[vnum] !== command.al) {
16534 var avwidth = views[vnum].getWidth () + 1;
16535 for (var a = 0; a < revealed.length; a++) {
16536 var newann =  new jalview.datamodel.AlignmentAnnotation (revealed[a]);
16537 command.seqs[s].addAlignmentAnnotation (newann);
16538 newann.padAnnotation (avwidth);
16539 views[vnum].addAnnotation (newann);
16540 views[vnum].setAnnotationIndex (newann, a);
16541 }
16542 }}
16543 }}}continue;
16544 }if (command.seqs[s].getAnnotation () == null) {
16545 continue;
16546 }if (aSize == 0) {
16547 annotations = command.seqs[s].getAnnotation ();
16548 } else {
16549 tmp =  new Array (aSize + command.seqs[s].getAnnotation ().length);
16550 System.arraycopy (annotations, 0, tmp, 0, aSize);
16551 System.arraycopy (command.seqs[s].getAnnotation (), 0, tmp, aSize, command.seqs[s].getAnnotation ().length);
16552 annotations = tmp;
16553 }aSize = annotations.length;
16554 }
16555 }if (annotations == null) {
16556 return;
16557 }if (!insert) {
16558 command.deletedAnnotations =  new java.util.Hashtable ();
16559 }var aSize;
16560 var temp;
16561 for (var a = 0; a < annotations.length; a++) {
16562 if (annotations[a].autoCalculated || annotations[a].annotations == null) {
16563 continue;
16564 }var tSize = 0;
16565 aSize = annotations[a].annotations.length;
16566 if (insert) {
16567 temp =  new Array (aSize + command.number);
16568 if (annotations[a].padGaps) {
16569 for (var aa = 0; aa < temp.length; aa++) {
16570 temp[aa] =  new jalview.datamodel.Annotation (command.gapChar + "", null, ' ', 0);
16571 }
16572 }} else {
16573 if (command.position < aSize) {
16574 if (command.position + command.number >= aSize) {
16575 tSize = aSize;
16576 } else {
16577 tSize = aSize - command.number;
16578 }} else {
16579 tSize = aSize;
16580 }if (tSize < 0) {
16581 tSize = aSize;
16582 }temp =  new Array (tSize);
16583 }if (insert) {
16584 if (command.position < annotations[a].annotations.length) {
16585 System.arraycopy (annotations[a].annotations, 0, temp, 0, command.position);
16586 if (command.deletedAnnotations != null && command.deletedAnnotations.containsKey (annotations[a].annotationId)) {
16587 var restore = command.deletedAnnotations.get (annotations[a].annotationId);
16588 System.arraycopy (restore, 0, temp, command.position, command.number);
16589 }System.arraycopy (annotations[a].annotations, command.position, temp, command.position + command.number, aSize - command.position);
16590 } else {
16591 if (command.deletedAnnotations != null && command.deletedAnnotations.containsKey (annotations[a].annotationId)) {
16592 var restore = command.deletedAnnotations.get (annotations[a].annotationId);
16593 temp =  new Array (annotations[a].annotations.length + restore.length);
16594 System.arraycopy (annotations[a].annotations, 0, temp, 0, annotations[a].annotations.length);
16595 System.arraycopy (restore, 0, temp, annotations[a].annotations.length, restore.length);
16596 } else {
16597 temp = annotations[a].annotations;
16598 }}} else {
16599 if (tSize != aSize || command.position < 2) {
16600 var copylen = Math.min (command.position, annotations[a].annotations.length);
16601 if (copylen > 0) {
16602 System.arraycopy (annotations[a].annotations, 0, temp, 0, copylen);
16603 }var deleted =  new Array (command.number);
16604 if (copylen >= command.position) {
16605 copylen = Math.min (command.number, annotations[a].annotations.length - command.position);
16606 if (copylen > 0) {
16607 System.arraycopy (annotations[a].annotations, command.position, deleted, 0, copylen);
16608 }}command.deletedAnnotations.put (annotations[a].annotationId, deleted);
16609 if (annotations[a].annotations.length > command.position + command.number) {
16610 System.arraycopy (annotations[a].annotations, command.position + command.number, temp, command.position, annotations[a].annotations.length - command.position - command.number);
16611 }} else {
16612 var dSize = aSize - command.position;
16613 if (dSize > 0) {
16614 var deleted =  new Array (command.number);
16615 System.arraycopy (annotations[a].annotations, command.position, deleted, 0, dSize);
16616 command.deletedAnnotations.put (annotations[a].annotationId, deleted);
16617 tSize = Math.min (annotations[a].annotations.length, command.position);
16618 temp =  new Array (tSize);
16619 System.arraycopy (annotations[a].annotations, 0, temp, 0, tSize);
16620 } else {
16621 temp = annotations[a].annotations;
16622 }}}annotations[a].annotations = temp;
16623 }
16624 }, "jalview.commands.EditCommand.Edit,~B,~B,~A");
16625 c$.adjustFeatures = Clazz_defineMethod (c$, "adjustFeatures", 
16626 function (command, index, i, j, insert) {
16627 var seq = command.seqs[index];
16628 var sequence = seq.getDatasetSequence ();
16629 if (sequence == null) {
16630 sequence = seq;
16631 }if (insert) {
16632 if (command.editedFeatures != null && command.editedFeatures.containsKey (seq)) {
16633 sequence.setSequenceFeatures (command.editedFeatures.get (seq));
16634 }return;
16635 }var sf = sequence.getSequenceFeatures ();
16636 if (sf == null) {
16637 return;
16638 }var oldsf =  new Array (sf.length);
16639 var cSize = j - i;
16640 for (var s = 0; s < sf.length; s++) {
16641 var copy =  new jalview.datamodel.SequenceFeature (sf[s]);
16642 oldsf[s] = copy;
16643 if (sf[s].getEnd () < i) {
16644 continue;
16645 }if (sf[s].getBegin () > j) {
16646 sf[s].setBegin (copy.getBegin () - cSize);
16647 sf[s].setEnd (copy.getEnd () - cSize);
16648 continue;
16649 }if (sf[s].getBegin () >= i) {
16650 sf[s].setBegin (i);
16651 }if (sf[s].getEnd () < j) {
16652 sf[s].setEnd (j - 1);
16653 }sf[s].setEnd (sf[s].getEnd () - (cSize));
16654 if (sf[s].getBegin () > sf[s].getEnd ()) {
16655 sequence.deleteFeature (sf[s]);
16656 }}
16657 if (command.editedFeatures == null) {
16658 command.editedFeatures =  new java.util.Hashtable ();
16659 }command.editedFeatures.put (seq, oldsf);
16660 }, "jalview.commands.EditCommand.Edit,~N,~N,~N,~B");
16661 Clazz_defineMethod (c$, "getEdits", 
16662 function () {
16663 return this.edits;
16664 });
16665 Clazz_defineMethod (c$, "priorState", 
16666 function (forUndo) {
16667 var result =  new java.util.HashMap ();
16668 if (this.getEdits () == null) {
16669 return result;
16670 }if (forUndo) {
16671 for (var e, $e = this.getEdits ().iterator (); $e.hasNext () && ((e = $e.next ()) || true);) {
16672 for (var seq, $seq = 0, $$seq = e.getSequences (); $seq < $$seq.length && ((seq = $$seq[$seq]) || true); $seq++) {
16673 var ds = seq.getDatasetSequence ();
16674 var preEdit = result.get (ds);
16675 if (preEdit == null) {
16676 preEdit =  new jalview.datamodel.Sequence ("", seq.getSequenceAsString ());
16677 preEdit.setDatasetSequence (ds);
16678 result.put (ds, preEdit);
16679 }}
16680 }
16681 return result;
16682 }var edits =  new jalview.util.ReverseListIterator (this.getEdits ());
16683 while (edits.hasNext ()) {
16684 var oldEdit = edits.next ();
16685 var action = oldEdit.getAction ();
16686 var position = oldEdit.getPosition ();
16687 var number = oldEdit.getNumber ();
16688 var gap = oldEdit.getGapCharacter ();
16689 for (var seq, $seq = 0, $$seq = oldEdit.getSequences (); $seq < $$seq.length && ((seq = $$seq[$seq]) || true); $seq++) {
16690 var ds = seq.getDatasetSequence ();
16691 var preEdit = result.get (ds);
16692 if (preEdit == null) {
16693 preEdit =  new jalview.datamodel.Sequence ("", seq.getSequenceAsString ());
16694 preEdit.setDatasetSequence (ds);
16695 result.put (ds, preEdit);
16696 }if (ds != null) {
16697 if (action === jalview.commands.EditCommand.Action.DELETE_GAP) {
16698 preEdit.setSequence ( String.instantialize (jalview.util.StringUtils.insertCharAt (preEdit.getSequence (), position, number, gap)));
16699 } else if (action === jalview.commands.EditCommand.Action.INSERT_GAP) {
16700 preEdit.setSequence ( String.instantialize (jalview.util.StringUtils.deleteChars (preEdit.getSequence (), position, position + number)));
16701 } else {
16702 System.err.println ("Can't undo edit action " + action);
16703 }}}
16704 }
16705 return result;
16706 }, "~B");
16707 Clazz_defineMethod (c$, "getEditIterator", 
16708 function (forwards) {
16709 if (forwards) {
16710 return this.getEdits ().iterator ();
16711 } else {
16712 return  new jalview.util.ReverseListIterator (this.getEdits ());
16713 }}, "~B");
16714 c$.$EditCommand$Edit$ = function () {
16715 Clazz_pu$h(self.c$);
16716 c$ = Clazz_decorateAsClass (function () {
16717 Clazz_prepareCallback (this, arguments);
16718 this.oldds = null;
16719 this.fullAlignmentHeight = false;
16720 this.deletedAnnotationRows = null;
16721 this.deletedAnnotations = null;
16722 this.editedFeatures = null;
16723 this.al = null;
16724 this.command = null;
16725 this.string = null;
16726 this.seqs = null;
16727 this.alIndex = null;
16728 this.position = 0;
16729 this.number = 0;
16730 this.gapChar = '\0';
16731 Clazz_instantialize (this, arguments);
16732 }, jalview.commands.EditCommand, "Edit");
16733 Clazz_makeConstructor (c$, 
16734 function (a, b, c, d, e) {
16735 this.command = a;
16736 this.seqs = b;
16737 this.position = c;
16738 this.number = d;
16739 this.gapChar = e;
16740 }, "jalview.commands.EditCommand.Action,~A,~N,~N,~S");
16741 Clazz_makeConstructor (c$, 
16742 function (a, b, c, d, e) {
16743 this.gapChar = e.getGapCharacter ();
16744 this.command = a;
16745 this.seqs = b;
16746 this.position = c;
16747 this.number = d;
16748 this.al = e;
16749 this.alIndex =  Clazz_newIntArray (b.length, 0);
16750 for (var f = 0; f < b.length; f++) {
16751 this.alIndex[f] = e.findIndex (b[f]);
16752 }
16753 this.fullAlignmentHeight = (e.getHeight () == b.length);
16754 }, "jalview.commands.EditCommand.Action,~A,~N,~N,jalview.datamodel.AlignmentI");
16755 Clazz_makeConstructor (c$, 
16756 function (a, b, c, d, e, f) {
16757 this.command = a;
16758 this.seqs = b;
16759 this.position = c;
16760 this.number = d;
16761 this.al = e;
16762 this.gapChar = e.getGapCharacter ();
16763 this.string =  Clazz_newCharArray (b.length, '\0');
16764 for (var g = 0; g < b.length; g++) {
16765 this.string[g] = f.toCharArray ();
16766 }
16767 this.fullAlignmentHeight = (e.getHeight () == b.length);
16768 }, "jalview.commands.EditCommand.Action,~A,~N,~N,jalview.datamodel.AlignmentI,~S");
16769 Clazz_defineMethod (c$, "getSequences", 
16770 function () {
16771 return this.seqs;
16772 });
16773 Clazz_defineMethod (c$, "getPosition", 
16774 function () {
16775 return this.position;
16776 });
16777 Clazz_defineMethod (c$, "getAction", 
16778 function () {
16779 return this.command;
16780 });
16781 Clazz_defineMethod (c$, "getNumber", 
16782 function () {
16783 return this.number;
16784 });
16785 Clazz_defineMethod (c$, "getGapCharacter", 
16786 function () {
16787 return this.gapChar;
16788 });
16789 c$ = Clazz_p0p ();
16790 };
16791 Clazz_pu$h(self.c$);
16792 c$ = Clazz_declareType (jalview.commands.EditCommand, "Action", Enum);
16793 Clazz_defineMethod (c$, "getUndoAction", 
16794 function () {
16795 switch (this) {
16796 case jalview.commands.EditCommand.Action.INSERT_GAP:
16797 return jalview.commands.EditCommand.Action.DELETE_GAP;
16798 case jalview.commands.EditCommand.Action.CUT:
16799 return jalview.commands.EditCommand.Action.PASTE;
16800 case jalview.commands.EditCommand.Action.DELETE_GAP:
16801 return jalview.commands.EditCommand.Action.INSERT_GAP;
16802 case jalview.commands.EditCommand.Action.INSERT_NUC:
16803 return null;
16804 case jalview.commands.EditCommand.Action.PASTE:
16805 return jalview.commands.EditCommand.Action.CUT;
16806 case jalview.commands.EditCommand.Action.REPLACE:
16807 return jalview.commands.EditCommand.Action.REPLACE;
16808 }
16809 return null;
16810 });
16811 Clazz_defineEnumConstant (c$, "INSERT_GAP", 0, []);
16812 Clazz_defineEnumConstant (c$, "DELETE_GAP", 1, []);
16813 Clazz_defineEnumConstant (c$, "CUT", 2, []);
16814 Clazz_defineEnumConstant (c$, "PASTE", 3, []);
16815 Clazz_defineEnumConstant (c$, "REPLACE", 4, []);
16816 Clazz_defineEnumConstant (c$, "INSERT_NUC", 5, []);
16817 c$ = Clazz_p0p ();
16818 });
16819 Clazz_declarePackage ("jalview.commands");
16820 Clazz_declareInterface (jalview.commands, "CommandI");
16821 Clazz_declarePackage ("jalview.analysis");
16822 Clazz_load (["jalview.schemes.ResidueProperties", "java.lang.StringBuffer"], "jalview.analysis.AlignSeq", ["jalview.datamodel.Mapping", "$.Sequence", "jalview.util.Comparison", "$.Format", "$.MapList", "$.MessageManager", "java.awt.Color", "java.lang.Error", "$.StringBuilder", "java.util.ArrayList", "$.Arrays", "$.StringTokenizer"], function () {
16823 c$ = Clazz_decorateAsClass (function () {
16824 this.score = null;
16825 this.E = null;
16826 this.F = null;
16827 this.traceback = null;
16828 this.seq1 = null;
16829 this.seq2 = null;
16830 this.s1 = null;
16831 this.s2 = null;
16832 this.s1str = null;
16833 this.s2str = null;
16834 this.maxi = 0;
16835 this.maxj = 0;
16836 this.aseq1 = null;
16837 this.aseq2 = null;
16838 this.astr1 = "";
16839 this.astr2 = "";
16840 this.seq1start = 0;
16841 this.seq1end = 0;
16842 this.seq2start = 0;
16843 this.seq2end = 0;
16844 this.count = 0;
16845 this.maxscore = 0;
16846 this.pid = 0;
16847 this.prev = 0;
16848 this.gapOpen = 120;
16849 this.gapExtend = 20;
16850 this.lookup = null;
16851 this.intToStr = null;
16852 this.defInt = 23;
16853 this.output = null;
16854 this.type = null;
16855 this.charToInt = null;
16856 Clazz_instantialize (this, arguments);
16857 }, jalview.analysis, "AlignSeq");
16858 Clazz_prepareFields (c$, function () {
16859 this.lookup = jalview.schemes.ResidueProperties.getBLOSUM62 ();
16860 this.intToStr = jalview.analysis.AlignSeq.pep;
16861 this.output =  new StringBuffer ();
16862 });
16863 Clazz_makeConstructor (c$, 
16864 function (s1, s2, type) {
16865 this.SeqInit (s1, s1.getSequenceAsString (), s2, s2.getSequenceAsString (), type);
16866 }, "jalview.datamodel.SequenceI,jalview.datamodel.SequenceI,~S");
16867 Clazz_makeConstructor (c$, 
16868 function (s1, string1, s2, string2, type) {
16869 this.SeqInit (s1, string1.toUpperCase (), s2, string2.toUpperCase (), type);
16870 }, "jalview.datamodel.SequenceI,~S,jalview.datamodel.SequenceI,~S,~S");
16871 Clazz_defineMethod (c$, "getMaxScore", 
16872 function () {
16873 return this.maxscore;
16874 });
16875 Clazz_defineMethod (c$, "getSeq2Start", 
16876 function () {
16877 return this.seq2start;
16878 });
16879 Clazz_defineMethod (c$, "getSeq2End", 
16880 function () {
16881 return this.seq2end;
16882 });
16883 Clazz_defineMethod (c$, "getSeq1Start", 
16884 function () {
16885 return this.seq1start;
16886 });
16887 Clazz_defineMethod (c$, "getSeq1End", 
16888 function () {
16889 return this.seq1end;
16890 });
16891 Clazz_defineMethod (c$, "getOutput", 
16892 function () {
16893 return this.output.toString ();
16894 });
16895 Clazz_defineMethod (c$, "getAStr1", 
16896 function () {
16897 return this.astr1;
16898 });
16899 Clazz_defineMethod (c$, "getAStr2", 
16900 function () {
16901 return this.astr2;
16902 });
16903 Clazz_defineMethod (c$, "getASeq1", 
16904 function () {
16905 return this.aseq1;
16906 });
16907 Clazz_defineMethod (c$, "getASeq2", 
16908 function () {
16909 return this.aseq2;
16910 });
16911 Clazz_defineMethod (c$, "getS1", 
16912 function () {
16913 return this.s1;
16914 });
16915 Clazz_defineMethod (c$, "getS2", 
16916 function () {
16917 return this.s2;
16918 });
16919 Clazz_defineMethod (c$, "getAlignedSeq1", 
16920 function () {
16921 var alSeq1 =  new jalview.datamodel.Sequence (this.s1.getName (), this.getAStr1 ());
16922 alSeq1.setStart (this.s1.getStart () + this.getSeq1Start () - 1);
16923 alSeq1.setEnd (this.s1.getStart () + this.getSeq1End () - 1);
16924 alSeq1.setDatasetSequence (this.s1.getDatasetSequence () == null ? this.s1 : this.s1.getDatasetSequence ());
16925 return alSeq1;
16926 });
16927 Clazz_defineMethod (c$, "getAlignedSeq2", 
16928 function () {
16929 var alSeq2 =  new jalview.datamodel.Sequence (this.s2.getName (), this.getAStr2 ());
16930 alSeq2.setStart (this.s2.getStart () + this.getSeq2Start () - 1);
16931 alSeq2.setEnd (this.s2.getStart () + this.getSeq2End () - 1);
16932 alSeq2.setDatasetSequence (this.s2.getDatasetSequence () == null ? this.s2 : this.s2.getDatasetSequence ());
16933 return alSeq2;
16934 });
16935 Clazz_defineMethod (c$, "SeqInit", 
16936 function (s1, string1, s2, string2, type) {
16937 this.s1 = s1;
16938 this.s2 = s2;
16939 this.setDefaultParams (type);
16940 this.SeqInit (string1, string2);
16941 }, "jalview.datamodel.SequenceI,~S,jalview.datamodel.SequenceI,~S,~S");
16942 Clazz_defineMethod (c$, "SeqInit", 
16943 function (s1, string1, s2, string2, scoreMatrix) {
16944 this.s1 = s1;
16945 this.s2 = s2;
16946 this.setType (scoreMatrix.isDNA () ? "dna" : "pep");
16947 this.lookup = scoreMatrix.getMatrix ();
16948 }, "jalview.datamodel.SequenceI,~S,jalview.datamodel.SequenceI,~S,jalview.schemes.ScoreMatrix");
16949 Clazz_defineMethod (c$, "SeqInit", 
16950  function (string1, string2) {
16951 this.s1str = jalview.analysis.AlignSeq.extractGaps (jalview.util.Comparison.GapChars, string1);
16952 this.s2str = jalview.analysis.AlignSeq.extractGaps (jalview.util.Comparison.GapChars, string2);
16953 if (this.s1str.length == 0 || this.s2str.length == 0) {
16954 this.output.append ("ALL GAPS: " + (this.s1str.length == 0 ? this.s1.getName () : " ") + (this.s2str.length == 0 ? this.s2.getName () : ""));
16955 return;
16956 }this.seq1 =  Clazz_newIntArray (this.s1str.length, 0);
16957 this.seq2 =  Clazz_newIntArray (this.s2str.length, 0);
16958 this.score =  Clazz_newIntArray (this.s1str.length, this.s2str.length, 0);
16959 this.E =  Clazz_newIntArray (this.s1str.length, this.s2str.length, 0);
16960 this.F =  Clazz_newIntArray (this.s1str.length, this.s2str.length, 0);
16961 this.traceback =  Clazz_newIntArray (this.s1str.length, this.s2str.length, 0);
16962 this.seq1 = this.stringToInt (this.s1str, this.type);
16963 this.seq2 = this.stringToInt (this.s2str, this.type);
16964 }, "~S,~S");
16965 Clazz_defineMethod (c$, "setDefaultParams", 
16966  function (type) {
16967 this.setType (type);
16968 if (type.equals ("pep")) {
16969 this.lookup = jalview.schemes.ResidueProperties.getDefaultPeptideMatrix ();
16970 } else if (type.equals ("dna")) {
16971 this.lookup = jalview.schemes.ResidueProperties.getDefaultDnaMatrix ();
16972 }}, "~S");
16973 Clazz_defineMethod (c$, "setType", 
16974  function (type2) {
16975 this.type = type2;
16976 if (this.type.equals ("pep")) {
16977 this.intToStr = jalview.analysis.AlignSeq.pep;
16978 this.charToInt = jalview.schemes.ResidueProperties.aaIndex;
16979 this.defInt = 23;
16980 } else if (this.type.equals ("dna")) {
16981 this.intToStr = jalview.analysis.AlignSeq.dna;
16982 this.charToInt = jalview.schemes.ResidueProperties.nucleotideIndex;
16983 this.defInt = 10;
16984 } else {
16985 this.output.append ("Wrong type = dna or pep only");
16986 throw  new Error (jalview.util.MessageManager.formatMessage ("error.unknown_type_dna_or_pep",  Clazz_newArray (-1, [type2])));
16987 }}, "~S");
16988 Clazz_defineMethod (c$, "traceAlignment", 
16989 function () {
16990 var max = -9999;
16991 for (var i = 0; i < this.seq1.length; i++) {
16992 if (this.score[i][this.seq2.length - 1] > max) {
16993 max = this.score[i][this.seq2.length - 1];
16994 this.maxi = i;
16995 this.maxj = this.seq2.length - 1;
16996 }}
16997 for (var j = 0; j < this.seq2.length; j++) {
16998 if (this.score[this.seq1.length - 1][j] > max) {
16999 max = this.score[this.seq1.length - 1][j];
17000 this.maxi = this.seq1.length - 1;
17001 this.maxj = j;
17002 }}
17003 var i = this.maxi;
17004 var j = this.maxj;
17005 var trace;
17006 this.maxscore = Clazz_doubleToInt (this.score[i][j] / 10);
17007 this.seq1end = this.maxi + 1;
17008 this.seq2end = this.maxj + 1;
17009 this.aseq1 =  Clazz_newIntArray (this.seq1.length + this.seq2.length, 0);
17010 this.aseq2 =  Clazz_newIntArray (this.seq1.length + this.seq2.length, 0);
17011 this.count = (this.seq1.length + this.seq2.length) - 1;
17012 while ((i > 0) && (j > 0)) {
17013 if ((this.aseq1[this.count] != this.defInt) && (i >= 0)) {
17014 this.aseq1[this.count] = this.seq1[i];
17015 this.astr1 = this.s1str.charAt (i) + this.astr1;
17016 }if ((this.aseq2[this.count] != this.defInt) && (j > 0)) {
17017 this.aseq2[this.count] = this.seq2[j];
17018 this.astr2 = this.s2str.charAt (j) + this.astr2;
17019 }trace = this.findTrace (i, j);
17020 if (trace == 0) {
17021 i--;
17022 j--;
17023 } else if (trace == 1) {
17024 j--;
17025 this.aseq1[this.count] = this.defInt;
17026 this.astr1 = "-" + this.astr1.substring (1);
17027 } else if (trace == -1) {
17028 i--;
17029 this.aseq2[this.count] = this.defInt;
17030 this.astr2 = "-" + this.astr2.substring (1);
17031 }this.count--;
17032 }
17033 this.seq1start = i + 1;
17034 this.seq2start = j + 1;
17035 if (this.aseq1[this.count] != this.defInt) {
17036 this.aseq1[this.count] = this.seq1[i];
17037 this.astr1 = this.s1str.charAt (i) + this.astr1;
17038 }if (this.aseq2[this.count] != this.defInt) {
17039 this.aseq2[this.count] = this.seq2[j];
17040 this.astr2 = this.s2str.charAt (j) + this.astr2;
17041 }});
17042 Clazz_defineMethod (c$, "printAlignment", 
17043 function (os) {
17044 var s1id = this.s1.getName ();
17045 var s2id = this.s2.getName ();
17046 var maxid = this.s1.getName ().length;
17047 if (this.s2.getName ().length > maxid) {
17048 maxid = this.s2.getName ().length;
17049 }if (maxid > 30) {
17050 maxid = 30;
17051 if (this.s1.getName ().length > maxid) {
17052 s1id = this.s1.getName ().substring (0, 30);
17053 }if (this.s2.getName ().length > maxid) {
17054 s2id = this.s2.getName ().substring (0, 30);
17055 }}var len = 72 - maxid - 1;
17056 var nochunks = (Clazz_doubleToInt ((this.aseq1.length - this.count) / len)) + 1;
17057 this.pid = 0;
17058 this.output.append ("Score = ").append ("" + this.score[this.maxi][this.maxj]).append (jalview.analysis.AlignSeq.NEWLINE);
17059 this.output.append ("Length of alignment = ").append (String.valueOf (this.aseq1.length - this.count)).append (jalview.analysis.AlignSeq.NEWLINE);
17060 this.output.append ("Sequence ");
17061 this.output.append ( new jalview.util.Format ("%" + maxid + "s").form (this.s1.getName ()));
17062 this.output.append (" :  ").append (String.valueOf (this.s1.getStart ())).append (" - ").append (String.valueOf (this.s1.getEnd ()));
17063 this.output.append (" (Sequence length = ").append (String.valueOf (this.s1str.length)).append (")").append (jalview.analysis.AlignSeq.NEWLINE);
17064 this.output.append ("Sequence ");
17065 this.output.append ( new jalview.util.Format ("%" + maxid + "s").form (this.s2.getName ()));
17066 this.output.append (" :  ").append (String.valueOf (this.s2.getStart ())).append (" - ").append (String.valueOf (this.s2.getEnd ()));
17067 this.output.append (" (Sequence length = ").append (String.valueOf (this.s2str.length)).append (")").append (jalview.analysis.AlignSeq.NEWLINE).append (jalview.analysis.AlignSeq.NEWLINE);
17068 for (var j = 0; j < nochunks; j++) {
17069 this.output.append ( new jalview.util.Format ("%" + (maxid) + "s").form (s1id)).append (" ");
17070 for (var i = 0; i < len; i++) {
17071 if ((i + (j * len)) < this.astr1.length) {
17072 this.output.append (this.astr1.charAt (i + (j * len)));
17073 }}
17074 this.output.append (jalview.analysis.AlignSeq.NEWLINE);
17075 this.output.append ( new jalview.util.Format ("%" + (maxid) + "s").form (" ")).append (" ");
17076 for (var i = 0; i < len; i++) {
17077 if ((i + (j * len)) < this.astr1.length) {
17078 if (this.astr1.charAt (i + (j * len)) == this.astr2.charAt (i + (j * len)) && !jalview.util.Comparison.isGap (this.astr1.charAt (i + (j * len)))) {
17079 this.pid++;
17080 this.output.append ("|");
17081 } else if (this.type.equals ("pep")) {
17082 if (jalview.schemes.ResidueProperties.getPAM250 (this.astr1.charAt (i + (j * len)), this.astr2.charAt (i + (j * len))) > 0) {
17083 this.output.append (".");
17084 } else {
17085 this.output.append (" ");
17086 }} else {
17087 this.output.append (" ");
17088 }}}
17089 this.output = this.output.append (jalview.analysis.AlignSeq.NEWLINE);
17090 this.output = this.output.append ( new jalview.util.Format ("%" + (maxid) + "s").form (s2id)).append (" ");
17091 for (var i = 0; i < len; i++) {
17092 if ((i + (j * len)) < this.astr2.length) {
17093 this.output.append (this.astr2.charAt (i + (j * len)));
17094 }}
17095 this.output.append (jalview.analysis.AlignSeq.NEWLINE).append (jalview.analysis.AlignSeq.NEWLINE);
17096 }
17097 this.pid = this.pid / (this.aseq1.length - this.count) * 100;
17098 this.output = this.output.append ( new jalview.util.Format ("Percentage ID = %2.2f\n\n").formDouble (this.pid));
17099 try {
17100 os.print (this.output.toString ());
17101 } catch (ex) {
17102 if (Clazz_exceptionOf (ex, Exception)) {
17103 } else {
17104 throw ex;
17105 }
17106 }
17107 }, "java.io.PrintStream");
17108 Clazz_defineMethod (c$, "printScoreMatrix", 
17109 function (mat) {
17110 var n = this.seq1.length;
17111 var m = this.seq2.length;
17112 for (var i = 0; i < n; i++) {
17113 if (i == 0) {
17114 jalview.util.Format.print (System.out, "%8s", this.s2str.substring (0, 1));
17115 for (var jj = 1; jj < m; jj++) {
17116 jalview.util.Format.print (System.out, "%5s", this.s2str.substring (jj, jj + 1));
17117 }
17118 System.out.println ();
17119 }for (var j = 0; j < m; j++) {
17120 if (j == 0) {
17121 jalview.util.Format.print (System.out, "%3s", this.s1str.substring (i, i + 1));
17122 }jalview.util.Format.printLong (System.out, "%3d ", Clazz_doubleToInt (mat[i][j] / 10));
17123 }
17124 System.out.println ();
17125 }
17126 }, "~A");
17127 Clazz_defineMethod (c$, "findTrace", 
17128 function (i, j) {
17129 var t = 0;
17130 var max = this.score[i - 1][j - 1] + (this.lookup[this.seq1[i]][this.seq2[j]] * 10);
17131 if (this.F[i][j] > max) {
17132 max = this.F[i][j];
17133 t = -1;
17134 } else if (this.F[i][j] == max) {
17135 if (this.prev == -1) {
17136 max = this.F[i][j];
17137 t = -1;
17138 }}if (this.E[i][j] >= max) {
17139 max = this.E[i][j];
17140 t = 1;
17141 } else if (this.E[i][j] == max) {
17142 if (this.prev == 1) {
17143 max = this.E[i][j];
17144 t = 1;
17145 }}this.prev = t;
17146 return t;
17147 }, "~N,~N");
17148 Clazz_defineMethod (c$, "calcScoreMatrix", 
17149 function () {
17150 var n = this.seq1.length;
17151 var m = this.seq2.length;
17152 this.score[0][0] = this.lookup[this.seq1[0]][this.seq2[0]] * 10;
17153 this.E[0][0] = -this.gapExtend;
17154 this.F[0][0] = 0;
17155 for (var j = 1; j < m; j++) {
17156 this.E[0][j] = this.max (this.score[0][j - 1] - this.gapOpen, this.E[0][j - 1] - this.gapExtend);
17157 this.F[0][j] = -this.gapExtend;
17158 this.score[0][j] = this.max (this.lookup[this.seq1[0]][this.seq2[j]] * 10, -this.gapOpen, -this.gapExtend);
17159 this.traceback[0][j] = 1;
17160 }
17161 for (var i = 1; i < n; i++) {
17162 this.E[i][0] = -this.gapOpen;
17163 this.F[i][0] = this.max (this.score[i - 1][0] - this.gapOpen, this.F[i - 1][0] - this.gapExtend);
17164 this.score[i][0] = this.max (this.lookup[this.seq1[i]][this.seq2[0]] * 10, this.E[i][0], this.F[i][0]);
17165 this.traceback[i][0] = -1;
17166 }
17167 for (var i = 1; i < n; i++) {
17168 for (var j = 1; j < m; j++) {
17169 this.E[i][j] = this.max (this.score[i][j - 1] - this.gapOpen, this.E[i][j - 1] - this.gapExtend);
17170 this.F[i][j] = this.max (this.score[i - 1][j] - this.gapOpen, this.F[i - 1][j] - this.gapExtend);
17171 this.score[i][j] = this.max (this.score[i - 1][j - 1] + (this.lookup[this.seq1[i]][this.seq2[j]] * 10), this.E[i][j], this.F[i][j]);
17172 this.traceback[i][j] = this.findTrace (i, j);
17173 }
17174 }
17175 });
17176 c$.extractGaps = Clazz_defineMethod (c$, "extractGaps", 
17177 function (gapChars, seq) {
17178 if (gapChars == null || seq == null) {
17179 return null;
17180 }var str =  new java.util.StringTokenizer (seq, gapChars);
17181 var newString =  new StringBuilder (seq.length);
17182 while (str.hasMoreTokens ()) {
17183 newString.append (str.nextToken ());
17184 }
17185 return newString.toString ();
17186 }, "~S,~S");
17187 Clazz_defineMethod (c$, "max", 
17188 function (i1, i2, i3) {
17189 var max = i1;
17190 if (i2 > i1) {
17191 max = i2;
17192 }if (i3 > max) {
17193 max = i3;
17194 }return max;
17195 }, "~N,~N,~N");
17196 Clazz_defineMethod (c$, "max", 
17197 function (i1, i2) {
17198 var max = i1;
17199 if (i2 > i1) {
17200 max = i2;
17201 }return max;
17202 }, "~N,~N");
17203 Clazz_defineMethod (c$, "stringToInt", 
17204 function (s, type) {
17205 var seq1 =  Clazz_newIntArray (s.length, 0);
17206 for (var i = 0; i < s.length; i++) {
17207 var c = s.charAt (i);
17208 if ('a' <= c && c <= 'z') {
17209 c = String.fromCharCode (c.charCodeAt (0) - (32));
17210 }try {
17211 seq1[i] = this.charToInt[c.charCodeAt (0)];
17212 if (seq1[i] < 0 || seq1[i] > this.defInt) {
17213 seq1[i] = this.defInt;
17214 }} catch (e) {
17215 if (Clazz_exceptionOf (e, Exception)) {
17216 seq1[i] = this.defInt;
17217 } else {
17218 throw e;
17219 }
17220 }
17221 }
17222 return seq1;
17223 }, "~S,~S");
17224 c$.displayMatrix = Clazz_defineMethod (c$, "displayMatrix", 
17225 function (g, mat, n, m, psize) {
17226 var max = -1000;
17227 var min = 1000;
17228 for (var i = 0; i < n; i++) {
17229 for (var j = 0; j < m; j++) {
17230 if (mat[i][j] >= max) {
17231 max = mat[i][j];
17232 }if (mat[i][j] <= min) {
17233 min = mat[i][j];
17234 }}
17235 }
17236 System.out.println (max + " " + min);
17237 for (var i = 0; i < n; i++) {
17238 for (var j = 0; j < m; j++) {
17239 var x = psize * i;
17240 var y = psize * j;
17241 var score = (mat[i][j] - min) / (max - min);
17242 g.setColor ( new java.awt.Color (score, 0, 0));
17243 g.fillRect (x, y, psize, psize);
17244 }
17245 }
17246 }, "java.awt.Graphics,~A,~N,~N,~N");
17247 c$.doGlobalNWAlignment = Clazz_defineMethod (c$, "doGlobalNWAlignment", 
17248 function (s1, s2, type) {
17249 var as =  new jalview.analysis.AlignSeq (s1, s2, type);
17250 as.calcScoreMatrix ();
17251 as.traceAlignment ();
17252 return as;
17253 }, "jalview.datamodel.SequenceI,jalview.datamodel.SequenceI,~S");
17254 Clazz_defineMethod (c$, "getMappingFromS1", 
17255 function (allowmismatch) {
17256 var as1 =  new java.util.ArrayList ();
17257 var as2 =  new java.util.ArrayList ();
17258 var pdbpos = this.s2.getStart () + this.getSeq2Start () - 2;
17259 var alignpos = this.s1.getStart () + this.getSeq1Start () - 2;
17260 var lp2 = pdbpos - 3;
17261 var lp1 = alignpos - 3;
17262 var lastmatch = false;
17263 for (var i = 0; i < this.astr1.length; i++) {
17264 var c1 = this.astr1.charAt (i);
17265 var c2 = this.astr2.charAt (i);
17266 if (c1 != '-') {
17267 alignpos++;
17268 }if (c2 != '-') {
17269 pdbpos++;
17270 }if (allowmismatch || c1 == c2) {
17271 if (lp1 + 1 != alignpos || lp2 + 1 != pdbpos) {
17272 as1.add (Integer.$valueOf (alignpos));
17273 as2.add (Integer.$valueOf (pdbpos));
17274 }lastmatch = true;
17275 lp1 = alignpos;
17276 lp2 = pdbpos;
17277 } else {
17278 if (lastmatch) {
17279 as1.add (Integer.$valueOf (lp1));
17280 as2.add (Integer.$valueOf (lp2));
17281 }lastmatch = false;
17282 }}
17283 var mapseq1 =  Clazz_newIntArray (as1.size () + (lastmatch ? 1 : 0), 0);
17284 var mapseq2 =  Clazz_newIntArray (as2.size () + (lastmatch ? 1 : 0), 0);
17285 var i = 0;
17286 for (var ip, $ip = as1.iterator (); $ip.hasNext () && ((ip = $ip.next ()) || true);) {
17287 mapseq1[i++] = (ip).intValue ();
17288 }
17289 ;i = 0;
17290 for (var ip, $ip = as2.iterator (); $ip.hasNext () && ((ip = $ip.next ()) || true);) {
17291 mapseq2[i++] = (ip).intValue ();
17292 }
17293 ;if (lastmatch) {
17294 mapseq1[mapseq1.length - 1] = alignpos;
17295 mapseq2[mapseq2.length - 1] = pdbpos;
17296 }var map =  new jalview.util.MapList (mapseq1, mapseq2, 1, 1);
17297 var mapping =  new jalview.datamodel.Mapping (map);
17298 mapping.setTo (this.s2);
17299 return mapping;
17300 }, "~B");
17301 c$.replaceMatchingSeqsWith = Clazz_defineMethod (c$, "replaceMatchingSeqsWith", 
17302 function (seqs, annotations, ochains, al, dnaOrProtein, removeOldAnnots) {
17303 var orig =  new java.util.ArrayList ();
17304 var repl =  new java.util.ArrayList ();
17305 var aligs =  new java.util.ArrayList ();
17306 if (al != null && al.getHeight () > 0) {
17307 var matches =  new java.util.ArrayList ();
17308 var aligns =  new java.util.ArrayList ();
17309 for (var sq, $sq = ochains.iterator (); $sq.hasNext () && ((sq = $sq.next ()) || true);) {
17310 var bestm = null;
17311 var bestaseq = null;
17312 var bestscore = 0;
17313 for (var msq, $msq = al.getSequences ().iterator (); $msq.hasNext () && ((msq = $msq.next ()) || true);) {
17314 var aseq = jalview.analysis.AlignSeq.doGlobalNWAlignment (msq, sq, dnaOrProtein);
17315 if (bestm == null || aseq.getMaxScore () > bestscore) {
17316 bestscore = aseq.getMaxScore ();
17317 bestaseq = aseq;
17318 bestm = msq;
17319 }}
17320 System.out.println ("Best Score for " + (matches.size () + 1) + " :" + bestscore);
17321 matches.add (bestm);
17322 aligns.add (bestaseq);
17323 al.deleteSequence (bestm);
17324 }
17325 for (var p = 0, pSize = seqs.size (); p < pSize; p++) {
17326 var sq;
17327 var sp = seqs.get (p);
17328 var q;
17329 if ((q = ochains.indexOf (sp)) > -1) {
17330 seqs.set (p, sq = matches.get (q));
17331 orig.add (sp);
17332 repl.add (sq);
17333 sq.setName (sp.getName ());
17334 sq.setDescription (sp.getDescription ());
17335 var sp2sq;
17336 sq.transferAnnotation (sp, sp2sq = aligns.get (q).getMappingFromS1 (false));
17337 aligs.add (aligns.get (q));
17338 var inspos = -1;
17339 for (var ap = 0; ap < annotations.size (); ) {
17340 if (annotations.get (ap).sequenceRef === sp) {
17341 if (inspos == -1) {
17342 inspos = ap;
17343 }if (removeOldAnnots) {
17344 annotations.remove (ap);
17345 } else {
17346 var alan = annotations.remove (ap);
17347 alan.liftOver (sq, sp2sq);
17348 alan.setSequenceRef (sq);
17349 sq.addAlignmentAnnotation (alan);
17350 }} else {
17351 ap++;
17352 }}
17353 if (sq.getAnnotation () != null && sq.getAnnotation ().length > 0) {
17354 annotations.addAll (inspos == -1 ? annotations.size () : inspos, java.util.Arrays.asList (sq.getAnnotation ()));
17355 }}}
17356 }return java.util.Arrays.asList ([orig, repl, aligs]);
17357 }, "java.util.List,java.util.List,java.util.List,jalview.datamodel.AlignmentI,~S,~B");
17358 c$.computeRedundancyMatrix = Clazz_defineMethod (c$, "computeRedundancyMatrix", 
17359 function (originalSequences, omitHidden, start, end, ungapped) {
17360 var height = originalSequences.length;
17361 var redundancy =  Clazz_newFloatArray (height, 0);
17362 var lngth =  Clazz_newIntArray (height, 0);
17363 for (var i = 0; i < height; i++) {
17364 redundancy[i] = 0;
17365 lngth[i] = -1;
17366 }
17367 var pid;
17368 var seqi;
17369 var seqj;
17370 for (var i = 0; i < height; i++) {
17371 for (var j = 0; j < i; j++) {
17372 if (i == j) {
17373 continue;
17374 }if (omitHidden == null) {
17375 seqi = originalSequences[i].getSequenceAsString (start, end);
17376 seqj = originalSequences[j].getSequenceAsString (start, end);
17377 } else {
17378 seqi = omitHidden[i];
17379 seqj = omitHidden[j];
17380 }if (lngth[i] == -1) {
17381 var ug = jalview.analysis.AlignSeq.extractGaps (jalview.util.Comparison.GapChars, seqi);
17382 lngth[i] = ug.length;
17383 if (ungapped) {
17384 seqi = ug;
17385 }}if (lngth[j] == -1) {
17386 var ug = jalview.analysis.AlignSeq.extractGaps (jalview.util.Comparison.GapChars, seqj);
17387 lngth[j] = ug.length;
17388 if (ungapped) {
17389 seqj = ug;
17390 }}pid = jalview.util.Comparison.PID (seqi, seqj);
17391 if (lngth[j] < lngth[i]) {
17392 redundancy[j] = Math.max (pid, redundancy[j]);
17393 } else {
17394 redundancy[i] = Math.max (pid, redundancy[i]);
17395 }}
17396 }
17397 return redundancy;
17398 }, "~A,~A,~N,~N,~B");
17399 Clazz_defineStatics (c$,
17400 "PEP", "pep",
17401 "DNA", "dna");
17402 c$.NEWLINE = c$.prototype.NEWLINE = System.lineSeparator ();
17403 Clazz_defineStatics (c$,
17404 "dna",  Clazz_newArray (-1, ["A", "C", "G", "T", "-"]),
17405 "pep",  Clazz_newArray (-1, ["A", "R", "N", "D", "C", "Q", "E", "G", "H", "I", "L", "K", "M", "F", "P", "S", "T", "W", "Y", "V", "B", "Z", "X", "-"]));
17406 });
17407 Clazz_declarePackage ("jalview.schemes");
17408 Clazz_load (["jalview.analysis.scoremodels.FeatureScoreModel", "$.PIDScoreModel", "jalview.schemes.ScoreMatrix", "java.awt.Color", "java.util.ArrayList", "$.HashMap", "$.Hashtable", "$.Vector"], "jalview.schemes.ResidueProperties", ["java.lang.StringBuffer"], function () {
17409 c$ = Clazz_declareType (jalview.schemes, "ResidueProperties");
17410 c$.buildAmbiguityCodonSet = Clazz_defineMethod (c$, "buildAmbiguityCodonSet", 
17411 function () {
17412 if (jalview.schemes.ResidueProperties._ambiguityCodes.size () > 0) {
17413 System.err.println ("Ignoring multiple calls to buildAmbiguityCodonSet");
17414 return;
17415 }for (var acode, $acode = jalview.schemes.ResidueProperties.ambiguityCodes.entrySet ().iterator (); $acode.hasNext () && ((acode = $acode.next ()) || true);) {
17416 for (var r, $r = 0, $$r = acode.getValue (); $r < $$r.length && ((r = $$r[$r]) || true); $r++) {
17417 var codesfor = jalview.schemes.ResidueProperties._ambiguityCodes.get (r);
17418 if (codesfor == null) {
17419 jalview.schemes.ResidueProperties._ambiguityCodes.put (r, codesfor =  new java.util.ArrayList ());
17420 }if (!codesfor.contains (acode.getKey ())) {
17421 codesfor.add (acode.getKey ());
17422 } else {
17423 System.err.println ("Inconsistency in the IUBMB ambiguity code nomenclature table: collision for " + acode.getKey () + " in residue " + r);
17424 }}
17425 }
17426 var unambcodons = jalview.schemes.ResidueProperties.codonHash2.keySet ().toArray ( new Array (jalview.schemes.ResidueProperties.codonHash2.size ()));
17427 for (var codon, $codon = 0, $$codon = unambcodons; $codon < $$codon.length && ((codon = $$codon[$codon]) || true); $codon++) {
17428 var residue = jalview.schemes.ResidueProperties.codonHash2.get (codon);
17429 var acodon =  new Array (codon.length);
17430 for (var i = 0, iSize = codon.length; i < iSize; i++) {
17431 var _ac = "" + codon.charAt (i);
17432 var acodes = jalview.schemes.ResidueProperties._ambiguityCodes.get (_ac);
17433 if (acodes != null) {
17434 acodon[i] = acodes.toArray ( new Array (acodes.size ()));
17435 } else {
17436 acodon[i] =  Clazz_newArray (-1, []);
17437 }}
17438 var tpos =  Clazz_newIntArray (codon.length, 0);
17439 var cpos =  Clazz_newIntArray (codon.length, 0);
17440 for (var i = 0; i < tpos.length; i++) {
17441 tpos[i] = -1;
17442 }
17443 tpos[acodon.length - 1] = 0;
17444 var ipos;
17445 var j;
17446 while (tpos[0] < acodon[0].length) {
17447 var allres =  Clazz_newCharArray (tpos.length, '\0');
17448 var _acodon = "";
17449 var _anuc;
17450 for (ipos = 0; ipos < tpos.length; ipos++) {
17451 if (acodon[ipos].length == 0 || tpos[ipos] < 0) {
17452 _acodon += codon.charAt (ipos);
17453 allres[ipos] =  Clazz_newCharArray (-1, [codon.charAt (ipos)]);
17454 } else {
17455 _acodon += acodon[ipos][tpos[ipos]];
17456 var altbase = jalview.schemes.ResidueProperties.ambiguityCodes.get (acodon[ipos][tpos[ipos]]);
17457 allres[ipos] =  Clazz_newCharArray (altbase.length, '\0');
17458 j = 0;
17459 for (var ab, $ab = 0, $$ab = altbase; $ab < $$ab.length && ((ab = $$ab[$ab]) || true); $ab++) {
17460 allres[ipos][j++] = ab.charAt (0);
17461 }
17462 }}
17463 for (ipos = 0; ipos < cpos.length; ipos++) {
17464 cpos[ipos] = 0;
17465 }
17466 var valid = true;
17467 do {
17468 var _codon = "";
17469 for (j = 0; j < cpos.length; j++) {
17470 _codon += allres[j][cpos[j]];
17471 }
17472 var tr = jalview.schemes.ResidueProperties.codonHash2.get (_codon);
17473 if (valid = (tr != null && tr.equals (residue))) {
17474 ipos = acodon.length - 1;
17475 while (++cpos[ipos] >= allres[ipos].length && ipos > 0) {
17476 cpos[ipos] = 0;
17477 ipos--;
17478 }
17479 }} while (valid && cpos[0] < allres[0].length);
17480 if (valid) {
17481 jalview.schemes.ResidueProperties.codonHash2.put (_acodon, residue);
17482 } else {
17483 }ipos = acodon.length - 1;
17484 while (++tpos[ipos] >= acodon[ipos].length && ipos > 0) {
17485 tpos[ipos] = -1;
17486 ipos--;
17487 }
17488 }
17489 }
17490 });
17491 c$.getHydmax = Clazz_defineMethod (c$, "getHydmax", 
17492 function () {
17493 return 4.5;
17494 });
17495 c$.getHydmin = Clazz_defineMethod (c$, "getHydmin", 
17496 function () {
17497 return -3.9;
17498 });
17499 c$.getHyd = Clazz_defineMethod (c$, "getHyd", 
17500 function () {
17501 return jalview.schemes.ResidueProperties.hyd;
17502 });
17503 c$.getAA3Hash = Clazz_defineMethod (c$, "getAA3Hash", 
17504 function () {
17505 return jalview.schemes.ResidueProperties.aa3Hash;
17506 });
17507 c$.getDNA = Clazz_defineMethod (c$, "getDNA", 
17508 function () {
17509 return jalview.schemes.ResidueProperties.DNA;
17510 });
17511 c$.getBLOSUM62 = Clazz_defineMethod (c$, "getBLOSUM62", 
17512 function () {
17513 return jalview.schemes.ResidueProperties.BLOSUM62;
17514 });
17515 c$.getPAM250 = Clazz_defineMethod (c$, "getPAM250", 
17516 function (A1, A2) {
17517 return jalview.schemes.ResidueProperties.getPAM250 (A1.charAt (0), A2.charAt (0));
17518 }, "~S,~S");
17519 c$.getBLOSUM62 = Clazz_defineMethod (c$, "getBLOSUM62", 
17520 function (c1, c2) {
17521 var pog = 0;
17522 try {
17523 var a = jalview.schemes.ResidueProperties.aaIndex[c1.charCodeAt (0)];
17524 var b = jalview.schemes.ResidueProperties.aaIndex[c2.charCodeAt (0)];
17525 pog = jalview.schemes.ResidueProperties.BLOSUM62[a][b];
17526 } catch (e) {
17527 if (Clazz_exceptionOf (e, Exception)) {
17528 } else {
17529 throw e;
17530 }
17531 }
17532 return pog;
17533 }, "~S,~S");
17534 c$.getCodons = Clazz_defineMethod (c$, "getCodons", 
17535 function (res) {
17536 if (jalview.schemes.ResidueProperties.codonHash.containsKey (res)) {
17537 return jalview.schemes.ResidueProperties.codonHash.get (res);
17538 }return null;
17539 }, "~S");
17540 c$.codonTranslate = Clazz_defineMethod (c$, "codonTranslate", 
17541 function (lccodon) {
17542 if (false) {
17543 return jalview.schemes.ResidueProperties._codonTranslate (lccodon);
17544 }var cdn = jalview.schemes.ResidueProperties.codonHash2.get (lccodon.toUpperCase ());
17545 if (cdn != null && cdn.equals ("*")) {
17546 return "STOP";
17547 }return cdn;
17548 }, "~S");
17549 c$._codonTranslate = Clazz_defineMethod (c$, "_codonTranslate", 
17550 function (lccodon) {
17551 var codon = lccodon.toUpperCase ();
17552 if (codon.indexOf ('X') > -1 || codon.indexOf ('N') > -1) {
17553 return "X";
17554 }for (var key, $key = jalview.schemes.ResidueProperties.codonHash.keySet ().iterator (); $key.hasNext () && ((key = $key.next ()) || true);) {
17555 if (jalview.schemes.ResidueProperties.codonHash.get (key).contains (codon)) {
17556 return key;
17557 }}
17558 return null;
17559 }, "~S");
17560 c$.getDefaultPeptideMatrix = Clazz_defineMethod (c$, "getDefaultPeptideMatrix", 
17561 function () {
17562 return jalview.schemes.ResidueProperties.getBLOSUM62 ();
17563 });
17564 c$.getDefaultDnaMatrix = Clazz_defineMethod (c$, "getDefaultDnaMatrix", 
17565 function () {
17566 return jalview.schemes.ResidueProperties.getDNA ();
17567 });
17568 c$.getScoreMatrix = Clazz_defineMethod (c$, "getScoreMatrix", 
17569 function (pwtype) {
17570 var val = jalview.schemes.ResidueProperties.scoreMatrices.get (pwtype);
17571 if (val != null && Clazz_instanceOf (val, jalview.schemes.ScoreMatrix)) {
17572 return val;
17573 }return null;
17574 }, "~S");
17575 c$.getScoreModel = Clazz_defineMethod (c$, "getScoreModel", 
17576 function (pwtype) {
17577 return jalview.schemes.ResidueProperties.scoreMatrices.get (pwtype);
17578 }, "~S");
17579 c$.getPAM250 = Clazz_defineMethod (c$, "getPAM250", 
17580 function (c, d) {
17581 var a = jalview.schemes.ResidueProperties.aaIndex[c.charCodeAt (0)];
17582 var b = jalview.schemes.ResidueProperties.aaIndex[d.charCodeAt (0)];
17583 var pog = jalview.schemes.ResidueProperties.PAM250[a][b];
17584 return pog;
17585 }, "~S,~S");
17586 c$.getDssp3state = Clazz_defineMethod (c$, "getDssp3state", 
17587 function (ssstring) {
17588 if (ssstring == null) {
17589 return null;
17590 }var ss =  new StringBuffer ();
17591 for (var i = 0; i < ssstring.length; i++) {
17592 var ssc = ssstring.substring (i, i + 1);
17593 if (jalview.schemes.ResidueProperties.toDssp3State.containsKey (ssc)) {
17594 ss.append (jalview.schemes.ResidueProperties.toDssp3State.get (ssc));
17595 } else {
17596 ss.append (" ");
17597 }}
17598 return ss.toString ();
17599 }, "~S");
17600 c$.getRNASecStrucState = Clazz_defineMethod (c$, "getRNASecStrucState", 
17601 function (ssstring) {
17602 if (ssstring == null) {
17603 return null;
17604 }var ss =  new StringBuffer ();
17605 for (var i = 0; i < ssstring.length; i++) {
17606 var ssc = ssstring.substring (i, i + 1);
17607 if (jalview.schemes.ResidueProperties.toRNAssState.containsKey (ssc)) {
17608 ss.append (ssc);
17609 } else {
17610 ss.append (" ");
17611 }}
17612 return ss.toString ();
17613 }, "~S");
17614 c$.isCloseParenRNA = Clazz_defineMethod (c$, "isCloseParenRNA", 
17615 function (dc) {
17616 return jalview.schemes.ResidueProperties.RNAcloseParen[dc.charCodeAt (0)];
17617 }, "~S");
17618 c$.getResidues = Clazz_defineMethod (c$, "getResidues", 
17619 function (nucleotide, includeAmbiguous) {
17620 var result =  new java.util.ArrayList ();
17621 if (nucleotide) {
17622 for (var nuc, $nuc = jalview.schemes.ResidueProperties.nucleotideName.keySet ().iterator (); $nuc.hasNext () && ((nuc = $nuc.next ()) || true);) {
17623 var val = jalview.schemes.ResidueProperties.nucleotideIndex[nuc.charCodeAt (0)];
17624 if ((!includeAmbiguous && val > 4) || (val >= 10)) {
17625 continue;
17626 }nuc = nuc.toUpperCase ();
17627 if (!result.contains (nuc)) {
17628 result.add (nuc);
17629 }}
17630 } else {
17631 for (var res, $res = jalview.schemes.ResidueProperties.aa3Hash.keySet ().iterator (); $res.hasNext () && ((res = $res.next ()) || true);) {
17632 var index = jalview.schemes.ResidueProperties.aa3Hash.get (res).intValue ();
17633 if ((!includeAmbiguous && index >= 20) || index >= 23) {
17634 continue;
17635 }res = res.toUpperCase ();
17636 if (!result.contains (res)) {
17637 result.add (res);
17638 }}
17639 }return result;
17640 }, "~B,~B");
17641 c$.scoreMatrices = c$.prototype.scoreMatrices =  new java.util.Hashtable ();
17642 Clazz_defineStatics (c$,
17643 "aaIndex", null,
17644 "nucleotideIndex", null,
17645 "purinepyrimidineIndex", null);
17646 c$.aa3Hash = c$.prototype.aa3Hash =  new java.util.HashMap ();
17647 c$.aa2Triplet = c$.prototype.aa2Triplet =  new java.util.HashMap ();
17648 c$.nucleotideName = c$.prototype.nucleotideName =  new java.util.HashMap ();
17649 {
17650 jalview.schemes.ResidueProperties.aaIndex =  Clazz_newIntArray (255, 0);
17651 for (var i = 0; i < 255; i++) {
17652 jalview.schemes.ResidueProperties.aaIndex[i] = 23;
17653 }
17654 jalview.schemes.ResidueProperties.aaIndex['A'.charCodeAt (0)] = 0;
17655 jalview.schemes.ResidueProperties.aaIndex['R'.charCodeAt (0)] = 1;
17656 jalview.schemes.ResidueProperties.aaIndex['N'.charCodeAt (0)] = 2;
17657 jalview.schemes.ResidueProperties.aaIndex['D'.charCodeAt (0)] = 3;
17658 jalview.schemes.ResidueProperties.aaIndex['C'.charCodeAt (0)] = 4;
17659 jalview.schemes.ResidueProperties.aaIndex['Q'.charCodeAt (0)] = 5;
17660 jalview.schemes.ResidueProperties.aaIndex['E'.charCodeAt (0)] = 6;
17661 jalview.schemes.ResidueProperties.aaIndex['G'.charCodeAt (0)] = 7;
17662 jalview.schemes.ResidueProperties.aaIndex['H'.charCodeAt (0)] = 8;
17663 jalview.schemes.ResidueProperties.aaIndex['I'.charCodeAt (0)] = 9;
17664 jalview.schemes.ResidueProperties.aaIndex['L'.charCodeAt (0)] = 10;
17665 jalview.schemes.ResidueProperties.aaIndex['K'.charCodeAt (0)] = 11;
17666 jalview.schemes.ResidueProperties.aaIndex['M'.charCodeAt (0)] = 12;
17667 jalview.schemes.ResidueProperties.aaIndex['F'.charCodeAt (0)] = 13;
17668 jalview.schemes.ResidueProperties.aaIndex['P'.charCodeAt (0)] = 14;
17669 jalview.schemes.ResidueProperties.aaIndex['S'.charCodeAt (0)] = 15;
17670 jalview.schemes.ResidueProperties.aaIndex['T'.charCodeAt (0)] = 16;
17671 jalview.schemes.ResidueProperties.aaIndex['W'.charCodeAt (0)] = 17;
17672 jalview.schemes.ResidueProperties.aaIndex['Y'.charCodeAt (0)] = 18;
17673 jalview.schemes.ResidueProperties.aaIndex['V'.charCodeAt (0)] = 19;
17674 jalview.schemes.ResidueProperties.aaIndex['B'.charCodeAt (0)] = 20;
17675 jalview.schemes.ResidueProperties.aaIndex['Z'.charCodeAt (0)] = 21;
17676 jalview.schemes.ResidueProperties.aaIndex['X'.charCodeAt (0)] = 22;
17677 jalview.schemes.ResidueProperties.aaIndex['U'.charCodeAt (0)] = 22;
17678 jalview.schemes.ResidueProperties.aaIndex['a'.charCodeAt (0)] = 0;
17679 jalview.schemes.ResidueProperties.aaIndex['r'.charCodeAt (0)] = 1;
17680 jalview.schemes.ResidueProperties.aaIndex['n'.charCodeAt (0)] = 2;
17681 jalview.schemes.ResidueProperties.aaIndex['d'.charCodeAt (0)] = 3;
17682 jalview.schemes.ResidueProperties.aaIndex['c'.charCodeAt (0)] = 4;
17683 jalview.schemes.ResidueProperties.aaIndex['q'.charCodeAt (0)] = 5;
17684 jalview.schemes.ResidueProperties.aaIndex['e'.charCodeAt (0)] = 6;
17685 jalview.schemes.ResidueProperties.aaIndex['g'.charCodeAt (0)] = 7;
17686 jalview.schemes.ResidueProperties.aaIndex['h'.charCodeAt (0)] = 8;
17687 jalview.schemes.ResidueProperties.aaIndex['i'.charCodeAt (0)] = 9;
17688 jalview.schemes.ResidueProperties.aaIndex['l'.charCodeAt (0)] = 10;
17689 jalview.schemes.ResidueProperties.aaIndex['k'.charCodeAt (0)] = 11;
17690 jalview.schemes.ResidueProperties.aaIndex['m'.charCodeAt (0)] = 12;
17691 jalview.schemes.ResidueProperties.aaIndex['f'.charCodeAt (0)] = 13;
17692 jalview.schemes.ResidueProperties.aaIndex['p'.charCodeAt (0)] = 14;
17693 jalview.schemes.ResidueProperties.aaIndex['s'.charCodeAt (0)] = 15;
17694 jalview.schemes.ResidueProperties.aaIndex['t'.charCodeAt (0)] = 16;
17695 jalview.schemes.ResidueProperties.aaIndex['w'.charCodeAt (0)] = 17;
17696 jalview.schemes.ResidueProperties.aaIndex['y'.charCodeAt (0)] = 18;
17697 jalview.schemes.ResidueProperties.aaIndex['v'.charCodeAt (0)] = 19;
17698 jalview.schemes.ResidueProperties.aaIndex['b'.charCodeAt (0)] = 20;
17699 jalview.schemes.ResidueProperties.aaIndex['z'.charCodeAt (0)] = 21;
17700 jalview.schemes.ResidueProperties.aaIndex['x'.charCodeAt (0)] = 22;
17701 jalview.schemes.ResidueProperties.aaIndex['u'.charCodeAt (0)] = 22;
17702 }Clazz_defineStatics (c$,
17703 "maxProteinIndex", 23,
17704 "maxNucleotideIndex", 10);
17705 {
17706 jalview.schemes.ResidueProperties.nucleotideIndex =  Clazz_newIntArray (255, 0);
17707 for (var i = 0; i < 255; i++) {
17708 jalview.schemes.ResidueProperties.nucleotideIndex[i] = 10;
17709 }
17710 jalview.schemes.ResidueProperties.nucleotideIndex['A'.charCodeAt (0)] = 0;
17711 jalview.schemes.ResidueProperties.nucleotideIndex['a'.charCodeAt (0)] = 0;
17712 jalview.schemes.ResidueProperties.nucleotideIndex['C'.charCodeAt (0)] = 1;
17713 jalview.schemes.ResidueProperties.nucleotideIndex['c'.charCodeAt (0)] = 1;
17714 jalview.schemes.ResidueProperties.nucleotideIndex['G'.charCodeAt (0)] = 2;
17715 jalview.schemes.ResidueProperties.nucleotideIndex['g'.charCodeAt (0)] = 2;
17716 jalview.schemes.ResidueProperties.nucleotideIndex['T'.charCodeAt (0)] = 3;
17717 jalview.schemes.ResidueProperties.nucleotideIndex['t'.charCodeAt (0)] = 3;
17718 jalview.schemes.ResidueProperties.nucleotideIndex['U'.charCodeAt (0)] = 4;
17719 jalview.schemes.ResidueProperties.nucleotideIndex['u'.charCodeAt (0)] = 4;
17720 jalview.schemes.ResidueProperties.nucleotideIndex['I'.charCodeAt (0)] = 5;
17721 jalview.schemes.ResidueProperties.nucleotideIndex['i'.charCodeAt (0)] = 5;
17722 jalview.schemes.ResidueProperties.nucleotideIndex['X'.charCodeAt (0)] = 6;
17723 jalview.schemes.ResidueProperties.nucleotideIndex['x'.charCodeAt (0)] = 6;
17724 jalview.schemes.ResidueProperties.nucleotideIndex['R'.charCodeAt (0)] = 7;
17725 jalview.schemes.ResidueProperties.nucleotideIndex['r'.charCodeAt (0)] = 7;
17726 jalview.schemes.ResidueProperties.nucleotideIndex['Y'.charCodeAt (0)] = 8;
17727 jalview.schemes.ResidueProperties.nucleotideIndex['y'.charCodeAt (0)] = 8;
17728 jalview.schemes.ResidueProperties.nucleotideIndex['N'.charCodeAt (0)] = 9;
17729 jalview.schemes.ResidueProperties.nucleotideIndex['n'.charCodeAt (0)] = 9;
17730 jalview.schemes.ResidueProperties.nucleotideName.put ("A", "Adenine");
17731 jalview.schemes.ResidueProperties.nucleotideName.put ("a", "Adenine");
17732 jalview.schemes.ResidueProperties.nucleotideName.put ("G", "Guanine");
17733 jalview.schemes.ResidueProperties.nucleotideName.put ("g", "Guanine");
17734 jalview.schemes.ResidueProperties.nucleotideName.put ("C", "Cytosine");
17735 jalview.schemes.ResidueProperties.nucleotideName.put ("c", "Cytosine");
17736 jalview.schemes.ResidueProperties.nucleotideName.put ("T", "Thymine");
17737 jalview.schemes.ResidueProperties.nucleotideName.put ("t", "Thymine");
17738 jalview.schemes.ResidueProperties.nucleotideName.put ("U", "Uracil");
17739 jalview.schemes.ResidueProperties.nucleotideName.put ("u", "Uracil");
17740 jalview.schemes.ResidueProperties.nucleotideName.put ("I", "Inosine");
17741 jalview.schemes.ResidueProperties.nucleotideName.put ("i", "Inosine");
17742 jalview.schemes.ResidueProperties.nucleotideName.put ("X", "Xanthine");
17743 jalview.schemes.ResidueProperties.nucleotideName.put ("x", "Xanthine");
17744 jalview.schemes.ResidueProperties.nucleotideName.put ("R", "Unknown Purine");
17745 jalview.schemes.ResidueProperties.nucleotideName.put ("r", "Unknown Purine");
17746 jalview.schemes.ResidueProperties.nucleotideName.put ("Y", "Unknown Pyrimidine");
17747 jalview.schemes.ResidueProperties.nucleotideName.put ("y", "Unknown Pyrimidine");
17748 jalview.schemes.ResidueProperties.nucleotideName.put ("N", "Unknown");
17749 jalview.schemes.ResidueProperties.nucleotideName.put ("n", "Unknown");
17750 jalview.schemes.ResidueProperties.nucleotideName.put ("W", "Weak nucleotide (A or T)");
17751 jalview.schemes.ResidueProperties.nucleotideName.put ("w", "Weak nucleotide (A or T)");
17752 jalview.schemes.ResidueProperties.nucleotideName.put ("S", "Strong nucleotide (G or C)");
17753 jalview.schemes.ResidueProperties.nucleotideName.put ("s", "Strong nucleotide (G or C)");
17754 jalview.schemes.ResidueProperties.nucleotideName.put ("M", "Amino (A or C)");
17755 jalview.schemes.ResidueProperties.nucleotideName.put ("m", "Amino (A or C)");
17756 jalview.schemes.ResidueProperties.nucleotideName.put ("K", "Keto (G or T)");
17757 jalview.schemes.ResidueProperties.nucleotideName.put ("k", "Keto (G or T)");
17758 jalview.schemes.ResidueProperties.nucleotideName.put ("B", "Not A (G or C or T)");
17759 jalview.schemes.ResidueProperties.nucleotideName.put ("b", "Not A (G or C or T)");
17760 jalview.schemes.ResidueProperties.nucleotideName.put ("H", "Not G (A or C or T)");
17761 jalview.schemes.ResidueProperties.nucleotideName.put ("h", "Not G (A or C or T)");
17762 jalview.schemes.ResidueProperties.nucleotideName.put ("D", "Not C (A or G or T)");
17763 jalview.schemes.ResidueProperties.nucleotideName.put ("d", "Not C (A or G or T)");
17764 jalview.schemes.ResidueProperties.nucleotideName.put ("V", "Not T (A or G or C");
17765 jalview.schemes.ResidueProperties.nucleotideName.put ("v", "Not T (A or G or C");
17766 }{
17767 jalview.schemes.ResidueProperties.purinepyrimidineIndex =  Clazz_newIntArray (255, 0);
17768 for (var i = 0; i < 255; i++) {
17769 jalview.schemes.ResidueProperties.purinepyrimidineIndex[i] = 3;
17770 }
17771 jalview.schemes.ResidueProperties.purinepyrimidineIndex['A'.charCodeAt (0)] = 0;
17772 jalview.schemes.ResidueProperties.purinepyrimidineIndex['a'.charCodeAt (0)] = 0;
17773 jalview.schemes.ResidueProperties.purinepyrimidineIndex['C'.charCodeAt (0)] = 1;
17774 jalview.schemes.ResidueProperties.purinepyrimidineIndex['c'.charCodeAt (0)] = 1;
17775 jalview.schemes.ResidueProperties.purinepyrimidineIndex['G'.charCodeAt (0)] = 0;
17776 jalview.schemes.ResidueProperties.purinepyrimidineIndex['g'.charCodeAt (0)] = 0;
17777 jalview.schemes.ResidueProperties.purinepyrimidineIndex['T'.charCodeAt (0)] = 1;
17778 jalview.schemes.ResidueProperties.purinepyrimidineIndex['t'.charCodeAt (0)] = 1;
17779 jalview.schemes.ResidueProperties.purinepyrimidineIndex['U'.charCodeAt (0)] = 1;
17780 jalview.schemes.ResidueProperties.purinepyrimidineIndex['u'.charCodeAt (0)] = 1;
17781 jalview.schemes.ResidueProperties.purinepyrimidineIndex['I'.charCodeAt (0)] = 2;
17782 jalview.schemes.ResidueProperties.purinepyrimidineIndex['i'.charCodeAt (0)] = 2;
17783 jalview.schemes.ResidueProperties.purinepyrimidineIndex['X'.charCodeAt (0)] = 2;
17784 jalview.schemes.ResidueProperties.purinepyrimidineIndex['x'.charCodeAt (0)] = 2;
17785 jalview.schemes.ResidueProperties.purinepyrimidineIndex['R'.charCodeAt (0)] = 0;
17786 jalview.schemes.ResidueProperties.purinepyrimidineIndex['r'.charCodeAt (0)] = 0;
17787 jalview.schemes.ResidueProperties.purinepyrimidineIndex['Y'.charCodeAt (0)] = 1;
17788 jalview.schemes.ResidueProperties.purinepyrimidineIndex['y'.charCodeAt (0)] = 1;
17789 jalview.schemes.ResidueProperties.purinepyrimidineIndex['N'.charCodeAt (0)] = 2;
17790 jalview.schemes.ResidueProperties.purinepyrimidineIndex['n'.charCodeAt (0)] = 2;
17791 }{
17792 jalview.schemes.ResidueProperties.aa3Hash.put ("ALA",  new Integer (0));
17793 jalview.schemes.ResidueProperties.aa3Hash.put ("ARG",  new Integer (1));
17794 jalview.schemes.ResidueProperties.aa3Hash.put ("ASN",  new Integer (2));
17795 jalview.schemes.ResidueProperties.aa3Hash.put ("ASP",  new Integer (3));
17796 jalview.schemes.ResidueProperties.aa3Hash.put ("CYS",  new Integer (4));
17797 jalview.schemes.ResidueProperties.aa3Hash.put ("GLN",  new Integer (5));
17798 jalview.schemes.ResidueProperties.aa3Hash.put ("GLU",  new Integer (6));
17799 jalview.schemes.ResidueProperties.aa3Hash.put ("GLY",  new Integer (7));
17800 jalview.schemes.ResidueProperties.aa3Hash.put ("HIS",  new Integer (8));
17801 jalview.schemes.ResidueProperties.aa3Hash.put ("ILE",  new Integer (9));
17802 jalview.schemes.ResidueProperties.aa3Hash.put ("LEU",  new Integer (10));
17803 jalview.schemes.ResidueProperties.aa3Hash.put ("LYS",  new Integer (11));
17804 jalview.schemes.ResidueProperties.aa3Hash.put ("MET",  new Integer (12));
17805 jalview.schemes.ResidueProperties.aa3Hash.put ("PHE",  new Integer (13));
17806 jalview.schemes.ResidueProperties.aa3Hash.put ("PRO",  new Integer (14));
17807 jalview.schemes.ResidueProperties.aa3Hash.put ("SER",  new Integer (15));
17808 jalview.schemes.ResidueProperties.aa3Hash.put ("THR",  new Integer (16));
17809 jalview.schemes.ResidueProperties.aa3Hash.put ("TRP",  new Integer (17));
17810 jalview.schemes.ResidueProperties.aa3Hash.put ("TYR",  new Integer (18));
17811 jalview.schemes.ResidueProperties.aa3Hash.put ("VAL",  new Integer (19));
17812 jalview.schemes.ResidueProperties.aa3Hash.put ("ASX",  new Integer (20));
17813 jalview.schemes.ResidueProperties.aa3Hash.put ("GLX",  new Integer (21));
17814 jalview.schemes.ResidueProperties.aa3Hash.put ("XAA",  new Integer (22));
17815 jalview.schemes.ResidueProperties.aa3Hash.put ("-",  new Integer (23));
17816 jalview.schemes.ResidueProperties.aa3Hash.put ("*",  new Integer (23));
17817 jalview.schemes.ResidueProperties.aa3Hash.put (".",  new Integer (23));
17818 jalview.schemes.ResidueProperties.aa3Hash.put (" ",  new Integer (23));
17819 jalview.schemes.ResidueProperties.aa3Hash.put ("Gap",  new Integer (23));
17820 }{
17821 jalview.schemes.ResidueProperties.aa2Triplet.put ("A", "ALA");
17822 jalview.schemes.ResidueProperties.aa2Triplet.put ("a", "ALA");
17823 jalview.schemes.ResidueProperties.aa2Triplet.put ("R", "ARG");
17824 jalview.schemes.ResidueProperties.aa2Triplet.put ("r", "ARG");
17825 jalview.schemes.ResidueProperties.aa2Triplet.put ("N", "ASN");
17826 jalview.schemes.ResidueProperties.aa2Triplet.put ("n", "ASN");
17827 jalview.schemes.ResidueProperties.aa2Triplet.put ("D", "ASP");
17828 jalview.schemes.ResidueProperties.aa2Triplet.put ("d", "ASP");
17829 jalview.schemes.ResidueProperties.aa2Triplet.put ("C", "CYS");
17830 jalview.schemes.ResidueProperties.aa2Triplet.put ("c", "CYS");
17831 jalview.schemes.ResidueProperties.aa2Triplet.put ("Q", "GLN");
17832 jalview.schemes.ResidueProperties.aa2Triplet.put ("q", "GLN");
17833 jalview.schemes.ResidueProperties.aa2Triplet.put ("E", "GLU");
17834 jalview.schemes.ResidueProperties.aa2Triplet.put ("e", "GLU");
17835 jalview.schemes.ResidueProperties.aa2Triplet.put ("G", "GLY");
17836 jalview.schemes.ResidueProperties.aa2Triplet.put ("g", "GLY");
17837 jalview.schemes.ResidueProperties.aa2Triplet.put ("H", "HIS");
17838 jalview.schemes.ResidueProperties.aa2Triplet.put ("h", "HIS");
17839 jalview.schemes.ResidueProperties.aa2Triplet.put ("I", "ILE");
17840 jalview.schemes.ResidueProperties.aa2Triplet.put ("i", "ILE");
17841 jalview.schemes.ResidueProperties.aa2Triplet.put ("L", "LEU");
17842 jalview.schemes.ResidueProperties.aa2Triplet.put ("l", "LEU");
17843 jalview.schemes.ResidueProperties.aa2Triplet.put ("K", "LYS");
17844 jalview.schemes.ResidueProperties.aa2Triplet.put ("k", "LYS");
17845 jalview.schemes.ResidueProperties.aa2Triplet.put ("M", "MET");
17846 jalview.schemes.ResidueProperties.aa2Triplet.put ("m", "MET");
17847 jalview.schemes.ResidueProperties.aa2Triplet.put ("F", "PHE");
17848 jalview.schemes.ResidueProperties.aa2Triplet.put ("f", "PHE");
17849 jalview.schemes.ResidueProperties.aa2Triplet.put ("P", "PRO");
17850 jalview.schemes.ResidueProperties.aa2Triplet.put ("p", "PRO");
17851 jalview.schemes.ResidueProperties.aa2Triplet.put ("S", "SER");
17852 jalview.schemes.ResidueProperties.aa2Triplet.put ("s", "SER");
17853 jalview.schemes.ResidueProperties.aa2Triplet.put ("T", "THR");
17854 jalview.schemes.ResidueProperties.aa2Triplet.put ("t", "THR");
17855 jalview.schemes.ResidueProperties.aa2Triplet.put ("W", "TRP");
17856 jalview.schemes.ResidueProperties.aa2Triplet.put ("w", "TRP");
17857 jalview.schemes.ResidueProperties.aa2Triplet.put ("Y", "TYR");
17858 jalview.schemes.ResidueProperties.aa2Triplet.put ("y", "TYR");
17859 jalview.schemes.ResidueProperties.aa2Triplet.put ("V", "VAL");
17860 jalview.schemes.ResidueProperties.aa2Triplet.put ("v", "VAL");
17861 }Clazz_defineStatics (c$,
17862 "aa",  Clazz_newArray (-1, ["A", "R", "N", "D", "C", "Q", "E", "G", "H", "I", "L", "K", "M", "F", "P", "S", "T", "W", "Y", "V", "B", "Z", "X", "_", "*", ".", " "]));
17863 c$.midBlue = c$.prototype.midBlue =  new java.awt.Color (100, 100, 255);
17864 c$.scaleColours = c$.prototype.scaleColours =  new java.util.Vector ();
17865 {
17866 jalview.schemes.ResidueProperties.scaleColours.addElement ( new java.awt.Color (114, 0, 147));
17867 jalview.schemes.ResidueProperties.scaleColours.addElement ( new java.awt.Color (156, 0, 98));
17868 jalview.schemes.ResidueProperties.scaleColours.addElement ( new java.awt.Color (190, 0, 0));
17869 jalview.schemes.ResidueProperties.scaleColours.addElement (java.awt.Color.red);
17870 jalview.schemes.ResidueProperties.scaleColours.addElement ( new java.awt.Color (255, 125, 0));
17871 jalview.schemes.ResidueProperties.scaleColours.addElement (java.awt.Color.orange);
17872 jalview.schemes.ResidueProperties.scaleColours.addElement ( new java.awt.Color (255, 194, 85));
17873 jalview.schemes.ResidueProperties.scaleColours.addElement (java.awt.Color.yellow);
17874 jalview.schemes.ResidueProperties.scaleColours.addElement ( new java.awt.Color (255, 255, 181));
17875 jalview.schemes.ResidueProperties.scaleColours.addElement (java.awt.Color.white);
17876 }c$.taylor = c$.prototype.taylor =  Clazz_newArray (-1, [ new java.awt.Color (204, 255, 0),  new java.awt.Color (0, 0, 255),  new java.awt.Color (204, 0, 255),  new java.awt.Color (255, 0, 0),  new java.awt.Color (255, 255, 0),  new java.awt.Color (255, 0, 204),  new java.awt.Color (255, 0, 102),  new java.awt.Color (255, 153, 0),  new java.awt.Color (0, 102, 255),  new java.awt.Color (102, 255, 0),  new java.awt.Color (51, 255, 0),  new java.awt.Color (102, 0, 255),  new java.awt.Color (0, 255, 0),  new java.awt.Color (0, 255, 102),  new java.awt.Color (255, 204, 0),  new java.awt.Color (255, 51, 0),  new java.awt.Color (255, 102, 0),  new java.awt.Color (0, 204, 255),  new java.awt.Color (0, 255, 204),  new java.awt.Color (153, 255, 0), java.awt.Color.white, java.awt.Color.white, java.awt.Color.white, java.awt.Color.white, java.awt.Color.white, java.awt.Color.white]);
17877 c$.nucleotide = c$.prototype.nucleotide =  Clazz_newArray (-1, [ new java.awt.Color (100, 247, 63),  new java.awt.Color (255, 179, 64),  new java.awt.Color (235, 65, 60),  new java.awt.Color (60, 136, 238),  new java.awt.Color (60, 136, 238), java.awt.Color.white, java.awt.Color.white, java.awt.Color.white, java.awt.Color.white, java.awt.Color.white, java.awt.Color.white]);
17878 c$.purinepyrimidine = c$.prototype.purinepyrimidine =  Clazz_newArray (-1, [ new java.awt.Color (255, 131, 250),  new java.awt.Color (64, 224, 208), java.awt.Color.white, java.awt.Color.white]);
17879 c$.zappo = c$.prototype.zappo =  Clazz_newArray (-1, [java.awt.Color.pink, jalview.schemes.ResidueProperties.midBlue, java.awt.Color.green, java.awt.Color.red, java.awt.Color.yellow, java.awt.Color.green, java.awt.Color.red, java.awt.Color.magenta, jalview.schemes.ResidueProperties.midBlue, java.awt.Color.pink, java.awt.Color.pink, jalview.schemes.ResidueProperties.midBlue, java.awt.Color.pink, java.awt.Color.orange, java.awt.Color.magenta, java.awt.Color.green, java.awt.Color.green, java.awt.Color.orange, java.awt.Color.orange, java.awt.Color.pink, java.awt.Color.white, java.awt.Color.white, java.awt.Color.white, java.awt.Color.white, java.awt.Color.white, java.awt.Color.white, java.awt.Color.white]);
17880 Clazz_defineStatics (c$,
17881 "hyd2",  Clazz_newDoubleArray (-1, [0.62, 0.29, -0.9, -0.74, 1.19, 0.48, -0.4, 1.38, -1.5, 1.06, 0.64, -0.78, 0.12, -0.85, -2.53, -0.18, -0.05, 1.08, 0.81, 0.0, 0.26, 0.0, 0.0]),
17882 "helix",  Clazz_newDoubleArray (-1, [1.42, 0.98, 0.67, 1.01, 0.70, 1.11, 1.51, 0.57, 1.00, 1.08, 1.21, 1.16, 1.45, 1.13, 0.57, 0.77, 0.83, 1.08, 0.69, 1.06, 0.84, 1.31, 1.00, 0.0]),
17883 "helixmin", 0.57,
17884 "helixmax", 1.51,
17885 "strand",  Clazz_newDoubleArray (-1, [0.83, 0.93, 0.89, 0.54, 1.19, 1.10, 0.37, 0.75, 0.87, 1.60, 1.30, 0.74, 1.05, 1.38, 0.55, 0.75, 1.19, 1.37, 1.47, 1.70, 0.72, 0.74, 1.0, 0.0]),
17886 "strandmin", 0.37,
17887 "strandmax", 1.7,
17888 "turn",  Clazz_newDoubleArray (-1, [0.66, 0.95, 1.56, 1.46, 1.19, 0.98, 0.74, 1.56, 0.95, 0.47, 0.59, 1.01, 0.60, 0.60, 1.52, 1.43, 0.96, 0.96, 1.14, 0.50, 1.51, 0.86, 1.00, 0, 0]),
17889 "turnmin", 0.47,
17890 "turnmax", 1.56,
17891 "buried",  Clazz_newDoubleArray (-1, [1.7, 0.1, 0.4, 0.4, 4.6, 0.3, 0.3, 1.8, 0.8, 3.1, 2.4, 0.05, 1.9, 2.2, 0.6, 0.8, 0.7, 1.6, 0.5, 2.9, 0.4, 0.3, 1.358, 0.00]),
17892 "buriedmin", 0.05,
17893 "buriedmax", 4.6,
17894 "hyd",  Clazz_newDoubleArray (-1, [1.8, -4.5, -3.5, -3.5, 2.5, -3.5, -3.5, -0.4, -3.2, 4.5, 3.8, -3.9, 1.9, 2.8, -1.6, -0.8, -0.7, -0.9, -1.3, 4.2, -3.5, -3.5, -0.49, 0.0]),
17895 "hydmax", 4.5,
17896 "hydmin", -3.9,
17897 "BLOSUM62",  Clazz_newArray (-1, [ Clazz_newIntArray (-1, [4, -1, -2, -2, 0, -1, -1, 0, -2, -1, -1, -1, -1, -2, -1, 1, 0, -3, -2, 0, -2, -1, 0, -4]),  Clazz_newIntArray (-1, [-1, 5, 0, -2, -3, 1, 0, -2, 0, -3, -2, 2, -1, -3, -2, -1, -1, -3, -2, -3, -1, 0, -1, -4]),  Clazz_newIntArray (-1, [-2, 0, 6, 1, -3, 0, 0, 0, 1, -3, -3, 0, -2, -3, -2, 1, 0, -4, -2, -3, 3, 0, -1, -4]),  Clazz_newIntArray (-1, [-2, -2, 1, 6, -3, 0, 2, -1, -1, -3, -4, -1, -3, -3, -1, 0, -1, -4, -3, -3, 4, 1, -1, -4]),  Clazz_newIntArray (-1, [0, 3, -3, -3, 9, -3, -4, -3, -3, -1, -1, -3, -1, -2, -3, -1, -1, -2, -2, -1, -3, -3, -2, -4]),  Clazz_newIntArray (-1, [-1, 1, 0, 0, -3, 5, 2, -2, 0, -3, -2, 1, 0, -3, -1, 0, -1, -2, -1, -2, 0, 3, -1, -4]),  Clazz_newIntArray (-1, [-1, 0, 0, 2, -4, 2, 5, -2, 0, -3, -3, 1, -2, -3, -1, 0, -1, -3, -2, -2, 1, 4, -1, -4]),  Clazz_newIntArray (-1, [0, -2, 0, -1, -3, -2, -2, 6, -2, -4, -4, -2, -3, -3, -2, 0, -2, -2, -3, -3, -1, -2, -1, -4]),  Clazz_newIntArray (-1, [-2, 0, 1, -1, -3, 0, 0, -2, 8, -3, -3, -1, -2, -1, -2, -1, -2, -2, 2, -3, 0, 0, -1, -4]),  Clazz_newIntArray (-1, [-1, -3, -3, -3, -1, -3, -3, -4, -3, 4, 2, -3, 1, 0, -3, -2, -1, -3, -1, 3, -3, -3, -1, -4]),  Clazz_newIntArray (-1, [-1, -2, -3, -4, -1, -2, -3, -4, -3, 2, 4, -2, 2, 0, -3, -2, -1, -2, -1, 1, -4, -3, -1, -4]),  Clazz_newIntArray (-1, [-1, 2, 0, -1, -3, 1, 1, -2, -1, -3, -2, 5, -1, -3, -1, 0, -1, -3, -2, -2, 0, 1, -1, -4]),  Clazz_newIntArray (-1, [-1, -1, -2, -3, -1, 0, -2, -3, -2, 1, 2, -1, 5, 0, -2, -1, -1, -1, -1, 1, -3, -1, -1, -4]),  Clazz_newIntArray (-1, [-2, -3, -3, -3, -2, -3, -3, -3, -1, 0, 0, -3, 0, 6, -4, -2, -2, 1, 3, -1, -3, -3, -1, -4]),  Clazz_newIntArray (-1, [-1, -2, -2, -1, -3, -1, -1, -2, -2, -3, -3, -1, -2, -4, 7, -1, -1, -4, -3, -2, -2, -1, -2, -4]),  Clazz_newIntArray (-1, [1, -1, 1, 0, -1, 0, 0, 0, -1, -2, -2, 0, -1, -2, -1, 4, 1, -3, -2, -2, 0, 0, 0, -4]),  Clazz_newIntArray (-1, [0, -1, 0, -1, -1, -1, -1, -2, -2, -1, -1, -1, -1, -2, -1, 1, 5, -2, -2, 0, -1, -1, 0, -4]),  Clazz_newIntArray (-1, [-3, -3, -4, -4, -2, -2, -3, -2, -2, -3, -2, -3, -1, 1, -4, -3, -2, 11, 2, -3, -4, -3, -2, -4]),  Clazz_newIntArray (-1, [-2, -2, -2, -3, -2, -1, -2, -3, 2, -1, -1, -2, -1, 3, -3, -2, -2, 2, 7, -1, -3, -2, -1, -4]),  Clazz_newIntArray (-1, [0, -3, -3, -3, -1, -2, -2, -3, -3, 3, 1, -2, 1, -1, -2, -2, 0, -3, -1, 4, -3, -2, -1, -4]),  Clazz_newIntArray (-1, [-2, -1, 3, 4, -3, 0, 1, -1, 0, -3, -4, 0, -3, -3, -2, 0, -1, -4, -3, -3, 4, 1, -1, -4]),  Clazz_newIntArray (-1, [-1, 0, 0, 1, -3, 3, 4, -2, 0, -3, -3, 1, -1, -3, -1, 0, -1, -3, -2, -2, 1, 4, -1, -4]),  Clazz_newIntArray (-1, [0, -1, -1, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, 0, 0, -2, -1, -1, -1, -1, -1, -4]),  Clazz_newIntArray (-1, [-4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, 1])]),
17898 "PAM250",  Clazz_newArray (-1, [ Clazz_newIntArray (-1, [2, -2, 0, 0, -2, 0, 0, 1, -1, -1, -2, -1, -1, -3, 1, 1, 1, -6, -3, 0, 0, 0, 0, -8]),  Clazz_newIntArray (-1, [-2, 6, 0, -1, -4, 1, -1, -3, 2, -2, -3, 3, 0, -4, 0, 0, -1, 2, -4, -2, -1, 0, -1, -8]),  Clazz_newIntArray (-1, [0, 0, 2, 2, -4, 1, 1, 0, 2, -2, -3, 1, -2, -3, 0, 1, 0, -4, -2, -2, 2, 1, 0, -8]),  Clazz_newIntArray (-1, [0, -1, 2, 4, -5, 2, 3, 1, 1, -2, -4, 0, -3, -6, -1, 0, 0, -7, -4, -2, 3, 3, -1, -8]),  Clazz_newIntArray (-1, [-2, -4, -4, -5, 12, -5, -5, -3, -3, -2, -6, -5, -5, -4, -3, 0, -2, -8, 0, -2, -4, -5, -3, -8]),  Clazz_newIntArray (-1, [0, 1, 1, 2, -5, 4, 2, -1, 3, -2, -2, 1, -1, -5, 0, -1, -1, -5, -4, -2, 1, 3, -1, -8]),  Clazz_newIntArray (-1, [0, -1, 1, 3, -5, 2, 4, 0, 1, -2, -3, 0, -2, -5, -1, 0, 0, -7, -4, -2, 3, 3, -1, -8]),  Clazz_newIntArray (-1, [1, -3, 0, 1, -3, -1, 0, 5, -2, -3, -4, -2, -3, -5, 0, 1, 0, -7, -5, -1, 0, 0, -1, -8]),  Clazz_newIntArray (-1, [-1, 2, 2, 1, -3, 3, 1, -2, 6, -2, -2, 0, -2, -2, 0, -1, -1, -3, 0, -2, 1, 2, -1, -8]),  Clazz_newIntArray (-1, [-1, -2, -2, -2, -2, -2, -2, -3, -2, 5, 2, -2, 2, 1, -2, -1, 0, -5, -1, 4, -2, -2, -1, -8]),  Clazz_newIntArray (-1, [-2, -3, -3, -4, -6, -2, -3, -4, -2, 2, 6, -3, 4, 2, -3, -3, -2, -2, -1, 2, -3, -3, -1, -8]),  Clazz_newIntArray (-1, [-1, 3, 1, 0, -5, 1, 0, -2, 0, -2, -3, 5, 0, -5, -1, 0, 0, -3, -4, -2, 1, 0, -1, -8]),  Clazz_newIntArray (-1, [-1, 0, -2, -3, -5, -1, -2, -3, -2, 2, 4, 0, 6, 0, -2, -2, -1, -4, -2, 2, -2, -2, -1, -8]),  Clazz_newIntArray (-1, [-3, -4, -3, -6, -4, -5, -5, -5, -2, 1, 2, -5, 0, 9, -5, -3, -3, 0, 7, -1, -4, -5, -2, -8]),  Clazz_newIntArray (-1, [1, 0, 0, -1, -3, 0, -1, 0, 0, -2, -3, -1, -2, -5, 6, 1, 0, -6, -5, -1, -1, 0, -1, -8]),  Clazz_newIntArray (-1, [1, 0, 1, 0, 0, -1, 0, 1, -1, -1, -3, 0, -2, -3, 1, 2, 1, -2, -3, -1, 0, 0, 0, -8]),  Clazz_newIntArray (-1, [1, -1, 0, 0, -2, -1, 0, 0, -1, 0, -2, 0, -1, -3, 0, 1, 3, -5, -3, 0, 0, -1, 0, -8]),  Clazz_newIntArray (-1, [-6, 2, -4, -7, -8, -5, -7, -7, -3, -5, -2, -3, -4, 0, -6, -2, -5, 17, 0, -6, -5, -6, -4, -8]),  Clazz_newIntArray (-1, [-3, -4, -2, -4, 0, -4, -4, -5, 0, -1, -1, -4, -2, 7, -5, -3, -3, 0, 10, -2, -3, -4, -2, -8]),  Clazz_newIntArray (-1, [0, -2, -2, -2, -2, -2, -2, -1, -2, 4, 2, -2, 2, -1, -1, -1, 0, -6, -2, 4, -2, -2, -1, -8]),  Clazz_newIntArray (-1, [0, -1, 2, 3, -4, 1, 3, 0, 1, -2, -3, 1, -2, -4, -1, 0, 0, -5, -3, -2, 3, 2, -1, -8]),  Clazz_newIntArray (-1, [0, 0, 1, 3, -5, 3, 3, 0, 2, -2, -3, 0, -2, -5, 0, 0, -1, -6, -4, -2, 2, 3, -1, -8]),  Clazz_newIntArray (-1, [0, -1, 0, -1, -3, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, 0, 0, -4, -2, -1, -1, -1, -1, -8]),  Clazz_newIntArray (-1, [-8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, 1])]));
17899 c$.ssHash = c$.prototype.ssHash =  new java.util.Hashtable ();
17900 {
17901 jalview.schemes.ResidueProperties.ssHash.put ("H", java.awt.Color.magenta);
17902 jalview.schemes.ResidueProperties.ssHash.put ("E", java.awt.Color.yellow);
17903 jalview.schemes.ResidueProperties.ssHash.put ("-", java.awt.Color.white);
17904 jalview.schemes.ResidueProperties.ssHash.put (".", java.awt.Color.white);
17905 jalview.schemes.ResidueProperties.ssHash.put ("S", java.awt.Color.cyan);
17906 jalview.schemes.ResidueProperties.ssHash.put ("T", java.awt.Color.blue);
17907 jalview.schemes.ResidueProperties.ssHash.put ("G", java.awt.Color.pink);
17908 jalview.schemes.ResidueProperties.ssHash.put ("I", java.awt.Color.pink);
17909 jalview.schemes.ResidueProperties.ssHash.put ("B", java.awt.Color.yellow);
17910 }Clazz_defineStatics (c$,
17911 "DNA",  Clazz_newArray (-1, [ Clazz_newIntArray (-1, [10, -8, -8, -8, -8, 1, 1, 1, -8, 1, 1]),  Clazz_newIntArray (-1, [-8, 10, -8, -8, -8, 1, 1, -8, 1, 1, 1]),  Clazz_newIntArray (-1, [-8, -8, 10, -8, -8, 1, 1, 1, -8, 1, 1]),  Clazz_newIntArray (-1, [-8, -8, -8, 10, 10, 1, 1, -8, 1, 1, 1]),  Clazz_newIntArray (-1, [-8, -8, -8, 10, 10, 1, 1, -8, 1, 1, 1]),  Clazz_newIntArray (-1, [1, 1, 1, 1, 1, 10, 0, 0, 0, 1, 1]),  Clazz_newIntArray (-1, [1, 1, 1, 1, 1, 0, 10, 0, 0, 1, 1]),  Clazz_newIntArray (-1, [1, -8, 1, -8, -8, 0, 0, 10, -8, 1, 1]),  Clazz_newIntArray (-1, [-8, 1, -8, 1, 1, 0, 0, -8, 10, 1, 1]),  Clazz_newIntArray (-1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 1]),  Clazz_newIntArray (-1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])]));
17912 {
17913 jalview.schemes.ResidueProperties.scoreMatrices.put ("BLOSUM62",  new jalview.schemes.ScoreMatrix ("BLOSUM62", jalview.schemes.ResidueProperties.BLOSUM62, 0));
17914 jalview.schemes.ResidueProperties.scoreMatrices.put ("PAM250",  new jalview.schemes.ScoreMatrix ("PAM250", jalview.schemes.ResidueProperties.PAM250, 0));
17915 jalview.schemes.ResidueProperties.scoreMatrices.put ("DNA",  new jalview.schemes.ScoreMatrix ("DNA", jalview.schemes.ResidueProperties.DNA, 1));
17916 }c$.pidColours = c$.prototype.pidColours =  Clazz_newArray (-1, [jalview.schemes.ResidueProperties.midBlue,  new java.awt.Color (153, 153, 255),  new java.awt.Color (204, 204, 255)]);
17917 Clazz_defineStatics (c$,
17918 "pidThresholds",  Clazz_newFloatArray (-1, [80, 60, 40]));
17919 c$.codonHash = c$.prototype.codonHash =  new java.util.HashMap ();
17920 c$.Lys = c$.prototype.Lys =  new java.util.ArrayList ();
17921 c$.Asn = c$.prototype.Asn =  new java.util.ArrayList ();
17922 c$.Gln = c$.prototype.Gln =  new java.util.ArrayList ();
17923 c$.His = c$.prototype.His =  new java.util.ArrayList ();
17924 c$.Glu = c$.prototype.Glu =  new java.util.ArrayList ();
17925 c$.Asp = c$.prototype.Asp =  new java.util.ArrayList ();
17926 c$.Tyr = c$.prototype.Tyr =  new java.util.ArrayList ();
17927 c$.Thr = c$.prototype.Thr =  new java.util.ArrayList ();
17928 c$.Pro = c$.prototype.Pro =  new java.util.ArrayList ();
17929 c$.Ala = c$.prototype.Ala =  new java.util.ArrayList ();
17930 c$.Ser = c$.prototype.Ser =  new java.util.ArrayList ();
17931 c$.Arg = c$.prototype.Arg =  new java.util.ArrayList ();
17932 c$.Gly = c$.prototype.Gly =  new java.util.ArrayList ();
17933 c$.Trp = c$.prototype.Trp =  new java.util.ArrayList ();
17934 c$.Cys = c$.prototype.Cys =  new java.util.ArrayList ();
17935 c$.Ile = c$.prototype.Ile =  new java.util.ArrayList ();
17936 c$.Met = c$.prototype.Met =  new java.util.ArrayList ();
17937 c$.Leu = c$.prototype.Leu =  new java.util.ArrayList ();
17938 c$.Val = c$.prototype.Val =  new java.util.ArrayList ();
17939 c$.Phe = c$.prototype.Phe =  new java.util.ArrayList ();
17940 c$.STOP = c$.prototype.STOP =  new java.util.ArrayList ();
17941 Clazz_defineStatics (c$,
17942 "START", "ATG");
17943 {
17944 jalview.schemes.ResidueProperties.codonHash.put ("K", jalview.schemes.ResidueProperties.Lys);
17945 jalview.schemes.ResidueProperties.codonHash.put ("N", jalview.schemes.ResidueProperties.Asn);
17946 jalview.schemes.ResidueProperties.codonHash.put ("Q", jalview.schemes.ResidueProperties.Gln);
17947 jalview.schemes.ResidueProperties.codonHash.put ("H", jalview.schemes.ResidueProperties.His);
17948 jalview.schemes.ResidueProperties.codonHash.put ("E", jalview.schemes.ResidueProperties.Glu);
17949 jalview.schemes.ResidueProperties.codonHash.put ("D", jalview.schemes.ResidueProperties.Asp);
17950 jalview.schemes.ResidueProperties.codonHash.put ("Y", jalview.schemes.ResidueProperties.Tyr);
17951 jalview.schemes.ResidueProperties.codonHash.put ("T", jalview.schemes.ResidueProperties.Thr);
17952 jalview.schemes.ResidueProperties.codonHash.put ("P", jalview.schemes.ResidueProperties.Pro);
17953 jalview.schemes.ResidueProperties.codonHash.put ("A", jalview.schemes.ResidueProperties.Ala);
17954 jalview.schemes.ResidueProperties.codonHash.put ("S", jalview.schemes.ResidueProperties.Ser);
17955 jalview.schemes.ResidueProperties.codonHash.put ("R", jalview.schemes.ResidueProperties.Arg);
17956 jalview.schemes.ResidueProperties.codonHash.put ("G", jalview.schemes.ResidueProperties.Gly);
17957 jalview.schemes.ResidueProperties.codonHash.put ("W", jalview.schemes.ResidueProperties.Trp);
17958 jalview.schemes.ResidueProperties.codonHash.put ("C", jalview.schemes.ResidueProperties.Cys);
17959 jalview.schemes.ResidueProperties.codonHash.put ("I", jalview.schemes.ResidueProperties.Ile);
17960 jalview.schemes.ResidueProperties.codonHash.put ("M", jalview.schemes.ResidueProperties.Met);
17961 jalview.schemes.ResidueProperties.codonHash.put ("L", jalview.schemes.ResidueProperties.Leu);
17962 jalview.schemes.ResidueProperties.codonHash.put ("V", jalview.schemes.ResidueProperties.Val);
17963 jalview.schemes.ResidueProperties.codonHash.put ("F", jalview.schemes.ResidueProperties.Phe);
17964 jalview.schemes.ResidueProperties.codonHash.put ("STOP", jalview.schemes.ResidueProperties.STOP);
17965 }c$.ambiguityCodes = c$.prototype.ambiguityCodes =  new java.util.Hashtable ();
17966 c$.codonHash2 = c$.prototype.codonHash2 =  new java.util.Hashtable ();
17967 c$._ambiguityCodes = c$.prototype._ambiguityCodes =  new java.util.Hashtable ();
17968 {
17969 jalview.schemes.ResidueProperties.ambiguityCodes.put ("R",  Clazz_newArray (-1, ["A", "G"]));
17970 jalview.schemes.ResidueProperties.ambiguityCodes.put ("Y",  Clazz_newArray (-1, ["T", "C"]));
17971 jalview.schemes.ResidueProperties.ambiguityCodes.put ("W",  Clazz_newArray (-1, ["A", "T"]));
17972 jalview.schemes.ResidueProperties.ambiguityCodes.put ("S",  Clazz_newArray (-1, ["G", "C"]));
17973 jalview.schemes.ResidueProperties.ambiguityCodes.put ("M",  Clazz_newArray (-1, ["A", "C"]));
17974 jalview.schemes.ResidueProperties.ambiguityCodes.put ("K",  Clazz_newArray (-1, ["G", "T"]));
17975 jalview.schemes.ResidueProperties.ambiguityCodes.put ("H",  Clazz_newArray (-1, ["A", "T", "C"]));
17976 jalview.schemes.ResidueProperties.ambiguityCodes.put ("B",  Clazz_newArray (-1, ["G", "T", "C"]));
17977 jalview.schemes.ResidueProperties.ambiguityCodes.put ("V",  Clazz_newArray (-1, ["G", "A", "C"]));
17978 jalview.schemes.ResidueProperties.ambiguityCodes.put ("D",  Clazz_newArray (-1, ["G", "A", "T"]));
17979 jalview.schemes.ResidueProperties.ambiguityCodes.put ("N",  Clazz_newArray (-1, ["G", "A", "T", "C"]));
17980 jalview.schemes.ResidueProperties.codonHash2.put ("AAA", "K");
17981 jalview.schemes.ResidueProperties.codonHash2.put ("AAG", "K");
17982 jalview.schemes.ResidueProperties.codonHash2.put ("AAC", "N");
17983 jalview.schemes.ResidueProperties.codonHash2.put ("AAT", "N");
17984 jalview.schemes.ResidueProperties.codonHash2.put ("CAA", "Q");
17985 jalview.schemes.ResidueProperties.codonHash2.put ("CAG", "Q");
17986 jalview.schemes.ResidueProperties.codonHash2.put ("CAC", "H");
17987 jalview.schemes.ResidueProperties.codonHash2.put ("CAT", "H");
17988 jalview.schemes.ResidueProperties.codonHash2.put ("GAA", "E");
17989 jalview.schemes.ResidueProperties.codonHash2.put ("GAG", "E");
17990 jalview.schemes.ResidueProperties.codonHash2.put ("GAC", "D");
17991 jalview.schemes.ResidueProperties.codonHash2.put ("GAT", "D");
17992 jalview.schemes.ResidueProperties.codonHash2.put ("TAC", "Y");
17993 jalview.schemes.ResidueProperties.codonHash2.put ("TAT", "Y");
17994 jalview.schemes.ResidueProperties.codonHash2.put ("ACA", "T");
17995 jalview.schemes.ResidueProperties.codonHash2.put ("ACC", "T");
17996 jalview.schemes.ResidueProperties.codonHash2.put ("ACT", "T");
17997 jalview.schemes.ResidueProperties.codonHash2.put ("ACG", "T");
17998 jalview.schemes.ResidueProperties.codonHash2.put ("CCA", "P");
17999 jalview.schemes.ResidueProperties.codonHash2.put ("CCG", "P");
18000 jalview.schemes.ResidueProperties.codonHash2.put ("CCC", "P");
18001 jalview.schemes.ResidueProperties.codonHash2.put ("CCT", "P");
18002 jalview.schemes.ResidueProperties.codonHash2.put ("GCA", "A");
18003 jalview.schemes.ResidueProperties.codonHash2.put ("GCG", "A");
18004 jalview.schemes.ResidueProperties.codonHash2.put ("GCC", "A");
18005 jalview.schemes.ResidueProperties.codonHash2.put ("GCT", "A");
18006 jalview.schemes.ResidueProperties.codonHash2.put ("TCA", "S");
18007 jalview.schemes.ResidueProperties.codonHash2.put ("TCG", "S");
18008 jalview.schemes.ResidueProperties.codonHash2.put ("TCC", "S");
18009 jalview.schemes.ResidueProperties.codonHash2.put ("TCT", "S");
18010 jalview.schemes.ResidueProperties.codonHash2.put ("AGC", "S");
18011 jalview.schemes.ResidueProperties.codonHash2.put ("AGT", "S");
18012 jalview.schemes.ResidueProperties.codonHash2.put ("AGA", "R");
18013 jalview.schemes.ResidueProperties.codonHash2.put ("AGG", "R");
18014 jalview.schemes.ResidueProperties.codonHash2.put ("CGA", "R");
18015 jalview.schemes.ResidueProperties.codonHash2.put ("CGG", "R");
18016 jalview.schemes.ResidueProperties.codonHash2.put ("CGC", "R");
18017 jalview.schemes.ResidueProperties.codonHash2.put ("CGT", "R");
18018 jalview.schemes.ResidueProperties.codonHash2.put ("GGA", "G");
18019 jalview.schemes.ResidueProperties.codonHash2.put ("GGG", "G");
18020 jalview.schemes.ResidueProperties.codonHash2.put ("GGC", "G");
18021 jalview.schemes.ResidueProperties.codonHash2.put ("GGT", "G");
18022 jalview.schemes.ResidueProperties.codonHash2.put ("TGA", "*");
18023 jalview.schemes.ResidueProperties.codonHash2.put ("TAA", "*");
18024 jalview.schemes.ResidueProperties.codonHash2.put ("TAG", "*");
18025 jalview.schemes.ResidueProperties.codonHash2.put ("TGG", "W");
18026 jalview.schemes.ResidueProperties.codonHash2.put ("TGC", "C");
18027 jalview.schemes.ResidueProperties.codonHash2.put ("TGT", "C");
18028 jalview.schemes.ResidueProperties.codonHash2.put ("ATA", "I");
18029 jalview.schemes.ResidueProperties.codonHash2.put ("ATC", "I");
18030 jalview.schemes.ResidueProperties.codonHash2.put ("ATT", "I");
18031 jalview.schemes.ResidueProperties.codonHash2.put ("ATG", "M");
18032 jalview.schemes.ResidueProperties.codonHash2.put ("CTA", "L");
18033 jalview.schemes.ResidueProperties.codonHash2.put ("CTG", "L");
18034 jalview.schemes.ResidueProperties.codonHash2.put ("CTC", "L");
18035 jalview.schemes.ResidueProperties.codonHash2.put ("CTT", "L");
18036 jalview.schemes.ResidueProperties.codonHash2.put ("TTA", "L");
18037 jalview.schemes.ResidueProperties.codonHash2.put ("TTG", "L");
18038 jalview.schemes.ResidueProperties.codonHash2.put ("GTA", "V");
18039 jalview.schemes.ResidueProperties.codonHash2.put ("GTG", "V");
18040 jalview.schemes.ResidueProperties.codonHash2.put ("GTC", "V");
18041 jalview.schemes.ResidueProperties.codonHash2.put ("GTT", "V");
18042 jalview.schemes.ResidueProperties.codonHash2.put ("TTC", "F");
18043 jalview.schemes.ResidueProperties.codonHash2.put ("TTT", "F");
18044 jalview.schemes.ResidueProperties.buildAmbiguityCodonSet ();
18045 }{
18046 jalview.schemes.ResidueProperties.Lys.add ("AAA");
18047 jalview.schemes.ResidueProperties.Lys.add ("AAG");
18048 jalview.schemes.ResidueProperties.Asn.add ("AAC");
18049 jalview.schemes.ResidueProperties.Asn.add ("AAT");
18050 jalview.schemes.ResidueProperties.Gln.add ("CAA");
18051 jalview.schemes.ResidueProperties.Gln.add ("CAG");
18052 jalview.schemes.ResidueProperties.His.add ("CAC");
18053 jalview.schemes.ResidueProperties.His.add ("CAT");
18054 jalview.schemes.ResidueProperties.Glu.add ("GAA");
18055 jalview.schemes.ResidueProperties.Glu.add ("GAG");
18056 jalview.schemes.ResidueProperties.Asp.add ("GAC");
18057 jalview.schemes.ResidueProperties.Asp.add ("GAT");
18058 jalview.schemes.ResidueProperties.Tyr.add ("TAC");
18059 jalview.schemes.ResidueProperties.Tyr.add ("TAT");
18060 jalview.schemes.ResidueProperties.Thr.add ("ACA");
18061 jalview.schemes.ResidueProperties.Thr.add ("ACG");
18062 jalview.schemes.ResidueProperties.Thr.add ("ACC");
18063 jalview.schemes.ResidueProperties.Thr.add ("ACT");
18064 jalview.schemes.ResidueProperties.Pro.add ("CCA");
18065 jalview.schemes.ResidueProperties.Pro.add ("CCG");
18066 jalview.schemes.ResidueProperties.Pro.add ("CCC");
18067 jalview.schemes.ResidueProperties.Pro.add ("CCT");
18068 jalview.schemes.ResidueProperties.Ala.add ("GCA");
18069 jalview.schemes.ResidueProperties.Ala.add ("GCG");
18070 jalview.schemes.ResidueProperties.Ala.add ("GCC");
18071 jalview.schemes.ResidueProperties.Ala.add ("GCT");
18072 jalview.schemes.ResidueProperties.Ser.add ("TCA");
18073 jalview.schemes.ResidueProperties.Ser.add ("TCG");
18074 jalview.schemes.ResidueProperties.Ser.add ("TCC");
18075 jalview.schemes.ResidueProperties.Ser.add ("TCT");
18076 jalview.schemes.ResidueProperties.Ser.add ("AGC");
18077 jalview.schemes.ResidueProperties.Ser.add ("AGT");
18078 jalview.schemes.ResidueProperties.Arg.add ("AGA");
18079 jalview.schemes.ResidueProperties.Arg.add ("AGG");
18080 jalview.schemes.ResidueProperties.Arg.add ("CGA");
18081 jalview.schemes.ResidueProperties.Arg.add ("CGG");
18082 jalview.schemes.ResidueProperties.Arg.add ("CGC");
18083 jalview.schemes.ResidueProperties.Arg.add ("CGT");
18084 jalview.schemes.ResidueProperties.Gly.add ("GGA");
18085 jalview.schemes.ResidueProperties.Gly.add ("GGG");
18086 jalview.schemes.ResidueProperties.Gly.add ("GGC");
18087 jalview.schemes.ResidueProperties.Gly.add ("GGT");
18088 jalview.schemes.ResidueProperties.STOP.add ("TGA");
18089 jalview.schemes.ResidueProperties.STOP.add ("TAA");
18090 jalview.schemes.ResidueProperties.STOP.add ("TAG");
18091 jalview.schemes.ResidueProperties.Trp.add ("TGG");
18092 jalview.schemes.ResidueProperties.Cys.add ("TGC");
18093 jalview.schemes.ResidueProperties.Cys.add ("TGT");
18094 jalview.schemes.ResidueProperties.Ile.add ("ATA");
18095 jalview.schemes.ResidueProperties.Ile.add ("ATC");
18096 jalview.schemes.ResidueProperties.Ile.add ("ATT");
18097 jalview.schemes.ResidueProperties.Met.add ("ATG");
18098 jalview.schemes.ResidueProperties.Leu.add ("CTA");
18099 jalview.schemes.ResidueProperties.Leu.add ("CTG");
18100 jalview.schemes.ResidueProperties.Leu.add ("CTC");
18101 jalview.schemes.ResidueProperties.Leu.add ("CTT");
18102 jalview.schemes.ResidueProperties.Leu.add ("TTA");
18103 jalview.schemes.ResidueProperties.Leu.add ("TTG");
18104 jalview.schemes.ResidueProperties.Val.add ("GTA");
18105 jalview.schemes.ResidueProperties.Val.add ("GTG");
18106 jalview.schemes.ResidueProperties.Val.add ("GTC");
18107 jalview.schemes.ResidueProperties.Val.add ("GTT");
18108 jalview.schemes.ResidueProperties.Phe.add ("TTC");
18109 jalview.schemes.ResidueProperties.Phe.add ("TTT");
18110 }c$.propHash = c$.prototype.propHash =  new java.util.Hashtable ();
18111 c$.hydrophobic = c$.prototype.hydrophobic =  new java.util.Hashtable ();
18112 c$.polar = c$.prototype.polar =  new java.util.Hashtable ();
18113 c$.small = c$.prototype.small =  new java.util.Hashtable ();
18114 c$.positive = c$.prototype.positive =  new java.util.Hashtable ();
18115 c$.negative = c$.prototype.negative =  new java.util.Hashtable ();
18116 c$.charged = c$.prototype.charged =  new java.util.Hashtable ();
18117 c$.aromatic = c$.prototype.aromatic =  new java.util.Hashtable ();
18118 c$.aliphatic = c$.prototype.aliphatic =  new java.util.Hashtable ();
18119 c$.tiny = c$.prototype.tiny =  new java.util.Hashtable ();
18120 c$.proline = c$.prototype.proline =  new java.util.Hashtable ();
18121 {
18122 jalview.schemes.ResidueProperties.hydrophobic.put ("I",  new Integer (1));
18123 jalview.schemes.ResidueProperties.hydrophobic.put ("L",  new Integer (1));
18124 jalview.schemes.ResidueProperties.hydrophobic.put ("V",  new Integer (1));
18125 jalview.schemes.ResidueProperties.hydrophobic.put ("C",  new Integer (1));
18126 jalview.schemes.ResidueProperties.hydrophobic.put ("A",  new Integer (1));
18127 jalview.schemes.ResidueProperties.hydrophobic.put ("G",  new Integer (1));
18128 jalview.schemes.ResidueProperties.hydrophobic.put ("M",  new Integer (1));
18129 jalview.schemes.ResidueProperties.hydrophobic.put ("F",  new Integer (1));
18130 jalview.schemes.ResidueProperties.hydrophobic.put ("Y",  new Integer (1));
18131 jalview.schemes.ResidueProperties.hydrophobic.put ("W",  new Integer (1));
18132 jalview.schemes.ResidueProperties.hydrophobic.put ("H",  new Integer (1));
18133 jalview.schemes.ResidueProperties.hydrophobic.put ("K",  new Integer (1));
18134 jalview.schemes.ResidueProperties.hydrophobic.put ("X",  new Integer (1));
18135 jalview.schemes.ResidueProperties.hydrophobic.put ("-",  new Integer (1));
18136 jalview.schemes.ResidueProperties.hydrophobic.put ("*",  new Integer (1));
18137 jalview.schemes.ResidueProperties.hydrophobic.put ("R",  new Integer (0));
18138 jalview.schemes.ResidueProperties.hydrophobic.put ("E",  new Integer (0));
18139 jalview.schemes.ResidueProperties.hydrophobic.put ("Q",  new Integer (0));
18140 jalview.schemes.ResidueProperties.hydrophobic.put ("D",  new Integer (0));
18141 jalview.schemes.ResidueProperties.hydrophobic.put ("N",  new Integer (0));
18142 jalview.schemes.ResidueProperties.hydrophobic.put ("S",  new Integer (0));
18143 jalview.schemes.ResidueProperties.hydrophobic.put ("T",  new Integer (0));
18144 jalview.schemes.ResidueProperties.hydrophobic.put ("P",  new Integer (0));
18145 }{
18146 jalview.schemes.ResidueProperties.polar.put ("Y",  new Integer (1));
18147 jalview.schemes.ResidueProperties.polar.put ("W",  new Integer (1));
18148 jalview.schemes.ResidueProperties.polar.put ("H",  new Integer (1));
18149 jalview.schemes.ResidueProperties.polar.put ("K",  new Integer (1));
18150 jalview.schemes.ResidueProperties.polar.put ("R",  new Integer (1));
18151 jalview.schemes.ResidueProperties.polar.put ("E",  new Integer (1));
18152 jalview.schemes.ResidueProperties.polar.put ("Q",  new Integer (1));
18153 jalview.schemes.ResidueProperties.polar.put ("D",  new Integer (1));
18154 jalview.schemes.ResidueProperties.polar.put ("N",  new Integer (1));
18155 jalview.schemes.ResidueProperties.polar.put ("S",  new Integer (1));
18156 jalview.schemes.ResidueProperties.polar.put ("T",  new Integer (1));
18157 jalview.schemes.ResidueProperties.polar.put ("X",  new Integer (1));
18158 jalview.schemes.ResidueProperties.polar.put ("-",  new Integer (1));
18159 jalview.schemes.ResidueProperties.polar.put ("*",  new Integer (1));
18160 jalview.schemes.ResidueProperties.polar.put ("I",  new Integer (0));
18161 jalview.schemes.ResidueProperties.polar.put ("L",  new Integer (0));
18162 jalview.schemes.ResidueProperties.polar.put ("V",  new Integer (0));
18163 jalview.schemes.ResidueProperties.polar.put ("C",  new Integer (0));
18164 jalview.schemes.ResidueProperties.polar.put ("A",  new Integer (0));
18165 jalview.schemes.ResidueProperties.polar.put ("G",  new Integer (0));
18166 jalview.schemes.ResidueProperties.polar.put ("M",  new Integer (0));
18167 jalview.schemes.ResidueProperties.polar.put ("F",  new Integer (0));
18168 jalview.schemes.ResidueProperties.polar.put ("P",  new Integer (0));
18169 }{
18170 jalview.schemes.ResidueProperties.small.put ("I",  new Integer (0));
18171 jalview.schemes.ResidueProperties.small.put ("L",  new Integer (0));
18172 jalview.schemes.ResidueProperties.small.put ("V",  new Integer (1));
18173 jalview.schemes.ResidueProperties.small.put ("C",  new Integer (1));
18174 jalview.schemes.ResidueProperties.small.put ("A",  new Integer (1));
18175 jalview.schemes.ResidueProperties.small.put ("G",  new Integer (1));
18176 jalview.schemes.ResidueProperties.small.put ("M",  new Integer (0));
18177 jalview.schemes.ResidueProperties.small.put ("F",  new Integer (0));
18178 jalview.schemes.ResidueProperties.small.put ("Y",  new Integer (0));
18179 jalview.schemes.ResidueProperties.small.put ("W",  new Integer (0));
18180 jalview.schemes.ResidueProperties.small.put ("H",  new Integer (0));
18181 jalview.schemes.ResidueProperties.small.put ("K",  new Integer (0));
18182 jalview.schemes.ResidueProperties.small.put ("R",  new Integer (0));
18183 jalview.schemes.ResidueProperties.small.put ("E",  new Integer (0));
18184 jalview.schemes.ResidueProperties.small.put ("Q",  new Integer (0));
18185 jalview.schemes.ResidueProperties.small.put ("D",  new Integer (1));
18186 jalview.schemes.ResidueProperties.small.put ("N",  new Integer (1));
18187 jalview.schemes.ResidueProperties.small.put ("S",  new Integer (1));
18188 jalview.schemes.ResidueProperties.small.put ("T",  new Integer (1));
18189 jalview.schemes.ResidueProperties.small.put ("P",  new Integer (1));
18190 jalview.schemes.ResidueProperties.small.put ("-",  new Integer (1));
18191 jalview.schemes.ResidueProperties.small.put ("*",  new Integer (1));
18192 }{
18193 jalview.schemes.ResidueProperties.positive.put ("I",  new Integer (0));
18194 jalview.schemes.ResidueProperties.positive.put ("L",  new Integer (0));
18195 jalview.schemes.ResidueProperties.positive.put ("V",  new Integer (0));
18196 jalview.schemes.ResidueProperties.positive.put ("C",  new Integer (0));
18197 jalview.schemes.ResidueProperties.positive.put ("A",  new Integer (0));
18198 jalview.schemes.ResidueProperties.positive.put ("G",  new Integer (0));
18199 jalview.schemes.ResidueProperties.positive.put ("M",  new Integer (0));
18200 jalview.schemes.ResidueProperties.positive.put ("F",  new Integer (0));
18201 jalview.schemes.ResidueProperties.positive.put ("Y",  new Integer (0));
18202 jalview.schemes.ResidueProperties.positive.put ("W",  new Integer (0));
18203 jalview.schemes.ResidueProperties.positive.put ("H",  new Integer (1));
18204 jalview.schemes.ResidueProperties.positive.put ("K",  new Integer (1));
18205 jalview.schemes.ResidueProperties.positive.put ("R",  new Integer (1));
18206 jalview.schemes.ResidueProperties.positive.put ("E",  new Integer (0));
18207 jalview.schemes.ResidueProperties.positive.put ("Q",  new Integer (0));
18208 jalview.schemes.ResidueProperties.positive.put ("D",  new Integer (0));
18209 jalview.schemes.ResidueProperties.positive.put ("N",  new Integer (0));
18210 jalview.schemes.ResidueProperties.positive.put ("S",  new Integer (0));
18211 jalview.schemes.ResidueProperties.positive.put ("T",  new Integer (0));
18212 jalview.schemes.ResidueProperties.positive.put ("P",  new Integer (0));
18213 jalview.schemes.ResidueProperties.positive.put ("-",  new Integer (1));
18214 jalview.schemes.ResidueProperties.positive.put ("*",  new Integer (1));
18215 }{
18216 jalview.schemes.ResidueProperties.negative.put ("I",  new Integer (0));
18217 jalview.schemes.ResidueProperties.negative.put ("L",  new Integer (0));
18218 jalview.schemes.ResidueProperties.negative.put ("V",  new Integer (0));
18219 jalview.schemes.ResidueProperties.negative.put ("C",  new Integer (0));
18220 jalview.schemes.ResidueProperties.negative.put ("A",  new Integer (0));
18221 jalview.schemes.ResidueProperties.negative.put ("G",  new Integer (0));
18222 jalview.schemes.ResidueProperties.negative.put ("M",  new Integer (0));
18223 jalview.schemes.ResidueProperties.negative.put ("F",  new Integer (0));
18224 jalview.schemes.ResidueProperties.negative.put ("Y",  new Integer (0));
18225 jalview.schemes.ResidueProperties.negative.put ("W",  new Integer (0));
18226 jalview.schemes.ResidueProperties.negative.put ("H",  new Integer (0));
18227 jalview.schemes.ResidueProperties.negative.put ("K",  new Integer (0));
18228 jalview.schemes.ResidueProperties.negative.put ("R",  new Integer (0));
18229 jalview.schemes.ResidueProperties.negative.put ("E",  new Integer (1));
18230 jalview.schemes.ResidueProperties.negative.put ("Q",  new Integer (0));
18231 jalview.schemes.ResidueProperties.negative.put ("D",  new Integer (1));
18232 jalview.schemes.ResidueProperties.negative.put ("N",  new Integer (0));
18233 jalview.schemes.ResidueProperties.negative.put ("S",  new Integer (0));
18234 jalview.schemes.ResidueProperties.negative.put ("T",  new Integer (0));
18235 jalview.schemes.ResidueProperties.negative.put ("P",  new Integer (0));
18236 jalview.schemes.ResidueProperties.negative.put ("-",  new Integer (1));
18237 jalview.schemes.ResidueProperties.negative.put ("*",  new Integer (1));
18238 }{
18239 jalview.schemes.ResidueProperties.charged.put ("I",  new Integer (0));
18240 jalview.schemes.ResidueProperties.charged.put ("L",  new Integer (0));
18241 jalview.schemes.ResidueProperties.charged.put ("V",  new Integer (0));
18242 jalview.schemes.ResidueProperties.charged.put ("C",  new Integer (0));
18243 jalview.schemes.ResidueProperties.charged.put ("A",  new Integer (0));
18244 jalview.schemes.ResidueProperties.charged.put ("G",  new Integer (0));
18245 jalview.schemes.ResidueProperties.charged.put ("M",  new Integer (0));
18246 jalview.schemes.ResidueProperties.charged.put ("F",  new Integer (0));
18247 jalview.schemes.ResidueProperties.charged.put ("Y",  new Integer (0));
18248 jalview.schemes.ResidueProperties.charged.put ("W",  new Integer (0));
18249 jalview.schemes.ResidueProperties.charged.put ("H",  new Integer (1));
18250 jalview.schemes.ResidueProperties.charged.put ("K",  new Integer (1));
18251 jalview.schemes.ResidueProperties.charged.put ("R",  new Integer (1));
18252 jalview.schemes.ResidueProperties.charged.put ("E",  new Integer (1));
18253 jalview.schemes.ResidueProperties.charged.put ("Q",  new Integer (0));
18254 jalview.schemes.ResidueProperties.charged.put ("D",  new Integer (1));
18255 jalview.schemes.ResidueProperties.charged.put ("N",  new Integer (0));
18256 jalview.schemes.ResidueProperties.charged.put ("S",  new Integer (0));
18257 jalview.schemes.ResidueProperties.charged.put ("T",  new Integer (0));
18258 jalview.schemes.ResidueProperties.charged.put ("P",  new Integer (0));
18259 jalview.schemes.ResidueProperties.charged.put ("-",  new Integer (1));
18260 jalview.schemes.ResidueProperties.charged.put ("*",  new Integer (1));
18261 }{
18262 jalview.schemes.ResidueProperties.aromatic.put ("I",  new Integer (0));
18263 jalview.schemes.ResidueProperties.aromatic.put ("L",  new Integer (0));
18264 jalview.schemes.ResidueProperties.aromatic.put ("V",  new Integer (0));
18265 jalview.schemes.ResidueProperties.aromatic.put ("C",  new Integer (0));
18266 jalview.schemes.ResidueProperties.aromatic.put ("A",  new Integer (0));
18267 jalview.schemes.ResidueProperties.aromatic.put ("G",  new Integer (0));
18268 jalview.schemes.ResidueProperties.aromatic.put ("M",  new Integer (0));
18269 jalview.schemes.ResidueProperties.aromatic.put ("F",  new Integer (1));
18270 jalview.schemes.ResidueProperties.aromatic.put ("Y",  new Integer (1));
18271 jalview.schemes.ResidueProperties.aromatic.put ("W",  new Integer (1));
18272 jalview.schemes.ResidueProperties.aromatic.put ("H",  new Integer (1));
18273 jalview.schemes.ResidueProperties.aromatic.put ("K",  new Integer (0));
18274 jalview.schemes.ResidueProperties.aromatic.put ("R",  new Integer (0));
18275 jalview.schemes.ResidueProperties.aromatic.put ("E",  new Integer (0));
18276 jalview.schemes.ResidueProperties.aromatic.put ("Q",  new Integer (0));
18277 jalview.schemes.ResidueProperties.aromatic.put ("D",  new Integer (0));
18278 jalview.schemes.ResidueProperties.aromatic.put ("N",  new Integer (0));
18279 jalview.schemes.ResidueProperties.aromatic.put ("S",  new Integer (0));
18280 jalview.schemes.ResidueProperties.aromatic.put ("T",  new Integer (0));
18281 jalview.schemes.ResidueProperties.aromatic.put ("P",  new Integer (0));
18282 jalview.schemes.ResidueProperties.aromatic.put ("-",  new Integer (1));
18283 jalview.schemes.ResidueProperties.aromatic.put ("*",  new Integer (1));
18284 }{
18285 jalview.schemes.ResidueProperties.aliphatic.put ("I",  new Integer (1));
18286 jalview.schemes.ResidueProperties.aliphatic.put ("L",  new Integer (1));
18287 jalview.schemes.ResidueProperties.aliphatic.put ("V",  new Integer (1));
18288 jalview.schemes.ResidueProperties.aliphatic.put ("C",  new Integer (0));
18289 jalview.schemes.ResidueProperties.aliphatic.put ("A",  new Integer (0));
18290 jalview.schemes.ResidueProperties.aliphatic.put ("G",  new Integer (0));
18291 jalview.schemes.ResidueProperties.aliphatic.put ("M",  new Integer (0));
18292 jalview.schemes.ResidueProperties.aliphatic.put ("F",  new Integer (0));
18293 jalview.schemes.ResidueProperties.aliphatic.put ("Y",  new Integer (0));
18294 jalview.schemes.ResidueProperties.aliphatic.put ("W",  new Integer (0));
18295 jalview.schemes.ResidueProperties.aliphatic.put ("H",  new Integer (0));
18296 jalview.schemes.ResidueProperties.aliphatic.put ("K",  new Integer (0));
18297 jalview.schemes.ResidueProperties.aliphatic.put ("R",  new Integer (0));
18298 jalview.schemes.ResidueProperties.aliphatic.put ("E",  new Integer (0));
18299 jalview.schemes.ResidueProperties.aliphatic.put ("Q",  new Integer (0));
18300 jalview.schemes.ResidueProperties.aliphatic.put ("D",  new Integer (0));
18301 jalview.schemes.ResidueProperties.aliphatic.put ("N",  new Integer (0));
18302 jalview.schemes.ResidueProperties.aliphatic.put ("S",  new Integer (0));
18303 jalview.schemes.ResidueProperties.aliphatic.put ("T",  new Integer (0));
18304 jalview.schemes.ResidueProperties.aliphatic.put ("P",  new Integer (0));
18305 jalview.schemes.ResidueProperties.aliphatic.put ("-",  new Integer (1));
18306 jalview.schemes.ResidueProperties.aliphatic.put ("*",  new Integer (1));
18307 }{
18308 jalview.schemes.ResidueProperties.tiny.put ("I",  new Integer (0));
18309 jalview.schemes.ResidueProperties.tiny.put ("L",  new Integer (0));
18310 jalview.schemes.ResidueProperties.tiny.put ("V",  new Integer (0));
18311 jalview.schemes.ResidueProperties.tiny.put ("C",  new Integer (0));
18312 jalview.schemes.ResidueProperties.tiny.put ("A",  new Integer (1));
18313 jalview.schemes.ResidueProperties.tiny.put ("G",  new Integer (1));
18314 jalview.schemes.ResidueProperties.tiny.put ("M",  new Integer (0));
18315 jalview.schemes.ResidueProperties.tiny.put ("F",  new Integer (0));
18316 jalview.schemes.ResidueProperties.tiny.put ("Y",  new Integer (0));
18317 jalview.schemes.ResidueProperties.tiny.put ("W",  new Integer (0));
18318 jalview.schemes.ResidueProperties.tiny.put ("H",  new Integer (0));
18319 jalview.schemes.ResidueProperties.tiny.put ("K",  new Integer (0));
18320 jalview.schemes.ResidueProperties.tiny.put ("R",  new Integer (0));
18321 jalview.schemes.ResidueProperties.tiny.put ("E",  new Integer (0));
18322 jalview.schemes.ResidueProperties.tiny.put ("Q",  new Integer (0));
18323 jalview.schemes.ResidueProperties.tiny.put ("D",  new Integer (0));
18324 jalview.schemes.ResidueProperties.tiny.put ("N",  new Integer (0));
18325 jalview.schemes.ResidueProperties.tiny.put ("S",  new Integer (1));
18326 jalview.schemes.ResidueProperties.tiny.put ("T",  new Integer (0));
18327 jalview.schemes.ResidueProperties.tiny.put ("P",  new Integer (0));
18328 jalview.schemes.ResidueProperties.tiny.put ("-",  new Integer (1));
18329 jalview.schemes.ResidueProperties.tiny.put ("*",  new Integer (1));
18330 }{
18331 jalview.schemes.ResidueProperties.proline.put ("I",  new Integer (0));
18332 jalview.schemes.ResidueProperties.proline.put ("L",  new Integer (0));
18333 jalview.schemes.ResidueProperties.proline.put ("V",  new Integer (0));
18334 jalview.schemes.ResidueProperties.proline.put ("C",  new Integer (0));
18335 jalview.schemes.ResidueProperties.proline.put ("A",  new Integer (0));
18336 jalview.schemes.ResidueProperties.proline.put ("G",  new Integer (0));
18337 jalview.schemes.ResidueProperties.proline.put ("M",  new Integer (0));
18338 jalview.schemes.ResidueProperties.proline.put ("F",  new Integer (0));
18339 jalview.schemes.ResidueProperties.proline.put ("Y",  new Integer (0));
18340 jalview.schemes.ResidueProperties.proline.put ("W",  new Integer (0));
18341 jalview.schemes.ResidueProperties.proline.put ("H",  new Integer (0));
18342 jalview.schemes.ResidueProperties.proline.put ("K",  new Integer (0));
18343 jalview.schemes.ResidueProperties.proline.put ("R",  new Integer (0));
18344 jalview.schemes.ResidueProperties.proline.put ("E",  new Integer (0));
18345 jalview.schemes.ResidueProperties.proline.put ("Q",  new Integer (0));
18346 jalview.schemes.ResidueProperties.proline.put ("D",  new Integer (0));
18347 jalview.schemes.ResidueProperties.proline.put ("N",  new Integer (0));
18348 jalview.schemes.ResidueProperties.proline.put ("S",  new Integer (0));
18349 jalview.schemes.ResidueProperties.proline.put ("T",  new Integer (0));
18350 jalview.schemes.ResidueProperties.proline.put ("P",  new Integer (1));
18351 jalview.schemes.ResidueProperties.proline.put ("-",  new Integer (1));
18352 jalview.schemes.ResidueProperties.proline.put ("*",  new Integer (1));
18353 }{
18354 jalview.schemes.ResidueProperties.propHash.put ("hydrophobic", jalview.schemes.ResidueProperties.hydrophobic);
18355 jalview.schemes.ResidueProperties.propHash.put ("small", jalview.schemes.ResidueProperties.small);
18356 jalview.schemes.ResidueProperties.propHash.put ("positive", jalview.schemes.ResidueProperties.positive);
18357 jalview.schemes.ResidueProperties.propHash.put ("negative", jalview.schemes.ResidueProperties.negative);
18358 jalview.schemes.ResidueProperties.propHash.put ("charged", jalview.schemes.ResidueProperties.charged);
18359 jalview.schemes.ResidueProperties.propHash.put ("aromatic", jalview.schemes.ResidueProperties.aromatic);
18360 jalview.schemes.ResidueProperties.propHash.put ("aliphatic", jalview.schemes.ResidueProperties.aliphatic);
18361 jalview.schemes.ResidueProperties.propHash.put ("tiny", jalview.schemes.ResidueProperties.tiny);
18362 jalview.schemes.ResidueProperties.propHash.put ("proline", jalview.schemes.ResidueProperties.proline);
18363 jalview.schemes.ResidueProperties.propHash.put ("polar", jalview.schemes.ResidueProperties.polar);
18364 }{
18365 var propMatrixF =  Clazz_newIntArray (23, 23, 0);
18366 var propMatrixPos =  Clazz_newIntArray (23, 23, 0);
18367 var propMatrixEpos =  Clazz_newIntArray (23, 23, 0);
18368 for (var i = 0; i < 23; i++) {
18369 var maxF = 0;
18370 var maxP = 0;
18371 var maxEP = 0;
18372 var ic = "";
18373 if (jalview.schemes.ResidueProperties.aa.length > i) {
18374 ic += jalview.schemes.ResidueProperties.aa[i];
18375 } else {
18376 ic = "-";
18377 }for (var j = i + 1; j < 23; j++) {
18378 var jc = "";
18379 if (jalview.schemes.ResidueProperties.aa.length > j) {
18380 jc += jalview.schemes.ResidueProperties.aa[j];
18381 } else {
18382 jc = "-";
18383 }propMatrixF[i][j] = 0;
18384 propMatrixPos[i][j] = 0;
18385 propMatrixEpos[i][j] = 0;
18386 for (var en = jalview.schemes.ResidueProperties.propHash.keys (); en.hasMoreElements (); ) {
18387 var ph = en.nextElement ();
18388 var pph = jalview.schemes.ResidueProperties.propHash.get (ph);
18389 if (pph.get (ic) != null && pph.get (jc) != null) {
18390 var icp = pph.get (ic).intValue ();
18391 var jcp = pph.get (jc).intValue ();
18392 propMatrixPos[i][j] += icp == jcp && icp > 0 ? 2 : 0;
18393 propMatrixPos[j][i] += icp == jcp && icp > 0 ? 2 : 0;
18394 propMatrixF[i][j] += icp == jcp ? 2 : 0;
18395 propMatrixF[j][i] += icp == jcp ? 2 : 0;
18396 propMatrixEpos[i][j] += icp == jcp ? (1 + icp * 2) : 0;
18397 propMatrixEpos[j][i] += icp == jcp ? (1 + icp * 2) : 0;
18398 }}
18399 if (maxF < propMatrixF[i][j]) {
18400 maxF = propMatrixF[i][j];
18401 }if (maxP < propMatrixPos[i][j]) {
18402 maxP = propMatrixPos[i][j];
18403 }if (maxEP < propMatrixEpos[i][j]) {
18404 maxEP = propMatrixEpos[i][j];
18405 }}
18406 propMatrixF[i][i] = maxF;
18407 propMatrixPos[i][i] = maxP;
18408 propMatrixEpos[i][i] = maxEP;
18409 }
18410 jalview.schemes.ResidueProperties.scoreMatrices.put ("PID",  new jalview.analysis.scoremodels.PIDScoreModel ());
18411 jalview.schemes.ResidueProperties.scoreMatrices.put ("Displayed Features",  new jalview.analysis.scoremodels.FeatureScoreModel ());
18412 }Clazz_defineStatics (c$,
18413 "toDssp3State", null);
18414 {
18415 jalview.schemes.ResidueProperties.toDssp3State =  new java.util.Hashtable ();
18416 jalview.schemes.ResidueProperties.toDssp3State.put ("H", "H");
18417 jalview.schemes.ResidueProperties.toDssp3State.put ("E", "E");
18418 jalview.schemes.ResidueProperties.toDssp3State.put ("C", " ");
18419 jalview.schemes.ResidueProperties.toDssp3State.put (" ", " ");
18420 jalview.schemes.ResidueProperties.toDssp3State.put ("T", " ");
18421 jalview.schemes.ResidueProperties.toDssp3State.put ("B", "E");
18422 jalview.schemes.ResidueProperties.toDssp3State.put ("G", "H");
18423 jalview.schemes.ResidueProperties.toDssp3State.put ("I", "H");
18424 jalview.schemes.ResidueProperties.toDssp3State.put ("X", " ");
18425 }Clazz_defineStatics (c$,
18426 "toRNAssState", null,
18427 "RNAcloseParen",  Clazz_newBooleanArray (255, false));
18428 {
18429 jalview.schemes.ResidueProperties.toRNAssState =  new java.util.Hashtable ();
18430 jalview.schemes.ResidueProperties.toRNAssState.put (")", "(");
18431 jalview.schemes.ResidueProperties.toRNAssState.put ("(", "(");
18432 jalview.schemes.ResidueProperties.toRNAssState.put ("]", "[");
18433 jalview.schemes.ResidueProperties.toRNAssState.put ("[", "[");
18434 jalview.schemes.ResidueProperties.toRNAssState.put ("{", "{");
18435 jalview.schemes.ResidueProperties.toRNAssState.put ("}", "{");
18436 jalview.schemes.ResidueProperties.toRNAssState.put (">", ">");
18437 jalview.schemes.ResidueProperties.toRNAssState.put ("<", ">");
18438 jalview.schemes.ResidueProperties.toRNAssState.put ("A", "A");
18439 jalview.schemes.ResidueProperties.toRNAssState.put ("a", "A");
18440 jalview.schemes.ResidueProperties.toRNAssState.put ("B", "B");
18441 jalview.schemes.ResidueProperties.toRNAssState.put ("b", "B");
18442 jalview.schemes.ResidueProperties.toRNAssState.put ("C", "C");
18443 jalview.schemes.ResidueProperties.toRNAssState.put ("c", "C");
18444 jalview.schemes.ResidueProperties.toRNAssState.put ("D", "D");
18445 jalview.schemes.ResidueProperties.toRNAssState.put ("d", "D");
18446 jalview.schemes.ResidueProperties.toRNAssState.put ("E", "E");
18447 jalview.schemes.ResidueProperties.toRNAssState.put ("e", "E");
18448 jalview.schemes.ResidueProperties.toRNAssState.put ("F", "F");
18449 jalview.schemes.ResidueProperties.toRNAssState.put ("f", "F");
18450 jalview.schemes.ResidueProperties.toRNAssState.put ("G", "G");
18451 jalview.schemes.ResidueProperties.toRNAssState.put ("g", "G");
18452 jalview.schemes.ResidueProperties.toRNAssState.put ("H", "H");
18453 jalview.schemes.ResidueProperties.toRNAssState.put ("h", "H");
18454 jalview.schemes.ResidueProperties.toRNAssState.put ("I", "I");
18455 jalview.schemes.ResidueProperties.toRNAssState.put ("i", "I");
18456 jalview.schemes.ResidueProperties.toRNAssState.put ("J", "J");
18457 jalview.schemes.ResidueProperties.toRNAssState.put ("j", "J");
18458 jalview.schemes.ResidueProperties.toRNAssState.put ("K", "K");
18459 jalview.schemes.ResidueProperties.toRNAssState.put ("k", "K");
18460 jalview.schemes.ResidueProperties.toRNAssState.put ("L", "L");
18461 jalview.schemes.ResidueProperties.toRNAssState.put ("l", "L");
18462 jalview.schemes.ResidueProperties.toRNAssState.put ("M", "M");
18463 jalview.schemes.ResidueProperties.toRNAssState.put ("m", "M");
18464 jalview.schemes.ResidueProperties.toRNAssState.put ("N", "N");
18465 jalview.schemes.ResidueProperties.toRNAssState.put ("n", "N");
18466 jalview.schemes.ResidueProperties.toRNAssState.put ("O", "O");
18467 jalview.schemes.ResidueProperties.toRNAssState.put ("o", "O");
18468 jalview.schemes.ResidueProperties.toRNAssState.put ("P", "P");
18469 jalview.schemes.ResidueProperties.toRNAssState.put ("p", "P");
18470 jalview.schemes.ResidueProperties.toRNAssState.put ("Q", "Q");
18471 jalview.schemes.ResidueProperties.toRNAssState.put ("q", "Q");
18472 jalview.schemes.ResidueProperties.toRNAssState.put ("R", "R");
18473 jalview.schemes.ResidueProperties.toRNAssState.put ("r", "R");
18474 jalview.schemes.ResidueProperties.toRNAssState.put ("S", "S");
18475 jalview.schemes.ResidueProperties.toRNAssState.put ("s", "S");
18476 jalview.schemes.ResidueProperties.toRNAssState.put ("T", "T");
18477 jalview.schemes.ResidueProperties.toRNAssState.put ("t", "T");
18478 jalview.schemes.ResidueProperties.toRNAssState.put ("U", "U");
18479 jalview.schemes.ResidueProperties.toRNAssState.put ("u", "U");
18480 jalview.schemes.ResidueProperties.toRNAssState.put ("V", "V");
18481 jalview.schemes.ResidueProperties.toRNAssState.put ("v", "V");
18482 jalview.schemes.ResidueProperties.toRNAssState.put ("W", "W");
18483 jalview.schemes.ResidueProperties.toRNAssState.put ("w", "W");
18484 jalview.schemes.ResidueProperties.toRNAssState.put ("X", "X");
18485 jalview.schemes.ResidueProperties.toRNAssState.put ("x", "X");
18486 jalview.schemes.ResidueProperties.toRNAssState.put ("Y", "Y");
18487 jalview.schemes.ResidueProperties.toRNAssState.put ("y", "Y");
18488 jalview.schemes.ResidueProperties.toRNAssState.put ("Z", "Z");
18489 jalview.schemes.ResidueProperties.toRNAssState.put ("z", "Z");
18490 for (var p = 0; p < jalview.schemes.ResidueProperties.RNAcloseParen.length; p++) {
18491 jalview.schemes.ResidueProperties.RNAcloseParen[p] = false;
18492 }
18493 for (var k, $k = jalview.schemes.ResidueProperties.toRNAssState.keySet ().iterator (); $k.hasNext () && ((k = $k.next ()) || true);) {
18494 jalview.schemes.ResidueProperties.RNAcloseParen[k.charCodeAt (0)] = k.charAt (0) != jalview.schemes.ResidueProperties.toRNAssState.get (k).charAt (0);
18495 }
18496 }});
18497 Clazz_declarePackage ("jalview.analysis.scoremodels");
18498 Clazz_load (["jalview.api.analysis.ScoreModelI", "$.ViewBasedAnalysisI"], "jalview.analysis.scoremodels.FeatureScoreModel", ["jalview.util.Comparison", "java.util.ArrayList", "$.Arrays", "$.Hashtable"], function () {
18499 c$ = Clazz_decorateAsClass (function () {
18500 this.fr = null;
18501 Clazz_instantialize (this, arguments);
18502 }, jalview.analysis.scoremodels, "FeatureScoreModel", null, [jalview.api.analysis.ScoreModelI, jalview.api.analysis.ViewBasedAnalysisI]);
18503 Clazz_overrideMethod (c$, "configureFromAlignmentView", 
18504 function (view) {
18505 this.fr = view.cloneFeatureRenderer ();
18506 return true;
18507 }, "jalview.api.AlignmentViewPanel");
18508 Clazz_overrideMethod (c$, "findDistances", 
18509 function (seqData) {
18510 var nofeats = 0;
18511 var dft = java.util.Arrays.asList (this.fr.getDisplayedFeatureTypes ());
18512 if (dft != null) {
18513 nofeats = dft.size ();
18514 }var sequenceString = seqData.getVisibleAlignment (jalview.util.Comparison.GapChars.charAt (0)).getSequencesArray ();
18515 var noseqs = sequenceString.length;
18516 var cpwidth = seqData.getWidth ();
18517 var distance =  Clazz_newFloatArray (noseqs, noseqs, 0);
18518 if (nofeats == 0) {
18519 for (var d, $d = 0, $$d = distance; $d < $$d.length && ((d = $$d[$d]) || true); $d++) {
18520 for (var i = 0; i < d.length; d[i++] = 0) {
18521 ;}
18522 }
18523 return distance;
18524 }var max = 0;
18525 for (var cpos = 0; cpos < cpwidth; cpos++) {
18526 var sfap =  new java.util.ArrayList ();
18527 for (var i = 0; i < noseqs; i++) {
18528 var types =  new java.util.Hashtable ();
18529 var sfs = this.fr.findFeaturesAtRes (sequenceString[i], sequenceString[i].findPosition (cpos));
18530 for (var sf, $sf = sfs.iterator (); $sf.hasNext () && ((sf = $sf.next ()) || true);) {
18531 types.put (sf.getType (), sf);
18532 }
18533 sfap.add (types);
18534 }
18535 for (var i = 0; i < (noseqs - 1); i++) {
18536 if (cpos == 0) {
18537 distance[i][i] = 0;
18538 }for (var j = i + 1; j < noseqs; j++) {
18539 var sfcommon = 0;
18540 var fi = sfap.get (i);
18541 var fk;
18542 var fj = sfap.get (j);
18543 if (fi.size () > fj.size ()) {
18544 fk = fj;
18545 } else {
18546 fk = fi;
18547 fi = fj;
18548 }for (var k, $k = fi.keySet ().iterator (); $k.hasNext () && ((k = $k.next ()) || true);) {
18549 var sfj = fk.get (k);
18550 if (sfj != null) {
18551 sfcommon++;
18552 }}
18553 distance[i][j] += (fi.size () + fk.size () - 2 * sfcommon);
18554 distance[j][i] += distance[i][j];
18555 }
18556 }
18557 }
18558 for (var i = 0; i < noseqs; i++) {
18559 for (var j = i + 1; j < noseqs; j++) {
18560 distance[i][j] /= cpwidth;
18561 distance[j][i] = distance[i][j];
18562 }
18563 }
18564 return distance;
18565 }, "jalview.datamodel.AlignmentView");
18566 Clazz_overrideMethod (c$, "getName", 
18567 function () {
18568 return "Sequence Feature Similarity";
18569 });
18570 Clazz_overrideMethod (c$, "isDNA", 
18571 function () {
18572 return true;
18573 });
18574 Clazz_overrideMethod (c$, "isProtein", 
18575 function () {
18576 return true;
18577 });
18578 Clazz_overrideMethod (c$, "toString", 
18579 function () {
18580 return "Score between sequences based on hamming distance between binary vectors marking features displayed at each column";
18581 });
18582 });
18583 Clazz_declarePackage ("jalview.api.analysis");
18584 Clazz_declareInterface (jalview.api.analysis, "ScoreModelI");
18585 Clazz_declarePackage ("jalview.api.analysis");
18586 Clazz_declareInterface (jalview.api.analysis, "ViewBasedAnalysisI");
18587 Clazz_declarePackage ("jalview.analysis.scoremodels");
18588 Clazz_load (["jalview.api.analysis.ScoreModelI"], "jalview.analysis.scoremodels.PIDScoreModel", ["jalview.util.Comparison"], function () {
18589 c$ = Clazz_declareType (jalview.analysis.scoremodels, "PIDScoreModel", null, jalview.api.analysis.ScoreModelI);
18590 Clazz_overrideMethod (c$, "findDistances", 
18591 function (seqData) {
18592 var sequenceString = seqData.getSequenceStrings (jalview.util.Comparison.GapChars.charAt (0));
18593 var noseqs = sequenceString.length;
18594 var distance =  Clazz_newFloatArray (noseqs, noseqs, 0);
18595 for (var i = 0; i < (noseqs - 1); i++) {
18596 for (var j = i; j < noseqs; j++) {
18597 if (j == i) {
18598 distance[i][i] = 0;
18599 } else {
18600 distance[i][j] = 100 - jalview.util.Comparison.PID (sequenceString[i], sequenceString[j]);
18601 distance[j][i] = distance[i][j];
18602 }}
18603 }
18604 return distance;
18605 }, "jalview.datamodel.AlignmentView");
18606 Clazz_overrideMethod (c$, "getName", 
18607 function () {
18608 return "PID";
18609 });
18610 Clazz_overrideMethod (c$, "isDNA", 
18611 function () {
18612 return true;
18613 });
18614 Clazz_overrideMethod (c$, "isProtein", 
18615 function () {
18616 return true;
18617 });
18618 });
18619 Clazz_declarePackage ("jalview.schemes");
18620 Clazz_load (["jalview.analysis.scoremodels.PairwiseSeqScoreModel", "jalview.api.analysis.ScoreModelI"], "jalview.schemes.ScoreMatrix", ["jalview.schemes.ResidueProperties", "java.lang.StringBuffer"], function () {
18621 c$ = Clazz_decorateAsClass (function () {
18622 this.name = null;
18623 this.matrix = null;
18624 this.type = 0;
18625 Clazz_instantialize (this, arguments);
18626 }, jalview.schemes, "ScoreMatrix", jalview.analysis.scoremodels.PairwiseSeqScoreModel, jalview.api.analysis.ScoreModelI);
18627 Clazz_overrideMethod (c$, "getName", 
18628 function () {
18629 return this.name;
18630 });
18631 Clazz_makeConstructor (c$, 
18632 function (name, matrix, type) {
18633 Clazz_superConstructor (this, jalview.schemes.ScoreMatrix, []);
18634 this.matrix = matrix;
18635 this.type = type;
18636 this.name = name;
18637 }, "~S,~A,~N");
18638 Clazz_overrideMethod (c$, "isDNA", 
18639 function () {
18640 return this.type == 1;
18641 });
18642 Clazz_overrideMethod (c$, "isProtein", 
18643 function () {
18644 return this.type == 0;
18645 });
18646 Clazz_overrideMethod (c$, "getMatrix", 
18647 function () {
18648 return this.matrix;
18649 });
18650 Clazz_defineMethod (c$, "getPairwiseScore", 
18651 function (A1, A2) {
18652 return this.getPairwiseScore (A1.charAt (0), A2.charAt (0));
18653 }, "~S,~S");
18654 Clazz_defineMethod (c$, "getPairwiseScore", 
18655 function (c, d) {
18656 var pog = 0;
18657 try {
18658 var a = (this.type == 0) ? jalview.schemes.ResidueProperties.aaIndex[c.charCodeAt (0)] : jalview.schemes.ResidueProperties.nucleotideIndex[c.charCodeAt (0)];
18659 var b = (this.type == 0) ? jalview.schemes.ResidueProperties.aaIndex[d.charCodeAt (0)] : jalview.schemes.ResidueProperties.nucleotideIndex[d.charCodeAt (0)];
18660 pog = this.matrix[a][b];
18661 } catch (e) {
18662 if (Clazz_exceptionOf (e, Exception)) {
18663 } else {
18664 throw e;
18665 }
18666 }
18667 return pog;
18668 }, "~S,~S");
18669 Clazz_overrideMethod (c$, "toString", 
18670 function () {
18671 return this.outputMatrix (false);
18672 });
18673 Clazz_defineMethod (c$, "outputMatrix", 
18674 function (html) {
18675 var sb =  new StringBuffer ();
18676 var symbols = (this.type == 0) ? jalview.schemes.ResidueProperties.aaIndex : jalview.schemes.ResidueProperties.nucleotideIndex;
18677 var symMax = (this.type == 0) ? 23 : 10;
18678 var header = true;
18679 if (html) {
18680 sb.append ("<table border=\"1\">");
18681 }for (var sym = 'A'; sym <= 'Z'; sym = String.fromCharCode (sym.charCodeAt (0) + 1)) {
18682 if (symbols[sym.charCodeAt (0)] >= 0 && symbols[sym.charCodeAt (0)] < symMax) {
18683 if (header) {
18684 sb.append (html ? "<tr><td></td>" : "");
18685 for (var sym2 = 'A'; sym2 <= 'Z'; sym2 = String.fromCharCode (sym2.charCodeAt (0) + 1)) {
18686 if (symbols[sym2.charCodeAt (0)] >= 0 && symbols[sym2.charCodeAt (0)] < symMax) {
18687 sb.append ((html ? "<td>&nbsp;" : "\t") + sym2 + (html ? "&nbsp;</td>" : ""));
18688 }}
18689 header = false;
18690 sb.append (html ? "</tr>\n" : "\n");
18691 }if (html) {
18692 sb.append ("<tr>");
18693 }sb.append ((html ? "<td>" : "") + sym + (html ? "</td>" : ""));
18694 for (var sym2 = 'A'; sym2 <= 'Z'; sym2 = String.fromCharCode (sym2.charCodeAt (0) + 1)) {
18695 if (symbols[sym2.charCodeAt (0)] >= 0 && symbols[sym2.charCodeAt (0)] < symMax) {
18696 sb.append ((html ? "<td>" : "\t") + this.matrix[symbols[sym.charCodeAt (0)]][symbols[sym2.charCodeAt (0)]] + (html ? "</td>" : ""));
18697 }}
18698 sb.append (html ? "</tr>\n" : "\n");
18699 }}
18700 if (html) {
18701 sb.append ("</table>");
18702 }return sb.toString ();
18703 }, "~B");
18704 });
18705 Clazz_declarePackage ("jalview.analysis.scoremodels");
18706 Clazz_load (["jalview.api.analysis.ScoreModelI"], "jalview.analysis.scoremodels.PairwiseSeqScoreModel", ["jalview.util.Comparison"], function () {
18707 c$ = Clazz_declareType (jalview.analysis.scoremodels, "PairwiseSeqScoreModel", null, jalview.api.analysis.ScoreModelI);
18708 Clazz_overrideMethod (c$, "findDistances", 
18709 function (seqData) {
18710 var sequenceString = seqData.getSequenceStrings (jalview.util.Comparison.GapChars.charAt (0));
18711 var noseqs = sequenceString.length;
18712 var distance =  Clazz_newFloatArray (noseqs, noseqs, 0);
18713 var maxscore = 0;
18714 var end = sequenceString[0].length;
18715 for (var i = 0; i < (noseqs - 1); i++) {
18716 for (var j = i; j < noseqs; j++) {
18717 var score = 0;
18718 for (var k = 0; k < end; k++) {
18719 try {
18720 score += this.getPairwiseScore (sequenceString[i].charAt (k), sequenceString[j].charAt (k));
18721 } catch (ex) {
18722 if (Clazz_exceptionOf (ex, Exception)) {
18723 System.err.println ("err creating " + this.getName () + " tree");
18724 ex.printStackTrace ();
18725 } else {
18726 throw ex;
18727 }
18728 }
18729 }
18730 distance[i][j] = score;
18731 if (score > maxscore) {
18732 maxscore = score;
18733 }}
18734 }
18735 for (var i = 0; i < (noseqs - 1); i++) {
18736 for (var j = i; j < noseqs; j++) {
18737 distance[i][j] = maxscore - distance[i][j];
18738 distance[j][i] = distance[i][j];
18739 }
18740 }
18741 return distance;
18742 }, "jalview.datamodel.AlignmentView");
18743 });
18744 Clazz_declarePackage ("jalview.datamodel");
18745 Clazz_load (["jalview.datamodel.ASequence", "$.SequenceI", "jalview.jsdev.RegExp"], "jalview.datamodel.Sequence", ["jalview.analysis.AlignSeq", "jalview.datamodel.AlignmentAnnotation", "$.DBRefEntry", "$.DBRefSource", "$.PDBEntry", "$.SequenceFeature", "jalview.schemes.ResidueProperties", "jalview.util.Comparison", "$.StringUtils", "java.lang.StringBuffer", "java.util.ArrayList", "$.Vector"], function () {
18746 c$ = Clazz_decorateAsClass (function () {
18747 this.datasetSequence = null;
18748 this.name = null;
18749 this.sequence = null;
18750 this.description = null;
18751 this.start = 0;
18752 this.end = 0;
18753 this.pdbIds = null;
18754 this.vamsasId = null;
18755 this.dbrefs = null;
18756 this.rna = null;
18757 this.annotation = null;
18758 this.index = -1;
18759 this.sequenceFeatures = null;
18760 this.limitrx = null;
18761 this.endrx = null;
18762 Clazz_instantialize (this, arguments);
18763 }, jalview.datamodel, "Sequence", jalview.datamodel.ASequence, jalview.datamodel.SequenceI);
18764 Clazz_prepareFields (c$, function () {
18765 this.limitrx = jalview.jsdev.RegExp.newRegex (["[/][0-9]{1,}[-][0-9]{1,}$"]);
18766 this.endrx = jalview.jsdev.RegExp.newRegex (["[0-9]{1,}$"]);
18767 });
18768 Clazz_makeConstructor (c$, 
18769 function (name, sequence, start, end) {
18770 Clazz_superConstructor (this, jalview.datamodel.Sequence, []);
18771 this.initSeqAndName (name, sequence.toCharArray (), start, end);
18772 }, "~S,~S,~N,~N");
18773 Clazz_makeConstructor (c$, 
18774 function (name, sequence, start, end) {
18775 Clazz_superConstructor (this, jalview.datamodel.Sequence, []);
18776 this.initSeqAndName (name, sequence, start, end);
18777 }, "~S,~A,~N,~N");
18778 Clazz_defineMethod (c$, "initSeqAndName", 
18779 function (name2, sequence2, start2, end2) {
18780 this.name = name2;
18781 this.sequence = sequence2;
18782 this.start = start2;
18783 this.end = end2;
18784 this.parseId ();
18785 this.checkValidRange ();
18786 }, "~S,~A,~N,~N");
18787 Clazz_defineMethod (c$, "parseId", 
18788 function () {
18789 if (this.name == null) {
18790 System.err.println ("POSSIBLE IMPLEMENTATION ERROR: null sequence name passed to constructor.");
18791 this.name = "";
18792 }if (this.limitrx.search (this.name)) {
18793 this.name = this.limitrx.left ();
18794 this.endrx.search (this.limitrx.stringMatched ());
18795 this.setStart (Integer.parseInt (this.limitrx.stringMatched ().substring (1, this.endrx.matchedFrom () - 1)));
18796 this.setEnd (Integer.parseInt (this.endrx.stringMatched ()));
18797 }});
18798 Clazz_defineMethod (c$, "checkValidRange", 
18799 function () {
18800 {
18801 var endRes = 0;
18802 for (var j = 0; j < this.sequence.length; j++) {
18803 if (!jalview.util.Comparison.isGap (this.sequence[j])) {
18804 endRes++;
18805 }}
18806 if (endRes > 0) {
18807 endRes += this.start - 1;
18808 }if (this.end < endRes) {
18809 this.end = endRes;
18810 }}});
18811 Clazz_makeConstructor (c$, 
18812 function (name, sequence) {
18813 this.construct (name, sequence, 1, -1);
18814 }, "~S,~S");
18815 Clazz_makeConstructor (c$, 
18816 function (seq) {
18817 this.construct (seq, seq.getAnnotation ());
18818 }, "jalview.datamodel.SequenceI");
18819 Clazz_makeConstructor (c$, 
18820 function (seq, alAnnotation) {
18821 Clazz_superConstructor (this, jalview.datamodel.Sequence, []);
18822 this.initSeqFrom (seq, alAnnotation);
18823 }, "jalview.datamodel.SequenceI,~A");
18824 Clazz_defineMethod (c$, "initSeqFrom", 
18825 function (seq, alAnnotation) {
18826 this.initSeqAndName (seq.getName (), seq.getSequence (), seq.getStart (), seq.getEnd ());
18827 this.description = seq.getDescription ();
18828 if (seq.getSequenceFeatures () != null) {
18829 var sf = seq.getSequenceFeatures ();
18830 for (var i = 0; i < sf.length; i++) {
18831 this.addSequenceFeature ( new jalview.datamodel.SequenceFeature (sf[i]));
18832 }
18833 }this.setDatasetSequence (seq.getDatasetSequence ());
18834 if (this.datasetSequence == null && seq.getDBRef () != null) {
18835 var dbr = seq.getDBRef ();
18836 for (var i = 0; i < dbr.length; i++) {
18837 this.addDBRef ( new jalview.datamodel.DBRefEntry (dbr[i]));
18838 }
18839 }if (seq.getAnnotation () != null) {
18840 var sqann = seq.getAnnotation ();
18841 for (var i = 0; i < sqann.length; i++) {
18842 if (sqann[i] == null) {
18843 continue;
18844 }var found = (alAnnotation == null);
18845 if (!found) {
18846 for (var apos = 0; !found && apos < alAnnotation.length; apos++) {
18847 found = (alAnnotation[apos] === sqann[i]);
18848 }
18849 }if (found) {
18850 var newann =  new jalview.datamodel.AlignmentAnnotation (sqann[i]);
18851 this.addAlignmentAnnotation (newann);
18852 }}
18853 }if (seq.getPDBId () != null) {
18854 var ids = seq.getPDBId ();
18855 var e = ids.elements ();
18856 while (e.hasMoreElements ()) {
18857 this.addPDBId ( new jalview.datamodel.PDBEntry (e.nextElement ()));
18858 }
18859 }}, "jalview.datamodel.SequenceI,~A");
18860 Clazz_defineMethod (c$, "setSequenceFeatures", 
18861 function (features) {
18862 this.sequenceFeatures = features;
18863 }, "~A");
18864 Clazz_overrideMethod (c$, "addSequenceFeature", 
18865 function (sf) {
18866 if (this.sequenceFeatures == null) {
18867 this.sequenceFeatures =  new Array (0);
18868 }for (var i = 0; i < this.sequenceFeatures.length; i++) {
18869 if (this.sequenceFeatures[i].equals (sf)) {
18870 return;
18871 }}
18872 var temp =  new Array (this.sequenceFeatures.length + 1);
18873 System.arraycopy (this.sequenceFeatures, 0, temp, 0, this.sequenceFeatures.length);
18874 temp[this.sequenceFeatures.length] = sf;
18875 this.sequenceFeatures = temp;
18876 }, "jalview.datamodel.SequenceFeature");
18877 Clazz_overrideMethod (c$, "deleteFeature", 
18878 function (sf) {
18879 if (this.sequenceFeatures == null) {
18880 return;
18881 }var index = 0;
18882 for (index = 0; index < this.sequenceFeatures.length; index++) {
18883 if (this.sequenceFeatures[index].equals (sf)) {
18884 break;
18885 }}
18886 if (index == this.sequenceFeatures.length) {
18887 return;
18888 }var sfLength = this.sequenceFeatures.length;
18889 if (sfLength < 2) {
18890 this.sequenceFeatures = null;
18891 } else {
18892 var temp =  new Array (sfLength - 1);
18893 System.arraycopy (this.sequenceFeatures, 0, temp, 0, index);
18894 if (index < sfLength) {
18895 System.arraycopy (this.sequenceFeatures, index + 1, temp, index, this.sequenceFeatures.length - index - 1);
18896 }this.sequenceFeatures = temp;
18897 }}, "jalview.datamodel.SequenceFeature");
18898 Clazz_defineMethod (c$, "getSequenceFeatures", 
18899 function () {
18900 var features = this.sequenceFeatures;
18901 var seq = this;
18902 var count = 0;
18903 while (features == null && seq.getDatasetSequence () != null && count++ < 10) {
18904 seq = seq.getDatasetSequence ();
18905 features = (seq).sequenceFeatures;
18906 }
18907 return features;
18908 });
18909 Clazz_overrideMethod (c$, "addPDBId", 
18910 function (entry) {
18911 if (this.pdbIds == null) {
18912 this.pdbIds =  new java.util.Vector ();
18913 }if (this.pdbIds.contains (entry)) {
18914 jalview.datamodel.Sequence.updatePDBEntry (this.pdbIds.get (this.pdbIds.indexOf (entry)), entry);
18915 } else {
18916 this.pdbIds.addElement (entry);
18917 }}, "jalview.datamodel.PDBEntry");
18918 c$.updatePDBEntry = Clazz_defineMethod (c$, "updatePDBEntry", 
18919  function (oldEntry, newEntry) {
18920 if (newEntry.getFile () != null) {
18921 oldEntry.setFile (newEntry.getFile ());
18922 }}, "jalview.datamodel.PDBEntry,jalview.datamodel.PDBEntry");
18923 Clazz_defineMethod (c$, "setPDBId", 
18924 function (id) {
18925 this.pdbIds = id;
18926 }, "java.util.Vector");
18927 Clazz_defineMethod (c$, "getPDBId", 
18928 function () {
18929 return this.pdbIds;
18930 });
18931 Clazz_overrideMethod (c$, "getDisplayId", 
18932 function (jvsuffix) {
18933 var result =  new StringBuffer (this.name);
18934 if (jvsuffix) {
18935 result.append ("/" + this.start + "-" + this.end);
18936 }return result.toString ();
18937 }, "~B");
18938 Clazz_overrideMethod (c$, "setName", 
18939 function (name) {
18940 this.name = name;
18941 this.parseId ();
18942 }, "~S");
18943 Clazz_defineMethod (c$, "getName", 
18944 function () {
18945 return this.name;
18946 });
18947 Clazz_overrideMethod (c$, "setStart", 
18948 function (start) {
18949 this.start = start;
18950 }, "~N");
18951 Clazz_defineMethod (c$, "getStart", 
18952 function () {
18953 return this.start;
18954 });
18955 Clazz_overrideMethod (c$, "setEnd", 
18956 function (end) {
18957 this.end = end;
18958 }, "~N");
18959 Clazz_defineMethod (c$, "getEnd", 
18960 function () {
18961 return this.end;
18962 });
18963 Clazz_overrideMethod (c$, "getLength", 
18964 function () {
18965 return this.sequence.length;
18966 });
18967 Clazz_defineMethod (c$, "setSequence", 
18968 function (seq) {
18969 this.sequence = seq.toCharArray ();
18970 this.checkValidRange ();
18971 }, "~S");
18972 Clazz_defineMethod (c$, "getSequenceAsString", 
18973 function () {
18974 return  String.instantialize (this.sequence);
18975 });
18976 Clazz_defineMethod (c$, "getSequenceAsString", 
18977 function (start, end) {
18978 return  String.instantialize (this.getSequence (start, end));
18979 }, "~N,~N");
18980 Clazz_defineMethod (c$, "getSequence", 
18981 function () {
18982 return this.sequence;
18983 });
18984 Clazz_defineMethod (c$, "getSequence", 
18985 function (start, end) {
18986 if (start < 0) {
18987 start = 0;
18988 }if (start >= this.sequence.length) {
18989 return  Clazz_newCharArray (0, '\0');
18990 }if (end >= this.sequence.length) {
18991 end = this.sequence.length;
18992 }var reply =  Clazz_newCharArray (end - start, '\0');
18993 System.arraycopy (this.sequence, start, reply, 0, end - start);
18994 return reply;
18995 }, "~N,~N");
18996 Clazz_overrideMethod (c$, "getSubSequence", 
18997 function (start, end) {
18998 if (start < 0) {
18999 start = 0;
19000 }var seq = this.getSequence (start, end);
19001 if (seq.length == 0) {
19002 return null;
19003 }var nstart = this.findPosition (start);
19004 var nend = this.findPosition (end) - 1;
19005 var nseq =  new jalview.datamodel.Sequence (this.getName (), seq, nstart, nend);
19006 nseq.setDescription (this.description);
19007 if (this.datasetSequence != null) {
19008 nseq.setDatasetSequence (this.datasetSequence);
19009 } else {
19010 nseq.setDatasetSequence (this);
19011 }return nseq;
19012 }, "~N,~N");
19013 Clazz_overrideMethod (c$, "getCharAt", 
19014 function (i) {
19015 if (i < this.sequence.length) {
19016 return this.sequence[i];
19017 } else {
19018 return ' ';
19019 }}, "~N");
19020 Clazz_defineMethod (c$, "setDescription", 
19021 function (desc) {
19022 this.description = desc;
19023 }, "~S");
19024 Clazz_defineMethod (c$, "getDescription", 
19025 function () {
19026 return this.description;
19027 });
19028 Clazz_overrideMethod (c$, "findIndex", 
19029 function (pos) {
19030 var j = this.start;
19031 var i = 0;
19032 while ((i < this.sequence.length) && (j <= this.end) && (j <= pos)) {
19033 if (!jalview.util.Comparison.isGap (this.sequence[i])) {
19034 j++;
19035 }i++;
19036 }
19037 if ((j == this.end) && (j < pos)) {
19038 return this.end + 1;
19039 } else {
19040 return i;
19041 }}, "~N");
19042 Clazz_overrideMethod (c$, "findPosition", 
19043 function (i) {
19044 var j = 0;
19045 var pos = this.start;
19046 var seqlen = this.sequence.length;
19047 while ((j < i) && (j < seqlen)) {
19048 if (!jalview.util.Comparison.isGap (this.sequence[j])) {
19049 pos++;
19050 }j++;
19051 }
19052 return pos;
19053 }, "~N");
19054 Clazz_overrideMethod (c$, "gapMap", 
19055 function () {
19056 var seq = jalview.analysis.AlignSeq.extractGaps (jalview.util.Comparison.GapChars,  String.instantialize (this.sequence));
19057 var map =  Clazz_newIntArray (seq.length, 0);
19058 var j = 0;
19059 var p = 0;
19060 while (j < this.sequence.length) {
19061 if (!jalview.util.Comparison.isGap (this.sequence[j])) {
19062 map[p++] = j;
19063 }j++;
19064 }
19065 return map;
19066 });
19067 Clazz_overrideMethod (c$, "findPositionMap", 
19068 function () {
19069 var map =  Clazz_newIntArray (this.sequence.length, 0);
19070 var j = 0;
19071 var pos = this.start;
19072 var seqlen = this.sequence.length;
19073 while ((j < seqlen)) {
19074 map[j] = pos;
19075 if (!jalview.util.Comparison.isGap (this.sequence[j])) {
19076 pos++;
19077 }j++;
19078 }
19079 return map;
19080 });
19081 Clazz_overrideMethod (c$, "getInsertions", 
19082 function () {
19083 var map =  new java.util.ArrayList ();
19084 var lastj = -1;
19085 var j = 0;
19086 var pos = this.start;
19087 var seqlen = this.sequence.length;
19088 while ((j < seqlen)) {
19089 if (jalview.util.Comparison.isGap (this.sequence[j])) {
19090 if (lastj == -1) {
19091 lastj = j;
19092 }} else {
19093 if (lastj != -1) {
19094 map.add ( Clazz_newIntArray (-1, [lastj, j - 1]));
19095 lastj = -1;
19096 }}j++;
19097 }
19098 if (lastj != -1) {
19099 map.add ( Clazz_newIntArray (-1, [lastj, j - 1]));
19100 lastj = -1;
19101 }return map;
19102 });
19103 Clazz_overrideMethod (c$, "deleteChars", 
19104 function (i, j) {
19105 var newstart = this.start;
19106 var newend = this.end;
19107 if (i >= this.sequence.length || i < 0) {
19108 return;
19109 }var tmp = jalview.util.StringUtils.deleteChars (this.sequence, i, j);
19110 var createNewDs = false;
19111 var eindex = -1;
19112 var sindex = -1;
19113 var ecalc = false;
19114 var scalc = false;
19115 for (var s = i; s < j; s++) {
19116 if (jalview.schemes.ResidueProperties.aaIndex[this.sequence[s].charCodeAt (0)] != 23) {
19117 if (createNewDs) {
19118 newend--;
19119 } else {
19120 if (!scalc) {
19121 sindex = this.findIndex (this.start) - 1;
19122 scalc = true;
19123 }if (sindex == s) {
19124 newstart = this.findPosition (j);
19125 break;
19126 } else {
19127 if (!ecalc) {
19128 eindex = this.findIndex (this.end) - 1;
19129 ecalc = true;
19130 }if (eindex < j) {
19131 newend = this.findPosition (i - 1);
19132 break;
19133 } else {
19134 createNewDs = true;
19135 newend--;
19136 }}}}}
19137 if (createNewDs && this.datasetSequence != null) {
19138 var ds =  new jalview.datamodel.Sequence (this.datasetSequence);
19139 ds.deleteChars (i, j);
19140 this.datasetSequence = ds;
19141 }this.start = newstart;
19142 this.end = newend;
19143 this.sequence = tmp;
19144 }, "~N,~N");
19145 Clazz_defineMethod (c$, "insertCharAt", 
19146 function (i, length, c) {
19147 var tmp =  Clazz_newCharArray (this.sequence.length + length, '\0');
19148 if (i >= this.sequence.length) {
19149 System.arraycopy (this.sequence, 0, tmp, 0, this.sequence.length);
19150 i = this.sequence.length;
19151 } else {
19152 System.arraycopy (this.sequence, 0, tmp, 0, i);
19153 }var index = i;
19154 while (length > 0) {
19155 tmp[index++] = c;
19156 length--;
19157 }
19158 if (i < this.sequence.length) {
19159 System.arraycopy (this.sequence, i, tmp, index, this.sequence.length - i);
19160 }this.sequence = tmp;
19161 }, "~N,~N,~S");
19162 Clazz_defineMethod (c$, "insertCharAt", 
19163 function (i, c) {
19164 this.insertCharAt (i, 1, c);
19165 }, "~N,~S");
19166 Clazz_overrideMethod (c$, "getVamsasId", 
19167 function () {
19168 return this.vamsasId;
19169 });
19170 Clazz_overrideMethod (c$, "setVamsasId", 
19171 function (id) {
19172 this.vamsasId = id;
19173 }, "~S");
19174 Clazz_defineMethod (c$, "setDBRef", 
19175 function (dbref) {
19176 this.dbrefs = dbref;
19177 }, "~A");
19178 Clazz_defineMethod (c$, "getDBRef", 
19179 function () {
19180 if (this.dbrefs == null && this.datasetSequence != null && this !== this.datasetSequence) {
19181 return this.datasetSequence.getDBRef ();
19182 }return this.dbrefs;
19183 });
19184 Clazz_overrideMethod (c$, "addDBRef", 
19185 function (entry) {
19186 if (this.dbrefs == null) {
19187 this.dbrefs =  new Array (0);
19188 }var i;
19189 var iSize = this.dbrefs.length;
19190 for (i = 0; i < iSize; i++) {
19191 if (this.dbrefs[i].equalRef (entry)) {
19192 if (entry.getMap () != null) {
19193 if (this.dbrefs[i].getMap () == null) {
19194 this.dbrefs[i] = entry;
19195 }}return;
19196 }}
19197 var temp =  new Array (iSize + 1);
19198 System.arraycopy (this.dbrefs, 0, temp, 0, iSize);
19199 temp[temp.length - 1] = entry;
19200 this.dbrefs = temp;
19201 }, "jalview.datamodel.DBRefEntry");
19202 Clazz_defineMethod (c$, "setDatasetSequence", 
19203 function (seq) {
19204 this.datasetSequence = seq;
19205 }, "jalview.datamodel.SequenceI");
19206 Clazz_defineMethod (c$, "getDatasetSequence", 
19207 function () {
19208 return this.datasetSequence;
19209 });
19210 Clazz_defineMethod (c$, "getAnnotation", 
19211 function () {
19212 return this.annotation == null ? null : this.annotation.toArray ( new Array (this.annotation.size ()));
19213 });
19214 Clazz_overrideMethod (c$, "hasAnnotation", 
19215 function (ann) {
19216 return this.annotation == null ? false : this.annotation.contains (ann);
19217 }, "jalview.datamodel.AlignmentAnnotation");
19218 Clazz_defineMethod (c$, "addAlignmentAnnotation", 
19219 function (annotation) {
19220 if (this.annotation == null) {
19221 this.annotation =  new java.util.Vector ();
19222 }if (!this.annotation.contains (annotation)) {
19223 this.annotation.addElement (annotation);
19224 }annotation.setSequenceRef (this);
19225 }, "jalview.datamodel.AlignmentAnnotation");
19226 Clazz_overrideMethod (c$, "removeAlignmentAnnotation", 
19227 function (annotation) {
19228 if (this.annotation != null) {
19229 this.annotation.removeElement (annotation);
19230 if (this.annotation.size () == 0) {
19231 this.annotation = null;
19232 }}}, "jalview.datamodel.AlignmentAnnotation");
19233 Clazz_defineMethod (c$, "isValidDatasetSequence", 
19234  function () {
19235 if (this.datasetSequence != null) {
19236 return false;
19237 }for (var i = 0; i < this.sequence.length; i++) {
19238 if (jalview.util.Comparison.isGap (this.sequence[i])) {
19239 return false;
19240 }}
19241 return true;
19242 });
19243 Clazz_overrideMethod (c$, "deriveSequence", 
19244 function () {
19245 var seq =  new jalview.datamodel.Sequence (this);
19246 if (this.datasetSequence != null) {
19247 seq.setDatasetSequence (this.datasetSequence);
19248 } else {
19249 if (this.isValidDatasetSequence ()) {
19250 seq.setDatasetSequence (this);
19251 } else {
19252 var ds = seq;
19253 ds.setSequence (jalview.analysis.AlignSeq.extractGaps (jalview.util.Comparison.GapChars,  String.instantialize (this.sequence)));
19254 this.setDatasetSequence (ds);
19255 ds.setSequenceFeatures (this.getSequenceFeatures ());
19256 seq = this;
19257 }}return seq;
19258 });
19259 Clazz_overrideMethod (c$, "createDatasetSequence", 
19260 function () {
19261 if (this.datasetSequence == null) {
19262 this.datasetSequence =  new jalview.datamodel.Sequence (this.getName (), jalview.analysis.AlignSeq.extractGaps (jalview.util.Comparison.GapChars, this.getSequenceAsString ()), this.getStart (), this.getEnd ());
19263 this.datasetSequence.setSequenceFeatures (this.getSequenceFeatures ());
19264 this.datasetSequence.setDescription (this.getDescription ());
19265 this.setSequenceFeatures (null);
19266 this.datasetSequence.setDBRef (this.getDBRef ());
19267 this.setDBRef (null);
19268 this.datasetSequence.setPDBId (this.getPDBId ());
19269 this.setPDBId (null);
19270 this.datasetSequence.updatePDBIds ();
19271 if (this.annotation != null) {
19272 for (var aa, $aa = this.annotation.iterator (); $aa.hasNext () && ((aa = $aa.next ()) || true);) {
19273 var _aa =  new jalview.datamodel.AlignmentAnnotation (aa);
19274 _aa.sequenceRef = this.datasetSequence;
19275 _aa.adjustForAlignment ();
19276 this.datasetSequence.addAlignmentAnnotation (_aa);
19277 }
19278 }}return this.datasetSequence;
19279 });
19280 Clazz_overrideMethod (c$, "setAlignmentAnnotation", 
19281 function (annotations) {
19282 if (this.annotation != null) {
19283 this.annotation.removeAllElements ();
19284 }if (annotations != null) {
19285 for (var i = 0; i < annotations.length; i++) {
19286 if (annotations[i] != null) {
19287 this.addAlignmentAnnotation (annotations[i]);
19288 }}
19289 }}, "~A");
19290 Clazz_defineMethod (c$, "getAnnotation", 
19291 function (label) {
19292 if (this.annotation == null || this.annotation.size () == 0) {
19293 return null;
19294 }var subset =  new java.util.Vector ();
19295 var e = this.annotation.elements ();
19296 while (e.hasMoreElements ()) {
19297 var ann = e.nextElement ();
19298 if (ann.label != null && ann.label.equals (label)) {
19299 subset.addElement (ann);
19300 }}
19301 if (subset.size () == 0) {
19302 return null;
19303 }var anns =  new Array (subset.size ());
19304 var i = 0;
19305 e = subset.elements ();
19306 while (e.hasMoreElements ()) {
19307 anns[i++] = e.nextElement ();
19308 }
19309 subset.removeAllElements ();
19310 return anns;
19311 }, "~S");
19312 Clazz_defineMethod (c$, "updatePDBIds", 
19313 function () {
19314 if (this.datasetSequence != null) {
19315 return this.datasetSequence.updatePDBIds ();
19316 }if (this.dbrefs == null || this.dbrefs.length == 0) {
19317 return false;
19318 }var newpdb =  new java.util.Vector ();
19319 for (var i = 0; i < this.dbrefs.length; i++) {
19320 if (jalview.datamodel.DBRefSource.PDB.equals (this.dbrefs[i].getSource ())) {
19321 var pdbe =  new jalview.datamodel.PDBEntry ();
19322 pdbe.setId (this.dbrefs[i].getAccessionId ());
19323 if (this.pdbIds == null || this.pdbIds.size () == 0) {
19324 newpdb.addElement (pdbe);
19325 } else {
19326 var en = this.pdbIds.elements ();
19327 var matched = false;
19328 while (!matched && en.hasMoreElements ()) {
19329 var anentry = en.nextElement ();
19330 if (anentry.getId ().equals (pdbe.getId ())) {
19331 matched = true;
19332 }}
19333 if (!matched) {
19334 newpdb.addElement (pdbe);
19335 }}}}
19336 if (newpdb.size () > 0) {
19337 var en = newpdb.elements ();
19338 while (en.hasMoreElements ()) {
19339 this.addPDBId (en.nextElement ());
19340 }
19341 return true;
19342 }return false;
19343 });
19344 Clazz_defineMethod (c$, "transferAnnotation", 
19345 function (entry, mp) {
19346 if (this.datasetSequence != null) {
19347 this.datasetSequence.transferAnnotation (entry, mp);
19348 return;
19349 }if (entry.getDatasetSequence () != null) {
19350 this.transferAnnotation (entry.getDatasetSequence (), mp);
19351 return;
19352 }if (entry.getSequenceFeatures () != null) {
19353 var sfs = entry.getSequenceFeatures ();
19354 for (var si = 0; si < sfs.length; si++) {
19355 var sf = (mp != null) ? mp.locateFeature (sfs[si]) :  Clazz_newArray (-1, [ new jalview.datamodel.SequenceFeature (sfs[si])]);
19356 if (sf != null && sf.length > 0) {
19357 for (var sfi = 0; sfi < sf.length; sfi++) {
19358 this.addSequenceFeature (sf[sfi]);
19359 }
19360 }}
19361 }if (entry.getPDBId () != null) {
19362 var e = entry.getPDBId ().elements ();
19363 while (e.hasMoreElements ()) {
19364 var pdb = e.nextElement ();
19365 this.addPDBId (pdb);
19366 }
19367 }var entryRefs = entry.getDBRef ();
19368 if (entryRefs != null) {
19369 for (var r = 0; r < entryRefs.length; r++) {
19370 var newref =  new jalview.datamodel.DBRefEntry (entryRefs[r]);
19371 if (newref.getMap () != null && mp != null) {
19372 }this.addDBRef (newref);
19373 }
19374 }}, "jalview.datamodel.SequenceI,jalview.datamodel.Mapping");
19375 Clazz_overrideMethod (c$, "getIndex", 
19376 function () {
19377 return this.index;
19378 });
19379 Clazz_overrideMethod (c$, "setIndex", 
19380 function (value) {
19381 this.index = value;
19382 }, "~N");
19383 Clazz_overrideMethod (c$, "setRNA", 
19384 function (r) {
19385 this.rna = r;
19386 }, "jalview.jsdev.api.VarnaRNA");
19387 Clazz_overrideMethod (c$, "getRNA", 
19388 function () {
19389 return this.rna;
19390 });
19391 Clazz_overrideMethod (c$, "getAlignmentAnnotations", 
19392 function (calcId, label) {
19393 var result =  new java.util.ArrayList ();
19394 if (this.annotation != null) {
19395 for (var ann, $ann = this.annotation.iterator (); $ann.hasNext () && ((ann = $ann.next ()) || true);) {
19396 if (ann.calcId != null && ann.calcId.equals (calcId) && ann.label != null && ann.label.equals (label)) {
19397 result.add (ann);
19398 }}
19399 }return result;
19400 }, "~S,~S");
19401 });
19402 Clazz_declarePackage ("jalview.datamodel");
19403 Clazz_load (["jalview.datamodel.ASequenceI"], "jalview.datamodel.ASequence", null, function () {
19404 c$ = Clazz_declareType (jalview.datamodel, "ASequence", null, jalview.datamodel.ASequenceI);
19405 });
19406 Clazz_declarePackage ("jalview.jsdev");
19407 Clazz_load (null, "jalview.jsdev.RegExp", ["com.stevesoft.pat.Regex"], function () {
19408 c$ = Clazz_decorateAsClass (function () {
19409 this.rg = null;
19410 Clazz_instantialize (this, arguments);
19411 }, jalview.jsdev, "RegExp");
19412 c$.newRegex = Clazz_defineMethod (c$, "newRegex", 
19413 function (params) {
19414 return  new com.stevesoft.pat.Regex (params.length < 1 ? null : params[0], params.length < 2 ? "" : params[1]);
19415 }, "~A");
19416 c$.perlCode = Clazz_defineMethod (c$, "perlCode", 
19417 function (s) {
19418 return com.stevesoft.pat.Regex.perlCode (s);
19419 }, "~S");
19420 });
19421 Clazz_declarePackage ("com.stevesoft.pat");
19422 Clazz_load (["com.stevesoft.pat.RegRes", "$.UniValidator", "jalview.jsdev.api.RegExpInterface", "com.stevesoft.pat.NoPattern", "$.Pthings", "$.patInt", "java.util.Hashtable"], ["com.stevesoft.pat.UnicodeW", "$.UnicodeCurrency", "$.UnicodeAlpha", "$.UnicodeUpper", "$.NUnicodeCurrency", "$.NUnicodeW", "$.NUnicodeAlpha", "$.UnicodeMath", "$.UnicodeWhite", "$.UnicodeDigit", "$.NUnicodeMath", "$.Regex", "$.NUnicodeDigit", "$.NUnicodeWhite", "$.NUnicodePunct", "$.UnicodePunct", "$.UnicodeLower"], ["com.stevesoft.pat.Any", "$.BackG", "$.BackMatch", "$.Backup", "$.Boundary", "$.Bracket", "$.CaseMgr", "$.Ctrl", "$.Custom", "$.CustomEndpoint", "$.DotMulti", "$.End", "$.FastMulti", "$.Group", "$.MessageManager", "$.Multi", "$.NullPattern", "$.Or", "$.OrMark", "$.Prop", "$.Range", "$.RegOpt", "$.RegSyntax", "$.RegSyntaxError", "$.ReplaceRule", "$.Replacer", "$.Rthings", "$.Skip", "$.Skipped", "$.Start", "$.StrPos", "$.lookAhead", "$.oneChar", "$.parsePerl", "$.patInf", "com.stevesoft.pat.wrap.StringWrap", "java.lang.NullPointerException", "$.StringBuffer", "java.util.BitSet"], function () {
19423 c$ = Clazz_declareType (com.stevesoft.pat, "UnicodePunct", com.stevesoft.pat.UniValidator);
19424 Clazz_overrideMethod (c$, "validate", 
19425 function (s, from, to) {
19426 return from < s.length () && com.stevesoft.pat.Prop.isPunct (s.charAt (from)) ? to : -1;
19427 }, "com.stevesoft.pat.StringLike,~N,~N");
19428 c$ = Clazz_declareType (com.stevesoft.pat, "UnicodeWhite", com.stevesoft.pat.UniValidator);
19429 Clazz_overrideMethod (c$, "validate", 
19430 function (s, from, to) {
19431 return from < s.length () && com.stevesoft.pat.Prop.isWhite (s.charAt (from)) ? to : -1;
19432 }, "com.stevesoft.pat.StringLike,~N,~N");
19433 c$ = Clazz_declareType (com.stevesoft.pat, "NUnicodePunct", com.stevesoft.pat.UniValidator);
19434 Clazz_overrideMethod (c$, "validate", 
19435 function (s, from, to) {
19436 return from < s.length () && !com.stevesoft.pat.Prop.isPunct (s.charAt (from)) ? to : -1;
19437 }, "com.stevesoft.pat.StringLike,~N,~N");
19438 c$ = Clazz_declareType (com.stevesoft.pat, "NUnicodeWhite", com.stevesoft.pat.UniValidator);
19439 Clazz_overrideMethod (c$, "validate", 
19440 function (s, from, to) {
19441 return from < s.length () && !com.stevesoft.pat.Prop.isWhite (s.charAt (from)) ? to : -1;
19442 }, "com.stevesoft.pat.StringLike,~N,~N");
19443 c$ = Clazz_declareType (com.stevesoft.pat, "UnicodeW", com.stevesoft.pat.UniValidator);
19444 Clazz_overrideMethod (c$, "validate", 
19445 function (s, from, to) {
19446 if (from >= s.length ()) {
19447 return -1;
19448 }var c = s.charAt (from);
19449 return (com.stevesoft.pat.Prop.isAlphabetic (c) || com.stevesoft.pat.Prop.isDecimalDigit (c) || c == '_') ? to : -1;
19450 }, "com.stevesoft.pat.StringLike,~N,~N");
19451 c$ = Clazz_declareType (com.stevesoft.pat, "NUnicodeW", com.stevesoft.pat.UniValidator);
19452 Clazz_overrideMethod (c$, "validate", 
19453 function (s, from, to) {
19454 if (from >= s.length ()) {
19455 return -1;
19456 }var c = s.charAt (from);
19457 return !(com.stevesoft.pat.Prop.isAlphabetic (c) || com.stevesoft.pat.Prop.isDecimalDigit (c) || c == '_') ? to : -1;
19458 }, "com.stevesoft.pat.StringLike,~N,~N");
19459 c$ = Clazz_declareType (com.stevesoft.pat, "UnicodeDigit", com.stevesoft.pat.UniValidator);
19460 Clazz_overrideMethod (c$, "validate", 
19461 function (s, from, to) {
19462 return from < s.length () && com.stevesoft.pat.Prop.isDecimalDigit (s.charAt (from)) ? to : -1;
19463 }, "com.stevesoft.pat.StringLike,~N,~N");
19464 c$ = Clazz_declareType (com.stevesoft.pat, "NUnicodeDigit", com.stevesoft.pat.UniValidator);
19465 Clazz_overrideMethod (c$, "validate", 
19466 function (s, from, to) {
19467 return from < s.length () && !com.stevesoft.pat.Prop.isDecimalDigit (s.charAt (from)) ? to : -1;
19468 }, "com.stevesoft.pat.StringLike,~N,~N");
19469 c$ = Clazz_declareType (com.stevesoft.pat, "UnicodeMath", com.stevesoft.pat.UniValidator);
19470 Clazz_overrideMethod (c$, "validate", 
19471 function (s, from, to) {
19472 return from < s.length () && com.stevesoft.pat.Prop.isMath (s.charAt (from)) ? to : -1;
19473 }, "com.stevesoft.pat.StringLike,~N,~N");
19474 c$ = Clazz_declareType (com.stevesoft.pat, "NUnicodeMath", com.stevesoft.pat.UniValidator);
19475 Clazz_overrideMethod (c$, "validate", 
19476 function (s, from, to) {
19477 return from < s.length () && !com.stevesoft.pat.Prop.isMath (s.charAt (from)) ? to : -1;
19478 }, "com.stevesoft.pat.StringLike,~N,~N");
19479 c$ = Clazz_declareType (com.stevesoft.pat, "UnicodeCurrency", com.stevesoft.pat.UniValidator);
19480 Clazz_overrideMethod (c$, "validate", 
19481 function (s, from, to) {
19482 return from < s.length () && com.stevesoft.pat.Prop.isCurrency (s.charAt (from)) ? to : -1;
19483 }, "com.stevesoft.pat.StringLike,~N,~N");
19484 c$ = Clazz_declareType (com.stevesoft.pat, "NUnicodeCurrency", com.stevesoft.pat.UniValidator);
19485 Clazz_overrideMethod (c$, "validate", 
19486 function (s, from, to) {
19487 return from < s.length () && !com.stevesoft.pat.Prop.isCurrency (s.charAt (from)) ? to : -1;
19488 }, "com.stevesoft.pat.StringLike,~N,~N");
19489 c$ = Clazz_declareType (com.stevesoft.pat, "UnicodeAlpha", com.stevesoft.pat.UniValidator);
19490 Clazz_overrideMethod (c$, "validate", 
19491 function (s, from, to) {
19492 return from < s.length () && com.stevesoft.pat.Prop.isAlphabetic (s.charAt (from)) ? to : -1;
19493 }, "com.stevesoft.pat.StringLike,~N,~N");
19494 c$ = Clazz_declareType (com.stevesoft.pat, "NUnicodeAlpha", com.stevesoft.pat.UniValidator);
19495 Clazz_overrideMethod (c$, "validate", 
19496 function (s, from, to) {
19497 return from < s.length () && !com.stevesoft.pat.Prop.isAlphabetic (s.charAt (from)) ? to : -1;
19498 }, "com.stevesoft.pat.StringLike,~N,~N");
19499 c$ = Clazz_declareType (com.stevesoft.pat, "UnicodeUpper", com.stevesoft.pat.UniValidator);
19500 Clazz_overrideMethod (c$, "validate", 
19501 function (s, from, to) {
19502 return from < s.length () && this.isUpper (s.charAt (from)) ? to : -1;
19503 }, "com.stevesoft.pat.StringLike,~N,~N");
19504 Clazz_defineMethod (c$, "isUpper", 
19505 function (c) {
19506 return c == com.stevesoft.pat.CaseMgr.toUpperCaseC (c) && c != com.stevesoft.pat.CaseMgr.toLowerCaseC (c);
19507 }, "~S");
19508 c$ = Clazz_declareType (com.stevesoft.pat, "UnicodeLower", com.stevesoft.pat.UniValidator);
19509 Clazz_overrideMethod (c$, "validate", 
19510 function (s, from, to) {
19511 return from < s.length () && this.isLower (s.charAt (from)) ? to : -1;
19512 }, "com.stevesoft.pat.StringLike,~N,~N");
19513 Clazz_defineMethod (c$, "isLower", 
19514 function (c) {
19515 return c != com.stevesoft.pat.CaseMgr.toUpperCaseC (c) && c == com.stevesoft.pat.CaseMgr.toLowerCaseC (c);
19516 }, "~S");
19517 c$ = Clazz_decorateAsClass (function () {
19518 this.thePattern = null;
19519 this.minMatch = null;
19520 this.rep = null;
19521 this.dontMatchInQuotes = false;
19522 this.ignoreCase = false;
19523 this.repr = null;
19524 this.esc = '\\';
19525 this.pt = null;
19526 this.gFlags = null;
19527 this.gFlagto = 0;
19528 this.gFlag = false;
19529 this.sFlag = false;
19530 this.mFlag = false;
19531 this.p = null;
19532 this.or = null;
19533 this.skipper = null;
19534 Clazz_instantialize (this, arguments);
19535 }, com.stevesoft.pat, "Regex", com.stevesoft.pat.RegRes, [jalview.jsdev.api.RegExpInterface, Cloneable]);
19536 Clazz_prepareFields (c$, function () {
19537 this.thePattern = com.stevesoft.pat.Regex.none;
19538 this.minMatch =  new com.stevesoft.pat.patInt (0);
19539 this.pt =  new com.stevesoft.pat.Pthings ();
19540 });
19541 Clazz_makeConstructor (c$, 
19542 function (s, strRp) {
19543 Clazz_superConstructor (this, com.stevesoft.pat.Regex, []);
19544 try {
19545 if (s != null) this.compile (s);
19546 if (strRp.length > 0) this.rep = com.stevesoft.pat.ReplaceRule.perlCode (strRp);
19547 } catch (rs) {
19548 if (Clazz_exceptionOf (rs, com.stevesoft.pat.RegSyntax)) {
19549 } else {
19550 throw rs;
19551 }
19552 }
19553 }, "~S,~S");
19554 Clazz_overrideMethod (c$, "clone", 
19555 function () {
19556 return  new com.stevesoft.pat.Regex (null, "").cloneFrom (this);
19557 });
19558 Clazz_defineMethod (c$, "cloneFrom", 
19559 function (r) {
19560 this.copyOutOf (r);
19561 this.dontMatchInQuotes = r.dontMatchInQuotes;
19562 this.esc = r.esc;
19563 this.ignoreCase = r.ignoreCase;
19564 this.gFlag = r.gFlag;
19565 if (r.rep == null) {
19566 this.rep = null;
19567 } else {
19568 this.rep = r.rep.clone ();
19569 }this.thePattern = r.thePattern.clone ( new java.util.Hashtable ());
19570 this.minMatch = r.minMatch;
19571 this.skipper = r.skipper;
19572 return this;
19573 }, "com.stevesoft.pat.Regex");
19574 Clazz_defineMethod (c$, "setDontMatchInQuotes", 
19575 function (b) {
19576 this.dontMatchInQuotes = b;
19577 }, "~B");
19578 Clazz_defineMethod (c$, "getDontMatchInQuotes", 
19579 function () {
19580 return this.dontMatchInQuotes;
19581 });
19582 Clazz_overrideMethod (c$, "setIgnoreCase", 
19583 function (b) {
19584 this.ignoreCase = b;
19585 }, "~B");
19586 Clazz_defineMethod (c$, "getIgnoreCase", 
19587 function () {
19588 return this.ignoreCase;
19589 });
19590 c$.setDefaultMFlag = Clazz_defineMethod (c$, "setDefaultMFlag", 
19591 function (mFlag) {
19592 com.stevesoft.pat.Regex.defaultMFlag = mFlag;
19593 }, "~B");
19594 c$.getDefaultMFlag = Clazz_defineMethod (c$, "getDefaultMFlag", 
19595 function () {
19596 return com.stevesoft.pat.Regex.defaultMFlag;
19597 });
19598 Clazz_defineMethod (c$, "setReplaceRuleStr", 
19599 function (rp) {
19600 this.rep = com.stevesoft.pat.ReplaceRule.perlCode (rp);
19601 this.repr = null;
19602 }, "~S");
19603 Clazz_defineMethod (c$, "setReplaceRule", 
19604 function (rp) {
19605 this.rep = rp;
19606 }, "com.stevesoft.pat.ReplaceRule");
19607 c$.isDefined = Clazz_defineMethod (c$, "isDefined", 
19608 function (nm) {
19609 return com.stevesoft.pat.Regex.validators.get (nm) != null;
19610 }, "~S");
19611 c$.undefine = Clazz_defineMethod (c$, "undefine", 
19612 function (nm) {
19613 com.stevesoft.pat.Regex.validators.remove (nm);
19614 }, "~S");
19615 c$.defineV = Clazz_defineMethod (c$, "defineV", 
19616 function (nm, pat, v) {
19617 v.pattern = pat;
19618 com.stevesoft.pat.Regex.validators.put (nm, v);
19619 }, "~S,~S,com.stevesoft.pat.Validator");
19620 c$.define = Clazz_defineMethod (c$, "define", 
19621 function (nm, pat) {
19622 com.stevesoft.pat.Regex.validators.put (nm, pat);
19623 }, "~S,~S");
19624 Clazz_defineMethod (c$, "getReplaceRule", 
19625 function () {
19626 return this.rep;
19627 });
19628 Clazz_defineMethod (c$, "_getReplacer", 
19629 function () {
19630 return this.repr == null ? this.repr =  new com.stevesoft.pat.Replacer () : this.repr;
19631 });
19632 Clazz_defineMethod (c$, "getReplacer", 
19633 function () {
19634 if (this.repr == null) {
19635 this.repr =  new com.stevesoft.pat.Replacer ();
19636 }this.repr.rh.me = this;
19637 this.repr.rh.prev = null;
19638 return this.repr;
19639 });
19640 Clazz_defineMethod (c$, "replaceFirst", 
19641 function (s) {
19642 return this._getReplacer ().replaceFirstRegion (s, this, 0, s.length).toString ();
19643 }, "~S");
19644 Clazz_defineMethod (c$, "replaceFirstFrom", 
19645 function (s, pos) {
19646 return this._getReplacer ().replaceFirstRegion (s, this, pos, s.length).toString ();
19647 }, "~S,~N");
19648 Clazz_defineMethod (c$, "replaceFirstRegion", 
19649 function (s, start, end) {
19650 return this._getReplacer ().replaceFirstRegion (s, this, start, end).toString ();
19651 }, "~S,~N,~N");
19652 Clazz_overrideMethod (c$, "replaceAll", 
19653 function (s) {
19654 return this._getReplacer ().replaceAllRegion (s, this, 0, s.length).toString ();
19655 }, "~S");
19656 Clazz_defineMethod (c$, "replaceAllLike", 
19657 function (s) {
19658 return this._getReplacer ().replaceAllRegion (s, this, 0, s.length ());
19659 }, "com.stevesoft.pat.StringLike");
19660 Clazz_defineMethod (c$, "replaceAllFrom", 
19661 function (s, pos) {
19662 return this._getReplacer ().replaceAllRegion (s, this, pos, s.length).toString ();
19663 }, "~S,~N");
19664 Clazz_defineMethod (c$, "replaceAllRegion", 
19665 function (s, start, end) {
19666 return this._getReplacer ().replaceAllRegion (s, this, start, end).toString ();
19667 }, "~S,~N,~N");
19668 Clazz_defineMethod (c$, "compile", 
19669 function (prepat) {
19670 var postpat = com.stevesoft.pat.parsePerl.codify (prepat, true);
19671 var pat = postpat == null ? prepat : postpat;
19672 this.minMatch = null;
19673 this.ignoreCase = false;
19674 this.dontMatchInQuotes = false;
19675 var mk =  new com.stevesoft.pat.Rthings (this);
19676 var offset = mk.val;
19677 var newpat = pat;
19678 this.thePattern = com.stevesoft.pat.Regex.none;
19679 this.p = null;
19680 this.or = null;
19681 this.minMatch =  new com.stevesoft.pat.patInt (0);
19682 var sp =  new com.stevesoft.pat.StrPos (pat, 0);
19683 if (sp.incMatch ("(?e=")) {
19684 var newEsc = sp.c;
19685 sp.inc ();
19686 if (sp.match (')')) {
19687 newpat = com.stevesoft.pat.Regex.reEscape (pat.substring (6), newEsc, '\\');
19688 }} else if (this.esc != '\\') {
19689 newpat = com.stevesoft.pat.Regex.reEscape (pat, this.esc, '\\');
19690 }this.thePattern = this._compile (newpat, mk);
19691 this.numSubs_ = mk.val - offset;
19692 mk.set (this);
19693 }, "~S");
19694 Clazz_defineMethod (c$, "equals", 
19695 function (o) {
19696 if (Clazz_instanceOf (o, com.stevesoft.pat.Regex)) {
19697 if (this.toString ().equals (o.toString ())) {
19698 return Clazz_superCall (this, com.stevesoft.pat.Regex, "equals", [o]);
19699 } else {
19700 return false;
19701 }} else {
19702 return Clazz_superCall (this, com.stevesoft.pat.Regex, "equals", [o]);
19703 }}, "~O");
19704 Clazz_defineMethod (c$, "prep", 
19705 function (s) {
19706 this.pt.lastPos = this.matchedTo ();
19707 if (this.pt.lastPos < 0) {
19708 this.pt.lastPos = 0;
19709 }if ((s == null ? null : s.unwrap ()) !== (this.src == null ? null : s.unwrap ())) {
19710 this.pt.lastPos = 0;
19711 }this.src = s;
19712 this.pt.dotDoesntMatchCR = com.stevesoft.pat.Regex.dotDoesntMatchCR && (!this.sFlag);
19713 this.pt.mFlag = ( new Boolean (this.mFlag | com.stevesoft.pat.Regex.defaultMFlag).valueOf ());
19714 this.pt.ignoreCase = this.ignoreCase;
19715 this.pt.no_check = false;
19716 if (this.pt.marks != null) {
19717 for (var i = 0; i < this.pt.marks.length; i++) {
19718 this.pt.marks[i] = -1;
19719 }
19720 }this.pt.marks = null;
19721 this.pt.nMarks = this.numSubs_;
19722 this.pt.src = s;
19723 if (this.dontMatchInQuotes) {
19724 com.stevesoft.pat.Regex.setCbits (s, this.pt);
19725 } else {
19726 this.pt.cbits = null;
19727 }return this.pt;
19728 }, "com.stevesoft.pat.StringLike");
19729 Clazz_defineMethod (c$, "matchAt", 
19730 function (s, start_pos) {
19731 return this._search (s, start_pos, start_pos);
19732 }, "~S,~N");
19733 Clazz_defineMethod (c$, "matchAtLike", 
19734 function (s, start_pos) {
19735 return this._searchLike (s, start_pos, start_pos);
19736 }, "com.stevesoft.pat.StringLike,~N");
19737 Clazz_overrideMethod (c$, "search", 
19738 function (s) {
19739 if (s == null) {
19740 throw  new NullPointerException (com.stevesoft.pat.MessageManager.getString ("exception.null_string_given_to_regex_search"));
19741 }return this._search (s, 0, s.length);
19742 }, "~S");
19743 Clazz_defineMethod (c$, "searchLike", 
19744 function (sl) {
19745 if (sl == null) {
19746 throw  new NullPointerException (com.stevesoft.pat.MessageManager.getString ("exception.null_string_like_given_to_regex_search"));
19747 }return this._searchLike (sl, 0, sl.length ());
19748 }, "com.stevesoft.pat.StringLike");
19749 Clazz_defineMethod (c$, "reverseSearch", 
19750 function (s) {
19751 if (s == null) {
19752 throw  new NullPointerException (com.stevesoft.pat.MessageManager.getString ("exception.null_string_given_to_regex_reverse_search"));
19753 }return this._reverseSearch (s, 0, s.length);
19754 }, "~S");
19755 Clazz_defineMethod (c$, "reverseSearchLike", 
19756 function (sl) {
19757 if (sl == null) {
19758 throw  new NullPointerException (com.stevesoft.pat.MessageManager.getString ("exception.null_string_like_given_to_regex_reverse_search"));
19759 }return this._reverseSearchLike (sl, 0, sl.length ());
19760 }, "com.stevesoft.pat.StringLike");
19761 Clazz_overrideMethod (c$, "searchFrom", 
19762 function (s, start) {
19763 if (s == null) {
19764 throw  new NullPointerException (com.stevesoft.pat.MessageManager.getString ("exception.null_string_like_given_to_regex_search_from"));
19765 }return this._search (s, start, s.length);
19766 }, "~S,~N");
19767 Clazz_defineMethod (c$, "searchFromLike", 
19768 function (s, start) {
19769 if (s == null) {
19770 throw  new NullPointerException (com.stevesoft.pat.MessageManager.getString ("exception.null_string_like_given_to_regex_search_from"));
19771 }return this._searchLike (s, start, s.length ());
19772 }, "com.stevesoft.pat.StringLike,~N");
19773 Clazz_defineMethod (c$, "searchRegion", 
19774 function (s, start, end) {
19775 if (s == null) {
19776 throw  new NullPointerException (com.stevesoft.pat.MessageManager.getString ("exception.null_string_like_given_to_regex_search_region"));
19777 }return this._search (s, start, end);
19778 }, "~S,~N,~N");
19779 Clazz_defineMethod (c$, "setGFlag", 
19780 function (b) {
19781 this.gFlag = b;
19782 }, "~B");
19783 Clazz_defineMethod (c$, "getGFlag", 
19784 function () {
19785 return this.gFlag;
19786 });
19787 Clazz_defineMethod (c$, "getSFlag", 
19788 function () {
19789 return this.sFlag;
19790 });
19791 Clazz_defineMethod (c$, "getMFlag", 
19792 function () {
19793 return this.mFlag;
19794 });
19795 Clazz_defineMethod (c$, "_search", 
19796 function (s, start, end) {
19797 return this._searchLike ( new com.stevesoft.pat.wrap.StringWrap (s), start, end);
19798 }, "~S,~N,~N");
19799 Clazz_defineMethod (c$, "_searchLike", 
19800 function (s, start, end) {
19801 if (this.gFlag && this.gFlagto > 0 && this.gFlags != null && s.unwrap () === this.gFlags.unwrap ()) {
19802 start = this.gFlagto;
19803 }this.gFlags = null;
19804 var pt = this.prep (s);
19805 var up = (this.minMatch == null ? end : end - this.minMatch.i);
19806 if (up < start && end >= start) {
19807 up = start;
19808 }if (this.skipper == null) {
19809 for (var i = start; i <= up; i++) {
19810 this.charsMatched_ = this.thePattern.matchAt (s, i, pt);
19811 if (this.charsMatched_ >= 0) {
19812 this.matchFrom_ = this.thePattern.mfrom;
19813 this.marks = pt.marks;
19814 this.gFlagto = this.matchFrom_ + this.charsMatched_;
19815 this.gFlags = s;
19816 return this.didMatch_ = true;
19817 }}
19818 } else {
19819 pt.no_check = true;
19820 for (var i = start; i <= up; i++) {
19821 i = this.skipper.find (this.src, i, up);
19822 if (i < 0) {
19823 this.charsMatched_ = this.matchFrom_ = -1;
19824 return this.didMatch_ = false;
19825 }this.charsMatched_ = this.thePattern.matchAt (s, i, pt);
19826 if (this.charsMatched_ >= 0) {
19827 this.matchFrom_ = this.thePattern.mfrom;
19828 this.marks = pt.marks;
19829 this.gFlagto = this.matchFrom_ + this.charsMatched_;
19830 this.gFlags = s;
19831 return this.didMatch_ = true;
19832 }}
19833 }return this.didMatch_ = false;
19834 }, "com.stevesoft.pat.StringLike,~N,~N");
19835 Clazz_defineMethod (c$, "_reverseSearch", 
19836 function (s, start, end) {
19837 return this._reverseSearchLike ( new com.stevesoft.pat.wrap.StringWrap (s), start, end);
19838 }, "~S,~N,~N");
19839 Clazz_defineMethod (c$, "_reverseSearchLike", 
19840 function (s, start, end) {
19841 if (this.gFlag && this.gFlagto > 0 && s.unwrap () === this.gFlags.unwrap ()) {
19842 end = this.gFlagto;
19843 }this.gFlags = null;
19844 var pt = this.prep (s);
19845 for (var i = end; i >= start; i--) {
19846 this.charsMatched_ = this.thePattern.matchAt (s, i, pt);
19847 if (this.charsMatched_ >= 0) {
19848 this.matchFrom_ = this.thePattern.mfrom;
19849 this.marks = pt.marks;
19850 this.gFlagto = this.matchFrom_ - 1;
19851 this.gFlags = s;
19852 return this.didMatch_ = true;
19853 }}
19854 return this.didMatch_ = false;
19855 }, "com.stevesoft.pat.StringLike,~N,~N");
19856 c$.setCbits = Clazz_defineMethod (c$, "setCbits", 
19857 function (s, pt) {
19858 if (s === com.stevesoft.pat.Regex.lasts) {
19859 pt.cbits = com.stevesoft.pat.Regex.lastbs;
19860 return;
19861 }var bs =  new java.util.BitSet (s.length ());
19862 var qc = ' ';
19863 var setBit = false;
19864 for (var i = 0; i < s.length (); i++) {
19865 if (setBit) {
19866 bs.set (i);
19867 }var c = s.charAt (i);
19868 if (!setBit && c == '"') {
19869 qc = c;
19870 setBit = true;
19871 bs.set (i);
19872 } else if (!setBit && c == '\'') {
19873 qc = c;
19874 setBit = true;
19875 bs.set (i);
19876 } else if (setBit && c == qc) {
19877 setBit = false;
19878 } else if (setBit && c == '\\' && i + 1 < s.length ()) {
19879 i++;
19880 if (setBit) {
19881 bs.set (i);
19882 }}}
19883 pt.cbits = com.stevesoft.pat.Regex.lastbs = bs;
19884 com.stevesoft.pat.Regex.lasts = s;
19885 }, "com.stevesoft.pat.StringLike,com.stevesoft.pat.Pthings");
19886 Clazz_defineMethod (c$, "add", 
19887 function (p2) {
19888 if (this.p == null) {
19889 this.p = p2;
19890 } else {
19891 this.p.add (p2);
19892 p2 = this.p;
19893 }}, "com.stevesoft.pat.Pattern");
19894 Clazz_defineMethod (c$, "compileSP", 
19895 function (sp, mk) {
19896 if (sp.match ('[')) {
19897 sp.inc ();
19898 this.add (this.matchBracket (sp));
19899 } else if (sp.match ('|')) {
19900 if (this.or == null) {
19901 this.or =  new com.stevesoft.pat.Or ();
19902 }if (this.p == null) {
19903 this.p =  new com.stevesoft.pat.NullPattern ();
19904 }this.or.addOr (this.p);
19905 this.p = null;
19906 } else if (sp.incMatch ("(?<")) {
19907 var i = sp.getPatInt ();
19908 if (i == null) {
19909 com.stevesoft.pat.RegSyntaxError.endItAll ("No int after (?<");
19910 }this.add ( new com.stevesoft.pat.Backup (i.intValue ()));
19911 if (!sp.match (')')) {
19912 com.stevesoft.pat.RegSyntaxError.endItAll ("No ) after (?<");
19913 }} else if (sp.incMatch ("(?>")) {
19914 var i = sp.getPatInt ();
19915 if (i == null) {
19916 com.stevesoft.pat.RegSyntaxError.endItAll ("No int after (?>");
19917 }this.add ( new com.stevesoft.pat.Backup (-i.intValue ()));
19918 if (!sp.match (')')) {
19919 com.stevesoft.pat.RegSyntaxError.endItAll ("No ) after (?<");
19920 }} else if (sp.incMatch ("(?@")) {
19921 var op = sp.c;
19922 sp.inc ();
19923 var cl = sp.c;
19924 sp.inc ();
19925 if (!sp.match (')')) {
19926 com.stevesoft.pat.RegSyntaxError.endItAll ("(?@ does not have closing paren");
19927 }this.add ( new com.stevesoft.pat.Group (op, cl));
19928 } else if (sp.incMatch ("(?#")) {
19929 while (!sp.match (')')) {
19930 sp.inc ();
19931 }
19932 } else if (sp.dontMatch && sp.c == 'w') {
19933 var b =  new com.stevesoft.pat.Bracket (false);
19934 b.addOr ( new com.stevesoft.pat.Range ('a', 'z'));
19935 b.addOr ( new com.stevesoft.pat.Range ('A', 'Z'));
19936 b.addOr ( new com.stevesoft.pat.Range ('0', '9'));
19937 b.addOr ( new com.stevesoft.pat.oneChar ('_'));
19938 this.add (b);
19939 } else if (sp.dontMatch && sp.c == 'G') {
19940 this.add ( new com.stevesoft.pat.BackG ());
19941 } else if (sp.dontMatch && sp.c == 's') {
19942 var b =  new com.stevesoft.pat.Bracket (false);
19943 b.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (32)));
19944 b.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (8), String.fromCharCode (10)));
19945 b.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (13)));
19946 this.add (b);
19947 } else if (sp.dontMatch && sp.c == 'd') {
19948 var digit =  new com.stevesoft.pat.Range ('0', '9');
19949 digit.printBrackets = true;
19950 this.add (digit);
19951 } else if (sp.dontMatch && sp.c == 'W') {
19952 var b =  new com.stevesoft.pat.Bracket (true);
19953 b.addOr ( new com.stevesoft.pat.Range ('a', 'z'));
19954 b.addOr ( new com.stevesoft.pat.Range ('A', 'Z'));
19955 b.addOr ( new com.stevesoft.pat.Range ('0', '9'));
19956 b.addOr ( new com.stevesoft.pat.oneChar ('_'));
19957 this.add (b);
19958 } else if (sp.dontMatch && sp.c == 'S') {
19959 var b =  new com.stevesoft.pat.Bracket (true);
19960 b.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (32)));
19961 b.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (8), String.fromCharCode (10)));
19962 b.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (13)));
19963 this.add (b);
19964 } else if (sp.dontMatch && sp.c == 'D') {
19965 var b =  new com.stevesoft.pat.Bracket (true);
19966 b.addOr ( new com.stevesoft.pat.Range ('0', '9'));
19967 this.add (b);
19968 } else if (sp.dontMatch && sp.c == 'B') {
19969 var r =  new com.stevesoft.pat.Regex (null, "");
19970 r._compile ("(?!\\b)", mk);
19971 this.add (r.thePattern);
19972 } else if (this.isOctalString (sp)) {
19973 var d = sp.c.charCodeAt (0) - 48;
19974 sp.inc ();
19975 d = 8 * d + sp.c.charCodeAt (0) - 48;
19976 var sp2 =  new com.stevesoft.pat.StrPos (sp);
19977 sp2.inc ();
19978 if (this.isOctalDigit (sp2, false)) {
19979 sp.inc ();
19980 d = 8 * d + sp.c.charCodeAt (0) - 48;
19981 }this.add ( new com.stevesoft.pat.oneChar (String.fromCharCode (d)));
19982 } else if (sp.dontMatch && sp.c >= '1' && sp.c <= '9') {
19983 var iv = sp.c.charCodeAt (0) - 48;
19984 var s2 =  new com.stevesoft.pat.StrPos (sp);
19985 s2.inc ();
19986 if (!s2.dontMatch && s2.c >= '0' && s2.c <= '9') {
19987 iv = 10 * iv + (s2.c.charCodeAt (0) - 48);
19988 sp.inc ();
19989 }this.add ( new com.stevesoft.pat.BackMatch (iv));
19990 } else if (sp.dontMatch && sp.c == 'b') {
19991 this.add ( new com.stevesoft.pat.Boundary ());
19992 } else if (sp.match ('\b')) {
19993 this.add ( new com.stevesoft.pat.Boundary ());
19994 } else if (sp.match ('$')) {
19995 this.add ( new com.stevesoft.pat.End (true));
19996 } else if (sp.dontMatch && sp.c == 'Z') {
19997 this.add ( new com.stevesoft.pat.End (false));
19998 } else if (sp.match ('.')) {
19999 this.add ( new com.stevesoft.pat.Any ());
20000 } else if (sp.incMatch ("(??")) {
20001 var sb =  new StringBuffer ();
20002 var sb2 =  new StringBuffer ();
20003 while (!sp.match (')') && !sp.match (':')) {
20004 sb.append (sp.c);
20005 sp.inc ();
20006 }
20007 if (sp.incMatch (":")) {
20008 while (!sp.match (')')) {
20009 sb2.append (sp.c);
20010 sp.inc ();
20011 }
20012 }var sbs = sb.toString ();
20013 if (Clazz_instanceOf (com.stevesoft.pat.Regex.validators.get (sbs), String)) {
20014 var pat = com.stevesoft.pat.Regex.validators.get (sbs);
20015 var r =  new com.stevesoft.pat.Regex (null, "");
20016 var rth =  new com.stevesoft.pat.Rthings (this);
20017 rth.noBackRefs = true;
20018 r._compile (pat, rth);
20019 this.add (r.thePattern);
20020 } else {
20021 var cm =  new com.stevesoft.pat.Custom (sb.toString ());
20022 if (cm.v != null) {
20023 var v2 = cm.v.arg (sb2.toString ());
20024 if (v2 != null) {
20025 v2.argsave = sb2.toString ();
20026 var p = cm.v.pattern;
20027 cm.v = v2;
20028 v2.pattern = p;
20029 }var r =  new com.stevesoft.pat.Regex (null, "");
20030 var rth =  new com.stevesoft.pat.Rthings (this);
20031 rth.noBackRefs = true;
20032 r._compile (cm.v.pattern, rth);
20033 cm.sub = r.thePattern;
20034 cm.sub.add ( new com.stevesoft.pat.CustomEndpoint (cm));
20035 cm.sub.setParent (cm);
20036 this.add (cm);
20037 }}} else if (sp.match ('(')) {
20038 mk.parenLevel++;
20039 var r =  new com.stevesoft.pat.Regex (null, "");
20040 sp.inc ();
20041 if (sp.incMatch ("?:")) {
20042 r.or =  new com.stevesoft.pat.Or ();
20043 } else if (sp.incMatch ("?=")) {
20044 r.or =  new com.stevesoft.pat.lookAhead (false);
20045 } else if (sp.incMatch ("?!")) {
20046 r.or =  new com.stevesoft.pat.lookAhead (true);
20047 } else if (sp.match ('?')) {
20048 sp.inc ();
20049 do {
20050 if (sp.c == 'i') {
20051 mk.ignoreCase = true;
20052 }if (sp.c == 'Q') {
20053 mk.dontMatchInQuotes = true;
20054 }if (sp.c == 'o') {
20055 mk.optimizeMe = true;
20056 }if (sp.c == 'g') {
20057 mk.gFlag = true;
20058 }if (sp.c == 's') {
20059 mk.sFlag = true;
20060 }if (sp.c == 'm') {
20061 mk.mFlag = true;
20062 }sp.inc ();
20063 } while (!sp.match (')') && !sp.$eos);
20064 r = null;
20065 mk.parenLevel--;
20066 if (sp.$eos) {
20067 com.stevesoft.pat.RegSyntaxError.endItAll ("Unclosed ()");
20068 }} else {
20069 r.or = mk.noBackRefs ?  new com.stevesoft.pat.Or () :  new com.stevesoft.pat.OrMark (mk.val++);
20070 }if (r != null) {
20071 this.add (r._compileSP (sp, mk));
20072 }} else if (sp.match ('^')) {
20073 this.add ( new com.stevesoft.pat.Start (true));
20074 } else if (sp.dontMatch && sp.c == 'A') {
20075 this.add ( new com.stevesoft.pat.Start (false));
20076 } else if (sp.match ('*')) {
20077 this.addMulti ( new com.stevesoft.pat.patInt (0),  new com.stevesoft.pat.patInf ());
20078 } else if (sp.match ('+')) {
20079 this.addMulti ( new com.stevesoft.pat.patInt (1),  new com.stevesoft.pat.patInf ());
20080 } else if (sp.match ('?')) {
20081 this.addMulti ( new com.stevesoft.pat.patInt (0),  new com.stevesoft.pat.patInt (1));
20082 } else if (sp.match ('{')) {
20083 var bad = false;
20084 var sp2 =  new com.stevesoft.pat.StrPos (sp);
20085 sp.inc ();
20086 var i1 = sp.getPatInt ();
20087 var i2 = null;
20088 if (sp.match ('}')) {
20089 i2 = i1;
20090 } else {
20091 if (!sp.match (',')) {
20092 bad = true;
20093 }sp.inc ();
20094 if (sp.match ('}')) {
20095 i2 =  new com.stevesoft.pat.patInf ();
20096 } else {
20097 i2 = sp.getPatInt ();
20098 }}if (i1 == null || i2 == null) {
20099 bad = true;
20100 }if (bad) {
20101 sp.dup (sp2);
20102 this.add ( new com.stevesoft.pat.oneChar (sp.c));
20103 } else {
20104 this.addMulti (i1, i2);
20105 }} else if (sp.escMatch ('x') && this.next2Hex (sp)) {
20106 sp.inc ();
20107 var d = this.getHexDigit (sp);
20108 sp.inc ();
20109 d = 16 * d + this.getHexDigit (sp);
20110 this.add ( new com.stevesoft.pat.oneChar (String.fromCharCode (d)));
20111 } else if (sp.escMatch ('c')) {
20112 sp.inc ();
20113 if (sp.c.charCodeAt (0) < com.stevesoft.pat.Ctrl.cmap.length) {
20114 this.add ( new com.stevesoft.pat.oneChar (com.stevesoft.pat.Ctrl.cmap[sp.c.charCodeAt (0)]));
20115 } else {
20116 this.add ( new com.stevesoft.pat.oneChar (sp.c));
20117 }} else if (sp.escMatch ('f')) {
20118 this.add ( new com.stevesoft.pat.oneChar (String.fromCharCode (12)));
20119 } else if (sp.escMatch ('a')) {
20120 this.add ( new com.stevesoft.pat.oneChar (String.fromCharCode (7)));
20121 } else if (sp.escMatch ('t')) {
20122 this.add ( new com.stevesoft.pat.oneChar ('\t'));
20123 } else if (sp.escMatch ('n')) {
20124 this.add ( new com.stevesoft.pat.oneChar ('\n'));
20125 } else if (sp.escMatch ('r')) {
20126 this.add ( new com.stevesoft.pat.oneChar ('\r'));
20127 } else if (sp.escMatch ('b')) {
20128 this.add ( new com.stevesoft.pat.oneChar ('\b'));
20129 } else if (sp.escMatch ('e')) {
20130 this.add ( new com.stevesoft.pat.oneChar (String.fromCharCode (27)));
20131 } else {
20132 this.add ( new com.stevesoft.pat.oneChar (sp.c));
20133 if (sp.match (')')) {
20134 com.stevesoft.pat.RegSyntaxError.endItAll ("Unmatched right paren in pattern");
20135 }}}, "com.stevesoft.pat.StrPos,com.stevesoft.pat.Rthings");
20136 Clazz_defineMethod (c$, "_compile", 
20137  function (pat, mk) {
20138 this.minMatch = null;
20139 this.sFlag = this.mFlag = this.ignoreCase = this.gFlag = false;
20140 var sp =  new com.stevesoft.pat.StrPos (pat, 0);
20141 this.thePattern = this._compileSP (sp, mk);
20142 this.pt.marks = null;
20143 return this.thePattern;
20144 }, "~S,com.stevesoft.pat.Rthings");
20145 Clazz_defineMethod (c$, "_compileSP", 
20146 function (sp, mk) {
20147 while (!(sp.$eos || (this.or != null && sp.match (')')))) {
20148 this.compileSP (sp, mk);
20149 sp.inc ();
20150 }
20151 if (sp.match (')')) {
20152 mk.parenLevel--;
20153 } else if (sp.$eos && mk.parenLevel != 0) {
20154 com.stevesoft.pat.RegSyntaxError.endItAll ("Unclosed Parenthesis! lvl=" + mk.parenLevel);
20155 }if (this.or != null) {
20156 if (this.p == null) {
20157 this.p =  new com.stevesoft.pat.NullPattern ();
20158 }this.or.addOr (this.p);
20159 return this.or;
20160 }return this.p == null ?  new com.stevesoft.pat.NullPattern () : this.p;
20161 }, "com.stevesoft.pat.StrPos,com.stevesoft.pat.Rthings");
20162 Clazz_defineMethod (c$, "addMulti", 
20163 function (i1, i2) {
20164 var last;
20165 var last2;
20166 for (last = this.p; last != null && last.next != null; last = last.next) {
20167 ;}
20168 if (last == null || last === this.p) {
20169 last2 = null;
20170 } else {
20171 for (last2 = this.p; last2.next !== last; last2 = last2.next) {
20172 ;}
20173 }if (Clazz_instanceOf (last, com.stevesoft.pat.Multi) && i1.intValue () == 0 && i2.intValue () == 1) {
20174 (last).matchFewest = true;
20175 } else if (Clazz_instanceOf (last, com.stevesoft.pat.FastMulti) && i1.intValue () == 0 && i2.intValue () == 1) {
20176 (last).matchFewest = true;
20177 } else if (Clazz_instanceOf (last, com.stevesoft.pat.DotMulti) && i1.intValue () == 0 && i2.intValue () == 1) {
20178 (last).matchFewest = true;
20179 } else if (Clazz_instanceOf (last, com.stevesoft.pat.Multi) || Clazz_instanceOf (last, com.stevesoft.pat.DotMulti) || Clazz_instanceOf (last, com.stevesoft.pat.FastMulti)) {
20180 throw  new com.stevesoft.pat.RegSyntax ("Syntax error.");
20181 } else if (last2 == null) {
20182 this.p = com.stevesoft.pat.Regex.mkMulti (i1, i2, this.p);
20183 } else {
20184 last2.next = com.stevesoft.pat.Regex.mkMulti (i1, i2, last);
20185 }}, "com.stevesoft.pat.patInt,com.stevesoft.pat.patInt");
20186 c$.mkMulti = Clazz_defineMethod (c$, "mkMulti", 
20187 function (lo, hi, p) {
20188 if (Clazz_instanceOf (p, com.stevesoft.pat.Any) && p.next == null) {
20189 return  new com.stevesoft.pat.DotMulti (lo, hi);
20190 }return com.stevesoft.pat.RegOpt.safe4fm (p) ?  new com.stevesoft.pat.FastMulti (lo, hi, p) :  new com.stevesoft.pat.Multi (lo, hi, p);
20191 }, "com.stevesoft.pat.patInt,com.stevesoft.pat.patInt,com.stevesoft.pat.Pattern");
20192 Clazz_defineMethod (c$, "matchBracket", 
20193 function (sp) {
20194 var ret;
20195 if (sp.match ('^')) {
20196 ret =  new com.stevesoft.pat.Bracket (true);
20197 sp.inc ();
20198 } else {
20199 ret =  new com.stevesoft.pat.Bracket (false);
20200 }if (sp.match (']')) {
20201 com.stevesoft.pat.RegSyntaxError.endItAll ("Unmatched []");
20202 }while (!sp.$eos && !sp.match (']')) {
20203 var s1 =  new com.stevesoft.pat.StrPos (sp);
20204 s1.inc ();
20205 var s1_ =  new com.stevesoft.pat.StrPos (s1);
20206 s1_.inc ();
20207 if (s1.match ('-') && !s1_.match (']')) {
20208 var s2 =  new com.stevesoft.pat.StrPos (s1);
20209 s2.inc ();
20210 if (!s2.$eos) {
20211 ret.addOr ( new com.stevesoft.pat.Range (sp.c, s2.c));
20212 }sp.inc ();
20213 sp.inc ();
20214 } else if (sp.escMatch ('Q')) {
20215 sp.inc ();
20216 while (!sp.escMatch ('E')) {
20217 ret.addOr ( new com.stevesoft.pat.oneChar (sp.c));
20218 sp.inc ();
20219 }
20220 } else if (sp.escMatch ('d')) {
20221 ret.addOr ( new com.stevesoft.pat.Range ('0', '9'));
20222 } else if (sp.escMatch ('s')) {
20223 ret.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (32)));
20224 ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (8), String.fromCharCode (10)));
20225 ret.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (13)));
20226 } else if (sp.escMatch ('w')) {
20227 ret.addOr ( new com.stevesoft.pat.Range ('a', 'z'));
20228 ret.addOr ( new com.stevesoft.pat.Range ('A', 'Z'));
20229 ret.addOr ( new com.stevesoft.pat.Range ('0', '9'));
20230 ret.addOr ( new com.stevesoft.pat.oneChar ('_'));
20231 } else if (sp.escMatch ('D')) {
20232 ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (0), String.fromCharCode (47)));
20233 ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (58), String.fromCharCode (65535)));
20234 } else if (sp.escMatch ('S')) {
20235 ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (0), String.fromCharCode (7)));
20236 ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (11), String.fromCharCode (12)));
20237 ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (14), String.fromCharCode (31)));
20238 ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (33), String.fromCharCode (65535)));
20239 } else if (sp.escMatch ('W')) {
20240 ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (0), String.fromCharCode (64)));
20241 ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (91), String.fromCharCode (94)));
20242 ret.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (96)));
20243 ret.addOr ( new com.stevesoft.pat.Range (String.fromCharCode (123), String.fromCharCode (65535)));
20244 } else if (sp.escMatch ('x') && this.next2Hex (sp)) {
20245 sp.inc ();
20246 var d = this.getHexDigit (sp);
20247 sp.inc ();
20248 d = 16 * d + this.getHexDigit (sp);
20249 ret.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (d)));
20250 } else if (sp.escMatch ('a')) {
20251 ret.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (7)));
20252 } else if (sp.escMatch ('f')) {
20253 ret.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (12)));
20254 } else if (sp.escMatch ('e')) {
20255 ret.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (27)));
20256 } else if (sp.escMatch ('n')) {
20257 ret.addOr ( new com.stevesoft.pat.oneChar ('\n'));
20258 } else if (sp.escMatch ('t')) {
20259 ret.addOr ( new com.stevesoft.pat.oneChar ('\t'));
20260 } else if (sp.escMatch ('r')) {
20261 ret.addOr ( new com.stevesoft.pat.oneChar ('\r'));
20262 } else if (sp.escMatch ('c')) {
20263 sp.inc ();
20264 if (sp.c.charCodeAt (0) < com.stevesoft.pat.Ctrl.cmap.length) {
20265 ret.addOr ( new com.stevesoft.pat.oneChar (com.stevesoft.pat.Ctrl.cmap[sp.c.charCodeAt (0)]));
20266 } else {
20267 ret.addOr ( new com.stevesoft.pat.oneChar (sp.c));
20268 }} else if (this.isOctalString (sp)) {
20269 var d = sp.c.charCodeAt (0) - 48;
20270 sp.inc ();
20271 d = 8 * d + sp.c.charCodeAt (0) - 48;
20272 var sp2 =  new com.stevesoft.pat.StrPos (sp);
20273 sp2.inc ();
20274 if (this.isOctalDigit (sp2, false)) {
20275 sp.inc ();
20276 d = 8 * d + sp.c.charCodeAt (0) - 48;
20277 }ret.addOr ( new com.stevesoft.pat.oneChar (String.fromCharCode (d)));
20278 } else {
20279 ret.addOr ( new com.stevesoft.pat.oneChar (sp.c));
20280 }sp.inc ();
20281 }
20282 return ret;
20283 }, "com.stevesoft.pat.StrPos");
20284 Clazz_overrideMethod (c$, "toString", 
20285 function () {
20286 {
20287 var sb =  new StringBuffer ();
20288 if (this.esc != '\\') {
20289 sb.append ("(?e=");
20290 sb.append (this.esc);
20291 sb.append (")");
20292 }if (this.gFlag || this.mFlag || !com.stevesoft.pat.Regex.dotDoesntMatchCR || this.sFlag || this.ignoreCase || this.dontMatchInQuotes || this.optimized ()) {
20293 sb.append ("(?");
20294 if (this.ignoreCase) {
20295 sb.append ("i");
20296 }if (this.mFlag) {
20297 sb.append ("m");
20298 }if (this.sFlag || !com.stevesoft.pat.Regex.dotDoesntMatchCR) {
20299 sb.append ("s");
20300 }if (this.dontMatchInQuotes) {
20301 sb.append ("Q");
20302 }if (this.optimized ()) {
20303 sb.append ("o");
20304 }if (this.gFlag) {
20305 sb.append ("g");
20306 }sb.append (")");
20307 }var patstr = this.thePattern.toString ();
20308 if (this.esc != '\\') {
20309 patstr = com.stevesoft.pat.Regex.reEscape (patstr, '\\', this.esc);
20310 }sb.append (patstr);
20311 return sb.toString ();
20312 }});
20313 c$.reEscape = Clazz_defineMethod (c$, "reEscape", 
20314 function (s, oldEsc, newEsc) {
20315 if (oldEsc == newEsc) {
20316 return s;
20317 }var i;
20318 var sb =  new StringBuffer ();
20319 for (i = 0; i < s.length; i++) {
20320 if (s.charAt (i) == oldEsc && i + 1 < s.length) {
20321 if (s.charAt (i + 1) == oldEsc) {
20322 sb.append (oldEsc);
20323 } else {
20324 sb.append (newEsc);
20325 sb.append (s.charAt (i + 1));
20326 }i++;
20327 } else if (s.charAt (i) == newEsc) {
20328 sb.append (newEsc);
20329 sb.append (newEsc);
20330 } else {
20331 sb.append (s.charAt (i));
20332 }}
20333 return sb.toString ();
20334 }, "~S,~S,~S");
20335 Clazz_defineMethod (c$, "accept", 
20336 function (dir, s) {
20337 return this.search (s);
20338 }, "java.io.File,~S");
20339 c$.version = Clazz_defineMethod (c$, "version", 
20340 function () {
20341 return "lgpl release 1.5.3";
20342 });
20343 Clazz_defineMethod (c$, "optimize", 
20344 function () {
20345 if (this.optimized () || this.thePattern == null) {
20346 return;
20347 }this.minMatch =  new com.stevesoft.pat.patInt (0);
20348 this.thePattern = com.stevesoft.pat.RegOpt.opt (this.thePattern, this.ignoreCase, this.dontMatchInQuotes);
20349 this.skipper = com.stevesoft.pat.Skip.findSkipRegex (this);
20350 return;
20351 });
20352 Clazz_defineMethod (c$, "optimized", 
20353 function () {
20354 return this.minMatch != null;
20355 });
20356 c$.perlCode = Clazz_defineMethod (c$, "perlCode", 
20357 function (s) {
20358 return com.stevesoft.pat.parsePerl.parse (s);
20359 }, "~S");
20360 Clazz_defineMethod (c$, "isLiteral", 
20361 function () {
20362 var x = this.thePattern;
20363 while (x != null) {
20364 if (Clazz_instanceOf (x, com.stevesoft.pat.oneChar)) {
20365 ;} else if (Clazz_instanceOf (x, com.stevesoft.pat.Skipped)) {
20366 ;} else {
20367 return false;
20368 }x = x.next;
20369 }
20370 return true;
20371 });
20372 Clazz_defineMethod (c$, "countMinChars", 
20373 function () {
20374 return this.thePattern.countMinChars ();
20375 });
20376 Clazz_defineMethod (c$, "countMaxChars", 
20377 function () {
20378 return this.thePattern.countMaxChars ();
20379 });
20380 Clazz_defineMethod (c$, "isHexDigit", 
20381 function (sp) {
20382 var r = !sp.$eos && !sp.dontMatch && ((sp.c >= '0' && sp.c <= '9') || (sp.c >= 'a' && sp.c <= 'f') || (sp.c >= 'A' && sp.c <= 'F'));
20383 return r;
20384 }, "com.stevesoft.pat.StrPos");
20385 Clazz_defineMethod (c$, "isOctalDigit", 
20386 function (sp, first) {
20387 var r = !sp.$eos && !( new Boolean (first ^ sp.dontMatch).valueOf ()) && sp.c >= '0' && sp.c <= '7';
20388 return r;
20389 }, "com.stevesoft.pat.StrPos,~B");
20390 Clazz_defineMethod (c$, "getHexDigit", 
20391 function (sp) {
20392 if (sp.c >= '0' && sp.c <= '9') {
20393 return sp.c.charCodeAt (0) - 48;
20394 }if (sp.c >= 'a' && sp.c <= 'f') {
20395 return sp.c.charCodeAt (0) - 97 + 10;
20396 }return sp.c.charCodeAt (0) - 65 + 10;
20397 }, "com.stevesoft.pat.StrPos");
20398 Clazz_defineMethod (c$, "next2Hex", 
20399 function (sp) {
20400 var sp2 =  new com.stevesoft.pat.StrPos (sp);
20401 sp2.inc ();
20402 if (!this.isHexDigit (sp2)) {
20403 return false;
20404 }sp2.inc ();
20405 if (!this.isHexDigit (sp2)) {
20406 return false;
20407 }return true;
20408 }, "com.stevesoft.pat.StrPos");
20409 Clazz_defineMethod (c$, "isOctalString", 
20410 function (sp) {
20411 if (!this.isOctalDigit (sp, true)) {
20412 return false;
20413 }var sp2 =  new com.stevesoft.pat.StrPos (sp);
20414 sp2.inc ();
20415 if (!this.isOctalDigit (sp2, false)) {
20416 return false;
20417 }return true;
20418 }, "com.stevesoft.pat.StrPos");
20419 Clazz_defineStatics (c$,
20420 "BackRefOffset", 1);
20421 c$.none = c$.prototype.none =  new com.stevesoft.pat.NoPattern ();
20422 c$.validators = c$.prototype.validators =  new java.util.Hashtable ();
20423 {
20424 com.stevesoft.pat.Regex.defineV ("p", "(?>1)",  new com.stevesoft.pat.UnicodePunct ());
20425 com.stevesoft.pat.Regex.defineV ("P", "(?>1)",  new com.stevesoft.pat.NUnicodePunct ());
20426 com.stevesoft.pat.Regex.defineV ("s", "(?>1)",  new com.stevesoft.pat.UnicodeWhite ());
20427 com.stevesoft.pat.Regex.defineV ("S", "(?>1)",  new com.stevesoft.pat.NUnicodeWhite ());
20428 com.stevesoft.pat.Regex.defineV ("w", "(?>1)",  new com.stevesoft.pat.UnicodeW ());
20429 com.stevesoft.pat.Regex.defineV ("W", "(?>1)",  new com.stevesoft.pat.NUnicodeW ());
20430 com.stevesoft.pat.Regex.defineV ("d", "(?>1)",  new com.stevesoft.pat.UnicodeDigit ());
20431 com.stevesoft.pat.Regex.defineV ("D", "(?>1)",  new com.stevesoft.pat.NUnicodeDigit ());
20432 com.stevesoft.pat.Regex.defineV ("m", "(?>1)",  new com.stevesoft.pat.UnicodeMath ());
20433 com.stevesoft.pat.Regex.defineV ("M", "(?>1)",  new com.stevesoft.pat.NUnicodeMath ());
20434 com.stevesoft.pat.Regex.defineV ("c", "(?>1)",  new com.stevesoft.pat.UnicodeCurrency ());
20435 com.stevesoft.pat.Regex.defineV ("C", "(?>1)",  new com.stevesoft.pat.NUnicodeCurrency ());
20436 com.stevesoft.pat.Regex.defineV ("a", "(?>1)",  new com.stevesoft.pat.UnicodeAlpha ());
20437 com.stevesoft.pat.Regex.defineV ("A", "(?>1)",  new com.stevesoft.pat.NUnicodeAlpha ());
20438 com.stevesoft.pat.Regex.defineV ("uc", "(?>1)",  new com.stevesoft.pat.UnicodeUpper ());
20439 com.stevesoft.pat.Regex.defineV ("lc", "(?>1)",  new com.stevesoft.pat.UnicodeLower ());
20440 }Clazz_defineStatics (c$,
20441 "defaultMFlag", false,
20442 "dotDoesntMatchCR", true,
20443 "lasts", null,
20444 "lastbs", null,
20445 "back_slash", '\\');
20446 });
20447 Clazz_declarePackage ("com.stevesoft.pat");
20448 Clazz_load (null, "com.stevesoft.pat.RegRes", ["java.lang.StringBuffer"], function () {
20449 c$ = Clazz_decorateAsClass (function () {
20450 this.marks = null;
20451 this.didMatch_ = false;
20452 this.src = null;
20453 this.charsMatched_ = 0;
20454 this.matchFrom_ = 0;
20455 this.numSubs_ = 0;
20456 Clazz_instantialize (this, arguments);
20457 }, com.stevesoft.pat, "RegRes");
20458 Clazz_defineMethod (c$, "getString", 
20459 function () {
20460 return this.src.toString ();
20461 });
20462 Clazz_defineMethod (c$, "getStringLike", 
20463 function () {
20464 return this.src;
20465 });
20466 Clazz_overrideMethod (c$, "toString", 
20467 function () {
20468 var sb =  new StringBuffer ();
20469 sb.append ("match=" + this.matchedFrom () + ":" + this.charsMatched ());
20470 if (!this.didMatch ()) {
20471 return sb.toString ();
20472 }for (var i = 0; i < this.numSubs (); i++) {
20473 var n = i + 1;
20474 sb.append (" sub(" + n + ")=" + this.matchedFromI (n) + ":" + this.charsMatchedI (n));
20475 }
20476 return sb.toString ();
20477 });
20478 Clazz_defineMethod (c$, "copyOutOf", 
20479 function (r) {
20480 if (r.marks == null) {
20481 this.marks = null;
20482 } else {
20483 try {
20484 this.marks =  Clazz_newIntArray (r.marks.length, 0);
20485 for (var i = 0; i < this.marks.length; i++) {
20486 this.marks[i] = r.marks[i];
20487 }
20488 } catch (t) {
20489 }
20490 }this.didMatch_ = r.didMatch_;
20491 this.src = r.src;
20492 this.charsMatched_ = r.charsMatched_;
20493 this.matchFrom_ = r.matchFrom_;
20494 this.numSubs_ = r.numSubs_;
20495 }, "com.stevesoft.pat.RegRes");
20496 Clazz_defineMethod (c$, "equals", 
20497 function (r) {
20498 if (this.charsMatched_ != r.charsMatched_ || this.matchFrom_ != r.matchFrom_ || this.didMatch_ != r.didMatch_ || this.numSubs_ != r.numSubs_ || !this.src.unwrap ().equals (r.src.unwrap ())) {
20499 return false;
20500 }if (this.marks == null && r.marks != null) {
20501 return false;
20502 }if (this.marks != null && r.marks == null) {
20503 return false;
20504 }for (var i = 1; i <= this.numSubs_; i++) {
20505 if (this.matchedFromI (i) != r.matchedFromI (i)) {
20506 return false;
20507 } else if (this.charsMatchedI (i) != r.charsMatchedI (i)) {
20508 return false;
20509 }}
20510 return true;
20511 }, "com.stevesoft.pat.RegRes");
20512 Clazz_defineMethod (c$, "stringMatched", 
20513 function () {
20514 var mf = this.matchedFrom ();
20515 var cm = this.charsMatched ();
20516 return !this.didMatch_ || mf < 0 || cm < 0 ? null : this.src.substring (mf, mf + cm);
20517 });
20518 Clazz_defineMethod (c$, "matchedFromI", 
20519 function (i) {
20520 if (this.marks == null || i > this.numSubs_) {
20521 return -1;
20522 }return this.marks[i];
20523 }, "~N");
20524 Clazz_defineMethod (c$, "charsMatchedI", 
20525 function (i) {
20526 if (this.marks == null || i > this.numSubs_ || !this.didMatch_) {
20527 return -1;
20528 }var mf = this.matchedFromI (i);
20529 return mf < 0 ? -1 : this.marks[i + this.numSubs_] - this.matchedFromI (i);
20530 }, "~N");
20531 Clazz_defineMethod (c$, "matchedToI", 
20532 function (i) {
20533 if (this.marks == null || i > this.numSubs_ || !this.didMatch_) {
20534 return -1;
20535 }return this.marks[i + this.numSubs_];
20536 }, "~N");
20537 Clazz_defineMethod (c$, "stringMatchedI", 
20538 function (i) {
20539 var mf = this.matchedFromI (i);
20540 var cm = this.charsMatchedI (i);
20541 return !this.didMatch_ || mf < 0 || cm < 0 ? null : this.src.substring (mf, mf + cm);
20542 }, "~N");
20543 Clazz_defineMethod (c$, "left", 
20544 function () {
20545 var mf = this.matchedFrom ();
20546 return !this.didMatch_ || (mf < 0) ? null : this.src.substring (0, mf);
20547 });
20548 Clazz_defineMethod (c$, "leftI", 
20549 function (i) {
20550 var mf = this.matchedFromI (i);
20551 return !this.didMatch_ || (mf < 0) ? null : this.src.substring (0, mf);
20552 }, "~N");
20553 Clazz_defineMethod (c$, "right", 
20554 function () {
20555 var mf = this.matchedFrom ();
20556 var cm = this.charsMatched ();
20557 return !this.didMatch_ || mf < 0 || cm < 0 ? null : this.src.substring (mf + cm, this.src.length ());
20558 });
20559 Clazz_defineMethod (c$, "rightI", 
20560 function (i) {
20561 var mf = this.matchedFromI (i);
20562 var cm = this.charsMatchedI (i);
20563 return !this.didMatch_ || mf < 0 || cm < 0 ? null : this.src.substring (mf + cm, this.src.length ());
20564 }, "~N");
20565 Clazz_defineMethod (c$, "matchedFrom", 
20566 function () {
20567 return !this.didMatch_ ? -1 : this.matchFrom_;
20568 });
20569 Clazz_defineMethod (c$, "charsMatched", 
20570 function () {
20571 return !this.didMatch_ || this.matchFrom_ < 0 ? -1 : this.charsMatched_;
20572 });
20573 Clazz_defineMethod (c$, "matchedTo", 
20574 function () {
20575 return !this.didMatch_ ? -1 : this.matchFrom_ + this.charsMatched_;
20576 });
20577 Clazz_defineMethod (c$, "numSubs", 
20578 function () {
20579 return this.numSubs_;
20580 });
20581 Clazz_defineMethod (c$, "didMatch", 
20582 function () {
20583 return this.didMatch_;
20584 });
20585 Clazz_defineMethod (c$, "matchFrom", 
20586 function () {
20587 return this.matchedFrom ();
20588 });
20589 Clazz_defineMethod (c$, "substring", 
20590 function () {
20591 return this.stringMatched ();
20592 });
20593 Clazz_defineMethod (c$, "matchFromI", 
20594 function (i) {
20595 return this.matchedFromI (i);
20596 }, "~N");
20597 Clazz_defineMethod (c$, "substringI", 
20598 function (i) {
20599 return this.stringMatchedI (i);
20600 }, "~N");
20601 });
20602 Clazz_declarePackage ("com.stevesoft.pat");
20603 Clazz_load (["com.stevesoft.pat.Validator"], "com.stevesoft.pat.UniValidator", ["com.stevesoft.pat.patInt"], function () {
20604 c$ = Clazz_declareType (com.stevesoft.pat, "UniValidator", com.stevesoft.pat.Validator);
20605 Clazz_overrideMethod (c$, "minChars", 
20606 function () {
20607 return  new com.stevesoft.pat.patInt (1);
20608 });
20609 Clazz_overrideMethod (c$, "maxChars", 
20610 function () {
20611 return  new com.stevesoft.pat.patInt (1);
20612 });
20613 });
20614 Clazz_declarePackage ("com.stevesoft.pat");
20615 Clazz_load (null, "com.stevesoft.pat.Validator", ["com.stevesoft.pat.patInf", "$.patInt"], function () {
20616 c$ = Clazz_decorateAsClass (function () {
20617 this.argsave = null;
20618 this.pattern = ".";
20619 Clazz_instantialize (this, arguments);
20620 }, com.stevesoft.pat, "Validator");
20621 Clazz_defineMethod (c$, "validate", 
20622 function (src, start, end) {
20623 return end;
20624 }, "com.stevesoft.pat.StringLike,~N,~N");
20625 Clazz_defineMethod (c$, "arg", 
20626 function (s) {
20627 return null;
20628 }, "~S");
20629 Clazz_defineMethod (c$, "minChars", 
20630 function () {
20631 return  new com.stevesoft.pat.patInt (0);
20632 });
20633 Clazz_defineMethod (c$, "maxChars", 
20634 function () {
20635 return  new com.stevesoft.pat.patInf ();
20636 });
20637 });
20638 Clazz_declarePackage ("com.stevesoft.pat");
20639 Clazz_load (["com.stevesoft.pat.patInt"], "com.stevesoft.pat.patInf", null, function () {
20640 c$ = Clazz_declareType (com.stevesoft.pat, "patInf", com.stevesoft.pat.patInt);
20641 Clazz_makeConstructor (c$, 
20642 function () {
20643 Clazz_superConstructor (this, com.stevesoft.pat.patInf, []);
20644 this.inf = true;
20645 });
20646 });
20647 Clazz_declarePackage ("com.stevesoft.pat");
20648 c$ = Clazz_decorateAsClass (function () {
20649 this.i = 0;
20650 this.inf = false;
20651 Clazz_instantialize (this, arguments);
20652 }, com.stevesoft.pat, "patInt");
20653 Clazz_makeConstructor (c$, 
20654 function () {
20655 this.i = 0;
20656 this.inf = false;
20657 });
20658 Clazz_makeConstructor (c$, 
20659 function (init) {
20660 this.i = init;
20661 this.inf = false;
20662 }, "~N");
20663 Clazz_makeConstructor (c$, 
20664 function (p) {
20665 this.i = p.i;
20666 this.inf = p.inf;
20667 }, "com.stevesoft.pat.patInt");
20668 Clazz_defineMethod (c$, "setInf", 
20669 function (b) {
20670 this.inf = b;
20671 if (b) {
20672 this.i = 2147483647;
20673 }}, "~B");
20674 Clazz_defineMethod (c$, "inc", 
20675 function () {
20676 if (!this.inf) {
20677 this.i++;
20678 }});
20679 Clazz_defineMethod (c$, "dec", 
20680 function () {
20681 if (!this.inf) {
20682 this.i--;
20683 }});
20684 Clazz_defineMethod (c$, "lessEq", 
20685 function (j) {
20686 return !this.inf && (j.inf || this.i <= j.i);
20687 }, "com.stevesoft.pat.patInt");
20688 Clazz_defineMethod (c$, "equals", 
20689 function (j) {
20690 return !j.inf && !this.inf && this.i == j.i;
20691 }, "com.stevesoft.pat.patInt");
20692 Clazz_overrideMethod (c$, "toString", 
20693 function () {
20694 if (this.inf) {
20695 return "";
20696 } else {
20697 return "" + this.i;
20698 }});
20699 Clazz_defineMethod (c$, "pluseq", 
20700 function (p) {
20701 if (this.inf || p.inf) {
20702 this.setInf (true);
20703 } else {
20704 this.i += p.i;
20705 }return this;
20706 }, "com.stevesoft.pat.patInt");
20707 Clazz_defineMethod (c$, "mul", 
20708 function (p) {
20709 if (this.inf || p.inf) {
20710 return  new com.stevesoft.pat.patInf ();
20711 }return  new com.stevesoft.pat.patInt (this.i * p.i);
20712 }, "com.stevesoft.pat.patInt");
20713 Clazz_defineMethod (c$, "mineq", 
20714 function (p) {
20715 if (p.inf) {
20716 return this;
20717 }if (this.inf) {
20718 this.i = p.i;
20719 } else if (p.i < this.i) {
20720 this.i = p.i;
20721 }this.setInf (false);
20722 return this;
20723 }, "com.stevesoft.pat.patInt");
20724 Clazz_defineMethod (c$, "maxeq", 
20725 function (p) {
20726 if (this.inf || p.inf) {
20727 this.setInf (true);
20728 return this;
20729 }if (p.i > this.i) {
20730 this.i = p.i;
20731 }return this;
20732 }, "com.stevesoft.pat.patInt");
20733 Clazz_defineMethod (c$, "finite", 
20734 function () {
20735 return !this.inf;
20736 });
20737 Clazz_defineMethod (c$, "intValue", 
20738 function () {
20739 return this.inf ? 2147483647 : this.i;
20740 });
20741 Clazz_declarePackage ("jalview.jsdev.api");
20742 Clazz_declareInterface (jalview.jsdev.api, "RegExpInterface");
20743 Clazz_declarePackage ("com.stevesoft.pat");
20744 Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.NoPattern", null, function () {
20745 c$ = Clazz_declareType (com.stevesoft.pat, "NoPattern", com.stevesoft.pat.Pattern);
20746 Clazz_overrideMethod (c$, "toString", 
20747 function () {
20748 return "(?e=#)[^#d#D]";
20749 });
20750 Clazz_overrideMethod (c$, "matchInternal", 
20751 function (i, p) {
20752 return -1;
20753 }, "~N,com.stevesoft.pat.Pthings");
20754 Clazz_overrideMethod (c$, "clone1", 
20755 function (h) {
20756 return  new com.stevesoft.pat.NoPattern ();
20757 }, "java.util.Hashtable");
20758 });
20759 Clazz_declarePackage ("com.stevesoft.pat");
20760 Clazz_load (null, "com.stevesoft.pat.Pattern", ["com.stevesoft.pat.MessageManager", "$.patInf", "$.patInt", "java.lang.Error", "$.StringBuffer"], function () {
20761 c$ = Clazz_decorateAsClass (function () {
20762 this.next = null;
20763 this.parent = null;
20764 this.mfrom = 0;
20765 Clazz_instantialize (this, arguments);
20766 }, com.stevesoft.pat, "Pattern");
20767 Clazz_defineMethod (c$, "getNext", 
20768 function () {
20769 return this.next != null ? this.next : (this.parent == null ? null : this.parent.getNext ());
20770 });
20771 Clazz_defineMethod (c$, "setParent", 
20772 function (p) {
20773 if (this.next != null) {
20774 this.next.setParent (p);
20775 } else {
20776 this.parent = p;
20777 }}, "com.stevesoft.pat.Pattern");
20778 Clazz_defineMethod (c$, "nextMatch", 
20779 function (i, pt) {
20780 var p = this.getNext ();
20781 return p == null ? i : p.matchInternal (i, pt);
20782 }, "~N,com.stevesoft.pat.Pthings");
20783 Clazz_defineMethod (c$, "nextString", 
20784 function () {
20785 if (this.next == null) {
20786 return "";
20787 }return this.next.toString ();
20788 });
20789 c$.inString = Clazz_defineMethod (c$, "inString", 
20790 function (c, s) {
20791 var i;
20792 for (i = 0; i < s.length; i++) {
20793 if (s.charAt (i) == c) {
20794 return true;
20795 }}
20796 return false;
20797 }, "~S,~S");
20798 c$.protect = Clazz_defineMethod (c$, "protect", 
20799 function (s, PROTECT_THESE, esc) {
20800 var i;
20801 var sb =  new StringBuffer ();
20802 var p = PROTECT_THESE + esc;
20803 for (i = 0; i < s.length; i++) {
20804 var c = s.charAt (i);
20805 if (com.stevesoft.pat.Pattern.inString (c, p)) {
20806 sb.append (esc);
20807 }sb.append (c);
20808 }
20809 return sb.toString ();
20810 }, "~S,~S,~S");
20811 Clazz_defineMethod (c$, "match", 
20812 function (s, pt) {
20813 return this.matchAt (s, 0, pt);
20814 }, "com.stevesoft.pat.StringLike,com.stevesoft.pat.Pthings");
20815 Clazz_defineMethod (c$, "matchAt", 
20816 function (s, i, pt) {
20817 pt.src = s;
20818 var r = this.matchInternal (i, pt);
20819 if (r < 0) {
20820 return -1;
20821 }this.mfrom = r < i ? r + 1 : i;
20822 return r < i ? i - r - 1 : r - i;
20823 }, "com.stevesoft.pat.StringLike,~N,com.stevesoft.pat.Pthings");
20824 Clazz_defineMethod (c$, "Masked", 
20825 function (i, pt) {
20826 return pt.cbits == null ? false : pt.cbits.get (i);
20827 }, "~N,com.stevesoft.pat.Pthings");
20828 Clazz_defineMethod (c$, "add", 
20829 function (p) {
20830 if (this.next == null) {
20831 if (p == null) {
20832 return this;
20833 }this.next = p;
20834 p.parent = this.parent;
20835 this.parent = null;
20836 } else {
20837 this.next.add (p);
20838 }return this;
20839 }, "com.stevesoft.pat.Pattern");
20840 Clazz_defineMethod (c$, "minChars", 
20841 function () {
20842 return  new com.stevesoft.pat.patInt (0);
20843 });
20844 Clazz_defineMethod (c$, "maxChars", 
20845 function () {
20846 return  new com.stevesoft.pat.patInf ();
20847 });
20848 Clazz_defineMethod (c$, "countMinChars", 
20849 function () {
20850 var p = this;
20851 var sum =  new com.stevesoft.pat.patInt (0);
20852 while (p != null) {
20853 sum.pluseq (p.minChars ());
20854 p = p.next;
20855 }
20856 return sum;
20857 });
20858 Clazz_defineMethod (c$, "countMaxChars", 
20859 function () {
20860 var p = this;
20861 var sum =  new com.stevesoft.pat.patInt (0);
20862 while (p != null) {
20863 sum.pluseq (p.maxChars ());
20864 p = p.next;
20865 }
20866 return sum;
20867 });
20868 Clazz_defineMethod (c$, "testMatch", 
20869 function (p, pos, pt) {
20870 var tab = null;
20871 if (pt.marks != null) {
20872 try {
20873 tab =  Clazz_newIntArray (pt.marks.length, 0);
20874 for (var i = 0; i < tab.length; i++) {
20875 tab[i] = pt.marks[i];
20876 }
20877 } catch (t) {
20878 }
20879 }var ret = p.matchInternal (pos, pt);
20880 if (ret < 0) {
20881 pt.marks = tab;
20882 }return ret;
20883 }, "com.stevesoft.pat.Pattern,~N,com.stevesoft.pat.Pthings");
20884 Clazz_defineMethod (c$, "clone1", 
20885 function (h) {
20886 throw  new Error (com.stevesoft.pat.MessageManager.formatMessage ("error.no_such_method_as_clone1_for",  Clazz_newArray (-1, [this.getClass ().getName ()])));
20887 }, "java.util.Hashtable");
20888 Clazz_defineMethod (c$, "clone", 
20889 function (h) {
20890 var p = h.get (this);
20891 if (p != null) {
20892 return p;
20893 }p = this.clone1 (h);
20894 if (p == null) {
20895 throw  new Error (com.stevesoft.pat.MessageManager.getString ("error.null_from_clone1"));
20896 }h.put (this, p);
20897 h.put (p, p);
20898 if (this.next != null) {
20899 p.next = this.next.clone (h);
20900 }if (this.parent != null) {
20901 p.parent = this.parent.clone (h);
20902 }return p;
20903 }, "java.util.Hashtable");
20904 Clazz_overrideMethod (c$, "equals", 
20905 function (o) {
20906 return o === this;
20907 }, "~O");
20908 Clazz_defineStatics (c$,
20909 "ESC", '\\',
20910 "PROTECT_THESE", "[]{}(),$,-\"^.");
20911 });
20912 Clazz_declarePackage ("com.stevesoft.pat");
20913 c$ = Clazz_declareType (com.stevesoft.pat, "MessageManager");
20914 c$.getString = Clazz_defineMethod (c$, "getString", 
20915 function (string) {
20916 return string;
20917 }, "~S");
20918 c$.formatMessage = Clazz_defineMethod (c$, "formatMessage", 
20919 function (s, fields) {
20920 for (var i = 0; i < fields.length; i++) s += " " + fields[i];
20921
20922 return s;
20923 }, "~S,~A");
20924 Clazz_declarePackage ("com.stevesoft.pat");
20925 c$ = Clazz_decorateAsClass (function () {
20926 this.src = null;
20927 this.ignoreCase = false;
20928 this.mFlag = false;
20929 this.cbits = null;
20930 this.marks = null;
20931 this.nMarks = 0;
20932 this.dotDoesntMatchCR = false;
20933 this.no_check = false;
20934 this.lastPos = 0;
20935 Clazz_instantialize (this, arguments);
20936 }, com.stevesoft.pat, "Pthings");
20937 Clazz_declarePackage ("com.stevesoft.pat");
20938 Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.Any", ["com.stevesoft.pat.patInt"], function () {
20939 c$ = Clazz_declareType (com.stevesoft.pat, "Any", com.stevesoft.pat.Pattern);
20940 Clazz_overrideMethod (c$, "matchInternal", 
20941 function (pos, pt) {
20942 if (pos < pt.src.length ()) {
20943 if (pt.dotDoesntMatchCR) {
20944 if (pt.src.charAt (pos) != '\n') {
20945 return this.nextMatch (pos + 1, pt);
20946 }} else {
20947 return this.nextMatch (pos + 1, pt);
20948 }}return -1;
20949 }, "~N,com.stevesoft.pat.Pthings");
20950 Clazz_overrideMethod (c$, "toString", 
20951 function () {
20952 return "." + this.nextString ();
20953 });
20954 Clazz_overrideMethod (c$, "minChars", 
20955 function () {
20956 return  new com.stevesoft.pat.patInt (1);
20957 });
20958 Clazz_overrideMethod (c$, "maxChars", 
20959 function () {
20960 return  new com.stevesoft.pat.patInt (1);
20961 });
20962 Clazz_overrideMethod (c$, "clone1", 
20963 function (h) {
20964 return  new com.stevesoft.pat.Any ();
20965 }, "java.util.Hashtable");
20966 });
20967 Clazz_declarePackage ("com.stevesoft.pat");
20968 Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.BackG", ["com.stevesoft.pat.patInt"], function () {
20969 c$ = Clazz_decorateAsClass (function () {
20970 this.c = '\0';
20971 this.altc = '\0';
20972 this.altc2 = '\0';
20973 this.mask = 0;
20974 Clazz_instantialize (this, arguments);
20975 }, com.stevesoft.pat, "BackG", com.stevesoft.pat.Pattern);
20976 Clazz_makeConstructor (c$, 
20977 function () {
20978 Clazz_superConstructor (this, com.stevesoft.pat.BackG, []);
20979 });
20980 Clazz_overrideMethod (c$, "matchInternal", 
20981 function (pos, pt) {
20982 return pos == pt.lastPos ? this.nextMatch (pos, pt) : -1;
20983 }, "~N,com.stevesoft.pat.Pthings");
20984 Clazz_overrideMethod (c$, "toString", 
20985 function () {
20986 return "\\G" + this.nextString ();
20987 });
20988 Clazz_overrideMethod (c$, "minChars", 
20989 function () {
20990 return  new com.stevesoft.pat.patInt (1);
20991 });
20992 Clazz_overrideMethod (c$, "maxChars", 
20993 function () {
20994 return  new com.stevesoft.pat.patInt (1);
20995 });
20996 Clazz_overrideMethod (c$, "clone1", 
20997 function (h) {
20998 return  new com.stevesoft.pat.BackG ();
20999 }, "java.util.Hashtable");
21000 });
21001 Clazz_declarePackage ("com.stevesoft.pat");
21002 Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.BackMatch", null, function () {
21003 c$ = Clazz_decorateAsClass (function () {
21004 this.id = 0;
21005 Clazz_instantialize (this, arguments);
21006 }, com.stevesoft.pat, "BackMatch", com.stevesoft.pat.Pattern);
21007 Clazz_makeConstructor (c$, 
21008 function (id) {
21009 Clazz_superConstructor (this, com.stevesoft.pat.BackMatch, []);
21010 this.id = id;
21011 }, "~N");
21012 Clazz_overrideMethod (c$, "toString", 
21013 function () {
21014 return "\\" + (this.id) + this.nextString ();
21015 });
21016 Clazz_overrideMethod (c$, "matchInternal", 
21017 function (pos, p) {
21018 var i1 = p.marks[this.id];
21019 var i2 = p.marks[this.id + p.nMarks];
21020 var imax = i2 - i1;
21021 if (i1 < 0 || imax < 0 || pos + imax > p.src.length ()) {
21022 return -1;
21023 }var ns = p.src.length () - pos;
21024 if (imax < ns) {
21025 ns = imax;
21026 }for (var i = 0; i < ns; i++) {
21027 if (p.src.charAt (i + i1) != p.src.charAt (pos + i)) {
21028 return -1;
21029 }}
21030 return this.nextMatch (pos + imax, p);
21031 }, "~N,com.stevesoft.pat.Pthings");
21032 Clazz_overrideMethod (c$, "clone1", 
21033 function (h) {
21034 return  new com.stevesoft.pat.BackMatch (this.id);
21035 }, "java.util.Hashtable");
21036 });
21037 Clazz_declarePackage ("com.stevesoft.pat");
21038 Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.Backup", ["com.stevesoft.pat.patInt"], function () {
21039 c$ = Clazz_decorateAsClass (function () {
21040 this.bk = 0;
21041 Clazz_instantialize (this, arguments);
21042 }, com.stevesoft.pat, "Backup", com.stevesoft.pat.Pattern);
21043 Clazz_makeConstructor (c$, 
21044 function (ii) {
21045 Clazz_superConstructor (this, com.stevesoft.pat.Backup, []);
21046 this.bk = ii;
21047 }, "~N");
21048 Clazz_overrideMethod (c$, "toString", 
21049 function () {
21050 return "(?" + (this.bk < 0 ? ">" + (-this.bk) : "<" + this.bk) + ")" + this.nextString ();
21051 });
21052 Clazz_overrideMethod (c$, "matchInternal", 
21053 function (pos, pt) {
21054 if (pos < this.bk) {
21055 return -1;
21056 }return this.nextMatch (pos - this.bk, pt);
21057 }, "~N,com.stevesoft.pat.Pthings");
21058 Clazz_overrideMethod (c$, "minChars", 
21059 function () {
21060 return  new com.stevesoft.pat.patInt (-this.bk);
21061 });
21062 Clazz_overrideMethod (c$, "maxChars", 
21063 function () {
21064 return  new com.stevesoft.pat.patInt (-this.bk);
21065 });
21066 Clazz_overrideMethod (c$, "clone1", 
21067 function (h) {
21068 return  new com.stevesoft.pat.Backup (this.bk);
21069 }, "java.util.Hashtable");
21070 });
21071 Clazz_declarePackage ("com.stevesoft.pat");
21072 Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.Boundary", ["com.stevesoft.pat.patInt"], function () {
21073 c$ = Clazz_declareType (com.stevesoft.pat, "Boundary", com.stevesoft.pat.Pattern);
21074 Clazz_overrideMethod (c$, "toString", 
21075 function () {
21076 return "\\b" + this.nextString ();
21077 });
21078 Clazz_defineMethod (c$, "isAChar", 
21079 function (c) {
21080 if (c >= 'a' && c <= 'z') {
21081 return true;
21082 }if (c >= 'A' && c <= 'Z') {
21083 return true;
21084 }if (c >= '0' && c <= '9') {
21085 return true;
21086 }if (c == '_') {
21087 return true;
21088 }return false;
21089 }, "~S");
21090 Clazz_defineMethod (c$, "matchLeft", 
21091 function (pos, pt) {
21092 if (pos <= 0) {
21093 return true;
21094 }if (this.isAChar (pt.src.charAt (pos)) && this.isAChar (pt.src.charAt (pos - 1))) {
21095 return false;
21096 }return true;
21097 }, "~N,com.stevesoft.pat.Pthings");
21098 Clazz_defineMethod (c$, "matchRight", 
21099 function (pos, pt) {
21100 if (pos < 0) {
21101 return false;
21102 }if (pos + 1 >= pt.src.length ()) {
21103 return true;
21104 }if (this.isAChar (pt.src.charAt (pos)) && this.isAChar (pt.src.charAt (pos + 1))) {
21105 return false;
21106 }return true;
21107 }, "~N,com.stevesoft.pat.Pthings");
21108 Clazz_overrideMethod (c$, "matchInternal", 
21109 function (pos, pt) {
21110 if (this.matchRight (pos - 1, pt) || this.matchLeft (pos, pt)) {
21111 return this.nextMatch (pos, pt);
21112 }return -1;
21113 }, "~N,com.stevesoft.pat.Pthings");
21114 Clazz_overrideMethod (c$, "maxChars", 
21115 function () {
21116 return  new com.stevesoft.pat.patInt (0);
21117 });
21118 Clazz_overrideMethod (c$, "clone1", 
21119 function (h) {
21120 return  new com.stevesoft.pat.Boundary ();
21121 }, "java.util.Hashtable");
21122 });
21123 Clazz_declarePackage ("com.stevesoft.pat");
21124 Clazz_load (["com.stevesoft.pat.Or"], "com.stevesoft.pat.Bracket", ["com.stevesoft.pat.patInt", "java.util.Vector"], function () {
21125 c$ = Clazz_decorateAsClass (function () {
21126 this.neg = false;
21127 Clazz_instantialize (this, arguments);
21128 }, com.stevesoft.pat, "Bracket", com.stevesoft.pat.Or);
21129 Clazz_makeConstructor (c$, 
21130 function (n) {
21131 Clazz_superConstructor (this, com.stevesoft.pat.Bracket, []);
21132 this.neg = n;
21133 }, "~B");
21134 Clazz_overrideMethod (c$, "leftForm", 
21135 function () {
21136 if (this.neg) {
21137 return "[^";
21138 } else {
21139 return "[";
21140 }});
21141 Clazz_overrideMethod (c$, "rightForm", 
21142 function () {
21143 return "]";
21144 });
21145 Clazz_overrideMethod (c$, "sepForm", 
21146 function () {
21147 return "";
21148 });
21149 Clazz_defineMethod (c$, "matchInternal", 
21150 function (pos, pt) {
21151 if (pos >= pt.src.length ()) {
21152 return -1;
21153 }var r = Clazz_superCall (this, com.stevesoft.pat.Bracket, "matchInternal", [pos, pt]);
21154 if ((this.neg && r < 0) || (!this.neg && r >= 0)) {
21155 return this.nextMatch (pos + 1, pt);
21156 }return -1;
21157 }, "~N,com.stevesoft.pat.Pthings");
21158 Clazz_overrideMethod (c$, "minChars", 
21159 function () {
21160 return  new com.stevesoft.pat.patInt (1);
21161 });
21162 Clazz_overrideMethod (c$, "maxChars", 
21163 function () {
21164 return  new com.stevesoft.pat.patInt (1);
21165 });
21166 Clazz_overrideMethod (c$, "addOr", 
21167 function (p) {
21168 this.pv = null;
21169 this.v.addElement (p);
21170 p.setParent (null);
21171 return this;
21172 }, "com.stevesoft.pat.Pattern");
21173 Clazz_overrideMethod (c$, "clone1", 
21174 function (h) {
21175 var b =  new com.stevesoft.pat.Bracket (this.neg);
21176 b.v =  new java.util.Vector ();
21177 for (var i = 0; i < this.v.size (); i++) {
21178 b.v.addElement ((this.v.elementAt (i)).clone1 (h));
21179 }
21180 return b;
21181 }, "java.util.Hashtable");
21182 });
21183 Clazz_declarePackage ("com.stevesoft.pat");
21184 Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.Or", ["com.stevesoft.pat.patInt", "java.lang.StringBuffer", "java.util.Vector"], function () {
21185 c$ = Clazz_decorateAsClass (function () {
21186 this.v = null;
21187 this.pv = null;
21188 Clazz_instantialize (this, arguments);
21189 }, com.stevesoft.pat, "Or", com.stevesoft.pat.Pattern);
21190 Clazz_makeConstructor (c$, 
21191 function () {
21192 Clazz_superConstructor (this, com.stevesoft.pat.Or, []);
21193 this.v =  new java.util.Vector ();
21194 });
21195 Clazz_defineMethod (c$, "leftForm", 
21196 function () {
21197 return "(?:";
21198 });
21199 Clazz_defineMethod (c$, "rightForm", 
21200 function () {
21201 return ")";
21202 });
21203 Clazz_defineMethod (c$, "sepForm", 
21204 function () {
21205 return "|";
21206 });
21207 Clazz_defineMethod (c$, "addOr", 
21208 function (p) {
21209 this.pv = null;
21210 this.v.addElement (p);
21211 p.setParent (this);
21212 return this;
21213 }, "com.stevesoft.pat.Pattern");
21214 Clazz_defineMethod (c$, "toString", 
21215 function () {
21216 var i;
21217 var sb =  new StringBuffer ();
21218 sb.append (this.leftForm ());
21219 if (this.v.size () > 0) {
21220 sb.append ((this.v.elementAt (0)).toString ());
21221 }for (i = 1; i < this.v.size (); i++) {
21222 sb.append (this.sepForm ());
21223 sb.append ((this.v.elementAt (i)).toString ());
21224 }
21225 sb.append (this.rightForm ());
21226 sb.append (this.nextString ());
21227 return sb.toString ();
21228 });
21229 Clazz_defineMethod (c$, "matchInternal", 
21230 function (pos, pt) {
21231 if (this.pv == null) {
21232 this.pv =  new Array (this.v.size ());
21233 this.v.copyInto (this.pv);
21234 }for (var i = 0; i < this.v.size (); i++) {
21235 var p = this.pv[i];
21236 var r = p.matchInternal (pos, pt);
21237 if (r >= 0) {
21238 return r;
21239 }}
21240 return -1;
21241 }, "~N,com.stevesoft.pat.Pthings");
21242 Clazz_overrideMethod (c$, "minChars", 
21243 function () {
21244 if (this.v.size () == 0) {
21245 return  new com.stevesoft.pat.patInt (0);
21246 }var m = (this.v.elementAt (0)).countMinChars ();
21247 for (var i = 1; i < this.v.size (); i++) {
21248 var p = this.v.elementAt (i);
21249 m.mineq (p.countMinChars ());
21250 }
21251 return m;
21252 });
21253 Clazz_overrideMethod (c$, "maxChars", 
21254 function () {
21255 if (this.v.size () == 0) {
21256 return  new com.stevesoft.pat.patInt (0);
21257 }var m = (this.v.elementAt (0)).countMaxChars ();
21258 for (var i = 1; i < this.v.size (); i++) {
21259 var p = this.v.elementAt (i);
21260 m.maxeq (p.countMaxChars ());
21261 }
21262 return m;
21263 });
21264 Clazz_overrideMethod (c$, "clone1", 
21265 function (h) {
21266 var o =  new com.stevesoft.pat.Or ();
21267 h.put (this, o);
21268 h.put (o, o);
21269 for (var i = 0; i < this.v.size (); i++) {
21270 o.v.addElement ((this.v.elementAt (i)).clone (h));
21271 }
21272 return o;
21273 }, "java.util.Hashtable");
21274 });
21275 Clazz_declarePackage ("com.stevesoft.pat");
21276 Clazz_load (null, "com.stevesoft.pat.CaseMgr", ["java.lang.Character"], function () {
21277 c$ = Clazz_declareType (com.stevesoft.pat, "CaseMgr");
21278 c$.toUpperCaseC = Clazz_defineMethod (c$, "toUpperCaseC", 
21279 function (c) {
21280 return Character.toUpperCase (c);
21281 }, "~S");
21282 c$.toLowerCaseC = Clazz_defineMethod (c$, "toLowerCaseC", 
21283 function (c) {
21284 return Character.toLowerCase (c);
21285 }, "~S");
21286 c$.toUpperCase = Clazz_defineMethod (c$, "toUpperCase", 
21287 function (s) {
21288 return s.toUpperCase ();
21289 }, "~S");
21290 c$.toLowerCase = Clazz_defineMethod (c$, "toLowerCase", 
21291 function (s) {
21292 return s.toLowerCase ();
21293 }, "~S");
21294 c$.toTitleCaseC = Clazz_defineMethod (c$, "toTitleCaseC", 
21295 function (c) {
21296 return Character.toUpperCase (c);
21297 }, "~S");
21298 c$.regionMatchesLike = Clazz_defineMethod (c$, "regionMatchesLike", 
21299 function (s1, ign, i1, s2, i2, i3) {
21300 var itot = i2 + i3;
21301 if (itot > s2.length () || i1 + i3 > s1.length ()) {
21302 return false;
21303 }if (!ign) {
21304 for (var i = i2; i < itot; i++) {
21305 if (s2.charAt (i) != s1.charAt (i1++)) {
21306 return false;
21307 }}
21308 } else {
21309 for (var i = i2; i < itot; i++) {
21310 if (com.stevesoft.pat.CaseMgr.toLowerCaseC (s2.charAt (i)) != com.stevesoft.pat.CaseMgr.toLowerCaseC (s1.charAt (i1++))) {
21311 return false;
21312 }}
21313 }return true;
21314 }, "com.stevesoft.pat.StringLike,~B,~N,com.stevesoft.pat.StringLike,~N,~N");
21315 c$.regionMatches = Clazz_defineMethod (c$, "regionMatches", 
21316 function (s1, ign, i1, s2, i2, i3) {
21317 var itot = i2 + i3;
21318 if (itot > s2.length () || i1 + i3 > s1.length) {
21319 return false;
21320 }if (!ign) {
21321 for (var i = i2; i < itot; i++) {
21322 if (s2.charAt (i) != s1.charAt (i1++)) {
21323 return false;
21324 }}
21325 } else {
21326 for (var i = i2; i < itot; i++) {
21327 if (com.stevesoft.pat.CaseMgr.toLowerCaseC (s2.charAt (i)) != com.stevesoft.pat.CaseMgr.toLowerCaseC (s1.charAt (i1++))) {
21328 return false;
21329 }}
21330 }return true;
21331 }, "~S,~B,~N,com.stevesoft.pat.StringLike,~N,~N");
21332 c$.regionMatchesLike2 = Clazz_defineMethod (c$, "regionMatchesLike2", 
21333 function (s1, ign, i1, s2, i2, i3) {
21334 var itot = i2 + i3;
21335 if (itot > s2.length || i1 + i3 > s1.length ()) {
21336 return false;
21337 }if (!ign) {
21338 for (var i = i2; i < itot; i++) {
21339 if (s2.charAt (i) != s1.charAt (i1++)) {
21340 return false;
21341 }}
21342 } else {
21343 for (var i = i2; i < itot; i++) {
21344 if (com.stevesoft.pat.CaseMgr.toLowerCaseC (s2.charAt (i)) != com.stevesoft.pat.CaseMgr.toLowerCaseC (s1.charAt (i1++))) {
21345 return false;
21346 }}
21347 }return true;
21348 }, "com.stevesoft.pat.StringLike,~B,~N,~S,~N,~N");
21349 c$.regionMatches2 = Clazz_defineMethod (c$, "regionMatches2", 
21350 function (s1, ign, i1, s2, i2, i3) {
21351 var itot = i2 + i3;
21352 if (itot > s2.length || i1 + i3 > s1.length) {
21353 return false;
21354 }if (!ign) {
21355 for (var i = i2; i < itot; i++) {
21356 if (s2.charAt (i) != s1.charAt (i1++)) {
21357 return false;
21358 }}
21359 } else {
21360 for (var i = i2; i < itot; i++) {
21361 if (com.stevesoft.pat.CaseMgr.toLowerCaseC (s2.charAt (i)) != com.stevesoft.pat.CaseMgr.toLowerCaseC (s1.charAt (i1++))) {
21362 return false;
21363 }}
21364 }return true;
21365 }, "~S,~B,~N,~S,~N,~N");
21366 Clazz_defineStatics (c$,
21367 "java_1_0", false);
21368 });
21369 Clazz_declarePackage ("com.stevesoft.pat");
21370 c$ = Clazz_declareType (com.stevesoft.pat, "Ctrl");
21371 Clazz_defineStatics (c$,
21372 "cmap",  Clazz_newCharArray (-1, [String.fromCharCode (64), 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', String.fromCharCode (91), String.fromCharCode (92), String.fromCharCode (93), String.fromCharCode (94), String.fromCharCode (95), String.fromCharCode (96), 'a', 'a', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', String.fromCharCode (123), String.fromCharCode (124), String.fromCharCode (125), String.fromCharCode (126), String.fromCharCode (127), String.fromCharCode (0), String.fromCharCode (1), String.fromCharCode (2), String.fromCharCode (3), String.fromCharCode (4), String.fromCharCode (5), String.fromCharCode (6), String.fromCharCode (7), String.fromCharCode (8), String.fromCharCode (9), String.fromCharCode (10), String.fromCharCode (11), String.fromCharCode (12), String.fromCharCode (13), String.fromCharCode (14), String.fromCharCode (15), String.fromCharCode (16), String.fromCharCode (17), String.fromCharCode (18), String.fromCharCode (19), String.fromCharCode (20), String.fromCharCode (21), String.fromCharCode (22), String.fromCharCode (23), String.fromCharCode (24), String.fromCharCode (25), String.fromCharCode (26), String.fromCharCode (27), String.fromCharCode (27), String.fromCharCode (29), String.fromCharCode (30), String.fromCharCode (31), String.fromCharCode (32), String.fromCharCode (1), String.fromCharCode (2), String.fromCharCode (3), String.fromCharCode (4), String.fromCharCode (5), String.fromCharCode (6), String.fromCharCode (7), String.fromCharCode (8), String.fromCharCode (9), String.fromCharCode (10), String.fromCharCode (11), String.fromCharCode (12), String.fromCharCode (13), String.fromCharCode (14), String.fromCharCode (15), String.fromCharCode (16), String.fromCharCode (17), String.fromCharCode (18), String.fromCharCode (19), String.fromCharCode (20), String.fromCharCode (21), String.fromCharCode (22), String.fromCharCode (23), String.fromCharCode (24), String.fromCharCode (25), String.fromCharCode (26), String.fromCharCode (59), String.fromCharCode (60), String.fromCharCode (61), String.fromCharCode (62), String.fromCharCode (63), String.fromCharCode (192), String.fromCharCode (193), String.fromCharCode (194), String.fromCharCode (195), String.fromCharCode (196), String.fromCharCode (197), String.fromCharCode (198), String.fromCharCode (199), String.fromCharCode (200), String.fromCharCode (201), String.fromCharCode (202), String.fromCharCode (203), String.fromCharCode (204), String.fromCharCode (205), String.fromCharCode (206), String.fromCharCode (207), String.fromCharCode (208), String.fromCharCode (209), String.fromCharCode (210), String.fromCharCode (211), String.fromCharCode (212), String.fromCharCode (213), String.fromCharCode (214), String.fromCharCode (215), String.fromCharCode (216), String.fromCharCode (217), String.fromCharCode (218), String.fromCharCode (219), String.fromCharCode (220), String.fromCharCode (221), String.fromCharCode (222), String.fromCharCode (223), String.fromCharCode (224), String.fromCharCode (225), String.fromCharCode (226), String.fromCharCode (227), String.fromCharCode (228), String.fromCharCode (229), String.fromCharCode (230), String.fromCharCode (231), String.fromCharCode (232), String.fromCharCode (233), String.fromCharCode (234), String.fromCharCode (235), String.fromCharCode (236), String.fromCharCode (237), String.fromCharCode (238), String.fromCharCode (239), String.fromCharCode (240), String.fromCharCode (241), String.fromCharCode (242), String.fromCharCode (243), String.fromCharCode (244), String.fromCharCode (245), String.fromCharCode (246), String.fromCharCode (247), String.fromCharCode (248), String.fromCharCode (249), String.fromCharCode (250), String.fromCharCode (251), String.fromCharCode (252), String.fromCharCode (253), String.fromCharCode (254), String.fromCharCode (255), String.fromCharCode (128), String.fromCharCode (129), String.fromCharCode (130), String.fromCharCode (131), String.fromCharCode (132), String.fromCharCode (133), String.fromCharCode (134), String.fromCharCode (135), String.fromCharCode (136), String.fromCharCode (137), String.fromCharCode (138), String.fromCharCode (139), String.fromCharCode (140), String.fromCharCode (141), String.fromCharCode (142), String.fromCharCode (143), String.fromCharCode (144), String.fromCharCode (145), String.fromCharCode (146), String.fromCharCode (147), String.fromCharCode (148), String.fromCharCode (149), String.fromCharCode (150), String.fromCharCode (151), String.fromCharCode (152), String.fromCharCode (153), String.fromCharCode (154), String.fromCharCode (155), String.fromCharCode (156), String.fromCharCode (157), String.fromCharCode (158), String.fromCharCode (159), String.fromCharCode (160), String.fromCharCode (161), String.fromCharCode (162), String.fromCharCode (163), String.fromCharCode (164), String.fromCharCode (165), String.fromCharCode (166), String.fromCharCode (167), String.fromCharCode (168), String.fromCharCode (169), String.fromCharCode (170), String.fromCharCode (171), String.fromCharCode (172), String.fromCharCode (173), String.fromCharCode (174), String.fromCharCode (175), String.fromCharCode (176), String.fromCharCode (177), String.fromCharCode (178), String.fromCharCode (179), String.fromCharCode (180), String.fromCharCode (181), String.fromCharCode (182), String.fromCharCode (183), String.fromCharCode (184), String.fromCharCode (185), String.fromCharCode (186), String.fromCharCode (187), String.fromCharCode (188), String.fromCharCode (189), String.fromCharCode (190), String.fromCharCode (191)]));
21373 Clazz_declarePackage ("com.stevesoft.pat");
21374 Clazz_load (["com.stevesoft.pat.PatternSub"], "com.stevesoft.pat.Custom", ["com.stevesoft.pat.Regex"], function () {
21375 c$ = Clazz_decorateAsClass (function () {
21376 this.select = null;
21377 this.v = null;
21378 this.start = 0;
21379 Clazz_instantialize (this, arguments);
21380 }, com.stevesoft.pat, "Custom", com.stevesoft.pat.PatternSub);
21381 Clazz_makeConstructor (c$, 
21382 function (s) {
21383 Clazz_superConstructor (this, com.stevesoft.pat.Custom, []);
21384 this.select = s;
21385 this.v = com.stevesoft.pat.Regex.validators.get (s);
21386 }, "~S");
21387 Clazz_defineMethod (c$, "matchInternal", 
21388 function (pos, pt) {
21389 this.start = pos;
21390 return this.sub.matchInternal (pos, pt);
21391 }, "~N,com.stevesoft.pat.Pthings");
21392 Clazz_overrideMethod (c$, "toString", 
21393 function () {
21394 var a = this.v.argsave == null ? "" : ":" + this.v.argsave;
21395 return "(??" + this.select + a + ")" + this.nextString ();
21396 });
21397 Clazz_overrideMethod (c$, "minChars", 
21398 function () {
21399 return this.v.minChars ();
21400 });
21401 Clazz_overrideMethod (c$, "maxChars", 
21402 function () {
21403 return this.v.maxChars ();
21404 });
21405 Clazz_overrideMethod (c$, "clone1", 
21406 function (h) {
21407 var c =  new com.stevesoft.pat.Custom (this.select);
21408 h.put (c, c);
21409 h.put (this, c);
21410 c.sub = this.sub.clone (h);
21411 return c;
21412 }, "java.util.Hashtable");
21413 });
21414 Clazz_declarePackage ("com.stevesoft.pat");
21415 Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.PatternSub", null, function () {
21416 c$ = Clazz_decorateAsClass (function () {
21417 this.sub = null;
21418 Clazz_instantialize (this, arguments);
21419 }, com.stevesoft.pat, "PatternSub", com.stevesoft.pat.Pattern);
21420 });
21421 Clazz_declarePackage ("com.stevesoft.pat");
21422 Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.CustomEndpoint", null, function () {
21423 c$ = Clazz_decorateAsClass (function () {
21424 this.c = null;
21425 Clazz_instantialize (this, arguments);
21426 }, com.stevesoft.pat, "CustomEndpoint", com.stevesoft.pat.Pattern);
21427 Clazz_makeConstructor (c$, 
21428 function (cm) {
21429 Clazz_superConstructor (this, com.stevesoft.pat.CustomEndpoint, []);
21430 this.c = cm;
21431 }, "com.stevesoft.pat.Custom");
21432 Clazz_overrideMethod (c$, "matchInternal", 
21433 function (pos, pt) {
21434 var npos = this.c.v.validate (pt.src, this.c.start, pos);
21435 if (npos >= 0) {
21436 return this.nextMatch (npos, pt);
21437 }return -1;
21438 }, "~N,com.stevesoft.pat.Pthings");
21439 Clazz_overrideMethod (c$, "toString", 
21440 function () {
21441 return "";
21442 });
21443 Clazz_overrideMethod (c$, "clone1", 
21444 function (h) {
21445 return  new com.stevesoft.pat.CustomEndpoint (this.c.clone (h));
21446 }, "java.util.Hashtable");
21447 });
21448 Clazz_declarePackage ("com.stevesoft.pat");
21449 Clazz_load (["com.stevesoft.pat.PatternSub"], "com.stevesoft.pat.DotMulti", null, function () {
21450 c$ = Clazz_decorateAsClass (function () {
21451 this.fewestMatches = null;
21452 this.mostMatches = null;
21453 this.matchFewest = false;
21454 this.src = null;
21455 this.srclength = 0;
21456 this.dotDoesntMatchCR = true;
21457 Clazz_instantialize (this, arguments);
21458 }, com.stevesoft.pat, "DotMulti", com.stevesoft.pat.PatternSub);
21459 Clazz_overrideMethod (c$, "minChars", 
21460 function () {
21461 return this.fewestMatches;
21462 });
21463 Clazz_overrideMethod (c$, "maxChars", 
21464 function () {
21465 return this.mostMatches;
21466 });
21467 Clazz_makeConstructor (c$, 
21468 function (a, b) {
21469 Clazz_superConstructor (this, com.stevesoft.pat.DotMulti, []);
21470 this.fewestMatches = a;
21471 this.mostMatches = b;
21472 }, "com.stevesoft.pat.patInt,com.stevesoft.pat.patInt");
21473 Clazz_overrideMethod (c$, "toString", 
21474 function () {
21475 return ".{" + this.fewestMatches + "," + this.mostMatches + "}" + (this.matchFewest ? "?" : "") + "(?# <= dot multi)" + this.nextString ();
21476 });
21477 Clazz_defineMethod (c$, "submatchInternal", 
21478 function (pos, pt) {
21479 if (pos < this.srclength) {
21480 if (this.dotDoesntMatchCR) {
21481 if (this.src.charAt (pos) != '\n') {
21482 return 1 + pos;
21483 }} else {
21484 return 1 + pos;
21485 }}return -1;
21486 }, "~N,com.stevesoft.pat.Pthings");
21487 Clazz_overrideMethod (c$, "matchInternal", 
21488 function (pos, pt) {
21489 var m = -1;
21490 var i = pos;
21491 this.src = pt.src;
21492 this.srclength = this.src.length ();
21493 this.dotDoesntMatchCR = pt.dotDoesntMatchCR;
21494 if (this.matchFewest) {
21495 var nMatches = 0;
21496 while (this.fewestMatches.intValue () > nMatches) {
21497 i = this.submatchInternal (i, pt);
21498 if (i < 0) {
21499 return -1;
21500 }nMatches++;
21501 }
21502 if (i < 0) {
21503 return -1;
21504 }var ii = this.nextMatch (i, pt);
21505 if (ii >= 0) {
21506 return ii;
21507 }if (!this.mostMatches.finite ()) {
21508 while (i >= 0) {
21509 i = this.submatchInternal (i, pt);
21510 if (i < 0) {
21511 return -1;
21512 }ii = this.nextMatch (i, pt);
21513 if (ii >= 0) {
21514 return ii;
21515 }}
21516 } else {
21517 while (i > 0) {
21518 i = this.submatchInternal (i, pt);
21519 if (i < 0) {
21520 return -1;
21521 }nMatches++;
21522 if (nMatches > this.mostMatches.intValue ()) {
21523 return -1;
21524 }ii = this.nextMatch (i, pt);
21525 if (ii >= 0) {
21526 return ii;
21527 }}
21528 }return -1;
21529 }var nMatches = 0;
21530 while (this.fewestMatches.intValue () > nMatches) {
21531 i = this.submatchInternal (i, pt);
21532 if (i >= 0) {
21533 nMatches++;
21534 } else {
21535 return -1;
21536 }}
21537 m = i;
21538 if (this.mostMatches.finite ()) {
21539 while (nMatches < this.mostMatches.intValue ()) {
21540 i = this.submatchInternal (i, pt);
21541 if (i >= 0) {
21542 m = i;
21543 nMatches++;
21544 } else {
21545 break;
21546 }}
21547 } else {
21548 while (true) {
21549 i = this.submatchInternal (i, pt);
21550 if (i >= 0) {
21551 m = i;
21552 nMatches++;
21553 } else {
21554 break;
21555 }}
21556 }while (m >= pos) {
21557 var r = this.nextMatch (m, pt);
21558 if (r >= 0) {
21559 return r;
21560 }m -= 1;
21561 nMatches--;
21562 if (nMatches < this.fewestMatches.intValue ()) {
21563 return -1;
21564 }}
21565 return -1;
21566 }, "~N,com.stevesoft.pat.Pthings");
21567 Clazz_overrideMethod (c$, "clone1", 
21568 function (h) {
21569 var dm =  new com.stevesoft.pat.DotMulti (this.fewestMatches, this.mostMatches);
21570 dm.matchFewest = this.matchFewest;
21571 return dm;
21572 }, "java.util.Hashtable");
21573 Clazz_defineStatics (c$,
21574 "step", 1,
21575 "idcount", 1);
21576 });
21577 Clazz_declarePackage ("com.stevesoft.pat");
21578 Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.End", ["com.stevesoft.pat.patInt"], function () {
21579 c$ = Clazz_decorateAsClass (function () {
21580 this.retIsEnd = false;
21581 Clazz_instantialize (this, arguments);
21582 }, com.stevesoft.pat, "End", com.stevesoft.pat.Pattern);
21583 Clazz_makeConstructor (c$, 
21584 function (b) {
21585 Clazz_superConstructor (this, com.stevesoft.pat.End, []);
21586 this.retIsEnd = b;
21587 }, "~B");
21588 Clazz_overrideMethod (c$, "matchInternal", 
21589 function (pos, pt) {
21590 if (this.retIsEnd && pt.mFlag && pos < pt.src.length ()) {
21591 if (pt.src.charAt (pos) == '\n') {
21592 return this.nextMatch (pos, pt);
21593 }}if (pt.src.length () == pos) {
21594 return this.nextMatch (pos, pt);
21595 } else if (pos < pt.src.length ()) {
21596 pt.src.charAt (pos);
21597 }return -1;
21598 }, "~N,com.stevesoft.pat.Pthings");
21599 Clazz_overrideMethod (c$, "toString", 
21600 function () {
21601 if (this.retIsEnd) {
21602 return "$";
21603 } else {
21604 return "\\Z";
21605 }});
21606 Clazz_overrideMethod (c$, "maxChars", 
21607 function () {
21608 return  new com.stevesoft.pat.patInt (1);
21609 });
21610 Clazz_overrideMethod (c$, "clone1", 
21611 function (h) {
21612 return  new com.stevesoft.pat.End (this.retIsEnd);
21613 }, "java.util.Hashtable");
21614 });
21615 Clazz_declarePackage ("com.stevesoft.pat");
21616 Clazz_load (["com.stevesoft.pat.PatternSub"], "com.stevesoft.pat.FastMulti", ["com.stevesoft.pat.RegSyntaxError", "$.patInt"], function () {
21617 c$ = Clazz_decorateAsClass (function () {
21618 this.fewestMatches = null;
21619 this.mostMatches = null;
21620 this.matchFewest = false;
21621 this.step = -1;
21622 Clazz_instantialize (this, arguments);
21623 }, com.stevesoft.pat, "FastMulti", com.stevesoft.pat.PatternSub);
21624 Clazz_overrideMethod (c$, "minChars", 
21625 function () {
21626 return this.sub.countMinChars ().mul (this.fewestMatches);
21627 });
21628 Clazz_overrideMethod (c$, "maxChars", 
21629 function () {
21630 return this.sub.countMaxChars ().mul (this.mostMatches);
21631 });
21632 Clazz_makeConstructor (c$, 
21633 function (a, b, p) {
21634 Clazz_superConstructor (this, com.stevesoft.pat.FastMulti, []);
21635 if (p == null) {
21636 com.stevesoft.pat.RegSyntaxError.endItAll ("Null length pattern followed by *, +, or other Multi.");
21637 }this.fewestMatches = a;
21638 this.mostMatches = b;
21639 this.sub = p;
21640 this.step = p.countMinChars ().intValue ();
21641 this.sub.setParent (null);
21642 }, "com.stevesoft.pat.patInt,com.stevesoft.pat.patInt,com.stevesoft.pat.Pattern");
21643 Clazz_defineMethod (c$, "toString", 
21644 function () {
21645 return this.sub.toString () + "{" + this.fewestMatches + "," + this.mostMatches + "}" + (this.matchFewest ? "?" : "") + "(?# <= fast multi)" + this.nextString ();
21646 });
21647 Clazz_defineMethod (c$, "matchInternal", 
21648 function (pos, pt) {
21649 var m = -1;
21650 var i = pos;
21651 var endstr = pt.src.length () - this.step;
21652 var matches =  new com.stevesoft.pat.patInt (0);
21653 if (this.matchFewest) {
21654 if (this.fewestMatches.lessEq (matches)) {
21655 var ii = this.nextMatch (i, pt);
21656 if (ii >= 0) {
21657 return ii;
21658 }}while (i >= 0 && i <= endstr) {
21659 i = this.sub.matchInternal (i, pt);
21660 if (i >= 0) {
21661 matches.inc ();
21662 if (this.fewestMatches.lessEq (matches)) {
21663 var ii = this.nextMatch (i, pt);
21664 if (ii >= 0) {
21665 return ii;
21666 }}if (matches.equals (this.mostMatches)) {
21667 return -1;
21668 }}}
21669 return -1;
21670 }var nMatches = 0;
21671 while (this.fewestMatches.intValue () > nMatches) {
21672 i = this.sub.matchInternal (i, pt);
21673 if (i >= 0) {
21674 nMatches++;
21675 } else {
21676 return -1;
21677 }}
21678 m = i;
21679 if (this.mostMatches.finite ()) {
21680 while (nMatches < this.mostMatches.intValue ()) {
21681 i = this.sub.matchInternal (i, pt);
21682 if (i >= 0) {
21683 m = i;
21684 nMatches++;
21685 } else {
21686 break;
21687 }}
21688 } else {
21689 while (true) {
21690 i = this.sub.matchInternal (i, pt);
21691 if (i >= 0) {
21692 m = i;
21693 nMatches++;
21694 } else {
21695 break;
21696 }}
21697 }while (m >= pos) {
21698 var r = this.nextMatch (m, pt);
21699 if (r >= 0) {
21700 return r;
21701 }m -= this.step;
21702 nMatches--;
21703 if (nMatches < this.fewestMatches.intValue ()) {
21704 return -1;
21705 }}
21706 return -1;
21707 }, "~N,com.stevesoft.pat.Pthings");
21708 Clazz_overrideMethod (c$, "clone1", 
21709 function (h) {
21710 try {
21711 var fm =  new com.stevesoft.pat.FastMulti (this.fewestMatches, this.mostMatches, this.sub.clone (h));
21712 fm.matchFewest = this.matchFewest;
21713 return fm;
21714 } catch (rs) {
21715 if (Clazz_exceptionOf (rs, com.stevesoft.pat.RegSyntax)) {
21716 return null;
21717 } else {
21718 throw rs;
21719 }
21720 }
21721 }, "java.util.Hashtable");
21722 });
21723 Clazz_declarePackage ("com.stevesoft.pat");
21724 Clazz_load (["java.lang.Error"], "com.stevesoft.pat.RegSyntaxError", ["com.stevesoft.pat.RegSyntax"], function () {
21725 c$ = Clazz_declareType (com.stevesoft.pat, "RegSyntaxError", Error);
21726 Clazz_makeConstructor (c$, 
21727 function () {
21728 Clazz_superConstructor (this, com.stevesoft.pat.RegSyntaxError, []);
21729 });
21730 c$.endItAll = Clazz_defineMethod (c$, "endItAll", 
21731 function (s) {
21732 if (com.stevesoft.pat.RegSyntaxError.RegSyntaxErrorEnabled) {
21733 throw  new com.stevesoft.pat.RegSyntaxError (s);
21734 }throw  new com.stevesoft.pat.RegSyntax (s);
21735 }, "~S");
21736 Clazz_defineStatics (c$,
21737 "RegSyntaxErrorEnabled", false);
21738 });
21739 Clazz_declarePackage ("com.stevesoft.pat");
21740 Clazz_load (["java.lang.Exception"], "com.stevesoft.pat.RegSyntax", null, function () {
21741 c$ = Clazz_declareType (com.stevesoft.pat, "RegSyntax", Exception);
21742 Clazz_makeConstructor (c$, 
21743 function () {
21744 Clazz_superConstructor (this, com.stevesoft.pat.RegSyntax, []);
21745 });
21746 });
21747 Clazz_declarePackage ("com.stevesoft.pat");
21748 Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.Group", ["com.stevesoft.pat.patInt"], function () {
21749 c$ = Clazz_decorateAsClass (function () {
21750 this.op = '\0';
21751 this.cl = '\0';
21752 Clazz_instantialize (this, arguments);
21753 }, com.stevesoft.pat, "Group", com.stevesoft.pat.Pattern);
21754 Clazz_makeConstructor (c$, 
21755 function (opi, cli) {
21756 Clazz_superConstructor (this, com.stevesoft.pat.Group, []);
21757 this.op = opi;
21758 this.cl = cli;
21759 }, "~S,~S");
21760 Clazz_overrideMethod (c$, "matchInternal", 
21761 function (pos, pt) {
21762 var i;
21763 var count = 1;
21764 if (pos < pt.src.length ()) {
21765 if (!this.Masked (pos, pt) && pt.src.charAt (pos) != this.op) {
21766 return -1;
21767 }}for (i = pos + 1; i < pt.src.length (); i++) {
21768 var c = pt.src.charAt (i);
21769 var b = !this.Masked (i, pt);
21770 if (b && c == '\\') {
21771 i++;
21772 } else {
21773 if (b && c == this.cl) {
21774 count--;
21775 }if (count == 0) {
21776 return this.nextMatch (i + 1, pt);
21777 }if (b && c == this.op) {
21778 count++;
21779 }}}
21780 return -1;
21781 }, "~N,com.stevesoft.pat.Pthings");
21782 Clazz_overrideMethod (c$, "toString", 
21783 function () {
21784 return "(?@" + this.op + this.cl + ")" + this.nextString ();
21785 });
21786 Clazz_overrideMethod (c$, "minChars", 
21787 function () {
21788 return  new com.stevesoft.pat.patInt (2);
21789 });
21790 Clazz_overrideMethod (c$, "clone1", 
21791 function (h) {
21792 return  new com.stevesoft.pat.Group (this.op, this.cl);
21793 }, "java.util.Hashtable");
21794 });
21795 Clazz_declarePackage ("com.stevesoft.pat");
21796 Clazz_load (["com.stevesoft.pat.PatternSub"], "com.stevesoft.pat.Multi", ["com.stevesoft.pat.Multi_stage2"], function () {
21797 c$ = Clazz_decorateAsClass (function () {
21798 this.a = null;
21799 this.b = null;
21800 this.p = null;
21801 this.st2 = null;
21802 this.matchFewest = false;
21803 Clazz_instantialize (this, arguments);
21804 }, com.stevesoft.pat, "Multi", com.stevesoft.pat.PatternSub);
21805 Clazz_overrideMethod (c$, "minChars", 
21806 function () {
21807 return this.a.mul (this.p.countMinChars ());
21808 });
21809 Clazz_overrideMethod (c$, "maxChars", 
21810 function () {
21811 return this.b.mul (this.p.countMaxChars ());
21812 });
21813 Clazz_makeConstructor (c$, 
21814 function (a, b, p) {
21815 Clazz_superConstructor (this, com.stevesoft.pat.Multi, []);
21816 this.a = a;
21817 this.b = b;
21818 this.p = p;
21819 this.st2 =  new com.stevesoft.pat.Multi_stage2 (a, b, p);
21820 this.st2.parent = this;
21821 this.sub = this.st2.sub;
21822 }, "com.stevesoft.pat.patInt,com.stevesoft.pat.patInt,com.stevesoft.pat.Pattern");
21823 Clazz_overrideMethod (c$, "toString", 
21824 function () {
21825 this.st2.matchFewest = this.matchFewest;
21826 return this.st2.toString ();
21827 });
21828 Clazz_overrideMethod (c$, "matchInternal", 
21829 function (pos, pt) {
21830 try {
21831 this.st2 =  new com.stevesoft.pat.Multi_stage2 (this.a, this.b, this.p);
21832 } catch (r__) {
21833 if (Clazz_exceptionOf (r__, com.stevesoft.pat.RegSyntax)) {
21834 } else {
21835 throw r__;
21836 }
21837 }
21838 this.st2.matchFewest = this.matchFewest;
21839 this.st2.parent = this;
21840 return this.st2.matchInternal (pos, pt);
21841 }, "~N,com.stevesoft.pat.Pthings");
21842 Clazz_overrideMethod (c$, "clone1", 
21843 function (h) {
21844 try {
21845 var m =  new com.stevesoft.pat.Multi (this.a, this.b, (this.p).clone (h));
21846 m.matchFewest = this.matchFewest;
21847 return m;
21848 } catch (rs) {
21849 if (Clazz_exceptionOf (rs, com.stevesoft.pat.RegSyntax)) {
21850 return null;
21851 } else {
21852 throw rs;
21853 }
21854 }
21855 }, "java.util.Hashtable");
21856 });
21857 Clazz_declarePackage ("com.stevesoft.pat");
21858 Clazz_load (["com.stevesoft.pat.PatternSub"], "com.stevesoft.pat.Multi_stage2", ["com.stevesoft.pat.RegSyntaxError", "$.patInt"], function () {
21859 c$ = Clazz_decorateAsClass (function () {
21860 this.nextRet = null;
21861 this.count = null;
21862 this.matchMin = null;
21863 this.matchMax = null;
21864 this.matchFewest = false;
21865 this.pos_old = -1;
21866 Clazz_instantialize (this, arguments);
21867 }, com.stevesoft.pat, "Multi_stage2", com.stevesoft.pat.PatternSub);
21868 Clazz_defineMethod (c$, "toString", 
21869 function () {
21870 var ret = "";
21871 ret += this.sub.toString ();
21872 ret += "{" + this.matchMin + "," + this.matchMax + "}";
21873 if (this.matchFewest) {
21874 ret += "?";
21875 }ret += this.parent.nextString ();
21876 return ret;
21877 });
21878 Clazz_makeConstructor (c$, 
21879 function (a, b, p) {
21880 Clazz_superConstructor (this, com.stevesoft.pat.Multi_stage2, []);
21881 if (p == null) {
21882 com.stevesoft.pat.RegSyntaxError.endItAll ("Multiple match of Null pattern requested.");
21883 }this.sub = p;
21884 this.nextRet = this;
21885 this.sub.setParent (this);
21886 this.matchMin = a;
21887 this.matchMax = b;
21888 this.count =  new com.stevesoft.pat.patInt (0);
21889 if (!a.lessEq (b)) {
21890 com.stevesoft.pat.RegSyntaxError.endItAll ("Bad Multi Args: " + a + ">" + b);
21891 }var i =  new com.stevesoft.pat.patInt (-1);
21892 if (a.lessEq (i)) {
21893 com.stevesoft.pat.RegSyntaxError.endItAll ("Bad Multi Args: " + a + "< 0");
21894 }}, "com.stevesoft.pat.patInt,com.stevesoft.pat.patInt,com.stevesoft.pat.Pattern");
21895 Clazz_defineMethod (c$, "getNext", 
21896 function () {
21897 return this.nextRet;
21898 });
21899 Clazz_overrideMethod (c$, "matchInternal", 
21900 function (pos, pt) {
21901 this.sub.setParent (this);
21902 var canUse = -1;
21903 if (this.pos_old >= 0 && pos == this.pos_old) {
21904 return -1;
21905 }this.pos_old = pos;
21906 if (this.matchMin.lessEq (this.count)) {
21907 canUse = pos;
21908 }if (!this.count.lessEq (this.matchMax) || pos > pt.src.length ()) {
21909 return -1;
21910 }if ((this.matchFewest || this.count.equals (this.matchMax)) && canUse >= 0) {
21911 var n = Clazz_superCall (this, com.stevesoft.pat.Multi_stage2, "getNext", []);
21912 if (n == null) {
21913 return canUse;
21914 }var ret = this.testMatch (n, pos, pt);
21915 if (ret >= 0) {
21916 return ret;
21917 } else {
21918 canUse = -1;
21919 }}this.count.inc ();
21920 try {
21921 if (this.count.lessEq (this.matchMax)) {
21922 var r = this.testMatch (this.sub, pos, pt);
21923 if (r >= 0) {
21924 return r;
21925 }}} finally {
21926 this.count.dec ();
21927 }
21928 if (!this.matchFewest && canUse >= 0) {
21929 var n = Clazz_superCall (this, com.stevesoft.pat.Multi_stage2, "getNext", []);
21930 if (n == null) {
21931 return canUse;
21932 }var ret = this.testMatch (n, pos, pt);
21933 return ret;
21934 } else {
21935 return canUse;
21936 }}, "~N,com.stevesoft.pat.Pthings");
21937 Clazz_overrideMethod (c$, "clone1", 
21938 function (h) {
21939 try {
21940 var m =  new com.stevesoft.pat.Multi_stage2 (this.matchMin, this.matchMax, this.sub.clone (h));
21941 m.matchFewest = this.matchFewest;
21942 return m;
21943 } catch (rs) {
21944 if (Clazz_exceptionOf (rs, com.stevesoft.pat.RegSyntax)) {
21945 return null;
21946 } else {
21947 throw rs;
21948 }
21949 }
21950 }, "java.util.Hashtable");
21951 });
21952 Clazz_declarePackage ("com.stevesoft.pat");
21953 Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.NullPattern", ["com.stevesoft.pat.patInt"], function () {
21954 c$ = Clazz_declareType (com.stevesoft.pat, "NullPattern", com.stevesoft.pat.Pattern);
21955 Clazz_overrideMethod (c$, "toString", 
21956 function () {
21957 return this.nextString ();
21958 });
21959 Clazz_overrideMethod (c$, "matchInternal", 
21960 function (p, pt) {
21961 return this.nextMatch (p, pt);
21962 }, "~N,com.stevesoft.pat.Pthings");
21963 Clazz_overrideMethod (c$, "maxChars", 
21964 function () {
21965 return  new com.stevesoft.pat.patInt (0);
21966 });
21967 Clazz_overrideMethod (c$, "clone1", 
21968 function (h) {
21969 return  new com.stevesoft.pat.NullPattern ();
21970 }, "java.util.Hashtable");
21971 });
21972 Clazz_declarePackage ("com.stevesoft.pat");
21973 Clazz_load (["com.stevesoft.pat.Or", "$.SubMark"], "com.stevesoft.pat.OrMark", null, function () {
21974 c$ = Clazz_decorateAsClass (function () {
21975 this.sm = null;
21976 this.id = 0;
21977 Clazz_instantialize (this, arguments);
21978 }, com.stevesoft.pat, "OrMark", com.stevesoft.pat.Or);
21979 Clazz_prepareFields (c$, function () {
21980 this.sm =  new com.stevesoft.pat.SubMark ();
21981 });
21982 Clazz_makeConstructor (c$, 
21983 function (i) {
21984 Clazz_superConstructor (this, com.stevesoft.pat.OrMark, []);
21985 this.sm.om = this;
21986 this.id = i;
21987 }, "~N");
21988 Clazz_overrideMethod (c$, "leftForm", 
21989 function () {
21990 return "(";
21991 });
21992 Clazz_defineMethod (c$, "getNext", 
21993 function () {
21994 return this.sm;
21995 });
21996 Clazz_defineMethod (c$, "matchInternal", 
21997 function (pos, pt) {
21998 this.sm.next = Clazz_superCall (this, com.stevesoft.pat.OrMark, "getNext", []);
21999 if (pt.marks == null) {
22000 var n2 = 2 * pt.nMarks + 2;
22001 pt.marks =  Clazz_newIntArray (n2, 0);
22002 for (var i = 0; i < n2; i++) {
22003 pt.marks[i] = -1;
22004 }
22005 }pt.marks[this.id] = pos;
22006 var ret = Clazz_superCall (this, com.stevesoft.pat.OrMark, "matchInternal", [pos, pt]);
22007 if (ret < 0) {
22008 pt.marks[this.id] = -1;
22009 } else if (pt.marks[this.id] > pt.marks[this.id + pt.nMarks]) {
22010 var swap = pt.marks[this.id];
22011 pt.marks[this.id] = pt.marks[this.id + pt.nMarks] + 1;
22012 pt.marks[this.id + pt.nMarks] = swap + 1;
22013 }return ret;
22014 }, "~N,com.stevesoft.pat.Pthings");
22015 Clazz_overrideMethod (c$, "clone1", 
22016 function (h) {
22017 var om =  new com.stevesoft.pat.OrMark (this.id);
22018 h.put (om, om);
22019 h.put (this, om);
22020 for (var i = 0; i < this.v.size (); i++) {
22021 om.v.addElement ((this.v.elementAt (i)).clone (h));
22022 }
22023 return om;
22024 }, "java.util.Hashtable");
22025 });
22026 Clazz_declarePackage ("com.stevesoft.pat");
22027 Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.SubMark", null, function () {
22028 c$ = Clazz_decorateAsClass (function () {
22029 this.end_pos = 0;
22030 this.start_pos = 0;
22031 this.om = null;
22032 Clazz_instantialize (this, arguments);
22033 }, com.stevesoft.pat, "SubMark", com.stevesoft.pat.Pattern);
22034 Clazz_overrideMethod (c$, "toString", 
22035 function () {
22036 return "";
22037 });
22038 Clazz_overrideMethod (c$, "matchInternal", 
22039 function (i, pt) {
22040 pt.marks[this.om.id + pt.nMarks] = i;
22041 var ret = this.nextMatch (i, pt);
22042 if (ret < 0) {
22043 pt.marks[this.om.id + pt.nMarks] = -1;
22044 }return ret;
22045 }, "~N,com.stevesoft.pat.Pthings");
22046 });
22047 Clazz_declarePackage ("com.stevesoft.pat");
22048 Clazz_load (null, "com.stevesoft.pat.Prop", ["com.stevesoft.pat.Bits"], function () {
22049 c$ = Clazz_declareType (com.stevesoft.pat, "Prop");
22050 c$.isDecimalDigit = Clazz_defineMethod (c$, "isDecimalDigit", 
22051 function (c) {
22052 if (com.stevesoft.pat.Bits.decimal_digit == null) {
22053 com.stevesoft.pat.Bits.decimal_digit_f ();
22054 }return com.stevesoft.pat.Bits.decimal_digit.get (c.charCodeAt (0));
22055 }, "~S");
22056 c$.isAlphabetic = Clazz_defineMethod (c$, "isAlphabetic", 
22057 function (c) {
22058 if (com.stevesoft.pat.Bits.letter == null) {
22059 com.stevesoft.pat.Bits.letter_f ();
22060 }return com.stevesoft.pat.Bits.letter.get (c.charCodeAt (0));
22061 }, "~S");
22062 c$.isMath = Clazz_defineMethod (c$, "isMath", 
22063 function (c) {
22064 if (com.stevesoft.pat.Bits.math == null) {
22065 com.stevesoft.pat.Bits.math_f ();
22066 }return com.stevesoft.pat.Bits.math.get (c.charCodeAt (0));
22067 }, "~S");
22068 c$.isCurrency = Clazz_defineMethod (c$, "isCurrency", 
22069 function (c) {
22070 if (com.stevesoft.pat.Bits.currency == null) {
22071 com.stevesoft.pat.Bits.currency_f ();
22072 }return com.stevesoft.pat.Bits.currency.get (c.charCodeAt (0));
22073 }, "~S");
22074 c$.isWhite = Clazz_defineMethod (c$, "isWhite", 
22075 function (c) {
22076 if (com.stevesoft.pat.Bits.white == null) {
22077 com.stevesoft.pat.Bits.white_f ();
22078 }return com.stevesoft.pat.Bits.white.get (c.charCodeAt (0));
22079 }, "~S");
22080 c$.isPunct = Clazz_defineMethod (c$, "isPunct", 
22081 function (c) {
22082 if (com.stevesoft.pat.Bits.punct == null) {
22083 com.stevesoft.pat.Bits.punct_f ();
22084 }return com.stevesoft.pat.Bits.punct.get (c.charCodeAt (0));
22085 }, "~S");
22086 });
22087 Clazz_declarePackage ("com.stevesoft.pat");
22088 c$ = Clazz_decorateAsClass (function () {
22089 this.carray = null;
22090 Clazz_instantialize (this, arguments);
22091 }, com.stevesoft.pat, "Bits");
22092 Clazz_makeConstructor (c$, 
22093 function (carray) {
22094 this.carray = carray;
22095 }, "~A");
22096 Clazz_defineMethod (c$, "get", 
22097 function (i) {
22098 return ((this.carray[i >> 4]).charCodeAt (0) & (1 << (i & 15))) != 0;
22099 }, "~N");
22100 Clazz_defineMethod (c$, "set", 
22101 function (i, b) {
22102 if (b) {
22103 this.carray[i >> 4] = String.fromCharCode ((this.carray[i >> 4]).charCodeAt (0) | ((String.fromCharCode (1)).charCodeAt (0) << (i & 15)));
22104 } else {
22105 this.carray[i >> 4] = String.fromCharCode ((this.carray[i >> 4]).charCodeAt (0) & (String.fromCharCode (~(1 << (i & 15)))).charCodeAt (0));
22106 }}, "~N,~B");
22107 c$.upper_f = Clazz_defineMethod (c$, "upper_f", 
22108 function () {
22109 var data =  Clazz_newCharArray (4159, '\0');
22110 com.stevesoft.pat.Bits.upper =  new com.stevesoft.pat.Bits (data);
22111 data[4] = String.fromCharCode (0xfffe);
22112 data[5] = String.fromCharCode (0x07ff);
22113 data[12] = String.fromCharCode (0xffff);
22114 data[13] = String.fromCharCode (0x7f7f);
22115 data[16] = String.fromCharCode (0x5555);
22116 data[17] = String.fromCharCode (0x5555);
22117 data[18] = String.fromCharCode (0x5555);
22118 data[19] = String.fromCharCode (0xaa55);
22119 data[20] = String.fromCharCode (0x54aa);
22120 data[21] = String.fromCharCode (0x5555);
22121 data[22] = String.fromCharCode (0x5555);
22122 data[23] = String.fromCharCode (0x2b55);
22123 data[24] = String.fromCharCode (0xced6);
22124 data[25] = String.fromCharCode (0xb1db);
22125 data[26] = String.fromCharCode (0xd2d5);
22126 data[27] = String.fromCharCode (0x11ae);
22127 data[28] = String.fromCharCode (0xa490);
22128 data[29] = String.fromCharCode (0x4aaa);
22129 data[30] = String.fromCharCode (0x5555);
22130 data[31] = String.fromCharCode (0x5412);
22131 data[32] = String.fromCharCode (0x5555);
22132 data[33] = 'U';
22133 data[56] = String.fromCharCode (0xd740);
22134 data[57] = String.fromCharCode (0xfffe);
22135 data[58] = String.fromCharCode (0x0ffb);
22136 data[61] = String.fromCharCode (0x541c);
22137 data[62] = String.fromCharCode (0x5555);
22138 data[64] = String.fromCharCode (0xdffe);
22139 data[65] = String.fromCharCode (0xffff);
22140 data[66] = String.fromCharCode (0xffff);
22141 data[70] = String.fromCharCode (0x5555);
22142 data[71] = String.fromCharCode (0x5555);
22143 data[72] = String.fromCharCode (0x0001);
22144 data[73] = String.fromCharCode (0x5555);
22145 data[74] = String.fromCharCode (0x5555);
22146 data[75] = String.fromCharCode (0x5555);
22147 data[76] = String.fromCharCode (0x088a);
22148 data[77] = String.fromCharCode (0x5555);
22149 data[78] = String.fromCharCode (0x4555);
22150 data[79] = String.fromCharCode (0x0115);
22151 data[83] = String.fromCharCode (0xfffe);
22152 data[84] = String.fromCharCode (0xffff);
22153 data[85] = String.fromCharCode (0x007f);
22154 data[266] = String.fromCharCode (0xffff);
22155 data[267] = String.fromCharCode (0xffff);
22156 data[268] = String.fromCharCode (0x003f);
22157 data[480] = String.fromCharCode (0x5555);
22158 data[481] = String.fromCharCode (0x5555);
22159 data[482] = String.fromCharCode (0x5555);
22160 data[483] = String.fromCharCode (0x5555);
22161 data[484] = String.fromCharCode (0x5555);
22162 data[485] = String.fromCharCode (0x5555);
22163 data[486] = String.fromCharCode (0x5555);
22164 data[487] = String.fromCharCode (0x5555);
22165 data[488] = String.fromCharCode (0x5555);
22166 data[489] = String.fromCharCode (0x0015);
22167 data[490] = String.fromCharCode (0x5555);
22168 data[491] = String.fromCharCode (0x5555);
22169 data[492] = String.fromCharCode (0x5555);
22170 data[493] = String.fromCharCode (0x5555);
22171 data[494] = String.fromCharCode (0x5555);
22172 data[495] = String.fromCharCode (0x0155);
22173 data[496] = String.fromCharCode (0xff00);
22174 data[497] = String.fromCharCode (0x3f00);
22175 data[498] = String.fromCharCode (0xff00);
22176 data[499] = String.fromCharCode (0xff00);
22177 data[500] = String.fromCharCode (0x3f00);
22178 data[501] = String.fromCharCode (0xaa00);
22179 data[502] = String.fromCharCode (0xff00);
22180 data[504] = String.fromCharCode (0xff00);
22181 data[505] = String.fromCharCode (0xff00);
22182 data[506] = String.fromCharCode (0xff00);
22183 data[507] = String.fromCharCode (0x5f00);
22184 data[508] = String.fromCharCode (0x1f00);
22185 data[509] = String.fromCharCode (0x0f00);
22186 data[510] = String.fromCharCode (0x1f00);
22187 data[511] = String.fromCharCode (0x1f00);
22188 data[528] = String.fromCharCode (0x3884);
22189 data[529] = String.fromCharCode (0x3f27);
22190 data[530] = String.fromCharCode (0x3d50);
22191 data[531] = String.fromCharCode (0x000b);
22192 data[4082] = String.fromCharCode (0xfffe);
22193 data[4083] = String.fromCharCode (0x07ff);
22194 data[4100] = String.fromCharCode (0xfffe);
22195 data[4101] = String.fromCharCode (0x07ff);
22196 data[4108] = String.fromCharCode (0xffff);
22197 data[4109] = String.fromCharCode (0x7f7f);
22198 data[4112] = String.fromCharCode (0x5555);
22199 data[4113] = String.fromCharCode (0x5555);
22200 data[4114] = String.fromCharCode (0x5555);
22201 data[4115] = String.fromCharCode (0xaa55);
22202 data[4116] = String.fromCharCode (0x54aa);
22203 data[4117] = String.fromCharCode (0x5555);
22204 data[4118] = String.fromCharCode (0x5555);
22205 data[4119] = String.fromCharCode (0x2b55);
22206 data[4120] = String.fromCharCode (0xced6);
22207 data[4121] = String.fromCharCode (0xb1db);
22208 data[4122] = String.fromCharCode (0xd2d5);
22209 data[4123] = String.fromCharCode (0x11ae);
22210 data[4124] = String.fromCharCode (0xa490);
22211 data[4125] = String.fromCharCode (0x4aaa);
22212 data[4126] = String.fromCharCode (0x5555);
22213 data[4127] = String.fromCharCode (0x5412);
22214 data[4128] = String.fromCharCode (0x5555);
22215 data[4129] = 'U';
22216 data[4152] = String.fromCharCode (0xd740);
22217 data[4153] = String.fromCharCode (0xfffe);
22218 data[4154] = String.fromCharCode (0x0ffb);
22219 data[4157] = String.fromCharCode (0x541c);
22220 data[4158] = 'U';
22221 });
22222 c$.lower_f = Clazz_defineMethod (c$, "lower_f", 
22223 function () {
22224 var data =  Clazz_newCharArray (4159, '\0');
22225 com.stevesoft.pat.Bits.lower =  new com.stevesoft.pat.Bits (data);
22226 data[6] = String.fromCharCode (0xfffe);
22227 data[7] = String.fromCharCode (0x07ff);
22228 data[10] = String.fromCharCode (0x0400);
22229 data[11] = String.fromCharCode (0x0420);
22230 data[13] = String.fromCharCode (0x8000);
22231 data[14] = String.fromCharCode (0xffff);
22232 data[15] = String.fromCharCode (0xff7f);
22233 data[16] = String.fromCharCode (0xaaaa);
22234 data[17] = String.fromCharCode (0xaaaa);
22235 data[18] = String.fromCharCode (0xaaaa);
22236 data[19] = String.fromCharCode (0x55aa);
22237 data[20] = String.fromCharCode (0xab55);
22238 data[21] = String.fromCharCode (0xaaaa);
22239 data[22] = String.fromCharCode (0xaaaa);
22240 data[23] = String.fromCharCode (0xd4aa);
22241 data[24] = String.fromCharCode (0x3129);
22242 data[25] = String.fromCharCode (0x4e24);
22243 data[26] = String.fromCharCode (0x292a);
22244 data[27] = String.fromCharCode (0x2651);
22245 data[28] = String.fromCharCode (0x5240);
22246 data[29] = String.fromCharCode (0xb555);
22247 data[30] = String.fromCharCode (0xaaaa);
22248 data[31] = String.fromCharCode (0xa829);
22249 data[32] = String.fromCharCode (0xaaaa);
22250 data[33] = String.fromCharCode (0x00aa);
22251 data[37] = String.fromCharCode (0xffff);
22252 data[38] = String.fromCharCode (0xffff);
22253 data[39] = String.fromCharCode (0xffff);
22254 data[40] = String.fromCharCode (0xffff);
22255 data[41] = String.fromCharCode (0xffff);
22256 data[42] = String.fromCharCode (0x01ff);
22257 data[57] = String.fromCharCode (0x0001);
22258 data[58] = String.fromCharCode (0xf000);
22259 data[59] = String.fromCharCode (0xffff);
22260 data[60] = String.fromCharCode (0x7fff);
22261 data[61] = 'c';
22262 data[62] = String.fromCharCode (0xaaa8);
22263 data[63] = String.fromCharCode (0x0007);
22264 data[67] = String.fromCharCode (0xffff);
22265 data[68] = String.fromCharCode (0xffff);
22266 data[69] = String.fromCharCode (0xdffe);
22267 data[70] = String.fromCharCode (0xaaaa);
22268 data[71] = String.fromCharCode (0xaaaa);
22269 data[72] = String.fromCharCode (0x0002);
22270 data[73] = String.fromCharCode (0xaaaa);
22271 data[74] = String.fromCharCode (0xaaaa);
22272 data[75] = String.fromCharCode (0xaaaa);
22273 data[76] = String.fromCharCode (0x1114);
22274 data[77] = String.fromCharCode (0xaaaa);
22275 data[78] = String.fromCharCode (0x8aaa);
22276 data[79] = String.fromCharCode (0x022a);
22277 data[86] = String.fromCharCode (0xfffe);
22278 data[87] = String.fromCharCode (0xffff);
22279 data[88] = String.fromCharCode (0x00ff);
22280 data[269] = String.fromCharCode (0xffff);
22281 data[270] = String.fromCharCode (0xffff);
22282 data[271] = String.fromCharCode (0x007f);
22283 data[480] = String.fromCharCode (0xaaaa);
22284 data[481] = String.fromCharCode (0xaaaa);
22285 data[482] = String.fromCharCode (0xaaaa);
22286 data[483] = String.fromCharCode (0xaaaa);
22287 data[484] = String.fromCharCode (0xaaaa);
22288 data[485] = String.fromCharCode (0xaaaa);
22289 data[486] = String.fromCharCode (0xaaaa);
22290 data[487] = String.fromCharCode (0xaaaa);
22291 data[488] = String.fromCharCode (0xaaaa);
22292 data[489] = String.fromCharCode (0x0fea);
22293 data[490] = String.fromCharCode (0xaaaa);
22294 data[491] = String.fromCharCode (0xaaaa);
22295 data[492] = String.fromCharCode (0xaaaa);
22296 data[493] = String.fromCharCode (0xaaaa);
22297 data[494] = String.fromCharCode (0xaaaa);
22298 data[495] = String.fromCharCode (0x02aa);
22299 data[496] = String.fromCharCode (0x00ff);
22300 data[497] = String.fromCharCode (0x003f);
22301 data[498] = String.fromCharCode (0x00ff);
22302 data[499] = String.fromCharCode (0x00ff);
22303 data[500] = String.fromCharCode (0x003f);
22304 data[501] = String.fromCharCode (0x00ff);
22305 data[502] = String.fromCharCode (0x00ff);
22306 data[503] = String.fromCharCode (0x3fff);
22307 data[504] = String.fromCharCode (0x00ff);
22308 data[505] = String.fromCharCode (0x00ff);
22309 data[506] = String.fromCharCode (0x00ff);
22310 data[507] = String.fromCharCode (0x00df);
22311 data[508] = String.fromCharCode (0x00dc);
22312 data[509] = String.fromCharCode (0x00cf);
22313 data[510] = String.fromCharCode (0x00ff);
22314 data[511] = String.fromCharCode (0x00dc);
22315 data[519] = String.fromCharCode (0x8000);
22316 data[528] = String.fromCharCode (0xc400);
22317 data[529] = String.fromCharCode (0x0008);
22318 data[530] = String.fromCharCode (0xc000);
22319 data[531] = String.fromCharCode (0x0010);
22320 data[4016] = String.fromCharCode (0x007f);
22321 data[4017] = String.fromCharCode (0x00f8);
22322 data[4084] = String.fromCharCode (0xfffe);
22323 data[4085] = String.fromCharCode (0x07ff);
22324 data[4102] = String.fromCharCode (0xfffe);
22325 data[4103] = String.fromCharCode (0x07ff);
22326 data[4106] = String.fromCharCode (0x0400);
22327 data[4107] = String.fromCharCode (0x0420);
22328 data[4109] = String.fromCharCode (0x8000);
22329 data[4110] = String.fromCharCode (0xffff);
22330 data[4111] = String.fromCharCode (0xff7f);
22331 data[4112] = String.fromCharCode (0xaaaa);
22332 data[4113] = String.fromCharCode (0xaaaa);
22333 data[4114] = String.fromCharCode (0xaaaa);
22334 data[4115] = String.fromCharCode (0x55aa);
22335 data[4116] = String.fromCharCode (0xab55);
22336 data[4117] = String.fromCharCode (0xaaaa);
22337 data[4118] = String.fromCharCode (0xaaaa);
22338 data[4119] = String.fromCharCode (0xd4aa);
22339 data[4120] = String.fromCharCode (0x3129);
22340 data[4121] = String.fromCharCode (0x4e24);
22341 data[4122] = String.fromCharCode (0x292a);
22342 data[4123] = String.fromCharCode (0x2651);
22343 data[4124] = String.fromCharCode (0x5240);
22344 data[4125] = String.fromCharCode (0xb555);
22345 data[4126] = String.fromCharCode (0xaaaa);
22346 data[4127] = String.fromCharCode (0xa829);
22347 data[4128] = String.fromCharCode (0xaaaa);
22348 data[4129] = String.fromCharCode (0x00aa);
22349 data[4133] = String.fromCharCode (0xffff);
22350 data[4134] = String.fromCharCode (0xffff);
22351 data[4135] = String.fromCharCode (0xffff);
22352 data[4136] = String.fromCharCode (0xffff);
22353 data[4137] = String.fromCharCode (0xffff);
22354 data[4138] = String.fromCharCode (0x01ff);
22355 data[4153] = String.fromCharCode (0x0001);
22356 data[4154] = String.fromCharCode (0xf000);
22357 data[4155] = String.fromCharCode (0xffff);
22358 data[4156] = String.fromCharCode (0x7fff);
22359 data[4157] = 'c';
22360 data[4158] = String.fromCharCode (0x00a8);
22361 });
22362 c$.title_f = Clazz_defineMethod (c$, "title_f", 
22363 function () {
22364 var data =  Clazz_newCharArray (4159, '\0');
22365 com.stevesoft.pat.Bits.title =  new com.stevesoft.pat.Bits (data);
22366 data[6] = String.fromCharCode (0xfffe);
22367 data[7] = String.fromCharCode (0x07ff);
22368 data[10] = String.fromCharCode (0x0400);
22369 data[11] = String.fromCharCode (0x0420);
22370 data[13] = String.fromCharCode (0x8000);
22371 data[14] = String.fromCharCode (0xffff);
22372 data[15] = String.fromCharCode (0xff7f);
22373 data[16] = String.fromCharCode (0xaaaa);
22374 data[17] = String.fromCharCode (0xaaaa);
22375 data[18] = String.fromCharCode (0xaaaa);
22376 data[19] = String.fromCharCode (0x55aa);
22377 data[20] = String.fromCharCode (0xab55);
22378 data[21] = String.fromCharCode (0xaaaa);
22379 data[22] = String.fromCharCode (0xaaaa);
22380 data[23] = String.fromCharCode (0xd4aa);
22381 data[24] = String.fromCharCode (0x3129);
22382 data[25] = String.fromCharCode (0x4e24);
22383 data[26] = String.fromCharCode (0x292a);
22384 data[27] = String.fromCharCode (0x2651);
22385 data[28] = String.fromCharCode (0x5240);
22386 data[29] = String.fromCharCode (0xb555);
22387 data[30] = String.fromCharCode (0xaaaa);
22388 data[31] = String.fromCharCode (0xa829);
22389 data[32] = String.fromCharCode (0xaaaa);
22390 data[33] = String.fromCharCode (0x00aa);
22391 data[37] = String.fromCharCode (0xffff);
22392 data[38] = String.fromCharCode (0xffff);
22393 data[39] = String.fromCharCode (0xffff);
22394 data[40] = String.fromCharCode (0xffff);
22395 data[41] = String.fromCharCode (0xffff);
22396 data[42] = String.fromCharCode (0x01ff);
22397 data[57] = String.fromCharCode (0x0001);
22398 data[58] = String.fromCharCode (0xf000);
22399 data[59] = String.fromCharCode (0xffff);
22400 data[60] = String.fromCharCode (0x7fff);
22401 data[61] = 'c';
22402 data[62] = String.fromCharCode (0xaaa8);
22403 data[63] = String.fromCharCode (0x0007);
22404 data[67] = String.fromCharCode (0xffff);
22405 data[68] = String.fromCharCode (0xffff);
22406 data[69] = String.fromCharCode (0xdffe);
22407 data[70] = String.fromCharCode (0xaaaa);
22408 data[71] = String.fromCharCode (0xaaaa);
22409 data[72] = String.fromCharCode (0x0002);
22410 data[73] = String.fromCharCode (0xaaaa);
22411 data[74] = String.fromCharCode (0xaaaa);
22412 data[75] = String.fromCharCode (0xaaaa);
22413 data[76] = String.fromCharCode (0x1114);
22414 data[77] = String.fromCharCode (0xaaaa);
22415 data[78] = String.fromCharCode (0x8aaa);
22416 data[79] = String.fromCharCode (0x022a);
22417 data[86] = String.fromCharCode (0xfffe);
22418 data[87] = String.fromCharCode (0xffff);
22419 data[88] = String.fromCharCode (0x00ff);
22420 data[269] = String.fromCharCode (0xffff);
22421 data[270] = String.fromCharCode (0xffff);
22422 data[271] = String.fromCharCode (0x007f);
22423 data[480] = String.fromCharCode (0xaaaa);
22424 data[481] = String.fromCharCode (0xaaaa);
22425 data[482] = String.fromCharCode (0xaaaa);
22426 data[483] = String.fromCharCode (0xaaaa);
22427 data[484] = String.fromCharCode (0xaaaa);
22428 data[485] = String.fromCharCode (0xaaaa);
22429 data[486] = String.fromCharCode (0xaaaa);
22430 data[487] = String.fromCharCode (0xaaaa);
22431 data[488] = String.fromCharCode (0xaaaa);
22432 data[489] = String.fromCharCode (0x0fea);
22433 data[490] = String.fromCharCode (0xaaaa);
22434 data[491] = String.fromCharCode (0xaaaa);
22435 data[492] = String.fromCharCode (0xaaaa);
22436 data[493] = String.fromCharCode (0xaaaa);
22437 data[494] = String.fromCharCode (0xaaaa);
22438 data[495] = String.fromCharCode (0x02aa);
22439 data[496] = String.fromCharCode (0x00ff);
22440 data[497] = String.fromCharCode (0x003f);
22441 data[498] = String.fromCharCode (0x00ff);
22442 data[499] = String.fromCharCode (0x00ff);
22443 data[500] = String.fromCharCode (0x003f);
22444 data[501] = String.fromCharCode (0x00ff);
22445 data[502] = String.fromCharCode (0x00ff);
22446 data[503] = String.fromCharCode (0x3fff);
22447 data[504] = String.fromCharCode (0x00ff);
22448 data[505] = String.fromCharCode (0x00ff);
22449 data[506] = String.fromCharCode (0x00ff);
22450 data[507] = String.fromCharCode (0x00df);
22451 data[508] = String.fromCharCode (0x00dc);
22452 data[509] = String.fromCharCode (0x00cf);
22453 data[510] = String.fromCharCode (0x00ff);
22454 data[511] = String.fromCharCode (0x00dc);
22455 data[519] = String.fromCharCode (0x8000);
22456 data[528] = String.fromCharCode (0xc400);
22457 data[529] = String.fromCharCode (0x0008);
22458 data[530] = String.fromCharCode (0xc000);
22459 data[531] = String.fromCharCode (0x0010);
22460 data[4016] = String.fromCharCode (0x007f);
22461 data[4017] = String.fromCharCode (0x00f8);
22462 data[4084] = String.fromCharCode (0xfffe);
22463 data[4085] = String.fromCharCode (0x07ff);
22464 data[4102] = String.fromCharCode (0xfffe);
22465 data[4103] = String.fromCharCode (0x07ff);
22466 data[4106] = String.fromCharCode (0x0400);
22467 data[4107] = String.fromCharCode (0x0420);
22468 data[4109] = String.fromCharCode (0x8000);
22469 data[4110] = String.fromCharCode (0xffff);
22470 data[4111] = String.fromCharCode (0xff7f);
22471 data[4112] = String.fromCharCode (0xaaaa);
22472 data[4113] = String.fromCharCode (0xaaaa);
22473 data[4114] = String.fromCharCode (0xaaaa);
22474 data[4115] = String.fromCharCode (0x55aa);
22475 data[4116] = String.fromCharCode (0xab55);
22476 data[4117] = String.fromCharCode (0xaaaa);
22477 data[4118] = String.fromCharCode (0xaaaa);
22478 data[4119] = String.fromCharCode (0xd4aa);
22479 data[4120] = String.fromCharCode (0x3129);
22480 data[4121] = String.fromCharCode (0x4e24);
22481 data[4122] = String.fromCharCode (0x292a);
22482 data[4123] = String.fromCharCode (0x2651);
22483 data[4124] = String.fromCharCode (0x5240);
22484 data[4125] = String.fromCharCode (0xb555);
22485 data[4126] = String.fromCharCode (0xaaaa);
22486 data[4127] = String.fromCharCode (0xa829);
22487 data[4128] = String.fromCharCode (0xaaaa);
22488 data[4129] = String.fromCharCode (0x00aa);
22489 data[4133] = String.fromCharCode (0xffff);
22490 data[4134] = String.fromCharCode (0xffff);
22491 data[4135] = String.fromCharCode (0xffff);
22492 data[4136] = String.fromCharCode (0xffff);
22493 data[4137] = String.fromCharCode (0xffff);
22494 data[4138] = String.fromCharCode (0x01ff);
22495 data[4153] = String.fromCharCode (0x0001);
22496 data[4154] = String.fromCharCode (0xf000);
22497 data[4155] = String.fromCharCode (0xffff);
22498 data[4156] = String.fromCharCode (0x7fff);
22499 data[4157] = 'c';
22500 data[4158] = String.fromCharCode (0x00a8);
22501 });
22502 c$.currency_f = Clazz_defineMethod (c$, "currency_f", 
22503 function () {
22504 var data =  Clazz_newCharArray (4159, '\0');
22505 com.stevesoft.pat.Bits.currency =  new com.stevesoft.pat.Bits (data);
22506 data[2] = String.fromCharCode (0x0010);
22507 data[10] = String.fromCharCode (0x003c);
22508 data[159] = String.fromCharCode (0x000c);
22509 data[227] = String.fromCharCode (0x8000);
22510 data[522] = String.fromCharCode (0x1fff);
22511 data[4070] = String.fromCharCode (0x0200);
22512 data[4080] = String.fromCharCode (0x0010);
22513 data[4094] = 'c';
22514 data[4098] = String.fromCharCode (0x0010);
22515 data[4106] = String.fromCharCode (0x003c);
22516 });
22517 c$.decimal_digit_f = Clazz_defineMethod (c$, "decimal_digit_f", 
22518 function () {
22519 var data =  Clazz_newCharArray (4159, '\0');
22520 com.stevesoft.pat.Bits.decimal_digit =  new com.stevesoft.pat.Bits (data);
22521 data[3] = String.fromCharCode (0x03ff);
22522 data[102] = String.fromCharCode (0x03ff);
22523 data[111] = String.fromCharCode (0x03ff);
22524 data[150] = String.fromCharCode (0xffc0);
22525 data[158] = String.fromCharCode (0xffc0);
22526 data[166] = String.fromCharCode (0xffc0);
22527 data[174] = String.fromCharCode (0xffc0);
22528 data[182] = String.fromCharCode (0xffc0);
22529 data[190] = String.fromCharCode (0xff80);
22530 data[198] = String.fromCharCode (0xffc0);
22531 data[206] = String.fromCharCode (0xffc0);
22532 data[214] = String.fromCharCode (0xffc0);
22533 data[229] = String.fromCharCode (0x03ff);
22534 data[237] = String.fromCharCode (0x03ff);
22535 data[242] = String.fromCharCode (0x03ff);
22536 data[4081] = String.fromCharCode (0x03ff);
22537 data[4099] = String.fromCharCode (0x03ff);
22538 });
22539 c$.math_f = Clazz_defineMethod (c$, "math_f", 
22540 function () {
22541 var data =  Clazz_newCharArray (4159, '\0');
22542 com.stevesoft.pat.Bits.math =  new com.stevesoft.pat.Bits (data);
22543 data[2] = String.fromCharCode (0x0800);
22544 data[3] = String.fromCharCode (0x7000);
22545 data[7] = String.fromCharCode (0x5000);
22546 data[10] = String.fromCharCode (0x1000);
22547 data[11] = String.fromCharCode (0x0002);
22548 data[13] = String.fromCharCode (0x0080);
22549 data[15] = String.fromCharCode (0x0080);
22550 data[516] = String.fromCharCode (0x0010);
22551 data[519] = String.fromCharCode (0x1c00);
22552 data[520] = String.fromCharCode (0x1c00);
22553 data[537] = String.fromCharCode (0x001f);
22554 data[541] = String.fromCharCode (0x0014);
22555 data[544] = String.fromCharCode (0xffff);
22556 data[545] = String.fromCharCode (0xffff);
22557 data[546] = String.fromCharCode (0xffff);
22558 data[547] = String.fromCharCode (0xffff);
22559 data[548] = String.fromCharCode (0xffff);
22560 data[549] = String.fromCharCode (0xffff);
22561 data[550] = String.fromCharCode (0xffff);
22562 data[551] = String.fromCharCode (0xffff);
22563 data[552] = String.fromCharCode (0xffff);
22564 data[553] = String.fromCharCode (0xffff);
22565 data[554] = String.fromCharCode (0xffff);
22566 data[555] = String.fromCharCode (0xffff);
22567 data[556] = String.fromCharCode (0xffff);
22568 data[557] = String.fromCharCode (0xffff);
22569 data[558] = String.fromCharCode (0xffff);
22570 data[559] = String.fromCharCode (0x0003);
22571 data[560] = String.fromCharCode (0x0f00);
22572 data[562] = String.fromCharCode (0x0003);
22573 data[4018] = String.fromCharCode (0x0200);
22574 data[4070] = 't';
22575 data[4080] = String.fromCharCode (0x0800);
22576 data[4081] = String.fromCharCode (0x7000);
22577 data[4085] = String.fromCharCode (0x5000);
22578 data[4094] = String.fromCharCode (0x1f04);
22579 data[4098] = String.fromCharCode (0x0800);
22580 data[4099] = String.fromCharCode (0x7000);
22581 data[4103] = String.fromCharCode (0x5000);
22582 data[4106] = String.fromCharCode (0x1000);
22583 data[4107] = String.fromCharCode (0x0002);
22584 data[4109] = String.fromCharCode (0x0080);
22585 data[4111] = String.fromCharCode (0x0080);
22586 });
22587 c$.letter_f = Clazz_defineMethod (c$, "letter_f", 
22588 function () {
22589 var data =  Clazz_newCharArray (4159, '\0');
22590 com.stevesoft.pat.Bits.letter =  new com.stevesoft.pat.Bits (data);
22591 data[4] = String.fromCharCode (0xfffe);
22592 data[5] = String.fromCharCode (0x07ff);
22593 data[6] = String.fromCharCode (0xfffe);
22594 data[7] = String.fromCharCode (0x07ff);
22595 data[10] = String.fromCharCode (0x0400);
22596 data[11] = String.fromCharCode (0x0420);
22597 data[12] = String.fromCharCode (0xffff);
22598 data[13] = String.fromCharCode (0xff7f);
22599 data[14] = String.fromCharCode (0xffff);
22600 data[15] = String.fromCharCode (0xff7f);
22601 data[16] = String.fromCharCode (0xffff);
22602 data[17] = String.fromCharCode (0xffff);
22603 data[18] = String.fromCharCode (0xffff);
22604 data[19] = String.fromCharCode (0xffff);
22605 data[20] = String.fromCharCode (0xffff);
22606 data[21] = String.fromCharCode (0xffff);
22607 data[22] = String.fromCharCode (0xffff);
22608 data[23] = String.fromCharCode (0xffff);
22609 data[24] = String.fromCharCode (0xffff);
22610 data[25] = String.fromCharCode (0xffff);
22611 data[26] = String.fromCharCode (0xffff);
22612 data[27] = String.fromCharCode (0xffff);
22613 data[28] = String.fromCharCode (0xffff);
22614 data[29] = String.fromCharCode (0xffff);
22615 data[30] = String.fromCharCode (0xffff);
22616 data[31] = String.fromCharCode (0xfc3f);
22617 data[32] = String.fromCharCode (0xffff);
22618 data[33] = String.fromCharCode (0x00ff);
22619 data[37] = String.fromCharCode (0xffff);
22620 data[38] = String.fromCharCode (0xffff);
22621 data[39] = String.fromCharCode (0xffff);
22622 data[40] = String.fromCharCode (0xffff);
22623 data[41] = String.fromCharCode (0xffff);
22624 data[42] = String.fromCharCode (0x01ff);
22625 data[43] = String.fromCharCode (0xf9ff);
22626 data[44] = String.fromCharCode (0x0003);
22627 data[45] = String.fromCharCode (0x0003);
22628 data[46] = String.fromCharCode (0x001f);
22629 data[55] = String.fromCharCode (0x0400);
22630 data[56] = String.fromCharCode (0xd740);
22631 data[57] = String.fromCharCode (0xffff);
22632 data[58] = String.fromCharCode (0xfffb);
22633 data[59] = String.fromCharCode (0xffff);
22634 data[60] = String.fromCharCode (0x7fff);
22635 data[61] = String.fromCharCode (0x547f);
22636 data[62] = String.fromCharCode (0xfffd);
22637 data[63] = String.fromCharCode (0x000f);
22638 data[64] = String.fromCharCode (0xdffe);
22639 data[65] = String.fromCharCode (0xffff);
22640 data[66] = String.fromCharCode (0xffff);
22641 data[67] = String.fromCharCode (0xffff);
22642 data[68] = String.fromCharCode (0xffff);
22643 data[69] = String.fromCharCode (0xdffe);
22644 data[70] = String.fromCharCode (0xffff);
22645 data[71] = String.fromCharCode (0xffff);
22646 data[72] = String.fromCharCode (0x0003);
22647 data[73] = String.fromCharCode (0xffff);
22648 data[74] = String.fromCharCode (0xffff);
22649 data[75] = String.fromCharCode (0xffff);
22650 data[76] = String.fromCharCode (0x199f);
22651 data[77] = String.fromCharCode (0xffff);
22652 data[78] = String.fromCharCode (0xcfff);
22653 data[79] = String.fromCharCode (0x033f);
22654 data[83] = String.fromCharCode (0xfffe);
22655 data[84] = String.fromCharCode (0xffff);
22656 data[85] = String.fromCharCode (0x027f);
22657 data[86] = String.fromCharCode (0xfffe);
22658 data[87] = String.fromCharCode (0xffff);
22659 data[88] = String.fromCharCode (0x00ff);
22660 data[93] = String.fromCharCode (0xffff);
22661 data[94] = String.fromCharCode (0x07ff);
22662 data[95] = String.fromCharCode (0x0007);
22663 data[98] = String.fromCharCode (0xfffe);
22664 data[99] = String.fromCharCode (0x07ff);
22665 data[100] = String.fromCharCode (0x07ff);
22666 data[103] = String.fromCharCode (0xfffe);
22667 data[104] = String.fromCharCode (0xffff);
22668 data[105] = String.fromCharCode (0xffff);
22669 data[106] = String.fromCharCode (0xffff);
22670 data[107] = String.fromCharCode (0x7cff);
22671 data[108] = String.fromCharCode (0x7fff);
22672 data[109] = String.fromCharCode (0x002f);
22673 data[110] = String.fromCharCode (0x0060);
22674 data[144] = String.fromCharCode (0xffe0);
22675 data[145] = String.fromCharCode (0xffff);
22676 data[146] = String.fromCharCode (0xffff);
22677 data[147] = String.fromCharCode (0x23ff);
22678 data[149] = String.fromCharCode (0xff00);
22679 data[150] = String.fromCharCode (0x0003);
22680 data[152] = String.fromCharCode (0x9fe0);
22681 data[153] = String.fromCharCode (0xfff9);
22682 data[154] = String.fromCharCode (0xfdff);
22683 data[155] = String.fromCharCode (0x03c5);
22684 data[157] = String.fromCharCode (0xb000);
22685 data[158] = String.fromCharCode (0x0003);
22686 data[159] = String.fromCharCode (0x0003);
22687 data[160] = String.fromCharCode (0x87e0);
22688 data[161] = String.fromCharCode (0xfff9);
22689 data[162] = String.fromCharCode (0xfdff);
22690 data[163] = String.fromCharCode (0x036d);
22691 data[165] = String.fromCharCode (0x5e00);
22692 data[167] = String.fromCharCode (0x001c);
22693 data[168] = String.fromCharCode (0xafe0);
22694 data[169] = String.fromCharCode (0xfffb);
22695 data[170] = String.fromCharCode (0xfdff);
22696 data[171] = String.fromCharCode (0x23ed);
22697 data[174] = String.fromCharCode (0x0001);
22698 data[176] = String.fromCharCode (0x9fe0);
22699 data[177] = String.fromCharCode (0xfff9);
22700 data[178] = String.fromCharCode (0xfdff);
22701 data[179] = String.fromCharCode (0x23cd);
22702 data[181] = String.fromCharCode (0xb000);
22703 data[182] = String.fromCharCode (0x0003);
22704 data[184] = String.fromCharCode (0xc7e0);
22705 data[185] = String.fromCharCode (0xd63d);
22706 data[186] = String.fromCharCode (0xc718);
22707 data[187] = String.fromCharCode (0x03bf);
22708 data[192] = String.fromCharCode (0xdfe0);
22709 data[193] = String.fromCharCode (0xfffd);
22710 data[194] = String.fromCharCode (0xfdff);
22711 data[195] = String.fromCharCode (0x03ef);
22712 data[198] = String.fromCharCode (0x0003);
22713 data[200] = String.fromCharCode (0xdfe0);
22714 data[201] = String.fromCharCode (0xfffd);
22715 data[202] = String.fromCharCode (0xfdff);
22716 data[203] = String.fromCharCode (0x03ef);
22717 data[205] = String.fromCharCode (0x4000);
22718 data[206] = String.fromCharCode (0x0003);
22719 data[208] = String.fromCharCode (0xdfe0);
22720 data[209] = String.fromCharCode (0xfffd);
22721 data[210] = String.fromCharCode (0xfdff);
22722 data[211] = String.fromCharCode (0x03ff);
22723 data[214] = String.fromCharCode (0x0003);
22724 data[224] = String.fromCharCode (0xfffe);
22725 data[225] = String.fromCharCode (0xffff);
22726 data[226] = String.fromCharCode (0x7fff);
22727 data[227] = String.fromCharCode (0x000d);
22728 data[228] = String.fromCharCode (0x007f);
22729 data[232] = String.fromCharCode (0x2596);
22730 data[233] = String.fromCharCode (0xfef0);
22731 data[234] = String.fromCharCode (0x6cae);
22732 data[235] = String.fromCharCode (0x200d);
22733 data[236] = String.fromCharCode (0x005f);
22734 data[237] = String.fromCharCode (0x3000);
22735 data[244] = String.fromCharCode (0xfeff);
22736 data[245] = String.fromCharCode (0xffff);
22737 data[246] = String.fromCharCode (0x03ff);
22738 data[266] = String.fromCharCode (0xffff);
22739 data[267] = String.fromCharCode (0xffff);
22740 data[268] = String.fromCharCode (0x003f);
22741 data[269] = String.fromCharCode (0xffff);
22742 data[270] = String.fromCharCode (0xffff);
22743 data[271] = String.fromCharCode (0x007f);
22744 data[272] = String.fromCharCode (0xffff);
22745 data[273] = String.fromCharCode (0xffff);
22746 data[274] = String.fromCharCode (0xffff);
22747 data[275] = String.fromCharCode (0xffff);
22748 data[276] = String.fromCharCode (0xffff);
22749 data[277] = String.fromCharCode (0x83ff);
22750 data[278] = String.fromCharCode (0xffff);
22751 data[279] = String.fromCharCode (0xffff);
22752 data[280] = String.fromCharCode (0xffff);
22753 data[281] = String.fromCharCode (0xffff);
22754 data[282] = String.fromCharCode (0xff07);
22755 data[283] = String.fromCharCode (0xffff);
22756 data[284] = String.fromCharCode (0xffff);
22757 data[285] = String.fromCharCode (0xffff);
22758 data[286] = String.fromCharCode (0xffff);
22759 data[287] = String.fromCharCode (0x03ff);
22760 data[480] = String.fromCharCode (0xffff);
22761 data[481] = String.fromCharCode (0xffff);
22762 data[482] = String.fromCharCode (0xffff);
22763 data[483] = String.fromCharCode (0xffff);
22764 data[484] = String.fromCharCode (0xffff);
22765 data[485] = String.fromCharCode (0xffff);
22766 data[486] = String.fromCharCode (0xffff);
22767 data[487] = String.fromCharCode (0xffff);
22768 data[488] = String.fromCharCode (0xffff);
22769 data[489] = String.fromCharCode (0x0fff);
22770 data[490] = String.fromCharCode (0xffff);
22771 data[491] = String.fromCharCode (0xffff);
22772 data[492] = String.fromCharCode (0xffff);
22773 data[493] = String.fromCharCode (0xffff);
22774 data[494] = String.fromCharCode (0xffff);
22775 data[495] = String.fromCharCode (0x03ff);
22776 data[496] = String.fromCharCode (0xffff);
22777 data[497] = String.fromCharCode (0x3f3f);
22778 data[498] = String.fromCharCode (0xffff);
22779 data[499] = String.fromCharCode (0xffff);
22780 data[500] = String.fromCharCode (0x3f3f);
22781 data[501] = String.fromCharCode (0xaaff);
22782 data[502] = String.fromCharCode (0xffff);
22783 data[503] = String.fromCharCode (0x3fff);
22784 data[504] = String.fromCharCode (0xffff);
22785 data[505] = String.fromCharCode (0xffff);
22786 data[506] = String.fromCharCode (0xffff);
22787 data[507] = String.fromCharCode (0x5fdf);
22788 data[508] = String.fromCharCode (0x1fdc);
22789 data[509] = String.fromCharCode (0x0fcf);
22790 data[510] = String.fromCharCode (0x1fff);
22791 data[511] = String.fromCharCode (0x1fdc);
22792 data[519] = String.fromCharCode (0x8000);
22793 data[528] = String.fromCharCode (0xfc84);
22794 data[529] = String.fromCharCode (0x3f2f);
22795 data[530] = String.fromCharCode (0xfd50);
22796 data[531] = String.fromCharCode (0x01fb);
22797 data[768] = String.fromCharCode (0x0020);
22798 data[771] = String.fromCharCode (0x003e);
22799 data[772] = String.fromCharCode (0xfffe);
22800 data[773] = String.fromCharCode (0xffff);
22801 data[774] = String.fromCharCode (0xffff);
22802 data[775] = String.fromCharCode (0xffff);
22803 data[776] = String.fromCharCode (0xffff);
22804 data[777] = String.fromCharCode (0x781f);
22805 data[778] = String.fromCharCode (0xfffe);
22806 data[779] = String.fromCharCode (0xffff);
22807 data[780] = String.fromCharCode (0xffff);
22808 data[781] = String.fromCharCode (0xffff);
22809 data[782] = String.fromCharCode (0xffff);
22810 data[783] = String.fromCharCode (0x77ff);
22811 data[784] = String.fromCharCode (0xffe0);
22812 data[785] = String.fromCharCode (0xffff);
22813 data[786] = String.fromCharCode (0x1fff);
22814 data[787] = String.fromCharCode (0xfffe);
22815 data[788] = String.fromCharCode (0xffff);
22816 data[789] = String.fromCharCode (0xffff);
22817 data[790] = String.fromCharCode (0xffff);
22818 data[791] = String.fromCharCode (0xffff);
22819 data[792] = String.fromCharCode (0x7fff);
22820 data[1248] = String.fromCharCode (0xffff);
22821 data[1249] = String.fromCharCode (0xffff);
22822 data[1250] = String.fromCharCode (0xffff);
22823 data[1251] = String.fromCharCode (0xffff);
22824 data[1252] = String.fromCharCode (0xffff);
22825 data[1253] = String.fromCharCode (0xffff);
22826 data[1254] = String.fromCharCode (0xffff);
22827 data[1255] = String.fromCharCode (0xffff);
22828 data[1256] = String.fromCharCode (0xffff);
22829 data[1257] = String.fromCharCode (0xffff);
22830 data[1258] = String.fromCharCode (0xffff);
22831 data[1259] = String.fromCharCode (0xffff);
22832 data[1260] = String.fromCharCode (0xffff);
22833 data[1261] = String.fromCharCode (0xffff);
22834 data[1262] = String.fromCharCode (0xffff);
22835 data[1263] = String.fromCharCode (0xffff);
22836 data[1264] = String.fromCharCode (0xffff);
22837 data[1265] = String.fromCharCode (0xffff);
22838 data[1266] = String.fromCharCode (0xffff);
22839 data[1267] = String.fromCharCode (0xffff);
22840 data[1268] = String.fromCharCode (0xffff);
22841 data[1269] = String.fromCharCode (0xffff);
22842 data[1270] = String.fromCharCode (0xffff);
22843 data[1271] = String.fromCharCode (0xffff);
22844 data[1272] = String.fromCharCode (0xffff);
22845 data[1273] = String.fromCharCode (0xffff);
22846 data[1274] = String.fromCharCode (0xffff);
22847 data[1275] = String.fromCharCode (0xffff);
22848 data[1276] = String.fromCharCode (0xffff);
22849 data[1277] = String.fromCharCode (0xffff);
22850 data[1278] = String.fromCharCode (0xffff);
22851 data[1279] = String.fromCharCode (0xffff);
22852 data[1280] = String.fromCharCode (0xffff);
22853 data[1281] = String.fromCharCode (0xffff);
22854 data[1282] = String.fromCharCode (0xffff);
22855 data[1283] = String.fromCharCode (0xffff);
22856 data[1284] = String.fromCharCode (0xffff);
22857 data[1285] = String.fromCharCode (0xffff);
22858 data[1286] = String.fromCharCode (0xffff);
22859 data[1287] = String.fromCharCode (0xffff);
22860 data[1288] = String.fromCharCode (0xffff);
22861 data[1289] = String.fromCharCode (0xffff);
22862 data[1290] = String.fromCharCode (0xffff);
22863 data[1291] = String.fromCharCode (0xffff);
22864 data[1292] = String.fromCharCode (0xffff);
22865 data[1293] = String.fromCharCode (0xffff);
22866 data[1294] = String.fromCharCode (0xffff);
22867 data[1295] = String.fromCharCode (0xffff);
22868 data[1296] = String.fromCharCode (0xffff);
22869 data[1297] = String.fromCharCode (0xffff);
22870 data[1298] = String.fromCharCode (0xffff);
22871 data[1299] = String.fromCharCode (0xffff);
22872 data[1300] = String.fromCharCode (0xffff);
22873 data[1301] = String.fromCharCode (0xffff);
22874 data[1302] = String.fromCharCode (0xffff);
22875 data[1303] = String.fromCharCode (0xffff);
22876 data[1304] = String.fromCharCode (0xffff);
22877 data[1305] = String.fromCharCode (0xffff);
22878 data[1306] = String.fromCharCode (0xffff);
22879 data[1307] = String.fromCharCode (0xffff);
22880 data[1308] = String.fromCharCode (0xffff);
22881 data[1309] = String.fromCharCode (0xffff);
22882 data[1310] = String.fromCharCode (0xffff);
22883 data[1311] = String.fromCharCode (0xffff);
22884 data[1312] = String.fromCharCode (0xffff);
22885 data[1313] = String.fromCharCode (0xffff);
22886 data[1314] = String.fromCharCode (0xffff);
22887 data[1315] = String.fromCharCode (0xffff);
22888 data[1316] = String.fromCharCode (0xffff);
22889 data[1317] = String.fromCharCode (0xffff);
22890 data[1318] = String.fromCharCode (0xffff);
22891 data[1319] = String.fromCharCode (0xffff);
22892 data[1320] = String.fromCharCode (0xffff);
22893 data[1321] = String.fromCharCode (0xffff);
22894 data[1322] = String.fromCharCode (0xffff);
22895 data[1323] = String.fromCharCode (0xffff);
22896 data[1324] = String.fromCharCode (0xffff);
22897 data[1325] = String.fromCharCode (0xffff);
22898 data[1326] = String.fromCharCode (0xffff);
22899 data[1327] = String.fromCharCode (0xffff);
22900 data[1328] = String.fromCharCode (0xffff);
22901 data[1329] = String.fromCharCode (0xffff);
22902 data[1330] = String.fromCharCode (0xffff);
22903 data[1331] = String.fromCharCode (0xffff);
22904 data[1332] = String.fromCharCode (0xffff);
22905 data[1333] = String.fromCharCode (0xffff);
22906 data[1334] = String.fromCharCode (0xffff);
22907 data[1335] = String.fromCharCode (0xffff);
22908 data[1336] = String.fromCharCode (0xffff);
22909 data[1337] = String.fromCharCode (0xffff);
22910 data[1338] = String.fromCharCode (0xffff);
22911 data[1339] = String.fromCharCode (0xffff);
22912 data[1340] = String.fromCharCode (0xffff);
22913 data[1341] = String.fromCharCode (0xffff);
22914 data[1342] = String.fromCharCode (0xffff);
22915 data[1343] = String.fromCharCode (0xffff);
22916 data[1344] = String.fromCharCode (0xffff);
22917 data[1345] = String.fromCharCode (0xffff);
22918 data[1346] = String.fromCharCode (0xffff);
22919 data[1347] = String.fromCharCode (0xffff);
22920 data[1348] = String.fromCharCode (0xffff);
22921 data[1349] = String.fromCharCode (0xffff);
22922 data[1350] = String.fromCharCode (0xffff);
22923 data[1351] = String.fromCharCode (0xffff);
22924 data[1352] = String.fromCharCode (0xffff);
22925 data[1353] = String.fromCharCode (0xffff);
22926 data[1354] = String.fromCharCode (0xffff);
22927 data[1355] = String.fromCharCode (0xffff);
22928 data[1356] = String.fromCharCode (0xffff);
22929 data[1357] = String.fromCharCode (0xffff);
22930 data[1358] = String.fromCharCode (0xffff);
22931 data[1359] = String.fromCharCode (0xffff);
22932 data[1360] = String.fromCharCode (0xffff);
22933 data[1361] = String.fromCharCode (0xffff);
22934 data[1362] = String.fromCharCode (0xffff);
22935 data[1363] = String.fromCharCode (0xffff);
22936 data[1364] = String.fromCharCode (0xffff);
22937 data[1365] = String.fromCharCode (0xffff);
22938 data[1366] = String.fromCharCode (0xffff);
22939 data[1367] = String.fromCharCode (0xffff);
22940 data[1368] = String.fromCharCode (0xffff);
22941 data[1369] = String.fromCharCode (0xffff);
22942 data[1370] = String.fromCharCode (0xffff);
22943 data[1371] = String.fromCharCode (0xffff);
22944 data[1372] = String.fromCharCode (0xffff);
22945 data[1373] = String.fromCharCode (0xffff);
22946 data[1374] = String.fromCharCode (0xffff);
22947 data[1375] = String.fromCharCode (0xffff);
22948 data[1376] = String.fromCharCode (0xffff);
22949 data[1377] = String.fromCharCode (0xffff);
22950 data[1378] = String.fromCharCode (0xffff);
22951 data[1379] = String.fromCharCode (0xffff);
22952 data[1380] = String.fromCharCode (0xffff);
22953 data[1381] = String.fromCharCode (0xffff);
22954 data[1382] = String.fromCharCode (0xffff);
22955 data[1383] = String.fromCharCode (0xffff);
22956 data[1384] = String.fromCharCode (0xffff);
22957 data[1385] = String.fromCharCode (0xffff);
22958 data[1386] = String.fromCharCode (0xffff);
22959 data[1387] = String.fromCharCode (0xffff);
22960 data[1388] = String.fromCharCode (0xffff);
22961 data[1389] = String.fromCharCode (0xffff);
22962 data[1390] = String.fromCharCode (0xffff);
22963 data[1391] = String.fromCharCode (0xffff);
22964 data[1392] = String.fromCharCode (0xffff);
22965 data[1393] = String.fromCharCode (0xffff);
22966 data[1394] = String.fromCharCode (0xffff);
22967 data[1395] = String.fromCharCode (0xffff);
22968 data[1396] = String.fromCharCode (0xffff);
22969 data[1397] = String.fromCharCode (0xffff);
22970 data[1398] = String.fromCharCode (0xffff);
22971 data[1399] = String.fromCharCode (0xffff);
22972 data[1400] = String.fromCharCode (0xffff);
22973 data[1401] = String.fromCharCode (0xffff);
22974 data[1402] = String.fromCharCode (0xffff);
22975 data[1403] = String.fromCharCode (0xffff);
22976 data[1404] = String.fromCharCode (0xffff);
22977 data[1405] = String.fromCharCode (0xffff);
22978 data[1406] = String.fromCharCode (0xffff);
22979 data[1407] = String.fromCharCode (0xffff);
22980 data[1408] = String.fromCharCode (0xffff);
22981 data[1409] = String.fromCharCode (0xffff);
22982 data[1410] = String.fromCharCode (0xffff);
22983 data[1411] = String.fromCharCode (0xffff);
22984 data[1412] = String.fromCharCode (0xffff);
22985 data[1413] = String.fromCharCode (0xffff);
22986 data[1414] = String.fromCharCode (0xffff);
22987 data[1415] = String.fromCharCode (0xffff);
22988 data[1416] = String.fromCharCode (0xffff);
22989 data[1417] = String.fromCharCode (0xffff);
22990 data[1418] = String.fromCharCode (0xffff);
22991 data[1419] = String.fromCharCode (0xffff);
22992 data[1420] = String.fromCharCode (0xffff);
22993 data[1421] = String.fromCharCode (0xffff);
22994 data[1422] = String.fromCharCode (0xffff);
22995 data[1423] = String.fromCharCode (0xffff);
22996 data[1424] = String.fromCharCode (0xffff);
22997 data[1425] = String.fromCharCode (0xffff);
22998 data[1426] = String.fromCharCode (0xffff);
22999 data[1427] = String.fromCharCode (0xffff);
23000 data[1428] = String.fromCharCode (0xffff);
23001 data[1429] = String.fromCharCode (0xffff);
23002 data[1430] = String.fromCharCode (0xffff);
23003 data[1431] = String.fromCharCode (0xffff);
23004 data[1432] = String.fromCharCode (0xffff);
23005 data[1433] = String.fromCharCode (0xffff);
23006 data[1434] = String.fromCharCode (0xffff);
23007 data[1435] = String.fromCharCode (0xffff);
23008 data[1436] = String.fromCharCode (0xffff);
23009 data[1437] = String.fromCharCode (0xffff);
23010 data[1438] = String.fromCharCode (0xffff);
23011 data[1439] = String.fromCharCode (0xffff);
23012 data[1440] = String.fromCharCode (0xffff);
23013 data[1441] = String.fromCharCode (0xffff);
23014 data[1442] = String.fromCharCode (0xffff);
23015 data[1443] = String.fromCharCode (0xffff);
23016 data[1444] = String.fromCharCode (0xffff);
23017 data[1445] = String.fromCharCode (0xffff);
23018 data[1446] = String.fromCharCode (0xffff);
23019 data[1447] = String.fromCharCode (0xffff);
23020 data[1448] = String.fromCharCode (0xffff);
23021 data[1449] = String.fromCharCode (0xffff);
23022 data[1450] = String.fromCharCode (0xffff);
23023 data[1451] = String.fromCharCode (0xffff);
23024 data[1452] = String.fromCharCode (0xffff);
23025 data[1453] = String.fromCharCode (0xffff);
23026 data[1454] = String.fromCharCode (0xffff);
23027 data[1455] = String.fromCharCode (0xffff);
23028 data[1456] = String.fromCharCode (0xffff);
23029 data[1457] = String.fromCharCode (0xffff);
23030 data[1458] = String.fromCharCode (0xffff);
23031 data[1459] = String.fromCharCode (0xffff);
23032 data[1460] = String.fromCharCode (0xffff);
23033 data[1461] = String.fromCharCode (0xffff);
23034 data[1462] = String.fromCharCode (0xffff);
23035 data[1463] = String.fromCharCode (0xffff);
23036 data[1464] = String.fromCharCode (0xffff);
23037 data[1465] = String.fromCharCode (0xffff);
23038 data[1466] = String.fromCharCode (0xffff);
23039 data[1467] = String.fromCharCode (0xffff);
23040 data[1468] = String.fromCharCode (0xffff);
23041 data[1469] = String.fromCharCode (0xffff);
23042 data[1470] = String.fromCharCode (0xffff);
23043 data[1471] = String.fromCharCode (0xffff);
23044 data[1472] = String.fromCharCode (0xffff);
23045 data[1473] = String.fromCharCode (0xffff);
23046 data[1474] = String.fromCharCode (0xffff);
23047 data[1475] = String.fromCharCode (0xffff);
23048 data[1476] = String.fromCharCode (0xffff);
23049 data[1477] = String.fromCharCode (0xffff);
23050 data[1478] = String.fromCharCode (0xffff);
23051 data[1479] = String.fromCharCode (0xffff);
23052 data[1480] = String.fromCharCode (0xffff);
23053 data[1481] = String.fromCharCode (0xffff);
23054 data[1482] = String.fromCharCode (0xffff);
23055 data[1483] = String.fromCharCode (0xffff);
23056 data[1484] = String.fromCharCode (0xffff);
23057 data[1485] = String.fromCharCode (0xffff);
23058 data[1486] = String.fromCharCode (0xffff);
23059 data[1487] = String.fromCharCode (0xffff);
23060 data[1488] = String.fromCharCode (0xffff);
23061 data[1489] = String.fromCharCode (0xffff);
23062 data[1490] = String.fromCharCode (0xffff);
23063 data[1491] = String.fromCharCode (0xffff);
23064 data[1492] = String.fromCharCode (0xffff);
23065 data[1493] = String.fromCharCode (0xffff);
23066 data[1494] = String.fromCharCode (0xffff);
23067 data[1495] = String.fromCharCode (0xffff);
23068 data[1496] = String.fromCharCode (0xffff);
23069 data[1497] = String.fromCharCode (0xffff);
23070 data[1498] = String.fromCharCode (0xffff);
23071 data[1499] = String.fromCharCode (0xffff);
23072 data[1500] = String.fromCharCode (0xffff);
23073 data[1501] = String.fromCharCode (0xffff);
23074 data[1502] = String.fromCharCode (0xffff);
23075 data[1503] = String.fromCharCode (0xffff);
23076 data[1504] = String.fromCharCode (0xffff);
23077 data[1505] = String.fromCharCode (0xffff);
23078 data[1506] = String.fromCharCode (0xffff);
23079 data[1507] = String.fromCharCode (0xffff);
23080 data[1508] = String.fromCharCode (0xffff);
23081 data[1509] = String.fromCharCode (0xffff);
23082 data[1510] = String.fromCharCode (0xffff);
23083 data[1511] = String.fromCharCode (0xffff);
23084 data[1512] = String.fromCharCode (0xffff);
23085 data[1513] = String.fromCharCode (0xffff);
23086 data[1514] = String.fromCharCode (0xffff);
23087 data[1515] = String.fromCharCode (0xffff);
23088 data[1516] = String.fromCharCode (0xffff);
23089 data[1517] = String.fromCharCode (0xffff);
23090 data[1518] = String.fromCharCode (0xffff);
23091 data[1519] = String.fromCharCode (0xffff);
23092 data[1520] = String.fromCharCode (0xffff);
23093 data[1521] = String.fromCharCode (0xffff);
23094 data[1522] = String.fromCharCode (0xffff);
23095 data[1523] = String.fromCharCode (0xffff);
23096 data[1524] = String.fromCharCode (0xffff);
23097 data[1525] = String.fromCharCode (0xffff);
23098 data[1526] = String.fromCharCode (0xffff);
23099 data[1527] = String.fromCharCode (0xffff);
23100 data[1528] = String.fromCharCode (0xffff);
23101 data[1529] = String.fromCharCode (0xffff);
23102 data[1530] = String.fromCharCode (0xffff);
23103 data[1531] = String.fromCharCode (0xffff);
23104 data[1532] = String.fromCharCode (0xffff);
23105 data[1533] = String.fromCharCode (0xffff);
23106 data[1534] = String.fromCharCode (0xffff);
23107 data[1535] = String.fromCharCode (0xffff);
23108 data[1536] = String.fromCharCode (0xffff);
23109 data[1537] = String.fromCharCode (0xffff);
23110 data[1538] = String.fromCharCode (0xffff);
23111 data[1539] = String.fromCharCode (0xffff);
23112 data[1540] = String.fromCharCode (0xffff);
23113 data[1541] = String.fromCharCode (0xffff);
23114 data[1542] = String.fromCharCode (0xffff);
23115 data[1543] = String.fromCharCode (0xffff);
23116 data[1544] = String.fromCharCode (0xffff);
23117 data[1545] = String.fromCharCode (0xffff);
23118 data[1546] = String.fromCharCode (0xffff);
23119 data[1547] = String.fromCharCode (0xffff);
23120 data[1548] = String.fromCharCode (0xffff);
23121 data[1549] = String.fromCharCode (0xffff);
23122 data[1550] = String.fromCharCode (0xffff);
23123 data[1551] = String.fromCharCode (0xffff);
23124 data[1552] = String.fromCharCode (0xffff);
23125 data[1553] = String.fromCharCode (0xffff);
23126 data[1554] = String.fromCharCode (0xffff);
23127 data[1555] = String.fromCharCode (0xffff);
23128 data[1556] = String.fromCharCode (0xffff);
23129 data[1557] = String.fromCharCode (0xffff);
23130 data[1558] = String.fromCharCode (0xffff);
23131 data[1559] = String.fromCharCode (0xffff);
23132 data[1560] = String.fromCharCode (0xffff);
23133 data[1561] = String.fromCharCode (0xffff);
23134 data[1562] = String.fromCharCode (0xffff);
23135 data[1563] = String.fromCharCode (0xffff);
23136 data[1564] = String.fromCharCode (0xffff);
23137 data[1565] = String.fromCharCode (0xffff);
23138 data[1566] = String.fromCharCode (0xffff);
23139 data[1567] = String.fromCharCode (0xffff);
23140 data[1568] = String.fromCharCode (0xffff);
23141 data[1569] = String.fromCharCode (0xffff);
23142 data[1570] = String.fromCharCode (0xffff);
23143 data[1571] = String.fromCharCode (0xffff);
23144 data[1572] = String.fromCharCode (0xffff);
23145 data[1573] = String.fromCharCode (0xffff);
23146 data[1574] = String.fromCharCode (0xffff);
23147 data[1575] = String.fromCharCode (0xffff);
23148 data[1576] = String.fromCharCode (0xffff);
23149 data[1577] = String.fromCharCode (0xffff);
23150 data[1578] = String.fromCharCode (0xffff);
23151 data[1579] = String.fromCharCode (0xffff);
23152 data[1580] = String.fromCharCode (0xffff);
23153 data[1581] = String.fromCharCode (0xffff);
23154 data[1582] = String.fromCharCode (0xffff);
23155 data[1583] = String.fromCharCode (0xffff);
23156 data[1584] = String.fromCharCode (0xffff);
23157 data[1585] = String.fromCharCode (0xffff);
23158 data[1586] = String.fromCharCode (0xffff);
23159 data[1587] = String.fromCharCode (0xffff);
23160 data[1588] = String.fromCharCode (0xffff);
23161 data[1589] = String.fromCharCode (0xffff);
23162 data[1590] = String.fromCharCode (0xffff);
23163 data[1591] = String.fromCharCode (0xffff);
23164 data[1592] = String.fromCharCode (0xffff);
23165 data[1593] = String.fromCharCode (0xffff);
23166 data[1594] = String.fromCharCode (0xffff);
23167 data[1595] = String.fromCharCode (0xffff);
23168 data[1596] = String.fromCharCode (0xffff);
23169 data[1597] = String.fromCharCode (0xffff);
23170 data[1598] = String.fromCharCode (0xffff);
23171 data[1599] = String.fromCharCode (0xffff);
23172 data[1600] = String.fromCharCode (0xffff);
23173 data[1601] = String.fromCharCode (0xffff);
23174 data[1602] = String.fromCharCode (0xffff);
23175 data[1603] = String.fromCharCode (0xffff);
23176 data[1604] = String.fromCharCode (0xffff);
23177 data[1605] = String.fromCharCode (0xffff);
23178 data[1606] = String.fromCharCode (0xffff);
23179 data[1607] = String.fromCharCode (0xffff);
23180 data[1608] = String.fromCharCode (0xffff);
23181 data[1609] = String.fromCharCode (0xffff);
23182 data[1610] = String.fromCharCode (0xffff);
23183 data[1611] = String.fromCharCode (0xffff);
23184 data[1612] = String.fromCharCode (0xffff);
23185 data[1613] = String.fromCharCode (0xffff);
23186 data[1614] = String.fromCharCode (0xffff);
23187 data[1615] = String.fromCharCode (0xffff);
23188 data[1616] = String.fromCharCode (0xffff);
23189 data[1617] = String.fromCharCode (0xffff);
23190 data[1618] = String.fromCharCode (0xffff);
23191 data[1619] = String.fromCharCode (0xffff);
23192 data[1620] = String.fromCharCode (0xffff);
23193 data[1621] = String.fromCharCode (0xffff);
23194 data[1622] = String.fromCharCode (0xffff);
23195 data[1623] = String.fromCharCode (0xffff);
23196 data[1624] = String.fromCharCode (0xffff);
23197 data[1625] = String.fromCharCode (0xffff);
23198 data[1626] = String.fromCharCode (0xffff);
23199 data[1627] = String.fromCharCode (0xffff);
23200 data[1628] = String.fromCharCode (0xffff);
23201 data[1629] = String.fromCharCode (0xffff);
23202 data[1630] = String.fromCharCode (0xffff);
23203 data[1631] = String.fromCharCode (0xffff);
23204 data[1632] = String.fromCharCode (0xffff);
23205 data[1633] = String.fromCharCode (0xffff);
23206 data[1634] = String.fromCharCode (0xffff);
23207 data[1635] = String.fromCharCode (0xffff);
23208 data[1636] = String.fromCharCode (0xffff);
23209 data[1637] = String.fromCharCode (0xffff);
23210 data[1638] = String.fromCharCode (0xffff);
23211 data[1639] = String.fromCharCode (0xffff);
23212 data[1640] = String.fromCharCode (0xffff);
23213 data[1641] = String.fromCharCode (0xffff);
23214 data[1642] = String.fromCharCode (0xffff);
23215 data[1643] = String.fromCharCode (0xffff);
23216 data[1644] = String.fromCharCode (0xffff);
23217 data[1645] = String.fromCharCode (0xffff);
23218 data[1646] = String.fromCharCode (0xffff);
23219 data[1647] = String.fromCharCode (0xffff);
23220 data[1648] = String.fromCharCode (0xffff);
23221 data[1649] = String.fromCharCode (0xffff);
23222 data[1650] = String.fromCharCode (0xffff);
23223 data[1651] = String.fromCharCode (0xffff);
23224 data[1652] = String.fromCharCode (0xffff);
23225 data[1653] = String.fromCharCode (0xffff);
23226 data[1654] = String.fromCharCode (0xffff);
23227 data[1655] = String.fromCharCode (0xffff);
23228 data[1656] = String.fromCharCode (0xffff);
23229 data[1657] = String.fromCharCode (0xffff);
23230 data[1658] = String.fromCharCode (0xffff);
23231 data[1659] = String.fromCharCode (0xffff);
23232 data[1660] = String.fromCharCode (0xffff);
23233 data[1661] = String.fromCharCode (0xffff);
23234 data[1662] = String.fromCharCode (0xffff);
23235 data[1663] = String.fromCharCode (0xffff);
23236 data[1664] = String.fromCharCode (0xffff);
23237 data[1665] = String.fromCharCode (0xffff);
23238 data[1666] = String.fromCharCode (0xffff);
23239 data[1667] = String.fromCharCode (0xffff);
23240 data[1668] = String.fromCharCode (0xffff);
23241 data[1669] = String.fromCharCode (0xffff);
23242 data[1670] = String.fromCharCode (0xffff);
23243 data[1671] = String.fromCharCode (0xffff);
23244 data[1672] = String.fromCharCode (0xffff);
23245 data[1673] = String.fromCharCode (0xffff);
23246 data[1674] = String.fromCharCode (0xffff);
23247 data[1675] = String.fromCharCode (0xffff);
23248 data[1676] = String.fromCharCode (0xffff);
23249 data[1677] = String.fromCharCode (0xffff);
23250 data[1678] = String.fromCharCode (0xffff);
23251 data[1679] = String.fromCharCode (0xffff);
23252 data[1680] = String.fromCharCode (0xffff);
23253 data[1681] = String.fromCharCode (0xffff);
23254 data[1682] = String.fromCharCode (0xffff);
23255 data[1683] = String.fromCharCode (0xffff);
23256 data[1684] = String.fromCharCode (0xffff);
23257 data[1685] = String.fromCharCode (0xffff);
23258 data[1686] = String.fromCharCode (0xffff);
23259 data[1687] = String.fromCharCode (0xffff);
23260 data[1688] = String.fromCharCode (0xffff);
23261 data[1689] = String.fromCharCode (0xffff);
23262 data[1690] = String.fromCharCode (0xffff);
23263 data[1691] = String.fromCharCode (0xffff);
23264 data[1692] = String.fromCharCode (0xffff);
23265 data[1693] = String.fromCharCode (0xffff);
23266 data[1694] = String.fromCharCode (0xffff);
23267 data[1695] = String.fromCharCode (0xffff);
23268 data[1696] = String.fromCharCode (0xffff);
23269 data[1697] = String.fromCharCode (0xffff);
23270 data[1698] = String.fromCharCode (0xffff);
23271 data[1699] = String.fromCharCode (0xffff);
23272 data[1700] = String.fromCharCode (0xffff);
23273 data[1701] = String.fromCharCode (0xffff);
23274 data[1702] = String.fromCharCode (0xffff);
23275 data[1703] = String.fromCharCode (0xffff);
23276 data[1704] = String.fromCharCode (0xffff);
23277 data[1705] = String.fromCharCode (0xffff);
23278 data[1706] = String.fromCharCode (0xffff);
23279 data[1707] = String.fromCharCode (0xffff);
23280 data[1708] = String.fromCharCode (0xffff);
23281 data[1709] = String.fromCharCode (0xffff);
23282 data[1710] = String.fromCharCode (0xffff);
23283 data[1711] = String.fromCharCode (0xffff);
23284 data[1712] = String.fromCharCode (0xffff);
23285 data[1713] = String.fromCharCode (0xffff);
23286 data[1714] = String.fromCharCode (0xffff);
23287 data[1715] = String.fromCharCode (0xffff);
23288 data[1716] = String.fromCharCode (0xffff);
23289 data[1717] = String.fromCharCode (0xffff);
23290 data[1718] = String.fromCharCode (0xffff);
23291 data[1719] = String.fromCharCode (0xffff);
23292 data[1720] = String.fromCharCode (0xffff);
23293 data[1721] = String.fromCharCode (0xffff);
23294 data[1722] = String.fromCharCode (0xffff);
23295 data[1723] = String.fromCharCode (0xffff);
23296 data[1724] = String.fromCharCode (0xffff);
23297 data[1725] = String.fromCharCode (0xffff);
23298 data[1726] = String.fromCharCode (0xffff);
23299 data[1727] = String.fromCharCode (0xffff);
23300 data[1728] = String.fromCharCode (0xffff);
23301 data[1729] = String.fromCharCode (0xffff);
23302 data[1730] = String.fromCharCode (0xffff);
23303 data[1731] = String.fromCharCode (0xffff);
23304 data[1732] = String.fromCharCode (0xffff);
23305 data[1733] = String.fromCharCode (0xffff);
23306 data[1734] = String.fromCharCode (0xffff);
23307 data[1735] = String.fromCharCode (0xffff);
23308 data[1736] = String.fromCharCode (0xffff);
23309 data[1737] = String.fromCharCode (0xffff);
23310 data[1738] = String.fromCharCode (0xffff);
23311 data[1739] = String.fromCharCode (0xffff);
23312 data[1740] = String.fromCharCode (0xffff);
23313 data[1741] = String.fromCharCode (0xffff);
23314 data[1742] = String.fromCharCode (0xffff);
23315 data[1743] = String.fromCharCode (0xffff);
23316 data[1744] = String.fromCharCode (0xffff);
23317 data[1745] = String.fromCharCode (0xffff);
23318 data[1746] = String.fromCharCode (0xffff);
23319 data[1747] = String.fromCharCode (0xffff);
23320 data[1748] = String.fromCharCode (0xffff);
23321 data[1749] = String.fromCharCode (0xffff);
23322 data[1750] = String.fromCharCode (0xffff);
23323 data[1751] = String.fromCharCode (0xffff);
23324 data[1752] = String.fromCharCode (0xffff);
23325 data[1753] = String.fromCharCode (0xffff);
23326 data[1754] = String.fromCharCode (0xffff);
23327 data[1755] = String.fromCharCode (0xffff);
23328 data[1756] = String.fromCharCode (0xffff);
23329 data[1757] = String.fromCharCode (0xffff);
23330 data[1758] = String.fromCharCode (0xffff);
23331 data[1759] = String.fromCharCode (0xffff);
23332 data[1760] = String.fromCharCode (0xffff);
23333 data[1761] = String.fromCharCode (0xffff);
23334 data[1762] = String.fromCharCode (0xffff);
23335 data[1763] = String.fromCharCode (0xffff);
23336 data[1764] = String.fromCharCode (0xffff);
23337 data[1765] = String.fromCharCode (0xffff);
23338 data[1766] = String.fromCharCode (0xffff);
23339 data[1767] = String.fromCharCode (0xffff);
23340 data[1768] = String.fromCharCode (0xffff);
23341 data[1769] = String.fromCharCode (0xffff);
23342 data[1770] = String.fromCharCode (0xffff);
23343 data[1771] = String.fromCharCode (0xffff);
23344 data[1772] = String.fromCharCode (0xffff);
23345 data[1773] = String.fromCharCode (0xffff);
23346 data[1774] = String.fromCharCode (0xffff);
23347 data[1775] = String.fromCharCode (0xffff);
23348 data[1776] = String.fromCharCode (0xffff);
23349 data[1777] = String.fromCharCode (0xffff);
23350 data[1778] = String.fromCharCode (0xffff);
23351 data[1779] = String.fromCharCode (0xffff);
23352 data[1780] = String.fromCharCode (0xffff);
23353 data[1781] = String.fromCharCode (0xffff);
23354 data[1782] = String.fromCharCode (0xffff);
23355 data[1783] = String.fromCharCode (0xffff);
23356 data[1784] = String.fromCharCode (0xffff);
23357 data[1785] = String.fromCharCode (0xffff);
23358 data[1786] = String.fromCharCode (0xffff);
23359 data[1787] = String.fromCharCode (0xffff);
23360 data[1788] = String.fromCharCode (0xffff);
23361 data[1789] = String.fromCharCode (0xffff);
23362 data[1790] = String.fromCharCode (0xffff);
23363 data[1791] = String.fromCharCode (0xffff);
23364 data[1792] = String.fromCharCode (0xffff);
23365 data[1793] = String.fromCharCode (0xffff);
23366 data[1794] = String.fromCharCode (0xffff);
23367 data[1795] = String.fromCharCode (0xffff);
23368 data[1796] = String.fromCharCode (0xffff);
23369 data[1797] = String.fromCharCode (0xffff);
23370 data[1798] = String.fromCharCode (0xffff);
23371 data[1799] = String.fromCharCode (0xffff);
23372 data[1800] = String.fromCharCode (0xffff);
23373 data[1801] = String.fromCharCode (0xffff);
23374 data[1802] = String.fromCharCode (0xffff);
23375 data[1803] = String.fromCharCode (0xffff);
23376 data[1804] = String.fromCharCode (0xffff);
23377 data[1805] = String.fromCharCode (0xffff);
23378 data[1806] = String.fromCharCode (0xffff);
23379 data[1807] = String.fromCharCode (0xffff);
23380 data[1808] = String.fromCharCode (0xffff);
23381 data[1809] = String.fromCharCode (0xffff);
23382 data[1810] = String.fromCharCode (0xffff);
23383 data[1811] = String.fromCharCode (0xffff);
23384 data[1812] = String.fromCharCode (0xffff);
23385 data[1813] = String.fromCharCode (0xffff);
23386 data[1814] = String.fromCharCode (0xffff);
23387 data[1815] = String.fromCharCode (0xffff);
23388 data[1816] = String.fromCharCode (0xffff);
23389 data[1817] = String.fromCharCode (0xffff);
23390 data[1818] = String.fromCharCode (0xffff);
23391 data[1819] = String.fromCharCode (0xffff);
23392 data[1820] = String.fromCharCode (0xffff);
23393 data[1821] = String.fromCharCode (0xffff);
23394 data[1822] = String.fromCharCode (0xffff);
23395 data[1823] = String.fromCharCode (0xffff);
23396 data[1824] = String.fromCharCode (0xffff);
23397 data[1825] = String.fromCharCode (0xffff);
23398 data[1826] = String.fromCharCode (0xffff);
23399 data[1827] = String.fromCharCode (0xffff);
23400 data[1828] = String.fromCharCode (0xffff);
23401 data[1829] = String.fromCharCode (0xffff);
23402 data[1830] = String.fromCharCode (0xffff);
23403 data[1831] = String.fromCharCode (0xffff);
23404 data[1832] = String.fromCharCode (0xffff);
23405 data[1833] = String.fromCharCode (0xffff);
23406 data[1834] = String.fromCharCode (0xffff);
23407 data[1835] = String.fromCharCode (0xffff);
23408 data[1836] = String.fromCharCode (0xffff);
23409 data[1837] = String.fromCharCode (0xffff);
23410 data[1838] = String.fromCharCode (0xffff);
23411 data[1839] = String.fromCharCode (0xffff);
23412 data[1840] = String.fromCharCode (0xffff);
23413 data[1841] = String.fromCharCode (0xffff);
23414 data[1842] = String.fromCharCode (0xffff);
23415 data[1843] = String.fromCharCode (0xffff);
23416 data[1844] = String.fromCharCode (0xffff);
23417 data[1845] = String.fromCharCode (0xffff);
23418 data[1846] = String.fromCharCode (0xffff);
23419 data[1847] = String.fromCharCode (0xffff);
23420 data[1848] = String.fromCharCode (0xffff);
23421 data[1849] = String.fromCharCode (0xffff);
23422 data[1850] = String.fromCharCode (0xffff);
23423 data[1851] = String.fromCharCode (0xffff);
23424 data[1852] = String.fromCharCode (0xffff);
23425 data[1853] = String.fromCharCode (0xffff);
23426 data[1854] = String.fromCharCode (0xffff);
23427 data[1855] = String.fromCharCode (0xffff);
23428 data[1856] = String.fromCharCode (0xffff);
23429 data[1857] = String.fromCharCode (0xffff);
23430 data[1858] = String.fromCharCode (0xffff);
23431 data[1859] = String.fromCharCode (0xffff);
23432 data[1860] = String.fromCharCode (0xffff);
23433 data[1861] = String.fromCharCode (0xffff);
23434 data[1862] = String.fromCharCode (0xffff);
23435 data[1863] = String.fromCharCode (0xffff);
23436 data[1864] = String.fromCharCode (0xffff);
23437 data[1865] = String.fromCharCode (0xffff);
23438 data[1866] = String.fromCharCode (0xffff);
23439 data[1867] = String.fromCharCode (0xffff);
23440 data[1868] = String.fromCharCode (0xffff);
23441 data[1869] = String.fromCharCode (0xffff);
23442 data[1870] = String.fromCharCode (0xffff);
23443 data[1871] = String.fromCharCode (0xffff);
23444 data[1872] = String.fromCharCode (0xffff);
23445 data[1873] = String.fromCharCode (0xffff);
23446 data[1874] = String.fromCharCode (0xffff);
23447 data[1875] = String.fromCharCode (0xffff);
23448 data[1876] = String.fromCharCode (0xffff);
23449 data[1877] = String.fromCharCode (0xffff);
23450 data[1878] = String.fromCharCode (0xffff);
23451 data[1879] = String.fromCharCode (0xffff);
23452 data[1880] = String.fromCharCode (0xffff);
23453 data[1881] = String.fromCharCode (0xffff);
23454 data[1882] = String.fromCharCode (0xffff);
23455 data[1883] = String.fromCharCode (0xffff);
23456 data[1884] = String.fromCharCode (0xffff);
23457 data[1885] = String.fromCharCode (0xffff);
23458 data[1886] = String.fromCharCode (0xffff);
23459 data[1887] = String.fromCharCode (0xffff);
23460 data[1888] = String.fromCharCode (0xffff);
23461 data[1889] = String.fromCharCode (0xffff);
23462 data[1890] = String.fromCharCode (0xffff);
23463 data[1891] = String.fromCharCode (0xffff);
23464 data[1892] = String.fromCharCode (0xffff);
23465 data[1893] = String.fromCharCode (0xffff);
23466 data[1894] = String.fromCharCode (0xffff);
23467 data[1895] = String.fromCharCode (0xffff);
23468 data[1896] = String.fromCharCode (0xffff);
23469 data[1897] = String.fromCharCode (0xffff);
23470 data[1898] = String.fromCharCode (0xffff);
23471 data[1899] = String.fromCharCode (0xffff);
23472 data[1900] = String.fromCharCode (0xffff);
23473 data[1901] = String.fromCharCode (0xffff);
23474 data[1902] = String.fromCharCode (0xffff);
23475 data[1903] = String.fromCharCode (0xffff);
23476 data[1904] = String.fromCharCode (0xffff);
23477 data[1905] = String.fromCharCode (0xffff);
23478 data[1906] = String.fromCharCode (0xffff);
23479 data[1907] = String.fromCharCode (0xffff);
23480 data[1908] = String.fromCharCode (0xffff);
23481 data[1909] = String.fromCharCode (0xffff);
23482 data[1910] = String.fromCharCode (0xffff);
23483 data[1911] = String.fromCharCode (0xffff);
23484 data[1912] = String.fromCharCode (0xffff);
23485 data[1913] = String.fromCharCode (0xffff);
23486 data[1914] = String.fromCharCode (0xffff);
23487 data[1915] = String.fromCharCode (0xffff);
23488 data[1916] = String.fromCharCode (0xffff);
23489 data[1917] = String.fromCharCode (0xffff);
23490 data[1918] = String.fromCharCode (0xffff);
23491 data[1919] = String.fromCharCode (0xffff);
23492 data[1920] = String.fromCharCode (0xffff);
23493 data[1921] = String.fromCharCode (0xffff);
23494 data[1922] = String.fromCharCode (0xffff);
23495 data[1923] = String.fromCharCode (0xffff);
23496 data[1924] = String.fromCharCode (0xffff);
23497 data[1925] = String.fromCharCode (0xffff);
23498 data[1926] = String.fromCharCode (0xffff);
23499 data[1927] = String.fromCharCode (0xffff);
23500 data[1928] = String.fromCharCode (0xffff);
23501 data[1929] = String.fromCharCode (0xffff);
23502 data[1930] = String.fromCharCode (0xffff);
23503 data[1931] = String.fromCharCode (0xffff);
23504 data[1932] = String.fromCharCode (0xffff);
23505 data[1933] = String.fromCharCode (0xffff);
23506 data[1934] = String.fromCharCode (0xffff);
23507 data[1935] = String.fromCharCode (0xffff);
23508 data[1936] = String.fromCharCode (0xffff);
23509 data[1937] = String.fromCharCode (0xffff);
23510 data[1938] = String.fromCharCode (0xffff);
23511 data[1939] = String.fromCharCode (0xffff);
23512 data[1940] = String.fromCharCode (0xffff);
23513 data[1941] = String.fromCharCode (0xffff);
23514 data[1942] = String.fromCharCode (0xffff);
23515 data[1943] = String.fromCharCode (0xffff);
23516 data[1944] = String.fromCharCode (0xffff);
23517 data[1945] = String.fromCharCode (0xffff);
23518 data[1946] = String.fromCharCode (0xffff);
23519 data[1947] = String.fromCharCode (0xffff);
23520 data[1948] = String.fromCharCode (0xffff);
23521 data[1949] = String.fromCharCode (0xffff);
23522 data[1950] = String.fromCharCode (0xffff);
23523 data[1951] = String.fromCharCode (0xffff);
23524 data[1952] = String.fromCharCode (0xffff);
23525 data[1953] = String.fromCharCode (0xffff);
23526 data[1954] = String.fromCharCode (0xffff);
23527 data[1955] = String.fromCharCode (0xffff);
23528 data[1956] = String.fromCharCode (0xffff);
23529 data[1957] = String.fromCharCode (0xffff);
23530 data[1958] = String.fromCharCode (0xffff);
23531 data[1959] = String.fromCharCode (0xffff);
23532 data[1960] = String.fromCharCode (0xffff);
23533 data[1961] = String.fromCharCode (0xffff);
23534 data[1962] = String.fromCharCode (0xffff);
23535 data[1963] = String.fromCharCode (0xffff);
23536 data[1964] = String.fromCharCode (0xffff);
23537 data[1965] = String.fromCharCode (0xffff);
23538 data[1966] = String.fromCharCode (0xffff);
23539 data[1967] = String.fromCharCode (0xffff);
23540 data[1968] = String.fromCharCode (0xffff);
23541 data[1969] = String.fromCharCode (0xffff);
23542 data[1970] = String.fromCharCode (0xffff);
23543 data[1971] = String.fromCharCode (0xffff);
23544 data[1972] = String.fromCharCode (0xffff);
23545 data[1973] = String.fromCharCode (0xffff);
23546 data[1974] = String.fromCharCode (0xffff);
23547 data[1975] = String.fromCharCode (0xffff);
23548 data[1976] = String.fromCharCode (0xffff);
23549 data[1977] = String.fromCharCode (0xffff);
23550 data[1978] = String.fromCharCode (0xffff);
23551 data[1979] = String.fromCharCode (0xffff);
23552 data[1980] = String.fromCharCode (0xffff);
23553 data[1981] = String.fromCharCode (0xffff);
23554 data[1982] = String.fromCharCode (0xffff);
23555 data[1983] = String.fromCharCode (0xffff);
23556 data[1984] = String.fromCharCode (0xffff);
23557 data[1985] = String.fromCharCode (0xffff);
23558 data[1986] = String.fromCharCode (0xffff);
23559 data[1987] = String.fromCharCode (0xffff);
23560 data[1988] = String.fromCharCode (0xffff);
23561 data[1989] = String.fromCharCode (0xffff);
23562 data[1990] = String.fromCharCode (0xffff);
23563 data[1991] = String.fromCharCode (0xffff);
23564 data[1992] = String.fromCharCode (0xffff);
23565 data[1993] = String.fromCharCode (0xffff);
23566 data[1994] = String.fromCharCode (0xffff);
23567 data[1995] = String.fromCharCode (0xffff);
23568 data[1996] = String.fromCharCode (0xffff);
23569 data[1997] = String.fromCharCode (0xffff);
23570 data[1998] = String.fromCharCode (0xffff);
23571 data[1999] = String.fromCharCode (0xffff);
23572 data[2000] = String.fromCharCode (0xffff);
23573 data[2001] = String.fromCharCode (0xffff);
23574 data[2002] = String.fromCharCode (0xffff);
23575 data[2003] = String.fromCharCode (0xffff);
23576 data[2004] = String.fromCharCode (0xffff);
23577 data[2005] = String.fromCharCode (0xffff);
23578 data[2006] = String.fromCharCode (0xffff);
23579 data[2007] = String.fromCharCode (0xffff);
23580 data[2008] = String.fromCharCode (0xffff);
23581 data[2009] = String.fromCharCode (0xffff);
23582 data[2010] = String.fromCharCode (0xffff);
23583 data[2011] = String.fromCharCode (0xffff);
23584 data[2012] = String.fromCharCode (0xffff);
23585 data[2013] = String.fromCharCode (0xffff);
23586 data[2014] = String.fromCharCode (0xffff);
23587 data[2015] = String.fromCharCode (0xffff);
23588 data[2016] = String.fromCharCode (0xffff);
23589 data[2017] = String.fromCharCode (0xffff);
23590 data[2018] = String.fromCharCode (0xffff);
23591 data[2019] = String.fromCharCode (0xffff);
23592 data[2020] = String.fromCharCode (0xffff);
23593 data[2021] = String.fromCharCode (0xffff);
23594 data[2022] = String.fromCharCode (0xffff);
23595 data[2023] = String.fromCharCode (0xffff);
23596 data[2024] = String.fromCharCode (0xffff);
23597 data[2025] = String.fromCharCode (0xffff);
23598 data[2026] = String.fromCharCode (0xffff);
23599 data[2027] = String.fromCharCode (0xffff);
23600 data[2028] = String.fromCharCode (0xffff);
23601 data[2029] = String.fromCharCode (0xffff);
23602 data[2030] = String.fromCharCode (0xffff);
23603 data[2031] = String.fromCharCode (0xffff);
23604 data[2032] = String.fromCharCode (0xffff);
23605 data[2033] = String.fromCharCode (0xffff);
23606 data[2034] = String.fromCharCode (0xffff);
23607 data[2035] = String.fromCharCode (0xffff);
23608 data[2036] = String.fromCharCode (0xffff);
23609 data[2037] = String.fromCharCode (0xffff);
23610 data[2038] = String.fromCharCode (0xffff);
23611 data[2039] = String.fromCharCode (0xffff);
23612 data[2040] = String.fromCharCode (0xffff);
23613 data[2041] = String.fromCharCode (0xffff);
23614 data[2042] = String.fromCharCode (0xffff);
23615 data[2043] = String.fromCharCode (0xffff);
23616 data[2044] = String.fromCharCode (0xffff);
23617 data[2045] = String.fromCharCode (0xffff);
23618 data[2046] = String.fromCharCode (0xffff);
23619 data[2047] = String.fromCharCode (0xffff);
23620 data[2048] = String.fromCharCode (0xffff);
23621 data[2049] = String.fromCharCode (0xffff);
23622 data[2050] = String.fromCharCode (0xffff);
23623 data[2051] = String.fromCharCode (0xffff);
23624 data[2052] = String.fromCharCode (0xffff);
23625 data[2053] = String.fromCharCode (0xffff);
23626 data[2054] = String.fromCharCode (0xffff);
23627 data[2055] = String.fromCharCode (0xffff);
23628 data[2056] = String.fromCharCode (0xffff);
23629 data[2057] = String.fromCharCode (0xffff);
23630 data[2058] = String.fromCharCode (0xffff);
23631 data[2059] = String.fromCharCode (0xffff);
23632 data[2060] = String.fromCharCode (0xffff);
23633 data[2061] = String.fromCharCode (0xffff);
23634 data[2062] = String.fromCharCode (0xffff);
23635 data[2063] = String.fromCharCode (0xffff);
23636 data[2064] = String.fromCharCode (0xffff);
23637 data[2065] = String.fromCharCode (0xffff);
23638 data[2066] = String.fromCharCode (0xffff);
23639 data[2067] = String.fromCharCode (0xffff);
23640 data[2068] = String.fromCharCode (0xffff);
23641 data[2069] = String.fromCharCode (0xffff);
23642 data[2070] = String.fromCharCode (0xffff);
23643 data[2071] = String.fromCharCode (0xffff);
23644 data[2072] = String.fromCharCode (0xffff);
23645 data[2073] = String.fromCharCode (0xffff);
23646 data[2074] = String.fromCharCode (0xffff);
23647 data[2075] = String.fromCharCode (0xffff);
23648 data[2076] = String.fromCharCode (0xffff);
23649 data[2077] = String.fromCharCode (0xffff);
23650 data[2078] = String.fromCharCode (0xffff);
23651 data[2079] = String.fromCharCode (0xffff);
23652 data[2080] = String.fromCharCode (0xffff);
23653 data[2081] = String.fromCharCode (0xffff);
23654 data[2082] = String.fromCharCode (0xffff);
23655 data[2083] = String.fromCharCode (0xffff);
23656 data[2084] = String.fromCharCode (0xffff);
23657 data[2085] = String.fromCharCode (0xffff);
23658 data[2086] = String.fromCharCode (0xffff);
23659 data[2087] = String.fromCharCode (0xffff);
23660 data[2088] = String.fromCharCode (0xffff);
23661 data[2089] = String.fromCharCode (0xffff);
23662 data[2090] = String.fromCharCode (0xffff);
23663 data[2091] = String.fromCharCode (0xffff);
23664 data[2092] = String.fromCharCode (0xffff);
23665 data[2093] = String.fromCharCode (0xffff);
23666 data[2094] = String.fromCharCode (0xffff);
23667 data[2095] = String.fromCharCode (0xffff);
23668 data[2096] = String.fromCharCode (0xffff);
23669 data[2097] = String.fromCharCode (0xffff);
23670 data[2098] = String.fromCharCode (0xffff);
23671 data[2099] = String.fromCharCode (0xffff);
23672 data[2100] = String.fromCharCode (0xffff);
23673 data[2101] = String.fromCharCode (0xffff);
23674 data[2102] = String.fromCharCode (0xffff);
23675 data[2103] = String.fromCharCode (0xffff);
23676 data[2104] = String.fromCharCode (0xffff);
23677 data[2105] = String.fromCharCode (0xffff);
23678 data[2106] = String.fromCharCode (0xffff);
23679 data[2107] = String.fromCharCode (0xffff);
23680 data[2108] = String.fromCharCode (0xffff);
23681 data[2109] = String.fromCharCode (0xffff);
23682 data[2110] = String.fromCharCode (0xffff);
23683 data[2111] = String.fromCharCode (0xffff);
23684 data[2112] = String.fromCharCode (0xffff);
23685 data[2113] = String.fromCharCode (0xffff);
23686 data[2114] = String.fromCharCode (0xffff);
23687 data[2115] = String.fromCharCode (0xffff);
23688 data[2116] = String.fromCharCode (0xffff);
23689 data[2117] = String.fromCharCode (0xffff);
23690 data[2118] = String.fromCharCode (0xffff);
23691 data[2119] = String.fromCharCode (0xffff);
23692 data[2120] = String.fromCharCode (0xffff);
23693 data[2121] = String.fromCharCode (0xffff);
23694 data[2122] = String.fromCharCode (0xffff);
23695 data[2123] = String.fromCharCode (0xffff);
23696 data[2124] = String.fromCharCode (0xffff);
23697 data[2125] = String.fromCharCode (0xffff);
23698 data[2126] = String.fromCharCode (0xffff);
23699 data[2127] = String.fromCharCode (0xffff);
23700 data[2128] = String.fromCharCode (0xffff);
23701 data[2129] = String.fromCharCode (0xffff);
23702 data[2130] = String.fromCharCode (0xffff);
23703 data[2131] = String.fromCharCode (0xffff);
23704 data[2132] = String.fromCharCode (0xffff);
23705 data[2133] = String.fromCharCode (0xffff);
23706 data[2134] = String.fromCharCode (0xffff);
23707 data[2135] = String.fromCharCode (0xffff);
23708 data[2136] = String.fromCharCode (0xffff);
23709 data[2137] = String.fromCharCode (0xffff);
23710 data[2138] = String.fromCharCode (0xffff);
23711 data[2139] = String.fromCharCode (0xffff);
23712 data[2140] = String.fromCharCode (0xffff);
23713 data[2141] = String.fromCharCode (0xffff);
23714 data[2142] = String.fromCharCode (0xffff);
23715 data[2143] = String.fromCharCode (0xffff);
23716 data[2144] = String.fromCharCode (0xffff);
23717 data[2145] = String.fromCharCode (0xffff);
23718 data[2146] = String.fromCharCode (0xffff);
23719 data[2147] = String.fromCharCode (0xffff);
23720 data[2148] = String.fromCharCode (0xffff);
23721 data[2149] = String.fromCharCode (0xffff);
23722 data[2150] = String.fromCharCode (0xffff);
23723 data[2151] = String.fromCharCode (0xffff);
23724 data[2152] = String.fromCharCode (0xffff);
23725 data[2153] = String.fromCharCode (0xffff);
23726 data[2154] = String.fromCharCode (0xffff);
23727 data[2155] = String.fromCharCode (0xffff);
23728 data[2156] = String.fromCharCode (0xffff);
23729 data[2157] = String.fromCharCode (0xffff);
23730 data[2158] = String.fromCharCode (0xffff);
23731 data[2159] = String.fromCharCode (0xffff);
23732 data[2160] = String.fromCharCode (0xffff);
23733 data[2161] = String.fromCharCode (0xffff);
23734 data[2162] = String.fromCharCode (0xffff);
23735 data[2163] = String.fromCharCode (0xffff);
23736 data[2164] = String.fromCharCode (0xffff);
23737 data[2165] = String.fromCharCode (0xffff);
23738 data[2166] = String.fromCharCode (0xffff);
23739 data[2167] = String.fromCharCode (0xffff);
23740 data[2168] = String.fromCharCode (0xffff);
23741 data[2169] = String.fromCharCode (0xffff);
23742 data[2170] = String.fromCharCode (0xffff);
23743 data[2171] = String.fromCharCode (0xffff);
23744 data[2172] = String.fromCharCode (0xffff);
23745 data[2173] = String.fromCharCode (0xffff);
23746 data[2174] = String.fromCharCode (0xffff);
23747 data[2175] = String.fromCharCode (0xffff);
23748 data[2176] = String.fromCharCode (0xffff);
23749 data[2177] = String.fromCharCode (0xffff);
23750 data[2178] = String.fromCharCode (0xffff);
23751 data[2179] = String.fromCharCode (0xffff);
23752 data[2180] = String.fromCharCode (0xffff);
23753 data[2181] = String.fromCharCode (0xffff);
23754 data[2182] = String.fromCharCode (0xffff);
23755 data[2183] = String.fromCharCode (0xffff);
23756 data[2184] = String.fromCharCode (0xffff);
23757 data[2185] = String.fromCharCode (0xffff);
23758 data[2186] = String.fromCharCode (0xffff);
23759 data[2187] = String.fromCharCode (0xffff);
23760 data[2188] = String.fromCharCode (0xffff);
23761 data[2189] = String.fromCharCode (0xffff);
23762 data[2190] = String.fromCharCode (0xffff);
23763 data[2191] = String.fromCharCode (0xffff);
23764 data[2192] = String.fromCharCode (0xffff);
23765 data[2193] = String.fromCharCode (0xffff);
23766 data[2194] = String.fromCharCode (0xffff);
23767 data[2195] = String.fromCharCode (0xffff);
23768 data[2196] = String.fromCharCode (0xffff);
23769 data[2197] = String.fromCharCode (0xffff);
23770 data[2198] = String.fromCharCode (0xffff);
23771 data[2199] = String.fromCharCode (0xffff);
23772 data[2200] = String.fromCharCode (0xffff);
23773 data[2201] = String.fromCharCode (0xffff);
23774 data[2202] = String.fromCharCode (0xffff);
23775 data[2203] = String.fromCharCode (0xffff);
23776 data[2204] = String.fromCharCode (0xffff);
23777 data[2205] = String.fromCharCode (0xffff);
23778 data[2206] = String.fromCharCode (0xffff);
23779 data[2207] = String.fromCharCode (0xffff);
23780 data[2208] = String.fromCharCode (0xffff);
23781 data[2209] = String.fromCharCode (0xffff);
23782 data[2210] = String.fromCharCode (0xffff);
23783 data[2211] = String.fromCharCode (0xffff);
23784 data[2212] = String.fromCharCode (0xffff);
23785 data[2213] = String.fromCharCode (0xffff);
23786 data[2214] = String.fromCharCode (0xffff);
23787 data[2215] = String.fromCharCode (0xffff);
23788 data[2216] = String.fromCharCode (0xffff);
23789 data[2217] = String.fromCharCode (0xffff);
23790 data[2218] = String.fromCharCode (0xffff);
23791 data[2219] = String.fromCharCode (0xffff);
23792 data[2220] = String.fromCharCode (0xffff);
23793 data[2221] = String.fromCharCode (0xffff);
23794 data[2222] = String.fromCharCode (0xffff);
23795 data[2223] = String.fromCharCode (0xffff);
23796 data[2224] = String.fromCharCode (0xffff);
23797 data[2225] = String.fromCharCode (0xffff);
23798 data[2226] = String.fromCharCode (0xffff);
23799 data[2227] = String.fromCharCode (0xffff);
23800 data[2228] = String.fromCharCode (0xffff);
23801 data[2229] = String.fromCharCode (0xffff);
23802 data[2230] = String.fromCharCode (0xffff);
23803 data[2231] = String.fromCharCode (0xffff);
23804 data[2232] = String.fromCharCode (0xffff);
23805 data[2233] = String.fromCharCode (0xffff);
23806 data[2234] = String.fromCharCode (0xffff);
23807 data[2235] = String.fromCharCode (0xffff);
23808 data[2236] = String.fromCharCode (0xffff);
23809 data[2237] = String.fromCharCode (0xffff);
23810 data[2238] = String.fromCharCode (0xffff);
23811 data[2239] = String.fromCharCode (0xffff);
23812 data[2240] = String.fromCharCode (0xffff);
23813 data[2241] = String.fromCharCode (0xffff);
23814 data[2242] = String.fromCharCode (0xffff);
23815 data[2243] = String.fromCharCode (0xffff);
23816 data[2244] = String.fromCharCode (0xffff);
23817 data[2245] = String.fromCharCode (0xffff);
23818 data[2246] = String.fromCharCode (0xffff);
23819 data[2247] = String.fromCharCode (0xffff);
23820 data[2248] = String.fromCharCode (0xffff);
23821 data[2249] = String.fromCharCode (0xffff);
23822 data[2250] = String.fromCharCode (0xffff);
23823 data[2251] = String.fromCharCode (0xffff);
23824 data[2252] = String.fromCharCode (0xffff);
23825 data[2253] = String.fromCharCode (0xffff);
23826 data[2254] = String.fromCharCode (0xffff);
23827 data[2255] = String.fromCharCode (0xffff);
23828 data[2256] = String.fromCharCode (0xffff);
23829 data[2257] = String.fromCharCode (0xffff);
23830 data[2258] = String.fromCharCode (0xffff);
23831 data[2259] = String.fromCharCode (0xffff);
23832 data[2260] = String.fromCharCode (0xffff);
23833 data[2261] = String.fromCharCode (0xffff);
23834 data[2262] = String.fromCharCode (0xffff);
23835 data[2263] = String.fromCharCode (0xffff);
23836 data[2264] = String.fromCharCode (0xffff);
23837 data[2265] = String.fromCharCode (0xffff);
23838 data[2266] = String.fromCharCode (0xffff);
23839 data[2267] = String.fromCharCode (0xffff);
23840 data[2268] = String.fromCharCode (0xffff);
23841 data[2269] = String.fromCharCode (0xffff);
23842 data[2270] = String.fromCharCode (0xffff);
23843 data[2271] = String.fromCharCode (0xffff);
23844 data[2272] = String.fromCharCode (0xffff);
23845 data[2273] = String.fromCharCode (0xffff);
23846 data[2274] = String.fromCharCode (0xffff);
23847 data[2275] = String.fromCharCode (0xffff);
23848 data[2276] = String.fromCharCode (0xffff);
23849 data[2277] = String.fromCharCode (0xffff);
23850 data[2278] = String.fromCharCode (0xffff);
23851 data[2279] = String.fromCharCode (0xffff);
23852 data[2280] = String.fromCharCode (0xffff);
23853 data[2281] = String.fromCharCode (0xffff);
23854 data[2282] = String.fromCharCode (0xffff);
23855 data[2283] = String.fromCharCode (0xffff);
23856 data[2284] = String.fromCharCode (0xffff);
23857 data[2285] = String.fromCharCode (0xffff);
23858 data[2286] = String.fromCharCode (0xffff);
23859 data[2287] = String.fromCharCode (0xffff);
23860 data[2288] = String.fromCharCode (0xffff);
23861 data[2289] = String.fromCharCode (0xffff);
23862 data[2290] = String.fromCharCode (0xffff);
23863 data[2291] = String.fromCharCode (0xffff);
23864 data[2292] = String.fromCharCode (0xffff);
23865 data[2293] = String.fromCharCode (0xffff);
23866 data[2294] = String.fromCharCode (0xffff);
23867 data[2295] = String.fromCharCode (0xffff);
23868 data[2296] = String.fromCharCode (0xffff);
23869 data[2297] = String.fromCharCode (0xffff);
23870 data[2298] = String.fromCharCode (0xffff);
23871 data[2299] = String.fromCharCode (0xffff);
23872 data[2300] = String.fromCharCode (0xffff);
23873 data[2301] = String.fromCharCode (0xffff);
23874 data[2302] = String.fromCharCode (0xffff);
23875 data[2303] = String.fromCharCode (0xffff);
23876 data[2304] = String.fromCharCode (0xffff);
23877 data[2305] = String.fromCharCode (0xffff);
23878 data[2306] = String.fromCharCode (0xffff);
23879 data[2307] = String.fromCharCode (0xffff);
23880 data[2308] = String.fromCharCode (0xffff);
23881 data[2309] = String.fromCharCode (0xffff);
23882 data[2310] = String.fromCharCode (0xffff);
23883 data[2311] = String.fromCharCode (0xffff);
23884 data[2312] = String.fromCharCode (0xffff);
23885 data[2313] = String.fromCharCode (0xffff);
23886 data[2314] = String.fromCharCode (0xffff);
23887 data[2315] = String.fromCharCode (0xffff);
23888 data[2316] = String.fromCharCode (0xffff);
23889 data[2317] = String.fromCharCode (0xffff);
23890 data[2318] = String.fromCharCode (0xffff);
23891 data[2319] = String.fromCharCode (0xffff);
23892 data[2320] = String.fromCharCode (0xffff);
23893 data[2321] = String.fromCharCode (0xffff);
23894 data[2322] = String.fromCharCode (0xffff);
23895 data[2323] = String.fromCharCode (0xffff);
23896 data[2324] = String.fromCharCode (0xffff);
23897 data[2325] = String.fromCharCode (0xffff);
23898 data[2326] = String.fromCharCode (0xffff);
23899 data[2327] = String.fromCharCode (0xffff);
23900 data[2328] = String.fromCharCode (0xffff);
23901 data[2329] = String.fromCharCode (0xffff);
23902 data[2330] = String.fromCharCode (0xffff);
23903 data[2331] = String.fromCharCode (0xffff);
23904 data[2332] = String.fromCharCode (0xffff);
23905 data[2333] = String.fromCharCode (0xffff);
23906 data[2334] = String.fromCharCode (0xffff);
23907 data[2335] = String.fromCharCode (0xffff);
23908 data[2336] = String.fromCharCode (0xffff);
23909 data[2337] = String.fromCharCode (0xffff);
23910 data[2338] = String.fromCharCode (0xffff);
23911 data[2339] = String.fromCharCode (0xffff);
23912 data[2340] = String.fromCharCode (0xffff);
23913 data[2341] = String.fromCharCode (0xffff);
23914 data[2342] = String.fromCharCode (0xffff);
23915 data[2343] = String.fromCharCode (0xffff);
23916 data[2344] = String.fromCharCode (0xffff);
23917 data[2345] = String.fromCharCode (0xffff);
23918 data[2346] = String.fromCharCode (0xffff);
23919 data[2347] = String.fromCharCode (0xffff);
23920 data[2348] = String.fromCharCode (0xffff);
23921 data[2349] = String.fromCharCode (0xffff);
23922 data[2350] = String.fromCharCode (0xffff);
23923 data[2351] = String.fromCharCode (0xffff);
23924 data[2352] = String.fromCharCode (0xffff);
23925 data[2353] = String.fromCharCode (0xffff);
23926 data[2354] = String.fromCharCode (0xffff);
23927 data[2355] = String.fromCharCode (0xffff);
23928 data[2356] = String.fromCharCode (0xffff);
23929 data[2357] = String.fromCharCode (0xffff);
23930 data[2358] = String.fromCharCode (0xffff);
23931 data[2359] = String.fromCharCode (0xffff);
23932 data[2360] = String.fromCharCode (0xffff);
23933 data[2361] = String.fromCharCode (0xffff);
23934 data[2362] = String.fromCharCode (0xffff);
23935 data[2363] = String.fromCharCode (0xffff);
23936 data[2364] = String.fromCharCode (0xffff);
23937 data[2365] = String.fromCharCode (0xffff);
23938 data[2366] = String.fromCharCode (0xffff);
23939 data[2367] = String.fromCharCode (0xffff);
23940 data[2368] = String.fromCharCode (0xffff);
23941 data[2369] = String.fromCharCode (0xffff);
23942 data[2370] = String.fromCharCode (0xffff);
23943 data[2371] = String.fromCharCode (0xffff);
23944 data[2372] = String.fromCharCode (0xffff);
23945 data[2373] = String.fromCharCode (0xffff);
23946 data[2374] = String.fromCharCode (0xffff);
23947 data[2375] = String.fromCharCode (0xffff);
23948 data[2376] = String.fromCharCode (0xffff);
23949 data[2377] = String.fromCharCode (0xffff);
23950 data[2378] = String.fromCharCode (0xffff);
23951 data[2379] = String.fromCharCode (0xffff);
23952 data[2380] = String.fromCharCode (0xffff);
23953 data[2381] = String.fromCharCode (0xffff);
23954 data[2382] = String.fromCharCode (0xffff);
23955 data[2383] = String.fromCharCode (0xffff);
23956 data[2384] = String.fromCharCode (0xffff);
23957 data[2385] = String.fromCharCode (0xffff);
23958 data[2386] = String.fromCharCode (0xffff);
23959 data[2387] = String.fromCharCode (0xffff);
23960 data[2388] = String.fromCharCode (0xffff);
23961 data[2389] = String.fromCharCode (0xffff);
23962 data[2390] = String.fromCharCode (0xffff);
23963 data[2391] = String.fromCharCode (0xffff);
23964 data[2392] = String.fromCharCode (0xffff);
23965 data[2393] = String.fromCharCode (0xffff);
23966 data[2394] = String.fromCharCode (0xffff);
23967 data[2395] = String.fromCharCode (0xffff);
23968 data[2396] = String.fromCharCode (0xffff);
23969 data[2397] = String.fromCharCode (0xffff);
23970 data[2398] = String.fromCharCode (0xffff);
23971 data[2399] = String.fromCharCode (0xffff);
23972 data[2400] = String.fromCharCode (0xffff);
23973 data[2401] = String.fromCharCode (0xffff);
23974 data[2402] = String.fromCharCode (0xffff);
23975 data[2403] = String.fromCharCode (0xffff);
23976 data[2404] = String.fromCharCode (0xffff);
23977 data[2405] = String.fromCharCode (0xffff);
23978 data[2406] = String.fromCharCode (0xffff);
23979 data[2407] = String.fromCharCode (0xffff);
23980 data[2408] = String.fromCharCode (0xffff);
23981 data[2409] = String.fromCharCode (0xffff);
23982 data[2410] = String.fromCharCode (0xffff);
23983 data[2411] = String.fromCharCode (0xffff);
23984 data[2412] = String.fromCharCode (0xffff);
23985 data[2413] = String.fromCharCode (0xffff);
23986 data[2414] = String.fromCharCode (0xffff);
23987 data[2415] = String.fromCharCode (0xffff);
23988 data[2416] = String.fromCharCode (0xffff);
23989 data[2417] = String.fromCharCode (0xffff);
23990 data[2418] = String.fromCharCode (0xffff);
23991 data[2419] = String.fromCharCode (0xffff);
23992 data[2420] = String.fromCharCode (0xffff);
23993 data[2421] = String.fromCharCode (0xffff);
23994 data[2422] = String.fromCharCode (0xffff);
23995 data[2423] = String.fromCharCode (0xffff);
23996 data[2424] = String.fromCharCode (0xffff);
23997 data[2425] = String.fromCharCode (0xffff);
23998 data[2426] = String.fromCharCode (0xffff);
23999 data[2427] = String.fromCharCode (0xffff);
24000 data[2428] = String.fromCharCode (0xffff);
24001 data[2429] = String.fromCharCode (0xffff);
24002 data[2430] = String.fromCharCode (0xffff);
24003 data[2431] = String.fromCharCode (0xffff);
24004 data[2432] = String.fromCharCode (0xffff);
24005 data[2433] = String.fromCharCode (0xffff);
24006 data[2434] = String.fromCharCode (0xffff);
24007 data[2435] = String.fromCharCode (0xffff);
24008 data[2436] = String.fromCharCode (0xffff);
24009 data[2437] = String.fromCharCode (0xffff);
24010 data[2438] = String.fromCharCode (0xffff);
24011 data[2439] = String.fromCharCode (0xffff);
24012 data[2440] = String.fromCharCode (0xffff);
24013 data[2441] = String.fromCharCode (0xffff);
24014 data[2442] = String.fromCharCode (0xffff);
24015 data[2443] = String.fromCharCode (0xffff);
24016 data[2444] = String.fromCharCode (0xffff);
24017 data[2445] = String.fromCharCode (0xffff);
24018 data[2446] = String.fromCharCode (0xffff);
24019 data[2447] = String.fromCharCode (0xffff);
24020 data[2448] = String.fromCharCode (0xffff);
24021 data[2449] = String.fromCharCode (0xffff);
24022 data[2450] = String.fromCharCode (0xffff);
24023 data[2451] = String.fromCharCode (0xffff);
24024 data[2452] = String.fromCharCode (0xffff);
24025 data[2453] = String.fromCharCode (0xffff);
24026 data[2454] = String.fromCharCode (0xffff);
24027 data[2455] = String.fromCharCode (0xffff);
24028 data[2456] = String.fromCharCode (0xffff);
24029 data[2457] = String.fromCharCode (0xffff);
24030 data[2458] = String.fromCharCode (0xffff);
24031 data[2459] = String.fromCharCode (0xffff);
24032 data[2460] = String.fromCharCode (0xffff);
24033 data[2461] = String.fromCharCode (0xffff);
24034 data[2462] = String.fromCharCode (0xffff);
24035 data[2463] = String.fromCharCode (0xffff);
24036 data[2464] = String.fromCharCode (0xffff);
24037 data[2465] = String.fromCharCode (0xffff);
24038 data[2466] = String.fromCharCode (0xffff);
24039 data[2467] = String.fromCharCode (0xffff);
24040 data[2468] = String.fromCharCode (0xffff);
24041 data[2469] = String.fromCharCode (0xffff);
24042 data[2470] = String.fromCharCode (0xffff);
24043 data[2471] = String.fromCharCode (0xffff);
24044 data[2472] = String.fromCharCode (0xffff);
24045 data[2473] = String.fromCharCode (0xffff);
24046 data[2474] = String.fromCharCode (0xffff);
24047 data[2475] = String.fromCharCode (0xffff);
24048 data[2476] = String.fromCharCode (0xffff);
24049 data[2477] = String.fromCharCode (0xffff);
24050 data[2478] = String.fromCharCode (0xffff);
24051 data[2479] = String.fromCharCode (0xffff);
24052 data[2480] = String.fromCharCode (0xffff);
24053 data[2481] = String.fromCharCode (0xffff);
24054 data[2482] = String.fromCharCode (0xffff);
24055 data[2483] = String.fromCharCode (0xffff);
24056 data[2484] = String.fromCharCode (0xffff);
24057 data[2485] = String.fromCharCode (0xffff);
24058 data[2486] = String.fromCharCode (0xffff);
24059 data[2487] = String.fromCharCode (0xffff);
24060 data[2488] = String.fromCharCode (0xffff);
24061 data[2489] = String.fromCharCode (0xffff);
24062 data[2490] = String.fromCharCode (0xffff);
24063 data[2491] = String.fromCharCode (0xffff);
24064 data[2492] = String.fromCharCode (0xffff);
24065 data[2493] = String.fromCharCode (0xffff);
24066 data[2494] = String.fromCharCode (0xffff);
24067 data[2495] = String.fromCharCode (0xffff);
24068 data[2496] = String.fromCharCode (0xffff);
24069 data[2497] = String.fromCharCode (0xffff);
24070 data[2498] = String.fromCharCode (0xffff);
24071 data[2499] = String.fromCharCode (0xffff);
24072 data[2500] = String.fromCharCode (0xffff);
24073 data[2501] = String.fromCharCode (0xffff);
24074 data[2502] = String.fromCharCode (0xffff);
24075 data[2503] = String.fromCharCode (0xffff);
24076 data[2504] = String.fromCharCode (0xffff);
24077 data[2505] = String.fromCharCode (0xffff);
24078 data[2506] = String.fromCharCode (0xffff);
24079 data[2507] = String.fromCharCode (0xffff);
24080 data[2508] = String.fromCharCode (0xffff);
24081 data[2509] = String.fromCharCode (0xffff);
24082 data[2510] = String.fromCharCode (0xffff);
24083 data[2511] = String.fromCharCode (0xffff);
24084 data[2512] = String.fromCharCode (0xffff);
24085 data[2513] = String.fromCharCode (0xffff);
24086 data[2514] = String.fromCharCode (0xffff);
24087 data[2515] = String.fromCharCode (0xffff);
24088 data[2516] = String.fromCharCode (0xffff);
24089 data[2517] = String.fromCharCode (0xffff);
24090 data[2518] = String.fromCharCode (0xffff);
24091 data[2519] = String.fromCharCode (0xffff);
24092 data[2520] = String.fromCharCode (0xffff);
24093 data[2521] = String.fromCharCode (0xffff);
24094 data[2522] = String.fromCharCode (0xffff);
24095 data[2523] = String.fromCharCode (0xffff);
24096 data[2524] = String.fromCharCode (0xffff);
24097 data[2525] = String.fromCharCode (0xffff);
24098 data[2526] = String.fromCharCode (0xffff);
24099 data[2527] = String.fromCharCode (0xffff);
24100 data[2528] = String.fromCharCode (0xffff);
24101 data[2529] = String.fromCharCode (0xffff);
24102 data[2530] = String.fromCharCode (0xffff);
24103 data[2531] = String.fromCharCode (0xffff);
24104 data[2532] = String.fromCharCode (0xffff);
24105 data[2533] = String.fromCharCode (0xffff);
24106 data[2534] = String.fromCharCode (0xffff);
24107 data[2535] = String.fromCharCode (0xffff);
24108 data[2536] = String.fromCharCode (0xffff);
24109 data[2537] = String.fromCharCode (0xffff);
24110 data[2538] = String.fromCharCode (0xffff);
24111 data[2539] = String.fromCharCode (0xffff);
24112 data[2540] = String.fromCharCode (0xffff);
24113 data[2541] = String.fromCharCode (0xffff);
24114 data[2542] = String.fromCharCode (0xffff);
24115 data[2543] = String.fromCharCode (0xffff);
24116 data[2544] = String.fromCharCode (0xffff);
24117 data[2545] = String.fromCharCode (0xffff);
24118 data[2546] = String.fromCharCode (0xffff);
24119 data[2547] = String.fromCharCode (0xffff);
24120 data[2548] = String.fromCharCode (0xffff);
24121 data[2549] = String.fromCharCode (0xffff);
24122 data[2550] = String.fromCharCode (0xffff);
24123 data[2551] = String.fromCharCode (0xffff);
24124 data[2552] = String.fromCharCode (0xffff);
24125 data[2553] = String.fromCharCode (0xffff);
24126 data[2554] = String.fromCharCode (0x003f);
24127 data[2752] = String.fromCharCode (0xffff);
24128 data[2753] = String.fromCharCode (0xffff);
24129 data[2754] = String.fromCharCode (0xffff);
24130 data[2755] = String.fromCharCode (0xffff);
24131 data[2756] = String.fromCharCode (0xffff);
24132 data[2757] = String.fromCharCode (0xffff);
24133 data[2758] = String.fromCharCode (0xffff);
24134 data[2759] = String.fromCharCode (0xffff);
24135 data[2760] = String.fromCharCode (0xffff);
24136 data[2761] = String.fromCharCode (0xffff);
24137 data[2762] = String.fromCharCode (0xffff);
24138 data[2763] = String.fromCharCode (0xffff);
24139 data[2764] = String.fromCharCode (0xffff);
24140 data[2765] = String.fromCharCode (0xffff);
24141 data[2766] = String.fromCharCode (0xffff);
24142 data[2767] = String.fromCharCode (0xffff);
24143 data[2768] = String.fromCharCode (0xffff);
24144 data[2769] = String.fromCharCode (0xffff);
24145 data[2770] = String.fromCharCode (0xffff);
24146 data[2771] = String.fromCharCode (0xffff);
24147 data[2772] = String.fromCharCode (0xffff);
24148 data[2773] = String.fromCharCode (0xffff);
24149 data[2774] = String.fromCharCode (0xffff);
24150 data[2775] = String.fromCharCode (0xffff);
24151 data[2776] = String.fromCharCode (0xffff);
24152 data[2777] = String.fromCharCode (0xffff);
24153 data[2778] = String.fromCharCode (0xffff);
24154 data[2779] = String.fromCharCode (0xffff);
24155 data[2780] = String.fromCharCode (0xffff);
24156 data[2781] = String.fromCharCode (0xffff);
24157 data[2782] = String.fromCharCode (0xffff);
24158 data[2783] = String.fromCharCode (0xffff);
24159 data[2784] = String.fromCharCode (0xffff);
24160 data[2785] = String.fromCharCode (0xffff);
24161 data[2786] = String.fromCharCode (0xffff);
24162 data[2787] = String.fromCharCode (0xffff);
24163 data[2788] = String.fromCharCode (0xffff);
24164 data[2789] = String.fromCharCode (0xffff);
24165 data[2790] = String.fromCharCode (0xffff);
24166 data[2791] = String.fromCharCode (0xffff);
24167 data[2792] = String.fromCharCode (0xffff);
24168 data[2793] = String.fromCharCode (0xffff);
24169 data[2794] = String.fromCharCode (0xffff);
24170 data[2795] = String.fromCharCode (0xffff);
24171 data[2796] = String.fromCharCode (0xffff);
24172 data[2797] = String.fromCharCode (0xffff);
24173 data[2798] = String.fromCharCode (0xffff);
24174 data[2799] = String.fromCharCode (0xffff);
24175 data[2800] = String.fromCharCode (0xffff);
24176 data[2801] = String.fromCharCode (0xffff);
24177 data[2802] = String.fromCharCode (0xffff);
24178 data[2803] = String.fromCharCode (0xffff);
24179 data[2804] = String.fromCharCode (0xffff);
24180 data[2805] = String.fromCharCode (0xffff);
24181 data[2806] = String.fromCharCode (0xffff);
24182 data[2807] = String.fromCharCode (0xffff);
24183 data[2808] = String.fromCharCode (0xffff);
24184 data[2809] = String.fromCharCode (0xffff);
24185 data[2810] = String.fromCharCode (0xffff);
24186 data[2811] = String.fromCharCode (0xffff);
24187 data[2812] = String.fromCharCode (0xffff);
24188 data[2813] = String.fromCharCode (0xffff);
24189 data[2814] = String.fromCharCode (0xffff);
24190 data[2815] = String.fromCharCode (0xffff);
24191 data[2816] = String.fromCharCode (0xffff);
24192 data[2817] = String.fromCharCode (0xffff);
24193 data[2818] = String.fromCharCode (0xffff);
24194 data[2819] = String.fromCharCode (0xffff);
24195 data[2820] = String.fromCharCode (0xffff);
24196 data[2821] = String.fromCharCode (0xffff);
24197 data[2822] = String.fromCharCode (0xffff);
24198 data[2823] = String.fromCharCode (0xffff);
24199 data[2824] = String.fromCharCode (0xffff);
24200 data[2825] = String.fromCharCode (0xffff);
24201 data[2826] = String.fromCharCode (0xffff);
24202 data[2827] = String.fromCharCode (0xffff);
24203 data[2828] = String.fromCharCode (0xffff);
24204 data[2829] = String.fromCharCode (0xffff);
24205 data[2830] = String.fromCharCode (0xffff);
24206 data[2831] = String.fromCharCode (0xffff);
24207 data[2832] = String.fromCharCode (0xffff);
24208 data[2833] = String.fromCharCode (0xffff);
24209 data[2834] = String.fromCharCode (0xffff);
24210 data[2835] = String.fromCharCode (0xffff);
24211 data[2836] = String.fromCharCode (0xffff);
24212 data[2837] = String.fromCharCode (0xffff);
24213 data[2838] = String.fromCharCode (0xffff);
24214 data[2839] = String.fromCharCode (0xffff);
24215 data[2840] = String.fromCharCode (0xffff);
24216 data[2841] = String.fromCharCode (0xffff);
24217 data[2842] = String.fromCharCode (0xffff);
24218 data[2843] = String.fromCharCode (0xffff);
24219 data[2844] = String.fromCharCode (0xffff);
24220 data[2845] = String.fromCharCode (0xffff);
24221 data[2846] = String.fromCharCode (0xffff);
24222 data[2847] = String.fromCharCode (0xffff);
24223 data[2848] = String.fromCharCode (0xffff);
24224 data[2849] = String.fromCharCode (0xffff);
24225 data[2850] = String.fromCharCode (0xffff);
24226 data[2851] = String.fromCharCode (0xffff);
24227 data[2852] = String.fromCharCode (0xffff);
24228 data[2853] = String.fromCharCode (0xffff);
24229 data[2854] = String.fromCharCode (0xffff);
24230 data[2855] = String.fromCharCode (0xffff);
24231 data[2856] = String.fromCharCode (0xffff);
24232 data[2857] = String.fromCharCode (0xffff);
24233 data[2858] = String.fromCharCode (0xffff);
24234 data[2859] = String.fromCharCode (0xffff);
24235 data[2860] = String.fromCharCode (0xffff);
24236 data[2861] = String.fromCharCode (0xffff);
24237 data[2862] = String.fromCharCode (0xffff);
24238 data[2863] = String.fromCharCode (0xffff);
24239 data[2864] = String.fromCharCode (0xffff);
24240 data[2865] = String.fromCharCode (0xffff);
24241 data[2866] = String.fromCharCode (0xffff);
24242 data[2867] = String.fromCharCode (0xffff);
24243 data[2868] = String.fromCharCode (0xffff);
24244 data[2869] = String.fromCharCode (0xffff);
24245 data[2870] = String.fromCharCode (0xffff);
24246 data[2871] = String.fromCharCode (0xffff);
24247 data[2872] = String.fromCharCode (0xffff);
24248 data[2873] = String.fromCharCode (0xffff);
24249 data[2874] = String.fromCharCode (0xffff);
24250 data[2875] = String.fromCharCode (0xffff);
24251 data[2876] = String.fromCharCode (0xffff);
24252 data[2877] = String.fromCharCode (0xffff);
24253 data[2878] = String.fromCharCode (0xffff);
24254 data[2879] = String.fromCharCode (0xffff);
24255 data[2880] = String.fromCharCode (0xffff);
24256 data[2881] = String.fromCharCode (0xffff);
24257 data[2882] = String.fromCharCode (0xffff);
24258 data[2883] = String.fromCharCode (0xffff);
24259 data[2884] = String.fromCharCode (0xffff);
24260 data[2885] = String.fromCharCode (0xffff);
24261 data[2886] = String.fromCharCode (0xffff);
24262 data[2887] = String.fromCharCode (0xffff);
24263 data[2888] = String.fromCharCode (0xffff);
24264 data[2889] = String.fromCharCode (0xffff);
24265 data[2890] = String.fromCharCode (0xffff);
24266 data[2891] = String.fromCharCode (0xffff);
24267 data[2892] = String.fromCharCode (0xffff);
24268 data[2893] = String.fromCharCode (0xffff);
24269 data[2894] = String.fromCharCode (0xffff);
24270 data[2895] = String.fromCharCode (0xffff);
24271 data[2896] = String.fromCharCode (0xffff);
24272 data[2897] = String.fromCharCode (0xffff);
24273 data[2898] = String.fromCharCode (0xffff);
24274 data[2899] = String.fromCharCode (0xffff);
24275 data[2900] = String.fromCharCode (0xffff);
24276 data[2901] = String.fromCharCode (0xffff);
24277 data[2902] = String.fromCharCode (0xffff);
24278 data[2903] = String.fromCharCode (0xffff);
24279 data[2904] = String.fromCharCode (0xffff);
24280 data[2905] = String.fromCharCode (0xffff);
24281 data[2906] = String.fromCharCode (0xffff);
24282 data[2907] = String.fromCharCode (0xffff);
24283 data[2908] = String.fromCharCode (0xffff);
24284 data[2909] = String.fromCharCode (0xffff);
24285 data[2910] = String.fromCharCode (0xffff);
24286 data[2911] = String.fromCharCode (0xffff);
24287 data[2912] = String.fromCharCode (0xffff);
24288 data[2913] = String.fromCharCode (0xffff);
24289 data[2914] = String.fromCharCode (0xffff);
24290 data[2915] = String.fromCharCode (0xffff);
24291 data[2916] = String.fromCharCode (0xffff);
24292 data[2917] = String.fromCharCode (0xffff);
24293 data[2918] = String.fromCharCode (0xffff);
24294 data[2919] = String.fromCharCode (0xffff);
24295 data[2920] = String.fromCharCode (0xffff);
24296 data[2921] = String.fromCharCode (0xffff);
24297 data[2922] = String.fromCharCode (0xffff);
24298 data[2923] = String.fromCharCode (0xffff);
24299 data[2924] = String.fromCharCode (0xffff);
24300 data[2925] = String.fromCharCode (0xffff);
24301 data[2926] = String.fromCharCode (0xffff);
24302 data[2927] = String.fromCharCode (0xffff);
24303 data[2928] = String.fromCharCode (0xffff);
24304 data[2929] = String.fromCharCode (0xffff);
24305 data[2930] = String.fromCharCode (0xffff);
24306 data[2931] = String.fromCharCode (0xffff);
24307 data[2932] = String.fromCharCode (0xffff);
24308 data[2933] = String.fromCharCode (0xffff);
24309 data[2934] = String.fromCharCode (0xffff);
24310 data[2935] = String.fromCharCode (0xffff);
24311 data[2936] = String.fromCharCode (0xffff);
24312 data[2937] = String.fromCharCode (0xffff);
24313 data[2938] = String.fromCharCode (0xffff);
24314 data[2939] = String.fromCharCode (0xffff);
24315 data[2940] = String.fromCharCode (0xffff);
24316 data[2941] = String.fromCharCode (0xffff);
24317 data[2942] = String.fromCharCode (0xffff);
24318 data[2943] = String.fromCharCode (0xffff);
24319 data[2944] = String.fromCharCode (0xffff);
24320 data[2945] = String.fromCharCode (0xffff);
24321 data[2946] = String.fromCharCode (0xffff);
24322 data[2947] = String.fromCharCode (0xffff);
24323 data[2948] = String.fromCharCode (0xffff);
24324 data[2949] = String.fromCharCode (0xffff);
24325 data[2950] = String.fromCharCode (0xffff);
24326 data[2951] = String.fromCharCode (0xffff);
24327 data[2952] = String.fromCharCode (0xffff);
24328 data[2953] = String.fromCharCode (0xffff);
24329 data[2954] = String.fromCharCode (0xffff);
24330 data[2955] = String.fromCharCode (0xffff);
24331 data[2956] = String.fromCharCode (0xffff);
24332 data[2957] = String.fromCharCode (0xffff);
24333 data[2958] = String.fromCharCode (0xffff);
24334 data[2959] = String.fromCharCode (0xffff);
24335 data[2960] = String.fromCharCode (0xffff);
24336 data[2961] = String.fromCharCode (0xffff);
24337 data[2962] = String.fromCharCode (0xffff);
24338 data[2963] = String.fromCharCode (0xffff);
24339 data[2964] = String.fromCharCode (0xffff);
24340 data[2965] = String.fromCharCode (0xffff);
24341 data[2966] = String.fromCharCode (0xffff);
24342 data[2967] = String.fromCharCode (0xffff);
24343 data[2968] = String.fromCharCode (0xffff);
24344 data[2969] = String.fromCharCode (0xffff);
24345 data[2970] = String.fromCharCode (0xffff);
24346 data[2971] = String.fromCharCode (0xffff);
24347 data[2972] = String.fromCharCode (0xffff);
24348 data[2973] = String.fromCharCode (0xffff);
24349 data[2974] = String.fromCharCode (0xffff);
24350 data[2975] = String.fromCharCode (0xffff);
24351 data[2976] = String.fromCharCode (0xffff);
24352 data[2977] = String.fromCharCode (0xffff);
24353 data[2978] = String.fromCharCode (0xffff);
24354 data[2979] = String.fromCharCode (0xffff);
24355 data[2980] = String.fromCharCode (0xffff);
24356 data[2981] = String.fromCharCode (0xffff);
24357 data[2982] = String.fromCharCode (0xffff);
24358 data[2983] = String.fromCharCode (0xffff);
24359 data[2984] = String.fromCharCode (0xffff);
24360 data[2985] = String.fromCharCode (0xffff);
24361 data[2986] = String.fromCharCode (0xffff);
24362 data[2987] = String.fromCharCode (0xffff);
24363 data[2988] = String.fromCharCode (0xffff);
24364 data[2989] = String.fromCharCode (0xffff);
24365 data[2990] = String.fromCharCode (0xffff);
24366 data[2991] = String.fromCharCode (0xffff);
24367 data[2992] = String.fromCharCode (0xffff);
24368 data[2993] = String.fromCharCode (0xffff);
24369 data[2994] = String.fromCharCode (0xffff);
24370 data[2995] = String.fromCharCode (0xffff);
24371 data[2996] = String.fromCharCode (0xffff);
24372 data[2997] = String.fromCharCode (0xffff);
24373 data[2998] = String.fromCharCode (0xffff);
24374 data[2999] = String.fromCharCode (0xffff);
24375 data[3000] = String.fromCharCode (0xffff);
24376 data[3001] = String.fromCharCode (0xffff);
24377 data[3002] = String.fromCharCode (0xffff);
24378 data[3003] = String.fromCharCode (0xffff);
24379 data[3004] = String.fromCharCode (0xffff);
24380 data[3005] = String.fromCharCode (0xffff);
24381 data[3006] = String.fromCharCode (0xffff);
24382 data[3007] = String.fromCharCode (0xffff);
24383 data[3008] = String.fromCharCode (0xffff);
24384 data[3009] = String.fromCharCode (0xffff);
24385 data[3010] = String.fromCharCode (0xffff);
24386 data[3011] = String.fromCharCode (0xffff);
24387 data[3012] = String.fromCharCode (0xffff);
24388 data[3013] = String.fromCharCode (0xffff);
24389 data[3014] = String.fromCharCode (0xffff);
24390 data[3015] = String.fromCharCode (0xffff);
24391 data[3016] = String.fromCharCode (0xffff);
24392 data[3017] = String.fromCharCode (0xffff);
24393 data[3018] = String.fromCharCode (0xffff);
24394 data[3019] = String.fromCharCode (0xffff);
24395 data[3020] = String.fromCharCode (0xffff);
24396 data[3021] = String.fromCharCode (0xffff);
24397 data[3022] = String.fromCharCode (0xffff);
24398 data[3023] = String.fromCharCode (0xffff);
24399 data[3024] = String.fromCharCode (0xffff);
24400 data[3025] = String.fromCharCode (0xffff);
24401 data[3026] = String.fromCharCode (0xffff);
24402 data[3027] = String.fromCharCode (0xffff);
24403 data[3028] = String.fromCharCode (0xffff);
24404 data[3029] = String.fromCharCode (0xffff);
24405 data[3030] = String.fromCharCode (0xffff);
24406 data[3031] = String.fromCharCode (0xffff);
24407 data[3032] = String.fromCharCode (0xffff);
24408 data[3033] = String.fromCharCode (0xffff);
24409 data[3034] = String.fromCharCode (0xffff);
24410 data[3035] = String.fromCharCode (0xffff);
24411 data[3036] = String.fromCharCode (0xffff);
24412 data[3037] = String.fromCharCode (0xffff);
24413 data[3038] = String.fromCharCode (0xffff);
24414 data[3039] = String.fromCharCode (0xffff);
24415 data[3040] = String.fromCharCode (0xffff);
24416 data[3041] = String.fromCharCode (0xffff);
24417 data[3042] = String.fromCharCode (0xffff);
24418 data[3043] = String.fromCharCode (0xffff);
24419 data[3044] = String.fromCharCode (0xffff);
24420 data[3045] = String.fromCharCode (0xffff);
24421 data[3046] = String.fromCharCode (0xffff);
24422 data[3047] = String.fromCharCode (0xffff);
24423 data[3048] = String.fromCharCode (0xffff);
24424 data[3049] = String.fromCharCode (0xffff);
24425 data[3050] = String.fromCharCode (0xffff);
24426 data[3051] = String.fromCharCode (0xffff);
24427 data[3052] = String.fromCharCode (0xffff);
24428 data[3053] = String.fromCharCode (0xffff);
24429 data[3054] = String.fromCharCode (0xffff);
24430 data[3055] = String.fromCharCode (0xffff);
24431 data[3056] = String.fromCharCode (0xffff);
24432 data[3057] = String.fromCharCode (0xffff);
24433 data[3058] = String.fromCharCode (0xffff);
24434 data[3059] = String.fromCharCode (0xffff);
24435 data[3060] = String.fromCharCode (0xffff);
24436 data[3061] = String.fromCharCode (0xffff);
24437 data[3062] = String.fromCharCode (0xffff);
24438 data[3063] = String.fromCharCode (0xffff);
24439 data[3064] = String.fromCharCode (0xffff);
24440 data[3065] = String.fromCharCode (0xffff);
24441 data[3066] = String.fromCharCode (0xffff);
24442 data[3067] = String.fromCharCode (0xffff);
24443 data[3068] = String.fromCharCode (0xffff);
24444 data[3069] = String.fromCharCode (0xffff);
24445 data[3070] = String.fromCharCode (0xffff);
24446 data[3071] = String.fromCharCode (0xffff);
24447 data[3072] = String.fromCharCode (0xffff);
24448 data[3073] = String.fromCharCode (0xffff);
24449 data[3074] = String.fromCharCode (0xffff);
24450 data[3075] = String.fromCharCode (0xffff);
24451 data[3076] = String.fromCharCode (0xffff);
24452 data[3077] = String.fromCharCode (0xffff);
24453 data[3078] = String.fromCharCode (0xffff);
24454 data[3079] = String.fromCharCode (0xffff);
24455 data[3080] = String.fromCharCode (0xffff);
24456 data[3081] = String.fromCharCode (0xffff);
24457 data[3082] = String.fromCharCode (0xffff);
24458 data[3083] = String.fromCharCode (0xffff);
24459 data[3084] = String.fromCharCode (0xffff);
24460 data[3085] = String.fromCharCode (0xffff);
24461 data[3086] = String.fromCharCode (0xffff);
24462 data[3087] = String.fromCharCode (0xffff);
24463 data[3088] = String.fromCharCode (0xffff);
24464 data[3089] = String.fromCharCode (0xffff);
24465 data[3090] = String.fromCharCode (0xffff);
24466 data[3091] = String.fromCharCode (0xffff);
24467 data[3092] = String.fromCharCode (0xffff);
24468 data[3093] = String.fromCharCode (0xffff);
24469 data[3094] = String.fromCharCode (0xffff);
24470 data[3095] = String.fromCharCode (0xffff);
24471 data[3096] = String.fromCharCode (0xffff);
24472 data[3097] = String.fromCharCode (0xffff);
24473 data[3098] = String.fromCharCode (0xffff);
24474 data[3099] = String.fromCharCode (0xffff);
24475 data[3100] = String.fromCharCode (0xffff);
24476 data[3101] = String.fromCharCode (0xffff);
24477 data[3102] = String.fromCharCode (0xffff);
24478 data[3103] = String.fromCharCode (0xffff);
24479 data[3104] = String.fromCharCode (0xffff);
24480 data[3105] = String.fromCharCode (0xffff);
24481 data[3106] = String.fromCharCode (0xffff);
24482 data[3107] = String.fromCharCode (0xffff);
24483 data[3108] = String.fromCharCode (0xffff);
24484 data[3109] = String.fromCharCode (0xffff);
24485 data[3110] = String.fromCharCode (0xffff);
24486 data[3111] = String.fromCharCode (0xffff);
24487 data[3112] = String.fromCharCode (0xffff);
24488 data[3113] = String.fromCharCode (0xffff);
24489 data[3114] = String.fromCharCode (0xffff);
24490 data[3115] = String.fromCharCode (0xffff);
24491 data[3116] = String.fromCharCode (0xffff);
24492 data[3117] = String.fromCharCode (0xffff);
24493 data[3118] = String.fromCharCode (0xffff);
24494 data[3119] = String.fromCharCode (0xffff);
24495 data[3120] = String.fromCharCode (0xffff);
24496 data[3121] = String.fromCharCode (0xffff);
24497 data[3122] = String.fromCharCode (0xffff);
24498 data[3123] = String.fromCharCode (0xffff);
24499 data[3124] = String.fromCharCode (0xffff);
24500 data[3125] = String.fromCharCode (0xffff);
24501 data[3126] = String.fromCharCode (0xffff);
24502 data[3127] = String.fromCharCode (0xffff);
24503 data[3128] = String.fromCharCode (0xffff);
24504 data[3129] = String.fromCharCode (0xffff);
24505 data[3130] = String.fromCharCode (0xffff);
24506 data[3131] = String.fromCharCode (0xffff);
24507 data[3132] = String.fromCharCode (0xffff);
24508 data[3133] = String.fromCharCode (0xffff);
24509 data[3134] = String.fromCharCode (0xffff);
24510 data[3135] = String.fromCharCode (0xffff);
24511 data[3136] = String.fromCharCode (0xffff);
24512 data[3137] = String.fromCharCode (0xffff);
24513 data[3138] = String.fromCharCode (0xffff);
24514 data[3139] = String.fromCharCode (0xffff);
24515 data[3140] = String.fromCharCode (0xffff);
24516 data[3141] = String.fromCharCode (0xffff);
24517 data[3142] = String.fromCharCode (0xffff);
24518 data[3143] = String.fromCharCode (0xffff);
24519 data[3144] = String.fromCharCode (0xffff);
24520 data[3145] = String.fromCharCode (0xffff);
24521 data[3146] = String.fromCharCode (0xffff);
24522 data[3147] = String.fromCharCode (0xffff);
24523 data[3148] = String.fromCharCode (0xffff);
24524 data[3149] = String.fromCharCode (0xffff);
24525 data[3150] = String.fromCharCode (0xffff);
24526 data[3151] = String.fromCharCode (0xffff);
24527 data[3152] = String.fromCharCode (0xffff);
24528 data[3153] = String.fromCharCode (0xffff);
24529 data[3154] = String.fromCharCode (0xffff);
24530 data[3155] = String.fromCharCode (0xffff);
24531 data[3156] = String.fromCharCode (0xffff);
24532 data[3157] = String.fromCharCode (0xffff);
24533 data[3158] = String.fromCharCode (0xffff);
24534 data[3159] = String.fromCharCode (0xffff);
24535 data[3160] = String.fromCharCode (0xffff);
24536 data[3161] = String.fromCharCode (0xffff);
24537 data[3162] = String.fromCharCode (0xffff);
24538 data[3163] = String.fromCharCode (0xffff);
24539 data[3164] = String.fromCharCode (0xffff);
24540 data[3165] = String.fromCharCode (0xffff);
24541 data[3166] = String.fromCharCode (0xffff);
24542 data[3167] = String.fromCharCode (0xffff);
24543 data[3168] = String.fromCharCode (0xffff);
24544 data[3169] = String.fromCharCode (0xffff);
24545 data[3170] = String.fromCharCode (0xffff);
24546 data[3171] = String.fromCharCode (0xffff);
24547 data[3172] = String.fromCharCode (0xffff);
24548 data[3173] = String.fromCharCode (0xffff);
24549 data[3174] = String.fromCharCode (0xffff);
24550 data[3175] = String.fromCharCode (0xffff);
24551 data[3176] = String.fromCharCode (0xffff);
24552 data[3177] = String.fromCharCode (0xffff);
24553 data[3178] = String.fromCharCode (0xffff);
24554 data[3179] = String.fromCharCode (0xffff);
24555 data[3180] = String.fromCharCode (0xffff);
24556 data[3181] = String.fromCharCode (0xffff);
24557 data[3182] = String.fromCharCode (0xffff);
24558 data[3183] = String.fromCharCode (0xffff);
24559 data[3184] = String.fromCharCode (0xffff);
24560 data[3185] = String.fromCharCode (0xffff);
24561 data[3186] = String.fromCharCode (0xffff);
24562 data[3187] = String.fromCharCode (0xffff);
24563 data[3188] = String.fromCharCode (0xffff);
24564 data[3189] = String.fromCharCode (0xffff);
24565 data[3190] = String.fromCharCode (0xffff);
24566 data[3191] = String.fromCharCode (0xffff);
24567 data[3192] = String.fromCharCode (0xffff);
24568 data[3193] = String.fromCharCode (0xffff);
24569 data[3194] = String.fromCharCode (0xffff);
24570 data[3195] = String.fromCharCode (0xffff);
24571 data[3196] = String.fromCharCode (0xffff);
24572 data[3197] = String.fromCharCode (0xffff);
24573 data[3198] = String.fromCharCode (0xffff);
24574 data[3199] = String.fromCharCode (0xffff);
24575 data[3200] = String.fromCharCode (0xffff);
24576 data[3201] = String.fromCharCode (0xffff);
24577 data[3202] = String.fromCharCode (0xffff);
24578 data[3203] = String.fromCharCode (0xffff);
24579 data[3204] = String.fromCharCode (0xffff);
24580 data[3205] = String.fromCharCode (0xffff);
24581 data[3206] = String.fromCharCode (0xffff);
24582 data[3207] = String.fromCharCode (0xffff);
24583 data[3208] = String.fromCharCode (0xffff);
24584 data[3209] = String.fromCharCode (0xffff);
24585 data[3210] = String.fromCharCode (0xffff);
24586 data[3211] = String.fromCharCode (0xffff);
24587 data[3212] = String.fromCharCode (0xffff);
24588 data[3213] = String.fromCharCode (0xffff);
24589 data[3214] = String.fromCharCode (0xffff);
24590 data[3215] = String.fromCharCode (0xffff);
24591 data[3216] = String.fromCharCode (0xffff);
24592 data[3217] = String.fromCharCode (0xffff);
24593 data[3218] = String.fromCharCode (0xffff);
24594 data[3219] = String.fromCharCode (0xffff);
24595 data[3220] = String.fromCharCode (0xffff);
24596 data[3221] = String.fromCharCode (0xffff);
24597 data[3222] = String.fromCharCode (0xffff);
24598 data[3223] = String.fromCharCode (0xffff);
24599 data[3224] = String.fromCharCode (0xffff);
24600 data[3225] = String.fromCharCode (0xffff);
24601 data[3226] = String.fromCharCode (0xffff);
24602 data[3227] = String.fromCharCode (0xffff);
24603 data[3228] = String.fromCharCode (0xffff);
24604 data[3229] = String.fromCharCode (0xffff);
24605 data[3230] = String.fromCharCode (0xffff);
24606 data[3231] = String.fromCharCode (0xffff);
24607 data[3232] = String.fromCharCode (0xffff);
24608 data[3233] = String.fromCharCode (0xffff);
24609 data[3234] = String.fromCharCode (0xffff);
24610 data[3235] = String.fromCharCode (0xffff);
24611 data[3236] = String.fromCharCode (0xffff);
24612 data[3237] = String.fromCharCode (0xffff);
24613 data[3238] = String.fromCharCode (0xffff);
24614 data[3239] = String.fromCharCode (0xffff);
24615 data[3240] = String.fromCharCode (0xffff);
24616 data[3241] = String.fromCharCode (0xffff);
24617 data[3242] = String.fromCharCode (0xffff);
24618 data[3243] = String.fromCharCode (0xffff);
24619 data[3244] = String.fromCharCode (0xffff);
24620 data[3245] = String.fromCharCode (0xffff);
24621 data[3246] = String.fromCharCode (0xffff);
24622 data[3247] = String.fromCharCode (0xffff);
24623 data[3248] = String.fromCharCode (0xffff);
24624 data[3249] = String.fromCharCode (0xffff);
24625 data[3250] = String.fromCharCode (0xffff);
24626 data[3251] = String.fromCharCode (0xffff);
24627 data[3252] = String.fromCharCode (0xffff);
24628 data[3253] = String.fromCharCode (0xffff);
24629 data[3254] = String.fromCharCode (0xffff);
24630 data[3255] = String.fromCharCode (0xffff);
24631 data[3256] = String.fromCharCode (0xffff);
24632 data[3257] = String.fromCharCode (0xffff);
24633 data[3258] = String.fromCharCode (0xffff);
24634 data[3259] = String.fromCharCode (0xffff);
24635 data[3260] = String.fromCharCode (0xffff);
24636 data[3261] = String.fromCharCode (0xffff);
24637 data[3262] = String.fromCharCode (0xffff);
24638 data[3263] = String.fromCharCode (0xffff);
24639 data[3264] = String.fromCharCode (0xffff);
24640 data[3265] = String.fromCharCode (0xffff);
24641 data[3266] = String.fromCharCode (0xffff);
24642 data[3267] = String.fromCharCode (0xffff);
24643 data[3268] = String.fromCharCode (0xffff);
24644 data[3269] = String.fromCharCode (0xffff);
24645 data[3270] = String.fromCharCode (0xffff);
24646 data[3271] = String.fromCharCode (0xffff);
24647 data[3272] = String.fromCharCode (0xffff);
24648 data[3273] = String.fromCharCode (0xffff);
24649 data[3274] = String.fromCharCode (0xffff);
24650 data[3275] = String.fromCharCode (0xffff);
24651 data[3276] = String.fromCharCode (0xffff);
24652 data[3277] = String.fromCharCode (0xffff);
24653 data[3278] = String.fromCharCode (0xffff);
24654 data[3279] = String.fromCharCode (0xffff);
24655 data[3280] = String.fromCharCode (0xffff);
24656 data[3281] = String.fromCharCode (0xffff);
24657 data[3282] = String.fromCharCode (0xffff);
24658 data[3283] = String.fromCharCode (0xffff);
24659 data[3284] = String.fromCharCode (0xffff);
24660 data[3285] = String.fromCharCode (0xffff);
24661 data[3286] = String.fromCharCode (0xffff);
24662 data[3287] = String.fromCharCode (0xffff);
24663 data[3288] = String.fromCharCode (0xffff);
24664 data[3289] = String.fromCharCode (0xffff);
24665 data[3290] = String.fromCharCode (0xffff);
24666 data[3291] = String.fromCharCode (0xffff);
24667 data[3292] = String.fromCharCode (0xffff);
24668 data[3293] = String.fromCharCode (0xffff);
24669 data[3294] = String.fromCharCode (0xffff);
24670 data[3295] = String.fromCharCode (0xffff);
24671 data[3296] = String.fromCharCode (0xffff);
24672 data[3297] = String.fromCharCode (0xffff);
24673 data[3298] = String.fromCharCode (0xffff);
24674 data[3299] = String.fromCharCode (0xffff);
24675 data[3300] = String.fromCharCode (0xffff);
24676 data[3301] = String.fromCharCode (0xffff);
24677 data[3302] = String.fromCharCode (0xffff);
24678 data[3303] = String.fromCharCode (0xffff);
24679 data[3304] = String.fromCharCode (0xffff);
24680 data[3305] = String.fromCharCode (0xffff);
24681 data[3306] = String.fromCharCode (0xffff);
24682 data[3307] = String.fromCharCode (0xffff);
24683 data[3308] = String.fromCharCode (0xffff);
24684 data[3309] = String.fromCharCode (0xffff);
24685 data[3310] = String.fromCharCode (0xffff);
24686 data[3311] = String.fromCharCode (0xffff);
24687 data[3312] = String.fromCharCode (0xffff);
24688 data[3313] = String.fromCharCode (0xffff);
24689 data[3314] = String.fromCharCode (0xffff);
24690 data[3315] = String.fromCharCode (0xffff);
24691 data[3316] = String.fromCharCode (0xffff);
24692 data[3317] = String.fromCharCode (0xffff);
24693 data[3318] = String.fromCharCode (0xffff);
24694 data[3319] = String.fromCharCode (0xffff);
24695 data[3320] = String.fromCharCode (0xffff);
24696 data[3321] = String.fromCharCode (0xffff);
24697 data[3322] = String.fromCharCode (0xffff);
24698 data[3323] = String.fromCharCode (0xffff);
24699 data[3324] = String.fromCharCode (0xffff);
24700 data[3325] = String.fromCharCode (0xffff);
24701 data[3326] = String.fromCharCode (0xffff);
24702 data[3327] = String.fromCharCode (0xffff);
24703 data[3328] = String.fromCharCode (0xffff);
24704 data[3329] = String.fromCharCode (0xffff);
24705 data[3330] = String.fromCharCode (0xffff);
24706 data[3331] = String.fromCharCode (0xffff);
24707 data[3332] = String.fromCharCode (0xffff);
24708 data[3333] = String.fromCharCode (0xffff);
24709 data[3334] = String.fromCharCode (0xffff);
24710 data[3335] = String.fromCharCode (0xffff);
24711 data[3336] = String.fromCharCode (0xffff);
24712 data[3337] = String.fromCharCode (0xffff);
24713 data[3338] = String.fromCharCode (0xffff);
24714 data[3339] = String.fromCharCode (0xffff);
24715 data[3340] = String.fromCharCode (0xffff);
24716 data[3341] = String.fromCharCode (0xffff);
24717 data[3342] = String.fromCharCode (0xffff);
24718 data[3343] = String.fromCharCode (0xffff);
24719 data[3344] = String.fromCharCode (0xffff);
24720 data[3345] = String.fromCharCode (0xffff);
24721 data[3346] = String.fromCharCode (0xffff);
24722 data[3347] = String.fromCharCode (0xffff);
24723 data[3348] = String.fromCharCode (0xffff);
24724 data[3349] = String.fromCharCode (0xffff);
24725 data[3350] = String.fromCharCode (0xffff);
24726 data[3351] = String.fromCharCode (0xffff);
24727 data[3352] = String.fromCharCode (0xffff);
24728 data[3353] = String.fromCharCode (0xffff);
24729 data[3354] = String.fromCharCode (0xffff);
24730 data[3355] = String.fromCharCode (0xffff);
24731 data[3356] = String.fromCharCode (0xffff);
24732 data[3357] = String.fromCharCode (0xffff);
24733 data[3358] = String.fromCharCode (0xffff);
24734 data[3359] = String.fromCharCode (0xffff);
24735 data[3360] = String.fromCharCode (0xffff);
24736 data[3361] = String.fromCharCode (0xffff);
24737 data[3362] = String.fromCharCode (0xffff);
24738 data[3363] = String.fromCharCode (0xffff);
24739 data[3364] = String.fromCharCode (0xffff);
24740 data[3365] = String.fromCharCode (0xffff);
24741 data[3366] = String.fromCharCode (0xffff);
24742 data[3367] = String.fromCharCode (0xffff);
24743 data[3368] = String.fromCharCode (0xffff);
24744 data[3369] = String.fromCharCode (0xffff);
24745 data[3370] = String.fromCharCode (0xffff);
24746 data[3371] = String.fromCharCode (0xffff);
24747 data[3372] = String.fromCharCode (0xffff);
24748 data[3373] = String.fromCharCode (0xffff);
24749 data[3374] = String.fromCharCode (0xffff);
24750 data[3375] = String.fromCharCode (0xffff);
24751 data[3376] = String.fromCharCode (0xffff);
24752 data[3377] = String.fromCharCode (0xffff);
24753 data[3378] = String.fromCharCode (0xffff);
24754 data[3379] = String.fromCharCode (0xffff);
24755 data[3380] = String.fromCharCode (0xffff);
24756 data[3381] = String.fromCharCode (0xffff);
24757 data[3382] = String.fromCharCode (0xffff);
24758 data[3383] = String.fromCharCode (0xffff);
24759 data[3384] = String.fromCharCode (0xffff);
24760 data[3385] = String.fromCharCode (0xffff);
24761 data[3386] = String.fromCharCode (0xffff);
24762 data[3387] = String.fromCharCode (0xffff);
24763 data[3388] = String.fromCharCode (0xffff);
24764 data[3389] = String.fromCharCode (0xffff);
24765 data[3390] = String.fromCharCode (0xffff);
24766 data[3391] = String.fromCharCode (0xffff);
24767 data[3392] = String.fromCharCode (0xffff);
24768 data[3393] = String.fromCharCode (0xffff);
24769 data[3394] = String.fromCharCode (0xffff);
24770 data[3395] = String.fromCharCode (0xffff);
24771 data[3396] = String.fromCharCode (0xffff);
24772 data[3397] = String.fromCharCode (0xffff);
24773 data[3398] = String.fromCharCode (0xffff);
24774 data[3399] = String.fromCharCode (0xffff);
24775 data[3400] = String.fromCharCode (0xffff);
24776 data[3401] = String.fromCharCode (0xffff);
24777 data[3402] = String.fromCharCode (0xffff);
24778 data[3403] = String.fromCharCode (0xffff);
24779 data[3404] = String.fromCharCode (0xffff);
24780 data[3405] = String.fromCharCode (0xffff);
24781 data[3406] = String.fromCharCode (0xffff);
24782 data[3407] = String.fromCharCode (0xffff);
24783 data[3408] = String.fromCharCode (0xffff);
24784 data[3409] = String.fromCharCode (0xffff);
24785 data[3410] = String.fromCharCode (0xffff);
24786 data[3411] = String.fromCharCode (0xffff);
24787 data[3412] = String.fromCharCode (0xffff);
24788 data[3413] = String.fromCharCode (0xffff);
24789 data[3414] = String.fromCharCode (0xffff);
24790 data[3415] = String.fromCharCode (0xffff);
24791 data[3416] = String.fromCharCode (0xffff);
24792 data[3417] = String.fromCharCode (0xffff);
24793 data[3418] = String.fromCharCode (0xffff);
24794 data[3419] = String.fromCharCode (0xffff);
24795 data[3420] = String.fromCharCode (0xffff);
24796 data[3421] = String.fromCharCode (0xffff);
24797 data[3422] = String.fromCharCode (0xffff);
24798 data[3423] = String.fromCharCode (0xffff);
24799 data[3424] = String.fromCharCode (0xffff);
24800 data[3425] = String.fromCharCode (0xffff);
24801 data[3426] = String.fromCharCode (0xffff);
24802 data[3427] = String.fromCharCode (0xffff);
24803 data[3428] = String.fromCharCode (0xffff);
24804 data[3429] = String.fromCharCode (0xffff);
24805 data[3430] = String.fromCharCode (0xffff);
24806 data[3431] = String.fromCharCode (0xffff);
24807 data[3432] = String.fromCharCode (0xffff);
24808 data[3433] = String.fromCharCode (0xffff);
24809 data[3434] = String.fromCharCode (0xffff);
24810 data[3435] = String.fromCharCode (0xffff);
24811 data[3436] = String.fromCharCode (0xffff);
24812 data[3437] = String.fromCharCode (0xffff);
24813 data[3438] = String.fromCharCode (0xffff);
24814 data[3439] = String.fromCharCode (0xffff);
24815 data[3440] = String.fromCharCode (0xffff);
24816 data[3441] = String.fromCharCode (0xffff);
24817 data[3442] = String.fromCharCode (0xffff);
24818 data[3443] = String.fromCharCode (0xffff);
24819 data[3444] = String.fromCharCode (0xffff);
24820 data[3445] = String.fromCharCode (0xffff);
24821 data[3446] = String.fromCharCode (0xffff);
24822 data[3447] = String.fromCharCode (0xffff);
24823 data[3448] = String.fromCharCode (0xffff);
24824 data[3449] = String.fromCharCode (0xffff);
24825 data[3450] = String.fromCharCode (0x000f);
24826 data[3984] = String.fromCharCode (0xffff);
24827 data[3985] = String.fromCharCode (0xffff);
24828 data[3986] = String.fromCharCode (0xffff);
24829 data[3987] = String.fromCharCode (0xffff);
24830 data[3988] = String.fromCharCode (0xffff);
24831 data[3989] = String.fromCharCode (0xffff);
24832 data[3990] = String.fromCharCode (0xffff);
24833 data[3991] = String.fromCharCode (0xffff);
24834 data[3992] = String.fromCharCode (0xffff);
24835 data[3993] = String.fromCharCode (0xffff);
24836 data[3994] = String.fromCharCode (0xffff);
24837 data[3995] = String.fromCharCode (0xffff);
24838 data[3996] = String.fromCharCode (0xffff);
24839 data[3997] = String.fromCharCode (0xffff);
24840 data[3998] = String.fromCharCode (0xffff);
24841 data[3999] = String.fromCharCode (0xffff);
24842 data[4000] = String.fromCharCode (0xffff);
24843 data[4001] = String.fromCharCode (0xffff);
24844 data[4002] = String.fromCharCode (0x3fff);
24845 data[4016] = String.fromCharCode (0x007f);
24846 data[4017] = String.fromCharCode (0x80f8);
24847 data[4018] = String.fromCharCode (0xfdff);
24848 data[4019] = String.fromCharCode (0x5f7f);
24849 data[4020] = String.fromCharCode (0xffdb);
24850 data[4021] = String.fromCharCode (0xffff);
24851 data[4022] = String.fromCharCode (0xffff);
24852 data[4023] = String.fromCharCode (0xffff);
24853 data[4024] = String.fromCharCode (0xffff);
24854 data[4025] = String.fromCharCode (0xffff);
24855 data[4026] = String.fromCharCode (0xffff);
24856 data[4027] = String.fromCharCode (0x0003);
24857 data[4029] = String.fromCharCode (0xfff8);
24858 data[4030] = String.fromCharCode (0xffff);
24859 data[4031] = String.fromCharCode (0xffff);
24860 data[4032] = String.fromCharCode (0xffff);
24861 data[4033] = String.fromCharCode (0xffff);
24862 data[4034] = String.fromCharCode (0xffff);
24863 data[4035] = String.fromCharCode (0xffff);
24864 data[4036] = String.fromCharCode (0xffff);
24865 data[4037] = String.fromCharCode (0xffff);
24866 data[4038] = String.fromCharCode (0xffff);
24867 data[4039] = String.fromCharCode (0xffff);
24868 data[4040] = String.fromCharCode (0xffff);
24869 data[4041] = String.fromCharCode (0xffff);
24870 data[4042] = String.fromCharCode (0xffff);
24871 data[4043] = String.fromCharCode (0xffff);
24872 data[4044] = String.fromCharCode (0xffff);
24873 data[4045] = String.fromCharCode (0xffff);
24874 data[4046] = String.fromCharCode (0xffff);
24875 data[4047] = String.fromCharCode (0xffff);
24876 data[4048] = String.fromCharCode (0xffff);
24877 data[4049] = String.fromCharCode (0xffff);
24878 data[4050] = String.fromCharCode (0xffff);
24879 data[4051] = String.fromCharCode (0x3fff);
24880 data[4053] = String.fromCharCode (0xffff);
24881 data[4054] = String.fromCharCode (0xffff);
24882 data[4055] = String.fromCharCode (0xffff);
24883 data[4056] = String.fromCharCode (0xffff);
24884 data[4057] = String.fromCharCode (0xfffc);
24885 data[4058] = String.fromCharCode (0xffff);
24886 data[4059] = String.fromCharCode (0xffff);
24887 data[4060] = String.fromCharCode (0x00ff);
24888 data[4063] = String.fromCharCode (0x0fff);
24889 data[4071] = String.fromCharCode (0xffd7);
24890 data[4072] = String.fromCharCode (0xffff);
24891 data[4073] = String.fromCharCode (0xffff);
24892 data[4074] = String.fromCharCode (0xffff);
24893 data[4075] = String.fromCharCode (0xffff);
24894 data[4076] = String.fromCharCode (0xffff);
24895 data[4077] = String.fromCharCode (0xffff);
24896 data[4078] = String.fromCharCode (0xffff);
24897 data[4079] = String.fromCharCode (0x1fff);
24898 data[4082] = String.fromCharCode (0xfffe);
24899 data[4083] = String.fromCharCode (0x07ff);
24900 data[4084] = String.fromCharCode (0xfffe);
24901 data[4085] = String.fromCharCode (0x07ff);
24902 data[4086] = String.fromCharCode (0xffc0);
24903 data[4087] = String.fromCharCode (0xffff);
24904 data[4088] = String.fromCharCode (0xffff);
24905 data[4089] = String.fromCharCode (0xffff);
24906 data[4090] = String.fromCharCode (0xffff);
24907 data[4091] = String.fromCharCode (0x7fff);
24908 data[4092] = String.fromCharCode (0xfcfc);
24909 data[4093] = String.fromCharCode (0x1cfc);
24910 data[4100] = String.fromCharCode (0xfffe);
24911 data[4101] = String.fromCharCode (0x07ff);
24912 data[4102] = String.fromCharCode (0xfffe);
24913 data[4103] = String.fromCharCode (0x07ff);
24914 data[4106] = String.fromCharCode (0x0400);
24915 data[4107] = String.fromCharCode (0x0420);
24916 data[4108] = String.fromCharCode (0xffff);
24917 data[4109] = String.fromCharCode (0xff7f);
24918 data[4110] = String.fromCharCode (0xffff);
24919 data[4111] = String.fromCharCode (0xff7f);
24920 data[4112] = String.fromCharCode (0xffff);
24921 data[4113] = String.fromCharCode (0xffff);
24922 data[4114] = String.fromCharCode (0xffff);
24923 data[4115] = String.fromCharCode (0xffff);
24924 data[4116] = String.fromCharCode (0xffff);
24925 data[4117] = String.fromCharCode (0xffff);
24926 data[4118] = String.fromCharCode (0xffff);
24927 data[4119] = String.fromCharCode (0xffff);
24928 data[4120] = String.fromCharCode (0xffff);
24929 data[4121] = String.fromCharCode (0xffff);
24930 data[4122] = String.fromCharCode (0xffff);
24931 data[4123] = String.fromCharCode (0xffff);
24932 data[4124] = String.fromCharCode (0xffff);
24933 data[4125] = String.fromCharCode (0xffff);
24934 data[4126] = String.fromCharCode (0xffff);
24935 data[4127] = String.fromCharCode (0xfc3f);
24936 data[4128] = String.fromCharCode (0xffff);
24937 data[4129] = String.fromCharCode (0x00ff);
24938 data[4133] = String.fromCharCode (0xffff);
24939 data[4134] = String.fromCharCode (0xffff);
24940 data[4135] = String.fromCharCode (0xffff);
24941 data[4136] = String.fromCharCode (0xffff);
24942 data[4137] = String.fromCharCode (0xffff);
24943 data[4138] = String.fromCharCode (0x01ff);
24944 data[4139] = String.fromCharCode (0xf9ff);
24945 data[4140] = String.fromCharCode (0x0003);
24946 data[4141] = String.fromCharCode (0x0003);
24947 data[4142] = String.fromCharCode (0x001f);
24948 data[4151] = String.fromCharCode (0x0400);
24949 data[4152] = String.fromCharCode (0xd740);
24950 data[4153] = String.fromCharCode (0xffff);
24951 data[4154] = String.fromCharCode (0xfffb);
24952 data[4155] = String.fromCharCode (0xffff);
24953 data[4156] = String.fromCharCode (0x7fff);
24954 data[4157] = String.fromCharCode (0x547f);
24955 data[4158] = String.fromCharCode (0x00fd);
24956 });
24957 c$.white_f = Clazz_defineMethod (c$, "white_f", 
24958 function () {
24959 var data =  Clazz_newCharArray (4159, '\0');
24960 com.stevesoft.pat.Bits.white =  new com.stevesoft.pat.Bits (data);
24961 data[0] = String.fromCharCode (0x3e00);
24962 data[1] = String.fromCharCode (0xf000);
24963 data[2] = String.fromCharCode (0x0001);
24964 data[512] = String.fromCharCode (0x0fff);
24965 data[514] = String.fromCharCode (0x0300);
24966 data[768] = String.fromCharCode (0x0001);
24967 data[4096] = String.fromCharCode (0x3e00);
24968 data[4097] = String.fromCharCode (0xf000);
24969 data[4098] = String.fromCharCode (0x0001);
24970 });
24971 c$.punct_f = Clazz_defineMethod (c$, "punct_f", 
24972 function () {
24973 var data =  Clazz_newCharArray (4159, '\0');
24974 com.stevesoft.pat.Bits.punct =  new com.stevesoft.pat.Bits (data);
24975 data[2] = String.fromCharCode (0xf7ee);
24976 data[3] = String.fromCharCode (0x8c00);
24977 data[4] = String.fromCharCode (0x0001);
24978 data[5] = String.fromCharCode (0xb800);
24979 data[7] = String.fromCharCode (0x2800);
24980 data[10] = String.fromCharCode (0x2802);
24981 data[11] = String.fromCharCode (0x8880);
24982 data[55] = String.fromCharCode (0x4030);
24983 data[56] = String.fromCharCode (0x0080);
24984 data[85] = String.fromCharCode (0xfc00);
24985 data[88] = String.fromCharCode (0x0200);
24986 data[91] = String.fromCharCode (0x4000);
24987 data[92] = String.fromCharCode (0x0009);
24988 data[95] = String.fromCharCode (0x0018);
24989 data[96] = String.fromCharCode (0x1000);
24990 data[97] = String.fromCharCode (0x8800);
24991 data[102] = String.fromCharCode (0x3c00);
24992 data[109] = String.fromCharCode (0x0010);
24993 data[150] = '0';
24994 data[151] = String.fromCharCode (0x0001);
24995 data[226] = String.fromCharCode (0x8000);
24996 data[229] = String.fromCharCode (0x0c00);
24997 data[234] = String.fromCharCode (0x8000);
24998 data[240] = String.fromCharCode (0xfff0);
24999 data[241] = String.fromCharCode (0x0007);
25000 data[243] = String.fromCharCode (0x3c00);
25001 data[248] = String.fromCharCode (0x0020);
25002 data[271] = String.fromCharCode (0x0800);
25003 data[513] = String.fromCharCode (0xffff);
25004 data[514] = String.fromCharCode (0x00ff);
25005 data[515] = String.fromCharCode (0xffff);
25006 data[516] = 'o';
25007 data[519] = String.fromCharCode (0x6000);
25008 data[520] = String.fromCharCode (0x6000);
25009 data[562] = String.fromCharCode (0x0600);
25010 data[768] = String.fromCharCode (0xff4e);
25011 data[769] = String.fromCharCode (0xfff3);
25012 data[771] = String.fromCharCode (0x0001);
25013 data[783] = String.fromCharCode (0x0800);
25014 data[4051] = String.fromCharCode (0xc000);
25015 data[4067] = String.fromCharCode (0xffff);
25016 data[4068] = String.fromCharCode (0xfe1f);
25017 data[4069] = String.fromCharCode (0xfff7);
25018 data[4070] = String.fromCharCode (0x0d0b);
25019 data[4080] = String.fromCharCode (0xf7ee);
25020 data[4081] = String.fromCharCode (0x8c00);
25021 data[4082] = String.fromCharCode (0x0001);
25022 data[4083] = String.fromCharCode (0xb800);
25023 data[4085] = String.fromCharCode (0x2800);
25024 data[4086] = String.fromCharCode (0x003e);
25025 data[4098] = String.fromCharCode (0xf7ee);
25026 data[4099] = String.fromCharCode (0x8c00);
25027 data[4100] = String.fromCharCode (0x0001);
25028 data[4101] = String.fromCharCode (0xb800);
25029 data[4103] = String.fromCharCode (0x2800);
25030 data[4106] = String.fromCharCode (0x2802);
25031 data[4107] = String.fromCharCode (0x8880);
25032 data[4151] = String.fromCharCode (0x4030);
25033 data[4152] = String.fromCharCode (0x0080);
25034 });
25035 Clazz_defineStatics (c$,
25036 "upper", null,
25037 "lower", null,
25038 "title", null,
25039 "currency", null,
25040 "decimal_digit", null,
25041 "math", null,
25042 "letter", null,
25043 "white", null,
25044 "punct", null);
25045 Clazz_declarePackage ("com.stevesoft.pat");
25046 Clazz_load (["com.stevesoft.pat.Pattern", "$.RegSyntax"], ["com.stevesoft.pat.BadRangeArgs", "$.Range"], ["com.stevesoft.pat.RegSyntaxError", "$.oneChar", "$.patInt"], function () {
25047 c$ = Clazz_declareType (com.stevesoft.pat, "BadRangeArgs", com.stevesoft.pat.RegSyntax);
25048 c$ = Clazz_decorateAsClass (function () {
25049 this.lo = '\0';
25050 this.hi = '\0';
25051 this.altlo = '\0';
25052 this.althi = '\0';
25053 this.printBrackets = false;
25054 Clazz_instantialize (this, arguments);
25055 }, com.stevesoft.pat, "Range", com.stevesoft.pat.Pattern);
25056 Clazz_overrideMethod (c$, "toString", 
25057 function () {
25058 var s = com.stevesoft.pat.Pattern.protect ("" + this.lo, "[]{}(),$,-\"^.", '\\') + "-" + com.stevesoft.pat.Pattern.protect ("" + this.hi, "[]{}(),$,-\"^.", '\\');
25059 if (!this.printBrackets) {
25060 return s;
25061 }return "[" + s + "]";
25062 });
25063 Clazz_makeConstructor (c$, 
25064 function (loi, hii) {
25065 Clazz_superConstructor (this, com.stevesoft.pat.Range, []);
25066 this.lo = loi;
25067 this.hi = hii;
25068 var o = null;
25069 if (this.lo >= this.hi) {
25070 com.stevesoft.pat.RegSyntaxError.endItAll ("Badly formed []'s : " + this.lo + " >= " + this.hi);
25071 }o =  new com.stevesoft.pat.oneChar (this.lo);
25072 this.altlo = o.altc;
25073 o =  new com.stevesoft.pat.oneChar (this.hi);
25074 this.althi = o.altc;
25075 }, "~S,~S");
25076 Clazz_overrideMethod (c$, "matchInternal", 
25077 function (pos, pt) {
25078 if (pos >= pt.src.length ()) {
25079 return -1;
25080 }if (this.Masked (pos, pt)) {
25081 return -1;
25082 }var c = pt.src.charAt (pos);
25083 if (this.lo <= c && c <= this.hi || (pt.ignoreCase && (this.altlo <= c && c <= this.althi))) {
25084 return this.nextMatch (pos + 1, pt);
25085 }return -1;
25086 }, "~N,com.stevesoft.pat.Pthings");
25087 Clazz_overrideMethod (c$, "minChars", 
25088 function () {
25089 return  new com.stevesoft.pat.patInt (1);
25090 });
25091 Clazz_overrideMethod (c$, "maxChars", 
25092 function () {
25093 return  new com.stevesoft.pat.patInt (1);
25094 });
25095 Clazz_overrideMethod (c$, "clone1", 
25096 function (h) {
25097 try {
25098 var r =  new com.stevesoft.pat.Range (this.lo, this.hi);
25099 r.printBrackets = this.printBrackets;
25100 return r;
25101 } catch (rs) {
25102 if (Clazz_exceptionOf (rs, com.stevesoft.pat.RegSyntax)) {
25103 return null;
25104 } else {
25105 throw rs;
25106 }
25107 }
25108 }, "java.util.Hashtable");
25109 });
25110 Clazz_declarePackage ("com.stevesoft.pat");
25111 Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.oneChar", ["com.stevesoft.pat.CaseMgr", "$.patInt"], function () {
25112 c$ = Clazz_decorateAsClass (function () {
25113 this.c = '\0';
25114 this.altc = '\0';
25115 this.altc2 = '\0';
25116 this.mask = 0;
25117 Clazz_instantialize (this, arguments);
25118 }, com.stevesoft.pat, "oneChar", com.stevesoft.pat.Pattern);
25119 Clazz_makeConstructor (c$, 
25120 function (ci) {
25121 Clazz_superConstructor (this, com.stevesoft.pat.oneChar, []);
25122 this.c = ci;
25123 var cu;
25124 var cl;
25125 var ct;
25126 cu = com.stevesoft.pat.CaseMgr.toUpperCaseC (this.c);
25127 cl = com.stevesoft.pat.CaseMgr.toLowerCaseC (this.c);
25128 ct = com.stevesoft.pat.CaseMgr.toTitleCaseC (this.c);
25129 if (this.c == cu) {
25130 this.altc = cl;
25131 this.altc2 = ct;
25132 } else if (this.c == cl) {
25133 this.altc = cu;
25134 this.altc2 = ct;
25135 } else {
25136 this.altc = cl;
25137 this.altc2 = cu;
25138 }this.mask = this.c.charCodeAt (0) & this.altc.charCodeAt (0) & this.altc2.charCodeAt (0);
25139 }, "~S");
25140 Clazz_overrideMethod (c$, "matchInternal", 
25141 function (pos, pt) {
25142 var p;
25143 var ret = -1;
25144 if (pos < pt.src.length () && !this.Masked (pos, pt) && ((p = pt.src.charAt (pos)) == this.c || (pt.ignoreCase && (p == this.altc || p == this.altc2)))) {
25145 ret = this.nextMatch (pos + 1, pt);
25146 }return ret;
25147 }, "~N,com.stevesoft.pat.Pthings");
25148 Clazz_overrideMethod (c$, "toString", 
25149 function () {
25150 return com.stevesoft.pat.Pattern.protect ("" + this.c, "[]{}(),$,-\"^.", '\\') + this.nextString ();
25151 });
25152 Clazz_overrideMethod (c$, "minChars", 
25153 function () {
25154 return  new com.stevesoft.pat.patInt (1);
25155 });
25156 Clazz_overrideMethod (c$, "maxChars", 
25157 function () {
25158 return  new com.stevesoft.pat.patInt (1);
25159 });
25160 Clazz_overrideMethod (c$, "clone1", 
25161 function (h) {
25162 return  new com.stevesoft.pat.oneChar (this.c);
25163 }, "java.util.Hashtable");
25164 });
25165 Clazz_declarePackage ("com.stevesoft.pat");
25166 Clazz_load (["com.stevesoft.pat.Pattern", "$.oneChar", "java.util.Hashtable", "$.Vector"], ["com.stevesoft.pat.Branch", "$.RegOpt", "$.FastChar"], ["com.stevesoft.pat.Any", "$.Bracket", "$.Custom", "$.FastBracket", "$.FastMulti", "$.Multi", "$.NullPattern", "$.Or", "$.Range", "$.UniValidator", "$.patInt", "java.lang.Character", "$.StringBuffer"], function () {
25167 c$ = Clazz_declareType (com.stevesoft.pat, "FastChar", com.stevesoft.pat.oneChar);
25168 Clazz_overrideMethod (c$, "matchInternal", 
25169 function (p, pt) {
25170 return (p < pt.src.length () && pt.src.charAt (p) == this.c) ? this.nextMatch (p + 1, pt) : -1;
25171 }, "~N,com.stevesoft.pat.Pthings");
25172 Clazz_overrideMethod (c$, "clone1", 
25173 function (h) {
25174 return  new com.stevesoft.pat.FastChar (this.c);
25175 }, "java.util.Hashtable");
25176 c$ = Clazz_decorateAsClass (function () {
25177 this.h = null;
25178 this.keys = null;
25179 Clazz_instantialize (this, arguments);
25180 }, com.stevesoft.pat, "Branch", com.stevesoft.pat.Pattern);
25181 Clazz_prepareFields (c$, function () {
25182 this.h =  new java.util.Hashtable ();
25183 this.keys =  new java.util.Vector ();
25184 });
25185 Clazz_makeConstructor (c$, 
25186 function () {
25187 Clazz_superConstructor (this, com.stevesoft.pat.Branch, []);
25188 });
25189 Clazz_overrideMethod (c$, "clone1", 
25190 function (x) {
25191 var b =  new com.stevesoft.pat.Branch ();
25192 b.keys = this.keys.clone ();
25193 x.put (this, b);
25194 x.put (b, b);
25195 for (var i = 0; i < this.keys.size (); i++) {
25196 var p = this.h.get (this.keys.elementAt (i));
25197 b.h.put (this.keys.elementAt (i), p.clone (x));
25198 }
25199 return b;
25200 }, "java.util.Hashtable");
25201 Clazz_defineMethod (c$, "reduce", 
25202 function (ignoreCase, dontMinQ) {
25203 if (this.h.size () == 1) {
25204 var e = this.h.keys ();
25205 var c = e.nextElement ();
25206 var oc;
25207 if (ignoreCase || dontMinQ) {
25208 oc =  new com.stevesoft.pat.oneChar (c.charValue ());
25209 } else {
25210 oc =  new com.stevesoft.pat.FastChar (c.charValue ());
25211 }oc.next = this.h.get (c);
25212 oc.add (this.next);
25213 return oc;
25214 } else if (this.h.size () == 0) {
25215 return null;
25216 }return this;
25217 }, "~B,~B");
25218 Clazz_defineMethod (c$, "maxChars", 
25219 function () {
25220 var e = this.h.keys ();
25221 var count =  new com.stevesoft.pat.patInt (0);
25222 while (e.hasMoreElements ()) {
25223 var key = e.nextElement ();
25224 var pa = this.h.get (key);
25225 var pi = pa.maxChars ();
25226 pi.inc ();
25227 count.maxeq (pi);
25228 }
25229 return count;
25230 });
25231 Clazz_defineMethod (c$, "minChars", 
25232 function () {
25233 var e = this.h.keys ();
25234 var count =  new com.stevesoft.pat.patInt (0);
25235 while (e.hasMoreElements ()) {
25236 var key = e.nextElement ();
25237 var pa = this.h.get (key);
25238 var pi = pa.minChars ();
25239 pi.inc ();
25240 count.mineq (pi);
25241 }
25242 return count;
25243 });
25244 Clazz_defineMethod (c$, "addc", 
25245 function (o, ignoreCase, dontMinQ) {
25246 var n = o.next;
25247 if (n == null) {
25248 n =  new com.stevesoft.pat.NullPattern ();
25249 } else {
25250 n = com.stevesoft.pat.RegOpt.opt (n, ignoreCase, dontMinQ);
25251 }n.setParent (this);
25252 this.set ( new Character (o.c), n, ignoreCase, dontMinQ);
25253 if (ignoreCase) {
25254 if (o.c != o.altc) {
25255 this.set ( new Character (o.altc), n, ignoreCase, dontMinQ);
25256 }if (o.c != o.altc2 && o.altc != o.altc2) {
25257 this.set ( new Character (o.altc2), n, ignoreCase, dontMinQ);
25258 }}}, "com.stevesoft.pat.oneChar,~B,~B");
25259 Clazz_defineMethod (c$, "set", 
25260 function (c, n, igc, dontMinQ) {
25261 var p = this.h.get (c);
25262 this.next = null;
25263 if (p == null) {
25264 if (Clazz_instanceOf (n, com.stevesoft.pat.Or)) {
25265 var np =  new com.stevesoft.pat.NullPattern ();
25266 np.add (n);
25267 this.h.put (c, np);
25268 } else {
25269 this.h.put (c, n);
25270 }this.keys.addElement (c);
25271 } else if (Clazz_instanceOf (p, com.stevesoft.pat.Or)) {
25272 (p).addOr (n);
25273 } else if (Clazz_instanceOf (p, com.stevesoft.pat.oneChar) && Clazz_instanceOf (n, com.stevesoft.pat.oneChar) && (p).c != (n).c) {
25274 var b =  new com.stevesoft.pat.Branch ();
25275 b.addc (p, igc, dontMinQ);
25276 b.addc (n, igc, dontMinQ);
25277 this.h.put (c, b);
25278 b.setParent (this);
25279 } else if (Clazz_instanceOf (p, com.stevesoft.pat.Branch) && Clazz_instanceOf (n, com.stevesoft.pat.oneChar)) {
25280 (p).addc (n, igc, dontMinQ);
25281 n.setParent (p);
25282 } else {
25283 var o =  new com.stevesoft.pat.Or ();
25284 o.setParent (this);
25285 if (Clazz_instanceOf (p, com.stevesoft.pat.NullPattern) && p.parent == null && p.next != null) {
25286 o.addOr (p.next);
25287 } else {
25288 o.addOr (p);
25289 }o.addOr (n);
25290 var optpat = com.stevesoft.pat.RegOpt.opt (o, igc, dontMinQ);
25291 this.h.put (c, optpat);
25292 optpat.setParent (this);
25293 }}, "Character,com.stevesoft.pat.Pattern,~B,~B");
25294 Clazz_overrideMethod (c$, "toString", 
25295 function () {
25296 var sb =  new StringBuffer ();
25297 sb.append ("(?:(?#branch)");
25298 for (var i = 0; i < this.keys.size (); i++) {
25299 var c = this.keys.elementAt (i);
25300 sb.append (c);
25301 sb.append (this.h.get (c));
25302 if (i + 1 < this.keys.size ()) {
25303 sb.append ("|");
25304 }}
25305 sb.append (")");
25306 sb.append (this.nextString ());
25307 return sb.toString ();
25308 });
25309 Clazz_defineMethod (c$, "matchInternal", 
25310 function (pos, pt) {
25311 if (pos >= pt.src.length ()) {
25312 return -1;
25313 }var n = this.h.get ( new Character (pt.src.charAt (pos)));
25314 if (n == null) {
25315 return -1;
25316 }if (pt.cbits != null && pt.cbits.get (pos)) {
25317 return -1;
25318 }return n.matchInternal (pos + 1, pt);
25319 }, "~N,com.stevesoft.pat.Pthings");
25320 c$ = Clazz_declareType (com.stevesoft.pat, "RegOpt");
25321 c$.opt = Clazz_defineMethod (c$, "opt", 
25322 function (p, ignoreCase, dontMinQ) {
25323 if (p == null) {
25324 return p;
25325 }if (Clazz_instanceOf (p, com.stevesoft.pat.Bracket)) {
25326 var b = p;
25327 p = com.stevesoft.pat.FastBracket.process (b, ignoreCase);
25328 p.next = b.next;
25329 p.parent = b.parent;
25330 } else if (Clazz_instanceOf (p, com.stevesoft.pat.oneChar) && !ignoreCase && !dontMinQ) {
25331 var o = p;
25332 p =  new com.stevesoft.pat.FastChar (o.c);
25333 p.next = o.next;
25334 p.parent = o.parent;
25335 } else if (Clazz_instanceOf (p, com.stevesoft.pat.Or) && (p).leftForm ().equals ("(?:") && (p).v.size () == 1) {
25336 var o = p;
25337 p = o.v.elementAt (0);
25338 p.setParent (null);
25339 p = com.stevesoft.pat.RegOpt.opt (p, ignoreCase, dontMinQ);
25340 p.add (o.next);
25341 } else if (Clazz_instanceOf (p, com.stevesoft.pat.Or)) {
25342 var o = p;
25343 o.pv = null;
25344 var v = o.v;
25345 o.v =  new java.util.Vector ();
25346 var b =  new com.stevesoft.pat.Branch ();
25347 b.parent = o.parent;
25348 for (var i = 0; i < v.size (); i++) {
25349 var pp = v.elementAt (i);
25350 if (Clazz_instanceOf (pp, com.stevesoft.pat.oneChar) && (b.h.size () >= 1 || (i + 1 < v.size () && Clazz_instanceOf (v.elementAt (i + 1), com.stevesoft.pat.oneChar)))) {
25351 b.addc (pp, ignoreCase, dontMinQ);
25352 } else {
25353 if (b.keys.size () > 0) {
25354 var p2 = b.reduce (ignoreCase, dontMinQ);
25355 if (p2 != null) {
25356 o.addOr (p2);
25357 b =  new com.stevesoft.pat.Branch ();
25358 b.parent = o.parent;
25359 }}o.addOr (com.stevesoft.pat.RegOpt.opt (pp, ignoreCase, dontMinQ));
25360 }}
25361 if (b.keys.size () > 0) {
25362 var p2 = b.reduce (ignoreCase, dontMinQ);
25363 if (p2 != null) {
25364 o.addOr (p2);
25365 }}if (o.v.size () == 1 && o.leftForm ().equals ("(?:")) {
25366 p = o.v.elementAt (0);
25367 p.setParent (null);
25368 p = com.stevesoft.pat.RegOpt.opt (p, ignoreCase, dontMinQ);
25369 p.add (o.next);
25370 }} else if (Clazz_instanceOf (p, com.stevesoft.pat.FastMulti)) {
25371 var ps = p;
25372 ps.sub = com.stevesoft.pat.RegOpt.opt (ps.sub, ignoreCase, dontMinQ);
25373 } else if (Clazz_instanceOf (p, com.stevesoft.pat.Multi) && com.stevesoft.pat.RegOpt.safe4fm ((p).sub)) {
25374 var m = p;
25375 var fm = null;
25376 try {
25377 fm =  new com.stevesoft.pat.FastMulti (m.a, m.b, com.stevesoft.pat.RegOpt.opt (m.sub, ignoreCase, dontMinQ));
25378 } catch (rs) {
25379 if (Clazz_exceptionOf (rs, com.stevesoft.pat.RegSyntax)) {
25380 } else {
25381 throw rs;
25382 }
25383 }
25384 fm.parent = m.parent;
25385 fm.matchFewest = m.matchFewest;
25386 fm.next = m.next;
25387 p = fm;
25388 }if (p.next != null) {
25389 p.next = com.stevesoft.pat.RegOpt.opt (p.next, ignoreCase, dontMinQ);
25390 }return p;
25391 }, "com.stevesoft.pat.Pattern,~B,~B");
25392 c$.safe4fm = Clazz_defineMethod (c$, "safe4fm", 
25393 function (x) {
25394 while (x != null) {
25395 if (Clazz_instanceOf (x, com.stevesoft.pat.Bracket)) {
25396 ;} else if (Clazz_instanceOf (x, com.stevesoft.pat.Range)) {
25397 ;} else if (Clazz_instanceOf (x, com.stevesoft.pat.oneChar)) {
25398 ;} else if (Clazz_instanceOf (x, com.stevesoft.pat.Any)) {
25399 ;} else if (Clazz_instanceOf (x, com.stevesoft.pat.Custom) && Clazz_instanceOf ((x).v, com.stevesoft.pat.UniValidator)) {
25400 ;} else if (Clazz_instanceOf (x, com.stevesoft.pat.Or)) {
25401 var o = x;
25402 if (!o.leftForm ().equals ("(?:")) {
25403 return false;
25404 }var lo = o.countMinChars ();
25405 var hi = o.countMaxChars ();
25406 if (!lo.equals (hi)) {
25407 return false;
25408 }for (var i = 0; i < o.v.size (); i++) {
25409 if (!com.stevesoft.pat.RegOpt.safe4fm (o.v.elementAt (i))) {
25410 return false;
25411 }}
25412 } else {
25413 return false;
25414 }x = x.next;
25415 }
25416 return true;
25417 }, "com.stevesoft.pat.Pattern");
25418 });
25419 Clazz_declarePackage ("com.stevesoft.pat");
25420 Clazz_load (["com.stevesoft.pat.Bracket"], "com.stevesoft.pat.FastBracket", ["com.stevesoft.pat.Range", "$.oneChar", "java.util.BitSet", "$.Vector"], function () {
25421 c$ = Clazz_decorateAsClass (function () {
25422 this.$min = 0;
25423 this.$max = 0;
25424 this.bs = null;
25425 Clazz_instantialize (this, arguments);
25426 }, com.stevesoft.pat, "FastBracket", com.stevesoft.pat.Bracket);
25427 c$.process = Clazz_defineMethod (c$, "process", 
25428 function (b, ignc) {
25429 var v = b.v;
25430 b.pv = null;
25431 try {
25432 var nv = v;
25433 if (ignc) {
25434 nv =  new java.util.Vector ();
25435 for (var i = 0; i < v.size (); i++) {
25436 var p = v.elementAt (i);
25437 nv.addElement (p);
25438 if (Clazz_instanceOf (p, com.stevesoft.pat.oneChar)) {
25439 var oc = p;
25440 nv.addElement ( new com.stevesoft.pat.oneChar (oc.altc));
25441 } else if (Clazz_instanceOf (p, com.stevesoft.pat.Range)) {
25442 var ra = p;
25443 nv.addElement ( new com.stevesoft.pat.Range (ra.altlo, ra.althi));
25444 }}
25445 }v = nv;
25446 for (var i = 0; i < v.size () - 1; i++) {
25447 for (var j = 0; j < v.size () - 1; j++) {
25448 var c1 = com.stevesoft.pat.FastBracket.getl (v.elementAt (j));
25449 var c2 = com.stevesoft.pat.FastBracket.getl (v.elementAt (j + 1));
25450 if (c2 < c1) {
25451 var o = v.elementAt (j);
25452 v.setElementAt (v.elementAt (j + 1), j);
25453 v.setElementAt (o, j + 1);
25454 }}
25455 }
25456 nv =  new java.util.Vector ();
25457 var p = v.elementAt (0);
25458 nv.addElement (p);
25459 for (var i = 1; i < v.size (); i++) {
25460 if ((com.stevesoft.pat.FastBracket.geth (p)).charCodeAt (0) + 1 >= (com.stevesoft.pat.FastBracket.getl (v.elementAt (i))).charCodeAt (0)) {
25461 var p2 = v.elementAt (i);
25462 var lo = com.stevesoft.pat.FastBracket.min (com.stevesoft.pat.FastBracket.getl (p), com.stevesoft.pat.FastBracket.getl (p2));
25463 var hi = com.stevesoft.pat.FastBracket.max (com.stevesoft.pat.FastBracket.geth (p), com.stevesoft.pat.FastBracket.geth (p2));
25464 nv.setElementAt (p = com.stevesoft.pat.FastBracket.mkelem (lo, hi), nv.size () - 1);
25465 } else {
25466 p = v.elementAt (i);
25467 nv.addElement (p);
25468 }}
25469 b.v = v = nv;
25470 } catch (e) {
25471 if (Clazz_exceptionOf (e, com.stevesoft.pat.RegSyntax)) {
25472 e.printStackTrace ();
25473 } else {
25474 throw e;
25475 }
25476 }
25477 var negv = com.stevesoft.pat.FastBracket.neg (v);
25478 if (v.size () == 1) {
25479 return b;
25480 }if (negv.size () == 1) {
25481 b.v = negv;
25482 b.neg = !b.neg;
25483 return b;
25484 }var fb = com.stevesoft.pat.FastBracket.newbrack (v, b.neg);
25485 if (fb == null) {
25486 fb = com.stevesoft.pat.FastBracket.newbrack (negv, !b.neg);
25487 }if (fb != null) {
25488 fb.parent = b.parent;
25489 fb.next = b.next;
25490 return fb;
25491 }return b;
25492 }, "com.stevesoft.pat.Bracket,~B");
25493 c$.newbrack = Clazz_defineMethod (c$, "newbrack", 
25494 function (v, neg) {
25495 var fb =  new com.stevesoft.pat.FastBracket (neg);
25496 fb.v = v;
25497 if (v.size () == 0) {
25498 return null;
25499 }fb.$min = (com.stevesoft.pat.FastBracket.getl (v.elementAt (0))).charCodeAt (0);
25500 fb.$max = (com.stevesoft.pat.FastBracket.geth (v.elementAt (v.size () - 1))).charCodeAt (0);
25501 if (fb.$max - fb.$min <= 256) {
25502 fb.bs =  new java.util.BitSet (fb.$max - fb.$min + 1);
25503 for (var i = 0; i < v.size (); i++) {
25504 var o = v.elementAt (i);
25505 var min0 = (com.stevesoft.pat.FastBracket.getl (o)).charCodeAt (0) - fb.$min;
25506 var max0 = (com.stevesoft.pat.FastBracket.geth (o)).charCodeAt (0) - fb.$min;
25507 for (var j = min0; j <= max0; j++) {
25508 fb.bs.set (j);
25509 }
25510 }
25511 return fb;
25512 }return null;
25513 }, "java.util.Vector,~B");
25514 c$.neg = Clazz_defineMethod (c$, "neg", 
25515 function (v) {
25516 try {
25517 var nv =  new java.util.Vector ();
25518 if (v.size () == 0) {
25519 nv.addElement ( new com.stevesoft.pat.Range (String.fromCharCode (0), String.fromCharCode (65535)));
25520 return nv;
25521 }var p0 = (com.stevesoft.pat.FastBracket.getl (v.elementAt (0))).charCodeAt (0);
25522 if (p0 != 0) {
25523 nv.addElement (com.stevesoft.pat.FastBracket.mkelem (String.fromCharCode (0), String.fromCharCode (p0 - 1)));
25524 }for (var i = 0; i < v.size () - 1; i++) {
25525 var hi = (com.stevesoft.pat.FastBracket.getl (v.elementAt (i + 1))).charCodeAt (0) - 1;
25526 var lo = (com.stevesoft.pat.FastBracket.geth (v.elementAt (i))).charCodeAt (0) + 1;
25527 nv.addElement (com.stevesoft.pat.FastBracket.mkelem (String.fromCharCode (lo), String.fromCharCode (hi)));
25528 }
25529 var pN = (com.stevesoft.pat.FastBracket.geth (v.lastElement ())).charCodeAt (0);
25530 if (pN != 65535) {
25531 nv.addElement (com.stevesoft.pat.FastBracket.mkelem (String.fromCharCode (pN + 1), String.fromCharCode (65535)));
25532 }return nv;
25533 } catch (rs) {
25534 if (Clazz_exceptionOf (rs, com.stevesoft.pat.RegSyntax)) {
25535 return null;
25536 } else {
25537 throw rs;
25538 }
25539 }
25540 }, "java.util.Vector");
25541 c$.mkelem = Clazz_defineMethod (c$, "mkelem", 
25542 function (lo, hi) {
25543 return lo == hi ? ( new com.stevesoft.pat.oneChar (lo)) : ( new com.stevesoft.pat.Range (lo, hi));
25544 }, "~S,~S");
25545 c$.min = Clazz_defineMethod (c$, "min", 
25546 function (a, b) {
25547 return a < b ? a : b;
25548 }, "~S,~S");
25549 c$.max = Clazz_defineMethod (c$, "max", 
25550 function (a, b) {
25551 return a > b ? a : b;
25552 }, "~S,~S");
25553 c$.getl = Clazz_defineMethod (c$, "getl", 
25554 function (o) {
25555 var p = o;
25556 if (Clazz_instanceOf (p, com.stevesoft.pat.Range)) {
25557 return (p).lo;
25558 }return (p).c;
25559 }, "~O");
25560 c$.geth = Clazz_defineMethod (c$, "geth", 
25561 function (o) {
25562 var p = o;
25563 if (Clazz_instanceOf (p, com.stevesoft.pat.Range)) {
25564 return (p).hi;
25565 }return (p).c;
25566 }, "~O");
25567 Clazz_overrideMethod (c$, "matchInternal", 
25568 function (pos, pt) {
25569 if (pos >= pt.src.length () || this.Masked (pos, pt)) {
25570 return -1;
25571 }var c = pt.src.charAt (pos);
25572 return ( new Boolean (this.neg ^ (c.charCodeAt (0) >= this.$min && c.charCodeAt (0) <= this.$max && this.bs.get (c.charCodeAt (0) - this.$min))).valueOf ()) ? this.nextMatch (pos + 1, pt) : -1;
25573 }, "~N,com.stevesoft.pat.Pthings");
25574 });
25575 \feffClazz_load (null, "java.util.BitSet", ["java.lang.IndexOutOfBoundsException", "$.NegativeArraySizeException", "$.StringBuffer", "java.util.Arrays"], function () {
25576 c$ = Clazz_decorateAsClass (function () {
25577 this.bits = null;
25578 Clazz_instantialize (this, arguments);
25579 }, java.util, "BitSet", null, [Cloneable, java.io.Serializable]);
25580 Clazz_makeConstructor (c$, 
25581 function () {
25582 this.construct (32);
25583 });
25584 Clazz_makeConstructor (c$, 
25585 function (nbits) {
25586 if (nbits < 0) throw  new NegativeArraySizeException ();
25587 var length = nbits >>> 5;
25588 if ((nbits & 4) != 0) ++length;
25589 this.bits =  Clazz_newArray (length, 0);
25590 }, "~N");
25591 Clazz_defineMethod (c$, "and", 
25592 function (bs) {
25593 var max = Math.min (this.bits.length, bs.bits.length);
25594 var i;
25595 for (i = 0; i < max; ++i) this.bits[i] &= bs.bits[i];
25596
25597 while (i < this.bits.length) this.bits[i++] = 0;
25598
25599 }, "java.util.BitSet");
25600 Clazz_defineMethod (c$, "andNot", 
25601 function (bs) {
25602 var i = Math.min (this.bits.length, bs.bits.length);
25603 while (--i >= 0) {
25604 this.bits[i] &= ~bs.bits[i];
25605 }
25606 }, "java.util.BitSet");
25607 Clazz_defineMethod (c$, "cardinality", 
25608 function () {
25609 var card = 0;
25610 for (var i = this.bits.length - 1; i >= 0; i--) {
25611 var a = this.bits[i];
25612 if (a == 0) continue ;if (a == -1) {
25613 card += 32;
25614 continue ;}a = ((a >> 1) & 0x55555555) + (a & 0x55555555);
25615 a = ((a >> 2) & 0x33333333) + (a & 0x33333333);
25616 a = ((a >> 4) & 0x0f0f0f0f) + (a & 0x0f0f0f0f);
25617 a = ((a >> 8) & 0x00ff00ff) + (a & 0x00ff00ff);
25618 card += ((a >> 16) & 0x0000ffff) + (a & 0x0000ffff);
25619 }
25620 return card;
25621 });
25622 Clazz_defineMethod (c$, "clear", 
25623 function () {
25624 java.util.Arrays.fill (this.bits, 0);
25625 });
25626 Clazz_defineMethod (c$, "clear", 
25627 function (pos) {
25628 var offset = pos >> 5;
25629 this.ensure (offset);
25630 this.bits[offset] &= ~(1 << pos);
25631 }, "~N");
25632 Clazz_defineMethod (c$, "clear", 
25633 function (from, to) {
25634 if (from < 0 || from > to) throw  new IndexOutOfBoundsException ();
25635 if (from == to) return ;
25636 var lo_offset = from >>> 5;
25637 var hi_offset = to >>> 5;
25638 this.ensure (hi_offset);
25639 if (lo_offset == hi_offset) {
25640 this.bits[hi_offset] &= ((1 << from) - 1) | (-1 << to);
25641 return ;
25642 }this.bits[lo_offset] &= (1 << from) - 1;
25643 this.bits[hi_offset] &= -1 << to;
25644 for (var i = lo_offset + 1; i < hi_offset; i++) this.bits[i] = 0;
25645
25646 }, "~N,~N");
25647 Clazz_defineMethod (c$, "clone", 
25648 function () {
25649 try {
25650 var bs = Clazz_superCall (this, java.util.BitSet, "clone", []);
25651 bs.bits = this.bits.clone ();
25652 return bs;
25653 } catch (e) {
25654 if (Clazz_exceptionOf (e, CloneNotSupportedException)) {
25655 return null;
25656 } else {
25657 throw e;
25658 }
25659 }
25660 });
25661 Clazz_overrideMethod(c$, "equals", 
25662 function (obj) {
25663 if (!(Clazz_instanceOf (obj, java.util.BitSet))) return false;
25664 var bs = obj;
25665 var max = Math.min (this.bits.length, bs.bits.length);
25666 var i;
25667 for (i = 0; i < max; ++i) if (this.bits[i] != bs.bits[i]) return false;
25668
25669 for (var j = i; j < this.bits.length; ++j) if (this.bits[j] != 0) return false;
25670
25671 for (var j = i; j < bs.bits.length; ++j) if (bs.bits[j] != 0) return false;
25672
25673 return true;
25674 }, "~O");
25675 Clazz_defineMethod (c$, "flip", 
25676 function (index) {
25677 var offset = index >> 5;
25678 this.ensure (offset);
25679 this.bits[offset] ^= 1 << index;
25680 }, "~N");
25681 Clazz_defineMethod (c$, "flip", 
25682 function (from, to) {
25683 if (from < 0 || from > to) throw  new IndexOutOfBoundsException ();
25684 if (from == to) return ;
25685 var lo_offset = from >>> 5;
25686 var hi_offset = to >>> 5;
25687 this.ensure (hi_offset);
25688 if (lo_offset == hi_offset) {
25689 this.bits[hi_offset] ^= (-1 << from) & ((1 << to) - 1);
25690 return ;
25691 }this.bits[lo_offset] ^= -1 << from;
25692 this.bits[hi_offset] ^= (1 << to) - 1;
25693 for (var i = lo_offset + 1; i < hi_offset; i++) this.bits[i] ^= -1;
25694
25695 }, "~N,~N");
25696 Clazz_defineMethod (c$, "get", 
25697 function (pos) {
25698 var offset = pos >> 5;
25699 if (offset >= this.bits.length) return false;
25700 return (this.bits[offset] & (1 << pos)) != 0;
25701 }, "~N");
25702 Clazz_defineMethod (c$, "get", 
25703 function (from, to) {
25704 if (from < 0 || from > to) throw  new IndexOutOfBoundsException ();
25705 var bs =  new java.util.BitSet (to - from);
25706 var lo_offset = from >>> 5;
25707 if (lo_offset >= this.bits.length) return bs;
25708 var lo_bit = from & 4;
25709 var hi_offset = to >>> 5;
25710 if (lo_bit == 0) {
25711 var len = Math.min (hi_offset - lo_offset + 1, this.bits.length - lo_offset);
25712 System.arraycopy (this.bits, lo_offset, bs.bits, 0, len);
25713 if (hi_offset < this.bits.length) bs.bits[hi_offset - lo_offset] &= (1 << to) - 1;
25714 return bs;
25715 }var len = Math.min (hi_offset, this.bits.length - 1);
25716 var reverse = ~lo_bit;
25717 var i;
25718 for (i = 0; lo_offset < len; lo_offset++, i++) bs.bits[i] = ((this.bits[lo_offset] >>> lo_bit) | (this.bits[lo_offset + 1] << reverse));
25719
25720 if ((to & 4) > lo_bit) bs.bits[i++] = this.bits[lo_offset] >>> lo_bit;
25721 if (hi_offset < this.bits.length) bs.bits[i - 1] &= (1 << (to - from)) - 1;
25722 return bs;
25723 }, "~N,~N");
25724 Clazz_overrideMethod(c$, "hashCode", 
25725 function () {
25726 var h = 1234;
25727 for (var i = this.bits.length; i > 0; ) h ^= i * this.bits[--i];
25728
25729 return h;
25730 });
25731 Clazz_defineMethod (c$, "intersects", 
25732 function (set) {
25733 var i = Math.min (this.bits.length, set.bits.length);
25734 while (--i >= 0) if ((this.bits[i] & set.bits[i]) != 0) return true;
25735
25736 return false;
25737 }, "java.util.BitSet");
25738 Clazz_defineMethod (c$, "isEmpty", 
25739 function () {
25740 for (var i = this.bits.length - 1; i >= 0; i--) if (this.bits[i] != 0) return false;
25741
25742 return true;
25743 });
25744 Clazz_defineMethod (c$, "length", 
25745 function () {
25746 var i;
25747 for (i = this.bits.length - 1; i >= 0 && this.bits[i] == 0; --i) ;
25748 if (i < 0) return 0;
25749 var b = this.bits[i];
25750 var len = (i + 1) * 32;
25751 while ((b & 0x80000000) == 0) {
25752 --len;
25753 b <<= 1;
25754 }
25755 return len;
25756 });
25757 Clazz_defineMethod (c$, "nextClearBit", 
25758 function (from) {
25759 var offset = from >> 5;
25760 var mask = 1 << from;
25761 while (offset < this.bits.length) {
25762 var h = this.bits[offset];
25763 do {
25764 if ((h & mask) == 0) return from;
25765 mask <<= 1;
25766 from++;
25767 } while (mask != 0);
25768 mask = 1;
25769 offset++;
25770 }
25771 return from;
25772 }, "~N");
25773 Clazz_defineMethod (c$, "nextSetBit", 
25774 function (from) {
25775 var offset = from >> 5;
25776 var mask = 1 << from;
25777 while (offset < this.bits.length) {
25778 var h = this.bits[offset];
25779 do {
25780 if ((h & mask) != 0) return from;
25781 mask <<= 1;
25782 from++;
25783 } while (mask != 0);
25784 mask = 1;
25785 offset++;
25786 }
25787 return -1;
25788 }, "~N");
25789 Clazz_defineMethod (c$, "or", 
25790 function (bs) {
25791 this.ensure (bs.bits.length - 1);
25792 for (var i = bs.bits.length - 1; i >= 0; i--) this.bits[i] |= bs.bits[i];
25793
25794 }, "java.util.BitSet");
25795 Clazz_defineMethod (c$, "set", 
25796 function (pos) {
25797 var offset = pos >> 5;
25798 this.ensure (offset);
25799 this.bits[offset] |= 1 << pos;
25800 }, "~N");
25801 Clazz_defineMethod (c$, "set", 
25802 function (index, value) {
25803 if (value) this.set (index);
25804  else this.clear (index);
25805 }, "~N,~B");
25806 Clazz_defineMethod (c$, "set", 
25807 function (from, to) {
25808 if (from < 0 || from > to) throw  new IndexOutOfBoundsException ();
25809 if (from == to) return ;
25810 var lo_offset = from >>> 5;
25811 var hi_offset = to >>> 5;
25812 this.ensure (hi_offset);
25813 if (lo_offset == hi_offset) {
25814 this.bits[hi_offset] |= (-1 << from) & ((1 << to) - 1);
25815 return ;
25816 }this.bits[lo_offset] |= -1 << from;
25817 this.bits[hi_offset] |= (1 << to) - 1;
25818 for (var i = lo_offset + 1; i < hi_offset; i++) this.bits[i] = -1;
25819
25820 }, "~N,~N");
25821 Clazz_defineMethod (c$, "set", 
25822 function (from, to, value) {
25823 if (value) this.set (from, to);
25824  else this.clear (from, to);
25825 }, "~N,~N,~B");
25826 Clazz_defineMethod (c$, "size", 
25827 function () {
25828 return this.bits.length * 32;
25829 });
25830 Clazz_overrideMethod(c$, "toString", 
25831 function () {
25832 var r =  new StringBuffer ("{");
25833 var first = true;
25834 for (var i = 0; i < this.bits.length; ++i) {
25835 var bit = 1;
25836 var word = this.bits[i];
25837 if (word == 0) continue ;for (var j = 0; j < 32; ++j) {
25838 if ((word & bit) != 0) {
25839 if (!first) r.append (", ");
25840 r.append (32 * i + j);
25841 first = false;
25842 }bit <<= 1;
25843 }
25844 }
25845 return r.append ("}").toString ();
25846 });
25847 Clazz_defineMethod (c$, "xor", 
25848 function (bs) {
25849 this.ensure (bs.bits.length - 1);
25850 for (var i = bs.bits.length - 1; i >= 0; i--) this.bits[i] ^= bs.bits[i];
25851
25852 }, "java.util.BitSet");
25853 Clazz_defineMethod (c$, "ensure", 
25854  function (lastElt) {
25855 if (lastElt >= this.bits.length) {
25856 var nd =  Clazz_newArray (lastElt + 1, 0);
25857 System.arraycopy (this.bits, 0, nd, 0, this.bits.length);
25858 this.bits = nd;
25859 }}, "~N");
25860 Clazz_defineStatics (c$,
25861 "INT_MASK", 0x4);
25862 });
25863 Clazz_declarePackage ("com.stevesoft.pat");
25864 Clazz_load (["java.util.Hashtable"], "com.stevesoft.pat.ReplaceRule", ["com.stevesoft.pat.Ctrl", "$.Regex", "$.Transformer", "java.lang.StringBuffer"], function () {
25865 c$ = Clazz_decorateAsClass (function () {
25866 this.next = null;
25867 this.name = null;
25868 Clazz_instantialize (this, arguments);
25869 }, com.stevesoft.pat, "ReplaceRule");
25870 Clazz_prepareFields (c$, function () {
25871 this.name = this.getClass ().getName ();
25872 });
25873 Clazz_defineMethod (c$, "clone1", 
25874 function () {
25875 return  new com.stevesoft.pat.RuleHolder (this);
25876 });
25877 Clazz_overrideMethod (c$, "clone", 
25878 function () {
25879 var x = this.clone1 ();
25880 var xsav = x;
25881 var y = this;
25882 while (y.next != null) {
25883 x.next = y.next.clone1 ();
25884 x.name = y.name;
25885 x = x.next;
25886 y = y.next;
25887 }
25888 return xsav;
25889 });
25890 c$.add = Clazz_defineMethod (c$, "add", 
25891 function (head, adding) {
25892 if (head == null) {
25893 return head = adding;
25894 }head.addRule (adding);
25895 return head;
25896 }, "com.stevesoft.pat.ReplaceRule,com.stevesoft.pat.ReplaceRule");
25897 Clazz_defineMethod (c$, "add", 
25898 function (adding) {
25899 return com.stevesoft.pat.ReplaceRule.add (this, adding);
25900 }, "com.stevesoft.pat.ReplaceRule");
25901 Clazz_defineMethod (c$, "addRule", 
25902 function (r) {
25903 if (this.next == null) {
25904 this.next = r;
25905 } else {
25906 this.next.addRule (r);
25907 }}, "com.stevesoft.pat.ReplaceRule");
25908 c$.getv = Clazz_defineMethod (c$, "getv", 
25909  function () {
25910 if (com.stevesoft.pat.ReplaceRule.getvar != null) {
25911 return com.stevesoft.pat.ReplaceRule.getvar.clone ();
25912 }com.stevesoft.pat.ReplaceRule.getvar =  new com.stevesoft.pat.Regex ("(?:\\\\(\\d+)|\\$(?:(\\d+)|(\\w+)|([&\'`])|\\{(?:(\\d+)|([^\n}\\\\]+))})|\\\\([nrbtaef])|\\\\c([\u0000-\uffff])|\\\\x([A-Fa-f0-9]{2})|\\\\([\u0000-\uffff]))", "");
25913 com.stevesoft.pat.ReplaceRule.getvar.optimize ();
25914 return com.stevesoft.pat.ReplaceRule.getvar;
25915 });
25916 c$.perlCode = Clazz_defineMethod (c$, "perlCode", 
25917 function (s) {
25918 try {
25919 var mf = 0;
25920 var mt = 0;
25921 var gv = com.stevesoft.pat.ReplaceRule.getv ();
25922 var head = null;
25923 var tmp = null;
25924 while (gv.searchFrom (s, mt)) {
25925 var off = com.stevesoft.pat.Regex.BackRefOffset - 1;
25926 mf = gv.matchedFrom ();
25927 if (mf > mt) {
25928 head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.StringRule (s.substring (mt, mf)));
25929 }var $var = null;
25930 if (($var = gv.stringMatchedI (1 + off)) != null || ($var = gv.stringMatchedI (2 + off)) != null || ($var = gv.stringMatchedI (5 + off)) != null) {
25931 var d = 0;
25932 for (var i = 0; i < $var.length; i++) {
25933 d = 8 * d + ($var.charCodeAt (i) - 48);
25934 }
25935 if ($var.length == 1) {
25936 head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.BackRefRule (d));
25937 } else {
25938 head =  new com.stevesoft.pat.StringRule ("" + String.fromCharCode (d));
25939 }} else if (($var = gv.stringMatchedI (10 + off)) != null) {
25940 if ("QELlUu".indexOf ($var) >= 0) {
25941 head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.CodeRule ($var.charAt (0)));
25942 } else {
25943 head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.StringRule ($var));
25944 }} else if (($var = gv.stringMatchedI (3 + off)) != null || ($var = gv.stringMatchedI (4 + off)) != null || ($var = gv.stringMatchedI (6 + off)) != null) {
25945 var arg = "";
25946 var pc;
25947 if ((pc = $var.indexOf (':')) > 0) {
25948 arg = $var.substring (pc + 1);
25949 $var = $var.substring (0, pc);
25950 }if ($var.equals ("&") || $var.equals ("MATCH")) {
25951 head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.AmpersandRule ());
25952 } else if ($var.equals ("`") || $var.equals ("PREMATCH")) {
25953 head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.LeftRule ());
25954 } else if ($var.equals ("'") || $var.equals ("POSTMATCH")) {
25955 head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.RightRule ());
25956 } else if ($var.equals ("WANT_MORE_TEXT")) {
25957 head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.WantMoreTextReplaceRule ());
25958 } else if ($var.equals ("POP")) {
25959 head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.PopRule ());
25960 } else if ($var.startsWith ("+") && (tmp = com.stevesoft.pat.ReplaceRule.defs.get ($var.substring (1))) != null) {
25961 if (Clazz_instanceOf (tmp, com.stevesoft.pat.Regex)) {
25962 head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.PushRule ($var.substring (1), tmp));
25963 } else if (Clazz_instanceOf (tmp, com.stevesoft.pat.Transformer)) {
25964 head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.PushRule ($var.substring (1), tmp));
25965 } else {
25966 head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.StringRule ("${" + $var + "}"));
25967 }} else if ($var.startsWith ("=") && (tmp = com.stevesoft.pat.ReplaceRule.defs.get ($var.substring (1))) != null) {
25968 if (Clazz_instanceOf (tmp, com.stevesoft.pat.Regex)) {
25969 head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.ChangeRule ($var.substring (1), tmp));
25970 } else if (Clazz_instanceOf (tmp, com.stevesoft.pat.Transformer)) {
25971 head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.ChangeRule ($var.substring (1), tmp));
25972 } else {
25973 head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.StringRule ("${" + $var + "}"));
25974 }} else if ((tmp = com.stevesoft.pat.ReplaceRule.defs.get ($var)) != null) {
25975 if (Clazz_instanceOf (tmp, com.stevesoft.pat.ReplaceRule)) {
25976 var alt = (tmp).arg (arg);
25977 if (alt == null) {
25978 alt = (tmp);
25979 }head = com.stevesoft.pat.ReplaceRule.add (head, (alt.clone ()));
25980 }} else {
25981 head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.StringRule ("${" + $var + "}"));
25982 }} else if (($var = gv.stringMatchedI (7 + off)) != null) {
25983 var c = $var.charAt (0);
25984 if (c == 'n') {
25985 head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.StringRule ("\n"));
25986 } else if (c == 't') {
25987 head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.StringRule ("\t"));
25988 } else if (c == 'r') {
25989 head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.StringRule ("\r"));
25990 } else if (c == 'b') {
25991 head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.StringRule ("\r"));
25992 } else if (c == 'a') {
25993 head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.StringRule ("\u0007"));
25994 } else if (c == 'e') {
25995 head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.StringRule ("\u001b"));
25996 } else if (c == 'f') {
25997 head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.StringRule ("\f"));
25998 }} else if (($var = gv.stringMatchedI (8 + off)) != null) {
25999 var c = $var.charAt (0);
26000 if (c.charCodeAt (0) < com.stevesoft.pat.Ctrl.cmap.length) {
26001 c = com.stevesoft.pat.Ctrl.cmap[c.charCodeAt (0)];
26002 }head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.StringRule ("" + c));
26003 } else if (($var = gv.stringMatchedI (9 + off)) != null) {
26004 var d = 16 * com.stevesoft.pat.ReplaceRule.getHexDigit ($var.charAt (0)) + com.stevesoft.pat.ReplaceRule.getHexDigit ($var.charAt (1));
26005 head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.StringRule ("" + String.fromCharCode (d)));
26006 }mt = gv.matchedTo ();
26007 }
26008 if (mt <= s.length) {
26009 head = com.stevesoft.pat.ReplaceRule.add (head,  new com.stevesoft.pat.StringRule (s.substring (mt)));
26010 }return head;
26011 } finally {
26012 }
26013 }, "~S");
26014 c$.isDefined = Clazz_defineMethod (c$, "isDefined", 
26015 function (s) {
26016 return com.stevesoft.pat.ReplaceRule.defs.get (s) != null;
26017 }, "~S");
26018 c$.define = Clazz_defineMethod (c$, "define", 
26019 function (s, r) {
26020 com.stevesoft.pat.ReplaceRule.defs.put (s, r);
26021 }, "~S,com.stevesoft.pat.Regex");
26022 c$.define = Clazz_defineMethod (c$, "define", 
26023 function (s, r) {
26024 com.stevesoft.pat.ReplaceRule.defs.put (s, r);
26025 r.name = s;
26026 }, "~S,com.stevesoft.pat.ReplaceRule");
26027 c$.define = Clazz_defineMethod (c$, "define", 
26028 function (s, t) {
26029 com.stevesoft.pat.ReplaceRule.defs.put (s, t);
26030 }, "~S,com.stevesoft.pat.Transformer");
26031 c$.undefine = Clazz_defineMethod (c$, "undefine", 
26032 function (s) {
26033 com.stevesoft.pat.ReplaceRule.defs.remove (s);
26034 }, "~S");
26035 Clazz_defineMethod (c$, "toString1", 
26036 function () {
26037 return "${" + this.name + "}";
26038 });
26039 Clazz_overrideMethod (c$, "toString", 
26040 function () {
26041 var sb =  new StringBuffer ();
26042 sb.append (this.toString1 ());
26043 var rr = this.next;
26044 while (rr != null) {
26045 sb.append (rr.toString1 ());
26046 rr = rr.next;
26047 }
26048 return sb.toString ();
26049 });
26050 Clazz_defineMethod (c$, "arg", 
26051 function (s) {
26052 return null;
26053 }, "~S");
26054 c$.getHexDigit = Clazz_defineMethod (c$, "getHexDigit", 
26055 function (c) {
26056 if (c >= '0' && c <= '9') {
26057 return c.charCodeAt (0) - 48;
26058 }if (c >= 'a' && c <= 'f') {
26059 return c.charCodeAt (0) - 97 + 10;
26060 }return c.charCodeAt (0) - 65 + 10;
26061 }, "~S");
26062 Clazz_defineStatics (c$,
26063 "getvar", null);
26064 c$.defs = c$.prototype.defs =  new java.util.Hashtable ();
26065 });
26066 Clazz_declarePackage ("com.stevesoft.pat");
26067 Clazz_load (["com.stevesoft.pat.ReplaceRule", "$.Replacer"], ["com.stevesoft.pat.Transformer", "$.TransRepRule"], ["com.stevesoft.pat.MessageManager", "$.Regex", "$.TransPat", "com.stevesoft.pat.wrap.StringWrap", "java.lang.ArrayIndexOutOfBoundsException", "$.NullPointerException"], function () {
26068 c$ = Clazz_decorateAsClass (function () {
26069 this.t = null;
26070 Clazz_instantialize (this, arguments);
26071 }, com.stevesoft.pat, "TransRepRule", com.stevesoft.pat.ReplaceRule);
26072 Clazz_makeConstructor (c$, 
26073 function (t) {
26074 Clazz_superConstructor (this, com.stevesoft.pat.TransRepRule, []);
26075 this.t = t;
26076 }, "com.stevesoft.pat.Transformer");
26077 Clazz_overrideMethod (c$, "toString1", 
26078 function () {
26079 return "";
26080 });
26081 Clazz_overrideMethod (c$, "clone1", 
26082 function () {
26083 return  new com.stevesoft.pat.TransRepRule (this.t);
26084 });
26085 Clazz_overrideMethod (c$, "apply", 
26086 function (sb, rr) {
26087 this.next = this.t.tp.ra[this.t.tp.pn].getReplaceRule ();
26088 }, "com.stevesoft.pat.StringBufferLike,com.stevesoft.pat.RegRes");
26089 c$ = Clazz_decorateAsClass (function () {
26090 this.tp = null;
26091 this.rp = null;
26092 this.auto_optimize = false;
26093 this.repr = null;
26094 Clazz_instantialize (this, arguments);
26095 }, com.stevesoft.pat, "Transformer");
26096 Clazz_prepareFields (c$, function () {
26097 this.repr =  new com.stevesoft.pat.Replacer ();
26098 });
26099 Clazz_defineMethod (c$, "getReplacer", 
26100 function () {
26101 return this.rp.getReplacer ();
26102 });
26103 Clazz_makeConstructor (c$, 
26104 function (auto) {
26105 this.rp =  new com.stevesoft.pat.Regex (null, "");
26106 this.auto_optimize = auto;
26107 this.tp =  new com.stevesoft.pat.TransPat ();
26108 this.rp.setReplaceRule ( new com.stevesoft.pat.TransRepRule (this));
26109 this.rp.thePattern = this.tp;
26110 }, "~B");
26111 Clazz_defineMethod (c$, "add", 
26112 function (r) {
26113 if (this.auto_optimize) {
26114 r.optimize ();
26115 }this.tp.ra[this.tp.ra_len++] = r;
26116 if (this.tp.ra.length == this.tp.ra_len) {
26117 var ra2 =  new Array (this.tp.ra_len + 10);
26118 for (var i = 0; i < this.tp.ra_len; i++) {
26119 ra2[i] = this.tp.ra[i];
26120 }
26121 this.tp.ra = ra2;
26122 }this.rp.numSubs_ = r.numSubs_ > this.rp.numSubs_ ? r.numSubs_ : this.rp.numSubs_;
26123 }, "com.stevesoft.pat.Regex");
26124 Clazz_defineMethod (c$, "patterns", 
26125 function () {
26126 return this.tp.ra_len;
26127 });
26128 Clazz_defineMethod (c$, "getRegexAt", 
26129 function (i) {
26130 if (i >= this.tp.ra_len) {
26131 throw  new ArrayIndexOutOfBoundsException ("i=" + i + ">=" + this.patterns ());
26132 }if (i < 0) {
26133 throw  new ArrayIndexOutOfBoundsException ("i=" + i + "< 0");
26134 }return this.tp.ra[i];
26135 }, "~N");
26136 Clazz_defineMethod (c$, "setRegexAt", 
26137 function (rx, i) {
26138 if (i >= this.tp.ra_len) {
26139 throw  new ArrayIndexOutOfBoundsException ("i=" + i + ">=" + this.patterns ());
26140 }if (i < 0) {
26141 throw  new ArrayIndexOutOfBoundsException ("i=" + i + "< 0");
26142 }this.tp.ra[i] = rx;
26143 }, "com.stevesoft.pat.Regex,~N");
26144 Clazz_defineMethod (c$, "add", 
26145 function (rs) {
26146 var r = com.stevesoft.pat.Regex.perlCode (rs);
26147 if (r == null) {
26148 throw  new NullPointerException (com.stevesoft.pat.MessageManager.formatMessage ("exception.bad_pattern_to_regex_perl_code",  Clazz_newArray (-1, [rs])));
26149 }this.add (r);
26150 }, "~S");
26151 Clazz_defineMethod (c$, "add", 
26152 function (array) {
26153 for (var i = 0; i < array.length; i++) {
26154 this.add (array[i]);
26155 }
26156 }, "~A");
26157 Clazz_defineMethod (c$, "replaceAll", 
26158 function (s) {
26159 return this.dorep (s, 0, s.length);
26160 }, "~S");
26161 Clazz_defineMethod (c$, "replaceAll", 
26162 function (s) {
26163 return this.dorep (s, 0, s.length ());
26164 }, "com.stevesoft.pat.StringLike");
26165 Clazz_defineMethod (c$, "replaceAllFrom", 
26166 function (s, start) {
26167 return this.dorep (s, start, s.length);
26168 }, "~S,~N");
26169 Clazz_defineMethod (c$, "replaceAllRegion", 
26170 function (s, start, end) {
26171 return this.dorep (s, start, end);
26172 }, "~S,~N,~N");
26173 Clazz_defineMethod (c$, "dorep", 
26174 function (s, start, end) {
26175 var tfmd = this.repr.replaceAllRegion (s, this.rp, start, end);
26176 this.tp.lastMatchedTo = this.repr.$lastMatchedTo;
26177 return tfmd;
26178 }, "com.stevesoft.pat.StringLike,~N,~N");
26179 Clazz_defineMethod (c$, "dorep", 
26180 function (s, start, end) {
26181 return this.dorep ( new com.stevesoft.pat.wrap.StringWrap (s), start, end).toString ();
26182 }, "~S,~N,~N");
26183 Clazz_defineMethod (c$, "replaceFirst", 
26184 function (s) {
26185 return this.dorep (s, 0, s.length);
26186 }, "~S");
26187 Clazz_defineMethod (c$, "replaceFirstFrom", 
26188 function (s, start) {
26189 return this.dorep (s, start, s.length);
26190 }, "~S,~N");
26191 Clazz_defineMethod (c$, "replaceFirstRegion", 
26192 function (s, start, end) {
26193 return this.dorep (s, start, end);
26194 }, "~S,~N,~N");
26195 });
26196 Clazz_declarePackage ("com.stevesoft.pat");
26197 Clazz_load (null, ["com.stevesoft.pat.RegHolder", "$.Replacer", "$.CodeVal"], ["com.stevesoft.pat.AmpersandRule", "$.ChangeRule", "$.MessageManager", "$.PopRule", "$.PushRule", "$.RuleHolder", "$.SpecialRule", "$.StringBufferLike", "$.WantMoreTextReplaceRule", "com.stevesoft.pat.wrap.StringWrap", "java.lang.NullPointerException"], function () {
26198 c$ = Clazz_decorateAsClass (function () {
26199 this.me = null;
26200 this.prev = null;
26201 Clazz_instantialize (this, arguments);
26202 }, com.stevesoft.pat, "RegHolder");
26203 c$ = Clazz_decorateAsClass (function () {
26204 this.pos = 0;
26205 this.code = '\0';
26206 Clazz_instantialize (this, arguments);
26207 }, com.stevesoft.pat, "CodeVal");
26208 Clazz_makeConstructor (c$, 
26209 function (p, c) {
26210 this.pos = p;
26211 this.code = c;
26212 }, "~N,~S");
26213 Clazz_overrideMethod (c$, "toString", 
26214 function () {
26215 return "(" + this.pos + "," + this.code + ")";
26216 });
26217 c$ = Clazz_decorateAsClass (function () {
26218 this.first = false;
26219 this.rh = null;
26220 this.sb = null;
26221 this.src = null;
26222 this.pos = 0;
26223 this.want_more_text = false;
26224 this.want_more_text_enable = false;
26225 this.$lastMatchedTo = 0;
26226 Clazz_instantialize (this, arguments);
26227 }, com.stevesoft.pat, "Replacer");
26228 Clazz_prepareFields (c$, function () {
26229 this.rh =  new com.stevesoft.pat.RegHolder ();
26230 });
26231 Clazz_makeConstructor (c$, 
26232 function () {
26233 });
26234 Clazz_defineMethod (c$, "replaceFirstRegion", 
26235 function (s, r, start, end) {
26236 return this.replaceFirstRegion ( new com.stevesoft.pat.wrap.StringWrap (s), r, start, end);
26237 }, "~S,com.stevesoft.pat.Regex,~N,~N");
26238 Clazz_defineMethod (c$, "replaceFirstRegion", 
26239 function (s, r, start, end) {
26240 this.first = true;
26241 this.rh.me = r;
26242 this.rh.prev = null;
26243 return this.dorep (s, start, end);
26244 }, "com.stevesoft.pat.StringLike,com.stevesoft.pat.Regex,~N,~N");
26245 Clazz_defineMethod (c$, "replaceFirst", 
26246 function (s) {
26247 return this.replaceFirstRegion (s, 0, s.length ());
26248 }, "com.stevesoft.pat.StringLike");
26249 Clazz_defineMethod (c$, "replaceFirstFrom", 
26250 function (s, start) {
26251 return this.replaceFirstRegion (s, start, s.length ());
26252 }, "com.stevesoft.pat.StringLike,~N");
26253 Clazz_defineMethod (c$, "replaceFirstRegion", 
26254 function (s, start, end) {
26255 this.first = true;
26256 return this.dorep (s, start, end);
26257 }, "com.stevesoft.pat.StringLike,~N,~N");
26258 Clazz_defineMethod (c$, "replaceAllRegion", 
26259 function (s, r, start, end) {
26260 return this.replaceAllRegion ( new com.stevesoft.pat.wrap.StringWrap (s), r, start, end);
26261 }, "~S,com.stevesoft.pat.Regex,~N,~N");
26262 Clazz_defineMethod (c$, "replaceAllRegion", 
26263 function (s, r, start, end) {
26264 this.first = false;
26265 this.rh.me = r;
26266 this.rh.prev = null;
26267 return this.dorep (s, start, end);
26268 }, "com.stevesoft.pat.StringLike,com.stevesoft.pat.Regex,~N,~N");
26269 Clazz_defineMethod (c$, "replaceAll", 
26270 function (s) {
26271 return this.replaceAllRegion (s, 0, s.length ());
26272 }, "com.stevesoft.pat.StringLike");
26273 Clazz_defineMethod (c$, "replaceAllFrom", 
26274 function (s, start) {
26275 return this.replaceAllRegion (s, start, s.length ());
26276 }, "com.stevesoft.pat.StringLike,~N");
26277 Clazz_defineMethod (c$, "replaceAllRegion", 
26278 function (s, start, end) {
26279 this.first = false;
26280 return this.dorep (s, start, end);
26281 }, "com.stevesoft.pat.StringLike,~N,~N");
26282 Clazz_defineMethod (c$, "replaceAll", 
26283 function (s) {
26284 return this.replaceAllRegion ( new com.stevesoft.pat.wrap.StringWrap (s), 0, s.length).toString ();
26285 }, "~S");
26286 Clazz_defineMethod (c$, "replaceAllFrom", 
26287 function (s, start) {
26288 return this.replaceAllRegion ( new com.stevesoft.pat.wrap.StringWrap (s), start, s.length).toString ();
26289 }, "~S,~N");
26290 Clazz_defineMethod (c$, "replaceAllRegion", 
26291 function (s, start, end) {
26292 this.first = false;
26293 return this.dorep ( new com.stevesoft.pat.wrap.StringWrap (s), start, end).toString ();
26294 }, "~S,~N,~N");
26295 Clazz_defineMethod (c$, "isSpecial", 
26296 function (x) {
26297 while (x != null) {
26298 if (Clazz_instanceOf (x, com.stevesoft.pat.SpecialRule) || (Clazz_instanceOf (x, com.stevesoft.pat.RuleHolder) && Clazz_instanceOf ((x).held, com.stevesoft.pat.SpecialRule))) {
26299 return true;
26300 }x = x.next;
26301 }
26302 return false;
26303 }, "com.stevesoft.pat.ReplaceRule");
26304 Clazz_defineMethod (c$, "apply1", 
26305 function (rr) {
26306 rr.charsMatched_++;
26307 this.apply (rr, null);
26308 rr.charsMatched_--;
26309 }, "com.stevesoft.pat.RegRes");
26310 Clazz_defineMethod (c$, "dorep", 
26311 function (s, start, end) {
26312 var ret = s;
26313 this.want_more_text = false;
26314 this.$lastMatchedTo = 0;
26315 if (this.rh.me == null) {
26316 throw  new NullPointerException (com.stevesoft.pat.MessageManager.getString ("exception.replace_null_regex_pointer"));
26317 }if (this.rh.me._searchLike (s, start, end)) {
26318 var rmn = this.rh.me.matchedTo ();
26319 if (this.rh.me.charsMatched () == 0 && !this.isSpecial (this.rh.me.getReplaceRule ())) {
26320 this.apply1 (this.rh.me);
26321 rmn++;
26322 }this.apply (this.rh.me);
26323 if (!this.first) {
26324 for (var i = rmn; !this.want_more_text && this.rh.me._searchLike (s, i, end); i = rmn) {
26325 rmn = this.rh.me.matchedTo ();
26326 if (this.rh.me.charsMatched () == 0) {
26327 if (!this.isSpecial (this.rh.me.getReplaceRule ())) {
26328 this.apply1 (this.rh.me);
26329 }rmn++;
26330 }this.apply (this.rh.me);
26331 }
26332 }ret = this.finish ();
26333 ret = ret == null ? s : ret;
26334 }return ret;
26335 }, "com.stevesoft.pat.StringLike,~N,~N");
26336 Clazz_defineMethod (c$, "apply", 
26337 function (r, rp) {
26338 if (rp == null || (rp.next == null && Clazz_instanceOf (rp, com.stevesoft.pat.AmpersandRule))) {
26339 return;
26340 }if (r.didMatch ()) {
26341 if (this.src == null) {
26342 this.src = r.getStringLike ();
26343 }if (this.sb == null) {
26344 this.sb =  new com.stevesoft.pat.StringBufferLike (this.src.newStringBufferLike ());
26345 }var rmf = r.matchedFrom ();
26346 for (var ii = this.pos; ii < rmf; ii++) {
26347 this.sb.appendC (this.src.charAt (ii));
26348 }
26349 for (var x = rp; x != null; x = x.next) {
26350 x.apply (this.sb, r);
26351 if (Clazz_instanceOf (x, com.stevesoft.pat.SpecialRule)) {
26352 if (Clazz_instanceOf (x, com.stevesoft.pat.WantMoreTextReplaceRule) && this.want_more_text_enable) {
26353 this.want_more_text = true;
26354 } else if (Clazz_instanceOf (x, com.stevesoft.pat.PushRule)) {
26355 var rh2 =  new com.stevesoft.pat.RegHolder ();
26356 rh2.me = (x).NewRule;
26357 rh2.prev = this.rh;
26358 this.rh = rh2;
26359 } else if (Clazz_instanceOf (x, com.stevesoft.pat.PopRule)) {
26360 if (this.rh.prev != null) {
26361 this.rh = this.rh.prev;
26362 }} else if (Clazz_instanceOf (x, com.stevesoft.pat.ChangeRule)) {
26363 this.rh.me = (x).NewRule;
26364 }}}
26365 if (!this.want_more_text) {
26366 this.pos = r.matchedTo ();
26367 }}}, "com.stevesoft.pat.RegRes,com.stevesoft.pat.ReplaceRule");
26368 Clazz_defineMethod (c$, "WantMoreText", 
26369 function () {
26370 return this.want_more_text;
26371 });
26372 Clazz_defineMethod (c$, "apply", 
26373 function (r) {
26374 this.apply (r, r.getReplaceRule ());
26375 }, "com.stevesoft.pat.Regex");
26376 Clazz_defineMethod (c$, "finish", 
26377 function () {
26378 if (this.src == null) {
26379 return null;
26380 }var s_end = this.src.length ();
26381 for (var ii = this.pos; ii < s_end; ii++) {
26382 this.sb.appendC (this.src.charAt (ii));
26383 }
26384 this.src = null;
26385 this.$lastMatchedTo = this.pos;
26386 this.pos = 0;
26387 var retstr = this.sb.toStringLike ();
26388 this.sb = null;
26389 return retstr;
26390 });
26391 Clazz_overrideMethod (c$, "clone", 
26392 function () {
26393 var r =  new com.stevesoft.pat.Replacer ();
26394 r.first = this.first;
26395 r.src = this.src;
26396 r.sb = this.sb;
26397 r.pos = this.pos;
26398 r.$lastMatchedTo = this.$lastMatchedTo;
26399 r.want_more_text = this.want_more_text;
26400 r.want_more_text_enable = this.want_more_text_enable;
26401 r.rh.me = this.rh.me;
26402 r.rh.prev = this.rh.prev;
26403 return r;
26404 });
26405 Clazz_defineMethod (c$, "lastMatchedTo", 
26406 function () {
26407 return this.$lastMatchedTo;
26408 });
26409 Clazz_defineMethod (c$, "getRegex", 
26410 function () {
26411 return this.rh.me;
26412 });
26413 Clazz_defineMethod (c$, "setSource", 
26414 function (sl) {
26415 this.src = sl;
26416 }, "com.stevesoft.pat.StringLike");
26417 Clazz_defineMethod (c$, "setBuffer", 
26418 function (sbl) {
26419 this.sb = sbl;
26420 }, "com.stevesoft.pat.StringBufferLike");
26421 Clazz_defineMethod (c$, "setPos", 
26422 function (pos) {
26423 this.pos = pos;
26424 }, "~N");
26425 });
26426 Clazz_declarePackage ("com.stevesoft.pat");
26427 Clazz_load (["com.stevesoft.pat.ReplaceRule"], "com.stevesoft.pat.AmpersandRule", null, function () {
26428 c$ = Clazz_declareType (com.stevesoft.pat, "AmpersandRule", com.stevesoft.pat.ReplaceRule);
26429 Clazz_makeConstructor (c$, 
26430 function () {
26431 Clazz_superConstructor (this, com.stevesoft.pat.AmpersandRule, []);
26432 });
26433 Clazz_overrideMethod (c$, "apply", 
26434 function (sb, res) {
26435 sb.append (res.stringMatched ());
26436 }, "com.stevesoft.pat.StringBufferLike,com.stevesoft.pat.RegRes");
26437 Clazz_overrideMethod (c$, "toString1", 
26438 function () {
26439 return "$&";
26440 });
26441 });
26442 Clazz_declarePackage ("com.stevesoft.pat");
26443 Clazz_load (["com.stevesoft.pat.SpecialRule"], "com.stevesoft.pat.ChangeRule", null, function () {
26444 c$ = Clazz_decorateAsClass (function () {
26445 this.NewRule = null;
26446 Clazz_instantialize (this, arguments);
26447 }, com.stevesoft.pat, "ChangeRule", com.stevesoft.pat.SpecialRule);
26448 Clazz_makeConstructor (c$, 
26449 function (c) {
26450 Clazz_superConstructor (this, com.stevesoft.pat.ChangeRule, []);
26451 this.NewRule = c.NewRule;
26452 }, "com.stevesoft.pat.ChangeRule");
26453 Clazz_makeConstructor (c$, 
26454 function (nm, rr) {
26455 Clazz_superConstructor (this, com.stevesoft.pat.ChangeRule, []);
26456 this.name = nm;
26457 this.NewRule = rr;
26458 }, "~S,com.stevesoft.pat.Regex");
26459 Clazz_makeConstructor (c$, 
26460 function (nm, tr) {
26461 Clazz_superConstructor (this, com.stevesoft.pat.ChangeRule, []);
26462 this.name = nm;
26463 this.NewRule = tr.rp;
26464 }, "~S,com.stevesoft.pat.Transformer");
26465 Clazz_overrideMethod (c$, "clone1", 
26466 function () {
26467 return  new com.stevesoft.pat.ChangeRule (this);
26468 });
26469 Clazz_overrideMethod (c$, "toString1", 
26470 function () {
26471 return "${=" + this.name + "}";
26472 });
26473 Clazz_overrideMethod (c$, "apply", 
26474 function (sb, rr) {
26475 }, "com.stevesoft.pat.StringBufferLike,com.stevesoft.pat.RegRes");
26476 });
26477 Clazz_declarePackage ("com.stevesoft.pat");
26478 Clazz_load (["com.stevesoft.pat.ReplaceRule"], "com.stevesoft.pat.SpecialRule", null, function () {
26479 c$ = Clazz_declareType (com.stevesoft.pat, "SpecialRule", com.stevesoft.pat.ReplaceRule);
26480 Clazz_makeConstructor (c$, 
26481 function () {
26482 Clazz_superConstructor (this, com.stevesoft.pat.SpecialRule, []);
26483 });
26484 Clazz_overrideMethod (c$, "apply", 
26485 function (sb, rr) {
26486 }, "com.stevesoft.pat.StringBufferLike,com.stevesoft.pat.RegRes");
26487 });
26488 Clazz_declarePackage ("com.stevesoft.pat");
26489 Clazz_load (["com.stevesoft.pat.SpecialRule"], "com.stevesoft.pat.PopRule", null, function () {
26490 c$ = Clazz_declareType (com.stevesoft.pat, "PopRule", com.stevesoft.pat.SpecialRule);
26491 Clazz_makeConstructor (c$, 
26492 function () {
26493 Clazz_superConstructor (this, com.stevesoft.pat.PopRule, []);
26494 });
26495 Clazz_overrideMethod (c$, "toString1", 
26496 function () {
26497 return "${POP}";
26498 });
26499 });
26500 Clazz_declarePackage ("com.stevesoft.pat");
26501 Clazz_load (["com.stevesoft.pat.SpecialRule"], "com.stevesoft.pat.PushRule", null, function () {
26502 c$ = Clazz_decorateAsClass (function () {
26503 this.NewRule = null;
26504 Clazz_instantialize (this, arguments);
26505 }, com.stevesoft.pat, "PushRule", com.stevesoft.pat.SpecialRule);
26506 Clazz_makeConstructor (c$, 
26507 function (p) {
26508 Clazz_superConstructor (this, com.stevesoft.pat.PushRule, []);
26509 this.NewRule = p.NewRule;
26510 }, "com.stevesoft.pat.PushRule");
26511 Clazz_makeConstructor (c$, 
26512 function (nm, rr) {
26513 Clazz_superConstructor (this, com.stevesoft.pat.PushRule, []);
26514 this.name = nm;
26515 this.NewRule = rr;
26516 }, "~S,com.stevesoft.pat.Regex");
26517 Clazz_makeConstructor (c$, 
26518 function (nm, tr) {
26519 Clazz_superConstructor (this, com.stevesoft.pat.PushRule, []);
26520 this.name = nm;
26521 this.NewRule = tr.rp;
26522 }, "~S,com.stevesoft.pat.Transformer");
26523 Clazz_overrideMethod (c$, "clone1", 
26524 function () {
26525 return  new com.stevesoft.pat.PushRule (this);
26526 });
26527 Clazz_defineMethod (c$, "String1", 
26528 function () {
26529 return "${+" + this.name + "}";
26530 });
26531 Clazz_overrideMethod (c$, "apply", 
26532 function (sbl, rr) {
26533 }, "com.stevesoft.pat.StringBufferLike,com.stevesoft.pat.RegRes");
26534 });
26535 Clazz_declarePackage ("com.stevesoft.pat");
26536 Clazz_load (["com.stevesoft.pat.ReplaceRule"], "com.stevesoft.pat.RuleHolder", null, function () {
26537 c$ = Clazz_decorateAsClass (function () {
26538 this.held = null;
26539 Clazz_instantialize (this, arguments);
26540 }, com.stevesoft.pat, "RuleHolder", com.stevesoft.pat.ReplaceRule);
26541 Clazz_makeConstructor (c$, 
26542 function () {
26543 Clazz_superConstructor (this, com.stevesoft.pat.RuleHolder, []);
26544 });
26545 Clazz_makeConstructor (c$, 
26546 function (h) {
26547 Clazz_superConstructor (this, com.stevesoft.pat.RuleHolder, []);
26548 this.held = h;
26549 }, "com.stevesoft.pat.ReplaceRule");
26550 Clazz_overrideMethod (c$, "clone1", 
26551 function () {
26552 return  new com.stevesoft.pat.RuleHolder (this.held);
26553 });
26554 Clazz_defineMethod (c$, "toString1", 
26555 function () {
26556 return this.held.toString1 ();
26557 });
26558 Clazz_defineMethod (c$, "apply", 
26559 function (sb, rr) {
26560 this.held.apply (sb, rr);
26561 }, "com.stevesoft.pat.StringBufferLike,com.stevesoft.pat.RegRes");
26562 Clazz_defineMethod (c$, "arg", 
26563 function (s) {
26564 return  new com.stevesoft.pat.RuleHolder (this.held.arg (s));
26565 }, "~S");
26566 });
26567 Clazz_declarePackage ("com.stevesoft.pat");
26568 Clazz_load (["com.stevesoft.pat.BasicStringBufferLike"], "com.stevesoft.pat.StringBufferLike", ["com.stevesoft.pat.CaseMgr"], function () {
26569 c$ = Clazz_decorateAsClass (function () {
26570 this.sbl = null;
26571 this.mode = 'E';
26572 this.altMode = ' ';
26573 Clazz_instantialize (this, arguments);
26574 }, com.stevesoft.pat, "StringBufferLike", null, com.stevesoft.pat.BasicStringBufferLike);
26575 Clazz_makeConstructor (c$, 
26576 function (sbl) {
26577 this.sbl = sbl;
26578 }, "com.stevesoft.pat.BasicStringBufferLike");
26579 Clazz_defineMethod (c$, "toStringLike", 
26580 function () {
26581 return this.sbl.toStringLike ();
26582 });
26583 Clazz_defineMethod (c$, "toString", 
26584 function () {
26585 return this.sbl.toString ();
26586 });
26587 Clazz_defineMethod (c$, "appendC", 
26588 function (c) {
26589 switch (this.mode) {
26590 case 'u':
26591 this.mode = this.altMode;
26592 this.altMode = ' ';
26593 case 'U':
26594 this.sbl.appendC (com.stevesoft.pat.CaseMgr.toUpperCaseC (c));
26595 break;
26596 case 'l':
26597 this.mode = this.altMode;
26598 this.altMode = ' ';
26599 case 'L':
26600 this.sbl.appendC (com.stevesoft.pat.CaseMgr.toLowerCaseC (c));
26601 break;
26602 case 'Q':
26603 if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9')) {
26604 ;} else {
26605 this.sbl.appendC ('\\');
26606 }default:
26607 this.sbl.appendC (c);
26608 break;
26609 }
26610 }, "~S");
26611 Clazz_overrideMethod (c$, "append", 
26612 function (s) {
26613 for (var i = 0; i < s.length; i++) {
26614 this.appendC (s.charAt (i));
26615 }
26616 }, "~S");
26617 Clazz_defineMethod (c$, "setMode", 
26618 function (c) {
26619 if (c == 'u' || c == 'l') {
26620 if (this.altMode == ' ') {
26621 this.altMode = this.mode;
26622 }}this.mode = c;
26623 }, "~S");
26624 Clazz_defineMethod (c$, "unwrap", 
26625 function () {
26626 return this.sbl.unwrap ();
26627 });
26628 });
26629 Clazz_declarePackage ("com.stevesoft.pat");
26630 Clazz_declareInterface (com.stevesoft.pat, "BasicStringBufferLike");
26631 Clazz_declarePackage ("com.stevesoft.pat");
26632 Clazz_load (["com.stevesoft.pat.SpecialRule"], "com.stevesoft.pat.WantMoreTextReplaceRule", null, function () {
26633 c$ = Clazz_declareType (com.stevesoft.pat, "WantMoreTextReplaceRule", com.stevesoft.pat.SpecialRule);
26634 Clazz_makeConstructor (c$, 
26635 function () {
26636 Clazz_superConstructor (this, com.stevesoft.pat.WantMoreTextReplaceRule, []);
26637 });
26638 Clazz_overrideMethod (c$, "apply", 
26639 function (sb, res) {
26640 }, "com.stevesoft.pat.StringBufferLike,com.stevesoft.pat.RegRes");
26641 Clazz_overrideMethod (c$, "toString1", 
26642 function () {
26643 return "${WANT_MORE_TEXT}";
26644 });
26645 });
26646 Clazz_declarePackage ("com.stevesoft.pat.wrap");
26647 Clazz_load (["com.stevesoft.pat.StringLike"], "com.stevesoft.pat.wrap.StringWrap", ["com.stevesoft.pat.wrap.StringBufferWrap"], function () {
26648 c$ = Clazz_decorateAsClass (function () {
26649 this.s = null;
26650 Clazz_instantialize (this, arguments);
26651 }, com.stevesoft.pat.wrap, "StringWrap", null, com.stevesoft.pat.StringLike);
26652 Clazz_makeConstructor (c$, 
26653 function (s) {
26654 this.s = s;
26655 }, "~S");
26656 Clazz_overrideMethod (c$, "toString", 
26657 function () {
26658 return this.s;
26659 });
26660 Clazz_overrideMethod (c$, "charAt", 
26661 function (i) {
26662 return this.s.charAt (i);
26663 }, "~N");
26664 Clazz_overrideMethod (c$, "length", 
26665 function () {
26666 return this.s.length;
26667 });
26668 Clazz_overrideMethod (c$, "substring", 
26669 function (i1, i2) {
26670 return this.s.substring (i1, i2);
26671 }, "~N,~N");
26672 Clazz_overrideMethod (c$, "unwrap", 
26673 function () {
26674 return this.s;
26675 });
26676 Clazz_overrideMethod (c$, "newStringBufferLike", 
26677 function () {
26678 return  new com.stevesoft.pat.wrap.StringBufferWrap ();
26679 });
26680 Clazz_overrideMethod (c$, "indexOf", 
26681 function (c) {
26682 return this.s.indexOf (c);
26683 }, "~S");
26684 });
26685 Clazz_declarePackage ("com.stevesoft.pat");
26686 Clazz_declareInterface (com.stevesoft.pat, "StringLike");
26687 Clazz_declarePackage ("com.stevesoft.pat.wrap");
26688 Clazz_load (["com.stevesoft.pat.BasicStringBufferLike", "java.lang.StringBuffer"], "com.stevesoft.pat.wrap.StringBufferWrap", ["com.stevesoft.pat.wrap.StringWrap"], function () {
26689 c$ = Clazz_decorateAsClass (function () {
26690 this.sb = null;
26691 Clazz_instantialize (this, arguments);
26692 }, com.stevesoft.pat.wrap, "StringBufferWrap", null, com.stevesoft.pat.BasicStringBufferLike);
26693 Clazz_prepareFields (c$, function () {
26694 this.sb =  new StringBuffer ();
26695 });
26696 Clazz_overrideMethod (c$, "appendC", 
26697 function (c) {
26698 this.sb.append (c);
26699 }, "~S");
26700 Clazz_overrideMethod (c$, "append", 
26701 function (s) {
26702 this.sb.append (s);
26703 }, "~S");
26704 Clazz_defineMethod (c$, "length", 
26705 function () {
26706 return this.sb.length ();
26707 });
26708 Clazz_overrideMethod (c$, "toString", 
26709 function () {
26710 return this.sb.toString ();
26711 });
26712 Clazz_overrideMethod (c$, "toStringLike", 
26713 function () {
26714 return  new com.stevesoft.pat.wrap.StringWrap (this.sb.toString ());
26715 });
26716 Clazz_overrideMethod (c$, "unwrap", 
26717 function () {
26718 return this.sb;
26719 });
26720 });
26721 Clazz_declarePackage ("com.stevesoft.pat");
26722 Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.TransPat", ["com.stevesoft.pat.Regex"], function () {
26723 c$ = Clazz_decorateAsClass (function () {
26724 this.ra = null;
26725 this.ra_len = 0;
26726 this.pn = -1;
26727 this.lastMatchedTo = -1;
26728 Clazz_instantialize (this, arguments);
26729 }, com.stevesoft.pat, "TransPat", com.stevesoft.pat.Pattern);
26730 Clazz_prepareFields (c$, function () {
26731 this.ra =  new Array (10);
26732 });
26733 Clazz_overrideMethod (c$, "toString", 
26734 function () {
26735 return "(?#TransPat)";
26736 });
26737 Clazz_makeConstructor (c$, 
26738 function () {
26739 Clazz_superConstructor (this, com.stevesoft.pat.TransPat, []);
26740 });
26741 Clazz_defineMethod (c$, "matchInternal", 
26742 function (pos, pt) {
26743 for (var i = 0; i < this.ra_len; i++) {
26744 pt.ignoreCase = this.ra[i].ignoreCase;
26745 pt.mFlag = this.ra[i].mFlag;
26746 pt.dotDoesntMatchCR = com.stevesoft.pat.Regex.dotDoesntMatchCR;
26747 var r = this.ra[i].thePattern.matchInternal (pos, pt);
26748 if (r >= 0) {
26749 this.pn = i;
26750 return r;
26751 }}
26752 this.pn = -1;
26753 return -1;
26754 }, "~N,com.stevesoft.pat.Pthings");
26755 });
26756 Clazz_declarePackage ("com.stevesoft.pat");
26757 Clazz_load (["com.stevesoft.pat.Regex"], "com.stevesoft.pat.Rthings", null, function () {
26758 c$ = Clazz_decorateAsClass (function () {
26759 this.val = 0;
26760 this.ignoreCase = false;
26761 this.dontMatchInQuotes = false;
26762 this.optimizeMe = false;
26763 this.noBackRefs = false;
26764 this.parenLevel = 0;
26765 this.gFlag = false;
26766 this.mFlag = false;
26767 this.sFlag = false;
26768 this.p = null;
26769 this.o = null;
26770 Clazz_instantialize (this, arguments);
26771 }, com.stevesoft.pat, "Rthings");
26772 Clazz_prepareFields (c$, function () {
26773 this.val = com.stevesoft.pat.Regex.BackRefOffset;
26774 });
26775 Clazz_makeConstructor (c$, 
26776 function (r) {
26777 this.ignoreCase = r.ignoreCase;
26778 this.dontMatchInQuotes = r.dontMatchInQuotes;
26779 }, "com.stevesoft.pat.Regex");
26780 Clazz_defineMethod (c$, "set", 
26781 function (r) {
26782 r.gFlag = this.gFlag;
26783 r.mFlag = this.mFlag;
26784 r.sFlag = this.sFlag;
26785 r.ignoreCase = this.ignoreCase;
26786 r.dontMatchInQuotes = this.dontMatchInQuotes;
26787 if (this.optimizeMe) {
26788 r.optimize ();
26789 }}, "com.stevesoft.pat.Regex");
26790 });
26791 Clazz_declarePackage ("com.stevesoft.pat");
26792 Clazz_load (null, "com.stevesoft.pat.Skip", ["com.stevesoft.pat.CaseMgr", "$.Or", "$.Skipped", "$.oneChar", "java.lang.StringBuffer"], function () {
26793 c$ = Clazz_decorateAsClass (function () {
26794 this.src = null;
26795 this.c = 0;
26796 this.mask = 0;
26797 this.$offset = 0;
26798 this.ign = false;
26799 this.m1 = false;
26800 Clazz_instantialize (this, arguments);
26801 }, com.stevesoft.pat, "Skip");
26802 c$.mkmask = Clazz_defineMethod (c$, "mkmask", 
26803 function (c) {
26804 var x = String.fromCharCode (c);
26805 return ~((com.stevesoft.pat.CaseMgr.toUpperCaseC (x)).charCodeAt (0) | (com.stevesoft.pat.CaseMgr.toLowerCaseC (x)).charCodeAt (0) | (com.stevesoft.pat.CaseMgr.toTitleCaseC (x)).charCodeAt (0));
26806 }, "~N");
26807 c$.string = Clazz_defineMethod (c$, "string", 
26808 function (r) {
26809 return r.skipper == null ? null : r.skipper.src;
26810 }, "com.stevesoft.pat.Regex");
26811 c$.offset = Clazz_defineMethod (c$, "offset", 
26812 function (r) {
26813 return r.skipper == null ? -1 : r.skipper.$offset;
26814 }, "com.stevesoft.pat.Regex");
26815 Clazz_makeConstructor (c$, 
26816 function (s, ign, o) {
26817 this.src = s;
26818 this.c = s.charCodeAt (0);
26819 if (ign) {
26820 this.mask = com.stevesoft.pat.Skip.mkmask (this.c);
26821 } else {
26822 this.mask = 0;
26823 }this.$offset = o;
26824 this.ign = ign;
26825 this.m1 = (s.length == 1);
26826 }, "~S,~B,~N");
26827 Clazz_defineMethod (c$, "find", 
26828 function (s) {
26829 return this.find (s, 0, s.length ());
26830 }, "com.stevesoft.pat.StringLike");
26831 c$.min = Clazz_defineMethod (c$, "min", 
26832 function (a, b) {
26833 return a < b ? a : b;
26834 }, "~N,~N");
26835 Clazz_defineMethod (c$, "find", 
26836 function (s, start, end) {
26837 if (start > end) {
26838 return -1;
26839 }start += this.$offset;
26840 var vend = com.stevesoft.pat.Skip.min (s.length () - 1, end + this.$offset);
26841 if (this.mask != this.c) {
26842 for (var i = start; i <= vend; i++) {
26843 if (0 == (s.charCodeAt (i) & this.mask)) {
26844 if (this.m1 || com.stevesoft.pat.CaseMgr.regionMatchesLike2 (s, this.ign, i, this.src, 0, this.src.length)) {
26845 return i - this.$offset;
26846 }}}
26847 } else {
26848 for (var i = start; i <= vend; i++) {
26849 if (this.c == s.charCodeAt (i)) {
26850 if (this.m1 || com.stevesoft.pat.CaseMgr.regionMatchesLike2 (s, this.ign, i, this.src, 0, this.src.length)) {
26851 return i - this.$offset;
26852 }}}
26853 }return -1;
26854 }, "com.stevesoft.pat.StringLike,~N,~N");
26855 c$.findSkipRegex = Clazz_defineMethod (c$, "findSkipRegex", 
26856 function (r) {
26857 return com.stevesoft.pat.Skip.findSkip (r.thePattern, r.ignoreCase, !r.dontMatchInQuotes);
26858 }, "com.stevesoft.pat.Regex");
26859 c$.findSkip = Clazz_defineMethod (c$, "findSkip", 
26860 function (p, ignoreCase, trnc) {
26861 var sb =  new StringBuffer ();
26862 var subsk = null;
26863 var offset = 0;
26864 var skipc = -1;
26865 var skipoff = 0;
26866 for (; p != null; p = p.next) {
26867 if (Clazz_instanceOf (p, com.stevesoft.pat.oneChar)) {
26868 skipc = ((p).c).charCodeAt (0);
26869 skipoff = offset;
26870 }if (Clazz_instanceOf (p, com.stevesoft.pat.oneChar) && Clazz_instanceOf (p.next, com.stevesoft.pat.oneChar)) {
26871 var psav = p;
26872 sb.append ((p).c);
26873 while (Clazz_instanceOf (p.next, com.stevesoft.pat.oneChar)) {
26874 sb.append ((p.next).c);
26875 p = p.next;
26876 }
26877 var st = sb.toString ();
26878 var sk = null;
26879 if (st.length > 2) {
26880 sk =  new com.stevesoft.pat.SkipBMH (st, ignoreCase, offset);
26881 } else {
26882 sk =  new com.stevesoft.pat.Skip2 (st, ignoreCase, offset);
26883 }if (trnc && st.length > 2) {
26884 psav.next =  new com.stevesoft.pat.Skipped (st.substring (1));
26885 psav.next.next = p.next;
26886 psav.next.parent = p.parent;
26887 }return sk;
26888 } else if (Clazz_instanceOf (p, com.stevesoft.pat.Or) && (p).v.size () == 1 && !(p).leftForm ().equals ("(?!") && null != (subsk = com.stevesoft.pat.Skip.findSkip ((p).v.elementAt (0), ignoreCase, trnc))) {
26889 subsk.$offset += offset;
26890 return subsk;
26891 } else if (p.minChars ().equals (p.maxChars ())) {
26892 offset += p.minChars ().intValue ();
26893 } else {
26894 return skipc < 0 ? null :  new com.stevesoft.pat.Skip ("" + String.fromCharCode (skipc), ignoreCase, skipoff);
26895 }}
26896 return null;
26897 }, "com.stevesoft.pat.Pattern,~B,~B");
26898 });
26899 Clazz_declarePackage ("com.stevesoft.pat");
26900 Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.Skipped", ["com.stevesoft.pat.CaseMgr", "$.patInt"], function () {
26901 c$ = Clazz_decorateAsClass (function () {
26902 this.s = null;
26903 Clazz_instantialize (this, arguments);
26904 }, com.stevesoft.pat, "Skipped", com.stevesoft.pat.Pattern);
26905 Clazz_makeConstructor (c$, 
26906 function (s) {
26907 Clazz_superConstructor (this, com.stevesoft.pat.Skipped, []);
26908 this.s = s;
26909 }, "~S");
26910 Clazz_overrideMethod (c$, "toString", 
26911 function () {
26912 return this.s + this.nextString ();
26913 });
26914 Clazz_overrideMethod (c$, "matchInternal", 
26915 function (pos, pt) {
26916 if (pt.no_check || com.stevesoft.pat.CaseMgr.regionMatches (this.s, pt.ignoreCase, 0, pt.src, pos, this.s.length)) {
26917 return this.nextMatch (pos + this.s.length, pt);
26918 }return -1;
26919 }, "~N,com.stevesoft.pat.Pthings");
26920 Clazz_overrideMethod (c$, "minChars", 
26921 function () {
26922 return  new com.stevesoft.pat.patInt (this.s.length);
26923 });
26924 Clazz_overrideMethod (c$, "maxChars", 
26925 function () {
26926 return  new com.stevesoft.pat.patInt (this.s.length);
26927 });
26928 Clazz_overrideMethod (c$, "clone1", 
26929 function (h) {
26930 return  new com.stevesoft.pat.Skipped (this.s);
26931 }, "java.util.Hashtable");
26932 });
26933 Clazz_declarePackage ("com.stevesoft.pat");
26934 Clazz_load (["com.stevesoft.pat.Pattern"], "com.stevesoft.pat.Start", ["com.stevesoft.pat.patInt"], function () {
26935 c$ = Clazz_decorateAsClass (function () {
26936 this.retIsStart = false;
26937 Clazz_instantialize (this, arguments);
26938 }, com.stevesoft.pat, "Start", com.stevesoft.pat.Pattern);
26939 Clazz_makeConstructor (c$, 
26940 function (b) {
26941 Clazz_superConstructor (this, com.stevesoft.pat.Start, []);
26942 this.retIsStart = b;
26943 }, "~B");
26944 Clazz_overrideMethod (c$, "matchInternal", 
26945 function (pos, pt) {
26946 if (this.retIsStart && pt.mFlag && pos > 0 && pt.src.charAt (pos - 1) == '\n') {
26947 return this.nextMatch (pos, pt);
26948 }if (pos == 0) {
26949 return this.nextMatch (pos, pt);
26950 }return -1;
26951 }, "~N,com.stevesoft.pat.Pthings");
26952 Clazz_overrideMethod (c$, "toString", 
26953 function () {
26954 if (this.retIsStart) {
26955 return "^" + this.nextString ();
26956 } else {
26957 return "\\A" + this.nextString ();
26958 }});
26959 Clazz_overrideMethod (c$, "maxChars", 
26960 function () {
26961 return  new com.stevesoft.pat.patInt (0);
26962 });
26963 Clazz_overrideMethod (c$, "clone1", 
26964 function (h) {
26965 return  new com.stevesoft.pat.Start (this.retIsStart);
26966 }, "java.util.Hashtable");
26967 });
26968 Clazz_declarePackage ("com.stevesoft.pat");
26969 Clazz_load (null, "com.stevesoft.pat.StrPos", ["com.stevesoft.pat.patInf", "$.patInt"], function () {
26970 c$ = Clazz_decorateAsClass (function () {
26971 this.s = null;
26972 this.$pos = 0;
26973 this.esc = '\\';
26974 this.c = '\0';
26975 this.dontMatch = false;
26976 this.$eos = false;
26977 Clazz_instantialize (this, arguments);
26978 }, com.stevesoft.pat, "StrPos");
26979 Clazz_defineMethod (c$, "pos", 
26980 function () {
26981 return this.$pos;
26982 });
26983 Clazz_defineMethod (c$, "thisChar", 
26984 function () {
26985 return this.c;
26986 });
26987 Clazz_defineMethod (c$, "eos", 
26988 function () {
26989 return this.$eos;
26990 });
26991 Clazz_makeConstructor (c$, 
26992 function (sp) {
26993 this.dup (sp);
26994 }, "com.stevesoft.pat.StrPos");
26995 Clazz_defineMethod (c$, "dup", 
26996 function (sp) {
26997 this.s = sp.s;
26998 this.$pos = sp.$pos;
26999 this.c = sp.c;
27000 this.dontMatch = sp.dontMatch;
27001 this.$eos = sp.$eos;
27002 }, "com.stevesoft.pat.StrPos");
27003 Clazz_makeConstructor (c$, 
27004 function (s, pos) {
27005 this.s = s;
27006 this.$pos = pos - 1;
27007 this.inc ();
27008 }, "~S,~N");
27009 Clazz_defineMethod (c$, "inc", 
27010 function () {
27011 this.$pos++;
27012 if (this.$pos >= this.s.length) {
27013 this.$eos = true;
27014 return this;
27015 }this.$eos = false;
27016 this.c = this.s.charAt (this.$pos);
27017 if (this.c == this.esc && this.$pos + 1 < this.s.length) {
27018 this.$pos++;
27019 this.c = this.s.charAt (this.$pos);
27020 if (this.c != this.esc) {
27021 this.dontMatch = true;
27022 } else {
27023 this.dontMatch = false;
27024 }} else {
27025 this.dontMatch = false;
27026 }return this;
27027 });
27028 Clazz_defineMethod (c$, "match", 
27029 function (ch) {
27030 if (this.dontMatch || this.$eos) {
27031 return false;
27032 }return this.c == ch;
27033 }, "~S");
27034 Clazz_defineMethod (c$, "escMatch", 
27035 function (ch) {
27036 if (!this.dontMatch || this.$eos) {
27037 return false;
27038 }return this.c == ch;
27039 }, "~S");
27040 Clazz_defineMethod (c$, "escaped", 
27041 function () {
27042 return this.dontMatch;
27043 });
27044 Clazz_defineMethod (c$, "incMatch", 
27045 function (st) {
27046 var sp =  new com.stevesoft.pat.StrPos (this);
27047 var i;
27048 for (i = 0; i < st.length; i++) {
27049 if (!sp.match (st.charAt (i))) {
27050 return false;
27051 }sp.inc ();
27052 }
27053 this.dup (sp);
27054 return true;
27055 }, "~S");
27056 Clazz_defineMethod (c$, "getPatInt", 
27057 function () {
27058 if (this.incMatch ("inf")) {
27059 return  new com.stevesoft.pat.patInf ();
27060 }var i;
27061 var cnt = 0;
27062 var sp =  new com.stevesoft.pat.StrPos (this);
27063 for (i = 0; !sp.$eos && sp.c >= '0' && sp.c <= '9'; i++) {
27064 cnt = 10 * cnt + sp.c.charCodeAt (0) - 48;
27065 sp.inc ();
27066 }
27067 if (i == 0) {
27068 return null;
27069 }this.dup (sp);
27070 return  new com.stevesoft.pat.patInt (cnt);
27071 });
27072 Clazz_defineMethod (c$, "getString", 
27073 function () {
27074 return this.s;
27075 });
27076 });
27077 Clazz_declarePackage ("com.stevesoft.pat");
27078 Clazz_load (["com.stevesoft.pat.Or"], "com.stevesoft.pat.lookAhead", ["com.stevesoft.pat.patInt"], function () {
27079 c$ = Clazz_decorateAsClass (function () {
27080 this.reverse = false;
27081 Clazz_instantialize (this, arguments);
27082 }, com.stevesoft.pat, "lookAhead", com.stevesoft.pat.Or);
27083 Clazz_makeConstructor (c$, 
27084 function (b) {
27085 Clazz_superConstructor (this, com.stevesoft.pat.lookAhead, []);
27086 this.reverse = b;
27087 }, "~B");
27088 Clazz_defineMethod (c$, "getNext", 
27089 function () {
27090 return null;
27091 });
27092 Clazz_overrideMethod (c$, "nextMatch", 
27093 function (pos, pt) {
27094 var p = Clazz_superCall (this, com.stevesoft.pat.lookAhead, "getNext", []);
27095 if (p != null) {
27096 return p.matchInternal (pos, pt);
27097 } else {
27098 return pos;
27099 }}, "~N,com.stevesoft.pat.Pthings");
27100 Clazz_defineMethod (c$, "matchInternal", 
27101 function (pos, pt) {
27102 if (Clazz_superCall (this, com.stevesoft.pat.lookAhead, "matchInternal", [pos, pt]) >= 0) {
27103 if (this.reverse) {
27104 return -1;
27105 } else {
27106 return this.nextMatch (pos, pt);
27107 }} else {
27108 if (this.reverse) {
27109 return this.nextMatch (pos, pt);
27110 } else {
27111 return -1;
27112 }}}, "~N,com.stevesoft.pat.Pthings");
27113 Clazz_overrideMethod (c$, "leftForm", 
27114 function () {
27115 if (this.reverse) {
27116 return "(?!";
27117 } else {
27118 return "(?=";
27119 }});
27120 Clazz_overrideMethod (c$, "minChars", 
27121 function () {
27122 return  new com.stevesoft.pat.patInt (0);
27123 });
27124 Clazz_overrideMethod (c$, "maxChars", 
27125 function () {
27126 return  new com.stevesoft.pat.patInt (0);
27127 });
27128 Clazz_overrideMethod (c$, "clone1", 
27129 function (h) {
27130 var la =  new com.stevesoft.pat.lookAhead (this.reverse);
27131 h.put (this, la);
27132 h.put (la, la);
27133 for (var i = 0; i < this.v.size (); i++) {
27134 la.v.addElement ((this.v.elementAt (i)).clone (h));
27135 }
27136 return la;
27137 }, "java.util.Hashtable");
27138 });
27139 Clazz_declarePackage ("com.stevesoft.pat");
27140 Clazz_load (null, "com.stevesoft.pat.parsePerl", ["com.stevesoft.pat.CaseMgr", "$.Prop", "$.RegSyntaxError", "$.Regex", "$.ReplaceRule", "$.StringRule", "java.lang.StringBuffer"], function () {
27141 c$ = Clazz_declareType (com.stevesoft.pat, "parsePerl");
27142 c$.close = Clazz_defineMethod (c$, "close", 
27143 function (c) {
27144 if (c == '<') {
27145 return '>';
27146 }if (c == '[') {
27147 return ']';
27148 }if (c == '(') {
27149 return ')';
27150 }if (c == '{') {
27151 return '}';
27152 }return c;
27153 }, "~S");
27154 c$.codify = Clazz_defineMethod (c$, "codify", 
27155 function (s, keepbs) {
27156 return com.stevesoft.pat.parsePerl.codifyRange (s, 0, s.length, keepbs);
27157 }, "~S,~B");
27158 c$.codifyRange = Clazz_defineMethod (c$, "codifyRange", 
27159 function (s, i0, iN, keepbs) {
27160 var sb =  new StringBuffer ();
27161 var ucmode = false;
27162 var lcmode = false;
27163 var litmode = false;
27164 var uc1 = false;
27165 var lc1 = false;
27166 var modified = false;
27167 for (var i = i0; i < iN; i++) {
27168 var c = s.charAt (i);
27169 var mf = true;
27170 var app = true;
27171 if (c == '\\') {
27172 app = false;
27173 i++;
27174 if (i < s.length) {
27175 var c2 = s.charAt (i);
27176 switch (c2) {
27177 case 'Q':
27178 litmode = true;
27179 break;
27180 case 'U':
27181 ucmode = true;
27182 break;
27183 case 'L':
27184 lcmode = true;
27185 break;
27186 case 'u':
27187 uc1 = true;
27188 break;
27189 case 'l':
27190 lc1 = true;
27191 break;
27192 case 'E':
27193 uc1 = lc1 = ucmode = lcmode = litmode = false;
27194 break;
27195 default:
27196 if (keepbs) {
27197 sb.append ('\\');
27198 }c = c2;
27199 if (keepbs) {
27200 mf = false;
27201 }app = true;
27202 break;
27203 }
27204 modified = new Boolean (modified | mf).valueOf ();
27205 }}if (app) {
27206 if (lc1) {
27207 c = com.stevesoft.pat.parsePerl.lc (c);
27208 lc1 = false;
27209 } else if (uc1) {
27210 c = com.stevesoft.pat.parsePerl.uc (c);
27211 uc1 = false;
27212 } else if (ucmode) {
27213 c = com.stevesoft.pat.parsePerl.uc (c);
27214 } else if (lcmode) {
27215 c = com.stevesoft.pat.parsePerl.lc (c);
27216 }if (litmode && com.stevesoft.pat.parsePerl.needbs (c)) {
27217 sb.append ('\\');
27218 }sb.append (c);
27219 }}
27220 return modified ? sb.toString () : s;
27221 }, "~S,~N,~N,~B");
27222 c$.uc = Clazz_defineMethod (c$, "uc", 
27223 function (c) {
27224 return com.stevesoft.pat.CaseMgr.toUpperCaseC (c);
27225 }, "~S");
27226 c$.lc = Clazz_defineMethod (c$, "lc", 
27227 function (c) {
27228 return com.stevesoft.pat.CaseMgr.toLowerCaseC (c);
27229 }, "~S");
27230 c$.needbs = Clazz_defineMethod (c$, "needbs", 
27231 function (c) {
27232 if (c >= 'a' && c <= 'z') {
27233 return false;
27234 }if (c >= 'A' && c <= 'Z') {
27235 return false;
27236 }if (c >= '0' && c <= '9') {
27237 return false;
27238 }if (c == '_') {
27239 return false;
27240 }return true;
27241 }, "~S");
27242 c$.parse = Clazz_defineMethod (c$, "parse", 
27243 function (s) {
27244 var igncase = false;
27245 var optim = false;
27246 var gFlag = false;
27247 var sFlag = false;
27248 var mFlag = false;
27249 var xFlag = false;
27250 var s1 =  new StringBuffer ();
27251 var s2 =  new StringBuffer ();
27252 var i = 0;
27253 var count = 0;
27254 var mode;
27255 var delim = '/';
27256 var cdelim = '/';
27257 if (s.length >= 3 && s.charAt (0) == 's') {
27258 mode = 's';
27259 delim = s.charAt (1);
27260 cdelim = com.stevesoft.pat.parsePerl.close (delim);
27261 i = 2;
27262 } else if (s.length >= 2 && s.charAt (0) == 'm') {
27263 mode = 'm';
27264 delim = s.charAt (1);
27265 cdelim = com.stevesoft.pat.parsePerl.close (delim);
27266 i = 2;
27267 } else if (s.length >= 1 && s.charAt (0) == '/') {
27268 mode = 'm';
27269 i = 1;
27270 } else {
27271 try {
27272 com.stevesoft.pat.RegSyntaxError.endItAll ("Regex.perlCode should be of the form s/// or m// or //");
27273 } catch (rs) {
27274 if (Clazz_exceptionOf (rs, com.stevesoft.pat.RegSyntax)) {
27275 } else {
27276 throw rs;
27277 }
27278 }
27279 return null;
27280 }for (; i < s.length; i++) {
27281 if (s.charAt (i) == '\\') {
27282 s1.append ('\\');
27283 i++;
27284 } else if (s.charAt (i) == cdelim && count == 0) {
27285 i++;
27286 break;
27287 } else if (s.charAt (i) == delim && cdelim != delim) {
27288 count++;
27289 } else if (s.charAt (i) == cdelim && cdelim != delim) {
27290 count--;
27291 }s1.append (s.charAt (i));
27292 }
27293 if (mode == 's' && cdelim != delim) {
27294 while (i < s.length && com.stevesoft.pat.Prop.isWhite (s.charAt (i))) {
27295 i++;
27296 }
27297 if (i >= s.length) {
27298 try {
27299 com.stevesoft.pat.RegSyntaxError.endItAll ("" + mode + delim + " needs " + cdelim);
27300 } catch (rs) {
27301 if (Clazz_exceptionOf (rs, com.stevesoft.pat.RegSyntax)) {
27302 } else {
27303 throw rs;
27304 }
27305 }
27306 return null;
27307 }cdelim = com.stevesoft.pat.parsePerl.close (delim = s.charAt (i));
27308 i++;
27309 }count = 0;
27310 if (mode == 's') {
27311 for (; i < s.length; i++) {
27312 if (s.charAt (i) == '\\') {
27313 s2.append ('\\');
27314 i++;
27315 } else if (s.charAt (i) == cdelim && count == 0) {
27316 i++;
27317 break;
27318 } else if (s.charAt (i) == delim && cdelim != delim) {
27319 count++;
27320 } else if (s.charAt (i) == cdelim && cdelim != delim) {
27321 count--;
27322 }s2.append (s.charAt (i));
27323 }
27324 }for (; i < s.length; i++) {
27325 var c = s.charAt (i);
27326 switch (c) {
27327 case 'x':
27328 xFlag = true;
27329 break;
27330 case 'i':
27331 igncase = true;
27332 break;
27333 case 'o':
27334 optim = true;
27335 break;
27336 case 's':
27337 sFlag = true;
27338 break;
27339 case 'm':
27340 mFlag = true;
27341 break;
27342 case 'g':
27343 gFlag = true;
27344 break;
27345 default:
27346 try {
27347 com.stevesoft.pat.RegSyntaxError.endItAll ("Illegal flag to pattern: " + c);
27348 } catch (rs) {
27349 if (Clazz_exceptionOf (rs, com.stevesoft.pat.RegSyntax)) {
27350 } else {
27351 throw rs;
27352 }
27353 }
27354 return null;
27355 }
27356 }
27357 var r =  new com.stevesoft.pat.Regex (null, "");
27358 try {
27359 var pat = s1.toString ();
27360 var reprul = s2.toString ();
27361 if (xFlag) {
27362 pat = com.stevesoft.pat.parsePerl.strip (pat);
27363 reprul = com.stevesoft.pat.parsePerl.strip (reprul);
27364 }r.compile (pat);
27365 r.ignoreCase = new Boolean (r.ignoreCase | igncase).valueOf ();
27366 r.gFlag = new Boolean (r.gFlag | gFlag).valueOf ();
27367 r.sFlag = new Boolean (r.sFlag | sFlag).valueOf ();
27368 r.mFlag = new Boolean (r.mFlag | mFlag).valueOf ();
27369 if (optim) {
27370 r.optimize ();
27371 }if (delim == '\'') {
27372 r.setReplaceRule ( new com.stevesoft.pat.StringRule (reprul));
27373 } else {
27374 r.setReplaceRule (com.stevesoft.pat.ReplaceRule.perlCode (reprul));
27375 }} catch (rs) {
27376 if (Clazz_exceptionOf (rs, com.stevesoft.pat.RegSyntax)) {
27377 r = null;
27378 } else {
27379 throw rs;
27380 }
27381 }
27382 return r;
27383 }, "~S");
27384 c$.strip = Clazz_defineMethod (c$, "strip", 
27385 function (s) {
27386 var sb =  new StringBuffer ();
27387 for (var i = 0; i < s.length; i++) {
27388 var c = s.charAt (i);
27389 if (com.stevesoft.pat.Prop.isWhite (c)) {
27390 ;} else if (c == '#') {
27391 i++;
27392 while (i < s.length) {
27393 if (s.charAt (i) == '\n') {
27394 break;
27395 }i++;
27396 }
27397 } else if (c == '\\') {
27398 sb.append (c);
27399 sb.append (s.charAt (++i));
27400 } else {
27401 sb.append (c);
27402 }}
27403 return sb.toString ();
27404 }, "~S");
27405 });
27406 Clazz_declarePackage ("com.stevesoft.pat");
27407 Clazz_load (["com.stevesoft.pat.ReplaceRule"], "com.stevesoft.pat.StringRule", null, function () {
27408 c$ = Clazz_decorateAsClass (function () {
27409 this.s = null;
27410 Clazz_instantialize (this, arguments);
27411 }, com.stevesoft.pat, "StringRule", com.stevesoft.pat.ReplaceRule);
27412 Clazz_makeConstructor (c$, 
27413 function (s) {
27414 Clazz_superConstructor (this, com.stevesoft.pat.StringRule, []);
27415 this.s = s;
27416 }, "~S");
27417 Clazz_overrideMethod (c$, "apply", 
27418 function (sb, res) {
27419 sb.append (this.s);
27420 }, "com.stevesoft.pat.StringBufferLike,com.stevesoft.pat.RegRes");
27421 Clazz_overrideMethod (c$, "toString1", 
27422 function () {
27423 return this.s;
27424 });
27425 Clazz_overrideMethod (c$, "clone1", 
27426 function () {
27427 return  new com.stevesoft.pat.StringRule (this.s);
27428 });
27429 });
27430 Clazz_declarePackage ("jalview.datamodel");
27431 Clazz_load (["java.util.HashMap"], "jalview.datamodel.AlignmentAnnotation", ["jalview.analysis.Rna", "jalview.datamodel.Annotation", "$.GraphLine", "jalview.schemes.ResidueProperties", "java.lang.Double", "$.Error", "$.Long", "$.StringBuffer", "$.StringBuilder", "java.util.Collections"], function () {
27432 c$ = Clazz_decorateAsClass (function () {
27433 this.autoCalculated = false;
27434 this.annotationId = null;
27435 this.sequenceRef = null;
27436 this.label = null;
27437 this.description = null;
27438 this.annotations = null;
27439 this.bps = null;
27440 this._rnasecstr = null;
27441 this.invalidrnastruc = -2;
27442 this.sequenceMapping = null;
27443 this.graphMin = 0;
27444 this.graphMax = 0;
27445 this.score = NaN;
27446 this.$hasScore = false;
27447 this.threshold = null;
27448 this.editable = false;
27449 this.hasIcons = false;
27450 this.hasText = false;
27451 this.visible = true;
27452 this.graphGroup = -1;
27453 this.height = 0;
27454 this.graph = 0;
27455 this.graphHeight = 40;
27456 this.padGaps = false;
27457 this.belowAlignment = true;
27458 this.groupRef = null;
27459 this.showAllColLabels = false;
27460 this.scaleColLabel = false;
27461 this.centreColLabels = false;
27462 this.isrna = false;
27463 if (!Clazz_isClassDefined ("jalview.datamodel.AlignmentAnnotation.AnnotCharSequence")) {
27464 jalview.datamodel.AlignmentAnnotation.$AlignmentAnnotation$AnnotCharSequence$ ();
27465 }
27466 this._lastrnaannot = -1;
27467 this.calcId = "";
27468 this.properties = null;
27469 this._linecolour = null;
27470 Clazz_instantialize (this, arguments);
27471 }, jalview.datamodel, "AlignmentAnnotation");
27472 Clazz_prepareFields (c$, function () {
27473 this.properties =  new java.util.HashMap ();
27474 });
27475 Clazz_defineMethod (c$, "_updateRnaSecStr", 
27476  function (RNAannot) {
27477 try {
27478 this._rnasecstr = jalview.analysis.Rna.GetBasePairs (RNAannot);
27479 this.bps = jalview.analysis.Rna.GetModeleBP (RNAannot);
27480 this.invalidrnastruc = -1;
27481 } catch (px) {
27482 if (Clazz_exceptionOf (px, jalview.analysis.WUSSParseException)) {
27483 this.invalidrnastruc = px.getProblemPos ();
27484 } else {
27485 throw px;
27486 }
27487 }
27488 if (this.invalidrnastruc > -1) {
27489 return;
27490 }jalview.analysis.Rna.HelixMap (this._rnasecstr);
27491 if (this._rnasecstr != null && this._rnasecstr.length > 0) {
27492 this.isrna = true;
27493 this.showAllColLabels = true;
27494 this.scaleColLabel = true;
27495 this._markRnaHelices ();
27496 }}, "CharSequence");
27497 Clazz_defineMethod (c$, "_markRnaHelices", 
27498  function () {
27499 var mxval = 0;
27500 for (var x = 0; x < this._rnasecstr.length; x++) {
27501 var val = 0;
27502 try {
27503 val = (Integer.$valueOf (this._rnasecstr[x].getFeatureGroup ())).intValue ();
27504 if (mxval < val) {
27505 mxval = val;
27506 }} catch (q) {
27507 if (Clazz_exceptionOf (q, NumberFormatException)) {
27508 } else {
27509 throw q;
27510 }
27511 }
27512 ;this.annotations[this._rnasecstr[x].getBegin ()].value = val;
27513 this.annotations[this._rnasecstr[x].getEnd ()].value = val;
27514 }
27515 this.setScore (mxval);
27516 });
27517 Clazz_defineMethod (c$, "finalize", 
27518 function () {
27519 this.sequenceRef = null;
27520 this.groupRef = null;
27521 Clazz_superCall (this, jalview.datamodel.AlignmentAnnotation, "finalize", []);
27522 });
27523 c$.getGraphValueFromString = Clazz_defineMethod (c$, "getGraphValueFromString", 
27524 function (string) {
27525 if (string.equalsIgnoreCase ("BAR_GRAPH")) {
27526 return 1;
27527 } else if (string.equalsIgnoreCase ("LINE_GRAPH")) {
27528 return 2;
27529 } else {
27530 return 0;
27531 }}, "~S");
27532 Clazz_defineMethod (c$, "ConcenStru", 
27533 function (RNAannot) {
27534 this.bps = jalview.analysis.Rna.GetModeleBP (RNAannot);
27535 }, "CharSequence");
27536 Clazz_makeConstructor (c$, 
27537 function (label, description, annotations) {
27538 this.setAnnotationId ();
27539 this.editable = true;
27540 this.label = label;
27541 this.description = description;
27542 this.annotations = annotations;
27543 this.validateRangeAndDisplay ();
27544 }, "~S,~S,~A");
27545 Clazz_defineMethod (c$, "areLabelsSecondaryStructure", 
27546 function () {
27547 var nonSSLabel = false;
27548 this.isrna = false;
27549 var rnastring =  new StringBuffer ();
27550 var firstChar = String.fromCharCode (0);
27551 for (var i = 0; i < this.annotations.length; i++) {
27552 if (this.annotations[i] == null) {
27553 continue;
27554 }if (this.annotations[i].secondaryStructure == 'H' || this.annotations[i].secondaryStructure == 'E') {
27555 this.hasIcons = new Boolean (this.hasIcons | true).valueOf ();
27556 } else {
27557 if (this.annotations[i].secondaryStructure == '(' || this.annotations[i].secondaryStructure == '[' || this.annotations[i].secondaryStructure == '<' || this.annotations[i].secondaryStructure == '{' || this.annotations[i].secondaryStructure == 'A' || this.annotations[i].secondaryStructure == 'B' || this.annotations[i].secondaryStructure == 'C' || this.annotations[i].secondaryStructure == 'D' || this.annotations[i].secondaryStructure == 'E' || this.annotations[i].secondaryStructure == 'F' || this.annotations[i].secondaryStructure == 'G' || this.annotations[i].secondaryStructure == 'H' || this.annotations[i].secondaryStructure == 'I' || this.annotations[i].secondaryStructure == 'J' || this.annotations[i].secondaryStructure == 'K' || this.annotations[i].secondaryStructure == 'L' || this.annotations[i].secondaryStructure == 'M' || this.annotations[i].secondaryStructure == 'N' || this.annotations[i].secondaryStructure == 'O' || this.annotations[i].secondaryStructure == 'P' || this.annotations[i].secondaryStructure == 'Q' || this.annotations[i].secondaryStructure == 'R' || this.annotations[i].secondaryStructure == 'S' || this.annotations[i].secondaryStructure == 'T' || this.annotations[i].secondaryStructure == 'U' || this.annotations[i].secondaryStructure == 'V' || this.annotations[i].secondaryStructure == 'W' || this.annotations[i].secondaryStructure == 'X' || this.annotations[i].secondaryStructure == 'Y' || this.annotations[i].secondaryStructure == 'Z') {
27558 this.hasIcons = new Boolean (this.hasIcons | true).valueOf ();
27559 this.isrna = new Boolean (this.isrna | true).valueOf ();
27560 }}if (this.annotations[i].displayCharacter == null || this.annotations[i].displayCharacter.length == 0) {
27561 rnastring.append ('.');
27562 continue;
27563 }if (this.annotations[i].displayCharacter.length == 1) {
27564 firstChar = this.annotations[i].displayCharacter.charAt (0);
27565 if (this.annotations[i].secondaryStructure != ' ' && !this.hasIcons && firstChar != ' ' && firstChar != '$' && firstChar.charCodeAt (0) != 0xCE && firstChar != '(' && firstChar != '[' && firstChar != '>' && firstChar != '{' && firstChar != 'A' && firstChar != 'B' && firstChar != 'C' && firstChar != 'D' && firstChar != 'E' && firstChar != 'F' && firstChar != 'G' && firstChar != 'H' && firstChar != 'I' && firstChar != 'J' && firstChar != 'K' && firstChar != 'L' && firstChar != 'M' && firstChar != 'N' && firstChar != 'O' && firstChar != 'P' && firstChar != 'Q' && firstChar != 'R' && firstChar != 'S' && firstChar != 'T' && firstChar != 'U' && firstChar != 'V' && firstChar != 'W' && firstChar != 'X' && firstChar != 'Y' && firstChar != 'Z' && firstChar != '-' && firstChar.charCodeAt (0) < jalview.schemes.ResidueProperties.aaIndex.length) {
27566 if (jalview.schemes.ResidueProperties.aaIndex[firstChar.charCodeAt (0)] < 23) {
27567 nonSSLabel = true;
27568 }}} else {
27569 rnastring.append (this.annotations[i].displayCharacter.charAt (1));
27570 }if (this.annotations[i].displayCharacter.length > 0) {
27571 this.hasText = true;
27572 }}
27573 if (nonSSLabel) {
27574 this.hasIcons = false;
27575 for (var j = 0; j < this.annotations.length; j++) {
27576 if (this.annotations[j] != null && this.annotations[j].secondaryStructure != ' ') {
27577 this.annotations[j].displayCharacter = String.valueOf (this.annotations[j].secondaryStructure);
27578 this.annotations[j].secondaryStructure = ' ';
27579 }}
27580 } else {
27581 if (this.isrna) {
27582 this._updateRnaSecStr (Clazz_innerTypeInstance (jalview.datamodel.AlignmentAnnotation.AnnotCharSequence, this, null));
27583 }}});
27584 Clazz_defineMethod (c$, "getRNAStruc", 
27585 function () {
27586 if (this.isrna) {
27587 var rnastruc = Clazz_innerTypeInstance (jalview.datamodel.AlignmentAnnotation.AnnotCharSequence, this, null).toString ();
27588 if (this._lastrnaannot != rnastruc.hashCode ()) {
27589 this._lastrnaannot = rnastruc.hashCode ();
27590 this._updateRnaSecStr (rnastruc);
27591 }return rnastruc;
27592 }return null;
27593 });
27594 Clazz_makeConstructor (c$, 
27595 function (label, description, annotations, min, max, graphType) {
27596 this.setAnnotationId ();
27597 this.editable = graphType == 0;
27598 this.label = label;
27599 this.description = description;
27600 this.annotations = annotations;
27601 this.graph = graphType;
27602 this.graphMin = min;
27603 this.graphMax = max;
27604 this.validateRangeAndDisplay ();
27605 }, "~S,~S,~A,~N,~N,~N");
27606 Clazz_defineMethod (c$, "validateRangeAndDisplay", 
27607 function () {
27608 if (this.annotations == null) {
27609 this.visible = false;
27610 return;
27611 }var graphType = this.graph;
27612 var min = this.graphMin;
27613 var max = this.graphMax;
27614 var drawValues = true;
27615 this._linecolour = null;
27616 if (min == max) {
27617 min = 999999999;
27618 for (var i = 0; i < this.annotations.length; i++) {
27619 if (this.annotations[i] == null) {
27620 continue;
27621 }if (drawValues && this.annotations[i].displayCharacter != null && this.annotations[i].displayCharacter.length > 1) {
27622 drawValues = false;
27623 }if (this.annotations[i].value > max) {
27624 max = this.annotations[i].value;
27625 }if (this.annotations[i].value < min) {
27626 min = this.annotations[i].value;
27627 }if (this._linecolour == null && this.annotations[i].colour != null) {
27628 this._linecolour = this.annotations[i].colour;
27629 }}
27630 if (min > 0) {
27631 min = 0;
27632 } else {
27633 if (max < 0) {
27634 max = 0;
27635 }}}this.graphMin = min;
27636 this.graphMax = max;
27637 this.areLabelsSecondaryStructure ();
27638 if (!drawValues && graphType != 0) {
27639 for (var i = 0; i < this.annotations.length; i++) {
27640 if (this.annotations[i] != null) {
27641 this.annotations[i].displayCharacter = "";
27642 }}
27643 }});
27644 Clazz_makeConstructor (c$, 
27645 function (annotation) {
27646 this.setAnnotationId ();
27647 this.label =  String.instantialize (annotation.label);
27648 if (annotation.description != null) {
27649 this.description =  String.instantialize (annotation.description);
27650 }this.graphMin = annotation.graphMin;
27651 this.graphMax = annotation.graphMax;
27652 this.graph = annotation.graph;
27653 this.graphHeight = annotation.graphHeight;
27654 this.graphGroup = annotation.graphGroup;
27655 this.groupRef = annotation.groupRef;
27656 this.editable = annotation.editable;
27657 this.autoCalculated = annotation.autoCalculated;
27658 this.hasIcons = annotation.hasIcons;
27659 this.hasText = annotation.hasText;
27660 this.height = annotation.height;
27661 this.label = annotation.label;
27662 this.padGaps = annotation.padGaps;
27663 this.visible = annotation.visible;
27664 this.centreColLabels = annotation.centreColLabels;
27665 this.scaleColLabel = annotation.scaleColLabel;
27666 this.showAllColLabels = annotation.showAllColLabels;
27667 this.calcId = annotation.calcId;
27668 if (annotation.properties != null) {
27669 this.properties =  new java.util.HashMap ();
27670 for (var val, $val = annotation.properties.entrySet ().iterator (); $val.hasNext () && ((val = $val.next ()) || true);) {
27671 this.properties.put (val.getKey (), val.getValue ());
27672 }
27673 }if (this.$hasScore = annotation.$hasScore) {
27674 this.score = annotation.score;
27675 }if (annotation.threshold != null) {
27676 this.threshold =  new jalview.datamodel.GraphLine (annotation.threshold);
27677 }var ann = annotation.annotations;
27678 if (annotation.annotations != null) {
27679 this.annotations =  new Array (ann.length);
27680 for (var i = 0; i < ann.length; i++) {
27681 if (ann[i] != null) {
27682 this.annotations[i] =  new jalview.datamodel.Annotation (ann[i]);
27683 if (this._linecolour != null) {
27684 this._linecolour = this.annotations[i].colour;
27685 }}}
27686 }if (annotation.sequenceRef != null) {
27687 this.sequenceRef = annotation.sequenceRef;
27688 if (annotation.sequenceMapping != null) {
27689 var p = null;
27690 this.sequenceMapping =  new java.util.HashMap ();
27691 var pos = annotation.sequenceMapping.keySet ().iterator ();
27692 while (pos.hasNext ()) {
27693 p = pos.next ();
27694 var a = annotation.sequenceMapping.get (p);
27695 if (a == null) {
27696 continue;
27697 }if (ann != null) {
27698 for (var i = 0; i < ann.length; i++) {
27699 if (ann[i] === a) {
27700 this.sequenceMapping.put (p, this.annotations[i]);
27701 }}
27702 }}
27703 } else {
27704 this.sequenceMapping = null;
27705 }}{
27706 }this.validateRangeAndDisplay ();
27707 }, "jalview.datamodel.AlignmentAnnotation");
27708 Clazz_defineMethod (c$, "restrict", 
27709 function (startRes, endRes) {
27710 if (this.annotations == null) {
27711 return;
27712 }if (startRes < 0) {
27713 startRes = 0;
27714 }if (startRes >= this.annotations.length) {
27715 startRes = this.annotations.length - 1;
27716 }if (endRes >= this.annotations.length) {
27717 endRes = this.annotations.length - 1;
27718 }if (this.annotations == null) {
27719 return;
27720 }var temp =  new Array (endRes - startRes + 1);
27721 if (startRes < this.annotations.length) {
27722 System.arraycopy (this.annotations, startRes, temp, 0, endRes - startRes + 1);
27723 }if (this.sequenceRef != null) {
27724 var spos = this.sequenceRef.findPosition (startRes);
27725 var epos = this.sequenceRef.findPosition (endRes);
27726 if (this.sequenceMapping != null) {
27727 var newmapping =  new java.util.HashMap ();
27728 var e = this.sequenceMapping.keySet ().iterator ();
27729 while (e.hasNext ()) {
27730 var pos = e.next ();
27731 if (pos.intValue () >= spos && pos.intValue () <= epos) {
27732 newmapping.put (pos, this.sequenceMapping.get (pos));
27733 }}
27734 this.sequenceMapping.clear ();
27735 this.sequenceMapping = newmapping;
27736 }}this.annotations = temp;
27737 }, "~N,~N");
27738 Clazz_defineMethod (c$, "padAnnotation", 
27739 function (length) {
27740 if (this.annotations == null) {
27741 return true;
27742 }if (this.annotations.length < length) {
27743 var na =  new Array (length);
27744 System.arraycopy (this.annotations, 0, na, 0, this.annotations.length);
27745 this.annotations = na;
27746 return true;
27747 }return this.annotations.length > length;
27748 }, "~N");
27749 Clazz_overrideMethod (c$, "toString", 
27750 function () {
27751 var buffer =  new StringBuilder (256);
27752 for (var i = 0; i < this.annotations.length; i++) {
27753 if (this.annotations[i] != null) {
27754 if (this.graph != 0) {
27755 buffer.append (this.annotations[i].value);
27756 } else if (this.hasIcons) {
27757 buffer.append (this.annotations[i].secondaryStructure);
27758 } else {
27759 buffer.append (this.annotations[i].displayCharacter);
27760 }}buffer.append (", ");
27761 }
27762 if (this.label.indexOf ("Consensus") == 0) {
27763 buffer.append ("\n");
27764 for (var i = 0; i < this.annotations.length; i++) {
27765 if (this.annotations[i] != null) {
27766 buffer.append (this.annotations[i].description);
27767 }buffer.append (", ");
27768 }
27769 }return buffer.toString ();
27770 });
27771 Clazz_defineMethod (c$, "setThreshold", 
27772 function (line) {
27773 this.threshold = line;
27774 }, "jalview.datamodel.GraphLine");
27775 Clazz_defineMethod (c$, "getThreshold", 
27776 function () {
27777 return this.threshold;
27778 });
27779 Clazz_defineMethod (c$, "createSequenceMapping", 
27780 function (seqRef, startRes, alreadyMapped) {
27781 if (seqRef == null) {
27782 return;
27783 }this.sequenceRef = seqRef;
27784 if (this.annotations == null) {
27785 return;
27786 }this.sequenceMapping =  new java.util.HashMap ();
27787 var seqPos;
27788 for (var i = 0; i < this.annotations.length; i++) {
27789 if (this.annotations[i] != null) {
27790 if (alreadyMapped) {
27791 seqPos = seqRef.findPosition (i);
27792 } else {
27793 seqPos = i + startRes;
27794 }this.sequenceMapping.put ( new Integer (seqPos), this.annotations[i]);
27795 }}
27796 }, "jalview.datamodel.SequenceI,~N,~B");
27797 Clazz_defineMethod (c$, "adjustForAlignment", 
27798 function () {
27799 if (this.sequenceRef == null) {
27800 return;
27801 }if (this.annotations == null) {
27802 return;
27803 }var a = 0;
27804 var aSize = this.sequenceRef.getLength ();
27805 if (aSize == 0) {
27806 return;
27807 }var position;
27808 var temp =  new Array (aSize);
27809 var index;
27810 for (a = this.sequenceRef.getStart (); a <= this.sequenceRef.getEnd (); a++) {
27811 index =  new Integer (a);
27812 if (this.sequenceMapping.containsKey (index)) {
27813 position = this.sequenceRef.findIndex (a) - 1;
27814 temp[position] = this.sequenceMapping.get (index);
27815 }}
27816 this.annotations = temp;
27817 });
27818 Clazz_defineMethod (c$, "compactAnnotationArray", 
27819 function () {
27820 var i = 0;
27821 var iSize = this.annotations.length;
27822 while (i < iSize) {
27823 if (this.annotations[i] == null) {
27824 if (i + 1 < iSize) {
27825 System.arraycopy (this.annotations, i + 1, this.annotations, i, iSize - i - 1);
27826 }iSize--;
27827 } else {
27828 i++;
27829 }}
27830 var ann = this.annotations;
27831 this.annotations =  new Array (i);
27832 System.arraycopy (ann, 0, this.annotations, 0, i);
27833 ann = null;
27834 return iSize;
27835 });
27836 Clazz_defineMethod (c$, "setSequenceRef", 
27837 function (sequenceI) {
27838 if (sequenceI != null) {
27839 if (this.sequenceRef != null) {
27840 var rIsDs = this.sequenceRef.getDatasetSequence () == null;
27841 var tIsDs = sequenceI.getDatasetSequence () == null;
27842 if (this.sequenceRef !== sequenceI && (rIsDs && !tIsDs && this.sequenceRef !== sequenceI.getDatasetSequence ()) && (!rIsDs && tIsDs && this.sequenceRef.getDatasetSequence () !== sequenceI) && (!rIsDs && !tIsDs && this.sequenceRef.getDatasetSequence () !== sequenceI.getDatasetSequence ()) && !this.sequenceRef.equals (sequenceI)) {
27843 this.sequenceRef = null;
27844 if (this.sequenceMapping != null) {
27845 this.sequenceMapping = null;
27846 }this.createSequenceMapping (sequenceI, 1, true);
27847 this.adjustForAlignment ();
27848 } else {
27849 this.sequenceRef = sequenceI;
27850 }} else {
27851 this.createSequenceMapping (sequenceI, 1, true);
27852 this.adjustForAlignment ();
27853 }} else {
27854 this.sequenceMapping = null;
27855 this.sequenceRef = null;
27856 }}, "jalview.datamodel.SequenceI");
27857 Clazz_defineMethod (c$, "getScore", 
27858 function () {
27859 return this.score;
27860 });
27861 Clazz_defineMethod (c$, "setScore", 
27862 function (score) {
27863 this.$hasScore = true;
27864 this.score = score;
27865 }, "~N");
27866 Clazz_defineMethod (c$, "hasScore", 
27867 function () {
27868 return this.$hasScore || !Double.isNaN (this.score);
27869 });
27870 Clazz_makeConstructor (c$, 
27871 function (label, description, score) {
27872 this.construct (label, description, null);
27873 this.setScore (score);
27874 }, "~S,~S,~N");
27875 Clazz_makeConstructor (c$, 
27876 function (alignmentAnnotation, colSel) {
27877 this.construct (alignmentAnnotation);
27878 if (this.annotations == null) {
27879 return;
27880 }colSel.makeVisibleAnnotation (this);
27881 }, "jalview.datamodel.AlignmentAnnotation,jalview.datamodel.ColumnSelection");
27882 Clazz_defineMethod (c$, "setPadGaps", 
27883 function (padgaps, gapchar) {
27884 this.padGaps = padgaps;
27885 if (padgaps) {
27886 this.hasText = true;
27887 for (var i = 0; i < this.annotations.length; i++) {
27888 if (this.annotations[i] == null) {
27889 this.annotations[i] =  new jalview.datamodel.Annotation (String.valueOf (gapchar), null, ' ', 0, null);
27890 } else if (this.annotations[i].displayCharacter == null || this.annotations[i].displayCharacter.equals (" ")) {
27891 this.annotations[i].displayCharacter = String.valueOf (gapchar);
27892 }}
27893 }}, "~B,~S");
27894 Clazz_defineMethod (c$, "getDescription", 
27895 function (seqname) {
27896 if (seqname && this.sequenceRef != null) {
27897 var i = this.description.toLowerCase ().indexOf ("<html>");
27898 if (i > -1) {
27899 return "<html>" + this.sequenceRef.getName () + " : " + this.description.substring (i + 6);
27900 }return this.sequenceRef.getName () + " : " + this.description;
27901 }return this.description;
27902 }, "~B");
27903 Clazz_defineMethod (c$, "isValidStruc", 
27904 function () {
27905 return this.invalidrnastruc == -1;
27906 });
27907 Clazz_defineMethod (c$, "getInvalidStrucPos", 
27908 function () {
27909 return this.invalidrnastruc;
27910 });
27911 Clazz_defineMethod (c$, "getCalcId", 
27912 function () {
27913 return this.calcId;
27914 });
27915 Clazz_defineMethod (c$, "setCalcId", 
27916 function (calcId) {
27917 this.calcId = calcId;
27918 }, "~S");
27919 Clazz_defineMethod (c$, "isRNA", 
27920 function () {
27921 return this.isrna;
27922 });
27923 Clazz_defineMethod (c$, "liftOver", 
27924 function (sq, sp2sq) {
27925 if (sp2sq.getMappedWidth () != sp2sq.getWidth ()) {
27926 throw  new Error ("liftOver currently not implemented for transfer of annotation between different types of seqeunce");
27927 }var mapIsTo = (sp2sq != null) ? (sp2sq.getTo () === sq || sp2sq.getTo () === sq.getDatasetSequence ()) : false;
27928 var mapForsq =  new java.util.HashMap ();
27929 if (this.sequenceMapping != null) {
27930 if (sp2sq != null) {
27931 for (var ie, $ie = this.sequenceMapping.entrySet ().iterator (); $ie.hasNext () && ((ie = $ie.next ()) || true);) {
27932 var mpos = Integer.$valueOf (mapIsTo ? sp2sq.getMappedPosition ((ie.getKey ()).intValue ()) : sp2sq.getPosition ((ie.getKey ()).intValue ()));
27933 if ((mpos).intValue () >= sq.getStart () && (mpos).intValue () <= sq.getEnd ()) {
27934 mapForsq.put (mpos, ie.getValue ());
27935 }}
27936 this.sequenceMapping = mapForsq;
27937 this.sequenceRef = sq;
27938 this.adjustForAlignment ();
27939 } else {
27940 }}}, "jalview.datamodel.SequenceI,jalview.datamodel.Mapping");
27941 Clazz_defineMethod (c$, "remap", 
27942 function (newref, mapping, from, to, idxoffset) {
27943 if (mapping != null) {
27944 var old = this.sequenceMapping;
27945 var remap =  new java.util.HashMap ();
27946 var index = -1;
27947 for (var mp, $mp = 0, $$mp = mapping; $mp < $$mp.length && ((mp = $$mp[$mp]) || true); $mp++) {
27948 if (index++ < 0) {
27949 continue;
27950 }var ann = null;
27951 if (from == -1) {
27952 ann = this.sequenceMapping.get (Integer.$valueOf (idxoffset + index));
27953 } else {
27954 if (mp != null && mp.length > from) {
27955 ann = this.sequenceMapping.get (Integer.$valueOf (mp[from]));
27956 }}if (ann != null) {
27957 if (to == -1) {
27958 remap.put (Integer.$valueOf (idxoffset + index), ann);
27959 } else {
27960 if (to > -1 && to < mp.length) {
27961 remap.put (Integer.$valueOf (mp[to]), ann);
27962 }}}}
27963 this.sequenceMapping = remap;
27964 old.clear ();
27965 if (newref != null) {
27966 this.sequenceRef = newref;
27967 }this.adjustForAlignment ();
27968 }}, "jalview.datamodel.SequenceI,~A,~N,~N,~N");
27969 Clazz_defineMethod (c$, "getProperty", 
27970 function (property) {
27971 if (this.properties == null) {
27972 return null;
27973 }return this.properties.get (property);
27974 }, "~S");
27975 Clazz_defineMethod (c$, "setProperty", 
27976 function (property, value) {
27977 if (this.properties == null) {
27978 this.properties =  new java.util.HashMap ();
27979 }this.properties.put (property, value);
27980 }, "~S,~S");
27981 Clazz_defineMethod (c$, "hasProperties", 
27982 function () {
27983 return this.properties != null && this.properties.size () > 0;
27984 });
27985 Clazz_defineMethod (c$, "getProperties", 
27986 function () {
27987 if (this.properties == null) {
27988 return java.util.Collections.emptyList ();
27989 }return this.properties.keySet ();
27990 });
27991 Clazz_defineMethod (c$, "getAnnotationForPosition", 
27992 function (position) {
27993 return this.sequenceMapping == null ? null : this.sequenceMapping.get (new Integer (position));
27994 }, "~N");
27995 Clazz_defineMethod (c$, "setAnnotationId", 
27996 function () {
27997 this.annotationId = "ann" + Long.toString (jalview.datamodel.AlignmentAnnotation.nextId ());
27998 });
27999 c$.nextId = Clazz_defineMethod (c$, "nextId", 
28000 function () {
28001 return jalview.datamodel.AlignmentAnnotation.counter++;
28002 });
28003 c$.$AlignmentAnnotation$AnnotCharSequence$ = function () {
28004 Clazz_pu$h(self.c$);
28005 c$ = Clazz_decorateAsClass (function () {
28006 Clazz_prepareCallback (this, arguments);
28007 this.offset = 0;
28008 this.max = 0;
28009 Clazz_instantialize (this, arguments);
28010 }, jalview.datamodel.AlignmentAnnotation, "AnnotCharSequence", null, CharSequence);
28011 Clazz_makeConstructor (c$, 
28012 function () {
28013 this.construct (0, this.b$["jalview.datamodel.AlignmentAnnotation"].annotations.length);
28014 });
28015 Clazz_makeConstructor (c$, 
28016 function (a, b) {
28017 this.offset = a;
28018 this.max = b;
28019 }, "~N,~N");
28020 Clazz_overrideMethod (c$, "subSequence", 
28021 function (a, b) {
28022 return Clazz_innerTypeInstance (jalview.datamodel.AlignmentAnnotation.AnnotCharSequence, this, null, this.offset + a, this.offset + b);
28023 }, "~N,~N");
28024 Clazz_overrideMethod (c$, "length", 
28025 function () {
28026 return this.max - this.offset;
28027 });
28028 Clazz_overrideMethod (c$, "charAt", 
28029 function (a) {
28030 return ((a + this.offset < 0) || (a + this.offset) >= this.max || this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[a + this.offset] == null || (this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[a + this.offset].secondaryStructure <= ' ') ? ' ' : this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[a + this.offset].displayCharacter == null || this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[a + this.offset].displayCharacter.length == 0 ? this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[a + this.offset].secondaryStructure : this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[a + this.offset].displayCharacter.charAt (0));
28031 }, "~N");
28032 Clazz_overrideMethod (c$, "toString", 
28033 function () {
28034 var a =  Clazz_newCharArray (this.max - this.offset, '\0');
28035 var b = this.b$["jalview.datamodel.AlignmentAnnotation"].annotations.length;
28036 for (var c = this.offset; c < b; c++) {
28037 a[c] = (this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[c] == null || ((this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[c].secondaryStructure).charCodeAt (0) <= 32)) ? ' ' : (this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[c].displayCharacter == null || this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[c].displayCharacter.length == 0 ? this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[c].secondaryStructure : this.b$["jalview.datamodel.AlignmentAnnotation"].annotations[c].displayCharacter.charAt (0));
28038 }
28039 return  String.instantialize (a);
28040 });
28041 c$ = Clazz_p0p ();
28042 };
28043 Clazz_defineStatics (c$,
28044 "ANNOTATION_ID_PREFIX", "ann",
28045 "SEQUENCE_PROFILE", 0,
28046 "STRUCTURE_PROFILE", 1,
28047 "CDNA_PROFILE", 2,
28048 "counter", 0,
28049 "NO_GRAPH", 0,
28050 "BAR_GRAPH", 1,
28051 "LINE_GRAPH", 2);
28052 });
28053 Clazz_declarePackage ("jalview.analysis");
28054 Clazz_load (["java.util.Arrays", "$.HashSet", "$.Hashtable"], "jalview.analysis.Rna", ["jalview.analysis.SecStrConsensus", "$.WUSSParseException", "jalview.datamodel.SequenceFeature", "jalview.util.MessageManager", "java.lang.StringBuffer", "java.util.ArrayList", "$.Stack", "$.Vector"], function () {
28055 c$ = Clazz_declareType (jalview.analysis, "Rna");
28056 c$.isOpeningParenthesis = Clazz_defineMethod (c$, "isOpeningParenthesis", 
28057  function (c) {
28058 return jalview.analysis.Rna.openingParsSet.contains (new Character (c).charCodeAt (0));
28059 }, "~S");
28060 c$.isClosingParenthesis = Clazz_defineMethod (c$, "isClosingParenthesis", 
28061  function (c) {
28062 return jalview.analysis.Rna.closingParsSet.contains (new Character (c).charCodeAt (0));
28063 }, "~S");
28064 c$.matchingOpeningParenthesis = Clazz_defineMethod (c$, "matchingOpeningParenthesis", 
28065  function (closingParenthesis) {
28066 if (!jalview.analysis.Rna.isClosingParenthesis (closingParenthesis)) {
28067 throw  new jalview.analysis.WUSSParseException (jalview.util.MessageManager.formatMessage ("exception.querying_matching_opening_parenthesis_for_non_closing_parenthesis",  Clazz_newArray (-1, [ new StringBuffer (closingParenthesis.charCodeAt (0)).toString ()])), -1);
28068 }return String.fromCharCode (jalview.analysis.Rna.closingToOpening.get (new Character (closingParenthesis).charCodeAt (0)));
28069 }, "~S");
28070 c$.GetSimpleBPs = Clazz_defineMethod (c$, "GetSimpleBPs", 
28071 function (line) {
28072 var stacks =  new java.util.Hashtable ();
28073 var pairs =  new java.util.Vector ();
28074 var i = 0;
28075 while (i < line.length) {
28076 var base = line.charAt (i);
28077 if (jalview.analysis.Rna.isOpeningParenthesis (base)) {
28078 if (!stacks.containsKey (new Character (base).charCodeAt (0))) {
28079 stacks.put (new Character (base).charCodeAt (0),  new java.util.Stack ());
28080 }stacks.get (new Character (base).charCodeAt (0)).push (new Integer (i));
28081 } else if (jalview.analysis.Rna.isClosingParenthesis (base)) {
28082 var opening = jalview.analysis.Rna.matchingOpeningParenthesis (base);
28083 if (!stacks.containsKey (new Character (opening).charCodeAt (0))) {
28084 throw  new jalview.analysis.WUSSParseException (jalview.util.MessageManager.formatMessage ("exception.mismatched_unseen_closing_char",  Clazz_newArray (-1, [ new StringBuffer (base.charCodeAt (0)).toString ()])), i);
28085 }var stack = stacks.get (new Character (opening).charCodeAt (0));
28086 if (stack.isEmpty ()) {
28087 throw  new jalview.analysis.WUSSParseException (jalview.util.MessageManager.formatMessage ("exception.mismatched_closing_char",  Clazz_newArray (-1, [ new StringBuffer (base.charCodeAt (0)).toString ()])), i);
28088 }var temp = (stack.pop ()).intValue ();
28089 pairs.add ( new jalview.analysis.SecStrConsensus.SimpleBP (temp, i));
28090 }i++;
28091 }
28092 for (var opening, $opening = stacks.keySet ().iterator (); $opening.hasNext () && ((opening = $opening.next ()) || true);) {
28093 var stack = stacks.get (new Character (opening).charCodeAt (0));
28094 if (!stack.empty ()) {
28095 throw  new jalview.analysis.WUSSParseException (jalview.util.MessageManager.formatMessage ("exception.mismatched_opening_char",  Clazz_newArray (-1, [ new StringBuffer (opening.charCodeAt (0)).toString (), Integer.$valueOf ((stack.pop ()).intValue ()).toString ()])), i);
28096 }}
28097 return pairs;
28098 }, "CharSequence");
28099 c$.GetBasePairs = Clazz_defineMethod (c$, "GetBasePairs", 
28100 function (line) {
28101 var bps = jalview.analysis.Rna.GetSimpleBPs (line);
28102 var outPairs =  new Array (bps.size ());
28103 for (var p = 0; p < bps.size (); p++) {
28104 var bp = bps.elementAt (p);
28105 outPairs[p] =  new jalview.datamodel.SequenceFeature ("RNA helix", "", "", bp.getBP5 (), bp.getBP3 (), "");
28106 }
28107 return outPairs;
28108 }, "CharSequence");
28109 c$.GetModeleBP = Clazz_defineMethod (c$, "GetModeleBP", 
28110 function (line) {
28111 var bps = jalview.analysis.Rna.GetSimpleBPs (line);
28112 return  new java.util.ArrayList (bps);
28113 }, "CharSequence");
28114 c$.HelixMap = Clazz_defineMethod (c$, "HelixMap", 
28115 function (pairs) {
28116 var helix = 0;
28117 var lastopen = 0;
28118 var lastclose = 9999999;
28119 var i = pairs.length;
28120 var open;
28121 var close;
28122 var j;
28123 var helices =  new java.util.Hashtable ();
28124 for (i = 0; i < pairs.length; i++) {
28125 open = pairs[i].getBegin ();
28126 close = pairs[i].getEnd ();
28127 if (open > lastclose) {
28128 helix++;
28129 }j = pairs.length - 1;
28130 while (j >= 0) {
28131 var popen = pairs[j].getBegin ();
28132 if ((popen < lastopen) && (popen > open)) {
28133 if (helices.containsValue (new Integer (popen)) && (((helices.get (new Integer (popen)))).intValue () === helix)) {
28134 continue;
28135 } else {
28136 helix++;
28137 break;
28138 }}j -= 1;
28139 }
28140 helices.put (new Integer (open), new Integer (helix));
28141 helices.put (new Integer (close), new Integer (helix));
28142 pairs[i].setFeatureGroup (Integer.toString (helix));
28143 lastopen = open;
28144 lastclose = close;
28145 }
28146 }, "~A");
28147 c$.pairHash = c$.prototype.pairHash =  new java.util.Hashtable ();
28148 Clazz_defineStatics (c$,
28149 "openingPars",  Clazz_newArray (-1, [new Character ('('), new Character ('['), new Character ('{'), new Character ('<'), new Character ('A'), new Character ('B'), new Character ('C'), new Character ('D'), new Character ('E'), new Character ('F'), new Character ('G'), new Character ('H'), new Character ('I'), new Character ('J'), new Character ('K'), new Character ('L'), new Character ('M'), new Character ('N'), new Character ('O'), new Character ('P'), new Character ('Q'), new Character ('R'), new Character ('S'), new Character ('T'), new Character ('U'), new Character ('V'), new Character ('W'), new Character ('X'), new Character ('Y'), new Character ('Z')]),
28150 "closingPars",  Clazz_newArray (-1, [new Character (')'), new Character (']'), new Character ('}'), new Character ('>'), new Character ('a'), new Character ('b'), new Character ('c'), new Character ('d'), new Character ('e'), new Character ('f'), new Character ('g'), new Character ('h'), new Character ('i'), new Character ('j'), new Character ('k'), new Character ('l'), new Character ('m'), new Character ('n'), new Character ('o'), new Character ('p'), new Character ('q'), new Character ('r'), new Character ('s'), new Character ('t'), new Character ('u'), new Character ('v'), new Character ('w'), new Character ('x'), new Character ('y'), new Character ('z')]));
28151 c$.openingParsSet = c$.prototype.openingParsSet =  new java.util.HashSet (java.util.Arrays.asList (jalview.analysis.Rna.openingPars));
28152 c$.closingParsSet = c$.prototype.closingParsSet =  new java.util.HashSet (java.util.Arrays.asList (jalview.analysis.Rna.closingPars));
28153 c$.closingToOpening = c$.prototype.closingToOpening =  new java.util.Hashtable ();
28154 {
28155 for (var i = 0; i < jalview.analysis.Rna.openingPars.length; i++) {
28156 jalview.analysis.Rna.closingToOpening.put (jalview.analysis.Rna.closingPars[i], jalview.analysis.Rna.openingPars[i]);
28157 }
28158 }});
28159 Clazz_declarePackage ("jalview.analysis");
28160 Clazz_load (null, "jalview.analysis.SecStrConsensus", ["java.util.ArrayList", "$.Hashtable"], function () {
28161 c$ = Clazz_declareType (jalview.analysis, "SecStrConsensus");
28162 c$.extractConsensus = Clazz_defineMethod (c$, "extractConsensus", 
28163 function (bps) {
28164 var maxlength = 0;
28165 for (var strs, $strs = bps.iterator (); $strs.hasNext () && ((strs = $strs.next ()) || true);) {
28166 for (var bp, $bp = strs.iterator (); $bp.hasNext () && ((bp = $bp.next ()) || true);) {
28167 maxlength = Math.max (1 + Math.max (bp.bp5, bp.bp3), maxlength);
28168 }
28169 }
28170 var seq =  new java.util.ArrayList ();
28171 for (var i = 0; i < maxlength; i++) {
28172 seq.add ( new java.util.Hashtable ());
28173 }
28174 for (var strs, $strs = bps.iterator (); $strs.hasNext () && ((strs = $strs.next ()) || true);) {
28175 for (var bp, $bp = strs.iterator (); $bp.hasNext () && ((bp = $bp.next ()) || true);) {
28176 var i = bp.bp5;
28177 var j = bp.bp3;
28178 var h = seq.get (i);
28179 if (!h.containsKey (new Integer (j))) {
28180 h.put (new Integer (j), new Double (0.0));
28181 }h.put (new Integer (j), new Double ((h.get (new Integer (j))).doubleValue () + 1.));
28182 }
28183 }
28184 var mat = jalview.analysis.SecStrConsensus.fillMatrix (seq);
28185 var res = jalview.analysis.SecStrConsensus.backtrack (mat, seq);
28186 var finalres =  Clazz_newIntArray (seq.size (), 0);
28187 for (var i = 0; i < seq.size (); i++) {
28188 finalres[i] = -1;
28189 }
28190 for (var bp, $bp = res.iterator (); $bp.hasNext () && ((bp = $bp.next ()) || true);) {
28191 finalres[bp.bp5] = bp.bp3;
28192 finalres[bp.bp3] = bp.bp5;
28193 }
28194 return finalres;
28195 }, "java.util.ArrayList");
28196 c$.canBasePair = Clazz_defineMethod (c$, "canBasePair", 
28197  function (seq, i, k) {
28198 return seq.get (i).containsKey (new Integer (k));
28199 }, "java.util.ArrayList,~N,~N");
28200 c$.basePairScore = Clazz_defineMethod (c$, "basePairScore", 
28201  function (seq, i, k) {
28202 return seq.get (i).get (new Integer (k));
28203 }, "java.util.ArrayList,~N,~N");
28204 c$.fillMatrix = Clazz_defineMethod (c$, "fillMatrix", 
28205  function (seq) {
28206 var n = seq.size ();
28207 var tab =  Clazz_newDoubleArray (n, n, 0);
28208 for (var m = 1; m <= n; m++) {
28209 for (var i = 0; i < n - m + 1; i++) {
28210 var j = i + m - 1;
28211 tab[i][j] = 0;
28212 if (i < j) {
28213 tab[i][j] = Math.max (tab[i][j], tab[i + 1][j]);
28214 for (var k = i + 1; k <= j; k++) {
28215 if (jalview.analysis.SecStrConsensus.canBasePair (seq, i, k)) {
28216 var fact1 = 0;
28217 if (k > i + 1) {
28218 fact1 = tab[i + 1][k - 1];
28219 }var fact2 = 0;
28220 if (k < j) {
28221 fact2 = tab[k + 1][j];
28222 }tab[i][j] = Math.max (tab[i][j], jalview.analysis.SecStrConsensus.basePairScore (seq, i, k) + fact1 + fact2);
28223 }}
28224 }}
28225 }
28226 return tab;
28227 }, "java.util.ArrayList");
28228 c$.backtrack = Clazz_defineMethod (c$, "backtrack", 
28229  function (tab, seq) {
28230 return jalview.analysis.SecStrConsensus.backtrack (tab, seq, 0, seq.size () - 1);
28231 }, "~A,java.util.ArrayList");
28232 c$.backtrack = Clazz_defineMethod (c$, "backtrack", 
28233  function (tab, seq, i, j) {
28234 var result =  new java.util.ArrayList ();
28235 if (i < j) {
28236 var indices =  new java.util.ArrayList ();
28237 indices.add (new Integer (-1));
28238 for (var k = i + 1; k <= j; k++) {
28239 indices.add (new Integer (k));
28240 }
28241 for (var k, $k = indices.iterator (); $k.hasNext () && ((k = $k.next ()) || true);) {
28242 if (k == -1) {
28243 if (tab[i][j] == tab[i + 1][j]) {
28244 result = jalview.analysis.SecStrConsensus.backtrack (tab, seq, i + 1, j);
28245 }} else {
28246 if (jalview.analysis.SecStrConsensus.canBasePair (seq, i, k)) {
28247 var fact1 = 0;
28248 if (k > i + 1) {
28249 fact1 = tab[i + 1][k - 1];
28250 }var fact2 = 0;
28251 if (k < j) {
28252 fact2 = tab[k + 1][j];
28253 }if (tab[i][j] == jalview.analysis.SecStrConsensus.basePairScore (seq, i, k) + fact1 + fact2) {
28254 result = jalview.analysis.SecStrConsensus.backtrack (tab, seq, i + 1, k - 1);
28255 result.addAll (jalview.analysis.SecStrConsensus.backtrack (tab, seq, k + 1, j));
28256 result.add ( new jalview.analysis.SecStrConsensus.SimpleBP (i, k));
28257 }}}}
28258 } else if (i == j) {
28259 } else {
28260 }return result;
28261 }, "~A,java.util.ArrayList,~N,~N");
28262 Clazz_pu$h(self.c$);
28263 c$ = Clazz_decorateAsClass (function () {
28264 this.bp5 = 0;
28265 this.bp3 = 0;
28266 Clazz_instantialize (this, arguments);
28267 }, jalview.analysis.SecStrConsensus, "SimpleBP");
28268 Clazz_makeConstructor (c$, 
28269 function () {
28270 });
28271 Clazz_makeConstructor (c$, 
28272 function (a, b) {
28273 this.bp5 = a;
28274 this.bp3 = b;
28275 }, "~N,~N");
28276 Clazz_defineMethod (c$, "setBP5", 
28277 function (a) {
28278 this.bp5 = a;
28279 }, "~N");
28280 Clazz_defineMethod (c$, "setBP3", 
28281 function (a) {
28282 this.bp3 = a;
28283 }, "~N");
28284 Clazz_defineMethod (c$, "getBP5", 
28285 function () {
28286 return this.bp5;
28287 });
28288 Clazz_defineMethod (c$, "getBP3", 
28289 function () {
28290 return this.bp3;
28291 });
28292 Clazz_overrideMethod (c$, "toString", 
28293 function () {
28294 return "(" + this.bp5 + "," + this.bp3 + ")";
28295 });
28296 c$ = Clazz_p0p ();
28297 });
28298 Clazz_declarePackage ("jalview.analysis");
28299 Clazz_load (["java.lang.Exception"], "jalview.analysis.WUSSParseException", null, function () {
28300 c$ = Clazz_decorateAsClass (function () {
28301 this.problemPos = 0;
28302 Clazz_instantialize (this, arguments);
28303 }, jalview.analysis, "WUSSParseException", Exception);
28304 Clazz_makeConstructor (c$, 
28305 function (problemPos) {
28306 this.construct ("Invalid WUSS Notation", problemPos);
28307 }, "~N");
28308 Clazz_makeConstructor (c$, 
28309 function (message, problemPos) {
28310 Clazz_superConstructor (this, jalview.analysis.WUSSParseException, [message + " at or near position " + problemPos]);
28311 this.problemPos = problemPos;
28312 }, "~S,~N");
28313 Clazz_defineMethod (c$, "getProblemPos", 
28314 function () {
28315 return this.problemPos;
28316 });
28317 });
28318 Clazz_load(["java.util.Vector"],"java.util.Stack",["java.util.EmptyStackException"],function(){
28319 c$=Clazz_declareType(java.util,"Stack",java.util.Vector);
28320 Clazz_defineMethod(c$,"empty",
28321 function(){
28322 return this.elementCount==0;
28323 });
28324 Clazz_defineMethod(c$,"peek",
28325 function(){
28326 try{
28327 return this.elementData[this.elementCount-1];
28328 }catch(e){
28329 if(Clazz_instanceOf(e,IndexOutOfBoundsException)){
28330 throw new java.util.EmptyStackException();
28331 }else{
28332 throw e;
28333 }
28334 }
28335 });
28336 Clazz_defineMethod(c$,"pop",
28337 function(){
28338 try{
28339 var index=this.elementCount-1;
28340 var obj=this.elementData[index];
28341 this.removeElementAt(index);
28342 return obj;
28343 }catch(e){
28344 if(Clazz_instanceOf(e,IndexOutOfBoundsException)){
28345 throw new java.util.EmptyStackException();
28346 }else{
28347 throw e;
28348 }
28349 }
28350 });
28351 Clazz_defineMethod(c$,"push",
28352 function(object){
28353 this.addElement(object);
28354 return object;
28355 },"~O");
28356 Clazz_defineMethod(c$,"search",
28357 function(o){
28358 var index=this.lastIndexOf(o);
28359 if(index>=0)return(this.elementCount-index);
28360 return-1;
28361 },"~O");
28362 });
28363 Clazz_declarePackage ("jalview.datamodel");
28364 Clazz_load (null, "jalview.datamodel.Annotation", ["java.lang.Float", "$.StringBuffer"], function () {
28365 c$ = Clazz_decorateAsClass (function () {
28366 this.displayCharacter = "";
28367 this.description = "";
28368 this.secondaryStructure = ' ';
28369 this.value = 0;
28370 this.colour = null;
28371 Clazz_instantialize (this, arguments);
28372 }, jalview.datamodel, "Annotation");
28373 Clazz_makeConstructor (c$, 
28374 function (displayChar, desc, ss, val) {
28375 this.displayCharacter = displayChar;
28376 this.description = desc;
28377 this.secondaryStructure = ss;
28378 this.value = val;
28379 }, "~S,~S,~S,~N");
28380 Clazz_makeConstructor (c$, 
28381 function (displayChar, desc, ss, val, colour) {
28382 this.construct (displayChar, desc, ss, val);
28383 this.colour = colour;
28384 }, "~S,~S,~S,~N,java.awt.Color");
28385 Clazz_makeConstructor (c$, 
28386 function (that) {
28387 if (that == null || this === that) {
28388 return;
28389 }if (that.displayCharacter != null) this.displayCharacter =  String.instantialize (that.displayCharacter);
28390 if (that.description != null) this.description =  String.instantialize (that.description);
28391 this.secondaryStructure = that.secondaryStructure;
28392 this.value = that.value;
28393 this.colour = that.colour;
28394 }, "jalview.datamodel.Annotation");
28395 Clazz_makeConstructor (c$, 
28396 function (val) {
28397 this.construct (null, null, ' ', val, null);
28398 }, "~N");
28399 Clazz_overrideMethod (c$, "toString", 
28400 function () {
28401 var sb =  new StringBuffer ();
28402 if (this.displayCharacter != null) {
28403 sb.append ("\'");
28404 sb.append (this.displayCharacter);
28405 sb.append ("\'");
28406 }{
28407 sb.append (",");
28408 }if (this.secondaryStructure.charCodeAt (0) != 0 && !("" + this.displayCharacter).equals ("" + this.secondaryStructure)) {
28409 sb.append ("\'");
28410 sb.append (this.secondaryStructure);
28411 sb.append ("\'");
28412 }{
28413 sb.append (",");
28414 }if (this.description != null && this.description.length > 0) {
28415 sb.append ("\"");
28416 sb.append (this.description);
28417 sb.append ("\"");
28418 }{
28419 sb.append (",");
28420 }if (!Float.isNaN (this.value)) {
28421 sb.append (this.value);
28422 }if (this.colour != null) {
28423 if (sb.length () > 0) {
28424 sb.append (",");
28425 }sb.append ("[");
28426 sb.append ("" + this.colour.getRed ());
28427 sb.append (",");
28428 sb.append ("" + this.colour.getGreen ());
28429 sb.append (",");
28430 sb.append ("" + this.colour.getBlue ());
28431 sb.append ("]");
28432 }return sb.toString ();
28433 });
28434 });
28435 Clazz_declarePackage ("jalview.datamodel");
28436 Clazz_load (["java.awt.Color"], "jalview.datamodel.GraphLine", null, function () {
28437 c$ = Clazz_decorateAsClass (function () {
28438 this.value = 0;
28439 this.label = "";
28440 this.colour = null;
28441 this.displayed = true;
28442 Clazz_instantialize (this, arguments);
28443 }, jalview.datamodel, "GraphLine");
28444 Clazz_prepareFields (c$, function () {
28445 this.colour = java.awt.Color.black;
28446 });
28447 Clazz_makeConstructor (c$, 
28448 function (value, label, col) {
28449 this.value = value;
28450 if (label != null) {
28451 this.label = label;
28452 }if (col != null) {
28453 this.colour = col;
28454 }}, "~N,~S,java.awt.Color");
28455 Clazz_makeConstructor (c$, 
28456 function (from) {
28457 if (from != null) {
28458 this.value = from.value;
28459 this.label =  String.instantialize (from.label);
28460 this.colour = from.colour;
28461 this.displayed = from.displayed;
28462 }}, "jalview.datamodel.GraphLine");
28463 Clazz_overrideMethod (c$, "equals", 
28464 function (obj) {
28465 if (obj != null && Clazz_instanceOf (obj, jalview.datamodel.GraphLine)) {
28466 var other = obj;
28467 return this.displayed == other.displayed && this.value == other.value && (this.colour != null ? (other.colour != null && other.colour.equals (this.colour)) : other.colour == null) && (this.label != null ? (other.label != null && other.label.equals (this.label)) : other.label == null);
28468 }return false;
28469 }, "~O");
28470 });
28471 Clazz_declarePackage ("jalview.datamodel");
28472 Clazz_load (null, "jalview.datamodel.DBRefEntry", ["jalview.datamodel.Mapping"], function () {
28473 c$ = Clazz_decorateAsClass (function () {
28474 this.source = "";
28475 this.version = "";
28476 this.accessionId = "";
28477 this.map = null;
28478 Clazz_instantialize (this, arguments);
28479 }, jalview.datamodel, "DBRefEntry");
28480 Clazz_makeConstructor (c$, 
28481 function () {
28482 });
28483 Clazz_makeConstructor (c$, 
28484 function (source, version, accessionId) {
28485 this.construct (source, version, accessionId, null);
28486 }, "~S,~S,~S");
28487 Clazz_makeConstructor (c$, 
28488 function (source, version, accessionId, map) {
28489 this.source = source.toUpperCase ();
28490 this.version = version;
28491 this.accessionId = accessionId;
28492 this.map = map;
28493 }, "~S,~S,~S,jalview.datamodel.Mapping");
28494 Clazz_makeConstructor (c$, 
28495 function (entry) {
28496 this.construct ((entry.source == null ? "" :  String.instantialize (entry.source)), (entry.version == null ? "" :  String.instantialize (entry.version)), (entry.accessionId == null ? "" :  String.instantialize (entry.accessionId)), (entry.map == null ? null :  new jalview.datamodel.Mapping (entry.map)));
28497 }, "jalview.datamodel.DBRefEntry");
28498 Clazz_overrideMethod (c$, "equals", 
28499 function (o) {
28500 if (o == null || !(Clazz_instanceOf (o, jalview.datamodel.DBRefEntry))) {
28501 return false;
28502 }var entry = o;
28503 if (entry === this) {
28504 return true;
28505 }if (this.equalRef (entry) && ((this.map == null && entry.map == null) || (this.map != null && entry.map != null && this.map.equals (entry.map)))) {
28506 return true;
28507 }return false;
28508 }, "~O");
28509 Clazz_defineMethod (c$, "equalRef", 
28510 function (entry) {
28511 if (entry == null) {
28512 return false;
28513 }if (entry === this) {
28514 return true;
28515 }if ((this.source != null && entry.source != null && this.source.equalsIgnoreCase (entry.source)) && (this.accessionId != null && entry.accessionId != null && this.accessionId.equalsIgnoreCase (entry.accessionId)) && (this.version != null && entry.version != null && this.version.equalsIgnoreCase (entry.version))) {
28516 return true;
28517 }return false;
28518 }, "jalview.datamodel.DBRefEntry");
28519 Clazz_defineMethod (c$, "getSource", 
28520 function () {
28521 return this.source;
28522 });
28523 Clazz_defineMethod (c$, "getVersion", 
28524 function () {
28525 return this.version;
28526 });
28527 Clazz_defineMethod (c$, "getAccessionId", 
28528 function () {
28529 return this.accessionId;
28530 });
28531 Clazz_defineMethod (c$, "setAccessionId", 
28532 function (accessionId) {
28533 this.accessionId = accessionId;
28534 }, "~S");
28535 Clazz_defineMethod (c$, "setSource", 
28536 function (source) {
28537 this.source = source;
28538 }, "~S");
28539 Clazz_defineMethod (c$, "setVersion", 
28540 function (version) {
28541 this.version = version;
28542 }, "~S");
28543 Clazz_defineMethod (c$, "getMap", 
28544 function () {
28545 return this.map;
28546 });
28547 Clazz_defineMethod (c$, "setMap", 
28548 function (map) {
28549 this.map = map;
28550 }, "jalview.datamodel.Mapping");
28551 Clazz_defineMethod (c$, "hasMap", 
28552 function () {
28553 return this.map != null;
28554 });
28555 Clazz_defineMethod (c$, "getSrcAccString", 
28556 function () {
28557 return ((this.source != null) ? this.source : "") + ":" + ((this.accessionId != null) ? this.accessionId : "");
28558 });
28559 Clazz_overrideMethod (c$, "toString", 
28560 function () {
28561 return this.getSrcAccString ();
28562 });
28563 });
28564 Clazz_declarePackage ("jalview.datamodel");
28565 c$ = Clazz_declareType (jalview.datamodel, "DBRefSource");
28566 Clazz_defineStatics (c$,
28567 "UNIPROT", "UNIPROT");
28568 c$.UP_NAME = c$.prototype.UP_NAME = "UNIPROT_NAME".toUpperCase ();
28569 c$.UNIPROTKB = c$.prototype.UNIPROTKB = "UniProtKB/TrEMBL".toUpperCase ();
28570 c$.EMBLCDSProduct = c$.prototype.EMBLCDSProduct = "EMBLCDSProtein".toUpperCase ();
28571 Clazz_defineStatics (c$,
28572 "PDB", "PDB",
28573 "EMBL", "EMBL",
28574 "EMBLCDS", "EMBLCDS",
28575 "PFAM", "PFAM",
28576 "RFAM", "RFAM");
28577 c$.GENEDB = c$.prototype.GENEDB = "GeneDB".toUpperCase ();
28578 c$.DNACODINGDBS = c$.prototype.DNACODINGDBS =  Clazz_newArray (-1, [jalview.datamodel.DBRefSource.EMBL, jalview.datamodel.DBRefSource.EMBLCDS, jalview.datamodel.DBRefSource.GENEDB]);
28579 c$.CODINGDBS = c$.prototype.CODINGDBS =  Clazz_newArray (-1, [jalview.datamodel.DBRefSource.EMBLCDS, jalview.datamodel.DBRefSource.GENEDB]);
28580 c$.PROTEINDBS = c$.prototype.PROTEINDBS =  Clazz_newArray (-1, [jalview.datamodel.DBRefSource.UNIPROT, jalview.datamodel.DBRefSource.PDB, jalview.datamodel.DBRefSource.UNIPROTKB, jalview.datamodel.DBRefSource.EMBLCDSProduct]);
28581 c$.PROTEINSEQ = c$.prototype.PROTEINSEQ =  Clazz_newArray (-1, [jalview.datamodel.DBRefSource.UNIPROT, jalview.datamodel.DBRefSource.UNIPROTKB, jalview.datamodel.DBRefSource.EMBLCDSProduct]);
28582 c$.PROTEINSTR = c$.prototype.PROTEINSTR =  Clazz_newArray (-1, [jalview.datamodel.DBRefSource.PDB]);
28583 c$.DOMAINDBS = c$.prototype.DOMAINDBS =  Clazz_newArray (-1, [jalview.datamodel.DBRefSource.PFAM, jalview.datamodel.DBRefSource.RFAM]);
28584 Clazz_defineStatics (c$,
28585 "SEQDB", "SQ",
28586 "DNASEQDB", "NASQ",
28587 "PROTSEQDB", "PROTSQ",
28588 "CODINGSEQDB", "CODING",
28589 "DNACODINGSEQDB", "XONCODING",
28590 "DOMAINDB", "DOMAIN",
28591 "MULTIACC", "MULTIACC",
28592 "ALIGNMENTDB", "ALIGNMENTS");
28593 Clazz_declarePackage ("jalview.datamodel");
28594 Clazz_load (["java.lang.Enum"], "jalview.datamodel.PDBEntry", null, function () {
28595 c$ = Clazz_decorateAsClass (function () {
28596 this.file = null;
28597 this.type = null;
28598 this.id = null;
28599 this.chainCode = null;
28600 this.properties = null;
28601 Clazz_instantialize (this, arguments);
28602 }, jalview.datamodel, "PDBEntry");
28603 Clazz_overrideMethod (c$, "equals", 
28604 function (obj) {
28605 if (obj == null || !(Clazz_instanceOf (obj, jalview.datamodel.PDBEntry))) {
28606 return false;
28607 }if (obj === this) {
28608 return true;
28609 }var o = obj;
28610 return (this.type === o.type || (this.type != null && o.type != null && o.type.equals (this.type))) && (this.id === o.id || (this.id != null && o.id != null && o.id.equalsIgnoreCase (this.id))) && (this.chainCode === o.chainCode || (this.chainCode != null && o.chainCode != null && o.chainCode.equalsIgnoreCase (this.chainCode))) && (this.properties === o.properties || (this.properties != null && o.properties != null && this.properties.equals (o.properties)));
28611 }, "~O");
28612 Clazz_makeConstructor (c$, 
28613 function () {
28614 });
28615 Clazz_makeConstructor (c$, 
28616 function (pdbId, chain, type, filePath) {
28617 this.id = pdbId;
28618 this.chainCode = chain;
28619 this.type = type == null ? null : type.toString ();
28620 this.file = filePath;
28621 }, "~S,~S,jalview.datamodel.PDBEntry.Type,~S");
28622 Clazz_makeConstructor (c$, 
28623 function (entry) {
28624 this.file = entry.file;
28625 this.type = entry.type;
28626 this.id = entry.id;
28627 this.chainCode = entry.chainCode;
28628 if (entry.properties != null) {
28629 this.properties = entry.properties.clone ();
28630 }}, "jalview.datamodel.PDBEntry");
28631 Clazz_defineMethod (c$, "setFile", 
28632 function (file) {
28633 this.file = file;
28634 }, "~S");
28635 Clazz_defineMethod (c$, "getFile", 
28636 function () {
28637 return this.file;
28638 });
28639 Clazz_defineMethod (c$, "setType", 
28640 function (t) {
28641 this.type = t;
28642 }, "~S");
28643 Clazz_defineMethod (c$, "setType", 
28644 function (type) {
28645 this.type = type == null ? null : type.toString ();
28646 }, "jalview.datamodel.PDBEntry.Type");
28647 Clazz_defineMethod (c$, "getType", 
28648 function () {
28649 return this.type;
28650 });
28651 Clazz_defineMethod (c$, "setId", 
28652 function (id) {
28653 this.id = id;
28654 }, "~S");
28655 Clazz_defineMethod (c$, "getId", 
28656 function () {
28657 return this.id;
28658 });
28659 Clazz_defineMethod (c$, "setProperty", 
28660 function (property) {
28661 this.properties = property;
28662 }, "java.util.Hashtable");
28663 Clazz_defineMethod (c$, "getProperty", 
28664 function () {
28665 return this.properties;
28666 });
28667 Clazz_defineMethod (c$, "getChainCode", 
28668 function () {
28669 return this.chainCode;
28670 });
28671 Clazz_defineMethod (c$, "setChainCode", 
28672 function (chainCode) {
28673 this.chainCode = chainCode;
28674 }, "~S");
28675 Clazz_pu$h(self.c$);
28676 c$ = Clazz_declareType (jalview.datamodel.PDBEntry, "Type", Enum);
28677 Clazz_defineEnumConstant (c$, "PDB", 0, []);
28678 Clazz_defineEnumConstant (c$, "FILE", 1, []);
28679 c$ = Clazz_p0p ();
28680 });
28681 Clazz_declarePackage ("jalview.util");
28682 Clazz_load (["java.util.regex.Pattern"], "jalview.util.StringUtils", ["java.lang.StringBuffer", "java.util.ArrayList"], function () {
28683 c$ = Clazz_declareType (jalview.util, "StringUtils");
28684 c$.insertCharAt = Clazz_defineMethod (c$, "insertCharAt", 
28685 function ($in, position, count, ch) {
28686 var tmp =  Clazz_newCharArray ($in.length + count, '\0');
28687 if (position >= $in.length) {
28688 System.arraycopy ($in, 0, tmp, 0, $in.length);
28689 position = $in.length;
28690 } else {
28691 System.arraycopy ($in, 0, tmp, 0, position);
28692 }var index = position;
28693 while (count > 0) {
28694 tmp[index++] = ch;
28695 count--;
28696 }
28697 if (position < $in.length) {
28698 System.arraycopy ($in, position, tmp, index, $in.length - position);
28699 }return tmp;
28700 }, "~A,~N,~N,~S");
28701 c$.deleteChars = Clazz_defineMethod (c$, "deleteChars", 
28702 function ($in, from, to) {
28703 if (from >= $in.length || from < 0) {
28704 return $in;
28705 }var tmp;
28706 if (to >= $in.length) {
28707 tmp =  Clazz_newCharArray (from, '\0');
28708 System.arraycopy ($in, 0, tmp, 0, from);
28709 to = $in.length;
28710 } else {
28711 tmp =  Clazz_newCharArray ($in.length - to + from, '\0');
28712 System.arraycopy ($in, 0, tmp, 0, from);
28713 System.arraycopy ($in, to, tmp, from, $in.length - to);
28714 }return tmp;
28715 }, "~A,~N,~N");
28716 c$.getLastToken = Clazz_defineMethod (c$, "getLastToken", 
28717 function (input, token) {
28718 if (input == null) {
28719 return null;
28720 }if (token == null) {
28721 return input;
28722 }var st = input.$plit (token);
28723 return st[st.length - 1];
28724 }, "~S,~S");
28725 c$.separatorListToArray = Clazz_defineMethod (c$, "separatorListToArray", 
28726 function (input, delimiter) {
28727 var seplen = delimiter.length;
28728 if (input == null || input.equals ("") || input.equals (delimiter)) {
28729 return null;
28730 }var jv =  new java.util.ArrayList ();
28731 var cp = 0;
28732 var pos;
28733 var escape;
28734 var wasescaped = false;
28735 var wasquoted = false;
28736 var lstitem = null;
28737 while ((pos = input.indexOf (delimiter, cp)) >= cp) {
28738 escape = (pos > 0 && input.charAt (pos - 1) == '\\') ? -1 : 0;
28739 if (wasescaped || wasquoted) {
28740 jv.set (jv.size () - 1, lstitem = lstitem + delimiter + input.substring (cp, pos + escape));
28741 } else {
28742 jv.add (lstitem = input.substring (cp, pos + escape));
28743 }cp = pos + seplen;
28744 wasescaped = escape == -1;
28745 wasquoted = jalview.util.StringUtils.DELIMITERS_PATTERN.matcher (lstitem).matches ();
28746 }
28747 if (cp < input.length) {
28748 var c = input.substring (cp);
28749 if (wasescaped || wasquoted) {
28750 jv.set (jv.size () - 1, lstitem + delimiter + c);
28751 } else {
28752 if (!c.equals (delimiter)) {
28753 jv.add (c);
28754 }}}if (jv.size () > 0) {
28755 var v = jv.toArray ( new Array (jv.size ()));
28756 jv.clear ();
28757 if (false) {
28758 System.err.println ("Array from '" + delimiter + "' separated List:\n" + v.length);
28759 for (var i = 0; i < v.length; i++) {
28760 System.err.println ("item " + i + " '" + v[i] + "'");
28761 }
28762 }return v;
28763 }if (false) {
28764 System.err.println ("Empty Array from '" + delimiter + "' separated List");
28765 }return null;
28766 }, "~S,~S");
28767 c$.arrayToSeparatorList = Clazz_defineMethod (c$, "arrayToSeparatorList", 
28768 function (list, separator) {
28769 var v =  new StringBuffer ();
28770 if (list != null && list.length > 0) {
28771 for (var i = 0, iSize = list.length; i < iSize; i++) {
28772 if (list[i] != null) {
28773 if (v.length () > 0) {
28774 v.append (separator);
28775 }v.append (list[i]);
28776 }}
28777 if (false) {
28778 System.err.println ("Returning '" + separator + "' separated List:\n");
28779 System.err.println (v);
28780 }return v.toString ();
28781 }if (false) {
28782 System.err.println ("Returning empty '" + separator + "' separated List\n");
28783 }return "" + separator;
28784 }, "~A,~S");
28785 c$.DELIMITERS_PATTERN = c$.prototype.DELIMITERS_PATTERN = java.util.regex.Pattern.compile (".*='[^']*(?!')");
28786 Clazz_defineStatics (c$,
28787 "DEBUG", false);
28788 });
28789 Clazz_declarePackage("java.util.regex");
28790 Clazz_load(null,"java.util.regex.Pattern",["java.lang.IllegalArgumentException","$.StringBuffer","java.util.regex.Matcher"],function(){
28791 c$=Clazz_decorateAsClass(function(){
28792 this.$flags=0;
28793 this.regexp=null;
28794 Clazz_instantialize(this,arguments);
28795 },java.util.regex,"Pattern",null,java.io.Serializable);
28796 Clazz_defineMethod(c$,"matcher",
28797 function(cs){
28798 return new java.util.regex.Matcher(this,cs);
28799 },"CharSequence");
28800 Clazz_defineMethod(c$,"split",
28801 function(input,limit){
28802 var res=new Array(0);
28803 var mat=this.matcher(input);
28804 var index=0;
28805 var curPos=0;
28806 if(input.length()==0){
28807 return[""];
28808 }else{
28809 while(mat.find()&&(index+1<limit||limit<=0)){
28810 res[res.length]=input.subSequence(curPos,mat.start()).toString();
28811 curPos=mat.end();
28812 index++;
28813 }
28814 res[res.length]=input.subSequence(curPos,input.length()).toString();
28815 index++;
28816 if(limit==0){
28817 while(--index>=0&&res[index].toString().length==0){
28818 res.length--;
28819 }
28820 }}return res;
28821 },"CharSequence,~N");
28822 Clazz_defineMethod(c$,"split",
28823 function(input){
28824 return this.split(input,0);
28825 },"CharSequence");
28826 Clazz_defineMethod(c$,"pattern",
28827 function(){
28828 {
28829 return this.regexp.source;
28830 }return null;
28831 });
28832 Clazz_defineMethod(c$,"toString",
28833 function(){
28834 return this.pattern();
28835 });
28836 Clazz_defineMethod(c$,"flags",
28837 function(){
28838 return this.$flags;
28839 });
28840 c$.compile=Clazz_defineMethod(c$,"compile",
28841 function(regex,flags){
28842 if((flags!=0)&&((flags|239)!=239)){
28843 throw new IllegalArgumentException("Illegal flags");
28844 }var flagStr="g";
28845 if((flags&8)!=0){
28846 flagStr+="m";
28847 }if((flags&2)!=0){
28848 flagStr+="i";
28849 }var pattern=new java.util.regex.Pattern();
28850 {
28851 pattern.regexp=new RegExp(regex,flagStr);
28852 }return pattern;
28853 },"~S,~N");
28854 c$.compile=Clazz_defineMethod(c$,"compile",
28855 function(pattern){
28856 return java.util.regex.Pattern.compile(pattern,0);
28857 },"~S");
28858 c$.matches=Clazz_defineMethod(c$,"matches",
28859 function(regex,input){
28860 return java.util.regex.Pattern.compile(regex).matcher(input).matches();
28861 },"~S,CharSequence");
28862 c$.quote=Clazz_defineMethod(c$,"quote",
28863 function(s){
28864 var sb=new StringBuffer().append("\\Q");
28865 var apos=0;
28866 var k;
28867 while((k=s.indexOf("\\E",apos))>=0){
28868 sb.append(s.substring(apos,k+2)).append("\\\\E\\Q");
28869 apos=k+2;
28870 }
28871 return sb.append(s.substring(apos)).append("\\E").toString();
28872 },"~S");
28873 Clazz_makeConstructor(c$,
28874 ($fz=function(){
28875 },$fz.isPrivate=true,$fz));
28876 Clazz_defineStatics(c$,
28877 "UNIX_LINES",1,
28878 "CASE_INSENSITIVE",2,
28879 "COMMENTS",4,
28880 "MULTILINE",8,
28881 "LITERAL",16,
28882 "DOTALL",32,
28883 "UNICODE_CASE",64,
28884 "CANON_EQ",128,
28885 "flagsBitMask",239);
28886 });
28887 Clazz_declarePackage("java.util.regex");
28888 Clazz_load(["java.util.regex.MatchResult"],"java.util.regex.Matcher",["java.lang.IllegalArgumentException","$.IndexOutOfBoundsException","$.NullPointerException","$.StringBuffer"],function(){
28889 c$=Clazz_decorateAsClass(function(){
28890 this.pat=null;
28891 this.string=null;
28892 this.leftBound=-1;
28893 this.rightBound=-1;
28894 this.appendPos=0;
28895 this.replacement=null;
28896 this.processedRepl=null;
28897 this.replacementParts=null;
28898 this.results=null;
28899 Clazz_instantialize(this,arguments);
28900 },java.util.regex,"Matcher",null,java.util.regex.MatchResult);
28901 Clazz_defineMethod(c$,"appendReplacement",
28902 function(sb,replacement){
28903 this.processedRepl=this.processReplacement(replacement);
28904 sb.append(this.string.subSequence(this.appendPos,this.start()));
28905 sb.append(this.processedRepl);
28906 this.appendPos=this.end();
28907 return this;
28908 },"StringBuffer,~S");
28909 Clazz_defineMethod(c$,"processReplacement",
28910 ($fz=function(replacement){
28911 if(this.replacement!=null&&this.replacement.equals(replacement)){
28912 if(this.replacementParts==null){
28913 return this.processedRepl;
28914 }else{
28915 var sb=new StringBuffer();
28916 for(var i=0;i<this.replacementParts.length;i++){
28917 sb.append(this.replacementParts[i]);
28918 }
28919 return sb.toString();
28920 }}else{
28921 this.replacement=replacement;
28922 var repl=replacement.toCharArray();
28923 var res=new StringBuffer();
28924 this.replacementParts=null;
28925 var index=0;
28926 var replacementPos=0;
28927 var nextBackSlashed=false;
28928 while(index<repl.length){
28929 if((repl[index]).charCodeAt(0)==('\\').charCodeAt(0)&&!nextBackSlashed){
28930 nextBackSlashed=true;
28931 index++;
28932 }if(nextBackSlashed){
28933 res.append(repl[index]);
28934 nextBackSlashed=false;
28935 }else{
28936 if((repl[index]).charCodeAt(0)==('$').charCodeAt(0)){
28937 if(this.replacementParts==null){
28938 this.replacementParts=new Array(0);
28939 }try{
28940 var gr=Integer.parseInt(String.instantialize(repl,++index,1));
28941 if(replacementPos!=res.length()){
28942 this.replacementParts[this.replacementParts.length]=res.subSequence(replacementPos,res.length());
28943 replacementPos=res.length();
28944 }this.replacementParts[this.replacementParts.length]=((Clazz_isClassDefined("java.util.regex.Matcher$1")?0:java.util.regex.Matcher.$Matcher$1$()),Clazz_innerTypeInstance(java.util.regex.Matcher$1,this,null));
28945 var group=this.group(gr);
28946 replacementPos+=group.length;
28947 res.append(group);
28948 }catch(e$$){
28949 if(Clazz_instanceOf(e$$,IndexOutOfBoundsException)){
28950 var iob=e$$;
28951 {
28952 throw iob;
28953 }
28954 }else if(Clazz_instanceOf(e$$,Exception)){
28955 var e=e$$;
28956 {
28957 throw new IllegalArgumentException("Illegal regular expression format");
28958 }
28959 }else{
28960 throw e$$;
28961 }
28962 }
28963 }else{
28964 res.append(repl[index]);
28965 }}index++;
28966 }
28967 if(this.replacementParts!=null&&replacementPos!=res.length()){
28968 this.replacementParts[this.replacementParts.length]=res.subSequence(replacementPos,res.length());
28969 }return res.toString();
28970 }},$fz.isPrivate=true,$fz),"~S");
28971 Clazz_defineMethod(c$,"reset",
28972 function(newSequence){
28973 if(newSequence==null){
28974 throw new NullPointerException("Empty new sequence!");
28975 }this.string=newSequence;
28976 return this.reset();
28977 },"CharSequence");
28978 Clazz_defineMethod(c$,"reset",
28979 function(){
28980 this.leftBound=0;
28981 this.rightBound=this.string.length();
28982 this.appendPos=0;
28983 this.replacement=null;
28984 {
28985 var flags=""+(this.pat.regexp.ignoreCase?"i":"")
28986 +(this.pat.regexp.global?"g":"")
28987 +(this.pat.regexp.multiline?"m":"");
28988 this.pat.regexp=new RegExp(this.pat.regexp.source,flags);
28989 }return this;
28990 });
28991 Clazz_defineMethod(c$,"region",
28992 function(leftBound,rightBound){
28993 if(leftBound>rightBound||leftBound<0||rightBound<0||leftBound>this.string.length()||rightBound>this.string.length()){
28994 throw new IndexOutOfBoundsException(leftBound+" is out of bound of "+rightBound);
28995 }this.leftBound=leftBound;
28996 this.rightBound=rightBound;
28997 this.results=null;
28998 this.appendPos=0;
28999 this.replacement=null;
29000 return this;
29001 },"~N,~N");
29002 Clazz_defineMethod(c$,"appendTail",
29003 function(sb){
29004 return sb.append(this.string.subSequence(this.appendPos,this.string.length()));
29005 },"StringBuffer");
29006 Clazz_defineMethod(c$,"replaceFirst",
29007 function(replacement){
29008 this.reset();
29009 if(this.find()){
29010 var sb=new StringBuffer();
29011 this.appendReplacement(sb,replacement);
29012 return this.appendTail(sb).toString();
29013 }return this.string.toString();
29014 },"~S");
29015 Clazz_defineMethod(c$,"replaceAll",
29016 function(replacement){
29017 var sb=new StringBuffer();
29018 this.reset();
29019 while(this.find()){
29020 this.appendReplacement(sb,replacement);
29021 }
29022 return this.appendTail(sb).toString();
29023 },"~S");
29024 Clazz_defineMethod(c$,"pattern",
29025 function(){
29026 return this.pat;
29027 });
29028 Clazz_defineMethod(c$,"group",
29029 function(groupIndex){
29030 if(this.results==null||groupIndex<0||groupIndex>this.results.length){
29031 return null;
29032 }return this.results[groupIndex];
29033 },"~N");
29034 Clazz_defineMethod(c$,"group",
29035 function(){
29036 return this.group(0);
29037 });
29038 Clazz_defineMethod(c$,"find",
29039 function(startIndex){
29040 var stringLength=this.string.length();
29041 if(startIndex<0||startIndex>stringLength)throw new IndexOutOfBoundsException("Out of bound "+startIndex);
29042 startIndex=this.findAt(startIndex);
29043 return false;
29044 },"~N");
29045 Clazz_defineMethod(c$,"findAt",
29046 ($fz=function(startIndex){
29047 return-1;
29048 },$fz.isPrivate=true,$fz),"~N");
29049 Clazz_defineMethod(c$,"find",
29050 function(){
29051 {
29052 this.results=this.pat.regexp.exec(this.string.subSequence(this.leftBound,this.rightBound));
29053 }return(this.results!=null);
29054 });
29055 Clazz_defineMethod(c$,"start",
29056 function(groupIndex){
29057 var beginningIndex=0;
29058 {
29059 beginningIndex=this.pat.regexp.lastIndex;
29060 }beginningIndex-=this.results[0].length;
29061 return beginningIndex;
29062 },"~N");
29063 Clazz_defineMethod(c$,"end",
29064 function(groupIndex){
29065 {
29066 return this.pat.regexp.lastIndex;
29067 }return-1;
29068 },"~N");
29069 Clazz_defineMethod(c$,"matches",
29070 function(){
29071 return this.find();
29072 });
29073 c$.quoteReplacement=Clazz_defineMethod(c$,"quoteReplacement",
29074 function(string){
29075 if(string.indexOf('\\') < 0 && string.indexOf ('$')<0)return string;
29076 var res=new StringBuffer(string.length*2);
29077 var ch;
29078 var len=string.length;
29079 for(var i=0;i<len;i++){
29080 switch(ch=string.charAt(i)){
29081 case'$':
29082 res.append('\\');
29083 res.append('$');
29084 break;
29085 case'\\':
29086 res.append('\\');
29087 res.append('\\');
29088 break;
29089 default:
29090 res.append(ch);
29091 }
29092 }
29093 return res.toString();
29094 },"~S");
29095 Clazz_defineMethod(c$,"lookingAt",
29096 function(){
29097 return false;
29098 });
29099 Clazz_defineMethod(c$,"start",
29100 function(){
29101 return this.start(0);
29102 });
29103 Clazz_overrideMethod(c$,"groupCount",
29104 function(){
29105 return this.results==null?0:this.results.length;
29106 });
29107 Clazz_defineMethod(c$,"end",
29108 function(){
29109 return this.end(0);
29110 });
29111 Clazz_defineMethod(c$,"toMatchResult",
29112 function(){
29113 return this;
29114 });
29115 Clazz_defineMethod(c$,"useAnchoringBounds",
29116 function(value){
29117 return this;
29118 },"~B");
29119 Clazz_defineMethod(c$,"hasAnchoringBounds",
29120 function(){
29121 return false;
29122 });
29123 Clazz_defineMethod(c$,"useTransparentBounds",
29124 function(value){
29125 return this;
29126 },"~B");
29127 Clazz_defineMethod(c$,"hasTransparentBounds",
29128 function(){
29129 return false;
29130 });
29131 Clazz_defineMethod(c$,"regionStart",
29132 function(){
29133 return this.leftBound;
29134 });
29135 Clazz_defineMethod(c$,"regionEnd",
29136 function(){
29137 return this.rightBound;
29138 });
29139 Clazz_defineMethod(c$,"requireEnd",
29140 function(){
29141 return false;
29142 });
29143 Clazz_defineMethod(c$,"hitEnd",
29144 function(){
29145 return false;
29146 });
29147 Clazz_defineMethod(c$,"usePattern",
29148 function(pat){
29149 if(pat==null){
29150 throw new IllegalArgumentException("Empty pattern!");
29151 }this.pat=pat;
29152 this.results=null;
29153 return this;
29154 },"java.util.regex.Pattern");
29155 Clazz_makeConstructor(c$,
29156 function(pat,cs){
29157 this.pat=pat;
29158 this.string=cs;
29159 this.leftBound=0;
29160 this.rightBound=this.string.toString().length;
29161 },"java.util.regex.Pattern,CharSequence");
29162 c$.$Matcher$1$=function(){
29163 Clazz_pu$h(self.c$);
29164 c$=Clazz_decorateAsClass(function(){
29165 Clazz_prepareCallback(this,arguments);
29166 this.grN=0;
29167 Clazz_instantialize(this,arguments);
29168 },java.util.regex,"Matcher$1");
29169 Clazz_prepareFields(c$,function(){
29170 this.grN=gr;
29171 });
29172 Clazz_overrideMethod(c$,"toString",
29173 function(){
29174 return this.b$["java.util.regex.Matcher"].group(this.grN);
29175 });
29176 c$=Clazz_p0p();
29177 };
29178 Clazz_defineStatics(c$,
29179 "MODE_FIND",1,
29180 "MODE_MATCH",2);
29181 });
29182 Clazz_declarePackage("java.util.regex");
29183 Clazz_declareInterface(java.util.regex,"MatchResult");
29184 Clazz_declarePackage ("jalview.util");
29185 Clazz_load (null, "jalview.util.Format", ["java.lang.Character", "$.IllegalArgumentException", "$.StringBuffer"], function () {
29186 c$ = Clazz_decorateAsClass (function () {
29187 this.width = 0;
29188 this.precision = 0;
29189 this.pre = null;
29190 this.post = null;
29191 this.leading_zeroes = false;
29192 this.show_plus = false;
29193 this.alternate = false;
29194 this.show_space = false;
29195 this.left_align = false;
29196 this.fmt = '\0';
29197 this.formatString = null;
29198 Clazz_instantialize (this, arguments);
29199 }, jalview.util, "Format");
29200 Clazz_makeConstructor (c$, 
29201 function (s) {
29202 this.formatString = s;
29203 this.width = 0;
29204 this.precision = -1;
29205 this.pre = "";
29206 this.post = "";
29207 this.leading_zeroes = false;
29208 this.show_plus = false;
29209 this.alternate = false;
29210 this.show_space = false;
29211 this.left_align = false;
29212 this.fmt = ' ';
29213 var length = s.length;
29214 var parse_state = 0;
29215 var i = 0;
29216 while (parse_state == 0) {
29217 if (i >= length) {
29218 parse_state = 5;
29219 } else if (s.charAt (i) == '%') {
29220 if (i < (length - 1)) {
29221 if (s.charAt (i + 1) == '%') {
29222 this.pre = this.pre + '%';
29223 i++;
29224 } else {
29225 parse_state = 1;
29226 }} else {
29227 throw  new IllegalArgumentException ();
29228 }} else {
29229 this.pre = this.pre + s.charAt (i);
29230 }i++;
29231 }
29232 while (parse_state == 1) {
29233 if (i >= length) {
29234 parse_state = 5;
29235 } else if (s.charAt (i) == ' ') {
29236 this.show_space = true;
29237 } else if (s.charAt (i) == '-') {
29238 this.left_align = true;
29239 } else if (s.charAt (i) == '+') {
29240 this.show_plus = true;
29241 } else if (s.charAt (i) == '0') {
29242 this.leading_zeroes = true;
29243 } else if (s.charAt (i) == '#') {
29244 this.alternate = true;
29245 } else {
29246 parse_state = 2;
29247 i--;
29248 }i++;
29249 }
29250 while (parse_state == 2) {
29251 if (i >= length) {
29252 parse_state = 5;
29253 } else if (('0' <= s.charAt (i)) && (s.charAt (i) <= '9')) {
29254 this.width = ((this.width * 10) + s.charCodeAt (i)) - 48;
29255 i++;
29256 } else if (s.charAt (i) == '.') {
29257 parse_state = 3;
29258 this.precision = 0;
29259 i++;
29260 } else {
29261 parse_state = 4;
29262 }}
29263 while (parse_state == 3) {
29264 if (i >= length) {
29265 parse_state = 5;
29266 } else if (('0' <= s.charAt (i)) && (s.charAt (i) <= '9')) {
29267 this.precision = ((this.precision * 10) + s.charCodeAt (i)) - 48;
29268 i++;
29269 } else {
29270 parse_state = 4;
29271 }}
29272 if (parse_state == 4) {
29273 if (i >= length) {
29274 parse_state = 5;
29275 } else {
29276 this.fmt = s.charAt (i);
29277 }i++;
29278 }if (i < length) {
29279 this.post = s.substring (i, length);
29280 }}, "~S");
29281 c$.getHexString = Clazz_defineMethod (c$, "getHexString", 
29282 function (color) {
29283 var r;
29284 var g;
29285 var b;
29286 r = Integer.toHexString (color.getRed ());
29287 if (r.length < 2) {
29288 r = "0" + r;
29289 }g = Integer.toHexString (color.getGreen ());
29290 if (g.length < 2) {
29291 g = "0" + g;
29292 }b = Integer.toHexString (color.getBlue ());
29293 if (b.length < 2) {
29294 b = "0" + b;
29295 }return r + g + b;
29296 }, "java.awt.Color");
29297 c$.printDouble = Clazz_defineMethod (c$, "printDouble", 
29298 function (s, fmt, x) {
29299 s.print ( new jalview.util.Format (fmt).formDouble (x));
29300 }, "java.io.PrintStream,~S,~N");
29301 c$.printLong = Clazz_defineMethod (c$, "printLong", 
29302 function (s, fmt, x) {
29303 s.print ( new jalview.util.Format (fmt).formLong (x));
29304 }, "java.io.PrintStream,~S,~N");
29305 c$.printChar = Clazz_defineMethod (c$, "printChar", 
29306 function (s, fmt, x) {
29307 s.print ( new jalview.util.Format (fmt).formChar (x));
29308 }, "java.io.PrintStream,~S,~S");
29309 c$.print = Clazz_defineMethod (c$, "print", 
29310 function (s, fmt, x) {
29311 s.print ( new jalview.util.Format (fmt).form (x));
29312 }, "java.io.PrintStream,~S,~S");
29313 c$.atoi = Clazz_defineMethod (c$, "atoi", 
29314 function (s) {
29315 return jalview.util.Format.atol (s);
29316 }, "~S");
29317 c$.atol = Clazz_defineMethod (c$, "atol", 
29318 function (s) {
29319 var i = 0;
29320 while ((i < s.length) && Character.isWhitespace (s.charAt (i))) {
29321 i++;
29322 }
29323 if ((i < s.length) && (s.charAt (i) == '0')) {
29324 if (((i + 1) < s.length) && ((s.charAt (i + 1) == 'x') || (s.charAt (i + 1) == 'X'))) {
29325 return jalview.util.Format.parseLong (s.substring (i + 2), 16);
29326 } else {
29327 return jalview.util.Format.parseLong (s, 8);
29328 }} else {
29329 return jalview.util.Format.parseLong (s, 10);
29330 }}, "~S");
29331 c$.parseLong = Clazz_defineMethod (c$, "parseLong", 
29332  function (s, base) {
29333 var i = 0;
29334 var sign = 1;
29335 var r = 0;
29336 while ((i < s.length) && Character.isWhitespace (s.charAt (i))) {
29337 i++;
29338 }
29339 if ((i < s.length) && (s.charAt (i) == '-')) {
29340 sign = -1;
29341 i++;
29342 } else if ((i < s.length) && (s.charAt (i) == '+')) {
29343 i++;
29344 }while (i < s.length) {
29345 var ch = s.charAt (i);
29346 if (('0' <= ch) && (ch.charCodeAt (0) < (48 + base))) {
29347 r = ((r * base) + ch.charCodeAt (0)) - 48;
29348 } else if (('A' <= ch) && (ch.charCodeAt (0) < ((65 + base) - 10))) {
29349 r = ((r * base) + ch.charCodeAt (0)) - 65 + 10;
29350 } else if (('a' <= ch) && (ch.charCodeAt (0) < ((97 + base) - 10))) {
29351 r = ((r * base) + ch.charCodeAt (0)) - 97 + 10;
29352 } else {
29353 return r * sign;
29354 }i++;
29355 }
29356 return r * sign;
29357 }, "~S,~N");
29358 c$.atof = Clazz_defineMethod (c$, "atof", 
29359 function (s) {
29360 var i = 0;
29361 var sign = 1;
29362 var r = 0;
29363 var p = 1;
29364 var state = 0;
29365 while ((i < s.length) && Character.isWhitespace (s.charAt (i))) {
29366 i++;
29367 }
29368 if ((i < s.length) && (s.charAt (i) == '-')) {
29369 sign = -1;
29370 i++;
29371 } else if ((i < s.length) && (s.charAt (i) == '+')) {
29372 i++;
29373 }while (i < s.length) {
29374 var ch = s.charAt (i);
29375 if (('0' <= ch) && (ch <= '9')) {
29376 if (state == 0) {
29377 r = ((r * 10) + ch.charCodeAt (0)) - 48;
29378 } else if (state == 1) {
29379 p = p / 10;
29380 r = r + (p * (ch.charCodeAt (0) - 48));
29381 }} else if (ch == '.') {
29382 if (state == 0) {
29383 state = 1;
29384 } else {
29385 return sign * r;
29386 }} else if ((ch == 'e') || (ch == 'E')) {
29387 var e = jalview.util.Format.parseLong (s.substring (i + 1), 10);
29388 return sign * r * Math.pow (10, e);
29389 } else {
29390 return sign * r;
29391 }i++;
29392 }
29393 return sign * r;
29394 }, "~S");
29395 Clazz_defineMethod (c$, "formDouble", 
29396 function (x) {
29397 var r;
29398 if (this.precision < 0) {
29399 this.precision = 6;
29400 }var s = 1;
29401 if (x < 0) {
29402 x = -x;
29403 s = -1;
29404 }if (this.fmt == 'f') {
29405 r = this.fixed_format (x);
29406 } else if ((this.fmt == 'e') || (this.fmt == 'E') || (this.fmt == 'g') || (this.fmt == 'G')) {
29407 r = this.exp_format (x);
29408 } else {
29409 throw  new IllegalArgumentException ();
29410 }return this.pad (this.sign (s, r));
29411 }, "~N");
29412 Clazz_defineMethod (c$, "formLong", 
29413 function (x) {
29414 var r;
29415 var s = 0;
29416 if ((this.fmt == 'd') || (this.fmt == 'i')) {
29417 if (x < 0) {
29418 r = ("" + x).substring (1);
29419 s = -1;
29420 } else {
29421 r = "" + x;
29422 s = 1;
29423 }} else if (this.fmt == 'o') {
29424 r = jalview.util.Format.convert (x, 3, 7, "01234567");
29425 } else if (this.fmt == 'x') {
29426 r = jalview.util.Format.convert (x, 4, 15, "0123456789abcdef");
29427 } else if (this.fmt == 'X') {
29428 r = jalview.util.Format.convert (x, 4, 15, "0123456789ABCDEF");
29429 } else {
29430 throw  new IllegalArgumentException ();
29431 }return this.pad (this.sign (s, r));
29432 }, "~N");
29433 Clazz_defineMethod (c$, "formChar", 
29434 function (c) {
29435 if (this.fmt != 'c') {
29436 throw  new IllegalArgumentException ();
29437 }var r = "" + c;
29438 return this.pad (r);
29439 }, "~S");
29440 Clazz_defineMethod (c$, "form", 
29441 function (s) {
29442 if (this.fmt != 's') {
29443 throw  new IllegalArgumentException ();
29444 }if (this.precision >= 0) {
29445 s = s.substring (0, this.precision);
29446 }return this.pad (s);
29447 }, "~S");
29448 c$.repeat = Clazz_defineMethod (c$, "repeat", 
29449  function (c, n) {
29450 if (n <= 0) {
29451 return "";
29452 }var s =  new StringBuffer (n);
29453 for (var i = 0; i < n; i++) {
29454 s.append (c);
29455 }
29456 return s.toString ();
29457 }, "~S,~N");
29458 c$.convert = Clazz_defineMethod (c$, "convert", 
29459  function (x, n, m, d) {
29460 if (x == 0) {
29461 return "0";
29462 }var r = "";
29463 while (x != 0) {
29464 r = d.charAt ((x & m)) + r;
29465 x = x >>> n;
29466 }
29467 return r;
29468 }, "~N,~N,~N,~S");
29469 Clazz_defineMethod (c$, "pad", 
29470  function (r) {
29471 var p = jalview.util.Format.repeat (' ', this.width - r.length);
29472 if (this.left_align) {
29473 return this.pre + r + p + this.post;
29474 } else {
29475 return this.pre + p + r + this.post;
29476 }}, "~S");
29477 Clazz_defineMethod (c$, "sign", 
29478  function (s, r) {
29479 var p = "";
29480 if (s < 0) {
29481 p = "-";
29482 } else if (s > 0) {
29483 if (this.show_plus) {
29484 p = "+";
29485 } else if (this.show_space) {
29486 p = " ";
29487 }} else {
29488 if ((this.fmt == 'o') && this.alternate && (r.length > 0) && (r.charAt (0) != '0')) {
29489 p = "0";
29490 } else if ((this.fmt == 'x') && this.alternate) {
29491 p = "0x";
29492 } else if ((this.fmt == 'X') && this.alternate) {
29493 p = "0X";
29494 }}var w = 0;
29495 if (this.leading_zeroes) {
29496 w = this.width;
29497 } else if (((this.fmt == 'd') || (this.fmt == 'i') || (this.fmt == 'x') || (this.fmt == 'X') || (this.fmt == 'o')) && (this.precision > 0)) {
29498 w = this.precision;
29499 }return p + jalview.util.Format.repeat ('0', w - p.length - r.length) + r;
29500 }, "~N,~S");
29501 Clazz_defineMethod (c$, "fixed_format", 
29502  function (d) {
29503 var removeTrailing = ((this.fmt == 'G') || (this.fmt == 'g')) && !this.alternate;
29504 if (d > 0x7FFFFFFFFFFFFFFF) {
29505 return this.exp_format (d);
29506 }if (this.precision == 0) {
29507 return Clazz_doubleToLong (d + 0.5) + (removeTrailing ? "" : ".");
29508 }var whole = Clazz_doubleToLong (d);
29509 var fr = d - whole;
29510 if ((fr >= 1) || (fr < 0)) {
29511 return this.exp_format (d);
29512 }var factor = 1;
29513 var leading_zeroes = "";
29514 for (var i = 1; (i <= this.precision) && (factor <= 0x7FFFFFFFFFFFFFFF); i++) {
29515 factor *= 10;
29516 leading_zeroes = leading_zeroes + "0";
29517 }
29518 var l = Clazz_doubleToLong ((factor * fr) + 0.5);
29519 if (l >= factor) {
29520 l = 0;
29521 whole++;
29522 }var z = leading_zeroes + l;
29523 z = "." + z.substring (z.length - this.precision, z.length);
29524 if (removeTrailing) {
29525 var t = z.length - 1;
29526 while ((t >= 0) && (z.charAt (t) == '0')) {
29527 t--;
29528 }
29529 if ((t >= 0) && (z.charAt (t) == '.')) {
29530 t--;
29531 }z = z.substring (0, t + 1);
29532 }return whole + z;
29533 }, "~N");
29534 Clazz_defineMethod (c$, "exp_format", 
29535  function (d) {
29536 var f = "";
29537 var e = 0;
29538 var dd = d;
29539 var factor = 1;
29540 if (d != 0) {
29541 while (dd > 10) {
29542 e++;
29543 factor /= 10;
29544 dd = dd / 10;
29545 }
29546 while (dd < 1) {
29547 e--;
29548 factor *= 10;
29549 dd = dd * 10;
29550 }
29551 }if (((this.fmt == 'g') || (this.fmt == 'G')) && (e >= -4) && (e < this.precision)) {
29552 return this.fixed_format (d);
29553 }d = d * factor;
29554 f = f + this.fixed_format (d);
29555 if ((this.fmt == 'e') || (this.fmt == 'g')) {
29556 f = f + "e";
29557 } else {
29558 f = f + "E";
29559 }var p = "000";
29560 if (e >= 0) {
29561 f = f + "+";
29562 p = p + e;
29563 } else {
29564 f = f + "-";
29565 p = p + (-e);
29566 }return f + p.substring (p.length - 3, p.length);
29567 }, "~N");
29568 Clazz_overrideMethod (c$, "toString", 
29569 function () {
29570 return this.formatString;
29571 });
29572 });
29573 Clazz_declarePackage ("jalview.util");
29574 Clazz_load (["java.util.Iterator"], "jalview.util.ReverseListIterator", null, function () {
29575 c$ = Clazz_decorateAsClass (function () {
29576 this.iterator = null;
29577 Clazz_instantialize (this, arguments);
29578 }, jalview.util, "ReverseListIterator", null, java.util.Iterator);
29579 Clazz_makeConstructor (c$, 
29580 function (stuff) {
29581 this.iterator = stuff.listIterator (stuff.size ());
29582 }, "java.util.List");
29583 Clazz_overrideMethod (c$, "hasNext", 
29584 function () {
29585 return this.iterator.hasPrevious ();
29586 });
29587 Clazz_overrideMethod (c$, "next", 
29588 function () {
29589 return this.iterator.previous ();
29590 });
29591 Clazz_overrideMethod (c$, "remove", 
29592 function () {
29593 this.iterator.remove ();
29594 });
29595 });
29596 Clazz_declarePackage ("jalview.commands");
29597 Clazz_load (["jalview.commands.CommandI"], "jalview.commands.OrderCommand", ["jalview.analysis.AlignmentSorter"], function () {
29598 c$ = Clazz_decorateAsClass (function () {
29599 this.description = null;
29600 this.seqs = null;
29601 this.seqs2 = null;
29602 this.al = null;
29603 Clazz_instantialize (this, arguments);
29604 }, jalview.commands, "OrderCommand", null, jalview.commands.CommandI);
29605 Clazz_makeConstructor (c$, 
29606 function (description, seqs, al) {
29607 this.description = description;
29608 this.seqs = seqs;
29609 this.seqs2 = al.getSequencesArray ();
29610 this.al = al;
29611 this.doCommand (null);
29612 }, "~S,~A,jalview.datamodel.AlignmentI");
29613 Clazz_overrideMethod (c$, "getDescription", 
29614 function () {
29615 return this.description;
29616 });
29617 Clazz_overrideMethod (c$, "getSize", 
29618 function () {
29619 return 1;
29620 });
29621 Clazz_overrideMethod (c$, "doCommand", 
29622 function (views) {
29623 jalview.analysis.AlignmentSorter.setOrder (this.al, this.seqs2);
29624 }, "~A");
29625 Clazz_overrideMethod (c$, "undoCommand", 
29626 function (views) {
29627 jalview.analysis.AlignmentSorter.setOrder (this.al, this.seqs);
29628 }, "~A");
29629 Clazz_defineMethod (c$, "getSequenceOrder", 
29630 function (undo) {
29631 return undo ? this.seqs : this.seqs2;
29632 }, "~B");
29633 });
29634 Clazz_declarePackage ("jalview.datamodel");
29635 Clazz_load (null, "jalview.datamodel.AlignmentOrder", ["java.lang.Error", "java.util.ArrayList", "$.Arrays"], function () {
29636 c$ = Clazz_decorateAsClass (function () {
29637 this.Type = 0;
29638 this.Name = null;
29639 this.Order = null;
29640 Clazz_instantialize (this, arguments);
29641 }, jalview.datamodel, "AlignmentOrder");
29642 Clazz_makeConstructor (c$, 
29643 function () {
29644 });
29645 Clazz_makeConstructor (c$, 
29646 function (anOrder) {
29647 this.Order = anOrder;
29648 }, "java.util.List");
29649 Clazz_makeConstructor (c$, 
29650 function (orderFrom) {
29651 this.Order =  new java.util.ArrayList ();
29652 for (var seq, $seq = orderFrom.getSequences ().iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
29653 this.Order.add (seq);
29654 }
29655 }, "jalview.datamodel.AlignmentI");
29656 Clazz_makeConstructor (c$, 
29657 function (orderFrom) {
29658 this.Order =  new java.util.ArrayList (java.util.Arrays.asList (orderFrom));
29659 }, "~A");
29660 Clazz_defineMethod (c$, "setType", 
29661 function (Type) {
29662 this.Type = Type;
29663 }, "~N");
29664 Clazz_defineMethod (c$, "getType", 
29665 function () {
29666 return this.Type;
29667 });
29668 Clazz_defineMethod (c$, "setName", 
29669 function (Name) {
29670 this.Name = Name;
29671 }, "~S");
29672 Clazz_defineMethod (c$, "getName", 
29673 function () {
29674 return this.Name;
29675 });
29676 Clazz_defineMethod (c$, "setOrder", 
29677 function (Order) {
29678 this.Order = Order;
29679 }, "java.util.List");
29680 Clazz_defineMethod (c$, "getOrder", 
29681 function () {
29682 return this.Order;
29683 });
29684 Clazz_defineMethod (c$, "updateSequence", 
29685 function (oldref, newref) {
29686 var found = this.Order.indexOf (oldref);
29687 if (found > -1) {
29688 this.Order.set (found, newref);
29689 }return found > -1;
29690 }, "jalview.datamodel.SequenceI,jalview.datamodel.SequenceI");
29691 Clazz_defineMethod (c$, "equals", 
29692 function (o) {
29693 if (o == null || !(Clazz_instanceOf (o, jalview.datamodel.AlignmentOrder))) {
29694 return false;
29695 }return this.equals (o, true);
29696 }, "~O");
29697 Clazz_defineMethod (c$, "equals", 
29698 function (o, identity) {
29699 if (o !== this) {
29700 if (o == null) {
29701 return false;
29702 }if (this.Order != null && o.Order != null && this.Order.size () == o.Order.size ()) {
29703 if (!identity) {
29704 throw  new Error ("Weak sequenceI equivalence not yet implemented.");
29705 } else {
29706 for (var i = 0, j = o.Order.size (); i < j; i++) {
29707 if (this.Order.get (i) !== o.Order.get (i)) {
29708 return false;
29709 }}
29710 }} else {
29711 return false;
29712 }}return true;
29713 }, "jalview.datamodel.AlignmentOrder,~B");
29714 Clazz_defineMethod (c$, "isConsistent", 
29715 function (o) {
29716 return this.isConsistent (o, true);
29717 }, "jalview.datamodel.AlignmentOrder");
29718 Clazz_defineMethod (c$, "isConsistent", 
29719 function (o, identity) {
29720 if (o !== this) {
29721 if (o == null) {
29722 return false;
29723 }if (this.Order != null && o.Order != null) {
29724 var c;
29725 var s;
29726 if (o.Order.size () > this.Order.size ()) {
29727 c = o.Order;
29728 s = this.Order;
29729 } else {
29730 c = this.Order;
29731 s = o.Order;
29732 }if (!identity) {
29733 throw  new Error ("Weak sequenceI equivalence not yet implemented.");
29734 } else {
29735 var last = -1;
29736 for (var i = 0, j = s.size (); i < j; i++) {
29737 var pos = c.indexOf (s.get (i));
29738 if (pos > last) {
29739 last = pos;
29740 } else {
29741 return false;
29742 }}
29743 }} else {
29744 return false;
29745 }}return true;
29746 }, "jalview.datamodel.AlignmentOrder,~B");
29747 Clazz_defineStatics (c$,
29748 "FILE", 0,
29749 "MSA", 1,
29750 "USER", 2);
29751 });
29752 Clazz_declarePackage ("jalview.datamodel");
29753 Clazz_load (["java.util.Vector"], "jalview.datamodel.ColumnSelection", ["jalview.util.ShiftList", "jalview.viewmodel.annotationfilter.AnnotationFilterParameter", "java.lang.StringBuffer", "java.util.ArrayList", "$.Collections"], function () {
29754 c$ = Clazz_decorateAsClass (function () {
29755 this.selected = null;
29756 this.hiddenColumns = null;
29757 Clazz_instantialize (this, arguments);
29758 }, jalview.datamodel, "ColumnSelection");
29759 Clazz_prepareFields (c$, function () {
29760 this.selected =  new java.util.Vector ();
29761 });
29762 Clazz_defineMethod (c$, "addElement", 
29763 function (col) {
29764 var column =  new Integer (col);
29765 if (!this.selected.contains (column)) {
29766 this.selected.addElement (column);
29767 }}, "~N");
29768 Clazz_defineMethod (c$, "clear", 
29769 function () {
29770 this.selected.removeAllElements ();
29771 });
29772 Clazz_defineMethod (c$, "removeElement", 
29773 function (col) {
29774 var colInt =  new Integer (col);
29775 if (this.selected.contains (colInt)) {
29776 this.selected.removeElement (colInt);
29777 }}, "~N");
29778 Clazz_defineMethod (c$, "removeElements", 
29779 function (start, end) {
29780 var colInt;
29781 for (var i = start; i < end; i++) {
29782 colInt =  new Integer (i);
29783 if (this.selected.contains (colInt)) {
29784 this.selected.removeElement (colInt);
29785 }}
29786 }, "~N,~N");
29787 Clazz_defineMethod (c$, "getSelected", 
29788 function () {
29789 return this.selected;
29790 });
29791 Clazz_defineMethod (c$, "contains", 
29792 function (col) {
29793 return this.selected.contains ( new Integer (col));
29794 }, "~N");
29795 Clazz_defineMethod (c$, "columnAt", 
29796 function (i) {
29797 return this.selected.elementAt (i).intValue ();
29798 }, "~N");
29799 Clazz_defineMethod (c$, "size", 
29800 function () {
29801 return this.selected.size ();
29802 });
29803 Clazz_defineMethod (c$, "getMax", 
29804 function () {
29805 var max = -1;
29806 for (var i = 0; i < this.selected.size (); i++) {
29807 if (this.columnAt (i) > max) {
29808 max = this.columnAt (i);
29809 }}
29810 return max;
29811 });
29812 Clazz_defineMethod (c$, "getMin", 
29813 function () {
29814 var min = 1000000000;
29815 for (var i = 0; i < this.selected.size (); i++) {
29816 if (this.columnAt (i) < min) {
29817 min = this.columnAt (i);
29818 }}
29819 return min;
29820 });
29821 Clazz_defineMethod (c$, "compensateForEdit", 
29822 function (start, change) {
29823 var deletedHiddenColumns = null;
29824 for (var i = 0; i < this.size (); i++) {
29825 var temp = this.columnAt (i);
29826 if (temp >= start) {
29827 this.selected.setElementAt ( new Integer (temp - change), i);
29828 }}
29829 if (this.hiddenColumns != null) {
29830 deletedHiddenColumns =  new java.util.ArrayList ();
29831 var hSize = this.hiddenColumns.size ();
29832 for (var i = 0; i < hSize; i++) {
29833 var region = this.hiddenColumns.elementAt (i);
29834 if (region[0] > start && start + change > region[1]) {
29835 deletedHiddenColumns.add (region);
29836 this.hiddenColumns.removeElementAt (i);
29837 i--;
29838 hSize--;
29839 continue;
29840 }if (region[0] > start) {
29841 region[0] -= change;
29842 region[1] -= change;
29843 }if (region[0] < 0) {
29844 region[0] = 0;
29845 }}
29846 this.revealHiddenColumns (0);
29847 }return deletedHiddenColumns;
29848 }, "~N,~N");
29849 Clazz_defineMethod (c$, "compensateForDelEdits", 
29850  function (start, change) {
29851 for (var i = 0; i < this.size (); i++) {
29852 var temp = this.columnAt (i);
29853 if (temp >= start) {
29854 this.selected.setElementAt ( new Integer (temp - change), i);
29855 }}
29856 if (this.hiddenColumns != null) {
29857 for (var i = 0; i < this.hiddenColumns.size (); i++) {
29858 var region = this.hiddenColumns.elementAt (i);
29859 if (region[0] >= start) {
29860 region[0] -= change;
29861 }if (region[1] >= start) {
29862 region[1] -= change;
29863 }if (region[1] < region[0]) {
29864 this.hiddenColumns.removeElementAt (i--);
29865 }if (region[0] < 0) {
29866 region[0] = 0;
29867 }if (region[1] < 0) {
29868 region[1] = 0;
29869 }}
29870 }}, "~N,~N");
29871 Clazz_defineMethod (c$, "compensateForEdits", 
29872 function (shiftrecord) {
29873 if (shiftrecord != null) {
29874 var shifts = shiftrecord.getShifts ();
29875 if (shifts != null && shifts.size () > 0) {
29876 var shifted = 0;
29877 for (var i = 0, j = shifts.size (); i < j; i++) {
29878 var sh = shifts.get (i);
29879 this.compensateForDelEdits (shifted + sh[0], sh[1]);
29880 shifted -= sh[1];
29881 }
29882 }return shiftrecord.getInverse ();
29883 }return null;
29884 }, "jalview.util.ShiftList");
29885 Clazz_defineMethod (c$, "pruneIntervalVector", 
29886  function (shifts, intervals) {
29887 var pruned = false;
29888 var i = 0;
29889 var j = intervals.size () - 1;
29890 var s = 0;
29891 var t = shifts.size () - 1;
29892 var hr = intervals.elementAt (i);
29893 var sr = shifts.get (s);
29894 while (i <= j && s <= t) {
29895 var trailinghn = hr[1] >= sr[0];
29896 if (!trailinghn) {
29897 if (i < j) {
29898 hr = intervals.elementAt (++i);
29899 } else {
29900 i++;
29901 }continue;
29902 }var endshift = sr[0] + sr[1];
29903 if (endshift < hr[0] || endshift < sr[0]) {
29904 if (s < t) {
29905 sr = shifts.get (++s);
29906 } else {
29907 s++;
29908 }continue;
29909 }var leadinghn = hr[0] >= sr[0];
29910 var leadinghc = hr[0] < endshift;
29911 var trailinghc = hr[1] < endshift;
29912 if (leadinghn) {
29913 if (trailinghc) {
29914 intervals.removeElementAt (i);
29915 pruned = true;
29916 j--;
29917 if (i <= j) {
29918 hr = intervals.elementAt (i);
29919 }continue;
29920 }if (leadinghc) {
29921 hr[0] = endshift;
29922 leadinghn = !leadinghn;
29923 pruned = true;
29924 }}if (!leadinghn) {
29925 if (trailinghc) {
29926 if (trailinghn) {
29927 hr[1] = sr[0] - 1;
29928 pruned = true;
29929 }} else {
29930 if (s < t) {
29931 sr = shifts.get (++s);
29932 } else {
29933 s++;
29934 }continue;
29935 }}}
29936 return pruned;
29937 }, "java.util.List,java.util.Vector");
29938 Clazz_defineMethod (c$, "pruneColumnList", 
29939  function (shifts, list) {
29940 var s = 0;
29941 var t = shifts.size ();
29942 var sr = shifts.get (s++);
29943 var pruned = false;
29944 var i = 0;
29945 var j = list.size ();
29946 while (i < j && s <= t) {
29947 var c = list.elementAt (i++).intValue ();
29948 if (sr[0] <= c) {
29949 if (sr[1] + sr[0] >= c) {
29950 list.removeElementAt (--i);
29951 j--;
29952 } else {
29953 if (s < t) {
29954 sr = shifts.get (s);
29955 }s++;
29956 }}}
29957 return pruned;
29958 }, "java.util.List,java.util.Vector");
29959 Clazz_defineMethod (c$, "pruneDeletions", 
29960 function (deletions) {
29961 if (deletions != null) {
29962 var shifts = deletions.getShifts ();
29963 if (shifts != null && shifts.size () > 0) {
29964 if (this.hiddenColumns != null) {
29965 this.pruneIntervalVector (shifts, this.hiddenColumns);
29966 if (this.hiddenColumns != null && this.hiddenColumns.size () == 0) {
29967 this.hiddenColumns = null;
29968 }}if (this.selected != null && this.selected.size () > 0) {
29969 this.pruneColumnList (shifts, this.selected);
29970 if (this.selected != null && this.selected.size () == 0) {
29971 this.selected = null;
29972 }}this.compensateForEdits (deletions);
29973 }}}, "jalview.util.ShiftList");
29974 Clazz_defineMethod (c$, "getHiddenColumns", 
29975 function () {
29976 return this.hiddenColumns == null ? java.util.Collections.emptyList () : this.hiddenColumns;
29977 });
29978 Clazz_defineMethod (c$, "adjustForHiddenColumns", 
29979 function (column) {
29980 var result = column;
29981 if (this.hiddenColumns != null) {
29982 for (var i = 0; i < this.hiddenColumns.size (); i++) {
29983 var region = this.hiddenColumns.elementAt (i);
29984 if (result >= region[0]) {
29985 result += region[1] - region[0] + 1;
29986 }}
29987 }return result;
29988 }, "~N");
29989 Clazz_defineMethod (c$, "findColumnPosition", 
29990 function (hiddenColumn) {
29991 var result = hiddenColumn;
29992 if (this.hiddenColumns != null) {
29993 var index = 0;
29994 var region;
29995 do {
29996 region = this.hiddenColumns.elementAt (index++);
29997 if (hiddenColumn > region[1]) {
29998 result -= region[1] + 1 - region[0];
29999 }} while ((hiddenColumn > region[1]) && (index < this.hiddenColumns.size ()));
30000 if (hiddenColumn > region[0] && hiddenColumn < region[1]) {
30001 return region[0] + hiddenColumn - result;
30002 }}return result;
30003 }, "~N");
30004 Clazz_defineMethod (c$, "findHiddenRegionPosition", 
30005 function (hiddenRegion) {
30006 var result = 0;
30007 if (this.hiddenColumns != null) {
30008 var index = 0;
30009 var gaps = 0;
30010 do {
30011 var region = this.hiddenColumns.elementAt (index);
30012 if (hiddenRegion == 0) {
30013 return region[0];
30014 }gaps += region[1] + 1 - region[0];
30015 result = region[1] + 1;
30016 index++;
30017 } while (index < hiddenRegion + 1);
30018 result -= gaps;
30019 }return result;
30020 }, "~N");
30021 Clazz_defineMethod (c$, "getHiddenBoundaryRight", 
30022 function (alPos) {
30023 if (this.hiddenColumns != null) {
30024 var index = 0;
30025 do {
30026 var region = this.hiddenColumns.elementAt (index);
30027 if (alPos < region[0]) {
30028 return region[0];
30029 }index++;
30030 } while (index < this.hiddenColumns.size ());
30031 }return alPos;
30032 }, "~N");
30033 Clazz_defineMethod (c$, "getHiddenBoundaryLeft", 
30034 function (alPos) {
30035 if (this.hiddenColumns != null) {
30036 var index = this.hiddenColumns.size () - 1;
30037 do {
30038 var region = this.hiddenColumns.elementAt (index);
30039 if (alPos > region[1]) {
30040 return region[1];
30041 }index--;
30042 } while (index > -1);
30043 }return alPos;
30044 }, "~N");
30045 Clazz_defineMethod (c$, "hideSelectedColumns", 
30046 function () {
30047 while (this.size () > 0) {
30048 var column = this.getSelected ().firstElement ().intValue ();
30049 this.hideColumns (column);
30050 }
30051 });
30052 Clazz_defineMethod (c$, "hideColumns", 
30053 function (start, end) {
30054 if (this.hiddenColumns == null) {
30055 this.hiddenColumns =  new java.util.Vector ();
30056 }var added = false;
30057 var overlap = false;
30058 for (var i = 0; i < this.hiddenColumns.size (); i++) {
30059 var region = this.hiddenColumns.elementAt (i);
30060 if (start <= region[1] && end >= region[0]) {
30061 this.hiddenColumns.removeElementAt (i);
30062 overlap = true;
30063 break;
30064 } else if (end < region[0] && start < region[0]) {
30065 this.hiddenColumns.insertElementAt ( Clazz_newIntArray (-1, [start, end]), i);
30066 added = true;
30067 break;
30068 }}
30069 if (overlap) {
30070 this.hideColumns (start, end);
30071 } else if (!added) {
30072 this.hiddenColumns.addElement ( Clazz_newIntArray (-1, [start, end]));
30073 }}, "~N,~N");
30074 Clazz_defineMethod (c$, "hideColumns", 
30075 function (col) {
30076 var min = col;
30077 var max = col + 1;
30078 while (this.contains (min)) {
30079 this.removeElement (min);
30080 min--;
30081 }
30082 while (this.contains (max)) {
30083 this.removeElement (max);
30084 max++;
30085 }
30086 min++;
30087 max--;
30088 if (min > max) {
30089 min = max;
30090 }this.hideColumns (min, max);
30091 }, "~N");
30092 Clazz_defineMethod (c$, "revealAllHiddenColumns", 
30093 function () {
30094 if (this.hiddenColumns != null) {
30095 for (var i = 0; i < this.hiddenColumns.size (); i++) {
30096 var region = this.hiddenColumns.elementAt (i);
30097 for (var j = region[0]; j < region[1] + 1; j++) {
30098 this.addElement (j);
30099 }
30100 }
30101 }this.hiddenColumns = null;
30102 });
30103 Clazz_defineMethod (c$, "revealHiddenColumns", 
30104 function (res) {
30105 for (var i = 0; i < this.hiddenColumns.size (); i++) {
30106 var region = this.hiddenColumns.elementAt (i);
30107 if (res == region[0]) {
30108 for (var j = region[0]; j < region[1] + 1; j++) {
30109 this.addElement (j);
30110 }
30111 this.hiddenColumns.removeElement (region);
30112 break;
30113 }}
30114 if (this.hiddenColumns.size () == 0) {
30115 this.hiddenColumns = null;
30116 }}, "~N");
30117 Clazz_defineMethod (c$, "isVisible", 
30118 function (column) {
30119 if (this.hiddenColumns != null) {
30120 for (var i = 0; i < this.hiddenColumns.size (); i++) {
30121 var region = this.hiddenColumns.elementAt (i);
30122 if (column >= region[0] && column <= region[1]) {
30123 return false;
30124 }}
30125 }return true;
30126 }, "~N");
30127 Clazz_makeConstructor (c$, 
30128 function (copy) {
30129 if (copy != null) {
30130 if (copy.selected != null) {
30131 this.selected =  new java.util.Vector ();
30132 for (var i = 0, j = copy.selected.size (); i < j; i++) {
30133 this.selected.addElement (copy.selected.elementAt (i));
30134 }
30135 }if (copy.hiddenColumns != null) {
30136 this.hiddenColumns =  new java.util.Vector (copy.hiddenColumns.size ());
30137 for (var i = 0, j = copy.hiddenColumns.size (); i < j; i++) {
30138 var rh;
30139 var cp;
30140 rh = copy.hiddenColumns.elementAt (i);
30141 if (rh != null) {
30142 cp =  Clazz_newIntArray (rh.length, 0);
30143 System.arraycopy (rh, 0, cp, 0, rh.length);
30144 this.hiddenColumns.addElement (cp);
30145 }}
30146 }}}, "jalview.datamodel.ColumnSelection");
30147 Clazz_makeConstructor (c$, 
30148 function () {
30149 });
30150 Clazz_defineMethod (c$, "getVisibleSequenceStrings", 
30151 function (start, end, seqs) {
30152 var i;
30153 var iSize = seqs.length;
30154 var selection =  new Array (iSize);
30155 if (this.hiddenColumns != null && this.hiddenColumns.size () > 0) {
30156 for (i = 0; i < iSize; i++) {
30157 var visibleSeq =  new StringBuffer ();
30158 var regions = this.getHiddenColumns ();
30159 var blockStart = start;
30160 var blockEnd = end;
30161 var region;
30162 var hideStart;
30163 var hideEnd;
30164 for (var j = 0; j < regions.size (); j++) {
30165 region = regions.get (j);
30166 hideStart = region[0];
30167 hideEnd = region[1];
30168 if (hideStart < start) {
30169 continue;
30170 }blockStart = Math.min (blockStart, hideEnd + 1);
30171 blockEnd = Math.min (blockEnd, hideStart);
30172 if (blockStart > blockEnd) {
30173 break;
30174 }visibleSeq.append (seqs[i].getSequence (blockStart, blockEnd));
30175 blockStart = hideEnd + 1;
30176 blockEnd = end;
30177 }
30178 if (end > blockStart) {
30179 visibleSeq.append (seqs[i].getSequence (blockStart, end));
30180 }selection[i] = visibleSeq.toString ();
30181 }
30182 } else {
30183 for (i = 0; i < iSize; i++) {
30184 selection[i] = seqs[i].getSequenceAsString (start, end);
30185 }
30186 }return selection;
30187 }, "~N,~N,~A");
30188 Clazz_defineMethod (c$, "getVisibleContigs", 
30189 function (start, end) {
30190 if (this.hiddenColumns != null && this.hiddenColumns.size () > 0) {
30191 var visiblecontigs =  new java.util.ArrayList ();
30192 var regions = this.getHiddenColumns ();
30193 var vstart = start;
30194 var region;
30195 var hideStart;
30196 var hideEnd;
30197 for (var j = 0; vstart < end && j < regions.size (); j++) {
30198 region = regions.get (j);
30199 hideStart = region[0];
30200 hideEnd = region[1];
30201 if (hideEnd < vstart) {
30202 continue;
30203 }if (hideStart > vstart) {
30204 visiblecontigs.add ( Clazz_newIntArray (-1, [vstart, hideStart - 1]));
30205 }vstart = hideEnd + 1;
30206 }
30207 if (vstart < end) {
30208 visiblecontigs.add ( Clazz_newIntArray (-1, [vstart, end - 1]));
30209 }var vcontigs =  Clazz_newIntArray (visiblecontigs.size () * 2, 0);
30210 for (var i = 0, j = visiblecontigs.size (); i < j; i++) {
30211 var vc = visiblecontigs.get (i);
30212 visiblecontigs.set (i, null);
30213 vcontigs[i * 2] = vc[0];
30214 vcontigs[i * 2 + 1] = vc[1];
30215 }
30216 visiblecontigs.clear ();
30217 return vcontigs;
30218 } else {
30219 return  Clazz_newIntArray (-1, [start, end - 1]);
30220 }}, "~N,~N");
30221 Clazz_defineMethod (c$, "makeVisibleAnnotation", 
30222 function (alignmentAnnotation) {
30223 this.makeVisibleAnnotation (-1, -1, alignmentAnnotation);
30224 }, "jalview.datamodel.AlignmentAnnotation");
30225 Clazz_defineMethod (c$, "makeVisibleAnnotation", 
30226 function (start, end, alignmentAnnotation) {
30227 if (alignmentAnnotation.annotations == null) {
30228 return;
30229 }if (start == end && end == -1) {
30230 start = 0;
30231 end = alignmentAnnotation.annotations.length;
30232 }if (this.hiddenColumns != null && this.hiddenColumns.size () > 0) {
30233 var annels =  new java.util.Vector ();
30234 var els = null;
30235 var regions = this.getHiddenColumns ();
30236 var blockStart = start;
30237 var blockEnd = end;
30238 var region;
30239 var hideStart;
30240 var hideEnd;
30241 var w = 0;
30242 for (var j = 0; j < regions.size (); j++) {
30243 region = regions.get (j);
30244 hideStart = region[0];
30245 hideEnd = region[1];
30246 if (hideStart < start) {
30247 continue;
30248 }blockStart = Math.min (blockStart, hideEnd + 1);
30249 blockEnd = Math.min (blockEnd, hideStart);
30250 if (blockStart > blockEnd) {
30251 break;
30252 }annels.addElement (els =  new Array (blockEnd - blockStart));
30253 System.arraycopy (alignmentAnnotation.annotations, blockStart, els, 0, els.length);
30254 w += els.length;
30255 blockStart = hideEnd + 1;
30256 blockEnd = end;
30257 }
30258 if (end > blockStart) {
30259 annels.addElement (els =  new Array (end - blockStart + 1));
30260 if ((els.length + blockStart) <= alignmentAnnotation.annotations.length) {
30261 System.arraycopy (alignmentAnnotation.annotations, blockStart, els, 0, els.length);
30262 } else {
30263 System.arraycopy (alignmentAnnotation.annotations, blockStart, els, 0, (alignmentAnnotation.annotations.length - blockStart));
30264 }w += els.length;
30265 }if (w == 0) {
30266 return;
30267 }alignmentAnnotation.annotations =  new Array (w);
30268 w = 0;
30269 for (var chnk, $chnk = annels.iterator (); $chnk.hasNext () && ((chnk = $chnk.next ()) || true);) {
30270 System.arraycopy (chnk, 0, alignmentAnnotation.annotations, w, chnk.length);
30271 w += chnk.length;
30272 }
30273 } else {
30274 alignmentAnnotation.restrict (start, end);
30275 }}, "~N,~N,jalview.datamodel.AlignmentAnnotation");
30276 Clazz_defineMethod (c$, "invertColumnSelection", 
30277 function (first, width) {
30278 var hasHidden = this.hiddenColumns != null && this.hiddenColumns.size () > 0;
30279 for (var i = first; i < width; i++) {
30280 if (this.contains (i)) {
30281 this.removeElement (i);
30282 } else {
30283 if (!hasHidden || this.isVisible (i)) {
30284 this.addElement (i);
30285 }}}
30286 }, "~N,~N");
30287 Clazz_defineMethod (c$, "addElementsFrom", 
30288 function (colsel) {
30289 if (colsel != null && colsel.size () > 0) {
30290 for (var col, $col = colsel.getSelected ().iterator (); $col.hasNext () && ((col = $col.next ()) || true);) {
30291 if (this.hiddenColumns != null && this.isVisible (col.intValue ())) {
30292 if (!this.selected.contains (col)) {
30293 this.selected.addElement (col);
30294 }}}
30295 }}, "jalview.datamodel.ColumnSelection");
30296 Clazz_defineMethod (c$, "setElementsFrom", 
30297 function (colsel) {
30298 this.selected =  new java.util.Vector ();
30299 if (colsel.selected != null && colsel.selected.size () > 0) {
30300 if (this.hiddenColumns != null && this.hiddenColumns.size () > 0) {
30301 this.addElementsFrom (colsel);
30302 } else {
30303 for (var col, $col = colsel.getSelected ().iterator (); $col.hasNext () && ((col = $col.next ()) || true);) {
30304 this.addElement ((col).intValue ());
30305 }
30306 }}}, "jalview.datamodel.ColumnSelection");
30307 c$.propagateInsertions = Clazz_defineMethod (c$, "propagateInsertions", 
30308 function (profileseq, al, input) {
30309 var profsqpos = 0;
30310 var gc = al.getGapCharacter ();
30311 var alandcolsel = input.getAlignmentAndColumnSelection (gc);
30312 var nview = alandcolsel[1];
30313 var origseq = (alandcolsel[0])[profsqpos];
30314 nview.propagateInsertions (profileseq, al, origseq);
30315 return nview;
30316 }, "jalview.datamodel.SequenceI,jalview.datamodel.AlignmentI,jalview.datamodel.AlignmentView");
30317 Clazz_defineMethod (c$, "propagateInsertions", 
30318 function (profileseq, al, origseq) {
30319 var gc = al.getGapCharacter ();
30320 this.pruneDeletions (jalview.util.ShiftList.parseMap (origseq.gapMap ()));
30321 var viscontigs = this.getVisibleContigs (0, profileseq.getLength ());
30322 var spos = 0;
30323 var offset = 0;
30324 for (var v = 0; v < viscontigs.length; v += 2) {
30325 if (viscontigs[v] > spos) {
30326 var sb =  new StringBuffer ();
30327 for (var s = 0, ns = viscontigs[v] - spos; s < ns; s++) {
30328 sb.append (gc);
30329 }
30330 for (var s = 0, ns = al.getHeight (); s < ns; s++) {
30331 var sqobj = al.getSequenceAt (s);
30332 if (sqobj !== profileseq) {
30333 var sq = al.getSequenceAt (s).getSequenceAsString ();
30334 if (sq.length <= spos + offset) {
30335 var diff = spos + offset - sq.length - 1;
30336 if (diff > 0) {
30337 sq = sq + sb;
30338 while ((diff = spos + offset - sq.length - 1) > 0) {
30339 if (diff >= sb.length ()) {
30340 sq += sb.toString ();
30341 } else {
30342 var buf =  Clazz_newCharArray (diff, '\0');
30343 sb.getChars (0, diff, buf, 0);
30344 sq += buf.toString ();
30345 }}
30346 }sq += sb.toString ();
30347 } else {
30348 al.getSequenceAt (s).setSequence (sq.substring (0, spos + offset) + sb.toString () + sq.substring (spos + offset));
30349 }}}
30350 }spos = viscontigs[v + 1] + 1;
30351 }
30352 if ((offset + spos) < profileseq.getLength ()) {
30353 var sb =  new StringBuffer ();
30354 for (var s = 0, ns = profileseq.getLength () - spos - offset; s < ns; s++) {
30355 sb.append (gc);
30356 }
30357 for (var s = 0, ns = al.getHeight (); s < ns; s++) {
30358 var sqobj = al.getSequenceAt (s);
30359 if (sqobj === profileseq) {
30360 continue;
30361 }var sq = sqobj.getSequenceAsString ();
30362 var diff = origseq.getLength () - sq.length;
30363 while (diff > 0) {
30364 if (diff >= sb.length ()) {
30365 sq += sb.toString ();
30366 } else {
30367 var buf =  Clazz_newCharArray (diff, '\0');
30368 sb.getChars (0, diff, buf, 0);
30369 sq += buf.toString ();
30370 }diff = origseq.getLength () - sq.length;
30371 }
30372 }
30373 }}, "jalview.datamodel.SequenceI,jalview.datamodel.AlignmentI,jalview.datamodel.SequenceI");
30374 Clazz_defineMethod (c$, "hasSelectedColumns", 
30375 function () {
30376 return (this.selected != null && this.selected.size () > 0);
30377 });
30378 Clazz_defineMethod (c$, "hasHiddenColumns", 
30379 function () {
30380 return this.hiddenColumns != null && this.hiddenColumns.size () > 0;
30381 });
30382 Clazz_defineMethod (c$, "hasManyHiddenColumns", 
30383 function () {
30384 return this.hiddenColumns != null && this.hiddenColumns.size () > 1;
30385 });
30386 Clazz_defineMethod (c$, "hideInsertionsFor", 
30387 function (sr) {
30388 var inserts = sr.getInsertions ();
30389 for (var r, $r = inserts.iterator (); $r.hasNext () && ((r = $r.next ()) || true);) {
30390 this.hideColumns (r[0], r[1]);
30391 }
30392 }, "jalview.datamodel.SequenceI");
30393 Clazz_defineMethod (c$, "filterAnnotations", 
30394 function (annotations, filterParams) {
30395 this.revealAllHiddenColumns ();
30396 this.clear ();
30397 var count = 0;
30398 do {
30399 if (annotations[count] != null) {
30400 var itemMatched = false;
30401 if (filterParams.getThresholdType () === jalview.viewmodel.annotationfilter.AnnotationFilterParameter.ThresholdType.ABOVE_THRESHOLD && annotations[count].value >= filterParams.getThresholdValue ()) {
30402 itemMatched = true;
30403 }if (filterParams.getThresholdType () === jalview.viewmodel.annotationfilter.AnnotationFilterParameter.ThresholdType.BELOW_THRESHOLD && annotations[count].value <= filterParams.getThresholdValue ()) {
30404 itemMatched = true;
30405 }if (filterParams.isFilterAlphaHelix () && annotations[count].secondaryStructure == 'H') {
30406 itemMatched = true;
30407 }if (filterParams.isFilterBetaSheet () && annotations[count].secondaryStructure == 'E') {
30408 itemMatched = true;
30409 }if (filterParams.isFilterTurn () && annotations[count].secondaryStructure == 'S') {
30410 itemMatched = true;
30411 }var regexSearchString = filterParams.getRegexString ();
30412 if (regexSearchString != null && !filterParams.getRegexSearchFields ().isEmpty ()) {
30413 var fields = filterParams.getRegexSearchFields ();
30414 try {
30415 if (fields.contains (jalview.viewmodel.annotationfilter.AnnotationFilterParameter.SearchableAnnotationField.DISPLAY_STRING) && annotations[count].displayCharacter.matches (regexSearchString)) {
30416 itemMatched = true;
30417 }} catch (pse) {
30418 if (Clazz_exceptionOf (pse, java.util.regex.PatternSyntaxException)) {
30419 if (annotations[count].displayCharacter.equals (regexSearchString)) {
30420 itemMatched = true;
30421 }} else {
30422 throw pse;
30423 }
30424 }
30425 if (fields.contains (jalview.viewmodel.annotationfilter.AnnotationFilterParameter.SearchableAnnotationField.DESCRIPTION) && annotations[count].description != null && annotations[count].description.matches (regexSearchString)) {
30426 itemMatched = true;
30427 }}if (itemMatched) {
30428 this.addElement (count);
30429 }}count++;
30430 } while (count < annotations.length);
30431 return false;
30432 }, "~A,jalview.viewmodel.annotationfilter.AnnotationFilterParameter");
30433 });
30434 Clazz_declarePackage ("jalview.util");
30435 Clazz_load (null, "jalview.util.ShiftList", ["java.util.ArrayList"], function () {
30436 c$ = Clazz_decorateAsClass (function () {
30437 this.shifts = null;
30438 Clazz_instantialize (this, arguments);
30439 }, jalview.util, "ShiftList");
30440 Clazz_makeConstructor (c$, 
30441 function () {
30442 this.shifts =  new java.util.ArrayList ();
30443 });
30444 Clazz_defineMethod (c$, "addShift", 
30445 function (pos, shift) {
30446 {
30447 var sidx = 0;
30448 var rshift = null;
30449 while (sidx < this.shifts.size () && (rshift = this.shifts.get (sidx))[0] < pos) {
30450 sidx++;
30451 }
30452 if (sidx == this.shifts.size ()) {
30453 this.shifts.add (sidx,  Clazz_newIntArray (-1, [pos, shift]));
30454 } else {
30455 rshift[1] += shift;
30456 }}}, "~N,~N");
30457 Clazz_defineMethod (c$, "shift", 
30458 function (pos) {
30459 if (this.shifts.size () == 0) {
30460 return pos;
30461 }var shifted = pos;
30462 var sidx = 0;
30463 var rshift;
30464 while (sidx < this.shifts.size () && (rshift = (this.shifts.get (sidx++)))[0] <= pos) {
30465 shifted += rshift[1];
30466 }
30467 return shifted;
30468 }, "~N");
30469 Clazz_defineMethod (c$, "clear", 
30470 function () {
30471 this.shifts.clear ();
30472 });
30473 Clazz_defineMethod (c$, "getInverse", 
30474 function () {
30475 var inverse =  new jalview.util.ShiftList ();
30476 {
30477 if (this.shifts != null) {
30478 for (var sh, $sh = this.shifts.iterator (); $sh.hasNext () && ((sh = $sh.next ()) || true);) {
30479 if (sh != null) {
30480 inverse.shifts.add ( Clazz_newIntArray (-1, [sh[0], -sh[1]]));
30481 }}
30482 }}return inverse;
30483 });
30484 c$.parseMap = Clazz_defineMethod (c$, "parseMap", 
30485 function (gapMap) {
30486 var shiftList = null;
30487 if (gapMap != null && gapMap.length > 0) {
30488 shiftList =  new jalview.util.ShiftList ();
30489 for (var i = 0, p = 0; i < gapMap.length; p++, i++) {
30490 if (p != gapMap[i]) {
30491 shiftList.addShift (p, gapMap[i] - p);
30492 p = gapMap[i];
30493 }}
30494 }return shiftList;
30495 }, "~A");
30496 Clazz_defineMethod (c$, "getShifts", 
30497 function () {
30498 return this.shifts;
30499 });
30500 });
30501 Clazz_declarePackage ("jalview.viewmodel.annotationfilter");
30502 Clazz_load (["java.lang.Enum", "java.util.ArrayList"], "jalview.viewmodel.annotationfilter.AnnotationFilterParameter", null, function () {
30503 c$ = Clazz_decorateAsClass (function () {
30504 this.thresholdType = null;
30505 this.thresholdValue = 0;
30506 this.filterAlphaHelix = false;
30507 this.filterBetaSheet = false;
30508 this.filterTurn = false;
30509 this.regexString = null;
30510 this.regexSearchFields = null;
30511 Clazz_instantialize (this, arguments);
30512 }, jalview.viewmodel.annotationfilter, "AnnotationFilterParameter");
30513 Clazz_prepareFields (c$, function () {
30514 this.regexSearchFields =  new java.util.ArrayList ();
30515 });
30516 Clazz_defineMethod (c$, "getThresholdType", 
30517 function () {
30518 return this.thresholdType;
30519 });
30520 Clazz_defineMethod (c$, "setThresholdType", 
30521 function (thresholdType) {
30522 this.thresholdType = thresholdType;
30523 }, "jalview.viewmodel.annotationfilter.AnnotationFilterParameter.ThresholdType");
30524 Clazz_defineMethod (c$, "getThresholdValue", 
30525 function () {
30526 return this.thresholdValue;
30527 });
30528 Clazz_defineMethod (c$, "setThresholdValue", 
30529 function (thresholdValue) {
30530 this.thresholdValue = thresholdValue;
30531 }, "~N");
30532 Clazz_defineMethod (c$, "getRegexString", 
30533 function () {
30534 return this.regexString;
30535 });
30536 Clazz_defineMethod (c$, "setRegexString", 
30537 function (regexString) {
30538 this.regexString = regexString;
30539 }, "~S");
30540 Clazz_defineMethod (c$, "getRegexSearchFields", 
30541 function () {
30542 return this.regexSearchFields;
30543 });
30544 Clazz_defineMethod (c$, "addRegexSearchField", 
30545 function (regexSearchField) {
30546 this.regexSearchFields.add (regexSearchField);
30547 }, "jalview.viewmodel.annotationfilter.AnnotationFilterParameter.SearchableAnnotationField");
30548 Clazz_defineMethod (c$, "isFilterAlphaHelix", 
30549 function () {
30550 return this.filterAlphaHelix;
30551 });
30552 Clazz_defineMethod (c$, "setFilterAlphaHelix", 
30553 function (alphaHelix) {
30554 this.filterAlphaHelix = alphaHelix;
30555 }, "~B");
30556 Clazz_defineMethod (c$, "isFilterBetaSheet", 
30557 function () {
30558 return this.filterBetaSheet;
30559 });
30560 Clazz_defineMethod (c$, "setFilterBetaSheet", 
30561 function (betaSheet) {
30562 this.filterBetaSheet = betaSheet;
30563 }, "~B");
30564 Clazz_defineMethod (c$, "isFilterTurn", 
30565 function () {
30566 return this.filterTurn;
30567 });
30568 Clazz_defineMethod (c$, "setFilterTurn", 
30569 function (turn) {
30570 this.filterTurn = turn;
30571 }, "~B");
30572 Clazz_pu$h(self.c$);
30573 c$ = Clazz_declareType (jalview.viewmodel.annotationfilter.AnnotationFilterParameter, "ThresholdType", Enum);
30574 Clazz_defineEnumConstant (c$, "NO_THRESHOLD", 0, []);
30575 Clazz_defineEnumConstant (c$, "BELOW_THRESHOLD", 1, []);
30576 Clazz_defineEnumConstant (c$, "ABOVE_THRESHOLD", 2, []);
30577 c$ = Clazz_p0p ();
30578 Clazz_pu$h(self.c$);
30579 c$ = Clazz_declareType (jalview.viewmodel.annotationfilter.AnnotationFilterParameter, "SearchableAnnotationField", Enum);
30580 Clazz_defineEnumConstant (c$, "DISPLAY_STRING", 0, []);
30581 Clazz_defineEnumConstant (c$, "DESCRIPTION", 1, []);
30582 c$ = Clazz_p0p ();
30583 });
30584 Clazz_declarePackage ("jalview.datamodel");
30585 Clazz_load (["java.util.ArrayList"], "jalview.datamodel.SearchResults", ["java.lang.StringBuilder", "java.util.Arrays"], function () {
30586 c$ = Clazz_decorateAsClass (function () {
30587 this.matches = null;
30588 if (!Clazz_isClassDefined ("jalview.datamodel.SearchResults.Match")) {
30589 jalview.datamodel.SearchResults.$SearchResults$Match$ ();
30590 }
30591 Clazz_instantialize (this, arguments);
30592 }, jalview.datamodel, "SearchResults");
30593 Clazz_prepareFields (c$, function () {
30594 this.matches =  new java.util.ArrayList ();
30595 });
30596 Clazz_defineMethod (c$, "addResult", 
30597 function (seq, start, end) {
30598 this.matches.add (Clazz_innerTypeInstance (jalview.datamodel.SearchResults.Match, this, null, seq, start, end));
30599 }, "jalview.datamodel.SequenceI,~N,~N");
30600 Clazz_defineMethod (c$, "involvesSequence", 
30601 function (sequence) {
30602 var ds = sequence.getDatasetSequence ();
30603 for (var m, $m = this.matches.iterator (); $m.hasNext () && ((m = $m.next ()) || true);) {
30604 if (m.sequence != null && (m.sequence === sequence || m.sequence === ds)) {
30605 return true;
30606 }}
30607 return false;
30608 }, "jalview.datamodel.SequenceI");
30609 Clazz_defineMethod (c$, "getResults", 
30610 function (sequence, start, end) {
30611 if (this.matches.isEmpty ()) {
30612 return null;
30613 }var result = null;
30614 var tmp = null;
30615 var resultLength;
30616 var matchStart = 0;
30617 var matchEnd = 0;
30618 var mfound;
30619 for (var m, $m = this.matches.iterator (); $m.hasNext () && ((m = $m.next ()) || true);) {
30620 mfound = false;
30621 if (m.sequence === sequence) {
30622 mfound = true;
30623 matchStart = sequence.findIndex (m.start) - 1;
30624 matchEnd = sequence.findIndex (m.end) - 1;
30625 } else if (m.sequence === sequence.getDatasetSequence ()) {
30626 mfound = true;
30627 matchStart = sequence.findIndex (m.start) - 1;
30628 matchEnd = sequence.findIndex (m.end) - 1;
30629 }if (mfound) {
30630 if (matchStart <= end && matchEnd >= start) {
30631 if (matchStart < start) {
30632 matchStart = start;
30633 }if (matchEnd > end) {
30634 matchEnd = end;
30635 }if (result == null) {
30636 result =  Clazz_newIntArray (-1, [matchStart, matchEnd]);
30637 } else {
30638 resultLength = result.length;
30639 tmp =  Clazz_newIntArray (resultLength + 2, 0);
30640 System.arraycopy (result, 0, tmp, 0, resultLength);
30641 result = tmp;
30642 result[resultLength] = matchStart;
30643 result[resultLength + 1] = matchEnd;
30644 }} else {
30645 }}}
30646 return result;
30647 }, "jalview.datamodel.SequenceI,~N,~N");
30648 Clazz_defineMethod (c$, "getSize", 
30649 function () {
30650 return this.matches.size ();
30651 });
30652 Clazz_defineMethod (c$, "getResultSequence", 
30653 function (index) {
30654 return this.matches.get (index).sequence;
30655 }, "~N");
30656 Clazz_defineMethod (c$, "getResultStart", 
30657 function (i) {
30658 return this.matches.get (i).start;
30659 }, "~N");
30660 Clazz_defineMethod (c$, "getResultEnd", 
30661 function (i) {
30662 return this.matches.get (i).end;
30663 }, "~N");
30664 Clazz_defineMethod (c$, "isEmpty", 
30665 function () {
30666 return this.matches.isEmpty ();
30667 });
30668 Clazz_defineMethod (c$, "getResults", 
30669 function () {
30670 return this.matches;
30671 });
30672 Clazz_overrideMethod (c$, "toString", 
30673 function () {
30674 var result =  new StringBuilder (256);
30675 for (var m, $m = this.matches.iterator (); $m.hasNext () && ((m = $m.next ()) || true);) {
30676 result.append (m.toString ());
30677 }
30678 return result.toString ();
30679 });
30680 c$.$SearchResults$Match$ = function () {
30681 Clazz_pu$h(self.c$);
30682 c$ = Clazz_decorateAsClass (function () {
30683 Clazz_prepareCallback (this, arguments);
30684 this.sequence = null;
30685 this.start = 0;
30686 this.end = 0;
30687 Clazz_instantialize (this, arguments);
30688 }, jalview.datamodel.SearchResults, "Match");
30689 Clazz_makeConstructor (c$, 
30690 function (a, b, c) {
30691 this.sequence = a;
30692 this.start = b;
30693 this.end = c;
30694 }, "jalview.datamodel.SequenceI,~N,~N");
30695 Clazz_defineMethod (c$, "getSequence", 
30696 function () {
30697 return this.sequence;
30698 });
30699 Clazz_defineMethod (c$, "getStart", 
30700 function () {
30701 return this.start;
30702 });
30703 Clazz_defineMethod (c$, "getEnd", 
30704 function () {
30705 return this.end;
30706 });
30707 Clazz_overrideMethod (c$, "toString", 
30708 function () {
30709 var a = this.sequence.getSequence ();
30710 var b = Math.max (this.start - 1, 0);
30711 var c = Math.min (this.end, a.length + 1);
30712 return String.valueOf (java.util.Arrays.copyOfRange (a, b, c));
30713 });
30714 Clazz_defineMethod (c$, "setSequence", 
30715 function (a) {
30716 this.sequence = a;
30717 }, "jalview.datamodel.SequenceI");
30718 c$ = Clazz_p0p ();
30719 };
30720 });
30721 Clazz_declarePackage ("jalview.datamodel");
30722 Clazz_load (["jalview.datamodel.AnnotatedCollectionI", "java.awt.Color", "java.util.ArrayList"], "jalview.datamodel.SequenceGroup", ["jalview.analysis.AAFrequency", "$.Conservation", "jalview.datamodel.AlignmentAnnotation", "$.Sequence", "jalview.schemes.ResidueProperties", "jalview.util.Comparison", "java.lang.StringBuffer"], function () {
30723 c$ = Clazz_decorateAsClass (function () {
30724 this.groupName = null;
30725 this.description = null;
30726 this.conserve = null;
30727 this.aaFrequency = null;
30728 this.displayBoxes = true;
30729 this.displayText = true;
30730 this.colourText = false;
30731 this.showNonconserved = false;
30732 this.sequences = null;
30733 this.seqrep = null;
30734 this.width = -1;
30735 this.cs = null;
30736 this.startRes = 0;
30737 this.endRes = 0;
30738 this.outlineColour = null;
30739 this.idColour = null;
30740 this.thresholdTextColour = 0;
30741 this.textColour = null;
30742 this.textColour2 = null;
30743 this.ignoreGapsInConsensus = true;
30744 this.showSequenceLogo = false;
30745 this.normaliseSequenceLogo = false;
30746 this.consPercGaps = 25;
30747 this.consensusData = null;
30748 this.hidereps = false;
30749 this.hidecols = false;
30750 this.consensus = null;
30751 this.conservation = null;
30752 this.showConsensusHistogram = false;
30753 this.context = null;
30754 Clazz_instantialize (this, arguments);
30755 }, jalview.datamodel, "SequenceGroup", null, jalview.datamodel.AnnotatedCollectionI);
30756 Clazz_prepareFields (c$, function () {
30757 this.sequences =  new java.util.ArrayList ();
30758 this.outlineColour = java.awt.Color.black;
30759 this.textColour = java.awt.Color.black;
30760 this.textColour2 = java.awt.Color.white;
30761 });
30762 Clazz_defineMethod (c$, "isShowSequenceLogo", 
30763 function () {
30764 return this.showSequenceLogo;
30765 });
30766 Clazz_makeConstructor (c$, 
30767 function () {
30768 this.groupName = "JGroup:" + this.hashCode ();
30769 });
30770 Clazz_makeConstructor (c$, 
30771 function (sequences, groupName, scheme, displayBoxes, displayText, colourText, start, end) {
30772 this.sequences = sequences;
30773 this.groupName = groupName;
30774 this.displayBoxes = displayBoxes;
30775 this.displayText = displayText;
30776 this.colourText = colourText;
30777 this.cs = scheme;
30778 this.startRes = start;
30779 this.endRes = end;
30780 this.recalcConservation ();
30781 }, "java.util.List,~S,jalview.schemes.ColourSchemeI,~B,~B,~B,~N,~N");
30782 Clazz_makeConstructor (c$, 
30783 function (seqsel) {
30784 if (seqsel != null) {
30785 this.sequences =  new java.util.ArrayList ();
30786 this.sequences.addAll (seqsel.sequences);
30787 if (seqsel.groupName != null) {
30788 this.groupName =  String.instantialize (seqsel.groupName);
30789 }this.displayBoxes = seqsel.displayBoxes;
30790 this.displayText = seqsel.displayText;
30791 this.colourText = seqsel.colourText;
30792 this.startRes = seqsel.startRes;
30793 this.endRes = seqsel.endRes;
30794 this.cs = seqsel.cs;
30795 if (seqsel.description != null) {
30796 this.description =  String.instantialize (seqsel.description);
30797 }this.hidecols = seqsel.hidecols;
30798 this.hidereps = seqsel.hidereps;
30799 this.idColour = seqsel.idColour;
30800 this.outlineColour = seqsel.outlineColour;
30801 this.seqrep = seqsel.seqrep;
30802 this.textColour = seqsel.textColour;
30803 this.textColour2 = seqsel.textColour2;
30804 this.thresholdTextColour = seqsel.thresholdTextColour;
30805 this.width = seqsel.width;
30806 this.ignoreGapsInConsensus = seqsel.ignoreGapsInConsensus;
30807 if (seqsel.conserve != null) {
30808 this.recalcConservation ();
30809 }}}, "jalview.datamodel.SequenceGroup");
30810 Clazz_defineMethod (c$, "getSelectionAsNewSequences", 
30811 function (align) {
30812 var iSize = this.sequences.size ();
30813 var seqs =  new Array (iSize);
30814 var inorder = this.getSequencesInOrder (align);
30815 for (var i = 0, ipos = 0; i < inorder.length; i++) {
30816 var seq = inorder[i];
30817 seqs[ipos] = seq.getSubSequence (this.startRes, this.endRes + 1);
30818 if (seqs[ipos] != null) {
30819 seqs[ipos].setDescription (seq.getDescription ());
30820 seqs[ipos].setDBRef (seq.getDBRef ());
30821 seqs[ipos].setSequenceFeatures (seq.getSequenceFeatures ());
30822 if (seq.getDatasetSequence () != null) {
30823 seqs[ipos].setDatasetSequence (seq.getDatasetSequence ());
30824 }if (seq.getAnnotation () != null) {
30825 var alann = align.getAlignmentAnnotation ();
30826 for (var a = 0; a < seq.getAnnotation ().length; a++) {
30827 var tocopy = seq.getAnnotation ()[a];
30828 if (alann != null) {
30829 var found = false;
30830 for (var pos = 0; pos < alann.length; pos++) {
30831 if (alann[pos] === tocopy) {
30832 found = true;
30833 break;
30834 }}
30835 if (!found) {
30836 continue;
30837 }}var newannot =  new jalview.datamodel.AlignmentAnnotation (seq.getAnnotation ()[a]);
30838 newannot.restrict (this.startRes, this.endRes);
30839 newannot.setSequenceRef (seqs[ipos]);
30840 newannot.adjustForAlignment ();
30841 seqs[ipos].addAlignmentAnnotation (newannot);
30842 }
30843 }ipos++;
30844 } else {
30845 iSize--;
30846 }}
30847 if (iSize != inorder.length) {
30848 var nseqs =  new Array (iSize);
30849 System.arraycopy (seqs, 0, nseqs, 0, iSize);
30850 seqs = nseqs;
30851 }return seqs;
30852 }, "jalview.datamodel.AlignmentI");
30853 Clazz_defineMethod (c$, "findEndRes", 
30854 function (seq) {
30855 var eres = 0;
30856 var ch;
30857 for (var j = 0; j < this.endRes + 1 && j < seq.getLength (); j++) {
30858 ch = seq.getCharAt (j);
30859 if (!jalview.util.Comparison.isGap ((ch))) {
30860 eres++;
30861 }}
30862 if (eres > 0) {
30863 eres += seq.getStart () - 1;
30864 }return eres;
30865 }, "jalview.datamodel.SequenceI");
30866 Clazz_defineMethod (c$, "getSequences", 
30867 function () {
30868 return this.sequences;
30869 });
30870 Clazz_defineMethod (c$, "getSequences", 
30871 function (hiddenReps) {
30872 if (hiddenReps == null) {
30873 return this.sequences;
30874 } else {
30875 var allSequences =  new java.util.ArrayList ();
30876 for (var seq, $seq = this.sequences.iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
30877 allSequences.add (seq);
30878 if (hiddenReps.containsKey (seq)) {
30879 var hsg = hiddenReps.get (seq);
30880 for (var seq2, $seq2 = hsg.getSequences ().iterator (); $seq2.hasNext () && ((seq2 = $seq2.next ()) || true);) {
30881 if (seq2 !== seq && !allSequences.contains (seq2)) {
30882 allSequences.add (seq2);
30883 }}
30884 }}
30885 return allSequences;
30886 }}, "java.util.Map");
30887 Clazz_defineMethod (c$, "getSequencesAsArray", 
30888 function (map) {
30889 var tmp = this.getSequences (map);
30890 if (tmp == null) {
30891 return null;
30892 }return tmp.toArray ( new Array (tmp.size ()));
30893 }, "java.util.Map");
30894 Clazz_defineMethod (c$, "adjustForRemoveLeft", 
30895 function (col) {
30896 if (this.startRes >= col) {
30897 this.startRes = this.startRes - col;
30898 }if (this.endRes >= col) {
30899 this.endRes = this.endRes - col;
30900 if (this.startRes > this.endRes) {
30901 this.startRes = 0;
30902 }} else {
30903 return false;
30904 }return true;
30905 }, "~N");
30906 Clazz_defineMethod (c$, "adjustForRemoveRight", 
30907 function (col) {
30908 if (this.startRes > col) {
30909 return false;
30910 }if (this.endRes >= col) {
30911 this.endRes = col;
30912 }return true;
30913 }, "~N");
30914 Clazz_defineMethod (c$, "getName", 
30915 function () {
30916 return this.groupName;
30917 });
30918 Clazz_defineMethod (c$, "getDescription", 
30919 function () {
30920 return this.description;
30921 });
30922 Clazz_defineMethod (c$, "setName", 
30923 function (name) {
30924 this.groupName = name;
30925 }, "~S");
30926 Clazz_defineMethod (c$, "setDescription", 
30927 function (desc) {
30928 this.description = desc;
30929 }, "~S");
30930 Clazz_defineMethod (c$, "getConservation", 
30931 function () {
30932 return this.conserve;
30933 });
30934 Clazz_defineMethod (c$, "setConservation", 
30935 function (c) {
30936 this.conserve = c;
30937 }, "jalview.analysis.Conservation");
30938 Clazz_defineMethod (c$, "addSequence", 
30939 function (s, recalc) {
30940 {
30941 if (s != null && !this.sequences.contains (s)) {
30942 this.sequences.add (s);
30943 }if (recalc) {
30944 this.recalcConservation ();
30945 }}}, "jalview.datamodel.SequenceI,~B");
30946 Clazz_defineMethod (c$, "getConsPercGaps", 
30947 function () {
30948 return this.consPercGaps;
30949 });
30950 Clazz_defineMethod (c$, "setConsPercGaps", 
30951 function (consPercGaps) {
30952 this.consPercGaps = consPercGaps;
30953 }, "~N");
30954 Clazz_defineMethod (c$, "recalcConservation", 
30955 function () {
30956 if (this.cs == null && this.consensus == null && this.conservation == null) {
30957 return;
30958 }try {
30959 var cnsns = jalview.analysis.AAFrequency.calculate (this.sequences, this.startRes, this.endRes + 1, this.showSequenceLogo);
30960 if (this.consensus != null) {
30961 this._updateConsensusRow (cnsns, this.sequences.size ());
30962 }if (this.cs != null) {
30963 this.cs.setConsensus (cnsns);
30964 }if ((this.conservation != null) || (this.cs != null && this.cs.conservationApplied ())) {
30965 var c =  new jalview.analysis.Conservation (this.groupName, jalview.schemes.ResidueProperties.propHash, 3, this.sequences, this.startRes, this.endRes + 1);
30966 c.calculate ();
30967 c.verdict (false, this.consPercGaps);
30968 if (this.conservation != null) {
30969 this._updateConservationRow (c);
30970 }if (this.cs != null) {
30971 if (this.cs.conservationApplied ()) {
30972 this.cs.setConservation (c);
30973 }}}if (this.cs != null) {
30974 this.cs.alignmentChanged (this.context != null ? this.context : this, null);
30975 }} catch (err) {
30976 if (Clazz_exceptionOf (err, OutOfMemoryError)) {
30977 System.out.println ("Out of memory loading groups: " + err);
30978 } else {
30979 throw err;
30980 }
30981 }
30982 });
30983 Clazz_defineMethod (c$, "_updateConservationRow", 
30984  function (c) {
30985 if (this.conservation == null) {
30986 this.getConservation ();
30987 }this.conservation.label = "Conservation for " + this.getName ();
30988 this.conservation.description = "Conservation for group " + this.getName () + " less than " + this.consPercGaps + "% gaps";
30989 var aWidth = (this.conservation.annotations != null) ? (this.endRes < this.conservation.annotations.length ? this.conservation.annotations.length : this.endRes + 1) : this.endRes + 1;
30990 this.conservation.annotations = null;
30991 this.conservation.annotations =  new Array (aWidth);
30992 c.completeAnnotations (this.conservation, null, this.startRes, this.endRes + 1);
30993 }, "jalview.analysis.Conservation");
30994 Clazz_defineMethod (c$, "_updateConsensusRow", 
30995  function (cnsns, nseq) {
30996 if (this.consensus == null) {
30997 this.getConsensus ();
30998 }this.consensus.label = "Consensus for " + this.getName ();
30999 this.consensus.description = "Percent Identity";
31000 this.consensusData = cnsns;
31001 var aWidth = (this.consensus.annotations != null) ? (this.endRes < this.consensus.annotations.length ? this.consensus.annotations.length : this.endRes + 1) : this.endRes + 1;
31002 this.consensus.annotations = null;
31003 this.consensus.annotations =  new Array (aWidth);
31004 jalview.analysis.AAFrequency.completeConsensus (this.consensus, cnsns, this.startRes, this.endRes + 1, this.ignoreGapsInConsensus, this.showSequenceLogo, nseq);
31005 }, "~A,~N");
31006 Clazz_defineMethod (c$, "addOrRemove", 
31007 function (s, recalc) {
31008 {
31009 if (this.sequences.contains (s)) {
31010 this.deleteSequence (s, recalc);
31011 } else {
31012 this.addSequence (s, recalc);
31013 }}}, "jalview.datamodel.SequenceI,~B");
31014 Clazz_defineMethod (c$, "deleteSequence", 
31015 function (s, recalc) {
31016 {
31017 this.sequences.remove (s);
31018 if (recalc) {
31019 this.recalcConservation ();
31020 }}}, "jalview.datamodel.SequenceI,~B");
31021 Clazz_overrideMethod (c$, "getStartRes", 
31022 function () {
31023 return this.startRes;
31024 });
31025 Clazz_overrideMethod (c$, "getEndRes", 
31026 function () {
31027 return this.endRes;
31028 });
31029 Clazz_defineMethod (c$, "setStartRes", 
31030 function (i) {
31031 this.startRes = i;
31032 }, "~N");
31033 Clazz_defineMethod (c$, "setEndRes", 
31034 function (i) {
31035 this.endRes = i;
31036 }, "~N");
31037 Clazz_defineMethod (c$, "getSize", 
31038 function () {
31039 return this.sequences.size ();
31040 });
31041 Clazz_defineMethod (c$, "getSequenceAt", 
31042 function (i) {
31043 return this.sequences.get (i);
31044 }, "~N");
31045 Clazz_defineMethod (c$, "setColourText", 
31046 function (state) {
31047 this.colourText = state;
31048 }, "~B");
31049 Clazz_defineMethod (c$, "getColourText", 
31050 function () {
31051 return this.colourText;
31052 });
31053 Clazz_defineMethod (c$, "setDisplayText", 
31054 function (state) {
31055 this.displayText = state;
31056 }, "~B");
31057 Clazz_defineMethod (c$, "getDisplayText", 
31058 function () {
31059 return this.displayText;
31060 });
31061 Clazz_defineMethod (c$, "setDisplayBoxes", 
31062 function (state) {
31063 this.displayBoxes = state;
31064 }, "~B");
31065 Clazz_defineMethod (c$, "getDisplayBoxes", 
31066 function () {
31067 return this.displayBoxes;
31068 });
31069 Clazz_overrideMethod (c$, "getWidth", 
31070 function () {
31071 {
31072 var first = true;
31073 for (var seq, $seq = this.sequences.iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
31074 if (first || seq.getLength () > this.width) {
31075 this.width = seq.getLength ();
31076 first = false;
31077 }}
31078 return this.width;
31079 }});
31080 Clazz_defineMethod (c$, "setOutlineColour", 
31081 function (c) {
31082 this.outlineColour = c;
31083 }, "java.awt.Color");
31084 Clazz_defineMethod (c$, "getOutlineColour", 
31085 function () {
31086 return this.outlineColour;
31087 });
31088 Clazz_defineMethod (c$, "getSequencesInOrder", 
31089 function (al) {
31090 return this.getSequencesInOrder (al, true);
31091 }, "jalview.datamodel.AlignmentI");
31092 Clazz_defineMethod (c$, "getSequencesInOrder", 
31093 function (al, trim) {
31094 {
31095 var sSize = this.sequences.size ();
31096 var alHeight = al.getHeight ();
31097 var seqs =  new Array ((trim) ? sSize : alHeight);
31098 var index = 0;
31099 for (var i = 0; i < alHeight && index < sSize; i++) {
31100 if (this.sequences.contains (al.getSequenceAt (i))) {
31101 seqs[(trim) ? index : i] = al.getSequenceAt (i);
31102 index++;
31103 }}
31104 if (index == 0) {
31105 return null;
31106 }if (!trim) {
31107 return seqs;
31108 }if (index < seqs.length) {
31109 var dummy = seqs;
31110 seqs =  new Array (index);
31111 while (--index >= 0) {
31112 seqs[index] = dummy[index];
31113 dummy[index] = null;
31114 }
31115 }return seqs;
31116 }}, "jalview.datamodel.AlignmentI,~B");
31117 Clazz_defineMethod (c$, "getIdColour", 
31118 function () {
31119 return this.idColour;
31120 });
31121 Clazz_defineMethod (c$, "setIdColour", 
31122 function (idColour) {
31123 this.idColour = idColour;
31124 }, "java.awt.Color");
31125 Clazz_overrideMethod (c$, "getSeqrep", 
31126 function () {
31127 return this.seqrep;
31128 });
31129 Clazz_overrideMethod (c$, "setSeqrep", 
31130 function (seqrep) {
31131 this.seqrep = seqrep;
31132 }, "jalview.datamodel.SequenceI");
31133 Clazz_overrideMethod (c$, "hasSeqrep", 
31134 function () {
31135 return this.seqrep != null;
31136 });
31137 Clazz_defineMethod (c$, "setHidereps", 
31138 function (visibility) {
31139 this.hidereps = visibility;
31140 }, "~B");
31141 Clazz_defineMethod (c$, "isHidereps", 
31142 function () {
31143 return this.hidereps;
31144 });
31145 Clazz_defineMethod (c$, "setHideCols", 
31146 function (visibility) {
31147 this.hidecols = visibility;
31148 }, "~B");
31149 Clazz_defineMethod (c$, "isHideCols", 
31150 function () {
31151 return this.hidecols;
31152 });
31153 Clazz_defineMethod (c$, "intersect", 
31154 function (alignment, map) {
31155 var sgroup =  new jalview.datamodel.SequenceGroup (this);
31156 var insect = this.getSequencesInOrder (alignment);
31157 sgroup.sequences =  new java.util.ArrayList ();
31158 for (var s = 0; insect != null && s < insect.length; s++) {
31159 if (map == null || map.containsKey (insect[s])) {
31160 sgroup.sequences.add (insect[s]);
31161 }}
31162 return sgroup;
31163 }, "jalview.datamodel.AlignmentI,java.util.Map");
31164 Clazz_defineMethod (c$, "getShowNonconserved", 
31165 function () {
31166 return this.showNonconserved;
31167 });
31168 Clazz_defineMethod (c$, "setShowNonconserved", 
31169 function (displayNonconserved) {
31170 this.showNonconserved = displayNonconserved;
31171 }, "~B");
31172 Clazz_defineMethod (c$, "setConsensus", 
31173 function (aan) {
31174 if (this.consensus == null) {
31175 this.consensus = aan;
31176 }}, "jalview.datamodel.AlignmentAnnotation");
31177 Clazz_defineMethod (c$, "getConsensus", 
31178 function () {
31179 var aWidth = this.getWidth ();
31180 if (aWidth < 0) {
31181 return null;
31182 }if (this.consensus == null) {
31183 this.consensus =  new jalview.datamodel.AlignmentAnnotation ("", "",  new Array (1), 0, 100, 1);
31184 this.consensus.hasText = true;
31185 this.consensus.autoCalculated = true;
31186 this.consensus.groupRef = this;
31187 this.consensus.label = "Consensus for " + this.getName ();
31188 this.consensus.description = "Percent Identity";
31189 }return this.consensus;
31190 });
31191 Clazz_defineMethod (c$, "setConservationRow", 
31192 function (aan) {
31193 if (this.conservation == null) {
31194 this.conservation = aan;
31195 }}, "jalview.datamodel.AlignmentAnnotation");
31196 Clazz_defineMethod (c$, "getConservationRow", 
31197 function () {
31198 if (this.conservation == null) {
31199 this.conservation =  new jalview.datamodel.AlignmentAnnotation ("", "",  new Array (1), 0, 11, 1);
31200 }this.conservation.hasText = true;
31201 this.conservation.autoCalculated = true;
31202 this.conservation.groupRef = this;
31203 this.conservation.label = "Conservation for " + this.getName ();
31204 this.conservation.description = "Conservation for group " + this.getName () + " less than " + this.consPercGaps + "% gaps";
31205 return this.conservation;
31206 });
31207 Clazz_defineMethod (c$, "hasAnnotationRows", 
31208 function () {
31209 return this.consensus != null || this.conservation != null;
31210 });
31211 Clazz_defineMethod (c$, "getConsensusSeq", 
31212 function () {
31213 this.getConsensus ();
31214 var seqs =  new StringBuffer ();
31215 for (var i = 0; i < this.consensus.annotations.length; i++) {
31216 if (this.consensus.annotations[i] != null) {
31217 if (this.consensus.annotations[i].description.charAt (0) == '[') {
31218 seqs.append (this.consensus.annotations[i].description.charAt (1));
31219 } else {
31220 seqs.append (this.consensus.annotations[i].displayCharacter);
31221 }}}
31222 var sq =  new jalview.datamodel.Sequence ("Group" + this.getName () + " Consensus", seqs.toString ());
31223 sq.setDescription ("Percentage Identity Consensus " + ((this.ignoreGapsInConsensus) ? " without gaps" : ""));
31224 return sq;
31225 });
31226 Clazz_defineMethod (c$, "setIgnoreGapsConsensus", 
31227 function (state) {
31228 if (this.ignoreGapsInConsensus != state && this.consensus != null) {
31229 this.ignoreGapsInConsensus = state;
31230 this.recalcConservation ();
31231 }this.ignoreGapsInConsensus = state;
31232 }, "~B");
31233 Clazz_defineMethod (c$, "getIgnoreGapsConsensus", 
31234 function () {
31235 return this.ignoreGapsInConsensus;
31236 });
31237 Clazz_defineMethod (c$, "setshowSequenceLogo", 
31238 function (showSequenceLogo) {
31239 if (this.showSequenceLogo != showSequenceLogo && this.consensus != null) {
31240 this.showSequenceLogo = showSequenceLogo;
31241 this.recalcConservation ();
31242 }this.showSequenceLogo = showSequenceLogo;
31243 }, "~B");
31244 Clazz_defineMethod (c$, "setShowConsensusHistogram", 
31245 function (showConsHist) {
31246 if (this.showConsensusHistogram != showConsHist && this.consensus != null) {
31247 this.showConsensusHistogram = showConsHist;
31248 this.recalcConservation ();
31249 }this.showConsensusHistogram = showConsHist;
31250 }, "~B");
31251 Clazz_defineMethod (c$, "isShowConsensusHistogram", 
31252 function () {
31253 return this.showConsensusHistogram;
31254 });
31255 Clazz_defineMethod (c$, "setNormaliseSequenceLogo", 
31256 function (norm) {
31257 this.normaliseSequenceLogo = norm;
31258 }, "~B");
31259 Clazz_defineMethod (c$, "isNormaliseSequenceLogo", 
31260 function () {
31261 return this.normaliseSequenceLogo;
31262 });
31263 Clazz_overrideMethod (c$, "getAlignmentAnnotation", 
31264 function () {
31265 var annot =  new java.util.ArrayList ();
31266 {
31267 for (var seq, $seq = this.sequences.iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
31268 var aa = seq.getAnnotation ();
31269 if (aa != null) {
31270 for (var al, $al = 0, $$al = aa; $al < $$al.length && ((al = $$al[$al]) || true); $al++) {
31271 if (al.groupRef === this) {
31272 annot.add (al);
31273 }}
31274 }}
31275 if (this.consensus != null) {
31276 annot.add (this.consensus);
31277 }if (this.conservation != null) {
31278 annot.add (this.conservation);
31279 }}return annot.toArray ( new Array (0));
31280 });
31281 Clazz_overrideMethod (c$, "findAnnotation", 
31282 function (calcId) {
31283 var aa =  new java.util.ArrayList ();
31284 for (var a, $a = 0, $$a = this.getAlignmentAnnotation (); $a < $$a.length && ((a = $$a[$a]) || true); $a++) {
31285 if (a.getCalcId () === calcId) {
31286 aa.add (a);
31287 }}
31288 return aa;
31289 }, "~S");
31290 Clazz_overrideMethod (c$, "findAnnotations", 
31291 function (seq, calcId, label) {
31292 var aa =  new java.util.ArrayList ();
31293 for (var ann, $ann = 0, $$ann = this.getAlignmentAnnotation (); $ann < $$ann.length && ((ann = $$ann[$ann]) || true); $ann++) {
31294 if (ann.getCalcId () != null && ann.getCalcId ().equals (calcId) && ann.sequenceRef != null && ann.sequenceRef === seq && ann.label != null && ann.label.equals (label)) {
31295 aa.add (ann);
31296 }}
31297 return aa;
31298 }, "jalview.datamodel.SequenceI,~S,~S");
31299 Clazz_defineMethod (c$, "hasAnnotation", 
31300 function (calcId) {
31301 if (calcId != null && !"".equals (calcId)) {
31302 for (var a, $a = 0, $$a = this.getAlignmentAnnotation (); $a < $$a.length && ((a = $$a[$a]) || true); $a++) {
31303 if (a.getCalcId () === calcId) {
31304 return true;
31305 }}
31306 }return false;
31307 }, "~S");
31308 Clazz_defineMethod (c$, "clear", 
31309 function () {
31310 {
31311 this.sequences.clear ();
31312 }});
31313 Clazz_defineMethod (c$, "setContext", 
31314 function (context) {
31315 this.context = context;
31316 }, "jalview.datamodel.AnnotatedCollectionI");
31317 Clazz_overrideMethod (c$, "getContext", 
31318 function () {
31319 return this.context;
31320 });
31321 });
31322 Clazz_declarePackage ("jalview.datamodel");
31323 Clazz_load (["jalview.datamodel.SequenceCollectionI"], "jalview.datamodel.AnnotatedCollectionI", null, function () {
31324 Clazz_declareInterface (jalview.datamodel, "AnnotatedCollectionI", jalview.datamodel.SequenceCollectionI);
31325 });
31326 Clazz_declarePackage ("jalview.datamodel");
31327 Clazz_declareInterface (jalview.datamodel, "SequenceCollectionI");
31328 Clazz_declarePackage ("jalview.analysis");
31329 Clazz_load (null, "jalview.analysis.AAFrequency", ["jalview.analysis.CodingUtils", "jalview.datamodel.Annotation", "jalview.util.Format", "$.MappingUtils", "$.QuickSort", "java.lang.Float", "$.StringBuilder", "java.util.Arrays", "$.Hashtable"], function () {
31330 c$ = Clazz_declareType (jalview.analysis, "AAFrequency");
31331 c$.calculate = Clazz_defineMethod (c$, "calculate", 
31332 function (list, start, end) {
31333 return jalview.analysis.AAFrequency.calculate (list, start, end, false);
31334 }, "java.util.List,~N,~N");
31335 c$.calculate = Clazz_defineMethod (c$, "calculate", 
31336 function (sequences, start, end, profile) {
31337 var seqs =  new Array (sequences.size ());
31338 var width = 0;
31339 {
31340 for (var i = 0; i < sequences.size (); i++) {
31341 seqs[i] = sequences.get (i);
31342 if (seqs[i].getLength () > width) {
31343 width = seqs[i].getLength ();
31344 }}
31345 var reply =  new Array (width);
31346 if (end >= width) {
31347 end = width;
31348 }jalview.analysis.AAFrequency.calculate (seqs, start, end, reply, profile);
31349 return reply;
31350 }}, "java.util.List,~N,~N,~B");
31351 c$.calculate = Clazz_defineMethod (c$, "calculate", 
31352 function (sequences, start, end, result, profile) {
31353 var residueHash;
31354 var maxCount;
31355 var nongap;
31356 var i;
31357 var j;
31358 var v;
31359 var jSize = sequences.length;
31360 var maxResidue;
31361 var c = '-';
31362 var percentage;
31363 var values =  Clazz_newIntArray (255, 0);
31364 var seq;
31365 for (i = start; i < end; i++) {
31366 residueHash =  new java.util.Hashtable ();
31367 maxCount = 0;
31368 maxResidue = "";
31369 nongap = 0;
31370 values =  Clazz_newIntArray (255, 0);
31371 for (j = 0; j < jSize; j++) {
31372 if (sequences[j] == null) {
31373 System.err.println ("WARNING: Consensus skipping null sequence - possible race condition.");
31374 continue;
31375 }seq = sequences[j].getSequence ();
31376 if (seq.length > i) {
31377 c = seq[i];
31378 if (c == '.' || c == ' ') {
31379 c = '-';
31380 }if (c == '-') {
31381 values['-'.charCodeAt (0)]++;
31382 continue;
31383 } else if ('a' <= c && c <= 'z') {
31384 c = String.fromCharCode (c.charCodeAt (0) + -32);
31385 }nongap++;
31386 values[c.charCodeAt (0)]++;
31387 } else {
31388 values['-'.charCodeAt (0)]++;
31389 }}
31390 if (jSize == 1) {
31391 maxResidue = String.valueOf (c);
31392 maxCount = 1;
31393 } else {
31394 for (v = 65; v <= 90; v++) {
31395 if (values[v] < 1 || values[v] < maxCount) {
31396 continue;
31397 }if (values[v] > maxCount) {
31398 maxResidue = jalview.analysis.AAFrequency.CHARS[v - 65];
31399 } else if (values[v] == maxCount) {
31400 maxResidue += jalview.analysis.AAFrequency.CHARS[v - 65];
31401 }maxCount = values[v];
31402 }
31403 }if (maxResidue.length == 0) {
31404 maxResidue = "-";
31405 }if (profile) {
31406 residueHash.put ("P",  Clazz_newArray (-1, [values,  Clazz_newIntArray (-1, [jSize, nongap])]));
31407 }residueHash.put ("C",  new Integer (maxCount));
31408 residueHash.put ("R", maxResidue);
31409 percentage = (maxCount * 100) / jSize;
31410 residueHash.put ("G",  new Float (percentage));
31411 if (nongap > 0) {
31412 percentage = (maxCount * 100) / nongap;
31413 }residueHash.put ("N",  new Float (percentage));
31414 result[i] = residueHash;
31415 }
31416 }, "~A,~N,~N,~A,~B");
31417 c$.completeConsensus = Clazz_defineMethod (c$, "completeConsensus", 
31418 function (consensus, hconsensus, iStart, width, ignoreGapsInConsensusCalculation, includeAllConsSymbols, nseq) {
31419 jalview.analysis.AAFrequency.completeConsensus (consensus, hconsensus, iStart, width, ignoreGapsInConsensusCalculation, includeAllConsSymbols, null, nseq);
31420 }, "jalview.datamodel.AlignmentAnnotation,~A,~N,~N,~B,~B,~N");
31421 c$.completeConsensus = Clazz_defineMethod (c$, "completeConsensus", 
31422 function (consensus, hconsensus, iStart, width, ignoreGapsInConsensusCalculation, includeAllConsSymbols, alphabet, nseq) {
31423 if (consensus == null || consensus.annotations == null || consensus.annotations.length < width) {
31424 return;
31425 }var fmt = jalview.analysis.AAFrequency.getPercentageFormat (nseq);
31426 for (var i = iStart; i < width; i++) {
31427 var hci;
31428 if (i >= hconsensus.length || ((hci = hconsensus[i]) == null)) {
31429 consensus.annotations[i] = null;
31430 continue;
31431 }var fv = hci.get (ignoreGapsInConsensusCalculation ? "N" : "G");
31432 if (fv == null) {
31433 consensus.annotations[i] = null;
31434 continue;
31435 }var value = fv.floatValue ();
31436 var maxRes = hci.get ("R").toString ();
31437 var mouseOver =  new StringBuilder (64);
31438 if (maxRes.length > 1) {
31439 mouseOver.append ("[").append (maxRes).append ("] ");
31440 maxRes = "+";
31441 } else {
31442 mouseOver.append (hci.get ("R") + " ");
31443 }var profile = hci.get ("P");
31444 if (profile != null && includeAllConsSymbols) {
31445 var sequenceCount = profile[1][0];
31446 var nonGappedCount = profile[1][1];
31447 var normalisedBy = ignoreGapsInConsensusCalculation ? nonGappedCount : sequenceCount;
31448 mouseOver.setLength (0);
31449 if (alphabet != null) {
31450 for (var c = 0; c < alphabet.length; c++) {
31451 var tval = profile[0][alphabet[c].charCodeAt (0)] * 100 / normalisedBy;
31452 mouseOver.append (((c == 0) ? "" : "; ")).append (alphabet[c]).append (" ").append (((fmt != null) ? fmt.formDouble (tval) : (Clazz_floatToInt (tval)))).append ("%");
31453 }
31454 } else {
31455 var ca =  Clazz_newCharArray (profile[0].length, '\0');
31456 var vl =  Clazz_newFloatArray (profile[0].length, 0);
31457 for (var c = 0; c < ca.length; c++) {
31458 ca[c] = String.fromCharCode (c);
31459 vl[c] = profile[0][c];
31460 }
31461 jalview.util.QuickSort.sortFloatChar (vl, ca);
31462 for (var p = 0, c = ca.length - 1; profile[0][ca[c].charCodeAt (0)] > 0; c--) {
31463 var residue = ca[c];
31464 if (residue != '-') {
31465 var tval = profile[0][residue.charCodeAt (0)] * 100 / normalisedBy;
31466 mouseOver.append ((((p == 0) ? "" : "; "))).append (residue).append (" ").append (((fmt != null) ? fmt.formDouble (tval) : (Clazz_floatToInt (tval)))).append ("%");
31467 p++;
31468 }}
31469 }} else {
31470 mouseOver.append ((((fmt != null) ? fmt.formDouble (value) : (Clazz_floatToInt (value))))).append ("%");
31471 }consensus.annotations[i] =  new jalview.datamodel.Annotation (maxRes, mouseOver.toString (), ' ', value);
31472 }
31473 }, "jalview.datamodel.AlignmentAnnotation,~A,~N,~N,~B,~B,~A,~N");
31474 c$.getPercentageFormat = Clazz_defineMethod (c$, "getPercentageFormat", 
31475 function (nseq) {
31476 var scale = 0;
31477 while (nseq >= 10) {
31478 scale++;
31479 nseq /= 10;
31480 }
31481 return scale <= 1 ? null :  new jalview.util.Format ("%3." + (scale - 1) + "f");
31482 }, "~N");
31483 c$.extractProfile = Clazz_defineMethod (c$, "extractProfile", 
31484 function (hconsensus, ignoreGaps) {
31485 var rtnval =  Clazz_newIntArray (64, 0);
31486 var profile = hconsensus.get ("P");
31487 if (profile == null) {
31488 return null;
31489 }var ca =  Clazz_newCharArray (profile[0].length, '\0');
31490 var vl =  Clazz_newFloatArray (profile[0].length, 0);
31491 for (var c = 0; c < ca.length; c++) {
31492 ca[c] = String.fromCharCode (c);
31493 vl[c] = profile[0][c];
31494 }
31495 jalview.util.QuickSort.sortFloatChar (vl, ca);
31496 var nextArrayPos = 2;
31497 var totalPercentage = 0;
31498 var distinctValuesCount = 0;
31499 var divisor = profile[1][ignoreGaps ? 1 : 0];
31500 for (var c = ca.length - 1; profile[0][ca[c].charCodeAt (0)] > 0; c--) {
31501 if (ca[c] != '-') {
31502 rtnval[nextArrayPos++] = (ca[c]).charCodeAt (0);
31503 var percentage = Clazz_floatToInt (profile[0][ca[c].charCodeAt (0)] * 100 / divisor);
31504 rtnval[nextArrayPos++] = percentage;
31505 totalPercentage += percentage;
31506 distinctValuesCount++;
31507 }}
31508 rtnval[0] = distinctValuesCount;
31509 rtnval[1] = totalPercentage;
31510 var result =  Clazz_newIntArray (rtnval.length + 1, 0);
31511 result[0] = 0;
31512 System.arraycopy (rtnval, 0, result, 1, rtnval.length);
31513 return result;
31514 }, "java.util.Hashtable,~B");
31515 c$.extractCdnaProfile = Clazz_defineMethod (c$, "extractCdnaProfile", 
31516 function (hashtable, ignoreGaps) {
31517 var codonCounts = hashtable.get ("P");
31518 var sortedCounts =  Clazz_newIntArray (codonCounts.length - 2, 0);
31519 System.arraycopy (codonCounts, 2, sortedCounts, 0, codonCounts.length - 2);
31520 var result =  Clazz_newIntArray (3 + 2 * sortedCounts.length, 0);
31521 result[0] = 2;
31522 var codons =  Clazz_newCharArray (sortedCounts.length, '\0');
31523 for (var i = 0; i < codons.length; i++) {
31524 codons[i] = String.fromCharCode (i);
31525 }
31526 jalview.util.QuickSort.sortIntChar (sortedCounts, codons);
31527 var totalPercentage = 0;
31528 var distinctValuesCount = 0;
31529 var j = 3;
31530 var divisor = ignoreGaps ? codonCounts[1] : codonCounts[0];
31531 for (var i = codons.length - 1; i >= 0; i--) {
31532 var codonCount = sortedCounts[i];
31533 if (codonCount == 0) {
31534 break;
31535 }distinctValuesCount++;
31536 result[j++] = (codons[i]).charCodeAt (0);
31537 var percentage = Clazz_doubleToInt (codonCount * 100 / divisor);
31538 result[j++] = percentage;
31539 totalPercentage += percentage;
31540 }
31541 result[2] = totalPercentage;
31542 result[1] = distinctValuesCount;
31543 return java.util.Arrays.copyOfRange (result, 0, j);
31544 }, "java.util.Hashtable,~B");
31545 c$.calculateCdna = Clazz_defineMethod (c$, "calculateCdna", 
31546 function (alignment, mappings, hconsensus, col0, col1) {
31547 var gapCharacter = alignment.getGapCharacter ();
31548 for (var col = col0; col < col1; col++) {
31549 var columnHash =  new java.util.Hashtable ();
31550 var codonCounts =  Clazz_newIntArray (66, 0);
31551 codonCounts[0] = alignment.getSequences ().size ();
31552 var ungappedCount = 0;
31553 for (var seq, $seq = alignment.getSequences ().iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
31554 if (seq.getCharAt (col) == gapCharacter) {
31555 continue;
31556 }var codon = jalview.util.MappingUtils.findCodonFor (seq, col, mappings);
31557 var codonEncoded = jalview.analysis.CodingUtils.encodeCodon (codon);
31558 if (codonEncoded >= 0) {
31559 codonCounts[codonEncoded + 2]++;
31560 ungappedCount++;
31561 }}
31562 codonCounts[1] = ungappedCount;
31563 columnHash.put ("P", codonCounts);
31564 hconsensus[col] = columnHash;
31565 }
31566 }, "jalview.datamodel.AlignmentI,java.util.Set,~A,~N,~N");
31567 c$.completeCdnaConsensus = Clazz_defineMethod (c$, "completeCdnaConsensus", 
31568 function (consensusAnnotation, consensusData, showProfileLogo, nseqs) {
31569 if (consensusAnnotation == null || consensusAnnotation.annotations == null || consensusAnnotation.annotations.length < consensusData.length) {
31570 return;
31571 }consensusAnnotation.scaleColLabel = true;
31572 for (var col = 0; col < consensusData.length; col++) {
31573 var hci = consensusData[col];
31574 if (hci == null) {
31575 continue;
31576 }var codonCounts = hci.get ("P");
31577 var totalCount = 0;
31578 var codons =  Clazz_newCharArray (codonCounts.length - 2, '\0');
31579 for (var j = 2; j < codonCounts.length; j++) {
31580 var codonCount = codonCounts[j];
31581 codons[j - 2] = String.fromCharCode (j - 2);
31582 totalCount += codonCount;
31583 }
31584 var sortedCodonCounts =  Clazz_newIntArray (codonCounts.length - 2, 0);
31585 System.arraycopy (codonCounts, 2, sortedCodonCounts, 0, codonCounts.length - 2);
31586 jalview.util.QuickSort.sortIntChar (sortedCodonCounts, codons);
31587 var modalCodonEncoded = (codons[codons.length - 1]).charCodeAt (0);
31588 var modalCodonCount = sortedCodonCounts[codons.length - 1];
31589 var modalCodon = String.valueOf (jalview.analysis.CodingUtils.decodeCodon (modalCodonEncoded));
31590 if (sortedCodonCounts.length > 1 && sortedCodonCounts[codons.length - 2] == modalCodonEncoded) {
31591 modalCodon = "+";
31592 }var pid = sortedCodonCounts[sortedCodonCounts.length - 1] * 100 / totalCount;
31593 var mouseOver =  new StringBuilder (32);
31594 var samePercent =  new StringBuilder ();
31595 var percent = null;
31596 var lastPercent = null;
31597 var fmt = jalview.analysis.AAFrequency.getPercentageFormat (nseqs);
31598 for (var j = codons.length - 1; j >= 0; j--) {
31599 var codonCount = sortedCodonCounts[j];
31600 if (codonCount == 0) {
31601 if (samePercent.length () > 0) {
31602 mouseOver.append (samePercent).append (": ").append (percent).append ("% ");
31603 }break;
31604 }var codonEncoded = (codons[j]).charCodeAt (0);
31605 var pct = Clazz_doubleToInt (codonCount * 100 / totalCount);
31606 var codon = String.valueOf (jalview.analysis.CodingUtils.decodeCodon (codonEncoded));
31607 percent = fmt == null ? Integer.toString (pct) : fmt.formLong (pct);
31608 if (showProfileLogo || codonCount == modalCodonCount) {
31609 if (percent.equals (lastPercent) && j > 0) {
31610 samePercent.append (samePercent.length () == 0 ? "" : ", ");
31611 samePercent.append (codon);
31612 } else {
31613 if (samePercent.length () > 0) {
31614 mouseOver.append (samePercent).append (": ").append (lastPercent).append ("% ");
31615 }samePercent.setLength (0);
31616 samePercent.append (codon);
31617 }lastPercent = percent;
31618 }}
31619 consensusAnnotation.annotations[col] =  new jalview.datamodel.Annotation (modalCodon, mouseOver.toString (), ' ', pid);
31620 }
31621 }, "jalview.datamodel.AlignmentAnnotation,~A,~B,~N");
31622 Clazz_defineStatics (c$,
31623 "TO_UPPER_CASE", -32,
31624 "MAXCOUNT", "C",
31625 "MAXRESIDUE", "R",
31626 "PID_GAPS", "G",
31627 "PID_NOGAPS", "N",
31628 "PROFILE", "P",
31629 "ENCODED_CHARS", "E");
31630 c$.CHARS = c$.prototype.CHARS =  new Array (26);
31631 {
31632 for (var c = 'A'; c <= 'Z'; c = String.fromCharCode (c.charCodeAt (0) + 1)) {
31633 jalview.analysis.AAFrequency.CHARS[c.charCodeAt (0) - 65] = String.valueOf (c);
31634 }
31635 }});
31636 Clazz_declarePackage ("jalview.analysis");
31637 c$ = Clazz_declareType (jalview.analysis, "CodingUtils");
31638 c$.encodeCodon = Clazz_defineMethod (c$, "encodeCodon", 
31639 function (codon) {
31640 if (codon == null) {
31641 return -1;
31642 }return jalview.analysis.CodingUtils.encodeCodon (codon[2]) + (jalview.analysis.CodingUtils.encodeCodon (codon[1]) << 2) + (jalview.analysis.CodingUtils.encodeCodon (codon[0]) << (4));
31643 }, "~A");
31644 c$.encodeCodon = Clazz_defineMethod (c$, "encodeCodon", 
31645 function (c) {
31646 var result = -2147483648;
31647 switch (c) {
31648 case 'A':
31649 case 'a':
31650 result = 0;
31651 break;
31652 case 'C':
31653 case 'c':
31654 result = 1;
31655 break;
31656 case 'G':
31657 case 'g':
31658 result = 2;
31659 break;
31660 case 'T':
31661 case 't':
31662 case 'U':
31663 case 'u':
31664 result = 3;
31665 break;
31666 }
31667 return result;
31668 }, "~S");
31669 c$.decodeCodon = Clazz_defineMethod (c$, "decodeCodon", 
31670 function (encoded) {
31671 var result =  Clazz_newCharArray (3, '\0');
31672 result[2] = jalview.analysis.CodingUtils.decodeNucleotide (encoded & 3);
31673 encoded = encoded >>> 2;
31674 result[1] = jalview.analysis.CodingUtils.decodeNucleotide (encoded & 3);
31675 encoded = encoded >>> 2;
31676 result[0] = jalview.analysis.CodingUtils.decodeNucleotide (encoded & 3);
31677 return result;
31678 }, "~N");
31679 c$.decodeNucleotide = Clazz_defineMethod (c$, "decodeNucleotide", 
31680 function (i) {
31681 var result = '0';
31682 switch (i) {
31683 case 0:
31684 result = 'A';
31685 break;
31686 case 1:
31687 result = 'C';
31688 break;
31689 case 2:
31690 result = 'G';
31691 break;
31692 case 3:
31693 result = 'T';
31694 break;
31695 }
31696 return result;
31697 }, "~N");
31698 Clazz_defineStatics (c$,
31699 "CODON_ENCODING_BITSHIFT", 2);
31700 Clazz_declarePackage ("jalview.analysis");
31701 Clazz_load (null, "jalview.analysis.Conservation", ["jalview.datamodel.Annotation", "$.Sequence", "jalview.schemes.ResidueProperties", "jalview.util.Comparison", "java.awt.Color", "java.lang.Character", "$.Double", "$.StringBuffer", "java.util.Hashtable", "$.Vector"], function () {
31702 c$ = Clazz_decorateAsClass (function () {
31703 this.sequences = null;
31704 this.start = 0;
31705 this.end = 0;
31706 this.seqNums = null;
31707 this.maxLength = 0;
31708 this.seqNumsChanged = false;
31709 this.total = null;
31710 this.canonicaliseAa = true;
31711 this.quality = null;
31712 this.qualityRange = null;
31713 this.consString = "";
31714 this.consSequence = null;
31715 this.propHash = null;
31716 this.threshold = 0;
31717 this.name = "";
31718 this.cons2 = null;
31719 this.consSymbs = null;
31720 Clazz_instantialize (this, arguments);
31721 }, jalview.analysis, "Conservation");
31722 Clazz_prepareFields (c$, function () {
31723 this.qualityRange =  new Array (2);
31724 });
31725 Clazz_makeConstructor (c$, 
31726 function (name, propHash, threshold, sequences, start, end) {
31727 this.name = name;
31728 this.propHash = propHash;
31729 this.threshold = threshold;
31730 this.start = start;
31731 this.end = end;
31732 this.maxLength = end - start + 1;
31733 var s;
31734 var sSize = sequences.size ();
31735 var sarray =  new Array (sSize);
31736 this.sequences = sarray;
31737 try {
31738 for (s = 0; s < sSize; s++) {
31739 sarray[s] = sequences.get (s);
31740 if (sarray[s].getLength () > this.maxLength) {
31741 this.maxLength = sarray[s].getLength ();
31742 }}
31743 } catch (ex) {
31744 if (Clazz_exceptionOf (ex, ArrayIndexOutOfBoundsException)) {
31745 this.sequences =  new Array (0);
31746 this.maxLength = 0;
31747 } else {
31748 throw ex;
31749 }
31750 }
31751 }, "~S,java.util.Hashtable,~N,java.util.List,~N,~N");
31752 Clazz_defineMethod (c$, "calcSeqNum", 
31753  function (i) {
31754 var sq = null;
31755 var sqnum = null;
31756 var sSize = this.sequences.length;
31757 if ((i > -1) && (i < sSize)) {
31758 sq = this.sequences[i].getSequenceAsString ();
31759 if (this.seqNums.size () <= i) {
31760 this.seqNums.addElement ( Clazz_newIntArray (sq.length + 1, 0));
31761 }if (sq.hashCode () != (this.seqNums.elementAt (i))[0]) {
31762 var j;
31763 var len;
31764 this.seqNumsChanged = true;
31765 len = sq.length;
31766 if (this.maxLength < len) {
31767 this.maxLength = len;
31768 }sqnum =  Clazz_newIntArray (len + 1, 0);
31769 sqnum[0] = sq.hashCode ();
31770 for (j = 1; j <= len; j++) {
31771 sqnum[j] = jalview.schemes.ResidueProperties.aaIndex[sq.charCodeAt (j - 1)];
31772 }
31773 this.seqNums.setElementAt (sqnum, i);
31774 } else {
31775 System.out.println ("SEQUENCE HAS BEEN DELETED!!!");
31776 }} else {
31777 System.err.println ("ERROR: calcSeqNum called with out of range sequence index for Alignment\n");
31778 }}, "~N");
31779 Clazz_defineMethod (c$, "calculate", 
31780 function () {
31781 var resultHash;
31782 var ht;
31783 var thresh;
31784 var j;
31785 var jSize = this.sequences.length;
31786 var values;
31787 var type;
31788 var res = null;
31789 var c;
31790 var enumeration2;
31791 this.total =  new Array (this.maxLength);
31792 for (var i = this.start; i <= this.end; i++) {
31793 values =  Clazz_newIntArray (255, 0);
31794 for (j = 0; j < jSize; j++) {
31795 if (this.sequences[j].getLength () > i) {
31796 c = this.sequences[j].getCharAt (i);
31797 if (this.canonicaliseAa) {
31798 c = String.fromCharCode (jalview.schemes.ResidueProperties.aaIndex[this.sequences[j].getCharAt (i).charCodeAt (0)]);
31799 if (c.charCodeAt (0) > 20) {
31800 c = '-';
31801 } else {
31802 c = jalview.schemes.ResidueProperties.aa[c.charCodeAt (0)].charAt (0);
31803 }} else {
31804 if (c == '.' || c == ' ') {
31805 c = '-';
31806 }if (!this.canonicaliseAa && 'a' <= c && c <= 'z') {
31807 c = String.fromCharCode (c.charCodeAt (0) - (32));
31808 }}values[c.charCodeAt (0)]++;
31809 } else {
31810 values['-'.charCodeAt (0)]++;
31811 }}
31812 thresh = Clazz_doubleToInt ((this.threshold * (jSize)) / 100);
31813 resultHash =  new java.util.Hashtable ();
31814 for (var v = '-'; v < 'Z'; v = String.fromCharCode (v.charCodeAt (0) + 1)) {
31815 if (values[v.charCodeAt (0)] > thresh) {
31816 res = String.valueOf (v);
31817 enumeration2 = this.propHash.keys ();
31818 while (enumeration2.hasMoreElements ()) {
31819 type = enumeration2.nextElement ();
31820 ht = this.propHash.get (type);
31821 if (!resultHash.containsKey (type)) {
31822 if (ht.containsKey (res)) {
31823 resultHash.put (type, ht.get (res));
31824 } else {
31825 resultHash.put (type, ht.get ("-"));
31826 }} else if ((resultHash.get (type)).equals (ht.get (res)) == false) {
31827 resultHash.put (type,  new Integer (-1));
31828 }}
31829 }}
31830 if (this.total.length > 0) {
31831 this.total[i - this.start] = resultHash;
31832 }}
31833 });
31834 Clazz_defineMethod (c$, "countConsNGaps", 
31835 function (j) {
31836 var count = 0;
31837 var cons = 0;
31838 var nres = 0;
31839 var r =  Clazz_newIntArray (2, 0);
31840 var f = '$';
31841 var i;
31842 var iSize = this.sequences.length;
31843 var c;
31844 for (i = 0; i < iSize; i++) {
31845 if (j >= this.sequences[i].getLength ()) {
31846 count++;
31847 continue;
31848 }c = this.sequences[i].getCharAt (j);
31849 if (jalview.util.Comparison.isGap ((c))) {
31850 count++;
31851 } else {
31852 nres++;
31853 if (nres == 1) {
31854 f = c;
31855 cons++;
31856 } else if (f == c) {
31857 cons++;
31858 }}}
31859 r[0] = (nres == cons) ? 1 : 0;
31860 r[1] = count;
31861 return r;
31862 }, "~N");
31863 Clazz_defineMethod (c$, "verdict", 
31864 function (consflag, percentageGaps) {
31865 var consString =  new StringBuffer ();
31866 var type;
31867 var result;
31868 var gapcons;
31869 var totGaps;
31870 var count;
31871 var pgaps;
31872 var resultHash;
31873 var enumeration;
31874 for (var i = 0; i < this.start; i++) {
31875 consString.append ('-');
31876 }
31877 this.consSymbs =  new Array (this.end - this.start + 1);
31878 for (var i = this.start; i <= this.end; i++) {
31879 gapcons = this.countConsNGaps (i);
31880 totGaps = gapcons[1];
31881 pgaps = (totGaps * 100) / this.sequences.length;
31882 this.consSymbs[i - this.start] =  String.instantialize ();
31883 if (percentageGaps > pgaps) {
31884 resultHash = this.total[i - this.start];
31885 count = 0;
31886 enumeration = resultHash.keys ();
31887 while (enumeration.hasMoreElements ()) {
31888 type = enumeration.nextElement ();
31889 result = resultHash.get (type);
31890 if (consflag) {
31891 if (result.intValue () == 1) {
31892 this.consSymbs[i - this.start] = type + " " + this.consSymbs[i - this.start];
31893 count++;
31894 }} else {
31895 if (result.intValue () != -1) {
31896 {
31897 if (result.intValue () == 0) {
31898 this.consSymbs[i - this.start] = this.consSymbs[i - this.start] + " !" + type;
31899 } else {
31900 this.consSymbs[i - this.start] = type + " " + this.consSymbs[i - this.start];
31901 }}count++;
31902 }}}
31903 if (count < 10) {
31904 consString.append ("" + count);
31905 } else {
31906 consString.append ((gapcons[0] == 1) ? "*" : "+");
31907 }} else {
31908 consString.append ('-');
31909 }}
31910 this.consSequence =  new jalview.datamodel.Sequence (this.name, consString.toString (), this.start, this.end);
31911 }, "~B,~N");
31912 Clazz_defineMethod (c$, "getConsSequence", 
31913 function () {
31914 return this.consSequence;
31915 });
31916 Clazz_defineMethod (c$, "findQuality", 
31917 function () {
31918 this.findQuality (0, this.maxLength - 1);
31919 });
31920 Clazz_defineMethod (c$, "percentIdentity2", 
31921  function () {
31922 this.seqNums =  new java.util.Vector ();
31923 var i = 0;
31924 var iSize = this.sequences.length;
31925 for (i = 0; i < iSize; i++) {
31926 this.calcSeqNum (i);
31927 }
31928 if ((this.cons2 == null) || this.seqNumsChanged) {
31929 this.cons2 =  Clazz_newIntArray (this.maxLength, 24, 0);
31930 for (var j = 0; j < 24; j++) {
31931 for (i = 0; i < this.maxLength; i++) {
31932 this.cons2[i][j] = 0;
31933 }
31934 }
31935 var sqnum;
31936 var j = 0;
31937 while (j < this.sequences.length) {
31938 sqnum = this.seqNums.elementAt (j);
31939 for (i = 1; i < sqnum.length; i++) {
31940 this.cons2[i - 1][sqnum[i]]++;
31941 }
31942 for (i = sqnum.length - 1; i < this.maxLength; i++) {
31943 this.cons2[i][23]++;
31944 }
31945 j++;
31946 }
31947 }});
31948 Clazz_defineMethod (c$, "findQuality", 
31949 function (start, end) {
31950 this.quality =  new java.util.Vector ();
31951 var max = -10000;
31952 var BLOSUM62 = jalview.schemes.ResidueProperties.getBLOSUM62 ();
31953 this.percentIdentity2 ();
31954 var size = this.seqNums.size ();
31955 var lengths =  Clazz_newIntArray (size, 0);
31956 var tot;
31957 var bigtot;
31958 var sr;
31959 var tmp;
31960 var x;
31961 var xx;
31962 var l;
31963 var j;
31964 var i;
31965 var ii;
31966 var i2;
31967 var k;
31968 var seqNum;
31969 for (l = 0; l < size; l++) {
31970 lengths[l] = (this.seqNums.elementAt (l)).length - 1;
31971 }
31972 for (j = start; j <= end; j++) {
31973 bigtot = 0;
31974 x =  Clazz_newDoubleArray (24, 0);
31975 for (ii = 0; ii < 24; ii++) {
31976 x[ii] = 0;
31977 for (i2 = 0; i2 < 24; i2++) {
31978 x[ii] += ((this.cons2[j][i2] * BLOSUM62[ii][i2]) + 4);
31979 }
31980 x[ii] /= size;
31981 }
31982 for (k = 0; k < size; k++) {
31983 tot = 0;
31984 xx =  Clazz_newDoubleArray (24, 0);
31985 seqNum = (j < lengths[k]) ? (this.seqNums.elementAt (k))[j + 1] : 23;
31986 for (i = 0; i < 23; i++) {
31987 sr = 0;
31988 sr = BLOSUM62[i][seqNum] + 4;
31989 xx[i] = x[i] - sr;
31990 tot += (xx[i] * xx[i]);
31991 }
31992 bigtot += Math.sqrt (tot);
31993 }
31994 if (max < bigtot) {
31995 max = bigtot;
31996 }this.quality.addElement ( new Double (bigtot));
31997 }
31998 var newmax = -10000;
31999 for (j = start; j <= end; j++) {
32000 tmp = (this.quality.elementAt (j)).doubleValue ();
32001 tmp = ((max - tmp) * (size - this.cons2[j][23])) / size;
32002 this.quality.setElementAt ( new Double (tmp), j);
32003 if (tmp > newmax) {
32004 newmax = tmp;
32005 }}
32006 this.qualityRange[0] =  new Double (0);
32007 this.qualityRange[1] =  new Double (newmax);
32008 }, "~N,~N");
32009 Clazz_defineMethod (c$, "completeAnnotations", 
32010 function (conservation, quality2, istart, alWidth) {
32011 var sequence = this.getConsSequence ().getSequence ();
32012 var minR;
32013 var minG;
32014 var minB;
32015 var maxR;
32016 var maxG;
32017 var maxB;
32018 minR = 0.3;
32019 minG = 0.0;
32020 minB = 0;
32021 maxR = 1.0 - minR;
32022 maxG = 0.9 - minG;
32023 maxB = 0 - minB;
32024 var min = 0;
32025 var max = 11;
32026 var qmin = 0;
32027 var qmax = 0;
32028 var c;
32029 if (conservation.annotations != null && conservation.annotations.length < alWidth) {
32030 conservation.annotations =  new Array (alWidth);
32031 }if (quality2 != null) {
32032 quality2.graphMax = this.qualityRange[1].floatValue ();
32033 if (quality2.annotations != null && quality2.annotations.length < alWidth) {
32034 quality2.annotations =  new Array (alWidth);
32035 }qmin = this.qualityRange[0].floatValue ();
32036 qmax = this.qualityRange[1].floatValue ();
32037 }for (var i = 0; i < alWidth; i++) {
32038 var value = 0;
32039 c = sequence[i];
32040 if (Character.isDigit (c)) {
32041 value = c.charCodeAt (0) - 48;
32042 } else if (c == '*') {
32043 value = 11;
32044 } else if (c == '+') {
32045 value = 10;
32046 }var vprop = value - min;
32047 vprop /= max;
32048 conservation.annotations[i] =  new jalview.datamodel.Annotation (String.valueOf (c), this.consSymbs[i - this.start], ' ', value,  new java.awt.Color (minR + (maxR * vprop), minG + (maxG * vprop), minB + (maxB * vprop)));
32049 if (quality2 != null) {
32050 value = (this.quality.elementAt (i)).floatValue ();
32051 vprop = value - qmin;
32052 vprop /= qmax;
32053 quality2.annotations[i] =  new jalview.datamodel.Annotation (" ", String.valueOf (value), ' ', value,  new java.awt.Color (minR + (maxR * vprop), minG + (maxG * vprop), minB + (maxB * vprop)));
32054 }}
32055 }, "jalview.datamodel.AlignmentAnnotation,jalview.datamodel.AlignmentAnnotation,~N,~N");
32056 c$.calculateConservation = Clazz_defineMethod (c$, "calculateConservation", 
32057 function (name, consHash, threshold, seqs, start, end, posOrNeg, consPercGaps, calcQuality) {
32058 var cons =  new jalview.analysis.Conservation (name, consHash, threshold, seqs, start, end);
32059 return jalview.analysis.Conservation.calculateConservation (cons, posOrNeg, consPercGaps, calcQuality);
32060 }, "~S,java.util.Hashtable,~N,java.util.List,~N,~N,~B,~N,~B");
32061 c$.calculateConservation = Clazz_defineMethod (c$, "calculateConservation", 
32062 function (cons, b, consPercGaps, calcQuality) {
32063 cons.calculate ();
32064 cons.verdict (b, consPercGaps);
32065 if (calcQuality) {
32066 cons.findQuality ();
32067 }return cons;
32068 }, "jalview.analysis.Conservation,~B,~N,~B");
32069 });
32070 Clazz_declarePackage ("jalview.datamodel");
32071 Clazz_load (["jalview.datamodel.AlignmentI", "$.HiddenSequences", "java.util.ArrayList", "$.Collections", "$.LinkedHashSet"], "jalview.datamodel.Alignment", ["jalview.analysis.AlignmentUtils", "jalview.datamodel.AlignmentAnnotation", "$.CigarArray", "$.SeqCigar", "$.Sequence", "jalview.util.Comparison", "$.MessageManager", "java.lang.Error", "java.util.HashSet", "$.Hashtable", "$.Vector"], function () {
32072 c$ = Clazz_decorateAsClass (function () {
32073 this.dataset = null;
32074 this.sequences = null;
32075 this.groups = null;
32076 this.gapCharacter = '-';
32077 this.type = 1;
32078 this.$hasRNAStructure = false;
32079 this.annotations = null;
32080 this.hiddenSequences = null;
32081 this.alignmentProperties = null;
32082 this.codonFrameList = null;
32083 this.alignmentRefs = 0;
32084 this.seqrep = null;
32085 Clazz_instantialize (this, arguments);
32086 }, jalview.datamodel, "Alignment", null, jalview.datamodel.AlignmentI);
32087 Clazz_prepareFields (c$, function () {
32088 this.groups = java.util.Collections.synchronizedList ( new java.util.ArrayList ());
32089 this.hiddenSequences =  new jalview.datamodel.HiddenSequences (this);
32090 this.codonFrameList =  new java.util.LinkedHashSet ();
32091 });
32092 Clazz_defineMethod (c$, "initAlignment", 
32093  function (seqs) {
32094 var i = 0;
32095 if (jalview.util.Comparison.isNucleotide (seqs)) {
32096 this.type = 1;
32097 } else {
32098 this.type = 0;
32099 }this.sequences = java.util.Collections.synchronizedList ( new java.util.ArrayList ());
32100 for (i = 0; i < seqs.length; i++) {
32101 this.sequences.add (seqs[i]);
32102 }
32103 }, "~A");
32104 Clazz_makeConstructor (c$, 
32105 function (al) {
32106 var seqs = al.getSequencesArray ();
32107 for (var i = 0; i < seqs.length; i++) {
32108 seqs[i] =  new jalview.datamodel.Sequence (seqs[i]);
32109 }
32110 this.codonFrameList = (al).codonFrameList;
32111 this.initAlignment (seqs);
32112 }, "jalview.datamodel.AlignmentI");
32113 Clazz_makeConstructor (c$, 
32114 function (seqs) {
32115 this.initAlignment (seqs);
32116 }, "~A");
32117 c$.createAlignment = Clazz_defineMethod (c$, "createAlignment", 
32118 function (compactAlignment) {
32119 throw  new Error (jalview.util.MessageManager.getString ("error.alignment_cigararray_not_implemented"));
32120 }, "jalview.datamodel.CigarArray");
32121 Clazz_defineMethod (c$, "getSequences", 
32122 function () {
32123 return this.sequences;
32124 });
32125 Clazz_defineMethod (c$, "getSequences", 
32126 function (hiddenReps) {
32127 return this.sequences;
32128 }, "java.util.Map");
32129 Clazz_defineMethod (c$, "getSequencesArray", 
32130 function () {
32131 if (this.sequences == null) {
32132 return null;
32133 }{
32134 return this.sequences.toArray ( new Array (this.sequences.size ()));
32135 }});
32136 Clazz_overrideMethod (c$, "getSequencesByName", 
32137 function () {
32138 return jalview.analysis.AlignmentUtils.getSequencesByName (this);
32139 });
32140 Clazz_overrideMethod (c$, "getSequenceAt", 
32141 function (i) {
32142 {
32143 if (i > -1 && i < this.sequences.size ()) {
32144 return this.sequences.get (i);
32145 }}return null;
32146 }, "~N");
32147 Clazz_overrideMethod (c$, "addSequence", 
32148 function (snew) {
32149 if (this.dataset != null) {
32150 if (snew.getDatasetSequence () != null) {
32151 this.getDataset ().addSequence (snew.getDatasetSequence ());
32152 } else {
32153 var adding = snew.deriveSequence ();
32154 this.getDataset ().addSequence (adding.getDatasetSequence ());
32155 snew = adding;
32156 }}if (this.sequences == null) {
32157 this.initAlignment ( Clazz_newArray (-1, [snew]));
32158 } else {
32159 {
32160 this.sequences.add (snew);
32161 }}if (this.hiddenSequences != null) {
32162 this.hiddenSequences.adjustHeightSequenceAdded ();
32163 }}, "jalview.datamodel.SequenceI");
32164 Clazz_overrideMethod (c$, "setSequenceAt", 
32165 function (i, snew) {
32166 {
32167 this.deleteSequence (i);
32168 this.sequences.set (i, snew);
32169 }}, "~N,jalview.datamodel.SequenceI");
32170 Clazz_defineMethod (c$, "getGroups", 
32171 function () {
32172 return this.groups;
32173 });
32174 Clazz_overrideMethod (c$, "finalize", 
32175 function () {
32176 if (this.getDataset () != null) {
32177 this.getDataset ().removeAlignmentRef ();
32178 }this.dataset = null;
32179 this.sequences = null;
32180 this.groups = null;
32181 this.annotations = null;
32182 this.hiddenSequences = null;
32183 });
32184 Clazz_defineMethod (c$, "removeAlignmentRef", 
32185  function () {
32186 if (--this.alignmentRefs == 0) {
32187 this.finalize ();
32188 }});
32189 Clazz_defineMethod (c$, "deleteSequence", 
32190 function (s) {
32191 this.deleteSequence (this.findIndex (s));
32192 }, "jalview.datamodel.SequenceI");
32193 Clazz_defineMethod (c$, "deleteSequence", 
32194 function (i) {
32195 if (i > -1 && i < this.getHeight ()) {
32196 {
32197 this.sequences.remove (i);
32198 this.hiddenSequences.adjustHeightSequenceDeleted (i);
32199 }}}, "~N");
32200 Clazz_overrideMethod (c$, "findGroup", 
32201 function (s) {
32202 {
32203 for (var i = 0; i < this.groups.size (); i++) {
32204 var sg = this.groups.get (i);
32205 if (sg.getSequences (null).contains (s)) {
32206 return sg;
32207 }}
32208 }return null;
32209 }, "jalview.datamodel.SequenceI");
32210 Clazz_overrideMethod (c$, "findAllGroups", 
32211 function (s) {
32212 var temp =  new java.util.ArrayList ();
32213 {
32214 var gSize = this.groups.size ();
32215 for (var i = 0; i < gSize; i++) {
32216 var sg = this.groups.get (i);
32217 if (sg == null || sg.getSequences () == null) {
32218 this.deleteGroup (sg);
32219 gSize--;
32220 continue;
32221 }if (sg.getSequences ().contains (s)) {
32222 temp.add (sg);
32223 }}
32224 }var ret =  new Array (temp.size ());
32225 return temp.toArray (ret);
32226 }, "jalview.datamodel.SequenceI");
32227 Clazz_overrideMethod (c$, "addGroup", 
32228 function (sg) {
32229 {
32230 if (!this.groups.contains (sg)) {
32231 if (this.hiddenSequences.getSize () > 0) {
32232 var i;
32233 var iSize = sg.getSize ();
32234 for (i = 0; i < iSize; i++) {
32235 if (!this.sequences.contains (sg.getSequenceAt (i))) {
32236 sg.deleteSequence (sg.getSequenceAt (i), false);
32237 iSize--;
32238 i--;
32239 }}
32240 if (sg.getSize () < 1) {
32241 return;
32242 }}sg.setContext (this);
32243 this.groups.add (sg);
32244 }}}, "jalview.datamodel.SequenceGroup");
32245 Clazz_defineMethod (c$, "removeAnnotationForGroup", 
32246  function (gp) {
32247 if (this.annotations == null || this.annotations.length == 0) {
32248 return;
32249 }var t;
32250 var todelete =  new Array (this.annotations.length);
32251 var tokeep =  new Array (this.annotations.length);
32252 var i;
32253 var p;
32254 var k;
32255 if (gp == null) {
32256 for (i = 0, p = 0, k = 0; i < this.annotations.length; i++) {
32257 if (this.annotations[i].groupRef != null) {
32258 todelete[p++] = this.annotations[i];
32259 } else {
32260 tokeep[k++] = this.annotations[i];
32261 }}
32262 } else {
32263 for (i = 0, p = 0, k = 0; i < this.annotations.length; i++) {
32264 if (this.annotations[i].groupRef === gp) {
32265 todelete[p++] = this.annotations[i];
32266 } else {
32267 tokeep[k++] = this.annotations[i];
32268 }}
32269 }if (p > 0) {
32270 for (i = 0; i < p; i++) {
32271 this.unhookAnnotation (todelete[i]);
32272 todelete[i] = null;
32273 }
32274 t =  new Array (k);
32275 for (i = 0; i < k; i++) {
32276 t[i] = tokeep[i];
32277 }
32278 this.annotations = t;
32279 }}, "jalview.datamodel.SequenceGroup");
32280 Clazz_overrideMethod (c$, "deleteAllGroups", 
32281 function () {
32282 {
32283 if (this.annotations != null) {
32284 this.removeAnnotationForGroup (null);
32285 }for (var sg, $sg = this.groups.iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
32286 sg.setContext (null);
32287 }
32288 this.groups.clear ();
32289 }});
32290 Clazz_overrideMethod (c$, "deleteGroup", 
32291 function (g) {
32292 {
32293 if (this.groups.contains (g)) {
32294 this.removeAnnotationForGroup (g);
32295 this.groups.remove (g);
32296 g.setContext (null);
32297 }}}, "jalview.datamodel.SequenceGroup");
32298 Clazz_defineMethod (c$, "findName", 
32299 function (name) {
32300 return this.findName (name, false);
32301 }, "~S");
32302 Clazz_defineMethod (c$, "findName", 
32303 function (token, b) {
32304 return this.findName (null, token, b);
32305 }, "~S,~B");
32306 Clazz_defineMethod (c$, "findName", 
32307 function (startAfter, token, b) {
32308 var i = 0;
32309 var sq = null;
32310 var sqname = null;
32311 if (startAfter != null) {
32312 var matched = false;
32313 while (i < this.sequences.size ()) {
32314 if (this.getSequenceAt (i++) === startAfter) {
32315 matched = true;
32316 break;
32317 }}
32318 if (!matched) {
32319 i = 0;
32320 }}while (i < this.sequences.size ()) {
32321 sq = this.getSequenceAt (i);
32322 sqname = sq.getName ();
32323 if (sqname.equals (token) || (b && (sqname.equalsIgnoreCase (token)))) {
32324 return this.getSequenceAt (i);
32325 }i++;
32326 }
32327 return null;
32328 }, "jalview.datamodel.SequenceI,~S,~B");
32329 Clazz_overrideMethod (c$, "findSequenceMatch", 
32330 function (name) {
32331 var matches =  new java.util.Vector ();
32332 var i = 0;
32333 while (i < this.sequences.size ()) {
32334 if (this.getSequenceAt (i).getName ().equals (name)) {
32335 matches.addElement (this.getSequenceAt (i));
32336 }i++;
32337 }
32338 var result =  new Array (matches.size ());
32339 for (i = 0; i < result.length; i++) {
32340 result[i] = matches.elementAt (i);
32341 }
32342 return result;
32343 }, "~S");
32344 Clazz_defineMethod (c$, "findIndex", 
32345 function (s) {
32346 var i = 0;
32347 while (i < this.sequences.size ()) {
32348 if (s === this.getSequenceAt (i)) {
32349 return i;
32350 }i++;
32351 }
32352 return -1;
32353 }, "jalview.datamodel.SequenceI");
32354 Clazz_defineMethod (c$, "findIndex", 
32355 function (results) {
32356 var i = 0;
32357 while (i < this.sequences.size ()) {
32358 if (results.involvesSequence (this.getSequenceAt (i))) {
32359 return i;
32360 }i++;
32361 }
32362 return -1;
32363 }, "jalview.datamodel.SearchResults");
32364 Clazz_overrideMethod (c$, "getHeight", 
32365 function () {
32366 return this.sequences.size ();
32367 });
32368 Clazz_overrideMethod (c$, "getWidth", 
32369 function () {
32370 var maxLength = -1;
32371 for (var i = 0; i < this.sequences.size (); i++) {
32372 if (this.getSequenceAt (i).getLength () > maxLength) {
32373 maxLength = this.getSequenceAt (i).getLength ();
32374 }}
32375 return maxLength;
32376 });
32377 Clazz_overrideMethod (c$, "setGapCharacter", 
32378 function (gc) {
32379 this.gapCharacter = gc;
32380 {
32381 for (var seq, $seq = this.sequences.iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
32382 seq.setSequence (seq.getSequenceAsString ().$replace ('.', gc).$replace ('-', gc).$replace (' ', gc));
32383 }
32384 }}, "~S");
32385 Clazz_defineMethod (c$, "getGapCharacter", 
32386 function () {
32387 return this.gapCharacter;
32388 });
32389 Clazz_defineMethod (c$, "isAligned", 
32390 function () {
32391 return this.isAligned (false);
32392 });
32393 Clazz_defineMethod (c$, "isAligned", 
32394 function (includeHidden) {
32395 var width = this.getWidth ();
32396 if (this.hiddenSequences == null || this.hiddenSequences.getSize () == 0) {
32397 includeHidden = true;
32398 }for (var i = 0; i < this.sequences.size (); i++) {
32399 if (includeHidden || !this.hiddenSequences.isHidden (this.getSequenceAt (i))) {
32400 if (this.getSequenceAt (i).getLength () != width) {
32401 return false;
32402 }}}
32403 return true;
32404 }, "~B");
32405 Clazz_overrideMethod (c$, "deleteAllAnnotations", 
32406 function (includingAutoCalculated) {
32407 var result = false;
32408 for (var alan, $alan = 0, $$alan = this.getAlignmentAnnotation (); $alan < $$alan.length && ((alan = $$alan[$alan]) || true); $alan++) {
32409 if (!alan.autoCalculated || includingAutoCalculated) {
32410 this.deleteAnnotation (alan);
32411 result = true;
32412 }}
32413 return result;
32414 }, "~B");
32415 Clazz_defineMethod (c$, "deleteAnnotation", 
32416 function (aa) {
32417 return this.deleteAnnotation (aa, true);
32418 }, "jalview.datamodel.AlignmentAnnotation");
32419 Clazz_defineMethod (c$, "deleteAnnotation", 
32420 function (aa, unhook) {
32421 var aSize = 1;
32422 if (this.annotations != null) {
32423 aSize = this.annotations.length;
32424 }if (aSize < 1) {
32425 return false;
32426 }var temp =  new Array (aSize - 1);
32427 var swap = false;
32428 var tIndex = 0;
32429 for (var i = 0; i < aSize; i++) {
32430 if (this.annotations[i] === aa) {
32431 swap = true;
32432 continue;
32433 }if (tIndex < temp.length) {
32434 temp[tIndex++] = this.annotations[i];
32435 }}
32436 if (swap) {
32437 this.annotations = temp;
32438 if (unhook) {
32439 this.unhookAnnotation (aa);
32440 }}return swap;
32441 }, "jalview.datamodel.AlignmentAnnotation,~B");
32442 Clazz_defineMethod (c$, "unhookAnnotation", 
32443  function (aa) {
32444 if (aa.sequenceRef != null) {
32445 aa.sequenceRef.removeAlignmentAnnotation (aa);
32446 }if (aa.groupRef != null) {
32447 aa.groupRef = null;
32448 }}, "jalview.datamodel.AlignmentAnnotation");
32449 Clazz_defineMethod (c$, "addAnnotation", 
32450 function (aa) {
32451 this.addAnnotation (aa, -1);
32452 }, "jalview.datamodel.AlignmentAnnotation");
32453 Clazz_defineMethod (c$, "addAnnotation", 
32454 function (aa, pos) {
32455 if (aa.getRNAStruc () != null) {
32456 this.$hasRNAStructure = true;
32457 }var aSize = 1;
32458 if (this.annotations != null) {
32459 aSize = this.annotations.length + 1;
32460 }var temp =  new Array (aSize);
32461 var i = 0;
32462 if (pos == -1 || pos >= aSize) {
32463 temp[aSize - 1] = aa;
32464 } else {
32465 temp[pos] = aa;
32466 }if (aSize > 1) {
32467 var p = 0;
32468 for (i = 0; i < (aSize - 1); i++, p++) {
32469 if (p == pos) {
32470 p++;
32471 }if (p < temp.length) {
32472 temp[p] = this.annotations[i];
32473 }}
32474 }this.annotations = temp;
32475 }, "jalview.datamodel.AlignmentAnnotation,~N");
32476 Clazz_overrideMethod (c$, "setAnnotationIndex", 
32477 function (aa, index) {
32478 if (aa == null || this.annotations == null || this.annotations.length - 1 < index) {
32479 return;
32480 }var aSize = this.annotations.length;
32481 var temp =  new Array (aSize);
32482 temp[index] = aa;
32483 for (var i = 0; i < aSize; i++) {
32484 if (i == index) {
32485 continue;
32486 }if (i < index) {
32487 temp[i] = this.annotations[i];
32488 } else {
32489 temp[i] = this.annotations[i - 1];
32490 }}
32491 this.annotations = temp;
32492 }, "jalview.datamodel.AlignmentAnnotation,~N");
32493 Clazz_defineMethod (c$, "getAlignmentAnnotation", 
32494 function () {
32495 return this.annotations;
32496 });
32497 Clazz_overrideMethod (c$, "setNucleotide", 
32498 function (b) {
32499 if (b) {
32500 this.type = 1;
32501 } else {
32502 this.type = 0;
32503 }}, "~B");
32504 Clazz_defineMethod (c$, "isNucleotide", 
32505 function () {
32506 if (this.type == 1) {
32507 return true;
32508 } else {
32509 return false;
32510 }});
32511 Clazz_overrideMethod (c$, "hasRNAStructure", 
32512 function () {
32513 return this.$hasRNAStructure;
32514 });
32515 Clazz_overrideMethod (c$, "setDataset", 
32516 function (data) {
32517 if (this.dataset == null && data == null) {
32518 var seqs =  new Array (this.getHeight ());
32519 var currentSeq;
32520 for (var i = 0; i < this.getHeight (); i++) {
32521 currentSeq = this.getSequenceAt (i);
32522 if (currentSeq.getDatasetSequence () != null) {
32523 seqs[i] = currentSeq.getDatasetSequence ();
32524 } else {
32525 seqs[i] = currentSeq.createDatasetSequence ();
32526 }}
32527 this.dataset =  new jalview.datamodel.Alignment (seqs);
32528 } else if (this.dataset == null && data != null) {
32529 this.dataset = data;
32530 for (var i = 0; i < this.getHeight (); i++) {
32531 var currentSeq = this.getSequenceAt (i);
32532 var dsq = currentSeq.getDatasetSequence ();
32533 if (dsq == null) {
32534 dsq = currentSeq.createDatasetSequence ();
32535 this.dataset.addSequence (dsq);
32536 } else {
32537 while (dsq.getDatasetSequence () != null) {
32538 dsq = dsq.getDatasetSequence ();
32539 }
32540 if (this.dataset.findIndex (dsq) == -1) {
32541 this.dataset.addSequence (dsq);
32542 }}}
32543 }this.dataset.addAlignmentRef ();
32544 }, "jalview.datamodel.Alignment");
32545 Clazz_defineMethod (c$, "addAlignmentRef", 
32546  function () {
32547 this.alignmentRefs++;
32548 });
32549 Clazz_overrideMethod (c$, "getDataset", 
32550 function () {
32551 return this.dataset;
32552 });
32553 Clazz_overrideMethod (c$, "padGaps", 
32554 function () {
32555 var modified = false;
32556 var maxLength = -1;
32557 var current;
32558 for (var i = 0; i < this.sequences.size (); i++) {
32559 current = this.getSequenceAt (i);
32560 for (var j = current.getLength (); j > maxLength; j--) {
32561 if (j > maxLength && !jalview.util.Comparison.isGap (current.getCharAt (j))) {
32562 maxLength = j;
32563 break;
32564 }}
32565 }
32566 maxLength++;
32567 var cLength;
32568 for (var i = 0; i < this.sequences.size (); i++) {
32569 current = this.getSequenceAt (i);
32570 cLength = current.getLength ();
32571 if (cLength < maxLength) {
32572 current.insertCharAt (cLength, maxLength - cLength, this.gapCharacter);
32573 modified = true;
32574 } else if (current.getLength () > maxLength) {
32575 current.deleteChars (maxLength, current.getLength ());
32576 }}
32577 return modified;
32578 });
32579 Clazz_overrideMethod (c$, "justify", 
32580 function (right) {
32581 var modified = false;
32582 var maxLength = -1;
32583 var ends =  Clazz_newIntArray (this.sequences.size () * 2, 0);
32584 var current;
32585 for (var i = 0; i < this.sequences.size (); i++) {
32586 current = this.getSequenceAt (i);
32587 ends[i * 2] = current.findIndex (current.getStart ());
32588 ends[i * 2 + 1] = current.findIndex (current.getStart () + current.getLength ());
32589 var hitres = false;
32590 for (var j = 0, rs = 0, ssiz = current.getLength (); j < ssiz; j++) {
32591 if (!jalview.util.Comparison.isGap (current.getCharAt (j))) {
32592 if (!hitres) {
32593 ends[i * 2] = j;
32594 hitres = true;
32595 } else {
32596 ends[i * 2 + 1] = j;
32597 if (j - ends[i * 2] > maxLength) {
32598 maxLength = j - ends[i * 2];
32599 }}}}
32600 }
32601 maxLength++;
32602 var cLength;
32603 var extent;
32604 var diff;
32605 for (var i = 0; i < this.sequences.size (); i++) {
32606 current = this.getSequenceAt (i);
32607 cLength = 1 + ends[i * 2 + 1] - ends[i * 2];
32608 diff = maxLength - cLength;
32609 extent = current.getLength ();
32610 if (right) {
32611 if (extent > ends[i * 2 + 1]) {
32612 current.deleteChars (ends[i * 2 + 1] + 1, extent);
32613 modified = true;
32614 }if (ends[i * 2] > diff) {
32615 current.deleteChars (0, ends[i * 2] - diff);
32616 modified = true;
32617 } else {
32618 if (ends[i * 2] < diff) {
32619 current.insertCharAt (0, diff - ends[i * 2], this.gapCharacter);
32620 modified = true;
32621 }}} else {
32622 if (ends[i * 2] > 0) {
32623 current.deleteChars (0, ends[i * 2]);
32624 modified = true;
32625 ends[i * 2 + 1] -= ends[i * 2];
32626 extent -= ends[i * 2];
32627 }if (extent > maxLength) {
32628 current.deleteChars (maxLength + 1, extent);
32629 modified = true;
32630 } else {
32631 if (extent < maxLength) {
32632 current.insertCharAt (extent, maxLength - extent, this.gapCharacter);
32633 modified = true;
32634 }}}}
32635 return modified;
32636 }, "~B");
32637 Clazz_defineMethod (c$, "getHiddenSequences", 
32638 function () {
32639 return this.hiddenSequences;
32640 });
32641 Clazz_overrideMethod (c$, "getCompactAlignment", 
32642 function () {
32643 {
32644 var alseqs =  new Array (this.sequences.size ());
32645 var i = 0;
32646 for (var seq, $seq = this.sequences.iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
32647 alseqs[i++] =  new jalview.datamodel.SeqCigar (seq);
32648 }
32649 var cal =  new jalview.datamodel.CigarArray (alseqs);
32650 cal.addOperation ('M', this.getWidth ());
32651 return cal;
32652 }});
32653 Clazz_overrideMethod (c$, "setProperty", 
32654 function (key, value) {
32655 if (this.alignmentProperties == null) {
32656 this.alignmentProperties =  new java.util.Hashtable ();
32657 }this.alignmentProperties.put (key, value);
32658 }, "~O,~O");
32659 Clazz_defineMethod (c$, "getProperty", 
32660 function (key) {
32661 if (this.alignmentProperties != null) {
32662 return this.alignmentProperties.get (key);
32663 } else {
32664 return null;
32665 }}, "~O");
32666 Clazz_defineMethod (c$, "getProperties", 
32667 function () {
32668 return this.alignmentProperties;
32669 });
32670 Clazz_overrideMethod (c$, "addCodonFrame", 
32671 function (codons) {
32672 if (codons != null) {
32673 this.codonFrameList.add (codons);
32674 }}, "jalview.datamodel.AlignedCodonFrame");
32675 Clazz_overrideMethod (c$, "getCodonFrame", 
32676 function (seq) {
32677 if (seq == null) {
32678 return null;
32679 }var cframes =  new java.util.ArrayList ();
32680 for (var acf, $acf = this.codonFrameList.iterator (); $acf.hasNext () && ((acf = $acf.next ()) || true);) {
32681 if (acf.involvesSequence (seq)) {
32682 cframes.add (acf);
32683 }}
32684 return cframes;
32685 }, "jalview.datamodel.SequenceI");
32686 Clazz_overrideMethod (c$, "setCodonFrames", 
32687 function (acfs) {
32688 this.codonFrameList = acfs;
32689 }, "java.util.Set");
32690 Clazz_defineMethod (c$, "getCodonFrames", 
32691 function () {
32692 return this.codonFrameList;
32693 });
32694 Clazz_overrideMethod (c$, "removeCodonFrame", 
32695 function (codons) {
32696 if (codons == null || this.codonFrameList == null) {
32697 return false;
32698 }return this.codonFrameList.remove (codons);
32699 }, "jalview.datamodel.AlignedCodonFrame");
32700 Clazz_overrideMethod (c$, "append", 
32701 function (toappend) {
32702 if (toappend === this) {
32703 System.err.println ("Self append may cause a deadlock.");
32704 }var samegap = toappend.getGapCharacter () == this.getGapCharacter ();
32705 var oldc = toappend.getGapCharacter ();
32706 var hashidden = toappend.getHiddenSequences () != null && toappend.getHiddenSequences ().hiddenSequences != null;
32707 var sqs = (hashidden) ? toappend.getHiddenSequences ().getFullAlignment ().getSequences () : toappend.getSequences ();
32708 if (sqs != null) {
32709 {
32710 for (var addedsq, $addedsq = sqs.iterator (); $addedsq.hasNext () && ((addedsq = $addedsq.next ()) || true);) {
32711 if (!samegap) {
32712 var oldseq = addedsq.getSequence ();
32713 for (var c = 0; c < oldseq.length; c++) {
32714 if (oldseq[c] == oldc) {
32715 oldseq[c] = this.gapCharacter;
32716 }}
32717 }this.addSequence (addedsq);
32718 }
32719 }}var alan = toappend.getAlignmentAnnotation ();
32720 for (var a = 0; alan != null && a < alan.length; a++) {
32721 this.addAnnotation (alan[a]);
32722 }
32723 this.codonFrameList.addAll (toappend.getCodonFrames ());
32724 var sg = toappend.getGroups ();
32725 if (sg != null) {
32726 for (var _sg, $_sg = sg.iterator (); $_sg.hasNext () && ((_sg = $_sg.next ()) || true);) {
32727 this.addGroup (_sg);
32728 }
32729 }if (toappend.getHiddenSequences () != null) {
32730 var hs = toappend.getHiddenSequences ();
32731 if (this.hiddenSequences == null) {
32732 this.hiddenSequences =  new jalview.datamodel.HiddenSequences (this);
32733 }if (hs.hiddenSequences != null) {
32734 for (var s = 0; s < hs.hiddenSequences.length; s++) {
32735 if (hs.hiddenSequences[s] != null) {
32736 this.hiddenSequences.hideSequence (hs.hiddenSequences[s]);
32737 }}
32738 }}if (toappend.getProperties () != null) {
32739 var key = toappend.getProperties ().keys ();
32740 while (key.hasMoreElements ()) {
32741 var k = key.nextElement ();
32742 var ourval = this.getProperty (k);
32743 var toapprop = toappend.getProperty (k);
32744 if (ourval != null) {
32745 if (ourval.getClass ().equals (toapprop.getClass ()) && !ourval.equals (toapprop)) {
32746 if (Clazz_instanceOf (ourval, String)) {
32747 this.setProperty (k, (ourval) + "; " + (toapprop));
32748 } else {
32749 if (Clazz_instanceOf (ourval, java.util.Vector)) {
32750 var theirv = (toapprop).elements ();
32751 while (theirv.hasMoreElements ()) {
32752 (ourval).addElement (theirv);
32753 }
32754 }}}} else {
32755 this.setProperty (k, toapprop);
32756 }}
32757 }}, "jalview.datamodel.AlignmentI");
32758 Clazz_overrideMethod (c$, "findOrCreateAnnotation", 
32759 function (name, calcId, autoCalc, seqRef, groupRef) {
32760 if (this.annotations != null) {
32761 for (var annot, $annot = 0, $$annot = this.getAlignmentAnnotation (); $annot < $$annot.length && ((annot = $$annot[$annot]) || true); $annot++) {
32762 if (annot.autoCalculated == autoCalc && (name.equals (annot.label)) && (calcId == null || annot.getCalcId ().equals (calcId)) && annot.sequenceRef === seqRef && annot.groupRef === groupRef) {
32763 return annot;
32764 }}
32765 }var annot =  new jalview.datamodel.AlignmentAnnotation (name, name,  new Array (1), 0, 0, 1);
32766 annot.hasText = false;
32767 annot.setCalcId ( String.instantialize (calcId));
32768 annot.autoCalculated = autoCalc;
32769 if (seqRef != null) {
32770 annot.setSequenceRef (seqRef);
32771 }annot.groupRef = groupRef;
32772 this.addAnnotation (annot);
32773 return annot;
32774 }, "~S,~S,~B,jalview.datamodel.SequenceI,jalview.datamodel.SequenceGroup");
32775 Clazz_overrideMethod (c$, "findAnnotation", 
32776 function (calcId) {
32777 var aa =  new java.util.ArrayList ();
32778 for (var a, $a = 0, $$a = this.getAlignmentAnnotation (); $a < $$a.length && ((a = $$a[$a]) || true); $a++) {
32779 if (a.getCalcId () === calcId || (a.getCalcId () != null && calcId != null && a.getCalcId ().equals (calcId))) {
32780 aa.add (a);
32781 }}
32782 return aa;
32783 }, "~S");
32784 Clazz_overrideMethod (c$, "findAnnotations", 
32785 function (seq, calcId, label) {
32786 var aa =  new java.util.ArrayList ();
32787 for (var ann, $ann = 0, $$ann = this.getAlignmentAnnotation (); $ann < $$ann.length && ((ann = $$ann[$ann]) || true); $ann++) {
32788 if (ann.getCalcId () != null && ann.getCalcId ().equals (calcId) && ann.sequenceRef != null && ann.sequenceRef === seq && ann.label != null && ann.label.equals (label)) {
32789 aa.add (ann);
32790 }}
32791 return aa;
32792 }, "jalview.datamodel.SequenceI,~S,~S");
32793 Clazz_overrideMethod (c$, "moveSelectedSequencesByOne", 
32794 function (sg, map, up) {
32795 {
32796 if (up) {
32797 for (var i = 1, iSize = this.sequences.size (); i < iSize; i++) {
32798 var seq = this.sequences.get (i);
32799 if (!sg.getSequences (map).contains (seq)) {
32800 continue;
32801 }var temp = this.sequences.get (i - 1);
32802 if (sg.getSequences (null).contains (temp)) {
32803 continue;
32804 }this.sequences.set (i, temp);
32805 this.sequences.set (i - 1, seq);
32806 }
32807 } else {
32808 for (var i = this.sequences.size () - 2; i > -1; i--) {
32809 var seq = this.sequences.get (i);
32810 if (!sg.getSequences (map).contains (seq)) {
32811 continue;
32812 }var temp = this.sequences.get (i + 1);
32813 if (sg.getSequences (map).contains (temp)) {
32814 continue;
32815 }this.sequences.set (i, temp);
32816 this.sequences.set (i + 1, seq);
32817 }
32818 }}}, "jalview.datamodel.SequenceGroup,java.util.Map,~B");
32819 Clazz_overrideMethod (c$, "validateAnnotation", 
32820 function (alignmentAnnotation) {
32821 alignmentAnnotation.validateRangeAndDisplay ();
32822 if (this.isNucleotide () && alignmentAnnotation.isValidStruc ()) {
32823 this.$hasRNAStructure = true;
32824 }}, "jalview.datamodel.AlignmentAnnotation");
32825 Clazz_overrideMethod (c$, "getSeqrep", 
32826 function () {
32827 return this.seqrep;
32828 });
32829 Clazz_overrideMethod (c$, "setSeqrep", 
32830 function (seqrep) {
32831 this.seqrep = seqrep;
32832 }, "jalview.datamodel.SequenceI");
32833 Clazz_overrideMethod (c$, "hasSeqrep", 
32834 function () {
32835 return this.seqrep != null;
32836 });
32837 Clazz_overrideMethod (c$, "getEndRes", 
32838 function () {
32839 return this.getWidth () - 1;
32840 });
32841 Clazz_overrideMethod (c$, "getStartRes", 
32842 function () {
32843 return 0;
32844 });
32845 Clazz_overrideMethod (c$, "getContext", 
32846 function () {
32847 return this.dataset;
32848 });
32849 Clazz_defineMethod (c$, "alignAs", 
32850 function (al) {
32851 return this.alignAs (al, false, true);
32852 }, "jalview.datamodel.AlignmentI");
32853 Clazz_defineMethod (c$, "alignAs", 
32854 function (al, preserveMappedGaps, preserveUnmappedGaps) {
32855 var count = 0;
32856 var thisIsNucleotide = this.isNucleotide ();
32857 var thatIsProtein = !al.isNucleotide ();
32858 if (!thatIsProtein && !thisIsNucleotide) {
32859 return jalview.analysis.AlignmentUtils.alignProteinAsDna (this, al);
32860 }var thisGapChar = this.getGapCharacter ();
32861 var gap = thisIsNucleotide && thatIsProtein ? String.valueOf ( Clazz_newCharArray (-1, [thisGapChar, thisGapChar, thisGapChar])) : String.valueOf (thisGapChar);
32862 for (var alignTo, $alignTo = this.getSequences ().iterator (); $alignTo.hasNext () && ((alignTo = $alignTo.next ()) || true);) {
32863 count += jalview.analysis.AlignmentUtils.alignSequenceAs (alignTo, al, gap, preserveMappedGaps, preserveUnmappedGaps) ? 1 : 0;
32864 }
32865 return count;
32866 }, "jalview.datamodel.AlignmentI,~B,~B");
32867 Clazz_overrideMethod (c$, "getSequenceNames", 
32868 function () {
32869 var names =  new java.util.HashSet ();
32870 for (var seq, $seq = this.getSequences ().iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
32871 names.add (seq.getName ());
32872 }
32873 return names;
32874 });
32875 Clazz_overrideMethod (c$, "toString", 
32876 function () {
32877 var seq = this.getSequencesArray ();
32878 {
32879 return "" + JSON.stringify(seq);
32880 }});
32881 Clazz_defineStatics (c$,
32882 "PROTEIN", 0,
32883 "NUCLEOTIDE", 1);
32884 });
32885 Clazz_declarePackage ("jalview.datamodel");
32886 Clazz_load (["jalview.datamodel.AnnotatedCollectionI"], "jalview.datamodel.AlignmentI", null, function () {
32887 Clazz_declareInterface (jalview.datamodel, "AlignmentI", jalview.datamodel.AnnotatedCollectionI);
32888 });
32889 Clazz_declarePackage ("jalview.datamodel");
32890 Clazz_load (null, "jalview.datamodel.HiddenSequences", ["jalview.datamodel.Alignment", "java.util.ArrayList"], function () {
32891 c$ = Clazz_decorateAsClass (function () {
32892 this.hiddenSequences = null;
32893 this.alignment = null;
32894 Clazz_instantialize (this, arguments);
32895 }, jalview.datamodel, "HiddenSequences");
32896 Clazz_makeConstructor (c$, 
32897 function (al) {
32898 this.alignment = al;
32899 }, "jalview.datamodel.AlignmentI");
32900 Clazz_defineMethod (c$, "getSize", 
32901 function () {
32902 if (this.hiddenSequences == null) {
32903 return 0;
32904 }var count = 0;
32905 for (var i = 0; i < this.hiddenSequences.length; i++) {
32906 if (this.hiddenSequences[i] != null) {
32907 count++;
32908 }}
32909 return count;
32910 });
32911 Clazz_defineMethod (c$, "getWidth", 
32912 function () {
32913 var width = 0;
32914 for (var i = 0; i < this.hiddenSequences.length; i++) {
32915 if (this.hiddenSequences[i] != null && this.hiddenSequences[i].getLength () > width) {
32916 width = this.hiddenSequences[i].getLength ();
32917 }}
32918 return width;
32919 });
32920 Clazz_defineMethod (c$, "adjustHeightSequenceDeleted", 
32921 function (seqIndex) {
32922 if (this.hiddenSequences == null) {
32923 return;
32924 }var alHeight = this.alignment.getHeight ();
32925 var tmp =  new Array (alHeight + this.getSize ());
32926 var deletionIndex = this.adjustForHiddenSeqs (seqIndex);
32927 for (var i = 0; i < this.hiddenSequences.length; i++) {
32928 if (this.hiddenSequences[i] == null) {
32929 continue;
32930 }if (i > deletionIndex) {
32931 tmp[i - 1] = this.hiddenSequences[i];
32932 } else {
32933 tmp[i] = this.hiddenSequences[i];
32934 }}
32935 this.hiddenSequences = tmp;
32936 }, "~N");
32937 Clazz_defineMethod (c$, "adjustHeightSequenceAdded", 
32938 function () {
32939 if (this.hiddenSequences == null) {
32940 return;
32941 }var alHeight = this.alignment.getHeight ();
32942 var tmp =  new Array (alHeight + this.getSize ());
32943 System.arraycopy (this.hiddenSequences, 0, tmp, 0, this.hiddenSequences.length);
32944 this.hiddenSequences = tmp;
32945 });
32946 Clazz_defineMethod (c$, "hideSequence", 
32947 function (sequence) {
32948 if (this.hiddenSequences == null) {
32949 this.hiddenSequences =  new Array (this.alignment.getHeight ());
32950 }var alignmentIndex = this.alignment.findIndex (sequence);
32951 alignmentIndex = this.adjustForHiddenSeqs (alignmentIndex);
32952 if (this.hiddenSequences[alignmentIndex] != null) {
32953 System.out.println ("ERROR!!!!!!!!!!!");
32954 }this.hiddenSequences[alignmentIndex] = sequence;
32955 this.alignment.deleteSequence (sequence);
32956 }, "jalview.datamodel.SequenceI");
32957 Clazz_defineMethod (c$, "showAll", 
32958 function (hiddenRepSequences) {
32959 var revealedSeqs =  new java.util.ArrayList ();
32960 for (var i = 0; i < this.hiddenSequences.length; i++) {
32961 if (this.hiddenSequences[i] != null) {
32962 var tmp = this.showSequence (i, hiddenRepSequences);
32963 for (var seq, $seq = tmp.iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
32964 revealedSeqs.add (seq);
32965 }
32966 }}
32967 return revealedSeqs;
32968 }, "java.util.Map");
32969 Clazz_defineMethod (c$, "showSequence", 
32970 function (alignmentIndex, hiddenRepSequences) {
32971 var revealedSeqs =  new java.util.ArrayList ();
32972 var repSequence = this.alignment.getSequenceAt (alignmentIndex);
32973 if (repSequence != null && hiddenRepSequences != null && hiddenRepSequences.containsKey (repSequence)) {
32974 hiddenRepSequences.remove (repSequence);
32975 revealedSeqs.add (repSequence);
32976 }var start = this.adjustForHiddenSeqs (alignmentIndex - 1);
32977 var end = this.adjustForHiddenSeqs (alignmentIndex);
32978 if (end >= this.hiddenSequences.length) {
32979 end = this.hiddenSequences.length - 1;
32980 }var asequences;
32981 {
32982 for (var index = end; index > start; index--) {
32983 var seq = this.hiddenSequences[index];
32984 this.hiddenSequences[index] = null;
32985 if (seq != null) {
32986 if (seq.getLength () > 0) {
32987 revealedSeqs.add (seq);
32988 asequences.add (alignmentIndex, seq);
32989 } else {
32990 System.out.println (seq.getName () + " has been deleted whilst hidden");
32991 }}}
32992 }return revealedSeqs;
32993 }, "~N,java.util.Map");
32994 Clazz_defineMethod (c$, "getHiddenSequence", 
32995 function (alignmentIndex) {
32996 return this.hiddenSequences[alignmentIndex];
32997 }, "~N");
32998 Clazz_defineMethod (c$, "findIndexWithoutHiddenSeqs", 
32999 function (alignmentIndex) {
33000 var index = 0;
33001 var hiddenSeqs = 0;
33002 if (this.hiddenSequences.length <= alignmentIndex) {
33003 alignmentIndex = this.hiddenSequences.length - 1;
33004 }while (index <= alignmentIndex) {
33005 if (this.hiddenSequences[index] != null) {
33006 hiddenSeqs++;
33007 }index++;
33008 }
33009 ;return (alignmentIndex - hiddenSeqs);
33010 }, "~N");
33011 Clazz_defineMethod (c$, "adjustForHiddenSeqs", 
33012 function (alignmentIndex) {
33013 var index = 0;
33014 var hSize = this.hiddenSequences.length;
33015 while (index <= alignmentIndex && index < hSize) {
33016 if (this.hiddenSequences[index] != null) {
33017 alignmentIndex++;
33018 }index++;
33019 }
33020 ;return alignmentIndex;
33021 }, "~N");
33022 Clazz_defineMethod (c$, "getFullAlignment", 
33023 function () {
33024 var isize = this.hiddenSequences.length;
33025 var seq =  new Array (isize);
33026 var index = 0;
33027 for (var i = 0; i < this.hiddenSequences.length; i++) {
33028 if (this.hiddenSequences[i] != null) {
33029 seq[i] = this.hiddenSequences[i];
33030 } else {
33031 seq[i] = this.alignment.getSequenceAt (index);
33032 index++;
33033 }}
33034 var fAlignmt =  new jalview.datamodel.Alignment (seq);
33035 fAlignmt.annotations = this.alignment.getAlignmentAnnotation ();
33036 fAlignmt.alignmentProperties = this.alignment.getProperties ();
33037 fAlignmt.groups = this.alignment.getGroups ();
33038 fAlignmt.$hasRNAStructure = this.alignment.hasRNAStructure ();
33039 return fAlignmt;
33040 });
33041 Clazz_defineMethod (c$, "isHidden", 
33042 function (seq) {
33043 if (this.hiddenSequences != null) {
33044 for (var i = 0; i < this.hiddenSequences.length; i++) {
33045 if (this.hiddenSequences[i] != null && this.hiddenSequences[i] === seq) {
33046 return true;
33047 }}
33048 }return false;
33049 }, "jalview.datamodel.SequenceI");
33050 });
33051 Clazz_load(["java.util.HashSet","$.Set"],"java.util.LinkedHashSet",["java.util.LinkedHashMap"],function(){
33052 c$=Clazz_declareType(java.util,"LinkedHashSet",java.util.HashSet,[java.util.Set,Cloneable,java.io.Serializable]);
33053 Clazz_makeConstructor(c$,
33054 function(){
33055 Clazz_superConstructor(this,java.util.LinkedHashSet,[new java.util.LinkedHashMap()]);
33056 });
33057 Clazz_makeConstructor(c$,
33058 function(capacity){
33059 Clazz_superConstructor(this,java.util.LinkedHashSet,[new java.util.LinkedHashMap(capacity)]);
33060 },"~N");
33061 Clazz_makeConstructor(c$,
33062 function(capacity,loadFactor){
33063 Clazz_superConstructor(this,java.util.LinkedHashSet,[new java.util.LinkedHashMap(capacity,loadFactor)]);
33064 },"~N,~N");
33065 Clazz_makeConstructor(c$,
33066 function(collection){
33067 Clazz_superConstructor(this,java.util.LinkedHashSet,[new java.util.LinkedHashMap(collection.size()<6?11:collection.size()*2)]);
33068 for(var e,$e=collection.iterator();$e.hasNext()&&((e=$e.next())||true);){
33069 this.add(e);
33070 }
33071 },"java.util.Collection");
33072 Clazz_overrideMethod(c$,"createBackingMap",
33073 function(capacity,loadFactor){
33074 return new java.util.LinkedHashMap(capacity,loadFactor);
33075 },"~N,~N");
33076 });
33077 Clazz_load(["java.util.HashMap"],"java.util.LinkedHashMap",["java.lang.IllegalStateException","java.util.AbstractCollection","$.AbstractSet","java.util.MapEntry.Type","java.util.NoSuchElementException"],function(){
33078 c$=Clazz_decorateAsClass(function(){
33079 this.accessOrder=false;
33080 this.head=null;
33081 this.tail=null;
33082 Clazz_instantialize(this,arguments);
33083 },java.util,"LinkedHashMap",java.util.HashMap);
33084 Clazz_makeConstructor(c$,
33085 function(){
33086 Clazz_superConstructor(this,java.util.LinkedHashMap);
33087 this.accessOrder=false;
33088 this.head=null;
33089 });
33090 Clazz_makeConstructor(c$,
33091 function(s){
33092 Clazz_superConstructor(this,java.util.LinkedHashMap,[s]);
33093 this.accessOrder=false;
33094 this.head=null;
33095 },"~N");
33096 Clazz_makeConstructor(c$,
33097 function(s,lf){
33098 Clazz_superConstructor(this,java.util.LinkedHashMap,[s,lf]);
33099 this.accessOrder=false;
33100 this.head=null;
33101 this.tail=null;
33102 },"~N,~N");
33103 Clazz_makeConstructor(c$,
33104 function(s,lf,order){
33105 Clazz_superConstructor(this,java.util.LinkedHashMap,[s,lf]);
33106 this.accessOrder=order;
33107 this.head=null;
33108 this.tail=null;
33109 },"~N,~N,~B");
33110 Clazz_makeConstructor(c$,
33111 function(m){
33112 Clazz_superConstructor(this,java.util.LinkedHashMap,[]);
33113 this.accessOrder=false;
33114 this.head=null;
33115 this.tail=null;
33116 this.putAll(m);
33117 },"java.util.Map");
33118 Clazz_overrideMethod(c$,"newElementArray",
33119 function(s){
33120 return new Array(s);
33121 },"~N");
33122 Clazz_overrideMethod(c$,"get",
33123 function(key){
33124 var m=this.getEntry(key);
33125 if(m==null){
33126 return null;
33127 }if(this.accessOrder&&this.tail!==m){
33128 var p=m.chainBackward;
33129 var n=m.chainForward;
33130 n.chainBackward=p;
33131 if(p!=null){
33132 p.chainForward=n;
33133 }else{
33134 this.head=n;
33135 }m.chainForward=null;
33136 m.chainBackward=this.tail;
33137 this.tail.chainForward=m;
33138 this.tail=m;
33139 }return m.value;
33140 },"~O");
33141 Clazz_overrideMethod(c$,"createEntry",
33142 function(key,index,value){
33143 var m=new java.util.LinkedHashMap.LinkedHashMapEntry(key,value);
33144 m.next=this.elementData[index];
33145 this.elementData[index]=m;
33146 this.linkEntry(m);
33147 return m;
33148 },"~O,~N,~O");
33149 Clazz_overrideMethod(c$,"put",
33150 function(key,value){
33151 var index=this.getModuloHash(key);
33152 var m=this.findEntry(key,index);
33153 if(m==null){
33154 this.modCount++;
33155 if(++this.elementCount>this.threshold){
33156 this.rehash();
33157 index=key==null?0:(key.hashCode()&0x7FFFFFFF)%this.elementData.length;
33158 }m=this.createEntry(key,index,null);
33159 }else{
33160 this.linkEntry(m);
33161 }var result=m.value;
33162 m.value=value;
33163 if(this.removeEldestEntry(this.head)){
33164 this.remove(this.head.key);
33165 }return result;
33166 },"~O,~O");
33167 Clazz_defineMethod(c$,"linkEntry",
33168 function(m){
33169 if(this.tail===m){
33170 return;
33171 }if(this.head==null){
33172 this.head=this.tail=m;
33173 return;
33174 }var p=m.chainBackward;
33175 var n=m.chainForward;
33176 if(p==null){
33177 if(n!=null){
33178 if(this.accessOrder){
33179 this.head=n;
33180 n.chainBackward=null;
33181 m.chainBackward=this.tail;
33182 m.chainForward=null;
33183 this.tail.chainForward=m;
33184 this.tail=m;
33185 }}else{
33186 m.chainBackward=this.tail;
33187 m.chainForward=null;
33188 this.tail.chainForward=m;
33189 this.tail=m;
33190 }return;
33191 }if(n==null){
33192 return;
33193 }if(this.accessOrder){
33194 p.chainForward=n;
33195 n.chainBackward=p;
33196 m.chainForward=null;
33197 m.chainBackward=this.tail;
33198 this.tail.chainForward=m;
33199 this.tail=m;
33200 }},"java.util.LinkedHashMap.LinkedHashMapEntry");
33201 Clazz_overrideMethod(c$,"entrySet",
33202 function(){
33203 return new java.util.LinkedHashMap.LinkedHashMapEntrySet(this);
33204 });
33205 Clazz_overrideMethod(c$,"keySet",
33206 function(){
33207 if(this.$keySet==null){
33208 this.$keySet=((Clazz_isClassDefined("java.util.LinkedHashMap$1")?0:java.util.LinkedHashMap.$LinkedHashMap$1$()),Clazz_innerTypeInstance(java.util.LinkedHashMap$1,this,null));
33209 }return this.$keySet;
33210 });
33211 Clazz_overrideMethod(c$,"values",
33212 function(){
33213 if(this.valuesCollection==null){
33214 this.valuesCollection=((Clazz_isClassDefined("java.util.LinkedHashMap$2")?0:java.util.LinkedHashMap.$LinkedHashMap$2$()),Clazz_innerTypeInstance(java.util.LinkedHashMap$2,this,null));
33215 }return this.valuesCollection;
33216 });
33217 Clazz_overrideMethod(c$,"remove",
33218 function(key){
33219 var m=this.removeEntry(key);
33220 if(m==null){
33221 return null;
33222 }var p=m.chainBackward;
33223 var n=m.chainForward;
33224 if(p!=null){
33225 p.chainForward=n;
33226 }else{
33227 this.head=n;
33228 }if(n!=null){
33229 n.chainBackward=p;
33230 }else{
33231 this.tail=p;
33232 }return m.value;
33233 },"~O");
33234 Clazz_defineMethod(c$,"removeEldestEntry",
33235 function(eldest){
33236 return false;
33237 },"java.util.Map.Entry");
33238 Clazz_defineMethod(c$,"clear",
33239 function(){
33240 Clazz_superCall(this,java.util.LinkedHashMap,"clear",[]);
33241 this.head=this.tail=null;
33242 });
33243 Clazz_defineMethod(c$,"clone",
33244 function(){
33245 var map=Clazz_superCall(this,java.util.LinkedHashMap,"clone",[]);
33246 map.clear();
33247 for(var entry,$entry=this.entrySet().iterator();$entry.hasNext()&&((entry=$entry.next())||true);){
33248 map.put(entry.getKey(),entry.getValue());
33249 }
33250 return map;
33251 });
33252 c$.$LinkedHashMap$1$=function(){
33253 Clazz_pu$h(self.c$);
33254 c$=Clazz_declareAnonymous(java.util,"LinkedHashMap$1",java.util.AbstractSet);
33255 Clazz_overrideMethod(c$,"contains",
33256 function(object){
33257 return this.b$["java.util.LinkedHashMap"].containsKey(object);
33258 },"~O");
33259 Clazz_overrideMethod(c$,"size",
33260 function(){
33261 return this.b$["java.util.LinkedHashMap"].size();
33262 });
33263 Clazz_overrideMethod(c$,"clear",
33264 function(){
33265 this.b$["java.util.LinkedHashMap"].clear();
33266 });
33267 Clazz_overrideMethod(c$,"remove",
33268 function(key){
33269 if(this.b$["java.util.LinkedHashMap"].containsKey(key)){
33270 this.b$["java.util.LinkedHashMap"].remove(key);
33271 return true;
33272 }return false;
33273 },"~O");
33274 Clazz_overrideMethod(c$,"iterator",
33275 function(){
33276 return new java.util.LinkedHashMap.LinkedHashIterator(((Clazz_isClassDefined("java.util.LinkedHashMap$1$1")?0:java.util.LinkedHashMap.$LinkedHashMap$1$1$()),Clazz_innerTypeInstance(java.util.LinkedHashMap$1$1,this,null)),this.b$["java.util.LinkedHashMap"]);
33277 });
33278 c$=Clazz_p0p();
33279 };
33280 c$.$LinkedHashMap$1$1$=function(){
33281 Clazz_pu$h(self.c$);
33282 c$=Clazz_declareAnonymous(java.util,"LinkedHashMap$1$1",null,java.util.MapEntry.Type);
33283 Clazz_overrideMethod(c$,"get",
33284 function(entry){
33285 return entry.key;
33286 },"java.util.MapEntry");
33287 c$=Clazz_p0p();
33288 };
33289 c$.$LinkedHashMap$2$=function(){
33290 Clazz_pu$h(self.c$);
33291 c$=Clazz_declareAnonymous(java.util,"LinkedHashMap$2",java.util.AbstractCollection);
33292 Clazz_overrideMethod(c$,"contains",
33293 function(object){
33294 return this.b$["java.util.LinkedHashMap"].containsValue(object);
33295 },"~O");
33296 Clazz_overrideMethod(c$,"size",
33297 function(){
33298 return this.b$["java.util.LinkedHashMap"].size();
33299 });
33300 Clazz_overrideMethod(c$,"clear",
33301 function(){
33302 this.b$["java.util.LinkedHashMap"].clear();
33303 });
33304 Clazz_overrideMethod(c$,"iterator",
33305 function(){
33306 return new java.util.LinkedHashMap.LinkedHashIterator(((Clazz_isClassDefined("java.util.LinkedHashMap$2$1")?0:java.util.LinkedHashMap.$LinkedHashMap$2$1$()),Clazz_innerTypeInstance(java.util.LinkedHashMap$2$1,this,null)),this.b$["java.util.LinkedHashMap"]);
33307 });
33308 c$=Clazz_p0p();
33309 };
33310 c$.$LinkedHashMap$2$1$=function(){
33311 Clazz_pu$h(self.c$);
33312 c$=Clazz_declareAnonymous(java.util,"LinkedHashMap$2$1",null,java.util.MapEntry.Type);
33313 Clazz_overrideMethod(c$,"get",
33314 function(entry){
33315 return entry.value;
33316 },"java.util.MapEntry");
33317 c$=Clazz_p0p();
33318 };
33319 Clazz_pu$h(self.c$);
33320 c$=Clazz_declareType(java.util.LinkedHashMap,"LinkedHashIterator",java.util.HashMap.HashMapIterator);
33321 Clazz_makeConstructor(c$,
33322 function(a,b){
33323 Clazz_superConstructor(this,java.util.LinkedHashMap.LinkedHashIterator,[a,b]);
33324 this.entry=b.head;
33325 },"java.util.MapEntry.Type,java.util.LinkedHashMap");
33326 Clazz_overrideMethod(c$,"hasNext",
33327 function(){
33328 return(this.entry!=null);
33329 });
33330 Clazz_overrideMethod(c$,"next",
33331 function(){
33332 this.checkConcurrentMod();
33333 if(!this.hasNext()){
33334 throw new java.util.NoSuchElementException();
33335 }var a=this.type.get(this.entry);
33336 this.lastEntry=this.entry;
33337 this.entry=(this.entry).chainForward;
33338 this.canRemove=true;
33339 return a;
33340 });
33341 Clazz_overrideMethod(c$,"remove",
33342 function(){
33343 this.checkConcurrentMod();
33344 if(!this.canRemove){
33345 throw new IllegalStateException();
33346 }this.canRemove=false;
33347 this.associatedMap.modCount++;
33348 var a=this.associatedMap.getModuloHash(this.lastEntry.key);
33349 var b=this.associatedMap.elementData[a];
33350 if(b===this.lastEntry){
33351 this.associatedMap.elementData[a]=this.lastEntry.next;
33352 }else{
33353 while(b.next!=null){
33354 if(b.next===this.lastEntry){
33355 break;
33356 }b=b.next;
33357 }
33358 b.next=this.lastEntry.next;
33359 }var c=this.lastEntry;
33360 var d=c.chainBackward;
33361 var e=c.chainForward;
33362 var f=this.associatedMap;
33363 if(d!=null){
33364 d.chainForward=e;
33365 if(e!=null){
33366 e.chainBackward=d;
33367 }else{
33368 f.tail=d;
33369 }}else{
33370 f.head=e;
33371 if(e!=null){
33372 e.chainBackward=null;
33373 }else{
33374 f.tail=null;
33375 }}this.associatedMap.elementCount--;
33376 this.expectedModCount++;
33377 });
33378 c$=Clazz_p0p();
33379 Clazz_pu$h(self.c$);
33380 c$=Clazz_declareType(java.util.LinkedHashMap,"LinkedHashMapEntrySet",java.util.HashMap.HashMapEntrySet);
33381 Clazz_overrideMethod(c$,"iterator",
33382 function(){
33383 return new java.util.LinkedHashMap.LinkedHashIterator(((Clazz_isClassDefined("java.util.LinkedHashMap$LinkedHashMapEntrySet$1")?0:java.util.LinkedHashMap.LinkedHashMapEntrySet.$LinkedHashMap$LinkedHashMapEntrySet$1$()),Clazz_innerTypeInstance(java.util.LinkedHashMap$LinkedHashMapEntrySet$1,this,null)),this.hashMap());
33384 });
33385 c$.$LinkedHashMap$LinkedHashMapEntrySet$1$=function(){
33386 Clazz_pu$h(self.c$);
33387 c$=Clazz_declareAnonymous(java.util,"LinkedHashMap$LinkedHashMapEntrySet$1",null,java.util.MapEntry.Type);
33388 Clazz_overrideMethod(c$,"get",
33389 function(a){
33390 return a;
33391 },"java.util.MapEntry");
33392 c$=Clazz_p0p();
33393 };
33394 c$=Clazz_p0p();
33395 Clazz_pu$h(self.c$);
33396 c$=Clazz_decorateAsClass(function(){
33397 this.chainForward=null;
33398 this.chainBackward=null;
33399 Clazz_instantialize(this,arguments);
33400 },java.util.LinkedHashMap,"LinkedHashMapEntry",java.util.HashMap.Entry);
33401 Clazz_makeConstructor(c$,
33402 function(a,b){
33403 Clazz_superConstructor(this,java.util.LinkedHashMap.LinkedHashMapEntry,[a,b]);
33404 this.chainForward=null;
33405 this.chainBackward=null;
33406 },"~O,~O");
33407 Clazz_defineMethod(c$,"clone",
33408 function(){
33409 var a=Clazz_superCall(this,java.util.LinkedHashMap.LinkedHashMapEntry,"clone",[]);
33410 a.chainBackward=this.chainBackward;
33411 a.chainForward=this.chainForward;
33412 var b=a.next;
33413 if(b!=null){
33414 a.next=b.clone();
33415 }return a;
33416 });
33417 c$=Clazz_p0p();
33418 });
33419 Clazz_declarePackage ("jalview.datamodel");
33420 Clazz_load (["jalview.datamodel.CigarBase"], "jalview.datamodel.CigarArray", ["jalview.datamodel.CigarCigar", "$.SeqCigar", "java.lang.StringBuffer", "java.util.Vector"], function () {
33421 c$ = Clazz_decorateAsClass (function () {
33422 this.refCigars = null;
33423 this.seqcigararray = false;
33424 Clazz_instantialize (this, arguments);
33425 }, jalview.datamodel, "CigarArray", jalview.datamodel.CigarBase);
33426 Clazz_defineMethod (c$, "isSeqCigarArray", 
33427 function () {
33428 return this.seqcigararray;
33429 });
33430 Clazz_makeConstructor (c$, 
33431 function (cigars) {
33432 Clazz_superConstructor (this, jalview.datamodel.CigarArray);
33433 this.seqcigararray = true;
33434 if (cigars != null && cigars.length > 0) {
33435 this.refCigars =  new Array (cigars.length);
33436 for (var c = 0; c < cigars.length; c++) {
33437 this.refCigars[c] = cigars[c];
33438 if (!((Clazz_instanceOf (cigars[c], jalview.datamodel.SeqCigar)) || Clazz_instanceOf (cigars[c], jalview.datamodel.CigarCigar))) {
33439 this.seqcigararray = false;
33440 }}
33441 }}, "~A");
33442 Clazz_makeConstructor (c$, 
33443 function (alignment, columnSelection, selectionGroup) {
33444 this.construct (jalview.datamodel.CigarArray.constructSeqCigarArray (alignment, selectionGroup));
33445 this.constructFromAlignment (alignment, columnSelection != null ? columnSelection.getHiddenColumns () : null, selectionGroup);
33446 }, "jalview.datamodel.AlignmentI,jalview.datamodel.ColumnSelection,jalview.datamodel.SequenceGroup");
33447 c$._calcStartEndBounds = Clazz_defineMethod (c$, "_calcStartEndBounds", 
33448  function (alignment, selectionGroup) {
33449 var startend =  Clazz_newIntArray (-1, [0, 0, 0]);
33450 if (selectionGroup != null) {
33451 startend[0] = selectionGroup.getSize ();
33452 startend[1] = selectionGroup.getStartRes ();
33453 startend[2] = selectionGroup.getEndRes ();
33454 } else {
33455 startend[0] = alignment.getHeight ();
33456 startend[2] = alignment.getWidth () - 1;
33457 }return startend;
33458 }, "jalview.datamodel.AlignmentI,jalview.datamodel.SequenceGroup");
33459 c$.constructSeqCigarArray = Clazz_defineMethod (c$, "constructSeqCigarArray", 
33460 function (alignment, selectionGroup) {
33461 var seqs = null;
33462 var i;
33463 var iSize;
33464 var _startend = jalview.datamodel.CigarArray._calcStartEndBounds (alignment, selectionGroup);
33465 var start = _startend[1];
33466 var end = _startend[2];
33467 if (selectionGroup != null) {
33468 iSize = selectionGroup.getSize ();
33469 seqs = selectionGroup.getSequencesInOrder (alignment);
33470 start = selectionGroup.getStartRes ();
33471 end = selectionGroup.getEndRes ();
33472 } else {
33473 iSize = alignment.getHeight ();
33474 seqs = alignment.getSequencesArray ();
33475 end = alignment.getWidth () - 1;
33476 }var selseqs =  new Array (iSize);
33477 for (i = 0; i < iSize; i++) {
33478 selseqs[i] =  new jalview.datamodel.SeqCigar (seqs[i], start, end);
33479 }
33480 return selseqs;
33481 }, "jalview.datamodel.AlignmentI,jalview.datamodel.SequenceGroup");
33482 Clazz_defineMethod (c$, "constructFromAlignment", 
33483  function (alignment, list, selectionGroup) {
33484 var _startend = jalview.datamodel.CigarArray._calcStartEndBounds (alignment, selectionGroup);
33485 var start = _startend[1];
33486 var end = _startend[2];
33487 if (list != null) {
33488 var region;
33489 var hideStart;
33490 var hideEnd;
33491 var last = start;
33492 for (var j = 0;  new Boolean (last < end & j < list.size ()).valueOf (); j++) {
33493 region = list.get (j);
33494 hideStart = region[0];
33495 hideEnd = region[1];
33496 if (hideStart < last) {
33497 if (hideEnd > last) {
33498 hideStart = last;
33499 } else {
33500 continue;
33501 }}if (hideStart > end) {
33502 break;
33503 }if (hideEnd > end) {
33504 hideEnd = end;
33505 }if (hideStart > hideEnd) {
33506 break;
33507 }if (last < hideStart) {
33508 this.addOperation ('M', hideStart - last);
33509 }this.addOperation ('D', 1 + hideEnd - hideStart);
33510 last = hideEnd + 1;
33511 }
33512 if (last < end) {
33513 this.addOperation ('M', end - last + 1);
33514 }} else {
33515 this.addOperation ('M', end - start + 1);
33516 }}, "jalview.datamodel.AlignmentI,java.util.List,jalview.datamodel.SequenceGroup");
33517 Clazz_defineMethod (c$, "getArrayofSequenceAndDeletions", 
33518 function (GapChar) {
33519 if (this.refCigars == null || this.refCigars.length == 0 || this.length == 0) {
33520 return null;
33521 }var sqanddels =  new Array (this.refCigars.length);
33522 for (var c = 0; c < this.refCigars.length; c++) {
33523 var refString = this.refCigars[c].getSequenceString (GapChar);
33524 if (refString != null) {
33525 sqanddels[c] = this.getSequenceAndDeletions (refString, GapChar);
33526 } else {
33527 sqanddels[c] = null;
33528 }}
33529 return sqanddels;
33530 }, "~S");
33531 Clazz_defineMethod (c$, "getSequenceString", 
33532 function (GapChar) {
33533 if (this.length == 0 || this.refCigars == null) {
33534 return "";
33535 }var seqStrings =  new StringBuffer ();
33536 var sqanddels = this.getArrayofSequenceAndDeletions (GapChar);
33537 for (var c = 0; c < this.refCigars.length; c++) {
33538 if (sqanddels[c] != null) {
33539 seqStrings.append (sqanddels[c][0]);
33540 sqanddels[c][0] = null;
33541 }seqStrings.append ('\n');
33542 }
33543 return seqStrings.toString ();
33544 }, "~S");
33545 Clazz_defineMethod (c$, "getSequenceStrings", 
33546 function (GapChar) {
33547 if (this.length == 0 || this.refCigars == null || this.refCigars.length == 0) {
33548 return null;
33549 }var sqanddels = this.getArrayofSequenceAndDeletions (GapChar);
33550 var seqs =  new Array (sqanddels.length);
33551 for (var c = 0; c < this.refCigars.length; c++) {
33552 seqs[c] = sqanddels[c][0];
33553 }
33554 return seqs;
33555 }, "~S");
33556 Clazz_defineMethod (c$, "applyDeletions", 
33557 function () {
33558 var delpos = null;
33559 if (this.length == 0) {
33560 return null;
33561 }var cursor = 0;
33562 var vcursor = 0;
33563 var offset = 0;
33564 var i = 0;
33565 while (i < this.length) {
33566 if (this.operation[i] != 'D') {
33567 if (this.operation[i] == 'M') {
33568 cursor += this.range[i];
33569 }vcursor += this.range[i++];
33570 } else {
33571 if (delpos == null) {
33572 delpos =  new java.util.Vector ();
33573 }var delstart = cursor;
33574 var delend = cursor + this.range[i] - 1;
33575 delpos.addElement ( Clazz_newIntArray (-1, [vcursor + offset, this.range[i]]));
33576 offset += this.range[i] - 1;
33577 System.arraycopy (this.operation, i + 1, this.operation, i, this.length - i);
33578 System.arraycopy (this.range, i + 1, this.range, i, this.length - i);
33579 this.length--;
33580 for (var s = 0; s < this.refCigars.length; s++) {
33581 var d = this.refCigars[s].deleteRange (delstart, delend);
33582 }
33583 }}
33584 if (delpos != null) {
33585 var pos =  Clazz_newIntArray (delpos.size () * 2, 0);
33586 for (var k = 0, l = delpos.size (); k < l; k++) {
33587 var dr = (delpos.elementAt (k));
33588 pos[k * 2] = dr[0];
33589 pos[k * 2 + 1] = dr[1];
33590 delpos.setElementAt (null, k);
33591 }
33592 delpos = null;
33593 return pos;
33594 }return null;
33595 });
33596 Clazz_defineMethod (c$, "getSeqCigarArray", 
33597 function () {
33598 if (!this.isSeqCigarArray ()) {
33599 return null;
33600 }var sa =  new Array (this.refCigars.length);
33601 for (var i = 0; i < this.refCigars.length; i++) {
33602 sa[i] = this.refCigars[i];
33603 }
33604 return sa;
33605 });
33606 });
33607 Clazz_declarePackage ("jalview.datamodel");
33608 Clazz_load (null, "jalview.datamodel.CigarBase", ["jalview.util.MessageManager", "java.lang.Error", "$.Exception", "$.StringBuffer", "java.util.Vector", "JU.AU"], function () {
33609 c$ = Clazz_decorateAsClass (function () {
33610 this.length = 0;
33611 this._inc_length = 10;
33612 this.operation = null;
33613 this.range = null;
33614 Clazz_instantialize (this, arguments);
33615 }, jalview.datamodel, "CigarBase");
33616 Clazz_makeConstructor (c$, 
33617 function () {
33618 });
33619 Clazz_defineMethod (c$, "getSequenceAndDeletions", 
33620 function (reference, GapChar) {
33621 var rlength = 0;
33622 var deletions = JU.AU.newInt2 (this.length);
33623 var trunc_deletions = null;
33624 var sq =  new StringBuffer ();
33625 var cursor = 0;
33626 var alcursor = 0;
33627 var start = 0;
33628 var startpos = 0;
33629 var end = 0;
33630 var endpos = 0;
33631 var delcount = -1;
33632 var consecutive_del = false;
33633 if (this.length == 0) {
33634 return null;
33635 }if (reference != null) {
33636 rlength = reference.length;
33637 }var modstart = true;
33638 for (var i = 0; i < this.length; i++) {
33639 switch (this.operation[i]) {
33640 case 'D':
33641 if (!consecutive_del) {
33642 deletions[++delcount] =  Clazz_newIntArray (-1, [cursor, 0, alcursor]);
33643 }cursor += this.range[i];
33644 deletions[delcount][1] = cursor - 1;
33645 consecutive_del = true;
33646 break;
33647 case 'I':
33648 consecutive_del = false;
33649 for (var r = 0; r < this.range[i]; r++) {
33650 sq.append (GapChar);
33651 alcursor++;
33652 }
33653 break;
33654 case 'M':
33655 consecutive_del = false;
33656 if (modstart) {
33657 start = cursor;
33658 startpos = alcursor;
33659 modstart = false;
33660 }if (reference != null) {
33661 var sbend = cursor + this.range[i];
33662 if (sbend > rlength) {
33663 sq.append (reference.substring (cursor, rlength));
33664 while (sbend-- >= rlength) {
33665 sq.append (GapChar);
33666 }
33667 } else {
33668 sq.append (reference.substring (cursor, sbend));
33669 }}alcursor += this.range[i];
33670 cursor += this.range[i];
33671 end = cursor - 1;
33672 endpos = alcursor;
33673 break;
33674 default:
33675 throw  new Error (jalview.util.MessageManager.formatMessage ("error.unknown_seq_cigar_operation",  Clazz_newArray (-1, [ new StringBuffer (this.operation[i].charCodeAt (0)).toString ()])));
33676 }
33677 }
33678 if (++delcount > 0) {
33679 trunc_deletions =  Clazz_newIntArray (delcount, 0);
33680 System.arraycopy (deletions, 0, trunc_deletions, 0, delcount);
33681 }deletions = null;
33682 return  Clazz_newArray (-1, [((reference != null) ? sq.toString () : null),  Clazz_newIntArray (-1, [start, startpos, end, endpos]), trunc_deletions]);
33683 }, "~S,~S");
33684 Clazz_defineMethod (c$, "compact_operations", 
33685 function () {
33686 var i = 1;
33687 if (this.operation == null) {
33688 return;
33689 }var last = this.operation[0];
33690 while (i < this.length) {
33691 if (last == this.operation[i]) {
33692 this.range[i - 1] += this.range[i];
33693 var r = this.length - i;
33694 if (r > 0) {
33695 System.arraycopy (this.range, i + 1, this.range, i, r);
33696 System.arraycopy (this.operation, i + 1, this.operation, i, r);
33697 }this.length--;
33698 } else {
33699 last = this.operation[i++];
33700 }}
33701 });
33702 c$.parseCigarString = Clazz_defineMethod (c$, "parseCigarString", 
33703 function (cigarString) {
33704 var ops = 0;
33705 for (var i = 0, l = cigarString.length; i < l; i++) {
33706 var c = cigarString.charAt (i);
33707 if (c == 'M' || c.charCodeAt (0) == (45) || c == 'I' || c.charCodeAt (0) == (41) || c == 'D' || c.charCodeAt (0) == (36)) {
33708 ops++;
33709 }}
33710 var operation =  Clazz_newCharArray (ops, '\0');
33711 var range =  Clazz_newIntArray (ops, 0);
33712 var op = 0;
33713 var i = 0;
33714 var l = cigarString.length;
33715 while (i < l) {
33716 var c;
33717 var j = i;
33718 do {
33719 c = cigarString.charAt (j++);
33720 } while (c >= '0' && c <= '9' && j < l);
33721 if (j >= l && c >= '0' && c <= '9') {
33722 throw  new Exception (jalview.util.MessageManager.getString ("exception.unterminated_cigar_string"));
33723 }try {
33724 var rangeint = cigarString.substring (i, j - 1);
33725 range[op] = Integer.parseInt (rangeint);
33726 i = j;
33727 } catch (e) {
33728 if (Clazz_exceptionOf (e, Exception)) {
33729 throw  new Error (jalview.util.MessageManager.getString ("error.implementation_bug_parse_cigar_string"));
33730 } else {
33731 throw e;
33732 }
33733 }
33734 if (c >= 'a' && c <= 'z') {
33735 c = String.fromCharCode (c.charCodeAt (0) - 32);
33736 }if ((c == 'M' || c == 'I' || c == 'D')) {
33737 operation[op++] = c;
33738 } else {
33739 throw  new Exception (jalview.util.MessageManager.formatMessage ("exception.unexpected_operation_cigar_string_pos",  Clazz_newArray (-1, [ new StringBuffer (c.charCodeAt (0)).toString (), Integer.$valueOf (i).toString (), cigarString])));
33740 }}
33741 return  Clazz_newArray (-1, [operation, range]);
33742 }, "~S");
33743 Clazz_defineMethod (c$, "addOperation", 
33744 function (op, range) {
33745 if (op >= 'a' && op <= 'z') {
33746 op = String.fromCharCode (op.charCodeAt (0) - 32);
33747 }if (op != 'M' && op != 'D' && op != 'I') {
33748 throw  new Error (jalview.util.MessageManager.getString ("error.implementation_error_invalid_operation_string"));
33749 }if (range == 0) {
33750 return;
33751 }if (range < 0) {
33752 throw  new Error (jalview.util.MessageManager.getString ("error.invalid_range_string"));
33753 }var lngth = 0;
33754 if (this.operation == null) {
33755 this.operation =  Clazz_newCharArray (this._inc_length, '\0');
33756 this.range =  Clazz_newIntArray (this._inc_length, 0);
33757 }if (this.length + 1 == this.operation.length) {
33758 var ops = this.operation;
33759 this.operation =  Clazz_newCharArray (this.length + 1 + this._inc_length, '\0');
33760 System.arraycopy (ops, 0, this.operation, 0, this.length);
33761 ops = null;
33762 var rng = this.range;
33763 this.range =  Clazz_newIntArray (this.length + 1 + this._inc_length, 0);
33764 System.arraycopy (rng, 0, this.range, 0, this.length);
33765 rng = null;
33766 }if ((this.length > 0) && (this.operation[this.length - 1] == op)) {
33767 this.length--;
33768 } else {
33769 this.range[this.length] = 0;
33770 }this.operation[this.length] = op;
33771 this.range[this.length++] += range;
33772 }, "~S,~N");
33773 Clazz_defineMethod (c$, "deleteRange", 
33774 function (start, end) {
33775 var deleted = 0;
33776 if (this.length == 0) {
33777 return deleted;
33778 }if (start < 0 || start > end) {
33779 throw  new Error (jalview.util.MessageManager.getString ("error.implementation_error_delete_range_out_of_bounds"));
33780 }var cursor = 0;
33781 var rlength = 1 + end - start;
33782 var oldlen = this.length;
33783 var o = 0;
33784 var editing = false;
33785 var oldops = this.operation;
33786 var oldrange = this.range;
33787 this.length = 0;
33788 this.operation = null;
33789 this.range = null;
33790 this.compact_operations ();
33791 while (o < oldlen && cursor <= end && rlength > 0) {
33792 if (oldops[o] == 'D') {
33793 this.addDeleted (oldrange[o++]);
33794 continue;
33795 }var remain = oldrange[o];
33796 if (!editing) {
33797 if ((cursor + remain) <= start) {
33798 this.addOperation (oldops[o], oldrange[o]);
33799 cursor += oldrange[o++];
33800 continue;
33801 }editing = true;
33802 if (start - cursor > 0) {
33803 this.addOperation (oldops[o], start - cursor);
33804 remain -= start - cursor;
33805 }}if (o < oldlen && editing && rlength > 0 && remain > 0) {
33806 switch (oldops[o]) {
33807 case 'M':
33808 if (rlength > remain) {
33809 this.addDeleted (remain);
33810 deleted += remain;
33811 } else {
33812 deleted += rlength;
33813 this.addDeleted (rlength);
33814 if (remain - rlength > 0) {
33815 this.addOperation ('M', remain - rlength);
33816 }rlength = 0;
33817 remain = 0;
33818 }break;
33819 case 'I':
33820 if (remain - rlength > 0) {
33821 this.addInsertion (remain - rlength);
33822 rlength = 0;
33823 }break;
33824 case 'D':
33825 throw  new Error (jalview.util.MessageManager.getString ("error.implementation_error"));
33826 default:
33827 throw  new Error (jalview.util.MessageManager.formatMessage ("error.implementation_error_unknown_operation",  Clazz_newArray (-1, [ new StringBuffer (oldops[o].charCodeAt (0)).toString ()])));
33828 }
33829 rlength -= remain;
33830 remain = oldrange[++o];
33831 }}
33832 while (o < oldlen) {
33833 this.addOperation (oldops[o], oldrange[o++]);
33834 }
33835 return deleted;
33836 }, "~N,~N");
33837 Clazz_defineMethod (c$, "hasDeletedRegions", 
33838 function () {
33839 for (var i = 0; i < this.length; i++) {
33840 if (this.operation[i] == 'D') {
33841 return true;
33842 }}
33843 return false;
33844 });
33845 Clazz_defineMethod (c$, "getDeletedRegions", 
33846 function () {
33847 if (this.length == 0) {
33848 return null;
33849 }var dr =  new java.util.Vector ();
33850 var cursor = 0;
33851 var vcursor = 0;
33852 for (var i = 0; i < this.length; i++) {
33853 switch (this.operation[i]) {
33854 case 'M':
33855 cursor += this.range[i];
33856 case 'I':
33857 vcursor += this.range[i];
33858 break;
33859 case 'D':
33860 dr.addElement ( Clazz_newIntArray (-1, [vcursor, cursor, this.range[i]]));
33861 cursor += this.range[i];
33862 }
33863 }
33864 if (dr.size () == 0) {
33865 return null;
33866 }var delregions =  Clazz_newIntArray (dr.size () * 3, 0);
33867 for (var i = 0, l = dr.size (); i < l; i++) {
33868 var reg = dr.elementAt (i);
33869 delregions[i * 3] = reg[0];
33870 delregions[i * 3 + 1] = reg[1];
33871 delregions[i * 3 + 2] = reg[2];
33872 }
33873 return delregions;
33874 });
33875 Clazz_defineMethod (c$, "getFullWidth", 
33876 function () {
33877 var w = 0;
33878 if (this.range != null) {
33879 for (var i = 0; i < this.length; i++) {
33880 w += this.range[i];
33881 }
33882 }return w;
33883 });
33884 Clazz_defineMethod (c$, "getWidth", 
33885 function () {
33886 var w = 0;
33887 if (this.range != null) {
33888 for (var i = 0; i < this.length; i++) {
33889 if (this.operation[i] == 'M' || this.operation[i] == 'I') {
33890 w += this.range[i];
33891 }}
33892 }return w;
33893 });
33894 Clazz_defineMethod (c$, "addInsertion", 
33895 function (range) {
33896 this.addOperation ('I', range);
33897 }, "~N");
33898 Clazz_defineMethod (c$, "addDeleted", 
33899 function (range) {
33900 this.addOperation ('D', range);
33901 }, "~N");
33902 Clazz_defineMethod (c$, "getCigarstring", 
33903 function () {
33904 var cigarString =  new StringBuffer ();
33905 for (var i = 0; i < this.length; i++) {
33906 cigarString.append ("" + this.range[i]);
33907 cigarString.append (this.operation[i]);
33908 }
33909 return cigarString.toString ();
33910 });
33911 Clazz_defineStatics (c$,
33912 "D", 'D',
33913 "I", 'I',
33914 "M", 'M',
33915 "_case_shift", String.fromCharCode (32));
33916 });
33917 Clazz_declarePackage ("jalview.datamodel");
33918 Clazz_load (["jalview.datamodel.CigarSimple"], "jalview.datamodel.CigarCigar", null, function () {
33919 c$ = Clazz_decorateAsClass (function () {
33920 this.refCigar = null;
33921 Clazz_instantialize (this, arguments);
33922 }, jalview.datamodel, "CigarCigar", jalview.datamodel.CigarSimple);
33923 Clazz_makeConstructor (c$, 
33924 function (cigar) {
33925 Clazz_superConstructor (this, jalview.datamodel.CigarCigar);
33926 this.refCigar = cigar;
33927 }, "jalview.datamodel.SeqCigar");
33928 Clazz_overrideMethod (c$, "getSequenceString", 
33929 function (GapChar) {
33930 if (this.length == 0) {
33931 return "";
33932 }var refString = this.refCigar.getSequenceString (GapChar);
33933 if (refString != null) {
33934 return (this.length == 0) ? "" : this.getSequenceAndDeletions (refString, GapChar)[0];
33935 } else {
33936 return null;
33937 }}, "~S");
33938 });
33939 Clazz_declarePackage ("jalview.datamodel");
33940 Clazz_load (["jalview.datamodel.CigarBase"], "jalview.datamodel.CigarSimple", null, function () {
33941 c$ = Clazz_declareType (jalview.datamodel, "CigarSimple", jalview.datamodel.CigarBase);
33942 });
33943 Clazz_declarePackage ("jalview.datamodel");
33944 Clazz_load (["jalview.datamodel.CigarSimple"], "jalview.datamodel.SeqCigar", ["jalview.analysis.AlignSeq", "$.SeqsetUtils", "jalview.datamodel.Sequence", "jalview.util.Comparison", "$.MessageManager", "$.ShiftList", "java.lang.Error", "$.StringBuffer", "java.util.Hashtable"], function () {
33945 c$ = Clazz_decorateAsClass (function () {
33946 this.start = 0;
33947 this.end = 0;
33948 this.refseq = null;
33949 this.seqProps = null;
33950 this.selGroups = null;
33951 Clazz_instantialize (this, arguments);
33952 }, jalview.datamodel, "SeqCigar", jalview.datamodel.CigarSimple);
33953 Clazz_defineMethod (c$, "getRefSeq", 
33954 function () {
33955 return this.refseq;
33956 });
33957 Clazz_defineMethod (c$, "getStart", 
33958 function () {
33959 return this.start;
33960 });
33961 Clazz_defineMethod (c$, "getEnd", 
33962 function () {
33963 return this.end;
33964 });
33965 Clazz_overrideMethod (c$, "getSequenceString", 
33966 function (GapChar) {
33967 return (this.length == 0) ? "" : this.getSequenceAndDeletions (this.refseq.getSequenceAsString (this.start, this.end), GapChar)[0];
33968 }, "~S");
33969 Clazz_defineMethod (c$, "getSeq", 
33970 function (GapChar) {
33971 var seq;
33972 if (this.refseq == null || this.length == 0) {
33973 return null;
33974 }var edit_result = this.getSequenceAndDeletions (this.refseq.getSequenceAsString (this.start, this.end), GapChar);
33975 if (edit_result == null) {
33976 throw  new Error (jalview.util.MessageManager.getString ("error.implementation_error_unexpected_null_from_get_sequence_and_deletions"));
33977 }var bounds = edit_result[1];
33978 seq =  new jalview.datamodel.Sequence (this.refseq.getName (), edit_result[0], this.refseq.getStart () + this.start + bounds[0], this.refseq.getStart () + this.start + ((bounds[2] == 0) ? -1 : bounds[2]));
33979 seq.setDescription (this.refseq.getDescription ());
33980 var sstart = seq.getStart ();
33981 var send = seq.getEnd ();
33982 if (this.seqProps != null) {
33983 jalview.analysis.SeqsetUtils.SeqCharacterUnhash (seq, this.seqProps);
33984 }seq.setDatasetSequence (this.refseq);
33985 seq.setStart (sstart);
33986 seq.setEnd (send);
33987 return seq;
33988 }, "~S");
33989 Clazz_defineMethod (c$, "_setSeq", 
33990  function (seq, initialDeletion, _s, _e) {
33991 var hasgaps = false;
33992 if (seq == null) {
33993 throw  new Error (jalview.util.MessageManager.getString ("error.implementation_error_set_seq_null"));
33994 }if (_s < 0) {
33995 throw  new Error (jalview.util.MessageManager.formatMessage ("error.implementation_error_s",  Clazz_newArray (-1, [Integer.$valueOf (_s).toString ()])));
33996 }var seq_string = seq.getSequenceAsString ();
33997 if (_e == 0 || _e < _s || _e > seq_string.length) {
33998 _e = seq_string.length;
33999 }this.start = seq.findPosition (_s) - seq.getStart ();
34000 this.end = seq.findPosition (_e) - seq.getStart ();
34001 var l_ungapped = this.end - this.start;
34002 var ds = seq.getDatasetSequence ();
34003 if (ds == null) {
34004 var ungapped = jalview.analysis.AlignSeq.extractGaps (jalview.util.Comparison.GapChars,  String.instantialize (seq_string));
34005 l_ungapped = ungapped.length;
34006 if (l_ungapped == seq.getLength ()) {
34007 ds = seq;
34008 } else {
34009 ds =  new jalview.datamodel.Sequence (seq.getName (), ungapped, seq.getStart (), seq.getStart () + ungapped.length - 1);
34010 }}if (ds.getStart () < seq.getStart ()) {
34011 var offset = seq.getStart () - ds.getStart ();
34012 if (initialDeletion) {
34013 this.addDeleted (_s + offset);
34014 this.start = 0;
34015 this.end += offset;
34016 } else {
34017 this.start += offset;
34018 this.end += offset;
34019 }}if (l_ungapped != (_e - _s)) {
34020 hasgaps = true;
34021 }this.refseq = ds;
34022 this.seqProps = jalview.analysis.SeqsetUtils.SeqCharacterHash (seq);
34023 if (this.end > ds.getLength ()) {
34024 throw  new Error (jalview.util.MessageManager.getString ("error.implementation_error_seqcigar_possible"));
34025 }return hasgaps;
34026 }, "jalview.datamodel.SequenceI,~B,~N,~N");
34027 Clazz_makeConstructor (c$, 
34028 function (seq, operation, range) {
34029 Clazz_superConstructor (this, jalview.datamodel.SeqCigar);
34030 if (seq == null) {
34031 throw  new Error (jalview.util.MessageManager.getString ("error.implmentation_bug_seq_null"));
34032 }if (operation.length != range.length) {
34033 throw  new Error (jalview.util.MessageManager.getString ("error.implementation_bug_cigar_operation_list_range_list"));
34034 }if (operation != null) {
34035 this.operation =  Clazz_newCharArray (operation.length + this._inc_length, '\0');
34036 this.range =  Clazz_newIntArray (operation.length + this._inc_length, 0);
34037 if (this._setSeq (seq, false, 0, 0)) {
34038 throw  new Error (jalview.util.MessageManager.getString ("error.not_yet_implemented_cigar_object_from_cigar_string"));
34039 }for (var i = this.length, j = 0; j < operation.length; i++, j++) {
34040 var op = operation[j];
34041 if (op != 'M' && op != 'I' && op != 'D') {
34042 throw  new Error (jalview.util.MessageManager.formatMessage ("error.implementation_bug_cigar_operation",  Clazz_newArray (-1, [Integer.$valueOf (j).toString (), Integer.$valueOf (op.charCodeAt (0)).toString (), Integer.$valueOf ('M'.charCodeAt (0)).toString (), Integer.$valueOf ('I'.charCodeAt (0)).toString (), Integer.$valueOf ('D'.charCodeAt (0)).toString ()])));
34043 }this.operation[i] = op;
34044 this.range[i] = range[j];
34045 }
34046 this.length += operation.length;
34047 } else {
34048 this.operation = null;
34049 this.range = null;
34050 this.length = 0;
34051 if (this._setSeq (seq, false, 0, 0)) {
34052 throw  new Error (jalview.util.MessageManager.getString ("error.not_yet_implemented_cigar_object_from_cigar_string"));
34053 }}}, "jalview.datamodel.SequenceI,~A,~A");
34054 Clazz_defineMethod (c$, "addMatch", 
34055 function (range) {
34056 this.addOperation ('M', range);
34057 }, "~N");
34058 c$.addSequenceOps = Clazz_defineMethod (c$, "addSequenceOps", 
34059 function (cigar, seq, startpos, endpos, initialDeletions) {
34060 var op = '\u0000';
34061 var range = 0;
34062 var p = 0;
34063 var res = seq.getLength ();
34064 if (!initialDeletions) {
34065 p = startpos;
34066 }while (p <= endpos) {
34067 var isGap = (p < res) ? jalview.util.Comparison.isGap (seq.getCharAt (p)) : true;
34068 if ((startpos <= p) && (p <= endpos)) {
34069 if (isGap) {
34070 if (range > 0 && op != 'I') {
34071 cigar.addOperation (op, range);
34072 range = 0;
34073 }op = 'I';
34074 range++;
34075 } else {
34076 if (range > 0 && op != 'M') {
34077 cigar.addOperation (op, range);
34078 range = 0;
34079 }op = 'M';
34080 range++;
34081 }} else {
34082 if (!isGap) {
34083 if (range > 0 && op != 'D') {
34084 cigar.addOperation (op, range);
34085 range = 0;
34086 }op = 'D';
34087 range++;
34088 } else {
34089 }}p++;
34090 }
34091 if (range > 0) {
34092 cigar.addOperation (op, range);
34093 }}, "jalview.datamodel.CigarBase,jalview.datamodel.SequenceI,~N,~N,~B");
34094 Clazz_makeConstructor (c$, 
34095 function (seq) {
34096 Clazz_superConstructor (this, jalview.datamodel.SeqCigar);
34097 if (seq == null) {
34098 throw  new Error (jalview.util.MessageManager.getString ("error.implementation_error_for_new_cigar"));
34099 }this._setSeq (seq, false, 0, 0);
34100 jalview.datamodel.SeqCigar.addSequenceOps (this, seq, 0, seq.getLength () - 1, false);
34101 }, "jalview.datamodel.SequenceI");
34102 Clazz_makeConstructor (c$, 
34103 function (seq, start, end) {
34104 Clazz_superConstructor (this, jalview.datamodel.SeqCigar);
34105 if (seq == null) {
34106 throw  new Error (jalview.util.MessageManager.getString ("error.implementation_error_for_new_cigar"));
34107 }this._setSeq (seq, false, start, end + 1);
34108 jalview.datamodel.SeqCigar.addSequenceOps (this, seq, start, end, false);
34109 }, "jalview.datamodel.SequenceI,~N,~N");
34110 c$.parseCigar = Clazz_defineMethod (c$, "parseCigar", 
34111 function (seq, cigarString) {
34112 var opsandrange = jalview.datamodel.CigarBase.parseCigarString (cigarString);
34113 return  new jalview.datamodel.SeqCigar (seq, opsandrange[0], opsandrange[1]);
34114 }, "jalview.datamodel.SequenceI,~S");
34115 c$.createAlignmentSequences = Clazz_defineMethod (c$, "createAlignmentSequences", 
34116 function (alseqs, gapCharacter, colsel, segments) {
34117 var seqs =  new Array (alseqs.length);
34118 var g_seqs =  new Array (alseqs.length);
34119 var alseqs_string =  new Array (alseqs.length);
34120 var gs_regions =  new Array (alseqs.length);
34121 for (var i = 0; i < alseqs.length; i++) {
34122 alseqs_string[i] = alseqs[i].getRefSeq ().getSequenceAsString (alseqs[i].start, alseqs[i].end);
34123 gs_regions[i] = alseqs[i].getSequenceAndDeletions (alseqs_string[i], gapCharacter);
34124 if (gs_regions[i] == null) {
34125 throw  new Error (jalview.util.MessageManager.formatMessage ("error.implementation_error_cigar_seq_no_operations",  Clazz_newArray (-1, [Integer.$valueOf (i).toString ()])));
34126 }g_seqs[i] =  new StringBuffer ((gs_regions[i])[0]);
34127 }
34128 var shifts =  new jalview.util.ShiftList ();
34129 for (var i = 0; i < alseqs.length; i++) {
34130 var gs_region = ((gs_regions[i])[2]);
34131 if (gs_region != null) {
34132 for (var hr = 0; hr < gs_region.length; hr++) {
34133 var region = gs_region[hr];
34134 var insert =  Clazz_newCharArray (region[1] - region[0] + 1, '\0');
34135 for (var s = 0; s < insert.length; s++) {
34136 insert[s] = gapCharacter;
34137 }
34138 var inspos = shifts.shift (region[2]);
34139 for (var s = 0; s < alseqs.length; s++) {
34140 if (s != i) {
34141 if (g_seqs[s].length () <= inspos) {
34142 for (var l = inspos - g_seqs[s].length (); l > 0; l--) {
34143 g_seqs[s].append (gapCharacter);
34144 }
34145 }g_seqs[s].insert (inspos, insert);
34146 } else {
34147 g_seqs[s].insert (inspos, alseqs_string[i].substring (region[0], region[1] + 1));
34148 }}
34149 shifts.addShift (region[2], insert.length);
34150 if (segments == null) {
34151 colsel.hideColumns (inspos, inspos + insert.length - 1);
34152 }}
34153 }}
34154 for (var i = 0; i < alseqs.length; i++) {
34155 var bounds = ((gs_regions[i])[1]);
34156 var ref = alseqs[i].getRefSeq ();
34157 seqs[i] =  new jalview.datamodel.Sequence (ref.getName (), g_seqs[i].toString (), ref.getStart () + alseqs[i].start + bounds[0], ref.getStart () + alseqs[i].start + (bounds[2] == 0 ? -1 : bounds[2]));
34158 seqs[i].setDatasetSequence (ref);
34159 seqs[i].setDescription (ref.getDescription ());
34160 }
34161 if (segments != null) {
34162 for (var i = 0; i < segments.length; i += 3) {
34163 colsel.hideColumns (segments[i + 1], segments[i + 1] + segments[i + 2] - 1);
34164 }
34165 }return seqs;
34166 }, "~A,~S,jalview.datamodel.ColumnSelection,~A");
34167 Clazz_defineMethod (c$, "setGroupMembership", 
34168 function (group) {
34169 if (this.selGroups == null) {
34170 this.selGroups =  new java.util.Hashtable ();
34171 }this.selGroups.put (group,  Clazz_newIntArray (0, 0));
34172 }, "~O");
34173 Clazz_defineMethod (c$, "removeGroupMembership", 
34174 function (group) {
34175 if (this.selGroups != null && this.selGroups.containsKey (group)) {
34176 this.selGroups.remove (group);
34177 return true;
34178 }return false;
34179 }, "~O");
34180 Clazz_defineMethod (c$, "clearMemberships", 
34181 function () {
34182 if (this.selGroups != null) {
34183 this.selGroups.clear ();
34184 }this.selGroups = null;
34185 });
34186 Clazz_defineMethod (c$, "getAllMemberships", 
34187 function () {
34188 if (this.selGroups == null) {
34189 return null;
34190 }var mmbs =  new Array (this.selGroups.size ());
34191 var en = this.selGroups.keys ();
34192 for (var i = 0; en.hasMoreElements (); i++) {
34193 mmbs[i] = en.nextElement ();
34194 }
34195 return mmbs;
34196 });
34197 Clazz_defineMethod (c$, "isMemberOf", 
34198 function (sgr) {
34199 return (this.selGroups != null) && this.selGroups.get (sgr) != null;
34200 }, "~O");
34201 });
34202 Clazz_declarePackage ("jalview.analysis");
34203 Clazz_load (null, "jalview.analysis.SeqsetUtils", ["jalview.analysis.AlignSeq", "$.SequenceIdMatcher", "jalview.datamodel.Sequence", "jalview.util.Comparison", "java.util.Hashtable", "$.Vector"], function () {
34204 c$ = Clazz_declareType (jalview.analysis, "SeqsetUtils");
34205 c$.SeqCharacterHash = Clazz_defineMethod (c$, "SeqCharacterHash", 
34206 function (seq) {
34207 var sqinfo =  new java.util.Hashtable ();
34208 sqinfo.put ("Name", seq.getName ());
34209 sqinfo.put ("Start",  new Integer (seq.getStart ()));
34210 sqinfo.put ("End",  new Integer (seq.getEnd ()));
34211 if (seq.getDescription () != null) {
34212 sqinfo.put ("Description", seq.getDescription ());
34213 }var sfeat =  new java.util.Vector ();
34214 var sfarray = seq.getSequenceFeatures ();
34215 if (sfarray != null && sfarray.length > 0) {
34216 for (var i = 0; i < sfarray.length; i++) {
34217 sfeat.addElement (sfarray[i]);
34218 }
34219 }sqinfo.put ("SeqFeatures", sfeat);
34220 sqinfo.put ("PdbId", (seq.getPDBId () != null) ? seq.getPDBId () :  new java.util.Vector ());
34221 sqinfo.put ("datasetSequence", (seq.getDatasetSequence () != null) ? seq.getDatasetSequence () :  new jalview.datamodel.Sequence ("THISISAPLACEHOLDER", ""));
34222 return sqinfo;
34223 }, "jalview.datamodel.SequenceI");
34224 c$.SeqCharacterUnhash = Clazz_defineMethod (c$, "SeqCharacterUnhash", 
34225 function (sq, sqinfo) {
34226 var namePresent = true;
34227 if (sqinfo == null) {
34228 return false;
34229 }var oldname = sqinfo.get ("Name");
34230 var start = sqinfo.get ("Start");
34231 var end = sqinfo.get ("End");
34232 var sfeatures = sqinfo.get ("SeqFeatures");
34233 var pdbid = sqinfo.get ("PdbId");
34234 var description = sqinfo.get ("Description");
34235 var seqds = sqinfo.get ("datasetSequence");
34236 if (oldname == null) {
34237 namePresent = false;
34238 } else {
34239 sq.setName (oldname);
34240 }if (pdbid != null && pdbid.size () > 0) {
34241 sq.setPDBId (pdbid);
34242 }if ((start != null) && (end != null)) {
34243 sq.setStart (start.intValue ());
34244 sq.setEnd (end.intValue ());
34245 }if ((sfeatures != null) && (sfeatures.size () > 0)) {
34246 var sfarray =  new Array (sfeatures.size ());
34247 for (var is = 0, isize = sfeatures.size (); is < isize; is++) {
34248 sfarray[is] = sfeatures.elementAt (is);
34249 }
34250 sq.setSequenceFeatures (sfarray);
34251 }if (description != null) {
34252 sq.setDescription (description);
34253 }if ((seqds != null) && !(seqds.getName ().equals ("THISISAPLACEHOLDER") && seqds.getLength () == 0)) {
34254 sq.setDatasetSequence (seqds);
34255 }return namePresent;
34256 }, "jalview.datamodel.SequenceI,java.util.Hashtable");
34257 c$.unique_name = Clazz_defineMethod (c$, "unique_name", 
34258 function (i) {
34259 return  String.instantialize ("Sequence" + i);
34260 }, "~N");
34261 c$.uniquify = Clazz_defineMethod (c$, "uniquify", 
34262 function (sequences, write_names) {
34263 var map =  new java.util.Hashtable ();
34264 for (var i = 0; i < sequences.length; i++) {
34265 var safename = jalview.analysis.SeqsetUtils.unique_name (i);
34266 map.put (safename, jalview.analysis.SeqsetUtils.SeqCharacterHash (sequences[i]));
34267 if (write_names) {
34268 sequences[i].setName (safename);
34269 }}
34270 return map;
34271 }, "~A,~B");
34272 c$.deuniquify = Clazz_defineMethod (c$, "deuniquify", 
34273 function (map, sequences) {
34274 return jalview.analysis.SeqsetUtils.deuniquify (map, sequences, true);
34275 }, "java.util.Hashtable,~A");
34276 c$.deuniquify = Clazz_defineMethod (c$, "deuniquify", 
34277 function (map, sequences, quiet) {
34278 var matcher =  new jalview.analysis.SequenceIdMatcher (sequences);
34279 var msq = null;
34280 var keys = map.keys ();
34281 var unmatched =  new java.util.Vector ();
34282 for (var i = 0, j = sequences.length; i < j; i++) {
34283 unmatched.addElement (sequences[i]);
34284 }
34285 while (keys.hasMoreElements ()) {
34286 var key = keys.nextElement ();
34287 if (Clazz_instanceOf (key, String)) {
34288 if ((msq = matcher.findIdMatch (key)) != null) {
34289 var sqinfo = map.get (key);
34290 unmatched.removeElement (msq);
34291 jalview.analysis.SeqsetUtils.SeqCharacterUnhash (msq, sqinfo);
34292 } else {
34293 if (!quiet) {
34294 System.err.println ("Can't find '" + (key) + "' in uniquified alignment");
34295 }}}}
34296 if (unmatched.size () > 0 && !quiet) {
34297 System.err.println ("Did not find matches for :");
34298 for (var i = unmatched.elements (); i.hasMoreElements (); System.out.println ((i.nextElement ()).getName ())) {
34299 ;}
34300 return false;
34301 }return true;
34302 }, "java.util.Hashtable,~A,~B");
34303 c$.getNonEmptySequenceSet = Clazz_defineMethod (c$, "getNonEmptySequenceSet", 
34304 function (sequences) {
34305 var ungapped =  Clazz_newBooleanArray (sequences.length, false);
34306 var msflen = 0;
34307 for (var i = 0, j = sequences.length; i < j; i++) {
34308 var tempseq = jalview.analysis.AlignSeq.extractGaps (jalview.util.Comparison.GapChars, sequences[i].getSequenceAsString ());
34309 if (tempseq.length == 0) {
34310 ungapped[i] = false;
34311 } else {
34312 ungapped[i] = true;
34313 msflen++;
34314 }}
34315 if (msflen == 0) {
34316 return null;
34317 }var mset =  new Array (msflen);
34318 for (var i = 0, j = sequences.length, k = 0; i < j; i++) {
34319 if (ungapped[i]) {
34320 mset[k++] = sequences[i];
34321 }}
34322 ungapped = null;
34323 return mset;
34324 }, "~A");
34325 });
34326 Clazz_declarePackage ("jalview.datamodel");
34327 Clazz_load (null, "jalview.datamodel.FeatureProperties", ["jalview.datamodel.DBRefSource"], function () {
34328 c$ = Clazz_declareType (jalview.datamodel, "FeatureProperties");
34329 c$.isCodingFeature = Clazz_defineMethod (c$, "isCodingFeature", 
34330 function (dbrefsource, type) {
34331 if (type.equalsIgnoreCase ("CDS")) {
34332 return (dbrefsource == null || dbrefsource.equalsIgnoreCase (jalview.datamodel.DBRefSource.EMBL) || dbrefsource.equalsIgnoreCase (jalview.datamodel.DBRefSource.EMBLCDS));
34333 }return false;
34334 }, "~S,~S");
34335 c$.getCodingFeature = Clazz_defineMethod (c$, "getCodingFeature", 
34336 function (dbrefsource) {
34337 if (jalview.datamodel.DBRefSource.EMBL.equalsIgnoreCase (dbrefsource) || jalview.datamodel.DBRefSource.EMBLCDS.equalsIgnoreCase (dbrefsource)) {
34338 return "CDS";
34339 }return null;
34340 }, "~S");
34341 Clazz_defineStatics (c$,
34342 "EMBL_CODING_FEATURE", "CDS",
34343 "EXONPOS", "exon number",
34344 "EXONPRODUCT", "product");
34345 });
34346 Clazz_declarePackage ("jalview.util");
34347 Clazz_load (["java.util.HashMap"], "jalview.util.DBRefUtils", ["jalview.datamodel.DBRefEntry", "$.DBRefSource", "$.PDBEntry", "jalview.jsdev.RegExp", "java.util.ArrayList", "$.Hashtable"], function () {
34348 c$ = Clazz_declareType (jalview.util, "DBRefUtils");
34349 c$.selectRefs = Clazz_defineMethod (c$, "selectRefs", 
34350 function (dbrefs, sources) {
34351 if (dbrefs == null) {
34352 return null;
34353 }if (sources == null) {
34354 return dbrefs;
34355 }var srcs =  new java.util.HashMap ();
34356 var res =  new java.util.ArrayList ();
34357 for (var i = 0; i < sources.length; i++) {
34358 srcs.put ( String.instantialize (sources[i]),  new Integer (i));
34359 }
34360 for (var i = 0, j = dbrefs.length; i < j; i++) {
34361 if (srcs.containsKey (dbrefs[i].getSource ())) {
34362 res.add (dbrefs[i]);
34363 }}
34364 if (res.size () > 0) {
34365 var reply =  new Array (res.size ());
34366 return res.toArray (reply);
34367 }res = null;
34368 return null;
34369 }, "~A,~A");
34370 c$.isDasCoordinateSystem = Clazz_defineMethod (c$, "isDasCoordinateSystem", 
34371 function (string, dBRefEntry) {
34372 if (string == null || dBRefEntry == null) {
34373 return false;
34374 }var coordsys = jalview.util.DBRefUtils.dasCoordinateSystemsLookup.get (string.toLowerCase ());
34375 return coordsys == null ? false : coordsys.equals (dBRefEntry.getSource ());
34376 }, "~S,jalview.datamodel.DBRefEntry");
34377 c$.getCanonicalName = Clazz_defineMethod (c$, "getCanonicalName", 
34378 function (source) {
34379 if (source == null) {
34380 return null;
34381 }var canonical = jalview.util.DBRefUtils.canonicalSourceNameLookup.get (source.toLowerCase ());
34382 return canonical == null ? source : canonical;
34383 }, "~S");
34384 c$.searchRefs = Clazz_defineMethod (c$, "searchRefs", 
34385 function (ref, entry) {
34386 return jalview.util.DBRefUtils.searchRefs (ref, entry, jalview.util.DBRefUtils.matchDbAndIdAndEitherMapOrEquivalentMapList);
34387 }, "~A,jalview.datamodel.DBRefEntry");
34388 c$.searchRefs = Clazz_defineMethod (c$, "searchRefs", 
34389 function (refs, entry, comparator) {
34390 if (refs == null || entry == null) {
34391 return null;
34392 }var rfs =  new java.util.ArrayList ();
34393 for (var i = 0; i < refs.length; i++) {
34394 if (comparator.matches (entry, refs[i])) {
34395 rfs.add (refs[i]);
34396 }}
34397 return rfs.size () == 0 ? null : rfs.toArray ( new Array (rfs.size ()));
34398 }, "~A,jalview.datamodel.DBRefEntry,jalview.util.DBRefUtils.DbRefComp");
34399 c$.parseToDbRef = Clazz_defineMethod (c$, "parseToDbRef", 
34400 function (seq, dbname, version, acn) {
34401 var ref = null;
34402 if (dbname != null) {
34403 var locsrc = jalview.util.DBRefUtils.getCanonicalName (dbname);
34404 if (locsrc.equals (jalview.datamodel.DBRefSource.PDB)) {
34405 var r = jalview.jsdev.RegExp.newRegex (["([0-9][0-9A-Za-z]{3})\\s*(.?)\\s*;\\s*([0-9]+)-([0-9]+)"]);
34406 if (r.search (acn.trim ())) {
34407 var pdbid = r.stringMatchedI (1);
34408 var chaincode = r.stringMatchedI (2);
34409 if (chaincode == null) {
34410 chaincode = " ";
34411 }if (chaincode.equals (" ")) {
34412 chaincode = "_";
34413 }ref =  new jalview.datamodel.DBRefEntry (locsrc, version, pdbid + chaincode);
34414 var pdbr =  new jalview.datamodel.PDBEntry ();
34415 pdbr.setId (pdbid);
34416 pdbr.setType (jalview.datamodel.PDBEntry.Type.PDB);
34417 pdbr.setProperty ( new java.util.Hashtable ());
34418 pdbr.setChainCode (chaincode);
34419 seq.addPDBId (pdbr);
34420 } else {
34421 System.err.println ("Malformed PDB DR line:" + acn);
34422 }} else {
34423 ref =  new jalview.datamodel.DBRefEntry (locsrc, version, acn);
34424 }}if (ref != null) {
34425 seq.addDBRef (ref);
34426 }return ref;
34427 }, "jalview.datamodel.SequenceI,~S,~S,~S");
34428 c$.$DBRefUtils$1$ = function () {
34429 Clazz_pu$h(self.c$);
34430 c$ = Clazz_declareAnonymous (jalview.util, "DBRefUtils$1", null, jalview.util.DBRefUtils.DbRefComp);
34431 Clazz_defineMethod (c$, "matches", 
34432 function (refa, refb) {
34433 if (refa.getSource () == null || refb.getSource ().equals (refa.getSource ())) {
34434 if (refa.getVersion () == null || refb.getVersion ().equals (refa.getVersion ())) {
34435 if (refa.getAccessionId () == null || refb.getAccessionId ().equals (refa.getAccessionId ())) {
34436 if (refa.getMap () == null || (refb.getMap () != null && refb.getMap ().equals (refa.getMap ()))) {
34437 return true;
34438 }}}}return false;
34439 }, "jalview.datamodel.DBRefEntry,jalview.datamodel.DBRefEntry");
34440 c$ = Clazz_p0p ();
34441 };
34442 c$.$DBRefUtils$2$ = function () {
34443 Clazz_pu$h(self.c$);
34444 c$ = Clazz_declareAnonymous (jalview.util, "DBRefUtils$2", null, jalview.util.DBRefUtils.DbRefComp);
34445 Clazz_defineMethod (c$, "matches", 
34446 function (refa, refb) {
34447 if ((refa.getSource () == null || refb.getSource () == null) || refb.getSource ().equals (refa.getSource ())) {
34448 if ((refa.getVersion () == null || refb.getVersion () == null) || refb.getVersion ().equals (refa.getVersion ())) {
34449 if ((refa.getAccessionId () == null || refb.getAccessionId () == null) || refb.getAccessionId ().equals (refa.getAccessionId ())) {
34450 if ((refa.getMap () == null || refb.getMap () == null) || (refb.getMap () != null && refb.getMap ().equals (refa.getMap ()))) {
34451 return true;
34452 }}}}return false;
34453 }, "jalview.datamodel.DBRefEntry,jalview.datamodel.DBRefEntry");
34454 c$ = Clazz_p0p ();
34455 };
34456 c$.$DBRefUtils$3$ = function () {
34457 Clazz_pu$h(self.c$);
34458 c$ = Clazz_declareAnonymous (jalview.util, "DBRefUtils$3", null, jalview.util.DBRefUtils.DbRefComp);
34459 Clazz_defineMethod (c$, "matches", 
34460 function (refa, refb) {
34461 if (refa.getSource () != null && refb.getSource () != null && refb.getSource ().equals (refa.getSource ())) {
34462 if (refa.getAccessionId () != null && refb.getAccessionId () != null || refb.getAccessionId ().equals (refa.getAccessionId ())) {
34463 if ((refa.getMap () == null || refb.getMap () == null) || (refa.getMap () != null && refb.getMap () != null && refb.getMap ().equals (refa.getMap ()))) {
34464 return true;
34465 }}}return false;
34466 }, "jalview.datamodel.DBRefEntry,jalview.datamodel.DBRefEntry");
34467 c$ = Clazz_p0p ();
34468 };
34469 c$.$DBRefUtils$4$ = function () {
34470 Clazz_pu$h(self.c$);
34471 c$ = Clazz_declareAnonymous (jalview.util, "DBRefUtils$4", null, jalview.util.DBRefUtils.DbRefComp);
34472 Clazz_defineMethod (c$, "matches", 
34473 function (refa, refb) {
34474 if (refa.getSource () != null && refb.getSource () != null && refb.getSource ().equals (refa.getSource ())) {
34475 if (refa.getAccessionId () != null && refb.getAccessionId () != null || refb.getAccessionId ().equals (refa.getAccessionId ())) {
34476 if ((refa.getMap () == null && refb.getMap () == null) || (refa.getMap () != null && refb.getMap () != null)) {
34477 if ((refb.getMap ().getMap () == null && refa.getMap ().getMap () == null) || (refb.getMap ().getMap () != null && refa.getMap ().getMap () != null && refb.getMap ().getMap ().getInverse ().equals (refa.getMap ().getMap ()))) {
34478 return true;
34479 }}}}return false;
34480 }, "jalview.datamodel.DBRefEntry,jalview.datamodel.DBRefEntry");
34481 c$ = Clazz_p0p ();
34482 };
34483 c$.$DBRefUtils$5$ = function () {
34484 Clazz_pu$h(self.c$);
34485 c$ = Clazz_declareAnonymous (jalview.util, "DBRefUtils$5", null, jalview.util.DBRefUtils.DbRefComp);
34486 Clazz_defineMethod (c$, "matches", 
34487 function (refa, refb) {
34488 if (refa.getSource () != null && refb.getSource () != null && refb.getSource ().equals (refa.getSource ())) {
34489 if (refa.getAccessionId () != null && refb.getAccessionId () != null || refb.getAccessionId ().equals (refa.getAccessionId ())) {
34490 if (refa.getMap () == null && refb.getMap () == null) {
34491 return true;
34492 }if (refa.getMap () != null && refb.getMap () != null && ((refb.getMap ().getMap () == null && refa.getMap ().getMap () == null) || (refb.getMap ().getMap () != null && refa.getMap ().getMap () != null && refb.getMap ().getMap ().equals (refa.getMap ().getMap ())))) {
34493 return true;
34494 }}}return false;
34495 }, "jalview.datamodel.DBRefEntry,jalview.datamodel.DBRefEntry");
34496 c$ = Clazz_p0p ();
34497 };
34498 c$.$DBRefUtils$6$ = function () {
34499 Clazz_pu$h(self.c$);
34500 c$ = Clazz_declareAnonymous (jalview.util, "DBRefUtils$6", null, jalview.util.DBRefUtils.DbRefComp);
34501 Clazz_defineMethod (c$, "matches", 
34502 function (refa, refb) {
34503 if (refa.getSource () != null && refb.getSource () != null && refb.getSource ().equals (refa.getSource ())) {
34504 if (refa.getAccessionId () != null && refb.getAccessionId () != null && refb.getAccessionId ().equals (refa.getAccessionId ())) {
34505 if (refa.getMap () == null || refb.getMap () == null) {
34506 return true;
34507 }if ((refa.getMap () != null && refb.getMap () != null) && (refb.getMap ().getMap () == null && refa.getMap ().getMap () == null) || (refb.getMap ().getMap () != null && refa.getMap ().getMap () != null && (refb.getMap ().getMap ().equals (refa.getMap ().getMap ())))) {
34508 return true;
34509 }}}return false;
34510 }, "jalview.datamodel.DBRefEntry,jalview.datamodel.DBRefEntry");
34511 c$ = Clazz_p0p ();
34512 };
34513 Clazz_declareInterface (jalview.util.DBRefUtils, "DbRefComp");
34514 c$.canonicalSourceNameLookup = c$.prototype.canonicalSourceNameLookup =  new java.util.HashMap ();
34515 c$.dasCoordinateSystemsLookup = c$.prototype.dasCoordinateSystemsLookup =  new java.util.HashMap ();
34516 {
34517 jalview.util.DBRefUtils.canonicalSourceNameLookup.put ("uniprotkb/swiss-prot", jalview.datamodel.DBRefSource.UNIPROT);
34518 jalview.util.DBRefUtils.canonicalSourceNameLookup.put ("uniprotkb/trembl", jalview.datamodel.DBRefSource.UNIPROT);
34519 jalview.util.DBRefUtils.canonicalSourceNameLookup.put ("pdb", jalview.datamodel.DBRefSource.PDB);
34520 jalview.util.DBRefUtils.dasCoordinateSystemsLookup.put ("pdbresnum", jalview.datamodel.DBRefSource.PDB);
34521 jalview.util.DBRefUtils.dasCoordinateSystemsLookup.put ("uniprot", jalview.datamodel.DBRefSource.UNIPROT);
34522 jalview.util.DBRefUtils.dasCoordinateSystemsLookup.put ("embl", jalview.datamodel.DBRefSource.EMBL);
34523 }c$.matchNonNullonA = c$.prototype.matchNonNullonA = ((Clazz_isClassDefined ("jalview.util.DBRefUtils$1") ? 0 : jalview.util.DBRefUtils.$DBRefUtils$1$ ()), Clazz_innerTypeInstance (jalview.util.DBRefUtils$1, this, null));
34524 c$.matchEitherNonNull = c$.prototype.matchEitherNonNull = ((Clazz_isClassDefined ("jalview.util.DBRefUtils$2") ? 0 : jalview.util.DBRefUtils.$DBRefUtils$2$ ()), Clazz_innerTypeInstance (jalview.util.DBRefUtils$2, this, null));
34525 c$.matchDbAndIdAndEitherMap = c$.prototype.matchDbAndIdAndEitherMap = ((Clazz_isClassDefined ("jalview.util.DBRefUtils$3") ? 0 : jalview.util.DBRefUtils.$DBRefUtils$3$ ()), Clazz_innerTypeInstance (jalview.util.DBRefUtils$3, this, null));
34526 c$.matchDbAndIdAndComplementaryMapList = c$.prototype.matchDbAndIdAndComplementaryMapList = ((Clazz_isClassDefined ("jalview.util.DBRefUtils$4") ? 0 : jalview.util.DBRefUtils.$DBRefUtils$4$ ()), Clazz_innerTypeInstance (jalview.util.DBRefUtils$4, this, null));
34527 c$.matchDbAndIdAndEquivalentMapList = c$.prototype.matchDbAndIdAndEquivalentMapList = ((Clazz_isClassDefined ("jalview.util.DBRefUtils$5") ? 0 : jalview.util.DBRefUtils.$DBRefUtils$5$ ()), Clazz_innerTypeInstance (jalview.util.DBRefUtils$5, this, null));
34528 c$.matchDbAndIdAndEitherMapOrEquivalentMapList = c$.prototype.matchDbAndIdAndEitherMapOrEquivalentMapList = ((Clazz_isClassDefined ("jalview.util.DBRefUtils$6") ? 0 : jalview.util.DBRefUtils.$DBRefUtils$6$ ()), Clazz_innerTypeInstance (jalview.util.DBRefUtils$6, this, null));
34529 });
34530 Clazz_load(["java.util.AbstractCollection","$.AbstractMap","$.AbstractSet","$.Iterator","$.MapEntry","$.Set","$.SortedMap"],"java.util.TreeMap",["java.lang.IllegalArgumentException","$.IllegalStateException","java.util.ConcurrentModificationException","$.NoSuchElementException"],function(){
34531 c$=Clazz_decorateAsClass(function(){
34532 this.$size=0;
34533 this.root=null;
34534 this.$comparator=null;
34535 this.modCount=0;
34536 this.$entrySet=null;
34537 Clazz_instantialize(this,arguments);
34538 },java.util,"TreeMap",java.util.AbstractMap,[java.util.SortedMap,Cloneable,java.io.Serializable]);
34539 c$.toComparable=Clazz_defineMethod(c$,"toComparable",
34540 ($fz=function(obj){
34541 return obj;
34542 },$fz.isPrivate=true,$fz),"~O");
34543 Clazz_makeConstructor(c$,
34544 function(comparator){
34545 Clazz_superConstructor(this,java.util.TreeMap,[]);
34546 this.$comparator=comparator;
34547 },"java.util.Comparator");
34548 Clazz_makeConstructor(c$,
34549 function(map){
34550 this.construct();
34551 this.putAll(map);
34552 },"java.util.Map");
34553 Clazz_makeConstructor(c$,
34554 function(map){
34555 this.construct(map.comparator());
34556 var it=map.entrySet().iterator();
34557 if(it.hasNext()){
34558 var entry=it.next();
34559 var last=new java.util.TreeMap.Entry(entry.getKey(),entry.getValue());
34560 this.root=last;
34561 this.$size=1;
34562 while(it.hasNext()){
34563 entry=it.next();
34564 var x=new java.util.TreeMap.Entry(entry.getKey(),entry.getValue());
34565 x.parent=last;
34566 last.right=x;
34567 this.$size++;
34568 this.balance(x);
34569 last=x;
34570 }
34571 }},"java.util.SortedMap");
34572 Clazz_defineMethod(c$,"balance",
34573 function(x){
34574 var y;
34575 x.color=true;
34576 while(x!==this.root&&x.parent.color){
34577 if(x.parent===x.parent.parent.left){
34578 y=x.parent.parent.right;
34579 if(y!=null&&y.color){
34580 x.parent.color=false;
34581 y.color=false;
34582 x.parent.parent.color=true;
34583 x=x.parent.parent;
34584 }else{
34585 if(x===x.parent.right){
34586 x=x.parent;
34587 this.leftRotate(x);
34588 }x.parent.color=false;
34589 x.parent.parent.color=true;
34590 this.rightRotate(x.parent.parent);
34591 }}else{
34592 y=x.parent.parent.left;
34593 if(y!=null&&y.color){
34594 x.parent.color=false;
34595 y.color=false;
34596 x.parent.parent.color=true;
34597 x=x.parent.parent;
34598 }else{
34599 if(x===x.parent.left){
34600 x=x.parent;
34601 this.rightRotate(x);
34602 }x.parent.color=false;
34603 x.parent.parent.color=true;
34604 this.leftRotate(x.parent.parent);
34605 }}}
34606 this.root.color=false;
34607 },"java.util.TreeMap.Entry");
34608 Clazz_overrideMethod(c$,"clear",
34609 function(){
34610 this.root=null;
34611 this.$size=0;
34612 this.modCount++;
34613 });
34614 Clazz_defineMethod(c$,"clone",
34615 function(){
34616 try{
34617 var clone=Clazz_superCall(this,java.util.TreeMap,"clone",[]);
34618 clone.$entrySet=null;
34619 if(this.root!=null){
34620 clone.root=this.root.clone(null);
34621 }return clone;
34622 }catch(e){
34623 if(Clazz_instanceOf(e,CloneNotSupportedException)){
34624 return null;
34625 }else{
34626 throw e;
34627 }
34628 }
34629 });
34630 Clazz_overrideMethod(c$,"comparator",
34631 function(){
34632 return this.$comparator;
34633 });
34634 Clazz_overrideMethod(c$,"containsKey",
34635 function(key){
34636 return this.find(key)!=null;
34637 },"~O");
34638 Clazz_defineMethod(c$,"containsValue",
34639 function(value){
34640 if(this.root!=null){
34641 return this.containsValue(this.root,value);
34642 }return false;
34643 },"~O");
34644 Clazz_defineMethod(c$,"containsValue",
34645 ($fz=function(node,value){
34646 if(value==null?node.value==null:value.equals(node.value)){
34647 return true;
34648 }if(node.left!=null){
34649 if(this.containsValue(node.left,value)){
34650 return true;
34651 }}if(node.right!=null){
34652 if(this.containsValue(node.right,value)){
34653 return true;
34654 }}return false;
34655 },$fz.isPrivate=true,$fz),"java.util.TreeMap.Entry,~O");
34656 Clazz_overrideMethod(c$,"entrySet",
34657 function(){
34658 if(this.$entrySet==null){
34659 this.$entrySet=((Clazz_isClassDefined("java.util.TreeMap$1")?0:java.util.TreeMap.$TreeMap$1$()),Clazz_innerTypeInstance(java.util.TreeMap$1,this,null));
34660 }return this.$entrySet;
34661 });
34662 Clazz_defineMethod(c$,"find",
34663 ($fz=function(keyObj){
34664 var result;
34665 var key=keyObj;
34666 var object=null;
34667 if(this.$comparator==null){
34668 object=java.util.TreeMap.toComparable(key);
34669 }var x=this.root;
34670 while(x!=null){
34671 result=object!=null?object.compareTo(x.key):this.$comparator.compare(key,x.key);
34672 if(result==0){
34673 return x;
34674 }x=result<0?x.left:x.right;
34675 }
34676 return null;
34677 },$fz.isPrivate=true,$fz),"~O");
34678 Clazz_defineMethod(c$,"findAfter",
34679 function(keyObj){
34680 var key=keyObj;
34681 var result;
34682 var object=null;
34683 if(this.$comparator==null){
34684 object=java.util.TreeMap.toComparable(key);
34685 }var x=this.root;
34686 var last=null;
34687 while(x!=null){
34688 result=object!=null?object.compareTo(x.key):this.$comparator.compare(key,x.key);
34689 if(result==0){
34690 return x;
34691 }if(result<0){
34692 last=x;
34693 x=x.left;
34694 }else{
34695 x=x.right;
34696 }}
34697 return last;
34698 },"~O");
34699 Clazz_defineMethod(c$,"findBefore",
34700 function(key){
34701 var result;
34702 var object=null;
34703 if(this.$comparator==null){
34704 object=java.util.TreeMap.toComparable(key);
34705 }var x=this.root;
34706 var last=null;
34707 while(x!=null){
34708 result=object!=null?object.compareTo(x.key):this.$comparator.compare(key,x.key);
34709 if(result<=0){
34710 x=x.left;
34711 }else{
34712 last=x;
34713 x=x.right;
34714 }}
34715 return last;
34716 },"~O");
34717 Clazz_overrideMethod(c$,"firstKey",
34718 function(){
34719 if(this.root!=null){
34720 return java.util.TreeMap.minimum(this.root).key;
34721 }throw new java.util.NoSuchElementException();
34722 });
34723 Clazz_defineMethod(c$,"fixup",
34724 ($fz=function(x){
34725 var w;
34726 while(x!==this.root&&!x.color){
34727 if(x===x.parent.left){
34728 w=x.parent.right;
34729 if(w==null){
34730 x=x.parent;
34731 continue;}if(w.color){
34732 w.color=false;
34733 x.parent.color=true;
34734 this.leftRotate(x.parent);
34735 w=x.parent.right;
34736 if(w==null){
34737 x=x.parent;
34738 continue;}}if((w.left==null||!w.left.color)&&(w.right==null||!w.right.color)){
34739 w.color=true;
34740 x=x.parent;
34741 }else{
34742 if(w.right==null||!w.right.color){
34743 w.left.color=false;
34744 w.color=true;
34745 this.rightRotate(w);
34746 w=x.parent.right;
34747 }w.color=x.parent.color;
34748 x.parent.color=false;
34749 w.right.color=false;
34750 this.leftRotate(x.parent);
34751 x=this.root;
34752 }}else{
34753 w=x.parent.left;
34754 if(w==null){
34755 x=x.parent;
34756 continue;}if(w.color){
34757 w.color=false;
34758 x.parent.color=true;
34759 this.rightRotate(x.parent);
34760 w=x.parent.left;
34761 if(w==null){
34762 x=x.parent;
34763 continue;}}if((w.left==null||!w.left.color)&&(w.right==null||!w.right.color)){
34764 w.color=true;
34765 x=x.parent;
34766 }else{
34767 if(w.left==null||!w.left.color){
34768 w.right.color=false;
34769 w.color=true;
34770 this.leftRotate(w);
34771 w=x.parent.left;
34772 }w.color=x.parent.color;
34773 x.parent.color=false;
34774 w.left.color=false;
34775 this.rightRotate(x.parent);
34776 x=this.root;
34777 }}}
34778 x.color=false;
34779 },$fz.isPrivate=true,$fz),"java.util.TreeMap.Entry");
34780 Clazz_overrideMethod(c$,"get",
34781 function(key){
34782 var node=this.find(key);
34783 if(node!=null){
34784 return node.value;
34785 }return null;
34786 },"~O");
34787 Clazz_overrideMethod(c$,"headMap",
34788 function(endKey){
34789 if(this.$comparator==null){
34790 java.util.TreeMap.toComparable(endKey).compareTo(endKey);
34791 }else{
34792 this.$comparator.compare(endKey,endKey);
34793 }return new java.util.TreeMap.SubMap(this,endKey);
34794 },"~O");
34795 Clazz_overrideMethod(c$,"keySet",
34796 function(){
34797 if(this.$keySet==null){
34798 this.$keySet=((Clazz_isClassDefined("java.util.TreeMap$2")?0:java.util.TreeMap.$TreeMap$2$()),Clazz_innerTypeInstance(java.util.TreeMap$2,this,null));
34799 }return this.$keySet;
34800 });
34801 Clazz_overrideMethod(c$,"lastKey",
34802 function(){
34803 if(this.root!=null){
34804 return java.util.TreeMap.maximum(this.root).key;
34805 }throw new java.util.NoSuchElementException();
34806 });
34807 Clazz_defineMethod(c$,"leftRotate",
34808 ($fz=function(x){
34809 var y=x.right;
34810 x.right=y.left;
34811 if(y.left!=null){
34812 y.left.parent=x;
34813 }y.parent=x.parent;
34814 if(x.parent==null){
34815 this.root=y;
34816 }else{
34817 if(x===x.parent.left){
34818 x.parent.left=y;
34819 }else{
34820 x.parent.right=y;
34821 }}y.left=x;
34822 x.parent=y;
34823 },$fz.isPrivate=true,$fz),"java.util.TreeMap.Entry");
34824 c$.maximum=Clazz_defineMethod(c$,"maximum",
34825 function(x){
34826 while(x.right!=null){
34827 x=x.right;
34828 }
34829 return x;
34830 },"java.util.TreeMap.Entry");
34831 c$.minimum=Clazz_defineMethod(c$,"minimum",
34832 function(x){
34833 while(x.left!=null){
34834 x=x.left;
34835 }
34836 return x;
34837 },"java.util.TreeMap.Entry");
34838 c$.predecessor=Clazz_defineMethod(c$,"predecessor",
34839 function(x){
34840 if(x.left!=null){
34841 return java.util.TreeMap.maximum(x.left);
34842 }var y=x.parent;
34843 while(y!=null&&x===y.left){
34844 x=y;
34845 y=y.parent;
34846 }
34847 return y;
34848 },"java.util.TreeMap.Entry");
34849 Clazz_overrideMethod(c$,"put",
34850 function(key,value){
34851 var entry=this.rbInsert(key);
34852 var result=entry.value;
34853 entry.value=value;
34854 return result;
34855 },"~O,~O");
34856 Clazz_defineMethod(c$,"rbDelete",
34857 function(z){
34858 var y=z.left==null||z.right==null?z:java.util.TreeMap.successor(z);
34859 var x=y.left!=null?y.left:y.right;
34860 if(x!=null){
34861 x.parent=y.parent;
34862 }if(y.parent==null){
34863 this.root=x;
34864 }else if(y===y.parent.left){
34865 y.parent.left=x;
34866 }else{
34867 y.parent.right=x;
34868 }this.modCount++;
34869 if(y!==z){
34870 z.key=y.key;
34871 z.value=y.value;
34872 }if(!y.color&&this.root!=null){
34873 if(x==null){
34874 this.fixup(y.parent);
34875 }else{
34876 this.fixup(x);
34877 }}this.$size--;
34878 },"java.util.TreeMap.Entry");
34879 Clazz_defineMethod(c$,"rbInsert",
34880 ($fz=function(object){
34881 var result=0;
34882 var y=null;
34883 if(this.$size!=0){
34884 var key=null;
34885 if(this.$comparator==null){
34886 key=java.util.TreeMap.toComparable(object);
34887 }var x=this.root;
34888 while(x!=null){
34889 y=x;
34890 result=key!=null?key.compareTo(x.key):this.$comparator.compare(object,x.key);
34891 if(result==0){
34892 return x;
34893 }x=result<0?x.left:x.right;
34894 }
34895 }this.$size++;
34896 this.modCount++;
34897 var z=new java.util.TreeMap.Entry(object);
34898 if(y==null){
34899 return this.root=z;
34900 }z.parent=y;
34901 if(result<0){
34902 y.left=z;
34903 }else{
34904 y.right=z;
34905 }this.balance(z);
34906 return z;
34907 },$fz.isPrivate=true,$fz),"~O");
34908 Clazz_overrideMethod(c$,"remove",
34909 function(key){
34910 var node=this.find(key);
34911 if(node==null){
34912 return null;
34913 }var result=node.value;
34914 this.rbDelete(node);
34915 return result;
34916 },"~O");
34917 Clazz_defineMethod(c$,"rightRotate",
34918 ($fz=function(x){
34919 var y=x.left;
34920 x.left=y.right;
34921 if(y.right!=null){
34922 y.right.parent=x;
34923 }y.parent=x.parent;
34924 if(x.parent==null){
34925 this.root=y;
34926 }else{
34927 if(x===x.parent.right){
34928 x.parent.right=y;
34929 }else{
34930 x.parent.left=y;
34931 }}y.right=x;
34932 x.parent=y;
34933 },$fz.isPrivate=true,$fz),"java.util.TreeMap.Entry");
34934 Clazz_overrideMethod(c$,"size",
34935 function(){
34936 return this.$size;
34937 });
34938 Clazz_overrideMethod(c$,"subMap",
34939 function(startKey,endKey){
34940 if(this.$comparator==null){
34941 if(java.util.TreeMap.toComparable(startKey).compareTo(endKey)<=0){
34942 return new java.util.TreeMap.SubMap(startKey,this,endKey);
34943 }}else{
34944 if(this.$comparator.compare(startKey,endKey)<=0){
34945 return new java.util.TreeMap.SubMap(startKey,this,endKey);
34946 }}throw new IllegalArgumentException();
34947 },"~O,~O");
34948 c$.successor=Clazz_defineMethod(c$,"successor",
34949 function(x){
34950 if(x.right!=null){
34951 return java.util.TreeMap.minimum(x.right);
34952 }var y=x.parent;
34953 while(y!=null&&x===y.right){
34954 x=y;
34955 y=y.parent;
34956 }
34957 return y;
34958 },"java.util.TreeMap.Entry");
34959 Clazz_overrideMethod(c$,"tailMap",
34960 function(startKey){
34961 if(this.$comparator==null){
34962 java.util.TreeMap.toComparable(startKey).compareTo(startKey);
34963 }else{
34964 this.$comparator.compare(startKey,startKey);
34965 }return new java.util.TreeMap.SubMap(startKey,this);
34966 },"~O");
34967 Clazz_overrideMethod(c$,"values",
34968 function(){
34969 if(this.valuesCollection==null){
34970 this.valuesCollection=((Clazz_isClassDefined("java.util.TreeMap$3")?0:java.util.TreeMap.$TreeMap$3$()),Clazz_innerTypeInstance(java.util.TreeMap$3,this,null));
34971 }return this.valuesCollection;
34972 });
34973 c$.$TreeMap$1$=function(){
34974 Clazz_pu$h(self.c$);
34975 c$=Clazz_declareAnonymous(java.util,"TreeMap$1",java.util.AbstractSet);
34976 Clazz_overrideMethod(c$,"size",
34977 function(){
34978 return this.b$["java.util.TreeMap"].$size;
34979 });
34980 Clazz_overrideMethod(c$,"clear",
34981 function(){
34982 this.b$["java.util.TreeMap"].clear();
34983 });
34984 Clazz_overrideMethod(c$,"contains",
34985 function(object){
34986 if(Clazz_instanceOf(object,java.util.Map.Entry)){
34987 var entry=object;
34988 var v1=this.b$["java.util.TreeMap"].get(entry.getKey());
34989 var v2=entry.getValue();
34990 return v1==null?v2==null:v1.equals(v2);
34991 }return false;
34992 },"~O");
34993 Clazz_defineMethod(c$,"iterator",
34994 function(){
34995 return new java.util.TreeMap.UnboundedEntryIterator(this.b$["java.util.TreeMap"]);
34996 });
34997 c$=Clazz_p0p();
34998 };
34999 c$.$TreeMap$2$=function(){
35000 Clazz_pu$h(self.c$);
35001 c$=Clazz_declareAnonymous(java.util,"TreeMap$2",java.util.AbstractSet);
35002 Clazz_overrideMethod(c$,"contains",
35003 function(object){
35004 return this.b$["java.util.TreeMap"].containsKey(object);
35005 },"~O");
35006 Clazz_overrideMethod(c$,"size",
35007 function(){
35008 return this.b$["java.util.TreeMap"].$size;
35009 });
35010 Clazz_overrideMethod(c$,"clear",
35011 function(){
35012 this.b$["java.util.TreeMap"].clear();
35013 });
35014 Clazz_overrideMethod(c$,"iterator",
35015 function(){
35016 return new java.util.TreeMap.UnboundedKeyIterator(this.b$["java.util.TreeMap"]);
35017 });
35018 c$=Clazz_p0p();
35019 };
35020 c$.$TreeMap$3$=function(){
35021 Clazz_pu$h(self.c$);
35022 c$=Clazz_declareAnonymous(java.util,"TreeMap$3",java.util.AbstractCollection);
35023 Clazz_overrideMethod(c$,"contains",
35024 function(object){
35025 return this.b$["java.util.TreeMap"].containsValue(object);
35026 },"~O");
35027 Clazz_overrideMethod(c$,"size",
35028 function(){
35029 return this.b$["java.util.TreeMap"].$size;
35030 });
35031 Clazz_overrideMethod(c$,"clear",
35032 function(){
35033 this.b$["java.util.TreeMap"].clear();
35034 });
35035 Clazz_overrideMethod(c$,"iterator",
35036 function(){
35037 return new java.util.TreeMap.UnboundedValueIterator(this.b$["java.util.TreeMap"]);
35038 });
35039 c$=Clazz_p0p();
35040 };
35041 Clazz_pu$h(self.c$);
35042 c$=Clazz_decorateAsClass(function(){
35043 this.parent=null;
35044 this.left=null;
35045 this.right=null;
35046 this.color=false;
35047 Clazz_instantialize(this,arguments);
35048 },java.util.TreeMap,"Entry",java.util.MapEntry);
35049 Clazz_defineMethod(c$,"clone",
35050 function(a){
35051 var b=Clazz_superCall(this,java.util.TreeMap.Entry,"clone",[]);
35052 b.parent=a;
35053 if(this.left!=null){
35054 b.left=this.left.clone(b);
35055 }if(this.right!=null){
35056 b.right=this.right.clone(b);
35057 }return b;
35058 },"java.util.TreeMap.Entry");
35059 c$=Clazz_p0p();
35060 Clazz_pu$h(self.c$);
35061 c$=Clazz_decorateAsClass(function(){
35062 this.backingMap=null;
35063 this.expectedModCount=0;
35064 this.node=null;
35065 this.lastNode=null;
35066 Clazz_instantialize(this,arguments);
35067 },java.util.TreeMap,"AbstractMapIterator");
35068 Clazz_makeConstructor(c$,
35069 function(a,b){
35070 this.backingMap=a;
35071 this.expectedModCount=a.modCount;
35072 this.node=b;
35073 },"java.util.TreeMap,java.util.TreeMap.Entry");
35074 Clazz_defineMethod(c$,"hasNext",
35075 function(){
35076 return this.node!=null;
35077 });
35078 Clazz_defineMethod(c$,"remove",
35079 function(){
35080 if(this.expectedModCount==this.backingMap.modCount){
35081 if(this.lastNode!=null){
35082 this.backingMap.rbDelete(this.lastNode);
35083 this.lastNode=null;
35084 this.expectedModCount++;
35085 }else{
35086 throw new IllegalStateException();
35087 }}else{
35088 throw new java.util.ConcurrentModificationException();
35089 }});
35090 Clazz_defineMethod(c$,"makeNext",
35091 function(){
35092 if(this.expectedModCount!=this.backingMap.modCount){
35093 throw new java.util.ConcurrentModificationException();
35094 }else if(this.node==null){
35095 throw new java.util.NoSuchElementException();
35096 }this.lastNode=this.node;
35097 this.node=java.util.TreeMap.successor(this.node);
35098 });
35099 c$=Clazz_p0p();
35100 Clazz_pu$h(self.c$);
35101 c$=Clazz_declareType(java.util.TreeMap,"UnboundedEntryIterator",java.util.TreeMap.AbstractMapIterator,java.util.Iterator);
35102 Clazz_makeConstructor(c$,
35103 function(a){
35104 Clazz_superConstructor(this,java.util.TreeMap.UnboundedEntryIterator,[a,a.root==null?null:java.util.TreeMap.minimum(a.root)]);
35105 },"java.util.TreeMap");
35106 Clazz_overrideMethod(c$,"next",
35107 function(){
35108 this.makeNext();
35109 return this.lastNode;
35110 });
35111 c$=Clazz_p0p();
35112 Clazz_pu$h(self.c$);
35113 c$=Clazz_declareType(java.util.TreeMap,"UnboundedKeyIterator",java.util.TreeMap.AbstractMapIterator,java.util.Iterator);
35114 Clazz_makeConstructor(c$,
35115 function(a){
35116 Clazz_superConstructor(this,java.util.TreeMap.UnboundedKeyIterator,[a,a.root==null?null:java.util.TreeMap.minimum(a.root)]);
35117 },"java.util.TreeMap");
35118 Clazz_overrideMethod(c$,"next",
35119 function(){
35120 this.makeNext();
35121 return this.lastNode.key;
35122 });
35123 c$=Clazz_p0p();
35124 Clazz_pu$h(self.c$);
35125 c$=Clazz_declareType(java.util.TreeMap,"UnboundedValueIterator",java.util.TreeMap.AbstractMapIterator,java.util.Iterator);
35126 Clazz_makeConstructor(c$,
35127 function(a){
35128 Clazz_superConstructor(this,java.util.TreeMap.UnboundedValueIterator,[a,a.root==null?null:java.util.TreeMap.minimum(a.root)]);
35129 },"java.util.TreeMap");
35130 Clazz_overrideMethod(c$,"next",
35131 function(){
35132 this.makeNext();
35133 return this.lastNode.value;
35134 });
35135 c$=Clazz_p0p();
35136 Clazz_pu$h(self.c$);
35137 c$=Clazz_decorateAsClass(function(){
35138 this.endKey=null;
35139 this.cmp=null;
35140 Clazz_instantialize(this,arguments);
35141 },java.util.TreeMap,"ComparatorBoundedIterator",java.util.TreeMap.AbstractMapIterator);
35142 Clazz_makeConstructor(c$,
35143 function(a,b,c){
35144 Clazz_superConstructor(this,java.util.TreeMap.ComparatorBoundedIterator,[a,b]);
35145 this.endKey=c;
35146 this.cmp=a.comparator();
35147 },"java.util.TreeMap,java.util.TreeMap.Entry,~O");
35148 Clazz_defineMethod(c$,"cleanNext",
35149 function(){
35150 if(this.node!=null&&this.cmp.compare(this.endKey,this.node.key)<=0){
35151 this.node=null;
35152 }});
35153 Clazz_overrideMethod(c$,"hasNext",
35154 function(){
35155 return(this.node!=null&&this.endKey!=null)&&(this.cmp.compare(this.node.key,this.endKey)<0);
35156 });
35157 c$=Clazz_p0p();
35158 Clazz_pu$h(self.c$);
35159 c$=Clazz_declareType(java.util.TreeMap,"ComparatorBoundedEntryIterator",java.util.TreeMap.ComparatorBoundedIterator,java.util.Iterator);
35160 Clazz_overrideMethod(c$,"next",
35161 function(){
35162 this.makeNext();
35163 this.cleanNext();
35164 return this.lastNode;
35165 });
35166 c$=Clazz_p0p();
35167 Clazz_pu$h(self.c$);
35168 c$=Clazz_declareType(java.util.TreeMap,"ComparatorBoundedKeyIterator",java.util.TreeMap.ComparatorBoundedIterator,java.util.Iterator);
35169 Clazz_overrideMethod(c$,"next",
35170 function(){
35171 this.makeNext();
35172 this.cleanNext();
35173 return this.lastNode.key;
35174 });
35175 c$=Clazz_p0p();
35176 Clazz_pu$h(self.c$);
35177 c$=Clazz_declareType(java.util.TreeMap,"ComparatorBoundedValueIterator",java.util.TreeMap.ComparatorBoundedIterator,java.util.Iterator);
35178 Clazz_overrideMethod(c$,"next",
35179 function(){
35180 this.makeNext();
35181 this.cleanNext();
35182 return this.lastNode.value;
35183 });
35184 c$=Clazz_p0p();
35185 Clazz_pu$h(self.c$);
35186 c$=Clazz_decorateAsClass(function(){
35187 this.endKey=null;
35188 Clazz_instantialize(this,arguments);
35189 },java.util.TreeMap,"ComparableBoundedIterator",java.util.TreeMap.AbstractMapIterator);
35190 Clazz_makeConstructor(c$,
35191 function(a,b,c){
35192 Clazz_superConstructor(this,java.util.TreeMap.ComparableBoundedIterator,[a,b]);
35193 this.endKey=c;
35194 },"java.util.TreeMap,java.util.TreeMap.Entry,Comparable");
35195 Clazz_defineMethod(c$,"cleanNext",
35196 function(){
35197 if((this.node!=null)&&(this.endKey.compareTo(this.node.key)<=0)){
35198 this.node=null;
35199 }});
35200 Clazz_overrideMethod(c$,"hasNext",
35201 function(){
35202 return(this.node!=null)&&(this.endKey.compareTo(this.node.key)>0);
35203 });
35204 c$=Clazz_p0p();
35205 Clazz_pu$h(self.c$);
35206 c$=Clazz_declareType(java.util.TreeMap,"ComparableBoundedEntryIterator",java.util.TreeMap.ComparableBoundedIterator,java.util.Iterator);
35207 Clazz_overrideMethod(c$,"next",
35208 function(){
35209 this.makeNext();
35210 this.cleanNext();
35211 return this.lastNode;
35212 });
35213 c$=Clazz_p0p();
35214 Clazz_pu$h(self.c$);
35215 c$=Clazz_declareType(java.util.TreeMap,"ComparableBoundedKeyIterator",java.util.TreeMap.ComparableBoundedIterator,java.util.Iterator);
35216 Clazz_overrideMethod(c$,"next",
35217 function(){
35218 this.makeNext();
35219 this.cleanNext();
35220 return this.lastNode.key;
35221 });
35222 c$=Clazz_p0p();
35223 Clazz_pu$h(self.c$);
35224 c$=Clazz_declareType(java.util.TreeMap,"ComparableBoundedValueIterator",java.util.TreeMap.ComparableBoundedIterator,java.util.Iterator);
35225 Clazz_overrideMethod(c$,"next",
35226 function(){
35227 this.makeNext();
35228 this.cleanNext();
35229 return this.lastNode.value;
35230 });
35231 c$=Clazz_p0p();
35232 Clazz_pu$h(self.c$);
35233 c$=Clazz_decorateAsClass(function(){
35234 this.backingMap=null;
35235 this.hasStart=false;
35236 this.hasEnd=false;
35237 this.startKey=null;
35238 this.endKey=null;
35239 this.$entrySet=null;
35240 Clazz_instantialize(this,arguments);
35241 },java.util.TreeMap,"SubMap",java.util.AbstractMap,[java.util.SortedMap,java.io.Serializable]);
35242 Clazz_makeConstructor(c$,
35243 function(a,b){
35244 Clazz_superConstructor(this,java.util.TreeMap.SubMap,[]);
35245 this.backingMap=b;
35246 this.hasStart=true;
35247 this.startKey=a;
35248 },"~O,java.util.TreeMap");
35249 Clazz_makeConstructor(c$,
35250 function(a,b,c){
35251 Clazz_superConstructor(this,java.util.TreeMap.SubMap,[]);
35252 this.backingMap=b;
35253 this.hasStart=this.hasEnd=true;
35254 this.startKey=a;
35255 this.endKey=c;
35256 },"~O,java.util.TreeMap,~O");
35257 Clazz_makeConstructor(c$,
35258 function(a,b){
35259 Clazz_superConstructor(this,java.util.TreeMap.SubMap,[]);
35260 this.backingMap=a;
35261 this.hasEnd=true;
35262 this.endKey=b;
35263 },"java.util.TreeMap,~O");
35264 Clazz_overrideMethod(c$,"comparator",
35265 function(){
35266 return this.backingMap.comparator();
35267 });
35268 Clazz_overrideMethod(c$,"containsKey",
35269 function(a){
35270 if(this.isInRange(a)){
35271 return this.backingMap.containsKey(a);
35272 }return false;
35273 },"~O");
35274 Clazz_overrideMethod(c$,"entrySet",
35275 function(){
35276 if(this.$entrySet==null){
35277 this.$entrySet=new java.util.TreeMap.SubMapEntrySet(this);
35278 }return this.$entrySet;
35279 });
35280 Clazz_overrideMethod(c$,"firstKey",
35281 function(){
35282 var a=this.firstEntry();
35283 if(a!=null){
35284 return a.key;
35285 }throw new java.util.NoSuchElementException();
35286 });
35287 Clazz_defineMethod(c$,"firstEntry",
35288 function(){
35289 if(!this.hasStart){
35290 var a=this.backingMap.root;
35291 return(a==null)?null:java.util.TreeMap.minimum(this.backingMap.root);
35292 }var a=this.backingMap.findAfter(this.startKey);
35293 if(a!=null&&this.checkUpperBound(a.key)){
35294 return a;
35295 }return null;
35296 });
35297 Clazz_overrideMethod(c$,"get",
35298 function(a){
35299 if(this.isInRange(a)){
35300 return this.backingMap.get(a);
35301 }return null;
35302 },"~O");
35303 Clazz_overrideMethod(c$,"headMap",
35304 function(a){
35305 this.checkRange(a);
35306 if(this.hasStart){
35307 return new java.util.TreeMap.SubMap(this.startKey,this.backingMap,a);
35308 }return new java.util.TreeMap.SubMap(this.backingMap,a);
35309 },"~O");
35310 Clazz_overrideMethod(c$,"isEmpty",
35311 function(){
35312 if(this.hasStart){
35313 var a=this.backingMap.findAfter(this.startKey);
35314 return a==null||!this.checkUpperBound(a.key);
35315 }return this.backingMap.findBefore(this.endKey)==null;
35316 });
35317 Clazz_overrideMethod(c$,"keySet",
35318 function(){
35319 if(this.$keySet==null){
35320 this.$keySet=new java.util.TreeMap.SubMapKeySet(this);
35321 }return this.$keySet;
35322 });
35323 Clazz_overrideMethod(c$,"lastKey",
35324 function(){
35325 if(!this.hasEnd){
35326 return this.backingMap.lastKey();
35327 }var a=this.backingMap.findBefore(this.endKey);
35328 if(a!=null&&this.checkLowerBound(a.key)){
35329 return a.key;
35330 }throw new java.util.NoSuchElementException();
35331 });
35332 Clazz_overrideMethod(c$,"put",
35333 function(a,b){
35334 if(this.isInRange(a)){
35335 return this.backingMap.put(a,b);
35336 }throw new IllegalArgumentException();
35337 },"~O,~O");
35338 Clazz_overrideMethod(c$,"remove",
35339 function(a){
35340 if(this.isInRange(a)){
35341 return this.backingMap.remove(a);
35342 }return null;
35343 },"~O");
35344 Clazz_overrideMethod(c$,"subMap",
35345 function(a,b){
35346 this.checkRange(a);
35347 this.checkRange(b);
35348 var c=this.backingMap.comparator();
35349 if(c==null){
35350 if(java.util.TreeMap.toComparable(a).compareTo(b)<=0){
35351 return new java.util.TreeMap.SubMap(a,this.backingMap,b);
35352 }}else{
35353 if(c.compare(a,b)<=0){
35354 return new java.util.TreeMap.SubMap(a,this.backingMap,b);
35355 }}throw new IllegalArgumentException();
35356 },"~O,~O");
35357 Clazz_overrideMethod(c$,"tailMap",
35358 function(a){
35359 this.checkRange(a);
35360 if(this.hasEnd){
35361 return new java.util.TreeMap.SubMap(a,this.backingMap,this.endKey);
35362 }return new java.util.TreeMap.SubMap(a,this.backingMap);
35363 },"~O");
35364 Clazz_overrideMethod(c$,"values",
35365 function(){
35366 if(this.valuesCollection==null){
35367 this.valuesCollection=new java.util.TreeMap.SubMapValuesCollection(this);
35368 }return this.valuesCollection;
35369 });
35370 c$=Clazz_p0p();
35371 Clazz_pu$h(self.c$);
35372 c$=Clazz_decorateAsClass(function(){
35373 this.subMap=null;
35374 Clazz_instantialize(this,arguments);
35375 },java.util.TreeMap,"SubMapEntrySet",java.util.AbstractSet,java.util.Set);
35376 Clazz_makeConstructor(c$,
35377 function(a){
35378 Clazz_superConstructor(this,java.util.TreeMap.SubMapEntrySet,[]);
35379 this.subMap=a;
35380 },"java.util.TreeMap.SubMap");
35381 Clazz_overrideMethod(c$,"isEmpty",
35382 function(){
35383 return this.subMap.isEmpty();
35384 });
35385 Clazz_overrideMethod(c$,"iterator",
35386 function(){
35387 var a=this.subMap.firstEntry();
35388 if(this.subMap.hasEnd){
35389 var b=this.subMap.comparator();
35390 if(b==null){
35391 return new java.util.TreeMap.ComparableBoundedEntryIterator(this.subMap.backingMap,a,java.util.TreeMap.toComparable(this.subMap.endKey));
35392 }return new java.util.TreeMap.ComparatorBoundedEntryIterator(this.subMap.backingMap,a,this.subMap.endKey);
35393 }return new java.util.TreeMap.UnboundedEntryIterator(this.subMap.backingMap,a);
35394 });
35395 Clazz_overrideMethod(c$,"size",
35396 function(){
35397 var a=0;
35398 var b=this.iterator();
35399 while(b.hasNext()){
35400 a++;
35401 b.next();
35402 }
35403 return a;
35404 });
35405 Clazz_overrideMethod(c$,"contains",
35406 function(a){
35407 if(Clazz_instanceOf(a,java.util.Map.Entry)){
35408 var b=a;
35409 var c=b.getKey();
35410 if(this.subMap.isInRange(c)){
35411 var d=this.subMap.get(c);
35412 var e=b.getValue();
35413 return d==null?e==null:d.equals(e);
35414 }}return false;
35415 },"~O");
35416 c$=Clazz_p0p();
35417 Clazz_pu$h(self.c$);
35418 c$=Clazz_decorateAsClass(function(){
35419 this.subMap=null;
35420 Clazz_instantialize(this,arguments);
35421 },java.util.TreeMap,"SubMapKeySet",java.util.AbstractSet,java.util.Set);
35422 Clazz_makeConstructor(c$,
35423 function(a){
35424 Clazz_superConstructor(this,java.util.TreeMap.SubMapKeySet,[]);
35425 this.subMap=a;
35426 },"java.util.TreeMap.SubMap");
35427 Clazz_overrideMethod(c$,"contains",
35428 function(a){
35429 return this.subMap.containsKey(a);
35430 },"~O");
35431 Clazz_overrideMethod(c$,"isEmpty",
35432 function(){
35433 return this.subMap.isEmpty();
35434 });
35435 Clazz_overrideMethod(c$,"size",
35436 function(){
35437 var a=0;
35438 var b=this.iterator();
35439 while(b.hasNext()){
35440 a++;
35441 b.next();
35442 }
35443 return a;
35444 });
35445 Clazz_overrideMethod(c$,"iterator",
35446 function(){
35447 var a=this.subMap.firstEntry();
35448 if(this.subMap.hasEnd){
35449 var b=this.subMap.comparator();
35450 if(b==null){
35451 return new java.util.TreeMap.ComparableBoundedKeyIterator(this.subMap.backingMap,a,java.util.TreeMap.toComparable(this.subMap.endKey));
35452 }return new java.util.TreeMap.ComparatorBoundedKeyIterator(this.subMap.backingMap,a,this.subMap.endKey);
35453 }return new java.util.TreeMap.UnboundedKeyIterator(this.subMap.backingMap,a);
35454 });
35455 c$=Clazz_p0p();
35456 Clazz_pu$h(self.c$);
35457 c$=Clazz_decorateAsClass(function(){
35458 this.subMap=null;
35459 Clazz_instantialize(this,arguments);
35460 },java.util.TreeMap,"SubMapValuesCollection",java.util.AbstractCollection);
35461 Clazz_makeConstructor(c$,
35462 function(a){
35463 Clazz_superConstructor(this,java.util.TreeMap.SubMapValuesCollection,[]);
35464 this.subMap=a;
35465 },"java.util.TreeMap.SubMap");
35466 Clazz_overrideMethod(c$,"isEmpty",
35467 function(){
35468 return this.subMap.isEmpty();
35469 });
35470 Clazz_overrideMethod(c$,"iterator",
35471 function(){
35472 var a=this.subMap.firstEntry();
35473 if(this.subMap.hasEnd){
35474 var b=this.subMap.comparator();
35475 if(b==null){
35476 return new java.util.TreeMap.ComparableBoundedValueIterator(this.subMap.backingMap,a,java.util.TreeMap.toComparable(this.subMap.endKey));
35477 }return new java.util.TreeMap.ComparatorBoundedValueIterator(this.subMap.backingMap,a,this.subMap.endKey);
35478 }return new java.util.TreeMap.UnboundedValueIterator(this.subMap.backingMap,a);
35479 });
35480 Clazz_overrideMethod(c$,"size",
35481 function(){
35482 var a=0;
35483 for(var b=this.iterator();b.hasNext();){
35484 b.next();
35485 a++;
35486 }
35487 return a;
35488 });
35489 c$=Clazz_p0p();
35490 });
35491 Clazz_declarePackage ("jalview.appletgui");
35492 Clazz_load (["jalview.structure.CommandListener", "$.SelectionSource", "$.VamsasSource", "jalview.viewmodel.AlignmentViewport", "java.awt.Font"], "jalview.appletgui.AlignViewport", ["awt2swing.Frame", "jalview.api.AlignViewportI", "jalview.bin.JalviewLite", "jalview.datamodel.ColumnSelection", "$.SearchResults", "$.Sequence", "$.SequenceGroup", "jalview.schemes.ColourSchemeProperty", "jalview.structure.StructureSelectionManager", "jalview.util.Platform", "jalview.workers.AlignCalcManager", "java.lang.Float", "$.StringBuilder"], function () {
35493 c$ = Clazz_decorateAsClass (function () {
35494 this.cursorMode = false;
35495 this.font = null;
35496 this.validCharWidth = true;
35497 this.currentTree = null;
35498 this.applet = null;
35499 this.MAC = false;
35500 this.annotationColumnSelectionState = null;
35501 this.nullFrame = null;
35502 this.featureSettings = null;
35503 this.heightScale = 1;
35504 this.widthScale = 1;
35505 this.centreColumnLabels = false;
35506 this.followSelection = true;
35507 Clazz_instantialize (this, arguments);
35508 }, jalview.appletgui, "AlignViewport", jalview.viewmodel.AlignmentViewport, [jalview.structure.SelectionSource, jalview.structure.VamsasSource, jalview.structure.CommandListener]);
35509 Clazz_prepareFields (c$, function () {
35510 this.font =  new java.awt.Font ("SansSerif", 0, 10);
35511 });
35512 Clazz_overrideMethod (c$, "finalize", 
35513 function () {
35514 this.applet = null;
35515 this.quality = null;
35516 this.alignment = null;
35517 this.colSel = null;
35518 });
35519 Clazz_makeConstructor (c$, 
35520 function (al, applet) {
35521 Clazz_superConstructor (this, jalview.appletgui.AlignViewport);
35522 this.calculator =  new jalview.workers.AlignCalcManager ();
35523 this.applet = applet;
35524 this.alignment = al;
35525 this.setPadGaps (true);
35526 this.startRes = 0;
35527 this.endRes = al.getWidth () - 1;
35528 this.startSeq = 0;
35529 this.endSeq = al.getHeight () - 1;
35530 if (applet != null) {
35531 var param = applet.widthScale;
35532 if (param != null) {
35533 try {
35534 this.widthScale =  new Float (param).floatValue ();
35535 } catch (e) {
35536 if (Clazz_exceptionOf (e, Exception)) {
35537 } else {
35538 throw e;
35539 }
35540 }
35541 if (this.widthScale <= 1.0) {
35542 System.err.println ("Invalid alignment character width scaling factor (" + this.widthScale + "). Ignoring.");
35543 this.widthScale = 1;
35544 }if (jalview.bin.JalviewLite.debug) {
35545 System.err.println ("Alignment character width scaling factor is now " + this.widthScale);
35546 }}param = applet.heightScale;
35547 if (param != null) {
35548 try {
35549 this.heightScale =  new Float (param).floatValue ();
35550 } catch (e) {
35551 if (Clazz_exceptionOf (e, Exception)) {
35552 } else {
35553 throw e;
35554 }
35555 }
35556 if (this.heightScale <= 1.0) {
35557 System.err.println ("Invalid alignment character height scaling factor (" + this.heightScale + "). Ignoring.");
35558 this.heightScale = 1;
35559 }if (jalview.bin.JalviewLite.debug) {
35560 System.err.println ("Alignment character height scaling factor is now " + this.heightScale);
35561 }}}this.setFont (this.font);
35562 this.MAC = jalview.util.Platform.isAMac ();
35563 if (applet != null) {
35564 this.setShowJVSuffix (applet.getDefaultParameter ("showFullId", this.getShowJVSuffix ()));
35565 this.setShowAnnotation (applet.getDefaultParameter ("showAnnotation", this.isShowAnnotation ()));
35566 this.showConservation = applet.getDefaultParameter ("showConservation", this.showConservation);
35567 this.showQuality = applet.getDefaultParameter ("showQuality", this.showQuality);
35568 this.showConsensus = applet.getDefaultParameter ("showConsensus", this.showConsensus);
35569 this.setShowUnconserved (applet.getDefaultParameter ("showUnconserved", this.getShowUnconserved ()));
35570 this.setScaleProteinAsCdna (applet.getDefaultParameter ("scaleProteinAsCdna", this.isScaleProteinAsCdna ()));
35571 var param = applet.upperCase;
35572 if (param != null) {
35573 if (param.equalsIgnoreCase ("bold")) {
35574 this.setUpperCasebold (true);
35575 }}this.sortByTree = applet.getDefaultParameter ("sortByTree", this.sortByTree);
35576 this.setFollowHighlight (applet.getDefaultParameter ("automaticScrolling", this.isFollowHighlight ()));
35577 this.followSelection = this.isFollowHighlight ();
35578 this.showSequenceLogo = applet.getDefaultParameter ("showSequenceLogo", this.showSequenceLogo);
35579 this.normaliseSequenceLogo = applet.getDefaultParameter ("normaliseSequenceLogo", applet.getDefaultParameter ("normaliseLogo", this.normaliseSequenceLogo));
35580 this.showGroupConsensus = applet.getDefaultParameter ("showGroupConsensus", this.showGroupConsensus);
35581 this.showGroupConservation = applet.getDefaultParameter ("showGroupConservation", this.showGroupConservation);
35582 this.showConsensusHistogram = applet.getDefaultParameter ("showConsensusHistogram", this.showConsensusHistogram);
35583 }if (applet != null) {
35584 var colour = applet.defaultColour;
35585 if (colour == null) {
35586 colour = applet.userDefinedColour;
35587 if (colour != null) {
35588 colour = "User Defined";
35589 }}if (colour != null) {
35590 this.globalColourScheme = jalview.schemes.ColourSchemeProperty.getColour (this.alignment, colour);
35591 if (this.globalColourScheme != null) {
35592 this.globalColourScheme.setConsensus (this.hconsensus);
35593 }}if (applet.userDefinedColour != null) {
35594 (this.globalColourScheme).parseAppletParameter (applet.userDefinedColour);
35595 }}this.initAutoAnnotation ();
35596 }, "jalview.datamodel.AlignmentI,jalview.bin.JalviewLite");
35597 Clazz_defineMethod (c$, "getConsensusSeq", 
35598 function () {
35599 if (this.consensus == null) {
35600 this.updateConsensus (null);
35601 }if (this.consensus == null) {
35602 return null;
35603 }var seqs =  new StringBuilder (this.consensus.annotations.length);
35604 for (var i = 0; i < this.consensus.annotations.length; i++) {
35605 if (this.consensus.annotations[i] != null) {
35606 if (this.consensus.annotations[i].description.charAt (0) == '[') {
35607 seqs.append (this.consensus.annotations[i].description.charAt (1));
35608 } else {
35609 seqs.append (this.consensus.annotations[i].displayCharacter);
35610 }}}
35611 var sq =  new jalview.datamodel.Sequence ("Consensus", seqs.toString ());
35612 sq.setDescription ("Percentage Identity Consensus " + ((this.ignoreGapsInConsensusCalculation) ? " without gaps" : ""));
35613 return sq;
35614 });
35615 Clazz_defineMethod (c$, "setFont", 
35616 function (f) {
35617 this.font = f;
35618 if (this.nullFrame == null) {
35619 this.nullFrame =  new awt2swing.Frame ();
35620 this.nullFrame.addNotify ();
35621 this.nullFrame.setFont (this.font);
35622 }var fm = this.nullFrame.getGraphics ().getFontMetrics (this.font);
35623 this.setCharHeight (Clazz_floatToInt (this.heightScale * fm.getHeight ()));
35624 this.setCharWidth (Clazz_floatToInt (this.widthScale * fm.charWidth ('M')));
35625 if (this.isUpperCasebold ()) {
35626 var f2 =  new java.awt.Font (f.getName (), 1, f.getSize ());
35627 fm = this.nullFrame.getGraphics ().getFontMetrics (f2);
35628 this.setCharWidth (Clazz_floatToInt (this.widthScale * (Clazz_doubleToInt (fm.stringWidth ("MMMMMMMMMMM") / 10))));
35629 }}, "java.awt.Font");
35630 Clazz_defineMethod (c$, "getFont", 
35631 function () {
35632 return this.font;
35633 });
35634 Clazz_defineMethod (c$, "resetSeqLimits", 
35635 function (height) {
35636 this.setEndSeq (Clazz_doubleToInt (height / this.getCharHeight ()));
35637 }, "~N");
35638 Clazz_defineMethod (c$, "setCurrentTree", 
35639 function (tree) {
35640 this.currentTree = tree;
35641 }, "jalview.analysis.NJTree");
35642 Clazz_defineMethod (c$, "getCurrentTree", 
35643 function () {
35644 return this.currentTree;
35645 });
35646 Clazz_defineMethod (c$, "getCentreColumnLabels", 
35647 function () {
35648 return this.centreColumnLabels;
35649 });
35650 Clazz_defineMethod (c$, "getFollowSelection", 
35651 function () {
35652 return this.followSelection;
35653 });
35654 Clazz_overrideMethod (c$, "sendSelection", 
35655 function () {
35656 this.getStructureSelectionManager ().sendSelection ( new jalview.datamodel.SequenceGroup (this.getSelectionGroup ()),  new jalview.datamodel.ColumnSelection (this.getColumnSelection ()), this);
35657 });
35658 Clazz_overrideMethod (c$, "getStructureSelectionManager", 
35659 function () {
35660 return jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.applet);
35661 });
35662 Clazz_defineMethod (c$, "expandColSelection", 
35663 function (sg, wholewidth) {
35664 var sgs;
35665 var sge;
35666 if (sg != null && (sgs = sg.getStartRes ()) >= 0 && sg.getStartRes () <= (sge = sg.getEndRes ()) && (this.colSel == null || this.colSel.getSelected () == null || this.colSel.getSelected ().size () == 0)) {
35667 if (!wholewidth && this.alignment.getWidth () == (1 + sge - sgs)) {
35668 return;
35669 }if (this.colSel == null) {
35670 this.colSel =  new jalview.datamodel.ColumnSelection ();
35671 }for (var cspos = sg.getStartRes (); cspos <= sg.getEndRes (); cspos++) {
35672 this.colSel.addElement (cspos);
35673 }
35674 }}, "jalview.datamodel.SequenceGroup,~B");
35675 Clazz_overrideMethod (c$, "isNormaliseSequenceLogo", 
35676 function () {
35677 return this.normaliseSequenceLogo;
35678 });
35679 Clazz_defineMethod (c$, "setNormaliseSequenceLogo", 
35680 function (state) {
35681 this.normaliseSequenceLogo = state;
35682 }, "~B");
35683 Clazz_overrideMethod (c$, "isValidCharWidth", 
35684 function () {
35685 return this.validCharWidth;
35686 });
35687 Clazz_defineMethod (c$, "getAnnotationColumnSelectionState", 
35688 function () {
35689 return this.annotationColumnSelectionState;
35690 });
35691 Clazz_defineMethod (c$, "setAnnotationColumnSelectionState", 
35692 function (annotationColumnSelectionState) {
35693 this.annotationColumnSelectionState = annotationColumnSelectionState;
35694 }, "jalview.appletgui.AnnotationColumnChooser");
35695 Clazz_overrideMethod (c$, "mirrorCommand", 
35696 function (command, undo, ssm, source) {
35697 if (Clazz_instanceOf (source, jalview.api.AlignViewportI) && (source).getCodingComplement () === this) {
35698 } else {
35699 return;
35700 }var mappedCommand = ssm.mapCommand (command, undo, this.getAlignment (), this.getGapCharacter ());
35701 if (mappedCommand != null) {
35702 mappedCommand.doCommand (null);
35703 this.firePropertyChange ("alignment", null, this.getAlignment ().getSequences ());
35704 }}, "jalview.commands.CommandI,~B,jalview.structure.StructureSelectionManager,jalview.structure.VamsasSource");
35705 Clazz_overrideMethod (c$, "getVamsasSource", 
35706 function () {
35707 return this;
35708 });
35709 Clazz_defineMethod (c$, "scrollComplementaryAlignment", 
35710 function (complementPanel) {
35711 if (complementPanel == null) {
35712 return;
35713 }var sr =  new jalview.datamodel.SearchResults ();
35714 var seqOffset = this.findComplementScrollTarget (sr);
35715 if (!sr.isEmpty ()) {
35716 complementPanel.setFollowingComplementScroll (true);
35717 complementPanel.scrollToCentre (sr, seqOffset);
35718 }}, "jalview.appletgui.AlignmentPanel");
35719 });
35720 Clazz_declarePackage ("jalview.structure");
35721 Clazz_declareInterface (jalview.structure, "CommandListener");
35722 Clazz_declarePackage ("jalview.structure");
35723 Clazz_declareInterface (jalview.structure, "SelectionSource");
35724 Clazz_declarePackage ("jalview.structure");
35725 Clazz_declareInterface (jalview.structure, "VamsasSource");
35726 Clazz_declarePackage ("jalview.viewmodel");
35727 Clazz_load (["jalview.api.AlignViewportI", "jalview.structure.CommandListener", "$.VamsasSource", "jalview.datamodel.ColumnSelection", "jalview.viewmodel.styles.ViewStyle", "jalview.workers.AlignCalcManager", "java.beans.PropertyChangeSupport", "java.util.ArrayDeque", "$.HashMap"], "jalview.viewmodel.AlignmentViewport", ["jalview.analysis.Conservation", "jalview.datamodel.AlignmentAnnotation", "$.AlignmentView", "$.CigarArray", "$.Sequence", "$.SequenceGroup", "jalview.schemes.Blosum62ColourScheme", "$.PIDColourScheme", "$.ResidueProperties", "jalview.util.Comparison", "$.MappingUtils", "jalview.workers.ComplementConsensusThread", "$.ConsensusThread", "$.ConservationThread", "$.StrucConsensusThread", "java.awt.Color", "java.util.ArrayList", "$.BitSet", "$.Hashtable"], function () {
35728 c$ = Clazz_decorateAsClass (function () {
35729 this.viewStyle = null;
35730 this.codingComplement = null;
35731 this.featuresDisplayed = null;
35732 this.historyList = null;
35733 this.redoList = null;
35734 this.alignment = null;
35735 this.sequenceSetID = null;
35736 this.$isDataset = false;
35737 this.hiddenRepSequences = null;
35738 this.colSel = null;
35739 this.autoCalculateConsensus = true;
35740 this.autoCalculateStrucConsensus = true;
35741 this.ignoreGapsInConsensusCalculation = false;
35742 this.globalColourScheme = null;
35743 this.consensus = null;
35744 this.complementConsensus = null;
35745 this.strucConsensus = null;
35746 this.conservation = null;
35747 this.quality = null;
35748 this.groupConsensus = null;
35749 this.groupConservation = null;
35750 this.hconsensus = null;
35751 this.hcomplementConsensus = null;
35752 this.hStrucConsensus = null;
35753 this.hconservation = null;
35754 this.ConsPercGaps = 25;
35755 this.calculator = null;
35756 this.showGroupConservation = false;
35757 this.showGroupConsensus = false;
35758 this.showSequenceLogo = false;
35759 this.normaliseSequenceLogo = false;
35760 this.showConsensusHistogram = true;
35761 this.padGaps = false;
35762 this.sortByTree = false;
35763 this.selectionGroup = null;
35764 this.viewId = null;
35765 this.sgrouphash = -1;
35766 this.colselhash = -1;
35767 this.changeSupport = null;
35768 this.showConservation = true;
35769 this.showQuality = true;
35770 this.showConsensus = true;
35771 this.sequenceColours = null;
35772 this.sortAnnotationsBy = null;
35773 this.showAutocalculatedAbove = false;
35774 this.followHighlight = true;
35775 this.startRes = 0;
35776 this.endRes = 0;
35777 this.startSeq = 0;
35778 this.endSeq = 0;
35779 Clazz_instantialize (this, arguments);
35780 }, jalview.viewmodel, "AlignmentViewport", null, [jalview.api.AlignViewportI, jalview.structure.CommandListener, jalview.structure.VamsasSource]);
35781 Clazz_prepareFields (c$, function () {
35782 this.viewStyle =  new jalview.viewmodel.styles.ViewStyle ();
35783 this.historyList =  new java.util.ArrayDeque ();
35784 this.redoList =  new java.util.ArrayDeque ();
35785 this.colSel =  new jalview.datamodel.ColumnSelection ();
35786 this.calculator =  new jalview.workers.AlignCalcManager ();
35787 this.changeSupport =  new java.beans.PropertyChangeSupport (this);
35788 this.sequenceColours =  new java.util.HashMap ();
35789 });
35790 Clazz_defineMethod (c$, "setFontName", 
35791 function (name) {
35792 this.viewStyle.setFontName (name);
35793 }, "~S");
35794 Clazz_defineMethod (c$, "setFontStyle", 
35795 function (style) {
35796 this.viewStyle.setFontStyle (style);
35797 }, "~N");
35798 Clazz_defineMethod (c$, "setFontSize", 
35799 function (size) {
35800 this.viewStyle.setFontSize (size);
35801 }, "~N");
35802 Clazz_defineMethod (c$, "getFontStyle", 
35803 function () {
35804 return this.viewStyle.getFontStyle ();
35805 });
35806 Clazz_defineMethod (c$, "getFontName", 
35807 function () {
35808 return this.viewStyle.getFontName ();
35809 });
35810 Clazz_defineMethod (c$, "getFontSize", 
35811 function () {
35812 return this.viewStyle.getFontSize ();
35813 });
35814 Clazz_defineMethod (c$, "setUpperCasebold", 
35815 function (upperCasebold) {
35816 this.viewStyle.setUpperCasebold (upperCasebold);
35817 }, "~B");
35818 Clazz_defineMethod (c$, "isUpperCasebold", 
35819 function () {
35820 return this.viewStyle.isUpperCasebold ();
35821 });
35822 Clazz_defineMethod (c$, "isSeqNameItalics", 
35823 function () {
35824 return this.viewStyle.isSeqNameItalics ();
35825 });
35826 Clazz_defineMethod (c$, "setColourByReferenceSeq", 
35827 function (colourByReferenceSeq) {
35828 this.viewStyle.setColourByReferenceSeq (colourByReferenceSeq);
35829 }, "~B");
35830 Clazz_defineMethod (c$, "setColourAppliesToAllGroups", 
35831 function (b) {
35832 this.viewStyle.setColourAppliesToAllGroups (b);
35833 }, "~B");
35834 Clazz_defineMethod (c$, "getColourAppliesToAllGroups", 
35835 function () {
35836 return this.viewStyle.getColourAppliesToAllGroups ();
35837 });
35838 Clazz_defineMethod (c$, "getAbovePIDThreshold", 
35839 function () {
35840 return this.viewStyle.getAbovePIDThreshold ();
35841 });
35842 Clazz_defineMethod (c$, "setIncrement", 
35843 function (inc) {
35844 this.viewStyle.setIncrement (inc);
35845 }, "~N");
35846 Clazz_defineMethod (c$, "getIncrement", 
35847 function () {
35848 return this.viewStyle.getIncrement ();
35849 });
35850 Clazz_defineMethod (c$, "setConservationSelected", 
35851 function (b) {
35852 this.viewStyle.setConservationSelected (b);
35853 }, "~B");
35854 Clazz_defineMethod (c$, "setShowHiddenMarkers", 
35855 function (show) {
35856 this.viewStyle.setShowHiddenMarkers (show);
35857 }, "~B");
35858 Clazz_defineMethod (c$, "getShowHiddenMarkers", 
35859 function () {
35860 return this.viewStyle.getShowHiddenMarkers ();
35861 });
35862 Clazz_defineMethod (c$, "setScaleRightWrapped", 
35863 function (b) {
35864 this.viewStyle.setScaleRightWrapped (b);
35865 }, "~B");
35866 Clazz_defineMethod (c$, "setScaleLeftWrapped", 
35867 function (b) {
35868 this.viewStyle.setScaleLeftWrapped (b);
35869 }, "~B");
35870 Clazz_defineMethod (c$, "setScaleAboveWrapped", 
35871 function (b) {
35872 this.viewStyle.setScaleAboveWrapped (b);
35873 }, "~B");
35874 Clazz_defineMethod (c$, "getScaleLeftWrapped", 
35875 function () {
35876 return this.viewStyle.getScaleLeftWrapped ();
35877 });
35878 Clazz_defineMethod (c$, "getScaleAboveWrapped", 
35879 function () {
35880 return this.viewStyle.getScaleAboveWrapped ();
35881 });
35882 Clazz_defineMethod (c$, "getScaleRightWrapped", 
35883 function () {
35884 return this.viewStyle.getScaleRightWrapped ();
35885 });
35886 Clazz_defineMethod (c$, "setAbovePIDThreshold", 
35887 function (b) {
35888 this.viewStyle.setAbovePIDThreshold (b);
35889 }, "~B");
35890 Clazz_defineMethod (c$, "setThreshold", 
35891 function (thresh) {
35892 this.viewStyle.setThreshold (thresh);
35893 }, "~N");
35894 Clazz_defineMethod (c$, "getThreshold", 
35895 function () {
35896 return this.viewStyle.getThreshold ();
35897 });
35898 Clazz_defineMethod (c$, "getShowJVSuffix", 
35899 function () {
35900 return this.viewStyle.getShowJVSuffix ();
35901 });
35902 Clazz_defineMethod (c$, "setShowJVSuffix", 
35903 function (b) {
35904 this.viewStyle.setShowJVSuffix (b);
35905 }, "~B");
35906 Clazz_defineMethod (c$, "setWrapAlignment", 
35907 function (state) {
35908 this.viewStyle.setWrapAlignment (state);
35909 }, "~B");
35910 Clazz_defineMethod (c$, "setShowText", 
35911 function (state) {
35912 this.viewStyle.setShowText (state);
35913 }, "~B");
35914 Clazz_defineMethod (c$, "setRenderGaps", 
35915 function (state) {
35916 this.viewStyle.setRenderGaps (state);
35917 }, "~B");
35918 Clazz_defineMethod (c$, "getColourText", 
35919 function () {
35920 return this.viewStyle.getColourText ();
35921 });
35922 Clazz_defineMethod (c$, "setColourText", 
35923 function (state) {
35924 this.viewStyle.setColourText (state);
35925 }, "~B");
35926 Clazz_defineMethod (c$, "getWrapAlignment", 
35927 function () {
35928 return this.viewStyle.getWrapAlignment ();
35929 });
35930 Clazz_defineMethod (c$, "getShowText", 
35931 function () {
35932 return this.viewStyle.getShowText ();
35933 });
35934 Clazz_defineMethod (c$, "getWrappedWidth", 
35935 function () {
35936 return this.viewStyle.getWrappedWidth ();
35937 });
35938 Clazz_defineMethod (c$, "setWrappedWidth", 
35939 function (w) {
35940 this.viewStyle.setWrappedWidth (w);
35941 }, "~N");
35942 Clazz_defineMethod (c$, "getCharHeight", 
35943 function () {
35944 return this.viewStyle.getCharHeight ();
35945 });
35946 Clazz_defineMethod (c$, "setCharHeight", 
35947 function (h) {
35948 this.viewStyle.setCharHeight (h);
35949 }, "~N");
35950 Clazz_defineMethod (c$, "getCharWidth", 
35951 function () {
35952 return this.viewStyle.getCharWidth ();
35953 });
35954 Clazz_defineMethod (c$, "setCharWidth", 
35955 function (w) {
35956 this.viewStyle.setCharWidth (w);
35957 }, "~N");
35958 Clazz_defineMethod (c$, "getShowBoxes", 
35959 function () {
35960 return this.viewStyle.getShowBoxes ();
35961 });
35962 Clazz_defineMethod (c$, "getShowUnconserved", 
35963 function () {
35964 return this.viewStyle.getShowUnconserved ();
35965 });
35966 Clazz_defineMethod (c$, "setShowUnconserved", 
35967 function (showunconserved) {
35968 this.viewStyle.setShowUnconserved (showunconserved);
35969 }, "~B");
35970 Clazz_defineMethod (c$, "setSeqNameItalics", 
35971 function (default1) {
35972 this.viewStyle.setSeqNameItalics (default1);
35973 }, "~B");
35974 Clazz_defineMethod (c$, "getAlignment", 
35975 function () {
35976 return this.alignment;
35977 });
35978 Clazz_overrideMethod (c$, "getGapCharacter", 
35979 function () {
35980 return this.alignment.getGapCharacter ();
35981 });
35982 Clazz_defineMethod (c$, "setDataset", 
35983 function (b) {
35984 this.$isDataset = b;
35985 }, "~B");
35986 Clazz_defineMethod (c$, "isDataset", 
35987 function () {
35988 return this.$isDataset;
35989 });
35990 Clazz_overrideMethod (c$, "setGlobalColourScheme", 
35991 function (cs) {
35992 this.globalColourScheme = cs;
35993 var recalc = false;
35994 if (cs != null) {
35995 cs.setConservationApplied (recalc = this.getConservationSelected ());
35996 if (this.getAbovePIDThreshold () || Clazz_instanceOf (cs, jalview.schemes.PIDColourScheme) || Clazz_instanceOf (cs, jalview.schemes.Blosum62ColourScheme)) {
35997 recalc = true;
35998 cs.setThreshold (this.viewStyle.getThreshold (), this.ignoreGapsInConsensusCalculation);
35999 } else {
36000 cs.setThreshold (0, this.ignoreGapsInConsensusCalculation);
36001 }if (recalc) {
36002 cs.setConsensus (this.hconsensus);
36003 cs.setConservation (this.hconservation);
36004 }cs.alignmentChanged (this.alignment, this.hiddenRepSequences);
36005 }if (this.getColourAppliesToAllGroups ()) {
36006 for (var sg, $sg = this.getAlignment ().getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
36007 if (cs == null) {
36008 sg.cs = null;
36009 continue;
36010 }sg.cs = cs.applyTo (sg, this.getHiddenRepSequences ());
36011 sg.setConsPercGaps (this.ConsPercGaps);
36012 if (this.getAbovePIDThreshold () || Clazz_instanceOf (cs, jalview.schemes.PIDColourScheme) || Clazz_instanceOf (cs, jalview.schemes.Blosum62ColourScheme)) {
36013 sg.cs.setThreshold (this.viewStyle.getThreshold (), this.isIgnoreGapsConsensus ());
36014 recalc = true;
36015 } else {
36016 sg.cs.setThreshold (0, this.isIgnoreGapsConsensus ());
36017 }if (this.getConservationSelected ()) {
36018 sg.cs.setConservationApplied (true);
36019 recalc = true;
36020 } else {
36021 sg.cs.setConservation (null);
36022 }if (recalc) {
36023 sg.recalcConservation ();
36024 } else {
36025 sg.cs.alignmentChanged (sg, this.hiddenRepSequences);
36026 }}
36027 }}, "jalview.schemes.ColourSchemeI");
36028 Clazz_overrideMethod (c$, "getGlobalColourScheme", 
36029 function () {
36030 return this.globalColourScheme;
36031 });
36032 Clazz_overrideMethod (c$, "setConservation", 
36033 function (cons) {
36034 this.hconservation = cons;
36035 }, "jalview.analysis.Conservation");
36036 Clazz_overrideMethod (c$, "getConsPercGaps", 
36037 function () {
36038 return this.ConsPercGaps;
36039 });
36040 Clazz_overrideMethod (c$, "setSequenceConsensusHash", 
36041 function (hconsensus) {
36042 this.hconsensus = hconsensus;
36043 }, "~A");
36044 Clazz_overrideMethod (c$, "setComplementConsensusHash", 
36045 function (hconsensus) {
36046 this.hcomplementConsensus = hconsensus;
36047 }, "~A");
36048 Clazz_overrideMethod (c$, "getSequenceConsensusHash", 
36049 function () {
36050 return this.hconsensus;
36051 });
36052 Clazz_overrideMethod (c$, "getComplementConsensusHash", 
36053 function () {
36054 return this.hcomplementConsensus;
36055 });
36056 Clazz_overrideMethod (c$, "getRnaStructureConsensusHash", 
36057 function () {
36058 return this.hStrucConsensus;
36059 });
36060 Clazz_overrideMethod (c$, "setRnaStructureConsensusHash", 
36061 function (hStrucConsensus) {
36062 this.hStrucConsensus = hStrucConsensus;
36063 }, "~A");
36064 Clazz_overrideMethod (c$, "getAlignmentQualityAnnot", 
36065 function () {
36066 return this.quality;
36067 });
36068 Clazz_overrideMethod (c$, "getAlignmentConservationAnnotation", 
36069 function () {
36070 return this.conservation;
36071 });
36072 Clazz_overrideMethod (c$, "getAlignmentConsensusAnnotation", 
36073 function () {
36074 return this.consensus;
36075 });
36076 Clazz_overrideMethod (c$, "getComplementConsensusAnnotation", 
36077 function () {
36078 return this.complementConsensus;
36079 });
36080 Clazz_overrideMethod (c$, "getAlignmentStrucConsensusAnnotation", 
36081 function () {
36082 return this.strucConsensus;
36083 });
36084 Clazz_defineMethod (c$, "updateConservation", 
36085 function (ap) {
36086 if (this.alignment.isNucleotide () || this.conservation == null || !this.autoCalculateConsensus) {
36087 return;
36088 }if (this.calculator.getRegisteredWorkersOfClass (jalview.workers.ConservationThread) == null) {
36089 this.calculator.registerWorker ( new jalview.workers.ConservationThread (this, ap));
36090 }}, "jalview.api.AlignmentViewPanel");
36091 Clazz_defineMethod (c$, "updateConsensus", 
36092 function (ap) {
36093 if (this.consensus == null || !this.autoCalculateConsensus) {
36094 return;
36095 }if (this.calculator.getRegisteredWorkersOfClass (jalview.workers.ConsensusThread) == null) {
36096 this.calculator.registerWorker ( new jalview.workers.ConsensusThread (this, ap));
36097 }var al = this.getAlignment ();
36098 if (!al.isNucleotide () && al.getCodonFrames () != null && !al.getCodonFrames ().isEmpty ()) {
36099 if (this.calculator.getRegisteredWorkersOfClass (jalview.workers.ComplementConsensusThread) == null) {
36100 this.calculator.registerWorker ( new jalview.workers.ComplementConsensusThread (this, ap));
36101 }}}, "jalview.api.AlignmentViewPanel");
36102 Clazz_defineMethod (c$, "updateStrucConsensus", 
36103 function (ap) {
36104 if (this.autoCalculateStrucConsensus && this.strucConsensus == null && this.alignment.isNucleotide () && this.alignment.hasRNAStructure ()) {
36105 this.initRNAStructure ();
36106 }if (this.strucConsensus == null || !this.autoCalculateStrucConsensus) {
36107 return;
36108 }if (this.calculator.getRegisteredWorkersOfClass (jalview.workers.StrucConsensusThread) == null) {
36109 this.calculator.registerWorker ( new jalview.workers.StrucConsensusThread (this, ap));
36110 }}, "jalview.api.AlignmentViewPanel");
36111 Clazz_defineMethod (c$, "isCalcInProgress", 
36112 function () {
36113 return this.calculator.isWorking ();
36114 });
36115 Clazz_overrideMethod (c$, "isCalculationInProgress", 
36116 function (alignmentAnnotation) {
36117 if (!alignmentAnnotation.autoCalculated) {
36118 return false;
36119 }if (this.calculator.workingInvolvedWith (alignmentAnnotation)) {
36120 return true;
36121 }return false;
36122 }, "jalview.datamodel.AlignmentAnnotation");
36123 Clazz_overrideMethod (c$, "isClosed", 
36124 function () {
36125 return this.alignment == null;
36126 });
36127 Clazz_overrideMethod (c$, "getCalcManager", 
36128 function () {
36129 return this.calculator;
36130 });
36131 Clazz_overrideMethod (c$, "isShowSequenceLogo", 
36132 function () {
36133 return this.showSequenceLogo;
36134 });
36135 Clazz_defineMethod (c$, "setShowSequenceLogo", 
36136 function (showSequenceLogo) {
36137 if (showSequenceLogo != this.showSequenceLogo) {
36138 this.showSequenceLogo = showSequenceLogo;
36139 this.calculator.updateAnnotationFor (jalview.workers.ConsensusThread);
36140 this.calculator.updateAnnotationFor (jalview.workers.ComplementConsensusThread);
36141 this.calculator.updateAnnotationFor (jalview.workers.StrucConsensusThread);
36142 }this.showSequenceLogo = showSequenceLogo;
36143 }, "~B");
36144 Clazz_defineMethod (c$, "setShowConsensusHistogram", 
36145 function (showConsensusHistogram) {
36146 this.showConsensusHistogram = showConsensusHistogram;
36147 }, "~B");
36148 Clazz_defineMethod (c$, "isShowGroupConservation", 
36149 function () {
36150 return this.showGroupConservation;
36151 });
36152 Clazz_defineMethod (c$, "setShowGroupConservation", 
36153 function (showGroupConservation) {
36154 this.showGroupConservation = showGroupConservation;
36155 }, "~B");
36156 Clazz_defineMethod (c$, "isShowGroupConsensus", 
36157 function () {
36158 return this.showGroupConsensus;
36159 });
36160 Clazz_defineMethod (c$, "setShowGroupConsensus", 
36161 function (showGroupConsensus) {
36162 this.showGroupConsensus = showGroupConsensus;
36163 }, "~B");
36164 Clazz_overrideMethod (c$, "isShowConsensusHistogram", 
36165 function () {
36166 return this.showConsensusHistogram;
36167 });
36168 Clazz_overrideMethod (c$, "getSelectionGroup", 
36169 function () {
36170 return this.selectionGroup;
36171 });
36172 Clazz_overrideMethod (c$, "setSelectionGroup", 
36173 function (sg) {
36174 this.selectionGroup = sg;
36175 }, "jalview.datamodel.SequenceGroup");
36176 Clazz_defineMethod (c$, "setHiddenColumns", 
36177 function (colsel) {
36178 this.colSel = colsel;
36179 }, "jalview.datamodel.ColumnSelection");
36180 Clazz_overrideMethod (c$, "getColumnSelection", 
36181 function () {
36182 return this.colSel;
36183 });
36184 Clazz_overrideMethod (c$, "setColumnSelection", 
36185 function (colSel) {
36186 this.colSel = colSel;
36187 if (colSel != null) {
36188 this.updateHiddenColumns ();
36189 }}, "jalview.datamodel.ColumnSelection");
36190 Clazz_overrideMethod (c$, "getHiddenRepSequences", 
36191 function () {
36192 return this.hiddenRepSequences;
36193 });
36194 Clazz_overrideMethod (c$, "setHiddenRepSequences", 
36195 function (hiddenRepSequences) {
36196 this.hiddenRepSequences = hiddenRepSequences;
36197 }, "java.util.Map");
36198 Clazz_overrideMethod (c$, "hasHiddenColumns", 
36199 function () {
36200 return this.colSel != null && this.colSel.hasHiddenColumns ();
36201 });
36202 Clazz_defineMethod (c$, "updateHiddenColumns", 
36203 function () {
36204 });
36205 Clazz_overrideMethod (c$, "hasHiddenRows", 
36206 function () {
36207 return this.alignment.getHiddenSequences ().getSize () > 0;
36208 });
36209 Clazz_defineMethod (c$, "setSequenceSetId", 
36210 function (newid) {
36211 if (this.sequenceSetID != null) {
36212 System.err.println ("Warning - overwriting a sequenceSetId for a viewport!");
36213 }this.sequenceSetID =  String.instantialize (newid);
36214 }, "~S");
36215 Clazz_overrideMethod (c$, "getSequenceSetId", 
36216 function () {
36217 if (this.sequenceSetID == null) {
36218 this.sequenceSetID = this.alignment.hashCode () + "";
36219 }return this.sequenceSetID;
36220 });
36221 Clazz_overrideMethod (c$, "getViewId", 
36222 function () {
36223 if (this.viewId == null) {
36224 this.viewId = this.getSequenceSetId () + "." + this.hashCode () + "";
36225 }return this.viewId;
36226 });
36227 Clazz_defineMethod (c$, "setIgnoreGapsConsensus", 
36228 function (b, ap) {
36229 this.ignoreGapsInConsensusCalculation = b;
36230 if (ap != null) {
36231 this.updateConsensus (ap);
36232 if (this.globalColourScheme != null) {
36233 this.globalColourScheme.setThreshold (this.globalColourScheme.getThreshold (), this.ignoreGapsInConsensusCalculation);
36234 }}}, "~B,jalview.api.AlignmentViewPanel");
36235 Clazz_defineMethod (c$, "isSelectionGroupChanged", 
36236 function (b) {
36237 var hc = (this.selectionGroup == null || this.selectionGroup.getSize () == 0) ? -1 : this.selectionGroup.hashCode ();
36238 if (hc != -1 && hc != this.sgrouphash) {
36239 if (b) {
36240 this.sgrouphash = hc;
36241 }return true;
36242 }return false;
36243 }, "~B");
36244 Clazz_defineMethod (c$, "isColSelChanged", 
36245 function (b) {
36246 var hc = (this.colSel == null || this.colSel.size () == 0) ? -1 : this.colSel.hashCode ();
36247 if (hc != -1 && hc != this.colselhash) {
36248 if (b) {
36249 this.colselhash = hc;
36250 }return true;
36251 }return false;
36252 }, "~B");
36253 Clazz_overrideMethod (c$, "isIgnoreGapsConsensus", 
36254 function () {
36255 return this.ignoreGapsInConsensusCalculation;
36256 });
36257 Clazz_defineMethod (c$, "addPropertyChangeListener", 
36258 function (listener) {
36259 this.changeSupport.addPropertyChangeListener (listener);
36260 }, "java.beans.PropertyChangeListener");
36261 Clazz_defineMethod (c$, "removePropertyChangeListener", 
36262 function (listener) {
36263 this.changeSupport.removePropertyChangeListener (listener);
36264 }, "java.beans.PropertyChangeListener");
36265 Clazz_defineMethod (c$, "firePropertyChange", 
36266 function (prop, oldvalue, newvalue) {
36267 this.changeSupport.firePropertyChange (prop, oldvalue, newvalue);
36268 }, "~S,~O,~O");
36269 Clazz_defineMethod (c$, "hideSelectedColumns", 
36270 function () {
36271 if (this.colSel.size () < 1) {
36272 return;
36273 }this.colSel.hideSelectedColumns ();
36274 this.setSelectionGroup (null);
36275 });
36276 Clazz_defineMethod (c$, "hideColumns", 
36277 function (start, end) {
36278 if (start == end) {
36279 this.colSel.hideColumns (start);
36280 } else {
36281 this.colSel.hideColumns (start, end);
36282 }}, "~N,~N");
36283 Clazz_defineMethod (c$, "showColumn", 
36284 function (col) {
36285 this.colSel.revealHiddenColumns (col);
36286 }, "~N");
36287 Clazz_defineMethod (c$, "showAllHiddenColumns", 
36288 function () {
36289 this.colSel.revealAllHiddenColumns ();
36290 });
36291 Clazz_defineMethod (c$, "showAllHiddenSeqs", 
36292 function () {
36293 if (this.alignment.getHiddenSequences ().getSize () > 0) {
36294 if (this.selectionGroup == null) {
36295 this.selectionGroup =  new jalview.datamodel.SequenceGroup ();
36296 this.selectionGroup.setEndRes (this.alignment.getWidth () - 1);
36297 }var tmp = this.alignment.getHiddenSequences ().showAll (this.hiddenRepSequences);
36298 for (var seq, $seq = tmp.iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
36299 this.selectionGroup.addSequence (seq, false);
36300 this.setSequenceAnnotationsVisible (seq, true);
36301 }
36302 this.hiddenRepSequences = null;
36303 this.firePropertyChange ("alignment", null, this.alignment.getSequences ());
36304 this.sendSelection ();
36305 }});
36306 Clazz_defineMethod (c$, "showSequence", 
36307 function (index) {
36308 var tmp = this.alignment.getHiddenSequences ().showSequence (index, this.hiddenRepSequences);
36309 if (tmp.size () > 0) {
36310 if (this.selectionGroup == null) {
36311 this.selectionGroup =  new jalview.datamodel.SequenceGroup ();
36312 this.selectionGroup.setEndRes (this.alignment.getWidth () - 1);
36313 }for (var seq, $seq = tmp.iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
36314 this.selectionGroup.addSequence (seq, false);
36315 this.setSequenceAnnotationsVisible (seq, true);
36316 }
36317 this.firePropertyChange ("alignment", null, this.alignment.getSequences ());
36318 this.sendSelection ();
36319 }}, "~N");
36320 Clazz_defineMethod (c$, "hideAllSelectedSeqs", 
36321 function () {
36322 if (this.selectionGroup == null || this.selectionGroup.getSize () < 1) {
36323 return;
36324 }var seqs = this.selectionGroup.getSequencesInOrder (this.alignment);
36325 this.hideSequence (seqs);
36326 this.setSelectionGroup (null);
36327 });
36328 Clazz_defineMethod (c$, "hideSequence", 
36329 function (seq) {
36330 if (seq != null) {
36331 for (var i = 0; i < seq.length; i++) {
36332 this.alignment.getHiddenSequences ().hideSequence (seq[i]);
36333 this.setSequenceAnnotationsVisible (seq[i], false);
36334 }
36335 this.firePropertyChange ("alignment", null, this.alignment.getSequences ());
36336 }}, "~A");
36337 Clazz_defineMethod (c$, "setSequenceAnnotationsVisible", 
36338 function (sequenceI, visible) {
36339 for (var ann, $ann = 0, $$ann = this.alignment.getAlignmentAnnotation (); $ann < $$ann.length && ((ann = $$ann[$ann]) || true); $ann++) {
36340 if (ann.sequenceRef === sequenceI) {
36341 ann.visible = visible;
36342 }}
36343 }, "jalview.datamodel.SequenceI,~B");
36344 Clazz_defineMethod (c$, "hideRepSequences", 
36345 function (repSequence, sg) {
36346 var sSize = sg.getSize ();
36347 if (sSize < 2) {
36348 return;
36349 }if (this.hiddenRepSequences == null) {
36350 this.hiddenRepSequences =  new java.util.Hashtable ();
36351 }this.hiddenRepSequences.put (repSequence, sg);
36352 var seqs =  new Array (sSize - 1);
36353 var index = 0;
36354 for (var i = 0; i < sSize; i++) {
36355 if (sg.getSequenceAt (i) !== repSequence) {
36356 if (index == sSize - 1) {
36357 return;
36358 }seqs[index++] = sg.getSequenceAt (i);
36359 }}
36360 sg.setSeqrep (repSequence);
36361 sg.setHidereps (true);
36362 this.hideSequence (seqs);
36363 }, "jalview.datamodel.SequenceI,jalview.datamodel.SequenceGroup");
36364 Clazz_defineMethod (c$, "isHiddenRepSequence", 
36365 function (seq) {
36366 return this.alignment.getSeqrep () === seq || (this.hiddenRepSequences != null && this.hiddenRepSequences.containsKey (seq));
36367 }, "jalview.datamodel.SequenceI");
36368 Clazz_defineMethod (c$, "getRepresentedSequences", 
36369 function (seq) {
36370 return (this.hiddenRepSequences == null ? null : this.hiddenRepSequences.get (seq));
36371 }, "jalview.datamodel.SequenceI");
36372 Clazz_overrideMethod (c$, "adjustForHiddenSeqs", 
36373 function (alignmentIndex) {
36374 return this.alignment.getHiddenSequences ().adjustForHiddenSeqs (alignmentIndex);
36375 }, "~N");
36376 Clazz_overrideMethod (c$, "invertColumnSelection", 
36377 function () {
36378 this.colSel.invertColumnSelection (0, this.alignment.getWidth ());
36379 });
36380 Clazz_overrideMethod (c$, "getSelectionAsNewSequence", 
36381 function () {
36382 var sequences;
36383 if (this.selectionGroup == null || this.selectionGroup.getSize () == 0) {
36384 sequences = this.alignment.getSequencesArray ();
36385 var annots = this.alignment.getAlignmentAnnotation ();
36386 for (var i = 0; i < sequences.length; i++) {
36387 sequences[i] =  new jalview.datamodel.Sequence (sequences[i], annots);
36388 }
36389 } else {
36390 sequences = this.selectionGroup.getSelectionAsNewSequences (this.alignment);
36391 }return sequences;
36392 });
36393 Clazz_overrideMethod (c$, "getSequenceSelection", 
36394 function () {
36395 var sequences = null;
36396 if (this.selectionGroup != null) {
36397 sequences = this.selectionGroup.getSequencesInOrder (this.alignment);
36398 }if (sequences == null) {
36399 sequences = this.alignment.getSequencesArray ();
36400 }return sequences;
36401 });
36402 Clazz_overrideMethod (c$, "getViewAsCigars", 
36403 function (selectedRegionOnly) {
36404 return  new jalview.datamodel.CigarArray (this.alignment, this.colSel, (selectedRegionOnly ? this.selectionGroup : null));
36405 }, "~B");
36406 Clazz_defineMethod (c$, "getAlignmentView", 
36407 function (selectedOnly) {
36408 return this.getAlignmentView (selectedOnly, false);
36409 }, "~B");
36410 Clazz_defineMethod (c$, "getAlignmentView", 
36411 function (selectedOnly, markGroups) {
36412 return  new jalview.datamodel.AlignmentView (this.alignment, this.colSel, this.selectionGroup, this.colSel != null && this.colSel.hasHiddenColumns (), selectedOnly, markGroups);
36413 }, "~B,~B");
36414 Clazz_overrideMethod (c$, "getViewAsString", 
36415 function (selectedRegionOnly) {
36416 var selection = null;
36417 var seqs = null;
36418 var i;
36419 var iSize;
36420 var start = 0;
36421 var end = 0;
36422 if (selectedRegionOnly && this.selectionGroup != null) {
36423 iSize = this.selectionGroup.getSize ();
36424 seqs = this.selectionGroup.getSequencesInOrder (this.alignment);
36425 start = this.selectionGroup.getStartRes ();
36426 end = this.selectionGroup.getEndRes () + 1;
36427 } else {
36428 iSize = this.alignment.getHeight ();
36429 seqs = this.alignment.getSequencesArray ();
36430 end = this.alignment.getWidth ();
36431 }selection =  new Array (iSize);
36432 if (this.colSel != null && this.colSel.hasHiddenColumns ()) {
36433 selection = this.colSel.getVisibleSequenceStrings (start, end, seqs);
36434 } else {
36435 for (i = 0; i < iSize; i++) {
36436 selection[i] = seqs[i].getSequenceAsString (start, end);
36437 }
36438 }return selection;
36439 }, "~B");
36440 Clazz_overrideMethod (c$, "getVisibleRegionBoundaries", 
36441 function (min, max) {
36442 var regions =  new java.util.ArrayList ();
36443 var start = min;
36444 var end = max;
36445 do {
36446 if (this.colSel != null && this.colSel.hasHiddenColumns ()) {
36447 if (start == 0) {
36448 start = this.colSel.adjustForHiddenColumns (start);
36449 }end = this.colSel.getHiddenBoundaryRight (start);
36450 if (start == end) {
36451 end = max;
36452 }if (end > max) {
36453 end = max;
36454 }}regions.add ( Clazz_newIntArray (-1, [start, end]));
36455 if (this.colSel != null && this.colSel.hasHiddenColumns ()) {
36456 start = this.colSel.adjustForHiddenColumns (end);
36457 start = this.colSel.getHiddenBoundaryLeft (start) + 1;
36458 }} while (end < max);
36459 var startEnd =  Clazz_newIntArray (regions.size (), 2, 0);
36460 return regions;
36461 }, "~N,~N");
36462 Clazz_overrideMethod (c$, "getVisibleAlignmentAnnotation", 
36463 function (selectedOnly) {
36464 var ala =  new java.util.ArrayList ();
36465 var aa;
36466 if ((aa = this.alignment.getAlignmentAnnotation ()) != null) {
36467 for (var annot, $annot = 0, $$annot = aa; $annot < $$annot.length && ((annot = $$annot[$annot]) || true); $annot++) {
36468 var clone =  new jalview.datamodel.AlignmentAnnotation (annot);
36469 if (selectedOnly && this.selectionGroup != null) {
36470 this.colSel.makeVisibleAnnotation (this.selectionGroup.getStartRes (), this.selectionGroup.getEndRes (), clone);
36471 } else {
36472 this.colSel.makeVisibleAnnotation (clone);
36473 }ala.add (clone);
36474 }
36475 }return ala;
36476 }, "~B");
36477 Clazz_overrideMethod (c$, "isPadGaps", 
36478 function () {
36479 return this.padGaps;
36480 });
36481 Clazz_overrideMethod (c$, "setPadGaps", 
36482 function (padGaps) {
36483 this.padGaps = padGaps;
36484 }, "~B");
36485 Clazz_overrideMethod (c$, "alignmentChanged", 
36486 function (ap) {
36487 if (this.isPadGaps ()) {
36488 this.alignment.padGaps ();
36489 }if (this.autoCalculateConsensus) {
36490 this.updateConsensus (ap);
36491 }if (this.hconsensus != null && this.autoCalculateConsensus) {
36492 this.updateConservation (ap);
36493 }if (this.autoCalculateStrucConsensus) {
36494 this.updateStrucConsensus (ap);
36495 }var alWidth = this.alignment.getWidth ();
36496 var groups = this.alignment.getGroups ();
36497 if (groups != null) {
36498 for (var sg, $sg = groups.iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
36499 if (sg.getEndRes () > alWidth) {
36500 sg.setEndRes (alWidth - 1);
36501 }}
36502 }if (this.selectionGroup != null && this.selectionGroup.getEndRes () > alWidth) {
36503 this.selectionGroup.setEndRes (alWidth - 1);
36504 }this.resetAllColourSchemes ();
36505 this.calculator.restartWorkers ();
36506 }, "jalview.api.AlignmentViewPanel");
36507 Clazz_defineMethod (c$, "resetAllColourSchemes", 
36508 function () {
36509 var cs = this.globalColourScheme;
36510 if (cs != null) {
36511 cs.alignmentChanged (this.alignment, this.hiddenRepSequences);
36512 cs.setConsensus (this.hconsensus);
36513 if (cs.conservationApplied ()) {
36514 cs.setConservation (jalview.analysis.Conservation.calculateConservation ("All", jalview.schemes.ResidueProperties.propHash, 3, this.alignment.getSequences (), 0, this.alignment.getWidth (), false, this.getConsPercGaps (), false));
36515 }}for (var sg, $sg = this.alignment.getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
36516 if (sg.cs != null) {
36517 sg.cs.alignmentChanged (sg, this.hiddenRepSequences);
36518 }sg.recalcConservation ();
36519 }
36520 });
36521 Clazz_defineMethod (c$, "initAutoAnnotation", 
36522 function () {
36523 if (this.hconsensus == null && !this.$isDataset) {
36524 if (!this.alignment.isNucleotide ()) {
36525 this.initConservation ();
36526 this.initQuality ();
36527 } else {
36528 this.initRNAStructure ();
36529 }this.consensus =  new jalview.datamodel.AlignmentAnnotation ("Consensus", "PID",  new Array (1), 0, 100, 1);
36530 this.initConsensus (this.consensus);
36531 this.initComplementConsensus ();
36532 }});
36533 Clazz_defineMethod (c$, "initComplementConsensus", 
36534 function () {
36535 if (!this.alignment.isNucleotide ()) {
36536 var codonMappings = this.alignment.getCodonFrames ();
36537 if (codonMappings != null && !codonMappings.isEmpty ()) {
36538 this.complementConsensus =  new jalview.datamodel.AlignmentAnnotation ("cDNA Consensus", "PID for cDNA",  new Array (1), 0, 100, 1);
36539 this.initConsensus (this.complementConsensus);
36540 }}});
36541 Clazz_defineMethod (c$, "initConsensus", 
36542  function (aa) {
36543 aa.hasText = true;
36544 aa.autoCalculated = true;
36545 if (this.showConsensus) {
36546 this.alignment.addAnnotation (aa);
36547 }}, "jalview.datamodel.AlignmentAnnotation");
36548 Clazz_defineMethod (c$, "initConservation", 
36549  function () {
36550 if (this.showConservation) {
36551 if (this.conservation == null) {
36552 this.conservation =  new jalview.datamodel.AlignmentAnnotation ("Conservation", "Conservation of total alignment less than " + this.getConsPercGaps () + "% gaps",  new Array (1), 0, 11, 1);
36553 this.conservation.hasText = true;
36554 this.conservation.autoCalculated = true;
36555 this.alignment.addAnnotation (this.conservation);
36556 }}});
36557 Clazz_defineMethod (c$, "initQuality", 
36558  function () {
36559 if (this.showQuality) {
36560 if (this.quality == null) {
36561 this.quality =  new jalview.datamodel.AlignmentAnnotation ("Quality", "Alignment Quality based on Blosum62 scores",  new Array (1), 0, 11, 1);
36562 this.quality.hasText = true;
36563 this.quality.autoCalculated = true;
36564 this.alignment.addAnnotation (this.quality);
36565 }}});
36566 Clazz_defineMethod (c$, "initRNAStructure", 
36567  function () {
36568 if (this.alignment.hasRNAStructure () && this.strucConsensus == null) {
36569 this.strucConsensus =  new jalview.datamodel.AlignmentAnnotation ("StrucConsensus", "PID",  new Array (1), 0, 100, 1);
36570 this.strucConsensus.hasText = true;
36571 this.strucConsensus.autoCalculated = true;
36572 if (this.showConsensus) {
36573 this.alignment.addAnnotation (this.strucConsensus);
36574 }}});
36575 Clazz_overrideMethod (c$, "calcPanelHeight", 
36576 function () {
36577 var anns = this.getAlignment ().getAlignmentAnnotation ();
36578 var height = 0;
36579 var charHeight = this.getCharHeight ();
36580 if (anns != null) {
36581 var graphgrp =  new java.util.BitSet ();
36582 for (var aa, $aa = 0, $$aa = anns; $aa < $$aa.length && ((aa = $$aa[$aa]) || true); $aa++) {
36583 if (aa == null) {
36584 System.err.println ("Null annotation row: ignoring.");
36585 continue;
36586 }if (!aa.visible) {
36587 continue;
36588 }if (aa.graphGroup > -1) {
36589 if (graphgrp.get (aa.graphGroup)) {
36590 continue;
36591 } else {
36592 graphgrp.set (aa.graphGroup);
36593 }}aa.height = 0;
36594 if (aa.hasText) {
36595 aa.height += charHeight;
36596 }if (aa.hasIcons) {
36597 aa.height += 16;
36598 }if (aa.graph > 0) {
36599 aa.height += aa.graphHeight;
36600 }if (aa.height == 0) {
36601 aa.height = 20;
36602 }height += aa.height;
36603 }
36604 }if (height == 0) {
36605 height = 20;
36606 }return height;
36607 });
36608 Clazz_overrideMethod (c$, "updateGroupAnnotationSettings", 
36609 function (applyGlobalSettings, preserveNewGroupSettings) {
36610 var updateCalcs = false;
36611 var conv = this.isShowGroupConservation ();
36612 var cons = this.isShowGroupConsensus ();
36613 var showprf = this.isShowSequenceLogo ();
36614 var showConsHist = this.isShowConsensusHistogram ();
36615 var normLogo = this.isNormaliseSequenceLogo ();
36616 var sortg = true;
36617 var aan = this.alignment.getAlignmentAnnotation ();
36618 var oldrfs =  new java.util.ArrayList ();
36619 if (aan != null) {
36620 for (var an = 0; an < aan.length; an++) {
36621 if (aan[an].autoCalculated && aan[an].groupRef != null) {
36622 oldrfs.add (aan[an].groupRef);
36623 this.alignment.deleteAnnotation (aan[an], false);
36624 }}
36625 }if (this.alignment.getGroups () != null) {
36626 for (var sg, $sg = this.alignment.getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
36627 updateCalcs = false;
36628 if (applyGlobalSettings || (!preserveNewGroupSettings && !oldrfs.contains (sg))) {
36629 sg.setshowSequenceLogo (showprf);
36630 sg.setShowConsensusHistogram (showConsHist);
36631 sg.setNormaliseSequenceLogo (normLogo);
36632 }if (conv) {
36633 updateCalcs = true;
36634 this.alignment.addAnnotation (sg.getConservationRow (), 0);
36635 }if (cons) {
36636 updateCalcs = true;
36637 this.alignment.addAnnotation (sg.getConsensus (), 0);
36638 }if (updateCalcs) {
36639 sg.recalcConservation ();
36640 }}
36641 }oldrfs.clear ();
36642 }, "~B,~B");
36643 Clazz_defineMethod (c$, "isDisplayReferenceSeq", 
36644 function () {
36645 return this.alignment.hasSeqrep () && this.viewStyle.isDisplayReferenceSeq ();
36646 });
36647 Clazz_defineMethod (c$, "setDisplayReferenceSeq", 
36648 function (displayReferenceSeq) {
36649 this.viewStyle.setDisplayReferenceSeq (displayReferenceSeq);
36650 }, "~B");
36651 Clazz_defineMethod (c$, "isColourByReferenceSeq", 
36652 function () {
36653 return this.alignment.hasSeqrep () && this.viewStyle.isColourByReferenceSeq ();
36654 });
36655 Clazz_overrideMethod (c$, "getSequenceColour", 
36656 function (seq) {
36657 var sqc = this.sequenceColours.get (seq);
36658 return (sqc == null ? java.awt.Color.white : sqc);
36659 }, "jalview.datamodel.SequenceI");
36660 Clazz_overrideMethod (c$, "setSequenceColour", 
36661 function (seq, col) {
36662 if (col == null) {
36663 this.sequenceColours.remove (seq);
36664 } else {
36665 this.sequenceColours.put (seq, col);
36666 }}, "jalview.datamodel.SequenceI,java.awt.Color");
36667 Clazz_overrideMethod (c$, "updateSequenceIdColours", 
36668 function () {
36669 for (var sg, $sg = this.alignment.getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
36670 if (sg.idColour != null) {
36671 for (var s, $s = sg.getSequences (this.getHiddenRepSequences ()).iterator (); $s.hasNext () && ((s = $s.next ()) || true);) {
36672 this.sequenceColours.put (s, sg.idColour);
36673 }
36674 }}
36675 });
36676 Clazz_overrideMethod (c$, "clearSequenceColours", 
36677 function () {
36678 this.sequenceColours.clear ();
36679 });
36680 Clazz_defineMethod (c$, "getCodingComplement", 
36681 function () {
36682 return this.codingComplement;
36683 });
36684 Clazz_defineMethod (c$, "setCodingComplement", 
36685 function (av) {
36686 if (this === av) {
36687 System.err.println ("Ignoring recursive setCodingComplement request");
36688 } else {
36689 this.codingComplement = av;
36690 if (av.getCodingComplement () !== this) {
36691 av.setCodingComplement (this);
36692 }}}, "jalview.api.AlignViewportI");
36693 Clazz_overrideMethod (c$, "isNucleotide", 
36694 function () {
36695 return this.getAlignment () == null ? false : this.getAlignment ().isNucleotide ();
36696 });
36697 Clazz_overrideMethod (c$, "getFeaturesDisplayed", 
36698 function () {
36699 return this.featuresDisplayed;
36700 });
36701 Clazz_overrideMethod (c$, "setFeaturesDisplayed", 
36702 function (featuresDisplayedI) {
36703 this.featuresDisplayed = featuresDisplayedI;
36704 }, "jalview.api.FeaturesDisplayedI");
36705 Clazz_overrideMethod (c$, "areFeaturesDisplayed", 
36706 function () {
36707 return this.featuresDisplayed != null && this.featuresDisplayed.getRegisterdFeaturesCount () > 0;
36708 });
36709 Clazz_defineMethod (c$, "setShowSequenceFeatures", 
36710 function (b) {
36711 this.viewStyle.setShowSequenceFeatures (b);
36712 }, "~B");
36713 Clazz_defineMethod (c$, "isShowSequenceFeatures", 
36714 function () {
36715 return this.viewStyle.isShowSequenceFeatures ();
36716 });
36717 Clazz_defineMethod (c$, "setShowSequenceFeaturesHeight", 
36718 function (selected) {
36719 this.viewStyle.setShowSequenceFeaturesHeight (selected);
36720 }, "~B");
36721 Clazz_defineMethod (c$, "isShowSequenceFeaturesHeight", 
36722 function () {
36723 return this.viewStyle.isShowSequenceFeaturesHeight ();
36724 });
36725 Clazz_defineMethod (c$, "setShowAnnotation", 
36726 function (b) {
36727 this.viewStyle.setShowAnnotation (b);
36728 }, "~B");
36729 Clazz_defineMethod (c$, "isShowAnnotation", 
36730 function () {
36731 return this.viewStyle.isShowAnnotation ();
36732 });
36733 Clazz_defineMethod (c$, "isRightAlignIds", 
36734 function () {
36735 return this.viewStyle.isRightAlignIds ();
36736 });
36737 Clazz_defineMethod (c$, "setRightAlignIds", 
36738 function (rightAlignIds) {
36739 this.viewStyle.setRightAlignIds (rightAlignIds);
36740 }, "~B");
36741 Clazz_defineMethod (c$, "getConservationSelected", 
36742 function () {
36743 return this.viewStyle.getConservationSelected ();
36744 });
36745 Clazz_defineMethod (c$, "setShowBoxes", 
36746 function (state) {
36747 this.viewStyle.setShowBoxes (state);
36748 }, "~B");
36749 Clazz_defineMethod (c$, "getTextColour", 
36750 function () {
36751 return this.viewStyle.getTextColour ();
36752 });
36753 Clazz_defineMethod (c$, "getTextColour2", 
36754 function () {
36755 return this.viewStyle.getTextColour2 ();
36756 });
36757 Clazz_defineMethod (c$, "getThresholdTextColour", 
36758 function () {
36759 return this.viewStyle.getThresholdTextColour ();
36760 });
36761 Clazz_defineMethod (c$, "isConservationColourSelected", 
36762 function () {
36763 return this.viewStyle.isConservationColourSelected ();
36764 });
36765 Clazz_defineMethod (c$, "isRenderGaps", 
36766 function () {
36767 return this.viewStyle.isRenderGaps ();
36768 });
36769 Clazz_defineMethod (c$, "isShowColourText", 
36770 function () {
36771 return this.viewStyle.isShowColourText ();
36772 });
36773 Clazz_defineMethod (c$, "setConservationColourSelected", 
36774 function (conservationColourSelected) {
36775 this.viewStyle.setConservationColourSelected (conservationColourSelected);
36776 }, "~B");
36777 Clazz_defineMethod (c$, "setShowColourText", 
36778 function (showColourText) {
36779 this.viewStyle.setShowColourText (showColourText);
36780 }, "~B");
36781 Clazz_defineMethod (c$, "setTextColour", 
36782 function (textColour) {
36783 this.viewStyle.setTextColour (textColour);
36784 }, "java.awt.Color");
36785 Clazz_defineMethod (c$, "setThresholdTextColour", 
36786 function (thresholdTextColour) {
36787 this.viewStyle.setThresholdTextColour (thresholdTextColour);
36788 }, "~N");
36789 Clazz_defineMethod (c$, "setTextColour2", 
36790 function (textColour2) {
36791 this.viewStyle.setTextColour2 (textColour2);
36792 }, "java.awt.Color");
36793 Clazz_overrideMethod (c$, "getViewStyle", 
36794 function () {
36795 return  new jalview.viewmodel.styles.ViewStyle (this.viewStyle);
36796 });
36797 Clazz_overrideMethod (c$, "setViewStyle", 
36798 function (settingsForView) {
36799 this.viewStyle =  new jalview.viewmodel.styles.ViewStyle (settingsForView);
36800 }, "jalview.api.ViewStyleI");
36801 Clazz_defineMethod (c$, "sameStyle", 
36802 function (them) {
36803 return this.viewStyle.sameStyle (them);
36804 }, "jalview.api.ViewStyleI");
36805 Clazz_defineMethod (c$, "getIdWidth", 
36806 function () {
36807 return this.viewStyle.getIdWidth ();
36808 });
36809 Clazz_defineMethod (c$, "setIdWidth", 
36810 function (i) {
36811 this.viewStyle.setIdWidth (i);
36812 }, "~N");
36813 Clazz_defineMethod (c$, "isCentreColumnLabels", 
36814 function () {
36815 return this.viewStyle.isCentreColumnLabels ();
36816 });
36817 Clazz_defineMethod (c$, "setCentreColumnLabels", 
36818 function (centreColumnLabels) {
36819 this.viewStyle.setCentreColumnLabels (centreColumnLabels);
36820 }, "~B");
36821 Clazz_defineMethod (c$, "setShowDBRefs", 
36822 function (showdbrefs) {
36823 this.viewStyle.setShowDBRefs (showdbrefs);
36824 }, "~B");
36825 Clazz_defineMethod (c$, "isShowDBRefs", 
36826 function () {
36827 return this.viewStyle.isShowDBRefs ();
36828 });
36829 Clazz_defineMethod (c$, "isShowNPFeats", 
36830 function () {
36831 return this.viewStyle.isShowNPFeats ();
36832 });
36833 Clazz_defineMethod (c$, "setShowNPFeats", 
36834 function (shownpfeats) {
36835 this.viewStyle.setShowNPFeats (shownpfeats);
36836 }, "~B");
36837 Clazz_defineMethod (c$, "addToHistoryList", 
36838 function (command) {
36839 if (this.historyList != null) {
36840 this.historyList.push (command);
36841 this.broadcastCommand (command, false);
36842 }}, "jalview.commands.CommandI");
36843 Clazz_defineMethod (c$, "broadcastCommand", 
36844 function (command, undo) {
36845 this.getStructureSelectionManager ().commandPerformed (command, undo, this.getVamsasSource ());
36846 }, "jalview.commands.CommandI,~B");
36847 Clazz_defineMethod (c$, "addToRedoList", 
36848 function (command) {
36849 if (this.redoList != null) {
36850 this.redoList.push (command);
36851 }this.broadcastCommand (command, true);
36852 }, "jalview.commands.CommandI");
36853 Clazz_defineMethod (c$, "clearRedoList", 
36854 function () {
36855 if (this.redoList != null) {
36856 this.redoList.clear ();
36857 }});
36858 Clazz_defineMethod (c$, "setHistoryList", 
36859 function (list) {
36860 this.historyList = list;
36861 }, "java.util.Deque");
36862 Clazz_defineMethod (c$, "getHistoryList", 
36863 function () {
36864 return this.historyList;
36865 });
36866 Clazz_defineMethod (c$, "setRedoList", 
36867 function (list) {
36868 this.redoList = list;
36869 }, "java.util.Deque");
36870 Clazz_defineMethod (c$, "getRedoList", 
36871 function () {
36872 return this.redoList;
36873 });
36874 Clazz_overrideMethod (c$, "getVamsasSource", 
36875 function () {
36876 return this;
36877 });
36878 Clazz_defineMethod (c$, "getSortAnnotationsBy", 
36879 function () {
36880 return this.sortAnnotationsBy;
36881 });
36882 Clazz_defineMethod (c$, "setSortAnnotationsBy", 
36883 function (sortAnnotationsBy) {
36884 this.sortAnnotationsBy = sortAnnotationsBy;
36885 }, "jalview.analysis.AnnotationSorter.SequenceAnnotationOrder");
36886 Clazz_defineMethod (c$, "isShowAutocalculatedAbove", 
36887 function () {
36888 return this.showAutocalculatedAbove;
36889 });
36890 Clazz_defineMethod (c$, "setShowAutocalculatedAbove", 
36891 function (showAutocalculatedAbove) {
36892 this.showAutocalculatedAbove = showAutocalculatedAbove;
36893 }, "~B");
36894 Clazz_defineMethod (c$, "isScaleProteinAsCdna", 
36895 function () {
36896 return this.viewStyle.isScaleProteinAsCdna ();
36897 });
36898 Clazz_defineMethod (c$, "setScaleProteinAsCdna", 
36899 function (b) {
36900 this.viewStyle.setScaleProteinAsCdna (b);
36901 }, "~B");
36902 Clazz_defineMethod (c$, "isFollowHighlight", 
36903 function () {
36904 return this.followHighlight;
36905 });
36906 Clazz_overrideMethod (c$, "setFollowHighlight", 
36907 function (b) {
36908 this.followHighlight = b;
36909 }, "~B");
36910 Clazz_defineMethod (c$, "getStartRes", 
36911 function () {
36912 return this.startRes;
36913 });
36914 Clazz_overrideMethod (c$, "getEndRes", 
36915 function () {
36916 return this.endRes;
36917 });
36918 Clazz_defineMethod (c$, "getStartSeq", 
36919 function () {
36920 return this.startSeq;
36921 });
36922 Clazz_defineMethod (c$, "setStartRes", 
36923 function (res) {
36924 this.startRes = res;
36925 }, "~N");
36926 Clazz_defineMethod (c$, "setStartSeq", 
36927 function (seq) {
36928 this.startSeq = seq;
36929 }, "~N");
36930 Clazz_defineMethod (c$, "setEndRes", 
36931 function (res) {
36932 if (res > this.alignment.getWidth () - 1) {
36933 res = this.alignment.getWidth () - 1;
36934 }if (res < 0) {
36935 res = 0;
36936 }this.endRes = res;
36937 }, "~N");
36938 Clazz_defineMethod (c$, "setEndSeq", 
36939 function (seq) {
36940 if (seq > this.alignment.getHeight ()) {
36941 seq = this.alignment.getHeight ();
36942 }if (seq < 0) {
36943 seq = 0;
36944 }this.endSeq = seq;
36945 }, "~N");
36946 Clazz_defineMethod (c$, "getEndSeq", 
36947 function () {
36948 return this.endSeq;
36949 });
36950 Clazz_defineMethod (c$, "findComplementScrollTarget", 
36951 function (sr) {
36952 var complement = this.getCodingComplement ();
36953 if (complement == null || !complement.isFollowHighlight ()) {
36954 return 0;
36955 }var iAmProtein = !this.getAlignment ().isNucleotide ();
36956 var proteinAlignment = iAmProtein ? this.getAlignment () : complement.getAlignment ();
36957 if (proteinAlignment == null) {
36958 return 0;
36959 }var mappings = proteinAlignment.getCodonFrames ();
36960 var seqOffset = 0;
36961 var sequence = null;
36962 var middleColumn = this.getStartRes () + Clazz_doubleToInt ((this.getEndRes () - this.getStartRes ()) / 2);
36963 var hiddenSequences = this.getAlignment ().getHiddenSequences ();
36964 for (var seqNo = this.getStartSeq (); seqNo < this.getEndSeq (); seqNo++, seqOffset++) {
36965 sequence = this.getAlignment ().getSequenceAt (seqNo);
36966 if (hiddenSequences != null && hiddenSequences.isHidden (sequence)) {
36967 continue;
36968 }if (jalview.util.Comparison.isGap (sequence.getCharAt (middleColumn))) {
36969 continue;
36970 }var seqMappings = jalview.util.MappingUtils.findMappingsForSequence (sequence, mappings);
36971 if (!seqMappings.isEmpty ()) {
36972 break;
36973 }}
36974 if (sequence == null) {
36975 return 0;
36976 }jalview.util.MappingUtils.addSearchResults (sr, sequence, sequence.findPosition (middleColumn), mappings);
36977 return seqOffset;
36978 }, "jalview.datamodel.SearchResults");
36979 });
36980 Clazz_declarePackage ("jalview.api");
36981 Clazz_load (["jalview.api.ViewStyleI"], "jalview.api.AlignViewportI", null, function () {
36982 Clazz_declareInterface (jalview.api, "AlignViewportI", jalview.api.ViewStyleI);
36983 });
36984 Clazz_declarePackage ("jalview.api");
36985 Clazz_declareInterface (jalview.api, "ViewStyleI");
36986 Clazz_declarePackage ("jalview.viewmodel.styles");
36987 Clazz_load (["jalview.api.ViewStyleI", "java.awt.Color"], "jalview.viewmodel.styles.ViewStyle", ["java.lang.Boolean"], function () {
36988 c$ = Clazz_decorateAsClass (function () {
36989 this.abovePIDThreshold = false;
36990 this.charHeight = 0;
36991 this.charWidth = 0;
36992 this.idWidth = -1;
36993 this.colourAppliesToAllGroups = false;
36994 this.centreColumnLabels = false;
36995 this.showdbrefs = false;
36996 this.shownpfeats = false;
36997 this.colourByReferenceSeq = false;
36998 this.conservationColourSelected = false;
36999 this.displayReferenceSeq = false;
37000 this.increment = 0;
37001 this.renderGaps = true;
37002 this.rightAlignIds = false;
37003 this.scaleAboveWrapped = false;
37004 this.scaleLeftWrapped = true;
37005 this.scaleRightWrapped = true;
37006 this.seqNameItalics = false;
37007 this.showAnnotation = true;
37008 this.showBoxes = true;
37009 this.showColourText = false;
37010 this.showHiddenMarkers = true;
37011 this.showJVSuffix = true;
37012 this.showSeqFeaturesHeight = false;
37013 this.showSequenceFeatures = false;
37014 this.showText = true;
37015 this.showUnconserved = false;
37016 this.textColour = null;
37017 this.textColour2 = null;
37018 this.threshold = 0;
37019 this.thresholdTextColour = 0;
37020 this.upperCasebold = false;
37021 this.fontName = null;
37022 this.fontSize = 0;
37023 this.scaleProteinAsCdna = true;
37024 this.wrapAlignment = false;
37025 this.wrappedWidth = 0;
37026 this.fontStyle = 0;
37027 Clazz_instantialize (this, arguments);
37028 }, jalview.viewmodel.styles, "ViewStyle", null, jalview.api.ViewStyleI);
37029 Clazz_prepareFields (c$, function () {
37030 this.textColour = java.awt.Color.black;
37031 this.textColour2 = java.awt.Color.white;
37032 });
37033 Clazz_makeConstructor (c$, 
37034 function (vs) {
37035 this.setAbovePIDThreshold (vs.getAbovePIDThreshold ());
37036 this.setCentreColumnLabels (vs.isCentreColumnLabels ());
37037 this.setCharHeight (vs.getCharHeight ());
37038 this.setCharWidth (vs.getCharWidth ());
37039 this.setColourAppliesToAllGroups (vs.getColourAppliesToAllGroups ());
37040 this.setColourByReferenceSeq (vs.isColourByReferenceSeq ());
37041 this.setColourText (vs.getColourText ());
37042 this.setConservationColourSelected (vs.isConservationColourSelected ());
37043 this.setConservationSelected (vs.getConservationSelected ());
37044 this.setDisplayReferenceSeq (vs.isDisplayReferenceSeq ());
37045 this.setFontName (vs.getFontName ());
37046 this.setFontSize (vs.getFontSize ());
37047 this.setFontStyle (vs.getFontStyle ());
37048 this.setIdWidth (vs.getIdWidth ());
37049 this.setIncrement (vs.getIncrement ());
37050 this.setRenderGaps (vs.isRenderGaps ());
37051 this.setRightAlignIds (vs.isRightAlignIds ());
37052 this.setScaleAboveWrapped (vs.getScaleAboveWrapped ());
37053 this.setScaleLeftWrapped (vs.getScaleLeftWrapped ());
37054 this.setScaleProteinAsCdna (vs.isScaleProteinAsCdna ());
37055 this.setScaleRightWrapped (vs.getScaleRightWrapped ());
37056 this.setSeqNameItalics (vs.isSeqNameItalics ());
37057 this.setShowAnnotation (vs.isShowAnnotation ());
37058 this.setShowBoxes (vs.getShowBoxes ());
37059 this.setShowColourText (vs.isShowColourText ());
37060 this.setShowDBRefs (vs.isShowDBRefs ());
37061 this.setShowHiddenMarkers (vs.getShowHiddenMarkers ());
37062 this.setShowJVSuffix (vs.getShowJVSuffix ());
37063 this.setShowNPFeats (vs.isShowNPFeats ());
37064 this.setShowSequenceFeaturesHeight (vs.isShowSequenceFeaturesHeight ());
37065 this.setShowSequenceFeatures (vs.isShowSequenceFeatures ());
37066 this.setShowText (vs.getShowText ());
37067 this.setShowUnconserved (vs.getShowUnconserved ());
37068 this.setTextColour (vs.getTextColour ());
37069 this.setTextColour2 (vs.getTextColour2 ());
37070 this.setThreshold (vs.getThreshold ());
37071 this.setThresholdTextColour (vs.getThresholdTextColour ());
37072 this.setUpperCasebold (vs.isUpperCasebold ());
37073 this.setWrapAlignment (vs.getWrapAlignment ());
37074 this.setWrappedWidth (vs.getWrappedWidth ());
37075 }, "jalview.api.ViewStyleI");
37076 Clazz_makeConstructor (c$, 
37077 function () {
37078 });
37079 Clazz_overrideMethod (c$, "equals", 
37080 function (other) {
37081 if (other == null || !(Clazz_instanceOf (other, jalview.viewmodel.styles.ViewStyle))) {
37082 return false;
37083 }var vs = other;
37084 var match = (this.getAbovePIDThreshold () == vs.getAbovePIDThreshold () && this.isCentreColumnLabels () == vs.isCentreColumnLabels () && this.getCharHeight () == vs.getCharHeight () && this.getCharWidth () == vs.getCharWidth () && this.getColourAppliesToAllGroups () == vs.getColourAppliesToAllGroups () && this.isColourByReferenceSeq () == vs.isColourByReferenceSeq () && this.getColourText () == vs.getColourText () && this.isConservationColourSelected () == vs.isConservationColourSelected () && this.getConservationSelected () == vs.getConservationSelected () && this.isDisplayReferenceSeq () == vs.isDisplayReferenceSeq () && this.getFontSize () == vs.getFontSize () && this.getFontStyle () == vs.getFontStyle () && this.getIdWidth () == vs.getIdWidth () && this.getIncrement () == vs.getIncrement () && this.isRenderGaps () == vs.isRenderGaps () && this.isRightAlignIds () == vs.isRightAlignIds () && this.getScaleAboveWrapped () == vs.getScaleAboveWrapped () && this.getScaleLeftWrapped () == vs.getScaleLeftWrapped () && this.isScaleProteinAsCdna () == vs.isScaleProteinAsCdna () && this.getScaleRightWrapped () == vs.getScaleRightWrapped () && this.isSeqNameItalics () == vs.isSeqNameItalics () && this.isShowAnnotation () == vs.isShowAnnotation () && this.getShowBoxes () == vs.getShowBoxes () && this.isShowColourText () == vs.isShowColourText () && this.isShowDBRefs () == vs.isShowDBRefs () && this.getShowHiddenMarkers () == vs.getShowHiddenMarkers () && this.getShowJVSuffix () == vs.getShowJVSuffix () && this.isShowNPFeats () == vs.isShowNPFeats () && this.isShowSequenceFeaturesHeight () == vs.isShowSequenceFeaturesHeight () && this.isShowSequenceFeatures () == vs.isShowSequenceFeatures () && this.getShowText () == vs.getShowText () && this.getShowUnconserved () == vs.getShowUnconserved () && this.getThreshold () == vs.getThreshold () && this.getThresholdTextColour () == vs.getThresholdTextColour () && this.isUpperCasebold () == vs.isUpperCasebold () && this.getWrapAlignment () == vs.getWrapAlignment () && this.getWrappedWidth () == vs.getWrappedWidth ());
37085 match = match && String.valueOf (this.getFontName ()).equals (String.valueOf (vs.getFontName ()));
37086 match = match && String.valueOf (this.getTextColour ()).equals (String.valueOf (vs.getTextColour ()));
37087 match = match && String.valueOf (this.getTextColour2 ()).equals (String.valueOf (vs.getTextColour2 ()));
37088 return match;
37089 }, "~O");
37090 Clazz_overrideMethod (c$, "hashCode", 
37091 function () {
37092 var hash = 0;
37093 var m = 1;
37094 hash += m++ * Boolean.$valueOf (this.abovePIDThreshold).hashCode ();
37095 hash += m++ * Boolean.$valueOf (this.centreColumnLabels).hashCode ();
37096 hash += m++ * Boolean.$valueOf (this.colourAppliesToAllGroups).hashCode ();
37097 hash += m++ * Boolean.$valueOf (this.displayReferenceSeq).hashCode ();
37098 hash += m++ * Boolean.$valueOf (this.renderGaps).hashCode ();
37099 hash += m++ * Boolean.$valueOf (this.rightAlignIds).hashCode ();
37100 hash += m++ * Boolean.$valueOf (this.scaleProteinAsCdna).hashCode ();
37101 hash += m++ * Boolean.$valueOf (this.scaleRightWrapped).hashCode ();
37102 hash += m++ * Boolean.$valueOf (this.seqNameItalics).hashCode ();
37103 hash += m++ * Boolean.$valueOf (this.showAnnotation).hashCode ();
37104 hash += m++ * Boolean.$valueOf (this.showBoxes).hashCode ();
37105 hash += m++ * Boolean.$valueOf (this.showdbrefs).hashCode ();
37106 hash += m++ * Boolean.$valueOf (this.showJVSuffix).hashCode ();
37107 hash += m++ * Boolean.$valueOf (this.showSequenceFeatures).hashCode ();
37108 hash += m++ * Boolean.$valueOf (this.showUnconserved).hashCode ();
37109 hash += m++ * Boolean.$valueOf (this.wrapAlignment).hashCode ();
37110 hash += m++ * this.charHeight;
37111 hash += m++ * this.charWidth;
37112 hash += m++ * this.fontSize;
37113 hash += m++ * this.fontStyle;
37114 hash += m++ * this.idWidth;
37115 hash += String.valueOf (this.fontName).hashCode ();
37116 return hash;
37117 });
37118 Clazz_defineMethod (c$, "isUpperCasebold", 
37119 function () {
37120 return this.upperCasebold;
37121 });
37122 Clazz_overrideMethod (c$, "setUpperCasebold", 
37123 function (upperCasebold) {
37124 this.upperCasebold = upperCasebold;
37125 }, "~B");
37126 Clazz_defineMethod (c$, "getAbovePIDThreshold", 
37127 function () {
37128 return this.abovePIDThreshold;
37129 });
37130 Clazz_defineMethod (c$, "getCharHeight", 
37131 function () {
37132 return this.charHeight;
37133 });
37134 Clazz_defineMethod (c$, "getCharWidth", 
37135 function () {
37136 return this.charWidth;
37137 });
37138 Clazz_defineMethod (c$, "getColourAppliesToAllGroups", 
37139 function () {
37140 return this.colourAppliesToAllGroups;
37141 });
37142 Clazz_defineMethod (c$, "getColourText", 
37143 function () {
37144 return this.showColourText;
37145 });
37146 Clazz_defineMethod (c$, "getConservationSelected", 
37147 function () {
37148 return this.conservationColourSelected;
37149 });
37150 Clazz_defineMethod (c$, "getIncrement", 
37151 function () {
37152 return this.increment;
37153 });
37154 Clazz_defineMethod (c$, "getScaleAboveWrapped", 
37155 function () {
37156 return this.scaleAboveWrapped;
37157 });
37158 Clazz_defineMethod (c$, "getScaleLeftWrapped", 
37159 function () {
37160 return this.scaleLeftWrapped;
37161 });
37162 Clazz_defineMethod (c$, "getScaleRightWrapped", 
37163 function () {
37164 return this.scaleRightWrapped;
37165 });
37166 Clazz_defineMethod (c$, "getShowBoxes", 
37167 function () {
37168 return this.showBoxes;
37169 });
37170 Clazz_defineMethod (c$, "getShowHiddenMarkers", 
37171 function () {
37172 return this.showHiddenMarkers;
37173 });
37174 Clazz_defineMethod (c$, "getShowJVSuffix", 
37175 function () {
37176 return this.showJVSuffix;
37177 });
37178 Clazz_defineMethod (c$, "getShowText", 
37179 function () {
37180 return this.showText;
37181 });
37182 Clazz_defineMethod (c$, "getShowUnconserved", 
37183 function () {
37184 return this.showUnconserved;
37185 });
37186 Clazz_defineMethod (c$, "getTextColour", 
37187 function () {
37188 return this.textColour;
37189 });
37190 Clazz_defineMethod (c$, "getTextColour2", 
37191 function () {
37192 return this.textColour2;
37193 });
37194 Clazz_defineMethod (c$, "getThreshold", 
37195 function () {
37196 return this.threshold;
37197 });
37198 Clazz_defineMethod (c$, "getThresholdTextColour", 
37199 function () {
37200 return this.thresholdTextColour;
37201 });
37202 Clazz_defineMethod (c$, "getWrapAlignment", 
37203 function () {
37204 return this.wrapAlignment;
37205 });
37206 Clazz_defineMethod (c$, "getWrappedWidth", 
37207 function () {
37208 return this.wrappedWidth;
37209 });
37210 Clazz_defineMethod (c$, "isColourByReferenceSeq", 
37211 function () {
37212 return this.colourByReferenceSeq;
37213 });
37214 Clazz_defineMethod (c$, "isConservationColourSelected", 
37215 function () {
37216 return this.conservationColourSelected;
37217 });
37218 Clazz_defineMethod (c$, "isDisplayReferenceSeq", 
37219 function () {
37220 return this.displayReferenceSeq;
37221 });
37222 Clazz_defineMethod (c$, "isRenderGaps", 
37223 function () {
37224 return this.renderGaps;
37225 });
37226 Clazz_defineMethod (c$, "isRightAlignIds", 
37227 function () {
37228 return this.rightAlignIds;
37229 });
37230 Clazz_defineMethod (c$, "isSeqNameItalics", 
37231 function () {
37232 return this.seqNameItalics;
37233 });
37234 Clazz_defineMethod (c$, "isShowAnnotation", 
37235 function () {
37236 return this.showAnnotation;
37237 });
37238 Clazz_defineMethod (c$, "isShowColourText", 
37239 function () {
37240 return this.showColourText;
37241 });
37242 Clazz_defineMethod (c$, "isShowSequenceFeaturesHeight", 
37243 function () {
37244 return this.showSeqFeaturesHeight;
37245 });
37246 Clazz_defineMethod (c$, "isShowSequenceFeatures", 
37247 function () {
37248 return this.showSequenceFeatures;
37249 });
37250 Clazz_overrideMethod (c$, "setAbovePIDThreshold", 
37251 function (b) {
37252 this.abovePIDThreshold = b;
37253 }, "~B");
37254 Clazz_overrideMethod (c$, "setCharHeight", 
37255 function (h) {
37256 this.charHeight = h;
37257 }, "~N");
37258 Clazz_overrideMethod (c$, "setCharWidth", 
37259 function (w) {
37260 this.charWidth = w;
37261 }, "~N");
37262 Clazz_overrideMethod (c$, "setColourAppliesToAllGroups", 
37263 function (b) {
37264 this.colourAppliesToAllGroups = b;
37265 }, "~B");
37266 Clazz_overrideMethod (c$, "setColourByReferenceSeq", 
37267 function (colourByReferenceSeq) {
37268 this.colourByReferenceSeq = colourByReferenceSeq;
37269 }, "~B");
37270 Clazz_overrideMethod (c$, "setColourText", 
37271 function (state) {
37272 this.showColourText = state;
37273 }, "~B");
37274 Clazz_overrideMethod (c$, "setConservationColourSelected", 
37275 function (conservationColourSelected) {
37276 this.conservationColourSelected = conservationColourSelected;
37277 }, "~B");
37278 Clazz_overrideMethod (c$, "setConservationSelected", 
37279 function (b) {
37280 this.conservationColourSelected = b;
37281 }, "~B");
37282 Clazz_overrideMethod (c$, "setDisplayReferenceSeq", 
37283 function (displayReferenceSeq) {
37284 this.displayReferenceSeq = displayReferenceSeq;
37285 }, "~B");
37286 Clazz_overrideMethod (c$, "setIncrement", 
37287 function (inc) {
37288 this.increment = inc;
37289 }, "~N");
37290 Clazz_overrideMethod (c$, "setRenderGaps", 
37291 function (state) {
37292 this.renderGaps = state;
37293 }, "~B");
37294 Clazz_overrideMethod (c$, "setRightAlignIds", 
37295 function (rightAlignIds) {
37296 this.rightAlignIds = rightAlignIds;
37297 }, "~B");
37298 Clazz_overrideMethod (c$, "setScaleAboveWrapped", 
37299 function (b) {
37300 this.scaleAboveWrapped = b;
37301 }, "~B");
37302 Clazz_overrideMethod (c$, "setScaleLeftWrapped", 
37303 function (b) {
37304 this.scaleLeftWrapped = b;
37305 }, "~B");
37306 Clazz_overrideMethod (c$, "setScaleRightWrapped", 
37307 function (b) {
37308 this.scaleRightWrapped = b;
37309 }, "~B");
37310 Clazz_overrideMethod (c$, "setSeqNameItalics", 
37311 function (italics) {
37312 this.seqNameItalics = italics;
37313 }, "~B");
37314 Clazz_overrideMethod (c$, "setShowAnnotation", 
37315 function (b) {
37316 this.showAnnotation = b;
37317 }, "~B");
37318 Clazz_overrideMethod (c$, "setShowBoxes", 
37319 function (state) {
37320 this.showBoxes = state;
37321 }, "~B");
37322 Clazz_overrideMethod (c$, "setShowColourText", 
37323 function (showColourText) {
37324 this.showColourText = showColourText;
37325 }, "~B");
37326 Clazz_overrideMethod (c$, "setShowHiddenMarkers", 
37327 function (show) {
37328 this.showHiddenMarkers = show;
37329 }, "~B");
37330 Clazz_overrideMethod (c$, "setShowJVSuffix", 
37331 function (b) {
37332 this.showJVSuffix = b;
37333 }, "~B");
37334 Clazz_overrideMethod (c$, "setShowSequenceFeaturesHeight", 
37335 function (selected) {
37336 this.showSeqFeaturesHeight = selected;
37337 }, "~B");
37338 Clazz_overrideMethod (c$, "setShowSequenceFeatures", 
37339 function (b) {
37340 this.showSequenceFeatures = b;
37341 }, "~B");
37342 Clazz_overrideMethod (c$, "setShowText", 
37343 function (state) {
37344 this.showText = state;
37345 }, "~B");
37346 Clazz_overrideMethod (c$, "setShowUnconserved", 
37347 function (showunconserved) {
37348 this.showUnconserved = showunconserved;
37349 }, "~B");
37350 Clazz_overrideMethod (c$, "setTextColour", 
37351 function (textColour) {
37352 this.textColour = textColour;
37353 }, "java.awt.Color");
37354 Clazz_overrideMethod (c$, "setTextColour2", 
37355 function (textColour2) {
37356 this.textColour2 = textColour2;
37357 }, "java.awt.Color");
37358 Clazz_overrideMethod (c$, "setThreshold", 
37359 function (thresh) {
37360 this.threshold = thresh;
37361 }, "~N");
37362 Clazz_overrideMethod (c$, "setThresholdTextColour", 
37363 function (thresholdTextColour) {
37364 this.thresholdTextColour = thresholdTextColour;
37365 }, "~N");
37366 Clazz_overrideMethod (c$, "setWrapAlignment", 
37367 function (state) {
37368 this.wrapAlignment = state;
37369 }, "~B");
37370 Clazz_overrideMethod (c$, "setWrappedWidth", 
37371 function (w) {
37372 this.wrappedWidth = w;
37373 }, "~N");
37374 Clazz_overrideMethod (c$, "sameStyle", 
37375 function (that) {
37376 return this.equals (that);
37377 }, "jalview.api.ViewStyleI");
37378 Clazz_defineMethod (c$, "getFontName", 
37379 function () {
37380 return this.fontName;
37381 });
37382 Clazz_defineMethod (c$, "getFontSize", 
37383 function () {
37384 return this.fontSize;
37385 });
37386 Clazz_defineMethod (c$, "getFontStyle", 
37387 function () {
37388 return this.fontStyle;
37389 });
37390 Clazz_overrideMethod (c$, "setFontName", 
37391 function (name) {
37392 this.fontName = name;
37393 }, "~S");
37394 Clazz_overrideMethod (c$, "setFontSize", 
37395 function (size) {
37396 this.fontSize = size;
37397 }, "~N");
37398 Clazz_overrideMethod (c$, "setFontStyle", 
37399 function (style) {
37400 this.fontStyle = style;
37401 }, "~N");
37402 Clazz_defineMethod (c$, "getIdWidth", 
37403 function () {
37404 return this.idWidth;
37405 });
37406 Clazz_overrideMethod (c$, "setIdWidth", 
37407 function (idWidth) {
37408 this.idWidth = idWidth;
37409 }, "~N");
37410 Clazz_defineMethod (c$, "isCentreColumnLabels", 
37411 function () {
37412 return this.centreColumnLabels;
37413 });
37414 Clazz_overrideMethod (c$, "setCentreColumnLabels", 
37415 function (centreColumnLabels) {
37416 this.centreColumnLabels = centreColumnLabels;
37417 }, "~B");
37418 Clazz_defineMethod (c$, "isShowDBRefs", 
37419 function () {
37420 return this.showdbrefs;
37421 });
37422 Clazz_overrideMethod (c$, "setShowDBRefs", 
37423 function (showdbrefs) {
37424 this.showdbrefs = showdbrefs;
37425 }, "~B");
37426 Clazz_defineMethod (c$, "isShowNPFeats", 
37427 function () {
37428 return this.shownpfeats;
37429 });
37430 Clazz_overrideMethod (c$, "setShowNPFeats", 
37431 function (shownpfeats) {
37432 this.shownpfeats = shownpfeats;
37433 }, "~B");
37434 Clazz_defineMethod (c$, "isScaleProteinAsCdna", 
37435 function () {
37436 return this.scaleProteinAsCdna;
37437 });
37438 Clazz_overrideMethod (c$, "setScaleProteinAsCdna", 
37439 function (b) {
37440 this.scaleProteinAsCdna = b;
37441 }, "~B");
37442 });
37443 Clazz_declarePackage ("jalview.workers");
37444 Clazz_load (["jalview.api.AlignCalcManagerI", "java.util.ArrayList", "$.Collections", "$.HashSet", "$.Hashtable"], "jalview.workers.AlignCalcManager", null, function () {
37445 c$ = Clazz_decorateAsClass (function () {
37446 this.restartable = null;
37447 this.blackList = null;
37448 this.inProgress = null;
37449 this.updating = null;
37450 this.canUpdate = null;
37451 Clazz_instantialize (this, arguments);
37452 }, jalview.workers, "AlignCalcManager", null, jalview.api.AlignCalcManagerI);
37453 Clazz_prepareFields (c$, function () {
37454 this.restartable = java.util.Collections.synchronizedList ( new java.util.ArrayList ());
37455 this.blackList = java.util.Collections.synchronizedList ( new java.util.ArrayList ());
37456 this.inProgress = java.util.Collections.synchronizedMap ( new java.util.Hashtable ());
37457 this.updating = java.util.Collections.synchronizedMap ( new java.util.Hashtable ());
37458 this.canUpdate =  new java.util.HashSet ();
37459 });
37460 Clazz_overrideMethod (c$, "notifyStart", 
37461 function (worker) {
37462 {
37463 var upd = this.updating.get (worker.getClass ());
37464 if (upd == null) {
37465 this.updating.put (worker.getClass (), upd = java.util.Collections.synchronizedList ( new java.util.ArrayList ()));
37466 }{
37467 upd.add (worker);
37468 }}}, "jalview.api.AlignCalcWorkerI");
37469 Clazz_overrideMethod (c$, "alreadyDoing", 
37470 function (worker) {
37471 {
37472 return this.inProgress.containsKey (worker.getClass ());
37473 }}, "jalview.api.AlignCalcWorkerI");
37474 Clazz_overrideMethod (c$, "isPending", 
37475 function (workingClass) {
37476 var upd;
37477 {
37478 upd = this.updating.get (workingClass.getClass ());
37479 if (upd == null) {
37480 return false;
37481 }{
37482 if (upd.size () > 1) {
37483 return true;
37484 }}return false;
37485 }}, "jalview.api.AlignCalcWorkerI");
37486 Clazz_defineMethod (c$, "numberLive", 
37487 function (worker) {
37488 {
37489 var upd = this.updating.get (worker.getClass ());
37490 if (upd == null) {
37491 return 0;
37492 };return upd.size ();
37493 }}, "jalview.api.AlignCalcWorkerI");
37494 Clazz_overrideMethod (c$, "notifyWorking", 
37495 function (worker) {
37496 {
37497 if (this.inProgress.get (worker.getClass ()) != null) {
37498 if (false) {
37499 System.err.println ("Warning: Multiple workers are running of type " + worker.getClass ());
37500 }return false;
37501 }this.inProgress.put (worker.getClass (), worker);
37502 }return true;
37503 }, "jalview.api.AlignCalcWorkerI");
37504 Clazz_overrideMethod (c$, "workerComplete", 
37505 function (worker) {
37506 {
37507 this.inProgress.remove (worker.getClass ());
37508 var upd = this.updating.get (worker.getClass ());
37509 if (upd != null) {
37510 {
37511 upd.remove (worker);
37512 }this.canUpdate.add (worker);
37513 }}}, "jalview.api.AlignCalcWorkerI");
37514 Clazz_overrideMethod (c$, "workerCannotRun", 
37515 function (worker) {
37516 {
37517 this.blackList.add (worker.getClass ());
37518 }}, "jalview.api.AlignCalcWorkerI");
37519 Clazz_defineMethod (c$, "isBlackListed", 
37520 function (workerType) {
37521 {
37522 return this.blackList.contains (workerType);
37523 }}, "Class");
37524 Clazz_overrideMethod (c$, "startWorker", 
37525 function (worker) {
37526 var workerAsThread = worker;
37527 if (workerAsThread.isAlive ()) {
37528 workerAsThread.interrupt ();
37529 worker = worker.getNewWorker ();
37530 }worker.setName (worker.getClass ().getName ());
37531 worker.start ();
37532 }, "jalview.api.AlignCalcWorkerI");
37533 Clazz_defineMethod (c$, "isWorking", 
37534 function (worker) {
37535 {
37536 return worker != null && this.inProgress.get (worker.getClass ()) === worker;
37537 }}, "jalview.api.AlignCalcWorkerI");
37538 Clazz_defineMethod (c$, "isWorking", 
37539 function () {
37540 {
37541 return this.inProgress.size () > 0;
37542 }});
37543 Clazz_overrideMethod (c$, "registerWorker", 
37544 function (worker) {
37545 {
37546 if (!this.restartable.contains (worker)) {
37547 this.restartable.add (worker);
37548 }this.startWorker (worker);
37549 }}, "jalview.api.AlignCalcWorkerI");
37550 Clazz_overrideMethod (c$, "restartWorkers", 
37551 function () {
37552 {
37553 for (var worker, $worker = this.restartable.iterator (); $worker.hasNext () && ((worker = $worker.next ()) || true);) {
37554 this.startWorker (worker);
37555 }
37556 }});
37557 Clazz_overrideMethod (c$, "workingInvolvedWith", 
37558 function (alignmentAnnotation) {
37559 {
37560 for (var worker, $worker = this.inProgress.values ().iterator (); $worker.hasNext () && ((worker = $worker.next ()) || true);) {
37561 if (worker.involves (alignmentAnnotation)) {
37562 return true;
37563 }}
37564 }{
37565 for (var workers, $workers = this.updating.values ().iterator (); $workers.hasNext () && ((workers = $workers.next ()) || true);) {
37566 for (var worker, $worker = workers.iterator (); $worker.hasNext () && ((worker = $worker.next ()) || true);) {
37567 if (worker.involves (alignmentAnnotation)) {
37568 return true;
37569 }}
37570 }
37571 }return false;
37572 }, "jalview.datamodel.AlignmentAnnotation");
37573 Clazz_overrideMethod (c$, "updateAnnotationFor", 
37574 function (workerClass) {
37575 var workers;
37576 {
37577 workers = this.canUpdate.toArray ( new Array (0));
37578 }for (var worker, $worker = 0, $$worker = workers; $worker < $$worker.length && ((worker = $$worker[$worker]) || true); $worker++) {
37579 if (workerClass.equals (worker.getClass ())) {
37580 worker.updateAnnotation ();
37581 }}
37582 }, "Class");
37583 Clazz_overrideMethod (c$, "getRegisteredWorkersOfClass", 
37584 function (workerClass) {
37585 var workingClass =  new java.util.ArrayList ();
37586 var workers;
37587 {
37588 workers = this.canUpdate.toArray ( new Array (this.canUpdate.size ()));
37589 }for (var worker, $worker = 0, $$worker = workers; $worker < $$worker.length && ((worker = $$worker[$worker]) || true); $worker++) {
37590 if (workerClass.equals (worker.getClass ())) {
37591 workingClass.add (worker);
37592 }}
37593 return (workingClass.size () == 0) ? null : workingClass;
37594 }, "Class");
37595 Clazz_overrideMethod (c$, "startRegisteredWorkersOfClass", 
37596 function (workerClass) {
37597 var workers = this.getRegisteredWorkersOfClass (workerClass);
37598 if (workers == null) {
37599 return false;
37600 }for (var worker, $worker = workers.iterator (); $worker.hasNext () && ((worker = $worker.next ()) || true);) {
37601 if (!this.isPending (worker)) {
37602 this.startWorker (worker);
37603 } else {
37604 System.err.println ("Pending exists for " + workerClass);
37605 }}
37606 return true;
37607 }, "Class");
37608 Clazz_overrideMethod (c$, "workerMayRun", 
37609 function (worker) {
37610 {
37611 if (this.blackList.contains (worker.getClass ())) {
37612 this.blackList.remove (worker.getClass ());
37613 }}}, "jalview.api.AlignCalcWorkerI");
37614 Clazz_overrideMethod (c$, "removeRegisteredWorkersOfClass", 
37615 function (typeToRemove) {
37616 var workers = this.getRegisteredWorkersOfClass (typeToRemove);
37617 var removable =  new java.util.ArrayList ();
37618 var toremovannot =  new java.util.HashSet ();
37619 {
37620 for (var worker, $worker = this.restartable.iterator (); $worker.hasNext () && ((worker = $worker.next ()) || true);) {
37621 if (typeToRemove.equals (worker.getClass ())) {
37622 removable.add (worker);
37623 toremovannot.add (worker);
37624 }}
37625 this.restartable.removeAll (removable);
37626 }{
37627 for (var worker, $worker = this.canUpdate.iterator (); $worker.hasNext () && ((worker = $worker.next ()) || true);) {
37628 if (typeToRemove.equals (worker.getClass ())) {
37629 removable.add (worker);
37630 toremovannot.add (worker);
37631 }}
37632 this.canUpdate.removeAll (removable);
37633 }}, "Class");
37634 });
37635 Clazz_declarePackage ("jalview.api");
37636 Clazz_declareInterface (jalview.api, "AlignCalcManagerI");
37637 Clazz_declarePackage ("java.util");
37638 Clazz_load (["java.util.AbstractCollection", "$.Iterator", "java.util.Deque"], "java.util.ArrayDeque", ["java.lang.AssertionError", "$.IllegalStateException", "$.NullPointerException", "java.lang.reflect.Array", "java.util.Arrays", "$.ConcurrentModificationException", "$.NoSuchElementException"], function () {
37639 c$ = Clazz_decorateAsClass (function () {
37640 this.elements = null;
37641 this.head = 0;
37642 this.tail = 0;
37643 if (!Clazz_isClassDefined ("java.util.ArrayDeque.DeqIterator")) {
37644 java.util.ArrayDeque.$ArrayDeque$DeqIterator$ ();
37645 }
37646 if (!Clazz_isClassDefined ("java.util.ArrayDeque.DescendingIterator")) {
37647 java.util.ArrayDeque.$ArrayDeque$DescendingIterator$ ();
37648 }
37649 Clazz_instantialize (this, arguments);
37650 }, java.util, "ArrayDeque", java.util.AbstractCollection, [java.util.Deque, Cloneable, java.io.Serializable]);
37651 Clazz_defineMethod (c$, "allocateElements", 
37652  function (numElements) {
37653 var initialCapacity = 8;
37654 if (numElements >= initialCapacity) {
37655 initialCapacity = numElements;
37656 initialCapacity |= (initialCapacity >>> 1);
37657 initialCapacity |= (initialCapacity >>> 2);
37658 initialCapacity |= (initialCapacity >>> 4);
37659 initialCapacity |= (initialCapacity >>> 8);
37660 initialCapacity |= (initialCapacity >>> 16);
37661 initialCapacity++;
37662 if (initialCapacity < 0) initialCapacity >>>= 1;
37663 }this.elements =  new Array (initialCapacity);
37664 }, "~N");
37665 Clazz_defineMethod (c$, "doubleCapacity", 
37666  function () {
37667 var p = this.head;
37668 var n = this.elements.length;
37669 var r = n - p;
37670 var newCapacity = n << 1;
37671 if (newCapacity < 0) throw  new IllegalStateException ("Sorry, deque too big");
37672 var a =  new Array (newCapacity);
37673 System.arraycopy (this.elements, p, a, 0, r);
37674 System.arraycopy (this.elements, 0, a, r, p);
37675 this.elements = a;
37676 this.head = 0;
37677 this.tail = n;
37678 });
37679 Clazz_defineMethod (c$, "copyElements", 
37680  function (a) {
37681 if (this.head < this.tail) {
37682 System.arraycopy (this.elements, this.head, a, 0, this.size ());
37683 } else if (this.head > this.tail) {
37684 var headPortionLen = this.elements.length - this.head;
37685 System.arraycopy (this.elements, this.head, a, 0, headPortionLen);
37686 System.arraycopy (this.elements, 0, a, headPortionLen, this.tail);
37687 }return a;
37688 }, "~A");
37689 Clazz_makeConstructor (c$, 
37690 function () {
37691 Clazz_superConstructor (this, java.util.ArrayDeque, []);
37692 this.elements =  new Array (16);
37693 });
37694 Clazz_makeConstructor (c$, 
37695 function (numElements) {
37696 Clazz_superConstructor (this, java.util.ArrayDeque, []);
37697 this.allocateElements (numElements);
37698 }, "~N");
37699 Clazz_makeConstructor (c$, 
37700 function (c) {
37701 Clazz_superConstructor (this, java.util.ArrayDeque, []);
37702 this.allocateElements (c.size ());
37703 this.addAll (c);
37704 }, "java.util.Collection");
37705 Clazz_overrideMethod (c$, "addFirst", 
37706 function (e) {
37707 if (e == null) throw  new NullPointerException ();
37708 this.elements[this.head = (this.head - 1) & (this.elements.length - 1)] = e;
37709 if (this.head == this.tail) this.doubleCapacity ();
37710 }, "~O");
37711 Clazz_overrideMethod (c$, "addLast", 
37712 function (e) {
37713 if (e == null) throw  new NullPointerException ();
37714 this.elements[this.tail] = e;
37715 if ((this.tail = (this.tail + 1) & (this.elements.length - 1)) == this.head) this.doubleCapacity ();
37716 }, "~O");
37717 Clazz_overrideMethod (c$, "offerFirst", 
37718 function (e) {
37719 this.addFirst (e);
37720 return true;
37721 }, "~O");
37722 Clazz_overrideMethod (c$, "offerLast", 
37723 function (e) {
37724 this.addLast (e);
37725 return true;
37726 }, "~O");
37727 Clazz_overrideMethod (c$, "removeFirst", 
37728 function () {
37729 var x = this.pollFirst ();
37730 if (x == null) throw  new java.util.NoSuchElementException ();
37731 return x;
37732 });
37733 Clazz_overrideMethod (c$, "removeLast", 
37734 function () {
37735 var x = this.pollLast ();
37736 if (x == null) throw  new java.util.NoSuchElementException ();
37737 return x;
37738 });
37739 Clazz_overrideMethod (c$, "pollFirst", 
37740 function () {
37741 var h = this.head;
37742 var result = this.elements[h];
37743 if (result == null) return null;
37744 this.elements[h] = null;
37745 this.head = (h + 1) & (this.elements.length - 1);
37746 return result;
37747 });
37748 Clazz_overrideMethod (c$, "pollLast", 
37749 function () {
37750 var t = (this.tail - 1) & (this.elements.length - 1);
37751 var result = this.elements[t];
37752 if (result == null) return null;
37753 this.elements[t] = null;
37754 this.tail = t;
37755 return result;
37756 });
37757 Clazz_overrideMethod (c$, "getFirst", 
37758 function () {
37759 var x = this.elements[this.head];
37760 if (x == null) throw  new java.util.NoSuchElementException ();
37761 return x;
37762 });
37763 Clazz_overrideMethod (c$, "getLast", 
37764 function () {
37765 var x = this.elements[(this.tail - 1) & (this.elements.length - 1)];
37766 if (x == null) throw  new java.util.NoSuchElementException ();
37767 return x;
37768 });
37769 Clazz_overrideMethod (c$, "peekFirst", 
37770 function () {
37771 return this.elements[this.head];
37772 });
37773 Clazz_overrideMethod (c$, "peekLast", 
37774 function () {
37775 return this.elements[(this.tail - 1) & (this.elements.length - 1)];
37776 });
37777 Clazz_overrideMethod (c$, "removeFirstOccurrence", 
37778 function (o) {
37779 if (o == null) return false;
37780 var mask = this.elements.length - 1;
37781 var i = this.head;
37782 var x;
37783 while ((x = this.elements[i]) != null) {
37784 if (o.equals (x)) {
37785 this.$delete (i);
37786 return true;
37787 }i = (i + 1) & mask;
37788 }
37789 return false;
37790 }, "~O");
37791 Clazz_overrideMethod (c$, "removeLastOccurrence", 
37792 function (o) {
37793 if (o == null) return false;
37794 var mask = this.elements.length - 1;
37795 var i = (this.tail - 1) & mask;
37796 var x;
37797 while ((x = this.elements[i]) != null) {
37798 if (o.equals (x)) {
37799 this.$delete (i);
37800 return true;
37801 }i = (i - 1) & mask;
37802 }
37803 return false;
37804 }, "~O");
37805 Clazz_overrideMethod (c$, "add", 
37806 function (e) {
37807 this.addLast (e);
37808 return true;
37809 }, "~O");
37810 Clazz_overrideMethod (c$, "offer", 
37811 function (e) {
37812 return this.offerLast (e);
37813 }, "~O");
37814 Clazz_defineMethod (c$, "remove", 
37815 function () {
37816 return this.removeFirst ();
37817 });
37818 Clazz_overrideMethod (c$, "poll", 
37819 function () {
37820 return this.pollFirst ();
37821 });
37822 Clazz_overrideMethod (c$, "element", 
37823 function () {
37824 return this.getFirst ();
37825 });
37826 Clazz_overrideMethod (c$, "peek", 
37827 function () {
37828 return this.peekFirst ();
37829 });
37830 Clazz_overrideMethod (c$, "push", 
37831 function (e) {
37832 this.addFirst (e);
37833 }, "~O");
37834 Clazz_overrideMethod (c$, "pop", 
37835 function () {
37836 return this.removeFirst ();
37837 });
37838 Clazz_defineMethod (c$, "checkInvariants", 
37839  function () {
37840 });
37841 Clazz_defineMethod (c$, "$delete", 
37842  function (i) {
37843 this.checkInvariants ();
37844 var elements = this.elements;
37845 var mask = elements.length - 1;
37846 var h = this.head;
37847 var t = this.tail;
37848 var front = (i - h) & mask;
37849 var back = (t - i) & mask;
37850 if (front >= ((t - h) & mask)) throw  new java.util.ConcurrentModificationException ();
37851 if (front < back) {
37852 if (h <= i) {
37853 System.arraycopy (elements, h, elements, h + 1, front);
37854 } else {
37855 System.arraycopy (elements, 0, elements, 1, i);
37856 elements[0] = elements[mask];
37857 System.arraycopy (elements, h, elements, h + 1, mask - h);
37858 }elements[h] = null;
37859 this.head = (h + 1) & mask;
37860 return false;
37861 } else {
37862 if (i < t) {
37863 System.arraycopy (elements, i + 1, elements, i, back);
37864 this.tail = t - 1;
37865 } else {
37866 System.arraycopy (elements, i + 1, elements, i, mask - i);
37867 elements[mask] = elements[0];
37868 System.arraycopy (elements, 1, elements, 0, t);
37869 this.tail = (t - 1) & mask;
37870 }return true;
37871 }}, "~N");
37872 Clazz_overrideMethod (c$, "size", 
37873 function () {
37874 return (this.tail - this.head) & (this.elements.length - 1);
37875 });
37876 Clazz_overrideMethod (c$, "isEmpty", 
37877 function () {
37878 return this.head == this.tail;
37879 });
37880 Clazz_overrideMethod (c$, "iterator", 
37881 function () {
37882 return Clazz_innerTypeInstance (java.util.ArrayDeque.DeqIterator, this, null);
37883 });
37884 Clazz_overrideMethod (c$, "descendingIterator", 
37885 function () {
37886 return Clazz_innerTypeInstance (java.util.ArrayDeque.DescendingIterator, this, null);
37887 });
37888 Clazz_overrideMethod (c$, "contains", 
37889 function (o) {
37890 if (o == null) return false;
37891 var mask = this.elements.length - 1;
37892 var i = this.head;
37893 var x;
37894 while ((x = this.elements[i]) != null) {
37895 if (o.equals (x)) return true;
37896 i = (i + 1) & mask;
37897 }
37898 return false;
37899 }, "~O");
37900 Clazz_defineMethod (c$, "remove", 
37901 function (o) {
37902 return this.removeFirstOccurrence (o);
37903 }, "~O");
37904 Clazz_overrideMethod (c$, "clear", 
37905 function () {
37906 var h = this.head;
37907 var t = this.tail;
37908 if (h != t) {
37909 this.head = this.tail = 0;
37910 var i = h;
37911 var mask = this.elements.length - 1;
37912 do {
37913 this.elements[i] = null;
37914 i = (i + 1) & mask;
37915 } while (i != t);
37916 }});
37917 Clazz_defineMethod (c$, "toArray", 
37918 function () {
37919 return this.copyElements ( new Array (this.size ()));
37920 });
37921 Clazz_defineMethod (c$, "toArray", 
37922 function (a) {
37923 var size = this.size ();
37924 if (a.length < size) a = java.lang.reflect.Array.newInstance (a.getClass ().getComponentType (), size);
37925 this.copyElements (a);
37926 if (a.length > size) a[size] = null;
37927 return a;
37928 }, "~A");
37929 Clazz_defineMethod (c$, "clone", 
37930 function () {
37931 try {
37932 var result = Clazz_superCall (this, java.util.ArrayDeque, "clone", []);
37933 result.elements = java.util.Arrays.copyOf (this.elements, this.elements.length);
37934 return result;
37935 } catch (e) {
37936 if (Clazz_exceptionOf (e, CloneNotSupportedException)) {
37937 throw  new AssertionError ();
37938 } else {
37939 throw e;
37940 }
37941 }
37942 });
37943 c$.$ArrayDeque$DeqIterator$ = function () {
37944 Clazz_pu$h(self.c$);
37945 c$ = Clazz_decorateAsClass (function () {
37946 Clazz_prepareCallback (this, arguments);
37947 this.cursor = 0;
37948 this.fence = 0;
37949 this.lastRet = -1;
37950 Clazz_instantialize (this, arguments);
37951 }, java.util.ArrayDeque, "DeqIterator", null, java.util.Iterator);
37952 Clazz_prepareFields (c$, function () {
37953 this.cursor = this.b$["java.util.ArrayDeque"].head;
37954 this.fence = this.b$["java.util.ArrayDeque"].tail;
37955 });
37956 Clazz_overrideMethod (c$, "hasNext", 
37957 function () {
37958 return this.cursor != this.fence;
37959 });
37960 Clazz_overrideMethod (c$, "next", 
37961 function () {
37962 if (this.cursor == this.fence) throw  new java.util.NoSuchElementException ();
37963 var a = this.b$["java.util.ArrayDeque"].elements[this.cursor];
37964 if (this.b$["java.util.ArrayDeque"].tail != this.fence || a == null) throw  new java.util.ConcurrentModificationException ();
37965 this.lastRet = this.cursor;
37966 this.cursor = (this.cursor + 1) & (this.b$["java.util.ArrayDeque"].elements.length - 1);
37967 return a;
37968 });
37969 Clazz_overrideMethod (c$, "remove", 
37970 function () {
37971 if (this.lastRet < 0) throw  new IllegalStateException ();
37972 if (this.b$["java.util.ArrayDeque"].$delete (this.lastRet)) {
37973 this.cursor = (this.cursor - 1) & (this.b$["java.util.ArrayDeque"].elements.length - 1);
37974 this.fence = this.b$["java.util.ArrayDeque"].tail;
37975 }this.lastRet = -1;
37976 });
37977 c$ = Clazz_p0p ();
37978 };
37979 c$.$ArrayDeque$DescendingIterator$ = function () {
37980 Clazz_pu$h(self.c$);
37981 c$ = Clazz_decorateAsClass (function () {
37982 Clazz_prepareCallback (this, arguments);
37983 this.cursor = 0;
37984 this.fence = 0;
37985 this.lastRet = -1;
37986 Clazz_instantialize (this, arguments);
37987 }, java.util.ArrayDeque, "DescendingIterator", null, java.util.Iterator);
37988 Clazz_prepareFields (c$, function () {
37989 this.cursor = this.b$["java.util.ArrayDeque"].tail;
37990 this.fence = this.b$["java.util.ArrayDeque"].head;
37991 });
37992 Clazz_overrideMethod (c$, "hasNext", 
37993 function () {
37994 return this.cursor != this.fence;
37995 });
37996 Clazz_overrideMethod (c$, "next", 
37997 function () {
37998 if (this.cursor == this.fence) throw  new java.util.NoSuchElementException ();
37999 this.cursor = (this.cursor - 1) & (this.b$["java.util.ArrayDeque"].elements.length - 1);
38000 var a = this.b$["java.util.ArrayDeque"].elements[this.cursor];
38001 if (this.b$["java.util.ArrayDeque"].head != this.fence || a == null) throw  new java.util.ConcurrentModificationException ();
38002 this.lastRet = this.cursor;
38003 return a;
38004 });
38005 Clazz_overrideMethod (c$, "remove", 
38006 function () {
38007 if (this.lastRet < 0) throw  new IllegalStateException ();
38008 if (!this.b$["java.util.ArrayDeque"].$delete (this.lastRet)) {
38009 this.cursor = (this.cursor + 1) & (this.b$["java.util.ArrayDeque"].elements.length - 1);
38010 this.fence = this.b$["java.util.ArrayDeque"].head;
38011 }this.lastRet = -1;
38012 });
38013 c$ = Clazz_p0p ();
38014 };
38015 Clazz_defineStatics (c$,
38016 "MIN_INITIAL_CAPACITY", 8);
38017 });
38018 Clazz_declarePackage ("java.util");
38019 Clazz_load (["java.util.Queue"], "java.util.Deque", null, function () {
38020 Clazz_declareInterface (java.util, "Deque", java.util.Queue);
38021 });
38022 Clazz_declarePackage ("jalview.datamodel");
38023 Clazz_load (null, "jalview.datamodel.AlignmentView", ["jalview.datamodel.Alignment", "$.CigarArray", "$.ColumnSelection", "$.SeqCigar", "$.SequenceGroup", "jalview.util.MessageManager", "$.ShiftList", "java.lang.Error", "java.util.ArrayList", "$.Vector"], function () {
38024 c$ = Clazz_decorateAsClass (function () {
38025 this.sequences = null;
38026 this.contigs = null;
38027 this.width = 0;
38028 this.firstCol = 0;
38029 this.scGroups = null;
38030 this.$isNa = false;
38031 if (!Clazz_isClassDefined ("jalview.datamodel.AlignmentView.ScGroup")) {
38032 jalview.datamodel.AlignmentView.$AlignmentView$ScGroup$ ();
38033 }
38034 this.selected = null;
38035 Clazz_instantialize (this, arguments);
38036 }, jalview.datamodel, "AlignmentView");
38037 Clazz_defineMethod (c$, "isNa", 
38038 function () {
38039 return this.$isNa;
38040 });
38041 Clazz_makeConstructor (c$, 
38042 function (alignment, columnSelection, selection, hasHiddenColumns, selectedRegionOnly, recordGroups) {
38043 this.construct ( new jalview.datamodel.CigarArray (alignment, (hasHiddenColumns ? columnSelection : null), (selectedRegionOnly ? selection : null)), (selectedRegionOnly && selection != null) ? selection.getStartRes () : 0);
38044 this.$isNa = alignment.isNucleotide ();
38045 var selseqs;
38046 if (selection != null && selection.getSize () > 0) {
38047 var sel = selection.getSequences (null);
38048 this.selected =  new java.util.Vector ();
38049 selseqs = selection.getSequencesInOrder (alignment, selectedRegionOnly);
38050 } else {
38051 selseqs = alignment.getSequencesArray ();
38052 }var seqsets =  new java.util.ArrayList ();
38053 var grps =  new java.util.ArrayList ();
38054 var gg = alignment.getGroups ();
38055 grps.addAll (gg);
38056 var sgrps = null;
38057 var addedgps = null;
38058 if (grps != null) {
38059 if (selection != null && selectedRegionOnly) {
38060 var ssel = selection.getStartRes ();
38061 var esel = selection.getEndRes ();
38062 var isg =  new java.util.ArrayList ();
38063 for (var sg, $sg = grps.iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
38064 if (!(sg.getStartRes () > esel || sg.getEndRes () < ssel)) {
38065 if (sg.getStartRes () < ssel) {
38066 sg.setStartRes (ssel);
38067 }if (sg.getEndRes () > esel) {
38068 sg.setEndRes (esel);
38069 }sg.setStartRes (sg.getStartRes () - ssel + 1);
38070 sg.setEndRes (sg.getEndRes () - ssel + 1);
38071 isg.add (sg);
38072 }}
38073 grps = isg;
38074 }sgrps =  new Array (grps.size ());
38075 addedgps =  Clazz_newBooleanArray (grps.size (), false);
38076 for (var g = 0; g < sgrps.length; g++) {
38077 var sg = grps.get (g);
38078 sgrps[g] = Clazz_innerTypeInstance (jalview.datamodel.AlignmentView.ScGroup, this, null);
38079 sgrps[g].sg =  new jalview.datamodel.SequenceGroup (sg);
38080 addedgps[g] = false;
38081 seqsets.add (sg.getSequences ());
38082 }
38083 }var csi = 0;
38084 for (var i = 0; i < selseqs.length; i++) {
38085 if (selseqs[i] != null) {
38086 if (selection != null && selection.getSize () > 0 && !selectedRegionOnly) {
38087 this.sequences[csi].setGroupMembership (this.selected);
38088 this.selected.addElement (this.sequences[csi]);
38089 }if (seqsets != null) {
38090 for (var sg = 0; sg < sgrps.length; sg++) {
38091 if ((seqsets.get (sg)).contains (selseqs[i])) {
38092 this.sequences[csi].setGroupMembership (sgrps[sg]);
38093 sgrps[sg].sg.deleteSequence (selseqs[i], false);
38094 sgrps[sg].seqs.addElement (this.sequences[csi]);
38095 if (!addedgps[sg]) {
38096 if (this.scGroups == null) {
38097 this.scGroups =  new java.util.ArrayList ();
38098 }addedgps[sg] = true;
38099 this.scGroups.add (sgrps[sg]);
38100 }}}
38101 }csi++;
38102 }}
38103 for (var sg = 0; sg < sgrps.length; sg++) {
38104 var sqs = sgrps[sg].sg.getSequencesAsArray (null);
38105 for (var si = 0; si < sqs.length; si++) {
38106 sgrps[sg].sg.deleteSequence (sqs[si], false);
38107 }
38108 sgrps[sg] = null;
38109 }
38110 }, "jalview.datamodel.AlignmentI,jalview.datamodel.ColumnSelection,jalview.datamodel.SequenceGroup,~B,~B,~B");
38111 Clazz_makeConstructor (c$, 
38112 function (seqcigararray) {
38113 if (!seqcigararray.isSeqCigarArray ()) {
38114 throw  new Error (jalview.util.MessageManager.getString ("error.implementation_error_can_only_make_alignmnet_from_cigararray"));
38115 }this.contigs = seqcigararray.getDeletedRegions ();
38116 this.sequences = seqcigararray.getSeqCigarArray ();
38117 this.width = seqcigararray.getWidth ();
38118 }, "jalview.datamodel.CigarArray");
38119 Clazz_makeConstructor (c$, 
38120 function (sdata, firstcol) {
38121 this.construct (sdata);
38122 this.firstCol = firstcol;
38123 }, "jalview.datamodel.CigarArray,~N");
38124 Clazz_defineMethod (c$, "setSequences", 
38125 function (sequences) {
38126 this.sequences = sequences;
38127 }, "~A");
38128 Clazz_defineMethod (c$, "setContigs", 
38129 function (contigs) {
38130 this.contigs = contigs;
38131 }, "~A");
38132 Clazz_defineMethod (c$, "getSequences", 
38133 function () {
38134 return this.sequences;
38135 });
38136 Clazz_defineMethod (c$, "getContigs", 
38137 function () {
38138 return this.contigs;
38139 });
38140 Clazz_defineMethod (c$, "getAlignmentAndColumnSelection", 
38141 function (gapCharacter) {
38142 var colsel =  new jalview.datamodel.ColumnSelection ();
38143 return  Clazz_newArray (-1, [jalview.datamodel.SeqCigar.createAlignmentSequences (this.sequences, gapCharacter, colsel, this.contigs), colsel]);
38144 }, "~S");
38145 Clazz_defineMethod (c$, "getVisibleAlignment", 
38146 function (c) {
38147 var aln = this.getVisibleSeqs (c);
38148 var vcal =  new jalview.datamodel.Alignment (aln);
38149 this.addPrunedGroupsInOrder (vcal, -1, -1, true);
38150 return vcal;
38151 }, "~S");
38152 Clazz_defineMethod (c$, "addPrunedGroupsInOrder", 
38153  function (vcal, gstart, gend, viscontigs) {
38154 var r = false;
38155 if (gstart > -1 && gstart <= gend) {
38156 r = true;
38157 }var aln = vcal.getSequencesArray ();
38158 {
38159 {
38160 var nvg = (this.scGroups != null) ? this.scGroups.size () : 0;
38161 if (nvg > 0) {
38162 var nsg =  new Array (nvg);
38163 for (var g = 0; g < nvg; g++) {
38164 var sg = this.scGroups.get (g).sg;
38165 if (r) {
38166 if (sg.getStartRes () > gend || sg.getEndRes () < gstart) {
38167 nsg[g] = null;
38168 continue;
38169 }}nsg[g] =  new jalview.datamodel.SequenceGroup (sg);
38170 if (r && !viscontigs) {
38171 if (nsg[g].getStartRes () < gstart) {
38172 nsg[g].setStartRes (0);
38173 } else {
38174 nsg[g].setStartRes (nsg[g].getStartRes () - gstart);
38175 nsg[g].setEndRes (nsg[g].getEndRes () - gstart);
38176 }if (nsg[g].getEndRes () > (gend - gstart)) {
38177 nsg[g].setEndRes (gend - gstart);
38178 }}}
38179 if (viscontigs) {
38180 if (this.contigs != null) {
38181 var p = 0;
38182 var prune =  new jalview.util.ShiftList ();
38183 if (r) {
38184 prune.addShift (gstart, -gstart);
38185 }for (var h = 0; h < this.contigs.length; h += 3) {
38186 {
38187 prune.addShift (p + this.contigs[h + 1], this.contigs[h + 2] - this.contigs[h + 1]);
38188 }p = this.contigs[h + 1] + this.contigs[h + 2];
38189 }
38190 for (var g = 0; g < nsg.length; g++) {
38191 if (nsg[g] != null) {
38192 var s = nsg[g].getStartRes ();
38193 var t = nsg[g].getEndRes ();
38194 var w = 1 + t - s;
38195 if (r) {
38196 if (s < gstart) {
38197 s = gstart;
38198 }if (t > gend) {
38199 t = gend;
38200 }}s = prune.shift (s);
38201 t = prune.shift (t);
38202 nsg[g].setStartRes (s);
38203 nsg[g].setEndRes (t);
38204 }}
38205 }}for (var nsq = 0; nsq < aln.length; nsq++) {
38206 for (var g = 0; g < nvg; g++) {
38207 if (nsg[g] != null && this.sequences[nsq].isMemberOf (this.scGroups.get (g))) {
38208 nsg[g].addSequence (aln[nsq], false);
38209 }}
38210 }
38211 for (var g = 0; g < nvg; g++) {
38212 if (nsg[g] != null && nsg[g].getSize () > 0) {
38213 vcal.addGroup (nsg[g]);
38214 }nsg[g] = null;
38215 }
38216 }}}}, "jalview.datamodel.AlignmentI,~N,~N,~B");
38217 Clazz_defineMethod (c$, "getVisibleSeqs", 
38218  function (c) {
38219 var aln =  new Array (this.sequences.length);
38220 for (var i = 0, j = this.sequences.length; i < j; i++) {
38221 aln[i] = this.sequences[i].getSeq ('-');
38222 }
38223 var seqs = this.getSequenceStrings ('-');
38224 for (var i = 0, j = aln.length; i < j; i++) {
38225 aln[i].setSequence (seqs[i]);
38226 }
38227 return aln;
38228 }, "~S");
38229 Clazz_defineMethod (c$, "getVisibleContigAlignments", 
38230 function (c) {
38231 var nvc = 0;
38232 var vcontigs = this.getVisibleContigs ();
38233 var contigviews = this.getVisibleContigs (c);
38234 var vcals =  new Array (contigviews.length);
38235 for (nvc = 0; nvc < contigviews.length; nvc++) {
38236 vcals[nvc] =  new jalview.datamodel.Alignment (contigviews[nvc]);
38237 if (this.scGroups != null && this.scGroups.size () > 0) {
38238 this.addPrunedGroupsInOrder (vcals[nvc], vcontigs[nvc * 2], vcontigs[nvc * 2 + 1], true);
38239 }}
38240 return vcals;
38241 }, "~S");
38242 Clazz_defineMethod (c$, "getSequenceStrings", 
38243 function (c) {
38244 var seqs =  new Array (this.sequences.length);
38245 for (var n = 0; n < this.sequences.length; n++) {
38246 var fullseq = this.sequences[n].getSequenceString (c);
38247 if (this.contigs != null) {
38248 seqs[n] = "";
38249 var p = 0;
38250 for (var h = 0; h < this.contigs.length; h += 3) {
38251 seqs[n] += fullseq.substring (p, this.contigs[h + 1]);
38252 p = this.contigs[h + 1] + this.contigs[h + 2];
38253 }
38254 seqs[n] += fullseq.substring (p);
38255 } else {
38256 seqs[n] = fullseq;
38257 }}
38258 return seqs;
38259 }, "~S");
38260 Clazz_defineMethod (c$, "getWidth", 
38261 function () {
38262 return this.width;
38263 });
38264 Clazz_defineMethod (c$, "setWidth", 
38265 function (width) {
38266 this.width = width;
38267 }, "~N");
38268 Clazz_defineMethod (c$, "getVisibleContigs", 
38269 function (gapCharacter) {
38270 var smsa;
38271 var njobs = 1;
38272 if (this.sequences == null || this.width <= 0) {
38273 return null;
38274 }if (this.contigs != null && this.contigs.length > 0) {
38275 var start = 0;
38276 njobs = 0;
38277 var fwidth = this.width;
38278 for (var contig = 0; contig < this.contigs.length; contig += 3) {
38279 if ((this.contigs[contig + 1] - start) > 0) {
38280 njobs++;
38281 }fwidth += this.contigs[contig + 2];
38282 start = this.contigs[contig + 1] + this.contigs[contig + 2];
38283 }
38284 if (start < fwidth) {
38285 njobs++;
38286 }smsa =  new Array (njobs);
38287 start = 0;
38288 var j = 0;
38289 for (var contig = 0; contig < this.contigs.length; contig += 3) {
38290 if (this.contigs[contig + 1] - start > 0) {
38291 var mseq =  new Array (this.sequences.length);
38292 for (var s = 0; s < mseq.length; s++) {
38293 mseq[s] = this.sequences[s].getSeq (gapCharacter).getSubSequence (start, this.contigs[contig + 1]);
38294 }
38295 smsa[j] = mseq;
38296 j++;
38297 }start = this.contigs[contig + 1] + this.contigs[contig + 2];
38298 }
38299 if (start < fwidth) {
38300 var mseq =  new Array (this.sequences.length);
38301 for (var s = 0; s < mseq.length; s++) {
38302 mseq[s] = this.sequences[s].getSeq (gapCharacter).getSubSequence (start, fwidth + 1);
38303 }
38304 smsa[j] = mseq;
38305 j++;
38306 }} else {
38307 smsa =  new Array (1);
38308 smsa[0] =  new Array (this.sequences.length);
38309 for (var s = 0; s < this.sequences.length; s++) {
38310 smsa[0][s] = this.sequences[s].getSeq (gapCharacter);
38311 }
38312 }return smsa;
38313 }, "~S");
38314 Clazz_defineMethod (c$, "getUpdatedView", 
38315 function (nvismsa, orders, gapCharacter) {
38316 if (this.sequences == null || this.width <= 0) {
38317 throw  new Error (jalview.util.MessageManager.getString ("error.empty_view_cannot_be_updated"));
38318 }if (nvismsa == null) {
38319 throw  new Error ("nvismsa==null. use getAlignmentAndColumnSelection() instead.");
38320 }if (this.contigs != null && this.contigs.length > 0) {
38321 var alignment =  new Array (this.sequences.length);
38322 var columnselection =  new jalview.datamodel.ColumnSelection ();
38323 if (this.contigs != null && this.contigs.length > 0) {
38324 var start = 0;
38325 var nwidth = 0;
38326 var owidth = this.width;
38327 var j = 0;
38328 for (var contig = 0; contig < this.contigs.length; contig += 3) {
38329 owidth += this.contigs[contig + 2];
38330 if (this.contigs[contig + 1] - start > 0) {
38331 var swidth = 0;
38332 if (nvismsa[j] != null) {
38333 var mseq = nvismsa[j];
38334 var order = (orders == null) ? null : orders[j];
38335 j++;
38336 if (mseq.length != this.sequences.length) {
38337 throw  new Error (jalview.util.MessageManager.formatMessage ("error.mismatch_between_number_of_sequences_in_block",  Clazz_newArray (-1, [Integer.$valueOf (j).toString (), Integer.$valueOf (mseq.length).toString (), Integer.$valueOf (this.sequences.length).toString ()])));
38338 }swidth = mseq[0].getLength ();
38339 for (var s = 0; s < mseq.length; s++) {
38340 if (alignment[s] == null) {
38341 alignment[s] = mseq[s];
38342 } else {
38343 alignment[s].setSequence (alignment[s].getSequenceAsString () + mseq[s].getSequenceAsString ());
38344 if (mseq[s].getStart () <= mseq[s].getEnd ()) {
38345 alignment[s].setEnd (mseq[s].getEnd ());
38346 }if (order != null) {
38347 order.updateSequence (mseq[s], alignment[s]);
38348 }}}
38349 } else {
38350 if (true) {
38351 for (var s = 0; s < this.sequences.length; s++) {
38352 var oseq = this.sequences[s].getSeq (gapCharacter).getSubSequence (start, this.contigs[contig + 1]);
38353 if (swidth < oseq.getLength ()) {
38354 swidth = oseq.getLength ();
38355 }if (alignment[s] == null) {
38356 alignment[s] = oseq;
38357 } else {
38358 alignment[s].setSequence (alignment[s].getSequenceAsString () + oseq.getSequenceAsString ());
38359 if (oseq.getEnd () >= oseq.getStart ()) {
38360 alignment[s].setEnd (oseq.getEnd ());
38361 }}}
38362 }j++;
38363 }nwidth += swidth;
38364 }start = this.contigs[contig + 1] + this.contigs[contig + 2];
38365 for (var s = 0; s < this.sequences.length; s++) {
38366 var hseq = this.sequences[s].getSeq (gapCharacter).getSubSequence (this.contigs[contig + 1], start);
38367 if (alignment[s] == null) {
38368 alignment[s] = hseq;
38369 } else {
38370 alignment[s].setSequence (alignment[s].getSequenceAsString () + hseq.getSequenceAsString ());
38371 if (hseq.getEnd () >= hseq.getStart ()) {
38372 alignment[s].setEnd (hseq.getEnd ());
38373 }}}
38374 columnselection.hideColumns (nwidth, nwidth + this.contigs[contig + 2] - 1);
38375 nwidth += this.contigs[contig + 2];
38376 }
38377 if (j < nvismsa.length) {
38378 var swidth = 0;
38379 if (nvismsa[j] != null) {
38380 var mseq = nvismsa[j];
38381 var order = (orders != null) ? orders[j] : null;
38382 swidth = mseq[0].getLength ();
38383 for (var s = 0; s < mseq.length; s++) {
38384 if (alignment[s] == null) {
38385 alignment[s] = mseq[s];
38386 } else {
38387 alignment[s].setSequence (alignment[s].getSequenceAsString () + mseq[s].getSequenceAsString ());
38388 if (mseq[s].getEnd () >= mseq[s].getStart ()) {
38389 alignment[s].setEnd (mseq[s].getEnd ());
38390 }if (order != null) {
38391 order.updateSequence (mseq[s], alignment[s]);
38392 }}}
38393 } else {
38394 if (start < owidth) {
38395 if (true) {
38396 for (var s = 0; s < this.sequences.length; s++) {
38397 var oseq = this.sequences[s].getSeq (gapCharacter).getSubSequence (start, owidth + 1);
38398 if (swidth < oseq.getLength ()) {
38399 swidth = oseq.getLength ();
38400 }if (alignment[s] == null) {
38401 alignment[s] = oseq;
38402 } else {
38403 alignment[s].setSequence (alignment[s].getSequenceAsString () + oseq.getSequenceAsString ());
38404 if (oseq.getEnd () >= oseq.getStart ()) {
38405 alignment[s].setEnd (oseq.getEnd ());
38406 }}}
38407 nwidth += swidth;
38408 } else {
38409 throw  new Error (jalview.util.MessageManager.getString ("error.padding_not_yet_implemented"));
38410 }}}}}return  Clazz_newArray (-1, [alignment, columnselection]);
38411 } else {
38412 if (nvismsa.length != 1) {
38413 throw  new Error (jalview.util.MessageManager.formatMessage ("error.mismatch_between_visible_blocks_to_update_and_number_of_contigs_in_view",  Clazz_newArray (-1, [Integer.$valueOf (nvismsa.length).toString ()])));
38414 }if (nvismsa[0] != null) {
38415 return  Clazz_newArray (-1, [nvismsa[0],  new jalview.datamodel.ColumnSelection ()]);
38416 } else {
38417 return this.getAlignmentAndColumnSelection (gapCharacter);
38418 }}}, "~A,~A,~S");
38419 Clazz_defineMethod (c$, "getVisibleContigs", 
38420 function () {
38421 if (this.contigs != null && this.contigs.length > 0) {
38422 var start = 0;
38423 var nvis = 0;
38424 var fwidth = this.width;
38425 for (var contig = 0; contig < this.contigs.length; contig += 3) {
38426 if ((this.contigs[contig + 1] - start) > 0) {
38427 nvis++;
38428 }fwidth += this.contigs[contig + 2];
38429 start = this.contigs[contig + 1] + this.contigs[contig + 2];
38430 }
38431 if (start < fwidth) {
38432 nvis++;
38433 }var viscontigs =  Clazz_newIntArray (nvis * 2, 0);
38434 nvis = 0;
38435 start = 0;
38436 for (var contig = 0; contig < this.contigs.length; contig += 3) {
38437 if ((this.contigs[contig + 1] - start) > 0) {
38438 viscontigs[nvis] = start;
38439 viscontigs[nvis + 1] = this.contigs[contig + 1] - 1;
38440 nvis += 2;
38441 }start = this.contigs[contig + 1] + this.contigs[contig + 2];
38442 }
38443 if (start < fwidth) {
38444 viscontigs[nvis] = start;
38445 viscontigs[nvis + 1] = fwidth;
38446 nvis += 2;
38447 }return viscontigs;
38448 } else {
38449 return  Clazz_newIntArray (-1, [0, this.width]);
38450 }});
38451 Clazz_defineMethod (c$, "getAlignmentOrigin", 
38452 function () {
38453 return this.firstCol;
38454 });
38455 Clazz_defineMethod (c$, "getVisibleContigMapFor", 
38456 function (gapMap) {
38457 var delMap = null;
38458 var viscontigs = this.getVisibleContigs ();
38459 var spos = 0;
38460 var i = 0;
38461 if (viscontigs != null) {
38462 delMap =  Clazz_newIntArray (gapMap.length, 0);
38463 for (var contig = 0; contig < viscontigs.length; contig += 2) {
38464 while (spos < gapMap.length && gapMap[spos] < viscontigs[contig]) {
38465 spos++;
38466 }
38467 while (spos < gapMap.length && gapMap[spos] <= viscontigs[contig + 1]) {
38468 delMap[i++] = spos++;
38469 }
38470 }
38471 var tmap =  Clazz_newIntArray (i, 0);
38472 System.arraycopy (delMap, 0, tmap, 0, i);
38473 delMap = tmap;
38474 }return delMap;
38475 }, "~A");
38476 Clazz_defineMethod (c$, "getEditedSequences", 
38477 function (gc, $delete) {
38478 var msf = this.getSequences ();
38479 var aln =  new Array (msf.length);
38480 for (var i = 0, j = msf.length; i < j; i++) {
38481 aln[i] = msf[i].getSeq (gc);
38482 }
38483 if ($delete) {
38484 var sqs = this.getSequenceStrings (gc);
38485 for (var i = 0; i < sqs.length; i++) {
38486 aln[i].setSequence (sqs[i]);
38487 sqs[i] = null;
38488 }
38489 }return aln;
38490 }, "~S,~B");
38491 c$.summariseAlignmentView = Clazz_defineMethod (c$, "summariseAlignmentView", 
38492 function (view, os) {
38493 os.print ("View has " + view.sequences.length + " of which ");
38494 if (view.selected == null) {
38495 os.print ("None");
38496 } else {
38497 os.print (" " + view.selected.size ());
38498 }os.println (" are selected.");
38499 os.print ("View is " + view.getWidth () + " columns wide");
38500 var viswid = 0;
38501 var contigs = view.getContigs ();
38502 if (contigs != null) {
38503 viswid = view.width;
38504 for (var i = 0; i < contigs.length; i += 3) {
38505 viswid += contigs[i + 2];
38506 }
38507 os.println ("with " + viswid + " visible columns spread over " + Clazz_doubleToInt (contigs.length / 3) + " regions.");
38508 } else {
38509 viswid = view.width;
38510 os.println (".");
38511 }if (view.scGroups != null) {
38512 os.println ("There are " + view.scGroups.size () + " groups defined on the view.");
38513 for (var g = 0; g < view.scGroups.size (); g++) {
38514 var sgr = view.scGroups.get (g);
38515 os.println ("Group " + g + ": Name = " + sgr.sg.getName () + " Contains " + sgr.seqs.size () + " Seqs.");
38516 os.println ("This group runs from " + sgr.sg.getStartRes () + " to " + sgr.sg.getEndRes ());
38517 for (var s = 0; s < sgr.seqs.size (); s++) {
38518 if (!(sgr.seqs.elementAt (s)).isMemberOf (sgr)) {
38519 os.println ("** WARNING: sequence " + (sgr.seqs.elementAt (s)).toString () + " is not marked as member of group.");
38520 }}
38521 }
38522 var visal = view.getVisibleAlignment ('-');
38523 if (visal != null) {
38524 os.println ("Vis. alignment is " + visal.getWidth () + " wide and has " + visal.getHeight () + " seqs.");
38525 if (visal.getGroups () != null && visal.getGroups ().size () > 0) {
38526 var i = 1;
38527 for (var sg, $sg = visal.getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
38528 os.println ("Group " + (i++) + " begins at column " + sg.getStartRes () + " and ends at " + sg.getEndRes ());
38529 }
38530 }}}}, "jalview.datamodel.AlignmentView,java.io.PrintStream");
38531 c$.testSelectionViews = Clazz_defineMethod (c$, "testSelectionViews", 
38532 function (alignment, csel, selection) {
38533 System.out.println ("Testing standard view creation:\n");
38534 var view = null;
38535 try {
38536 System.out.println ("View with no hidden columns, no limit to selection, no groups to be collected:");
38537 view =  new jalview.datamodel.AlignmentView (alignment, csel, selection, false, false, false);
38538 jalview.datamodel.AlignmentView.summariseAlignmentView (view, System.out);
38539 } catch (e) {
38540 if (Clazz_exceptionOf (e, Exception)) {
38541 e.printStackTrace ();
38542 System.err.println ("Failed to generate alignment with selection but no groups marked.");
38543 } else {
38544 throw e;
38545 }
38546 }
38547 try {
38548 System.out.println ("View with no hidden columns, no limit to selection, and all groups to be collected:");
38549 view =  new jalview.datamodel.AlignmentView (alignment, csel, selection, false, false, true);
38550 jalview.datamodel.AlignmentView.summariseAlignmentView (view, System.out);
38551 } catch (e) {
38552 if (Clazz_exceptionOf (e, Exception)) {
38553 e.printStackTrace ();
38554 System.err.println ("Failed to generate alignment with selection marked but no groups marked.");
38555 } else {
38556 throw e;
38557 }
38558 }
38559 try {
38560 System.out.println ("View with no hidden columns, limited to selection and no groups to be collected:");
38561 view =  new jalview.datamodel.AlignmentView (alignment, csel, selection, false, true, false);
38562 jalview.datamodel.AlignmentView.summariseAlignmentView (view, System.out);
38563 } catch (e) {
38564 if (Clazz_exceptionOf (e, Exception)) {
38565 e.printStackTrace ();
38566 System.err.println ("Failed to generate alignment with selection restricted but no groups marked.");
38567 } else {
38568 throw e;
38569 }
38570 }
38571 try {
38572 System.out.println ("View with no hidden columns, limited to selection, and all groups to be collected:");
38573 view =  new jalview.datamodel.AlignmentView (alignment, csel, selection, false, true, true);
38574 jalview.datamodel.AlignmentView.summariseAlignmentView (view, System.out);
38575 } catch (e) {
38576 if (Clazz_exceptionOf (e, Exception)) {
38577 e.printStackTrace ();
38578 System.err.println ("Failed to generate alignment with selection restricted and groups marked.");
38579 } else {
38580 throw e;
38581 }
38582 }
38583 try {
38584 System.out.println ("View *with* hidden columns, no limit to selection, no groups to be collected:");
38585 view =  new jalview.datamodel.AlignmentView (alignment, csel, selection, true, false, false);
38586 jalview.datamodel.AlignmentView.summariseAlignmentView (view, System.out);
38587 } catch (e) {
38588 if (Clazz_exceptionOf (e, Exception)) {
38589 e.printStackTrace ();
38590 System.err.println ("Failed to generate alignment with selection but no groups marked.");
38591 } else {
38592 throw e;
38593 }
38594 }
38595 try {
38596 System.out.println ("View *with* hidden columns, no limit to selection, and all groups to be collected:");
38597 view =  new jalview.datamodel.AlignmentView (alignment, csel, selection, true, false, true);
38598 jalview.datamodel.AlignmentView.summariseAlignmentView (view, System.out);
38599 } catch (e) {
38600 if (Clazz_exceptionOf (e, Exception)) {
38601 e.printStackTrace ();
38602 System.err.println ("Failed to generate alignment with selection marked but no groups marked.");
38603 } else {
38604 throw e;
38605 }
38606 }
38607 try {
38608 System.out.println ("View *with* hidden columns, limited to selection and no groups to be collected:");
38609 view =  new jalview.datamodel.AlignmentView (alignment, csel, selection, true, true, false);
38610 jalview.datamodel.AlignmentView.summariseAlignmentView (view, System.out);
38611 } catch (e) {
38612 if (Clazz_exceptionOf (e, Exception)) {
38613 e.printStackTrace ();
38614 System.err.println ("Failed to generate alignment with selection restricted but no groups marked.");
38615 } else {
38616 throw e;
38617 }
38618 }
38619 try {
38620 System.out.println ("View *with* hidden columns, limited to selection, and all groups to be collected:");
38621 view =  new jalview.datamodel.AlignmentView (alignment, csel, selection, true, true, true);
38622 jalview.datamodel.AlignmentView.summariseAlignmentView (view, System.out);
38623 } catch (e) {
38624 if (Clazz_exceptionOf (e, Exception)) {
38625 e.printStackTrace ();
38626 System.err.println ("Failed to generate alignment with selection restricted and groups marked.");
38627 } else {
38628 throw e;
38629 }
38630 }
38631 }, "jalview.datamodel.AlignmentI,jalview.datamodel.ColumnSelection,jalview.datamodel.SequenceGroup");
38632 c$.$AlignmentView$ScGroup$ = function () {
38633 Clazz_pu$h(self.c$);
38634 c$ = Clazz_decorateAsClass (function () {
38635 Clazz_prepareCallback (this, arguments);
38636 this.seqs = null;
38637 this.sg = null;
38638 Clazz_instantialize (this, arguments);
38639 }, jalview.datamodel.AlignmentView, "ScGroup");
38640 Clazz_makeConstructor (c$, 
38641 function () {
38642 this.seqs =  new java.util.Vector ();
38643 });
38644 c$ = Clazz_p0p ();
38645 };
38646 });
38647 Clazz_declarePackage ("jalview.schemes");
38648 Clazz_load (["jalview.schemes.ResidueColourScheme"], "jalview.schemes.Blosum62ColourScheme", ["jalview.schemes.ResidueProperties", "jalview.util.Comparison", "java.awt.Color"], function () {
38649 c$ = Clazz_declareType (jalview.schemes, "Blosum62ColourScheme", jalview.schemes.ResidueColourScheme);
38650 Clazz_overrideMethod (c$, "findColourSeq", 
38651 function (res, j, seq) {
38652 if ('a' <= res && res <= 'z') {
38653 res = String.fromCharCode (res.charCodeAt (0) - (32));
38654 }if (this.consensus == null || j >= this.consensus.length || this.consensus[j] == null || (this.threshold != 0 && !this.aboveThreshold (res, j))) {
38655 return java.awt.Color.white;
38656 }var currentColour;
38657 if (!jalview.util.Comparison.isGap (res)) {
38658 var max = this.consensus[j].get ("R");
38659 if (max.indexOf (res) > -1) {
38660 currentColour =  new java.awt.Color (154, 154, 255);
38661 } else {
38662 var c = 0;
38663 var max_aa = 0;
38664 var n = max.length;
38665 do {
38666 c += jalview.schemes.ResidueProperties.getBLOSUM62 (max.charAt (max_aa), res);
38667 } while (++max_aa < n);
38668 if (c > 0) {
38669 currentColour =  new java.awt.Color (204, 204, 255);
38670 } else {
38671 currentColour = java.awt.Color.white;
38672 }}if (this.conservationColouring) {
38673 currentColour = this.applyConservation (currentColour, j);
38674 }} else {
38675 return java.awt.Color.white;
38676 }return currentColour;
38677 }, "~S,~N,jalview.datamodel.SequenceI");
38678 Clazz_defineMethod (c$, "applyTo", 
38679 function (sg, hiddenRepSequences) {
38680 var newcs = Clazz_superCall (this, jalview.schemes.Blosum62ColourScheme, "applyTo", [sg, hiddenRepSequences]);
38681 return newcs;
38682 }, "jalview.datamodel.AnnotatedCollectionI,java.util.Map");
38683 });
38684 Clazz_declarePackage ("jalview.schemes");
38685 Clazz_load (["jalview.schemes.ColourSchemeI"], "jalview.schemes.ResidueColourScheme", ["jalview.util.Comparison", "$.MessageManager", "java.awt.Color", "java.lang.Error"], function () {
38686 c$ = Clazz_decorateAsClass (function () {
38687 this.symbolIndex = null;
38688 this.conservationColouring = false;
38689 this.colors = null;
38690 this.threshold = 0;
38691 this.ignoreGaps = "G";
38692 this.consensus = null;
38693 this.conservation = null;
38694 this.conservationLength = 0;
38695 this.inc = 30;
38696 Clazz_instantialize (this, arguments);
38697 }, jalview.schemes, "ResidueColourScheme", null, jalview.schemes.ColourSchemeI);
38698 Clazz_makeConstructor (c$, 
38699 function (aaOrnaIndex, colours, threshold) {
38700 this.symbolIndex = aaOrnaIndex;
38701 this.colors = colours;
38702 this.threshold = threshold;
38703 }, "~A,~A,~N");
38704 Clazz_makeConstructor (c$, 
38705 function (aaOrNaIndex) {
38706 this.symbolIndex = aaOrNaIndex;
38707 }, "~A");
38708 Clazz_makeConstructor (c$, 
38709 function () {
38710 this.symbolIndex = null;
38711 });
38712 Clazz_overrideMethod (c$, "findColour", 
38713 function (c) {
38714 return this.colors == null ? java.awt.Color.white : this.colors[this.symbolIndex[c.charCodeAt (0)]];
38715 }, "~S");
38716 Clazz_overrideMethod (c$, "findColourSeq", 
38717 function (c, j, seq) {
38718 var currentColour;
38719 if (this.colors != null && this.symbolIndex != null && (this.threshold == 0) || this.aboveThreshold (c, j)) {
38720 currentColour = this.colors[this.symbolIndex[c.charCodeAt (0)]];
38721 } else {
38722 currentColour = java.awt.Color.white;
38723 }if (this.conservationColouring) {
38724 currentColour = this.applyConservation (currentColour, j);
38725 }return currentColour;
38726 }, "~S,~N,jalview.datamodel.SequenceI");
38727 Clazz_overrideMethod (c$, "getThreshold", 
38728 function () {
38729 return this.threshold;
38730 });
38731 Clazz_overrideMethod (c$, "setThreshold", 
38732 function (ct, ignoreGaps) {
38733 this.threshold = ct;
38734 if (ignoreGaps) {
38735 this.ignoreGaps = "N";
38736 } else {
38737 this.ignoreGaps = "G";
38738 }}, "~N,~B");
38739 Clazz_defineMethod (c$, "aboveThreshold", 
38740 function (c, j) {
38741 if ('a' <= c && c <= 'z') {
38742 c = String.fromCharCode (c.charCodeAt (0) - (32));
38743 }if (this.consensus == null || this.consensus.length < j || this.consensus[j] == null) {
38744 return false;
38745 }if (((this.consensus[j].get ("C")).intValue () != -1) && this.consensus[j].contains (String.valueOf (c))) {
38746 if ((this.consensus[j].get (this.ignoreGaps)).floatValue () >= this.threshold) {
38747 return true;
38748 }}return false;
38749 }, "~S,~N");
38750 Clazz_overrideMethod (c$, "conservationApplied", 
38751 function () {
38752 return this.conservationColouring;
38753 });
38754 Clazz_overrideMethod (c$, "setConservationApplied", 
38755 function (conservationApplied) {
38756 this.conservationColouring = conservationApplied;
38757 }, "~B");
38758 Clazz_overrideMethod (c$, "setConservationInc", 
38759 function (i) {
38760 this.inc = i;
38761 }, "~N");
38762 Clazz_overrideMethod (c$, "getConservationInc", 
38763 function () {
38764 return this.inc;
38765 });
38766 Clazz_overrideMethod (c$, "setConsensus", 
38767 function (consensus) {
38768 if (consensus == null) {
38769 return;
38770 }this.consensus = consensus;
38771 }, "~A");
38772 Clazz_overrideMethod (c$, "setConservation", 
38773 function (cons) {
38774 if (cons == null) {
38775 this.conservationColouring = false;
38776 this.conservation = null;
38777 } else {
38778 this.conservationColouring = true;
38779 var i;
38780 var iSize = cons.getConsSequence ().getLength ();
38781 this.conservation =  Clazz_newCharArray (iSize, '\0');
38782 for (i = 0; i < iSize; i++) {
38783 this.conservation[i] = cons.getConsSequence ().getCharAt (i);
38784 }
38785 this.conservationLength = this.conservation.length;
38786 }}, "jalview.analysis.Conservation");
38787 Clazz_defineMethod (c$, "applyConservation", 
38788 function (currentColour, i) {
38789 if ((this.conservationLength > i) && (this.conservation[i] != '*') && (this.conservation[i] != '+')) {
38790 if (jalview.util.Comparison.isGap (this.conservation[i])) {
38791 currentColour = java.awt.Color.white;
38792 } else {
38793 var t = 11 - ((this.conservation[i]).charCodeAt (0) - 48);
38794 if (t == 0) {
38795 return java.awt.Color.white;
38796 }var red = currentColour.getRed ();
38797 var green = currentColour.getGreen ();
38798 var blue = currentColour.getBlue ();
38799 var dr = 255 - red;
38800 var dg = 255 - green;
38801 var db = 255 - blue;
38802 dr *= t / 10;
38803 dg *= t / 10;
38804 db *= t / 10;
38805 red += (this.inc / 20) * dr;
38806 green += (this.inc / 20) * dg;
38807 blue += (this.inc / 20) * db;
38808 if (red > 255 || green > 255 || blue > 255) {
38809 currentColour = java.awt.Color.white;
38810 } else {
38811 currentColour =  new java.awt.Color (red, green, blue);
38812 }}}return currentColour;
38813 }, "java.awt.Color,~N");
38814 Clazz_overrideMethod (c$, "alignmentChanged", 
38815 function (alignment, hiddenReps) {
38816 }, "jalview.datamodel.AnnotatedCollectionI,java.util.Map");
38817 Clazz_overrideMethod (c$, "applyTo", 
38818 function (sg, hiddenRepSequences) {
38819 try {
38820 return this.getClass ().newInstance ();
38821 } catch (q) {
38822 if (Clazz_exceptionOf (q, Exception)) {
38823 throw  new Error (jalview.util.MessageManager.formatMessage ("error.implementation_error_cannot_duplicate_colour_scheme",  Clazz_newArray (-1, [this.getClass ().getName ()])), q);
38824 } else {
38825 throw q;
38826 }
38827 }
38828 }, "jalview.datamodel.AnnotatedCollectionI,java.util.Map");
38829 });
38830 Clazz_declarePackage ("jalview.schemes");
38831 Clazz_declareInterface (jalview.schemes, "ColourSchemeI");
38832 Clazz_declarePackage ("jalview.schemes");
38833 Clazz_load (["jalview.schemes.ResidueColourScheme"], "jalview.schemes.PIDColourScheme", ["jalview.schemes.ResidueProperties", "jalview.util.Comparison", "java.awt.Color"], function () {
38834 c$ = Clazz_decorateAsClass (function () {
38835 this.pidColours = null;
38836 this.thresholds = null;
38837 this.group = null;
38838 Clazz_instantialize (this, arguments);
38839 }, jalview.schemes, "PIDColourScheme", jalview.schemes.ResidueColourScheme);
38840 Clazz_makeConstructor (c$, 
38841 function () {
38842 Clazz_superConstructor (this, jalview.schemes.PIDColourScheme, []);
38843 this.pidColours = jalview.schemes.ResidueProperties.pidColours;
38844 this.thresholds = jalview.schemes.ResidueProperties.pidThresholds;
38845 });
38846 Clazz_overrideMethod (c$, "findColourSeq", 
38847 function (c, j, seq) {
38848 if ('a' <= c && c <= 'z') {
38849 c = String.fromCharCode (c.charCodeAt (0) - (32));
38850 }if (this.consensus == null || j >= this.consensus.length || this.consensus[j] == null) {
38851 return java.awt.Color.white;
38852 }if ((this.threshold != 0) && !this.aboveThreshold (c, j)) {
38853 return java.awt.Color.white;
38854 }var currentColour = java.awt.Color.white;
38855 var sc = 0;
38856 if (this.consensus.length <= j) {
38857 return java.awt.Color.white;
38858 }if ((Integer.parseInt (this.consensus[j].get ("C").toString ()) != -1) && this.consensus[j].contains (String.valueOf (c))) {
38859 sc = (this.consensus[j].get (this.ignoreGaps)).floatValue ();
38860 if (!jalview.util.Comparison.isGap (c)) {
38861 for (var i = 0; i < this.thresholds.length; i++) {
38862 if (sc > this.thresholds[i]) {
38863 currentColour = this.pidColours[i];
38864 break;
38865 }}
38866 }}if (this.conservationColouring) {
38867 currentColour = this.applyConservation (currentColour, j);
38868 }return currentColour;
38869 }, "~S,~N,jalview.datamodel.SequenceI");
38870 });
38871 Clazz_declarePackage ("jalview.workers");
38872 Clazz_load (["jalview.workers.ConsensusThread"], "jalview.workers.ComplementConsensusThread", ["jalview.analysis.AAFrequency"], function () {
38873 c$ = Clazz_decorateAsClass (function () {
38874 this.mappings = null;
38875 Clazz_instantialize (this, arguments);
38876 }, jalview.workers, "ComplementConsensusThread", jalview.workers.ConsensusThread);
38877 Clazz_overrideMethod (c$, "getNewWorker", 
38878 function () {
38879 return  new jalview.workers.ComplementConsensusThread (this.alignViewport, this.ap);
38880 });
38881 Clazz_overrideMethod (c$, "getConsensusAnnotation", 
38882 function () {
38883 return this.alignViewport.getComplementConsensusAnnotation ();
38884 });
38885 Clazz_overrideMethod (c$, "getViewportConsensus", 
38886 function () {
38887 return this.alignViewport.getComplementConsensusHash ();
38888 });
38889 Clazz_defineMethod (c$, "initializeCalc", 
38890 function () {
38891 this.mappings = this.alignment.getCodonFrames ();
38892 return (this.mappings != null && !this.mappings.isEmpty () && Clazz_superCall (this, jalview.workers.ComplementConsensusThread, "initializeCalc", []));
38893 });
38894 Clazz_overrideMethod (c$, "computeConsensus", 
38895 function () {
38896 for (var i = 0; i < 3; i++) {
38897 try {
38898 jalview.analysis.AAFrequency.calculateCdna (this.alignment, this.mappings, this.hconsensus, this.iFirst, this.iLast);
38899 break;
38900 } catch (e) {
38901 if (Clazz_exceptionOf (e, java.util.ConcurrentModificationException)) {
38902 } else {
38903 throw e;
38904 }
38905 }
38906 }
38907 });
38908 Clazz_overrideMethod (c$, "finalizeCalc", 
38909 function () {
38910 this.alignViewport.setComplementConsensusHash (this.hconsensus);
38911 });
38912 Clazz_overrideMethod (c$, "deriveConsensus", 
38913 function (consensusAnnotation, consensusData) {
38914 jalview.analysis.AAFrequency.completeCdnaConsensus (consensusAnnotation, consensusData, this.alignViewport.isShowSequenceLogo (), this.getSequences ().length);
38915 }, "jalview.datamodel.AlignmentAnnotation,~A");
38916 });
38917 Clazz_declarePackage ("jalview.workers");
38918 Clazz_load (["jalview.api.AlignCalcWorkerI", "jalview.workers.AlignCalcWorker"], "jalview.workers.ConsensusThread", ["jalview.analysis.AAFrequency"], function () {
38919 c$ = Clazz_decorateAsClass (function () {
38920 this.hconsensus = null;
38921 this.aseqs = null;
38922 Clazz_instantialize (this, arguments);
38923 }, jalview.workers, "ConsensusThread", jalview.workers.AlignCalcWorker, jalview.api.AlignCalcWorkerI);
38924 Clazz_overrideMethod (c$, "getNewWorker", 
38925 function () {
38926 return  new jalview.workers.ConsensusThread (this.alignViewport, this.ap);
38927 });
38928 Clazz_overrideMethod (c$, "run1", 
38929 function (state) {
38930 while (!Thread.interrupted ()) {
38931 if (this.alignViewport.isClosed ()) {
38932 this.abortAndDestroy ();
38933 return;
38934 }try {
38935 switch (state) {
38936 case 0:
38937 if (this.calcMan.isPending (this)) return;
38938 this.calcMan.notifyStart (this);
38939 var consensus = this.getConsensusAnnotation ();
38940 if (consensus == null || this.calcMan.isPending (this)) {
38941 this.calcMan.workerComplete (this);
38942 return;
38943 }state = 3;
38944 break;
38945 case 3:
38946 while (!this.calcMan.notifyWorking (this)) {
38947 if (this.ap != null) {
38948 this.ap.paintAlignment (false);
38949 }try {
38950 if (this.sleepAndReturn (200, state)) return;
38951 } catch (e) {
38952 if (Clazz_exceptionOf (e, InterruptedException)) {
38953 state = 2;
38954 break;
38955 } else {
38956 throw e;
38957 }
38958 }
38959 }
38960 if (this.alignViewport.isClosed ()) {
38961 this.abortAndDestroy ();
38962 state = 2;
38963 break;
38964 }this.alignment = this.alignViewport.getAlignment ();
38965 this.aWidth = -1;
38966 if (this.alignment == null || (this.aWidth = this.alignment.getWidth ()) < 0) {
38967 state = 2;
38968 }this.eraseConsensus (this.aWidth);
38969 state = (this.initializeCalc () ? 4 : 2);
38970 break;
38971 case 4:
38972 this.iFirst = this.iLast;
38973 this.iLast = Math.min (this.iLast + this.nPer, this.aWidth);
38974 if (this.iLast == this.iFirst) {
38975 state = 2;
38976 } else {
38977 this.computeConsensus ();
38978 if (this.sleepAndReturn (0, state)) return;
38979 }break;
38980 case 2:
38981 this.finalizeCalc ();
38982 this.updateAlignment ();
38983 this.notifyDone ();
38984 return;
38985 }
38986 } catch (e$$) {
38987 if (Clazz_exceptionOf (e$$, OutOfMemoryError)) {
38988 var error = e$$;
38989 {
38990 this.calcMan.workerCannotRun (this);
38991 this.ap.raiseOOMWarning ("calculating consensus", error);
38992 }
38993 } else {
38994 var e = e$$;
38995 {
38996 System.out.println ("Error in ConsensusThread: " + e);
38997 e.printStackTrace ();
38998 this.calcMan.workerComplete (this);
38999 }
39000 }
39001 }
39002 }
39003 }, "~N");
39004 Clazz_defineMethod (c$, "initializeCalc", 
39005 function () {
39006 this.iLast = 0;
39007 this.hconsensus =  new Array (this.aWidth);
39008 this.aseqs = this.getSequences ();
39009 return true;
39010 });
39011 Clazz_defineMethod (c$, "computeConsensus", 
39012 function () {
39013 this.started = System.currentTimeMillis ();
39014 jalview.analysis.AAFrequency.calculate (this.aseqs, this.iFirst, this.iLast, this.hconsensus, true);
39015 if (System.currentTimeMillis () - this.started < 500) this.nPer *= 2;
39016 });
39017 Clazz_defineMethod (c$, "finalizeCalc", 
39018 function () {
39019 this.alignViewport.setSequenceConsensusHash (this.hconsensus);
39020 });
39021 Clazz_defineMethod (c$, "updateAlignment", 
39022 function () {
39023 this.setColourSchemeConsensus (this.hconsensus);
39024 this.updateResultAnnotation (true);
39025 });
39026 Clazz_defineMethod (c$, "eraseConsensus", 
39027 function (aWidth) {
39028 var consensus = this.getConsensusAnnotation ();
39029 consensus.annotations =  new Array (aWidth);
39030 }, "~N");
39031 Clazz_defineMethod (c$, "getSequences", 
39032 function () {
39033 return this.alignViewport.getAlignment ().getSequencesArray ();
39034 });
39035 Clazz_defineMethod (c$, "setColourSchemeConsensus", 
39036 function (hconsensus) {
39037 var globalColourScheme = this.alignViewport.getGlobalColourScheme ();
39038 if (globalColourScheme != null) {
39039 globalColourScheme.setConsensus (hconsensus);
39040 }}, "~A");
39041 Clazz_defineMethod (c$, "getConsensusAnnotation", 
39042 function () {
39043 return this.alignViewport.getAlignmentConsensusAnnotation ();
39044 });
39045 Clazz_overrideMethod (c$, "updateAnnotation", 
39046 function () {
39047 this.updateResultAnnotation (false);
39048 });
39049 Clazz_defineMethod (c$, "updateResultAnnotation", 
39050 function (immediate) {
39051 var consensus = this.getConsensusAnnotation ();
39052 var hconsensus = this.getViewportConsensus ();
39053 if (immediate || !this.calcMan.isWorking (this) && consensus != null && hconsensus != null) {
39054 this.deriveConsensus (consensus, hconsensus);
39055 }}, "~B");
39056 Clazz_defineMethod (c$, "deriveConsensus", 
39057 function (consensusAnnotation, consensusData) {
39058 var nseq = this.getSequences ().length;
39059 jalview.analysis.AAFrequency.completeConsensus (consensusAnnotation, consensusData, 0, consensusData.length, this.alignViewport.isIgnoreGapsConsensus (), this.alignViewport.isShowSequenceLogo (), nseq);
39060 }, "jalview.datamodel.AlignmentAnnotation,~A");
39061 Clazz_defineMethod (c$, "getViewportConsensus", 
39062 function () {
39063 return this.alignViewport.getSequenceConsensusHash ();
39064 });
39065 });
39066 Clazz_declarePackage ("jalview.api");
39067 Clazz_declareInterface (jalview.api, "AlignCalcWorkerI", Runnable);
39068 Clazz_declarePackage ("jalview.workers");
39069 Clazz_load (["jalview.api.AlignCalcWorkerI", "swingjs.JSThread"], "jalview.workers.AlignCalcWorker", null, function () {
39070 c$ = Clazz_decorateAsClass (function () {
39071 this.iFirst = 0;
39072 this.iLast = 0;
39073 this.nPer = 2;
39074 this.started = 0;
39075 this.alignment = null;
39076 this.aWidth = 0;
39077 this.alignViewport = null;
39078 this.calcMan = null;
39079 this.ap = null;
39080 this.ourAnnots = null;
39081 Clazz_instantialize (this, arguments);
39082 }, jalview.workers, "AlignCalcWorker", swingjs.JSThread, jalview.api.AlignCalcWorkerI);
39083 Clazz_makeConstructor (c$, 
39084 function (alignViewport, alignPanel) {
39085 Clazz_superConstructor (this, jalview.workers.AlignCalcWorker, [null, "AlignCalcWorker"]);
39086 this.alignViewport = alignViewport;
39087 this.calcMan = alignViewport.getCalcManager ();
39088 this.ap = alignPanel;
39089 }, "jalview.api.AlignViewportI,jalview.api.AlignmentViewPanel");
39090 Clazz_defineMethod (c$, "abortAndDestroy", 
39091 function () {
39092 if (this.calcMan != null) {
39093 this.calcMan.workerComplete (this);
39094 }this.alignViewport = null;
39095 this.calcMan = null;
39096 this.ap = null;
39097 });
39098 Clazz_overrideMethod (c$, "involves", 
39099 function (i) {
39100 return this.ourAnnots != null && this.ourAnnots.contains (i);
39101 }, "jalview.datamodel.AlignmentAnnotation");
39102 Clazz_overrideMethod (c$, "removeOurAnnotation", 
39103 function () {
39104 if (this.ourAnnots != null && this.alignViewport != null) {
39105 var alignment = this.alignViewport.getAlignment ();
39106 {
39107 for (var aa, $aa = this.ourAnnots.iterator (); $aa.hasNext () && ((aa = $aa.next ()) || true);) {
39108 alignment.deleteAnnotation (aa, true);
39109 }
39110 }}});
39111 Clazz_defineMethod (c$, "notifyDone", 
39112 function () {
39113 if (this.ap != null) {
39114 this.ap.paintAlignment (true);
39115 }this.calcMan.workerComplete (this);
39116 });
39117 Clazz_defineStatics (c$,
39118 "LOOP_STANDBY", 3,
39119 "LOOP_CALCULATE", 4,
39120 "MS_MAX", 500);
39121 });
39122 Clazz_declarePackage ("jalview.workers");
39123 Clazz_load (["jalview.api.AlignCalcWorkerI", "jalview.workers.AlignCalcWorker"], "jalview.workers.ConservationThread", ["jalview.analysis.Conservation", "jalview.schemes.ResidueProperties", "java.util.ArrayList"], function () {
39124 c$ = Clazz_decorateAsClass (function () {
39125 this.ConsPercGaps = 25;
39126 this.cons = null;
39127 this.conservation = null;
39128 this.quality = null;
39129 Clazz_instantialize (this, arguments);
39130 }, jalview.workers, "ConservationThread", jalview.workers.AlignCalcWorker, jalview.api.AlignCalcWorkerI);
39131 Clazz_overrideMethod (c$, "getNewWorker", 
39132 function () {
39133 return  new jalview.workers.ConservationThread (this.alignViewport, this.ap);
39134 });
39135 Clazz_makeConstructor (c$, 
39136 function (alignViewport, alignPanel) {
39137 Clazz_superConstructor (this, jalview.workers.ConservationThread, [alignViewport, alignPanel]);
39138 this.ConsPercGaps = alignViewport.getConsPercGaps ();
39139 }, "jalview.api.AlignViewportI,jalview.api.AlignmentViewPanel");
39140 Clazz_overrideMethod (c$, "run1", 
39141 function (state) {
39142 while (!Thread.interrupted ()) {
39143 try {
39144 switch (state) {
39145 case 0:
39146 if (this.calcMan.isPending (this)) return;
39147 this.calcMan.notifyStart (this);
39148 state = 3;
39149 break;
39150 case 3:
39151 while (!this.calcMan.notifyWorking (this)) {
39152 if (this.ap != null) {
39153 this.ap.paintAlignment (false);
39154 }try {
39155 if (this.sleepAndReturn (200, state)) return;
39156 } catch (e) {
39157 if (Clazz_exceptionOf (e, InterruptedException)) {
39158 state = 2;
39159 break;
39160 } else {
39161 throw e;
39162 }
39163 }
39164 }
39165 if (this.alignViewport.isClosed ()) {
39166 this.abortAndDestroy ();
39167 state = 2;
39168 break;
39169 }var ourAnnot =  new java.util.ArrayList ();
39170 this.alignment = this.alignViewport.getAlignment ();
39171 this.conservation = this.alignViewport.getAlignmentConservationAnnotation ();
39172 this.quality = this.alignViewport.getAlignmentQualityAnnot ();
39173 ourAnnot.add (this.conservation);
39174 ourAnnot.add (this.quality);
39175 this.ourAnnots = ourAnnot;
39176 this.ConsPercGaps = this.alignViewport.getConsPercGaps ();
39177 if (this.alignment == null || (this.aWidth = this.alignment.getWidth ()) < 0) {
39178 this.calcMan.workerComplete (this);
39179 return;
39180 }state = 4;
39181 break;
39182 case 4:
39183 this.iFirst = this.iLast;
39184 this.nPer = this.aWidth + 1;
39185 this.iLast = Math.min (this.iLast + this.nPer, this.aWidth);
39186 if (this.iLast == this.iFirst) {
39187 state = 2;
39188 } else {
39189 this.computeConsensus ();
39190 if (this.sleepAndReturn (0, state)) return;
39191 }break;
39192 case 2:
39193 this.updateResultAnnotation (true);
39194 this.notifyDone ();
39195 return;
39196 }
39197 } catch (e$$) {
39198 if (Clazz_exceptionOf (e$$, OutOfMemoryError)) {
39199 var error = e$$;
39200 {
39201 this.calcMan.workerCannotRun (this);
39202 this.ap.raiseOOMWarning ("calculating conservation", error);
39203 }
39204 } else {
39205 var e = e$$;
39206 {
39207 System.out.println ("Error in ConsensusThread: " + e);
39208 e.printStackTrace ();
39209 this.calcMan.workerComplete (this);
39210 }
39211 }
39212 }
39213 }
39214 }, "~N");
39215 Clazz_defineMethod (c$, "computeConsensus", 
39216  function () {
39217 this.cons = jalview.analysis.Conservation.calculateConservation ("All", jalview.schemes.ResidueProperties.propHash, 3, this.alignment.getSequences (), 0, this.aWidth - 1, false, this.ConsPercGaps, this.quality != null);
39218 });
39219 Clazz_defineMethod (c$, "updateResultAnnotation", 
39220  function (b) {
39221 if (b || !this.calcMan.isWorking (this) && this.cons != null && this.conservation != null && this.quality != null) {
39222 this.alignViewport.setConservation (this.cons);
39223 this.cons.completeAnnotations (this.conservation, this.quality, 0, this.aWidth);
39224 }}, "~B");
39225 Clazz_overrideMethod (c$, "updateAnnotation", 
39226 function () {
39227 this.updateResultAnnotation (false);
39228 });
39229 });
39230 Clazz_declarePackage ("jalview.workers");
39231 Clazz_load (["jalview.api.AlignCalcWorkerI", "jalview.workers.AlignCalcWorker"], "jalview.workers.StrucConsensusThread", ["jalview.analysis.StructureFrequency"], function () {
39232 c$ = Clazz_decorateAsClass (function () {
39233 this.rnaStruc = null;
39234 this.strucConsensus = null;
39235 this.hStrucConsensus = null;
39236 this.nseq = -1;
39237 this.aa = null;
39238 this.arr = null;
39239 Clazz_instantialize (this, arguments);
39240 }, jalview.workers, "StrucConsensusThread", jalview.workers.AlignCalcWorker, jalview.api.AlignCalcWorkerI);
39241 Clazz_overrideMethod (c$, "getNewWorker", 
39242 function () {
39243 return  new jalview.workers.StrucConsensusThread (this.alignViewport, this.ap);
39244 });
39245 Clazz_overrideMethod (c$, "run1", 
39246 function (state) {
39247 if (this.alignViewport.isClosed ()) {
39248 this.abortAndDestroy ();
39249 return;
39250 }while (!Thread.interrupted ()) {
39251 try {
39252 switch (state) {
39253 case 0:
39254 if (this.calcMan.isPending (this)) return;
39255 this.calcMan.notifyStart (this);
39256 state = 3;
39257 break;
39258 case 3:
39259 while (!this.calcMan.notifyWorking (this)) {
39260 if (this.ap != null) {
39261 this.ap.paintAlignment (false);
39262 }try {
39263 if (this.sleepAndReturn (200, state)) return;
39264 } catch (e) {
39265 if (Clazz_exceptionOf (e, InterruptedException)) {
39266 state = 2;
39267 break;
39268 } else {
39269 throw e;
39270 }
39271 }
39272 }
39273 if (this.alignViewport.isClosed ()) {
39274 this.abortAndDestroy ();
39275 state = 2;
39276 break;
39277 }this.alignment = this.alignViewport.getAlignment ();
39278 this.aWidth = -1;
39279 if (this.alignment == null || (this.aWidth = this.alignment.getWidth ()) < 0) {
39280 state = 2;
39281 }this.strucConsensus = this.alignViewport.getAlignmentStrucConsensusAnnotation ();
39282 this.hStrucConsensus = this.alignViewport.getRnaStructureConsensusHash ();
39283 this.strucConsensus.annotations = null;
39284 this.strucConsensus.annotations =  new Array (this.aWidth);
39285 this.hStrucConsensus =  new Array (this.aWidth);
39286 this.aa = this.alignViewport.getAlignment ().getAlignmentAnnotation ();
39287 for (var i = 0; i < this.aa.length; i++) {
39288 if (this.aa[i].getRNAStruc () != null && this.aa[i].isValidStruc ()) {
39289 this.rnaStruc = this.aa[i];
39290 break;
39291 }}
39292 if (this.rnaStruc == null || !this.rnaStruc.isValidStruc ()) {
39293 this.calcMan.workerComplete (this);
39294 return;
39295 }this.arr = this.alignment.getSequencesArray ();
39296 this.nseq = this.arr.length;
39297 state = 4;
39298 break;
39299 case 4:
39300 this.iFirst = this.iLast;
39301 this.iLast = Math.min (this.iLast + this.nPer, this.aWidth);
39302 if (this.iLast == this.iFirst) {
39303 state = 2;
39304 } else {
39305 jalview.analysis.StructureFrequency.calculate (this.arr, 0, this.alignment.getWidth (), this.hStrucConsensus, true, this.rnaStruc);
39306 if (this.sleepAndReturn (0, state)) return;
39307 }break;
39308 case 2:
39309 this.alignViewport.setRnaStructureConsensusHash (this.hStrucConsensus);
39310 this.updateResultAnnotation (true);
39311 if (this.alignViewport.getGlobalColourScheme () != null) {
39312 this.alignViewport.getGlobalColourScheme ().setConsensus (this.hStrucConsensus);
39313 }this.notifyDone ();
39314 return;
39315 }
39316 } catch (e$$) {
39317 if (Clazz_exceptionOf (e$$, OutOfMemoryError)) {
39318 var error = e$$;
39319 {
39320 this.calcMan.workerCannotRun (this);
39321 this.ap.raiseOOMWarning ("calculating RNA structure consensus", error);
39322 }
39323 } else {
39324 var e = e$$;
39325 {
39326 System.out.println ("Error in ConsensusThread: " + e);
39327 e.printStackTrace ();
39328 this.calcMan.workerComplete (this);
39329 }
39330 }
39331 }
39332 }
39333 }, "~N");
39334 Clazz_overrideMethod (c$, "updateAnnotation", 
39335 function () {
39336 this.updateResultAnnotation (false);
39337 });
39338 Clazz_defineMethod (c$, "updateResultAnnotation", 
39339 function (immediate) {
39340 if (immediate || !this.calcMan.isWorking (this) && this.strucConsensus != null && this.hStrucConsensus != null) {
39341 jalview.analysis.StructureFrequency.completeConsensus (this.strucConsensus, this.hStrucConsensus, 0, this.hStrucConsensus.length, this.alignViewport.isIgnoreGapsConsensus (), this.alignViewport.isShowSequenceLogo (), this.nseq);
39342 }}, "~B");
39343 });
39344 Clazz_declarePackage ("jalview.analysis");
39345 Clazz_load (null, "jalview.analysis.StructureFrequency", ["jalview.datamodel.Annotation", "jalview.util.Format", "$.QuickSort", "java.lang.Float", "java.util.Hashtable", "JU.AU"], function () {
39346 c$ = Clazz_declareType (jalview.analysis, "StructureFrequency");
39347 c$.findPair = Clazz_defineMethod (c$, "findPair", 
39348 function (pairs, indice) {
39349 for (var i = 0; i < pairs.length; i++) {
39350 if (pairs[i].getBegin () == indice) {
39351 return pairs[i].getEnd ();
39352 }}
39353 return -1;
39354 }, "~A,~N");
39355 c$.calculate = Clazz_defineMethod (c$, "calculate", 
39356 function (sequences, start, end, result, profile, rnaStruc) {
39357 var residueHash;
39358 var maxResidue;
39359 var struc = rnaStruc.getRNAStruc ().toCharArray ();
39360 var rna = rnaStruc._rnasecstr;
39361 var c;
39362 var s;
39363 var cEnd;
39364 var count = 0;
39365 var nonGap = 0;
39366 var i;
39367 var bpEnd = -1;
39368 var j;
39369 var jSize = sequences.length;
39370 var values;
39371 var pairs;
39372 var percentage;
39373 var wooble = true;
39374 for (i = start; i < end; i++) {
39375 residueHash =  new java.util.Hashtable ();
39376 maxResidue = "-";
39377 values =  Clazz_newIntArray (255, 0);
39378 pairs =  Clazz_newIntArray (255, 255, 0);
39379 bpEnd = -1;
39380 if (i < struc.length) {
39381 s = struc[i];
39382 } else {
39383 s = '-';
39384 }if (s == '.' || s == ' ') {
39385 s = '-';
39386 }if (s != '(' && s != '[') {
39387 if (s == '-') {
39388 values['-'.charCodeAt (0)]++;
39389 }} else {
39390 bpEnd = jalview.analysis.StructureFrequency.findPair (rna, i);
39391 if (bpEnd > -1) {
39392 for (j = 0; j < jSize; j++) {
39393 if (sequences[j] == null) {
39394 System.err.println ("WARNING: Consensus skipping null sequence - possible race condition.");
39395 continue;
39396 }c = sequences[j].getCharAt (i);
39397 if (c == '.' || c == ' ') {
39398 c = '-';
39399 }if (c == '-') {
39400 values['-'.charCodeAt (0)]++;
39401 continue;
39402 }cEnd = sequences[j].getCharAt (bpEnd);
39403 if (jalview.analysis.StructureFrequency.checkBpType (c, cEnd) == true) {
39404 values['('.charCodeAt (0)]++;
39405 maxResidue = "(";
39406 wooble = true;
39407 }if (jalview.analysis.StructureFrequency.checkBpType (c, cEnd) == false) {
39408 wooble = false;
39409 values['['.charCodeAt (0)]++;
39410 maxResidue = "[";
39411 }pairs[c.charCodeAt (0)][cEnd.charCodeAt (0)]++;
39412 }
39413 }}if (profile) {
39414 residueHash.put ("P",  Clazz_newArray (-1, [values,  Clazz_newIntArray (-1, [jSize, (jSize - values['-'.charCodeAt (0)])])]));
39415 residueHash.put ("B", pairs);
39416 }if (wooble == true) {
39417 count = values['('.charCodeAt (0)];
39418 }if (wooble == false) {
39419 count = values['['.charCodeAt (0)];
39420 }residueHash.put ("C",  new Integer (count));
39421 residueHash.put ("R", maxResidue);
39422 percentage = (count * 100) / jSize;
39423 residueHash.put ("G",  new Float (percentage));
39424 if (result[i] == null) {
39425 result[i] = residueHash;
39426 }if (bpEnd > 0) {
39427 values[')'.charCodeAt (0)] = values['('.charCodeAt (0)];
39428 values[']'.charCodeAt (0)] = values['['.charCodeAt (0)];
39429 values['('.charCodeAt (0)] = 0;
39430 values['['.charCodeAt (0)] = 0;
39431 residueHash =  new java.util.Hashtable ();
39432 if (wooble == true) {
39433 maxResidue = ")";
39434 }if (wooble == false) {
39435 maxResidue = "]";
39436 }if (profile) {
39437 residueHash.put ("P",  Clazz_newArray (-1, [values,  Clazz_newIntArray (-1, [jSize, (jSize - values['-'.charCodeAt (0)])])]));
39438 residueHash.put ("B", pairs);
39439 }residueHash.put ("C",  new Integer (count));
39440 residueHash.put ("R", maxResidue);
39441 percentage = (count * 100) / jSize;
39442 residueHash.put ("G",  new Float (percentage));
39443 result[bpEnd] = residueHash;
39444 }}
39445 }, "~A,~N,~N,~A,~B,jalview.datamodel.AlignmentAnnotation");
39446 c$.checkBpType = Clazz_defineMethod (c$, "checkBpType", 
39447 function (up, down) {
39448 if (up > 'Z') {
39449 up = String.fromCharCode (up.charCodeAt (0) - 32);
39450 }if (down > 'Z') {
39451 down = String.fromCharCode (down.charCodeAt (0) - 32);
39452 }switch (up) {
39453 case 'A':
39454 switch (down) {
39455 case 'T':
39456 return true;
39457 case 'U':
39458 return true;
39459 }
39460 break;
39461 case 'C':
39462 switch (down) {
39463 case 'G':
39464 return true;
39465 }
39466 break;
39467 case 'T':
39468 switch (down) {
39469 case 'A':
39470 return true;
39471 case 'G':
39472 return true;
39473 }
39474 break;
39475 case 'G':
39476 switch (down) {
39477 case 'C':
39478 return true;
39479 case 'T':
39480 return true;
39481 case 'U':
39482 return true;
39483 }
39484 break;
39485 case 'U':
39486 switch (down) {
39487 case 'A':
39488 return true;
39489 case 'G':
39490 return true;
39491 }
39492 break;
39493 }
39494 return false;
39495 }, "~S,~S");
39496 c$.completeConsensus = Clazz_defineMethod (c$, "completeConsensus", 
39497 function (consensus, hconsensus, iStart, width, ignoreGapsInConsensusCalculation, includeAllConsSymbols, nseq) {
39498 var tval;
39499 var value;
39500 if (consensus == null || consensus.annotations == null || consensus.annotations.length < width) {
39501 return;
39502 }var fmtstr = "%3.1f";
39503 var precision = 2;
39504 while (nseq > 100) {
39505 precision++;
39506 nseq /= 10;
39507 }
39508 if (precision > 2) {
39509 fmtstr = "%" + (2 + precision) + "." + precision + "f";
39510 }var fmt =  new jalview.util.Format (fmtstr);
39511 for (var i = iStart; i < width; i++) {
39512 var hci;
39513 if (i >= hconsensus.length || ((hci = hconsensus[i]) == null)) {
39514 consensus.annotations[i] = null;
39515 continue;
39516 }value = 0;
39517 var fv;
39518 if (ignoreGapsInConsensusCalculation) {
39519 fv = hci.get ("N");
39520 } else {
39521 fv = hci.get ("G");
39522 }if (fv == null) {
39523 consensus.annotations[i] = null;
39524 continue;
39525 }value = fv.floatValue ();
39526 var maxRes = hci.get ("R").toString ();
39527 var mouseOver = hci.get ("R") + " ";
39528 if (maxRes.length > 1) {
39529 mouseOver = "[" + maxRes + "] ";
39530 maxRes = "+";
39531 }var profile = hci.get ("P");
39532 var pairs = hci.get ("B");
39533 if (pairs != null && includeAllConsSymbols) {
39534 mouseOver = "";
39535 var ca = JU.AU.newInt2 (625);
39536 var vl =  Clazz_newFloatArray (625, 0);
39537 var x = 0;
39538 for (var c = 65; c < 90; c++) {
39539 for (var d = 65; d < 90; d++) {
39540 ca[x] =  Clazz_newIntArray (-1, [c, d]);
39541 vl[x] = pairs[c][d];
39542 x++;
39543 }
39544 }
39545 jalview.util.QuickSort.sortFloatObject (vl, ca);
39546 var p = 0;
39547 var divisor = profile[1][ignoreGapsInConsensusCalculation ? 1 : 0];
39548 for (var c = 624; c > 0; c--) {
39549 if (vl[c] > 0) {
39550 tval = (vl[c] * 100 / divisor);
39551 mouseOver += ((p == 0) ? "" : "; ") + String.fromCharCode (ca[c][0]) + String.fromCharCode (ca[c][1]) + " " + fmt.formDouble (tval) + "%";
39552 p++;
39553 }}
39554 } else {
39555 mouseOver += (fmt.formDouble (value) + "%");
39556 }consensus.annotations[i] =  new jalview.datamodel.Annotation (maxRes, mouseOver, ' ', value);
39557 }
39558 }, "jalview.datamodel.AlignmentAnnotation,~A,~N,~N,~B,~B,~N");
39559 c$.extractProfile = Clazz_defineMethod (c$, "extractProfile", 
39560 function (hconsensus, ignoreGapsInConsensusCalculation) {
39561 var rtnval =  Clazz_newIntArray (74, 0);
39562 var profile = hconsensus.get ("P");
39563 var pairs = hconsensus.get ("B");
39564 if (profile == null) {
39565 return null;
39566 }var ca = JU.AU.newInt2 (625);
39567 var vl =  Clazz_newFloatArray (625, 0);
39568 var x = 0;
39569 for (var c = 65; c < 90; c++) {
39570 for (var d = 65; d < 90; d++) {
39571 ca[x] =  Clazz_newIntArray (-1, [c, d]);
39572 vl[x] = pairs[c][d];
39573 x++;
39574 }
39575 }
39576 jalview.util.QuickSort.sortFloatObject (vl, ca);
39577 var valuesCount = 0;
39578 rtnval[1] = 0;
39579 var offset = 2;
39580 var divisor = profile[1][ignoreGapsInConsensusCalculation ? 1 : 0];
39581 for (var c = 624; c > 0; c--) {
39582 if (vl[c] > 0) {
39583 rtnval[offset++] = ca[c][0];
39584 rtnval[offset++] = ca[c][1];
39585 rtnval[offset] = Clazz_floatToInt (vl[c] * 100 / divisor);
39586 rtnval[1] += rtnval[offset++];
39587 valuesCount++;
39588 }}
39589 rtnval[0] = valuesCount;
39590 var result =  Clazz_newIntArray (rtnval.length + 1, 0);
39591 result[0] = 1;
39592 System.arraycopy (rtnval, 0, result, 1, rtnval.length);
39593 return result;
39594 }, "java.util.Hashtable,~B");
39595 Clazz_defineStatics (c$,
39596 "STRUCTURE_PROFILE_LENGTH", 74,
39597 "MAXCOUNT", "C",
39598 "MAXRESIDUE", "R",
39599 "PID_GAPS", "G",
39600 "PID_NOGAPS", "N",
39601 "PROFILE", "P",
39602 "PAIRPROFILE", "B");
39603 });
39604 Clazz_declarePackage ("jalview.schemes");
39605 Clazz_load (null, "jalview.schemes.ColourSchemeProperty", ["jalview.schemes.Blosum62ColourScheme", "$.BuriedColourScheme", "$.ClustalxColourScheme", "$.HelixColourScheme", "$.HydrophobicColourScheme", "$.NucleotideColourScheme", "$.PIDColourScheme", "$.PurinePyrimidineColourScheme", "$.RNAHelicesColour", "$.StrandColourScheme", "$.TCoffeeColourScheme", "$.TaylorColourScheme", "$.TurnColourScheme", "$.UserColourScheme", "$.ZappoColourScheme", "jalview.util.ColorUtils", "java.awt.Color"], function () {
39606 c$ = Clazz_declareType (jalview.schemes, "ColourSchemeProperty");
39607 c$.getColourIndexFromName = Clazz_defineMethod (c$, "getColourIndexFromName", 
39608 function (name) {
39609 var ret = -1;
39610 if (name.equalsIgnoreCase ("Clustal")) {
39611 ret = 2;
39612 } else if (name.equalsIgnoreCase ("Blosum62")) {
39613 ret = 3;
39614 } else if (name.equalsIgnoreCase ("% Identity")) {
39615 ret = 4;
39616 } else if (name.equalsIgnoreCase ("Zappo")) {
39617 ret = 5;
39618 } else if (name.equalsIgnoreCase ("Taylor")) {
39619 ret = 6;
39620 } else if (name.equalsIgnoreCase ("Hydrophobic")) {
39621 ret = 7;
39622 } else if (name.equalsIgnoreCase ("Helix Propensity")) {
39623 ret = 8;
39624 } else if (name.equalsIgnoreCase ("Strand Propensity")) {
39625 ret = 9;
39626 } else if (name.equalsIgnoreCase ("Turn Propensity")) {
39627 ret = 10;
39628 } else if (name.equalsIgnoreCase ("Buried Index")) {
39629 ret = 11;
39630 } else if (name.equalsIgnoreCase ("Nucleotide")) {
39631 ret = 12;
39632 } else if (name.equalsIgnoreCase ("T-Coffee Scores")) {
39633 ret = 15;
39634 } else if (name.equalsIgnoreCase ("User Defined")) {
39635 ret = 0;
39636 } else if (name.equalsIgnoreCase ("None")) {
39637 ret = 1;
39638 } else if (name.equalsIgnoreCase ("Purine/Pyrimidine")) {
39639 ret = 13;
39640 } else if (name.equalsIgnoreCase ("RNA Interaction type")) {
39641 ret = 17;
39642 } else if (name.equalsIgnoreCase ("RNA Helices")) {
39643 ret = 16;
39644 }return ret;
39645 }, "~S");
39646 c$.getColourName = Clazz_defineMethod (c$, "getColourName", 
39647 function (cs) {
39648 var index = 1;
39649 if (Clazz_instanceOf (cs, jalview.schemes.ClustalxColourScheme)) {
39650 index = 2;
39651 } else if (Clazz_instanceOf (cs, jalview.schemes.Blosum62ColourScheme)) {
39652 index = 3;
39653 } else if (Clazz_instanceOf (cs, jalview.schemes.PIDColourScheme)) {
39654 index = 4;
39655 } else if (Clazz_instanceOf (cs, jalview.schemes.ZappoColourScheme)) {
39656 index = 5;
39657 } else if (Clazz_instanceOf (cs, jalview.schemes.TaylorColourScheme)) {
39658 index = 6;
39659 } else if (Clazz_instanceOf (cs, jalview.schemes.HydrophobicColourScheme)) {
39660 index = 7;
39661 } else if (Clazz_instanceOf (cs, jalview.schemes.HelixColourScheme)) {
39662 index = 8;
39663 } else if (Clazz_instanceOf (cs, jalview.schemes.StrandColourScheme)) {
39664 index = 9;
39665 } else if (Clazz_instanceOf (cs, jalview.schemes.TurnColourScheme)) {
39666 index = 10;
39667 } else if (Clazz_instanceOf (cs, jalview.schemes.BuriedColourScheme)) {
39668 index = 11;
39669 } else if (Clazz_instanceOf (cs, jalview.schemes.NucleotideColourScheme)) {
39670 index = 12;
39671 } else if (Clazz_instanceOf (cs, jalview.schemes.PurinePyrimidineColourScheme)) {
39672 index = 13;
39673 } else if (Clazz_instanceOf (cs, jalview.schemes.TCoffeeColourScheme)) {
39674 index = 15;
39675 } else if (Clazz_instanceOf (cs, jalview.schemes.RNAHelicesColour)) {
39676 index = 16;
39677 } else if (Clazz_instanceOf (cs, jalview.schemes.UserColourScheme)) {
39678 if (((cs).getName () != null) && ((cs).getName ().length > 0)) {
39679 return (cs).getName ();
39680 }index = 0;
39681 }return jalview.schemes.ColourSchemeProperty.getColourName (index);
39682 }, "jalview.schemes.ColourSchemeI");
39683 c$.getColourName = Clazz_defineMethod (c$, "getColourName", 
39684 function (index) {
39685 var ret = null;
39686 switch (index) {
39687 case 2:
39688 ret = "Clustal";
39689 break;
39690 case 3:
39691 ret = "Blosum62";
39692 break;
39693 case 4:
39694 ret = "% Identity";
39695 break;
39696 case 5:
39697 ret = "Zappo";
39698 break;
39699 case 6:
39700 ret = "Taylor";
39701 break;
39702 case 7:
39703 ret = "Hydrophobic";
39704 break;
39705 case 8:
39706 ret = "Helix Propensity";
39707 break;
39708 case 9:
39709 ret = "Strand Propensity";
39710 break;
39711 case 10:
39712 ret = "Turn Propensity";
39713 break;
39714 case 11:
39715 ret = "Buried Index";
39716 break;
39717 case 12:
39718 ret = "Nucleotide";
39719 break;
39720 case 13:
39721 ret = "Purine/Pyrimidine";
39722 break;
39723 case 15:
39724 ret = "T-Coffee Scores";
39725 break;
39726 case 17:
39727 ret = "RNA Interaction type";
39728 break;
39729 case 16:
39730 ret = "RNA Helices";
39731 break;
39732 case 0:
39733 ret = "User Defined";
39734 break;
39735 default:
39736 ret = "None";
39737 break;
39738 }
39739 return ret;
39740 }, "~N");
39741 c$.getColour = Clazz_defineMethod (c$, "getColour", 
39742 function (alignment, name) {
39743 var colindex = jalview.schemes.ColourSchemeProperty.getColourIndexFromName (name);
39744 if (colindex == -1) {
39745 if (name.indexOf ('=') == -1) {
39746 try {
39747 return  new jalview.schemes.UserColourScheme (name);
39748 } catch (e) {
39749 if (Clazz_exceptionOf (e, Exception)) {
39750 } else {
39751 throw e;
39752 }
39753 }
39754 } else {
39755 try {
39756 var ucs =  new jalview.schemes.UserColourScheme ("white");
39757 ucs.parseAppletParameter (name);
39758 } catch (e) {
39759 if (Clazz_exceptionOf (e, Exception)) {
39760 } else {
39761 throw e;
39762 }
39763 }
39764 }}return jalview.schemes.ColourSchemeProperty.getColour (alignment, jalview.schemes.ColourSchemeProperty.getColourIndexFromName (name));
39765 }, "jalview.datamodel.AnnotatedCollectionI,~S");
39766 c$.getColour = Clazz_defineMethod (c$, "getColour", 
39767 function (coll, index) {
39768 var cs = null;
39769 switch (index) {
39770 case 2:
39771 cs =  new jalview.schemes.ClustalxColourScheme (coll, null);
39772 break;
39773 case 3:
39774 cs =  new jalview.schemes.Blosum62ColourScheme ();
39775 break;
39776 case 4:
39777 cs =  new jalview.schemes.PIDColourScheme ();
39778 break;
39779 case 5:
39780 cs =  new jalview.schemes.ZappoColourScheme ();
39781 break;
39782 case 6:
39783 cs =  new jalview.schemes.TaylorColourScheme ();
39784 break;
39785 case 7:
39786 cs =  new jalview.schemes.HydrophobicColourScheme ();
39787 break;
39788 case 8:
39789 cs =  new jalview.schemes.HelixColourScheme ();
39790 break;
39791 case 9:
39792 cs =  new jalview.schemes.StrandColourScheme ();
39793 break;
39794 case 10:
39795 cs =  new jalview.schemes.TurnColourScheme ();
39796 break;
39797 case 11:
39798 cs =  new jalview.schemes.BuriedColourScheme ();
39799 break;
39800 case 12:
39801 cs =  new jalview.schemes.NucleotideColourScheme ();
39802 break;
39803 case 13:
39804 cs =  new jalview.schemes.PurinePyrimidineColourScheme ();
39805 break;
39806 case 15:
39807 cs =  new jalview.schemes.TCoffeeColourScheme (coll);
39808 break;
39809 case 16:
39810 cs =  new jalview.schemes.RNAHelicesColour (coll);
39811 break;
39812 case 0:
39813 var col =  new Array (24);
39814 for (var i = 0; i < 24; i++) {
39815 col[i] = java.awt.Color.white;
39816 }
39817 cs =  new jalview.schemes.UserColourScheme (col);
39818 break;
39819 default:
39820 break;
39821 }
39822 return cs;
39823 }, "jalview.datamodel.AnnotatedCollectionI,~N");
39824 c$.getAWTColorFromName = Clazz_defineMethod (c$, "getAWTColorFromName", 
39825 function (name) {
39826 var col = null;
39827 name = name.toLowerCase ();
39828 if (name.equals ("black")) {
39829 col = java.awt.Color.black;
39830 } else if (name.equals ("blue")) {
39831 col = java.awt.Color.blue;
39832 } else if (name.equals ("cyan")) {
39833 col = java.awt.Color.cyan;
39834 } else if (name.equals ("darkGray")) {
39835 col = java.awt.Color.darkGray;
39836 } else if (name.equals ("gray")) {
39837 col = java.awt.Color.gray;
39838 } else if (name.equals ("green")) {
39839 col = java.awt.Color.green;
39840 } else if (name.equals ("lightGray")) {
39841 col = java.awt.Color.lightGray;
39842 } else if (name.equals ("magenta")) {
39843 col = java.awt.Color.magenta;
39844 } else if (name.equals ("orange")) {
39845 col = java.awt.Color.orange;
39846 } else if (name.equals ("pink")) {
39847 col = java.awt.Color.pink;
39848 } else if (name.equals ("red")) {
39849 col = java.awt.Color.red;
39850 } else if (name.equals ("white")) {
39851 col = java.awt.Color.white;
39852 } else if (name.equals ("yellow")) {
39853 col = java.awt.Color.yellow;
39854 }return col;
39855 }, "~S");
39856 c$.initRnaHelicesShading = Clazz_defineMethod (c$, "initRnaHelicesShading", 
39857 function (n) {
39858 var j = 0;
39859 if (jalview.schemes.ColourSchemeProperty.rnaHelices == null) {
39860 jalview.schemes.ColourSchemeProperty.rnaHelices =  new Array (n + 1);
39861 } else if (jalview.schemes.ColourSchemeProperty.rnaHelices != null && jalview.schemes.ColourSchemeProperty.rnaHelices.length <= n) {
39862 var t =  new Array (n + 1);
39863 System.arraycopy (jalview.schemes.ColourSchemeProperty.rnaHelices, 0, t, 0, jalview.schemes.ColourSchemeProperty.rnaHelices.length);
39864 j = jalview.schemes.ColourSchemeProperty.rnaHelices.length;
39865 jalview.schemes.ColourSchemeProperty.rnaHelices = t;
39866 } else {
39867 return;
39868 }for (; j <= n; j++) {
39869 jalview.schemes.ColourSchemeProperty.rnaHelices[j] = jalview.util.ColorUtils.generateRandomColor (java.awt.Color.white);
39870 }
39871 }, "~N");
39872 Clazz_defineStatics (c$,
39873 "UNDEFINED", -1,
39874 "USER_DEFINED", 0,
39875 "NONE", 1,
39876 "CLUSTAL", 2,
39877 "BLOSUM", 3,
39878 "PID", 4,
39879 "ZAPPO", 5,
39880 "TAYLOR", 6,
39881 "HYDROPHOBIC", 7,
39882 "HELIX", 8,
39883 "STRAND", 9,
39884 "TURN", 10,
39885 "BURIED", 11,
39886 "NUCLEOTIDE", 12,
39887 "PURINEPYRIMIDINE", 13,
39888 "COVARIATION", 14,
39889 "TCOFFEE", 15,
39890 "RNAHELIX", 16,
39891 "RNAINTERACTION", 17,
39892 "FIRST_COLOUR", 1,
39893 "LAST_COLOUR", 17,
39894 "rnaHelices", null);
39895 });
39896 Clazz_declarePackage ("jalview.schemes");
39897 Clazz_load (["jalview.schemes.ScoreColourScheme"], "jalview.schemes.BuriedColourScheme", ["jalview.schemes.ResidueProperties", "java.awt.Color"], function () {
39898 c$ = Clazz_declareType (jalview.schemes, "BuriedColourScheme", jalview.schemes.ScoreColourScheme);
39899 Clazz_makeConstructor (c$, 
39900 function () {
39901 Clazz_superConstructor (this, jalview.schemes.BuriedColourScheme, [jalview.schemes.ResidueProperties.aaIndex, jalview.schemes.ResidueProperties.buried, 0.05, 4.6]);
39902 });
39903 Clazz_overrideMethod (c$, "makeColour", 
39904 function (c) {
39905 return  new java.awt.Color (0, (1.0 - c), c);
39906 }, "~N");
39907 });
39908 Clazz_declarePackage ("jalview.schemes");
39909 Clazz_load (["jalview.schemes.ResidueColourScheme"], "jalview.schemes.ScoreColourScheme", ["jalview.schemes.ResidueProperties", "jalview.util.Comparison", "java.awt.Color"], function () {
39910 c$ = Clazz_decorateAsClass (function () {
39911 this.min = 0;
39912 this.max = 0;
39913 this.scores = null;
39914 Clazz_instantialize (this, arguments);
39915 }, jalview.schemes, "ScoreColourScheme", jalview.schemes.ResidueColourScheme);
39916 Clazz_makeConstructor (c$, 
39917 function (symbolIndex, scores, min, max) {
39918 Clazz_superConstructor (this, jalview.schemes.ScoreColourScheme, [symbolIndex]);
39919 this.scores = scores;
39920 this.min = min;
39921 this.max = max;
39922 var i;
39923 var iSize = scores.length;
39924 this.colors =  new Array (scores.length);
39925 for (i = 0; i < iSize; i++) {
39926 var red = (scores[i] - min) / (max - min);
39927 if (red > 1.0) {
39928 red = 1.0;
39929 }if (red < 0.0) {
39930 red = 0.0;
39931 }this.colors[i] = this.makeColour (red);
39932 }
39933 }, "~A,~A,~N,~N");
39934 Clazz_overrideMethod (c$, "findColourSeq", 
39935 function (c, j, seq) {
39936 if (this.threshold > 0) {
39937 if (!this.aboveThreshold (c, j)) {
39938 return java.awt.Color.white;
39939 }}if (jalview.util.Comparison.isGap (c)) {
39940 return java.awt.Color.white;
39941 }var currentColour = this.colors[jalview.schemes.ResidueProperties.aaIndex[c.charCodeAt (0)]];
39942 if (this.conservationColouring) {
39943 currentColour = this.applyConservation (currentColour, j);
39944 }return currentColour;
39945 }, "~S,~N,jalview.datamodel.SequenceI");
39946 Clazz_defineMethod (c$, "makeColour", 
39947 function (c) {
39948 return  new java.awt.Color (c, 0.0, 1.0 - c);
39949 }, "~N");
39950 });
39951 Clazz_declarePackage ("jalview.schemes");
39952 Clazz_load (["jalview.schemes.ResidueColourScheme", "java.util.HashMap"], ["jalview.schemes.ConsensusColour", "$.ClustalxColourScheme"], ["jalview.schemes.Consensus", "$.ResidueProperties", "java.awt.Color"], function () {
39953 c$ = Clazz_decorateAsClass (function () {
39954 this.cons2 = null;
39955 this.colours = null;
39956 this.residueColour = null;
39957 this.size = 0;
39958 this.conses = null;
39959 this.includeGaps = true;
39960 Clazz_instantialize (this, arguments);
39961 }, jalview.schemes, "ClustalxColourScheme", jalview.schemes.ResidueColourScheme);
39962 Clazz_prepareFields (c$, function () {
39963 this.conses =  new Array (32);
39964 });
39965 Clazz_makeConstructor (c$, 
39966 function (alignment, hiddenReps) {
39967 Clazz_superConstructor (this, jalview.schemes.ClustalxColourScheme, []);
39968 this.alignmentChanged (alignment, hiddenReps);
39969 }, "jalview.datamodel.AnnotatedCollectionI,java.util.Map");
39970 Clazz_overrideMethod (c$, "alignmentChanged", 
39971 function (alignment, hiddenReps) {
39972 var maxWidth = alignment.getWidth ();
39973 var seqs = alignment.getSequences (hiddenReps);
39974 this.cons2 =  Clazz_newIntArray (maxWidth, 24, 0);
39975 this.includeGaps = this.isIncludeGaps ();
39976 var start = 0;
39977 for (var j = 0; j < 24; j++) {
39978 for (var i = 0; i < maxWidth; i++) {
39979 this.cons2[i][j] = 0;
39980 }
39981 }
39982 var res;
39983 var i;
39984 var j = 0;
39985 var seq;
39986 for (var sq, $sq = seqs.iterator (); $sq.hasNext () && ((sq = $sq.next ()) || true);) {
39987 seq = sq.getSequence ();
39988 var end_j = seq.length - 1;
39989 for (i = start; i <= end_j; i++) {
39990 if ((seq.length - 1) < i) {
39991 res = 23;
39992 } else {
39993 res = jalview.schemes.ResidueProperties.aaIndex[seq[i].charCodeAt (0)];
39994 }this.cons2[i][res]++;
39995 }
39996 j++;
39997 }
39998 this.size = seqs.size ();
39999 this.makeColours ();
40000 }, "jalview.datamodel.AnnotatedCollectionI,java.util.Map");
40001 Clazz_defineMethod (c$, "makeColours", 
40002 function () {
40003 this.conses[0] =  new jalview.schemes.Consensus ("WLVIMAFCYHP", 60);
40004 this.conses[1] =  new jalview.schemes.Consensus ("WLVIMAFCYHP", 80);
40005 this.conses[2] =  new jalview.schemes.Consensus ("ED", 50);
40006 this.conses[3] =  new jalview.schemes.Consensus ("KR", 60);
40007 this.conses[4] =  new jalview.schemes.Consensus ("G", 50);
40008 this.conses[5] =  new jalview.schemes.Consensus ("N", 50);
40009 this.conses[6] =  new jalview.schemes.Consensus ("QE", 50);
40010 this.conses[7] =  new jalview.schemes.Consensus ("P", 50);
40011 this.conses[8] =  new jalview.schemes.Consensus ("TS", 50);
40012 this.conses[26] =  new jalview.schemes.Consensus ("A", 85);
40013 this.conses[27] =  new jalview.schemes.Consensus ("C", 85);
40014 this.conses[10] =  new jalview.schemes.Consensus ("E", 85);
40015 this.conses[11] =  new jalview.schemes.Consensus ("F", 85);
40016 this.conses[12] =  new jalview.schemes.Consensus ("G", 85);
40017 this.conses[13] =  new jalview.schemes.Consensus ("H", 85);
40018 this.conses[14] =  new jalview.schemes.Consensus ("I", 85);
40019 this.conses[15] =  new jalview.schemes.Consensus ("L", 85);
40020 this.conses[16] =  new jalview.schemes.Consensus ("M", 85);
40021 this.conses[17] =  new jalview.schemes.Consensus ("N", 85);
40022 this.conses[18] =  new jalview.schemes.Consensus ("P", 85);
40023 this.conses[19] =  new jalview.schemes.Consensus ("Q", 85);
40024 this.conses[20] =  new jalview.schemes.Consensus ("R", 85);
40025 this.conses[21] =  new jalview.schemes.Consensus ("S", 85);
40026 this.conses[22] =  new jalview.schemes.Consensus ("T", 85);
40027 this.conses[23] =  new jalview.schemes.Consensus ("V", 85);
40028 this.conses[24] =  new jalview.schemes.Consensus ("W", 85);
40029 this.conses[25] =  new jalview.schemes.Consensus ("Y", 85);
40030 this.conses[28] =  new jalview.schemes.Consensus ("K", 85);
40031 this.conses[29] =  new jalview.schemes.Consensus ("D", 85);
40032 this.conses[30] =  new jalview.schemes.Consensus ("G", 0);
40033 this.conses[31] =  new jalview.schemes.Consensus ("P", 0);
40034 this.colours =  new Array (11);
40035 var tmp8 =  new Array (1);
40036 tmp8[0] = this.conses[30];
40037 this.colours[7] =  new jalview.schemes.ConsensusColour (jalview.schemes.ClustalxColourScheme.colhash.get (java.awt.Color.ORANGE), tmp8);
40038 var tmp9 =  new Array (1);
40039 tmp9[0] = this.conses[31];
40040 this.colours[8] =  new jalview.schemes.ConsensusColour (jalview.schemes.ClustalxColourScheme.colhash.get (java.awt.Color.YELLOW), tmp9);
40041 var tmp10 =  new Array (1);
40042 tmp10[0] = this.conses[27];
40043 this.colours[9] =  new jalview.schemes.ConsensusColour (jalview.schemes.ClustalxColourScheme.colhash.get (java.awt.Color.PINK), tmp8);
40044 var tmp1 =  new Array (14);
40045 tmp1[0] = this.conses[0];
40046 tmp1[1] = this.conses[1];
40047 tmp1[2] = this.conses[26];
40048 tmp1[3] = this.conses[27];
40049 tmp1[4] = this.conses[11];
40050 tmp1[5] = this.conses[13];
40051 tmp1[6] = this.conses[14];
40052 tmp1[7] = this.conses[15];
40053 tmp1[8] = this.conses[16];
40054 tmp1[9] = this.conses[23];
40055 tmp1[10] = this.conses[24];
40056 tmp1[11] = this.conses[25];
40057 tmp1[12] = this.conses[18];
40058 tmp1[13] = this.conses[19];
40059 this.colours[0] =  new jalview.schemes.ConsensusColour (jalview.schemes.ClustalxColourScheme.colhash.get (java.awt.Color.BLUE), tmp1);
40060 this.colours[10] =  new jalview.schemes.ConsensusColour (jalview.schemes.ClustalxColourScheme.colhash.get (java.awt.Color.CYAN), tmp1);
40061 var tmp2 =  new Array (5);
40062 tmp2[0] = this.conses[8];
40063 tmp2[1] = this.conses[21];
40064 tmp2[2] = this.conses[22];
40065 tmp2[3] = this.conses[0];
40066 tmp2[4] = this.conses[1];
40067 this.colours[1] =  new jalview.schemes.ConsensusColour (jalview.schemes.ClustalxColourScheme.colhash.get (java.awt.Color.GREEN), tmp2);
40068 var tmp3 =  new Array (3);
40069 tmp3[0] = this.conses[17];
40070 tmp3[1] = this.conses[29];
40071 tmp3[2] = this.conses[5];
40072 this.colours[2] =  new jalview.schemes.ConsensusColour (jalview.schemes.ClustalxColourScheme.colhash.get (java.awt.Color.GREEN), tmp3);
40073 var tmp4 =  new Array (6);
40074 tmp4[0] = this.conses[6];
40075 tmp4[1] = this.conses[19];
40076 tmp4[2] = this.conses[22];
40077 tmp4[3] = this.conses[3];
40078 tmp4[4] = this.conses[28];
40079 tmp4[5] = this.conses[20];
40080 this.colours[3] =  new jalview.schemes.ConsensusColour (jalview.schemes.ClustalxColourScheme.colhash.get (java.awt.Color.GREEN), tmp4);
40081 var tmp5 =  new Array (4);
40082 tmp5[0] = this.conses[3];
40083 tmp5[1] = this.conses[28];
40084 tmp5[2] = this.conses[20];
40085 tmp5[3] = this.conses[19];
40086 this.colours[4] =  new jalview.schemes.ConsensusColour (jalview.schemes.ClustalxColourScheme.colhash.get (java.awt.Color.RED), tmp5);
40087 var tmp6 =  new Array (6);
40088 tmp6[0] = this.conses[3];
40089 tmp6[1] = this.conses[29];
40090 tmp6[2] = this.conses[10];
40091 tmp6[3] = this.conses[6];
40092 tmp6[4] = this.conses[19];
40093 tmp6[5] = this.conses[2];
40094 this.colours[5] =  new jalview.schemes.ConsensusColour (jalview.schemes.ClustalxColourScheme.colhash.get (java.awt.Color.MAGENTA), tmp6);
40095 var tmp7 =  new Array (5);
40096 tmp7[0] = this.conses[3];
40097 tmp7[1] = this.conses[29];
40098 tmp7[2] = this.conses[10];
40099 tmp7[3] = this.conses[17];
40100 tmp7[4] = this.conses[2];
40101 this.colours[6] =  new jalview.schemes.ConsensusColour (jalview.schemes.ClustalxColourScheme.colhash.get (java.awt.Color.MAGENTA), tmp7);
40102 this.residueColour =  new Array (20);
40103 this.residueColour[0] = this.colours[0];
40104 this.residueColour[1] = this.colours[4];
40105 this.residueColour[2] = this.colours[2];
40106 this.residueColour[3] = this.colours[6];
40107 this.residueColour[4] = this.colours[0];
40108 this.residueColour[5] = this.colours[3];
40109 this.residueColour[6] = this.colours[5];
40110 this.residueColour[7] = this.colours[7];
40111 this.residueColour[8] = this.colours[10];
40112 this.residueColour[9] = this.colours[0];
40113 this.residueColour[10] = this.colours[0];
40114 this.residueColour[11] = this.colours[4];
40115 this.residueColour[12] = this.colours[0];
40116 this.residueColour[13] = this.colours[0];
40117 this.residueColour[14] = this.colours[8];
40118 this.residueColour[15] = this.colours[1];
40119 this.residueColour[16] = this.colours[1];
40120 this.residueColour[17] = this.colours[0];
40121 this.residueColour[18] = this.colours[10];
40122 this.residueColour[19] = this.colours[0];
40123 });
40124 Clazz_overrideMethod (c$, "findColour", 
40125 function (c) {
40126 return java.awt.Color.pink;
40127 }, "~S");
40128 Clazz_overrideMethod (c$, "findColourSeq", 
40129 function (c, j, seq) {
40130 var currentColour;
40131 if (this.cons2.length <= j || (this.includeGaps && this.threshold != 0 && !this.aboveThreshold (c, j))) {
40132 return java.awt.Color.white;
40133 }var i = jalview.schemes.ResidueProperties.aaIndex[c.charCodeAt (0)];
40134 currentColour = java.awt.Color.white;
40135 if (i > 19) {
40136 return currentColour;
40137 }for (var k = 0; k < this.residueColour[i].conses.length; k++) {
40138 if (this.residueColour[i].conses[k].isConserved (this.cons2, j, this.size, this.includeGaps)) {
40139 currentColour = this.residueColour[i].c;
40140 }}
40141 if (i == 4) {
40142 if (this.conses[27].isConserved (this.cons2, j, this.size, this.includeGaps)) {
40143 currentColour = jalview.schemes.ClustalxColourScheme.colhash.get (java.awt.Color.PINK);
40144 }}if (this.conservationColouring) {
40145 currentColour = this.applyConservation (currentColour, j);
40146 }return currentColour;
40147 }, "~S,~N,jalview.datamodel.SequenceI");
40148 Clazz_defineMethod (c$, "isIncludeGaps", 
40149 function () {
40150 return this.includeGaps;
40151 });
40152 Clazz_defineMethod (c$, "setIncludeGaps", 
40153 function (includeGaps) {
40154 this.includeGaps = includeGaps;
40155 }, "~B");
40156 Clazz_overrideMethod (c$, "applyTo", 
40157 function (sg, hiddenRepSequences) {
40158 var css =  new jalview.schemes.ClustalxColourScheme (sg, hiddenRepSequences);
40159 css.includeGaps = this.includeGaps;
40160 return css;
40161 }, "jalview.datamodel.AnnotatedCollectionI,java.util.Map");
40162 Clazz_defineStatics (c$,
40163 "EIGHTY_FIVE", 85,
40164 "FIFTY", 50,
40165 "EIGHTY", 80,
40166 "SIXTY", 60);
40167 c$.colhash = c$.prototype.colhash =  new java.util.HashMap ();
40168 {
40169 jalview.schemes.ClustalxColourScheme.colhash.put (java.awt.Color.RED,  new java.awt.Color (0.9, 0.2, 0.1));
40170 jalview.schemes.ClustalxColourScheme.colhash.put (java.awt.Color.BLUE,  new java.awt.Color (0.5, 0.7, 0.9));
40171 jalview.schemes.ClustalxColourScheme.colhash.put (java.awt.Color.GREEN,  new java.awt.Color (0.1, 0.8, 0.1));
40172 jalview.schemes.ClustalxColourScheme.colhash.put (java.awt.Color.ORANGE,  new java.awt.Color (0.9, 0.6, 0.3));
40173 jalview.schemes.ClustalxColourScheme.colhash.put (java.awt.Color.CYAN,  new java.awt.Color (0.1, 0.7, 0.7));
40174 jalview.schemes.ClustalxColourScheme.colhash.put (java.awt.Color.PINK,  new java.awt.Color (0.9, 0.5, 0.5));
40175 jalview.schemes.ClustalxColourScheme.colhash.put (java.awt.Color.MAGENTA,  new java.awt.Color (0.8, 0.3, 0.8));
40176 jalview.schemes.ClustalxColourScheme.colhash.put (java.awt.Color.YELLOW,  new java.awt.Color (0.8, 0.8, 0.0));
40177 }c$ = Clazz_decorateAsClass (function () {
40178 this.conses = null;
40179 this.c = null;
40180 Clazz_instantialize (this, arguments);
40181 }, jalview.schemes, "ConsensusColour");
40182 Clazz_makeConstructor (c$, 
40183 function (c, conses) {
40184 this.conses = conses;
40185 this.c = c;
40186 }, "java.awt.Color,~A");
40187 });
40188 Clazz_declarePackage ("jalview.schemes");
40189 Clazz_load (null, "jalview.schemes.Consensus", ["jalview.schemes.ResidueProperties"], function () {
40190 c$ = Clazz_decorateAsClass (function () {
40191 this.mask = null;
40192 this.threshold = 0;
40193 this.maskstr = null;
40194 Clazz_instantialize (this, arguments);
40195 }, jalview.schemes, "Consensus");
40196 Clazz_makeConstructor (c$, 
40197 function (mask, threshold) {
40198 this.maskstr = mask;
40199 this.setMask (mask);
40200 this.threshold = threshold;
40201 }, "~S,~N");
40202 Clazz_defineMethod (c$, "setMask", 
40203 function (s) {
40204 this.mask = this.setNums (s);
40205 }, "~S");
40206 Clazz_defineMethod (c$, "isConserved", 
40207 function (cons2, col, size) {
40208 return this.isConserved (cons2, col, size, true);
40209 }, "~A,~N,~N");
40210 Clazz_defineMethod (c$, "isConserved", 
40211 function (cons2, col, size, includeGaps) {
40212 var tot = 0;
40213 if (!includeGaps) {
40214 size -= cons2[col][cons2[col].length - 1];
40215 }for (var i = 0; i < this.mask.length; i++) {
40216 tot += cons2[col][this.mask[i]];
40217 }
40218 if (tot > ((this.threshold * size) / 100)) {
40219 return true;
40220 }return false;
40221 }, "~A,~N,~N,~B");
40222 Clazz_defineMethod (c$, "setNums", 
40223 function (s) {
40224 var out =  Clazz_newIntArray (s.length, 0);
40225 var i = 0;
40226 while (i < s.length) {
40227 out[i] = jalview.schemes.ResidueProperties.aaIndex[s.charCodeAt (i)];
40228 i++;
40229 }
40230 return out;
40231 }, "~S");
40232 });
40233 Clazz_declarePackage ("jalview.schemes");
40234 Clazz_load (["jalview.schemes.ScoreColourScheme"], "jalview.schemes.HelixColourScheme", ["jalview.schemes.ResidueProperties", "java.awt.Color"], function () {
40235 c$ = Clazz_declareType (jalview.schemes, "HelixColourScheme", jalview.schemes.ScoreColourScheme);
40236 Clazz_makeConstructor (c$, 
40237 function () {
40238 Clazz_superConstructor (this, jalview.schemes.HelixColourScheme, [jalview.schemes.ResidueProperties.aaIndex, jalview.schemes.ResidueProperties.helix, 0.57, 1.51]);
40239 });
40240 Clazz_overrideMethod (c$, "makeColour", 
40241 function (c) {
40242 return  new java.awt.Color (c, 1.0 - c, c);
40243 }, "~N");
40244 });
40245 Clazz_declarePackage ("jalview.schemes");
40246 Clazz_load (["jalview.schemes.ScoreColourScheme"], "jalview.schemes.HydrophobicColourScheme", ["jalview.schemes.ResidueProperties", "java.awt.Color"], function () {
40247 c$ = Clazz_declareType (jalview.schemes, "HydrophobicColourScheme", jalview.schemes.ScoreColourScheme);
40248 Clazz_makeConstructor (c$, 
40249 function () {
40250 Clazz_superConstructor (this, jalview.schemes.HydrophobicColourScheme, [jalview.schemes.ResidueProperties.aaIndex, jalview.schemes.ResidueProperties.hyd, -3.9, 4.5]);
40251 });
40252 Clazz_overrideMethod (c$, "makeColour", 
40253 function (c) {
40254 return  new java.awt.Color (c, 0.0, 1.0 - c);
40255 }, "~N");
40256 });
40257 Clazz_declarePackage ("jalview.schemes");
40258 Clazz_load (["jalview.schemes.ResidueColourScheme"], "jalview.schemes.NucleotideColourScheme", ["jalview.schemes.ResidueProperties", "java.awt.Color"], function () {
40259 c$ = Clazz_declareType (jalview.schemes, "NucleotideColourScheme", jalview.schemes.ResidueColourScheme);
40260 Clazz_makeConstructor (c$, 
40261 function () {
40262 Clazz_superConstructor (this, jalview.schemes.NucleotideColourScheme, [jalview.schemes.ResidueProperties.nucleotideIndex, jalview.schemes.ResidueProperties.nucleotide, 0]);
40263 });
40264 Clazz_overrideMethod (c$, "findColour", 
40265 function (c) {
40266 return this.colors[jalview.schemes.ResidueProperties.nucleotideIndex[c.charCodeAt (0)]];
40267 }, "~S");
40268 Clazz_overrideMethod (c$, "findColourSeq", 
40269 function (c, j, seq) {
40270 var currentColour;
40271 if ((this.threshold == 0) || this.aboveThreshold (c, j)) {
40272 try {
40273 currentColour = this.colors[jalview.schemes.ResidueProperties.nucleotideIndex[c.charCodeAt (0)]];
40274 } catch (ex) {
40275 if (Clazz_exceptionOf (ex, Exception)) {
40276 return java.awt.Color.white;
40277 } else {
40278 throw ex;
40279 }
40280 }
40281 } else {
40282 return java.awt.Color.white;
40283 }if (this.conservationColouring) {
40284 currentColour = this.applyConservation (currentColour, j);
40285 }return currentColour;
40286 }, "~S,~N,jalview.datamodel.SequenceI");
40287 });
40288 Clazz_declarePackage ("jalview.schemes");
40289 Clazz_load (["jalview.schemes.ResidueColourScheme"], "jalview.schemes.PurinePyrimidineColourScheme", ["jalview.schemes.ResidueProperties", "java.awt.Color"], function () {
40290 c$ = Clazz_declareType (jalview.schemes, "PurinePyrimidineColourScheme", jalview.schemes.ResidueColourScheme);
40291 Clazz_makeConstructor (c$, 
40292 function () {
40293 Clazz_superConstructor (this, jalview.schemes.PurinePyrimidineColourScheme, [jalview.schemes.ResidueProperties.purinepyrimidineIndex, jalview.schemes.ResidueProperties.purinepyrimidine, 0]);
40294 });
40295 Clazz_defineMethod (c$, "findColour", 
40296 function (c) {
40297 return this.colors[jalview.schemes.ResidueProperties.purinepyrimidineIndex[c.charCodeAt (0)]];
40298 }, "~S");
40299 Clazz_defineMethod (c$, "findColour", 
40300 function (c, j) {
40301 var currentColour;
40302 if ((this.threshold == 0) || this.aboveThreshold (c, j)) {
40303 try {
40304 currentColour = this.colors[jalview.schemes.ResidueProperties.purinepyrimidineIndex[c.charCodeAt (0)]];
40305 } catch (ex) {
40306 if (Clazz_exceptionOf (ex, Exception)) {
40307 return java.awt.Color.white;
40308 } else {
40309 throw ex;
40310 }
40311 }
40312 } else {
40313 return java.awt.Color.white;
40314 }if (this.conservationColouring) {
40315 currentColour = this.applyConservation (currentColour, j);
40316 }return currentColour;
40317 }, "~S,~N");
40318 });
40319 Clazz_declarePackage ("jalview.schemes");
40320 Clazz_load (["jalview.schemes.ResidueColourScheme", "java.util.Hashtable"], "jalview.schemes.RNAHelicesColour", ["jalview.schemes.ResidueProperties", "jalview.util.ColorUtils", "java.awt.Color"], function () {
40321 c$ = Clazz_decorateAsClass (function () {
40322 this.helixcolorhash = null;
40323 this.positionsToHelix = null;
40324 this.numHelix = 0;
40325 this.annotation = null;
40326 this.lastrefresh = -1;
40327 Clazz_instantialize (this, arguments);
40328 }, jalview.schemes, "RNAHelicesColour", jalview.schemes.ResidueColourScheme);
40329 Clazz_prepareFields (c$, function () {
40330 this.helixcolorhash =  new java.util.Hashtable ();
40331 this.positionsToHelix =  new java.util.Hashtable ();
40332 });
40333 Clazz_makeConstructor (c$, 
40334 function (annotation) {
40335 Clazz_superConstructor (this, jalview.schemes.RNAHelicesColour, [jalview.schemes.ResidueProperties.nucleotideIndex]);
40336 this.annotation = annotation;
40337 this.refresh ();
40338 }, "jalview.datamodel.AlignmentAnnotation");
40339 Clazz_makeConstructor (c$, 
40340 function (alignment) {
40341 Clazz_superConstructor (this, jalview.schemes.RNAHelicesColour, [jalview.schemes.ResidueProperties.nucleotideIndex]);
40342 this.alignmentChanged (alignment, null);
40343 }, "jalview.datamodel.AnnotatedCollectionI");
40344 Clazz_overrideMethod (c$, "alignmentChanged", 
40345 function (alignment, hiddenReps) {
40346 var annotations = alignment.getAlignmentAnnotation ();
40347 for (var i = 0; i < annotations.length; i++) {
40348 if (annotations[i].getRNAStruc () != null) {
40349 this.annotation = annotations[i];
40350 break;
40351 }}
40352 this.refresh ();
40353 }, "jalview.datamodel.AnnotatedCollectionI,java.util.Map");
40354 Clazz_defineMethod (c$, "refresh", 
40355 function () {
40356 if (this.annotation != null && ((this.annotation._rnasecstr == null || this.lastrefresh != this.annotation._rnasecstr.hashCode ()) && this.annotation.isValidStruc ())) {
40357 this.annotation.getRNAStruc ();
40358 this.lastrefresh = this.annotation._rnasecstr.hashCode ();
40359 this.numHelix = 0;
40360 this.positionsToHelix =  new java.util.Hashtable ();
40361 for (var x = 0; x < this.annotation._rnasecstr.length; x++) {
40362 this.positionsToHelix.put (new Integer (this.annotation._rnasecstr[x].getBegin ()), this.annotation._rnasecstr[x].getFeatureGroup ());
40363 this.positionsToHelix.put (new Integer (this.annotation._rnasecstr[x].getEnd ()), this.annotation._rnasecstr[x].getFeatureGroup ());
40364 if (Integer.parseInt (this.annotation._rnasecstr[x].getFeatureGroup ()) > this.numHelix) {
40365 this.numHelix = Integer.parseInt (this.annotation._rnasecstr[x].getFeatureGroup ());
40366 }}
40367 for (var j = 0; j <= this.numHelix; j++) {
40368 if (!this.helixcolorhash.containsKey (Integer.toString (j))) {
40369 this.helixcolorhash.put (Integer.toString (j), jalview.util.ColorUtils.generateRandomColor (java.awt.Color.white));
40370 }}
40371 }});
40372 Clazz_overrideMethod (c$, "findColour", 
40373 function (c) {
40374 return jalview.schemes.ResidueProperties.purinepyrimidine[jalview.schemes.ResidueProperties.purinepyrimidineIndex[c.charCodeAt (0)]];
40375 }, "~S");
40376 Clazz_overrideMethod (c$, "findColourSeq", 
40377 function (c, j, seq) {
40378 this.refresh ();
40379 var currentColour = java.awt.Color.white;
40380 var currentHelix = null;
40381 currentHelix = this.positionsToHelix.get (new Integer (j));
40382 if (currentHelix != null) {
40383 currentColour = this.helixcolorhash.get (currentHelix);
40384 }return currentColour;
40385 }, "~S,~N,jalview.datamodel.SequenceI");
40386 });
40387 Clazz_declarePackage ("jalview.util");
40388 Clazz_load (null, "jalview.util.ColorUtils", ["java.awt.Color", "java.util.Random"], function () {
40389 c$ = Clazz_declareType (jalview.util, "ColorUtils");
40390 c$.generateRandomColor = Clazz_defineMethod (c$, "generateRandomColor", 
40391 function (mix) {
40392 var random =  new java.util.Random ();
40393 var red = random.nextInt (256);
40394 var green = random.nextInt (256);
40395 var blue = random.nextInt (256);
40396 if (mix != null) {
40397 red = Clazz_doubleToInt ((red + mix.getRed ()) / 2);
40398 green = Clazz_doubleToInt ((green + mix.getGreen ()) / 2);
40399 blue = Clazz_doubleToInt ((blue + mix.getBlue ()) / 2);
40400 }var color =  new java.awt.Color (red, green, blue);
40401 return color;
40402 }, "java.awt.Color");
40403 c$.toTkCode = Clazz_defineMethod (c$, "toTkCode", 
40404 function (colour) {
40405 var colstring = "#" + ((colour.getRed () < 16) ? "0" : "") + Integer.toHexString (colour.getRed ()) + ((colour.getGreen () < 16) ? "0" : "") + Integer.toHexString (colour.getGreen ()) + ((colour.getBlue () < 16) ? "0" : "") + Integer.toHexString (colour.getBlue ());
40406 return colstring;
40407 }, "java.awt.Color");
40408 c$.darkerThan = Clazz_defineMethod (c$, "darkerThan", 
40409 function (col) {
40410 return col == null ? null : col.darker ().darker ().darker ();
40411 }, "java.awt.Color");
40412 c$.brighterThan = Clazz_defineMethod (c$, "brighterThan", 
40413 function (col) {
40414 return col == null ? null : col.brighter ().brighter ().brighter ();
40415 }, "java.awt.Color");
40416 });
40417 Clazz_declarePackage ("jalview.schemes");
40418 Clazz_load (["jalview.schemes.ScoreColourScheme"], "jalview.schemes.StrandColourScheme", ["jalview.schemes.ResidueProperties", "java.awt.Color"], function () {
40419 c$ = Clazz_declareType (jalview.schemes, "StrandColourScheme", jalview.schemes.ScoreColourScheme);
40420 Clazz_makeConstructor (c$, 
40421 function () {
40422 Clazz_superConstructor (this, jalview.schemes.StrandColourScheme, [jalview.schemes.ResidueProperties.aaIndex, jalview.schemes.ResidueProperties.strand, 0.37, 1.7]);
40423 });
40424 Clazz_overrideMethod (c$, "makeColour", 
40425 function (c) {
40426 return  new java.awt.Color (c, c, 1.0 - c);
40427 }, "~N");
40428 });
40429 Clazz_declarePackage ("jalview.schemes");
40430 Clazz_load (["jalview.schemes.ResidueColourScheme", "java.awt.Color"], "jalview.schemes.TCoffeeColourScheme", ["jalview.datamodel.AlignmentI", "java.util.ArrayList", "$.IdentityHashMap"], function () {
40431 c$ = Clazz_decorateAsClass (function () {
40432 this.seqMap = null;
40433 Clazz_instantialize (this, arguments);
40434 }, jalview.schemes, "TCoffeeColourScheme", jalview.schemes.ResidueColourScheme);
40435 Clazz_makeConstructor (c$, 
40436 function (alignment) {
40437 Clazz_superConstructor (this, jalview.schemes.TCoffeeColourScheme, []);
40438 this.alignmentChanged (alignment, null);
40439 }, "jalview.datamodel.AnnotatedCollectionI");
40440 Clazz_overrideMethod (c$, "alignmentChanged", 
40441 function (alignment, hiddenReps) {
40442 var annots =  new java.util.ArrayList ();
40443 this.seqMap =  new java.util.IdentityHashMap ();
40444 var alcontext = Clazz_instanceOf (alignment, jalview.datamodel.AlignmentI) ? alignment : alignment.getContext ();
40445 var w = 0;
40446 for (var al, $al = alcontext.findAnnotation ("TCoffeeScore").iterator (); $al.hasNext () && ((al = $al.next ()) || true);) {
40447 if (al.sequenceRef != null && !al.belowAlignment) {
40448 annots.add (al);
40449 if (w < al.annotations.length) {
40450 w = al.annotations.length;
40451 }var scores =  new Array (al.annotations.length);
40452 var i = 0;
40453 for (var an, $an = 0, $$an = al.annotations; $an < $$an.length && ((an = $$an[$an]) || true); $an++) {
40454 scores[i++] = (an != null) ? an.colour : java.awt.Color.white;
40455 }
40456 this.seqMap.put (al.sequenceRef, scores);
40457 }}
40458 }, "jalview.datamodel.AnnotatedCollectionI,java.util.Map");
40459 Clazz_overrideMethod (c$, "findColourSeq", 
40460 function (c, j, seq) {
40461 var cols;
40462 if (this.seqMap == null || (cols = this.seqMap.get (seq)) == null) {
40463 return java.awt.Color.white;
40464 }if (j < 0 || j >= cols.length) {
40465 return java.awt.Color.white;
40466 }return cols[j];
40467 }, "~S,~N,jalview.datamodel.SequenceI");
40468 Clazz_overrideMethod (c$, "applyTo", 
40469 function (sg, hiddenRepSequences) {
40470 return  new jalview.schemes.TCoffeeColourScheme (sg);
40471 }, "jalview.datamodel.AnnotatedCollectionI,java.util.Map");
40472 c$.$colors = c$.prototype.$colors =  Clazz_newArray (-1, [ new java.awt.Color (102, 102, 255),  new java.awt.Color (0, 255, 0),  new java.awt.Color (102, 255, 0),  new java.awt.Color (204, 255, 0),  new java.awt.Color (255, 255, 0),  new java.awt.Color (255, 204, 0),  new java.awt.Color (255, 153, 0),  new java.awt.Color (255, 102, 0),  new java.awt.Color (255, 51, 0),  new java.awt.Color (255, 34, 0)]);
40473 });
40474 Clazz_declarePackage ("jalview.schemes");
40475 Clazz_load (["jalview.schemes.ResidueColourScheme"], "jalview.schemes.TaylorColourScheme", ["jalview.schemes.ResidueProperties"], function () {
40476 c$ = Clazz_declareType (jalview.schemes, "TaylorColourScheme", jalview.schemes.ResidueColourScheme);
40477 Clazz_makeConstructor (c$, 
40478 function () {
40479 Clazz_superConstructor (this, jalview.schemes.TaylorColourScheme, [jalview.schemes.ResidueProperties.aaIndex, jalview.schemes.ResidueProperties.taylor, 0]);
40480 });
40481 });
40482 Clazz_declarePackage ("jalview.schemes");
40483 Clazz_load (["jalview.schemes.ScoreColourScheme"], "jalview.schemes.TurnColourScheme", ["jalview.schemes.ResidueProperties", "java.awt.Color"], function () {
40484 c$ = Clazz_declareType (jalview.schemes, "TurnColourScheme", jalview.schemes.ScoreColourScheme);
40485 Clazz_makeConstructor (c$, 
40486 function () {
40487 Clazz_superConstructor (this, jalview.schemes.TurnColourScheme, [jalview.schemes.ResidueProperties.aaIndex, jalview.schemes.ResidueProperties.turn, 0.47, 1.56]);
40488 });
40489 Clazz_overrideMethod (c$, "makeColour", 
40490 function (c) {
40491 return  new java.awt.Color (c, 1 - c, 1 - c);
40492 }, "~N");
40493 });
40494 Clazz_declarePackage ("jalview.schemes");
40495 Clazz_load (["jalview.schemes.ResidueColourScheme"], "jalview.schemes.UserColourScheme", ["jalview.schemes.ColourSchemeProperty", "$.ResidueProperties", "java.awt.Color", "java.util.StringTokenizer"], function () {
40496 c$ = Clazz_decorateAsClass (function () {
40497 this.lowerCaseColours = null;
40498 this.schemeName = null;
40499 Clazz_instantialize (this, arguments);
40500 }, jalview.schemes, "UserColourScheme", jalview.schemes.ResidueColourScheme);
40501 Clazz_makeConstructor (c$, 
40502 function () {
40503 Clazz_superConstructor (this, jalview.schemes.UserColourScheme, [jalview.schemes.ResidueProperties.aaIndex]);
40504 });
40505 Clazz_makeConstructor (c$, 
40506 function (newColors) {
40507 Clazz_superConstructor (this, jalview.schemes.UserColourScheme, [jalview.schemes.ResidueProperties.aaIndex]);
40508 this.colors = newColors;
40509 }, "~A");
40510 Clazz_overrideMethod (c$, "applyTo", 
40511 function (sg, hiddenRepSequences) {
40512 var usc =  new jalview.schemes.UserColourScheme (this.colors);
40513 if (this.lowerCaseColours != null) {
40514 usc.schemeName =  String.instantialize (this.schemeName);
40515 usc.lowerCaseColours =  new Array (this.lowerCaseColours.length);
40516 System.arraycopy (this.lowerCaseColours, 0, usc.lowerCaseColours, 0, this.lowerCaseColours.length);
40517 }return usc;
40518 }, "jalview.datamodel.AnnotatedCollectionI,java.util.Map");
40519 Clazz_makeConstructor (c$, 
40520 function (colour) {
40521 Clazz_superConstructor (this, jalview.schemes.UserColourScheme, [jalview.schemes.ResidueProperties.aaIndex]);
40522 var col = this.getColourFromString (colour);
40523 if (col == null) {
40524 System.out.println ("Unknown colour!! " + colour);
40525 col = this.createColourFromName (colour);
40526 }this.colors =  new Array (24);
40527 for (var i = 0; i < 24; i++) {
40528 this.colors[i] = col;
40529 }
40530 this.schemeName = colour;
40531 }, "~S");
40532 Clazz_defineMethod (c$, "getColours", 
40533 function () {
40534 return this.colors;
40535 });
40536 Clazz_defineMethod (c$, "getLowerCaseColours", 
40537 function () {
40538 return this.lowerCaseColours;
40539 });
40540 Clazz_defineMethod (c$, "setName", 
40541 function (name) {
40542 this.schemeName = name;
40543 }, "~S");
40544 Clazz_defineMethod (c$, "getName", 
40545 function () {
40546 return this.schemeName;
40547 });
40548 Clazz_defineMethod (c$, "getColourFromString", 
40549 function (colour) {
40550 colour = colour.trim ();
40551 var col = null;
40552 try {
40553 var value = Integer.parseInt (colour, 16);
40554 col =  new java.awt.Color (value);
40555 } catch (ex) {
40556 if (Clazz_exceptionOf (ex, NumberFormatException)) {
40557 } else {
40558 throw ex;
40559 }
40560 }
40561 if (col == null) {
40562 col = jalview.schemes.ColourSchemeProperty.getAWTColorFromName (colour);
40563 }if (col == null) {
40564 try {
40565 var st =  new java.util.StringTokenizer (colour, ",");
40566 var r = Integer.parseInt (st.nextToken ());
40567 var g = Integer.parseInt (st.nextToken ());
40568 var b = Integer.parseInt (st.nextToken ());
40569 col =  new java.awt.Color (r, g, b);
40570 } catch (ex) {
40571 if (Clazz_exceptionOf (ex, Exception)) {
40572 } else {
40573 throw ex;
40574 }
40575 }
40576 }return col;
40577 }, "~S");
40578 Clazz_defineMethod (c$, "createColourFromName", 
40579 function (name) {
40580 var r;
40581 var g;
40582 var b;
40583 var lsize = name.length;
40584 var start = 0;
40585 var end = Clazz_doubleToInt (lsize / 3);
40586 var rgbOffset = Math.abs (name.hashCode () % 10) * 15;
40587 r = Math.abs (name.substring (start, end).hashCode () + rgbOffset) % 210 + 20;
40588 start = end;
40589 end += Clazz_doubleToInt (lsize / 3);
40590 if (end > lsize) {
40591 end = lsize;
40592 }g = Math.abs (name.substring (start, end).hashCode () + rgbOffset) % 210 + 20;
40593 b = Math.abs (name.substring (end).hashCode () + rgbOffset) % 210 + 20;
40594 var color =  new java.awt.Color (r, g, b);
40595 return color;
40596 }, "~S");
40597 Clazz_defineMethod (c$, "parseAppletParameter", 
40598 function (paramValue) {
40599 var st =  new java.util.StringTokenizer (paramValue, ";");
40600 var st2;
40601 var token = null;
40602 var colour;
40603 var residues;
40604 try {
40605 while (st.hasMoreElements ()) {
40606 token = st.nextToken ().trim ();
40607 residues = token.substring (0, token.indexOf ("="));
40608 colour = token.substring (token.indexOf ("=") + 1);
40609 st2 =  new java.util.StringTokenizer (residues, " ,");
40610 while (st2.hasMoreTokens ()) {
40611 token = st2.nextToken ();
40612 if (jalview.schemes.ResidueProperties.aaIndex[token.charCodeAt (0)] == -1) {
40613 continue;
40614 }var colIndex = jalview.schemes.ResidueProperties.aaIndex[token.charCodeAt (0)];
40615 if (token.equalsIgnoreCase ("lowerCase")) {
40616 if (this.lowerCaseColours == null) {
40617 this.lowerCaseColours =  new Array (23);
40618 }for (var i = 0; i < 23; i++) {
40619 if (this.lowerCaseColours[i] == null) {
40620 this.lowerCaseColours[i] = this.getColourFromString (colour);
40621 }}
40622 continue;
40623 }if (token.equals (token.toLowerCase ())) {
40624 if (this.lowerCaseColours == null) {
40625 this.lowerCaseColours =  new Array (23);
40626 }this.lowerCaseColours[colIndex] = this.getColourFromString (colour);
40627 } else {
40628 this.colors[colIndex] = this.getColourFromString (colour);
40629 }}
40630 }
40631 } catch (ex) {
40632 if (Clazz_exceptionOf (ex, Exception)) {
40633 System.out.println ("Error parsing userDefinedColours:\n" + token + "\n" + ex);
40634 } else {
40635 throw ex;
40636 }
40637 }
40638 }, "~S");
40639 Clazz_overrideMethod (c$, "findColourSeq", 
40640 function (c, j, seq) {
40641 var currentColour;
40642 var index = jalview.schemes.ResidueProperties.aaIndex[c.charCodeAt (0)];
40643 if ((this.threshold == 0) || this.aboveThreshold (c, j)) {
40644 if (this.lowerCaseColours != null && 'a' <= c && c <= 'z') {
40645 currentColour = this.lowerCaseColours[index];
40646 } else {
40647 currentColour = this.colors[index];
40648 }} else {
40649 currentColour = java.awt.Color.white;
40650 }if (this.conservationColouring) {
40651 currentColour = this.applyConservation (currentColour, j);
40652 }return currentColour;
40653 }, "~S,~N,jalview.datamodel.SequenceI");
40654 Clazz_defineMethod (c$, "setLowerCaseColours", 
40655 function (lcolours) {
40656 this.lowerCaseColours = lcolours;
40657 }, "~A");
40658 });
40659 Clazz_declarePackage ("jalview.schemes");
40660 Clazz_load (["jalview.schemes.ResidueColourScheme"], "jalview.schemes.ZappoColourScheme", ["jalview.schemes.ResidueProperties"], function () {
40661 c$ = Clazz_declareType (jalview.schemes, "ZappoColourScheme", jalview.schemes.ResidueColourScheme);
40662 Clazz_makeConstructor (c$, 
40663 function () {
40664 Clazz_superConstructor (this, jalview.schemes.ZappoColourScheme, [jalview.schemes.ResidueProperties.aaIndex, jalview.schemes.ResidueProperties.zappo, 0]);
40665 });
40666 });
40667 Clazz_declarePackage ("jalview.structure");
40668 Clazz_load (["java.util.ArrayList", "$.HashMap", "$.LinkedHashSet", "$.Vector"], "jalview.structure.StructureSelectionManager", ["MCview.PDBfile", "jalview.analysis.AlignSeq", "jalview.commands.EditCommand", "$.OrderCommand", "jalview.datamodel.Mapping", "$.SearchResults", "jalview.io.AppletFormatAdapter", "jalview.structure.AtomSpec", "$.SecondaryStructureListener", "$.SequenceListener", "$.StructureListener", "$.StructureMapping", "$.VamsasListener", "jalview.util.MappingUtils", "$.MessageManager", "java.lang.Error", "$.NullPointerException", "$.StringBuilder", "java.util.Arrays", "$.Collections", "$.IdentityHashMap"], function () {
40669 c$ = Clazz_decorateAsClass (function () {
40670 this.mappings = null;
40671 this.processSecondaryStructure = false;
40672 this.secStructServices = false;
40673 this.addTempFacAnnot = false;
40674 this.seqmappings = null;
40675 this.seqMappingRefCounts = null;
40676 this.commandListeners = null;
40677 this.sel_listeners = null;
40678 this.pdbIdFileName = null;
40679 this.pdbFileNameId = null;
40680 this.relaySeqMappings = true;
40681 this.listeners = null;
40682 this.handlingVamsasMo = false;
40683 this.lastmsg = 0;
40684 this.view_listeners = null;
40685 Clazz_instantialize (this, arguments);
40686 }, jalview.structure, "StructureSelectionManager");
40687 Clazz_prepareFields (c$, function () {
40688 this.mappings =  new java.util.ArrayList ();
40689 this.seqmappings =  new java.util.LinkedHashSet ();
40690 this.seqMappingRefCounts =  new java.util.HashMap ();
40691 this.commandListeners =  new java.util.ArrayList ();
40692 this.sel_listeners =  new java.util.ArrayList ();
40693 this.pdbIdFileName =  new java.util.HashMap ();
40694 this.pdbFileNameId =  new java.util.HashMap ();
40695 this.listeners =  new java.util.Vector ();
40696 this.view_listeners =  new java.util.Vector ();
40697 });
40698 Clazz_defineMethod (c$, "isSecStructServices", 
40699 function () {
40700 return this.secStructServices;
40701 });
40702 Clazz_defineMethod (c$, "setSecStructServices", 
40703 function (secStructServices) {
40704 this.secStructServices = secStructServices;
40705 }, "~B");
40706 Clazz_defineMethod (c$, "isAddTempFacAnnot", 
40707 function () {
40708 return this.addTempFacAnnot;
40709 });
40710 Clazz_defineMethod (c$, "setAddTempFacAnnot", 
40711 function (addTempFacAnnot) {
40712 this.addTempFacAnnot = addTempFacAnnot;
40713 }, "~B");
40714 Clazz_defineMethod (c$, "isProcessSecondaryStructure", 
40715 function () {
40716 return this.processSecondaryStructure;
40717 });
40718 Clazz_defineMethod (c$, "setProcessSecondaryStructure", 
40719 function (enable) {
40720 this.processSecondaryStructure = enable;
40721 }, "~B");
40722 Clazz_defineMethod (c$, "reportMapping", 
40723 function () {
40724 if (this.mappings.isEmpty ()) {
40725 System.err.println ("reportMapping: No PDB/Sequence mappings.");
40726 } else {
40727 System.err.println ("reportMapping: There are " + this.mappings.size () + " mappings.");
40728 var i = 0;
40729 for (var sm, $sm = this.mappings.iterator (); $sm.hasNext () && ((sm = $sm.next ()) || true);) {
40730 System.err.println ("mapping " + i++ + " : " + sm.pdbfile);
40731 }
40732 }});
40733 Clazz_defineMethod (c$, "registerPDBFile", 
40734 function (idForFile, absoluteFile) {
40735 this.pdbIdFileName.put (idForFile, absoluteFile);
40736 this.pdbFileNameId.put (absoluteFile, idForFile);
40737 }, "~S,~S");
40738 Clazz_defineMethod (c$, "findIdForPDBFile", 
40739 function (idOrFile) {
40740 var id = this.pdbFileNameId.get (idOrFile);
40741 return id;
40742 }, "~S");
40743 Clazz_defineMethod (c$, "findFileForPDBId", 
40744 function (idOrFile) {
40745 var id = this.pdbIdFileName.get (idOrFile);
40746 return id;
40747 }, "~S");
40748 Clazz_defineMethod (c$, "isPDBFileRegistered", 
40749 function (idOrFile) {
40750 return this.pdbFileNameId.containsKey (idOrFile) || this.pdbIdFileName.containsKey (idOrFile);
40751 }, "~S");
40752 c$.getStructureSelectionManager = Clazz_defineMethod (c$, "getStructureSelectionManager", 
40753 function (context) {
40754 if (context == null) {
40755 if (jalview.structure.StructureSelectionManager.nullProvider == null) {
40756 if (jalview.structure.StructureSelectionManager.instances != null) {
40757 throw  new Error (jalview.util.MessageManager.getString ("error.implementation_error_structure_selection_manager_null"),  new NullPointerException (jalview.util.MessageManager.getString ("exception.ssm_context_is_null")));
40758 } else {
40759 jalview.structure.StructureSelectionManager.nullProvider =  new jalview.structure.StructureSelectionManager ();
40760 }return jalview.structure.StructureSelectionManager.nullProvider;
40761 }}if (jalview.structure.StructureSelectionManager.instances == null) {
40762 jalview.structure.StructureSelectionManager.instances =  new java.util.IdentityHashMap ();
40763 }var instance = jalview.structure.StructureSelectionManager.instances.get (context);
40764 if (instance == null) {
40765 if (jalview.structure.StructureSelectionManager.nullProvider != null) {
40766 instance = jalview.structure.StructureSelectionManager.nullProvider;
40767 } else {
40768 instance =  new jalview.structure.StructureSelectionManager ();
40769 }jalview.structure.StructureSelectionManager.instances.put (context, instance);
40770 }return instance;
40771 }, "jalview.api.StructureSelectionManagerProvider");
40772 Clazz_defineMethod (c$, "setRelaySeqMappings", 
40773 function (relay) {
40774 this.relaySeqMappings = relay;
40775 }, "~B");
40776 Clazz_defineMethod (c$, "isRelaySeqMappingsEnabled", 
40777 function () {
40778 return this.relaySeqMappings;
40779 });
40780 Clazz_defineMethod (c$, "addStructureViewerListener", 
40781 function (svl) {
40782 if (!this.listeners.contains (svl)) {
40783 this.listeners.addElement (svl);
40784 }}, "~O");
40785 Clazz_defineMethod (c$, "alreadyMappedToFile", 
40786 function (pdbid) {
40787 for (var sm, $sm = this.mappings.iterator (); $sm.hasNext () && ((sm = $sm.next ()) || true);) {
40788 if (sm.getPdbId ().equals (pdbid)) {
40789 return sm.pdbfile;
40790 }}
40791 return null;
40792 }, "~S");
40793 Clazz_defineMethod (c$, "setMapping", 
40794 function (sequence, targetChains, pdbFile, protocol) {
40795 return this.setMapping (true, sequence, targetChains, pdbFile, protocol);
40796 }, "~A,~A,~S,~S");
40797 Clazz_defineMethod (c$, "setMapping", 
40798 function (forStructureView, sequence, targetChains, pdbFile, protocol) {
40799 var parseSecStr = this.processSecondaryStructure;
40800 if (this.isPDBFileRegistered (pdbFile)) {
40801 for (var sq, $sq = 0, $$sq = sequence; $sq < $$sq.length && ((sq = $$sq[$sq]) || true); $sq++) {
40802 var ds = sq;
40803 while (ds.getDatasetSequence () != null) {
40804 ds = ds.getDatasetSequence ();
40805 }
40806 ;if (ds.getAnnotation () != null) {
40807 for (var ala, $ala = 0, $$ala = ds.getAnnotation (); $ala < $$ala.length && ((ala = $$ala[$ala]) || true); $ala++) {
40808 if (MCview.PDBfile.isCalcIdForFile (ala, this.findIdForPDBFile (pdbFile))) {
40809 parseSecStr = false;
40810 }}
40811 }}
40812 }var pdb = null;
40813 try {
40814 pdb =  new MCview.PDBfile (this.addTempFacAnnot, parseSecStr, this.secStructServices, pdbFile, protocol);
40815 if (pdb.id != null && pdb.id.trim ().length > 0 && jalview.io.AppletFormatAdapter.FILE.equals (protocol)) {
40816 this.registerPDBFile (pdb.id.trim (), pdbFile);
40817 }} catch (ex) {
40818 if (Clazz_exceptionOf (ex, Exception)) {
40819 ex.printStackTrace ();
40820 return null;
40821 } else {
40822 throw ex;
40823 }
40824 }
40825 var targetChain;
40826 for (var s = 0; s < sequence.length; s++) {
40827 var infChain = true;
40828 var seq = sequence[s];
40829 if (targetChains != null && targetChains[s] != null) {
40830 infChain = false;
40831 targetChain = targetChains[s];
40832 } else if (seq.getName ().indexOf ("|") > -1) {
40833 targetChain = seq.getName ().substring (seq.getName ().lastIndexOf ("|") + 1);
40834 if (targetChain.length > 1) {
40835 if (targetChain.trim ().length == 0) {
40836 targetChain = " ";
40837 } else {
40838 targetChain = "";
40839 }}} else {
40840 targetChain = "";
40841 }var max = -10;
40842 var maxAlignseq = null;
40843 var maxChainId = " ";
40844 var maxChain = null;
40845 var first = true;
40846 for (var chain, $chain = pdb.chains.iterator (); $chain.hasNext () && ((chain = $chain.next ()) || true);) {
40847 if (targetChain.length > 0 && !targetChain.equals (chain.id) && !infChain) {
40848 continue;
40849 }var type = chain.isNa ? "dna" : "pep";
40850 var as = jalview.analysis.AlignSeq.doGlobalNWAlignment (seq, chain.sequence, type);
40851 if (first || as.maxscore > max || (as.maxscore == max && chain.id.equals (targetChain))) {
40852 first = false;
40853 maxChain = chain;
40854 max = as.maxscore;
40855 maxAlignseq = as;
40856 maxChainId = chain.id;
40857 }}
40858 if (maxChain == null) {
40859 continue;
40860 }var mappingDetails =  new StringBuilder (128);
40861 mappingDetails.append (jalview.structure.StructureSelectionManager.NEWLINE).append ("PDB Sequence is :").append (jalview.structure.StructureSelectionManager.NEWLINE).append ("Sequence = ").append (maxChain.sequence.getSequenceAsString ());
40862 mappingDetails.append (jalview.structure.StructureSelectionManager.NEWLINE).append ("No of residues = ").append (maxChain.residues.size ()).append (jalview.structure.StructureSelectionManager.NEWLINE).append (jalview.structure.StructureSelectionManager.NEWLINE);
40863 var ps = ((Clazz_isClassDefined ("jalview.structure.StructureSelectionManager$1") ? 0 : jalview.structure.StructureSelectionManager.$StructureSelectionManager$1$ ()), Clazz_innerTypeInstance (jalview.structure.StructureSelectionManager$1, this, Clazz_cloneFinals ("mappingDetails", mappingDetails), System.out));
40864 maxAlignseq.printAlignment (ps);
40865 mappingDetails.append (jalview.structure.StructureSelectionManager.NEWLINE).append ("PDB start/end ");
40866 mappingDetails.append (String.valueOf (maxAlignseq.seq2start)).append (" ");
40867 mappingDetails.append (String.valueOf (maxAlignseq.seq2end));
40868 mappingDetails.append (jalview.structure.StructureSelectionManager.NEWLINE).append ("SEQ start/end ");
40869 mappingDetails.append (String.valueOf (maxAlignseq.seq1start + seq.getStart () - 1)).append (" ");
40870 mappingDetails.append (String.valueOf (maxAlignseq.seq1end + seq.getEnd () - 1));
40871 maxChain.makeExactMapping (maxAlignseq, seq);
40872 var sqmpping = maxAlignseq.getMappingFromS1 (false);
40873 var omap =  new jalview.datamodel.Mapping (sqmpping.getMap ().getInverse ());
40874 maxChain.transferRESNUMFeatures (seq, null);
40875 var mapping =  Clazz_newIntArray (seq.findPosition (seq.getLength ()) + 2, 2, 0);
40876 var resNum = -10000;
40877 var index = 0;
40878 do {
40879 var tmp = maxChain.atoms.elementAt (index);
40880 if (resNum != tmp.resNumber && tmp.alignmentMapping != -1) {
40881 resNum = tmp.resNumber;
40882 mapping[tmp.alignmentMapping + 1][0] = tmp.resNumber;
40883 mapping[tmp.alignmentMapping + 1][1] = tmp.atomIndex;
40884 }index++;
40885 } while (index < maxChain.atoms.size ());
40886 if (protocol.equals (jalview.io.AppletFormatAdapter.PASTE)) {
40887 pdbFile = "INLINE" + pdb.id;
40888 }var newMapping =  new jalview.structure.StructureMapping (seq, pdbFile, pdb.id, maxChainId, mapping, mappingDetails.toString ());
40889 if (forStructureView) {
40890 this.mappings.add (newMapping);
40891 }maxChain.transferResidueAnnotation (newMapping, sqmpping);
40892 }
40893 return pdb;
40894 }, "~B,~A,~A,~S,~S");
40895 Clazz_defineMethod (c$, "removeStructureViewerListener", 
40896 function (svl, pdbfiles) {
40897 this.listeners.removeElement (svl);
40898 if (Clazz_instanceOf (svl, jalview.structure.SequenceListener)) {
40899 for (var i = 0; i < this.listeners.size (); i++) {
40900 if (Clazz_instanceOf (this.listeners.elementAt (i), jalview.structure.StructureListener)) {
40901 (this.listeners.elementAt (i)).releaseReferences (svl);
40902 }}
40903 }if (pdbfiles == null) {
40904 return;
40905 }var pdbs =  new java.util.ArrayList (java.util.Arrays.asList (pdbfiles));
40906 var sl;
40907 for (var i = 0; i < this.listeners.size (); i++) {
40908 if (Clazz_instanceOf (this.listeners.elementAt (i), jalview.structure.StructureListener)) {
40909 sl = this.listeners.elementAt (i);
40910 for (var pdbfile, $pdbfile = 0, $$pdbfile = sl.getPdbFile (); $pdbfile < $$pdbfile.length && ((pdbfile = $$pdbfile[$pdbfile]) || true); $pdbfile++) {
40911 pdbs.remove (pdbfile);
40912 }
40913 }}
40914 if (pdbs.size () > 0) {
40915 var tmp =  new java.util.ArrayList ();
40916 for (var sm, $sm = this.mappings.iterator (); $sm.hasNext () && ((sm = $sm.next ()) || true);) {
40917 if (!pdbs.contains (sm.pdbfile)) {
40918 tmp.add (sm);
40919 }}
40920 this.mappings = tmp;
40921 }}, "~O,~A");
40922 Clazz_defineMethod (c$, "mouseOverStructure", 
40923 function (pdbResNum, chain, pdbfile) {
40924 var atomSpec =  new jalview.structure.AtomSpec (pdbfile, chain, pdbResNum, 0);
40925 var atoms = java.util.Collections.singletonList (atomSpec);
40926 this.mouseOverStructure (atoms);
40927 }, "~N,~S,~S");
40928 Clazz_defineMethod (c$, "mouseOverStructure", 
40929 function (atoms) {
40930 if (this.listeners == null) {
40931 return;
40932 }var hasSequenceListener = false;
40933 for (var i = 0; i < this.listeners.size (); i++) {
40934 if (Clazz_instanceOf (this.listeners.elementAt (i), jalview.structure.SequenceListener)) {
40935 hasSequenceListener = true;
40936 }}
40937 if (!hasSequenceListener) {
40938 return;
40939 }var results =  new jalview.datamodel.SearchResults ();
40940 for (var atom, $atom = atoms.iterator (); $atom.hasNext () && ((atom = $atom.next ()) || true);) {
40941 var lastseq = null;
40942 var lastipos = -1;
40943 for (var sm, $sm = this.mappings.iterator (); $sm.hasNext () && ((sm = $sm.next ()) || true);) {
40944 if (sm.pdbfile.equals (atom.getPdbFile ()) && sm.pdbchain.equals (atom.getChain ())) {
40945 var indexpos = sm.getSeqPos (atom.getPdbResNum ());
40946 if (lastipos != indexpos && lastseq !== sm.sequence) {
40947 results.addResult (sm.sequence, indexpos, indexpos);
40948 lastipos = indexpos;
40949 lastseq = sm.sequence;
40950 for (var acf, $acf = this.seqmappings.iterator (); $acf.hasNext () && ((acf = $acf.next ()) || true);) {
40951 acf.markMappedRegion (sm.sequence, indexpos, results);
40952 }
40953 }}}
40954 }
40955 for (var li, $li = this.listeners.iterator (); $li.hasNext () && ((li = $li.next ()) || true);) {
40956 if (Clazz_instanceOf (li, jalview.structure.SequenceListener)) {
40957 (li).highlightSequence (results);
40958 }}
40959 }, "java.util.List");
40960 Clazz_defineMethod (c$, "mouseOverSequence", 
40961 function (seq, indexpos, index, source) {
40962 var hasSequenceListeners = this.handlingVamsasMo || !this.seqmappings.isEmpty ();
40963 var results = null;
40964 if (index == -1) {
40965 index = seq.findPosition (indexpos);
40966 }for (var i = 0; i < this.listeners.size (); i++) {
40967 var listener = this.listeners.elementAt (i);
40968 if (listener === source) {
40969 continue;
40970 }if (Clazz_instanceOf (listener, jalview.structure.StructureListener)) {
40971 this.highlightStructure (listener, seq, index);
40972 } else {
40973 if (Clazz_instanceOf (listener, jalview.structure.SequenceListener)) {
40974 var seqListener = listener;
40975 if (hasSequenceListeners && seqListener.getVamsasSource () !== source) {
40976 if (this.relaySeqMappings) {
40977 if (results == null) {
40978 results = jalview.util.MappingUtils.buildSearchResults (seq, index, this.seqmappings);
40979 }if (this.handlingVamsasMo) {
40980 results.addResult (seq, index, index);
40981 }seqListener.highlightSequence (results);
40982 }}} else if (Clazz_instanceOf (listener, jalview.structure.VamsasListener) && !this.handlingVamsasMo) {
40983 (listener).mouseOverSequence (seq, indexpos, source);
40984 } else if (Clazz_instanceOf (listener, jalview.structure.SecondaryStructureListener)) {
40985 (listener).mouseOverSequence (seq, indexpos, index);
40986 }}}
40987 }, "jalview.datamodel.SequenceI,~N,~N,jalview.structure.VamsasSource");
40988 Clazz_defineMethod (c$, "highlightStructure", 
40989 function (sl, seq, index) {
40990 if (!sl.isListeningFor (seq)) {
40991 return;
40992 }var atomNo;
40993 var atoms =  new java.util.ArrayList ();
40994 for (var sm, $sm = this.mappings.iterator (); $sm.hasNext () && ((sm = $sm.next ()) || true);) {
40995 if (sm.sequence === seq || sm.sequence === seq.getDatasetSequence ()) {
40996 atomNo = sm.getAtomNum (index);
40997 if (atomNo > 0) {
40998 atoms.add ( new jalview.structure.AtomSpec (sm.pdbfile, sm.pdbchain, sm.getPDBResNum (index), atomNo));
40999 }}}
41000 sl.highlightAtoms (atoms);
41001 }, "jalview.structure.StructureListener,jalview.datamodel.SequenceI,~N");
41002 Clazz_defineMethod (c$, "mouseOverVamsasSequence", 
41003 function (sequenceI, position, source) {
41004 this.handlingVamsasMo = true;
41005 var msg = sequenceI.hashCode () * (1 + position);
41006 if (this.lastmsg != msg) {
41007 this.lastmsg = msg;
41008 this.mouseOverSequence (sequenceI, position, -1, source);
41009 }this.handlingVamsasMo = false;
41010 }, "jalview.datamodel.SequenceI,~N,jalview.structure.VamsasSource");
41011 Clazz_defineMethod (c$, "colourSequenceFromStructure", 
41012 function (seq, pdbid) {
41013 return null;
41014 }, "jalview.datamodel.SequenceI,~S");
41015 Clazz_defineMethod (c$, "structureSelectionChanged", 
41016 function () {
41017 });
41018 Clazz_defineMethod (c$, "sequenceSelectionChanged", 
41019 function () {
41020 });
41021 Clazz_defineMethod (c$, "sequenceColoursChanged", 
41022 function (source) {
41023 var sl;
41024 for (var i = 0; i < this.listeners.size (); i++) {
41025 if (Clazz_instanceOf (this.listeners.elementAt (i), jalview.structure.StructureListener)) {
41026 sl = this.listeners.elementAt (i);
41027 sl.updateColours (source);
41028 }}
41029 }, "~O");
41030 Clazz_defineMethod (c$, "getMapping", 
41031 function (pdbfile) {
41032 var tmp =  new java.util.ArrayList ();
41033 for (var sm, $sm = this.mappings.iterator (); $sm.hasNext () && ((sm = $sm.next ()) || true);) {
41034 if (sm.pdbfile.equals (pdbfile)) {
41035 tmp.add (sm);
41036 }}
41037 return tmp.toArray ( new Array (tmp.size ()));
41038 }, "~S");
41039 Clazz_defineMethod (c$, "printMappings", 
41040 function (pdbfile, seqs) {
41041 if (pdbfile == null || seqs == null || seqs.isEmpty ()) {
41042 return "";
41043 }var sb =  new StringBuilder (64);
41044 for (var sm, $sm = this.mappings.iterator (); $sm.hasNext () && ((sm = $sm.next ()) || true);) {
41045 if (sm.pdbfile.equals (pdbfile) && seqs.contains (sm.sequence)) {
41046 sb.append (sm.mappingDetails);
41047 sb.append (jalview.structure.StructureSelectionManager.NEWLINE);
41048 sb.append ("=====================");
41049 sb.append (jalview.structure.StructureSelectionManager.NEWLINE);
41050 }}
41051 sb.append (jalview.structure.StructureSelectionManager.NEWLINE);
41052 return sb.toString ();
41053 }, "~S,java.util.List");
41054 Clazz_defineMethod (c$, "removeMappings", 
41055 function (set) {
41056 if (set != null) {
41057 for (var acf, $acf = set.iterator (); $acf.hasNext () && ((acf = $acf.next ()) || true);) {
41058 this.removeMapping (acf);
41059 }
41060 }}, "java.util.Set");
41061 Clazz_defineMethod (c$, "removeMapping", 
41062 function (acf) {
41063 if (acf != null && this.seqmappings.contains (acf)) {
41064 var count = (this.seqMappingRefCounts.get (acf)).intValue ();
41065 count--;
41066 if (count > 0) {
41067 this.seqMappingRefCounts.put (acf, new Integer (count));
41068 } else {
41069 this.seqmappings.remove (acf);
41070 this.seqMappingRefCounts.remove (acf);
41071 }}}, "jalview.datamodel.AlignedCodonFrame");
41072 Clazz_defineMethod (c$, "addMappings", 
41073 function (set) {
41074 if (set != null) {
41075 for (var acf, $acf = set.iterator (); $acf.hasNext () && ((acf = $acf.next ()) || true);) {
41076 this.addMapping (acf);
41077 }
41078 }}, "java.util.Set");
41079 Clazz_defineMethod (c$, "addMapping", 
41080 function (acf) {
41081 if (acf != null) {
41082 if (this.seqmappings.contains (acf)) {
41083 this.seqMappingRefCounts.put (acf, new Integer ((this.seqMappingRefCounts.get (acf)).intValue () + 1));
41084 } else {
41085 this.seqmappings.add (acf);
41086 this.seqMappingRefCounts.put (acf, new Integer (1));
41087 }}}, "jalview.datamodel.AlignedCodonFrame");
41088 Clazz_defineMethod (c$, "addSelectionListener", 
41089 function (selecter) {
41090 if (!this.sel_listeners.contains (selecter)) {
41091 this.sel_listeners.add (selecter);
41092 }}, "jalview.structure.SelectionListener");
41093 Clazz_defineMethod (c$, "removeSelectionListener", 
41094 function (toremove) {
41095 if (this.sel_listeners.contains (toremove)) {
41096 this.sel_listeners.remove (toremove);
41097 }}, "jalview.structure.SelectionListener");
41098 Clazz_defineMethod (c$, "sendSelection", 
41099 function (selection, colsel, source) {
41100 for (var slis, $slis = this.sel_listeners.iterator (); $slis.hasNext () && ((slis = $slis.next ()) || true);) {
41101 if (slis !== source) {
41102 slis.selection (selection, colsel, source);
41103 }}
41104 }, "jalview.datamodel.SequenceGroup,jalview.datamodel.ColumnSelection,jalview.structure.SelectionSource");
41105 Clazz_defineMethod (c$, "sendViewPosition", 
41106 function (source, startRes, endRes, startSeq, endSeq) {
41107 if (this.view_listeners != null && this.view_listeners.size () > 0) {
41108 var listeners = this.view_listeners.elements ();
41109 while (listeners.hasMoreElements ()) {
41110 var slis = listeners.nextElement ();
41111 if (slis !== source) {
41112 slis.viewPosition (startRes, endRes, startSeq, endSeq, source);
41113 };}
41114 }}, "jalview.api.AlignmentViewPanel,~N,~N,~N,~N");
41115 c$.release = Clazz_defineMethod (c$, "release", 
41116 function (jalviewLite) {
41117 {
41118 if (jalview.structure.StructureSelectionManager.instances == null) {
41119 return;
41120 }var mnger = (jalview.structure.StructureSelectionManager.instances.get (jalviewLite));
41121 if (mnger != null) {
41122 jalview.structure.StructureSelectionManager.instances.remove (jalviewLite);
41123 try {
41124 mnger.finalize ();
41125 } catch (x) {
41126 }
41127 }}}, "jalview.api.StructureSelectionManagerProvider");
41128 Clazz_defineMethod (c$, "registerPDBEntry", 
41129 function (pdbentry) {
41130 if (pdbentry.getFile () != null && pdbentry.getFile ().trim ().length > 0) {
41131 this.registerPDBFile (pdbentry.getId (), pdbentry.getFile ());
41132 }}, "jalview.datamodel.PDBEntry");
41133 Clazz_defineMethod (c$, "addCommandListener", 
41134 function (cl) {
41135 if (!this.commandListeners.contains (cl)) {
41136 this.commandListeners.add (cl);
41137 }}, "jalview.structure.CommandListener");
41138 Clazz_defineMethod (c$, "hasCommandListener", 
41139 function (cl) {
41140 return this.commandListeners.contains (cl);
41141 }, "jalview.structure.CommandListener");
41142 Clazz_defineMethod (c$, "removeCommandListener", 
41143 function (l) {
41144 return this.commandListeners.remove (l);
41145 }, "jalview.structure.CommandListener");
41146 Clazz_defineMethod (c$, "commandPerformed", 
41147 function (command, undo, source) {
41148 for (var listener, $listener = this.commandListeners.iterator (); $listener.hasNext () && ((listener = $listener.next ()) || true);) {
41149 listener.mirrorCommand (command, undo, this, source);
41150 }
41151 }, "jalview.commands.CommandI,~B,jalview.structure.VamsasSource");
41152 Clazz_defineMethod (c$, "mapCommand", 
41153 function (command, undo, mapTo, gapChar) {
41154 if (Clazz_instanceOf (command, jalview.commands.EditCommand)) {
41155 return jalview.util.MappingUtils.mapEditCommand (command, undo, mapTo, gapChar, this.seqmappings);
41156 } else if (Clazz_instanceOf (command, jalview.commands.OrderCommand)) {
41157 return jalview.util.MappingUtils.mapOrderCommand (command, undo, mapTo, this.seqmappings);
41158 }return null;
41159 }, "jalview.commands.CommandI,~B,jalview.datamodel.AlignmentI,~S");
41160 c$.$StructureSelectionManager$1$ = function () {
41161 Clazz_pu$h(self.c$);
41162 c$ = Clazz_declareAnonymous (jalview.structure, "StructureSelectionManager$1", java.io.PrintStream);
41163 Clazz_defineMethod (c$, "print", 
41164 function (x) {
41165 this.f$.mappingDetails.append (x);
41166 }, "~S");
41167 Clazz_defineMethod (c$, "println", 
41168 function () {
41169 this.f$.mappingDetails.append (jalview.structure.StructureSelectionManager.NEWLINE);
41170 });
41171 c$ = Clazz_p0p ();
41172 };
41173 c$.NEWLINE = c$.prototype.NEWLINE = System.lineSeparator ();
41174 Clazz_defineStatics (c$,
41175 "instances", null,
41176 "nullProvider", null);
41177 });
41178 Clazz_declarePackage ("MCview");
41179 Clazz_load (["jalview.io.AlignFile"], "MCview.PDBfile", ["MCview.Atom", "$.PDBChain", "jalview.analysis.AlignSeq", "jalview.datamodel.Alignment", "$.AlignmentI", "$.PDBEntry", "jalview.io.FileParse", "jalview.util.MessageManager", "java.awt.Color", "java.io.IOException", "java.util.ArrayList", "$.Hashtable", "$.Vector"], function () {
41180 c$ = Clazz_decorateAsClass (function () {
41181 this.chains = null;
41182 this.id = null;
41183 this.visibleChainAnnotation = false;
41184 this.$predictSecondaryStructure = true;
41185 this.externalSecondaryStructure = false;
41186 Clazz_instantialize (this, arguments);
41187 }, MCview, "PDBfile", jalview.io.AlignFile);
41188 Clazz_makeConstructor (c$, 
41189 function (addAlignmentAnnotations, predictSecondaryStructure, externalSecStr) {
41190 Clazz_superConstructor (this, MCview.PDBfile);
41191 this.visibleChainAnnotation = addAlignmentAnnotations;
41192 this.$predictSecondaryStructure = predictSecondaryStructure;
41193 this.externalSecondaryStructure = externalSecStr;
41194 }, "~B,~B,~B");
41195 Clazz_makeConstructor (c$, 
41196 function (addAlignmentAnnotations, predictSecondaryStructure, externalSecStr, file, protocol) {
41197 Clazz_superConstructor (this, MCview.PDBfile, [false, file, protocol]);
41198 this.visibleChainAnnotation = addAlignmentAnnotations;
41199 this.$predictSecondaryStructure = predictSecondaryStructure;
41200 this.externalSecondaryStructure = externalSecStr;
41201 this.doParse ();
41202 }, "~B,~B,~B,~S,~S");
41203 Clazz_makeConstructor (c$, 
41204 function (addAlignmentAnnotations, predictSecondaryStructure, externalSecStr, source) {
41205 Clazz_superConstructor (this, MCview.PDBfile, [false, source]);
41206 this.visibleChainAnnotation = addAlignmentAnnotations;
41207 this.$predictSecondaryStructure = predictSecondaryStructure;
41208 this.externalSecondaryStructure = externalSecStr;
41209 this.doParse ();
41210 }, "~B,~B,~B,jalview.io.FileParse");
41211 Clazz_overrideMethod (c$, "print", 
41212 function () {
41213 return null;
41214 });
41215 Clazz_overrideMethod (c$, "parse", 
41216 function () {
41217 this.id = this.safeName (this.getDataName ());
41218 this.chains =  new java.util.Vector ();
41219 var rna =  new java.util.ArrayList ();
41220 var prot =  new java.util.ArrayList ();
41221 var tmpchain;
41222 var line = null;
41223 var modelFlag = false;
41224 var terFlag = false;
41225 var lastID = "";
41226 var indexx = 0;
41227 var atomnam = null;
41228 try {
41229 while ((line = this.nextLine ()) != null) {
41230 if (line.indexOf ("HEADER") == 0) {
41231 if (line.length > 62) {
41232 var tid;
41233 if (line.length > 67) {
41234 tid = line.substring (62, 67).trim ();
41235 } else {
41236 tid = line.substring (62).trim ();
41237 }if (tid.length > 0) {
41238 this.id = tid;
41239 }continue;
41240 }}if (line.indexOf ("SEQRES") == 0) {
41241 }if (line.indexOf ("MODEL") == 0) {
41242 modelFlag = true;
41243 }if (line.indexOf ("TER") == 0) {
41244 terFlag = true;
41245 }if (modelFlag && line.indexOf ("ENDMDL") == 0) {
41246 break;
41247 }if (line.indexOf ("ATOM") == 0 || (line.indexOf ("HETATM") == 0 && !terFlag)) {
41248 terFlag = false;
41249 atomnam = line.substring (12, 15).trim ();
41250 if (!atomnam.equals ("CA") && !atomnam.equals ("P")) {
41251 continue;
41252 }var tmpatom =  new MCview.Atom (line);
41253 tmpchain = this.findChain (tmpatom.chain);
41254 if (tmpchain != null) {
41255 if (tmpatom.resNumIns.trim ().equals (lastID)) {
41256 continue;
41257 }tmpchain.atoms.addElement (tmpatom);
41258 } else {
41259 tmpchain =  new MCview.PDBChain (this.id, tmpatom.chain);
41260 this.chains.addElement (tmpchain);
41261 tmpchain.atoms.addElement (tmpatom);
41262 }lastID = tmpatom.resNumIns.trim ();
41263 }this.index++;
41264 }
41265 this.makeResidueList ();
41266 this.makeCaBondList ();
41267 if (this.id == null) {
41268 this.id = this.inFile.getName ();
41269 }for (var chain, $chain = this.chains.iterator (); $chain.hasNext () && ((chain = $chain.next ()) || true);) {
41270 var chainseq = this.postProcessChain (chain);
41271 if (MCview.PDBfile.isRNA (chainseq)) {
41272 rna.add (chainseq);
41273 } else {
41274 prot.add (chainseq);
41275 }}
41276 if (this.$predictSecondaryStructure) {
41277 this.predictSecondaryStructure (rna, prot);
41278 }} catch (e$$) {
41279 if (Clazz_exceptionOf (e$$, OutOfMemoryError)) {
41280 var er = e$$;
41281 {
41282 System.out.println ("OUT OF MEMORY LOADING PDB FILE");
41283 throw  new java.io.IOException (jalview.util.MessageManager.getString ("exception.outofmemory_loading_pdb_file"));
41284 }
41285 } else if (Clazz_exceptionOf (e$$, NumberFormatException)) {
41286 var ex = e$$;
41287 {
41288 if (line != null) {
41289 System.err.println ("Couldn't read number from line:");
41290 System.err.println (line);
41291 }}
41292 } else {
41293 throw e$$;
41294 }
41295 }
41296 this.markCalcIds ();
41297 });
41298 Clazz_defineMethod (c$, "predictSecondaryStructure", 
41299 function (rnaSequences, proteinSequences) {
41300 if (this.externalSecondaryStructure && rnaSequences.size () > 0) {
41301 try {
41302 this.processPdbFileWithAnnotate3d (rnaSequences);
41303 } catch (x) {
41304 if (Clazz_exceptionOf (x, Exception)) {
41305 System.err.println ("Exceptions when dealing with RNA in pdb file");
41306 x.printStackTrace ();
41307 } else {
41308 throw x;
41309 }
41310 }
41311 }if (proteinSequences.size () > 0) {
41312 try {
41313 this.processPdbFileWithJmol (proteinSequences);
41314 } catch (x) {
41315 if (Clazz_exceptionOf (x, Exception)) {
41316 System.err.println ("Exceptions from Jmol when processing data in pdb file");
41317 x.printStackTrace ();
41318 } else {
41319 throw x;
41320 }
41321 }
41322 }}, "java.util.List,java.util.List");
41323 Clazz_defineMethod (c$, "postProcessChain", 
41324 function (chain) {
41325 var dataset = chain.sequence;
41326 dataset.setName (this.id + "|" + dataset.getName ());
41327 var entry =  new jalview.datamodel.PDBEntry ();
41328 entry.setId (this.id);
41329 entry.setType (jalview.datamodel.PDBEntry.Type.PDB);
41330 entry.setProperty ( new java.util.Hashtable ());
41331 if (chain.id != null) {
41332 entry.setChainCode (String.valueOf (chain.id));
41333 }if (this.inFile != null) {
41334 entry.setFile (this.inFile.getAbsolutePath ());
41335 } else {
41336 entry.setFile (this.getDataName ());
41337 }dataset.addPDBId (entry);
41338 var chainseq = dataset.deriveSequence ();
41339 this.seqs.addElement (chainseq);
41340 var chainannot = chainseq.getAnnotation ();
41341 if (chainannot != null && this.visibleChainAnnotation) {
41342 for (var ai = 0; ai < chainannot.length; ai++) {
41343 chainannot[ai].visible = this.visibleChainAnnotation;
41344 this.annotations.addElement (chainannot[ai]);
41345 }
41346 }return chainseq;
41347 }, "MCview.PDBChain");
41348 c$.isCalcIdHandled = Clazz_defineMethod (c$, "isCalcIdHandled", 
41349 function (calcId) {
41350 return calcId != null && (MCview.PDBfile.CALC_ID_PREFIX.equals (calcId));
41351 }, "~S");
41352 c$.isCalcIdForFile = Clazz_defineMethod (c$, "isCalcIdForFile", 
41353 function (alan, pdbFile) {
41354 return alan.getCalcId () != null && MCview.PDBfile.CALC_ID_PREFIX.equals (alan.getCalcId ()) && pdbFile.equals (alan.getProperty ("PDBID"));
41355 }, "jalview.datamodel.AlignmentAnnotation,~S");
41356 c$.relocateCalcId = Clazz_defineMethod (c$, "relocateCalcId", 
41357 function (calcId, alreadyLoadedPDB) {
41358 var s = MCview.PDBfile.CALC_ID_PREFIX.length;
41359 var end = calcId.indexOf (MCview.PDBfile.CALC_ID_PREFIX, s);
41360 var between = calcId.substring (s, end - 1);
41361 return MCview.PDBfile.CALC_ID_PREFIX + alreadyLoadedPDB.get (between) + ":" + calcId.substring (end);
41362 }, "~S,java.util.Hashtable");
41363 Clazz_defineMethod (c$, "markCalcIds", 
41364  function () {
41365 for (var sq, $sq = this.seqs.iterator (); $sq.hasNext () && ((sq = $sq.next ()) || true);) {
41366 if (sq.getAnnotation () != null) {
41367 for (var aa, $aa = 0, $$aa = sq.getAnnotation (); $aa < $$aa.length && ((aa = $$aa[$aa]) || true); $aa++) {
41368 var oldId = aa.getCalcId ();
41369 if (oldId == null) {
41370 oldId = "";
41371 }aa.setCalcId (MCview.PDBfile.CALC_ID_PREFIX);
41372 aa.setProperty ("PDBID", this.id);
41373 aa.setProperty ("oldCalcId", oldId);
41374 }
41375 }}
41376 });
41377 Clazz_defineMethod (c$, "processPdbFileWithJmol", 
41378  function (prot) {
41379 try {
41380 var cl = Clazz._4Name ("jalview.ext.jmol.PDBFileWithJmol");
41381 if (cl != null) {
41382 var constructor = cl.getConstructor ( Clazz_newArray (-1, [jalview.io.FileParse]));
41383 var args =  Clazz_newArray (-1, [ new jalview.io.FileParse (this.getDataName (), this.type)]);
41384 var jmf = constructor.newInstance (args);
41385 var al =  new jalview.datamodel.Alignment (cl.getMethod ("getSeqsAsArray",  Clazz_newArray (-1, [])).invoke (jmf, []));
41386 cl.getMethod ("addAnnotations",  Clazz_newArray (-1, [jalview.datamodel.AlignmentI])).invoke (jmf, [al]);
41387 for (var sq, $sq = al.getSequences ().iterator (); $sq.hasNext () && ((sq = $sq.next ()) || true);) {
41388 if (sq.getDatasetSequence () != null) {
41389 sq.getDatasetSequence ().getPDBId ().clear ();
41390 } else {
41391 sq.getPDBId ().clear ();
41392 }}
41393 this.replaceAndUpdateChains (prot, al, "pep", false);
41394 }} catch (q) {
41395 if (Clazz_exceptionOf (q, ClassNotFoundException)) {
41396 } else {
41397 throw q;
41398 }
41399 }
41400 }, "java.util.List");
41401 Clazz_defineMethod (c$, "replaceAndUpdateChains", 
41402  function (prot, al, pep, b) {
41403 var replaced = jalview.analysis.AlignSeq.replaceMatchingSeqsWith (this.seqs, this.annotations, prot, al, pep, false);
41404 for (var ch, $ch = this.chains.iterator (); $ch.hasNext () && ((ch = $ch.next ()) || true);) {
41405 var p = 0;
41406 for (var sq, $sq = replaced.get (0).iterator (); $sq.hasNext () && ((sq = $sq.next ()) || true);) {
41407 p++;
41408 if (sq === ch.sequence || sq.getDatasetSequence () === ch.sequence) {
41409 p = -p;
41410 break;
41411 }}
41412 if (p < 0) {
41413 p = -p - 1;
41414 ch.shadow = replaced.get (1).get (p);
41415 ch.shadowMap = (replaced.get (2).get (p)).getMappingFromS1 (false);
41416 }}
41417 }, "java.util.List,jalview.datamodel.AlignmentI,~S,~B");
41418 Clazz_defineMethod (c$, "processPdbFileWithAnnotate3d", 
41419  function (rna) {
41420 try {
41421 var cl = Clazz._4Name ("jalview.ws.jws1.Annotate3D");
41422 if (cl != null) {
41423 var annotate3d = cl.getConstructor ( Clazz_newArray (-1, [])).newInstance ( Clazz_newArray (-1, []));
41424 var al = (cl.getMethod ("getRNAMLFor",  Clazz_newArray (-1, [jalview.io.FileParse])).invoke (annotate3d,  Clazz_newArray (-1, [ new jalview.io.FileParse (this.getDataName (), this.type)])));
41425 for (var sq, $sq = al.getSequences ().iterator (); $sq.hasNext () && ((sq = $sq.next ()) || true);) {
41426 if (sq.getDatasetSequence () != null) {
41427 if (sq.getDatasetSequence ().getPDBId () != null) {
41428 sq.getDatasetSequence ().getPDBId ().clear ();
41429 }} else {
41430 if (sq.getPDBId () != null) {
41431 sq.getPDBId ().clear ();
41432 }}}
41433 this.replaceAndUpdateChains (rna, al, "dna", false);
41434 }} catch (x) {
41435 if (Clazz_exceptionOf (x, ClassNotFoundException)) {
41436 } else {
41437 throw x;
41438 }
41439 }
41440 ;}, "java.util.List");
41441 Clazz_defineMethod (c$, "safeName", 
41442  function (dataName) {
41443 var p = 0;
41444 while ((p = dataName.indexOf ("/")) > -1 && p < dataName.length) {
41445 dataName = dataName.substring (p + 1);
41446 }
41447 return dataName;
41448 }, "~S");
41449 Clazz_defineMethod (c$, "makeResidueList", 
41450 function () {
41451 for (var i = 0; i < this.chains.size (); i++) {
41452 this.chains.elementAt (i).makeResidueList (this.visibleChainAnnotation);
41453 }
41454 });
41455 Clazz_defineMethod (c$, "makeCaBondList", 
41456 function () {
41457 for (var i = 0; i < this.chains.size (); i++) {
41458 this.chains.elementAt (i).makeCaBondList ();
41459 }
41460 });
41461 Clazz_defineMethod (c$, "findChain", 
41462 function (id) {
41463 for (var i = 0; i < this.chains.size (); i++) {
41464 if (this.chains.elementAt (i).id.equals (id)) {
41465 return this.chains.elementAt (i);
41466 }}
41467 return null;
41468 }, "~S");
41469 Clazz_defineMethod (c$, "setChargeColours", 
41470 function () {
41471 for (var i = 0; i < this.chains.size (); i++) {
41472 this.chains.elementAt (i).setChargeColours ();
41473 }
41474 });
41475 Clazz_defineMethod (c$, "setColours", 
41476 function (cs) {
41477 for (var i = 0; i < this.chains.size (); i++) {
41478 this.chains.elementAt (i).setChainColours (cs);
41479 }
41480 }, "jalview.schemes.ColourSchemeI");
41481 Clazz_defineMethod (c$, "setChainColours", 
41482 function () {
41483 for (var i = 0; i < this.chains.size (); i++) {
41484 this.chains.elementAt (i).setChainColours (java.awt.Color.getHSBColor (1.0 / i, .4, 1.0));
41485 }
41486 });
41487 c$.isRNA = Clazz_defineMethod (c$, "isRNA", 
41488 function (seq) {
41489 for (var c, $c = 0, $$c = seq.getSequence (); $c < $$c.length && ((c = $$c[$c]) || true); $c++) {
41490 if ((c != 'A') && (c != 'C') && (c != 'G') && (c != 'U')) {
41491 return false;
41492 }}
41493 return true;
41494 }, "jalview.datamodel.SequenceI");
41495 Clazz_defineStatics (c$,
41496 "CALC_ID_PREFIX", "JalviewPDB");
41497 });
41498 Clazz_declarePackage ("jalview.io");
41499 Clazz_load (["jalview.io.FileParse"], "jalview.io.AlignFile", ["jalview.datamodel.Sequence", "jalview.util.MessageManager", "java.io.IOException", "java.lang.Error", "java.util.ArrayList", "$.Hashtable", "$.Vector"], function () {
41500 c$ = Clazz_decorateAsClass (function () {
41501 this.noSeqs = 0;
41502 this.maxLength = 0;
41503 this.seqs = null;
41504 this.annotations = null;
41505 this.seqGroups = null;
41506 this.properties = null;
41507 this.start = 0;
41508 this.end = 0;
41509 this.jvSuffix = true;
41510 this.parseCalled = false;
41511 this.newickStrings = null;
41512 Clazz_instantialize (this, arguments);
41513 }, jalview.io, "AlignFile", jalview.io.FileParse);
41514 Clazz_makeConstructor (c$, 
41515 function () {
41516 Clazz_superConstructor (this, jalview.io.AlignFile, []);
41517 this.initData ();
41518 });
41519 Clazz_makeConstructor (c$, 
41520 function (inFile, type) {
41521 this.construct (true, inFile, type);
41522 }, "~S,~S");
41523 Clazz_makeConstructor (c$, 
41524 function (parseImmediately, inFile, type) {
41525 Clazz_superConstructor (this, jalview.io.AlignFile, [inFile, type]);
41526 this.initData ();
41527 if (parseImmediately) {
41528 this.doParse ();
41529 }}, "~B,~S,~S");
41530 Clazz_makeConstructor (c$, 
41531 function (source) {
41532 this.construct (true, source);
41533 }, "jalview.io.FileParse");
41534 Clazz_makeConstructor (c$, 
41535 function (parseImmediately, source) {
41536 Clazz_superConstructor (this, jalview.io.AlignFile, [source]);
41537 this.initData ();
41538 if (parseImmediately) {
41539 this.doParse ();
41540 }}, "~B,jalview.io.FileParse");
41541 Clazz_defineMethod (c$, "doParse", 
41542 function () {
41543 if (this.parseCalled) {
41544 throw  new java.io.IOException ("Implementation error: Parser called twice for same data.\nNeed to call initData() again before parsing can be reattempted.");
41545 }this.parseCalled = true;
41546 this.parse ();
41547 for (var i = 0, c = this.seqs.size (); i < c; i++) {
41548 this.seqs.get (i).setIndex (i);
41549 }
41550 });
41551 Clazz_defineMethod (c$, "getSeqs", 
41552 function () {
41553 return this.seqs;
41554 });
41555 Clazz_defineMethod (c$, "getSeqGroups", 
41556 function () {
41557 return this.seqGroups;
41558 });
41559 Clazz_defineMethod (c$, "getSeqsAsArray", 
41560 function () {
41561 var s =  new Array (this.seqs.size ());
41562 for (var i = 0; i < this.seqs.size (); i++) {
41563 s[i] = this.seqs.elementAt (i);
41564 }
41565 return s;
41566 });
41567 Clazz_defineMethod (c$, "addAnnotations", 
41568 function (al) {
41569 this.addProperties (al);
41570 for (var i = 0; i < this.annotations.size (); i++) {
41571 var an = this.annotations.elementAt (i);
41572 an.validateRangeAndDisplay ();
41573 al.addAnnotation (an);
41574 }
41575 }, "jalview.datamodel.AlignmentI");
41576 Clazz_defineMethod (c$, "addSeqGroups", 
41577 function (al) {
41578 this.seqGroups = al.getGroups ();
41579 }, "jalview.datamodel.AlignmentI");
41580 Clazz_defineMethod (c$, "addProperties", 
41581 function (al) {
41582 if (this.properties != null && this.properties.size () > 0) {
41583 var keys = this.properties.keys ();
41584 var vals = this.properties.elements ();
41585 while (keys.hasMoreElements ()) {
41586 al.setProperty (keys.nextElement (), vals.nextElement ());
41587 }
41588 }}, "jalview.datamodel.AlignmentI");
41589 Clazz_defineMethod (c$, "setAlignmentProperty", 
41590 function (key, value) {
41591 if (key == null) {
41592 throw  new Error (jalview.util.MessageManager.getString ("error.implementation_error_cannot_have_null_alignment"));
41593 }if (value == null) {
41594 return;
41595 }if (this.properties == null) {
41596 this.properties =  new java.util.Hashtable ();
41597 }this.properties.put (key, value);
41598 }, "~O,~O");
41599 Clazz_defineMethod (c$, "getAlignmentProperty", 
41600 function (key) {
41601 if (this.properties != null && key != null) {
41602 return this.properties.get (key);
41603 }return null;
41604 }, "~O");
41605 Clazz_defineMethod (c$, "initData", 
41606 function () {
41607 this.seqs =  new java.util.Vector ();
41608 this.annotations =  new java.util.Vector ();
41609 this.seqGroups =  new java.util.ArrayList ();
41610 this.parseCalled = false;
41611 });
41612 Clazz_defineMethod (c$, "setSeqs", 
41613 function (s) {
41614 this.seqs =  new java.util.Vector ();
41615 for (var i = 0; i < s.length; i++) {
41616 this.seqs.addElement (s[i]);
41617 }
41618 }, "~A");
41619 Clazz_defineMethod (c$, "addJVSuffix", 
41620 function (b) {
41621 this.jvSuffix = b;
41622 }, "~B");
41623 Clazz_defineMethod (c$, "parseId", 
41624 function (id) {
41625 var seq = null;
41626 id = id.trim ();
41627 var space = id.indexOf (" ");
41628 if (space > -1) {
41629 seq =  new jalview.datamodel.Sequence (id.substring (0, space), "");
41630 seq.setDescription (id.substring (space + 1));
41631 } else {
41632 seq =  new jalview.datamodel.Sequence (id, "");
41633 }return seq;
41634 }, "~S");
41635 Clazz_defineMethod (c$, "printId", 
41636 function (seq) {
41637 return seq.getDisplayId (this.jvSuffix);
41638 }, "jalview.datamodel.SequenceI");
41639 Clazz_defineMethod (c$, "addNewickTree", 
41640 function (treeName, newickString) {
41641 if (this.newickStrings == null) {
41642 this.newickStrings =  new java.util.Vector ();
41643 }this.newickStrings.addElement ( Clazz_newArray (-1, [treeName, newickString]));
41644 }, "~S,~S");
41645 Clazz_defineMethod (c$, "getTreeCount", 
41646 function () {
41647 return this.newickStrings == null ? 0 : this.newickStrings.size ();
41648 });
41649 Clazz_defineMethod (c$, "addGroups", 
41650 function (al) {
41651 for (var sg, $sg = this.getSeqGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
41652 al.addGroup (sg);
41653 }
41654 }, "jalview.datamodel.AlignmentI");
41655 });
41656 Clazz_declarePackage ("jalview.io");
41657 Clazz_load (null, "jalview.io.FileParse", ["jalview.io.AppletFormatAdapter", "jalview.util.MessageManager", "java.io.BufferedReader", "$.IOException", "$.InputStreamReader", "$.StringReader", "java.lang.Error", "java.net.URL", "java.util.zip.GZIPInputStream"], function () {
41658 c$ = Clazz_decorateAsClass (function () {
41659 this.dataName = "unknown source";
41660 this.inFile = null;
41661 this.viewport = null;
41662 this.exportSettings = null;
41663 this.index = 1;
41664 this.suffixSeparator = '#';
41665 this.newline = null;
41666 this.suffix = null;
41667 this.type = null;
41668 this.dataIn = null;
41669 this.errormessage = "UNITIALISED SOURCE";
41670 this.error = true;
41671 this.warningMessage = null;
41672 this.READAHEAD_LIMIT = 2048;
41673 Clazz_instantialize (this, arguments);
41674 }, jalview.io, "FileParse");
41675 Clazz_prepareFields (c$, function () {
41676 this.newline = System.getProperty ("line.separator");
41677 });
41678 Clazz_defineMethod (c$, "setNewlineString", 
41679 function (nl) {
41680 this.newline = nl;
41681 }, "~S");
41682 Clazz_defineMethod (c$, "getNewlineString", 
41683 function () {
41684 return this.newline;
41685 });
41686 Clazz_makeConstructor (c$, 
41687 function () {
41688 });
41689 Clazz_makeConstructor (c$, 
41690 function (from) {
41691 if (from == null) {
41692 throw  new Error (jalview.util.MessageManager.getString ("error.implementation_error_null_fileparse"));
41693 }if (from === this) {
41694 return;
41695 }this.index = ++from.index;
41696 this.inFile = from.inFile;
41697 this.suffixSeparator = from.suffixSeparator;
41698 this.suffix = from.suffix;
41699 this.errormessage = from.errormessage;
41700 this.error = false;
41701 this.type = from.type;
41702 this.dataIn = from.dataIn;
41703 if (this.dataIn != null) {
41704 this.mark ();
41705 }this.dataName = from.dataName;
41706 }, "jalview.io.FileParse");
41707 Clazz_defineMethod (c$, "tryAsGzipSource", 
41708  function (inputStream) {
41709 var inData =  new java.io.BufferedReader ( new java.io.InputStreamReader ( new java.util.zip.GZIPInputStream (inputStream)));
41710 inData.mark (2048);
41711 inData.read ();
41712 inData.reset ();
41713 return inData;
41714 }, "java.io.InputStream");
41715 Clazz_defineMethod (c$, "checkURLSource", 
41716  function (fileStr) {
41717 this.errormessage = "URL NOT FOUND";
41718 var url =  new java.net.URL (fileStr);
41719 var e = null;
41720 if (fileStr.toLowerCase ().endsWith (".gz")) {
41721 try {
41722 var inputStream = url.openStream ();
41723 this.dataIn = this.tryAsGzipSource (inputStream);
41724 this.dataName = fileStr;
41725 return false;
41726 } catch (ex) {
41727 if (Clazz_exceptionOf (ex, Exception)) {
41728 e = ex;
41729 } else {
41730 throw ex;
41731 }
41732 }
41733 }try {
41734 this.dataIn =  new java.io.BufferedReader ( new java.io.InputStreamReader (url.openStream ()));
41735 } catch (q) {
41736 if (Clazz_exceptionOf (q, java.io.IOException)) {
41737 if (e != null) {
41738 throw  new java.io.IOException (jalview.util.MessageManager.getString ("exception.failed_to_resolve_gzip_stream"), e);
41739 }throw q;
41740 } else {
41741 throw q;
41742 }
41743 }
41744 this.dataName = fileStr;
41745 return false;
41746 }, "~S");
41747 Clazz_defineMethod (c$, "extractSuffix", 
41748  function (fileStr) {
41749 var sfpos = fileStr.lastIndexOf (this.suffixSeparator);
41750 if (sfpos > -1 && sfpos < fileStr.length - 1) {
41751 this.suffix = fileStr.substring (sfpos + 1);
41752 return fileStr.substring (0, sfpos);
41753 }return null;
41754 }, "~S");
41755 Clazz_makeConstructor (c$, 
41756 function (fileStr, type) {
41757 this.type = type;
41758 this.error = false;
41759 if (type.equals (jalview.io.AppletFormatAdapter.FILE)) {
41760 {
41761 }} else if (type.equals (jalview.io.AppletFormatAdapter.URL)) {
41762 try {
41763 try {
41764 this.checkURLSource (fileStr);
41765 if (this.suffixSeparator == '#') {
41766 this.extractSuffix (fileStr);
41767 }} catch (e) {
41768 if (Clazz_exceptionOf (e, java.io.IOException)) {
41769 var suffixLess = this.extractSuffix (fileStr);
41770 if (suffixLess == null) {
41771 throw (e);
41772 } else {
41773 try {
41774 this.checkURLSource (suffixLess);
41775 } catch (e2) {
41776 if (Clazz_exceptionOf (e2, java.io.IOException)) {
41777 this.errormessage = "BAD URL WITH OR WITHOUT SUFFIX";
41778 throw (e);
41779 } else {
41780 throw e2;
41781 }
41782 }
41783 }} else {
41784 throw e;
41785 }
41786 }
41787 } catch (e) {
41788 if (Clazz_exceptionOf (e, Exception)) {
41789 this.errormessage = "CANNOT ACCESS DATA AT URL '" + fileStr + "' (" + e.getMessage () + ")";
41790 this.error = true;
41791 } else {
41792 throw e;
41793 }
41794 }
41795 } else if (type.equals (jalview.io.AppletFormatAdapter.PASTE)) {
41796 this.errormessage = "PASTE INACCESSIBLE!";
41797 this.dataIn =  new java.io.BufferedReader ( new java.io.StringReader (fileStr));
41798 this.dataName = "Paste";
41799 } else if (type.equals (jalview.io.AppletFormatAdapter.CLASSLOADER)) {
41800 this.errormessage = "RESOURCE CANNOT BE LOCATED";
41801 var is = this.getClass ().getResourceAsStream ("/" + fileStr);
41802 if (is == null) {
41803 var suffixLess = this.extractSuffix (fileStr);
41804 if (suffixLess != null) {
41805 is = this.getClass ().getResourceAsStream ("/" + suffixLess);
41806 }}if (is != null) {
41807 this.dataIn =  new java.io.BufferedReader ( new java.io.InputStreamReader (is));
41808 this.dataName = fileStr;
41809 } else {
41810 this.error = true;
41811 }} else {
41812 this.errormessage = "PROBABLE IMPLEMENTATION ERROR : Datasource Type given as '" + (type != null ? type : "null") + "'";
41813 this.error = true;
41814 }if (this.dataIn == null || this.error) {
41815 throw  new java.io.IOException (jalview.util.MessageManager.formatMessage ("exception.failed_to_read_data_from_source",  Clazz_newArray (-1, [this.errormessage])));
41816 }this.error = false;
41817 this.dataIn.mark (2048);
41818 }, "~S,~S");
41819 Clazz_defineMethod (c$, "mark", 
41820 function () {
41821 if (this.dataIn != null) {
41822 this.dataIn.mark (2048);
41823 } else {
41824 throw  new java.io.IOException (jalview.util.MessageManager.getString ("exception.no_init_source_stream"));
41825 }});
41826 Clazz_defineMethod (c$, "nextLine", 
41827 function () {
41828 if (!this.error) {
41829 return this.dataIn.readLine ();
41830 }throw  new java.io.IOException (jalview.util.MessageManager.formatMessage ("exception.invalid_source_stream",  Clazz_newArray (-1, [this.errormessage])));
41831 });
41832 Clazz_defineMethod (c$, "isExporting", 
41833 function () {
41834 return !this.error && this.dataIn == null;
41835 });
41836 Clazz_defineMethod (c$, "isValid", 
41837 function () {
41838 return !this.error;
41839 });
41840 Clazz_defineMethod (c$, "close", 
41841 function () {
41842 this.errormessage = "EXCEPTION ON CLOSE";
41843 this.error = true;
41844 this.dataIn.close ();
41845 this.dataIn = null;
41846 this.errormessage = "SOURCE IS CLOSED";
41847 });
41848 Clazz_defineMethod (c$, "reset", 
41849 function () {
41850 if (this.dataIn != null && !this.error) {
41851 this.dataIn.reset ();
41852 } else {
41853 throw  new java.io.IOException (jalview.util.MessageManager.getString ("error.implementation_error_reset_called_for_invalid_source"));
41854 }});
41855 Clazz_defineMethod (c$, "hasWarningMessage", 
41856 function () {
41857 return (this.warningMessage != null && this.warningMessage.length > 0);
41858 });
41859 Clazz_defineMethod (c$, "getWarningMessage", 
41860 function () {
41861 return this.warningMessage;
41862 });
41863 Clazz_defineMethod (c$, "getInFile", 
41864 function () {
41865 if (this.inFile != null) {
41866 return this.inFile.getAbsolutePath () + " (" + this.index + ")";
41867 } else {
41868 return "From Paste + (" + this.index + ")";
41869 }});
41870 Clazz_defineMethod (c$, "getDataName", 
41871 function () {
41872 return this.dataName;
41873 });
41874 Clazz_defineMethod (c$, "setDataName", 
41875 function (dataname) {
41876 this.dataName = dataname;
41877 }, "~S");
41878 Clazz_defineMethod (c$, "getReader", 
41879 function () {
41880 if (this.dataIn != null) {
41881 return this.dataIn;
41882 }return null;
41883 });
41884 Clazz_defineMethod (c$, "getViewport", 
41885 function () {
41886 return this.viewport;
41887 });
41888 Clazz_defineMethod (c$, "setViewport", 
41889 function (viewport) {
41890 this.viewport = viewport;
41891 }, "jalview.api.AlignViewportI");
41892 Clazz_defineMethod (c$, "getExportSettings", 
41893 function () {
41894 return this.exportSettings;
41895 });
41896 Clazz_defineMethod (c$, "setExportSettings", 
41897 function (exportSettings) {
41898 this.exportSettings = exportSettings;
41899 }, "jalview.api.AlignExportSettingI");
41900 Clazz_defineMethod (c$, "configureForView", 
41901 function (avpanel) {
41902 if (avpanel != null) {
41903 this.setViewport (avpanel.getAlignViewport ());
41904 }}, "jalview.api.AlignmentViewPanel");
41905 });
41906 Clazz_declarePackage ("jalview.io");
41907 Clazz_load (null, "jalview.io.AppletFormatAdapter", ["MCview.PDBfile", "jalview.datamodel.Alignment", "jalview.io.FileParse", "$.IdentifyFile", "jalview.jsdev.GenericFileAdapter", "jalview.util.MessageManager", "java.io.IOException", "java.lang.Exception", "$.StringBuffer"], function () {
41908 c$ = Clazz_decorateAsClass (function () {
41909 this.viewpanel = null;
41910 this.annotFromStructure = false;
41911 this.localSecondaryStruct = false;
41912 this.serviceSecondaryStruct = false;
41913 this.alignFile = null;
41914 this.inFile = null;
41915 this.newline = null;
41916 this.exportSettings = null;
41917 Clazz_instantialize (this, arguments);
41918 }, jalview.io, "AppletFormatAdapter");
41919 Clazz_prepareFields (c$, function () {
41920 this.newline = System.getProperty ("line.separator");
41921 });
41922 Clazz_makeConstructor (c$, 
41923 function () {
41924 });
41925 Clazz_makeConstructor (c$, 
41926 function (viewpanel) {
41927 this.viewpanel = viewpanel;
41928 }, "jalview.api.AlignmentViewPanel");
41929 Clazz_makeConstructor (c$, 
41930 function (alignPanel, settings) {
41931 this.viewpanel = alignPanel;
41932 this.exportSettings = settings;
41933 }, "jalview.api.AlignmentViewPanel,jalview.api.AlignExportSettingI");
41934 c$.prettyPrint = Clazz_defineMethod (c$, "prettyPrint", 
41935 function (els) {
41936 var list =  new StringBuffer ();
41937 for (var i = 0, iSize = els.length - 1; i < iSize; i++) {
41938 list.append (els[i]);
41939 list.append (", ");
41940 }
41941 list.append (" and " + els[els.length - 1] + ".");
41942 return list.toString ();
41943 }, "~A");
41944 Clazz_defineMethod (c$, "setNewlineString", 
41945 function (nl) {
41946 this.newline = nl;
41947 }, "~S");
41948 Clazz_defineMethod (c$, "getNewlineString", 
41949 function () {
41950 return this.newline;
41951 });
41952 c$.isValidFormat = Clazz_defineMethod (c$, "isValidFormat", 
41953 function (format) {
41954 return jalview.io.AppletFormatAdapter.isValidFormat (format, false);
41955 }, "~S");
41956 c$.isValidFormat = Clazz_defineMethod (c$, "isValidFormat", 
41957 function (format, forwriting) {
41958 var valid = false;
41959 var format_list = (forwriting) ? jalview.io.AppletFormatAdapter.WRITEABLE_FORMATS : jalview.io.AppletFormatAdapter.READABLE_FORMATS;
41960 for (var element, $element = 0, $$element = format_list; $element < $$element.length && ((element = $$element[$element]) || true); $element++) {
41961 if (element.equalsIgnoreCase (format)) {
41962 return true;
41963 }}
41964 return valid;
41965 }, "~S,~B");
41966 Clazz_defineMethod (c$, "readFile", 
41967 function (inFile, type, format) {
41968 this.inFile = inFile;
41969 try {
41970 if (format.equals ("FASTA")) {
41971 this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("FastaFile", [inFile, type]);
41972 } else if (format.equals ("MSF")) {
41973 this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("MSFfile", [inFile, type]);
41974 } else if (format.equals ("PileUp")) {
41975 this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("PileUpfile", [inFile, type]);
41976 } else if (format.equals ("CLUSTAL")) {
41977 this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("ClustalFile", [inFile, type]);
41978 } else if (format.equals ("BLC")) {
41979 this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("BLCFile", [inFile, type]);
41980 } else if (format.equals ("PIR")) {
41981 this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("PIRFile", [inFile, type]);
41982 } else if (format.equals ("PFAM")) {
41983 this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("PfamFile", [inFile, type]);
41984 } else if (format.equals ("JnetFile")) {
41985 this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("JPredFile", [inFile, type]);
41986 (this.alignFile).removeNonSequences ();
41987 } else if (format.equals ("PDB")) {
41988 this.alignFile =  new MCview.PDBfile (this.annotFromStructure, this.localSecondaryStruct, this.serviceSecondaryStruct, inFile, type);
41989 } else if (format.equals ("STH")) {
41990 this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("StockholmFile", [inFile, type]);
41991 } else if (format.equals ("SimpleBLAST")) {
41992 this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("SimpleBlastFile", [inFile, type]);
41993 } else if (format.equals ("PHYLIP")) {
41994 this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("PhylipFile", [inFile, type]);
41995 } else if (format.equals ("JSON")) {
41996 this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("JSONFile", [inFile, type]);
41997 } else if (format.equals ("HTML")) {
41998 this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("HtmlFile", [inFile, type]);
41999 } else if (format.equals ("RNAML")) {
42000 this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("RnamlFile", [inFile, type]);
42001 } else if (format.equals ("GFF v2 or v3")) {
42002 this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("Gff3File", [inFile, type]);
42003 }return this.buildAlignmentFrom (this.alignFile);
42004 } catch (e) {
42005 if (Clazz_exceptionOf (e, Exception)) {
42006 e.printStackTrace ();
42007 System.err.println ("Failed to read alignment using the '" + format + "' reader.\n" + e);
42008 if (e.getMessage () != null && e.getMessage ().startsWith (jalview.io.AppletFormatAdapter.INVALID_CHARACTERS)) {
42009 throw  new java.io.IOException (e.getMessage ());
42010 }if (type.equalsIgnoreCase ("Paste")) {
42011 try {
42012 this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("FastaFile", [">UNKNOWN\n" + inFile, "Paste"]);
42013 return this.buildAlignmentFrom (this.alignFile);
42014 } catch (ex) {
42015 if (Clazz_exceptionOf (ex, Exception)) {
42016 if (ex.toString ().startsWith (jalview.io.AppletFormatAdapter.INVALID_CHARACTERS)) {
42017 throw  new java.io.IOException (e.getMessage ());
42018 }ex.printStackTrace ();
42019 } else {
42020 throw ex;
42021 }
42022 }
42023 }throw  new java.io.IOException (jalview.io.AppletFormatAdapter.SUPPORTED_FORMATS);
42024 } else {
42025 throw e;
42026 }
42027 }
42028 }, "~S,~S,~S");
42029 Clazz_defineMethod (c$, "readFromFile", 
42030 function (source, format) {
42031 this.inFile = source.getInFile ();
42032 var type = source.type;
42033 try {
42034 if (format.equals ("FASTA")) {
42035 this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("FastaFile", [source]);
42036 } else if (format.equals ("MSF")) {
42037 this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("MSFfile", [source]);
42038 } else if (format.equals ("PileUp")) {
42039 this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("PileUpfile", [source]);
42040 } else if (format.equals ("CLUSTAL")) {
42041 this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("ClustalFile", [source]);
42042 } else if (format.equals ("BLC")) {
42043 this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("BLCFile", [source]);
42044 } else if (format.equals ("PIR")) {
42045 this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("PIRFile", [source]);
42046 } else if (format.equals ("PFAM")) {
42047 this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("PfamFile", [source]);
42048 } else if (format.equals ("JnetFile")) {
42049 this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("JPredFile", [source]);
42050 (this.alignFile).removeNonSequences ();
42051 } else if (format.equals ("PDB")) {
42052 this.alignFile =  new MCview.PDBfile (this.annotFromStructure, this.localSecondaryStruct, this.serviceSecondaryStruct, source);
42053 } else if (format.equals ("STH")) {
42054 this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("StockholmFile", [source]);
42055 } else if (format.equals ("RNAML")) {
42056 this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("RnamlFile", [source]);
42057 } else if (format.equals ("SimpleBLAST")) {
42058 this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("SimpleBlastFile", [source]);
42059 } else if (format.equals ("PHYLIP")) {
42060 this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("PhylipFile", [source]);
42061 } else if (format.equals ("GFF v2 or v3")) {
42062 this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("Gff3File", [this.inFile, type]);
42063 } else if (format.equals ("JSON")) {
42064 this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("JSONFile", [source]);
42065 } else if (format.equals ("HTML")) {
42066 this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("HtmlFile", [source]);
42067 }return this.buildAlignmentFrom (this.alignFile);
42068 } catch (e) {
42069 if (Clazz_exceptionOf (e, Exception)) {
42070 e.printStackTrace ();
42071 System.err.println ("Failed to read alignment using the '" + format + "' reader.\n" + e);
42072 if (e.getMessage () != null && e.getMessage ().startsWith (jalview.io.AppletFormatAdapter.INVALID_CHARACTERS)) {
42073 throw  new java.io.IOException (e.getMessage ());
42074 }if (type.equalsIgnoreCase ("Paste")) {
42075 try {
42076 this.alignFile = jalview.jsdev.GenericFileAdapter.getFile ("FastaFile", [">UNKNOWN\n" + this.inFile, "Paste"]);
42077 return this.buildAlignmentFrom (this.alignFile);
42078 } catch (ex) {
42079 if (Clazz_exceptionOf (ex, Exception)) {
42080 if (ex.toString ().startsWith (jalview.io.AppletFormatAdapter.INVALID_CHARACTERS)) {
42081 throw  new java.io.IOException (e.getMessage ());
42082 }ex.printStackTrace ();
42083 } else {
42084 throw ex;
42085 }
42086 }
42087 }throw  new java.io.IOException (jalview.io.AppletFormatAdapter.SUPPORTED_FORMATS);
42088 } else {
42089 throw e;
42090 }
42091 }
42092 }, "jalview.io.FileParse,~S");
42093 Clazz_defineMethod (c$, "buildAlignmentFrom", 
42094  function (alignFile2) {
42095 var al =  new jalview.datamodel.Alignment (this.alignFile.getSeqsAsArray ());
42096 this.alignFile.addAnnotations (al);
42097 this.alignFile.addGroups (al);
42098 return al;
42099 }, "jalview.io.AlignFile");
42100 Clazz_defineMethod (c$, "formatSequences", 
42101 function (format, jvsuffix, ap, selectedOnly) {
42102 var selvew = ap.getAlignViewport ().getAlignmentView (selectedOnly, false);
42103 var aselview = selvew.getVisibleAlignment (ap.getAlignViewport ().getGapCharacter ());
42104 var ala = (ap.getAlignViewport ().getVisibleAlignmentAnnotation (selectedOnly));
42105 if (ala != null) {
42106 for (var aa, $aa = ala.iterator (); $aa.hasNext () && ((aa = $aa.next ()) || true);) {
42107 aselview.addAnnotation (aa);
42108 }
42109 }this.viewpanel = ap;
42110 return this.formatSequences (format, aselview, jvsuffix);
42111 }, "~S,~B,jalview.api.AlignmentViewPanel,~B");
42112 Clazz_defineMethod (c$, "formatSequences", 
42113 function (format, alignment, jvsuffix) {
42114 try {
42115 var afile = null;
42116 if (format.equalsIgnoreCase ("FASTA")) {
42117 afile = jalview.jsdev.GenericFileAdapter.getFile ("FastaFile", []);
42118 } else if (format.equalsIgnoreCase ("MSF")) {
42119 afile = jalview.jsdev.GenericFileAdapter.getFile ("MSFfile", []);
42120 } else if (format.equalsIgnoreCase ("PileUp")) {
42121 afile = jalview.jsdev.GenericFileAdapter.getFile ("PileUpfile", []);
42122 } else if (format.equalsIgnoreCase ("CLUSTAL")) {
42123 afile = jalview.jsdev.GenericFileAdapter.getFile ("ClustalFile", []);
42124 } else if (format.equalsIgnoreCase ("BLC")) {
42125 afile = jalview.jsdev.GenericFileAdapter.getFile ("BLCFile", []);
42126 } else if (format.equalsIgnoreCase ("PIR")) {
42127 afile = jalview.jsdev.GenericFileAdapter.getFile ("PIRFile", []);
42128 } else if (format.equalsIgnoreCase ("PFAM")) {
42129 afile = jalview.jsdev.GenericFileAdapter.getFile ("PfamFile", []);
42130 } else if (format.equalsIgnoreCase ("STH")) {
42131 afile = jalview.jsdev.GenericFileAdapter.getFile ("StockholmFile", [alignment]);
42132 } else if (format.equalsIgnoreCase ("AMSA")) {
42133 afile = jalview.jsdev.GenericFileAdapter.getFile ("AMSAFile", [alignment]);
42134 } else if (format.equalsIgnoreCase ("PHYLIP")) {
42135 afile = jalview.jsdev.GenericFileAdapter.getFile ("PhylipFile", []);
42136 } else if (format.equalsIgnoreCase ("JSON")) {
42137 afile = jalview.jsdev.GenericFileAdapter.getFile ("JSONFile", []);
42138 } else if (format.equalsIgnoreCase ("RNAML")) {
42139 afile = jalview.jsdev.GenericFileAdapter.getFile ("RnamlFile", []);
42140 } else {
42141 throw  new Exception (jalview.util.MessageManager.getString ("error.implementation_error_unknown_file_format_string"));
42142 }afile.setNewlineString (this.newline);
42143 afile.addJVSuffix (jvsuffix);
42144 afile.setExportSettings (this.exportSettings);
42145 afile.configureForView (this.viewpanel);
42146 if (this.viewpanel == null || this.viewpanel.getAlignment () == null || this.viewpanel.getAlignment () !== alignment) {
42147 afile.setSeqs (alignment.getSequencesArray ());
42148 } else {
42149 afile.setSeqs (this.viewpanel.getAlignment ().getSequencesArray ());
42150 }var afileresp = afile.print ();
42151 if (afile.hasWarningMessage ()) {
42152 System.err.println ("Warning raised when writing as " + format + " : " + afile.getWarningMessage ());
42153 }return afileresp;
42154 } catch (e) {
42155 if (Clazz_exceptionOf (e, Exception)) {
42156 System.err.println ("Failed to write alignment as a '" + format + "' file\n");
42157 e.printStackTrace ();
42158 } else {
42159 throw e;
42160 }
42161 }
42162 return null;
42163 }, "~S,jalview.datamodel.AlignmentI,~B");
42164 c$.checkProtocol = Clazz_defineMethod (c$, "checkProtocol", 
42165 function (file) {
42166 var protocol = jalview.io.AppletFormatAdapter.FILE;
42167 var ft = file.toLowerCase ().trim ();
42168 if (ft.indexOf ("http:") == 0 || ft.indexOf ("https:") == 0 || ft.indexOf ("file:") == 0) {
42169 protocol = jalview.io.AppletFormatAdapter.URL;
42170 }return protocol;
42171 }, "~S");
42172 c$.resolveProtocol = Clazz_defineMethod (c$, "resolveProtocol", 
42173 function (file, format) {
42174 return jalview.io.AppletFormatAdapter.resolveProtocol (file, format, false);
42175 }, "~S,~S");
42176 c$.resolveProtocol = Clazz_defineMethod (c$, "resolveProtocol", 
42177 function (file, format, debug) {
42178 var protocol = null;
42179 if (debug) {
42180 System.out.println ("resolving datasource started with:\n>>file\n" + file + ">>endfile");
42181 }try {
42182 var rtn = false;
42183 var is = System.getSecurityManager ().getClass ().getResourceAsStream ("/" + file);
42184 if (is != null) {
42185 rtn = true;
42186 is.close ();
42187 }if (debug) {
42188 System.err.println ("Resource '" + file + "' was " + (rtn ? "" : "not") + " located by classloader.");
42189 };if (rtn) {
42190 protocol = jalview.io.AppletFormatAdapter.CLASSLOADER;
42191 }} catch (ex) {
42192 if (Clazz_exceptionOf (ex, Exception)) {
42193 System.err.println ("Exception checking resources: " + file + " " + ex);
42194 } else {
42195 throw ex;
42196 }
42197 }
42198 if (file.indexOf ("://") > -1) {
42199 protocol = jalview.io.AppletFormatAdapter.URL;
42200 } else {
42201 protocol = jalview.io.AppletFormatAdapter.FILE;
42202 }var fp = null;
42203 try {
42204 if (debug) {
42205 System.out.println ("Trying to get contents of resource as " + protocol + ":");
42206 }fp =  new jalview.io.FileParse (file, protocol);
42207 if (!fp.isValid ()) {
42208 fp = null;
42209 } else {
42210 if (debug) {
42211 System.out.println ("Successful.");
42212 }}} catch (e) {
42213 if (Clazz_exceptionOf (e, Exception)) {
42214 if (debug) {
42215 System.err.println ("Exception when accessing content: " + e);
42216 }fp = null;
42217 } else {
42218 throw e;
42219 }
42220 }
42221 if (fp == null) {
42222 if (debug) {
42223 System.out.println ("Accessing as paste.");
42224 }protocol = jalview.io.AppletFormatAdapter.PASTE;
42225 fp = null;
42226 try {
42227 fp =  new jalview.io.FileParse (file, protocol);
42228 if (!fp.isValid ()) {
42229 fp = null;
42230 }} catch (e) {
42231 if (Clazz_exceptionOf (e, Exception)) {
42232 System.err.println ("Failed to access content as paste!");
42233 e.printStackTrace ();
42234 fp = null;
42235 } else {
42236 throw e;
42237 }
42238 }
42239 }if (fp == null) {
42240 return null;
42241 }if (format == null || format.length == 0) {
42242 return protocol;
42243 } else {
42244 try {
42245 var idformat =  new jalview.io.IdentifyFile ().Identify (file, protocol);
42246 if (idformat == null) {
42247 if (debug) {
42248 System.out.println ("Format not identified. Inaccessible file.");
42249 }return null;
42250 }if (debug) {
42251 System.out.println ("Format identified as " + idformat + "and expected as " + format);
42252 }if (idformat.equals (format)) {
42253 if (debug) {
42254 System.out.println ("Protocol identified as " + protocol);
42255 }return protocol;
42256 } else {
42257 if (debug) {
42258 System.out.println ("File deemed not accessible via " + protocol);
42259 }fp.close ();
42260 return null;
42261 }} catch (e) {
42262 if (Clazz_exceptionOf (e, Exception)) {
42263 if (debug) {
42264 System.err.println ("File deemed not accessible via " + protocol);
42265 e.printStackTrace ();
42266 };} else {
42267 throw e;
42268 }
42269 }
42270 }return null;
42271 }, "~S,~S,~B");
42272 Clazz_defineMethod (c$, "getAlignFile", 
42273 function () {
42274 return this.alignFile;
42275 });
42276 Clazz_defineMethod (c$, "setAlignFile", 
42277 function (alignFile) {
42278 this.alignFile = alignFile;
42279 }, "jalview.io.AlignFile");
42280 Clazz_defineStatics (c$,
42281 "FILE", "File",
42282 "URL", "URL",
42283 "PASTE", "Paste",
42284 "CLASSLOADER", "ClassLoader");
42285 c$.READABLE_FORMATS = c$.prototype.READABLE_FORMATS =  Clazz_newArray (-1, ["BLC", "CLUSTAL", "FASTA", "MSF", "PileUp", "PIR", "PFAM", "STH", "PDB", "JnetFile", "RNAML", "PHYLIP", "JSON", "GFF v2 or v3", "HTML"]);
42286 c$.READABLE_EXTENSIONS = c$.prototype.READABLE_EXTENSIONS =  Clazz_newArray (-1, ["fa, fasta, mfa, fastq", "aln", "pfam", "msf", "pir", "blc", "amsa", "sto,stk", "xml,rnaml", "phy", "json", ".gff2,gff3", "jar,jvp", "html"]);
42287 c$.READABLE_FNAMES = c$.prototype.READABLE_FNAMES =  Clazz_newArray (-1, ["Fasta", "Clustal", "PFAM", "MSF", "PIR", "BLC", "AMSA", "Stockholm", "RNAML", "PHYLIP", "JSON", "GFF v2 or v3", "Jalview", "HTML"]);
42288 c$.WRITEABLE_FORMATS = c$.prototype.WRITEABLE_FORMATS =  Clazz_newArray (-1, ["BLC", "CLUSTAL", "FASTA", "MSF", "PileUp", "PIR", "PFAM", "AMSA", "STH", "PHYLIP", "JSON"]);
42289 c$.WRITABLE_EXTENSIONS = c$.prototype.WRITABLE_EXTENSIONS =  Clazz_newArray (-1, ["fa, fasta, mfa, fastq", "aln", "pfam", "msf", "pir", "blc", "amsa", "sto,stk", "phy", "json", "jvp"]);
42290 c$.WRITABLE_FNAMES = c$.prototype.WRITABLE_FNAMES =  Clazz_newArray (-1, ["Fasta", "Clustal", "PFAM", "MSF", "PIR", "BLC", "AMSA", "STH", "PHYLIP", "JSON", "Jalview"]);
42291 Clazz_defineStatics (c$,
42292 "INVALID_CHARACTERS", "Contains invalid characters");
42293 c$.SUPPORTED_FORMATS = c$.prototype.SUPPORTED_FORMATS = "Formats currently supported are\n" + jalview.io.AppletFormatAdapter.prettyPrint (jalview.io.AppletFormatAdapter.READABLE_FORMATS);
42294 });
42295 Clazz_declarePackage ("jalview.io");
42296 Clazz_load (null, "jalview.io.IdentifyFile", ["jalview.io.FileParse"], function () {
42297 c$ = Clazz_declareType (jalview.io, "IdentifyFile");
42298 Clazz_defineMethod (c$, "Identify", 
42299 function (file, protocol) {
42300 var emessage = "UNIDENTIFIED FILE PARSING ERROR";
42301 var parser = null;
42302 try {
42303 parser =  new jalview.io.FileParse (file, protocol);
42304 if (parser.isValid ()) {
42305 return this.Identify (parser);
42306 }} catch (e) {
42307 if (Clazz_exceptionOf (e, Exception)) {
42308 System.err.println ("Error whilst identifying");
42309 e.printStackTrace (System.err);
42310 emessage = e.getMessage ();
42311 } else {
42312 throw e;
42313 }
42314 }
42315 if (parser != null) {
42316 return parser.errormessage;
42317 }return emessage;
42318 }, "~S,~S");
42319 Clazz_defineMethod (c$, "Identify", 
42320 function (source) {
42321 return this.Identify (source, true);
42322 }, "jalview.io.FileParse");
42323 Clazz_defineMethod (c$, "Identify", 
42324 function (source, closeSource) {
42325 var reply = "PFAM";
42326 var data;
42327 var length = 0;
42328 var lineswereskipped = false;
42329 var isBinary = false;
42330 try {
42331 if (!closeSource) {
42332 source.mark ();
42333 }while ((data = source.nextLine ()) != null) {
42334 length += data.trim ().length;
42335 if (!lineswereskipped) {
42336 for (var i = 0; !isBinary && i < data.length; i++) {
42337 var c = data.charAt (i);
42338 isBinary = (c.charCodeAt (0) < 32 && c != '\t' && c != '\n' && c != '\r' && c.charCodeAt (0) != 5 && c.charCodeAt (0) != 27);
42339 }
42340 }if (isBinary) {
42341 if (source.inFile != null) {
42342 var fileStr = source.inFile.getName ();
42343 if (fileStr.lastIndexOf (".jar") > -1 || fileStr.lastIndexOf (".zip") > -1) {
42344 reply = "Jalview";
42345 }}if (!lineswereskipped && data.startsWith ("PK")) {
42346 reply = "Jalview";
42347 break;
42348 }}data = data.toUpperCase ();
42349 if (data.startsWith ("##GFF-VERSION")) {
42350 reply = "GFF v2 or v3";
42351 break;
42352 }if (data.indexOf ("# STOCKHOLM") > -1) {
42353 reply = "STH";
42354 break;
42355 }if (data.matches ("<HTML(\"[^\"]*\"|'[^']*'|[^'\">])*>")) {
42356 reply = "HTML";
42357 break;
42358 }if (data.matches ("<RNAML (\"[^\"]*\"|'[^']*'|[^'\">])*>")) {
42359 reply = "RNAML";
42360 break;
42361 }if (data.indexOf ("{\"") > -1) {
42362 reply = "JSON";
42363 break;
42364 }if ((data.length < 1) || (data.indexOf ("#") == 0)) {
42365 lineswereskipped = true;
42366 continue;
42367 }if (data.indexOf ("PILEUP") > -1) {
42368 reply = "PileUp";
42369 break;
42370 }if ((data.indexOf ("//") == 0) || ((data.indexOf ("!!") > -1) && (data.indexOf ("!!") < data.indexOf ("_MULTIPLE_ALIGNMENT ")))) {
42371 reply = "MSF";
42372 break;
42373 } else if (data.indexOf ("CLUSTAL") > -1) {
42374 reply = "CLUSTAL";
42375 break;
42376 } else if (data.indexOf (">") > -1) {
42377 var checkPIR = false;
42378 var starterm = false;
42379 if ((data.indexOf (">P1;") > -1) || (data.indexOf (">DL;") > -1)) {
42380 checkPIR = true;
42381 reply = "PIR";
42382 }data = source.nextLine ();
42383 if (data.indexOf (">") > -1) {
42384 reply = "BLC";
42385 } else {
42386 var data1 = source.nextLine ();
42387 var data2 = source.nextLine ();
42388 var c1;
42389 if (checkPIR) {
42390 starterm = (data1 != null && data1.indexOf ("*") > -1) || (data2 != null && data2.indexOf ("*") > -1);
42391 }if (data2 != null && (c1 = data.indexOf ("*")) > -1) {
42392 if (c1 == 0 && c1 == data2.indexOf ("*")) {
42393 reply = "BLC";
42394 } else {
42395 reply = "FASTA";
42396 }} else {
42397 reply = "FASTA";
42398 if (!checkPIR) {
42399 break;
42400 }}}if (checkPIR) {
42401 var dta = null;
42402 if (!starterm) {
42403 do {
42404 try {
42405 dta = source.nextLine ();
42406 } catch (ex) {
42407 if (Clazz_exceptionOf (ex, java.io.IOException)) {
42408 } else {
42409 throw ex;
42410 }
42411 }
42412 ;if (dta != null && dta.indexOf ("*") > -1) {
42413 starterm = true;
42414 }} while (dta != null && !starterm);
42415 }if (starterm) {
42416 reply = "PIR";
42417 break;
42418 } else {
42419 reply = "FASTA";
42420 }}break;
42421 } else if (data.indexOf ("HEADER") == 0 || data.indexOf ("ATOM") == 0) {
42422 reply = "PDB";
42423 break;
42424 } else if (data.matches ("\\s*\\d+\\s+\\d+\\s*")) {
42425 reply = "PHYLIP";
42426 break;
42427 } else if (!lineswereskipped && data.charAt (0) != '*' && data.charAt (0) != ' ' && data.indexOf (":") < data.indexOf (",")) {
42428 reply = "JnetFile";
42429 break;
42430 }lineswereskipped = true;
42431 }
42432 if (closeSource) {
42433 source.close ();
42434 } else {
42435 source.reset ();
42436 }} catch (ex) {
42437 if (Clazz_exceptionOf (ex, Exception)) {
42438 System.err.println ("File Identification failed!\n" + ex);
42439 return source.errormessage;
42440 } else {
42441 throw ex;
42442 }
42443 }
42444 if (length == 0) {
42445 System.err.println ("File Identification failed! - Empty file was read.");
42446 return "EMPTY DATA FILE";
42447 }return reply;
42448 }, "jalview.io.FileParse,~B");
42449 Clazz_defineStatics (c$,
42450 "GFF3File", "GFF v2 or v3");
42451 });
42452 Clazz_declarePackage ("jalview.jsdev");
42453 Clazz_load (["jalview.io.AlignFile"], "jalview.jsdev.GenericFileAdapter", ["jalview.datamodel.AlignmentI", "jalview.io.FileParse", "java.io.BufferedReader", "$.InputStreamReader", "java.net.URL"], function () {
42454 c$ = Clazz_declareType (jalview.jsdev, "GenericFileAdapter", jalview.io.AlignFile);
42455 c$.getFile = Clazz_defineMethod (c$, "getFile", 
42456 function (fileType, params) {
42457 var cl = null;
42458 try {
42459 cl = Clazz._4Name ("jalview.io." + fileType);
42460 } catch (e) {
42461 if (Clazz_exceptionOf (e, ClassNotFoundException)) {
42462 System.err.println ("did not find file jalview.io." + fileType);
42463 return null;
42464 } else {
42465 throw e;
42466 }
42467 }
42468 var m;
42469 var ex = null;
42470 try {
42471 switch (params.length) {
42472 case 0:
42473 return cl.newInstance ();
42474 case 1:
42475 m = (Clazz_instanceOf (params[0], jalview.io.FileParse) ? cl.getConstructor ([jalview.io.FileParse]) : cl.getConstructor ([jalview.datamodel.AlignmentI]));
42476 break;
42477 case 2:
42478 m = cl.getConstructor ([String, String]);
42479 break;
42480 default:
42481 return null;
42482 }
42483 return m.newInstance (params);
42484 } catch (e$$) {
42485 if (Clazz_exceptionOf (e$$, InstantiationException)) {
42486 var e = e$$;
42487 {
42488 ex = e;
42489 }
42490 } else if (Clazz_exceptionOf (e$$, IllegalAccessException)) {
42491 var e = e$$;
42492 {
42493 ex = e;
42494 }
42495 } else if (Clazz_exceptionOf (e$$, NoSuchMethodException)) {
42496 var e = e$$;
42497 {
42498 ex = e;
42499 }
42500 } else if (Clazz_exceptionOf (e$$, SecurityException)) {
42501 var e = e$$;
42502 {
42503 ex = e;
42504 }
42505 } else if (Clazz_exceptionOf (e$$, IllegalArgumentException)) {
42506 var e = e$$;
42507 {
42508 ex = e;
42509 }
42510 } else if (Clazz_exceptionOf (e$$, java.lang.reflect.InvocationTargetException)) {
42511 var e = e$$;
42512 {
42513 ex = e;
42514 }
42515 } else {
42516 throw e$$;
42517 }
42518 }
42519 if (ex != null) {
42520 System.err.println ("Error in GenericFileAdapter: " + ex);
42521 {
42522 alert(ex)
42523 }}return null;
42524 }, "~S,~A");
42525 c$.isJS = Clazz_defineMethod (c$, "isJS", 
42526 function () {
42527 {
42528 return true;
42529 }});
42530 c$.getReader = Clazz_defineMethod (c$, "getReader", 
42531 function (fileName, forceURL) {
42532 if (!forceURL && !jalview.jsdev.GenericFileAdapter.isJS ()) return  new java.io.BufferedReader ( new java.io.FileReader (fileName));
42533 if (fileName.indexOf ("//") < 0) fileName = "file://" + fileName;
42534 return  new java.io.BufferedReader ( new java.io.InputStreamReader ( new java.net.URL (fileName).openStream ()));
42535 }, "~S,~B");
42536 Clazz_defineStatics (c$,
42537 "TCOFFEE_SCORE", "TCoffeeScore",
42538 "Phylip_FILE", 1,
42539 "Phylip_FILE_EXT", "phy",
42540 "Phylip_FILE_DESC", "PHYLIP",
42541 "JSON_FILE", 2,
42542 "JSON_FILE_EXT", "json",
42543 "JSON_FILE_DESC", "JSON",
42544 "Html_FILE", 3,
42545 "Html_FILE_EXT", "html",
42546 "Html_FILE_DESC", "HTML");
42547 });
42548 Clazz_declarePackage ("java.util.zip");
42549 Clazz_load (["java.util.zip.InflaterInputStream", "$.CRC32"], "java.util.zip.GZIPInputStream", ["java.io.EOFException", "$.IOException", "java.util.zip.CheckedInputStream", "$.Inflater", "$.ZipException"], function () {
42550 c$ = Clazz_decorateAsClass (function () {
42551 this.crc = null;
42552 this.eos = false;
42553 this.$closed = false;
42554 this.tmpbuf = null;
42555 Clazz_instantialize (this, arguments);
42556 }, java.util.zip, "GZIPInputStream", java.util.zip.InflaterInputStream);
42557 Clazz_prepareFields (c$, function () {
42558 this.crc =  new java.util.zip.CRC32 ();
42559 this.tmpbuf =  Clazz_newByteArray (128, 0);
42560 });
42561 Clazz_defineMethod (c$, "ensureOpen", 
42562  function () {
42563 if (this.$closed) {
42564 throw  new java.io.IOException ("Stream closed");
42565 }});
42566 Clazz_makeConstructor (c$, 
42567 function ($in, size) {
42568 Clazz_superConstructor (this, java.util.zip.GZIPInputStream, [$in,  new java.util.zip.Inflater ().init (0, true), size]);
42569 this.readHeader ($in);
42570 }, "java.io.InputStream,~N");
42571 Clazz_overrideMethod (c$, "read", 
42572 function (buf, off, len) {
42573 this.ensureOpen ();
42574 if (this.eos) {
42575 return -1;
42576 }var n = this.readInf (buf, off, len);
42577 if (n == -1) {
42578 if (this.readTrailer ()) this.eos = true;
42579  else return this.read (buf, off, len);
42580 } else {
42581 this.crc.update (buf, off, n);
42582 }return n;
42583 }, "~A,~N,~N");
42584 Clazz_defineMethod (c$, "close", 
42585 function () {
42586 if (!this.$closed) {
42587 Clazz_superCall (this, java.util.zip.GZIPInputStream, "close", []);
42588 this.eos = true;
42589 this.$closed = true;
42590 }});
42591 Clazz_defineMethod (c$, "readHeader", 
42592  function (this_in) {
42593 var $in =  new java.util.zip.CheckedInputStream (this_in).set (this.crc);
42594 this.crc.reset ();
42595 if (this.readUShort ($in) != 35615) {
42596 throw  new java.util.zip.ZipException ("Not in GZIP format");
42597 }if (this.readUByte ($in) != 8) {
42598 throw  new java.util.zip.ZipException ("Unsupported compression method");
42599 }var flg = this.readUByte ($in);
42600 this.skipBytes ($in, 6);
42601 var n = 10;
42602 if ((flg & 4) == 4) {
42603 var m = this.readUShort ($in);
42604 this.skipBytes ($in, m);
42605 n += m + 2;
42606 }if ((flg & 8) == 8) {
42607 do {
42608 n++;
42609 } while (this.readUByte ($in) != 0);
42610 }if ((flg & 16) == 16) {
42611 do {
42612 n++;
42613 } while (this.readUByte ($in) != 0);
42614 }if ((flg & 2) == 2) {
42615 var v = this.crc.getValue () & 0xffff;
42616 if (this.readUShort ($in) != v) {
42617 throw  new java.util.zip.ZipException ("Corrupt GZIP header");
42618 }n += 2;
42619 }this.crc.reset ();
42620 return n;
42621 }, "java.io.InputStream");
42622 Clazz_defineMethod (c$, "readTrailer", 
42623  function () {
42624 return true;
42625 });
42626 Clazz_defineMethod (c$, "readUShort", 
42627  function ($in) {
42628 var b = this.readUByte ($in);
42629 return (this.readUByte ($in) << 8) | b;
42630 }, "java.io.InputStream");
42631 Clazz_defineMethod (c$, "readUByte", 
42632  function ($in) {
42633 var b = $in.readByteAsInt ();
42634 if (b == -1) {
42635 throw  new java.io.EOFException ();
42636 }if (b < -1 || b > 255) {
42637 throw  new java.io.IOException (this.$in.getClass ().getName () + ".read() returned value out of range -1..255: " + b);
42638 }return b;
42639 }, "java.io.InputStream");
42640 Clazz_defineMethod (c$, "skipBytes", 
42641  function ($in, n) {
42642 while (n > 0) {
42643 var len = $in.read (this.tmpbuf, 0, n < this.tmpbuf.length ? n : this.tmpbuf.length);
42644 if (len == -1) {
42645 throw  new java.io.EOFException ();
42646 }n -= len;
42647 }
42648 }, "java.io.InputStream,~N");
42649 Clazz_defineStatics (c$,
42650 "GZIP_MAGIC", 0x8b1f,
42651 "FHCRC", 2,
42652 "FEXTRA", 4,
42653 "FNAME", 8,
42654 "FCOMMENT", 16);
42655 });
42656 Clazz_declarePackage ("java.util.zip");
42657 Clazz_load (["JU.InflaterInputStream"], "java.util.zip.InflaterInputStream", null, function () {
42658 c$ = Clazz_decorateAsClass (function () {
42659 this.inf = null;
42660 Clazz_instantialize (this, arguments);
42661 }, java.util.zip, "InflaterInputStream", JU.InflaterInputStream);
42662 Clazz_makeConstructor (c$, 
42663 function ($in, inflater, size) {
42664 Clazz_superConstructor (this, java.util.zip.InflaterInputStream, [$in, inflater, size, true]);
42665 this.inf = inflater;
42666 }, "java.io.InputStream,java.util.zip.Inflater,~N");
42667 });
42668 Clazz_declarePackage ("JU");
42669 Clazz_load (["java.io.FilterInputStream"], "JU.InflaterInputStream", ["java.io.EOFException", "$.IOException", "java.lang.IllegalArgumentException", "$.IndexOutOfBoundsException", "$.NullPointerException"], function () {
42670 c$ = Clazz_decorateAsClass (function () {
42671 this.inflater = null;
42672 this.buf = null;
42673 this.len = 0;
42674 this.closed = false;
42675 this.eof = false;
42676 this.close_in = true;
42677 this.myinflater = false;
42678 this.byte1 = null;
42679 this.b = null;
42680 Clazz_instantialize (this, arguments);
42681 }, JU, "InflaterInputStream", java.io.FilterInputStream);
42682 Clazz_prepareFields (c$, function () {
42683 this.byte1 =  Clazz_newByteArray (1, 0);
42684 this.b =  Clazz_newByteArray (512, 0);
42685 });
42686 Clazz_makeConstructor (c$, 
42687 function ($in, inflater, size, close_in) {
42688 Clazz_superConstructor (this, JU.InflaterInputStream, [$in]);
42689 this.inflater = inflater;
42690 this.buf =  Clazz_newByteArray (size, 0);
42691 this.close_in = close_in;
42692 }, "java.io.InputStream,JU.Inflater,~N,~B");
42693 Clazz_overrideMethod (c$, "readByteAsInt", 
42694 function () {
42695 if (this.closed) {
42696 throw  new java.io.IOException ("Stream closed");
42697 }return this.read (this.byte1, 0, 1) == -1 ? -1 : this.byte1[0] & 0xff;
42698 });
42699 Clazz_overrideMethod (c$, "read", 
42700 function (b, off, len) {
42701 return this.readInf (b, off, len);
42702 }, "~A,~N,~N");
42703 Clazz_defineMethod (c$, "readInf", 
42704 function (b, off, len) {
42705 if (this.closed) {
42706 throw  new java.io.IOException ("Stream closed");
42707 }if (b == null) {
42708 throw  new NullPointerException ();
42709 } else if (off < 0 || len < 0 || len > b.length - off) {
42710 throw  new IndexOutOfBoundsException ();
42711 } else if (len == 0) {
42712 return 0;
42713 } else if (this.eof) {
42714 return -1;
42715 }var n = 0;
42716 this.inflater.setOutput (b, off, len);
42717 while (!this.eof) {
42718 if (this.inflater.avail_in == 0) this.fill ();
42719 var err = this.inflater.inflate (0);
42720 n += this.inflater.next_out_index - off;
42721 off = this.inflater.next_out_index;
42722 switch (err) {
42723 case -3:
42724 throw  new java.io.IOException (this.inflater.msg);
42725 case 1:
42726 case 2:
42727 this.eof = true;
42728 if (err == 2) return -1;
42729 break;
42730 default:
42731 }
42732 if (this.inflater.avail_out == 0) break;
42733 }
42734 return n;
42735 }, "~A,~N,~N");
42736 Clazz_overrideMethod (c$, "available", 
42737 function () {
42738 if (this.closed) {
42739 throw  new java.io.IOException ("Stream closed");
42740 }return (this.eof ? 0 : 1);
42741 });
42742 Clazz_overrideMethod (c$, "skip", 
42743 function (n) {
42744 if (n < 0) {
42745 throw  new IllegalArgumentException ("negative skip length");
42746 }if (this.closed) {
42747 throw  new java.io.IOException ("Stream closed");
42748 }var max = Math.min (n, 2147483647);
42749 var total = 0;
42750 while (total < max) {
42751 var len = max - total;
42752 if (len > this.b.length) {
42753 len = this.b.length;
42754 }len = this.read (this.b, 0, len);
42755 if (len == -1) {
42756 this.eof = true;
42757 break;
42758 }total += len;
42759 }
42760 return total;
42761 }, "~N");
42762 Clazz_overrideMethod (c$, "close", 
42763 function () {
42764 if (!this.closed) {
42765 if (this.myinflater) this.inflater.end ();
42766 if (this.close_in) this.$in.close ();
42767 this.closed = true;
42768 }});
42769 Clazz_defineMethod (c$, "fill", 
42770 function () {
42771 if (this.closed) {
42772 throw  new java.io.IOException ("Stream closed");
42773 }this.len = this.$in.read (this.buf, 0, this.buf.length);
42774 if (this.len == -1) {
42775 if (this.inflater.istate.wrap == 0 && !this.inflater.finished ()) {
42776 this.buf[0] = 0;
42777 this.len = 1;
42778 } else if (this.inflater.istate.was != -1) {
42779 throw  new java.io.IOException ("footer is not found");
42780 } else {
42781 throw  new java.io.EOFException ("Unexpected end of ZLIB input stream");
42782 }}this.inflater.setInput (this.buf, 0, this.len, true);
42783 });
42784 Clazz_overrideMethod (c$, "markSupported", 
42785 function () {
42786 return false;
42787 });
42788 Clazz_overrideMethod (c$, "mark", 
42789 function (readlimit) {
42790 }, "~N");
42791 Clazz_overrideMethod (c$, "reset", 
42792 function () {
42793 throw  new java.io.IOException ("mark/reset not supported");
42794 });
42795 Clazz_defineMethod (c$, "getTotalIn", 
42796 function () {
42797 return this.inflater.getTotalIn ();
42798 });
42799 Clazz_defineMethod (c$, "getTotalOut", 
42800 function () {
42801 return this.inflater.getTotalOut ();
42802 });
42803 Clazz_defineMethod (c$, "getAvailIn", 
42804 function () {
42805 if (this.inflater.avail_in <= 0) return null;
42806 var tmp =  Clazz_newByteArray (this.inflater.avail_in, 0);
42807 System.arraycopy (this.inflater.next_in, this.inflater.next_in_index, tmp, 0, this.inflater.avail_in);
42808 return tmp;
42809 });
42810 Clazz_defineMethod (c$, "readHeader", 
42811 function () {
42812 var empty = "".getBytes ();
42813 this.inflater.setInput (empty, 0, 0, false);
42814 this.inflater.setOutput (empty, 0, 0);
42815 var err = this.inflater.inflate (0);
42816 if (!this.inflater.istate.inParsingHeader ()) {
42817 return;
42818 }var b1 =  Clazz_newByteArray (1, 0);
42819 do {
42820 var i = this.$in.read (b1, 0, 1);
42821 if (i <= 0) throw  new java.io.IOException ("no input");
42822 this.inflater.setInput (b1, 0, b1.length, false);
42823 err = this.inflater.inflate (0);
42824 if (err != 0) throw  new java.io.IOException (this.inflater.msg);
42825 } while (this.inflater.istate.inParsingHeader ());
42826 });
42827 Clazz_defineMethod (c$, "getInflater", 
42828 function () {
42829 return this.inflater;
42830 });
42831 Clazz_defineStatics (c$,
42832 "DEFAULT_BUFSIZE", 512);
42833 });
42834 Clazz_declarePackage ("java.util.zip");
42835 Clazz_load (["JU.CRC32"], "java.util.zip.CRC32", null, function () {
42836 c$ = Clazz_declareType (java.util.zip, "CRC32", JU.CRC32);
42837 });
42838 Clazz_declarePackage ("JU");
42839 Clazz_load (["JU.Checksum"], "JU.CRC32", null, function () {
42840 c$ = Clazz_decorateAsClass (function () {
42841 this.crc = 0;
42842 this.b1 = null;
42843 Clazz_instantialize (this, arguments);
42844 }, JU, "CRC32", null, JU.Checksum);
42845 Clazz_prepareFields (c$, function () {
42846 this.b1 =  Clazz_newByteArray (1, 0);
42847 });
42848 Clazz_overrideMethod (c$, "update", 
42849 function (buf, index, len) {
42850 var c = ~this.crc;
42851 while (--len >= 0) c = JU.CRC32.crc_table[(c ^ buf[index++]) & 0xff] ^ (c >>> 8);
42852
42853 this.crc = ~c;
42854 }, "~A,~N,~N");
42855 Clazz_overrideMethod (c$, "reset", 
42856 function () {
42857 this.crc = 0;
42858 });
42859 Clazz_overrideMethod (c$, "resetLong", 
42860 function (vv) {
42861 this.crc = (vv & 0xffffffff);
42862 }, "~N");
42863 Clazz_overrideMethod (c$, "getValue", 
42864 function () {
42865 return this.crc & 0xffffffff;
42866 });
42867 Clazz_overrideMethod (c$, "updateByteAsInt", 
42868 function (b) {
42869 this.b1[0] = b;
42870 this.update (this.b1, 0, 1);
42871 }, "~N");
42872 Clazz_defineStatics (c$,
42873 "crc_table",  Clazz_newIntArray (-1, [0, 1996959894, -301047508, -1727442502, 124634137, 1886057615, -379345611, -1637575261, 249268274, 2044508324, -522852066, -1747789432, 162941995, 2125561021, -407360249, -1866523247, 498536548, 1789927666, -205950648, -2067906082, 450548861, 1843258603, -187386543, -2083289657, 325883990, 1684777152, -43845254, -1973040660, 335633487, 1661365465, -99664541, -1928851979, 997073096, 1281953886, -715111964, -1570279054, 1006888145, 1258607687, -770865667, -1526024853, 901097722, 1119000684, -608450090, -1396901568, 853044451, 1172266101, -589951537, -1412350631, 651767980, 1373503546, -925412992, -1076862698, 565507253, 1454621731, -809855591, -1195530993, 671266974, 1594198024, -972236366, -1324619484, 795835527, 1483230225, -1050600021, -1234817731, 1994146192, 31158534, -1731059524, -271249366, 1907459465, 112637215, -1614814043, -390540237, 2013776290, 251722036, -1777751922, -519137256, 2137656763, 141376813, -1855689577, -429695999, 1802195444, 476864866, -2056965928, -228458418, 1812370925, 453092731, -2113342271, -183516073, 1706088902, 314042704, -1950435094, -54949764, 1658658271, 366619977, -1932296973, -69972891, 1303535960, 984961486, -1547960204, -725929758, 1256170817, 1037604311, -1529756563, -740887301, 1131014506, 879679996, -1385723834, -631195440, 1141124467, 855842277, -1442165665, -586318647, 1342533948, 654459306, -1106571248, -921952122, 1466479909, 544179635, -1184443383, -832445281, 1591671054, 702138776, -1328506846, -942167884, 1504918807, 783551873, -1212326853, -1061524307, -306674912, -1698712650, 62317068, 1957810842, -355121351, -1647151185, 81470997, 1943803523, -480048366, -1805370492, 225274430, 2053790376, -468791541, -1828061283, 167816743, 2097651377, -267414716, -2029476910, 503444072, 1762050814, -144550051, -2140837941, 426522225, 1852507879, -19653770, -1982649376, 282753626, 1742555852, -105259153, -1900089351, 397917763, 1622183637, -690576408, -1580100738, 953729732, 1340076626, -776247311, -1497606297, 1068828381, 1219638859, -670225446, -1358292148, 906185462, 1090812512, -547295293, -1469587627, 829329135, 1181335161, -882789492, -1134132454, 628085408, 1382605366, -871598187, -1156888829, 570562233, 1426400815, -977650754, -1296233688, 733239954, 1555261956, -1026031705, -1244606671, 752459403, 1541320221, -1687895376, -328994266, 1969922972, 40735498, -1677130071, -351390145, 1913087877, 83908371, -1782625662, -491226604, 2075208622, 213261112, -1831694693, -438977011, 2094854071, 198958881, -2032938284, -237706686, 1759359992, 534414190, -2118248755, -155638181, 1873836001, 414664567, -2012718362, -15766928, 1711684554, 285281116, -1889165569, -127750551, 1634467795, 376229701, -1609899400, -686959890, 1308918612, 956543938, -1486412191, -799009033, 1231636301, 1047427035, -1362007478, -640263460, 1088359270, 936918000, -1447252397, -558129467, 1202900863, 817233897, -1111625188, -893730166, 1404277552, 615818150, -1160759803, -841546093, 1423857449, 601450431, -1285129682, -1000256840, 1567103746, 711928724, -1274298825, -1022587231, 1510334235, 755167117]));
42874 });
42875 Clazz_declarePackage ("JU");
42876 Clazz_declareInterface (JU, "Checksum");
42877 Clazz_declarePackage ("java.util.zip");
42878 Clazz_load (["java.io.FilterInputStream"], "java.util.zip.CheckedInputStream", null, function () {
42879 c$ = Clazz_decorateAsClass (function () {
42880 this.cksum = null;
42881 Clazz_instantialize (this, arguments);
42882 }, java.util.zip, "CheckedInputStream", java.io.FilterInputStream);
42883 Clazz_defineMethod (c$, "set", 
42884 function (cksum) {
42885 this.$in = this.$in;
42886 this.cksum = cksum;
42887 return this;
42888 }, "JU.Checksum");
42889 Clazz_overrideMethod (c$, "readByteAsInt", 
42890 function () {
42891 var b = this.$in.readByteAsInt ();
42892 if (b != -1) {
42893 this.cksum.updateByteAsInt (b);
42894 }return b;
42895 });
42896 Clazz_overrideMethod (c$, "read", 
42897 function (buf, off, len) {
42898 len = this.$in.read (buf, off, len);
42899 if (len != -1) {
42900 this.cksum.update (buf, off, len);
42901 }return len;
42902 }, "~A,~N,~N");
42903 Clazz_overrideMethod (c$, "skip", 
42904 function (n) {
42905 var buf =  Clazz_newByteArray (512, 0);
42906 var total = 0;
42907 while (total < n) {
42908 var len = n - total;
42909 len = this.read (buf, 0, len < buf.length ? len : buf.length);
42910 if (len == -1) {
42911 return total;
42912 }total += len;
42913 }
42914 return total;
42915 }, "~N");
42916 Clazz_defineMethod (c$, "getChecksum", 
42917 function () {
42918 return this.cksum;
42919 });
42920 });
42921 Clazz_declarePackage ("java.util.zip");
42922 Clazz_load (["JU.Inflater"], "java.util.zip.Inflater", null, function () {
42923 c$ = Clazz_declareType (java.util.zip, "Inflater", JU.Inflater);
42924 Clazz_defineMethod (c$, "initialize", 
42925 function (nowrap) {
42926 return this.init (0, nowrap);
42927 }, "~B");
42928 });
42929 Clazz_declarePackage ("JU");
42930 Clazz_load (["JU.ZStream"], "JU.Inflater", ["JU.Inflate"], function () {
42931 c$ = Clazz_declareType (JU, "Inflater", JU.ZStream);
42932 Clazz_defineMethod (c$, "init", 
42933 function (w, nowrap) {
42934 this.setAdler32 ();
42935 if (w == 0) w = 15;
42936 this.istate =  new JU.Inflate (this);
42937 this.istate.inflateInit (nowrap ? -w : w);
42938 return this;
42939 }, "~N,~B");
42940 Clazz_overrideMethod (c$, "inflate", 
42941 function (f) {
42942 if (this.istate == null) return -2;
42943 var ret = this.istate.inflate (f);
42944 return ret;
42945 }, "~N");
42946 Clazz_overrideMethod (c$, "end", 
42947 function () {
42948 if (this.istate == null) return -2;
42949 var ret = this.istate.inflateEnd ();
42950 return ret;
42951 });
42952 Clazz_defineMethod (c$, "sync", 
42953 function () {
42954 if (this.istate == null) return -2;
42955 return this.istate.inflateSync ();
42956 });
42957 Clazz_defineMethod (c$, "syncPoint", 
42958 function () {
42959 if (this.istate == null) return -2;
42960 return this.istate.inflateSyncPoint ();
42961 });
42962 Clazz_defineMethod (c$, "setDictionary", 
42963 function (dictionary, dictLength) {
42964 if (this.istate == null) return -2;
42965 return this.istate.inflateSetDictionary (dictionary, dictLength);
42966 }, "~A,~N");
42967 Clazz_overrideMethod (c$, "finished", 
42968 function () {
42969 return this.istate.mode == 12;
42970 });
42971 Clazz_defineMethod (c$, "reset", 
42972 function () {
42973 this.avail_in = 0;
42974 if (this.istate != null) this.istate.reset ();
42975 });
42976 Clazz_defineStatics (c$,
42977 "MAX_WBITS", 15,
42978 "DEF_WBITS", 15,
42979 "$Z_STREAM_ERROR", -2);
42980 });
42981 Clazz_declarePackage ("JU");
42982 Clazz_load (null, "JU.ZStream", ["JU.Adler32"], function () {
42983 c$ = Clazz_decorateAsClass (function () {
42984 this.next_in = null;
42985 this.next_in_index = 0;
42986 this.avail_in = 0;
42987 this.total_in = 0;
42988 this.next_out = null;
42989 this.next_out_index = 0;
42990 this.avail_out = 0;
42991 this.total_out = 0;
42992 this.msg = null;
42993 this.dstate = null;
42994 this.istate = null;
42995 this.data_type = 0;
42996 this.checksum = null;
42997 Clazz_instantialize (this, arguments);
42998 }, JU, "ZStream");
42999 Clazz_defineMethod (c$, "setAdler32", 
43000 function () {
43001 this.checksum =  new JU.Adler32 ();
43002 });
43003 Clazz_defineMethod (c$, "inflate", 
43004 function (f) {
43005 if (this.istate == null) return -2;
43006 return this.istate.inflate (f);
43007 }, "~N");
43008 Clazz_defineMethod (c$, "deflate", 
43009 function (flush) {
43010 if (this.dstate == null) {
43011 return -2;
43012 }return this.dstate.deflate (flush);
43013 }, "~N");
43014 Clazz_defineMethod (c$, "flush_pending", 
43015 function () {
43016 var len = this.dstate.pending;
43017 if (len > this.avail_out) len = this.avail_out;
43018 if (len == 0) return;
43019 System.arraycopy (this.dstate.pending_buf, this.dstate.pending_out, this.next_out, this.next_out_index, len);
43020 this.next_out_index += len;
43021 this.dstate.pending_out += len;
43022 this.total_out += len;
43023 this.avail_out -= len;
43024 this.dstate.pending -= len;
43025 if (this.dstate.pending == 0) {
43026 this.dstate.pending_out = 0;
43027 }});
43028 Clazz_defineMethod (c$, "read_buf", 
43029 function (buf, start, size) {
43030 var len = this.avail_in;
43031 if (len > size) len = size;
43032 if (len == 0) return 0;
43033 this.avail_in -= len;
43034 if (this.dstate.wrap != 0) {
43035 this.checksum.update (this.next_in, this.next_in_index, len);
43036 }System.arraycopy (this.next_in, this.next_in_index, buf, start, len);
43037 this.next_in_index += len;
43038 this.total_in += len;
43039 return len;
43040 }, "~A,~N,~N");
43041 Clazz_defineMethod (c$, "getAdler", 
43042 function () {
43043 return this.checksum.getValue ();
43044 });
43045 Clazz_defineMethod (c$, "free", 
43046 function () {
43047 this.next_in = null;
43048 this.next_out = null;
43049 this.msg = null;
43050 });
43051 Clazz_defineMethod (c$, "setOutput", 
43052 function (buf, off, len) {
43053 this.next_out = buf;
43054 this.next_out_index = off;
43055 this.avail_out = len;
43056 }, "~A,~N,~N");
43057 Clazz_defineMethod (c$, "setInput", 
43058 function (buf, off, len, append) {
43059 if (len <= 0 && append && this.next_in != null) return;
43060 if (this.avail_in > 0 && append) {
43061 var tmp =  Clazz_newByteArray (this.avail_in + len, 0);
43062 System.arraycopy (this.next_in, this.next_in_index, tmp, 0, this.avail_in);
43063 System.arraycopy (buf, off, tmp, this.avail_in, len);
43064 this.next_in = tmp;
43065 this.next_in_index = 0;
43066 this.avail_in += len;
43067 } else {
43068 this.next_in = buf;
43069 this.next_in_index = off;
43070 this.avail_in = len;
43071 }}, "~A,~N,~N,~B");
43072 Clazz_defineMethod (c$, "getAvailIn", 
43073 function () {
43074 return this.avail_in;
43075 });
43076 Clazz_defineMethod (c$, "getTotalOut", 
43077 function () {
43078 return this.total_out;
43079 });
43080 Clazz_defineMethod (c$, "getTotalIn", 
43081 function () {
43082 return this.total_in;
43083 });
43084 c$.getBytes = Clazz_defineMethod (c$, "getBytes", 
43085 function (s) {
43086 {
43087 var x = [];
43088 for (var i = 0; i < s.length;i++) {
43089 var pt = s.charCodeAt(i);
43090 if (pt <= 0x7F) {
43091 x.push(pt);
43092 } else if (pt <= 0x7FF) {
43093 x.push(0xC0|((pt>>6)&0x1F));
43094 x.push(0x80|(pt&0x3F));
43095 } else if (pt <= 0xFFFF) {
43096 x.push(0xE0|((pt>>12)&0xF));
43097 x.push(0x80|((pt>>6)&0x3F));
43098 x.push(0x80|(pt&0x3F));
43099 } else {
43100 x.push(0x3F); // '?'
43101 }
43102 }
43103 return (Int32Array != Array ? new Int32Array(x) : x);
43104 }}, "~S");
43105 Clazz_defineStatics (c$,
43106 "Z_STREAM_ERROR", -2);
43107 });
43108 Clazz_declarePackage ("JU");
43109 Clazz_load (["JU.Checksum"], "JU.Adler32", null, function () {
43110 c$ = Clazz_decorateAsClass (function () {
43111 this.s1 = 1;
43112 this.s2 = 0;
43113 this.b1 = null;
43114 Clazz_instantialize (this, arguments);
43115 }, JU, "Adler32", null, JU.Checksum);
43116 Clazz_prepareFields (c$, function () {
43117 this.b1 =  Clazz_newByteArray (1, 0);
43118 });
43119 Clazz_overrideMethod (c$, "resetLong", 
43120 function (init) {
43121 this.s1 = init & 0xffff;
43122 this.s2 = (init >> 16) & 0xffff;
43123 }, "~N");
43124 Clazz_overrideMethod (c$, "reset", 
43125 function () {
43126 this.s1 = 1;
43127 this.s2 = 0;
43128 });
43129 Clazz_overrideMethod (c$, "getValue", 
43130 function () {
43131 return ((this.s2 << 16) | this.s1);
43132 });
43133 Clazz_overrideMethod (c$, "update", 
43134 function (buf, index, len) {
43135 if (len == 1) {
43136 this.s1 += buf[index++] & 0xff;
43137 this.s2 += this.s1;
43138 this.s1 %= 65521;
43139 this.s2 %= 65521;
43140 return;
43141 }var len1 = Clazz_doubleToInt (len / 5552);
43142 var len2 = len % 5552;
43143 while (len1-- > 0) {
43144 var k = 5552;
43145 len -= k;
43146 while (k-- > 0) {
43147 this.s1 += buf[index++] & 0xff;
43148 this.s2 += this.s1;
43149 }
43150 this.s1 %= 65521;
43151 this.s2 %= 65521;
43152 }
43153 var k = len2;
43154 len -= k;
43155 while (k-- > 0) {
43156 this.s1 += buf[index++] & 0xff;
43157 this.s2 += this.s1;
43158 }
43159 this.s1 %= 65521;
43160 this.s2 %= 65521;
43161 }, "~A,~N,~N");
43162 Clazz_overrideMethod (c$, "updateByteAsInt", 
43163 function (b) {
43164 this.b1[0] = b;
43165 this.update (this.b1, 0, 1);
43166 }, "~N");
43167 Clazz_defineStatics (c$,
43168 "BASE", 65521,
43169 "NMAX", 5552);
43170 });
43171 Clazz_declarePackage ("JU");
43172 Clazz_load (["java.lang.Exception"], "JU.Inflate", ["JU.Adler32", "$.CRC32", "$.GZIPHeader", "$.InfBlocks", "java.io.ByteArrayOutputStream"], function () {
43173 c$ = Clazz_decorateAsClass (function () {
43174 this.mode = 0;
43175 this.method = 0;
43176 this.was = -1;
43177 this.need = 0;
43178 this.marker = 0;
43179 this.wrap = 0;
43180 this.wbits = 0;
43181 this.blocks = null;
43182 this.z = null;
43183 this.flags = 0;
43184 this.need_bytes = -1;
43185 this.crcbuf = null;
43186 this.gheader = null;
43187 if (!Clazz_isClassDefined ("JU.Inflate.Return")) {
43188 JU.Inflate.$Inflate$Return$ ();
43189 }
43190 this.tmp_string = null;
43191 Clazz_instantialize (this, arguments);
43192 }, JU, "Inflate");
43193 Clazz_prepareFields (c$, function () {
43194 this.crcbuf =  Clazz_newByteArray (4, 0);
43195 });
43196 Clazz_defineMethod (c$, "reset", 
43197 function () {
43198 this.inflateReset ();
43199 });
43200 Clazz_defineMethod (c$, "inflateReset", 
43201 function () {
43202 if (this.z == null) return -2;
43203 this.z.total_in = this.z.total_out = 0;
43204 this.z.msg = null;
43205 this.mode = 14;
43206 this.need_bytes = -1;
43207 this.blocks.reset ();
43208 return 0;
43209 });
43210 Clazz_defineMethod (c$, "inflateEnd", 
43211 function () {
43212 if (this.blocks != null) {
43213 this.blocks.free ();
43214 }return 0;
43215 });
43216 Clazz_makeConstructor (c$, 
43217 function (z) {
43218 this.z = z;
43219 }, "JU.ZStream");
43220 Clazz_defineMethod (c$, "inflateInit", 
43221 function (w) {
43222 this.z.msg = null;
43223 this.blocks = null;
43224 this.wrap = 0;
43225 if (w < 0) {
43226 w = -w;
43227 } else {
43228 this.wrap = (w >> 4) + 1;
43229 if (w < 48) w &= 15;
43230 }if (w < 8 || w > 15) {
43231 this.inflateEnd ();
43232 return -2;
43233 }if (this.blocks != null && this.wbits != w) {
43234 this.blocks.free ();
43235 this.blocks = null;
43236 }this.wbits = w;
43237 this.blocks =  new JU.InfBlocks (this.z, 1 << w);
43238 this.inflateReset ();
43239 return 0;
43240 }, "~N");
43241 Clazz_defineMethod (c$, "inflate", 
43242 function (f) {
43243 var r;
43244 var b;
43245 if (this.z == null || this.z.next_in == null) {
43246 if (f == 4 && this.mode == 14) return 0;
43247 return -2;
43248 }f = f == 4 ? -5 : 0;
43249 r = -5;
43250 while (true) {
43251 switch (this.mode) {
43252 case 14:
43253 if (this.wrap == 0) {
43254 this.mode = 7;
43255 break;
43256 }try {
43257 r = this.readBytes (2, r, f);
43258 } catch (e) {
43259 if (Clazz_exceptionOf (e, JU.Inflate.Return)) {
43260 return e.r;
43261 } else {
43262 throw e;
43263 }
43264 }
43265 if ((this.wrap & 2) != 0 && this.need == 0x8b1f) {
43266 this.z.checksum =  new JU.CRC32 ();
43267 this.checksum (2, this.need);
43268 if (this.gheader == null) this.gheader =  new JU.GZIPHeader ();
43269 this.mode = 23;
43270 break;
43271 }this.flags = 0;
43272 this.method = (this.need) & 0xff;
43273 b = ((this.need >> 8)) & 0xff;
43274 if ((this.wrap & 1) == 0 || (((this.method << 8) + b) % 31) != 0) {
43275 this.mode = 13;
43276 this.z.msg = "incorrect header check";
43277 break;
43278 }if ((this.method & 0xf) != 8) {
43279 this.mode = 13;
43280 this.z.msg = "unknown compression method";
43281 break;
43282 }if ((this.method >> 4) + 8 > this.wbits) {
43283 this.mode = 13;
43284 this.z.msg = "invalid window size";
43285 break;
43286 }this.z.checksum =  new JU.Adler32 ();
43287 if ((b & 32) == 0) {
43288 this.mode = 7;
43289 break;
43290 }this.mode = 2;
43291 case 2:
43292 if (this.z.avail_in == 0) return r;
43293 r = f;
43294 this.z.avail_in--;
43295 this.z.total_in++;
43296 this.need = ((this.z.next_in[this.z.next_in_index++] & 0xff) << 24) & 0xff000000;
43297 this.mode = 3;
43298 case 3:
43299 if (this.z.avail_in == 0) return r;
43300 r = f;
43301 this.z.avail_in--;
43302 this.z.total_in++;
43303 this.need += ((this.z.next_in[this.z.next_in_index++] & 0xff) << 16) & 0xff0000;
43304 this.mode = 4;
43305 case 4:
43306 if (this.z.avail_in == 0) return r;
43307 r = f;
43308 this.z.avail_in--;
43309 this.z.total_in++;
43310 this.need += ((this.z.next_in[this.z.next_in_index++] & 0xff) << 8) & 0xff00;
43311 this.mode = 5;
43312 case 5:
43313 if (this.z.avail_in == 0) return r;
43314 r = f;
43315 this.z.avail_in--;
43316 this.z.total_in++;
43317 this.need += (this.z.next_in[this.z.next_in_index++] & 0xff);
43318 this.z.checksum.resetLong (this.need);
43319 this.mode = 6;
43320 return 2;
43321 case 6:
43322 this.mode = 13;
43323 this.z.msg = "need dictionary";
43324 this.marker = 0;
43325 return -2;
43326 case 7:
43327 r = this.blocks.proc (r);
43328 if (r == -3) {
43329 this.mode = 13;
43330 this.marker = 0;
43331 break;
43332 }if (r == 0) {
43333 r = f;
43334 }if (r != 1) {
43335 return r;
43336 }r = f;
43337 this.was = this.z.checksum.getValue ();
43338 this.blocks.reset ();
43339 if (this.wrap == 0) {
43340 this.mode = 12;
43341 break;
43342 }this.mode = 8;
43343 case 8:
43344 if (this.z.avail_in == 0) return r;
43345 r = f;
43346 this.z.avail_in--;
43347 this.z.total_in++;
43348 this.need = ((this.z.next_in[this.z.next_in_index++] & 0xff) << 24) & 0xff000000;
43349 this.mode = 9;
43350 case 9:
43351 if (this.z.avail_in == 0) return r;
43352 r = f;
43353 this.z.avail_in--;
43354 this.z.total_in++;
43355 this.need += ((this.z.next_in[this.z.next_in_index++] & 0xff) << 16) & 0xff0000;
43356 this.mode = 10;
43357 case 10:
43358 if (this.z.avail_in == 0) return r;
43359 r = f;
43360 this.z.avail_in--;
43361 this.z.total_in++;
43362 this.need += ((this.z.next_in[this.z.next_in_index++] & 0xff) << 8) & 0xff00;
43363 this.mode = 11;
43364 case 11:
43365 if (this.z.avail_in == 0) return r;
43366 r = f;
43367 this.z.avail_in--;
43368 this.z.total_in++;
43369 this.need += (this.z.next_in[this.z.next_in_index++] & 0xff);
43370 if (this.flags != 0) {
43371 this.need = ((this.need & 0xff000000) >> 24 | (this.need & 0x00ff0000) >> 8 | (this.need & 0x0000ff00) << 8 | (this.need & 0x0000ffff) << 24) & 0xffffffff;
43372 }if (((this.was)) != ((this.need))) {
43373 this.z.msg = "incorrect data check";
43374 } else if (this.flags != 0 && this.gheader != null) {
43375 this.gheader.crc = this.need;
43376 }this.mode = 15;
43377 case 15:
43378 if (this.wrap != 0 && this.flags != 0) {
43379 try {
43380 r = this.readBytes (4, r, f);
43381 } catch (e) {
43382 if (Clazz_exceptionOf (e, JU.Inflate.Return)) {
43383 return e.r;
43384 } else {
43385 throw e;
43386 }
43387 }
43388 if (this.z.msg != null && this.z.msg.equals ("incorrect data check")) {
43389 this.mode = 13;
43390 this.marker = 5;
43391 break;
43392 }if (this.need != (this.z.total_out & 0xffffffff)) {
43393 this.z.msg = "incorrect length check";
43394 this.mode = 13;
43395 break;
43396 }this.z.msg = null;
43397 } else {
43398 if (this.z.msg != null && this.z.msg.equals ("incorrect data check")) {
43399 this.mode = 13;
43400 this.marker = 5;
43401 break;
43402 }}this.mode = 12;
43403 case 12:
43404 return 1;
43405 case 13:
43406 return -3;
43407 case 23:
43408 try {
43409 r = this.readBytes (2, r, f);
43410 } catch (e) {
43411 if (Clazz_exceptionOf (e, JU.Inflate.Return)) {
43412 return e.r;
43413 } else {
43414 throw e;
43415 }
43416 }
43417 this.flags = (this.need) & 0xffff;
43418 if ((this.flags & 0xff) != 8) {
43419 this.z.msg = "unknown compression method";
43420 this.mode = 13;
43421 break;
43422 }if ((this.flags & 0xe000) != 0) {
43423 this.z.msg = "unknown header flags set";
43424 this.mode = 13;
43425 break;
43426 }if ((this.flags & 0x0200) != 0) {
43427 this.checksum (2, this.need);
43428 }this.mode = 16;
43429 case 16:
43430 try {
43431 r = this.readBytes (4, r, f);
43432 } catch (e) {
43433 if (Clazz_exceptionOf (e, JU.Inflate.Return)) {
43434 return e.r;
43435 } else {
43436 throw e;
43437 }
43438 }
43439 if (this.gheader != null) this.gheader.time = this.need;
43440 if ((this.flags & 0x0200) != 0) {
43441 this.checksum (4, this.need);
43442 }this.mode = 17;
43443 case 17:
43444 try {
43445 r = this.readBytes (2, r, f);
43446 } catch (e) {
43447 if (Clazz_exceptionOf (e, JU.Inflate.Return)) {
43448 return e.r;
43449 } else {
43450 throw e;
43451 }
43452 }
43453 if (this.gheader != null) {
43454 this.gheader.xflags = (this.need) & 0xff;
43455 this.gheader.os = ((this.need) >> 8) & 0xff;
43456 }if ((this.flags & 0x0200) != 0) {
43457 this.checksum (2, this.need);
43458 }this.mode = 18;
43459 case 18:
43460 if ((this.flags & 0x0400) != 0) {
43461 try {
43462 r = this.readBytes (2, r, f);
43463 } catch (e) {
43464 if (Clazz_exceptionOf (e, JU.Inflate.Return)) {
43465 return e.r;
43466 } else {
43467 throw e;
43468 }
43469 }
43470 if (this.gheader != null) {
43471 this.gheader.extra =  Clazz_newByteArray ((this.need) & 0xffff, 0);
43472 }if ((this.flags & 0x0200) != 0) {
43473 this.checksum (2, this.need);
43474 }} else if (this.gheader != null) {
43475 this.gheader.extra = null;
43476 }this.mode = 19;
43477 case 19:
43478 if ((this.flags & 0x0400) != 0) {
43479 try {
43480 r = this.readBytes (r, f);
43481 if (this.gheader != null) {
43482 var foo = this.tmp_string.toByteArray ();
43483 this.tmp_string = null;
43484 if (foo.length == this.gheader.extra.length) {
43485 System.arraycopy (foo, 0, this.gheader.extra, 0, foo.length);
43486 } else {
43487 this.z.msg = "bad extra field length";
43488 this.mode = 13;
43489 break;
43490 }}} catch (e) {
43491 if (Clazz_exceptionOf (e, JU.Inflate.Return)) {
43492 return e.r;
43493 } else {
43494 throw e;
43495 }
43496 }
43497 } else if (this.gheader != null) {
43498 this.gheader.extra = null;
43499 }this.mode = 20;
43500 case 20:
43501 if ((this.flags & 0x0800) != 0) {
43502 try {
43503 r = this.readString (r, f);
43504 if (this.gheader != null) {
43505 this.gheader.name = this.tmp_string.toByteArray ();
43506 }this.tmp_string = null;
43507 } catch (e) {
43508 if (Clazz_exceptionOf (e, JU.Inflate.Return)) {
43509 return e.r;
43510 } else {
43511 throw e;
43512 }
43513 }
43514 } else if (this.gheader != null) {
43515 this.gheader.name = null;
43516 }this.mode = 21;
43517 case 21:
43518 if ((this.flags & 0x1000) != 0) {
43519 try {
43520 r = this.readString (r, f);
43521 if (this.gheader != null) {
43522 this.gheader.comment = this.tmp_string.toByteArray ();
43523 }this.tmp_string = null;
43524 } catch (e) {
43525 if (Clazz_exceptionOf (e, JU.Inflate.Return)) {
43526 return e.r;
43527 } else {
43528 throw e;
43529 }
43530 }
43531 } else if (this.gheader != null) {
43532 this.gheader.comment = null;
43533 }this.mode = 22;
43534 case 22:
43535 if ((this.flags & 0x0200) != 0) {
43536 try {
43537 r = this.readBytes (2, r, f);
43538 } catch (e) {
43539 if (Clazz_exceptionOf (e, JU.Inflate.Return)) {
43540 return e.r;
43541 } else {
43542 throw e;
43543 }
43544 }
43545 if (this.gheader != null) {
43546 this.gheader.hcrc = (this.need & 0xffff);
43547 }if (this.need != (this.z.checksum.getValue () & 0xffff)) {
43548 this.mode = 13;
43549 this.z.msg = "header crc mismatch";
43550 this.marker = 5;
43551 break;
43552 }}this.z.checksum =  new JU.CRC32 ();
43553 this.mode = 7;
43554 break;
43555 default:
43556 return -2;
43557 }
43558 }
43559 }, "~N");
43560 Clazz_defineMethod (c$, "inflateSetDictionary", 
43561 function (dictionary, dictLength) {
43562 if (this.z == null || (this.mode != 6 && this.wrap != 0)) {
43563 return -2;
43564 }var index = 0;
43565 var length = dictLength;
43566 if (this.mode == 6) {
43567 var adler_need = this.z.checksum.getValue ();
43568 this.z.checksum.reset ();
43569 this.z.checksum.update (dictionary, 0, dictLength);
43570 if (this.z.checksum.getValue () != adler_need) {
43571 return -3;
43572 }}this.z.checksum.reset ();
43573 if (length >= (1 << this.wbits)) {
43574 length = (1 << this.wbits) - 1;
43575 index = dictLength - length;
43576 }this.blocks.set_dictionary (dictionary, index, length);
43577 this.mode = 7;
43578 return 0;
43579 }, "~A,~N");
43580 Clazz_defineMethod (c$, "inflateSync", 
43581 function () {
43582 var n;
43583 var p;
43584 var m;
43585 var r;
43586 var w;
43587 if (this.z == null) return -2;
43588 if (this.mode != 13) {
43589 this.mode = 13;
43590 this.marker = 0;
43591 }if ((n = this.z.avail_in) == 0) return -5;
43592 p = this.z.next_in_index;
43593 m = this.marker;
43594 while (n != 0 && m < 4) {
43595 if (this.z.next_in[p] == JU.Inflate.mark[m]) {
43596 m++;
43597 } else if (this.z.next_in[p] != 0) {
43598 m = 0;
43599 } else {
43600 m = 4 - m;
43601 }p++;
43602 n--;
43603 }
43604 this.z.total_in += p - this.z.next_in_index;
43605 this.z.next_in_index = p;
43606 this.z.avail_in = n;
43607 this.marker = m;
43608 if (m != 4) {
43609 return -3;
43610 }r = this.z.total_in;
43611 w = this.z.total_out;
43612 this.inflateReset ();
43613 this.z.total_in = r;
43614 this.z.total_out = w;
43615 this.mode = 7;
43616 return 0;
43617 });
43618 Clazz_defineMethod (c$, "inflateSyncPoint", 
43619 function () {
43620 if (this.z == null || this.blocks == null) return -2;
43621 return this.blocks.sync_point ();
43622 });
43623 Clazz_defineMethod (c$, "readBytes", 
43624  function (n, r, f) {
43625 if (this.need_bytes == -1) {
43626 this.need_bytes = n;
43627 this.need = 0;
43628 }while (this.need_bytes > 0) {
43629 if (this.z.avail_in == 0) {
43630 throw Clazz_innerTypeInstance (JU.Inflate.Return, this, null, r);
43631 }r = f;
43632 this.z.avail_in--;
43633 this.z.total_in++;
43634 this.need = this.need | ((this.z.next_in[this.z.next_in_index++] & 0xff) << ((n - this.need_bytes) * 8));
43635 this.need_bytes--;
43636 }
43637 if (n == 2) {
43638 this.need &= 0xffff;
43639 } else if (n == 4) {
43640 this.need &= 0xffffffff;
43641 }this.need_bytes = -1;
43642 return r;
43643 }, "~N,~N,~N");
43644 Clazz_defineMethod (c$, "readString", 
43645  function (r, f) {
43646 if (this.tmp_string == null) {
43647 this.tmp_string =  new java.io.ByteArrayOutputStream ();
43648 }var b = 0;
43649 do {
43650 if (this.z.avail_in == 0) {
43651 throw Clazz_innerTypeInstance (JU.Inflate.Return, this, null, r);
43652 }r = f;
43653 this.z.avail_in--;
43654 this.z.total_in++;
43655 b = this.z.next_in[this.z.next_in_index];
43656 if (b != 0) this.tmp_string.write (this.z.next_in, this.z.next_in_index, 1);
43657 this.z.checksum.update (this.z.next_in, this.z.next_in_index, 1);
43658 this.z.next_in_index++;
43659 } while (b != 0);
43660 return r;
43661 }, "~N,~N");
43662 Clazz_defineMethod (c$, "readBytes", 
43663  function (r, f) {
43664 if (this.tmp_string == null) {
43665 this.tmp_string =  new java.io.ByteArrayOutputStream ();
43666 }while (this.need > 0) {
43667 if (this.z.avail_in == 0) {
43668 throw Clazz_innerTypeInstance (JU.Inflate.Return, this, null, r);
43669 }r = f;
43670 this.z.avail_in--;
43671 this.z.total_in++;
43672 this.tmp_string.write (this.z.next_in, this.z.next_in_index, 1);
43673 this.z.checksum.update (this.z.next_in, this.z.next_in_index, 1);
43674 this.z.next_in_index++;
43675 this.need--;
43676 }
43677 return r;
43678 }, "~N,~N");
43679 Clazz_defineMethod (c$, "checksum", 
43680  function (n, v) {
43681 for (var i = 0; i < n; i++) {
43682 this.crcbuf[i] = (v & 0xff);
43683 v >>= 8;
43684 }
43685 this.z.checksum.update (this.crcbuf, 0, n);
43686 }, "~N,~N");
43687 Clazz_defineMethod (c$, "getGZIPHeader", 
43688 function () {
43689 return this.gheader;
43690 });
43691 Clazz_defineMethod (c$, "inParsingHeader", 
43692 function () {
43693 switch (this.mode) {
43694 case 14:
43695 case 2:
43696 case 3:
43697 case 4:
43698 case 5:
43699 case 23:
43700 case 16:
43701 case 17:
43702 case 18:
43703 case 19:
43704 case 20:
43705 case 21:
43706 case 22:
43707 return true;
43708 default:
43709 return false;
43710 }
43711 });
43712 c$.$Inflate$Return$ = function () {
43713 Clazz_pu$h(self.c$);
43714 c$ = Clazz_decorateAsClass (function () {
43715 Clazz_prepareCallback (this, arguments);
43716 this.r = 0;
43717 Clazz_instantialize (this, arguments);
43718 }, JU.Inflate, "Return", Exception);
43719 Clazz_makeConstructor (c$, 
43720 function (a) {
43721 Clazz_superConstructor (this, JU.Inflate.Return, []);
43722 this.r = a;
43723 }, "~N");
43724 c$ = Clazz_p0p ();
43725 };
43726 Clazz_defineStatics (c$,
43727 "PRESET_DICT", 0x20,
43728 "Z_NO_FLUSH", 0,
43729 "Z_PARTIAL_FLUSH", 1,
43730 "Z_SYNC_FLUSH", 2,
43731 "Z_FULL_FLUSH", 3,
43732 "Z_FINISH", 4,
43733 "Z_DEFLATED", 8,
43734 "Z_OK", 0,
43735 "Z_STREAM_END", 1,
43736 "Z_NEED_DICT", 2,
43737 "Z_STREAM_ERROR", -2,
43738 "Z_DATA_ERROR", -3,
43739 "Z_BUF_ERROR", -5,
43740 "DICT4", 2,
43741 "DICT3", 3,
43742 "DICT2", 4,
43743 "DICT1", 5,
43744 "DICT0", 6,
43745 "BLOCKS", 7,
43746 "CHECK4", 8,
43747 "CHECK3", 9,
43748 "CHECK2", 10,
43749 "CHECK1", 11,
43750 "DONE", 12,
43751 "BAD", 13,
43752 "HEAD", 14,
43753 "LENGTH", 15,
43754 "TIME", 16,
43755 "OS", 17,
43756 "EXLEN", 18,
43757 "EXTRA", 19,
43758 "NAME", 20,
43759 "COMMENT", 21,
43760 "HCRC", 22,
43761 "FLAGS", 23,
43762 "mark",  Clazz_newByteArray (-1, [0, 0, 0xff, 0xff]));
43763 });
43764 Clazz_declarePackage ("JU");
43765 Clazz_load (null, "JU.GZIPHeader", ["JU.ZStream", "java.lang.IllegalArgumentException", "$.InternalError"], function () {
43766 c$ = Clazz_decorateAsClass (function () {
43767 this.text = false;
43768 this.fhcrc = false;
43769 this.time = 0;
43770 this.xflags = 0;
43771 this.os = 255;
43772 this.extra = null;
43773 this.name = null;
43774 this.comment = null;
43775 this.hcrc = 0;
43776 this.crc = 0;
43777 this.done = false;
43778 this.mtime = 0;
43779 Clazz_instantialize (this, arguments);
43780 }, JU, "GZIPHeader", null, Cloneable);
43781 Clazz_defineMethod (c$, "setModifiedTime", 
43782 function (mtime) {
43783 this.mtime = mtime;
43784 }, "~N");
43785 Clazz_defineMethod (c$, "getModifiedTime", 
43786 function () {
43787 return this.mtime;
43788 });
43789 Clazz_defineMethod (c$, "setOS", 
43790 function (os) {
43791 if ((0 <= os && os <= 13) || os == 255) this.os = os;
43792  else throw  new IllegalArgumentException ("os: " + os);
43793 }, "~N");
43794 Clazz_defineMethod (c$, "getOS", 
43795 function () {
43796 return this.os;
43797 });
43798 Clazz_defineMethod (c$, "setName", 
43799 function (name) {
43800 this.name = JU.ZStream.getBytes (name);
43801 }, "~S");
43802 Clazz_defineMethod (c$, "getName", 
43803 function () {
43804 if (this.name == null) return "";
43805 try {
43806 return  String.instantialize (this.name, "ISO-8859-1");
43807 } catch (e) {
43808 if (Clazz_exceptionOf (e, java.io.UnsupportedEncodingException)) {
43809 throw  new InternalError (e.toString ());
43810 } else {
43811 throw e;
43812 }
43813 }
43814 });
43815 Clazz_defineMethod (c$, "setComment", 
43816 function (comment) {
43817 this.comment = JU.ZStream.getBytes (comment);
43818 }, "~S");
43819 Clazz_defineMethod (c$, "getComment", 
43820 function () {
43821 if (this.comment == null) return "";
43822 try {
43823 return  String.instantialize (this.comment, "ISO-8859-1");
43824 } catch (e) {
43825 if (Clazz_exceptionOf (e, java.io.UnsupportedEncodingException)) {
43826 throw  new InternalError (e.toString ());
43827 } else {
43828 throw e;
43829 }
43830 }
43831 });
43832 Clazz_defineMethod (c$, "setCRC", 
43833 function (crc) {
43834 this.crc = crc;
43835 }, "~N");
43836 Clazz_defineMethod (c$, "getCRC", 
43837 function () {
43838 return this.crc;
43839 });
43840 Clazz_defineMethod (c$, "put", 
43841 function (d) {
43842 var flag = 0;
43843 if (this.text) {
43844 flag |= 1;
43845 }if (this.fhcrc) {
43846 flag |= 2;
43847 }if (this.extra != null) {
43848 flag |= 4;
43849 }if (this.name != null) {
43850 flag |= 8;
43851 }if (this.comment != null) {
43852 flag |= 16;
43853 }var xfl = 0;
43854 if (d.level == 1) {
43855 xfl |= 4;
43856 } else if (d.level == 9) {
43857 xfl |= 2;
43858 }d.put_short (0x8b1f);
43859 d.put_byteB (8);
43860 d.put_byteB (flag);
43861 d.put_byteB (this.mtime);
43862 d.put_byteB ((this.mtime >> 8));
43863 d.put_byteB ((this.mtime >> 16));
43864 d.put_byteB ((this.mtime >> 24));
43865 d.put_byteB (xfl);
43866 d.put_byteB (this.os);
43867 if (this.extra != null) {
43868 d.put_byteB (this.extra.length);
43869 d.put_byteB ((this.extra.length >> 8));
43870 d.put_byte (this.extra, 0, this.extra.length);
43871 }if (this.name != null) {
43872 d.put_byte (this.name, 0, this.name.length);
43873 d.put_byteB (0);
43874 }if (this.comment != null) {
43875 d.put_byte (this.comment, 0, this.comment.length);
43876 d.put_byteB (0);
43877 }}, "JU.Deflate");
43878 Clazz_defineMethod (c$, "clone", 
43879 function () {
43880 var gheader = Clazz_superCall (this, JU.GZIPHeader, "clone", []);
43881 var tmp;
43882 if (gheader.extra != null) {
43883 tmp =  Clazz_newByteArray (gheader.extra.length, 0);
43884 System.arraycopy (gheader.extra, 0, tmp, 0, tmp.length);
43885 gheader.extra = tmp;
43886 }if (gheader.name != null) {
43887 tmp =  Clazz_newByteArray (gheader.name.length, 0);
43888 System.arraycopy (gheader.name, 0, tmp, 0, tmp.length);
43889 gheader.name = tmp;
43890 }if (gheader.comment != null) {
43891 tmp =  Clazz_newByteArray (gheader.comment.length, 0);
43892 System.arraycopy (gheader.comment, 0, tmp, 0, tmp.length);
43893 gheader.comment = tmp;
43894 }return gheader;
43895 });
43896 Clazz_defineStatics (c$,
43897 "OS_MSDOS", 0x00,
43898 "OS_AMIGA", 0x01,
43899 "OS_VMS", 0x02,
43900 "OS_UNIX", 0x03,
43901 "OS_ATARI", 0x05,
43902 "OS_OS2", 0x06,
43903 "OS_MACOS", 0x07,
43904 "OS_TOPS20", 0x0a,
43905 "OS_WIN32", 0x0b,
43906 "OS_VMCMS", 0x04,
43907 "OS_ZSYSTEM", 0x08,
43908 "OS_CPM", 0x09,
43909 "OS_QDOS", 0x0c,
43910 "OS_RISCOS", 0x0d,
43911 "OS_UNKNOWN", 0xff);
43912 });
43913 Clazz_declarePackage ("JU");
43914 Clazz_load (["JU.InfTree"], "JU.InfBlocks", ["JU.InfCodes"], function () {
43915 c$ = Clazz_decorateAsClass (function () {
43916 this.mode = 0;
43917 this.left = 0;
43918 this.table = 0;
43919 this.index = 0;
43920 this.blens = null;
43921 this.bb = null;
43922 this.tb = null;
43923 this.bl = null;
43924 this.bd = null;
43925 this.tl = null;
43926 this.td = null;
43927 this.tli = null;
43928 this.tdi = null;
43929 this.codes = null;
43930 this.last = 0;
43931 this.bitk = 0;
43932 this.bitb = 0;
43933 this.hufts = null;
43934 this.window = null;
43935 this.end = 0;
43936 this.read = 0;
43937 this.write = 0;
43938 this.check = false;
43939 this.inftree = null;
43940 this.z = null;
43941 Clazz_instantialize (this, arguments);
43942 }, JU, "InfBlocks");
43943 Clazz_prepareFields (c$, function () {
43944 this.bb =  Clazz_newIntArray (1, 0);
43945 this.tb =  Clazz_newIntArray (1, 0);
43946 this.bl =  Clazz_newIntArray (1, 0);
43947 this.bd =  Clazz_newIntArray (1, 0);
43948 this.tli =  Clazz_newIntArray (1, 0);
43949 this.tdi =  Clazz_newIntArray (1, 0);
43950 this.inftree =  new JU.InfTree ();
43951 });
43952 Clazz_makeConstructor (c$, 
43953 function (z, w) {
43954 this.z = z;
43955 this.codes =  new JU.InfCodes (this.z, this);
43956 this.hufts =  Clazz_newIntArray (4320, 0);
43957 this.window =  Clazz_newByteArray (w, 0);
43958 this.end = w;
43959 this.check = (z.istate.wrap == 0) ? false : true;
43960 this.mode = 0;
43961 {
43962 this.tl = Clazz_newArray(1, null);
43963 this.td = Clazz_newArray(1, null);
43964 }this.reset ();
43965 }, "JU.ZStream,~N");
43966 Clazz_defineMethod (c$, "reset", 
43967 function () {
43968 if (this.mode == 6) {
43969 this.codes.free (this.z);
43970 }this.mode = 0;
43971 this.bitk = 0;
43972 this.bitb = 0;
43973 this.read = this.write = 0;
43974 if (this.check) {
43975 this.z.checksum.reset ();
43976 }});
43977 Clazz_defineMethod (c$, "proc", 
43978 function (r) {
43979 var t;
43980 var b;
43981 var k;
43982 var p;
43983 var n;
43984 var q;
43985 var m;
43986 {
43987 p = this.z.next_in_index;
43988 n = this.z.avail_in;
43989 b = this.bitb;
43990 k = this.bitk;
43991 }{
43992 q = this.write;
43993 m = (q < this.read ? this.read - q - 1 : this.end - q);
43994 }while (true) {
43995 switch (this.mode) {
43996 case 0:
43997 while (k < (3)) {
43998 if (n != 0) {
43999 r = 0;
44000 } else {
44001 this.bitb = b;
44002 this.bitk = k;
44003 this.z.avail_in = n;
44004 this.z.total_in += p - this.z.next_in_index;
44005 this.z.next_in_index = p;
44006 this.write = q;
44007 return this.inflate_flush (r);
44008 }n--;
44009 b |= (this.z.next_in[p++] & 0xff) << k;
44010 k += 8;
44011 }
44012 t = (b & 7);
44013 this.last = t & 1;
44014 switch (t >>> 1) {
44015 case 0:
44016 {
44017 b >>>= (3);
44018 k -= (3);
44019 }t = k & 7;
44020 {
44021 b >>>= (t);
44022 k -= (t);
44023 }this.mode = 1;
44024 break;
44025 case 1:
44026 JU.InfTree.inflate_trees_fixed (this.bl, this.bd, this.tl, this.td, this.z);
44027 this.codes.init (this.bl[0], this.bd[0], this.tl[0], 0, this.td[0], 0);
44028 {
44029 b >>>= (3);
44030 k -= (3);
44031 }this.mode = 6;
44032 break;
44033 case 2:
44034 {
44035 b >>>= (3);
44036 k -= (3);
44037 }this.mode = 3;
44038 break;
44039 case 3:
44040 {
44041 b >>>= (3);
44042 k -= (3);
44043 }this.mode = 9;
44044 this.z.msg = "invalid block type";
44045 r = -3;
44046 this.bitb = b;
44047 this.bitk = k;
44048 this.z.avail_in = n;
44049 this.z.total_in += p - this.z.next_in_index;
44050 this.z.next_in_index = p;
44051 this.write = q;
44052 return this.inflate_flush (r);
44053 }
44054 break;
44055 case 1:
44056 while (k < (32)) {
44057 if (n != 0) {
44058 r = 0;
44059 } else {
44060 this.bitb = b;
44061 this.bitk = k;
44062 this.z.avail_in = n;
44063 this.z.total_in += p - this.z.next_in_index;
44064 this.z.next_in_index = p;
44065 this.write = q;
44066 return this.inflate_flush (r);
44067 }n--;
44068 b |= (this.z.next_in[p++] & 0xff) << k;
44069 k += 8;
44070 }
44071 if ((((~b) >>> 16) & 0xffff) != (b & 0xffff)) {
44072 this.mode = 9;
44073 this.z.msg = "invalid stored block lengths";
44074 r = -3;
44075 this.bitb = b;
44076 this.bitk = k;
44077 this.z.avail_in = n;
44078 this.z.total_in += p - this.z.next_in_index;
44079 this.z.next_in_index = p;
44080 this.write = q;
44081 return this.inflate_flush (r);
44082 }this.left = (b & 0xffff);
44083 b = k = 0;
44084 this.mode = this.left != 0 ? 2 : (this.last != 0 ? 7 : 0);
44085 break;
44086 case 2:
44087 if (n == 0) {
44088 this.bitb = b;
44089 this.bitk = k;
44090 this.z.avail_in = n;
44091 this.z.total_in += p - this.z.next_in_index;
44092 this.z.next_in_index = p;
44093 this.write = q;
44094 return this.inflate_flush (r);
44095 }if (m == 0) {
44096 if (q == this.end && this.read != 0) {
44097 q = 0;
44098 m = (q < this.read ? this.read - q - 1 : this.end - q);
44099 }if (m == 0) {
44100 this.write = q;
44101 r = this.inflate_flush (r);
44102 q = this.write;
44103 m = (q < this.read ? this.read - q - 1 : this.end - q);
44104 if (q == this.end && this.read != 0) {
44105 q = 0;
44106 m = (q < this.read ? this.read - q - 1 : this.end - q);
44107 }if (m == 0) {
44108 this.bitb = b;
44109 this.bitk = k;
44110 this.z.avail_in = n;
44111 this.z.total_in += p - this.z.next_in_index;
44112 this.z.next_in_index = p;
44113 this.write = q;
44114 return this.inflate_flush (r);
44115 }}}r = 0;
44116 t = this.left;
44117 if (t > n) t = n;
44118 if (t > m) t = m;
44119 System.arraycopy (this.z.next_in, p, this.window, q, t);
44120 p += t;
44121 n -= t;
44122 q += t;
44123 m -= t;
44124 if ((this.left -= t) != 0) break;
44125 this.mode = this.last != 0 ? 7 : 0;
44126 break;
44127 case 3:
44128 while (k < (14)) {
44129 if (n != 0) {
44130 r = 0;
44131 } else {
44132 this.bitb = b;
44133 this.bitk = k;
44134 this.z.avail_in = n;
44135 this.z.total_in += p - this.z.next_in_index;
44136 this.z.next_in_index = p;
44137 this.write = q;
44138 return this.inflate_flush (r);
44139 }n--;
44140 b |= (this.z.next_in[p++] & 0xff) << k;
44141 k += 8;
44142 }
44143 this.table = t = (b & 0x3fff);
44144 if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29) {
44145 this.mode = 9;
44146 this.z.msg = "too many length or distance symbols";
44147 r = -3;
44148 this.bitb = b;
44149 this.bitk = k;
44150 this.z.avail_in = n;
44151 this.z.total_in += p - this.z.next_in_index;
44152 this.z.next_in_index = p;
44153 this.write = q;
44154 return this.inflate_flush (r);
44155 }t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f);
44156 if (this.blens == null || this.blens.length < t) {
44157 this.blens =  Clazz_newIntArray (t, 0);
44158 } else {
44159 for (var i = 0; i < t; i++) {
44160 this.blens[i] = 0;
44161 }
44162 }{
44163 b >>>= (14);
44164 k -= (14);
44165 }this.index = 0;
44166 this.mode = 4;
44167 case 4:
44168 while (this.index < 4 + (this.table >>> 10)) {
44169 while (k < (3)) {
44170 if (n != 0) {
44171 r = 0;
44172 } else {
44173 this.bitb = b;
44174 this.bitk = k;
44175 this.z.avail_in = n;
44176 this.z.total_in += p - this.z.next_in_index;
44177 this.z.next_in_index = p;
44178 this.write = q;
44179 return this.inflate_flush (r);
44180 }n--;
44181 b |= (this.z.next_in[p++] & 0xff) << k;
44182 k += 8;
44183 }
44184 this.blens[JU.InfBlocks.border[this.index++]] = b & 7;
44185 {
44186 b >>>= (3);
44187 k -= (3);
44188 }}
44189 while (this.index < 19) {
44190 this.blens[JU.InfBlocks.border[this.index++]] = 0;
44191 }
44192 this.bb[0] = 7;
44193 t = this.inftree.inflate_trees_bits (this.blens, this.bb, this.tb, this.hufts, this.z);
44194 if (t != 0) {
44195 r = t;
44196 if (r == -3) {
44197 this.blens = null;
44198 this.mode = 9;
44199 }this.bitb = b;
44200 this.bitk = k;
44201 this.z.avail_in = n;
44202 this.z.total_in += p - this.z.next_in_index;
44203 this.z.next_in_index = p;
44204 this.write = q;
44205 return this.inflate_flush (r);
44206 }this.index = 0;
44207 this.mode = 5;
44208 case 5:
44209 while (true) {
44210 t = this.table;
44211 if (!(this.index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f))) {
44212 break;
44213 }var i;
44214 var j;
44215 var c;
44216 t = this.bb[0];
44217 while (k < (t)) {
44218 if (n != 0) {
44219 r = 0;
44220 } else {
44221 this.bitb = b;
44222 this.bitk = k;
44223 this.z.avail_in = n;
44224 this.z.total_in += p - this.z.next_in_index;
44225 this.z.next_in_index = p;
44226 this.write = q;
44227 return this.inflate_flush (r);
44228 }n--;
44229 b |= (this.z.next_in[p++] & 0xff) << k;
44230 k += 8;
44231 }
44232 t = this.hufts[(this.tb[0] + (b & JU.InfBlocks.inflate_mask[t])) * 3 + 1];
44233 c = this.hufts[(this.tb[0] + (b & JU.InfBlocks.inflate_mask[t])) * 3 + 2];
44234 if (c < 16) {
44235 b >>>= (t);
44236 k -= (t);
44237 this.blens[this.index++] = c;
44238 } else {
44239 i = c == 18 ? 7 : c - 14;
44240 j = c == 18 ? 11 : 3;
44241 while (k < (t + i)) {
44242 if (n != 0) {
44243 r = 0;
44244 } else {
44245 this.bitb = b;
44246 this.bitk = k;
44247 this.z.avail_in = n;
44248 this.z.total_in += p - this.z.next_in_index;
44249 this.z.next_in_index = p;
44250 this.write = q;
44251 return this.inflate_flush (r);
44252 }n--;
44253 b |= (this.z.next_in[p++] & 0xff) << k;
44254 k += 8;
44255 }
44256 b >>>= (t);
44257 k -= (t);
44258 j += (b & JU.InfBlocks.inflate_mask[i]);
44259 b >>>= (i);
44260 k -= (i);
44261 i = this.index;
44262 t = this.table;
44263 if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) || (c == 16 && i < 1)) {
44264 this.blens = null;
44265 this.mode = 9;
44266 this.z.msg = "invalid bit length repeat";
44267 r = -3;
44268 this.bitb = b;
44269 this.bitk = k;
44270 this.z.avail_in = n;
44271 this.z.total_in += p - this.z.next_in_index;
44272 this.z.next_in_index = p;
44273 this.write = q;
44274 return this.inflate_flush (r);
44275 }c = c == 16 ? this.blens[i - 1] : 0;
44276 do {
44277 this.blens[i++] = c;
44278 } while (--j != 0);
44279 this.index = i;
44280 }}
44281 this.tb[0] = -1;
44282 {
44283 this.bl[0] = 9;
44284 this.bd[0] = 6;
44285 t = this.table;
44286 t = this.inftree.inflate_trees_dynamic (257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f), this.blens, this.bl, this.bd, this.tli, this.tdi, this.hufts, this.z);
44287 if (t != 0) {
44288 if (t == -3) {
44289 this.blens = null;
44290 this.mode = 9;
44291 }r = t;
44292 this.bitb = b;
44293 this.bitk = k;
44294 this.z.avail_in = n;
44295 this.z.total_in += p - this.z.next_in_index;
44296 this.z.next_in_index = p;
44297 this.write = q;
44298 return this.inflate_flush (r);
44299 }this.codes.init (this.bl[0], this.bd[0], this.hufts, this.tli[0], this.hufts, this.tdi[0]);
44300 }this.mode = 6;
44301 case 6:
44302 this.bitb = b;
44303 this.bitk = k;
44304 this.z.avail_in = n;
44305 this.z.total_in += p - this.z.next_in_index;
44306 this.z.next_in_index = p;
44307 this.write = q;
44308 if ((r = this.codes.proc (r)) != 1) {
44309 return this.inflate_flush (r);
44310 }r = 0;
44311 this.codes.free (this.z);
44312 p = this.z.next_in_index;
44313 n = this.z.avail_in;
44314 b = this.bitb;
44315 k = this.bitk;
44316 q = this.write;
44317 m = (q < this.read ? this.read - q - 1 : this.end - q);
44318 if (this.last == 0) {
44319 this.mode = 0;
44320 break;
44321 }this.mode = 7;
44322 case 7:
44323 this.write = q;
44324 r = this.inflate_flush (r);
44325 q = this.write;
44326 m = (q < this.read ? this.read - q - 1 : this.end - q);
44327 if (this.read != this.write) {
44328 this.bitb = b;
44329 this.bitk = k;
44330 this.z.avail_in = n;
44331 this.z.total_in += p - this.z.next_in_index;
44332 this.z.next_in_index = p;
44333 this.write = q;
44334 return this.inflate_flush (r);
44335 }this.mode = 8;
44336 case 8:
44337 r = 1;
44338 this.bitb = b;
44339 this.bitk = k;
44340 this.z.avail_in = n;
44341 this.z.total_in += p - this.z.next_in_index;
44342 this.z.next_in_index = p;
44343 this.write = q;
44344 return this.inflate_flush (r);
44345 case 9:
44346 r = -3;
44347 this.bitb = b;
44348 this.bitk = k;
44349 this.z.avail_in = n;
44350 this.z.total_in += p - this.z.next_in_index;
44351 this.z.next_in_index = p;
44352 this.write = q;
44353 return this.inflate_flush (r);
44354 default:
44355 r = -2;
44356 this.bitb = b;
44357 this.bitk = k;
44358 this.z.avail_in = n;
44359 this.z.total_in += p - this.z.next_in_index;
44360 this.z.next_in_index = p;
44361 this.write = q;
44362 return this.inflate_flush (r);
44363 }
44364 }
44365 }, "~N");
44366 Clazz_defineMethod (c$, "free", 
44367 function () {
44368 this.reset ();
44369 this.window = null;
44370 this.hufts = null;
44371 });
44372 Clazz_defineMethod (c$, "set_dictionary", 
44373 function (d, start, n) {
44374 System.arraycopy (d, start, this.window, 0, n);
44375 this.read = this.write = n;
44376 }, "~A,~N,~N");
44377 Clazz_defineMethod (c$, "sync_point", 
44378 function () {
44379 return this.mode == 1 ? 1 : 0;
44380 });
44381 Clazz_defineMethod (c$, "inflate_flush", 
44382 function (r) {
44383 var n;
44384 var p;
44385 var q;
44386 p = this.z.next_out_index;
44387 q = this.read;
44388 n = ((q <= this.write ? this.write : this.end) - q);
44389 if (n > this.z.avail_out) n = this.z.avail_out;
44390 if (n != 0 && r == -5) r = 0;
44391 this.z.avail_out -= n;
44392 this.z.total_out += n;
44393 if (this.check && n > 0) {
44394 this.z.checksum.update (this.window, q, n);
44395 }System.arraycopy (this.window, q, this.z.next_out, p, n);
44396 p += n;
44397 q += n;
44398 if (q == this.end) {
44399 q = 0;
44400 if (this.write == this.end) this.write = 0;
44401 n = this.write - q;
44402 if (n > this.z.avail_out) n = this.z.avail_out;
44403 if (n != 0 && r == -5) r = 0;
44404 this.z.avail_out -= n;
44405 this.z.total_out += n;
44406 if (this.check && n > 0) {
44407 this.z.checksum.update (this.window, q, n);
44408 }System.arraycopy (this.window, q, this.z.next_out, p, n);
44409 p += n;
44410 q += n;
44411 }this.z.next_out_index = p;
44412 this.read = q;
44413 return r;
44414 }, "~N");
44415 Clazz_defineStatics (c$,
44416 "MANY", 1440,
44417 "inflate_mask",  Clazz_newIntArray (-1, [0x00000000, 0x00000001, 0x00000003, 0x00000007, 0x0000000f, 0x0000001f, 0x0000003f, 0x0000007f, 0x000000ff, 0x000001ff, 0x000003ff, 0x000007ff, 0x00000fff, 0x00001fff, 0x00003fff, 0x00007fff, 0x0000ffff]),
44418 "border",  Clazz_newIntArray (-1, [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]),
44419 "Z_OK", 0,
44420 "Z_STREAM_END", 1,
44421 "Z_STREAM_ERROR", -2,
44422 "Z_DATA_ERROR", -3,
44423 "Z_BUF_ERROR", -5,
44424 "TYPE", 0,
44425 "LENS", 1,
44426 "STORED", 2,
44427 "TABLE", 3,
44428 "BTREE", 4,
44429 "DTREE", 5,
44430 "CODES", 6,
44431 "DRY", 7,
44432 "DONE", 8,
44433 "BAD", 9);
44434 });
44435 Clazz_declarePackage ("JU");
44436 c$ = Clazz_decorateAsClass (function () {
44437 this.hn = null;
44438 this.v = null;
44439 this.c = null;
44440 this.r = null;
44441 this.u = null;
44442 this.x = null;
44443 Clazz_instantialize (this, arguments);
44444 }, JU, "InfTree");
44445 Clazz_defineMethod (c$, "huft_build", 
44446  function (b, bindex, n, s, d, e, t, m, hp, hn, v) {
44447 var a;
44448 var f;
44449 var g;
44450 var h;
44451 var i;
44452 var j;
44453 var k;
44454 var l;
44455 var mask;
44456 var p;
44457 var q;
44458 var w;
44459 var xp;
44460 var y;
44461 var z;
44462 p = 0;
44463 i = n;
44464 do {
44465 this.c[b[bindex + p]]++;
44466 p++;
44467 i--;
44468 } while (i != 0);
44469 if (this.c[0] == n) {
44470 t[0] = -1;
44471 m[0] = 0;
44472 return 0;
44473 }l = m[0];
44474 for (j = 1; j <= 15; j++) if (this.c[j] != 0) break;
44475
44476 k = j;
44477 if (l < j) {
44478 l = j;
44479 }for (i = 15; i != 0; i--) {
44480 if (this.c[i] != 0) break;
44481 }
44482 g = i;
44483 if (l > i) {
44484 l = i;
44485 }m[0] = l;
44486 for (y = 1 << j; j < i; j++, y <<= 1) {
44487 if ((y -= this.c[j]) < 0) {
44488 return -3;
44489 }}
44490 if ((y -= this.c[i]) < 0) {
44491 return -3;
44492 }this.c[i] += y;
44493 this.x[1] = j = 0;
44494 p = 1;
44495 xp = 2;
44496 while (--i != 0) {
44497 this.x[xp] = (j += this.c[p]);
44498 xp++;
44499 p++;
44500 }
44501 i = 0;
44502 p = 0;
44503 do {
44504 if ((j = b[bindex + p]) != 0) {
44505 v[this.x[j]++] = i;
44506 }p++;
44507 } while (++i < n);
44508 n = this.x[g];
44509 this.x[0] = i = 0;
44510 p = 0;
44511 h = -1;
44512 w = -l;
44513 this.u[0] = 0;
44514 q = 0;
44515 z = 0;
44516 for (; k <= g; k++) {
44517 a = this.c[k];
44518 while (a-- != 0) {
44519 while (k > w + l) {
44520 h++;
44521 w += l;
44522 z = g - w;
44523 z = (z > l) ? l : z;
44524 if ((f = 1 << (j = k - w)) > a + 1) {
44525 f -= a + 1;
44526 xp = k;
44527 if (j < z) {
44528 while (++j < z) {
44529 if ((f <<= 1) <= this.c[++xp]) break;
44530 f -= this.c[xp];
44531 }
44532 }}z = 1 << j;
44533 if (hn[0] + z > 1440) {
44534 return -3;
44535 }this.u[h] = q = hn[0];
44536 hn[0] += z;
44537 if (h != 0) {
44538 this.x[h] = i;
44539 this.r[0] = j;
44540 this.r[1] = l;
44541 j = i >>> (w - l);
44542 this.r[2] = (q - this.u[h - 1] - j);
44543 System.arraycopy (this.r, 0, hp, (this.u[h - 1] + j) * 3, 3);
44544 } else {
44545 t[0] = q;
44546 }}
44547 this.r[1] = (k - w);
44548 if (p >= n) {
44549 this.r[0] = 192;
44550 } else if (v[p] < s) {
44551 this.r[0] = (v[p] < 256 ? 0 : 96);
44552 this.r[2] = v[p++];
44553 } else {
44554 this.r[0] = (e[v[p] - s] + 16 + 64);
44555 this.r[2] = d[v[p++] - s];
44556 }f = 1 << (k - w);
44557 for (j = i >>> w; j < z; j += f) {
44558 System.arraycopy (this.r, 0, hp, (q + j) * 3, 3);
44559 }
44560 for (j = 1 << (k - 1); (i & j) != 0; j >>>= 1) {
44561 i ^= j;
44562 }
44563 i ^= j;
44564 mask = (1 << w) - 1;
44565 while ((i & mask) != this.x[h]) {
44566 h--;
44567 w -= l;
44568 mask = (1 << w) - 1;
44569 }
44570 }
44571 }
44572 return y != 0 && g != 1 ? -5 : 0;
44573 }, "~A,~N,~N,~N,~A,~A,~A,~A,~A,~A,~A");
44574 Clazz_defineMethod (c$, "inflate_trees_bits", 
44575 function (c, bb, tb, hp, z) {
44576 var result;
44577 this.initWorkArea (19);
44578 this.hn[0] = 0;
44579 result = this.huft_build (c, 0, 19, 19, null, null, tb, bb, hp, this.hn, this.v);
44580 if (result == -3) {
44581 z.msg = "oversubscribed dynamic bit lengths tree";
44582 } else if (result == -5 || bb[0] == 0) {
44583 z.msg = "incomplete dynamic bit lengths tree";
44584 result = -3;
44585 }return result;
44586 }, "~A,~A,~A,~A,JU.ZStream");
44587 Clazz_defineMethod (c$, "inflate_trees_dynamic", 
44588 function (nl, nd, c, bl, bd, tl, td, hp, z) {
44589 var result;
44590 this.initWorkArea (288);
44591 this.hn[0] = 0;
44592 result = this.huft_build (c, 0, nl, 257, JU.InfTree.cplens, JU.InfTree.cplext, tl, bl, hp, this.hn, this.v);
44593 if (result != 0 || bl[0] == 0) {
44594 if (result == -3) {
44595 z.msg = "oversubscribed literal/length tree";
44596 } else if (result != -4) {
44597 z.msg = "incomplete literal/length tree";
44598 result = -3;
44599 }return result;
44600 }this.initWorkArea (288);
44601 result = this.huft_build (c, nl, nd, 0, JU.InfTree.cpdist, JU.InfTree.cpdext, td, bd, hp, this.hn, this.v);
44602 if (result != 0 || (bd[0] == 0 && nl > 257)) {
44603 if (result == -3) {
44604 z.msg = "oversubscribed distance tree";
44605 } else if (result == -5) {
44606 z.msg = "incomplete distance tree";
44607 result = -3;
44608 } else if (result != -4) {
44609 z.msg = "empty distance tree with lengths";
44610 result = -3;
44611 }return result;
44612 }return 0;
44613 }, "~N,~N,~A,~A,~A,~A,~A,~A,JU.ZStream");
44614 c$.inflate_trees_fixed = Clazz_defineMethod (c$, "inflate_trees_fixed", 
44615 function (bl, bd, tl, td, z) {
44616 bl[0] = 9;
44617 bd[0] = 5;
44618 tl[0] = JU.InfTree.fixed_tl;
44619 td[0] = JU.InfTree.fixed_td;
44620 return 0;
44621 }, "~A,~A,~A,~A,JU.ZStream");
44622 Clazz_defineMethod (c$, "initWorkArea", 
44623  function (vsize) {
44624 if (this.hn == null) {
44625 this.hn =  Clazz_newIntArray (1, 0);
44626 this.v =  Clazz_newIntArray (vsize, 0);
44627 this.c =  Clazz_newIntArray (16, 0);
44628 this.r =  Clazz_newIntArray (3, 0);
44629 this.u =  Clazz_newIntArray (15, 0);
44630 this.x =  Clazz_newIntArray (16, 0);
44631 }if (this.v.length < vsize) {
44632 this.v =  Clazz_newIntArray (vsize, 0);
44633 }for (var i = 0; i < vsize; i++) {
44634 this.v[i] = 0;
44635 }
44636 for (var i = 0; i < 16; i++) {
44637 this.c[i] = 0;
44638 }
44639 for (var i = 0; i < 3; i++) {
44640 this.r[i] = 0;
44641 }
44642 System.arraycopy (this.c, 0, this.u, 0, 15);
44643 System.arraycopy (this.c, 0, this.x, 0, 16);
44644 }, "~N");
44645 Clazz_defineStatics (c$,
44646 "MANY", 1440,
44647 "Z_OK", 0,
44648 "Z_DATA_ERROR", -3,
44649 "Z_MEM_ERROR", -4,
44650 "Z_BUF_ERROR", -5,
44651 "fixed_bl", 9,
44652 "fixed_bd", 5,
44653 "fixed_tl",  Clazz_newIntArray (-1, [96, 7, 256, 0, 8, 80, 0, 8, 16, 84, 8, 115, 82, 7, 31, 0, 8, 112, 0, 8, 48, 0, 9, 192, 80, 7, 10, 0, 8, 96, 0, 8, 32, 0, 9, 160, 0, 8, 0, 0, 8, 128, 0, 8, 64, 0, 9, 224, 80, 7, 6, 0, 8, 88, 0, 8, 24, 0, 9, 144, 83, 7, 59, 0, 8, 120, 0, 8, 56, 0, 9, 208, 81, 7, 17, 0, 8, 104, 0, 8, 40, 0, 9, 176, 0, 8, 8, 0, 8, 136, 0, 8, 72, 0, 9, 240, 80, 7, 4, 0, 8, 84, 0, 8, 20, 85, 8, 227, 83, 7, 43, 0, 8, 116, 0, 8, 52, 0, 9, 200, 81, 7, 13, 0, 8, 100, 0, 8, 36, 0, 9, 168, 0, 8, 4, 0, 8, 132, 0, 8, 68, 0, 9, 232, 80, 7, 8, 0, 8, 92, 0, 8, 28, 0, 9, 152, 84, 7, 83, 0, 8, 124, 0, 8, 60, 0, 9, 216, 82, 7, 23, 0, 8, 108, 0, 8, 44, 0, 9, 184, 0, 8, 12, 0, 8, 140, 0, 8, 76, 0, 9, 248, 80, 7, 3, 0, 8, 82, 0, 8, 18, 85, 8, 163, 83, 7, 35, 0, 8, 114, 0, 8, 50, 0, 9, 196, 81, 7, 11, 0, 8, 98, 0, 8, 34, 0, 9, 164, 0, 8, 2, 0, 8, 130, 0, 8, 66, 0, 9, 228, 80, 7, 7, 0, 8, 90, 0, 8, 26, 0, 9, 148, 84, 7, 67, 0, 8, 122, 0, 8, 58, 0, 9, 212, 82, 7, 19, 0, 8, 106, 0, 8, 42, 0, 9, 180, 0, 8, 10, 0, 8, 138, 0, 8, 74, 0, 9, 244, 80, 7, 5, 0, 8, 86, 0, 8, 22, 192, 8, 0, 83, 7, 51, 0, 8, 118, 0, 8, 54, 0, 9, 204, 81, 7, 15, 0, 8, 102, 0, 8, 38, 0, 9, 172, 0, 8, 6, 0, 8, 134, 0, 8, 70, 0, 9, 236, 80, 7, 9, 0, 8, 94, 0, 8, 30, 0, 9, 156, 84, 7, 99, 0, 8, 126, 0, 8, 62, 0, 9, 220, 82, 7, 27, 0, 8, 110, 0, 8, 46, 0, 9, 188, 0, 8, 14, 0, 8, 142, 0, 8, 78, 0, 9, 252, 96, 7, 256, 0, 8, 81, 0, 8, 17, 85, 8, 131, 82, 7, 31, 0, 8, 113, 0, 8, 49, 0, 9, 194, 80, 7, 10, 0, 8, 97, 0, 8, 33, 0, 9, 162, 0, 8, 1, 0, 8, 129, 0, 8, 65, 0, 9, 226, 80, 7, 6, 0, 8, 89, 0, 8, 25, 0, 9, 146, 83, 7, 59, 0, 8, 121, 0, 8, 57, 0, 9, 210, 81, 7, 17, 0, 8, 105, 0, 8, 41, 0, 9, 178, 0, 8, 9, 0, 8, 137, 0, 8, 73, 0, 9, 242, 80, 7, 4, 0, 8, 85, 0, 8, 21, 80, 8, 258, 83, 7, 43, 0, 8, 117, 0, 8, 53, 0, 9, 202, 81, 7, 13, 0, 8, 101, 0, 8, 37, 0, 9, 170, 0, 8, 5, 0, 8, 133, 0, 8, 69, 0, 9, 234, 80, 7, 8, 0, 8, 93, 0, 8, 29, 0, 9, 154, 84, 7, 83, 0, 8, 125, 0, 8, 61, 0, 9, 218, 82, 7, 23, 0, 8, 109, 0, 8, 45, 0, 9, 186, 0, 8, 13, 0, 8, 141, 0, 8, 77, 0, 9, 250, 80, 7, 3, 0, 8, 83, 0, 8, 19, 85, 8, 195, 83, 7, 35, 0, 8, 115, 0, 8, 51, 0, 9, 198, 81, 7, 11, 0, 8, 99, 0, 8, 35, 0, 9, 166, 0, 8, 3, 0, 8, 131, 0, 8, 67, 0, 9, 230, 80, 7, 7, 0, 8, 91, 0, 8, 27, 0, 9, 150, 84, 7, 67, 0, 8, 123, 0, 8, 59, 0, 9, 214, 82, 7, 19, 0, 8, 107, 0, 8, 43, 0, 9, 182, 0, 8, 11, 0, 8, 139, 0, 8, 75, 0, 9, 246, 80, 7, 5, 0, 8, 87, 0, 8, 23, 192, 8, 0, 83, 7, 51, 0, 8, 119, 0, 8, 55, 0, 9, 206, 81, 7, 15, 0, 8, 103, 0, 8, 39, 0, 9, 174, 0, 8, 7, 0, 8, 135, 0, 8, 71, 0, 9, 238, 80, 7, 9, 0, 8, 95, 0, 8, 31, 0, 9, 158, 84, 7, 99, 0, 8, 127, 0, 8, 63, 0, 9, 222, 82, 7, 27, 0, 8, 111, 0, 8, 47, 0, 9, 190, 0, 8, 15, 0, 8, 143, 0, 8, 79, 0, 9, 254, 96, 7, 256, 0, 8, 80, 0, 8, 16, 84, 8, 115, 82, 7, 31, 0, 8, 112, 0, 8, 48, 0, 9, 193, 80, 7, 10, 0, 8, 96, 0, 8, 32, 0, 9, 161, 0, 8, 0, 0, 8, 128, 0, 8, 64, 0, 9, 225, 80, 7, 6, 0, 8, 88, 0, 8, 24, 0, 9, 145, 83, 7, 59, 0, 8, 120, 0, 8, 56, 0, 9, 209, 81, 7, 17, 0, 8, 104, 0, 8, 40, 0, 9, 177, 0, 8, 8, 0, 8, 136, 0, 8, 72, 0, 9, 241, 80, 7, 4, 0, 8, 84, 0, 8, 20, 85, 8, 227, 83, 7, 43, 0, 8, 116, 0, 8, 52, 0, 9, 201, 81, 7, 13, 0, 8, 100, 0, 8, 36, 0, 9, 169, 0, 8, 4, 0, 8, 132, 0, 8, 68, 0, 9, 233, 80, 7, 8, 0, 8, 92, 0, 8, 28, 0, 9, 153, 84, 7, 83, 0, 8, 124, 0, 8, 60, 0, 9, 217, 82, 7, 23, 0, 8, 108, 0, 8, 44, 0, 9, 185, 0, 8, 12, 0, 8, 140, 0, 8, 76, 0, 9, 249, 80, 7, 3, 0, 8, 82, 0, 8, 18, 85, 8, 163, 83, 7, 35, 0, 8, 114, 0, 8, 50, 0, 9, 197, 81, 7, 11, 0, 8, 98, 0, 8, 34, 0, 9, 165, 0, 8, 2, 0, 8, 130, 0, 8, 66, 0, 9, 229, 80, 7, 7, 0, 8, 90, 0, 8, 26, 0, 9, 149, 84, 7, 67, 0, 8, 122, 0, 8, 58, 0, 9, 213, 82, 7, 19, 0, 8, 106, 0, 8, 42, 0, 9, 181, 0, 8, 10, 0, 8, 138, 0, 8, 74, 0, 9, 245, 80, 7, 5, 0, 8, 86, 0, 8, 22, 192, 8, 0, 83, 7, 51, 0, 8, 118, 0, 8, 54, 0, 9, 205, 81, 7, 15, 0, 8, 102, 0, 8, 38, 0, 9, 173, 0, 8, 6, 0, 8, 134, 0, 8, 70, 0, 9, 237, 80, 7, 9, 0, 8, 94, 0, 8, 30, 0, 9, 157, 84, 7, 99, 0, 8, 126, 0, 8, 62, 0, 9, 221, 82, 7, 27, 0, 8, 110, 0, 8, 46, 0, 9, 189, 0, 8, 14, 0, 8, 142, 0, 8, 78, 0, 9, 253, 96, 7, 256, 0, 8, 81, 0, 8, 17, 85, 8, 131, 82, 7, 31, 0, 8, 113, 0, 8, 49, 0, 9, 195, 80, 7, 10, 0, 8, 97, 0, 8, 33, 0, 9, 163, 0, 8, 1, 0, 8, 129, 0, 8, 65, 0, 9, 227, 80, 7, 6, 0, 8, 89, 0, 8, 25, 0, 9, 147, 83, 7, 59, 0, 8, 121, 0, 8, 57, 0, 9, 211, 81, 7, 17, 0, 8, 105, 0, 8, 41, 0, 9, 179, 0, 8, 9, 0, 8, 137, 0, 8, 73, 0, 9, 243, 80, 7, 4, 0, 8, 85, 0, 8, 21, 80, 8, 258, 83, 7, 43, 0, 8, 117, 0, 8, 53, 0, 9, 203, 81, 7, 13, 0, 8, 101, 0, 8, 37, 0, 9, 171, 0, 8, 5, 0, 8, 133, 0, 8, 69, 0, 9, 235, 80, 7, 8, 0, 8, 93, 0, 8, 29, 0, 9, 155, 84, 7, 83, 0, 8, 125, 0, 8, 61, 0, 9, 219, 82, 7, 23, 0, 8, 109, 0, 8, 45, 0, 9, 187, 0, 8, 13, 0, 8, 141, 0, 8, 77, 0, 9, 251, 80, 7, 3, 0, 8, 83, 0, 8, 19, 85, 8, 195, 83, 7, 35, 0, 8, 115, 0, 8, 51, 0, 9, 199, 81, 7, 11, 0, 8, 99, 0, 8, 35, 0, 9, 167, 0, 8, 3, 0, 8, 131, 0, 8, 67, 0, 9, 231, 80, 7, 7, 0, 8, 91, 0, 8, 27, 0, 9, 151, 84, 7, 67, 0, 8, 123, 0, 8, 59, 0, 9, 215, 82, 7, 19, 0, 8, 107, 0, 8, 43, 0, 9, 183, 0, 8, 11, 0, 8, 139, 0, 8, 75, 0, 9, 247, 80, 7, 5, 0, 8, 87, 0, 8, 23, 192, 8, 0, 83, 7, 51, 0, 8, 119, 0, 8, 55, 0, 9, 207, 81, 7, 15, 0, 8, 103, 0, 8, 39, 0, 9, 175, 0, 8, 7, 0, 8, 135, 0, 8, 71, 0, 9, 239, 80, 7, 9, 0, 8, 95, 0, 8, 31, 0, 9, 159, 84, 7, 99, 0, 8, 127, 0, 8, 63, 0, 9, 223, 82, 7, 27, 0, 8, 111, 0, 8, 47, 0, 9, 191, 0, 8, 15, 0, 8, 143, 0, 8, 79, 0, 9, 255]),
44654 "fixed_td",  Clazz_newIntArray (-1, [80, 5, 1, 87, 5, 257, 83, 5, 17, 91, 5, 4097, 81, 5, 5, 89, 5, 1025, 85, 5, 65, 93, 5, 16385, 80, 5, 3, 88, 5, 513, 84, 5, 33, 92, 5, 8193, 82, 5, 9, 90, 5, 2049, 86, 5, 129, 192, 5, 24577, 80, 5, 2, 87, 5, 385, 83, 5, 25, 91, 5, 6145, 81, 5, 7, 89, 5, 1537, 85, 5, 97, 93, 5, 24577, 80, 5, 4, 88, 5, 769, 84, 5, 49, 92, 5, 12289, 82, 5, 13, 90, 5, 3073, 86, 5, 193, 192, 5, 24577]),
44655 "cplens",  Clazz_newIntArray (-1, [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0]),
44656 "cplext",  Clazz_newIntArray (-1, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112]),
44657 "cpdist",  Clazz_newIntArray (-1, [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577]),
44658 "cpdext",  Clazz_newIntArray (-1, [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13]),
44659 "BMAX", 15);
44660 Clazz_declarePackage ("JU");
44661 c$ = Clazz_decorateAsClass (function () {
44662 this.mode = 0;
44663 this.len = 0;
44664 this.tree = null;
44665 this.tree_index = 0;
44666 this.need = 0;
44667 this.lit = 0;
44668 this.get = 0;
44669 this.dist = 0;
44670 this.lbits = 0;
44671 this.dbits = 0;
44672 this.ltree = null;
44673 this.ltree_index = 0;
44674 this.dtree = null;
44675 this.dtree_index = 0;
44676 this.z = null;
44677 this.s = null;
44678 Clazz_instantialize (this, arguments);
44679 }, JU, "InfCodes");
44680 Clazz_makeConstructor (c$, 
44681 function (z, s) {
44682 this.z = z;
44683 this.s = s;
44684 }, "JU.ZStream,JU.InfBlocks");
44685 Clazz_defineMethod (c$, "init", 
44686 function (bl, bd, tl, tl_index, td, td_index) {
44687 this.mode = 0;
44688 this.lbits = bl;
44689 this.dbits = bd;
44690 this.ltree = tl;
44691 this.ltree_index = tl_index;
44692 this.dtree = td;
44693 this.dtree_index = td_index;
44694 this.tree = null;
44695 }, "~N,~N,~A,~N,~A,~N");
44696 Clazz_defineMethod (c$, "proc", 
44697 function (r) {
44698 var j;
44699 var tindex;
44700 var e;
44701 var b = 0;
44702 var k = 0;
44703 var p = 0;
44704 var n;
44705 var q;
44706 var m;
44707 var f;
44708 p = this.z.next_in_index;
44709 n = this.z.avail_in;
44710 b = this.s.bitb;
44711 k = this.s.bitk;
44712 q = this.s.write;
44713 m = q < this.s.read ? this.s.read - q - 1 : this.s.end - q;
44714 while (true) {
44715 switch (this.mode) {
44716 case 0:
44717 if (m >= 258 && n >= 10) {
44718 this.s.bitb = b;
44719 this.s.bitk = k;
44720 this.z.avail_in = n;
44721 this.z.total_in += p - this.z.next_in_index;
44722 this.z.next_in_index = p;
44723 this.s.write = q;
44724 r = this.inflate_fast (this.lbits, this.dbits, this.ltree, this.ltree_index, this.dtree, this.dtree_index, this.s, this.z);
44725 p = this.z.next_in_index;
44726 n = this.z.avail_in;
44727 b = this.s.bitb;
44728 k = this.s.bitk;
44729 q = this.s.write;
44730 m = q < this.s.read ? this.s.read - q - 1 : this.s.end - q;
44731 if (r != 0) {
44732 this.mode = r == 1 ? 7 : 9;
44733 break;
44734 }}this.need = this.lbits;
44735 this.tree = this.ltree;
44736 this.tree_index = this.ltree_index;
44737 this.mode = 1;
44738 case 1:
44739 j = this.need;
44740 while (k < (j)) {
44741 if (n != 0) r = 0;
44742  else {
44743 this.s.bitb = b;
44744 this.s.bitk = k;
44745 this.z.avail_in = n;
44746 this.z.total_in += p - this.z.next_in_index;
44747 this.z.next_in_index = p;
44748 this.s.write = q;
44749 return this.s.inflate_flush (r);
44750 }n--;
44751 b |= (this.z.next_in[p++] & 0xff) << k;
44752 k += 8;
44753 }
44754 tindex = (this.tree_index + (b & JU.InfCodes.inflate_mask[j])) * 3;
44755 b >>>= (this.tree[tindex + 1]);
44756 k -= (this.tree[tindex + 1]);
44757 e = this.tree[tindex];
44758 if (e == 0) {
44759 this.lit = this.tree[tindex + 2];
44760 this.mode = 6;
44761 break;
44762 }if ((e & 16) != 0) {
44763 this.get = e & 15;
44764 this.len = this.tree[tindex + 2];
44765 this.mode = 2;
44766 break;
44767 }if ((e & 64) == 0) {
44768 this.need = e;
44769 this.tree_index = Clazz_doubleToInt (tindex / 3) + this.tree[tindex + 2];
44770 break;
44771 }if ((e & 32) != 0) {
44772 this.mode = 7;
44773 break;
44774 }this.mode = 9;
44775 this.z.msg = "invalid literal/length code";
44776 r = -3;
44777 this.s.bitb = b;
44778 this.s.bitk = k;
44779 this.z.avail_in = n;
44780 this.z.total_in += p - this.z.next_in_index;
44781 this.z.next_in_index = p;
44782 this.s.write = q;
44783 return this.s.inflate_flush (r);
44784 case 2:
44785 j = this.get;
44786 while (k < (j)) {
44787 if (n != 0) r = 0;
44788  else {
44789 this.s.bitb = b;
44790 this.s.bitk = k;
44791 this.z.avail_in = n;
44792 this.z.total_in += p - this.z.next_in_index;
44793 this.z.next_in_index = p;
44794 this.s.write = q;
44795 return this.s.inflate_flush (r);
44796 }n--;
44797 b |= (this.z.next_in[p++] & 0xff) << k;
44798 k += 8;
44799 }
44800 this.len += (b & JU.InfCodes.inflate_mask[j]);
44801 b >>= j;
44802 k -= j;
44803 this.need = this.dbits;
44804 this.tree = this.dtree;
44805 this.tree_index = this.dtree_index;
44806 this.mode = 3;
44807 case 3:
44808 j = this.need;
44809 while (k < (j)) {
44810 if (n != 0) r = 0;
44811  else {
44812 this.s.bitb = b;
44813 this.s.bitk = k;
44814 this.z.avail_in = n;
44815 this.z.total_in += p - this.z.next_in_index;
44816 this.z.next_in_index = p;
44817 this.s.write = q;
44818 return this.s.inflate_flush (r);
44819 }n--;
44820 b |= (this.z.next_in[p++] & 0xff) << k;
44821 k += 8;
44822 }
44823 tindex = (this.tree_index + (b & JU.InfCodes.inflate_mask[j])) * 3;
44824 b >>= this.tree[tindex + 1];
44825 k -= this.tree[tindex + 1];
44826 e = (this.tree[tindex]);
44827 if ((e & 16) != 0) {
44828 this.get = e & 15;
44829 this.dist = this.tree[tindex + 2];
44830 this.mode = 4;
44831 break;
44832 }if ((e & 64) == 0) {
44833 this.need = e;
44834 this.tree_index = Clazz_doubleToInt (tindex / 3) + this.tree[tindex + 2];
44835 break;
44836 }this.mode = 9;
44837 this.z.msg = "invalid distance code";
44838 r = -3;
44839 this.s.bitb = b;
44840 this.s.bitk = k;
44841 this.z.avail_in = n;
44842 this.z.total_in += p - this.z.next_in_index;
44843 this.z.next_in_index = p;
44844 this.s.write = q;
44845 return this.s.inflate_flush (r);
44846 case 4:
44847 j = this.get;
44848 while (k < (j)) {
44849 if (n != 0) r = 0;
44850  else {
44851 this.s.bitb = b;
44852 this.s.bitk = k;
44853 this.z.avail_in = n;
44854 this.z.total_in += p - this.z.next_in_index;
44855 this.z.next_in_index = p;
44856 this.s.write = q;
44857 return this.s.inflate_flush (r);
44858 }n--;
44859 b |= (this.z.next_in[p++] & 0xff) << k;
44860 k += 8;
44861 }
44862 this.dist += (b & JU.InfCodes.inflate_mask[j]);
44863 b >>= j;
44864 k -= j;
44865 this.mode = 5;
44866 case 5:
44867 f = q - this.dist;
44868 while (f < 0) {
44869 f += this.s.end;
44870 }
44871 while (this.len != 0) {
44872 if (m == 0) {
44873 if (q == this.s.end && this.s.read != 0) {
44874 q = 0;
44875 m = q < this.s.read ? this.s.read - q - 1 : this.s.end - q;
44876 }if (m == 0) {
44877 this.s.write = q;
44878 r = this.s.inflate_flush (r);
44879 q = this.s.write;
44880 m = q < this.s.read ? this.s.read - q - 1 : this.s.end - q;
44881 if (q == this.s.end && this.s.read != 0) {
44882 q = 0;
44883 m = q < this.s.read ? this.s.read - q - 1 : this.s.end - q;
44884 }if (m == 0) {
44885 this.s.bitb = b;
44886 this.s.bitk = k;
44887 this.z.avail_in = n;
44888 this.z.total_in += p - this.z.next_in_index;
44889 this.z.next_in_index = p;
44890 this.s.write = q;
44891 return this.s.inflate_flush (r);
44892 }}}this.s.window[q++] = this.s.window[f++];
44893 m--;
44894 if (f == this.s.end) f = 0;
44895 this.len--;
44896 }
44897 this.mode = 0;
44898 break;
44899 case 6:
44900 if (m == 0) {
44901 if (q == this.s.end && this.s.read != 0) {
44902 q = 0;
44903 m = q < this.s.read ? this.s.read - q - 1 : this.s.end - q;
44904 }if (m == 0) {
44905 this.s.write = q;
44906 r = this.s.inflate_flush (r);
44907 q = this.s.write;
44908 m = q < this.s.read ? this.s.read - q - 1 : this.s.end - q;
44909 if (q == this.s.end && this.s.read != 0) {
44910 q = 0;
44911 m = q < this.s.read ? this.s.read - q - 1 : this.s.end - q;
44912 }if (m == 0) {
44913 this.s.bitb = b;
44914 this.s.bitk = k;
44915 this.z.avail_in = n;
44916 this.z.total_in += p - this.z.next_in_index;
44917 this.z.next_in_index = p;
44918 this.s.write = q;
44919 return this.s.inflate_flush (r);
44920 }}}r = 0;
44921 this.s.window[q++] = this.lit;
44922 m--;
44923 this.mode = 0;
44924 break;
44925 case 7:
44926 if (k > 7) {
44927 k -= 8;
44928 n++;
44929 p--;
44930 }this.s.write = q;
44931 r = this.s.inflate_flush (r);
44932 q = this.s.write;
44933 m = q < this.s.read ? this.s.read - q - 1 : this.s.end - q;
44934 if (this.s.read != this.s.write) {
44935 this.s.bitb = b;
44936 this.s.bitk = k;
44937 this.z.avail_in = n;
44938 this.z.total_in += p - this.z.next_in_index;
44939 this.z.next_in_index = p;
44940 this.s.write = q;
44941 return this.s.inflate_flush (r);
44942 }this.mode = 8;
44943 case 8:
44944 r = 1;
44945 this.s.bitb = b;
44946 this.s.bitk = k;
44947 this.z.avail_in = n;
44948 this.z.total_in += p - this.z.next_in_index;
44949 this.z.next_in_index = p;
44950 this.s.write = q;
44951 return this.s.inflate_flush (r);
44952 case 9:
44953 r = -3;
44954 this.s.bitb = b;
44955 this.s.bitk = k;
44956 this.z.avail_in = n;
44957 this.z.total_in += p - this.z.next_in_index;
44958 this.z.next_in_index = p;
44959 this.s.write = q;
44960 return this.s.inflate_flush (r);
44961 default:
44962 r = -2;
44963 this.s.bitb = b;
44964 this.s.bitk = k;
44965 this.z.avail_in = n;
44966 this.z.total_in += p - this.z.next_in_index;
44967 this.z.next_in_index = p;
44968 this.s.write = q;
44969 return this.s.inflate_flush (r);
44970 }
44971 }
44972 }, "~N");
44973 Clazz_defineMethod (c$, "free", 
44974 function (z) {
44975 }, "JU.ZStream");
44976 Clazz_defineMethod (c$, "inflate_fast", 
44977 function (bl, bd, tl, tl_index, td, td_index, s, z) {
44978 var t;
44979 var tp;
44980 var tp_index;
44981 var e;
44982 var b;
44983 var k;
44984 var p;
44985 var n;
44986 var q;
44987 var m;
44988 var ml;
44989 var md;
44990 var c;
44991 var d;
44992 var r;
44993 var tp_index_t_3;
44994 p = z.next_in_index;
44995 n = z.avail_in;
44996 b = s.bitb;
44997 k = s.bitk;
44998 q = s.write;
44999 m = q < s.read ? s.read - q - 1 : s.end - q;
45000 ml = JU.InfCodes.inflate_mask[bl];
45001 md = JU.InfCodes.inflate_mask[bd];
45002 do {
45003 while (k < (20)) {
45004 n--;
45005 b |= (z.next_in[p++] & 0xff) << k;
45006 k += 8;
45007 }
45008 t = b & ml;
45009 tp = tl;
45010 tp_index = tl_index;
45011 tp_index_t_3 = (tp_index + t) * 3;
45012 if ((e = tp[tp_index_t_3]) == 0) {
45013 b >>= (tp[tp_index_t_3 + 1]);
45014 k -= (tp[tp_index_t_3 + 1]);
45015 s.window[q++] = tp[tp_index_t_3 + 2];
45016 m--;
45017 continue;
45018 }do {
45019 b >>= (tp[tp_index_t_3 + 1]);
45020 k -= (tp[tp_index_t_3 + 1]);
45021 if ((e & 16) != 0) {
45022 e &= 15;
45023 c = tp[tp_index_t_3 + 2] + (b & JU.InfCodes.inflate_mask[e]);
45024 b >>= e;
45025 k -= e;
45026 while (k < (15)) {
45027 n--;
45028 b |= (z.next_in[p++] & 0xff) << k;
45029 k += 8;
45030 }
45031 t = b & md;
45032 tp = td;
45033 tp_index = td_index;
45034 tp_index_t_3 = (tp_index + t) * 3;
45035 e = tp[tp_index_t_3];
45036 do {
45037 b >>= (tp[tp_index_t_3 + 1]);
45038 k -= (tp[tp_index_t_3 + 1]);
45039 if ((e & 16) != 0) {
45040 e &= 15;
45041 while (k < (e)) {
45042 n--;
45043 b |= (z.next_in[p++] & 0xff) << k;
45044 k += 8;
45045 }
45046 d = tp[tp_index_t_3 + 2] + (b & JU.InfCodes.inflate_mask[e]);
45047 b >>= (e);
45048 k -= (e);
45049 m -= c;
45050 if (q >= d) {
45051 r = q - d;
45052 if (q - r > 0 && 2 > (q - r)) {
45053 s.window[q++] = s.window[r++];
45054 s.window[q++] = s.window[r++];
45055 c -= 2;
45056 } else {
45057 System.arraycopy (s.window, r, s.window, q, 2);
45058 q += 2;
45059 r += 2;
45060 c -= 2;
45061 }} else {
45062 r = q - d;
45063 do {
45064 r += s.end;
45065 } while (r < 0);
45066 e = s.end - r;
45067 if (c > e) {
45068 c -= e;
45069 if (q - r > 0 && e > (q - r)) {
45070 do {
45071 s.window[q++] = s.window[r++];
45072 } while (--e != 0);
45073 } else {
45074 System.arraycopy (s.window, r, s.window, q, e);
45075 q += e;
45076 r += e;
45077 e = 0;
45078 }r = 0;
45079 }}if (q - r > 0 && c > (q - r)) {
45080 do {
45081 s.window[q++] = s.window[r++];
45082 } while (--c != 0);
45083 } else {
45084 System.arraycopy (s.window, r, s.window, q, c);
45085 q += c;
45086 r += c;
45087 c = 0;
45088 }break;
45089 } else if ((e & 64) == 0) {
45090 t += tp[tp_index_t_3 + 2];
45091 t += (b & JU.InfCodes.inflate_mask[e]);
45092 tp_index_t_3 = (tp_index + t) * 3;
45093 e = tp[tp_index_t_3];
45094 } else {
45095 z.msg = "invalid distance code";
45096 c = z.avail_in - n;
45097 c = (k >> 3) < c ? k >> 3 : c;
45098 n += c;
45099 p -= c;
45100 k -= c << 3;
45101 s.bitb = b;
45102 s.bitk = k;
45103 z.avail_in = n;
45104 z.total_in += p - z.next_in_index;
45105 z.next_in_index = p;
45106 s.write = q;
45107 return -3;
45108 }} while (true);
45109 break;
45110 }if ((e & 64) == 0) {
45111 t += tp[tp_index_t_3 + 2];
45112 t += (b & JU.InfCodes.inflate_mask[e]);
45113 tp_index_t_3 = (tp_index + t) * 3;
45114 if ((e = tp[tp_index_t_3]) == 0) {
45115 b >>= (tp[tp_index_t_3 + 1]);
45116 k -= (tp[tp_index_t_3 + 1]);
45117 s.window[q++] = tp[tp_index_t_3 + 2];
45118 m--;
45119 break;
45120 }} else if ((e & 32) != 0) {
45121 c = z.avail_in - n;
45122 c = (k >> 3) < c ? k >> 3 : c;
45123 n += c;
45124 p -= c;
45125 k -= c << 3;
45126 s.bitb = b;
45127 s.bitk = k;
45128 z.avail_in = n;
45129 z.total_in += p - z.next_in_index;
45130 z.next_in_index = p;
45131 s.write = q;
45132 return 1;
45133 } else {
45134 z.msg = "invalid literal/length code";
45135 c = z.avail_in - n;
45136 c = (k >> 3) < c ? k >> 3 : c;
45137 n += c;
45138 p -= c;
45139 k -= c << 3;
45140 s.bitb = b;
45141 s.bitk = k;
45142 z.avail_in = n;
45143 z.total_in += p - z.next_in_index;
45144 z.next_in_index = p;
45145 s.write = q;
45146 return -3;
45147 }} while (true);
45148 } while (m >= 258 && n >= 10);
45149 c = z.avail_in - n;
45150 c = (k >> 3) < c ? k >> 3 : c;
45151 n += c;
45152 p -= c;
45153 k -= c << 3;
45154 s.bitb = b;
45155 s.bitk = k;
45156 z.avail_in = n;
45157 z.total_in += p - z.next_in_index;
45158 z.next_in_index = p;
45159 s.write = q;
45160 return 0;
45161 }, "~N,~N,~A,~N,~A,~N,JU.InfBlocks,JU.ZStream");
45162 Clazz_defineStatics (c$,
45163 "inflate_mask",  Clazz_newIntArray (-1, [0x00000000, 0x00000001, 0x00000003, 0x00000007, 0x0000000f, 0x0000001f, 0x0000003f, 0x0000007f, 0x000000ff, 0x000001ff, 0x000003ff, 0x000007ff, 0x00000fff, 0x00001fff, 0x00003fff, 0x00007fff, 0x0000ffff]),
45164 "Z_OK", 0,
45165 "Z_STREAM_END", 1,
45166 "Z_STREAM_ERROR", -2,
45167 "Z_DATA_ERROR", -3,
45168 "START", 0,
45169 "LEN", 1,
45170 "LENEXT", 2,
45171 "DIST", 3,
45172 "DISTEXT", 4,
45173 "COPY", 5,
45174 "LIT", 6,
45175 "WASH", 7,
45176 "END", 8,
45177 "BADCODE", 9);
45178 Clazz_load (["java.io.OutputStream"], "java.io.ByteArrayOutputStream", ["java.lang.IllegalArgumentException", "$.IndexOutOfBoundsException", "$.OutOfMemoryError"], function () {
45179 c$ = Clazz_decorateAsClass (function () {
45180 this.buf = null;
45181 this.count = 0;
45182 Clazz_instantialize (this, arguments);
45183 }, java.io, "ByteArrayOutputStream", java.io.OutputStream);
45184 Clazz_makeConstructor (c$, 
45185 function () {
45186 this.construct (32);
45187 });
45188 Clazz_makeConstructor (c$, 
45189 function (size) {
45190 Clazz_superConstructor (this, java.io.ByteArrayOutputStream, []);
45191 if (size < 0) {
45192 throw  new IllegalArgumentException ("Negative initial size: " + size);
45193 }this.buf =  Clazz_newByteArray (size, 0);
45194 }, "~N");
45195 Clazz_defineMethod (c$, "ensureCapacity", 
45196  function (minCapacity) {
45197 if (minCapacity - this.buf.length > 0) this.grow (minCapacity);
45198 }, "~N");
45199 Clazz_defineMethod (c$, "grow", 
45200  function (minCapacity) {
45201 var oldCapacity = this.buf.length;
45202 var newCapacity = oldCapacity << 1;
45203 if (newCapacity - minCapacity < 0) newCapacity = minCapacity;
45204 if (newCapacity < 0) {
45205 if (minCapacity < 0) throw  new OutOfMemoryError ();
45206 newCapacity = minCapacity;
45207 }this.buf = java.io.ByteArrayOutputStream.arrayCopyByte (this.buf, newCapacity);
45208 }, "~N");
45209 c$.arrayCopyByte = Clazz_defineMethod (c$, "arrayCopyByte", 
45210  function (array, newLength) {
45211 var t =  Clazz_newByteArray (newLength, 0);
45212 System.arraycopy (array, 0, t, 0, array.length < newLength ? array.length : newLength);
45213 return t;
45214 }, "~A,~N");
45215 Clazz_overrideMethod (c$, "writeByteAsInt", 
45216 function (b) {
45217 this.ensureCapacity (this.count + 1);
45218 this.buf[this.count] = b;
45219 this.count += 1;
45220 }, "~N");
45221 Clazz_defineMethod (c$, "write", 
45222 function (b, off, len) {
45223 if ((off < 0) || (off > b.length) || (len < 0) || ((off + len) - b.length > 0)) {
45224 throw  new IndexOutOfBoundsException ();
45225 }this.ensureCapacity (this.count + len);
45226 System.arraycopy (b, off, this.buf, this.count, len);
45227 this.count += len;
45228 }, "~A,~N,~N");
45229 Clazz_defineMethod (c$, "writeTo", 
45230 function (out) {
45231 out.write (this.buf, 0, this.count);
45232 }, "java.io.OutputStream");
45233 Clazz_defineMethod (c$, "reset", 
45234 function () {
45235 this.count = 0;
45236 });
45237 Clazz_defineMethod (c$, "toByteArray", 
45238 function () {
45239 return (this.count == this.buf.length ? this.buf : java.io.ByteArrayOutputStream.arrayCopyByte (this.buf, this.count));
45240 });
45241 Clazz_defineMethod (c$, "size", 
45242 function () {
45243 return this.count;
45244 });
45245 Clazz_overrideMethod (c$, "toString", 
45246 function () {
45247 return  String.instantialize (this.buf, 0, this.count);
45248 });
45249 Clazz_overrideMethod (c$, "close", 
45250 function () {
45251 });
45252 });
45253 Clazz_load (["java.io.Closeable", "$.Flushable"], "java.io.OutputStream", ["java.lang.IndexOutOfBoundsException", "$.NullPointerException"], function () {
45254 c$ = Clazz_declareType (java.io, "OutputStream", null, [java.io.Closeable, java.io.Flushable]);
45255 Clazz_defineMethod (c$, "write", 
45256 function (b, off, len) {
45257 if (b == null) {
45258 throw  new NullPointerException ();
45259 } else if ((off < 0) || (off > b.length) || (len < 0) || ((off + len) > b.length) || ((off + len) < 0)) {
45260 throw  new IndexOutOfBoundsException ();
45261 } else if (len == 0) {
45262 return;
45263 }for (var i = 0; i < len; i++) {
45264 this.writeByteAsInt (b[off + i]);
45265 }
45266 }, "~A,~N,~N");
45267 Clazz_overrideMethod (c$, "flush", 
45268 function () {
45269 });
45270 Clazz_overrideMethod (c$, "close", 
45271 function () {
45272 });
45273 });
45274 Clazz_declarePackage ("java.util.zip");
45275 Clazz_load (["java.io.IOException"], "java.util.zip.ZipException", null, function () {
45276 c$ = Clazz_declareType (java.util.zip, "ZipException", java.io.IOException);
45277 });
45278 Clazz_declarePackage ("MCview");
45279 Clazz_load (["java.awt.Color"], "MCview.Atom", ["java.lang.Float"], function () {
45280 c$ = Clazz_decorateAsClass (function () {
45281 this.x = 0;
45282 this.y = 0;
45283 this.z = 0;
45284 this.number = 0;
45285 this.name = null;
45286 this.resName = null;
45287 this.resNumber = 0;
45288 this.insCode = ' ';
45289 this.resNumIns = null;
45290 this.type = 0;
45291 this.color = null;
45292 this.chain = null;
45293 this.alignmentMapping = -1;
45294 this.atomIndex = 0;
45295 this.occupancy = 0;
45296 this.tfactor = 0;
45297 this.isSelected = false;
45298 Clazz_instantialize (this, arguments);
45299 }, MCview, "Atom");
45300 Clazz_prepareFields (c$, function () {
45301 this.color = java.awt.Color.lightGray;
45302 });
45303 Clazz_makeConstructor (c$, 
45304 function (str) {
45305 this.atomIndex = Integer.parseInt (str.substring (6, 11).trim ());
45306 this.name = str.substring (12, 15).trim ();
45307 this.resName = str.substring (17, 20);
45308 this.chain = str.substring (21, 22);
45309 this.resNumber = Integer.parseInt (str.substring (22, 26).trim ());
45310 this.resNumIns = str.substring (22, 27).trim ();
45311 this.insCode = str.substring (26, 27).charAt (0);
45312 this.x = ( new Float (str.substring (30, 38).trim ()).floatValue ());
45313 this.y = ( new Float (str.substring (38, 46).trim ()).floatValue ());
45314 this.z = ( new Float (str.substring (47, 55).trim ()).floatValue ());
45315 var tm = str.substring (54, 60).trim ();
45316 if (tm.length > 0) {
45317 this.occupancy = ( new Float (tm)).floatValue ();
45318 } else {
45319 this.occupancy = 1;
45320 }tm = str.substring (60, 66).trim ();
45321 if (tm.length > 0) {
45322 this.tfactor = ( new Float (tm).floatValue ());
45323 } else {
45324 this.tfactor = 1;
45325 }}, "~S");
45326 Clazz_makeConstructor (c$, 
45327 function (x, y, z) {
45328 this.x = x;
45329 this.y = y;
45330 this.z = z;
45331 }, "~N,~N,~N");
45332 });
45333 Clazz_declarePackage ("MCview");
45334 Clazz_load (["java.util.Vector"], "MCview.PDBChain", ["MCview.Bond", "$.Residue", "jalview.datamodel.AlignmentAnnotation", "$.Annotation", "$.Sequence", "$.SequenceFeature", "jalview.schemes.ResidueProperties", "java.awt.Color", "java.lang.StringBuilder"], function () {
45335 c$ = Clazz_decorateAsClass (function () {
45336 this.id = null;
45337 this.bonds = null;
45338 this.atoms = null;
45339 this.residues = null;
45340 this.offset = 0;
45341 this.sequence = null;
45342 this.shadow = null;
45343 this.isNa = false;
45344 this.isVisible = true;
45345 this.pdbstart = 0;
45346 this.pdbend = 0;
45347 this.seqstart = 0;
45348 this.seqend = 0;
45349 this.pdbid = "";
45350 this.newline = null;
45351 this.shadowMap = null;
45352 Clazz_instantialize (this, arguments);
45353 }, MCview, "PDBChain");
45354 Clazz_prepareFields (c$, function () {
45355 this.bonds =  new java.util.Vector ();
45356 this.atoms =  new java.util.Vector ();
45357 this.residues =  new java.util.Vector ();
45358 this.newline = System.getProperty ("line.separator");
45359 });
45360 Clazz_makeConstructor (c$, 
45361 function (pdbid, id) {
45362 this.pdbid = pdbid.toLowerCase ();
45363 this.id = id;
45364 }, "~S,~S");
45365 Clazz_defineMethod (c$, "setNewlineString", 
45366 function (nl) {
45367 this.newline = nl;
45368 }, "~S");
45369 Clazz_defineMethod (c$, "getNewlineString", 
45370 function () {
45371 return this.newline;
45372 });
45373 Clazz_defineMethod (c$, "print", 
45374 function () {
45375 var tmp =  new StringBuilder (256);
45376 for (var b, $b = this.bonds.iterator (); $b.hasNext () && ((b = $b.next ()) || true);) {
45377 tmp.append (b.at1.resName).append (" ").append (b.at1.resNumber).append (" ").append (this.offset).append (this.newline);
45378 }
45379 return tmp.toString ();
45380 });
45381 Clazz_defineMethod (c$, "makeExactMapping", 
45382 function (as, s1) {
45383 var pdbpos = as.getSeq2Start () - 2;
45384 var alignpos = s1.getStart () + as.getSeq1Start () - 3;
45385 for (var atom, $atom = this.atoms.iterator (); $atom.hasNext () && ((atom = $atom.next ()) || true);) {
45386 atom.alignmentMapping = -1;
45387 }
45388 for (var i = 0; i < as.astr1.length; i++) {
45389 if (as.astr1.charAt (i) != '-') {
45390 alignpos++;
45391 }if (as.astr2.charAt (i) != '-') {
45392 pdbpos++;
45393 }if (as.astr1.charAt (i) == as.astr2.charAt (i)) {
45394 var res = this.residues.elementAt (pdbpos);
45395 for (var atom, $atom = res.atoms.iterator (); $atom.hasNext () && ((atom = $atom.next ()) || true);) {
45396 atom.alignmentMapping = alignpos;
45397 }
45398 }}
45399 }, "jalview.analysis.AlignSeq,jalview.datamodel.SequenceI");
45400 Clazz_defineMethod (c$, "transferRESNUMFeatures", 
45401 function (seq, status) {
45402 var sq = seq;
45403 while (sq != null && sq.getDatasetSequence () != null) {
45404 sq = sq.getDatasetSequence ();
45405 if (sq === this.sequence) {
45406 return null;
45407 }}
45408 if (status == null) {
45409 status = "IEA:jalview";
45410 }var features = this.sequence.getSequenceFeatures ();
45411 for (var i = 0; i < features.length; i++) {
45412 if (features[i].getFeatureGroup ().equals (this.pdbid)) {
45413 var tx =  new jalview.datamodel.SequenceFeature (features[i]);
45414 tx.setBegin (1 + this.residues.elementAt (tx.getBegin () - this.offset).atoms.elementAt (0).alignmentMapping);
45415 tx.setEnd (1 + this.residues.elementAt (tx.getEnd () - this.offset).atoms.elementAt (0).alignmentMapping);
45416 tx.setStatus (status + ((tx.getStatus () == null || tx.getStatus ().length == 0) ? "" : ":" + tx.getStatus ()));
45417 if (tx.begin != 0 && tx.end != 0) {
45418 sq.addSequenceFeature (tx);
45419 }}}
45420 return features;
45421 }, "jalview.datamodel.SequenceI,~S");
45422 Clazz_defineMethod (c$, "makeCaBondList", 
45423 function () {
45424 var na = false;
45425 var numNa = 0;
45426 for (var i = 0; i < (this.residues.size () - 1); i++) {
45427 var tmpres = this.residues.elementAt (i);
45428 var tmpres2 = this.residues.elementAt (i + 1);
45429 var at1 = tmpres.findAtom ("CA");
45430 var at2 = tmpres2.findAtom ("CA");
45431 na = false;
45432 if ((at1 == null) && (at2 == null)) {
45433 na = true;
45434 at1 = tmpres.findAtom ("P");
45435 at2 = tmpres2.findAtom ("P");
45436 }if ((at1 != null) && (at2 != null)) {
45437 if (at1.chain.equals (at2.chain)) {
45438 if (na) {
45439 numNa++;
45440 }this.makeBond (at1, at2);
45441 }} else {
45442 System.out.println ("not found " + i);
45443 }}
45444 if (this.residues.size () > 0 && (Clazz_doubleToInt (numNa / (this.residues.size () - 1)) > 0.99)) {
45445 this.isNa = true;
45446 }});
45447 Clazz_defineMethod (c$, "makeBond", 
45448 function (at1, at2) {
45449 this.bonds.addElement ( new MCview.Bond (at1, at2));
45450 }, "MCview.Atom,MCview.Atom");
45451 Clazz_defineMethod (c$, "makeResidueList", 
45452 function (visibleChainAnnotation) {
45453 var count = 0;
45454 var symbol;
45455 var deoxyn = false;
45456 var nucleotide = false;
45457 var seq =  new StringBuilder (256);
45458 var resFeatures =  new java.util.Vector ();
45459 var resAnnotation =  new java.util.Vector ();
45460 var i;
45461 var iSize = this.atoms.size () - 1;
45462 var resNumber = -1;
45463 for (i = 0; i <= iSize; i++) {
45464 var tmp = this.atoms.elementAt (i);
45465 resNumber = tmp.resNumber;
45466 var res = resNumber;
45467 if (i == 0) {
45468 this.offset = resNumber;
45469 }var resAtoms =  new java.util.Vector ();
45470 while ((resNumber == res) && (i < this.atoms.size ())) {
45471 resAtoms.add (this.atoms.elementAt (i));
45472 i++;
45473 if (i < this.atoms.size ()) {
45474 resNumber = this.atoms.elementAt (i).resNumber;
45475 } else {
45476 resNumber++;
45477 }}
45478 i--;
45479 this.residues.addElement ( new MCview.Residue (resAtoms, resNumber - 1, count));
45480 var tmpres = this.residues.lastElement ();
45481 var tmpat = tmpres.atoms.get (0);
45482 var sf =  new jalview.datamodel.SequenceFeature ("RESNUM", tmpat.resName + ":" + tmpat.resNumIns + " " + this.pdbid + this.id, "", this.offset + count, this.offset + count, this.pdbid);
45483 resFeatures.addElement (sf);
45484 resAnnotation.addElement ( new jalview.datamodel.Annotation (tmpat.tfactor));
45485 if ((symbol = jalview.schemes.ResidueProperties.getAA3Hash ().get (tmpat.resName)) == null) {
45486 var nucname = tmpat.resName.trim ();
45487 deoxyn = nucname.length == 2 && jalview.schemes.ResidueProperties.aaIndex[nucname.charCodeAt (0)] == jalview.schemes.ResidueProperties.aaIndex['D'.charCodeAt (0)];
45488 if (tmpat.name.equalsIgnoreCase ("CA") || jalview.schemes.ResidueProperties.nucleotideIndex[nucname.charCodeAt ((deoxyn ? 1 : 0))] == -1) {
45489 seq.append ("X");
45490 } else {
45491 nucleotide = true;
45492 seq.append (nucname.charAt ((deoxyn ? 1 : 0)));
45493 }} else {
45494 if (nucleotide) {
45495 System.err.println ("Warning: mixed nucleotide and amino acid chain.. its gonna do bad things to you!");
45496 }seq.append (jalview.schemes.ResidueProperties.aa[(symbol).intValue ()]);
45497 }count++;
45498 }
45499 if (this.id.length < 1) {
45500 this.id = " ";
45501 }this.isNa = nucleotide;
45502 this.sequence =  new jalview.datamodel.Sequence (this.id, seq.toString (), this.offset, resNumber - 1);
45503 for (i = 0, iSize = resFeatures.size (); i < iSize; i++) {
45504 this.sequence.addSequenceFeature (resFeatures.elementAt (i));
45505 resFeatures.setElementAt (null, i);
45506 }
45507 if (visibleChainAnnotation) {
45508 var annots =  new Array (resAnnotation.size ());
45509 var max = 0;
45510 for (i = 0, iSize = annots.length; i < iSize; i++) {
45511 annots[i] = resAnnotation.elementAt (i);
45512 if (annots[i].value > max) {
45513 max = annots[i].value;
45514 }resAnnotation.setElementAt (null, i);
45515 }
45516 var tfactorann =  new jalview.datamodel.AlignmentAnnotation ("Temperature Factor", "Temperature Factor for " + this.pdbid + this.id, annots, 0, max, 2);
45517 tfactorann.setSequenceRef (this.sequence);
45518 this.sequence.addAlignmentAnnotation (tfactorann);
45519 }}, "~B");
45520 Clazz_defineMethod (c$, "setChargeColours", 
45521 function () {
45522 for (var b, $b = this.bonds.iterator (); $b.hasNext () && ((b = $b.next ()) || true);) {
45523 if (b.at1 != null && b.at2 != null) {
45524 b.startCol = MCview.PDBChain.getChargeColour (b.at1.resName);
45525 b.endCol = MCview.PDBChain.getChargeColour (b.at2.resName);
45526 } else {
45527 b.startCol = java.awt.Color.gray;
45528 b.endCol = java.awt.Color.gray;
45529 }}
45530 });
45531 c$.getChargeColour = Clazz_defineMethod (c$, "getChargeColour", 
45532 function (resName) {
45533 var result = java.awt.Color.lightGray;
45534 if ("ASP".equals (resName) || "GLU".equals (resName)) {
45535 result = java.awt.Color.red;
45536 } else if ("LYS".equals (resName) || "ARG".equals (resName)) {
45537 result = java.awt.Color.blue;
45538 } else if ("CYS".equals (resName)) {
45539 result = java.awt.Color.yellow;
45540 }return result;
45541 }, "~S");
45542 Clazz_defineMethod (c$, "setChainColours", 
45543 function (cs) {
45544 var index;
45545 for (var b, $b = this.bonds.iterator (); $b.hasNext () && ((b = $b.next ()) || true);) {
45546 try {
45547 index = jalview.schemes.ResidueProperties.aa3Hash.get (b.at1.resName).intValue ();
45548 b.startCol = cs.findColour (jalview.schemes.ResidueProperties.aa[index].charAt (0));
45549 index = jalview.schemes.ResidueProperties.aa3Hash.get (b.at2.resName).intValue ();
45550 b.endCol = cs.findColour (jalview.schemes.ResidueProperties.aa[index].charAt (0));
45551 } catch (e) {
45552 if (Clazz_exceptionOf (e, Exception)) {
45553 b.startCol = java.awt.Color.gray;
45554 b.endCol = java.awt.Color.gray;
45555 } else {
45556 throw e;
45557 }
45558 }
45559 }
45560 }, "jalview.schemes.ColourSchemeI");
45561 Clazz_defineMethod (c$, "setChainColours", 
45562 function (col) {
45563 for (var b, $b = this.bonds.iterator (); $b.hasNext () && ((b = $b.next ()) || true);) {
45564 b.startCol = col;
45565 b.endCol = col;
45566 }
45567 }, "java.awt.Color");
45568 Clazz_defineMethod (c$, "transferResidueAnnotation", 
45569 function (mapping, sqmpping) {
45570 var sq = mapping.getSequence ();
45571 var dsq = sq;
45572 if (sq != null) {
45573 while (dsq.getDatasetSequence () != null) {
45574 dsq = dsq.getDatasetSequence ();
45575 }
45576 if (this.shadow != null && this.shadow.getAnnotation () != null) {
45577 for (var ana, $ana = 0, $$ana = this.shadow.getAnnotation (); $ana < $$ana.length && ((ana = $$ana[$ana]) || true); $ana++) {
45578 var transfer = sq.getAlignmentAnnotations (ana.getCalcId (), ana.label);
45579 if (transfer == null || transfer.size () == 0) {
45580 ana =  new jalview.datamodel.AlignmentAnnotation (ana);
45581 ana.liftOver (this.sequence, this.shadowMap);
45582 ana.liftOver (dsq, sqmpping);
45583 dsq.addAlignmentAnnotation (ana);
45584 } else {
45585 continue;
45586 }}
45587 } else {
45588 if (this.sequence != null && this.sequence.getAnnotation () != null) {
45589 for (var ana, $ana = 0, $$ana = this.sequence.getAnnotation (); $ana < $$ana.length && ((ana = $$ana[$ana]) || true); $ana++) {
45590 var transfer = sq.getAlignmentAnnotations (ana.getCalcId (), ana.label);
45591 if (transfer == null || transfer.size () == 0) {
45592 ana =  new jalview.datamodel.AlignmentAnnotation (ana);
45593 ana.liftOver (dsq, sqmpping);
45594 } else {
45595 continue;
45596 }}
45597 }}if (false) {
45598 var min = -1;
45599 var max = 0;
45600 var an =  new Array (sq.getEnd () - sq.getStart () + 1);
45601 for (var i = sq.getStart (), j = sq.getEnd (), k = 0; i <= j; i++, k++) {
45602 var prn = mapping.getPDBResNum (k + 1);
45603 an[k] =  new jalview.datamodel.Annotation (prn);
45604 if (min == -1) {
45605 min = k;
45606 max = k;
45607 } else {
45608 if (min > k) {
45609 min = k;
45610 } else if (max < k) {
45611 max = k;
45612 }}}
45613 sq.addAlignmentAnnotation ( new jalview.datamodel.AlignmentAnnotation ("PDB.RESNUM", "PDB Residue Numbering for " + this.pdbid + ":" + this.id, an, min, max, 2));
45614 }}}, "jalview.structure.StructureMapping,jalview.datamodel.Mapping");
45615 Clazz_defineStatics (c$,
45616 "PDBFILEFEATURE", "PDBFile",
45617 "IEASTATUS", "IEA:jalview");
45618 });
45619 Clazz_declarePackage ("MCview");
45620 Clazz_load (["java.awt.Color"], "MCview.Bond", null, function () {
45621 c$ = Clazz_decorateAsClass (function () {
45622 this.start = null;
45623 this.end = null;
45624 this.startCol = null;
45625 this.endCol = null;
45626 this.at1 = null;
45627 this.at2 = null;
45628 Clazz_instantialize (this, arguments);
45629 }, MCview, "Bond");
45630 Clazz_prepareFields (c$, function () {
45631 this.startCol = java.awt.Color.lightGray;
45632 this.endCol = java.awt.Color.lightGray;
45633 });
45634 Clazz_makeConstructor (c$, 
45635 function (at1, at2) {
45636 this.start =  Clazz_newFloatArray (-1, [at1.x, at1.y, at1.z]);
45637 this.end =  Clazz_newFloatArray (-1, [at2.x, at2.y, at2.z]);
45638 this.startCol = at1.color;
45639 this.endCol = at2.color;
45640 this.at1 = at1;
45641 this.at2 = at2;
45642 }, "MCview.Atom,MCview.Atom");
45643 Clazz_defineMethod (c$, "translate", 
45644 function (x, y, z) {
45645 this.start[0] = this.start[0] + x;
45646 this.end[0] = this.end[0] + x;
45647 this.start[1] = this.start[1] + y;
45648 this.end[1] = this.end[1] + y;
45649 this.start[2] = this.start[2] + z;
45650 this.end[2] = this.end[2] + z;
45651 }, "~N,~N,~N");
45652 });
45653 Clazz_declarePackage ("MCview");
45654 c$ = Clazz_decorateAsClass (function () {
45655 this.atoms = null;
45656 this.number = 0;
45657 this.count = 0;
45658 Clazz_instantialize (this, arguments);
45659 }, MCview, "Residue");
45660 Clazz_makeConstructor (c$, 
45661 function (resAtoms, number, count) {
45662 this.atoms = resAtoms;
45663 this.number = number;
45664 this.count = count;
45665 }, "java.util.Vector,~N,~N");
45666 Clazz_defineMethod (c$, "findAtom", 
45667 function (name) {
45668 for (var atom, $atom = this.atoms.iterator (); $atom.hasNext () && ((atom = $atom.next ()) || true);) {
45669 if (atom.name.equals (name)) {
45670 return atom;
45671 }}
45672 return null;
45673 }, "~S");
45674 Clazz_declarePackage ("jalview.structure");
45675 c$ = Clazz_decorateAsClass (function () {
45676 this.pdbFile = null;
45677 this.chain = null;
45678 this.pdbResNum = 0;
45679 this.atomIndex = 0;
45680 Clazz_instantialize (this, arguments);
45681 }, jalview.structure, "AtomSpec");
45682 Clazz_makeConstructor (c$, 
45683 function (pdbFile, chain, resNo, atomNo) {
45684 this.pdbFile = pdbFile;
45685 this.chain = chain;
45686 this.pdbResNum = resNo;
45687 this.atomIndex = atomNo;
45688 }, "~S,~S,~N,~N");
45689 Clazz_defineMethod (c$, "getPdbFile", 
45690 function () {
45691 return this.pdbFile;
45692 });
45693 Clazz_defineMethod (c$, "getChain", 
45694 function () {
45695 return this.chain;
45696 });
45697 Clazz_defineMethod (c$, "getPdbResNum", 
45698 function () {
45699 return this.pdbResNum;
45700 });
45701 Clazz_defineMethod (c$, "getAtomIndex", 
45702 function () {
45703 return this.atomIndex;
45704 });
45705 Clazz_overrideMethod (c$, "toString", 
45706 function () {
45707 return "pdbFile: " + this.pdbFile + ", chain: " + this.chain + ", res: " + this.pdbResNum + ", atom: " + this.atomIndex;
45708 });
45709 Clazz_declarePackage ("jalview.structure");
45710 Clazz_declareInterface (jalview.structure, "SecondaryStructureListener");
45711 Clazz_declarePackage ("jalview.structure");
45712 Clazz_declareInterface (jalview.structure, "SequenceListener");
45713 Clazz_declarePackage ("jalview.structure");
45714 Clazz_declareInterface (jalview.structure, "StructureListener");
45715 Clazz_declarePackage ("jalview.structure");
45716 Clazz_load (null, "jalview.structure.StructureMapping", ["jalview.datamodel.AlignmentAnnotation"], function () {
45717 c$ = Clazz_decorateAsClass (function () {
45718 this.mappingDetails = null;
45719 this.sequence = null;
45720 this.pdbfile = null;
45721 this.pdbid = null;
45722 this.pdbchain = null;
45723 this.mapping = null;
45724 Clazz_instantialize (this, arguments);
45725 }, jalview.structure, "StructureMapping");
45726 Clazz_makeConstructor (c$, 
45727 function (seq, pdbfile, pdbid, chain, mapping, mappingDetails) {
45728 this.sequence = seq;
45729 this.pdbfile = pdbfile;
45730 this.pdbid = pdbid;
45731 this.pdbchain = chain;
45732 this.mapping = mapping;
45733 this.mappingDetails = mappingDetails;
45734 }, "jalview.datamodel.SequenceI,~S,~S,~S,~A,~S");
45735 Clazz_defineMethod (c$, "getSequence", 
45736 function () {
45737 return this.sequence;
45738 });
45739 Clazz_defineMethod (c$, "getChain", 
45740 function () {
45741 return this.pdbchain;
45742 });
45743 Clazz_defineMethod (c$, "getPdbId", 
45744 function () {
45745 return this.pdbid;
45746 });
45747 Clazz_defineMethod (c$, "getAtomNum", 
45748 function (seqpos) {
45749 if (this.mapping.length > seqpos) {
45750 return this.mapping[seqpos][1];
45751 } else {
45752 return 0;
45753 }}, "~N");
45754 Clazz_defineMethod (c$, "getPDBResNum", 
45755 function (seqpos) {
45756 if (this.mapping.length > seqpos) {
45757 return this.mapping[seqpos][0];
45758 } else {
45759 return 0;
45760 }}, "~N");
45761 Clazz_defineMethod (c$, "getSeqPos", 
45762 function (pdbResNum) {
45763 for (var i = 0; i < this.mapping.length; i++) {
45764 if (this.mapping[i][0] == pdbResNum) {
45765 return i;
45766 }}
45767 return -1;
45768 }, "~N");
45769 Clazz_defineMethod (c$, "transfer", 
45770 function (ana) {
45771 var ala_copy =  new jalview.datamodel.AlignmentAnnotation (ana);
45772 var ds = this.sequence;
45773 while (ds.getDatasetSequence () != null) {
45774 ds = ds.getDatasetSequence ();
45775 }
45776 ala_copy.remap (ds, this.mapping, -1, -1, 0);
45777 ds.addAlignmentAnnotation (ala_copy);
45778 if (ds !== this.sequence) {
45779 ala_copy =  new jalview.datamodel.AlignmentAnnotation (ala_copy);
45780 this.sequence.addAlignmentAnnotation (ala_copy);
45781 }return ala_copy;
45782 }, "jalview.datamodel.AlignmentAnnotation");
45783 });
45784 Clazz_declarePackage ("jalview.structure");
45785 Clazz_declareInterface (jalview.structure, "VamsasListener");
45786 Clazz_declarePackage ("jalview.appletgui");
45787 Clazz_load (["awt2swing.Panel", "jalview.api.AlignmentViewPanel", "java.awt.event.AdjustmentListener", "awt2swing.Scrollbar"], "jalview.appletgui.AlignmentPanel", ["awt2swing.Frame", "jalview.analysis.AnnotationSorter", "jalview.appletgui.AnnotationLabels", "$.AnnotationPanel", "$.FeatureRenderer", "$.IdPanel", "$.IdwidthAdjuster", "$.PaintRefresher", "$.ScalePanel", "$.SeqPanel", "jalview.bin.JalviewLite", "jalview.structure.StructureSelectionManager", "java.awt.BorderLayout", "$.Color", "$.Dimension", "java.awt.event.ComponentAdapter", "java.beans.PropertyChangeListener"], function () {
45788 c$ = Clazz_decorateAsClass (function () {
45789 this.av = null;
45790 this.overviewPanel = null;
45791 this.seqPanel = null;
45792 this.idPanel = null;
45793 this.idwidthAdjuster = null;
45794 this.alignFrame = null;
45795 this.scalePanel = null;
45796 this.annotationPanel = null;
45797 this.alabels = null;
45798 this.fastPaint = true;
45799 this.hextent = 0;
45800 this.vextent = 0;
45801 this.sequenceHolderPanel = null;
45802 this.vscroll = null;
45803 this.hscroll = null;
45804 this.seqPanelHolder = null;
45805 this.scalePanelHolder = null;
45806 this.idPanelHolder = null;
45807 this.idSpaceFillerPanel1 = null;
45808 this.annotationSpaceFillerHolder = null;
45809 this.hscrollFillerPanel = null;
45810 this.annotationPanelHolder = null;
45811 this.apvscroll = null;
45812 this.followingComplementScroll = false;
45813 Clazz_instantialize (this, arguments);
45814 }, jalview.appletgui, "AlignmentPanel", awt2swing.Panel, [java.awt.event.AdjustmentListener, jalview.api.AlignmentViewPanel]);
45815 Clazz_prepareFields (c$, function () {
45816 this.sequenceHolderPanel =  new awt2swing.Panel ();
45817 this.vscroll =  new awt2swing.Scrollbar ();
45818 this.hscroll =  new awt2swing.Scrollbar ();
45819 this.seqPanelHolder =  new awt2swing.Panel ();
45820 this.scalePanelHolder =  new awt2swing.Panel ();
45821 this.idPanelHolder =  new awt2swing.Panel ();
45822 this.idSpaceFillerPanel1 =  new awt2swing.Panel ();
45823 this.annotationSpaceFillerHolder =  new awt2swing.Panel ();
45824 this.hscrollFillerPanel =  new awt2swing.Panel ();
45825 this.annotationPanelHolder =  new awt2swing.Panel ();
45826 this.apvscroll =  new awt2swing.Scrollbar ();
45827 });
45828 Clazz_overrideMethod (c$, "finalize", 
45829 function () {
45830 this.alignFrame = null;
45831 this.av = null;
45832 this.seqPanel = null;
45833 this.seqPanelHolder = null;
45834 this.sequenceHolderPanel = null;
45835 this.scalePanel = null;
45836 this.scalePanelHolder = null;
45837 this.annotationPanel = null;
45838 this.annotationPanelHolder = null;
45839 this.annotationSpaceFillerHolder = null;
45840 });
45841 Clazz_makeConstructor (c$, 
45842 function (af, av) {
45843 Clazz_superConstructor (this, jalview.appletgui.AlignmentPanel, []);
45844 this.setName ("alignmentPanel");
45845 try {
45846 this.jbInit ();
45847 } catch (e) {
45848 if (Clazz_exceptionOf (e, Exception)) {
45849 e.printStackTrace ();
45850 } else {
45851 throw e;
45852 }
45853 }
45854 this.alignFrame = af;
45855 this.av = av;
45856 this.seqPanel =  new jalview.appletgui.SeqPanel (av, this);
45857 this.idPanel =  new jalview.appletgui.IdPanel (av, this);
45858 this.scalePanel =  new jalview.appletgui.ScalePanel (av, this);
45859 this.idwidthAdjuster =  new jalview.appletgui.IdwidthAdjuster (this);
45860 this.annotationPanel =  new jalview.appletgui.AnnotationPanel (this);
45861 this.annotationPanelHolder.add (this.annotationPanel, "Center");
45862 this.sequenceHolderPanel.add (this.annotationPanelHolder, "South");
45863 this.alabels =  new jalview.appletgui.AnnotationLabels (this);
45864 this.setAnnotationVisible (av.isShowAnnotation ());
45865 this.idPanelHolder.add (this.idPanel, "Center");
45866 this.idSpaceFillerPanel1.add (this.idwidthAdjuster, "Center");
45867 this.annotationSpaceFillerHolder.add (this.alabels, "Center");
45868 this.scalePanelHolder.add (this.scalePanel, "Center");
45869 this.seqPanelHolder.add (this.seqPanel, "Center");
45870 this.fontChanged ();
45871 this.setScrollValues (0, 0);
45872 this.apvscroll.addAdjustmentListener (this);
45873 this.hscroll.addAdjustmentListener (this);
45874 this.vscroll.addAdjustmentListener (this);
45875 this.addComponentListener (((Clazz_isClassDefined ("jalview.appletgui.AlignmentPanel$1") ? 0 : jalview.appletgui.AlignmentPanel.$AlignmentPanel$1$ ()), Clazz_innerTypeInstance (jalview.appletgui.AlignmentPanel$1, this, Clazz_cloneFinals ("av", av))));
45876 var d = this.calculateIdWidth ();
45877 this.idPanel.idCanvas.setSize (d);
45878 this.hscrollFillerPanel.setSize (d.width, this.annotationPanel.getSize ().height);
45879 this.idPanel.idCanvas.setSize (d.width, this.seqPanel.seqCanvas.getSize ().height);
45880 this.annotationSpaceFillerHolder.setSize (d.width, this.annotationPanel.getSize ().height);
45881 this.alabels.setSize (d.width, this.annotationPanel.getSize ().height);
45882 var ap = this;
45883 av.addPropertyChangeListener (((Clazz_isClassDefined ("jalview.appletgui.AlignmentPanel$2") ? 0 : jalview.appletgui.AlignmentPanel.$AlignmentPanel$2$ ()), Clazz_innerTypeInstance (jalview.appletgui.AlignmentPanel$2, this, Clazz_cloneFinals ("ap", ap, "av", av))));
45884 }, "jalview.appletgui.AlignFrame,jalview.appletgui.AlignViewport");
45885 Clazz_overrideMethod (c$, "getAlignViewport", 
45886 function () {
45887 return this.av;
45888 });
45889 Clazz_defineMethod (c$, "getSequenceRenderer", 
45890 function () {
45891 return this.seqPanel.seqCanvas.sr;
45892 });
45893 Clazz_overrideMethod (c$, "getFeatureRenderer", 
45894 function () {
45895 return this.seqPanel.seqCanvas.fr;
45896 });
45897 Clazz_overrideMethod (c$, "cloneFeatureRenderer", 
45898 function () {
45899 var nfr =  new jalview.appletgui.FeatureRenderer (this.av);
45900 nfr.transferSettings (this.seqPanel.seqCanvas.fr);
45901 return nfr;
45902 });
45903 Clazz_defineMethod (c$, "alignmentChanged", 
45904 function () {
45905 this.av.alignmentChanged (this);
45906 if (this.overviewPanel != null) {
45907 this.overviewPanel.updateOverviewImage ();
45908 }this.alignFrame.updateEditMenuBar ();
45909 this.repaint ();
45910 });
45911 Clazz_defineMethod (c$, "fontChanged", 
45912 function () {
45913 this.idPanel.idCanvas.image = null;
45914 var fm = this.getFontMetrics (this.av.getFont ());
45915 this.scalePanel.setSize ( new java.awt.Dimension (10, this.av.getCharHeight () + fm.getDescent ()));
45916 this.idwidthAdjuster.setSize ( new java.awt.Dimension (10, this.av.getCharHeight () + fm.getDescent ()));
45917 this.av.updateSequenceIdColours ();
45918 this.annotationPanel.image = null;
45919 var ap = this.annotationPanel.adjustPanelHeight (false);
45920 var d = this.calculateIdWidth ();
45921 d.setSize (d.width + 4, this.seqPanel.seqCanvas.getSize ().height);
45922 this.alabels.setSize (d.width + 4, ap);
45923 this.idPanel.idCanvas.setSize (d);
45924 this.hscrollFillerPanel.setSize (d);
45925 this.validateAnnotationDimensions (false);
45926 this.annotationPanel.repaint ();
45927 this.validate ();
45928 this.repaint ();
45929 if (this.overviewPanel != null) {
45930 this.overviewPanel.updateOverviewImage ();
45931 }});
45932 Clazz_defineMethod (c$, "setIdWidth", 
45933 function (w, h) {
45934 this.idPanel.idCanvas.setSize (w, h);
45935 this.idPanelHolder.setSize (w, this.idPanelHolder.getSize ().height);
45936 this.annotationSpaceFillerHolder.setSize (w, this.annotationSpaceFillerHolder.getSize ().height);
45937 this.alabels.setSize (w, this.alabels.getSize ().height);
45938 this.validate ();
45939 }, "~N,~N");
45940 Clazz_defineMethod (c$, "calculateIdWidth", 
45941 function () {
45942 if (this.av.nullFrame == null) {
45943 this.av.nullFrame =  new awt2swing.Frame ();
45944 this.av.nullFrame.addNotify ();
45945 this.av.nullFrame.setFont (this.av.font);
45946 }var g = this.av.nullFrame.getGraphics ();
45947 var fm = g.getFontMetrics (this.av.font);
45948 var al = this.av.getAlignment ();
45949 var i = 0;
45950 var idWidth = 0;
45951 var id;
45952 while (i < al.getHeight () && al.getSequenceAt (i) != null) {
45953 var s = al.getSequenceAt (i);
45954 id = s.getDisplayId (this.av.getShowJVSuffix ());
45955 if (fm.stringWidth (id) > idWidth) {
45956 idWidth = fm.stringWidth (id);
45957 }i++;
45958 }
45959 i = 0;
45960 if (al.getAlignmentAnnotation () != null) {
45961 fm = g.getFontMetrics (this.av.nullFrame.getFont ());
45962 while (i < al.getAlignmentAnnotation ().length) {
45963 var label = al.getAlignmentAnnotation ()[i].label;
45964 if (fm.stringWidth (label) > idWidth) {
45965 idWidth = fm.stringWidth (label);
45966 }i++;
45967 }
45968 }return  new java.awt.Dimension (idWidth, this.idPanel.idCanvas.getSize ().height);
45969 });
45970 Clazz_defineMethod (c$, "highlightSearchResults", 
45971 function (results) {
45972 this.scrollToPosition (results);
45973 this.seqPanel.seqCanvas.highlightSearchResults (results);
45974 }, "jalview.datamodel.SearchResults");
45975 Clazz_defineMethod (c$, "scrollToPosition", 
45976 function (results) {
45977 return this.scrollToPosition (results, true);
45978 }, "jalview.datamodel.SearchResults");
45979 Clazz_defineMethod (c$, "scrollToPosition", 
45980 function (results, redrawOverview) {
45981 return this.scrollToPosition (results, redrawOverview, false);
45982 }, "jalview.datamodel.SearchResults,~B");
45983 Clazz_defineMethod (c$, "scrollToPosition", 
45984 function (results, redrawOverview, centre) {
45985 if (results != null && results.getSize () > 0) {
45986 var alignment = this.av.getAlignment ();
45987 var seqIndex = alignment.findIndex (results);
45988 if (seqIndex == -1) {
45989 return false;
45990 }var seq = alignment.getSequenceAt (seqIndex);
45991 var r = results.getResults (seq, 0, alignment.getWidth ());
45992 if (r == null) {
45993 if (jalview.bin.JalviewLite.debug) {
45994 System.out.println ("DEBUG: scroll didn't happen - results not within alignment : " + seq.getStart () + "," + seq.getEnd ());
45995 }return false;
45996 }if (jalview.bin.JalviewLite.debug) {
45997 }var start = r[0];
45998 var end = r[1];
45999 if (centre) {
46000 var offset = Clazz_doubleToInt ((this.av.getEndRes () - this.av.getStartRes () + 1) / 2) - 1;
46001 start = Math.max (start - offset, 0);
46002 end = Math.min (end + offset, seq.getEnd () - 1);
46003 }if (start < 0) {
46004 return false;
46005 }if (end == seq.getEnd ()) {
46006 return false;
46007 }return this.scrollTo (start, end, seqIndex, false, redrawOverview);
46008 }return true;
46009 }, "jalview.datamodel.SearchResults,~B,~B");
46010 Clazz_defineMethod (c$, "scrollTo", 
46011 function (ostart, end, seqIndex, scrollToNearest, redrawOverview) {
46012 var startv;
46013 var endv;
46014 var starts;
46015 var ends;
46016 var width;
46017 var start = -1;
46018 if (this.av.hasHiddenColumns ()) {
46019 start = this.av.getColumnSelection ().findColumnPosition (ostart);
46020 end = this.av.getColumnSelection ().findColumnPosition (end);
46021 if (start == end) {
46022 if (!scrollToNearest && !this.av.getColumnSelection ().isVisible (ostart)) {
46023 return false;
46024 }}} else {
46025 start = ostart;
46026 }if (!this.av.getWrapAlignment ()) {
46027 if ((startv = this.av.getStartRes ()) >= start) {
46028 this.setScrollValues (start - 1, seqIndex);
46029 } else if ((endv = this.av.getEndRes ()) <= end) {
46030 this.setScrollValues (startv + 1 + end - endv, seqIndex);
46031 } else if ((starts = this.av.getStartSeq ()) > seqIndex) {
46032 this.setScrollValues (this.av.getStartRes (), seqIndex);
46033 } else if ((ends = this.av.getEndSeq ()) <= seqIndex) {
46034 this.setScrollValues (this.av.getStartRes (), starts + seqIndex - ends + 1);
46035 }} else {
46036 this.scrollToWrappedVisible (start);
46037 }if (redrawOverview && this.overviewPanel != null) {
46038 this.overviewPanel.setBoxPosition ();
46039 }this.paintAlignment (redrawOverview);
46040 return true;
46041 }, "~N,~N,~N,~B,~B");
46042 Clazz_defineMethod (c$, "scrollToWrappedVisible", 
46043 function (res) {
46044 var cwidth = this.seqPanel.seqCanvas.getWrappedCanvasWidth (this.seqPanel.seqCanvas.getSize ().width);
46045 if (res <= this.av.getStartRes () || res >= (this.av.getStartRes () + cwidth)) {
46046 this.vscroll.setValue (Clazz_doubleToInt (res / cwidth));
46047 this.av.startRes = this.vscroll.getValue () * cwidth;
46048 }}, "~N");
46049 Clazz_defineMethod (c$, "getOverviewPanel", 
46050 function () {
46051 return this.overviewPanel;
46052 });
46053 Clazz_defineMethod (c$, "setOverviewPanel", 
46054 function (op) {
46055 this.overviewPanel = op;
46056 }, "jalview.appletgui.OverviewPanel");
46057 Clazz_defineMethod (c$, "setAnnotationVisible", 
46058 function (b) {
46059 if (!this.av.getWrapAlignment ()) {
46060 this.annotationSpaceFillerHolder.setVisible (b);
46061 this.annotationPanelHolder.setVisible (b);
46062 } else {
46063 this.annotationSpaceFillerHolder.setVisible (false);
46064 this.annotationPanelHolder.setVisible (false);
46065 }this.validate ();
46066 this.repaint ();
46067 }, "~B");
46068 Clazz_overrideMethod (c$, "adjustAnnotationHeight", 
46069 function () {
46070 if (this.alignFrame.getSize ().height == 0) {
46071 System.out.println ("adjustAnnotationHeight frame size zero NEEDS FIXING");
46072 }this.fontChanged ();
46073 this.validateAnnotationDimensions (true);
46074 this.apvscroll.addNotify ();
46075 this.hscroll.addNotify ();
46076 this.validate ();
46077 this.paintAlignment (true);
46078 });
46079 Clazz_defineMethod (c$, "validateAnnotationDimensions", 
46080 function (adjustPanelHeight) {
46081 var rowHeight = this.av.getCharHeight ();
46082 var alignmentHeight = rowHeight * this.av.getAlignment ().getHeight ();
46083 var annotationHeight = this.av.calcPanelHeight ();
46084 var mheight = annotationHeight;
46085 var d = this.sequenceHolderPanel.getSize ();
46086 var availableHeight = d.height - this.scalePanelHolder.getHeight ();
46087 if (adjustPanelHeight) {
46088 if (annotationHeight + alignmentHeight > availableHeight) {
46089 annotationHeight = Math.min (annotationHeight, availableHeight - 2 * rowHeight);
46090 }} else {
46091 annotationHeight = this.annotationPanelHolder.getSize ().height;
46092 }if (availableHeight - annotationHeight < 5) {
46093 annotationHeight = availableHeight;
46094 }this.annotationPanel.setSize ( new java.awt.Dimension (d.width, annotationHeight));
46095 this.annotationPanelHolder.setSize ( new java.awt.Dimension (d.width, annotationHeight));
46096 this.seqPanel.seqCanvas.setSize (d.width, this.seqPanel.seqCanvas.getSize ().height);
46097 var e = this.idPanel.getSize ();
46098 this.alabels.setSize ( new java.awt.Dimension (e.width, annotationHeight));
46099 this.annotationSpaceFillerHolder.setSize ( new java.awt.Dimension (e.width, annotationHeight));
46100 var s = this.apvscroll.getValue ();
46101 if (s > mheight - annotationHeight) {
46102 s = 0;
46103 }this.apvscroll.setValues (s, annotationHeight, 0, mheight);
46104 this.annotationPanel.setScrollOffset (this.apvscroll.getValue (), false);
46105 this.alabels.setScrollOffset (this.apvscroll.getValue (), false);
46106 }, "~B");
46107 Clazz_defineMethod (c$, "setWrapAlignment", 
46108 function (wrap) {
46109 this.av.startSeq = 0;
46110 this.av.startRes = 0;
46111 this.scalePanelHolder.setVisible (!wrap);
46112 this.hscroll.setVisible (!wrap);
46113 this.idwidthAdjuster.setVisible (!wrap);
46114 if (wrap) {
46115 this.annotationPanelHolder.setVisible (false);
46116 this.annotationSpaceFillerHolder.setVisible (false);
46117 } else if (this.av.isShowAnnotation ()) {
46118 this.annotationPanelHolder.setVisible (true);
46119 this.annotationSpaceFillerHolder.setVisible (true);
46120 }this.idSpaceFillerPanel1.setVisible (!wrap);
46121 this.fontChanged ();
46122 this.validate ();
46123 this.sequenceHolderPanel.validate ();
46124 this.repaint ();
46125 }, "~B");
46126 Clazz_defineMethod (c$, "scrollUp", 
46127 function (up) {
46128 if (up) {
46129 if (this.vscroll.getValue () < 1) {
46130 return false;
46131 }this.setScrollValues (this.hscroll.getValue (), this.vscroll.getValue () - 1);
46132 } else {
46133 if (this.vextent + this.vscroll.getValue () >= this.av.getAlignment ().getHeight ()) {
46134 return false;
46135 }this.setScrollValues (this.hscroll.getValue (), this.vscroll.getValue () + 1);
46136 }this.repaint ();
46137 return true;
46138 }, "~B");
46139 Clazz_defineMethod (c$, "scrollRight", 
46140 function (right) {
46141 if (!right) {
46142 if (this.hscroll.getValue () < 1) {
46143 return false;
46144 }this.setScrollValues (this.hscroll.getValue () - 1, this.vscroll.getValue ());
46145 } else {
46146 if (this.hextent + this.hscroll.getValue () >= this.av.getAlignment ().getWidth ()) {
46147 return false;
46148 }this.setScrollValues (this.hscroll.getValue () + 1, this.vscroll.getValue ());
46149 }this.repaint ();
46150 return true;
46151 }, "~B");
46152 Clazz_defineMethod (c$, "setScrollValues", 
46153 function (x, y) {
46154 var width = this.av.getAlignment ().getWidth ();
46155 var height = this.av.getAlignment ().getHeight ();
46156 if (this.av.hasHiddenColumns ()) {
46157 width = this.av.getColumnSelection ().findColumnPosition (width);
46158 }if (x < 0) {
46159 x = 0;
46160 };this.hextent = Clazz_doubleToInt (this.seqPanel.seqCanvas.getSize ().width / this.av.getCharWidth ());
46161 this.vextent = Clazz_doubleToInt (this.seqPanel.seqCanvas.getSize ().height / this.av.getCharHeight ());
46162 if (this.hextent > width) {
46163 this.hextent = width;
46164 }if (this.vextent > height) {
46165 this.vextent = height;
46166 }if ((this.hextent + x) > width) {
46167 System.err.println ("hextent was " + this.hextent + " and x was " + x);
46168 x = width - this.hextent;
46169 }if ((this.vextent + y) > height) {
46170 y = height - this.vextent;
46171 }if (y < 0) {
46172 y = 0;
46173 }if (x < 0) {
46174 System.err.println ("x was " + x);
46175 x = 0;
46176 }this.av.setStartSeq (y);
46177 var endSeq = y + this.vextent;
46178 if (endSeq > this.av.getAlignment ().getHeight ()) {
46179 endSeq = this.av.getAlignment ().getHeight ();
46180 }this.av.setEndSeq (endSeq);
46181 this.av.setStartRes (x);
46182 this.av.setEndRes ((x + (Clazz_doubleToInt (this.seqPanel.seqCanvas.getSize ().width / this.av.getCharWidth ()))) - 1);
46183 this.hscroll.setValues (x, this.hextent, 0, width);
46184 this.vscroll.setValues (y, this.vextent, 0, height);
46185 if (this.overviewPanel != null) {
46186 this.overviewPanel.setBoxPosition ();
46187 }this.sendViewPosition ();
46188 }, "~N,~N");
46189 Clazz_overrideMethod (c$, "adjustmentValueChanged", 
46190 function (evt) {
46191 if (this.annotationPanel == null) return;
46192 var oldX = this.av.getStartRes ();
46193 var oldY = this.av.getStartSeq ();
46194 if (evt == null || evt.getSource () === this.apvscroll) {
46195 this.annotationPanel.setScrollOffset (this.apvscroll.getValue (), false);
46196 this.alabels.setScrollOffset (this.apvscroll.getValue (), false);
46197 }if (evt == null || evt.getSource () === this.hscroll) {
46198 var x = this.hscroll.getValue ();
46199 this.av.setStartRes (x);
46200 this.av.setEndRes (x + Clazz_doubleToInt (this.seqPanel.seqCanvas.getSize ().width / this.av.getCharWidth ()) - 1);
46201 }if (evt == null || evt.getSource () === this.vscroll) {
46202 var offy = this.vscroll.getValue ();
46203 if (this.av.getWrapAlignment ()) {
46204 var rowSize = this.seqPanel.seqCanvas.getWrappedCanvasWidth (this.seqPanel.seqCanvas.getSize ().width);
46205 this.av.setStartRes (this.vscroll.getValue () * rowSize);
46206 this.av.setEndRes ((this.vscroll.getValue () + 1) * rowSize);
46207 } else {
46208 this.av.setStartSeq (offy);
46209 this.av.setEndSeq (offy + Clazz_doubleToInt (this.seqPanel.seqCanvas.getSize ().height / this.av.getCharHeight ()));
46210 }}if (this.overviewPanel != null) {
46211 this.overviewPanel.setBoxPosition ();
46212 }var scrollX = this.av.startRes - oldX;
46213 var scrollY = this.av.startSeq - oldY;
46214 if (this.av.getWrapAlignment () || !this.fastPaint || this.av.MAC) {
46215 this.repaint ();
46216 } else {
46217 if (scrollX > this.av.endRes - this.av.startRes) {
46218 scrollX = this.av.endRes - this.av.startRes;
46219 } else if (scrollX < this.av.startRes - this.av.endRes) {
46220 scrollX = this.av.startRes - this.av.endRes;
46221 }this.idPanel.idCanvas.fastPaint (scrollY);
46222 this.seqPanel.seqCanvas.fastPaint (scrollX, scrollY);
46223 this.scalePanel.repaint ();
46224 if (this.av.isShowAnnotation ()) {
46225 this.annotationPanel.fastPaint (this.av.getStartRes () - oldX);
46226 }}this.sendViewPosition ();
46227 if (this.isFollowingComplementScroll ()) {
46228 this.setFollowingComplementScroll (false);
46229 } else {
46230 var ap = this.getComplementPanel ();
46231 this.av.scrollComplementaryAlignment (ap);
46232 }}, "java.awt.event.AdjustmentEvent");
46233 Clazz_defineMethod (c$, "getComplementPanel", 
46234  function () {
46235 var ap = null;
46236 if (this.alignFrame != null) {
46237 var sf = this.alignFrame.getSplitFrame ();
46238 if (sf != null) {
46239 var other = sf.getComplement (this.alignFrame);
46240 if (other != null) {
46241 ap = other.alignPanel;
46242 }}}return ap;
46243 });
46244 Clazz_defineMethod (c$, "scrollToCentre", 
46245 function (sr, seqOffset) {
46246 var mappedTo = sr.getResultSequence (0);
46247 var seqs = this.av.getAlignment ().getSequences ();
46248 var sequenceIndex = 0;
46249 var matched = false;
46250 for (var seq, $seq = seqs.iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
46251 if (mappedTo === seq.getDatasetSequence ()) {
46252 matched = true;
46253 break;
46254 }sequenceIndex++;
46255 }
46256 if (!matched) {
46257 return;
46258 }sequenceIndex = Math.max (0, sequenceIndex - seqOffset);
46259 sr.getResults ().get (0).setSequence (this.av.getAlignment ().getSequenceAt (sequenceIndex));
46260 this.setFollowingComplementScroll (true);
46261 this.scrollToPosition (sr, true, true);
46262 }, "jalview.datamodel.SearchResults,~N");
46263 Clazz_defineMethod (c$, "sendViewPosition", 
46264  function () {
46265 jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.av.applet).sendViewPosition (this, this.av.startRes, this.av.endRes, this.av.startSeq, this.av.endSeq);
46266 });
46267 Clazz_overrideMethod (c$, "paintAlignment", 
46268 function (updateOverview) {
46269 var sorter =  new jalview.analysis.AnnotationSorter (this.getAlignment (), this.av.isShowAutocalculatedAbove ());
46270 sorter.sort (this.getAlignment ().getAlignmentAnnotation (), this.av.getSortAnnotationsBy ());
46271 this.repaint ();
46272 if (updateOverview) {
46273 jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.av.applet).sequenceColoursChanged (this);
46274 if (this.overviewPanel != null) {
46275 this.overviewPanel.updateOverviewImage ();
46276 }}}, "~B");
46277 Clazz_overrideMethod (c$, "paintComponent", 
46278 function (g) {
46279 System.out.println ("alignframe paintcomp");
46280 this.invalidate ();
46281 var d = this.idPanel.idCanvas.getSize ();
46282 var canvasHeight = this.seqPanel.seqCanvas.getSize ().height;
46283 if (canvasHeight != d.height) {
46284 this.idPanel.idCanvas.setSize (d.width, canvasHeight);
46285 }if (this.av.getWrapAlignment ()) {
46286 var maxwidth = this.av.getAlignment ().getWidth ();
46287 if (this.av.hasHiddenColumns ()) {
46288 maxwidth = this.av.getColumnSelection ().findColumnPosition (maxwidth) - 1;
46289 }var canvasWidth = this.seqPanel.seqCanvas.getWrappedCanvasWidth (this.seqPanel.seqCanvas.getSize ().width);
46290 if (canvasWidth > 0) {
46291 var max = Clazz_doubleToInt (maxwidth / canvasWidth);
46292 this.vscroll.setMaximum (1 + max);
46293 this.vscroll.setUnitIncrement (1);
46294 this.vscroll.setVisibleAmount (1);
46295 }} else {
46296 this.setScrollValues (this.av.getStartRes (), this.av.getStartSeq ());
46297 }}, "java.awt.Graphics");
46298 Clazz_defineMethod (c$, "jbInit", 
46299  function () {
46300 this.setLayout ( new java.awt.BorderLayout ());
46301 this.sequenceHolderPanel.setLayout ( new java.awt.BorderLayout ());
46302 this.seqPanelHolder.setLayout ( new java.awt.BorderLayout ());
46303 this.scalePanelHolder.setBackground (java.awt.Color.white);
46304 this.scalePanelHolder.setLayout ( new java.awt.BorderLayout ());
46305 this.idPanelHolder.setLayout ( new java.awt.BorderLayout ());
46306 this.idSpaceFillerPanel1.setBackground (java.awt.Color.white);
46307 this.idSpaceFillerPanel1.setLayout ( new java.awt.BorderLayout ());
46308 this.annotationSpaceFillerHolder.setBackground (java.awt.Color.white);
46309 this.annotationSpaceFillerHolder.setLayout ( new java.awt.BorderLayout ());
46310 this.hscroll.setOrientation (0);
46311 var hscrollHolder =  new awt2swing.Panel ();
46312 hscrollHolder.setLayout ( new java.awt.BorderLayout ());
46313 this.hscrollFillerPanel.setBackground (java.awt.Color.white);
46314 this.apvscroll.setOrientation (1);
46315 this.apvscroll.setVisible (true);
46316 this.apvscroll.addAdjustmentListener (this);
46317 this.annotationPanelHolder.setBackground (java.awt.Color.white);
46318 this.annotationPanelHolder.setLayout ( new java.awt.BorderLayout ());
46319 this.annotationPanelHolder.add (this.apvscroll, "East");
46320 hscrollHolder.setBackground (java.awt.Color.white);
46321 this.seqPanelHolder.setBackground (java.awt.Color.white);
46322 this.idPanelHolder.setBackground (java.awt.Color.white);
46323 this.sequenceHolderPanel.add (this.scalePanelHolder, "North");
46324 this.sequenceHolderPanel.add (this.seqPanelHolder, "Center");
46325 this.seqPanelHolder.add (this.vscroll, "East");
46326 this.add (this.idPanelHolder, "West");
46327 this.idPanelHolder.add (this.idSpaceFillerPanel1, "North");
46328 this.idPanelHolder.add (this.annotationSpaceFillerHolder, "South");
46329 this.add (hscrollHolder, "South");
46330 hscrollHolder.add (this.hscroll, "Center");
46331 hscrollHolder.add (this.hscrollFillerPanel, "West");
46332 this.add (this.sequenceHolderPanel, "Center");
46333 });
46334 Clazz_defineMethod (c$, "updateAnnotation", 
46335 function () {
46336 this.updateAnnotation (false);
46337 });
46338 Clazz_defineMethod (c$, "updateAnnotation", 
46339 function (applyGlobalSettings) {
46340 this.updateAnnotation (applyGlobalSettings, false);
46341 }, "~B");
46342 Clazz_defineMethod (c$, "updateAnnotation", 
46343 function (applyGlobalSettings, preserveNewGroupSettings) {
46344 this.av.updateGroupAnnotationSettings (applyGlobalSettings, preserveNewGroupSettings);
46345 this.adjustAnnotationHeight ();
46346 }, "~B,~B");
46347 Clazz_overrideMethod (c$, "getAlignment", 
46348 function () {
46349 return this.av.getAlignment ();
46350 });
46351 Clazz_overrideMethod (c$, "getViewName", 
46352 function () {
46353 return this.getName ();
46354 });
46355 Clazz_overrideMethod (c$, "getStructureSelectionManager", 
46356 function () {
46357 return jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.av.applet);
46358 });
46359 Clazz_overrideMethod (c$, "raiseOOMWarning", 
46360 function (string, error) {
46361 System.err.println ("Out of memory whilst '" + string + "'");
46362 error.printStackTrace ();
46363 }, "~S,OutOfMemoryError");
46364 Clazz_defineMethod (c$, "setFollowingComplementScroll", 
46365 function (b) {
46366 this.followingComplementScroll = b;
46367 }, "~B");
46368 Clazz_defineMethod (c$, "isFollowingComplementScroll", 
46369 function () {
46370 return this.followingComplementScroll;
46371 });
46372 c$.$AlignmentPanel$1$ = function () {
46373 Clazz_pu$h(self.c$);
46374 c$ = Clazz_declareAnonymous (jalview.appletgui, "AlignmentPanel$1", java.awt.event.ComponentAdapter);
46375 Clazz_overrideMethod (c$, "componentResized", 
46376 function (evt) {
46377 this.b$["jalview.appletgui.AlignmentPanel"].setScrollValues (this.f$.av.getStartRes (), this.f$.av.getStartSeq ());
46378 if (this.b$["jalview.appletgui.AlignmentPanel"].getSize ().height > 0 && this.b$["jalview.appletgui.AlignmentPanel"].annotationPanelHolder.getSize ().height > 0) {
46379 this.b$["jalview.appletgui.AlignmentPanel"].validateAnnotationDimensions (false);
46380 }this.b$["jalview.appletgui.AlignmentPanel"].repaint ();
46381 }, "java.awt.event.ComponentEvent");
46382 c$ = Clazz_p0p ();
46383 };
46384 c$.$AlignmentPanel$2$ = function () {
46385 Clazz_pu$h(self.c$);
46386 c$ = Clazz_declareAnonymous (jalview.appletgui, "AlignmentPanel$2", null, java.beans.PropertyChangeListener);
46387 Clazz_overrideMethod (c$, "propertyChange", 
46388 function (evt) {
46389 if (evt.getPropertyName ().equals ("alignment")) {
46390 jalview.appletgui.PaintRefresher.Refresh (this.f$.ap, this.f$.av.getSequenceSetId (), true, true);
46391 this.b$["jalview.appletgui.AlignmentPanel"].alignmentChanged ();
46392 }}, "java.beans.PropertyChangeEvent");
46393 c$ = Clazz_p0p ();
46394 };
46395 });
46396 Clazz_declarePackage ("jalview.api");
46397 Clazz_load (["jalview.api.OOMHandlerI"], "jalview.api.AlignmentViewPanel", null, function () {
46398 Clazz_declareInterface (jalview.api, "AlignmentViewPanel", jalview.api.OOMHandlerI);
46399 });
46400 Clazz_declarePackage ("jalview.api");
46401 Clazz_declareInterface (jalview.api, "OOMHandlerI");
46402 Clazz_declarePackage ("awt2swing");
46403 Clazz_load (["javax.swing.JScrollBar"], "awt2swing.Scrollbar", null, function () {
46404 c$ = Clazz_declareType (awt2swing, "Scrollbar", javax.swing.JScrollBar);
46405 Clazz_defineMethod (c$, "addChangeListener", 
46406 function (l) {
46407 this.addAdjustmentListener (l);
46408 }, "javax.swing.event.ChangeListener");
46409 Clazz_defineMethod (c$, "removeChangeListener", 
46410 function (l) {
46411 this.removeAdjustmentListener (l);
46412 }, "javax.swing.event.ChangeListener");
46413 });
46414 Clazz_declarePackage ("javax.swing");
46415 Clazz_load (["java.awt.Adjustable", "javax.swing.JComponent", "javax.swing.event.ChangeListener"], "javax.swing.JScrollBar", ["java.lang.IllegalArgumentException", "java.awt.Dimension", "java.awt.event.AdjustmentEvent", "$.AdjustmentListener", "javax.swing.BoundedRangeModel", "$.DefaultBoundedRangeModel", "$.UIManager"], function () {
46416 c$ = Clazz_decorateAsClass (function () {
46417 this.fwdAdjustmentEvents = null;
46418 this.model = null;
46419 this.orientation = 0;
46420 this.unitIncrement = 0;
46421 this.blockIncrement = 0;
46422 if (!Clazz_isClassDefined ("javax.swing.JScrollBar.ModelListener")) {
46423 javax.swing.JScrollBar.$JScrollBar$ModelListener$ ();
46424 }
46425 Clazz_instantialize (this, arguments);
46426 }, javax.swing, "JScrollBar", javax.swing.JComponent, java.awt.Adjustable);
46427 Clazz_prepareFields (c$, function () {
46428 this.fwdAdjustmentEvents = Clazz_innerTypeInstance (javax.swing.JScrollBar.ModelListener, this, null);
46429 });
46430 Clazz_defineMethod (c$, "checkOrientation", 
46431  function (orientation) {
46432 switch (orientation) {
46433 case 1:
46434 case 0:
46435 break;
46436 default:
46437 throw  new IllegalArgumentException ("orientation must be one of: VERTICAL, HORIZONTAL");
46438 }
46439 }, "~N");
46440 Clazz_makeConstructor (c$, 
46441 function (orientation, value, extent, min, max) {
46442 Clazz_superConstructor (this, javax.swing.JScrollBar, []);
46443 this.checkOrientation (orientation);
46444 this.unitIncrement = 1;
46445 this.blockIncrement = (extent == 0) ? 1 : extent;
46446 this.orientation = orientation;
46447 this.model =  new javax.swing.DefaultBoundedRangeModel (value, extent, min, max);
46448 this.model.addChangeListener (this.fwdAdjustmentEvents);
46449 this.setRequestFocusEnabled (false);
46450 this.updateUI ();
46451 }, "~N,~N,~N,~N,~N");
46452 Clazz_makeConstructor (c$, 
46453 function (orientation) {
46454 this.construct (orientation, 0, 10, 0, 100);
46455 }, "~N");
46456 Clazz_makeConstructor (c$, 
46457 function () {
46458 this.construct (1);
46459 });
46460 Clazz_overrideMethod (c$, "getUI", 
46461 function () {
46462 return this.ui;
46463 });
46464 Clazz_overrideMethod (c$, "updateUI", 
46465 function () {
46466 this.setUI (javax.swing.UIManager.getUI (this));
46467 });
46468 Clazz_overrideMethod (c$, "getUIClassID", 
46469 function () {
46470 return "ScrollBarUI";
46471 });
46472 Clazz_overrideMethod (c$, "getOrientation", 
46473 function () {
46474 return this.orientation;
46475 });
46476 Clazz_defineMethod (c$, "setOrientation", 
46477 function (orientation) {
46478 this.checkOrientation (orientation);
46479 var oldValue = this.orientation;
46480 this.orientation = orientation;
46481 this.firePropertyChangeInt ("orientation", oldValue, orientation);
46482 if (orientation != oldValue) {
46483 this.revalidate ();
46484 }}, "~N");
46485 Clazz_defineMethod (c$, "getModel", 
46486 function () {
46487 return this.model;
46488 });
46489 Clazz_defineMethod (c$, "setModel", 
46490 function (newModel) {
46491 var oldModel = this.model;
46492 if (this.model != null) {
46493 this.model.removeChangeListener (this.fwdAdjustmentEvents);
46494 }this.model = newModel;
46495 if (this.model != null) {
46496 this.model.addChangeListener (this.fwdAdjustmentEvents);
46497 }this.firePropertyChangeObject ("model", oldModel, this.model);
46498 }, "javax.swing.BoundedRangeModel");
46499 Clazz_defineMethod (c$, "getUnitIncrement", 
46500 function (direction) {
46501 return this.unitIncrement;
46502 }, "~N");
46503 Clazz_overrideMethod (c$, "setUnitIncrement", 
46504 function (unitIncrement) {
46505 var oldValue = this.unitIncrement;
46506 this.unitIncrement = unitIncrement;
46507 this.firePropertyChangeInt ("unitIncrement", oldValue, unitIncrement);
46508 }, "~N");
46509 Clazz_defineMethod (c$, "getBlockIncrement", 
46510 function (direction) {
46511 return this.blockIncrement;
46512 }, "~N");
46513 Clazz_overrideMethod (c$, "setBlockIncrement", 
46514 function (blockIncrement) {
46515 var oldValue = this.blockIncrement;
46516 this.blockIncrement = blockIncrement;
46517 this.firePropertyChangeInt ("blockIncrement", oldValue, blockIncrement);
46518 }, "~N");
46519 Clazz_defineMethod (c$, "getUnitIncrement", 
46520 function () {
46521 return this.unitIncrement;
46522 });
46523 Clazz_defineMethod (c$, "getBlockIncrement", 
46524 function () {
46525 return this.blockIncrement;
46526 });
46527 Clazz_overrideMethod (c$, "getValue", 
46528 function () {
46529 return this.getModel ().getValue ();
46530 });
46531 Clazz_overrideMethod (c$, "setValue", 
46532 function (value) {
46533 var m = this.getModel ();
46534 m.setValue (value);
46535 }, "~N");
46536 Clazz_overrideMethod (c$, "getVisibleAmount", 
46537 function () {
46538 return this.getModel ().getExtent ();
46539 });
46540 Clazz_overrideMethod (c$, "setVisibleAmount", 
46541 function (extent) {
46542 this.getModel ().setExtent (extent);
46543 }, "~N");
46544 Clazz_overrideMethod (c$, "getMinimum", 
46545 function () {
46546 return this.getModel ().getMinimum ();
46547 });
46548 Clazz_overrideMethod (c$, "setMinimum", 
46549 function (minimum) {
46550 this.getModel ().setMinimum (minimum);
46551 }, "~N");
46552 Clazz_overrideMethod (c$, "getMaximum", 
46553 function () {
46554 return this.getModel ().getMaximum ();
46555 });
46556 Clazz_overrideMethod (c$, "setMaximum", 
46557 function (maximum) {
46558 this.getModel ().setMaximum (maximum);
46559 }, "~N");
46560 Clazz_defineMethod (c$, "getValueIsAdjusting", 
46561 function () {
46562 return this.getModel ().getValueIsAdjusting ();
46563 });
46564 Clazz_defineMethod (c$, "setValueIsAdjusting", 
46565 function (b) {
46566 var m = this.getModel ();
46567 m.setValueIsAdjusting (b);
46568 }, "~B");
46569 Clazz_defineMethod (c$, "setValues", 
46570 function (newValue, newExtent, newMin, newMax) {
46571 var m = this.getModel ();
46572 m.setRangeProperties (newValue, newExtent, newMin, newMax, m.getValueIsAdjusting ());
46573 }, "~N,~N,~N,~N");
46574 Clazz_overrideMethod (c$, "addAdjustmentListener", 
46575 function (l) {
46576 this.listenerList.add (java.awt.event.AdjustmentListener, l);
46577 }, "java.awt.event.AdjustmentListener");
46578 Clazz_overrideMethod (c$, "removeAdjustmentListener", 
46579 function (l) {
46580 this.listenerList.remove (java.awt.event.AdjustmentListener, l);
46581 }, "java.awt.event.AdjustmentListener");
46582 Clazz_defineMethod (c$, "getAdjustmentListeners", 
46583 function () {
46584 return this.listenerList.getListeners (java.awt.event.AdjustmentListener);
46585 });
46586 Clazz_defineMethod (c$, "fireAdjustmentValueChanged", 
46587 function (id, type, value) {
46588 this.fireAdjustmentValueChanged (id, type, value, this.getValueIsAdjusting ());
46589 }, "~N,~N,~N");
46590 Clazz_defineMethod (c$, "fireAdjustmentValueChanged", 
46591  function (id, type, value, isAdjusting) {
46592 var listeners = this.listenerList.getListenerList ();
46593 var e = null;
46594 for (var i = listeners.length - 2; i >= 0; i -= 2) {
46595 if (listeners[i] === java.awt.event.AdjustmentListener) {
46596 if (e == null) {
46597 e =  new java.awt.event.AdjustmentEvent (this, id, type, value, isAdjusting);
46598 }(listeners[i + 1]).adjustmentValueChanged (e);
46599 }}
46600 }, "~N,~N,~N,~B");
46601 Clazz_overrideMethod (c$, "getMinimumSize", 
46602 function () {
46603 var pref = this.getPreferredSize ();
46604 if (this.orientation == 1) {
46605 return  new java.awt.Dimension (pref.width, 5);
46606 } else {
46607 return  new java.awt.Dimension (5, pref.height);
46608 }});
46609 Clazz_overrideMethod (c$, "getMaximumSize", 
46610 function () {
46611 var pref = this.getPreferredSize ();
46612 if (this.getOrientation () == 1) {
46613 return  new java.awt.Dimension (pref.width, 32767);
46614 } else {
46615 return  new java.awt.Dimension (32767, pref.height);
46616 }});
46617 Clazz_defineMethod (c$, "setEnabled", 
46618 function (x) {
46619 Clazz_superCall (this, javax.swing.JScrollBar, "setEnabled", [x]);
46620 var children = this.getComponents ();
46621 for (var i = 0; i < children.length; i++) {
46622 children[i].setEnabled (x);
46623 }
46624 }, "~B");
46625 Clazz_defineMethod (c$, "paramString", 
46626 function () {
46627 var orientationString = (this.orientation == 0 ? "HORIZONTAL" : "VERTICAL");
46628 return Clazz_superCall (this, javax.swing.JScrollBar, "paramString", []) + ",blockIncrement=" + this.blockIncrement + ",orientation=" + orientationString + ",unitIncrement=" + this.unitIncrement;
46629 });
46630 c$.$JScrollBar$ModelListener$ = function () {
46631 Clazz_pu$h(self.c$);
46632 c$ = Clazz_decorateAsClass (function () {
46633 Clazz_prepareCallback (this, arguments);
46634 Clazz_instantialize (this, arguments);
46635 }, javax.swing.JScrollBar, "ModelListener", null, javax.swing.event.ChangeListener);
46636 Clazz_overrideMethod (c$, "stateChanged", 
46637 function (a) {
46638 var b = a.getSource ();
46639 if (Clazz_instanceOf (b, javax.swing.BoundedRangeModel)) {
46640 var c = 601;
46641 var d = 5;
46642 var e = b;
46643 var f = e.getValue ();
46644 var g = e.getValueIsAdjusting ();
46645 this.b$["javax.swing.JScrollBar"].fireAdjustmentValueChanged (c, d, f, g);
46646 }}, "javax.swing.event.ChangeEvent");
46647 c$ = Clazz_p0p ();
46648 };
46649 Clazz_defineStatics (c$,
46650 "$uiClassID", "ScrollBarUI");
46651 });
46652 Clazz_declarePackage ("java.awt");
46653 c$ = Clazz_declareInterface (java.awt, "Adjustable");
46654 Clazz_defineStatics (c$,
46655 "HORIZONTAL", 0,
46656 "VERTICAL", 1,
46657 "NO_ORIENTATION", 2);
46658 Clazz_declarePackage ("java.awt.event");
46659 Clazz_load (["java.awt.AWTEvent"], "java.awt.event.AdjustmentEvent", null, function () {
46660 c$ = Clazz_decorateAsClass (function () {
46661 this.adjustable = null;
46662 this.value = 0;
46663 this.adjustmentType = 0;
46664 this.isAdjusting = false;
46665 Clazz_instantialize (this, arguments);
46666 }, java.awt.event, "AdjustmentEvent", java.awt.AWTEvent);
46667 Clazz_makeConstructor (c$, 
46668 function (source, id, type, value) {
46669 this.construct (source, id, type, value, false);
46670 }, "java.awt.Adjustable,~N,~N,~N");
46671 Clazz_makeConstructor (c$, 
46672 function (source, id, type, value, isAdjusting) {
46673 Clazz_superConstructor (this, java.awt.event.AdjustmentEvent, [source, id]);
46674 this.adjustable = source;
46675 this.adjustmentType = type;
46676 this.value = value;
46677 this.isAdjusting = isAdjusting;
46678 }, "java.awt.Adjustable,~N,~N,~N,~B");
46679 Clazz_defineMethod (c$, "getAdjustable", 
46680 function () {
46681 return this.adjustable;
46682 });
46683 Clazz_defineMethod (c$, "getValue", 
46684 function () {
46685 return this.value;
46686 });
46687 Clazz_defineMethod (c$, "getAdjustmentType", 
46688 function () {
46689 return this.adjustmentType;
46690 });
46691 Clazz_defineMethod (c$, "getValueIsAdjusting", 
46692 function () {
46693 return this.isAdjusting;
46694 });
46695 Clazz_overrideMethod (c$, "paramString", 
46696 function () {
46697 var typeStr;
46698 switch (this.id) {
46699 case 601:
46700 typeStr = "ADJUSTMENT_VALUE_CHANGED";
46701 break;
46702 default:
46703 typeStr = "unknown type";
46704 }
46705 var adjTypeStr;
46706 switch (this.adjustmentType) {
46707 case 1:
46708 adjTypeStr = "UNIT_INCREMENT";
46709 break;
46710 case 2:
46711 adjTypeStr = "UNIT_DECREMENT";
46712 break;
46713 case 4:
46714 adjTypeStr = "BLOCK_INCREMENT";
46715 break;
46716 case 3:
46717 adjTypeStr = "BLOCK_DECREMENT";
46718 break;
46719 case 5:
46720 adjTypeStr = "TRACK";
46721 break;
46722 default:
46723 adjTypeStr = "unknown type";
46724 }
46725 return typeStr + ",adjType=" + adjTypeStr + ",value=" + this.value + ",isAdjusting=" + this.isAdjusting;
46726 });
46727 Clazz_defineStatics (c$,
46728 "ADJUSTMENT_FIRST", 601,
46729 "ADJUSTMENT_LAST", 601,
46730 "ADJUSTMENT_VALUE_CHANGED", 601,
46731 "UNIT_INCREMENT", 1,
46732 "UNIT_DECREMENT", 2,
46733 "BLOCK_DECREMENT", 3,
46734 "BLOCK_INCREMENT", 4,
46735 "TRACK", 5);
46736 });
46737 Clazz_declarePackage ("jalview.appletgui");
46738 Clazz_load (["awt2swing.Panel", "java.awt.event.ActionListener", "$.MouseListener", "$.MouseMotionListener"], "jalview.appletgui.AnnotationLabels", ["awt2swing.Checkbox", "$.CheckboxMenuItem", "$.Frame", "$.MenuItem", "$.PopupMenu", "$.Util", "jalview.analysis.AlignmentUtils", "jalview.appletgui.AlignFrame", "$.CutAndPasteTransfer", "$.EditNameDialog", "$.PaintRefresher", "$.Tooltip", "jalview.bin.JalviewLite", "jalview.datamodel.AlignmentAnnotation", "$.SequenceGroup", "jalview.util.MessageManager", "$.ParseHtmlBodyAndLinks", "java.awt.Color", "$.Dimension", "$.FlowLayout", "java.awt.event.ItemListener", "java.lang.StringBuffer", "java.util.Arrays", "$.Collections", "$.Vector"], function () {
46739 c$ = Clazz_decorateAsClass (function () {
46740 this.image = null;
46741 this.active = false;
46742 this.ap = null;
46743 this.av = null;
46744 this.resizing = false;
46745 this.oldY = 0;
46746 this.mouseX = 0;
46747 this.scrollOffset = 0;
46748 this.selectedRow = -1;
46749 this.tooltip = null;
46750 this.hasHiddenRows = false;
46751 this.resizePanel = false;
46752 this.dragEvent = null;
46753 this.dragCancelled = false;
46754 Clazz_instantialize (this, arguments);
46755 }, jalview.appletgui, "AnnotationLabels", awt2swing.Panel, [java.awt.event.ActionListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener]);
46756 Clazz_makeConstructor (c$, 
46757 function (ap) {
46758 Clazz_superConstructor (this, jalview.appletgui.AnnotationLabels, []);
46759 this.ap = ap;
46760 this.av = ap.av;
46761 this.setLayout (null);
46762 this.addMouseListener (this);
46763 this.addMouseMotionListener (this);
46764 }, "jalview.appletgui.AlignmentPanel");
46765 Clazz_makeConstructor (c$, 
46766 function (av) {
46767 Clazz_superConstructor (this, jalview.appletgui.AnnotationLabels, []);
46768 this.av = av;
46769 }, "jalview.appletgui.AlignViewport");
46770 Clazz_defineMethod (c$, "setScrollOffset", 
46771 function (y, repaint) {
46772 this.scrollOffset = y;
46773 if (repaint) {
46774 this.repaint ();
46775 }}, "~N,~B");
46776 Clazz_defineMethod (c$, "getSelectedRow", 
46777 function (y) {
46778 var row = -2;
46779 var aa = this.ap.av.getAlignment ().getAlignmentAnnotation ();
46780 if (aa == null) {
46781 return row;
46782 }var height = 0;
46783 for (var i = 0; i < aa.length; i++) {
46784 row = -1;
46785 if (!aa[i].visible) {
46786 continue;
46787 }height += aa[i].height;
46788 if (y < height) {
46789 row = i;
46790 break;
46791 }}
46792 return row;
46793 }, "~N");
46794 Clazz_overrideMethod (c$, "actionPerformed", 
46795 function (evt) {
46796 var aa = this.av.getAlignment ().getAlignmentAnnotation ();
46797 if (evt.getActionCommand ().equals (jalview.appletgui.AnnotationLabels.ADDNEW)) {
46798 var newAnnotation =  new jalview.datamodel.AlignmentAnnotation ("", null,  new Array (this.ap.av.getAlignment ().getWidth ()));
46799 if (!this.editLabelDescription (newAnnotation)) {
46800 return;
46801 }this.ap.av.getAlignment ().addAnnotation (newAnnotation);
46802 this.ap.av.getAlignment ().setAnnotationIndex (newAnnotation, 0);
46803 } else if (evt.getActionCommand ().equals (jalview.appletgui.AnnotationLabels.EDITNAME)) {
46804 this.editLabelDescription (aa[this.selectedRow]);
46805 } else if (evt.getActionCommand ().equals (jalview.appletgui.AnnotationLabels.HIDE)) {
46806 aa[this.selectedRow].visible = false;
46807 } else if (evt.getActionCommand ().equals (jalview.appletgui.AnnotationLabels.SHOWALL)) {
46808 for (var i = 0; i < aa.length; i++) {
46809 aa[i].visible = (aa[i].annotations == null) ? false : true;
46810 }
46811 } else if (evt.getActionCommand ().equals (jalview.appletgui.AnnotationLabels.OUTPUT_TEXT)) {
46812 var cap =  new jalview.appletgui.CutAndPasteTransfer (false, this.ap.alignFrame);
46813 var frame =  new awt2swing.Frame ();
46814 frame.add (cap);
46815 jalview.bin.JalviewLite.addFrame (frame, this.ap.alignFrame.getTitle () + " - " + aa[this.selectedRow].label, 500, 100);
46816 cap.setText (aa[this.selectedRow].toString ());
46817 } else if (evt.getActionCommand ().equals (jalview.appletgui.AnnotationLabels.COPYCONS_SEQ)) {
46818 var cons = this.av.getConsensusSeq ();
46819 if (cons != null) {
46820 this.copy_annotseqtoclipboard (cons);
46821 }}this.refresh ();
46822 }, "java.awt.event.ActionEvent");
46823 Clazz_defineMethod (c$, "refresh", 
46824 function () {
46825 this.ap.annotationPanel.adjustPanelHeight ();
46826 this.setSize (this.getSize ().width, this.ap.annotationPanel.getSize ().height);
46827 this.ap.validate ();
46828 this.ap.paintAlignment (true);
46829 });
46830 Clazz_defineMethod (c$, "editLabelDescription", 
46831 function (annotation) {
46832 var padGaps =  new awt2swing.Checkbox ("Fill Empty Gaps With \"" + this.ap.av.getGapCharacter () + "\"", annotation.padGaps);
46833 var dialog =  new jalview.appletgui.EditNameDialog (annotation.label, annotation.description, "      Annotation Label", "Annotation Description", this.ap.alignFrame, "Edit Annotation Name / Description", 500, 180, false);
46834 var empty =  new awt2swing.Panel ( new java.awt.FlowLayout ());
46835 empty.add (padGaps);
46836 dialog.add (empty);
46837 dialog.pack ();
46838 dialog.setVisible (true);
46839 if (dialog.accept) {
46840 annotation.label = dialog.getName ();
46841 annotation.description = dialog.getDescription ();
46842 annotation.setPadGaps (padGaps.getState (), this.av.getGapCharacter ());
46843 this.repaint ();
46844 return true;
46845 } else {
46846 return false;
46847 }}, "jalview.datamodel.AlignmentAnnotation");
46848 Clazz_overrideMethod (c$, "mouseMoved", 
46849 function (evt) {
46850 this.resizePanel = evt.getY () < 10 && evt.getX () < 14;
46851 var row = this.getSelectedRow (evt.getY () + this.scrollOffset);
46852 if (row > -1) {
46853 var phb =  new jalview.util.ParseHtmlBodyAndLinks (this.av.getAlignment ().getAlignmentAnnotation ()[row].getDescription (true), true, "\n");
46854 if (this.tooltip == null) {
46855 this.tooltip =  new jalview.appletgui.Tooltip (phb.getNonHtmlContent (), this);
46856 } else {
46857 this.tooltip.setTip (phb.getNonHtmlContent ());
46858 }} else if (this.tooltip != null) {
46859 this.tooltip.setTip ("");
46860 }}, "java.awt.event.MouseEvent");
46861 Clazz_defineMethod (c$, "cancelDrag", 
46862 function () {
46863 this.dragEvent = null;
46864 this.dragCancelled = true;
46865 });
46866 Clazz_overrideMethod (c$, "mouseDragged", 
46867 function (evt) {
46868 if (this.dragCancelled) {
46869 return;
46870 };this.dragEvent = evt;
46871 if (this.resizePanel) {
46872 var d = this.ap.annotationPanelHolder.getSize ();
46873 var e = this.ap.annotationSpaceFillerHolder.getSize ();
46874 var f = this.ap.seqPanelHolder.getSize ();
46875 var dif = evt.getY () - this.oldY;
46876 dif /= this.ap.av.getCharHeight ();
46877 dif *= this.ap.av.getCharHeight ();
46878 if ((d.height - dif) > 20 && (f.height + dif) > 20) {
46879 this.ap.annotationPanel.setSize (d.width, d.height - dif);
46880 this.setSize ( new java.awt.Dimension (e.width, d.height - dif));
46881 this.ap.annotationSpaceFillerHolder.setSize ( new java.awt.Dimension (e.width, d.height - dif));
46882 this.ap.annotationPanelHolder.setSize ( new java.awt.Dimension (d.width, d.height - dif));
46883 this.ap.apvscroll.setValues (this.ap.apvscroll.getValue (), d.height - dif, 0, this.av.calcPanelHeight ());
46884 f.height += dif;
46885 this.ap.seqPanelHolder.setPreferredSize (f);
46886 this.ap.setScrollValues (this.av.getStartRes (), this.av.getStartSeq ());
46887 this.ap.validate ();
46888 this.ap.addNotify ();
46889 }} else {
46890 var diff;
46891 if ((diff = 6 - evt.getY ()) > 0) {
46892 this.ap.apvscroll.setValue (this.ap.apvscroll.getValue () - diff);
46893 this.ap.adjustmentValueChanged (null);
46894 } else if ((0 < (diff = 6 - this.ap.annotationSpaceFillerHolder.getSize ().height + evt.getY ()))) {
46895 this.ap.apvscroll.setValue (this.ap.apvscroll.getValue () + diff);
46896 this.ap.adjustmentValueChanged (null);
46897 }this.repaint ();
46898 }}, "java.awt.event.MouseEvent");
46899 Clazz_overrideMethod (c$, "mouseClicked", 
46900 function (evt) {
46901 }, "java.awt.event.MouseEvent");
46902 Clazz_overrideMethod (c$, "mouseReleased", 
46903 function (evt) {
46904 if (!this.resizePanel && !this.dragCancelled) {
46905 var start = this.selectedRow;
46906 var end = this.getSelectedRow (evt.getY () + this.scrollOffset);
46907 if (start > -1 && start != end) {
46908 var startAA = this.ap.av.getAlignment ().getAlignmentAnnotation ()[start];
46909 if (end == -1) {
46910 end = this.ap.av.getAlignment ().getAlignmentAnnotation ().length - 1;
46911 }var endAA = this.ap.av.getAlignment ().getAlignmentAnnotation ()[end];
46912 this.ap.av.getAlignment ().getAlignmentAnnotation ()[end] = startAA;
46913 this.ap.av.getAlignment ().getAlignmentAnnotation ()[start] = endAA;
46914 }}this.resizePanel = false;
46915 this.dragEvent = null;
46916 this.dragCancelled = false;
46917 this.repaint ();
46918 this.ap.annotationPanel.repaint ();
46919 }, "java.awt.event.MouseEvent");
46920 Clazz_overrideMethod (c$, "mouseEntered", 
46921 function (evt) {
46922 if (evt.getY () < 10 && evt.getX () < 14) {
46923 this.resizePanel = true;
46924 this.repaint ();
46925 }}, "java.awt.event.MouseEvent");
46926 Clazz_overrideMethod (c$, "mouseExited", 
46927 function (evt) {
46928 this.dragCancelled = false;
46929 if (this.dragEvent == null) {
46930 this.resizePanel = false;
46931 } else {
46932 if (!this.resizePanel) {
46933 this.dragEvent = null;
46934 }}this.repaint ();
46935 }, "java.awt.event.MouseEvent");
46936 Clazz_overrideMethod (c$, "mousePressed", 
46937 function (evt) {
46938 this.oldY = evt.getY ();
46939 if (this.resizePanel) {
46940 return;
46941 }this.dragCancelled = false;
46942 this.selectedRow = this.getSelectedRow (evt.getY () + this.scrollOffset);
46943 var aa = this.ap.av.getAlignment ().getAlignmentAnnotation ();
46944 if ((evt.getModifiers () & 4) == 4) {
46945 var popup =  new awt2swing.PopupMenu (jalview.util.MessageManager.getString ("label.annotations"));
46946 var item =  new awt2swing.MenuItem (jalview.appletgui.AnnotationLabels.ADDNEW);
46947 item.addActionListener (this);
46948 popup.add (item);
46949 if (this.selectedRow < 0) {
46950 if (this.hasHiddenRows) {
46951 item =  new awt2swing.MenuItem (jalview.appletgui.AnnotationLabels.SHOWALL);
46952 item.addActionListener (this);
46953 popup.add (item);
46954 }this.add (popup);
46955 popup.show (this, evt.getX (), evt.getY ());
46956 return;
46957 }item =  new awt2swing.MenuItem (jalview.appletgui.AnnotationLabels.EDITNAME);
46958 item.addActionListener (this);
46959 popup.add (item);
46960 item =  new awt2swing.MenuItem (jalview.appletgui.AnnotationLabels.HIDE);
46961 item.addActionListener (this);
46962 popup.add (item);
46963 if (this.selectedRow < aa.length) {
46964 if (aa[this.selectedRow].sequenceRef != null) {
46965 var label = aa[this.selectedRow].label;
46966 var hideType =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.hide_all") + " " + label);
46967 hideType.addActionListener (((Clazz_isClassDefined ("jalview.appletgui.AnnotationLabels$1") ? 0 : jalview.appletgui.AnnotationLabels.$AnnotationLabels$1$ ()), Clazz_innerTypeInstance (jalview.appletgui.AnnotationLabels$1, this, Clazz_cloneFinals ("label", label))));
46968 popup.add (hideType);
46969 }}if (this.hasHiddenRows) {
46970 item =  new awt2swing.MenuItem (jalview.appletgui.AnnotationLabels.SHOWALL);
46971 item.addActionListener (this);
46972 popup.add (item);
46973 }this.add (popup);
46974 item =  new awt2swing.MenuItem (jalview.appletgui.AnnotationLabels.OUTPUT_TEXT);
46975 item.addActionListener (this);
46976 popup.add (item);
46977 if (this.selectedRow < aa.length) {
46978 if (aa[this.selectedRow].autoCalculated) {
46979 if (aa[this.selectedRow].label.indexOf ("Consensus") > -1) {
46980 popup.addSeparator ();
46981 var cbmi =  new awt2swing.CheckboxMenuItem (jalview.util.MessageManager.getString ("label.ignore_gaps_consensus"), (aa[this.selectedRow].groupRef != null) ? aa[this.selectedRow].groupRef.getIgnoreGapsConsensus () : this.ap.av.isIgnoreGapsConsensus ());
46982 var aaa = aa[this.selectedRow];
46983 cbmi.addItemListener (((Clazz_isClassDefined ("jalview.appletgui.AnnotationLabels$2") ? 0 : jalview.appletgui.AnnotationLabels.$AnnotationLabels$2$ ()), Clazz_innerTypeInstance (jalview.appletgui.AnnotationLabels$2, this, Clazz_cloneFinals ("aaa", aaa, "cbmi", cbmi))));
46984 popup.add (cbmi);
46985 if (aaa.groupRef != null) {
46986 var chist =  new awt2swing.CheckboxMenuItem (jalview.util.MessageManager.getString ("label.show_group_histogram"), aa[this.selectedRow].groupRef.isShowConsensusHistogram ());
46987 chist.addItemListener (((Clazz_isClassDefined ("jalview.appletgui.AnnotationLabels$3") ? 0 : jalview.appletgui.AnnotationLabels.$AnnotationLabels$3$ ()), Clazz_innerTypeInstance (jalview.appletgui.AnnotationLabels$3, this, Clazz_cloneFinals ("aaa", aaa, "chist", chist))));
46988 popup.add (chist);
46989 var cprofl =  new awt2swing.CheckboxMenuItem (jalview.util.MessageManager.getString ("label.show_group_logo"), aa[this.selectedRow].groupRef.isShowSequenceLogo ());
46990 cprofl.addItemListener (((Clazz_isClassDefined ("jalview.appletgui.AnnotationLabels$4") ? 0 : jalview.appletgui.AnnotationLabels.$AnnotationLabels$4$ ()), Clazz_innerTypeInstance (jalview.appletgui.AnnotationLabels$4, this, Clazz_cloneFinals ("aaa", aaa, "cprofl", cprofl))));
46991 popup.add (cprofl);
46992 var cprofn =  new awt2swing.CheckboxMenuItem (jalview.util.MessageManager.getString ("label.normalise_group_logo"), aa[this.selectedRow].groupRef.isNormaliseSequenceLogo ());
46993 cprofn.addItemListener (((Clazz_isClassDefined ("jalview.appletgui.AnnotationLabels$5") ? 0 : jalview.appletgui.AnnotationLabels.$AnnotationLabels$5$ ()), Clazz_innerTypeInstance (jalview.appletgui.AnnotationLabels$5, this, Clazz_cloneFinals ("aaa", aaa, "cprofn", cprofn))));
46994 popup.add (cprofn);
46995 } else {
46996 var chist =  new awt2swing.CheckboxMenuItem (jalview.util.MessageManager.getString ("label.show_histogram"), this.av.isShowConsensusHistogram ());
46997 chist.addItemListener (((Clazz_isClassDefined ("jalview.appletgui.AnnotationLabels$6") ? 0 : jalview.appletgui.AnnotationLabels.$AnnotationLabels$6$ ()), Clazz_innerTypeInstance (jalview.appletgui.AnnotationLabels$6, this, Clazz_cloneFinals ("chist", chist))));
46998 popup.add (chist);
46999 var cprof =  new awt2swing.CheckboxMenuItem (jalview.util.MessageManager.getString ("label.show_logo"), this.av.isShowSequenceLogo ());
47000 cprof.addItemListener (((Clazz_isClassDefined ("jalview.appletgui.AnnotationLabels$7") ? 0 : jalview.appletgui.AnnotationLabels.$AnnotationLabels$7$ ()), Clazz_innerTypeInstance (jalview.appletgui.AnnotationLabels$7, this, Clazz_cloneFinals ("cprof", cprof))));
47001 popup.add (cprof);
47002 var cprofn =  new awt2swing.CheckboxMenuItem (jalview.util.MessageManager.getString ("label.normalise_logo"), this.av.isNormaliseSequenceLogo ());
47003 cprofn.addItemListener (((Clazz_isClassDefined ("jalview.appletgui.AnnotationLabels$8") ? 0 : jalview.appletgui.AnnotationLabels.$AnnotationLabels$8$ ()), Clazz_innerTypeInstance (jalview.appletgui.AnnotationLabels$8, this, Clazz_cloneFinals ("cprofn", cprofn))));
47004 popup.add (cprofn);
47005 }item =  new awt2swing.MenuItem (jalview.appletgui.AnnotationLabels.COPYCONS_SEQ);
47006 item.addActionListener (this);
47007 popup.add (item);
47008 }}}popup.show (this, evt.getX (), evt.getY ());
47009 } else {
47010 if (this.selectedRow > -1 && this.selectedRow < aa.length) {
47011 if (aa[this.selectedRow].groupRef != null) {
47012 if (evt.getClickCount () >= 2) {
47013 this.ap.seqPanel.ap.idPanel.highlightSearchResults (null);
47014 this.ap.av.setSelectionGroup (aa[this.selectedRow].groupRef);
47015 this.ap.av.sendSelection ();
47016 this.ap.paintAlignment (false);
47017 jalview.appletgui.PaintRefresher.Refresh (this.ap, this.ap.av.getSequenceSetId ());
47018 } else {
47019 this.ap.seqPanel.ap.idPanel.highlightSearchResults (aa[this.selectedRow].groupRef.getSequences (null));
47020 }return;
47021 } else if (aa[this.selectedRow].sequenceRef != null) {
47022 if (evt.getClickCount () == 1) {
47023 this.ap.seqPanel.ap.idPanel.highlightSearchResults (java.util.Arrays.asList ( Clazz_newArray (-1, [aa[this.selectedRow].sequenceRef])));
47024 } else if (evt.getClickCount () >= 2) {
47025 this.ap.seqPanel.ap.idPanel.highlightSearchResults (null);
47026 var sg = this.ap.av.getSelectionGroup ();
47027 if (sg != null) {
47028 if (!(evt.isControlDown () || evt.isShiftDown ())) {
47029 sg =  new jalview.datamodel.SequenceGroup (sg);
47030 sg.clear ();
47031 sg.addSequence (aa[this.selectedRow].sequenceRef, false);
47032 } else {
47033 if (evt.isControlDown ()) {
47034 sg.addOrRemove (aa[this.selectedRow].sequenceRef, true);
47035 } else {
47036 sg.addSequence (aa[this.selectedRow].sequenceRef, true);
47037 }}} else {
47038 sg =  new jalview.datamodel.SequenceGroup ();
47039 sg.setStartRes (0);
47040 sg.setEndRes (this.ap.av.getAlignment ().getWidth () - 1);
47041 sg.addSequence (aa[this.selectedRow].sequenceRef, false);
47042 }this.ap.av.setSelectionGroup (sg);
47043 this.ap.paintAlignment (false);
47044 jalview.appletgui.PaintRefresher.Refresh (this.ap, this.ap.av.getSequenceSetId ());
47045 this.ap.av.sendSelection ();
47046 }}}}}, "java.awt.event.MouseEvent");
47047 Clazz_defineMethod (c$, "copy_annotseqtoclipboard", 
47048 function (sq) {
47049 if (sq == null || sq.getLength () < 1) {
47050 return;
47051 }jalview.appletgui.AlignFrame.copiedSequences =  new StringBuffer ();
47052 jalview.appletgui.AlignFrame.copiedSequences.append (sq.getName () + "\t" + sq.getStart () + "\t" + sq.getEnd () + "\t" + sq.getSequenceAsString () + "\n");
47053 if (this.av.hasHiddenColumns ()) {
47054 jalview.appletgui.AlignFrame.copiedHiddenColumns =  new java.util.Vector ();
47055 for (var region, $region = this.av.getColumnSelection ().getHiddenColumns ().iterator (); $region.hasNext () && ((region = $region.next ()) || true);) {
47056 jalview.appletgui.AlignFrame.copiedHiddenColumns.addElement ( Clazz_newIntArray (-1, [region[0], region[1]]));
47057 }
47058 }}, "jalview.datamodel.SequenceI");
47059 Clazz_overrideMethod (c$, "paintComponent", 
47060 function (g) {
47061 if (this.av.getWrapAlignment () || !this.av.isShowAnnotation ()) return;
47062 var w = this.getSize ().width;
47063 var h = this.getSize ().height;
47064 if (this.image == null || w != this.image.getWidth (this) || h != this.image.getHeight (this)) {
47065 this.image = this.createImage (w, this.ap.annotationPanel.getSize ().height);
47066 }this.drawComponent (this.image.getGraphics (), w);
47067 g.drawImage (this.image, 0, 0, this);
47068 }, "java.awt.Graphics");
47069 Clazz_defineMethod (c$, "drawComponent", 
47070 function (g, width) {
47071 g.setFont (this.av.getFont ());
47072 var fm = g.getFontMetrics (this.av.getFont ());
47073 g.setColor (java.awt.Color.white);
47074 g.fillRect (0, 0, this.getSize ().width, this.getSize ().height);
47075 g.translate (0, -this.scrollOffset);
47076 g.setColor (java.awt.Color.black);
47077 var aa = this.av.getAlignment ().getAlignmentAnnotation ();
47078 var y = 0;
47079 var fy = g.getFont ().getSize ();
47080 var x = 0;
47081 var offset;
47082 if (aa != null) {
47083 this.hasHiddenRows = false;
47084 for (var i = 0; i < aa.length; i++) {
47085 if (!aa[i].visible) {
47086 this.hasHiddenRows = true;
47087 continue;
47088 }x = width - fm.stringWidth (aa[i].label) - 3;
47089 y += aa[i].height;
47090 offset = Clazz_doubleToInt (-(aa[i].height - fy) / 2);
47091 awt2swing.Util.drawString (g, aa[i].label, x, y + offset);
47092 }
47093 }g.translate (0, +this.scrollOffset);
47094 if (this.resizePanel) {
47095 g.setColor (java.awt.Color.red);
47096 g.setPaintMode ();
47097 g.drawLine (2, 8, 5, 2);
47098 g.drawLine (5, 2, 8, 8);
47099 } else if (!this.dragCancelled && this.dragEvent != null && aa != null) {
47100 g.setColor (java.awt.Color.lightGray);
47101 awt2swing.Util.drawString (g, aa[this.selectedRow].label, this.dragEvent.getX (), this.dragEvent.getY ());
47102 }if (!this.av.getWrapAlignment () && ((aa == null) || (aa.length < 1))) {
47103 g.setColor (java.awt.Color.black);
47104 awt2swing.Util.drawString (g, jalview.util.MessageManager.getString ("label.right_click"), 2, 8);
47105 awt2swing.Util.drawString (g, jalview.util.MessageManager.getString ("label.to_add_annotation"), 2, 18);
47106 }}, "java.awt.Graphics,~N");
47107 c$.$AnnotationLabels$1$ = function () {
47108 Clazz_pu$h(self.c$);
47109 c$ = Clazz_declareAnonymous (jalview.appletgui, "AnnotationLabels$1", null, java.awt.event.ActionListener);
47110 Clazz_overrideMethod (c$, "actionPerformed", 
47111 function (e) {
47112 jalview.analysis.AlignmentUtils.showOrHideSequenceAnnotations (this.b$["jalview.appletgui.AnnotationLabels"].ap.av.getAlignment (), java.util.Collections.singleton (this.f$.label), null, false, false);
47113 this.b$["jalview.appletgui.AnnotationLabels"].refresh ();
47114 }, "java.awt.event.ActionEvent");
47115 c$ = Clazz_p0p ();
47116 };
47117 c$.$AnnotationLabels$2$ = function () {
47118 Clazz_pu$h(self.c$);
47119 c$ = Clazz_declareAnonymous (jalview.appletgui, "AnnotationLabels$2", null, java.awt.event.ItemListener);
47120 Clazz_overrideMethod (c$, "itemStateChanged", 
47121 function (e) {
47122 if (this.f$.aaa.groupRef != null) {
47123 this.f$.aaa.groupRef.setIgnoreGapsConsensus (this.f$.cbmi.getState ());
47124 } else {
47125 this.b$["jalview.appletgui.AnnotationLabels"].ap.av.setIgnoreGapsConsensus (this.f$.cbmi.getState (), this.b$["jalview.appletgui.AnnotationLabels"].ap);
47126 }this.b$["jalview.appletgui.AnnotationLabels"].ap.paintAlignment (true);
47127 }, "java.awt.event.ItemEvent");
47128 c$ = Clazz_p0p ();
47129 };
47130 c$.$AnnotationLabels$3$ = function () {
47131 Clazz_pu$h(self.c$);
47132 c$ = Clazz_declareAnonymous (jalview.appletgui, "AnnotationLabels$3", null, java.awt.event.ItemListener);
47133 Clazz_overrideMethod (c$, "itemStateChanged", 
47134 function (e) {
47135 this.f$.aaa.groupRef.setShowConsensusHistogram (this.f$.chist.getState ());
47136 this.b$["jalview.appletgui.AnnotationLabels"].ap.repaint ();
47137 }, "java.awt.event.ItemEvent");
47138 c$ = Clazz_p0p ();
47139 };
47140 c$.$AnnotationLabels$4$ = function () {
47141 Clazz_pu$h(self.c$);
47142 c$ = Clazz_declareAnonymous (jalview.appletgui, "AnnotationLabels$4", null, java.awt.event.ItemListener);
47143 Clazz_overrideMethod (c$, "itemStateChanged", 
47144 function (e) {
47145 this.f$.aaa.groupRef.setshowSequenceLogo (this.f$.cprofl.getState ());
47146 this.b$["jalview.appletgui.AnnotationLabels"].ap.repaint ();
47147 }, "java.awt.event.ItemEvent");
47148 c$ = Clazz_p0p ();
47149 };
47150 c$.$AnnotationLabels$5$ = function () {
47151 Clazz_pu$h(self.c$);
47152 c$ = Clazz_declareAnonymous (jalview.appletgui, "AnnotationLabels$5", null, java.awt.event.ItemListener);
47153 Clazz_overrideMethod (c$, "itemStateChanged", 
47154 function (e) {
47155 this.f$.aaa.groupRef.setshowSequenceLogo (true);
47156 this.f$.aaa.groupRef.setNormaliseSequenceLogo (this.f$.cprofn.getState ());
47157 this.b$["jalview.appletgui.AnnotationLabels"].ap.repaint ();
47158 }, "java.awt.event.ItemEvent");
47159 c$ = Clazz_p0p ();
47160 };
47161 c$.$AnnotationLabels$6$ = function () {
47162 Clazz_pu$h(self.c$);
47163 c$ = Clazz_declareAnonymous (jalview.appletgui, "AnnotationLabels$6", null, java.awt.event.ItemListener);
47164 Clazz_overrideMethod (c$, "itemStateChanged", 
47165 function (e) {
47166 this.b$["jalview.appletgui.AnnotationLabels"].av.setShowConsensusHistogram (this.f$.chist.getState ());
47167 this.b$["jalview.appletgui.AnnotationLabels"].ap.alignFrame.showConsensusHistogram.setState (this.f$.chist.getState ());
47168 this.b$["jalview.appletgui.AnnotationLabels"].ap.repaint ();
47169 }, "java.awt.event.ItemEvent");
47170 c$ = Clazz_p0p ();
47171 };
47172 c$.$AnnotationLabels$7$ = function () {
47173 Clazz_pu$h(self.c$);
47174 c$ = Clazz_declareAnonymous (jalview.appletgui, "AnnotationLabels$7", null, java.awt.event.ItemListener);
47175 Clazz_overrideMethod (c$, "itemStateChanged", 
47176 function (e) {
47177 this.b$["jalview.appletgui.AnnotationLabels"].av.setShowSequenceLogo (this.f$.cprof.getState ());
47178 this.b$["jalview.appletgui.AnnotationLabels"].ap.alignFrame.showSequenceLogo.setState (this.f$.cprof.getState ());
47179 this.b$["jalview.appletgui.AnnotationLabels"].ap.repaint ();
47180 }, "java.awt.event.ItemEvent");
47181 c$ = Clazz_p0p ();
47182 };
47183 c$.$AnnotationLabels$8$ = function () {
47184 Clazz_pu$h(self.c$);
47185 c$ = Clazz_declareAnonymous (jalview.appletgui, "AnnotationLabels$8", null, java.awt.event.ItemListener);
47186 Clazz_overrideMethod (c$, "itemStateChanged", 
47187 function (e) {
47188 this.b$["jalview.appletgui.AnnotationLabels"].av.setShowSequenceLogo (true);
47189 this.b$["jalview.appletgui.AnnotationLabels"].ap.alignFrame.normSequenceLogo.setState (this.f$.cprofn.getState ());
47190 this.b$["jalview.appletgui.AnnotationLabels"].av.setNormaliseSequenceLogo (this.f$.cprofn.getState ());
47191 this.b$["jalview.appletgui.AnnotationLabels"].ap.repaint ();
47192 }, "java.awt.event.ItemEvent");
47193 c$ = Clazz_p0p ();
47194 };
47195 Clazz_defineStatics (c$,
47196 "ADDNEW", "Add New Row",
47197 "EDITNAME", "Edit Label/Description",
47198 "HIDE", "Hide This Row",
47199 "SHOWALL", "Show All Hidden Rows",
47200 "OUTPUT_TEXT", "Show Values In Textbox",
47201 "COPYCONS_SEQ", "Copy Consensus Sequence");
47202 });
47203 Clazz_declarePackage ("awt2swing");
47204 Clazz_load (["javax.swing.JCheckBox"], "awt2swing.Checkbox", null, function () {
47205 c$ = Clazz_declareType (awt2swing, "Checkbox", javax.swing.JCheckBox);
47206 Clazz_defineMethod (c$, "getState", 
47207 function () {
47208 return this.isSelected ();
47209 });
47210 Clazz_defineMethod (c$, "setState", 
47211 function (b) {
47212 this.setSelected (b);
47213 }, "~B");
47214 });
47215 Clazz_declarePackage ("jalview.appletgui");
47216 Clazz_load (["awt2swing.Panel", "java.awt.event.ActionListener", "$.MouseListener", "awt2swing.Button", "$.TextArea", "java.awt.BorderLayout"], "jalview.appletgui.CutAndPasteTransfer", ["awt2swing.Frame", "$.Label", "jalview.analysis.AlignmentUtils", "jalview.api.ComplexAlignFile", "jalview.appletgui.AlignFrame", "$.AppletJmol", "$.JVDialog", "$.SplitFrame", "jalview.datamodel.PDBEntry", "jalview.io.AnnotationFile", "$.AppletFormatAdapter", "$.IdentifyFile", "$.NewickFile", "jalview.jsdev.GenericFileAdapter", "jalview.schemes.TCoffeeColourScheme", "jalview.util.MessageManager", "java.awt.Font"], function () {
47217 c$ = Clazz_decorateAsClass (function () {
47218 this.pdbImport = false;
47219 this.treeImport = false;
47220 this.annotationImport = false;
47221 this.seq = null;
47222 this.alignFrame = null;
47223 this.source = null;
47224 this.textarea = null;
47225 this.accept = null;
47226 this.addSequences = null;
47227 this.$cancel = null;
47228 this.buttonPanel = null;
47229 this.borderLayout1 = null;
47230 Clazz_instantialize (this, arguments);
47231 }, jalview.appletgui, "CutAndPasteTransfer", awt2swing.Panel, [java.awt.event.ActionListener, java.awt.event.MouseListener]);
47232 Clazz_prepareFields (c$, function () {
47233 this.textarea =  new awt2swing.TextArea ();
47234 this.accept =  new awt2swing.Button ("New Window");
47235 this.addSequences =  new awt2swing.Button ("Add to Current Alignment");
47236 this.$cancel =  new awt2swing.Button ("Close");
47237 this.buttonPanel =  new awt2swing.Panel ();
47238 this.borderLayout1 =  new java.awt.BorderLayout ();
47239 });
47240 Clazz_makeConstructor (c$, 
47241 function (forImport, alignFrame) {
47242 Clazz_superConstructor (this, jalview.appletgui.CutAndPasteTransfer, []);
47243 try {
47244 this.jbInit ();
47245 } catch (e) {
47246 if (Clazz_exceptionOf (e, Exception)) {
47247 e.printStackTrace ();
47248 } else {
47249 throw e;
47250 }
47251 }
47252 this.alignFrame = alignFrame;
47253 if (!forImport) {
47254 this.buttonPanel.setVisible (false);
47255 }}, "~B,jalview.appletgui.AlignFrame");
47256 Clazz_defineMethod (c$, "getText", 
47257 function () {
47258 return this.textarea.getText ();
47259 });
47260 Clazz_defineMethod (c$, "setText", 
47261 function (text) {
47262 this.textarea.setText (text);
47263 }, "~S");
47264 Clazz_defineMethod (c$, "setPDBImport", 
47265 function (seq) {
47266 this.seq = seq;
47267 this.accept.setLabel (jalview.util.MessageManager.getString ("action.accept"));
47268 this.addSequences.setVisible (false);
47269 this.pdbImport = true;
47270 }, "jalview.datamodel.SequenceI");
47271 Clazz_defineMethod (c$, "setTreeImport", 
47272 function () {
47273 this.treeImport = true;
47274 this.accept.setLabel (jalview.util.MessageManager.getString ("action.accept"));
47275 this.addSequences.setVisible (false);
47276 });
47277 Clazz_defineMethod (c$, "setAnnotationImport", 
47278 function () {
47279 this.annotationImport = true;
47280 this.accept.setLabel (jalview.util.MessageManager.getString ("action.accept"));
47281 this.addSequences.setVisible (false);
47282 });
47283 Clazz_overrideMethod (c$, "actionPerformed", 
47284 function (evt) {
47285 if (evt.getSource () === this.accept) {
47286 this.ok (true);
47287 } else if (evt.getSource () === this.addSequences) {
47288 this.ok (false);
47289 } else if (evt.getSource () === this.$cancel) {
47290 this.cancel ();
47291 }}, "java.awt.event.ActionEvent");
47292 Clazz_defineMethod (c$, "ok", 
47293 function (newWindow) {
47294 var text = this.getText ();
47295 var length = text.length;
47296 this.textarea.append ("\n");
47297 if (this.textarea.getText ().length == length) {
47298 var warning = "\n\n#################################################\nWARNING!! THIS IS THE MAXIMUM SIZE OF TEXTAREA!!\n\nCAN\'T INPUT FULL ALIGNMENT\n\nYOU MUST DELETE THIS WARNING TO CONTINUE\n\nMAKE SURE LAST SEQUENCE PASTED IS COMPLETE\n#################################################\n";
47299 this.textarea.setText (text.substring (0, text.length - warning.length) + warning);
47300 this.textarea.setCaretPosition (text.length);
47301 }if (this.pdbImport) {
47302 this.openPdbViewer (text);
47303 } else if (this.treeImport) {
47304 if (!this.loadTree ()) {
47305 return;
47306 }} else if (this.annotationImport) {
47307 this.loadAnnotations ();
47308 } else if (this.alignFrame != null) {
47309 this.loadAlignment (text, newWindow, this.alignFrame.getAlignViewport ());
47310 }if (Clazz_instanceOf (this.getParent (), awt2swing.Frame)) {
47311 (this.getParent ()).setVisible (false);
47312 } else {
47313 (this.getParent ()).setVisible (false);
47314 }}, "~B");
47315 Clazz_defineMethod (c$, "loadTree", 
47316 function () {
47317 try {
47318 var fin =  new jalview.io.NewickFile (this.textarea.getText (), "Paste");
47319 fin.parse ();
47320 if (fin.getTree () != null) {
47321 this.alignFrame.loadTree (fin, "Pasted tree file");
47322 return true;
47323 }} catch (ex) {
47324 if (Clazz_exceptionOf (ex, Exception)) {
47325 this.textarea.setText (jalview.util.MessageManager.formatMessage ("label.could_not_parse_newick_file",  Clazz_newArray (-1, [ex.getMessage ()])));
47326 return false;
47327 } else {
47328 throw ex;
47329 }
47330 }
47331 return false;
47332 });
47333 Clazz_defineMethod (c$, "loadAlignment", 
47334 function (text, newWindow, viewport) {
47335 var al = null;
47336 var format =  new jalview.io.IdentifyFile ().Identify (text, jalview.io.AppletFormatAdapter.PASTE);
47337 var afa =  new jalview.io.AppletFormatAdapter (this.alignFrame.alignPanel);
47338 try {
47339 al = afa.readFile (text, jalview.io.AppletFormatAdapter.PASTE, format);
47340 this.source = afa.getAlignFile ();
47341 } catch (ex) {
47342 if (Clazz_exceptionOf (ex, java.io.IOException)) {
47343 ex.printStackTrace ();
47344 } else {
47345 throw ex;
47346 }
47347 }
47348 if (al != null) {
47349 al.setDataset (null);
47350 var allowSplitFrame = this.alignFrame.viewport.applet.getDefaultParameter ("enableSplitFrame", false);
47351 if (allowSplitFrame && this.openSplitFrame (al, format)) {
47352 return;
47353 }if (newWindow) {
47354 var af;
47355 if (Clazz_instanceOf (this.source, jalview.api.ComplexAlignFile)) {
47356 var colSel = (this.source).getColumnSelection ();
47357 var hiddenSeqs = (this.source).getHiddenSequences ();
47358 var showSeqFeatures = (this.source).isShowSeqFeatures ();
47359 var cs = (this.source).getColourScheme ();
47360 af =  new jalview.appletgui.AlignFrame (al, hiddenSeqs, colSel, this.alignFrame.viewport.applet, "Cut & Paste input - " + format, false);
47361 af.getAlignViewport ().setShowSequenceFeatures (showSeqFeatures);
47362 af.changeColour (cs);
47363 } else {
47364 af =  new jalview.appletgui.AlignFrame (al, this.alignFrame.viewport.applet, "Cut & Paste input - " + format, false);
47365 }af.setStatus (jalview.util.MessageManager.getString ("label.successfully_pasted_annotation_to_alignment"));
47366 } else {
47367 this.alignFrame.addSequences (al.getSequencesArray ());
47368 this.alignFrame.setStatus (jalview.util.MessageManager.getString ("label.successfully_pasted_alignment_file"));
47369 }}}, "~S,~B,jalview.appletgui.AlignViewport");
47370 Clazz_defineMethod (c$, "openSplitFrame", 
47371 function (al, format) {
47372 var thisAlignment = this.alignFrame.getAlignViewport ().getAlignment ();
47373 if (thisAlignment.isNucleotide () == al.isNucleotide ()) {
47374 return false;
47375 }var protein = thisAlignment.isNucleotide () ? al : thisAlignment;
47376 var dna = thisAlignment.isNucleotide () ? thisAlignment : al;
47377 var mapped = jalview.analysis.AlignmentUtils.mapProteinToCdna (protein, dna);
47378 if (!mapped) {
47379 return false;
47380 }var title = jalview.util.MessageManager.getString ("label.open_split_window");
47381 var dialog =  new jalview.appletgui.JVDialog (this.getParent (), title, true, 100, 400);
47382 dialog.ok.setLabel (jalview.util.MessageManager.getString ("action.yes"));
47383 dialog.cancel.setLabel (jalview.util.MessageManager.getString ("action.no"));
47384 var question =  new awt2swing.Panel ( new java.awt.BorderLayout ());
47385 var text = jalview.util.MessageManager.getString ("label.open_split_window?");
47386 question.add ( new awt2swing.Label (text, 0), "Center");
47387 dialog.setMainPanel (question);
47388 dialog.setVisible (true);
47389 dialog.toFront ();
47390 if (!dialog.accept) {
47391 return false;
47392 }var applet = this.alignFrame.viewport.applet;
47393 var copyFrame =  new jalview.appletgui.AlignFrame (this.alignFrame.viewport.getAlignment (), applet, this.alignFrame.getTitle (), false, false);
47394 var newFrame =  new jalview.appletgui.AlignFrame (al, this.alignFrame.viewport.applet, "Cut & Paste input - " + format, false, false);
47395 var dnaFrame = al.isNucleotide () ? newFrame : copyFrame;
47396 var proteinFrame = al.isNucleotide () ? copyFrame : newFrame;
47397 var sf =  new jalview.appletgui.SplitFrame (dnaFrame, proteinFrame);
47398 sf.addToDisplay (false, applet);
47399 return true;
47400 }, "jalview.datamodel.AlignmentI,~S");
47401 Clazz_defineMethod (c$, "loadAnnotations", 
47402 function () {
47403 var tcf = null;
47404 try {
47405 tcf = jalview.jsdev.GenericFileAdapter.getFile ("TCoffeeScoreFile", [this.textarea.getText (), jalview.io.AppletFormatAdapter.PASTE]);
47406 if (tcf.isValid ()) {
47407 if (tcf.annotateAlignment (this.alignFrame.viewport.getAlignment (), true)) {
47408 this.alignFrame.tcoffeeColour.setEnabled (true);
47409 this.alignFrame.alignPanel.fontChanged ();
47410 this.alignFrame.changeColour ( new jalview.schemes.TCoffeeColourScheme (this.alignFrame.viewport.getAlignment ()));
47411 this.alignFrame.setStatus (jalview.util.MessageManager.getString ("label.successfully_pasted_tcoffee_scores_to_alignment"));
47412 } else {
47413 this.alignFrame.setStatus (jalview.util.MessageManager.formatMessage ("label.failed_add_tcoffee_scores",  Clazz_newArray (-1, [(tcf.getWarningMessage () != null ? tcf.getWarningMessage () : "")])));
47414 }} else {
47415 tcf = null;
47416 }} catch (x) {
47417 if (Clazz_exceptionOf (x, Exception)) {
47418 tcf = null;
47419 } else {
47420 throw x;
47421 }
47422 }
47423 if (tcf == null) {
47424 if ( new jalview.io.AnnotationFile ().annotateAlignmentView (this.alignFrame.viewport, this.textarea.getText (), jalview.io.AppletFormatAdapter.PASTE)) {
47425 this.alignFrame.alignPanel.fontChanged ();
47426 this.alignFrame.alignPanel.setScrollValues (0, 0);
47427 this.alignFrame.setStatus (jalview.util.MessageManager.getString ("label.successfully_pasted_annotation_to_alignment"));
47428 } else {
47429 if (!this.alignFrame.parseFeaturesFile (this.textarea.getText (), jalview.io.AppletFormatAdapter.PASTE)) {
47430 this.alignFrame.setStatus (jalview.util.MessageManager.getString ("label.couldnt_parse_pasted_text_as_valid_annotation_feature_GFF_tcoffee_file"));
47431 }}}});
47432 Clazz_defineMethod (c$, "openPdbViewer", 
47433 function (text) {
47434 var pdb =  new jalview.datamodel.PDBEntry ();
47435 pdb.setFile (text);
47436  new jalview.appletgui.AppletJmol (pdb,  Clazz_newArray (-1, [this.seq]), null, this.alignFrame.alignPanel, jalview.io.AppletFormatAdapter.PASTE);
47437 }, "~S");
47438 Clazz_defineMethod (c$, "cancel", 
47439 function () {
47440 this.textarea.setText ("");
47441 if (Clazz_instanceOf (this.getParent (), awt2swing.Frame)) {
47442 (this.getParent ()).setVisible (false);
47443 } else {
47444 (this.getParent ()).setVisible (false);
47445 }});
47446 Clazz_defineMethod (c$, "jbInit", 
47447  function () {
47448 this.textarea.setFont ( new java.awt.Font ("Monospaced", 0, 10));
47449 this.textarea.setText (jalview.util.MessageManager.getString ("label.paste_your_alignment_file"));
47450 this.textarea.addMouseListener (this);
47451 this.setLayout (this.borderLayout1);
47452 this.accept.addActionListener (this);
47453 this.addSequences.addActionListener (this);
47454 this.$cancel.addActionListener (this);
47455 this.add (this.buttonPanel, "South");
47456 this.buttonPanel.add (this.accept, null);
47457 this.buttonPanel.add (this.addSequences);
47458 this.buttonPanel.add (this.$cancel, null);
47459 this.add (this.textarea, "Center");
47460 });
47461 Clazz_overrideMethod (c$, "mousePressed", 
47462 function (evt) {
47463 if (this.textarea.getText ().startsWith (jalview.util.MessageManager.getString ("label.paste_your"))) {
47464 this.textarea.setText ("");
47465 }}, "java.awt.event.MouseEvent");
47466 Clazz_overrideMethod (c$, "mouseReleased", 
47467 function (evt) {
47468 }, "java.awt.event.MouseEvent");
47469 Clazz_overrideMethod (c$, "mouseClicked", 
47470 function (evt) {
47471 }, "java.awt.event.MouseEvent");
47472 Clazz_overrideMethod (c$, "mouseEntered", 
47473 function (evt) {
47474 }, "java.awt.event.MouseEvent");
47475 Clazz_overrideMethod (c$, "mouseExited", 
47476 function (evt) {
47477 }, "java.awt.event.MouseEvent");
47478 });
47479 Clazz_declarePackage ("awt2swing");
47480 Clazz_load (["javax.swing.JButton"], "awt2swing.Button", null, function () {
47481 c$ = Clazz_declareType (awt2swing, "Button", javax.swing.JButton);
47482 });
47483 Clazz_declarePackage ("awt2swing");
47484 Clazz_load (["javax.swing.JTextArea"], "awt2swing.TextArea", null, function () {
47485 c$ = Clazz_declareType (awt2swing, "TextArea", javax.swing.JTextArea);
47486 });
47487 Clazz_declarePackage ("javax.swing");
47488 Clazz_load (["javax.swing.text.JTextComponent"], "javax.swing.JTextArea", ["java.lang.IllegalArgumentException", "java.awt.Dimension", "javax.swing.JComponent", "$.LookAndFeel", "javax.swing.text.BadLocationException", "$.JSMinimalAbstractDocument", "swingjs.JSToolkit"], function () {
47489 c$ = Clazz_decorateAsClass (function () {
47490 this.rows = 0;
47491 this.columns = 0;
47492 this.columnWidth = 0;
47493 this.rowHeight = 0;
47494 this.wrap = false;
47495 this.word = false;
47496 Clazz_instantialize (this, arguments);
47497 }, javax.swing, "JTextArea", javax.swing.text.JTextComponent);
47498 Clazz_makeConstructor (c$, 
47499 function () {
47500 this.construct (null, null, 0, 0);
47501 });
47502 Clazz_makeConstructor (c$, 
47503 function (text) {
47504 this.construct (null, text, 0, 0);
47505 }, "~S");
47506 Clazz_makeConstructor (c$, 
47507 function (rows, columns) {
47508 this.construct (null, null, rows, columns);
47509 }, "~N,~N");
47510 Clazz_makeConstructor (c$, 
47511 function (text, rows, columns) {
47512 this.construct (null, text, rows, columns);
47513 }, "~S,~N,~N");
47514 Clazz_makeConstructor (c$, 
47515 function (doc) {
47516 this.construct (doc, null, 0, 0);
47517 }, "javax.swing.text.Document");
47518 Clazz_makeConstructor (c$, 
47519 function (doc, text, rows, columns) {
47520 Clazz_superConstructor (this, javax.swing.JTextArea);
47521 this.rows = rows;
47522 this.columns = columns;
47523 if (doc == null) {
47524 doc = this.createDefaultModel ();
47525 }this.setDocument (doc);
47526 if (text != null) {
47527 this.setText (text);
47528 this.select (0, 0);
47529 }if (rows < 0) {
47530 throw  new IllegalArgumentException ("rows: " + rows);
47531 }if (columns < 0) {
47532 throw  new IllegalArgumentException ("columns: " + columns);
47533 }javax.swing.LookAndFeel.installProperty (this, "focusTraversalKeysForward", javax.swing.JComponent.getManagingFocusForwardTraversalKeys ());
47534 javax.swing.LookAndFeel.installProperty (this, "focusTraversalKeysBackward", javax.swing.JComponent.getManagingFocusBackwardTraversalKeys ());
47535 }, "javax.swing.text.Document,~S,~N,~N");
47536 Clazz_overrideMethod (c$, "getUIClassID", 
47537 function () {
47538 return "TextAreaUI";
47539 });
47540 Clazz_defineMethod (c$, "createDefaultModel", 
47541 function () {
47542 return swingjs.JSToolkit.getPlainDocument (this);
47543 });
47544 Clazz_defineMethod (c$, "setTabSize", 
47545 function (size) {
47546 var doc = this.getDocument ();
47547 if (doc != null) {
47548 var old = this.getTabSize ();
47549 doc.putProperty ("tabSize",  new Integer (size));
47550 this.firePropertyChangeInt ("tabSize", old, size);
47551 }}, "~N");
47552 Clazz_defineMethod (c$, "getTabSize", 
47553 function () {
47554 var size = 8;
47555 var doc = this.getDocument ();
47556 if (doc != null) {
47557 var i = doc.getProperty ("tabSize");
47558 if (i != null) {
47559 size = i.intValue ();
47560 }}return size;
47561 });
47562 Clazz_defineMethod (c$, "setLineWrap", 
47563 function (wrap) {
47564 var old = this.wrap;
47565 this.wrap = wrap;
47566 this.firePropertyChangeBool ("lineWrap", old, wrap);
47567 }, "~B");
47568 Clazz_defineMethod (c$, "getLineWrap", 
47569 function () {
47570 return this.wrap;
47571 });
47572 Clazz_defineMethod (c$, "setWrapStyleWord", 
47573 function (word) {
47574 var old = this.word;
47575 this.word = word;
47576 this.firePropertyChangeBool ("wrapStyleWord", old, word);
47577 }, "~B");
47578 Clazz_defineMethod (c$, "getWrapStyleWord", 
47579 function () {
47580 return this.word;
47581 });
47582 Clazz_defineMethod (c$, "getLineOfOffset", 
47583 function (offset) {
47584 var doc = this.getDocument ();
47585 if (offset < 0) {
47586 throw  new javax.swing.text.BadLocationException ("Can't translate offset to line", -1);
47587 } else if (offset > doc.getLength ()) {
47588 throw  new javax.swing.text.BadLocationException ("Can't translate offset to line", doc.getLength () + 1);
47589 } else {
47590 var map = this.getDocument ().getDefaultRootElement ();
47591 return map.getElementIndex (offset);
47592 }}, "~N");
47593 Clazz_defineMethod (c$, "getLineCount", 
47594 function () {
47595 var map = this.getDocument ().getDefaultRootElement ();
47596 return map.getElementCount ();
47597 });
47598 Clazz_defineMethod (c$, "getLineStartOffset", 
47599 function (line) {
47600 var lineCount = this.getLineCount ();
47601 if (line < 0) {
47602 throw  new javax.swing.text.BadLocationException ("Negative line", -1);
47603 } else if (line >= lineCount) {
47604 throw  new javax.swing.text.BadLocationException ("No such line", this.getDocument ().getLength () + 1);
47605 } else {
47606 var map = this.getDocument ().getDefaultRootElement ();
47607 var lineElem = map.getElement (line);
47608 return lineElem.getStartOffset ();
47609 }}, "~N");
47610 Clazz_defineMethod (c$, "getLineEndOffset", 
47611 function (line) {
47612 var lineCount = this.getLineCount ();
47613 if (line < 0) {
47614 throw  new javax.swing.text.BadLocationException ("Negative line", -1);
47615 } else if (line >= lineCount) {
47616 throw  new javax.swing.text.BadLocationException ("No such line", this.getDocument ().getLength () + 1);
47617 } else {
47618 var map = this.getDocument ().getDefaultRootElement ();
47619 var lineElem = map.getElement (line);
47620 var endOffset = lineElem.getEndOffset ();
47621 return ((line == lineCount - 1) ? (endOffset - 1) : endOffset);
47622 }}, "~N");
47623 Clazz_defineMethod (c$, "insert", 
47624 function (str, pos) {
47625 var doc = this.getDocument ();
47626 if (doc != null) {
47627 try {
47628 doc.insertString (pos, str, null);
47629 } catch (e) {
47630 if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
47631 throw  new IllegalArgumentException (e.getMessage ());
47632 } else {
47633 throw e;
47634 }
47635 }
47636 }}, "~S,~N");
47637 Clazz_defineMethod (c$, "append", 
47638 function (str) {
47639 var doc = this.getDocument ();
47640 if (doc != null) {
47641 try {
47642 doc.insertString (doc.getLength (), str, null);
47643 } catch (e) {
47644 if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
47645 } else {
47646 throw e;
47647 }
47648 }
47649 }}, "~S");
47650 Clazz_defineMethod (c$, "replaceRange", 
47651 function (str, start, end) {
47652 if (end < start) {
47653 throw  new IllegalArgumentException ("end before start");
47654 }var doc = this.getDocument ();
47655 if (doc != null) {
47656 try {
47657 if (Clazz_instanceOf (doc, javax.swing.text.JSMinimalAbstractDocument)) {
47658 (doc).replace (start, end - start, str, null);
47659 } else {
47660 doc.remove (start, end - start);
47661 doc.insertString (start, str, null);
47662 }} catch (e) {
47663 if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) {
47664 throw  new IllegalArgumentException (e.getMessage ());
47665 } else {
47666 throw e;
47667 }
47668 }
47669 }}, "~S,~N,~N");
47670 Clazz_defineMethod (c$, "getRows", 
47671 function () {
47672 return this.rows;
47673 });
47674 Clazz_defineMethod (c$, "setRows", 
47675 function (rows) {
47676 var oldVal = this.rows;
47677 if (rows < 0) {
47678 throw  new IllegalArgumentException ("rows less than zero.");
47679 }if (rows != oldVal) {
47680 this.rows = rows;
47681 this.invalidate ();
47682 }}, "~N");
47683 Clazz_defineMethod (c$, "getRowHeight", 
47684 function () {
47685 if (this.rowHeight == 0) {
47686 var metrics = this.getFontMetrics (this.getFont ());
47687 this.rowHeight = metrics.getHeight ();
47688 }return this.rowHeight;
47689 });
47690 Clazz_defineMethod (c$, "getColumns", 
47691 function () {
47692 return this.columns;
47693 });
47694 Clazz_defineMethod (c$, "setColumns", 
47695 function (columns) {
47696 var oldVal = this.columns;
47697 if (columns < 0) {
47698 throw  new IllegalArgumentException ("columns less than zero.");
47699 }if (columns != oldVal) {
47700 this.columns = columns;
47701 this.invalidate ();
47702 }}, "~N");
47703 Clazz_defineMethod (c$, "getColumnWidth", 
47704 function () {
47705 if (this.columnWidth == 0) {
47706 var metrics = this.getFontMetrics (this.getFont ());
47707 this.columnWidth = metrics.charWidth ('m');
47708 }return this.columnWidth;
47709 });
47710 Clazz_overrideMethod (c$, "getPreferredSize", 
47711 function () {
47712 var d = this.getPrefSizeJComp ();
47713 d = (d == null) ?  new java.awt.Dimension (400, 400) : d;
47714 var insets = this.getInsets ();
47715 if (this.columns != 0) {
47716 d.width = Math.max (d.width, this.columns * this.getColumnWidth () + insets.left + insets.right);
47717 }if (this.rows != 0) {
47718 d.height = Math.max (d.height, this.rows * this.getRowHeight () + insets.top + insets.bottom);
47719 }return d;
47720 });
47721 Clazz_defineMethod (c$, "setFont", 
47722 function (f) {
47723 Clazz_superCall (this, javax.swing.JTextArea, "setFont", [f]);
47724 this.rowHeight = 0;
47725 this.columnWidth = 0;
47726 }, "java.awt.Font");
47727 Clazz_defineMethod (c$, "paramString", 
47728 function () {
47729 var wrapString = (this.wrap ? "true" : "false");
47730 var wordString = (this.word ? "true" : "false");
47731 return Clazz_superCall (this, javax.swing.JTextArea, "paramString", []) + ",colums=" + this.columns + ",columWidth=" + this.columnWidth + ",rows=" + this.rows + ",rowHeight=" + this.rowHeight + ",word=" + wordString + ",wrap=" + wrapString;
47732 });
47733 Clazz_defineMethod (c$, "getScrollableTracksViewportWidth", 
47734 function () {
47735 return (this.wrap) ? true : Clazz_superCall (this, javax.swing.JTextArea, "getScrollableTracksViewportWidth", []);
47736 });
47737 Clazz_defineMethod (c$, "getPreferredScrollableViewportSize", 
47738 function () {
47739 var size = Clazz_superCall (this, javax.swing.JTextArea, "getPreferredScrollableViewportSize", []);
47740 size = (size == null) ?  new java.awt.Dimension (400, 400) : size;
47741 var insets = this.getInsets ();
47742 size.width = (this.columns == 0) ? size.width : this.columns * this.getColumnWidth () + insets.left + insets.right;
47743 size.height = (this.rows == 0) ? size.height : this.rows * this.getRowHeight () + insets.top + insets.bottom;
47744 return size;
47745 });
47746 Clazz_overrideMethod (c$, "getScrollableUnitIncrement", 
47747 function (visibleRect, orientation, direction) {
47748 switch (orientation) {
47749 case 1:
47750 return this.getRowHeight ();
47751 case 0:
47752 return this.getColumnWidth ();
47753 default:
47754 throw  new IllegalArgumentException ("Invalid orientation: " + orientation);
47755 }
47756 }, "java.awt.Rectangle,~N,~N");
47757 Clazz_defineStatics (c$,
47758 "$uiClassID", "TextAreaUI");
47759 });
47760 Clazz_declarePackage ("jalview.api");
47761 Clazz_declareInterface (jalview.api, "ComplexAlignFile");
47762 Clazz_declarePackage ("jalview.appletgui");
47763 Clazz_load (["awt2swing.Panel", "java.awt.Dimension", "java.util.ArrayList"], "jalview.appletgui.AppletJmol", null, function () {
47764 c$ = Clazz_decorateAsClass (function () {
47765 this.scriptWindow = null;
47766 this.inputLine = null;
47767 this.history = null;
47768 this.renderPanel = null;
47769 this.ap = null;
47770 this._aps = null;
47771 this.fileLoadingError = null;
47772 this.loadedInline = false;
47773 this.fr = null;
47774 this.jmb = null;
47775 if (!Clazz_isClassDefined ("jalview.appletgui.AppletJmol.RenderPanel")) {
47776 jalview.appletgui.AppletJmol.$AppletJmol$RenderPanel$ ();
47777 }
47778 Clazz_instantialize (this, arguments);
47779 }, jalview.appletgui, "AppletJmol");
47780 Clazz_prepareFields (c$, function () {
47781 this._aps =  new java.util.ArrayList ();
47782 });
47783 Clazz_makeConstructor (c$, 
47784 function (entry, sequenceIs, object, ap2, uRL) {
47785 }, "jalview.datamodel.PDBEntry,~A,~O,jalview.appletgui.AlignmentPanel,~S");
47786 Clazz_defineMethod (c$, "setJalviewColourScheme", 
47787 function (ucs) {
47788 }, "jalview.schemes.UserColourScheme");
47789 c$.$AppletJmol$RenderPanel$ = function () {
47790 Clazz_pu$h(self.c$);
47791 c$ = Clazz_decorateAsClass (function () {
47792 Clazz_prepareCallback (this, arguments);
47793 this.currentSize = null;
47794 Clazz_instantialize (this, arguments);
47795 }, jalview.appletgui.AppletJmol, "RenderPanel", awt2swing.Panel);
47796 Clazz_prepareFields (c$, function () {
47797 this.currentSize =  new java.awt.Dimension ();
47798 });
47799 Clazz_overrideMethod (c$, "update", 
47800 function (a) {
47801 this.paint (a);
47802 }, "java.awt.Graphics");
47803 Clazz_defineMethod (c$, "PaintComponent", 
47804 function (a) {
47805 this.currentSize = this.getSize ();
47806 }, "java.awt.Graphics");
47807 c$ = Clazz_p0p ();
47808 };
47809 });
47810 Clazz_declarePackage ("jalview.appletgui");
47811 Clazz_load (["java.awt.Dialog", "java.awt.event.ActionListener", "awt2swing.Button"], "jalview.appletgui.JVDialog", ["awt2swing.Panel", "java.awt.FlowLayout"], function () {
47812 c$ = Clazz_decorateAsClass (function () {
47813 this.ap = null;
47814 this.buttonPanel = null;
47815 this.ok = null;
47816 this.cancel = null;
47817 this.accept = false;
47818 this.owner = null;
47819 Clazz_instantialize (this, arguments);
47820 }, jalview.appletgui, "JVDialog", java.awt.Dialog, java.awt.event.ActionListener);
47821 Clazz_prepareFields (c$, function () {
47822 this.ok =  new awt2swing.Button ("Accept");
47823 this.cancel =  new awt2swing.Button ("Cancel");
47824 });
47825 Clazz_makeConstructor (c$, 
47826 function (owner, title, modal, width, height) {
47827 Clazz_superConstructor (this, jalview.appletgui.JVDialog, [owner, title, modal]);
47828 this.owner = owner;
47829 height += owner.getInsets ().top + this.getInsets ().bottom;
47830 this.setBounds (owner.getBounds ().x + Clazz_doubleToInt ((owner.getSize ().width - width) / 2), owner.getBounds ().y + Clazz_doubleToInt ((owner.getSize ().height - height) / 2), width, height);
47831 }, "awt2swing.Frame,~S,~B,~N,~N");
47832 Clazz_defineMethod (c$, "setMainPanel", 
47833 function (panel) {
47834 this.add (panel, "North");
47835 this.buttonPanel =  new awt2swing.Panel ( new java.awt.FlowLayout ());
47836 this.buttonPanel.add (this.ok);
47837 this.buttonPanel.add (this.cancel);
47838 this.ok.addActionListener (this);
47839 this.cancel.addActionListener (this);
47840 this.add (this.buttonPanel, "South");
47841 this.pack ();
47842 }, "awt2swing.Panel");
47843 Clazz_overrideMethod (c$, "actionPerformed", 
47844 function (evt) {
47845 if (evt.getSource () === this.ok) {
47846 this.accept = true;
47847 }this.setVisible (false);
47848 }, "java.awt.event.ActionEvent");
47849 });
47850 Clazz_declarePackage ("jalview.appletgui");
47851 Clazz_load (["jalview.appletgui.EmbmenuFrame"], "jalview.appletgui.SplitFrame", ["awt2swing.Panel", "jalview.analysis.AlignmentUtils", "jalview.bin.JalviewLite", "jalview.structure.StructureSelectionManager", "java.awt.BorderLayout", "$.Dimension", "$.GridLayout"], function () {
47852 c$ = Clazz_decorateAsClass (function () {
47853 this.topFrame = null;
47854 this.bottomFrame = null;
47855 this.outermost = null;
47856 Clazz_instantialize (this, arguments);
47857 }, jalview.appletgui, "SplitFrame", jalview.appletgui.EmbmenuFrame);
47858 Clazz_makeConstructor (c$, 
47859 function (af1, af2) {
47860 Clazz_superConstructor (this, jalview.appletgui.SplitFrame, []);
47861 this.topFrame = af1;
47862 this.bottomFrame = af2;
47863 this.init ();
47864 }, "jalview.appletgui.AlignFrame,jalview.appletgui.AlignFrame");
47865 Clazz_defineMethod (c$, "init", 
47866 function () {
47867 var $private = Clazz_checkPrivateMethod (arguments);
47868 if ($private != null) {
47869 return $private.apply (this, arguments);
47870 }
47871 this.constructSplit ();
47872 var topViewport = this.topFrame.viewport;
47873 var bottomViewport = this.bottomFrame.viewport;
47874 var topAlignment = topViewport.getAlignment ();
47875 var bottomAlignment = bottomViewport.getAlignment ();
47876 var cdna = topAlignment.isNucleotide () ? topViewport : (bottomAlignment.isNucleotide () ? bottomViewport : null);
47877 var protein = !topAlignment.isNucleotide () ? topViewport : (!bottomAlignment.isNucleotide () ? bottomViewport : null);
47878 var mapped = jalview.analysis.AlignmentUtils.mapProteinToCdna (protein.getAlignment (), cdna.getAlignment ());
47879 if (mapped) {
47880 var ssm = jalview.structure.StructureSelectionManager.getStructureSelectionManager (topViewport.applet);
47881 ssm.addMappings (protein.getAlignment ().getCodonFrames ());
47882 topViewport.setCodingComplement (bottomViewport);
47883 ssm.addCommandListener (cdna);
47884 ssm.addCommandListener (protein);
47885 }protein.initComplementConsensus ();
47886 var ap = topAlignment.isNucleotide () ? this.bottomFrame.alignPanel : this.topFrame.alignPanel;
47887 protein.updateConsensus (ap);
47888 this.adjustLayout ();
47889 });
47890 Clazz_defineMethod (c$, "constructSplit", 
47891 function () {
47892 this.unsetMenuBar ();
47893 this.outermost =  new awt2swing.Panel ( new java.awt.GridLayout (2, 1));
47894 var topPanel =  new awt2swing.Panel ();
47895 var bottomPanel =  new awt2swing.Panel ();
47896 this.outermost.add (topPanel);
47897 this.outermost.add (bottomPanel);
47898 this.addAlignFrameComponents (this.topFrame, topPanel);
47899 this.addAlignFrameComponents (this.bottomFrame, bottomPanel);
47900 });
47901 Clazz_defineMethod (c$, "adjustLayout", 
47902 function () {
47903 var cdna = this.topFrame.getAlignViewport ().getAlignment ().isNucleotide () ? this.topFrame.viewport : this.bottomFrame.viewport;
47904 var protein = cdna === this.topFrame.viewport ? this.bottomFrame.viewport : this.topFrame.viewport;
47905 var w1 = this.topFrame.alignPanel.idPanel.idCanvas.getWidth ();
47906 var w2 = this.bottomFrame.alignPanel.idPanel.idCanvas.getWidth ();
47907 var w3 = Math.max (w1, w2);
47908 if (w1 != w3) {
47909 var d = this.topFrame.alignPanel.idPanel.idCanvas.getSize ();
47910 this.topFrame.alignPanel.idPanel.idCanvas.setSize ( new java.awt.Dimension (w3, d.height));
47911 }if (w2 != w3) {
47912 var d = this.bottomFrame.alignPanel.idPanel.idCanvas.getSize ();
47913 this.bottomFrame.alignPanel.idPanel.idCanvas.setSize ( new java.awt.Dimension (w3, d.height));
47914 }if (protein != null && cdna != null) {
47915 var vs = protein.getViewStyle ();
47916 var scale = vs.isScaleProteinAsCdna () ? 3 : 1;
47917 vs.setCharWidth (scale * cdna.getViewStyle ().getCharWidth ());
47918 protein.setViewStyle (vs);
47919 }});
47920 Clazz_defineMethod (c$, "addAlignFrameComponents", 
47921  function (af, panel) {
47922 panel.setLayout ( new java.awt.BorderLayout ());
47923 var menuPanel = af.makeEmbeddedPopupMenu (af.getJMenuBar (), true, false);
47924 panel.add (menuPanel, "North");
47925 panel.add (af.statusBar, "South");
47926 panel.add (af.alignPanel, "Center");
47927 af.setSplitFrame (this);
47928 }, "jalview.appletgui.AlignFrame,awt2swing.Panel");
47929 Clazz_defineMethod (c$, "addToDisplay", 
47930 function (embedded, applet) {
47931 this.createSplitFrameWindow (embedded, applet);
47932 this.validate ();
47933 this.topFrame.alignPanel.adjustAnnotationHeight ();
47934 this.topFrame.alignPanel.paintAlignment (true);
47935 this.bottomFrame.alignPanel.adjustAnnotationHeight ();
47936 this.bottomFrame.alignPanel.paintAlignment (true);
47937 }, "~B,jalview.bin.JalviewLite");
47938 Clazz_defineMethod (c$, "createSplitFrameWindow", 
47939 function (embed, applet) {
47940 if (embed) {
47941 applet.add (this.outermost);
47942 applet.validate ();
47943 } else {
47944 this.add (this.outermost);
47945 var width = Math.max (this.topFrame.frameWidth, this.bottomFrame.frameWidth);
47946 var height = this.topFrame.frameHeight + this.bottomFrame.frameHeight;
47947 jalview.bin.JalviewLite.addFrame (this, this.getTitle (), width, height);
47948 }}, "~B,jalview.bin.JalviewLite");
47949 Clazz_defineMethod (c$, "getComplement", 
47950 function (af) {
47951 if (this.topFrame === af) {
47952 return this.bottomFrame;
47953 } else if (this.bottomFrame === af) {
47954 return this.topFrame;
47955 }return null;
47956 }, "jalview.appletgui.AlignFrame");
47957 });
47958 Clazz_declarePackage ("java.awt");
47959 Clazz_load (["java.awt.LayoutManager"], "java.awt.GridLayout", ["java.lang.IllegalArgumentException", "java.awt.Dimension"], function () {
47960 c$ = Clazz_decorateAsClass (function () {
47961 this.hgap = 0;
47962 this.vgap = 0;
47963 this.rows = 0;
47964 this.cols = 0;
47965 Clazz_instantialize (this, arguments);
47966 }, java.awt, "GridLayout", null, [java.awt.LayoutManager, java.io.Serializable]);
47967 Clazz_makeConstructor (c$, 
47968 function () {
47969 this.construct (1, 0, 0, 0);
47970 });
47971 Clazz_makeConstructor (c$, 
47972 function (rows, cols) {
47973 this.construct (rows, cols, 0, 0);
47974 }, "~N,~N");
47975 Clazz_makeConstructor (c$, 
47976 function (rows, cols, hgap, vgap) {
47977 if ((rows == 0) && (cols == 0)) {
47978 throw  new IllegalArgumentException ("rows and cols cannot both be zero");
47979 }this.rows = rows;
47980 this.cols = cols;
47981 this.hgap = hgap;
47982 this.vgap = vgap;
47983 }, "~N,~N,~N,~N");
47984 Clazz_defineMethod (c$, "getRows", 
47985 function () {
47986 return this.rows;
47987 });
47988 Clazz_defineMethod (c$, "setRows", 
47989 function (rows) {
47990 if ((rows == 0) && (this.cols == 0)) {
47991 throw  new IllegalArgumentException ("rows and cols cannot both be zero");
47992 }this.rows = rows;
47993 }, "~N");
47994 Clazz_defineMethod (c$, "getColumns", 
47995 function () {
47996 return this.cols;
47997 });
47998 Clazz_defineMethod (c$, "setColumns", 
47999 function (cols) {
48000 if ((cols == 0) && (this.rows == 0)) {
48001 throw  new IllegalArgumentException ("rows and cols cannot both be zero");
48002 }this.cols = cols;
48003 }, "~N");
48004 Clazz_defineMethod (c$, "getHgap", 
48005 function () {
48006 return this.hgap;
48007 });
48008 Clazz_defineMethod (c$, "setHgap", 
48009 function (hgap) {
48010 this.hgap = hgap;
48011 }, "~N");
48012 Clazz_defineMethod (c$, "getVgap", 
48013 function () {
48014 return this.vgap;
48015 });
48016 Clazz_defineMethod (c$, "setVgap", 
48017 function (vgap) {
48018 this.vgap = vgap;
48019 }, "~N");
48020 Clazz_overrideMethod (c$, "addLayoutComponent", 
48021 function (name, comp) {
48022 }, "~S,java.awt.Component");
48023 Clazz_overrideMethod (c$, "removeLayoutComponent", 
48024 function (comp) {
48025 }, "java.awt.Component");
48026 Clazz_overrideMethod (c$, "preferredLayoutSize", 
48027 function (parent) {
48028 {
48029 var insets = parent.getInsets ();
48030 var ncomponents = parent.getComponentCount ();
48031 var nrows = this.rows;
48032 var ncols = this.cols;
48033 if (nrows > 0) {
48034 ncols = Clazz_doubleToInt ((ncomponents + nrows - 1) / nrows);
48035 } else {
48036 nrows = Clazz_doubleToInt ((ncomponents + ncols - 1) / ncols);
48037 }var w = 0;
48038 var h = 0;
48039 for (var i = 0; i < ncomponents; i++) {
48040 var comp = parent.getComponent (i);
48041 var d = comp.getPreferredSize ();
48042 if (w < d.width) {
48043 w = d.width;
48044 }if (h < d.height) {
48045 h = d.height;
48046 }}
48047 return  new java.awt.Dimension (insets.left + insets.right + ncols * w + (ncols - 1) * this.hgap, insets.top + insets.bottom + nrows * h + (nrows - 1) * this.vgap);
48048 }}, "java.awt.Container");
48049 Clazz_overrideMethod (c$, "minimumLayoutSize", 
48050 function (parent) {
48051 {
48052 var insets = parent.getInsets ();
48053 var ncomponents = parent.getComponentCount ();
48054 var nrows = this.rows;
48055 var ncols = this.cols;
48056 if (nrows > 0) {
48057 ncols = Clazz_doubleToInt ((ncomponents + nrows - 1) / nrows);
48058 } else {
48059 nrows = Clazz_doubleToInt ((ncomponents + ncols - 1) / ncols);
48060 }var w = 0;
48061 var h = 0;
48062 for (var i = 0; i < ncomponents; i++) {
48063 var comp = parent.getComponent (i);
48064 var d = comp.getMinimumSize ();
48065 if (w < d.width) {
48066 w = d.width;
48067 }if (h < d.height) {
48068 h = d.height;
48069 }}
48070 return  new java.awt.Dimension (insets.left + insets.right + ncols * w + (ncols - 1) * this.hgap, insets.top + insets.bottom + nrows * h + (nrows - 1) * this.vgap);
48071 }}, "java.awt.Container");
48072 Clazz_overrideMethod (c$, "layoutContainer", 
48073 function (parent) {
48074 {
48075 var insets = parent.getInsets ();
48076 var ncomponents = parent.getComponentCount ();
48077 var nrows = this.rows;
48078 var ncols = this.cols;
48079 var ltr = parent.getComponentOrientation ().isLeftToRight ();
48080 if (ncomponents == 0) {
48081 return;
48082 }if (nrows > 0) {
48083 ncols = Clazz_doubleToInt ((ncomponents + nrows - 1) / nrows);
48084 } else {
48085 nrows = Clazz_doubleToInt ((ncomponents + ncols - 1) / ncols);
48086 }var totalGapsWidth = (ncols - 1) * this.hgap;
48087 var widthWOInsets = parent.width - (insets.left + insets.right);
48088 var widthOnComponent = Clazz_doubleToInt ((widthWOInsets - totalGapsWidth) / ncols);
48089 var extraWidthAvailable = Clazz_doubleToInt ((widthWOInsets - (widthOnComponent * ncols + totalGapsWidth)) / 2);
48090 var totalGapsHeight = (nrows - 1) * this.vgap;
48091 var heightWOInsets = parent.height - (insets.top + insets.bottom);
48092 var heightOnComponent = Clazz_doubleToInt ((heightWOInsets - totalGapsHeight) / nrows);
48093 var extraHeightAvailable = Clazz_doubleToInt ((heightWOInsets - (heightOnComponent * nrows + totalGapsHeight)) / 2);
48094 if (ltr) {
48095 for (var c = 0, x = insets.left + extraWidthAvailable; c < ncols; c++, x += widthOnComponent + this.hgap) {
48096 for (var r = 0, y = insets.top + extraHeightAvailable; r < nrows; r++, y += heightOnComponent + this.vgap) {
48097 var i = r * ncols + c;
48098 if (i < ncomponents) {
48099 parent.getComponent (i).setBounds (x, y, widthOnComponent, heightOnComponent);
48100 }}
48101 }
48102 } else {
48103 for (var c = 0, x = (parent.width - insets.right - widthOnComponent) - extraWidthAvailable; c < ncols; c++, x -= widthOnComponent + this.hgap) {
48104 for (var r = 0, y = insets.top + extraHeightAvailable; r < nrows; r++, y += heightOnComponent + this.vgap) {
48105 var i = r * ncols + c;
48106 if (i < ncomponents) {
48107 parent.getComponent (i).setBounds (x, y, widthOnComponent, heightOnComponent);
48108 }}
48109 }
48110 }}}, "java.awt.Container");
48111 Clazz_overrideMethod (c$, "toString", 
48112 function () {
48113 return this.getClass ().getName () + "[hgap=" + this.hgap + ",vgap=" + this.vgap + ",rows=" + this.rows + ",cols=" + this.cols + "]";
48114 });
48115 });
48116 Clazz_declarePackage ("jalview.io");
48117 Clazz_load (null, "jalview.io.AnnotationFile", ["jalview.analysis.Conservation", "jalview.datamodel.AlignmentAnnotation", "$.Annotation", "$.ColumnSelection", "$.GraphLine", "$.SequenceGroup", "jalview.io.AppletFormatAdapter", "jalview.jsdev.GenericFileAdapter", "jalview.schemes.ColourSchemeProperty", "$.ResidueProperties", "$.UserColourScheme", "jalview.util.Comparison", "$.Format", "java.awt.Color", "java.io.BufferedReader", "$.InputStreamReader", "$.StringReader", "java.lang.Boolean", "$.Float", "$.StringBuffer", "java.util.ArrayList", "$.BitSet", "$.Date", "$.Hashtable", "$.StringTokenizer", "$.Vector"], function () {
48118 c$ = Clazz_decorateAsClass (function () {
48119 this.newline = null;
48120 this.text = null;
48121 if (!Clazz_isClassDefined ("jalview.io.AnnotationFile.ViewDef")) {
48122 jalview.io.AnnotationFile.$AnnotationFile$ViewDef$ ();
48123 }
48124 this.refSeq = null;
48125 this.refSeqId = null;
48126 this.nlinesread = 0;
48127 this.lastread = "";
48128 Clazz_instantialize (this, arguments);
48129 }, jalview.io, "AnnotationFile");
48130 Clazz_prepareFields (c$, function () {
48131 this.newline = System.getProperty ("line.separator");
48132 });
48133 Clazz_makeConstructor (c$, 
48134 function () {
48135 this.init ();
48136 });
48137 Clazz_defineMethod (c$, "setNewlineString", 
48138 function (nl) {
48139 this.newline = nl;
48140 this.init ();
48141 }, "~S");
48142 Clazz_defineMethod (c$, "getNewlineString", 
48143 function () {
48144 return this.newline;
48145 });
48146 Clazz_defineMethod (c$, "init", 
48147  function () {
48148 this.text =  new StringBuffer ("JALVIEW_ANNOTATION" + this.newline + "# Created: " +  new java.util.Date () + this.newline + this.newline);
48149 this.refSeq = null;
48150 this.refSeqId = null;
48151 });
48152 Clazz_defineMethod (c$, "printAnnotations", 
48153 function (annotations, list, properties) {
48154 return this.printAnnotations (annotations, list, properties, null, null, null);
48155 }, "~A,java.util.List,java.util.Hashtable");
48156 Clazz_defineMethod (c$, "printAnnotations", 
48157 function (annotations, list, properties, cs, al, view) {
48158 if (view != null) {
48159 if (view.viewname != null) {
48160 this.text.append ("VIEW_DEF\t" + view.viewname + "\n");
48161 }if (list == null) {
48162 list = view.visibleGroups;
48163 }if (cs == null) {
48164 cs = view.hiddencols;
48165 }if (al == null) {
48166 }}if (al != null && al.hasSeqrep ()) {
48167 this.text.append ("VIEW_SETREF\t" + al.getSeqrep ().getName () + "\n");
48168 }if (cs != null && cs.hasHiddenColumns ()) {
48169 this.text.append ("VIEW_HIDECOLS\t");
48170 var hc = cs.getHiddenColumns ();
48171 var comma = false;
48172 for (var r, $r = hc.iterator (); $r.hasNext () && ((r = $r.next ()) || true);) {
48173 if (!comma) {
48174 comma = true;
48175 } else {
48176 this.text.append (",");
48177 }this.text.append ("" + r[0]);
48178 this.text.append ("-");
48179 this.text.append ("" + r[1]);
48180 }
48181 this.text.append ("\n");
48182 }if (annotations != null) {
48183 var oneColour = true;
48184 var row;
48185 var comma;
48186 var refSeq = null;
48187 var refGroup = null;
48188 var colours =  new StringBuffer ();
48189 var graphLine =  new StringBuffer ();
48190 var rowprops =  new StringBuffer ();
48191 var graphGroup =  new java.util.Hashtable ();
48192 var graphGroup_refs =  new java.util.Hashtable ();
48193 var graphGroupSeen =  new java.util.BitSet ();
48194 var color;
48195 for (var i = 0; i < annotations.length; i++) {
48196 row = annotations[i];
48197 if (!row.visible && !row.hasScore () && !(row.graphGroup > -1 && graphGroupSeen.get (row.graphGroup))) {
48198 continue;
48199 }color = null;
48200 oneColour = true;
48201 this.writeSequence_Ref (refSeq, row.sequenceRef);
48202 refSeq = row.sequenceRef;
48203 this.writeGroup_Ref (refGroup, row.groupRef);
48204 refGroup = row.groupRef;
48205 var hasGlyphs = row.hasIcons;
48206 var hasLabels = row.hasText;
48207 var hasValues = row.$hasScore;
48208 var hasText = false;
48209 for (var j = 0; row.annotations != null && j < row.annotations.length && (!hasGlyphs || !hasLabels || !hasValues); j++) {
48210 if (row.annotations[j] != null) {
48211 hasLabels = new Boolean (hasLabels | (row.annotations[j].displayCharacter != null && row.annotations[j].displayCharacter.length > 0 && !row.annotations[j].displayCharacter.equals (" "))).valueOf ();
48212 hasGlyphs = new Boolean (hasGlyphs | ((row.annotations[j].secondaryStructure).charCodeAt (0) != 0 && row.annotations[j].secondaryStructure != ' ')).valueOf ();
48213 hasValues = new Boolean (hasValues | (!Float.isNaN (row.annotations[j].value))).valueOf ();
48214 hasText = new Boolean (hasText | (row.annotations[j].description != null && row.annotations[j].description.length > 0)).valueOf ();
48215 }}
48216 if (row.graph == 0) {
48217 this.text.append ("NO_GRAPH\t");
48218 hasValues = false;
48219 } else {
48220 if (row.graph == 1) {
48221 this.text.append ("BAR_GRAPH\t");
48222 hasGlyphs = false;
48223 } else if (row.graph == 2) {
48224 hasGlyphs = false;
48225 this.text.append ("LINE_GRAPH\t");
48226 }if (row.getThreshold () != null) {
48227 graphLine.append ("GRAPHLINE\t");
48228 graphLine.append (row.label);
48229 graphLine.append ("\t");
48230 graphLine.append (row.getThreshold ().value);
48231 graphLine.append ("\t");
48232 graphLine.append (row.getThreshold ().label);
48233 graphLine.append ("\t");
48234 graphLine.append (jalview.util.Format.getHexString (row.getThreshold ().colour));
48235 graphLine.append (this.newline);
48236 }if (row.graphGroup > -1) {
48237 graphGroupSeen.set (row.graphGroup);
48238 var key =  new Integer (row.graphGroup);
48239 if (graphGroup.containsKey (key)) {
48240 graphGroup.put (key, graphGroup.get (key) + "\t" + row.label);
48241 } else {
48242 graphGroup_refs.put (key,  Clazz_newArray (-1, [refSeq, refGroup]));
48243 graphGroup.put (key, row.label);
48244 }}}this.text.append (row.label + "\t");
48245 if (row.description != null) {
48246 this.text.append (row.description + "\t");
48247 }for (var j = 0; row.annotations != null && j < row.annotations.length; j++) {
48248 if (refSeq != null && jalview.util.Comparison.isGap (refSeq.getCharAt (j))) {
48249 continue;
48250 }if (row.annotations[j] != null) {
48251 comma = "";
48252 if (hasGlyphs) {
48253 this.text.append (comma);
48254 if (row.annotations[j].secondaryStructure != ' ') {
48255 this.text.append (row.annotations[j].secondaryStructure);
48256 }comma = ",";
48257 }if (hasValues) {
48258 if (!Float.isNaN (row.annotations[j].value)) {
48259 this.text.append (comma + row.annotations[j].value);
48260 } else {
48261 System.err.println ("Skipping NaN - not valid value.");
48262 this.text.append (comma + 0);
48263 }comma = ",";
48264 }if (hasLabels) {
48265 if (row.annotations[j].displayCharacter != null && row.annotations[j].displayCharacter.length > 0 && !row.annotations[j].displayCharacter.equals (" ")) {
48266 this.text.append (comma + row.annotations[j].displayCharacter);
48267 comma = ",";
48268 }}if (hasText) {
48269 if (row.annotations[j].description != null && row.annotations[j].description.length > 0 && !row.annotations[j].description.equals (row.annotations[j].displayCharacter)) {
48270 this.text.append (comma + row.annotations[j].description);
48271 comma = ",";
48272 }}if (color != null && !color.equals (row.annotations[j].colour)) {
48273 oneColour = false;
48274 }color = row.annotations[j].colour;
48275 if (row.annotations[j].colour != null && row.annotations[j].colour !== java.awt.Color.black) {
48276 this.text.append (comma + "[" + jalview.util.Format.getHexString (row.annotations[j].colour) + "]");
48277 comma = ",";
48278 }}this.text.append ("|");
48279 }
48280 if (row.hasScore ()) {
48281 this.text.append ("\t" + row.score);
48282 }this.text.append (this.newline);
48283 if (color != null && color !== java.awt.Color.black && oneColour) {
48284 colours.append ("COLOUR\t");
48285 colours.append (row.label);
48286 colours.append ("\t");
48287 colours.append (jalview.util.Format.getHexString (color));
48288 colours.append (this.newline);
48289 }if (row.scaleColLabel || row.showAllColLabels || row.centreColLabels) {
48290 rowprops.append ("ROWPROPERTIES\t");
48291 rowprops.append (row.label);
48292 rowprops.append ("\tscaletofit=");
48293 rowprops.append (row.scaleColLabel);
48294 rowprops.append ("\tshowalllabs=");
48295 rowprops.append (row.showAllColLabels);
48296 rowprops.append ("\tcentrelabs=");
48297 rowprops.append (row.centreColLabels);
48298 rowprops.append (this.newline);
48299 }if (graphLine.length () > 0) {
48300 this.text.append (graphLine.toString ());
48301 graphLine.setLength (0);
48302 }}
48303 this.text.append (this.newline);
48304 this.text.append (colours.toString ());
48305 if (graphGroup.size () > 0) {
48306 var oldRefSeq = refSeq;
48307 var oldRefGroup = refGroup;
48308 for (var combine_statement, $combine_statement = graphGroup.entrySet ().iterator (); $combine_statement.hasNext () && ((combine_statement = $combine_statement.next ()) || true);) {
48309 var seqRefAndGroup = graphGroup_refs.get (combine_statement.getKey ());
48310 this.writeSequence_Ref (refSeq, seqRefAndGroup[0]);
48311 refSeq = seqRefAndGroup[0];
48312 this.writeGroup_Ref (refGroup, seqRefAndGroup[1]);
48313 refGroup = seqRefAndGroup[1];
48314 this.text.append ("COMBINE\t");
48315 this.text.append (combine_statement.getValue ());
48316 this.text.append (this.newline);
48317 }
48318 this.writeSequence_Ref (refSeq, oldRefSeq);
48319 refSeq = oldRefSeq;
48320 this.writeGroup_Ref (refGroup, oldRefGroup);
48321 refGroup = oldRefGroup;
48322 }this.text.append (rowprops.toString ());
48323 }if (list != null) {
48324 this.printGroups (list);
48325 }if (properties != null) {
48326 this.text.append (this.newline);
48327 this.text.append (this.newline);
48328 this.text.append ("ALIGNMENT");
48329 var en = properties.keys ();
48330 while (en.hasMoreElements ()) {
48331 var key = en.nextElement ().toString ();
48332 this.text.append ("\t");
48333 this.text.append (key);
48334 this.text.append ("=");
48335 this.text.append (properties.get (key));
48336 }
48337 }return this.text.toString ();
48338 }, "~A,java.util.List,java.util.Hashtable,jalview.datamodel.ColumnSelection,jalview.datamodel.AlignmentI,jalview.io.AnnotationFile.ViewDef");
48339 Clazz_defineMethod (c$, "writeGroup_Ref", 
48340  function (refGroup, next_refGroup) {
48341 if (next_refGroup == null) {
48342 if (refGroup != null) {
48343 this.text.append (this.newline);
48344 this.text.append ("GROUP_REF\t");
48345 this.text.append ("ALIGNMENT");
48346 this.text.append (this.newline);
48347 }return true;
48348 } else {
48349 if (refGroup == null || refGroup !== next_refGroup) {
48350 this.text.append (this.newline);
48351 this.text.append ("GROUP_REF\t");
48352 this.text.append (next_refGroup.getName ());
48353 this.text.append (this.newline);
48354 return true;
48355 }}return false;
48356 }, "jalview.datamodel.SequenceGroup,jalview.datamodel.SequenceGroup");
48357 Clazz_defineMethod (c$, "writeSequence_Ref", 
48358  function (refSeq, next_refSeq) {
48359 if (next_refSeq == null) {
48360 if (refSeq != null) {
48361 this.text.append (this.newline);
48362 this.text.append ("SEQUENCE_REF\t");
48363 this.text.append ("ALIGNMENT");
48364 this.text.append (this.newline);
48365 return true;
48366 }} else {
48367 if (refSeq == null || refSeq !== next_refSeq) {
48368 this.text.append (this.newline);
48369 this.text.append ("SEQUENCE_REF\t");
48370 this.text.append (next_refSeq.getName ());
48371 this.text.append (this.newline);
48372 return true;
48373 }}return false;
48374 }, "jalview.datamodel.SequenceI,jalview.datamodel.SequenceI");
48375 Clazz_defineMethod (c$, "printGroups", 
48376 function (list) {
48377 var seqrep = null;
48378 for (var sg, $sg = list.iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
48379 if (!sg.hasSeqrep ()) {
48380 this.text.append ("SEQUENCE_GROUP\t" + sg.getName () + "\t" + (sg.getStartRes () + 1) + "\t" + (sg.getEndRes () + 1) + "\t" + "-1\t");
48381 seqrep = null;
48382 } else {
48383 seqrep = sg.getSeqrep ();
48384 this.text.append ("SEQUENCE_REF\t");
48385 this.text.append (seqrep.getName ());
48386 this.text.append (this.newline);
48387 this.text.append ("SEQUENCE_GROUP\t");
48388 this.text.append (sg.getName ());
48389 this.text.append ("\t");
48390 this.text.append ("" + (seqrep.findPosition (sg.getStartRes ())));
48391 this.text.append ("\t");
48392 this.text.append ((seqrep.findPosition (sg.getEndRes ())));
48393 this.text.append ("\t");
48394 this.text.append ("-1\t");
48395 }for (var s = 0; s < sg.getSize (); s++) {
48396 this.text.append (sg.getSequenceAt (s).getName ());
48397 this.text.append ("\t");
48398 }
48399 this.text.append (this.newline);
48400 this.text.append ("PROPERTIES\t");
48401 this.text.append (sg.getName ());
48402 this.text.append ("\t");
48403 if (sg.getDescription () != null) {
48404 this.text.append ("description=");
48405 this.text.append (sg.getDescription ());
48406 this.text.append ("\t");
48407 }if (sg.cs != null) {
48408 this.text.append ("colour=");
48409 this.text.append (jalview.schemes.ColourSchemeProperty.getColourName (sg.cs));
48410 this.text.append ("\t");
48411 if (sg.cs.getThreshold () != 0) {
48412 this.text.append ("pidThreshold=");
48413 this.text.append (sg.cs.getThreshold ());
48414 }if (sg.cs.conservationApplied ()) {
48415 this.text.append ("consThreshold=");
48416 this.text.append (sg.cs.getConservationInc ());
48417 this.text.append ("\t");
48418 }}this.text.append ("outlineColour=");
48419 this.text.append (jalview.util.Format.getHexString (sg.getOutlineColour ()));
48420 this.text.append ("\t");
48421 this.text.append ("displayBoxes=");
48422 this.text.append (sg.getDisplayBoxes ());
48423 this.text.append ("\t");
48424 this.text.append ("displayText=");
48425 this.text.append (sg.getDisplayText ());
48426 this.text.append ("\t");
48427 this.text.append ("colourText=");
48428 this.text.append (sg.getColourText ());
48429 this.text.append ("\t");
48430 this.text.append ("showUnconserved=");
48431 this.text.append (sg.getShowNonconserved ());
48432 this.text.append ("\t");
48433 if (sg.textColour !== java.awt.Color.black) {
48434 this.text.append ("textCol1=");
48435 this.text.append (jalview.util.Format.getHexString (sg.textColour));
48436 this.text.append ("\t");
48437 }if (sg.textColour2 !== java.awt.Color.white) {
48438 this.text.append ("textCol2=");
48439 this.text.append (jalview.util.Format.getHexString (sg.textColour2));
48440 this.text.append ("\t");
48441 }if (sg.thresholdTextColour != 0) {
48442 this.text.append ("textColThreshold=");
48443 this.text.append (sg.thresholdTextColour);
48444 this.text.append ("\t");
48445 }if (sg.idColour != null) {
48446 this.text.append ("idColour=");
48447 this.text.append (jalview.util.Format.getHexString (sg.idColour));
48448 this.text.append ("\t");
48449 }if (sg.isHidereps ()) {
48450 this.text.append ("hide=true\t");
48451 }if (sg.isHideCols ()) {
48452 this.text.append ("hidecols=true\t");
48453 }if (seqrep != null) {
48454 this.text.append (this.newline);
48455 this.text.append ("SEQUENCE_REF");
48456 }this.text.append (this.newline);
48457 this.text.append (this.newline);
48458 }
48459 }, "java.util.List");
48460 Clazz_defineMethod (c$, "annotateAlignmentView", 
48461 function (viewport, file, protocol) {
48462 var colSel = viewport.getColumnSelection ();
48463 if (colSel == null) {
48464 colSel =  new jalview.datamodel.ColumnSelection ();
48465 }var rslt = this.readAnnotationFile (viewport.getAlignment (), colSel, file, protocol);
48466 if (rslt && (colSel.hasSelectedColumns () || colSel.hasHiddenColumns ())) {
48467 viewport.setColumnSelection (colSel);
48468 }return rslt;
48469 }, "jalview.api.AlignViewportI,~S,~S");
48470 Clazz_defineMethod (c$, "readAnnotationFile", 
48471 function (al, file, protocol) {
48472 return this.readAnnotationFile (al, null, file, protocol);
48473 }, "jalview.datamodel.AlignmentI,~S,~S");
48474 Clazz_defineMethod (c$, "readAnnotationFile", 
48475 function (al, colSel, file, protocol) {
48476 var $in = null;
48477 try {
48478 if (protocol.equals (jalview.io.AppletFormatAdapter.FILE)) {
48479 $in = jalview.jsdev.GenericFileAdapter.getReader (file, false);
48480 } else if (protocol.equals (jalview.io.AppletFormatAdapter.URL)) {
48481 $in = jalview.jsdev.GenericFileAdapter.getReader (file, true);
48482 } else if (protocol.equals (jalview.io.AppletFormatAdapter.PASTE)) {
48483 $in =  new java.io.BufferedReader ( new java.io.StringReader (file));
48484 } else if (protocol.equals (jalview.io.AppletFormatAdapter.CLASSLOADER)) {
48485 var is = this.getClass ().getResourceAsStream ("/" + file);
48486 if (is != null) {
48487 $in =  new java.io.BufferedReader ( new java.io.InputStreamReader (is));
48488 }}if ($in != null) {
48489 return this.parseAnnotationFrom (al, colSel, $in);
48490 }} catch (ex) {
48491 if (Clazz_exceptionOf (ex, Exception)) {
48492 ex.printStackTrace ();
48493 System.out.println ("Problem reading annotation file: " + ex);
48494 if (this.nlinesread > 0) {
48495 System.out.println ("Last read line " + this.nlinesread + ": '" + this.lastread + "' (first 80 chars) ...");
48496 }return false;
48497 } else {
48498 throw ex;
48499 }
48500 }
48501 return false;
48502 }, "jalview.datamodel.AlignmentI,jalview.datamodel.ColumnSelection,~S,~S");
48503 Clazz_defineMethod (c$, "parseAnnotationFrom", 
48504 function (al, colSel, $in) {
48505 this.nlinesread = 0;
48506 var combineAnnotation_calls =  new java.util.ArrayList ();
48507 var deferredAnnotation_calls =  new java.util.ArrayList ();
48508 var modified = false;
48509 var groupRef = null;
48510 var groupRefRows =  new java.util.Hashtable ();
48511 var autoAnnots =  new java.util.Hashtable ();
48512 {
48513 var line;
48514 var label;
48515 var description;
48516 var token;
48517 var graphStyle;
48518 var index;
48519 var refSeqIndex = 1;
48520 var existingAnnotations = 0;
48521 var overrideAutoAnnot = false;
48522 if (al.getAlignmentAnnotation () != null) {
48523 existingAnnotations = al.getAlignmentAnnotation ().length;
48524 if (existingAnnotations > 0) {
48525 var aa = al.getAlignmentAnnotation ();
48526 for (var aai = 0; aai < aa.length; aai++) {
48527 if (aa[aai].autoCalculated) {
48528 autoAnnots.put (this.autoAnnotsKey (aa[aai], aa[aai].sequenceRef, (aa[aai].groupRef == null ? null : aa[aai].groupRef.getName ())),  new Integer (1));
48529 }}
48530 }}var alWidth = al.getWidth ();
48531 var st;
48532 var annotations;
48533 var annotation = null;
48534 var jvAnnotationFile = false;
48535 while ((line = $in.readLine ()) != null) {
48536 this.nlinesread++;
48537 this.lastread =  String.instantialize (line);
48538 if (line.indexOf ("#") == 0) {
48539 continue;
48540 }if (line.indexOf ("JALVIEW_ANNOTATION") > -1) {
48541 jvAnnotationFile = true;
48542 break;
48543 }}
48544 if (!jvAnnotationFile) {
48545 $in.close ();
48546 return false;
48547 }while ((line = $in.readLine ()) != null) {
48548 this.nlinesread++;
48549 this.lastread =  String.instantialize (line);
48550 if (line.indexOf ("#") == 0 || line.indexOf ("JALVIEW_ANNOTATION") > -1 || line.length == 0) {
48551 continue;
48552 }st =  new java.util.StringTokenizer (line, "\t");
48553 token = st.nextToken ();
48554 if (token.equalsIgnoreCase ("COLOUR")) {
48555 this.colourAnnotations (al, st.nextToken (), st.nextToken ());
48556 modified = true;
48557 continue;
48558 } else if (token.equalsIgnoreCase (jalview.io.AnnotationFile.COMBINE)) {
48559 combineAnnotation_calls.add ( Clazz_newArray (-1, [st, this.refSeq, groupRef]));
48560 modified = true;
48561 continue;
48562 } else if (token.equalsIgnoreCase ("ROWPROPERTIES")) {
48563 this.addRowProperties (al, st);
48564 modified = true;
48565 continue;
48566 } else if (token.equalsIgnoreCase (jalview.io.AnnotationFile.GRAPHLINE)) {
48567 deferredAnnotation_calls.add ( Clazz_newArray (-1, [jalview.io.AnnotationFile.GRAPHLINE, st, this.refSeq, groupRef]));
48568 modified = true;
48569 continue;
48570 } else if (token.equalsIgnoreCase ("SEQUENCE_REF")) {
48571 if (st.hasMoreTokens ()) {
48572 this.refSeq = al.findName (this.refSeqId = st.nextToken ());
48573 if (this.refSeq == null) {
48574 this.refSeqId = null;
48575 }try {
48576 refSeqIndex = Integer.parseInt (st.nextToken ());
48577 if (refSeqIndex < 1) {
48578 refSeqIndex = 1;
48579 System.out.println ("WARNING: SEQUENCE_REF index must be > 0 in AnnotationFile");
48580 }} catch (ex) {
48581 if (Clazz_exceptionOf (ex, Exception)) {
48582 refSeqIndex = 1;
48583 } else {
48584 throw ex;
48585 }
48586 }
48587 } else {
48588 this.refSeq = null;
48589 this.refSeqId = null;
48590 }continue;
48591 } else if (token.equalsIgnoreCase ("GROUP_REF")) {
48592 groupRef = null;
48593 if (st.hasMoreTokens ()) {
48594 groupRef = st.nextToken ();
48595 if (groupRef.length < 1) {
48596 groupRef = null;
48597 } else {
48598 if (groupRefRows.get (groupRef) == null) {
48599 groupRefRows.put (groupRef,  new java.util.Vector ());
48600 }}}continue;
48601 } else if (token.equalsIgnoreCase ("SEQUENCE_GROUP")) {
48602 this.addGroup (al, st);
48603 modified = true;
48604 continue;
48605 } else if (token.equalsIgnoreCase ("PROPERTIES")) {
48606 this.addProperties (al, st);
48607 modified = true;
48608 continue;
48609 } else if (token.equalsIgnoreCase ("BELOW_ALIGNMENT")) {
48610 this.setBelowAlignment (al, st);
48611 modified = true;
48612 continue;
48613 } else if (token.equalsIgnoreCase ("ALIGNMENT")) {
48614 this.addAlignmentDetails (al, st);
48615 modified = true;
48616 continue;
48617 } else if (token.equalsIgnoreCase ("VIEW_SETREF")) {
48618 if (this.refSeq != null) {
48619 al.setSeqrep (this.refSeq);
48620 }modified = true;
48621 continue;
48622 } else if (token.equalsIgnoreCase ("VIEW_HIDECOLS")) {
48623 if (st.hasMoreTokens ()) {
48624 if (colSel == null) {
48625 colSel =  new jalview.datamodel.ColumnSelection ();
48626 }this.parseHideCols (colSel, st.nextToken ());
48627 }modified = true;
48628 continue;
48629 } else if (token.equalsIgnoreCase ("HIDE_INSERTIONS")) {
48630 var sr = this.refSeq == null ? al.getSeqrep () : this.refSeq;
48631 if (sr == null) {
48632 sr = al.getSequenceAt (0);
48633 }if (sr != null) {
48634 if (colSel == null) {
48635 System.err.println ("Cannot process HIDE_INSERTIONS without an alignment view: Ignoring line: " + line);
48636 } else {
48637 colSel.hideInsertionsFor (sr);
48638 }}modified = true;
48639 continue;
48640 }graphStyle = jalview.datamodel.AlignmentAnnotation.getGraphValueFromString (token);
48641 label = st.nextToken ();
48642 index = 0;
48643 annotations =  new Array (alWidth);
48644 description = null;
48645 var score = NaN;
48646 if (st.hasMoreTokens ()) {
48647 line = st.nextToken ();
48648 if (line.indexOf ("|") == -1) {
48649 description = line;
48650 if (st.hasMoreTokens ()) {
48651 line = st.nextToken ();
48652 }}if (st.hasMoreTokens ()) {
48653 score = Float.$valueOf (st.nextToken ()).floatValue ();
48654 }st =  new java.util.StringTokenizer (line, "|", true);
48655 var emptyColumn = true;
48656 var onlyOneElement = (st.countTokens () == 1);
48657 while (st.hasMoreElements () && index < alWidth) {
48658 token = st.nextToken ().trim ();
48659 if (onlyOneElement) {
48660 try {
48661 score = Float.$valueOf (token).floatValue ();
48662 break;
48663 } catch (ex) {
48664 if (Clazz_exceptionOf (ex, NumberFormatException)) {
48665 } else {
48666 throw ex;
48667 }
48668 }
48669 }if (token.equals ("|")) {
48670 if (emptyColumn) {
48671 index++;
48672 }emptyColumn = true;
48673 } else {
48674 annotations[index++] = this.parseAnnotation (token, graphStyle);
48675 emptyColumn = false;
48676 }}
48677 }annotation =  new jalview.datamodel.AlignmentAnnotation (label, description, (index == 0) ? null : annotations, 0, 0, graphStyle);
48678 annotation.score = score;
48679 if (!overrideAutoAnnot && autoAnnots.containsKey (this.autoAnnotsKey (annotation, this.refSeq, groupRef))) {
48680 continue;
48681 }if (this.refSeq != null) {
48682 annotation.belowAlignment = false;
48683 var referedSeq = this.refSeq;
48684 do {
48685 var ann =  new jalview.datamodel.AlignmentAnnotation (annotation);
48686 annotation.createSequenceMapping (referedSeq, refSeqIndex, false);
48687 annotation.adjustForAlignment ();
48688 referedSeq.addAlignmentAnnotation (annotation);
48689 al.addAnnotation (annotation);
48690 al.setAnnotationIndex (annotation, al.getAlignmentAnnotation ().length - existingAnnotations - 1);
48691 if (groupRef != null) {
48692 (groupRefRows.get (groupRef)).addElement (annotation);
48693 }annotation = ann;
48694 } while (this.refSeqId != null && (referedSeq = al.findName (referedSeq, this.refSeqId, true)) != null);
48695 } else {
48696 al.addAnnotation (annotation);
48697 al.setAnnotationIndex (annotation, al.getAlignmentAnnotation ().length - existingAnnotations - 1);
48698 if (groupRef != null) {
48699 (groupRefRows.get (groupRef)).addElement (annotation);
48700 }}modified = true;
48701 }
48702 var groupRefLookup =  new java.util.Hashtable ();
48703 var en = groupRefRows.keys ();
48704 while (en.hasMoreElements ()) {
48705 groupRef = en.nextElement ();
48706 var matched = false;
48707 for (var theGroup, $theGroup = al.getGroups ().iterator (); $theGroup.hasNext () && ((theGroup = $theGroup.next ()) || true);) {
48708 if (theGroup.getName ().equals (groupRef)) {
48709 if (matched) {
48710 System.err.println ("Ignoring 1:many group reference mappings for group name '" + groupRef + "'");
48711 } else {
48712 matched = true;
48713 var rowset = groupRefRows.get (groupRef);
48714 groupRefLookup.put (groupRef, theGroup);
48715 if (rowset != null && rowset.size () > 0) {
48716 var alan = null;
48717 for (var elm = 0, elmSize = rowset.size (); elm < elmSize; elm++) {
48718 alan = rowset.elementAt (elm);
48719 alan.groupRef = theGroup;
48720 }
48721 }}}}
48722 (groupRefRows.get (groupRef)).removeAllElements ();
48723 }
48724 for (var _deferred_args, $_deferred_args = deferredAnnotation_calls.iterator (); $_deferred_args.hasNext () && ((_deferred_args = $_deferred_args.next ()) || true);) {
48725 if (_deferred_args[0] === jalview.io.AnnotationFile.GRAPHLINE) {
48726 this.addLine (al, _deferred_args[1], _deferred_args[2], (_deferred_args[3] == null) ? null : groupRefLookup.get (_deferred_args[3]));
48727 }}
48728 var combinecount = 0;
48729 for (var _combine_args, $_combine_args = combineAnnotation_calls.iterator (); $_combine_args.hasNext () && ((_combine_args = $_combine_args.next ()) || true);) {
48730 this.combineAnnotations (al, ++combinecount, _combine_args[0], _combine_args[1], (_combine_args[2] == null) ? null : groupRefLookup.get (_combine_args[2]));
48731 }
48732 }return modified;
48733 }, "jalview.datamodel.AlignmentI,jalview.datamodel.ColumnSelection,java.io.BufferedReader");
48734 Clazz_defineMethod (c$, "parseHideCols", 
48735  function (colSel, nextToken) {
48736 var inval =  new java.util.StringTokenizer (nextToken, ",");
48737 while (inval.hasMoreTokens ()) {
48738 var range = inval.nextToken ().trim ();
48739 var from;
48740 var to = range.indexOf ("-");
48741 if (to == -1) {
48742 from = to = Integer.parseInt (range);
48743 if (from >= 0) {
48744 colSel.hideColumns (from, to);
48745 }} else {
48746 from = Integer.parseInt (range.substring (0, to));
48747 if (to < range.length - 1) {
48748 to = Integer.parseInt (range.substring (to + 1));
48749 } else {
48750 to = from;
48751 }if (from > 0 && to >= from) {
48752 colSel.hideColumns (from, to);
48753 }}}
48754 }, "jalview.datamodel.ColumnSelection,~S");
48755 Clazz_defineMethod (c$, "autoAnnotsKey", 
48756  function (annotation, refSeq, groupRef) {
48757 return annotation.graph + "\t" + annotation.label + "\t" + annotation.description + "\t" + (refSeq != null ? refSeq.getDisplayId (true) : "");
48758 }, "jalview.datamodel.AlignmentAnnotation,jalview.datamodel.SequenceI,~S");
48759 Clazz_defineMethod (c$, "parseAnnotation", 
48760 function (string, graphStyle) {
48761 var hasSymbols = (graphStyle == 0);
48762 var desc = null;
48763 var displayChar = null;
48764 var ss = ' ';
48765 var value = 0;
48766 var parsedValue = false;
48767 var dcset = false;
48768 var colour = null;
48769 var i = string.indexOf ("[");
48770 var j = string.indexOf ("]");
48771 if (i > -1 && j > -1) {
48772 var ucs =  new jalview.schemes.UserColourScheme ();
48773 colour = ucs.getColourFromString (string.substring (i + 1, j));
48774 if (i > 0 && string.charAt (i - 1) == ',') {
48775 i--;
48776 }string = string.substring (0, i) + string.substring (j + 1);
48777 }var st =  new java.util.StringTokenizer (string, ",", true);
48778 var token;
48779 var seenContent = false;
48780 var pass = 0;
48781 while (st.hasMoreTokens ()) {
48782 pass++;
48783 token = st.nextToken ().trim ();
48784 if (token.equals (",")) {
48785 if (!seenContent && parsedValue && !dcset) {
48786 dcset = true;
48787 displayChar = " ";
48788 }seenContent = false;
48789 continue;
48790 } else {
48791 seenContent = true;
48792 }if (!parsedValue) {
48793 try {
48794 displayChar = token;
48795 value =  new Float (token).floatValue ();
48796 parsedValue = true;
48797 continue;
48798 } catch (ex) {
48799 if (Clazz_exceptionOf (ex, NumberFormatException)) {
48800 } else {
48801 throw ex;
48802 }
48803 }
48804 } else {
48805 if (token.length == 1) {
48806 displayChar = token;
48807 }}if (hasSymbols && (token.equals ("H") || token.equals ("E") || token.equals ("S") || token.equals (" "))) {
48808 ss = token.charAt (0);
48809 if (displayChar.equals (token.substring (0, 1))) {
48810 displayChar = "";
48811 }} else if (desc == null || (parsedValue && pass > 2)) {
48812 desc = token;
48813 }}
48814 if (displayChar != null && desc != null && desc.length == 1) {
48815 if (displayChar.length > 1) {
48816 var tmp = displayChar;
48817 displayChar = desc;
48818 desc = tmp;
48819 } else {
48820 if (displayChar.equals (desc)) {
48821 desc = null;
48822 }}}var anot =  new jalview.datamodel.Annotation (displayChar, desc, ss, value);
48823 anot.colour = colour;
48824 return anot;
48825 }, "~S,~N");
48826 Clazz_defineMethod (c$, "colourAnnotations", 
48827 function (al, label, colour) {
48828 var ucs =  new jalview.schemes.UserColourScheme (colour);
48829 var annotations;
48830 for (var i = 0; i < al.getAlignmentAnnotation ().length; i++) {
48831 if (al.getAlignmentAnnotation ()[i].label.equalsIgnoreCase (label)) {
48832 annotations = al.getAlignmentAnnotation ()[i].annotations;
48833 for (var j = 0; j < annotations.length; j++) {
48834 if (annotations[j] != null) {
48835 annotations[j].colour = ucs.findColour ('A');
48836 }}
48837 }}
48838 }, "jalview.datamodel.AlignmentI,~S,~S");
48839 Clazz_defineMethod (c$, "combineAnnotations", 
48840 function (al, combineCount, st, seqRef, groupRef) {
48841 var group = st.nextToken ();
48842 var graphGroup = 0;
48843 if (al.getAlignmentAnnotation () != null) {
48844 for (var i = 0; i < al.getAlignmentAnnotation ().length; i++) {
48845 var aa = al.getAlignmentAnnotation ()[i];
48846 if (aa.graphGroup > graphGroup) {
48847 graphGroup = aa.graphGroup + 1;
48848 }if (aa.sequenceRef === seqRef && aa.groupRef === groupRef && aa.label.equalsIgnoreCase (group)) {
48849 if (aa.graphGroup > -1) {
48850 graphGroup = aa.graphGroup;
48851 } else {
48852 if (graphGroup <= combineCount) {
48853 graphGroup = combineCount + 1;
48854 }aa.graphGroup = graphGroup;
48855 }break;
48856 }}
48857 while (st.hasMoreTokens ()) {
48858 group = st.nextToken ();
48859 for (var i = 0; i < al.getAlignmentAnnotation ().length; i++) {
48860 var aa = al.getAlignmentAnnotation ()[i];
48861 if (aa.sequenceRef === seqRef && aa.groupRef === groupRef && aa.label.equalsIgnoreCase (group)) {
48862 aa.graphGroup = graphGroup;
48863 break;
48864 }}
48865 }
48866 } else {
48867 System.err.println ("Couldn't combine annotations. None are added to alignment yet!");
48868 }}, "jalview.datamodel.AlignmentI,~N,java.util.StringTokenizer,jalview.datamodel.SequenceI,jalview.datamodel.SequenceGroup");
48869 Clazz_defineMethod (c$, "addLine", 
48870 function (al, st, seqRef, groupRef) {
48871 var group = st.nextToken ();
48872 var annotation = null;
48873 var alannot = al.getAlignmentAnnotation ();
48874 var value =  new Float (st.nextToken ()).floatValue ();
48875 var label = st.hasMoreTokens () ? st.nextToken () : null;
48876 var colour = null;
48877 if (st.hasMoreTokens ()) {
48878 var ucs =  new jalview.schemes.UserColourScheme (st.nextToken ());
48879 colour = ucs.findColour ('A');
48880 }if (alannot != null) {
48881 for (var i = 0; i < alannot.length; i++) {
48882 if (alannot[i].label.equalsIgnoreCase (group) && (seqRef == null || alannot[i].sequenceRef === seqRef) && (groupRef == null || alannot[i].groupRef === groupRef)) {
48883 alannot[i].setThreshold ( new jalview.datamodel.GraphLine (value, label, colour));
48884 }}
48885 }if (annotation == null) {
48886 return;
48887 }}, "jalview.datamodel.AlignmentI,java.util.StringTokenizer,jalview.datamodel.SequenceI,jalview.datamodel.SequenceGroup");
48888 Clazz_defineMethod (c$, "addGroup", 
48889 function (al, st) {
48890 var sg =  new jalview.datamodel.SequenceGroup ();
48891 sg.setName (st.nextToken ());
48892 var rng = "";
48893 try {
48894 rng = st.nextToken ();
48895 if (rng.length > 0 && !rng.startsWith ("*")) {
48896 sg.setStartRes (Integer.parseInt (rng) - 1);
48897 } else {
48898 sg.setStartRes (0);
48899 }rng = st.nextToken ();
48900 if (rng.length > 0 && !rng.startsWith ("*")) {
48901 sg.setEndRes (Integer.parseInt (rng) - 1);
48902 } else {
48903 sg.setEndRes (al.getWidth () - 1);
48904 }} catch (e) {
48905 if (Clazz_exceptionOf (e, Exception)) {
48906 System.err.println ("Couldn't parse Group Start or End Field as '*' or a valid column or sequence index: '" + rng + "' - assuming alignment width for group.");
48907 sg.setStartRes (0);
48908 sg.setEndRes (al.getWidth () - 1);
48909 } else {
48910 throw e;
48911 }
48912 }
48913 var index = st.nextToken ();
48914 if (index.equals ("-1")) {
48915 while (st.hasMoreElements ()) {
48916 sg.addSequence (al.findName (st.nextToken ()), false);
48917 }
48918 } else {
48919 var st2 =  new java.util.StringTokenizer (index, ",");
48920 while (st2.hasMoreTokens ()) {
48921 var tmp = st2.nextToken ();
48922 if (tmp.equals ("*")) {
48923 for (var i = 0; i < al.getHeight (); i++) {
48924 sg.addSequence (al.getSequenceAt (i), false);
48925 }
48926 } else if (tmp.indexOf ("-") >= 0) {
48927 var st3 =  new java.util.StringTokenizer (tmp, "-");
48928 var start = (Integer.parseInt (st3.nextToken ()));
48929 var end = (Integer.parseInt (st3.nextToken ()));
48930 if (end > start) {
48931 for (var i = start; i <= end; i++) {
48932 sg.addSequence (al.getSequenceAt (i - 1), false);
48933 }
48934 }} else {
48935 sg.addSequence (al.getSequenceAt (Integer.parseInt (tmp) - 1), false);
48936 }}
48937 }if (this.refSeq != null) {
48938 sg.setStartRes (this.refSeq.findIndex (sg.getStartRes () + 1) - 1);
48939 sg.setEndRes (this.refSeq.findIndex (sg.getEndRes () + 1) - 1);
48940 sg.setSeqrep (this.refSeq);
48941 }if (sg.getSize () > 0) {
48942 al.addGroup (sg);
48943 }}, "jalview.datamodel.AlignmentI,java.util.StringTokenizer");
48944 Clazz_defineMethod (c$, "addRowProperties", 
48945 function (al, st) {
48946 var label = st.nextToken ();
48947 var keyValue;
48948 var key;
48949 var value;
48950 var scaletofit = false;
48951 var centerlab = false;
48952 var showalllabs = false;
48953 while (st.hasMoreTokens ()) {
48954 keyValue = st.nextToken ();
48955 key = keyValue.substring (0, keyValue.indexOf ("="));
48956 value = keyValue.substring (keyValue.indexOf ("=") + 1);
48957 if (key.equalsIgnoreCase ("scaletofit")) {
48958 scaletofit = Boolean.$valueOf (value).booleanValue ();
48959 }if (key.equalsIgnoreCase ("showalllabs")) {
48960 showalllabs = Boolean.$valueOf (value).booleanValue ();
48961 }if (key.equalsIgnoreCase ("centrelabs")) {
48962 centerlab = Boolean.$valueOf (value).booleanValue ();
48963 }var alr = al.getAlignmentAnnotation ();
48964 if (alr != null) {
48965 for (var i = 0; i < alr.length; i++) {
48966 if (alr[i].label.equalsIgnoreCase (label)) {
48967 alr[i].centreColLabels = centerlab;
48968 alr[i].scaleColLabel = scaletofit;
48969 alr[i].showAllColLabels = showalllabs;
48970 }}
48971 }}
48972 }, "jalview.datamodel.AlignmentI,java.util.StringTokenizer");
48973 Clazz_defineMethod (c$, "addProperties", 
48974 function (al, st) {
48975 if (al.getGroups () == null) {
48976 return;
48977 }var name = st.nextToken ();
48978 var sg = null;
48979 for (var _sg, $_sg = al.getGroups ().iterator (); $_sg.hasNext () && ((_sg = $_sg.next ()) || true);) {
48980 if ((sg = _sg).getName ().equals (name)) {
48981 break;
48982 } else {
48983 sg = null;
48984 }}
48985 if (sg != null) {
48986 var keyValue;
48987 var key;
48988 var value;
48989 var def = sg.cs;
48990 sg.cs = null;
48991 while (st.hasMoreTokens ()) {
48992 keyValue = st.nextToken ();
48993 key = keyValue.substring (0, keyValue.indexOf ("="));
48994 value = keyValue.substring (keyValue.indexOf ("=") + 1);
48995 if (key.equalsIgnoreCase ("description")) {
48996 sg.setDescription (value);
48997 } else if (key.equalsIgnoreCase ("colour")) {
48998 sg.cs = jalview.schemes.ColourSchemeProperty.getColour (al, value);
48999 } else if (key.equalsIgnoreCase ("pidThreshold")) {
49000 sg.cs.setThreshold (Integer.parseInt (value), true);
49001 } else if (key.equalsIgnoreCase ("consThreshold")) {
49002 sg.cs.setConservationInc (Integer.parseInt (value));
49003 var c =  new jalview.analysis.Conservation ("Group", jalview.schemes.ResidueProperties.propHash, 3, sg.getSequences (null), sg.getStartRes (), sg.getEndRes () + 1);
49004 c.calculate ();
49005 c.verdict (false, 25);
49006 sg.cs.setConservation (c);
49007 } else if (key.equalsIgnoreCase ("outlineColour")) {
49008 sg.setOutlineColour ( new jalview.schemes.UserColourScheme (value).findColour ('A'));
49009 } else if (key.equalsIgnoreCase ("displayBoxes")) {
49010 sg.setDisplayBoxes (Boolean.$valueOf (value).booleanValue ());
49011 } else if (key.equalsIgnoreCase ("showUnconserved")) {
49012 sg.setShowNonconserved (Boolean.$valueOf (value).booleanValue ());
49013 } else if (key.equalsIgnoreCase ("displayText")) {
49014 sg.setDisplayText (Boolean.$valueOf (value).booleanValue ());
49015 } else if (key.equalsIgnoreCase ("colourText")) {
49016 sg.setColourText (Boolean.$valueOf (value).booleanValue ());
49017 } else if (key.equalsIgnoreCase ("textCol1")) {
49018 sg.textColour =  new jalview.schemes.UserColourScheme (value).findColour ('A');
49019 } else if (key.equalsIgnoreCase ("textCol2")) {
49020 sg.textColour2 =  new jalview.schemes.UserColourScheme (value).findColour ('A');
49021 } else if (key.equalsIgnoreCase ("textColThreshold")) {
49022 sg.thresholdTextColour = Integer.parseInt (value);
49023 } else if (key.equalsIgnoreCase ("idColour")) {
49024 sg.setIdColour ((def =  new jalview.schemes.UserColourScheme (value)).findColour ('A'));
49025 } else if (key.equalsIgnoreCase ("hide")) {
49026 sg.setHidereps (true);
49027 } else if (key.equalsIgnoreCase ("hidecols")) {
49028 sg.setHideCols (true);
49029 }sg.recalcConservation ();
49030 }
49031 if (sg.cs == null) {
49032 sg.cs = def;
49033 }}}, "jalview.datamodel.AlignmentI,java.util.StringTokenizer");
49034 Clazz_defineMethod (c$, "setBelowAlignment", 
49035 function (al, st) {
49036 var token;
49037 var aa;
49038 var ala = al.getAlignmentAnnotation ();
49039 if (ala == null) {
49040 System.err.print ("Warning - no annotation to set below for sequence associated annotation:");
49041 }while (st.hasMoreTokens ()) {
49042 token = st.nextToken ();
49043 if (ala == null) {
49044 System.err.print (" " + token);
49045 } else {
49046 for (var i = 0; i < al.getAlignmentAnnotation ().length; i++) {
49047 aa = al.getAlignmentAnnotation ()[i];
49048 if (aa.sequenceRef === this.refSeq && aa.label.equals (token)) {
49049 aa.belowAlignment = true;
49050 }}
49051 }}
49052 if (ala == null) {
49053 System.err.print ("\n");
49054 }}, "jalview.datamodel.AlignmentI,java.util.StringTokenizer");
49055 Clazz_defineMethod (c$, "addAlignmentDetails", 
49056 function (al, st) {
49057 var keyValue;
49058 var key;
49059 var value;
49060 while (st.hasMoreTokens ()) {
49061 keyValue = st.nextToken ();
49062 key = keyValue.substring (0, keyValue.indexOf ("="));
49063 value = keyValue.substring (keyValue.indexOf ("=") + 1);
49064 al.setProperty (key, value);
49065 }
49066 }, "jalview.datamodel.AlignmentI,java.util.StringTokenizer");
49067 Clazz_defineMethod (c$, "printCSVAnnotations", 
49068 function (annotations) {
49069 var sp =  new StringBuffer ();
49070 for (var i = 0; i < annotations.length; i++) {
49071 var atos = annotations[i].toString ();
49072 var p = 0;
49073 do {
49074 var cp = atos.indexOf ("\n", p);
49075 sp.append (annotations[i].label);
49076 sp.append (",");
49077 if (cp > p) {
49078 sp.append (atos.substring (p, cp + 1));
49079 } else {
49080 sp.append (atos.substring (p));
49081 sp.append (this.newline);
49082 }p = cp + 1;
49083 } while (p > 0);
49084 }
49085 return sp.toString ();
49086 }, "~A");
49087 Clazz_defineMethod (c$, "printAnnotationsForView", 
49088 function (viewport) {
49089 return this.printAnnotations (viewport.isShowAnnotation () ? viewport.getAlignment ().getAlignmentAnnotation () : null, viewport.getAlignment ().getGroups (), viewport.getAlignment ().getProperties (), viewport.getColumnSelection (), viewport.getAlignment (), null);
49090 }, "jalview.api.AlignViewportI");
49091 Clazz_defineMethod (c$, "printAnnotationsForAlignment", 
49092 function (al) {
49093 return this.printAnnotations (al.getAlignmentAnnotation (), al.getGroups (), al.getProperties (), null, al, null);
49094 }, "jalview.datamodel.AlignmentI");
49095 c$.$AnnotationFile$ViewDef$ = function () {
49096 Clazz_pu$h(self.c$);
49097 c$ = Clazz_decorateAsClass (function () {
49098 Clazz_prepareCallback (this, arguments);
49099 this.viewname = null;
49100 this.hidseqs = null;
49101 this.hiddencols = null;
49102 this.visibleGroups = null;
49103 this.hiddenRepSeqs = null;
49104 Clazz_instantialize (this, arguments);
49105 }, jalview.io.AnnotationFile, "ViewDef");
49106 Clazz_makeConstructor (c$, 
49107 function (a, b, c, d) {
49108 this.viewname = a;
49109 this.hidseqs = b;
49110 this.hiddencols = c;
49111 this.hiddenRepSeqs = d;
49112 }, "~S,jalview.datamodel.HiddenSequences,jalview.datamodel.ColumnSelection,java.util.Hashtable");
49113 c$ = Clazz_p0p ();
49114 };
49115 Clazz_defineStatics (c$,
49116 "GRAPHLINE", "GRAPHLINE",
49117 "COMBINE", "COMBINE");
49118 });
49119 Clazz_declarePackage ("jalview.io");
49120 Clazz_load (["jalview.io.FileParse", "jalview.jsdev.RegExp"], "jalview.io.NewickFile", ["jalview.datamodel.SequenceNode", "jalview.util.MessageManager", "java.io.BufferedReader", "$.IOException", "java.lang.Float", "$.StringBuffer", "java.util.StringTokenizer"], function () {
49121 c$ = Clazz_decorateAsClass (function () {
49122 this.root = null;
49123 this.$HasBootstrap = false;
49124 this.$HasDistances = false;
49125 this.RootHasDistance = false;
49126 this.ReplaceUnderscores = false;
49127 this.printRootInfo = true;
49128 this.NodeSafeName = null;
49129 this.QuoteChar = '\'';
49130 Clazz_instantialize (this, arguments);
49131 }, jalview.io, "NewickFile", jalview.io.FileParse);
49132 Clazz_prepareFields (c$, function () {
49133 this.NodeSafeName =  Clazz_newArray (-1, [jalview.jsdev.RegExp.perlCode ("m/[\\[,:'()]/"), jalview.jsdev.RegExp.perlCode ("s/'/''/"), jalview.jsdev.RegExp.perlCode ("s/\\/w/_/")]);
49134 });
49135 Clazz_makeConstructor (c$, 
49136 function (inStr) {
49137 Clazz_superConstructor (this, jalview.io.NewickFile, [inStr, "Paste"]);
49138 }, "~S");
49139 Clazz_makeConstructor (c$, 
49140 function (newtree) {
49141 Clazz_superConstructor (this, jalview.io.NewickFile, []);
49142 this.root = newtree;
49143 }, "jalview.datamodel.SequenceNode");
49144 Clazz_makeConstructor (c$, 
49145 function (newtree, bootstrap) {
49146 Clazz_superConstructor (this, jalview.io.NewickFile, []);
49147 this.$HasBootstrap = bootstrap;
49148 this.root = newtree;
49149 }, "jalview.datamodel.SequenceNode,~B");
49150 Clazz_makeConstructor (c$, 
49151 function (newtree, bootstrap, distances) {
49152 Clazz_superConstructor (this, jalview.io.NewickFile, []);
49153 this.root = newtree;
49154 this.$HasBootstrap = bootstrap;
49155 this.$HasDistances = distances;
49156 }, "jalview.datamodel.SequenceNode,~B,~B");
49157 Clazz_makeConstructor (c$, 
49158 function (newtree, bootstrap, distances, rootdistance) {
49159 Clazz_superConstructor (this, jalview.io.NewickFile, []);
49160 this.root = newtree;
49161 this.$HasBootstrap = bootstrap;
49162 this.$HasDistances = distances;
49163 this.RootHasDistance = rootdistance;
49164 }, "jalview.datamodel.SequenceNode,~B,~B,~B");
49165 Clazz_defineMethod (c$, "ErrorStringrange", 
49166  function (Error, Er, r, p, s) {
49167 return ((Error == null) ? "" : Error) + Er + " at position " + p + " ( " + s.substring (((p - r) < 0) ? 0 : (p - r), ((p + r) > s.length) ? s.length : (p + r)) + " )\n";
49168 }, "~S,~S,~N,~N,~S");
49169 Clazz_defineMethod (c$, "HasBootstrap", 
49170 function () {
49171 return this.$HasBootstrap;
49172 });
49173 Clazz_defineMethod (c$, "HasDistances", 
49174 function () {
49175 return this.$HasDistances;
49176 });
49177 Clazz_defineMethod (c$, "HasRootDistance", 
49178 function () {
49179 return this.RootHasDistance;
49180 });
49181 Clazz_defineMethod (c$, "parse", 
49182 function () {
49183 var nf;
49184 {
49185 var file =  new StringBuffer ();
49186 while ((nf = this.nextLine ()) != null) {
49187 file.append (nf);
49188 }
49189 nf = file.toString ();
49190 }this.root =  new jalview.datamodel.SequenceNode ();
49191 var realroot = null;
49192 var c = this.root;
49193 var d = -1;
49194 var cp = 0;
49195 var Error = null;
49196 var nodename = null;
49197 var commentString2 = null;
49198 var DefDistance = 0.001;
49199 var DefBootstrap = -1;
49200 var distance = DefDistance;
49201 var bootstrap = DefBootstrap;
49202 var ascending = false;
49203 var majorsyms = jalview.jsdev.RegExp.newRegex (["[(\\['),;]"]);
49204 var nextcp = 0;
49205 var ncp = cp;
49206 var parsednodename = false;
49207 while (majorsyms.searchFrom (nf, cp) && (Error == null)) {
49208 var fcp = majorsyms.matchedFrom ();
49209 var schar;
49210 switch (schar = nf.charAt (fcp)) {
49211 case '(':
49212 if (ascending) {
49213 Error = this.ErrorStringrange (Error, "Unexpected '('", 7, fcp, nf);
49214 continue;
49215 };d++;
49216 if (c.right () == null) {
49217 c.setRight ( new jalview.datamodel.SequenceNode (null, c, null, DefDistance, DefBootstrap, false));
49218 c = c.right ();
49219 } else {
49220 if (c.left () != null) {
49221 var tmpn =  new jalview.datamodel.SequenceNode (null, c, null, 0, 0, true);
49222 tmpn.SetChildren (c.left (), c.right ());
49223 c.setRight (tmpn);
49224 }c.setLeft ( new jalview.datamodel.SequenceNode (null, c, null, DefDistance, DefBootstrap, false));
49225 c = c.left ();
49226 }if (realroot == null) {
49227 realroot = c;
49228 }nodename = null;
49229 distance = DefDistance;
49230 bootstrap = DefBootstrap;
49231 cp = fcp + 1;
49232 break;
49233 case '\'':
49234 var qnodename = jalview.jsdev.RegExp.newRegex (["'([^']|'')+'"]);
49235 if (qnodename.searchFrom (nf, fcp)) {
49236 var nl = qnodename.stringMatched ().length;
49237 nodename =  String.instantialize (qnodename.stringMatched ().substring (1, nl - 1));
49238 var xpandquotes = jalview.jsdev.RegExp.perlCode ("s/''/'/");
49239 var widernodename = xpandquotes.replaceAll (nodename);
49240 nodename = widernodename;
49241 nextcp = fcp + nl + 1;
49242 parsednodename = true;
49243 } else {
49244 Error = this.ErrorStringrange (Error, "Unterminated quotes for nodename", 7, fcp, nf);
49245 }break;
49246 default:
49247 if (schar == ';') {
49248 if (d != -1) {
49249 Error = this.ErrorStringrange (Error, "Wayward semicolon (depth=" + d + ")", 7, fcp, nf);
49250 }}if (schar == '[') {
49251 var comment = jalview.jsdev.RegExp.newRegex (["]"]);
49252 if (comment.searchFrom (nf, fcp)) {
49253 nextcp = comment.matchedFrom () + 1;
49254 this.warningMessage = "Tree file contained comments which may confuse input algorithm.";
49255 break;
49256 } else {
49257 Error = this.ErrorStringrange (Error, "Unterminated comment", 3, fcp, nf);
49258 };}var fstring = nf.substring (ncp, fcp);
49259 while (fstring.indexOf (']') > -1) {
49260 var cstart = fstring.indexOf ('[');
49261 var cend = fstring.indexOf (']');
49262 commentString2 = fstring.substring (cstart + 1, cend);
49263 fstring = fstring.substring (0, cstart) + fstring.substring (cend + 1);
49264 }
49265 var uqnodename = jalview.jsdev.RegExp.newRegex (["\\b([^' :;\\](),]+)"]);
49266 var nbootstrap = jalview.jsdev.RegExp.newRegex (["\\s*([0-9+]+)\\s*:"]);
49267 var ndist = jalview.jsdev.RegExp.newRegex ([":([-0-9Ee.+]+)"]);
49268 if (!parsednodename && uqnodename.search (fstring) && ((uqnodename.matchedFromI (1) == 0) || (fstring.charAt (uqnodename.matchedFromI (1) - 1) != ':'))) {
49269 if (nodename == null) {
49270 if (this.ReplaceUnderscores) {
49271 nodename = uqnodename.stringMatchedI (1).$replace ('_', ' ');
49272 } else {
49273 nodename = uqnodename.stringMatchedI (1);
49274 }} else {
49275 Error = this.ErrorStringrange (Error, "File has broken algorithm - overwritten nodename", 10, fcp, nf);
49276 }}if (nbootstrap.search (fstring)) {
49277 if (nbootstrap.stringMatchedI (1).equals (uqnodename.stringMatchedI (1))) {
49278 nodename = null;
49279 }if (nodename == null || nodename.length == 0 || nbootstrap.matchedFromI (1) > (uqnodename.matchedFromI (1) + uqnodename.stringMatched ().length)) {
49280 try {
49281 bootstrap = ( new Integer (nbootstrap.stringMatchedI (1))).intValue ();
49282 this.$HasBootstrap = true;
49283 } catch (e) {
49284 if (Clazz_exceptionOf (e, Exception)) {
49285 Error = this.ErrorStringrange (Error, "Can't parse bootstrap value", 4, ncp + nbootstrap.matchedFrom (), nf);
49286 } else {
49287 throw e;
49288 }
49289 }
49290 }}var nodehasdistance = false;
49291 if (ndist.search (fstring)) {
49292 try {
49293 distance = ( new Float (ndist.stringMatchedI (1))).floatValue ();
49294 this.$HasDistances = true;
49295 nodehasdistance = true;
49296 } catch (e) {
49297 if (Clazz_exceptionOf (e, Exception)) {
49298 Error = this.ErrorStringrange (Error, "Can't parse node distance value", 7, ncp + ndist.matchedFrom (), nf);
49299 } else {
49300 throw e;
49301 }
49302 }
49303 }if (ascending) {
49304 c.setName (nodename);
49305 c.dist = (this.$HasDistances) ? distance : DefDistance;
49306 c.setBootstrap ((this.$HasBootstrap) ? bootstrap : DefBootstrap);
49307 if (c === realroot) {
49308 this.RootHasDistance = nodehasdistance;
49309 }this.parseNHXNodeProps (c, commentString2);
49310 commentString2 = null;
49311 } else {
49312 var newnode =  new jalview.datamodel.SequenceNode (null, c, nodename, (this.$HasDistances) ? distance : DefDistance, (this.$HasBootstrap) ? bootstrap : DefBootstrap, false);
49313 this.parseNHXNodeProps (c, commentString2);
49314 commentString2 = null;
49315 if (c.right () == null) {
49316 c.setRight (newnode);
49317 } else {
49318 if (c.left () == null) {
49319 c.setLeft (newnode);
49320 } else {
49321 var newdummy =  new jalview.datamodel.SequenceNode (null, c, null, (this.$HasDistances ? 0 : DefDistance), 0, true);
49322 newdummy.SetChildren (c.left (), newnode);
49323 c.setLeft (newdummy);
49324 }}}if (ascending) {
49325 c = c.AscendTree ();
49326 if ((d > -1) && (c == null)) {
49327 Error = this.ErrorStringrange (Error, "File broke algorithm: Lost place in tree (is there an extra ')' ?)", 7, fcp, nf);
49328 }}if (nf.charAt (fcp) == ')') {
49329 d--;
49330 ascending = true;
49331 } else {
49332 if (nf.charAt (fcp) == ',') {
49333 if (ascending) {
49334 ascending = false;
49335 } else {
49336 if ((c.left () != null) && (!c.left ().isLeaf ())) {
49337 c = c.left ();
49338 }}}}nodename = null;
49339 distance = DefDistance;
49340 bootstrap = DefBootstrap;
49341 commentString2 = null;
49342 parsednodename = false;
49343 }
49344 if (nextcp == 0) {
49345 ncp = cp = fcp + 1;
49346 } else {
49347 cp = nextcp;
49348 nextcp = 0;
49349 }}
49350 if (Error != null) {
49351 throw ( new java.io.IOException (jalview.util.MessageManager.formatMessage ("exception.newfile",  Clazz_newArray (-1, [Error.toString ()]))));
49352 }if (this.root == null) {
49353 throw ( new java.io.IOException (jalview.util.MessageManager.formatMessage ("exception.newfile",  Clazz_newArray (-1, [jalview.util.MessageManager.getString ("label.no_tree_read_in")]))));
49354 }this.root = this.root.right ().detach ();
49355 if (!this.RootHasDistance) {
49356 this.root.dist = (this.$HasDistances) ? 0 : DefDistance;
49357 }});
49358 Clazz_defineMethod (c$, "parseNHXNodeProps", 
49359  function (c, commentString) {
49360 if (commentString != null && commentString.startsWith ("&&NHX")) {
49361 var st =  new java.util.StringTokenizer (commentString.substring (5), ":");
49362 while (st.hasMoreTokens ()) {
49363 var tok = st.nextToken ();
49364 var colpos = tok.indexOf ("=");
49365 if (colpos > -1) {
49366 var code = tok.substring (0, colpos);
49367 var value = tok.substring (colpos + 1);
49368 try {
49369 if (code.toLowerCase ().equals ("b")) {
49370 var v = -1;
49371 var iv =  new Float (value);
49372 v = iv.intValue ();
49373 c.setBootstrap (v);
49374 this.$HasBootstrap = true;
49375 }} catch (e) {
49376 if (Clazz_exceptionOf (e, Exception)) {
49377 System.err.println ("Couldn't parse code '" + code + "' = '" + value + "'");
49378 e.printStackTrace (System.err);
49379 } else {
49380 throw e;
49381 }
49382 }
49383 }}
49384 }}, "jalview.datamodel.SequenceNode,~S");
49385 Clazz_defineMethod (c$, "getTree", 
49386 function () {
49387 return this.root;
49388 });
49389 Clazz_defineMethod (c$, "print", 
49390 function () {
49391 {
49392 var tf =  new StringBuffer ();
49393 this.print (tf, this.root);
49394 return (tf.append (";").toString ());
49395 }});
49396 Clazz_defineMethod (c$, "print", 
49397 function (withbootstraps) {
49398 {
49399 var boots = this.$HasBootstrap;
49400 this.$HasBootstrap = withbootstraps;
49401 var rv = this.print ();
49402 this.$HasBootstrap = boots;
49403 return rv;
49404 }}, "~B");
49405 Clazz_defineMethod (c$, "print", 
49406 function (withbootstraps, withdists) {
49407 {
49408 var dists = this.$HasDistances;
49409 this.$HasDistances = withdists;
49410 var rv = this.print (withbootstraps);
49411 this.$HasDistances = dists;
49412 return rv;
49413 }}, "~B,~B");
49414 Clazz_defineMethod (c$, "print", 
49415 function (withbootstraps, withdists, printRootInfo) {
49416 {
49417 var rootinfo = printRootInfo;
49418 this.printRootInfo = printRootInfo;
49419 var rv = this.print (withbootstraps, withdists);
49420 this.printRootInfo = rootinfo;
49421 return rv;
49422 }}, "~B,~B,~B");
49423 Clazz_defineMethod (c$, "getQuoteChar", 
49424 function () {
49425 return this.QuoteChar;
49426 });
49427 Clazz_defineMethod (c$, "setQuoteChar", 
49428 function (c) {
49429 var old = this.QuoteChar;
49430 this.QuoteChar = c;
49431 return old;
49432 }, "~S");
49433 Clazz_defineMethod (c$, "nodeName", 
49434  function (name) {
49435 if (this.NodeSafeName[0].search (name)) {
49436 return this.QuoteChar + this.NodeSafeName[1].replaceAll (name) + this.QuoteChar;
49437 } else {
49438 return this.NodeSafeName[2].replaceAll (name);
49439 }}, "~S");
49440 Clazz_defineMethod (c$, "printNodeField", 
49441  function (c) {
49442 return ((c.getName () == null) ? "" : this.nodeName (c.getName ())) + ((this.$HasBootstrap) ? ((c.getBootstrap () > -1) ? ((c.getName () != null ? " " : "") + c.getBootstrap ()) : "") : "") + ((this.$HasDistances) ? (":" + c.dist) : "");
49443 }, "jalview.datamodel.SequenceNode");
49444 Clazz_defineMethod (c$, "printRootField", 
49445  function (root) {
49446 return (this.printRootInfo) ? (((root.getName () == null) ? "" : this.nodeName (root.getName ())) + ((this.$HasBootstrap) ? ((root.getBootstrap () > -1) ? ((root.getName () != null ? " " : "") + +root.getBootstrap ()) : "") : "") + ((this.RootHasDistance) ? (":" + root.dist) : "")) : "";
49447 }, "jalview.datamodel.SequenceNode");
49448 Clazz_defineMethod (c$, "print", 
49449 function (tf, root) {
49450 if (root != null) {
49451 if (root.isLeaf () && this.printRootInfo) {
49452 tf.append (this.printRootField (root));
49453 } else {
49454 if (root.isDummy ()) {
49455 this._print (tf, root.right ());
49456 this._print (tf, root.left ());
49457 } else {
49458 tf.append ("(");
49459 this._print (tf, root.right ());
49460 if (root.left () != null) {
49461 tf.append (",");
49462 }this._print (tf, root.left ());
49463 tf.append (")" + this.printRootField (root));
49464 }}}}, "StringBuffer,jalview.datamodel.SequenceNode");
49465 Clazz_defineMethod (c$, "_print", 
49466 function (tf, c) {
49467 if (c != null) {
49468 if (c.isLeaf ()) {
49469 tf.append (this.printNodeField (c));
49470 } else {
49471 if (c.isDummy ()) {
49472 this._print (tf, c.left ());
49473 if (c.left () != null) {
49474 tf.append (",");
49475 }this._print (tf, c.right ());
49476 } else {
49477 tf.append ("(");
49478 this._print (tf, c.right ());
49479 if (c.left () != null) {
49480 tf.append (",");
49481 }this._print (tf, c.left ());
49482 tf.append (")" + this.printNodeField (c));
49483 }}}}, "StringBuffer,jalview.datamodel.SequenceNode");
49484 c$.main = Clazz_defineMethod (c$, "main", 
49485 function (args) {
49486 try {
49487 if (args == null || args.length != 1) {
49488 System.err.println ("Takes one argument - file name of a newick tree file.");
49489 System.exit (0);
49490 }var fn =  new java.io.File (args[0]);
49491 var newickfile =  new StringBuffer ();
49492 var treefile =  new java.io.BufferedReader ( new java.io.FileReader (fn));
49493 var l;
49494 while ((l = treefile.readLine ()) != null) {
49495 newickfile.append (l);
49496 }
49497 treefile.close ();
49498 System.out.println ("Read file :\n");
49499 var trf =  new jalview.io.NewickFile (args[0], "File");
49500 trf.parse ();
49501 System.out.println ("Original file :\n");
49502 var nonl = jalview.jsdev.RegExp.newRegex (["\n+", ""]);
49503 System.out.println (nonl.replaceAll (newickfile.toString ()) + "\n");
49504 System.out.println ("Parsed file.\n");
49505 System.out.println ("Default output type for original input.\n");
49506 System.out.println (trf.print ());
49507 System.out.println ("Without bootstraps.\n");
49508 System.out.println (trf.print (false));
49509 System.out.println ("Without distances.\n");
49510 System.out.println (trf.print (true, false));
49511 System.out.println ("Without bootstraps but with distanecs.\n");
49512 System.out.println (trf.print (false, true));
49513 System.out.println ("Without bootstraps or distanecs.\n");
49514 System.out.println (trf.print (false, false));
49515 System.out.println ("With bootstraps and with distances.\n");
49516 System.out.println (trf.print (true, true));
49517 } catch (e) {
49518 if (Clazz_exceptionOf (e, java.io.IOException)) {
49519 System.err.println ("Exception\n" + e);
49520 e.printStackTrace ();
49521 } else {
49522 throw e;
49523 }
49524 }
49525 }, "~A");
49526 });
49527 Clazz_declarePackage ("jalview.datamodel");
49528 Clazz_load (["jalview.datamodel.BinaryNode", "java.awt.Color"], "jalview.datamodel.SequenceNode", null, function () {
49529 c$ = Clazz_decorateAsClass (function () {
49530 this.dist = 0;
49531 this.count = 0;
49532 this.height = 0;
49533 this.ycount = 0;
49534 this.color = null;
49535 this.dummy = false;
49536 this.placeholder = false;
49537 Clazz_instantialize (this, arguments);
49538 }, jalview.datamodel, "SequenceNode", jalview.datamodel.BinaryNode);
49539 Clazz_prepareFields (c$, function () {
49540 this.color = java.awt.Color.black;
49541 });
49542 Clazz_makeConstructor (c$, 
49543 function (val, parent, dist, name) {
49544 Clazz_superConstructor (this, jalview.datamodel.SequenceNode, [val, parent, name]);
49545 this.dist = dist;
49546 }, "~O,jalview.datamodel.SequenceNode,~N,~S");
49547 Clazz_makeConstructor (c$, 
49548 function (val, parent, name, dist, bootstrap, dummy) {
49549 Clazz_superConstructor (this, jalview.datamodel.SequenceNode, [val, parent, name]);
49550 this.dist = dist;
49551 this.bootstrap = bootstrap;
49552 this.dummy = dummy;
49553 }, "~O,jalview.datamodel.SequenceNode,~S,~N,~N,~B");
49554 Clazz_defineMethod (c$, "isDummy", 
49555 function () {
49556 return this.dummy;
49557 });
49558 Clazz_defineMethod (c$, "isPlaceholder", 
49559 function () {
49560 return this.placeholder;
49561 });
49562 Clazz_defineMethod (c$, "setDummy", 
49563 function (newstate) {
49564 var oldstate = this.dummy;
49565 this.dummy = newstate;
49566 return oldstate;
49567 }, "~B");
49568 Clazz_defineMethod (c$, "setPlaceholder", 
49569 function (Placeholder) {
49570 this.placeholder = Placeholder;
49571 }, "~B");
49572 Clazz_defineMethod (c$, "AscendTree", 
49573 function () {
49574 var c = this;
49575 do {
49576 c = c.parent ();
49577 } while ((c != null) && c.dummy);
49578 return c;
49579 });
49580 Clazz_defineMethod (c$, "isSequenceLabel", 
49581 function () {
49582 if (this.name != null && this.name.length > 0) {
49583 for (var c = 0, s = this.name.length; c < s; c++) {
49584 var q = this.name.charAt (c);
49585 if ('0' <= q && q <= '9') continue;
49586 return true;
49587 }
49588 }return false;
49589 });
49590 });
49591 Clazz_declarePackage ("jalview.datamodel");
49592 c$ = Clazz_decorateAsClass (function () {
49593 this.$element = null;
49594 this.name = null;
49595 this.$left = null;
49596 this.$right = null;
49597 this.$parent = null;
49598 this.bootstrap = 0;
49599 Clazz_instantialize (this, arguments);
49600 }, jalview.datamodel, "BinaryNode");
49601 Clazz_makeConstructor (c$, 
49602 function () {
49603 this.$left = this.$right = this.$parent = null;
49604 this.bootstrap = 0;
49605 });
49606 Clazz_makeConstructor (c$, 
49607 function (element, parent, name) {
49608 this.$element = element;
49609 this.$parent = parent;
49610 this.name = name;
49611 this.$left = this.$right = null;
49612 }, "~O,jalview.datamodel.BinaryNode,~S");
49613 Clazz_defineMethod (c$, "element", 
49614 function () {
49615 return this.$element;
49616 });
49617 Clazz_defineMethod (c$, "setElement", 
49618 function (v) {
49619 return this.$element = v;
49620 }, "~O");
49621 Clazz_defineMethod (c$, "left", 
49622 function () {
49623 return this.$left;
49624 });
49625 Clazz_defineMethod (c$, "setLeft", 
49626 function (n) {
49627 return this.$left = n;
49628 }, "jalview.datamodel.BinaryNode");
49629 Clazz_defineMethod (c$, "right", 
49630 function () {
49631 return this.$right;
49632 });
49633 Clazz_defineMethod (c$, "setRight", 
49634 function (n) {
49635 return this.$right = n;
49636 }, "jalview.datamodel.BinaryNode");
49637 Clazz_defineMethod (c$, "parent", 
49638 function () {
49639 return this.$parent;
49640 });
49641 Clazz_defineMethod (c$, "setParent", 
49642 function (n) {
49643 return this.$parent = n;
49644 }, "jalview.datamodel.BinaryNode");
49645 Clazz_defineMethod (c$, "isLeaf", 
49646 function () {
49647 return (this.$left == null) && (this.$right == null);
49648 });
49649 Clazz_defineMethod (c$, "SetChildren", 
49650 function (leftchild, rightchild) {
49651 if (leftchild != null) {
49652 this.setLeft (leftchild);
49653 leftchild.detach ();
49654 leftchild.setParent (this);
49655 }if (rightchild != null) {
49656 this.setRight (rightchild);
49657 rightchild.detach ();
49658 rightchild.setParent (this);
49659 }}, "jalview.datamodel.BinaryNode,jalview.datamodel.BinaryNode");
49660 Clazz_defineMethod (c$, "detach", 
49661 function () {
49662 if (this.$parent != null) {
49663 if (this.$parent.$left === this) {
49664 this.$parent.$left = null;
49665 } else {
49666 if (this.$parent.$right === this) {
49667 this.$parent.$right = null;
49668 }}}this.$parent = null;
49669 return this;
49670 });
49671 Clazz_defineMethod (c$, "ascendLeft", 
49672 function () {
49673 var c = this;
49674 do {
49675 c = c.parent ();
49676 } while ((c != null) && (c.left () != null) && !c.left ().isLeaf ());
49677 return c;
49678 });
49679 Clazz_defineMethod (c$, "ascendRight", 
49680 function () {
49681 var c = this;
49682 do {
49683 c = c.parent ();
49684 } while ((c != null) && (c.right () != null) && !c.right ().isLeaf ());
49685 return c;
49686 });
49687 Clazz_defineMethod (c$, "setName", 
49688 function (name) {
49689 this.name = name;
49690 }, "~S");
49691 Clazz_defineMethod (c$, "getName", 
49692 function () {
49693 return this.name;
49694 });
49695 Clazz_defineMethod (c$, "setBootstrap", 
49696 function (boot) {
49697 this.bootstrap = boot;
49698 }, "~N");
49699 Clazz_defineMethod (c$, "getBootstrap", 
49700 function () {
49701 return this.bootstrap;
49702 });
49703 Clazz_declarePackage ("jalview.appletgui");
49704 Clazz_load (["jalview.appletgui.JVDialog"], "jalview.appletgui.EditNameDialog", ["awt2swing.Label", "$.Panel", "$.TextField", "java.awt.BorderLayout", "$.Font"], function () {
49705 c$ = Clazz_decorateAsClass (function () {
49706 this.id = null;
49707 this.description = null;
49708 Clazz_instantialize (this, arguments);
49709 }, jalview.appletgui, "EditNameDialog", jalview.appletgui.JVDialog);
49710 Clazz_overrideMethod (c$, "getName", 
49711 function () {
49712 return this.id.getText ();
49713 });
49714 Clazz_defineMethod (c$, "getDescription", 
49715 function () {
49716 if (this.description.getText ().length < 1) {
49717 return null;
49718 } else {
49719 return this.description.getText ();
49720 }});
49721 Clazz_makeConstructor (c$, 
49722 function (name, desc, label1, label2, owner, title, width, height, display) {
49723 Clazz_superConstructor (this, jalview.appletgui.EditNameDialog, [owner, title, true, width, height]);
49724 var mono =  new java.awt.Font ("Monospaced", 0, 12);
49725 var panel =  new awt2swing.Panel ( new java.awt.BorderLayout ());
49726 var panel2 =  new awt2swing.Panel ( new java.awt.BorderLayout ());
49727 this.id =  new awt2swing.TextField (name, 40);
49728 this.id.setFont (mono);
49729 var label =  new awt2swing.Label (label1);
49730 label.setFont (mono);
49731 panel2.add (label, "West");
49732 panel2.add (this.id, "Center");
49733 panel.add (panel2, "North");
49734 if (label2 != null) {
49735 panel2 =  new awt2swing.Panel ( new java.awt.BorderLayout ());
49736 this.description =  new awt2swing.TextField (desc, 40);
49737 this.description.setFont (mono);
49738 label =  new awt2swing.Label (label2);
49739 label.setFont (mono);
49740 panel2.add (label, "West");
49741 panel2.add (this.description, "Center");
49742 panel.add (panel2, "Center");
49743 }this.setMainPanel (panel);
49744 this.setVisible (display);
49745 }, "~S,~S,~S,~S,awt2swing.Frame,~S,~N,~N,~B");
49746 });
49747 Clazz_declarePackage ("awt2swing");
49748 Clazz_load (["javax.swing.JTextField"], "awt2swing.TextField", ["java.awt.event.TextEvent", "javax.swing.event.DocumentListener"], function () {
49749 c$ = Clazz_declareType (awt2swing, "TextField", javax.swing.JTextField);
49750 Clazz_defineMethod (c$, "addTextListener", 
49751 function (textListener) {
49752 this.getDocument ().addDocumentListener (((Clazz_isClassDefined ("awt2swing.TextField$1") ? 0 : awt2swing.TextField.$TextField$1$ ()), Clazz_innerTypeInstance (awt2swing.TextField$1, this, Clazz_cloneFinals ("textListener", textListener))));
49753 }, "java.awt.event.TextListener");
49754 c$.$TextField$1$ = function () {
49755 Clazz_pu$h(self.c$);
49756 c$ = Clazz_declareAnonymous (awt2swing, "TextField$1", null, javax.swing.event.DocumentListener);
49757 Clazz_overrideMethod (c$, "insertUpdate", 
49758 function (e) {
49759 }, "javax.swing.event.DocumentEvent");
49760 Clazz_overrideMethod (c$, "removeUpdate", 
49761 function (e) {
49762 }, "javax.swing.event.DocumentEvent");
49763 Clazz_overrideMethod (c$, "changedUpdate", 
49764 function (e) {
49765 this.f$.textListener.textValueChanged ( new java.awt.event.TextEvent (this, 0));
49766 }, "javax.swing.event.DocumentEvent");
49767 c$ = Clazz_p0p ();
49768 };
49769 });
49770 Clazz_declarePackage ("java.awt.event");
49771 Clazz_load (["java.awt.AWTEvent"], "java.awt.event.TextEvent", null, function () {
49772 c$ = Clazz_declareType (java.awt.event, "TextEvent", java.awt.AWTEvent);
49773 Clazz_overrideMethod (c$, "paramString", 
49774 function () {
49775 var typeStr;
49776 switch (this.id) {
49777 case 900:
49778 typeStr = "TEXT_VALUE_CHANGED";
49779 break;
49780 default:
49781 typeStr = "unknown type";
49782 }
49783 return typeStr;
49784 });
49785 Clazz_defineStatics (c$,
49786 "TEXT_FIRST", 900,
49787 "TEXT_LAST", 900,
49788 "TEXT_VALUE_CHANGED", 900);
49789 });
49790 Clazz_declarePackage ("jalview.appletgui");
49791 Clazz_load (null, "jalview.appletgui.PaintRefresher", ["jalview.appletgui.AlignmentPanel", "java.util.Hashtable", "$.Vector"], function () {
49792 c$ = Clazz_declareType (jalview.appletgui, "PaintRefresher");
49793 c$.Register = Clazz_defineMethod (c$, "Register", 
49794 function (comp, seqSetId) {
49795 if (jalview.appletgui.PaintRefresher.components == null) {
49796 jalview.appletgui.PaintRefresher.components =  new java.util.Hashtable ();
49797 }if (jalview.appletgui.PaintRefresher.components.containsKey (seqSetId)) {
49798 var comps = jalview.appletgui.PaintRefresher.components.get (seqSetId);
49799 if (!comps.contains (comp)) {
49800 comps.addElement (comp);
49801 }} else {
49802 var vcoms =  new java.util.Vector ();
49803 vcoms.addElement (comp);
49804 jalview.appletgui.PaintRefresher.components.put (seqSetId, vcoms);
49805 }}, "java.awt.Component,~S");
49806 c$.RemoveComponent = Clazz_defineMethod (c$, "RemoveComponent", 
49807 function (comp) {
49808 if (jalview.appletgui.PaintRefresher.components == null) {
49809 return;
49810 }var en = jalview.appletgui.PaintRefresher.components.keys ();
49811 while (en.hasMoreElements ()) {
49812 var id = en.nextElement ().toString ();
49813 var comps = jalview.appletgui.PaintRefresher.components.get (id);
49814 comps.removeElement (comp);
49815 if (comps.size () == 0) {
49816 jalview.appletgui.PaintRefresher.components.remove (id);
49817 }}
49818 }, "java.awt.Component");
49819 c$.Refresh = Clazz_defineMethod (c$, "Refresh", 
49820 function (source, id) {
49821 jalview.appletgui.PaintRefresher.Refresh (source, id, false, false);
49822 }, "java.awt.Component,~S");
49823 c$.Refresh = Clazz_defineMethod (c$, "Refresh", 
49824 function (source, id, alignmentChanged, validateSequences) {
49825 if (jalview.appletgui.PaintRefresher.components == null) {
49826 return;
49827 }var comp;
49828 var comps = jalview.appletgui.PaintRefresher.components.get (id);
49829 if (comps == null) {
49830 return;
49831 }var e = comps.elements ();
49832 while (e.hasMoreElements ()) {
49833 comp = e.nextElement ();
49834 if (comp === source) {
49835 continue;
49836 }if (!comp.isValid ()) {
49837 comps.removeElement (comp);
49838 } else if (validateSequences && Clazz_instanceOf (comp, jalview.appletgui.AlignmentPanel) && Clazz_instanceOf (source, jalview.appletgui.AlignmentPanel)) {
49839 jalview.appletgui.PaintRefresher.validateSequences ((source).av.getAlignment (), (comp).av.getAlignment ());
49840 }if (Clazz_instanceOf (comp, jalview.appletgui.AlignmentPanel) && alignmentChanged) {
49841 (comp).alignmentChanged ();
49842 }comp.repaint ();
49843 }
49844 }, "java.awt.Component,~S,~B,~B");
49845 c$.validateSequences = Clazz_defineMethod (c$, "validateSequences", 
49846 function (source, comp) {
49847 var a1;
49848 if (source.getHiddenSequences ().getSize () > 0) {
49849 a1 = source.getHiddenSequences ().getFullAlignment ().getSequencesArray ();
49850 } else {
49851 a1 = source.getSequencesArray ();
49852 }var a2;
49853 if (comp.getHiddenSequences ().getSize () > 0) {
49854 a2 = comp.getHiddenSequences ().getFullAlignment ().getSequencesArray ();
49855 } else {
49856 a2 = comp.getSequencesArray ();
49857 }var i;
49858 var iSize = a1.length;
49859 var j;
49860 var jSize = a2.length;
49861 if (iSize == jSize) {
49862 return;
49863 }var exists = false;
49864 for (i = 0; i < iSize; i++) {
49865 exists = false;
49866 for (j = 0; j < jSize; j++) {
49867 if (a2[j] === a1[i]) {
49868 exists = true;
49869 break;
49870 }}
49871 if (!exists) {
49872 if (i < comp.getHeight ()) {
49873 var alsq;
49874 {
49875 alsq.add (i, a1[i]);
49876 }} else {
49877 comp.addSequence (a1[i]);
49878 }if (comp.getHiddenSequences ().getSize () > 0) {
49879 a2 = comp.getHiddenSequences ().getFullAlignment ().getSequencesArray ();
49880 } else {
49881 a2 = comp.getSequencesArray ();
49882 }jSize = a2.length;
49883 }}
49884 iSize = a1.length;
49885 jSize = a2.length;
49886 for (j = 0; j < jSize; j++) {
49887 exists = false;
49888 for (i = 0; i < iSize; i++) {
49889 if (a2[j] === a1[i]) {
49890 exists = true;
49891 break;
49892 }}
49893 if (!exists) {
49894 comp.deleteSequence (a2[j]);
49895 }}
49896 }, "jalview.datamodel.AlignmentI,jalview.datamodel.AlignmentI");
49897 c$.getAssociatedPanels = Clazz_defineMethod (c$, "getAssociatedPanels", 
49898 function (id) {
49899 var comps = jalview.appletgui.PaintRefresher.components.get (id);
49900 var tmp =  new java.util.Vector ();
49901 var i;
49902 var iSize = comps.size ();
49903 for (i = 0; i < iSize; i++) {
49904 if (Clazz_instanceOf (comps.elementAt (i), jalview.appletgui.AlignmentPanel)) {
49905 tmp.addElement (comps.elementAt (i));
49906 }}
49907 var result =  new Array (tmp.size ());
49908 for (var ix = 0; ix < result.length; ix++) {
49909 result[ix] = tmp.elementAt (ix);
49910 }
49911 return result;
49912 }, "~S");
49913 Clazz_defineStatics (c$,
49914 "components", null);
49915 });
49916 Clazz_declarePackage ("jalview.appletgui");
49917 Clazz_load (null, "jalview.appletgui.Tooltip", ["awt2swing.Frame", "java.applet.Applet", "java.awt.Toolkit"], function () {
49918 c$ = Clazz_decorateAsClass (function () {
49919 this.tip = null;
49920 this.lastTip = "";
49921 this.setPosition = false;
49922 this.owner = null;
49923 this.mainContainer = null;
49924 this.mainLayout = null;
49925 this.shown = false;
49926 this.VERTICAL_OFFSET = 20;
49927 this.HORIZONTAL_ENLARGE = 10;
49928 this.fontHeight = 0;
49929 this.linkImage = null;
49930 this.fm = null;
49931 Clazz_instantialize (this, arguments);
49932 }, jalview.appletgui, "Tooltip");
49933 Clazz_defineMethod (c$, "setVisible", 
49934 function (b) {
49935 }, "~B");
49936 Clazz_makeConstructor (c$, 
49937 function (tip, owner) {
49938 this.owner = owner;
49939 this.setTip (tip);
49940 var url = this.getClass ().getResource ("/images/link.gif");
49941 if (url != null) {
49942 this.linkImage = java.awt.Toolkit.getDefaultToolkit ().getImage (url);
49943 }}, "~S,java.awt.Component");
49944 Clazz_defineMethod (c$, "setTip", 
49945 function (tip) {
49946 System.err.println ("Tooltip: " + tip);
49947 }, "~S");
49948 Clazz_defineMethod (c$, "setTipLocation", 
49949 function (evt) {
49950 }, "java.awt.event.MouseEvent");
49951 Clazz_defineMethod (c$, "removeToolTip", 
49952  function () {
49953 });
49954 Clazz_defineMethod (c$, "mouseEntered", 
49955 function (me) {
49956 this.setTipLocation (me);
49957 }, "java.awt.event.MouseEvent");
49958 Clazz_defineMethod (c$, "mouseExited", 
49959 function (me) {
49960 this.removeToolTip ();
49961 }, "java.awt.event.MouseEvent");
49962 Clazz_defineMethod (c$, "mousePressed", 
49963 function (me) {
49964 this.removeToolTip ();
49965 }, "java.awt.event.MouseEvent");
49966 Clazz_defineMethod (c$, "mouseReleased", 
49967 function (me) {
49968 }, "java.awt.event.MouseEvent");
49969 Clazz_defineMethod (c$, "mouseClicked", 
49970 function (me) {
49971 }, "java.awt.event.MouseEvent");
49972 Clazz_defineMethod (c$, "mouseMoved", 
49973 function (me) {
49974 if (!this.shown) {
49975 this.setTipLocation (me);
49976 } else if (this.setPosition) {
49977 this.setTipLocation (me);
49978 }}, "java.awt.event.MouseEvent");
49979 Clazz_defineMethod (c$, "mouseDragged", 
49980 function (me) {
49981 }, "java.awt.event.MouseEvent");
49982 });
49983 Clazz_declarePackage ("jalview.util");
49984 Clazz_load (["java.lang.StringBuffer", "java.util.ArrayList", "java.util.regex.Pattern"], "jalview.util.ParseHtmlBodyAndLinks", ["java.util.StringTokenizer"], function () {
49985 c$ = Clazz_decorateAsClass (function () {
49986 this.orig = null;
49987 this.htmlContent = true;
49988 this.links = null;
49989 this.sb = null;
49990 Clazz_instantialize (this, arguments);
49991 }, jalview.util, "ParseHtmlBodyAndLinks");
49992 Clazz_prepareFields (c$, function () {
49993 this.links =  new java.util.ArrayList ();
49994 this.sb =  new StringBuffer ();
49995 });
49996 Clazz_defineMethod (c$, "getOrig", 
49997 function () {
49998 return this.orig;
49999 });
50000 Clazz_defineMethod (c$, "isHtmlContent", 
50001 function () {
50002 return this.htmlContent;
50003 });
50004 Clazz_defineMethod (c$, "getContent", 
50005 function () {
50006 return this.sb.toString ();
50007 });
50008 Clazz_defineMethod (c$, "getLinks", 
50009 function () {
50010 return this.links;
50011 });
50012 Clazz_makeConstructor (c$, 
50013 function (description, removeHTML, newline) {
50014 if (description == null || description.length == 0) {
50015 this.htmlContent = false;
50016 return;
50017 }if (description.toUpperCase ().indexOf ("<HTML>") == -1) {
50018 this.htmlContent = false;
50019 }this.orig = description;
50020 var st =  new java.util.StringTokenizer (description, "<");
50021 var token;
50022 var link;
50023 var startTag;
50024 var tag = null;
50025 while (st.hasMoreElements ()) {
50026 token = st.nextToken ("&>");
50027 if (token.equalsIgnoreCase ("html") || token.startsWith ("/")) {
50028 continue;
50029 }tag = null;
50030 startTag = token.indexOf ("<");
50031 if (startTag > -1) {
50032 tag = token.substring (startTag + 1);
50033 token = token.substring (0, startTag);
50034 }if (tag != null && tag.toUpperCase ().startsWith ("A HREF=")) {
50035 if (token.length > 0) {
50036 this.sb.append (token);
50037 }link = tag.substring (tag.indexOf ("\"") + 1, tag.length - 1);
50038 var label = st.nextToken ("<>");
50039 this.links.add (label + "|" + link);
50040 this.sb.append (label + "%LINK%");
50041 } else if (tag != null && tag.equalsIgnoreCase ("br")) {
50042 this.sb.append (newline);
50043 } else if (token.startsWith ("lt;")) {
50044 this.sb.append ("<" + token.substring (3));
50045 } else if (token.startsWith ("gt;")) {
50046 this.sb.append (">" + token.substring (3));
50047 } else if (token.startsWith ("amp;")) {
50048 this.sb.append ("&" + token.substring (4));
50049 } else {
50050 this.sb.append (token);
50051 }}
50052 if (removeHTML && !this.htmlContent) {
50053 this.sb =  new StringBuffer (jalview.util.ParseHtmlBodyAndLinks.LEFT_ANGLE_BRACKET_PATTERN.matcher (description).replaceAll ("&lt;"));
50054 }}, "~S,~B,~S");
50055 Clazz_defineMethod (c$, "getNonHtmlContent", 
50056 function () {
50057 return this.isHtmlContent () ? this.sb.toString () : this.orig;
50058 });
50059 c$.LEFT_ANGLE_BRACKET_PATTERN = c$.prototype.LEFT_ANGLE_BRACKET_PATTERN = java.util.regex.Pattern.compile ("<");
50060 });
50061 Clazz_declarePackage ("jalview.appletgui");
50062 Clazz_load (["awt2swing.Panel", "jalview.renderer.AwtRenderPanelI", "java.awt.event.ActionListener", "$.AdjustmentListener", "$.MouseListener", "$.MouseMotionListener", "java.awt.Color"], "jalview.appletgui.AnnotationPanel", ["awt2swing.MenuItem", "$.PopupMenu", "$.Util", "jalview.appletgui.EditNameDialog", "$.UserDefinedColours", "jalview.datamodel.Annotation", "jalview.renderer.AnnotationRenderer", "jalview.util.MessageManager", "$.Platform", "java.awt.Dimension", "java.lang.StringBuffer"], function () {
50063 c$ = Clazz_decorateAsClass (function () {
50064 this.av = null;
50065 this.ap = null;
50066 this.activeRow = -1;
50067 this.HELIX = "Helix";
50068 this.SHEET = "Sheet";
50069 this.STEM = "RNA Helix";
50070 this.LABEL = "Label";
50071 this.REMOVE = "Remove Annotation";
50072 this.COLOUR = "Colour";
50073 this.HELIX_COLOUR = null;
50074 this.SHEET_COLOUR = null;
50075 this.image = null;
50076 this.gg = null;
50077 this.fm = null;
50078 this.imgWidth = 0;
50079 this.$fastPaint = false;
50080 this.graphStretch = -1;
50081 this.graphStretchY = -1;
50082 this.mouseDragging = false;
50083 this.MAC = false;
50084 this.renderer = null;
50085 this.needValidating = false;
50086 this.scrollOffset = 0;
50087 this.$bounds = null;
50088 Clazz_instantialize (this, arguments);
50089 }, jalview.appletgui, "AnnotationPanel", awt2swing.Panel, [jalview.renderer.AwtRenderPanelI, java.awt.event.AdjustmentListener, java.awt.event.ActionListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener]);
50090 Clazz_prepareFields (c$, function () {
50091 this.HELIX_COLOUR = java.awt.Color.red.darker ();
50092 this.SHEET_COLOUR = java.awt.Color.green.darker ().darker ();
50093 this.$bounds =  Clazz_newIntArray (2, 0);
50094 });
50095 Clazz_makeConstructor (c$, 
50096 function (ap) {
50097 Clazz_superConstructor (this, jalview.appletgui.AnnotationPanel, []);
50098 this.MAC = jalview.util.Platform.isAMac ();
50099 this.ap = ap;
50100 this.av = ap.av;
50101 this.setLayout (null);
50102 var height = this.adjustPanelHeight ();
50103 ap.apvscroll.setValues (0, this.getSize ().height, 0, height);
50104 this.addMouseMotionListener (this);
50105 this.addMouseListener (this);
50106 this.renderer =  new jalview.renderer.AnnotationRenderer ();
50107 }, "jalview.appletgui.AlignmentPanel");
50108 Clazz_makeConstructor (c$, 
50109 function (av) {
50110 Clazz_superConstructor (this, jalview.appletgui.AnnotationPanel, []);
50111 this.av = av;
50112 this.renderer =  new jalview.renderer.AnnotationRenderer ();
50113 }, "jalview.appletgui.AlignViewport");
50114 Clazz_overrideMethod (c$, "adjustmentValueChanged", 
50115 function (evt) {
50116 }, "java.awt.event.AdjustmentEvent");
50117 Clazz_overrideMethod (c$, "actionPerformed", 
50118 function (evt) {
50119 var aa = this.av.getAlignment ().getAlignmentAnnotation ();
50120 if (aa == null) {
50121 return;
50122 }var anot = aa[this.activeRow].annotations;
50123 if (anot.length < this.av.getColumnSelection ().getMax ()) {
50124 var temp =  new Array (this.av.getColumnSelection ().getMax () + 2);
50125 System.arraycopy (anot, 0, temp, 0, anot.length);
50126 anot = temp;
50127 aa[this.activeRow].annotations = anot;
50128 }var label = "";
50129 if (this.av.getColumnSelection () != null && this.av.getColumnSelection ().size () > 0 && anot[this.av.getColumnSelection ().getMin ()] != null) {
50130 label = anot[this.av.getColumnSelection ().getMin ()].displayCharacter;
50131 }if (evt.getActionCommand ().equals ("Remove Annotation")) {
50132 for (var i = 0; i < this.av.getColumnSelection ().size (); i++) {
50133 anot[this.av.getColumnSelection ().columnAt (i)] = null;
50134 }
50135 } else if (evt.getActionCommand ().equals ("Label")) {
50136 label = this.enterLabel (label, "Enter Label");
50137 if (label == null) {
50138 return;
50139 }if ((label.length > 0) && !aa[this.activeRow].hasText) {
50140 aa[this.activeRow].hasText = true;
50141 }for (var i = 0; i < this.av.getColumnSelection ().size (); i++) {
50142 var index = this.av.getColumnSelection ().columnAt (i);
50143 if (!this.av.getColumnSelection ().isVisible (index)) {
50144 continue;
50145 }if (anot[index] == null) {
50146 anot[index] =  new jalview.datamodel.Annotation (label, "", ' ', 0);
50147 }anot[index].displayCharacter = label;
50148 }
50149 } else if (evt.getActionCommand ().equals ("Colour")) {
50150 var udc =  new jalview.appletgui.UserDefinedColours (this, java.awt.Color.black, this.ap.alignFrame);
50151 var col = udc.getColor ();
50152 for (var i = 0; i < this.av.getColumnSelection ().size (); i++) {
50153 var index = this.av.getColumnSelection ().columnAt (i);
50154 if (!this.av.getColumnSelection ().isVisible (index)) {
50155 continue;
50156 }if (anot[index] == null) {
50157 anot[index] =  new jalview.datamodel.Annotation ("", "", ' ', 0);
50158 }anot[index].colour = col;
50159 }
50160 } else {
50161 var type = String.fromCharCode (0);
50162 var symbol = "\u03B1";
50163 if (evt.getActionCommand ().equals ("Helix")) {
50164 type = 'H';
50165 } else if (evt.getActionCommand ().equals ("Sheet")) {
50166 type = 'E';
50167 symbol = "\u03B2";
50168 } else if (evt.getActionCommand ().equals ("RNA Helix")) {
50169 type = 'S';
50170 symbol = "\u03C3";
50171 }if (!aa[this.activeRow].hasIcons) {
50172 aa[this.activeRow].hasIcons = true;
50173 }label = this.enterLabel (symbol, "Enter Label");
50174 if (label == null) {
50175 return;
50176 }if ((label.length > 0) && !aa[this.activeRow].hasText) {
50177 aa[this.activeRow].hasText = true;
50178 if (evt.getActionCommand ().equals ("RNA Helix")) {
50179 aa[this.activeRow].showAllColLabels = true;
50180 }}for (var i = 0; i < this.av.getColumnSelection ().size (); i++) {
50181 var index = this.av.getColumnSelection ().columnAt (i);
50182 if (!this.av.getColumnSelection ().isVisible (index)) {
50183 continue;
50184 }if (anot[index] == null) {
50185 anot[index] =  new jalview.datamodel.Annotation (label, "", type, 0);
50186 }anot[index].secondaryStructure = type != 'S' ? type : label.length == 0 ? ' ' : label.charAt (0);
50187 anot[index].displayCharacter = label;
50188 }
50189 }this.av.getAlignment ().validateAnnotation (aa[this.activeRow]);
50190 this.ap.alignmentChanged ();
50191 this.adjustPanelHeight ();
50192 this.repaint ();
50193 return;
50194 }, "java.awt.event.ActionEvent");
50195 Clazz_defineMethod (c$, "enterLabel", 
50196 function (text, label) {
50197 var dialog =  new jalview.appletgui.EditNameDialog (text, null, label, null, this.ap.alignFrame, "Enter Label", 400, 200, true);
50198 if (dialog.accept) {
50199 return dialog.getName ();
50200 } else {
50201 return null;
50202 }}, "~S,~S");
50203 Clazz_overrideMethod (c$, "mousePressed", 
50204 function (evt) {
50205 var aa = this.av.getAlignment ().getAlignmentAnnotation ();
50206 if (aa == null) {
50207 return;
50208 }var height = -this.scrollOffset;
50209 this.activeRow = -1;
50210 for (var i = 0; i < aa.length; i++) {
50211 if (aa[i].visible) {
50212 height += aa[i].height;
50213 }if (evt.getY () < height) {
50214 if (aa[i].editable) {
50215 this.activeRow = i;
50216 } else if (aa[i].graph > 0) {
50217 this.graphStretch = i;
50218 this.graphStretchY = evt.getY ();
50219 }break;
50220 }}
50221 if ((evt.getModifiers () & 4) == 4 && this.activeRow != -1) {
50222 if (this.av.getColumnSelection () == null) {
50223 return;
50224 }var pop =  new awt2swing.PopupMenu (jalview.util.MessageManager.getString ("label.structure_type"));
50225 var item;
50226 if (this.av.getAlignment ().isNucleotide () == true) {
50227 item =  new awt2swing.MenuItem ("RNA Helix");
50228 item.addActionListener (this);
50229 pop.add (item);
50230 } else {
50231 item =  new awt2swing.MenuItem ("Helix");
50232 item.addActionListener (this);
50233 pop.add (item);
50234 item =  new awt2swing.MenuItem ("Sheet");
50235 item.addActionListener (this);
50236 pop.add (item);
50237 }item =  new awt2swing.MenuItem ("Label");
50238 item.addActionListener (this);
50239 pop.add (item);
50240 item =  new awt2swing.MenuItem ("Colour");
50241 item.addActionListener (this);
50242 pop.add (item);
50243 item =  new awt2swing.MenuItem ("Remove Annotation");
50244 item.addActionListener (this);
50245 pop.add (item);
50246 this.ap.alignFrame.add (pop);
50247 pop.show (this, evt.getX (), evt.getY ());
50248 return;
50249 }this.ap.scalePanel.mousePressed (evt);
50250 }, "java.awt.event.MouseEvent");
50251 Clazz_overrideMethod (c$, "mouseReleased", 
50252 function (evt) {
50253 this.graphStretch = -1;
50254 this.graphStretchY = -1;
50255 this.mouseDragging = false;
50256 if (this.needValidating) {
50257 this.ap.validate ();
50258 this.needValidating = false;
50259 }this.ap.scalePanel.mouseReleased (evt);
50260 }, "java.awt.event.MouseEvent");
50261 Clazz_overrideMethod (c$, "mouseClicked", 
50262 function (evt) {
50263 }, "java.awt.event.MouseEvent");
50264 Clazz_overrideMethod (c$, "mouseDragged", 
50265 function (evt) {
50266 if (this.graphStretch > -1) {
50267 this.av.getAlignment ().getAlignmentAnnotation ()[this.graphStretch].graphHeight += this.graphStretchY - evt.getY ();
50268 if (this.av.getAlignment ().getAlignmentAnnotation ()[this.graphStretch].graphHeight < 0) {
50269 this.av.getAlignment ().getAlignmentAnnotation ()[this.graphStretch].graphHeight = 0;
50270 }this.graphStretchY = evt.getY ();
50271 this.av.calcPanelHeight ();
50272 this.needValidating = true;
50273 this.ap.paintAlignment (true);
50274 } else {
50275 this.ap.scalePanel.mouseDragged (evt);
50276 }}, "java.awt.event.MouseEvent");
50277 Clazz_overrideMethod (c$, "mouseMoved", 
50278 function (evt) {
50279 var aa = this.av.getAlignment ().getAlignmentAnnotation ();
50280 if (aa == null) {
50281 return;
50282 }var row = -1;
50283 var height = -this.scrollOffset;
50284 for (var i = 0; i < aa.length; i++) {
50285 if (aa[i].visible) {
50286 height += aa[i].height;
50287 }if (evt.getY () < height) {
50288 row = i;
50289 break;
50290 }}
50291 var res = Clazz_doubleToInt (evt.getX () / this.av.getCharWidth ()) + this.av.getStartRes ();
50292 if (this.av.hasHiddenColumns ()) {
50293 res = this.av.getColumnSelection ().adjustForHiddenColumns (res);
50294 }if (row > -1 && res < aa[row].annotations.length && aa[row].annotations[res] != null) {
50295 var text =  new StringBuffer ("Sequence position " + (res + 1));
50296 if (aa[row].annotations[res].description != null) {
50297 text.append ("  " + aa[row].annotations[res].description);
50298 }this.ap.alignFrame.setStatus (text.toString ());
50299 }}, "java.awt.event.MouseEvent");
50300 Clazz_overrideMethod (c$, "mouseEntered", 
50301 function (evt) {
50302 this.ap.scalePanel.mouseEntered (evt);
50303 }, "java.awt.event.MouseEvent");
50304 Clazz_overrideMethod (c$, "mouseExited", 
50305 function (evt) {
50306 this.ap.scalePanel.mouseExited (evt);
50307 }, "java.awt.event.MouseEvent");
50308 Clazz_defineMethod (c$, "adjustPanelHeight", 
50309 function () {
50310 return this.adjustPanelHeight (true);
50311 });
50312 Clazz_defineMethod (c$, "adjustPanelHeight", 
50313 function (repaint) {
50314 var height = this.av.calcPanelHeight ();
50315 this.setSize ( new java.awt.Dimension (this.getSize ().width, height));
50316 if (repaint) {
50317 this.repaint ();
50318 }return height;
50319 }, "~B");
50320 Clazz_defineMethod (c$, "addEditableColumn", 
50321 function (i) {
50322 if (this.activeRow == -1) {
50323 var aa = this.av.getAlignment ().getAlignmentAnnotation ();
50324 if (aa == null) {
50325 return;
50326 }for (var j = 0; j < aa.length; j++) {
50327 if (aa[j].editable) {
50328 this.activeRow = j;
50329 break;
50330 }}
50331 }}, "~N");
50332 Clazz_overrideMethod (c$, "paintComponent", 
50333 function (g) {
50334 if (this.av.getWrapAlignment () || !this.av.isShowAnnotation ()) return;
50335 var d = this.getSize ();
50336 this.imgWidth = d.width;
50337 if (this.imgWidth < 1 || d.height < 1) {
50338 return;
50339 }if (this.image == null || this.imgWidth != this.image.getWidth (this) || d.height != this.image.getHeight (this)) {
50340 this.image = this.createImage (this.imgWidth, d.height);
50341 this.gg = this.image.getGraphics ();
50342 this.gg.setFont (this.av.getFont ());
50343 this.fm = this.gg.getFontMetrics ();
50344 this.$fastPaint = false;
50345 }if (this.$fastPaint) {
50346 g.drawImage (this.image, 0, 0, this);
50347 this.$fastPaint = false;
50348 return;
50349 }this.gg.setColor (java.awt.Color.white);
50350 this.gg.fillRect (0, 0, this.getSize ().width, this.getSize ().height);
50351 this.drawComponent (this.gg, this.av.startRes, this.av.endRes + 1);
50352 g.drawImage (this.image, 0, 0, this);
50353 }, "java.awt.Graphics");
50354 Clazz_defineMethod (c$, "fastPaint", 
50355 function (horizontal) {
50356 if (horizontal == 0 || this.av.getAlignment ().getAlignmentAnnotation () == null || this.av.getAlignment ().getAlignmentAnnotation ().length < 1) {
50357 this.repaint ();
50358 return;
50359 }this.gg.copyArea (0, 0, this.imgWidth, this.getSize ().height, -horizontal * this.av.getCharWidth (), 0);
50360 var sr = this.av.startRes;
50361 var er = this.av.endRes + 1;
50362 var transX = 0;
50363 if (horizontal > 0) {
50364 transX = (er - sr - horizontal) * this.av.getCharWidth ();
50365 sr = er - horizontal;
50366 } else if (horizontal < 0) {
50367 er = sr - horizontal;
50368 }this.gg.translate (transX, 0);
50369 this.drawComponent (this.gg, sr, er);
50370 this.gg.translate (-transX, 0);
50371 this.$fastPaint = true;
50372 this.repaint ();
50373 }, "~N");
50374 Clazz_defineMethod (c$, "drawComponent", 
50375 function (g, startRes, endRes) {
50376 var ofont = this.av.getFont ();
50377 g.setFont (ofont);
50378 g.setColor (java.awt.Color.white);
50379 g.fillRect (0, 0, (endRes - startRes) * this.av.getCharWidth (), this.getSize ().height);
50380 if (this.fm == null) {
50381 this.fm = g.getFontMetrics ();
50382 }if ((this.av.getAlignment ().getAlignmentAnnotation () == null) || (this.av.getAlignment ().getAlignmentAnnotation ().length < 1)) {
50383 g.setColor (java.awt.Color.white);
50384 g.fillRect (0, 0, this.getSize ().width, this.getSize ().height);
50385 g.setColor (java.awt.Color.black);
50386 if (this.av.validCharWidth) {
50387 awt2swing.Util.drawString (g, jalview.util.MessageManager.getString ("label.alignment_has_no_annotations"), 20, 15);
50388 }return;
50389 }g.translate (0, -this.scrollOffset);
50390 this.renderer.drawComponent (this, this.av, g, this.activeRow, startRes, endRes);
50391 g.translate (0, +this.scrollOffset);
50392 }, "java.awt.Graphics,~N,~N");
50393 Clazz_defineMethod (c$, "setScrollOffset", 
50394 function (value, repaint) {
50395 this.scrollOffset = value;
50396 if (repaint) {
50397 this.repaint ();
50398 }}, "~N,~B");
50399 Clazz_defineMethod (c$, "getFontMetrics", 
50400 function () {
50401 return this.fm;
50402 });
50403 Clazz_overrideMethod (c$, "getFadedImage", 
50404 function () {
50405 return this.image;
50406 });
50407 Clazz_overrideMethod (c$, "getFadedImageWidth", 
50408 function () {
50409 return this.imgWidth;
50410 });
50411 Clazz_overrideMethod (c$, "getVisibleVRange", 
50412 function () {
50413 if (this.ap != null && this.ap.alabels != null) {
50414 var sOffset = -this.ap.alabels.scrollOffset;
50415 var visHeight = sOffset + this.ap.annotationPanelHolder.getHeight ();
50416 this.$bounds[0] = sOffset;
50417 this.$bounds[1] = visHeight;
50418 return this.$bounds;
50419 } else {
50420 return null;
50421 }});
50422 Clazz_defineStatics (c$,
50423 "GRAPH_HEIGHT", 40);
50424 });
50425 Clazz_declarePackage ("jalview.renderer");
50426 Clazz_load (["java.awt.image.ImageObserver"], "jalview.renderer.AwtRenderPanelI", null, function () {
50427 Clazz_declareInterface (jalview.renderer, "AwtRenderPanelI", java.awt.image.ImageObserver);
50428 });
50429 Clazz_declarePackage ("jalview.appletgui");
50430 Clazz_load (["awt2swing.Panel", "java.awt.event.ActionListener", "$.AdjustmentListener", "$.FocusListener", "awt2swing.Button", "$.Label", "$.Scrollbar", "$.TextField", "java.awt.GridLayout", "java.util.Vector"], "jalview.appletgui.UserDefinedColours", ["awt2swing.Frame", "jalview.appletgui.AnnotationColourChooser", "$.FeatureColourChooser", "$.FeatureRenderer", "$.FeatureSettings", "jalview.bin.JalviewLite", "jalview.schemes.ResidueProperties", "$.UserColourScheme", "jalview.util.MessageManager", "java.awt.Color", "$.Dialog", "$.Font", "$.Rectangle", "java.awt.event.MouseAdapter", "java.lang.Error"], function () {
50431 c$ = Clazz_decorateAsClass (function () {
50432 this.ap = null;
50433 this.seqGroup = null;
50434 this.selectedButton = null;
50435 this.oldColours = null;
50436 this.oldColourScheme = null;
50437 this.frame = null;
50438 this.jmol = null;
50439 this.dialog = null;
50440 this.caller = null;
50441 this.originalLabel = null;
50442 this.originalColour = null;
50443 this.R = 0;
50444 this.G = 0;
50445 this.B = 0;
50446 this.buttonPanel = null;
50447 this.gridLayout = null;
50448 this.okcancelPanel = null;
50449 this.okButton = null;
50450 this.applyButton = null;
50451 this.cancelButton = null;
50452 this.rScroller = null;
50453 this.label1 = null;
50454 this.rText = null;
50455 this.label4 = null;
50456 this.gScroller = null;
50457 this.gText = null;
50458 this.label5 = null;
50459 this.bScroller = null;
50460 this.bText = null;
50461 this.target = null;
50462 Clazz_instantialize (this, arguments);
50463 }, jalview.appletgui, "UserDefinedColours", awt2swing.Panel, [java.awt.event.ActionListener, java.awt.event.AdjustmentListener, java.awt.event.FocusListener]);
50464 Clazz_prepareFields (c$, function () {
50465 this.oldColours =  new java.util.Vector ();
50466 this.buttonPanel =  new awt2swing.Panel ();
50467 this.gridLayout =  new java.awt.GridLayout ();
50468 this.okcancelPanel =  new awt2swing.Panel ();
50469 this.okButton =  new awt2swing.Button ();
50470 this.applyButton =  new awt2swing.Button ();
50471 this.cancelButton =  new awt2swing.Button ();
50472 this.rScroller =  new awt2swing.Scrollbar ();
50473 this.label1 =  new awt2swing.Label ();
50474 this.rText =  new awt2swing.TextField ();
50475 this.label4 =  new awt2swing.Label ();
50476 this.gScroller =  new awt2swing.Scrollbar ();
50477 this.gText =  new awt2swing.TextField ();
50478 this.label5 =  new awt2swing.Label ();
50479 this.bScroller =  new awt2swing.Scrollbar ();
50480 this.bText =  new awt2swing.TextField ();
50481 this.target =  new awt2swing.Panel ();
50482 });
50483 Clazz_defineMethod (c$, "loadDefaultColours", 
50484 function () {
50485 return null;
50486 });
50487 Clazz_makeConstructor (c$, 
50488 function (ap, sg) {
50489 Clazz_superConstructor (this, jalview.appletgui.UserDefinedColours, []);
50490 this.ap = ap;
50491 this.seqGroup = sg;
50492 if (this.seqGroup != null) {
50493 this.oldColourScheme = this.seqGroup.cs;
50494 } else {
50495 this.oldColourScheme = ap.av.getGlobalColourScheme ();
50496 }this.init ();
50497 }, "jalview.appletgui.AlignmentPanel,jalview.datamodel.SequenceGroup");
50498 Clazz_makeConstructor (c$, 
50499 function (jmol) {
50500 Clazz_superConstructor (this, jalview.appletgui.UserDefinedColours, []);
50501 this.jmol = jmol;
50502 this.init ();
50503 }, "jalview.appletgui.AppletJmol");
50504 Clazz_makeConstructor (c$, 
50505 function (fr, alignframe) {
50506 Clazz_superConstructor (this, jalview.appletgui.UserDefinedColours, []);
50507 this.caller = fr;
50508 this.originalColour = fr.colourPanel.getBackground ();
50509 this.originalLabel = "Feature Colour";
50510 this.setForDialog ("Select Feature Colour", alignframe);
50511 this.setTargetColour (fr.colourPanel.getBackground ());
50512 this.dialog.setVisible (true);
50513 }, "jalview.appletgui.FeatureRenderer,awt2swing.Frame");
50514 Clazz_makeConstructor (c$, 
50515 function (caller, col1, alignframe) {
50516 this.construct (caller, col1, alignframe, "Select Colour");
50517 }, "java.awt.Component,java.awt.Color,awt2swing.Frame");
50518 Clazz_makeConstructor (c$, 
50519 function (caller, col1, alignframe, title) {
50520 Clazz_superConstructor (this, jalview.appletgui.UserDefinedColours, []);
50521 this.caller = caller;
50522 this.originalColour = col1;
50523 this.originalLabel = title;
50524 this.setForDialog (title, alignframe);
50525 this.setTargetColour (col1);
50526 this.dialog.setVisible (true);
50527 }, "java.awt.Component,java.awt.Color,awt2swing.Frame,~S");
50528 Clazz_makeConstructor (c$, 
50529 function (caller, label, colour) {
50530 this.construct (caller, label, colour, colour);
50531 }, "~O,~S,java.awt.Color");
50532 Clazz_makeConstructor (c$, 
50533 function (me, type, graduatedColor) {
50534 this.construct (me, type, graduatedColor, graduatedColor.getMaxColor ());
50535 }, "jalview.appletgui.FeatureSettings,~S,jalview.schemes.GraduatedColor");
50536 Clazz_makeConstructor (c$, 
50537  function (caller, label, ocolour, colour) {
50538 Clazz_superConstructor (this, jalview.appletgui.UserDefinedColours, []);
50539 this.caller = caller;
50540 this.originalColour = ocolour;
50541 this.originalLabel = label;
50542 this.init ();
50543 this.remove (this.buttonPanel);
50544 this.setTargetColour (colour);
50545 this.okcancelPanel.setBounds ( new java.awt.Rectangle (0, 113, 400, 35));
50546 this.frame.setTitle (jalview.util.MessageManager.getString ("label.user_defined_colours") + " - " + label);
50547 this.frame.setSize (420, 200);
50548 }, "~O,~S,~O,java.awt.Color");
50549 Clazz_defineMethod (c$, "setForDialog", 
50550 function (title, alignframe) {
50551 this.init ();
50552 this.frame.setVisible (false);
50553 this.remove (this.buttonPanel);
50554 if (Clazz_instanceOf (alignframe, awt2swing.Frame)) {
50555 this.dialog =  new java.awt.Dialog (alignframe, title, true);
50556 } else {
50557 throw  new Error (jalview.util.MessageManager.getString ("label.error_unsupported_owwner_user_colour_scheme"));
50558 }this.dialog.add (this);
50559 this.setSize (400, 123);
50560 this.okcancelPanel.setBounds ( new java.awt.Rectangle (0, 123, 400, 35));
50561 var height = 160 + alignframe.getInsets ().top + this.getInsets ().bottom;
50562 var width = 400;
50563 this.dialog.setBounds (alignframe.getBounds ().x + Clazz_doubleToInt ((alignframe.getSize ().width - width) / 2), alignframe.getBounds ().y + Clazz_doubleToInt ((alignframe.getSize ().height - height) / 2), width, height);
50564 }, "~S,java.awt.Container");
50565 Clazz_overrideMethod (c$, "actionPerformed", 
50566 function (evt) {
50567 var source = evt.getSource ();
50568 if (source === this.okButton) {
50569 this.okButton_actionPerformed ();
50570 } else if (source === this.applyButton) {
50571 this.applyButton_actionPerformed ();
50572 } else if (source === this.cancelButton) {
50573 this.cancelButton_actionPerformed ();
50574 } else if (source === this.rText) {
50575 this.rText_actionPerformed ();
50576 } else if (source === this.gText) {
50577 this.gText_actionPerformed ();
50578 } else if (source === this.bText) {
50579 this.bText_actionPerformed ();
50580 }}, "java.awt.event.ActionEvent");
50581 Clazz_overrideMethod (c$, "adjustmentValueChanged", 
50582 function (evt) {
50583 if (evt.getSource () === this.rScroller) {
50584 this.rScroller_adjustmentValueChanged ();
50585 } else if (evt.getSource () === this.gScroller) {
50586 this.gScroller_adjustmentValueChanged ();
50587 } else if (evt.getSource () === this.bScroller) {
50588 this.bScroller_adjustmentValueChanged ();
50589 }}, "java.awt.event.AdjustmentEvent");
50590 Clazz_defineMethod (c$, "init", 
50591 function () {
50592 try {
50593 this.jbInit ();
50594 } catch (e) {
50595 if (Clazz_exceptionOf (e, Exception)) {
50596 e.printStackTrace ();
50597 } else {
50598 throw e;
50599 }
50600 }
50601 this.frame =  new awt2swing.Frame ();
50602 this.frame.add (this);
50603 jalview.bin.JalviewLite.addFrame (this.frame, jalview.util.MessageManager.getString ("label.user_defined_colours"), 420, 345);
50604 if (this.seqGroup != null) {
50605 this.frame.setTitle (this.frame.getTitle () + " (" + this.seqGroup.getName () + ")");
50606 }for (var i = 0; i < 20; i++) {
50607 this.makeButton (jalview.schemes.ResidueProperties.aa2Triplet.get (jalview.schemes.ResidueProperties.aa[i]) + "", jalview.schemes.ResidueProperties.aa[i]);
50608 }
50609 this.makeButton ("B", "B");
50610 this.makeButton ("Z", "Z");
50611 this.makeButton ("X", "X");
50612 this.makeButton ("Gap", "'.','-',' '");
50613 this.validate ();
50614 });
50615 Clazz_defineMethod (c$, "rText_actionPerformed", 
50616 function () {
50617 try {
50618 var i = Integer.parseInt (this.rText.getText ());
50619 this.rScroller.setValue (i);
50620 this.rScroller_adjustmentValueChanged ();
50621 } catch (ex) {
50622 if (Clazz_exceptionOf (ex, NumberFormatException)) {
50623 } else {
50624 throw ex;
50625 }
50626 }
50627 });
50628 Clazz_defineMethod (c$, "gText_actionPerformed", 
50629 function () {
50630 try {
50631 var i = Integer.parseInt (this.gText.getText ());
50632 this.gScroller.setValue (i);
50633 this.gScroller_adjustmentValueChanged ();
50634 } catch (ex) {
50635 if (Clazz_exceptionOf (ex, NumberFormatException)) {
50636 } else {
50637 throw ex;
50638 }
50639 }
50640 });
50641 Clazz_defineMethod (c$, "bText_actionPerformed", 
50642 function () {
50643 try {
50644 var i = Integer.parseInt (this.bText.getText ());
50645 this.bScroller.setValue (i);
50646 this.bScroller_adjustmentValueChanged ();
50647 } catch (ex) {
50648 if (Clazz_exceptionOf (ex, NumberFormatException)) {
50649 } else {
50650 throw ex;
50651 }
50652 }
50653 });
50654 Clazz_defineMethod (c$, "rScroller_adjustmentValueChanged", 
50655 function () {
50656 this.R = this.rScroller.getValue ();
50657 this.rText.setText (this.R + "");
50658 this.colourChanged ();
50659 });
50660 Clazz_defineMethod (c$, "gScroller_adjustmentValueChanged", 
50661 function () {
50662 this.G = this.gScroller.getValue ();
50663 this.gText.setText (this.G + "");
50664 this.colourChanged ();
50665 });
50666 Clazz_defineMethod (c$, "bScroller_adjustmentValueChanged", 
50667 function () {
50668 this.B = this.bScroller.getValue ();
50669 this.bText.setText (this.B + "");
50670 this.colourChanged ();
50671 });
50672 Clazz_defineMethod (c$, "colourChanged", 
50673 function () {
50674 var col =  new java.awt.Color (this.R, this.G, this.B);
50675 this.target.setBackground (col);
50676 this.target.repaint ();
50677 if (this.selectedButton != null) {
50678 this.selectedButton.setBackground (col);
50679 this.selectedButton.repaint ();
50680 }});
50681 Clazz_defineMethod (c$, "setTargetColour", 
50682 function (col) {
50683 this.R = col.getRed ();
50684 this.G = col.getGreen ();
50685 this.B = col.getBlue ();
50686 this.rScroller.setValue (this.R);
50687 this.gScroller.setValue (this.G);
50688 this.bScroller.setValue (this.B);
50689 this.rText.setText (this.R + "");
50690 this.gText.setText (this.G + "");
50691 this.bText.setText (this.B + "");
50692 this.colourChanged ();
50693 }, "java.awt.Color");
50694 Clazz_defineMethod (c$, "colourButtonPressed", 
50695 function (e) {
50696 this.selectedButton = e.getSource ();
50697 this.setTargetColour (this.selectedButton.getBackground ());
50698 }, "java.awt.event.MouseEvent");
50699 Clazz_defineMethod (c$, "makeButton", 
50700 function (label, aa) {
50701 var button =  new awt2swing.Button ();
50702 var col = java.awt.Color.white;
50703 if (this.oldColourScheme != null) {
50704 try {
50705 col = this.oldColourScheme.findColourSeq (aa.charAt (0), -1, null);
50706 } catch (ex) {
50707 if (Clazz_exceptionOf (ex, Exception)) {
50708 } else {
50709 throw ex;
50710 }
50711 }
50712 }button.setBackground (col);
50713 this.oldColours.addElement (col);
50714 button.setLabel (label);
50715 button.setForeground (col.darker ().darker ().darker ());
50716 button.setFont ( new java.awt.Font ("Verdana", 1, 10));
50717 button.addMouseListener (((Clazz_isClassDefined ("jalview.appletgui.UserDefinedColours$1") ? 0 : jalview.appletgui.UserDefinedColours.$UserDefinedColours$1$ ()), Clazz_innerTypeInstance (jalview.appletgui.UserDefinedColours$1, this, null)));
50718 this.buttonPanel.add (button, null);
50719 }, "~S,~S");
50720 Clazz_defineMethod (c$, "okButton_actionPerformed", 
50721 function () {
50722 this.applyButton_actionPerformed ();
50723 if (this.dialog != null) {
50724 this.dialog.setVisible (false);
50725 }this.frame.setVisible (false);
50726 });
50727 Clazz_defineMethod (c$, "getColor", 
50728 function () {
50729 return  new java.awt.Color (this.R, this.G, this.B);
50730 });
50731 Clazz_defineMethod (c$, "applyButton_actionPerformed", 
50732 function () {
50733 if (this.caller != null) {
50734 if (Clazz_instanceOf (this.caller, jalview.appletgui.FeatureSettings)) {
50735 (this.caller).setUserColour (this.originalLabel, this.getColor ());
50736 } else if (Clazz_instanceOf (this.caller, jalview.appletgui.AnnotationColourChooser)) {
50737 if (this.originalLabel.equals ("Min Colour")) {
50738 (this.caller).minColour_actionPerformed (this.getColor ());
50739 } else {
50740 (this.caller).maxColour_actionPerformed (this.getColor ());
50741 }} else if (Clazz_instanceOf (this.caller, jalview.appletgui.FeatureRenderer)) {
50742 (this.caller).colourPanel.updateColor (this.getColor ());
50743 } else if (Clazz_instanceOf (this.caller, jalview.appletgui.FeatureColourChooser)) {
50744 if (this.originalLabel.indexOf ("inimum") > -1) {
50745 (this.caller).minColour_actionPerformed (this.getColor ());
50746 } else {
50747 (this.caller).maxColour_actionPerformed (this.getColor ());
50748 }}return;
50749 }var newColours =  new Array (24);
50750 for (var i = 0; i < 24; i++) {
50751 var button = this.buttonPanel.getComponent (i);
50752 newColours[i] = button.getBackground ();
50753 }
50754 var ucs =  new jalview.schemes.UserColourScheme (newColours);
50755 if (this.ap != null) {
50756 ucs.setThreshold (0, this.ap.av.isIgnoreGapsConsensus ());
50757 }if (this.ap != null) {
50758 if (this.seqGroup != null) {
50759 this.seqGroup.cs = ucs;
50760 } else {
50761 this.ap.av.setGlobalColourScheme (ucs);
50762 }this.ap.seqPanel.seqCanvas.img = null;
50763 this.ap.paintAlignment (true);
50764 } else if (this.jmol != null) {
50765 this.jmol.setJalviewColourScheme (ucs);
50766 }});
50767 Clazz_defineMethod (c$, "cancelButton_actionPerformed", 
50768 function () {
50769 if (this.caller != null) {
50770 if (Clazz_instanceOf (this.caller, jalview.appletgui.FeatureSettings)) {
50771 (this.caller).setUserColour (this.originalLabel, this.originalColour);
50772 } else if (Clazz_instanceOf (this.caller, jalview.appletgui.AnnotationColourChooser)) {
50773 if (this.originalLabel.equals ("Min Colour")) {
50774 (this.caller).minColour_actionPerformed (this.originalColour);
50775 } else {
50776 (this.caller).maxColour_actionPerformed (this.originalColour);
50777 }} else if (Clazz_instanceOf (this.caller, jalview.appletgui.FeatureRenderer)) {
50778 (this.caller).colourPanel.updateColor (this.originalColour);
50779 } else if (Clazz_instanceOf (this.caller, jalview.appletgui.FeatureColourChooser)) {
50780 if (this.originalLabel.indexOf ("inimum") > -1) {
50781 (this.caller).minColour_actionPerformed (this.originalColour);
50782 } else {
50783 (this.caller).maxColour_actionPerformed (this.originalColour);
50784 }}if (this.dialog != null) {
50785 this.dialog.setVisible (false);
50786 }this.frame.setVisible (false);
50787 return;
50788 }var newColours =  new Array (24);
50789 for (var i = 0; i < 24; i++) {
50790 newColours[i] = this.oldColours.elementAt (i);
50791 this.buttonPanel.getComponent (i).setBackground (newColours[i]);
50792 }
50793 var ucs =  new jalview.schemes.UserColourScheme (newColours);
50794 if (this.ap != null) {
50795 if (this.seqGroup != null) {
50796 this.seqGroup.cs = ucs;
50797 } else {
50798 this.ap.av.setGlobalColourScheme (ucs);
50799 }this.ap.paintAlignment (true);
50800 } else if (this.jmol != null) {
50801 this.jmol.setJalviewColourScheme (ucs);
50802 }this.frame.setVisible (false);
50803 });
50804 Clazz_defineMethod (c$, "jbInit", 
50805  function () {
50806 this.setLayout (null);
50807 this.buttonPanel.setLayout (this.gridLayout);
50808 this.gridLayout.setColumns (6);
50809 this.gridLayout.setRows (4);
50810 this.okButton.setFont ( new java.awt.Font ("Verdana", 0, 11));
50811 this.okButton.setLabel (jalview.util.MessageManager.getString ("action.ok"));
50812 this.okButton.addActionListener (this);
50813 this.applyButton.setFont ( new java.awt.Font ("Verdana", 0, 11));
50814 this.applyButton.setLabel (jalview.util.MessageManager.getString ("action.apply"));
50815 this.applyButton.addActionListener (this);
50816 this.cancelButton.setFont ( new java.awt.Font ("Verdana", 0, 11));
50817 this.cancelButton.setLabel (jalview.util.MessageManager.getString ("action.cancel"));
50818 this.cancelButton.addActionListener (this);
50819 this.setBackground ( new java.awt.Color (212, 208, 223));
50820 this.okcancelPanel.setBounds ( new java.awt.Rectangle (0, 265, 400, 35));
50821 this.buttonPanel.setBounds ( new java.awt.Rectangle (0, 123, 400, 142));
50822 this.rScroller.setMaximum (256);
50823 this.rScroller.setMinimum (0);
50824 this.rScroller.setOrientation (0);
50825 this.rScroller.setUnitIncrement (1);
50826 this.rScroller.setVisibleAmount (1);
50827 this.rScroller.setBounds ( new java.awt.Rectangle (36, 27, 119, 19));
50828 this.rScroller.addAdjustmentListener (this);
50829 this.label1.setAlignment (4);
50830 this.label1.setText ("R");
50831 this.label1.setBounds ( new java.awt.Rectangle (19, 30, 16, 15));
50832 this.rText.setFont ( new java.awt.Font ("Dialog", 0, 10));
50833 this.rText.setText ("0        ");
50834 this.rText.setBounds ( new java.awt.Rectangle (156, 27, 53, 19));
50835 this.rText.addActionListener (this);
50836 this.rText.addFocusListener (this);
50837 this.label4.setAlignment (4);
50838 this.label4.setText ("G");
50839 this.label4.setBounds ( new java.awt.Rectangle (15, 56, 20, 15));
50840 this.gScroller.setMaximum (256);
50841 this.gScroller.setMinimum (0);
50842 this.gScroller.setOrientation (0);
50843 this.gScroller.setUnitIncrement (1);
50844 this.gScroller.setVisibleAmount (1);
50845 this.gScroller.setBounds ( new java.awt.Rectangle (35, 52, 120, 20));
50846 this.gScroller.addAdjustmentListener (this);
50847 this.gText.setFont ( new java.awt.Font ("Dialog", 0, 10));
50848 this.gText.setText ("0        ");
50849 this.gText.setBounds ( new java.awt.Rectangle (156, 52, 53, 20));
50850 this.gText.addActionListener (this);
50851 this.gText.addFocusListener (this);
50852 this.label5.setAlignment (4);
50853 this.label5.setText ("B");
50854 this.label5.setBounds ( new java.awt.Rectangle (14, 82, 20, 15));
50855 this.bScroller.setMaximum (256);
50856 this.bScroller.setMinimum (0);
50857 this.bScroller.setOrientation (0);
50858 this.bScroller.setUnitIncrement (1);
50859 this.bScroller.setVisibleAmount (1);
50860 this.bScroller.setBounds ( new java.awt.Rectangle (35, 78, 120, 20));
50861 this.bScroller.addAdjustmentListener (this);
50862 this.bText.setFont ( new java.awt.Font ("Dialog", 0, 10));
50863 this.bText.setText ("0        ");
50864 this.bText.setBounds ( new java.awt.Rectangle (157, 78, 52, 20));
50865 this.bText.addActionListener (this);
50866 this.bText.addFocusListener (this);
50867 this.target.setBackground (java.awt.Color.black);
50868 this.target.setBounds ( new java.awt.Rectangle (229, 26, 134, 79));
50869 this.add (this.okcancelPanel, null);
50870 this.okcancelPanel.add (this.okButton, null);
50871 this.okcancelPanel.add (this.applyButton, null);
50872 this.okcancelPanel.add (this.cancelButton, null);
50873 this.add (this.rText);
50874 this.add (this.gText);
50875 this.add (this.bText);
50876 this.add (this.buttonPanel, null);
50877 this.add (this.target, null);
50878 this.add (this.gScroller);
50879 this.add (this.rScroller);
50880 this.add (this.bScroller);
50881 this.add (this.label5);
50882 this.add (this.label4);
50883 this.add (this.label1);
50884 });
50885 Clazz_overrideMethod (c$, "focusGained", 
50886 function (e) {
50887 }, "java.awt.event.FocusEvent");
50888 Clazz_overrideMethod (c$, "focusLost", 
50889 function (e) {
50890 var c = e.getComponent ();
50891 if (c === this.rText) {
50892 this.rText_actionPerformed ();
50893 } else {
50894 if (c === this.gText) {
50895 this.gText_actionPerformed ();
50896 } else {
50897 if (c === this.bText) {
50898 this.bText_actionPerformed ();
50899 }}}}, "java.awt.event.FocusEvent");
50900 c$.$UserDefinedColours$1$ = function () {
50901 Clazz_pu$h(self.c$);
50902 c$ = Clazz_declareAnonymous (jalview.appletgui, "UserDefinedColours$1", java.awt.event.MouseAdapter);
50903 Clazz_overrideMethod (c$, "mousePressed", 
50904 function (e) {
50905 this.b$["jalview.appletgui.UserDefinedColours"].colourButtonPressed (e);
50906 }, "java.awt.event.MouseEvent");
50907 c$ = Clazz_p0p ();
50908 };
50909 });
50910 Clazz_declarePackage ("jalview.appletgui");
50911 Clazz_load (["awt2swing.Panel", "java.awt.event.ActionListener", "$.AdjustmentListener", "$.ItemListener", "$.MouseListener", "awt2swing.Button", "$.Checkbox", "$.Choice", "$.Scrollbar", "$.TextField", "java.awt.BorderLayout", "$.FlowLayout"], "jalview.appletgui.AnnotationColourChooser", ["awt2swing.Frame", "jalview.appletgui.UserDefinedColours", "jalview.bin.JalviewLite", "jalview.datamodel.GraphLine", "jalview.schemes.AnnotationColourGradient", "$.ColourSchemeI", "jalview.util.MessageManager", "java.awt.Color", "$.Dimension", "$.Font", "java.lang.Error", "$.Float", "java.util.Hashtable", "$.Vector"], function () {
50912 c$ = Clazz_decorateAsClass (function () {
50913 this.frame = null;
50914 this.av = null;
50915 this.ap = null;
50916 this.oldcs = null;
50917 this.oldgroupColours = null;
50918 this.currentAnnotation = null;
50919 this.adjusting = false;
50920 this.annotations = null;
50921 this.minColour = null;
50922 this.maxColour = null;
50923 this.ok = null;
50924 this.cancel = null;
50925 this.defColours = null;
50926 this.jPanel1 = null;
50927 this.jPanel2 = null;
50928 this.threshold = null;
50929 this.flowLayout1 = null;
50930 this.jPanel3 = null;
50931 this.slider = null;
50932 this.thresholdValue = null;
50933 this.currentColours = null;
50934 this.borderLayout1 = null;
50935 this.thresholdIsMin = null;
50936 Clazz_instantialize (this, arguments);
50937 }, jalview.appletgui, "AnnotationColourChooser", awt2swing.Panel, [java.awt.event.ActionListener, java.awt.event.AdjustmentListener, java.awt.event.ItemListener, java.awt.event.MouseListener]);
50938 Clazz_prepareFields (c$, function () {
50939 this.annotations =  new awt2swing.Choice ();
50940 this.minColour =  new awt2swing.Button ();
50941 this.maxColour =  new awt2swing.Button ();
50942 this.ok =  new awt2swing.Button ();
50943 this.cancel =  new awt2swing.Button ();
50944 this.defColours =  new awt2swing.Button ();
50945 this.jPanel1 =  new awt2swing.Panel ();
50946 this.jPanel2 =  new awt2swing.Panel ();
50947 this.threshold =  new awt2swing.Choice ();
50948 this.flowLayout1 =  new java.awt.FlowLayout ();
50949 this.jPanel3 =  new awt2swing.Panel ();
50950 this.slider =  new awt2swing.Scrollbar (0);
50951 this.thresholdValue =  new awt2swing.TextField (20);
50952 this.currentColours =  new awt2swing.Checkbox ();
50953 this.borderLayout1 =  new java.awt.BorderLayout ();
50954 this.thresholdIsMin =  new awt2swing.Checkbox ();
50955 });
50956 Clazz_makeConstructor (c$, 
50957 function (av, ap) {
50958 Clazz_superConstructor (this, jalview.appletgui.AnnotationColourChooser, []);
50959 try {
50960 this.jbInit ();
50961 } catch (ex) {
50962 if (Clazz_exceptionOf (ex, Exception)) {
50963 } else {
50964 throw ex;
50965 }
50966 }
50967 this.oldcs = av.getGlobalColourScheme ();
50968 if (av.getAlignment ().getGroups () != null) {
50969 this.oldgroupColours =  new java.util.Hashtable ();
50970 for (var sg, $sg = ap.av.getAlignment ().getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
50971 if (sg.cs != null) {
50972 this.oldgroupColours.put (sg, sg.cs);
50973 } else {
50974 this.oldgroupColours.put (sg, "null");
50975 }}
50976 }this.av = av;
50977 this.ap = ap;
50978 this.slider.addAdjustmentListener (this);
50979 this.slider.addMouseListener (this);
50980 if (av.getAlignment ().getAlignmentAnnotation () == null) {
50981 return;
50982 }this.setDefaultMinMax ();
50983 this.adjusting = true;
50984 if (Clazz_instanceOf (this.oldcs, jalview.schemes.AnnotationColourGradient)) {
50985 var acg = this.oldcs;
50986 this.currentColours.setState (acg.isPredefinedColours () || acg.getBaseColour () != null);
50987 if (!acg.isPredefinedColours () && acg.getBaseColour () == null) {
50988 this.minColour.setBackground (acg.getMinColour ());
50989 this.maxColour.setBackground (acg.getMaxColour ());
50990 }}var list =  new java.util.Vector ();
50991 var index = 1;
50992 for (var i = 0; i < av.getAlignment ().getAlignmentAnnotation ().length; i++) {
50993 var label = av.getAlignment ().getAlignmentAnnotation ()[i].label;
50994 if (!list.contains (label)) {
50995 list.addElement (label);
50996 } else {
50997 list.addElement (label + "_" + (index++));
50998 }}
50999 for (var i = 0; i < list.size (); i++) {
51000 this.annotations.addItem (list.elementAt (i).toString ());
51001 }
51002 this.threshold.addItem (jalview.util.MessageManager.getString ("label.threshold_feature_no_thereshold"));
51003 this.threshold.addItem (jalview.util.MessageManager.getString ("label.threshold_feature_above_thereshold"));
51004 this.threshold.addItem (jalview.util.MessageManager.getString ("label.threshold_feature_below_thereshold"));
51005 if (Clazz_instanceOf (this.oldcs, jalview.schemes.AnnotationColourGradient)) {
51006 var acg = this.oldcs;
51007 this.annotations.select (acg.getAnnotation ());
51008 switch (acg.getAboveThreshold ()) {
51009 case -1:
51010 this.threshold.select (new Integer (0));
51011 break;
51012 case 1:
51013 this.threshold.select (new Integer (1));
51014 break;
51015 case 0:
51016 this.threshold.select (new Integer (1));
51017 break;
51018 default:
51019 throw  new Error (jalview.util.MessageManager.getString ("error.implementation_error_dont_know_thereshold_annotationcolourgradient"));
51020 }
51021 this.thresholdIsMin.setState (acg.thresholdIsMinMax);
51022 this.thresholdValue.setText ("" + acg.getAnnotationThreshold ());
51023 }this.adjusting = false;
51024 this.changeColour ();
51025 this.frame =  new awt2swing.Frame ();
51026 this.frame.add (this);
51027 jalview.bin.JalviewLite.addFrame (this.frame, jalview.util.MessageManager.getString ("label.colour_by_annotation"), 560, 175);
51028 this.validate ();
51029 }, "jalview.appletgui.AlignViewport,jalview.appletgui.AlignmentPanel");
51030 Clazz_defineMethod (c$, "setDefaultMinMax", 
51031  function () {
51032 this.minColour.setBackground (this.av.applet.getDefaultColourParameter ("ANNOTATIONCOLOUR_MIN", java.awt.Color.orange));
51033 this.maxColour.setBackground (this.av.applet.getDefaultColourParameter ("ANNOTATIONCOLOUR_MAX", java.awt.Color.red));
51034 });
51035 Clazz_makeConstructor (c$, 
51036 function () {
51037 Clazz_superConstructor (this, jalview.appletgui.AnnotationColourChooser, []);
51038 try {
51039 this.jbInit ();
51040 } catch (ex) {
51041 if (Clazz_exceptionOf (ex, Exception)) {
51042 ex.printStackTrace ();
51043 } else {
51044 throw ex;
51045 }
51046 }
51047 });
51048 Clazz_defineMethod (c$, "jbInit", 
51049  function () {
51050 this.minColour.setFont ( new java.awt.Font ("Verdana", 0, 11));
51051 this.minColour.setLabel (jalview.util.MessageManager.getString ("label.min_colour"));
51052 this.minColour.addActionListener (this);
51053 this.maxColour.setFont ( new java.awt.Font ("Verdana", 0, 11));
51054 this.maxColour.setLabel (jalview.util.MessageManager.getString ("label.max_colour"));
51055 this.maxColour.addActionListener (this);
51056 this.thresholdIsMin.addItemListener (this);
51057 this.ok.setLabel (jalview.util.MessageManager.getString ("action.ok"));
51058 this.ok.addActionListener (this);
51059 this.cancel.setLabel (jalview.util.MessageManager.getString ("action.cancel"));
51060 this.cancel.addActionListener (this);
51061 this.defColours.setLabel (jalview.util.MessageManager.getString ("action.set_defaults"));
51062 this.defColours.addActionListener (this);
51063 this.annotations.addItemListener (this);
51064 this.thresholdValue.addActionListener (this);
51065 this.slider.setBackground (java.awt.Color.white);
51066 this.slider.setPreferredSize ( new java.awt.Dimension (193, 21));
51067 this.slider.setEnabled (false);
51068 this.thresholdValue.setPreferredSize ( new java.awt.Dimension (79, 22));
51069 this.thresholdValue.setEnabled (false);
51070 this.thresholdValue.setColumns (5);
51071 this.currentColours.setFont ( new java.awt.Font ("Verdana", 0, 11));
51072 this.currentColours.setLabel (jalview.util.MessageManager.getString ("label.use_original_colours"));
51073 this.currentColours.addItemListener (this);
51074 this.thresholdIsMin.setBackground (java.awt.Color.white);
51075 this.thresholdIsMin.setLabel (jalview.util.MessageManager.getString ("label.threshold_minmax"));
51076 this.setLayout (this.borderLayout1);
51077 this.jPanel1.setBackground (java.awt.Color.white);
51078 this.jPanel2.setLayout ( new java.awt.FlowLayout ());
51079 this.jPanel2.setBackground (java.awt.Color.white);
51080 this.threshold.addItemListener (this);
51081 this.jPanel3.setLayout ( new java.awt.FlowLayout ());
51082 this.jPanel3.setBackground (java.awt.Color.white);
51083 var jPanel4 =  new awt2swing.Panel ();
51084 jPanel4.setLayout ( new java.awt.BorderLayout ());
51085 jPanel4.setBackground (java.awt.Color.white);
51086 this.jPanel1.add (this.ok);
51087 this.jPanel1.add (this.cancel);
51088 this.jPanel2.add (this.annotations);
51089 this.jPanel2.add (this.currentColours);
51090 this.jPanel2.add (this.minColour);
51091 this.jPanel2.add (this.maxColour);
51092 jPanel4.add (this.thresholdIsMin, "West");
51093 jPanel4.add (this.slider, "Center");
51094 jPanel4.add (this.thresholdValue, "East");
51095 var jPanel34 =  new awt2swing.Panel ();
51096 jPanel34.setLayout ( new java.awt.BorderLayout ());
51097 jPanel34.setBackground (java.awt.Color.white);
51098 jPanel34.add (this.jPanel2, "North");
51099 jPanel34.add (this.threshold, "West");
51100 this.jPanel3.add (this.defColours);
51101 jPanel34.add (this.jPanel3, "East");
51102 jPanel34.add (jPanel4, "South");
51103 this.add (jPanel34, "Center");
51104 this.add (this.jPanel1, "South");
51105 });
51106 Clazz_overrideMethod (c$, "actionPerformed", 
51107 function (evt) {
51108 if (evt.getSource () === this.thresholdValue) {
51109 try {
51110 var f =  new Float (this.thresholdValue.getText ()).floatValue ();
51111 this.slider.setValue (Clazz_floatToInt (f * 1000));
51112 this.adjustmentValueChanged (null);
51113 } catch (ex) {
51114 if (Clazz_exceptionOf (ex, NumberFormatException)) {
51115 } else {
51116 throw ex;
51117 }
51118 }
51119 } else if (evt.getSource () === this.minColour) {
51120 this.minColour_actionPerformed (null);
51121 } else if (evt.getSource () === this.maxColour) {
51122 this.maxColour_actionPerformed (null);
51123 } else if (evt.getSource () === this.defColours) {
51124 this.defColour_actionPerformed ();
51125 } else if (evt.getSource () === this.ok) {
51126 this.changeColour ();
51127 this.frame.setVisible (false);
51128 } else if (evt.getSource () === this.cancel) {
51129 this.reset ();
51130 this.ap.paintAlignment (true);
51131 this.frame.setVisible (false);
51132 } else {
51133 this.changeColour ();
51134 }}, "java.awt.event.ActionEvent");
51135 Clazz_overrideMethod (c$, "itemStateChanged", 
51136 function (evt) {
51137 if (evt.getSource () === this.currentColours) {
51138 if (this.currentColours.getState ()) {
51139 this.reset ();
51140 }this.maxColour.setEnabled (!this.currentColours.getState ());
51141 this.minColour.setEnabled (!this.currentColours.getState ());
51142 }this.changeColour ();
51143 }, "java.awt.event.ItemEvent");
51144 Clazz_overrideMethod (c$, "adjustmentValueChanged", 
51145 function (evt) {
51146 if (!this.adjusting) {
51147 this.thresholdValue.setText ((this.slider.getValue () / 1000) + "");
51148 if (this.currentColours.getState () && !(Clazz_instanceOf (this.av.getGlobalColourScheme (), jalview.schemes.AnnotationColourGradient))) {
51149 this.changeColour ();
51150 }this.currentAnnotation.threshold.value = this.slider.getValue () / 1000;
51151 this.ap.paintAlignment (false);
51152 }}, "java.awt.event.AdjustmentEvent");
51153 Clazz_defineMethod (c$, "minColour_actionPerformed", 
51154 function (newCol) {
51155 if (newCol != null) {
51156 this.minColour.setBackground (newCol);
51157 this.minColour.repaint ();
51158 this.changeColour ();
51159 } else {
51160  new jalview.appletgui.UserDefinedColours (this, "Min Colour", this.minColour.getBackground ());
51161 }}, "java.awt.Color");
51162 Clazz_defineMethod (c$, "maxColour_actionPerformed", 
51163 function (newCol) {
51164 if (newCol != null) {
51165 this.maxColour.setBackground (newCol);
51166 this.maxColour.repaint ();
51167 this.changeColour ();
51168 } else {
51169  new jalview.appletgui.UserDefinedColours (this, "Max Colour", this.maxColour.getBackground ());
51170 }}, "java.awt.Color");
51171 Clazz_defineMethod (c$, "defColour_actionPerformed", 
51172 function () {
51173 this.setDefaultMinMax ();
51174 this.minColour.repaint ();
51175 this.maxColour.repaint ();
51176 this.changeColour ();
51177 });
51178 Clazz_defineMethod (c$, "changeColour", 
51179 function () {
51180 if (this.adjusting) {
51181 return;
51182 }this.currentAnnotation = this.av.getAlignment ().getAlignmentAnnotation ()[this.annotations.getSelectedIndex ()];
51183 var aboveThreshold = -1;
51184 if (this.threshold.getSelectedIndex () == 1) {
51185 aboveThreshold = 1;
51186 } else if (this.threshold.getSelectedIndex () == 2) {
51187 aboveThreshold = 0;
51188 }this.slider.setEnabled (true);
51189 this.thresholdValue.setEnabled (true);
51190 this.thresholdIsMin.setEnabled (true);
51191 if (aboveThreshold == -1) {
51192 this.slider.setEnabled (false);
51193 this.thresholdValue.setEnabled (false);
51194 this.thresholdIsMin.setEnabled (false);
51195 this.thresholdValue.setText ("");
51196 } else if (aboveThreshold != -1 && this.currentAnnotation.threshold == null) {
51197 this.currentAnnotation.setThreshold ( new jalview.datamodel.GraphLine ((this.currentAnnotation.graphMax - this.currentAnnotation.graphMin) / 2, "Threshold", java.awt.Color.black));
51198 }if (aboveThreshold != -1) {
51199 this.adjusting = true;
51200 this.slider.setMinimum (Clazz_floatToInt (this.currentAnnotation.graphMin * 1000));
51201 this.slider.setMaximum (Clazz_floatToInt (this.currentAnnotation.graphMax * 1000));
51202 this.slider.setValue (Clazz_floatToInt (this.currentAnnotation.threshold.value * 1000));
51203 this.thresholdValue.setText (this.currentAnnotation.threshold.value + "");
51204 this.slider.setEnabled (true);
51205 this.thresholdValue.setEnabled (true);
51206 this.adjusting = false;
51207 }var acg = null;
51208 if (this.currentColours.getState ()) {
51209 acg =  new jalview.schemes.AnnotationColourGradient (this.currentAnnotation, this.av.getGlobalColourScheme (), aboveThreshold);
51210 } else {
51211 acg =  new jalview.schemes.AnnotationColourGradient (this.currentAnnotation, this.minColour.getBackground (), this.maxColour.getBackground (), aboveThreshold);
51212 }if (this.currentAnnotation.graphMin == 0 && this.currentAnnotation.graphMax == 0) {
51213 acg.setPredefinedColours (true);
51214 }acg.thresholdIsMinMax = this.thresholdIsMin.getState ();
51215 this.av.setGlobalColourScheme (acg);
51216 if (this.av.getAlignment ().getGroups () != null) {
51217 for (var sg, $sg = this.ap.av.getAlignment ().getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
51218 if (sg.cs == null) {
51219 continue;
51220 }if (this.currentColours.getState ()) {
51221 sg.cs =  new jalview.schemes.AnnotationColourGradient (this.currentAnnotation, sg.cs, aboveThreshold);
51222 } else {
51223 sg.cs =  new jalview.schemes.AnnotationColourGradient (this.currentAnnotation, this.minColour.getBackground (), this.maxColour.getBackground (), aboveThreshold);
51224 }}
51225 }this.ap.alignmentChanged ();
51226 this.ap.paintAlignment (true);
51227 });
51228 Clazz_defineMethod (c$, "reset", 
51229 function () {
51230 this.av.setGlobalColourScheme (this.oldcs);
51231 if (this.av.getAlignment ().getGroups () != null) {
51232 for (var sg, $sg = this.ap.av.getAlignment ().getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
51233 var cs = this.oldgroupColours.get (sg);
51234 if (Clazz_instanceOf (cs, jalview.schemes.ColourSchemeI)) {
51235 sg.cs = cs;
51236 } else {
51237 sg.cs = null;
51238 }}
51239 }this.ap.paintAlignment (true);
51240 });
51241 Clazz_overrideMethod (c$, "mouseClicked", 
51242 function (evt) {
51243 }, "java.awt.event.MouseEvent");
51244 Clazz_overrideMethod (c$, "mousePressed", 
51245 function (evt) {
51246 }, "java.awt.event.MouseEvent");
51247 Clazz_overrideMethod (c$, "mouseReleased", 
51248 function (evt) {
51249 this.ap.paintAlignment (true);
51250 }, "java.awt.event.MouseEvent");
51251 Clazz_overrideMethod (c$, "mouseEntered", 
51252 function (evt) {
51253 }, "java.awt.event.MouseEvent");
51254 Clazz_overrideMethod (c$, "mouseExited", 
51255 function (evt) {
51256 }, "java.awt.event.MouseEvent");
51257 });
51258 Clazz_declarePackage ("awt2swing");
51259 Clazz_load (["javax.swing.JComboBox"], "awt2swing.Choice", null, function () {
51260 c$ = Clazz_declareType (awt2swing, "Choice", javax.swing.JComboBox);
51261 Clazz_defineMethod (c$, "select", 
51262 function (key) {
51263 this.setSelectedItem (key);
51264 }, "~O");
51265 });
51266 Clazz_declarePackage ("javax.swing");
51267 Clazz_load (["java.awt.ItemSelectable", "java.awt.event.ActionListener", "javax.swing.ActionPropertyChangeListener", "$.JComponent", "javax.swing.event.ListDataListener", "javax.swing.JPopupMenu"], "javax.swing.JComboBox", ["java.lang.IllegalArgumentException", "$.RuntimeException", "java.awt.Component", "$.EventQueue", "java.awt.event.ActionEvent", "$.InputEvent", "$.ItemEvent", "$.ItemListener", "javax.swing.AbstractAction", "$.DefaultComboBoxModel", "$.MutableComboBoxModel", "$.SwingUtilities", "$.UIManager", "javax.swing.event.AncestorListener", "$.PopupMenuEvent", "$.PopupMenuListener"], function () {
51268 c$ = Clazz_decorateAsClass (function () {
51269 this.dataModel = null;
51270 this.renderer = null;
51271 this.editor = null;
51272 this.maximumRowCount = 8;
51273 this.$isEditable = false;
51274 this.keySelectionManager = null;
51275 this.actionCommand = "comboBoxChanged";
51276 this.lightWeightPopupEnabled = false;
51277 this.selectedItemReminder = null;
51278 this.prototypeDisplayValue = null;
51279 this.firingActionEvent = false;
51280 this.selectingItem = false;
51281 this.$action = null;
51282 this.actionPropertyChangeListener = null;
51283 if (!Clazz_isClassDefined ("javax.swing.JComboBox.DefaultKeySelectionManager")) {
51284 javax.swing.JComboBox.$JComboBox$DefaultKeySelectionManager$ ();
51285 }
51286 Clazz_instantialize (this, arguments);
51287 }, javax.swing, "JComboBox", javax.swing.JComponent, [java.awt.ItemSelectable, javax.swing.event.ListDataListener, java.awt.event.ActionListener]);
51288 Clazz_prepareFields (c$, function () {
51289 this.lightWeightPopupEnabled = javax.swing.JPopupMenu.getDefaultLightWeightPopupEnabled ();
51290 });
51291 Clazz_makeConstructor (c$, 
51292 function (aModel) {
51293 Clazz_superConstructor (this, javax.swing.JComboBox);
51294 this.setModel (aModel);
51295 this.init ();
51296 }, "javax.swing.ComboBoxModel");
51297 Clazz_makeConstructor (c$, 
51298 function (items) {
51299 Clazz_superConstructor (this, javax.swing.JComboBox);
51300 this.setModel ( new javax.swing.DefaultComboBoxModel (items));
51301 this.init ();
51302 }, "~A");
51303 Clazz_makeConstructor (c$, 
51304 function (items) {
51305 Clazz_superConstructor (this, javax.swing.JComboBox);
51306 this.setModel ( new javax.swing.DefaultComboBoxModel (items));
51307 this.init ();
51308 }, "java.util.Vector");
51309 Clazz_makeConstructor (c$, 
51310 function () {
51311 Clazz_superConstructor (this, javax.swing.JComboBox);
51312 this.setModel ( new javax.swing.DefaultComboBoxModel ());
51313 this.init ();
51314 });
51315 Clazz_defineMethod (c$, "init", 
51316  function () {
51317 this.installAncestorListener ();
51318 this.setUIProperty ("opaque", new Boolean (true));
51319 this.updateUI ();
51320 });
51321 Clazz_defineMethod (c$, "installAncestorListener", 
51322 function () {
51323 this.addAncestorListener (((Clazz_isClassDefined ("javax.swing.JComboBox$1") ? 0 : javax.swing.JComboBox.$JComboBox$1$ ()), Clazz_innerTypeInstance (javax.swing.JComboBox$1, this, null)));
51324 });
51325 Clazz_overrideMethod (c$, "updateUI", 
51326 function () {
51327 this.setUI (javax.swing.UIManager.getUI (this));
51328 var renderer = this.getRenderer ();
51329 if (Clazz_instanceOf (renderer, java.awt.Component)) {
51330 javax.swing.SwingUtilities.updateComponentTreeUI (renderer);
51331 }});
51332 Clazz_overrideMethod (c$, "getUIClassID", 
51333 function () {
51334 return "ComboBoxUI";
51335 });
51336 Clazz_overrideMethod (c$, "getUI", 
51337 function () {
51338 return this.ui;
51339 });
51340 Clazz_defineMethod (c$, "setModel", 
51341 function (aModel) {
51342 var oldModel = this.dataModel;
51343 if (oldModel != null) {
51344 oldModel.removeListDataListener (this);
51345 }this.dataModel = aModel;
51346 this.dataModel.addListDataListener (this);
51347 this.selectedItemReminder = this.dataModel.getSelectedItem ();
51348 this.firePropertyChangeObject ("model", oldModel, this.dataModel);
51349 }, "javax.swing.ComboBoxModel");
51350 Clazz_defineMethod (c$, "getModel", 
51351 function () {
51352 return this.dataModel;
51353 });
51354 Clazz_defineMethod (c$, "setLightWeightPopupEnabled", 
51355 function (aFlag) {
51356 var oldFlag = this.lightWeightPopupEnabled;
51357 this.lightWeightPopupEnabled = aFlag;
51358 this.firePropertyChangeBool ("lightWeightPopupEnabled", oldFlag, this.lightWeightPopupEnabled);
51359 }, "~B");
51360 Clazz_defineMethod (c$, "isLightWeightPopupEnabled", 
51361 function () {
51362 return this.lightWeightPopupEnabled;
51363 });
51364 Clazz_defineMethod (c$, "setEditable", 
51365 function (aFlag) {
51366 var oldFlag = this.$isEditable;
51367 this.$isEditable = aFlag;
51368 this.firePropertyChangeBool ("editable", oldFlag, this.$isEditable);
51369 }, "~B");
51370 Clazz_defineMethod (c$, "isEditable", 
51371 function () {
51372 return this.$isEditable;
51373 });
51374 Clazz_defineMethod (c$, "setMaximumRowCount", 
51375 function (count) {
51376 var oldCount = this.maximumRowCount;
51377 this.maximumRowCount = count;
51378 this.firePropertyChangeInt ("maximumRowCount", oldCount, this.maximumRowCount);
51379 }, "~N");
51380 Clazz_defineMethod (c$, "getMaximumRowCount", 
51381 function () {
51382 return this.maximumRowCount;
51383 });
51384 Clazz_defineMethod (c$, "setRenderer", 
51385 function (aRenderer) {
51386 var oldRenderer = this.renderer;
51387 this.renderer = aRenderer;
51388 this.firePropertyChangeObject ("renderer", oldRenderer, this.renderer);
51389 this.invalidate ();
51390 }, "javax.swing.ListCellRenderer");
51391 Clazz_defineMethod (c$, "getRenderer", 
51392 function () {
51393 return this.renderer;
51394 });
51395 Clazz_defineMethod (c$, "setEditor", 
51396 function (anEditor) {
51397 var oldEditor = this.editor;
51398 if (this.editor != null) {
51399 this.editor.removeActionListener (this);
51400 }this.editor = anEditor;
51401 if (this.editor != null) {
51402 this.editor.addActionListener (this);
51403 }this.firePropertyChangeObject ("editor", oldEditor, this.editor);
51404 }, "javax.swing.ComboBoxEditor");
51405 Clazz_defineMethod (c$, "getEditor", 
51406 function () {
51407 return this.editor;
51408 });
51409 Clazz_defineMethod (c$, "setSelectedItem", 
51410 function (anObject) {
51411 var oldSelection = this.selectedItemReminder;
51412 var objectToSelect = anObject;
51413 if (oldSelection == null || !oldSelection.equals (anObject)) {
51414 if (anObject != null && !this.isEditable ()) {
51415 var found = false;
51416 for (var i = 0; i < this.dataModel.getSize (); i++) {
51417 var element = this.dataModel.getElementAt (i);
51418 if (anObject.equals (element)) {
51419 found = true;
51420 objectToSelect = element;
51421 break;
51422 }}
51423 if (!found) {
51424 return;
51425 }}this.selectingItem = true;
51426 this.dataModel.setSelectedItem (objectToSelect);
51427 this.selectingItem = false;
51428 if (this.selectedItemReminder !== this.dataModel.getSelectedItem ()) {
51429 this.selectedItemChanged ();
51430 }}this.fireActionEvent ();
51431 }, "~O");
51432 Clazz_defineMethod (c$, "getSelectedItem", 
51433 function () {
51434 return this.dataModel.getSelectedItem ();
51435 });
51436 Clazz_defineMethod (c$, "setSelectedIndex", 
51437 function (anIndex) {
51438 var size = this.dataModel.getSize ();
51439 if (anIndex == -1) {
51440 this.setSelectedItem (null);
51441 } else if (anIndex < -1 || anIndex >= size) {
51442 throw  new IllegalArgumentException ("setSelectedIndex: " + anIndex + " out of bounds");
51443 } else {
51444 this.setSelectedItem (this.dataModel.getElementAt (anIndex));
51445 }}, "~N");
51446 Clazz_defineMethod (c$, "getSelectedIndex", 
51447 function () {
51448 var sObject = this.dataModel.getSelectedItem ();
51449 var i;
51450 var c;
51451 var obj;
51452 for (i = 0, c = this.dataModel.getSize (); i < c; i++) {
51453 obj = this.dataModel.getElementAt (i);
51454 if (obj != null && obj.equals (sObject)) return i;
51455 }
51456 return -1;
51457 });
51458 Clazz_defineMethod (c$, "getPrototypeDisplayValue", 
51459 function () {
51460 return this.prototypeDisplayValue;
51461 });
51462 Clazz_defineMethod (c$, "setPrototypeDisplayValue", 
51463 function (prototypeDisplayValue) {
51464 var oldValue = this.prototypeDisplayValue;
51465 this.prototypeDisplayValue = prototypeDisplayValue;
51466 this.firePropertyChangeObject ("prototypeDisplayValue", oldValue, prototypeDisplayValue);
51467 }, "~O");
51468 Clazz_defineMethod (c$, "addItem", 
51469 function (anObject) {
51470 this.checkMutableComboBoxModel ();
51471 (this.dataModel).addElement (anObject);
51472 }, "~O");
51473 Clazz_defineMethod (c$, "insertItemAt", 
51474 function (anObject, index) {
51475 this.checkMutableComboBoxModel ();
51476 (this.dataModel).insertElementAt (anObject, index);
51477 }, "~O,~N");
51478 Clazz_defineMethod (c$, "removeItem", 
51479 function (anObject) {
51480 this.checkMutableComboBoxModel ();
51481 (this.dataModel).removeElement (anObject);
51482 }, "~O");
51483 Clazz_defineMethod (c$, "removeItemAt", 
51484 function (anIndex) {
51485 this.checkMutableComboBoxModel ();
51486 (this.dataModel).removeElementAt (anIndex);
51487 }, "~N");
51488 Clazz_defineMethod (c$, "removeAllItems", 
51489 function () {
51490 this.checkMutableComboBoxModel ();
51491 var model = this.dataModel;
51492 var size = model.getSize ();
51493 if (Clazz_instanceOf (model, javax.swing.DefaultComboBoxModel)) {
51494 (model).removeAllElements ();
51495 } else {
51496 for (var i = 0; i < size; ++i) {
51497 var element = model.getElementAt (0);
51498 model.removeElement (element);
51499 }
51500 }this.selectedItemReminder = null;
51501 if (this.isEditable ()) {
51502 this.editor.setItem (null);
51503 }});
51504 Clazz_defineMethod (c$, "checkMutableComboBoxModel", 
51505 function () {
51506 if (!(Clazz_instanceOf (this.dataModel, javax.swing.MutableComboBoxModel))) throw  new RuntimeException ("Cannot use this method with a non-Mutable data model.");
51507 });
51508 Clazz_defineMethod (c$, "showPopup", 
51509 function () {
51510 this.setPopupVisible (true);
51511 });
51512 Clazz_defineMethod (c$, "hidePopup", 
51513 function () {
51514 this.setPopupVisible (false);
51515 });
51516 Clazz_defineMethod (c$, "setPopupVisible", 
51517 function (v) {
51518 this.getUI ().setPopupVisible (this, v);
51519 }, "~B");
51520 Clazz_defineMethod (c$, "isPopupVisible", 
51521 function () {
51522 return this.getUI ().isPopupVisible (this);
51523 });
51524 Clazz_overrideMethod (c$, "addItemListener", 
51525 function (aListener) {
51526 this.listenerList.add (java.awt.event.ItemListener, aListener);
51527 }, "java.awt.event.ItemListener");
51528 Clazz_overrideMethod (c$, "removeItemListener", 
51529 function (aListener) {
51530 this.listenerList.remove (java.awt.event.ItemListener, aListener);
51531 }, "java.awt.event.ItemListener");
51532 Clazz_defineMethod (c$, "getItemListeners", 
51533 function () {
51534 return this.listenerList.getListeners (java.awt.event.ItemListener);
51535 });
51536 Clazz_defineMethod (c$, "addActionListener", 
51537 function (l) {
51538 this.listenerList.add (java.awt.event.ActionListener, l);
51539 }, "java.awt.event.ActionListener");
51540 Clazz_defineMethod (c$, "removeActionListener", 
51541 function (l) {
51542 if ((l != null) && (this.getAction () === l)) {
51543 this.setAction (null);
51544 } else {
51545 this.listenerList.remove (java.awt.event.ActionListener, l);
51546 }}, "java.awt.event.ActionListener");
51547 Clazz_defineMethod (c$, "getActionListeners", 
51548 function () {
51549 return this.listenerList.getListeners (java.awt.event.ActionListener);
51550 });
51551 Clazz_defineMethod (c$, "addPopupMenuListener", 
51552 function (l) {
51553 this.listenerList.add (javax.swing.event.PopupMenuListener, l);
51554 }, "javax.swing.event.PopupMenuListener");
51555 Clazz_defineMethod (c$, "removePopupMenuListener", 
51556 function (l) {
51557 this.listenerList.remove (javax.swing.event.PopupMenuListener, l);
51558 }, "javax.swing.event.PopupMenuListener");
51559 Clazz_defineMethod (c$, "getPopupMenuListeners", 
51560 function () {
51561 return this.listenerList.getListeners (javax.swing.event.PopupMenuListener);
51562 });
51563 Clazz_defineMethod (c$, "firePopupMenuWillBecomeVisible", 
51564 function () {
51565 var listeners = this.listenerList.getListenerList ();
51566 var e = null;
51567 for (var i = listeners.length - 2; i >= 0; i -= 2) {
51568 if (listeners[i] === javax.swing.event.PopupMenuListener) {
51569 if (e == null) e =  new javax.swing.event.PopupMenuEvent (this);
51570 (listeners[i + 1]).popupMenuWillBecomeVisible (e);
51571 }}
51572 });
51573 Clazz_defineMethod (c$, "firePopupMenuWillBecomeInvisible", 
51574 function () {
51575 var listeners = this.listenerList.getListenerList ();
51576 var e = null;
51577 for (var i = listeners.length - 2; i >= 0; i -= 2) {
51578 if (listeners[i] === javax.swing.event.PopupMenuListener) {
51579 if (e == null) e =  new javax.swing.event.PopupMenuEvent (this);
51580 (listeners[i + 1]).popupMenuWillBecomeInvisible (e);
51581 }}
51582 });
51583 Clazz_defineMethod (c$, "firePopupMenuCanceled", 
51584 function () {
51585 var listeners = this.listenerList.getListenerList ();
51586 var e = null;
51587 for (var i = listeners.length - 2; i >= 0; i -= 2) {
51588 if (listeners[i] === javax.swing.event.PopupMenuListener) {
51589 if (e == null) e =  new javax.swing.event.PopupMenuEvent (this);
51590 (listeners[i + 1]).popupMenuCanceled (e);
51591 }}
51592 });
51593 Clazz_defineMethod (c$, "setActionCommand", 
51594 function (aCommand) {
51595 this.actionCommand = aCommand;
51596 }, "~S");
51597 Clazz_defineMethod (c$, "getActionCommand", 
51598 function () {
51599 return this.actionCommand;
51600 });
51601 Clazz_defineMethod (c$, "setAction", 
51602 function (a) {
51603 var oldValue = this.getAction ();
51604 if (this.$action == null || !this.$action.equals (a)) {
51605 this.$action = a;
51606 if (oldValue != null) {
51607 this.removeActionListener (oldValue);
51608 oldValue.removePropertyChangeListener (this.actionPropertyChangeListener);
51609 this.actionPropertyChangeListener = null;
51610 }this.configurePropertiesFromAction (this.$action);
51611 if (this.$action != null) {
51612 if (!this.isListener (java.awt.event.ActionListener, this.$action)) {
51613 this.addActionListener (this.$action);
51614 }this.actionPropertyChangeListener = this.createActionPropertyChangeListener (this.$action);
51615 this.$action.addPropertyChangeListener (this.actionPropertyChangeListener);
51616 }this.firePropertyChangeObject ("action", oldValue, this.$action);
51617 }}, "javax.swing.Action");
51618 Clazz_defineMethod (c$, "isListener", 
51619  function (c, a) {
51620 var isListener = false;
51621 var listeners = this.listenerList.getListenerList ();
51622 for (var i = listeners.length - 2; i >= 0; i -= 2) {
51623 if (listeners[i] === c && listeners[i + 1] === a) {
51624 isListener = true;
51625 }}
51626 return isListener;
51627 }, "Class,java.awt.event.ActionListener");
51628 Clazz_defineMethod (c$, "getAction", 
51629 function () {
51630 return this.$action;
51631 });
51632 Clazz_defineMethod (c$, "configurePropertiesFromAction", 
51633 function (a) {
51634 javax.swing.AbstractAction.setEnabledFromAction (this, a);
51635 javax.swing.AbstractAction.setToolTipTextFromAction (this, a);
51636 this.setActionCommandFromAction (a);
51637 }, "javax.swing.Action");
51638 Clazz_defineMethod (c$, "createActionPropertyChangeListener", 
51639 function (a) {
51640 return  new javax.swing.JComboBox.ComboBoxActionPropertyChangeListener (this, a);
51641 }, "javax.swing.Action");
51642 Clazz_defineMethod (c$, "actionPropertyChanged", 
51643 function (action, propertyName) {
51644 if (propertyName === "ActionCommandKey") {
51645 this.setActionCommandFromAction (action);
51646 } else if (propertyName === "enabled") {
51647 javax.swing.AbstractAction.setEnabledFromAction (this, action);
51648 } else if ("ShortDescription" === propertyName) {
51649 javax.swing.AbstractAction.setToolTipTextFromAction (this, action);
51650 }}, "javax.swing.Action,~S");
51651 Clazz_defineMethod (c$, "setActionCommandFromAction", 
51652  function (a) {
51653 this.setActionCommand ((a != null) ? a.getValue ("ActionCommandKey") : null);
51654 }, "javax.swing.Action");
51655 Clazz_defineMethod (c$, "fireItemStateChanged", 
51656 function (e) {
51657 var listeners = this.listenerList.getListenerList ();
51658 for (var i = listeners.length - 2; i >= 0; i -= 2) {
51659 if (listeners[i] === java.awt.event.ItemListener) {
51660 (listeners[i + 1]).itemStateChanged (e);
51661 }}
51662 }, "java.awt.event.ItemEvent");
51663 Clazz_defineMethod (c$, "fireActionEvent", 
51664 function () {
51665 if (!this.firingActionEvent) {
51666 this.firingActionEvent = true;
51667 var e = null;
51668 var listeners = this.listenerList.getListenerList ();
51669 var mostRecentEventTime = java.awt.EventQueue.getMostRecentEventTime ();
51670 var modifiers = 0;
51671 var currentEvent = java.awt.EventQueue.getCurrentEvent ();
51672 if (Clazz_instanceOf (currentEvent, java.awt.event.InputEvent)) {
51673 modifiers = (currentEvent).getModifiers ();
51674 } else if (Clazz_instanceOf (currentEvent, java.awt.event.ActionEvent)) {
51675 modifiers = (currentEvent).getModifiers ();
51676 }for (var i = listeners.length - 2; i >= 0; i -= 2) {
51677 if (listeners[i] === java.awt.event.ActionListener) {
51678 if (e == null) e =  new java.awt.event.ActionEvent (this, 1001, this.getActionCommand (), mostRecentEventTime, modifiers);
51679 (listeners[i + 1]).actionPerformed (e);
51680 }}
51681 this.firingActionEvent = false;
51682 }});
51683 Clazz_defineMethod (c$, "selectedItemChanged", 
51684 function () {
51685 if (this.selectedItemReminder != null) {
51686 this.fireItemStateChanged ( new java.awt.event.ItemEvent (this, 701, this.selectedItemReminder, 2));
51687 }this.selectedItemReminder = this.dataModel.getSelectedItem ();
51688 if (this.selectedItemReminder != null) {
51689 this.fireItemStateChanged ( new java.awt.event.ItemEvent (this, 701, this.selectedItemReminder, 1));
51690 }});
51691 Clazz_overrideMethod (c$, "getSelectedObjects", 
51692 function () {
51693 var selectedObject = this.getSelectedItem ();
51694 if (selectedObject == null) return  new Array (0);
51695  else {
51696 var result =  new Array (1);
51697 result[0] = selectedObject;
51698 return result;
51699 }});
51700 Clazz_defineMethod (c$, "actionPerformed", 
51701 function (e) {
51702 var newItem = this.getEditor ().getItem ();
51703 this.setPopupVisible (false);
51704 this.getModel ().setSelectedItem (newItem);
51705 var oldCommand = this.getActionCommand ();
51706 this.setActionCommand ("comboBoxEdited");
51707 this.fireActionEvent ();
51708 this.setActionCommand (oldCommand);
51709 }, "java.awt.event.ActionEvent");
51710 Clazz_overrideMethod (c$, "contentsChanged", 
51711 function (e) {
51712 var oldSelection = this.selectedItemReminder;
51713 var newSelection = this.dataModel.getSelectedItem ();
51714 if (oldSelection == null || !oldSelection.equals (newSelection)) {
51715 this.selectedItemChanged ();
51716 if (!this.selectingItem) {
51717 this.fireActionEvent ();
51718 }}}, "javax.swing.event.ListDataEvent");
51719 Clazz_overrideMethod (c$, "intervalAdded", 
51720 function (e) {
51721 if (this.selectedItemReminder !== this.dataModel.getSelectedItem ()) {
51722 this.selectedItemChanged ();
51723 }}, "javax.swing.event.ListDataEvent");
51724 Clazz_overrideMethod (c$, "intervalRemoved", 
51725 function (e) {
51726 this.contentsChanged (e);
51727 }, "javax.swing.event.ListDataEvent");
51728 Clazz_defineMethod (c$, "selectWithKeyChar", 
51729 function (keyChar) {
51730 var index;
51731 if (this.keySelectionManager == null) this.keySelectionManager = this.createDefaultKeySelectionManager ();
51732 index = this.keySelectionManager.selectionForKey (keyChar, this.getModel ());
51733 if (index != -1) {
51734 this.setSelectedIndex (index);
51735 return true;
51736 } else return false;
51737 }, "~S");
51738 Clazz_defineMethod (c$, "setEnabled", 
51739 function (b) {
51740 Clazz_superCall (this, javax.swing.JComboBox, "setEnabled", [b]);
51741 this.firePropertyChangeBool ("enabled", !this.isEnabled (), this.isEnabled ());
51742 }, "~B");
51743 Clazz_defineMethod (c$, "configureEditor", 
51744 function (anEditor, anItem) {
51745 anEditor.setItem (anItem);
51746 }, "javax.swing.ComboBoxEditor,~O");
51747 Clazz_defineMethod (c$, "processKeyEvent", 
51748 function (e) {
51749 if (e.getKeyCode () == 9) {
51750 this.hidePopup ();
51751 }Clazz_superCall (this, javax.swing.JComboBox, "processKeyEvent", [e]);
51752 }, "java.awt.event.KeyEvent");
51753 Clazz_defineMethod (c$, "setKeySelectionManager", 
51754 function (aManager) {
51755 this.keySelectionManager = aManager;
51756 }, "javax.swing.JComboBox.KeySelectionManager");
51757 Clazz_defineMethod (c$, "getKeySelectionManager", 
51758 function () {
51759 return this.keySelectionManager;
51760 });
51761 Clazz_defineMethod (c$, "getItemCount", 
51762 function () {
51763 return this.dataModel.getSize ();
51764 });
51765 Clazz_defineMethod (c$, "getItemAt", 
51766 function (index) {
51767 return this.dataModel.getElementAt (index);
51768 }, "~N");
51769 Clazz_defineMethod (c$, "createDefaultKeySelectionManager", 
51770 function () {
51771 return Clazz_innerTypeInstance (javax.swing.JComboBox.DefaultKeySelectionManager, this, null);
51772 });
51773 Clazz_defineMethod (c$, "paramString", 
51774 function () {
51775 var selectedItemReminderString = (this.selectedItemReminder != null ? this.selectedItemReminder.toString () : "");
51776 var isEditableString = (this.$isEditable ? "true" : "false");
51777 var lightWeightPopupEnabledString = (this.lightWeightPopupEnabled ? "true" : "false");
51778 return Clazz_superCall (this, javax.swing.JComboBox, "paramString", []) + ",isEditable=" + isEditableString + ",lightWeightPopupEnabled=" + lightWeightPopupEnabledString + ",maximumRowCount=" + this.maximumRowCount + ",selectedItemReminder=" + selectedItemReminderString;
51779 });
51780 c$.$JComboBox$DefaultKeySelectionManager$ = function () {
51781 Clazz_pu$h(self.c$);
51782 c$ = Clazz_decorateAsClass (function () {
51783 Clazz_prepareCallback (this, arguments);
51784 Clazz_instantialize (this, arguments);
51785 }, javax.swing.JComboBox, "DefaultKeySelectionManager", null, javax.swing.JComboBox.KeySelectionManager);
51786 Clazz_overrideMethod (c$, "selectionForKey", 
51787 function (a, b) {
51788 var c;
51789 var d;
51790 var e = -1;
51791 var f = b.getSelectedItem ();
51792 var g;
51793 var h;
51794 if (f != null) {
51795 for (c = 0, d = b.getSize (); c < d; c++) {
51796 if (f === b.getElementAt (c)) {
51797 e = c;
51798 break;
51799 }}
51800 }h = ("" + a).toLowerCase ();
51801 a = h.charAt (0);
51802 for (c = ++e, d = b.getSize (); c < d; c++) {
51803 var i = b.getElementAt (c);
51804 if (i != null && i.toString () != null) {
51805 g = i.toString ().toLowerCase ();
51806 if (g.length > 0 && g.charAt (0) == a) return c;
51807 }}
51808 for (c = 0; c < e; c++) {
51809 var i = b.getElementAt (c);
51810 if (i != null && i.toString () != null) {
51811 g = i.toString ().toLowerCase ();
51812 if (g.length > 0 && g.charAt (0) == a) return c;
51813 }}
51814 return -1;
51815 }, "~S,javax.swing.ComboBoxModel");
51816 c$ = Clazz_p0p ();
51817 };
51818 c$.$JComboBox$1$ = function () {
51819 Clazz_pu$h(self.c$);
51820 c$ = Clazz_declareAnonymous (javax.swing, "JComboBox$1", null, javax.swing.event.AncestorListener);
51821 Clazz_overrideMethod (c$, "ancestorAdded", 
51822 function (event) {
51823 this.b$["javax.swing.JComboBox"].hidePopup ();
51824 }, "javax.swing.event.AncestorEvent");
51825 Clazz_overrideMethod (c$, "ancestorRemoved", 
51826 function (event) {
51827 this.b$["javax.swing.JComboBox"].hidePopup ();
51828 }, "javax.swing.event.AncestorEvent");
51829 Clazz_overrideMethod (c$, "ancestorMoved", 
51830 function (event) {
51831 if (event.getSource () !== this.b$["javax.swing.JComboBox"]) this.b$["javax.swing.JComboBox"].hidePopup ();
51832 }, "javax.swing.event.AncestorEvent");
51833 c$ = Clazz_p0p ();
51834 };
51835 Clazz_pu$h(self.c$);
51836 c$ = Clazz_declareType (javax.swing.JComboBox, "ComboBoxActionPropertyChangeListener", javax.swing.ActionPropertyChangeListener);
51837 Clazz_overrideMethod (c$, "actionPropertyChanged", 
51838 function (a, b, c) {
51839 if (javax.swing.AbstractAction.shouldReconfigure (c)) {
51840 a.configurePropertiesFromAction (b);
51841 } else {
51842 a.actionPropertyChanged (b, c.getPropertyName ());
51843 }}, "javax.swing.JComboBox,javax.swing.Action,java.beans.PropertyChangeEvent");
51844 c$ = Clazz_p0p ();
51845 Clazz_declareInterface (javax.swing.JComboBox, "KeySelectionManager");
51846 Clazz_defineStatics (c$,
51847 "$uiClassID", "ComboBoxUI");
51848 });
51849 Clazz_declarePackage ("javax.swing.event");
51850 Clazz_load (["java.util.EventListener"], "javax.swing.event.ListDataListener", null, function () {
51851 Clazz_declareInterface (javax.swing.event, "ListDataListener", java.util.EventListener);
51852 });
51853 Clazz_declarePackage ("javax.swing");
51854 Clazz_load (["javax.swing.AbstractListModel", "$.MutableComboBoxModel"], "javax.swing.DefaultComboBoxModel", ["java.util.Vector"], function () {
51855 c$ = Clazz_decorateAsClass (function () {
51856 this.objects = null;
51857 this.selectedObject = null;
51858 Clazz_instantialize (this, arguments);
51859 }, javax.swing, "DefaultComboBoxModel", javax.swing.AbstractListModel, javax.swing.MutableComboBoxModel);
51860 Clazz_makeConstructor (c$, 
51861 function () {
51862 Clazz_superConstructor (this, javax.swing.DefaultComboBoxModel, []);
51863 this.objects =  new java.util.Vector ();
51864 });
51865 Clazz_makeConstructor (c$, 
51866 function (items) {
51867 Clazz_superConstructor (this, javax.swing.DefaultComboBoxModel, []);
51868 this.objects =  new java.util.Vector ();
51869 this.objects.ensureCapacity (items.length);
51870 var i;
51871 var c;
51872 for (i = 0, c = items.length; i < c; i++) this.objects.addElement (items[i]);
51873
51874 if (this.getSize () > 0) {
51875 this.selectedObject = this.getElementAt (0);
51876 }}, "~A");
51877 Clazz_makeConstructor (c$, 
51878 function (v) {
51879 Clazz_superConstructor (this, javax.swing.DefaultComboBoxModel, []);
51880 this.objects = v;
51881 if (this.getSize () > 0) {
51882 this.selectedObject = this.getElementAt (0);
51883 }}, "java.util.Vector");
51884 Clazz_overrideMethod (c$, "setSelectedItem", 
51885 function (anObject) {
51886 if ((this.selectedObject != null && !this.selectedObject.equals (anObject)) || this.selectedObject == null && anObject != null) {
51887 this.selectedObject = anObject;
51888 this.fireContentsChanged (this, -1, -1);
51889 }}, "~O");
51890 Clazz_overrideMethod (c$, "getSelectedItem", 
51891 function () {
51892 return this.selectedObject;
51893 });
51894 Clazz_overrideMethod (c$, "getSize", 
51895 function () {
51896 return this.objects.size ();
51897 });
51898 Clazz_overrideMethod (c$, "getElementAt", 
51899 function (index) {
51900 if (index >= 0 && index < this.objects.size ()) return this.objects.elementAt (index);
51901  else return null;
51902 }, "~N");
51903 Clazz_defineMethod (c$, "getIndexOf", 
51904 function (anObject) {
51905 return this.objects.indexOf (anObject);
51906 }, "~O");
51907 Clazz_overrideMethod (c$, "addElement", 
51908 function (anObject) {
51909 this.objects.addElement (anObject);
51910 this.fireIntervalAdded (this, this.objects.size () - 1, this.objects.size () - 1);
51911 if (this.objects.size () == 1 && this.selectedObject == null && anObject != null) {
51912 this.setSelectedItem (anObject);
51913 }}, "~O");
51914 Clazz_overrideMethod (c$, "insertElementAt", 
51915 function (anObject, index) {
51916 this.objects.insertElementAt (anObject, index);
51917 this.fireIntervalAdded (this, index, index);
51918 }, "~O,~N");
51919 Clazz_overrideMethod (c$, "removeElementAt", 
51920 function (index) {
51921 if (this.getElementAt (index) === this.selectedObject) {
51922 if (index == 0) {
51923 this.setSelectedItem (this.getSize () == 1 ? null : this.getElementAt (index + 1));
51924 } else {
51925 this.setSelectedItem (this.getElementAt (index - 1));
51926 }}this.objects.removeElementAt (index);
51927 this.fireIntervalRemoved (this, index, index);
51928 }, "~N");
51929 Clazz_overrideMethod (c$, "removeElement", 
51930 function (anObject) {
51931 var index = this.objects.indexOf (anObject);
51932 if (index != -1) {
51933 this.removeElementAt (index);
51934 }}, "~O");
51935 Clazz_defineMethod (c$, "removeAllElements", 
51936 function () {
51937 if (this.objects.size () > 0) {
51938 var firstIndex = 0;
51939 var lastIndex = this.objects.size () - 1;
51940 this.objects.removeAllElements ();
51941 this.selectedObject = null;
51942 this.fireIntervalRemoved (this, firstIndex, lastIndex);
51943 } else {
51944 this.selectedObject = null;
51945 }});
51946 });
51947 Clazz_declarePackage ("javax.swing");
51948 Clazz_load (["javax.swing.ListModel", "javax.swing.event.EventListenerList"], "javax.swing.AbstractListModel", ["javax.swing.event.ListDataEvent", "$.ListDataListener"], function () {
51949 c$ = Clazz_decorateAsClass (function () {
51950 this.listenerList = null;
51951 Clazz_instantialize (this, arguments);
51952 }, javax.swing, "AbstractListModel", null, javax.swing.ListModel);
51953 Clazz_prepareFields (c$, function () {
51954 this.listenerList =  new javax.swing.event.EventListenerList ();
51955 });
51956 Clazz_overrideMethod (c$, "addListDataListener", 
51957 function (l) {
51958 this.listenerList.add (javax.swing.event.ListDataListener, l);
51959 }, "javax.swing.event.ListDataListener");
51960 Clazz_overrideMethod (c$, "removeListDataListener", 
51961 function (l) {
51962 this.listenerList.remove (javax.swing.event.ListDataListener, l);
51963 }, "javax.swing.event.ListDataListener");
51964 Clazz_defineMethod (c$, "getListDataListeners", 
51965 function () {
51966 return this.listenerList.getListeners (javax.swing.event.ListDataListener);
51967 });
51968 Clazz_defineMethod (c$, "fireContentsChanged", 
51969 function (source, index0, index1) {
51970 var listeners = this.listenerList.getListenerList ();
51971 var e = null;
51972 for (var i = listeners.length - 2; i >= 0; i -= 2) {
51973 if (listeners[i] === javax.swing.event.ListDataListener) {
51974 if (e == null) {
51975 e =  new javax.swing.event.ListDataEvent (source, 0, index0, index1);
51976 }(listeners[i + 1]).contentsChanged (e);
51977 }}
51978 }, "~O,~N,~N");
51979 Clazz_defineMethod (c$, "fireIntervalAdded", 
51980 function (source, index0, index1) {
51981 var listeners = this.listenerList.getListenerList ();
51982 var e = null;
51983 for (var i = listeners.length - 2; i >= 0; i -= 2) {
51984 if (listeners[i] === javax.swing.event.ListDataListener) {
51985 if (e == null) {
51986 e =  new javax.swing.event.ListDataEvent (source, 1, index0, index1);
51987 }(listeners[i + 1]).intervalAdded (e);
51988 }}
51989 }, "~O,~N,~N");
51990 Clazz_defineMethod (c$, "fireIntervalRemoved", 
51991 function (source, index0, index1) {
51992 var listeners = this.listenerList.getListenerList ();
51993 var e = null;
51994 for (var i = listeners.length - 2; i >= 0; i -= 2) {
51995 if (listeners[i] === javax.swing.event.ListDataListener) {
51996 if (e == null) {
51997 e =  new javax.swing.event.ListDataEvent (source, 2, index0, index1);
51998 }(listeners[i + 1]).intervalRemoved (e);
51999 }}
52000 }, "~O,~N,~N");
52001 Clazz_defineMethod (c$, "getListeners", 
52002 function (listenerType) {
52003 return this.listenerList.getListeners (listenerType);
52004 }, "Class");
52005 });
52006 Clazz_declarePackage ("javax.swing");
52007 Clazz_declareInterface (javax.swing, "ListModel");
52008 Clazz_declarePackage ("javax.swing.event");
52009 Clazz_load (["java.util.EventObject"], "javax.swing.event.ListDataEvent", null, function () {
52010 c$ = Clazz_decorateAsClass (function () {
52011 this.type = 0;
52012 this.index0 = 0;
52013 this.index1 = 0;
52014 Clazz_instantialize (this, arguments);
52015 }, javax.swing.event, "ListDataEvent", java.util.EventObject);
52016 Clazz_defineMethod (c$, "getType", 
52017 function () {
52018 return this.type;
52019 });
52020 Clazz_defineMethod (c$, "getIndex0", 
52021 function () {
52022 return this.index0;
52023 });
52024 Clazz_defineMethod (c$, "getIndex1", 
52025 function () {
52026 return this.index1;
52027 });
52028 Clazz_makeConstructor (c$, 
52029 function (source, type, index0, index1) {
52030 Clazz_superConstructor (this, javax.swing.event.ListDataEvent, [source]);
52031 this.type = type;
52032 this.index0 = Math.min (index0, index1);
52033 this.index1 = Math.max (index0, index1);
52034 }, "~O,~N,~N,~N");
52035 Clazz_overrideMethod (c$, "toString", 
52036 function () {
52037 return this.getClass ().getName () + "[type=" + this.type + ",index0=" + this.index0 + ",index1=" + this.index1 + "]";
52038 });
52039 Clazz_defineStatics (c$,
52040 "CONTENTS_CHANGED", 0,
52041 "INTERVAL_ADDED", 1,
52042 "INTERVAL_REMOVED", 2);
52043 });
52044 Clazz_declarePackage ("javax.swing");
52045 Clazz_load (["javax.swing.ComboBoxModel"], "javax.swing.MutableComboBoxModel", null, function () {
52046 Clazz_declareInterface (javax.swing, "MutableComboBoxModel", javax.swing.ComboBoxModel);
52047 });
52048 Clazz_declarePackage ("javax.swing");
52049 Clazz_load (["javax.swing.ListModel"], "javax.swing.ComboBoxModel", null, function () {
52050 Clazz_declareInterface (javax.swing, "ComboBoxModel", javax.swing.ListModel);
52051 });
52052 Clazz_declarePackage ("jalview.schemes");
52053 Clazz_load (["jalview.schemes.FollowerColourScheme"], "jalview.schemes.AnnotationColourGradient", ["jalview.datamodel.AlignmentI", "$.GraphLine", "jalview.renderer.AnnotationRenderer", "jalview.schemes.ColourSchemeProperty", "jalview.util.Comparison", "java.awt.Color", "java.util.IdentityHashMap"], function () {
52054 c$ = Clazz_decorateAsClass (function () {
52055 this.annotation = null;
52056 this.aboveAnnotationThreshold = -1;
52057 this.thresholdIsMinMax = false;
52058 this.annotationThreshold = null;
52059 this.r1 = 0;
52060 this.g1 = 0;
52061 this.b1 = 0;
52062 this.rr = 0;
52063 this.gg = 0;
52064 this.bb = 0;
52065 this.predefinedColours = false;
52066 this.seqAssociated = false;
52067 this.noGradient = false;
52068 this.seqannot = null;
52069 this.aamin = 0;
52070 this.aamax = 0;
52071 Clazz_instantialize (this, arguments);
52072 }, jalview.schemes, "AnnotationColourGradient", jalview.schemes.FollowerColourScheme);
52073 Clazz_overrideMethod (c$, "applyTo", 
52074 function (sg, hiddenRepSequences) {
52075 var acg =  new jalview.schemes.AnnotationColourGradient (this.annotation, this.colourScheme, this.aboveAnnotationThreshold);
52076 acg.thresholdIsMinMax = this.thresholdIsMinMax;
52077 acg.annotationThreshold = (this.annotationThreshold == null) ? null :  new jalview.datamodel.GraphLine (this.annotationThreshold);
52078 acg.r1 = this.r1;
52079 acg.g1 = this.g1;
52080 acg.b1 = this.b1;
52081 acg.rr = this.rr;
52082 acg.gg = this.gg;
52083 acg.bb = this.bb;
52084 acg.predefinedColours = this.predefinedColours;
52085 acg.seqAssociated = this.seqAssociated;
52086 acg.noGradient = this.noGradient;
52087 return acg;
52088 }, "jalview.datamodel.AnnotatedCollectionI,java.util.Map");
52089 Clazz_makeConstructor (c$, 
52090 function (annotation, originalColour, aboveThreshold) {
52091 Clazz_superConstructor (this, jalview.schemes.AnnotationColourGradient, []);
52092 if (Clazz_instanceOf (originalColour, jalview.schemes.AnnotationColourGradient)) {
52093 this.colourScheme = (originalColour).colourScheme;
52094 } else {
52095 this.colourScheme = originalColour;
52096 }this.annotation = annotation;
52097 this.aboveAnnotationThreshold = aboveThreshold;
52098 if (aboveThreshold != -1 && annotation.threshold != null) {
52099 this.annotationThreshold = annotation.threshold;
52100 }this.r1 = 254;
52101 this.g1 = 254;
52102 this.b1 = 254;
52103 this.rr = 0;
52104 this.gg = 0;
52105 this.bb = 0;
52106 this.noGradient = true;
52107 }, "jalview.datamodel.AlignmentAnnotation,jalview.schemes.ColourSchemeI,~N");
52108 Clazz_makeConstructor (c$, 
52109 function (annotation, minColour, maxColour, aboveThreshold) {
52110 Clazz_superConstructor (this, jalview.schemes.AnnotationColourGradient, []);
52111 this.annotation = annotation;
52112 this.aboveAnnotationThreshold = aboveThreshold;
52113 if (aboveThreshold != -1 && annotation.threshold != null) {
52114 this.annotationThreshold = annotation.threshold;
52115 }this.r1 = minColour.getRed ();
52116 this.g1 = minColour.getGreen ();
52117 this.b1 = minColour.getBlue ();
52118 this.rr = maxColour.getRed () - this.r1;
52119 this.gg = maxColour.getGreen () - this.g1;
52120 this.bb = maxColour.getBlue () - this.b1;
52121 this.noGradient = false;
52122 this.aamax = annotation.graphMax;
52123 this.aamin = annotation.graphMin;
52124 if (annotation.isRNA ()) {
52125 jalview.schemes.ColourSchemeProperty.initRnaHelicesShading (1 + Clazz_floatToInt (this.aamax));
52126 }}, "jalview.datamodel.AlignmentAnnotation,java.awt.Color,java.awt.Color,~N");
52127 Clazz_defineMethod (c$, "alignmentChanged", 
52128 function (alignment, hiddenReps) {
52129 Clazz_superCall (this, jalview.schemes.AnnotationColourGradient, "alignmentChanged", [alignment, hiddenReps]);
52130 if (this.seqAssociated && this.annotation.getCalcId () != null) {
52131 if (this.seqannot != null) {
52132 this.seqannot.clear ();
52133 } else {
52134 this.seqannot =  new java.util.IdentityHashMap ();
52135 }var alcontext = Clazz_instanceOf (alignment, jalview.datamodel.AlignmentI) ? alignment : alignment.getContext ();
52136 var f = true;
52137 var rna = false;
52138 for (var alan, $alan = alcontext.findAnnotation (this.annotation.getCalcId ()).iterator (); $alan.hasNext () && ((alan = $alan.next ()) || true);) {
52139 if (alan.sequenceRef != null && (alan.label != null && this.annotation != null && alan.label.equals (this.annotation.label))) {
52140 if (!rna && alan.isRNA ()) {
52141 rna = true;
52142 }this.seqannot.put (alan.sequenceRef, alan);
52143 if (f || alan.graphMax > this.aamax) {
52144 this.aamax = alan.graphMax;
52145 }if (f || alan.graphMin < this.aamin) {
52146 this.aamin = alan.graphMin;
52147 }f = false;
52148 }}
52149 if (rna) {
52150 jalview.schemes.ColourSchemeProperty.initRnaHelicesShading (1 + Clazz_floatToInt (this.aamax));
52151 }}}, "jalview.datamodel.AnnotatedCollectionI,java.util.Map");
52152 Clazz_defineMethod (c$, "getAnnotation", 
52153 function () {
52154 return this.annotation.label;
52155 });
52156 Clazz_defineMethod (c$, "getAboveThreshold", 
52157 function () {
52158 return this.aboveAnnotationThreshold;
52159 });
52160 Clazz_defineMethod (c$, "getAnnotationThreshold", 
52161 function () {
52162 if (this.annotationThreshold == null) {
52163 return 0;
52164 } else {
52165 return this.annotationThreshold.value;
52166 }});
52167 Clazz_defineMethod (c$, "getMinColour", 
52168 function () {
52169 return  new java.awt.Color (Clazz_floatToInt (this.r1), Clazz_floatToInt (this.g1), Clazz_floatToInt (this.b1));
52170 });
52171 Clazz_defineMethod (c$, "getMaxColour", 
52172 function () {
52173 return  new java.awt.Color (Clazz_floatToInt (this.r1 + this.rr), Clazz_floatToInt (this.g1 + this.gg), Clazz_floatToInt (this.b1 + this.bb));
52174 });
52175 Clazz_overrideMethod (c$, "findColour", 
52176 function (c) {
52177 return java.awt.Color.red;
52178 }, "~S");
52179 Clazz_overrideMethod (c$, "findColourSeq", 
52180 function (c, j, seq) {
52181 var currentColour = java.awt.Color.white;
52182 var annotation = (this.seqAssociated && this.seqannot != null ? this.seqannot.get (seq) : this.annotation);
52183 if (annotation == null) {
52184 return currentColour;
52185 }if ((this.threshold == 0) || this.aboveThreshold (c, j)) {
52186 if (annotation.annotations != null && j < annotation.annotations.length && annotation.annotations[j] != null && !jalview.util.Comparison.isGap (c)) {
52187 var aj = annotation.annotations[j];
52188 if (this.aboveAnnotationThreshold == -1 || (this.annotationThreshold != null && (this.aboveAnnotationThreshold == 1 ? aj.value >= this.annotationThreshold.value : aj.value <= this.annotationThreshold.value))) {
52189 if (this.predefinedColours && aj.colour != null && !aj.colour.equals (java.awt.Color.black)) {
52190 currentColour = aj.colour;
52191 } else if (annotation.hasIcons && annotation.graph == 0) {
52192 if (aj.secondaryStructure > ' ' && aj.secondaryStructure != '.' && aj.secondaryStructure != '-') {
52193 if (this.colourScheme != null) {
52194 currentColour = this.colourScheme.findColourSeq (c, j, seq);
52195 } else {
52196 if (annotation.isRNA ()) {
52197 currentColour = jalview.schemes.ColourSchemeProperty.rnaHelices[Clazz_floatToInt (aj.value)];
52198 } else {
52199 currentColour = annotation.annotations[j].secondaryStructure == 'H' ? jalview.renderer.AnnotationRenderer.HELIX_COLOUR : annotation.annotations[j].secondaryStructure == 'E' ? jalview.renderer.AnnotationRenderer.SHEET_COLOUR : jalview.renderer.AnnotationRenderer.STEM_COLOUR;
52200 }}} else {
52201 return java.awt.Color.white;
52202 }} else if (this.noGradient) {
52203 if (this.colourScheme != null) {
52204 currentColour = this.colourScheme.findColourSeq (c, j, seq);
52205 } else {
52206 if (aj.colour != null) {
52207 currentColour = aj.colour;
52208 }}} else {
52209 currentColour = this.shadeCalculation (annotation, j);
52210 }}if (this.conservationColouring) {
52211 currentColour = this.applyConservation (currentColour, j);
52212 }}}return currentColour;
52213 }, "~S,~N,jalview.datamodel.SequenceI");
52214 Clazz_defineMethod (c$, "shadeCalculation", 
52215  function (annotation, j) {
52216 var range = 1;
52217 if (this.thresholdIsMinMax && annotation.threshold != null && this.aboveAnnotationThreshold == 1 && annotation.annotations[j].value >= annotation.threshold.value) {
52218 range = (annotation.annotations[j].value - annotation.threshold.value) / (annotation.graphMax - annotation.threshold.value);
52219 } else if (this.thresholdIsMinMax && annotation.threshold != null && this.aboveAnnotationThreshold == 0 && annotation.annotations[j].value >= annotation.graphMin) {
52220 range = (annotation.annotations[j].value - annotation.graphMin) / (annotation.threshold.value - annotation.graphMin);
52221 } else {
52222 if (annotation.graphMax != annotation.graphMin) {
52223 range = (annotation.annotations[j].value - annotation.graphMin) / (annotation.graphMax - annotation.graphMin);
52224 } else {
52225 range = 0;
52226 }}var dr = Clazz_floatToInt (this.rr * range + this.r1);
52227 var dg = Clazz_floatToInt (this.gg * range + this.g1);
52228 var db = Clazz_floatToInt (this.bb * range + this.b1);
52229 return  new java.awt.Color (dr, dg, db);
52230 }, "jalview.datamodel.AlignmentAnnotation,~N");
52231 Clazz_defineMethod (c$, "isPredefinedColours", 
52232 function () {
52233 return this.predefinedColours;
52234 });
52235 Clazz_defineMethod (c$, "setPredefinedColours", 
52236 function (predefinedColours) {
52237 this.predefinedColours = predefinedColours;
52238 }, "~B");
52239 Clazz_defineMethod (c$, "isSeqAssociated", 
52240 function () {
52241 return this.seqAssociated;
52242 });
52243 Clazz_defineMethod (c$, "setSeqAssociated", 
52244 function (sassoc) {
52245 this.seqAssociated = sassoc;
52246 }, "~B");
52247 Clazz_defineStatics (c$,
52248 "NO_THRESHOLD", -1,
52249 "BELOW_THRESHOLD", 0,
52250 "ABOVE_THRESHOLD", 1);
52251 });
52252 Clazz_declarePackage ("jalview.schemes");
52253 Clazz_load (["jalview.schemes.ResidueColourScheme"], "jalview.schemes.FollowerColourScheme", null, function () {
52254 c$ = Clazz_decorateAsClass (function () {
52255 this.colourScheme = null;
52256 Clazz_instantialize (this, arguments);
52257 }, jalview.schemes, "FollowerColourScheme", jalview.schemes.ResidueColourScheme);
52258 Clazz_defineMethod (c$, "getBaseColour", 
52259 function () {
52260 return this.colourScheme;
52261 });
52262 Clazz_overrideMethod (c$, "setConsensus", 
52263 function (consensus) {
52264 if (this.colourScheme != null) {
52265 this.colourScheme.setConsensus (consensus);
52266 }}, "~A");
52267 Clazz_overrideMethod (c$, "setConservation", 
52268 function (cons) {
52269 if (this.colourScheme != null) {
52270 this.colourScheme.setConservation (cons);
52271 }}, "jalview.analysis.Conservation");
52272 Clazz_overrideMethod (c$, "setConservationInc", 
52273 function (i) {
52274 if (this.colourScheme != null) {
52275 this.colourScheme.setConservationInc (i);
52276 }}, "~N");
52277 });
52278 Clazz_declarePackage ("jalview.renderer");
52279 Clazz_load (["jalview.util.Platform", "java.awt.Color"], "jalview.renderer.AnnotationRenderer", ["awt2swing.Util", "jalview.analysis.AAFrequency", "$.CodingUtils", "$.StructureFrequency", "jalview.jsdev.RegExp", "jalview.schemes.NucleotideColourScheme", "$.ResidueProperties", "$.ZappoColourScheme", "java.awt.BasicStroke", "java.awt.geom.AffineTransform", "java.util.BitSet"], function () {
52280 c$ = Clazz_decorateAsClass (function () {
52281 this.debugRedraw = false;
52282 this.charWidth = 0;
52283 this.endRes = 0;
52284 this.charHeight = 0;
52285 this.validCharWidth = false;
52286 this.hasHiddenColumns = false;
52287 this.fm = null;
52288 this.MAC = false;
52289 this.av_renderHistogram = true;
52290 this.av_renderProfile = true;
52291 this.av_normaliseProfile = false;
52292 this.profcolour = null;
52293 this.columnSelection = null;
52294 this.hconsensus = null;
52295 this.complementConsensus = null;
52296 this.hStrucConsensus = null;
52297 this.av_ignoreGapsConsensus = false;
52298 this.fadedImage = null;
52299 this.annotationPanel = null;
52300 this.imgWidth = 0;
52301 this.sOffset = 0;
52302 this.visHeight = 0;
52303 this.useClip = true;
52304 this.canClip = false;
52305 this.rna = false;
52306 this.sdNOTCANONICAL_COLOUR = null;
52307 Clazz_instantialize (this, arguments);
52308 }, jalview.renderer, "AnnotationRenderer");
52309 Clazz_prepareFields (c$, function () {
52310 this.MAC = jalview.util.Platform.isAMac ();
52311 });
52312 Clazz_makeConstructor (c$, 
52313 function () {
52314 this.construct (false);
52315 });
52316 Clazz_makeConstructor (c$, 
52317 function (debugRedraw) {
52318 this.debugRedraw = debugRedraw;
52319 }, "~B");
52320 Clazz_defineMethod (c$, "drawStemAnnot", 
52321 function (g, row_annotations, lastSSX, x, y, iconOffset, startRes, column, validRes, validEnd) {
52322 g.setColor (jalview.renderer.AnnotationRenderer.STEM_COLOUR);
52323 var sCol = (Clazz_doubleToInt (lastSSX / this.charWidth)) + startRes;
52324 var x1 = lastSSX;
52325 var x2 = (x * this.charWidth);
52326 var closeparen = jalview.jsdev.RegExp.newRegex (["(\\))"]);
52327 var dc = (column == 0 || row_annotations[column - 1] == null) ? ' ' : row_annotations[column - 1].secondaryStructure;
52328 var diffupstream = sCol == 0 || row_annotations[sCol - 1] == null || dc != row_annotations[sCol - 1].secondaryStructure;
52329 var diffdownstream = !validRes || !validEnd || row_annotations[column] == null || dc != row_annotations[column].secondaryStructure;
52330 if (column > 0 && jalview.schemes.ResidueProperties.isCloseParenRNA (dc)) {
52331 if (diffupstream) {
52332 g.fillPolygon ( Clazz_newIntArray (-1, [lastSSX + 5, lastSSX + 5, lastSSX]),  Clazz_newIntArray (-1, [y + iconOffset, y + 14 + iconOffset, y + 8 + iconOffset]), 3);
52333 x1 += 5;
52334 }if (diffdownstream) {
52335 x2 -= 1;
52336 }} else {
52337 if (diffdownstream) {
52338 g.fillPolygon ( Clazz_newIntArray (-1, [x2 - 5, x2 - 5, x2]),  Clazz_newIntArray (-1, [y + iconOffset, y + 14 + iconOffset, y + 8 + iconOffset]), 3);
52339 x2 -= 5;
52340 }if (diffupstream) {
52341 x1 += 1;
52342 }}g.fillRect (x1, y + 4 + iconOffset, x2 - x1, 7);
52343 }, "java.awt.Graphics,~A,~N,~N,~N,~N,~N,~N,~B,~B");
52344 Clazz_defineMethod (c$, "drawNotCanonicalAnnot", 
52345 function (g, nonCanColor, row_annotations, lastSSX, x, y, iconOffset, startRes, column, validRes, validEnd) {
52346 g.setColor (nonCanColor);
52347 var sCol = (Clazz_doubleToInt (lastSSX / this.charWidth)) + startRes;
52348 var x1 = lastSSX;
52349 var x2 = (x * this.charWidth);
52350 var closeparen = jalview.jsdev.RegExp.newRegex (["}|]|<|[a-z]"]);
52351 var dc = (column == 0 || row_annotations[column - 1] == null) ? "" : row_annotations[column - 1].displayCharacter;
52352 var diffupstream = sCol == 0 || row_annotations[sCol - 1] == null || !dc.equals (row_annotations[sCol - 1].displayCharacter);
52353 var diffdownstream = !validRes || !validEnd || row_annotations[column] == null || !dc.equals (row_annotations[column].displayCharacter);
52354 if (column > 0 && closeparen.search (dc)) {
52355 if (diffupstream) {
52356 g.fillPolygon ( Clazz_newIntArray (-1, [lastSSX + 5, lastSSX + 5, lastSSX]),  Clazz_newIntArray (-1, [y + iconOffset, y + 14 + iconOffset, y + 8 + iconOffset]), 3);
52357 x1 += 5;
52358 }if (diffdownstream) {
52359 x2 -= 1;
52360 }} else {
52361 if (diffdownstream) {
52362 g.fillPolygon ( Clazz_newIntArray (-1, [x2 - 5, x2 - 5, x2]),  Clazz_newIntArray (-1, [y + iconOffset, y + 14 + iconOffset, y + 8 + iconOffset]), 3);
52363 x2 -= 5;
52364 }if (diffupstream) {
52365 x1 += 1;
52366 }}g.fillRect (x1, y + 4 + iconOffset, x2 - x1, 7);
52367 }, "java.awt.Graphics,java.awt.Color,~A,~N,~N,~N,~N,~N,~N,~B,~B");
52368 Clazz_defineMethod (c$, "updateFromAwtRenderPanel", 
52369 function (annotPanel, av) {
52370 this.fm = annotPanel.getFontMetrics ();
52371 this.annotationPanel = annotPanel;
52372 this.fadedImage = annotPanel.getFadedImage ();
52373 this.imgWidth = annotPanel.getFadedImageWidth ();
52374 var bounds = annotPanel.getVisibleVRange ();
52375 if (bounds != null) {
52376 this.sOffset = bounds[0];
52377 this.visHeight = bounds[1];
52378 if (this.visHeight == 0) {
52379 this.useClip = false;
52380 } else {
52381 this.useClip = this.canClip;
52382 }} else {
52383 this.useClip = false;
52384 }this.updateFromAlignViewport (av);
52385 }, "jalview.renderer.AwtRenderPanelI,jalview.api.AlignViewportI");
52386 Clazz_defineMethod (c$, "updateFromAlignViewport", 
52387 function (av) {
52388 this.charWidth = av.getCharWidth ();
52389 this.endRes = av.getEndRes ();
52390 this.charHeight = av.getCharHeight ();
52391 this.hasHiddenColumns = av.hasHiddenColumns ();
52392 this.validCharWidth = av.isValidCharWidth ();
52393 this.av_renderHistogram = av.isShowConsensusHistogram ();
52394 this.av_renderProfile = av.isShowSequenceLogo ();
52395 this.av_normaliseProfile = av.isNormaliseSequenceLogo ();
52396 this.profcolour = av.getGlobalColourScheme ();
52397 if (this.profcolour == null) {
52398 this.profcolour = av.getAlignment ().isNucleotide () ?  new jalview.schemes.NucleotideColourScheme () :  new jalview.schemes.ZappoColourScheme ();
52399 }this.columnSelection = av.getColumnSelection ();
52400 this.hconsensus = av.getSequenceConsensusHash ();
52401 this.complementConsensus = av.getComplementConsensusHash ();
52402 this.hStrucConsensus = av.getRnaStructureConsensusHash ();
52403 this.av_ignoreGapsConsensus = av.isIgnoreGapsConsensus ();
52404 }, "jalview.api.AlignViewportI");
52405 Clazz_defineMethod (c$, "getProfileFor", 
52406 function (aa, column) {
52407 if (aa.autoCalculated && (aa.label.startsWith ("Consensus") || aa.label.startsWith ("cDNA Consensus"))) {
52408 var forComplement = aa.label.startsWith ("cDNA Consensus");
52409 if (aa.groupRef != null && aa.groupRef.consensusData != null && aa.groupRef.isShowSequenceLogo ()) {
52410 return jalview.analysis.AAFrequency.extractProfile (aa.groupRef.consensusData[column], aa.groupRef.getIgnoreGapsConsensus ());
52411 }if (aa.groupRef == null && aa.sequenceRef == null) {
52412 if (forComplement) {
52413 return jalview.analysis.AAFrequency.extractCdnaProfile (this.complementConsensus[column], this.av_ignoreGapsConsensus);
52414 } else {
52415 return jalview.analysis.AAFrequency.extractProfile (this.hconsensus[column], this.av_ignoreGapsConsensus);
52416 }}} else {
52417 if (aa.autoCalculated && aa.label.startsWith ("StrucConsensus")) {
52418 if (aa.groupRef == null && aa.sequenceRef == null && this.hStrucConsensus != null && this.hStrucConsensus.length > column) {
52419 return jalview.analysis.StructureFrequency.extractProfile (this.hStrucConsensus[column], this.av_ignoreGapsConsensus);
52420 }}}return null;
52421 }, "jalview.datamodel.AlignmentAnnotation,~N");
52422 Clazz_defineMethod (c$, "drawComponent", 
52423 function (annotPanel, av, g, activeRow, startRes, endRes) {
52424 var stime = System.currentTimeMillis ();
52425 var usedFaded = false;
52426 this.updateFromAwtRenderPanel (annotPanel, av);
52427 this.fm = g.getFontMetrics ();
52428 var aa = av.getAlignment ().getAlignmentAnnotation ();
52429 var temp = 0;
52430 if (aa == null) {
52431 return false;
52432 }var x = 0;
52433 var y = 0;
52434 var column = 0;
52435 var lastSS;
52436 var lastSSX;
52437 var iconOffset = 0;
52438 var validRes = false;
52439 var validEnd = false;
52440 var labelAllCols = false;
52441 var centreColLabels;
52442 var centreColLabelsDef = av.isCentreColumnLabels ();
52443 var scaleColLabel = false;
52444 var consensusAnnot = av.getAlignmentConsensusAnnotation ();
52445 var structConsensusAnnot = av.getAlignmentStrucConsensusAnnotation ();
52446 var complementConsensusAnnot = av.getComplementConsensusAnnotation ();
52447 var renderHistogram = true;
52448 var renderProfile = true;
52449 var normaliseProfile = false;
52450 var isRNA = this.rna;
52451 var graphGroupDrawn =  new java.util.BitSet ();
52452 var charOffset = 0;
52453 var fmWidth;
52454 var fmScaling = 1;
52455 var ofont = g.getFont ();
52456 var yfrom = 0;
52457 var f_i = 0;
52458 var yto = 0;
52459 var f_to = 0;
52460 var clipst = false;
52461 var clipend = false;
52462 for (var i = 0; i < aa.length; i++) {
52463 var row = aa[i];
52464 isRNA = row.isRNA ();
52465 {
52466 if (row.groupRef != null && row === row.groupRef.getConsensus ()) {
52467 renderHistogram = row.groupRef.isShowConsensusHistogram ();
52468 renderProfile = row.groupRef.isShowSequenceLogo ();
52469 normaliseProfile = row.groupRef.isNormaliseSequenceLogo ();
52470 } else if (row === consensusAnnot || row === structConsensusAnnot || row === complementConsensusAnnot) {
52471 renderHistogram = this.av_renderHistogram;
52472 renderProfile = this.av_renderProfile;
52473 normaliseProfile = this.av_normaliseProfile;
52474 } else {
52475 renderHistogram = true;
52476 }}var row_annotations = row.annotations;
52477 if (!row.visible) {
52478 continue;
52479 }centreColLabels = row.centreColLabels || centreColLabelsDef;
52480 labelAllCols = row.showAllColLabels;
52481 scaleColLabel = row.scaleColLabel;
52482 lastSS = ' ';
52483 lastSSX = 0;
52484 if (!this.useClip || ((y - this.charHeight) < this.visHeight && (y + row.height + this.charHeight * 2) >= this.sOffset)) {
52485 if (!clipst) {
52486 clipst = true;
52487 yfrom = y;
52488 f_i = i;
52489 }yto = y;
52490 f_to = i;
52491 if (row.graph > 0) {
52492 if (row.graphGroup > -1 && graphGroupDrawn.get (row.graphGroup)) {
52493 continue;
52494 }y += row.height;
52495 if (row.hasText) {
52496 iconOffset = this.charHeight - this.fm.getDescent ();
52497 y -= this.charHeight;
52498 }} else if (row.hasText) {
52499 iconOffset = this.charHeight - this.fm.getDescent ();
52500 } else {
52501 iconOffset = 0;
52502 }if (row.autoCalculated && av.isCalculationInProgress (row)) {
52503 y += this.charHeight;
52504 usedFaded = true;
52505 g.drawImage (this.fadedImage, 0, y - row.height, this.imgWidth, y, 0, y - row.height, this.imgWidth, y, this.annotationPanel);
52506 g.setColor (java.awt.Color.black);
52507 continue;
52508 }x = (startRes == 0) ? 0 : -1;
52509 while (x < endRes - startRes) {
52510 if (this.hasHiddenColumns) {
52511 column = this.columnSelection.adjustForHiddenColumns (startRes + x);
52512 if (column > row_annotations.length - 1) {
52513 break;
52514 }} else {
52515 column = startRes + x;
52516 }if ((row_annotations == null) || (row_annotations.length <= column) || (row_annotations[column] == null)) {
52517 validRes = false;
52518 } else {
52519 validRes = true;
52520 }var displayChar = validRes ? row_annotations[column].displayCharacter : null;
52521 if (x > -1) {
52522 if (activeRow == i) {
52523 g.setColor (java.awt.Color.red);
52524 if (this.columnSelection != null) {
52525 for (var n = 0; n < this.columnSelection.size (); n++) {
52526 var v = this.columnSelection.columnAt (n);
52527 if (v == column) {
52528 g.fillRect (x * this.charWidth, y, this.charWidth, this.charHeight);
52529 }}
52530 }}if (row.getInvalidStrucPos () > x) {
52531 g.setColor (java.awt.Color.orange);
52532 g.fillRect (x * this.charWidth, y, this.charWidth, this.charHeight);
52533 } else if (row.getInvalidStrucPos () == x) {
52534 g.setColor (java.awt.Color.orange.darker ());
52535 g.fillRect (x * this.charWidth, y, this.charWidth, this.charHeight);
52536 }if (this.validCharWidth && validRes && displayChar != null && (displayChar.length > 0)) {
52537 fmWidth = this.fm.charsWidth (displayChar.toCharArray (), 0, displayChar.length);
52538 if (scaleColLabel) {
52539 if (fmWidth > this.charWidth) {
52540 fmScaling = this.charWidth;
52541 fmScaling /= fmWidth;
52542 g.setFont (ofont.deriveFont (java.awt.geom.AffineTransform.getScaleInstance (fmScaling, 1.0)));
52543 fmWidth = this.charWidth;
52544 }}charOffset = Clazz_floatToInt ((this.charWidth - fmWidth) / 2);
52545 if (row_annotations[column].colour == null) {
52546 g.setColor (java.awt.Color.black);
52547 } else {
52548 g.setColor (row_annotations[column].colour);
52549 }if (column == 0 || row.graph > 0) {
52550 awt2swing.Util.drawString (g, displayChar, (x * this.charWidth) + charOffset, y + iconOffset);
52551 } else if (row_annotations[column - 1] == null || (labelAllCols || !displayChar.equals (row_annotations[column - 1].displayCharacter) || (displayChar.length < 2 && row_annotations[column].secondaryStructure == ' '))) {
52552 awt2swing.Util.drawString (g, displayChar, x * this.charWidth + charOffset, y + iconOffset);
52553 }g.setFont (ofont);
52554 }}if (row.hasIcons) {
52555 var ss = validRes ? row_annotations[column].secondaryStructure : '-';
52556 if (ss == '(') {
52557 if (displayChar.indexOf (')') > -1) {
52558 ss = ')';
52559 }}if (ss == '[') {
52560 if ((displayChar.indexOf (']') > -1)) {
52561 ss = ']';
52562 }}if (ss == '{') {
52563 if (displayChar.indexOf ('}') > -1) {
52564 ss = '}';
52565 }}if (ss == '<') {
52566 if (displayChar.indexOf ('<') > -1) {
52567 ss = '>';
52568 }}if (ss.charCodeAt (0) >= 65) {
52569 if (displayChar.indexOf (ss.charCodeAt (0) + 32) > -1) {
52570 ss = String.fromCharCode (ss.charCodeAt (0) + 32);
52571 }}if (!validRes || (ss != lastSS)) {
52572 if (x > -1) {
52573 var nb_annot = x - temp;
52574 switch (lastSS) {
52575 case '(':
52576 case ')':
52577 this.drawStemAnnot (g, row_annotations, lastSSX, x, y, iconOffset, startRes, column, validRes, validEnd);
52578 temp = x;
52579 break;
52580 case 'H':
52581 if (!isRNA) {
52582 this.drawHelixAnnot (g, row_annotations, lastSSX, x, y, iconOffset, startRes, column, validRes, validEnd);
52583 break;
52584 }case 'E':
52585 if (!isRNA) {
52586 this.drawSheetAnnot (g, row_annotations, lastSSX, x, y, iconOffset, startRes, column, validRes, validEnd);
52587 break;
52588 }case '{':
52589 case '}':
52590 case '[':
52591 case ']':
52592 case '>':
52593 case '<':
52594 case 'A':
52595 case 'a':
52596 case 'B':
52597 case 'b':
52598 case 'C':
52599 case 'c':
52600 case 'D':
52601 case 'd':
52602 case 'e':
52603 case 'F':
52604 case 'f':
52605 case 'G':
52606 case 'g':
52607 case 'h':
52608 case 'I':
52609 case 'i':
52610 case 'J':
52611 case 'j':
52612 case 'K':
52613 case 'k':
52614 case 'L':
52615 case 'l':
52616 case 'M':
52617 case 'm':
52618 case 'N':
52619 case 'n':
52620 case 'O':
52621 case 'o':
52622 case 'P':
52623 case 'p':
52624 case 'Q':
52625 case 'q':
52626 case 'R':
52627 case 'r':
52628 case 'S':
52629 case 's':
52630 case 'T':
52631 case 't':
52632 case 'U':
52633 case 'u':
52634 case 'V':
52635 case 'v':
52636 case 'W':
52637 case 'w':
52638 case 'X':
52639 case 'x':
52640 case 'Y':
52641 case 'y':
52642 case 'Z':
52643 case 'z':
52644 var nonCanColor = this.getNotCanonicalColor (lastSS);
52645 this.drawNotCanonicalAnnot (g, nonCanColor, row_annotations, lastSSX, x, y, iconOffset, startRes, column, validRes, validEnd);
52646 temp = x;
52647 break;
52648 default:
52649 g.setColor (java.awt.Color.gray);
52650 g.fillRect (lastSSX, y + 6 + iconOffset, (x * this.charWidth) - lastSSX, 2);
52651 temp = x;
52652 break;
52653 }
52654 }if (validRes) {
52655 lastSS = ss;
52656 } else {
52657 lastSS = ' ';
52658 }if (x > -1) {
52659 lastSSX = (x * this.charWidth);
52660 }}}column++;
52661 x++;
52662 }
52663 if (column >= row_annotations.length) {
52664 column = row_annotations.length - 1;
52665 validEnd = false;
52666 } else {
52667 validEnd = true;
52668 }if ((row_annotations == null) || (row_annotations.length <= column) || (row_annotations[column] == null)) {
52669 validRes = false;
52670 } else {
52671 validRes = true;
52672 }if (row.hasIcons) {
52673 switch (lastSS) {
52674 case 'H':
52675 if (!isRNA) {
52676 this.drawHelixAnnot (g, row_annotations, lastSSX, x, y, iconOffset, startRes, column, validRes, validEnd);
52677 break;
52678 }case 'E':
52679 if (!isRNA) {
52680 this.drawSheetAnnot (g, row_annotations, lastSSX, x, y, iconOffset, startRes, column, validRes, validEnd);
52681 break;
52682 }case '(':
52683 case ')':
52684 this.drawStemAnnot (g, row_annotations, lastSSX, x, y, iconOffset, startRes, column, validRes, validEnd);
52685 break;
52686 case '{':
52687 case '}':
52688 case '[':
52689 case ']':
52690 case '>':
52691 case '<':
52692 case 'A':
52693 case 'a':
52694 case 'B':
52695 case 'b':
52696 case 'C':
52697 case 'c':
52698 case 'D':
52699 case 'd':
52700 case 'e':
52701 case 'F':
52702 case 'f':
52703 case 'G':
52704 case 'g':
52705 case 'h':
52706 case 'I':
52707 case 'i':
52708 case 'J':
52709 case 'j':
52710 case 'K':
52711 case 'k':
52712 case 'L':
52713 case 'l':
52714 case 'M':
52715 case 'm':
52716 case 'N':
52717 case 'n':
52718 case 'O':
52719 case 'o':
52720 case 'P':
52721 case 'p':
52722 case 'Q':
52723 case 'q':
52724 case 'R':
52725 case 'r':
52726 case 'T':
52727 case 't':
52728 case 'U':
52729 case 'u':
52730 case 'V':
52731 case 'v':
52732 case 'W':
52733 case 'w':
52734 case 'X':
52735 case 'x':
52736 case 'Y':
52737 case 'y':
52738 case 'Z':
52739 case 'z':
52740 var nonCanColor = this.getNotCanonicalColor (lastSS);
52741 this.drawNotCanonicalAnnot (g, nonCanColor, row_annotations, lastSSX, x, y, iconOffset, startRes, column, validRes, validEnd);
52742 break;
52743 default:
52744 this.drawGlyphLine (g, row_annotations, lastSSX, x, y, iconOffset, startRes, column, validRes, validEnd);
52745 break;
52746 }
52747 }if (row.graph > 0 && row.graphHeight > 0) {
52748 if (row.graph == 2) {
52749 if (row.graphGroup > -1 && !graphGroupDrawn.get (row.graphGroup)) {
52750 var groupmax = -999999;
52751 var groupmin = 9999999;
52752 for (var gg = 0; gg < aa.length; gg++) {
52753 if (aa[gg].graphGroup != row.graphGroup) {
52754 continue;
52755 }if (aa[gg] !== row) {
52756 aa[gg].visible = false;
52757 }if (aa[gg].graphMax > groupmax) {
52758 groupmax = aa[gg].graphMax;
52759 }if (aa[gg].graphMin < groupmin) {
52760 groupmin = aa[gg].graphMin;
52761 }}
52762 for (var gg = 0; gg < aa.length; gg++) {
52763 if (aa[gg].graphGroup == row.graphGroup) {
52764 this.drawLineGraph (g, aa[gg], aa[gg].annotations, startRes, endRes, y, groupmin, groupmax, row.graphHeight);
52765 }}
52766 graphGroupDrawn.set (row.graphGroup);
52767 } else {
52768 this.drawLineGraph (g, row, row_annotations, startRes, endRes, y, row.graphMin, row.graphMax, row.graphHeight);
52769 }} else if (row.graph == 1) {
52770 this.drawBarGraph (g, row, row_annotations, startRes, endRes, row.graphMin, row.graphMax, y, renderHistogram, renderProfile, normaliseProfile);
52771 }}} else {
52772 if (clipst && !clipend) {
52773 clipend = true;
52774 }}if (row.graph > 0 && row.hasText) {
52775 y += this.charHeight;
52776 }if (row.graph == 0) {
52777 y += aa[i].height;
52778 }}
52779 if (this.debugRedraw) {
52780 if (this.canClip) {
52781 if (clipst) {
52782 System.err.println ("Start clip at : " + yfrom + " (index " + f_i + ")");
52783 }if (clipend) {
52784 System.err.println ("End clip at : " + yto + " (index " + f_to + ")");
52785 }};System.err.println ("Annotation Rendering time:" + (System.currentTimeMillis () - stime));
52786 };return !usedFaded;
52787 }, "jalview.renderer.AwtRenderPanelI,jalview.api.AlignViewportI,java.awt.Graphics,~N,~N,~N");
52788 Clazz_defineMethod (c$, "drawGlyphLine", 
52789 function (g, row, lastSSX, x, y, iconOffset, startRes, column, validRes, validEnd) {
52790 g.setColor (jalview.renderer.AnnotationRenderer.GLYPHLINE_COLOR);
52791 g.fillRect (lastSSX, y + 6 + iconOffset, (x * this.charWidth) - lastSSX, 2);
52792 }, "java.awt.Graphics,~A,~N,~N,~N,~N,~N,~N,~B,~B");
52793 Clazz_defineMethod (c$, "drawSheetAnnot", 
52794 function (g, row, lastSSX, x, y, iconOffset, startRes, column, validRes, validEnd) {
52795 g.setColor (jalview.renderer.AnnotationRenderer.SHEET_COLOUR);
52796 if (!validEnd || !validRes || row == null || row[column] == null || row[column].secondaryStructure != 'E') {
52797 g.fillRect (lastSSX, y + 4 + iconOffset, (x * this.charWidth) - lastSSX - 4, 7);
52798 g.fillPolygon ( Clazz_newIntArray (-1, [(x * this.charWidth) - 4, (x * this.charWidth) - 4, (x * this.charWidth)]),  Clazz_newIntArray (-1, [y + iconOffset, y + 14 + iconOffset, y + 7 + iconOffset]), 3);
52799 } else {
52800 g.fillRect (lastSSX, y + 4 + iconOffset, (x + 1) * this.charWidth - lastSSX, 7);
52801 }}, "java.awt.Graphics,~A,~N,~N,~N,~N,~N,~N,~B,~B");
52802 Clazz_defineMethod (c$, "drawHelixAnnot", 
52803 function (g, row, lastSSX, x, y, iconOffset, startRes, column, validRes, validEnd) {
52804 g.setColor (jalview.renderer.AnnotationRenderer.HELIX_COLOUR);
52805 var sCol = (Clazz_doubleToInt (lastSSX / this.charWidth)) + startRes;
52806 var x1 = lastSSX;
52807 var x2 = (x * this.charWidth);
52808 if (this.MAC) {
52809 var ofs = Clazz_doubleToInt (this.charWidth / 2);
52810 g.fillRoundRect (lastSSX, y + 4 + iconOffset, x2 - x1, 8, 8, 8);
52811 if (sCol == 0 || row[sCol - 1] == null || row[sCol - 1].secondaryStructure != 'H') {
52812 } else {
52813 g.fillRoundRect (lastSSX, y + 4 + iconOffset, x2 - x1 - ofs + 1, 8, 0, 0);
52814 }if (!validRes || row[column] == null || row[column].secondaryStructure != 'H') {
52815 } else {
52816 g.fillRoundRect (lastSSX + ofs, y + 4 + iconOffset, x2 - x1 - ofs + 1, 8, 0, 0);
52817 }return;
52818 }if (sCol == 0 || row[sCol - 1] == null || row[sCol - 1].secondaryStructure != 'H') {
52819 g.fillArc (lastSSX, y + 4 + iconOffset, this.charWidth, 8, 90, 180);
52820 x1 += Clazz_doubleToInt (this.charWidth / 2);
52821 }if (!validRes || row[column] == null || row[column].secondaryStructure != 'H') {
52822 g.fillArc ((x * this.charWidth) - this.charWidth, y + 4 + iconOffset, this.charWidth, 8, 270, 180);
52823 x2 -= Clazz_doubleToInt (this.charWidth / 2);
52824 }g.fillRect (x1, y + 4 + iconOffset, x2 - x1, 8);
52825 }, "java.awt.Graphics,~A,~N,~N,~N,~N,~N,~N,~B,~B");
52826 Clazz_defineMethod (c$, "drawLineGraph", 
52827 function (g, _aa, aa_annotations, sRes, eRes, y, min, max, graphHeight) {
52828 if (sRes > aa_annotations.length) {
52829 return;
52830 }var x = 0;
52831 if (eRes < this.endRes) {
52832 eRes++;
52833 }eRes = Math.min (eRes, aa_annotations.length);
52834 if (sRes == 0) {
52835 x++;
52836 }var y1 = y;
52837 var y2 = y;
52838 var range = max - min;
52839 if (min < 0) {
52840 y2 = y - Clazz_floatToInt ((0 - min / range) * graphHeight);
52841 }g.setColor (java.awt.Color.gray);
52842 g.drawLine (x - this.charWidth, y2, (eRes - sRes + 1) * this.charWidth, y2);
52843 eRes = Math.min (eRes, aa_annotations.length);
52844 var column;
52845 var aaMax = aa_annotations.length - 1;
52846 while (x < eRes - sRes) {
52847 column = sRes + x;
52848 if (this.hasHiddenColumns) {
52849 column = this.columnSelection.adjustForHiddenColumns (column);
52850 }if (column > aaMax) {
52851 break;
52852 }if (aa_annotations[column] == null || aa_annotations[column - 1] == null) {
52853 x++;
52854 continue;
52855 }if (aa_annotations[column].colour == null) {
52856 g.setColor (java.awt.Color.black);
52857 } else {
52858 g.setColor (aa_annotations[column].colour);
52859 }y1 = y - Clazz_floatToInt (((aa_annotations[column - 1].value - min) / range) * graphHeight);
52860 y2 = y - Clazz_floatToInt (((aa_annotations[column].value - min) / range) * graphHeight);
52861 g.drawLine (x * this.charWidth - Clazz_doubleToInt (this.charWidth / 2), y1, x * this.charWidth + Clazz_doubleToInt (this.charWidth / 2), y2);
52862 x++;
52863 }
52864 if (_aa.threshold != null) {
52865 g.setColor (_aa.threshold.colour);
52866 var g2 = g;
52867 g2.setStroke ( new java.awt.BasicStroke (1, 2, 1, 3,  Clazz_newFloatArray (-1, [5, 3]), 0));
52868 y2 = Clazz_floatToInt (y - ((_aa.threshold.value - min) / range) * graphHeight);
52869 g.drawLine (0, y2, (eRes - sRes) * this.charWidth, y2);
52870 g2.setStroke ( new java.awt.BasicStroke ());
52871 }}, "java.awt.Graphics,jalview.datamodel.AlignmentAnnotation,~A,~N,~N,~N,~N,~N,~N");
52872 Clazz_defineMethod (c$, "drawBarGraph", 
52873 function (g, _aa, aa_annotations, sRes, eRes, min, max, y, renderHistogram, renderProfile, normaliseProfile) {
52874 if (sRes > aa_annotations.length) {
52875 return;
52876 }var ofont = g.getFont ();
52877 eRes = Math.min (eRes, aa_annotations.length);
52878 var x = 0;
52879 var y1 = y;
52880 var y2 = y;
52881 var range = max - min;
52882 if (min < 0) {
52883 y2 = y - Clazz_floatToInt ((0 - min / (range)) * _aa.graphHeight);
52884 }g.setColor (java.awt.Color.gray);
52885 g.drawLine (x, y2, (eRes - sRes) * this.charWidth, y2);
52886 var column;
52887 var aaMax = aa_annotations.length - 1;
52888 while (x < eRes - sRes) {
52889 column = sRes + x;
52890 if (this.hasHiddenColumns) {
52891 column = this.columnSelection.adjustForHiddenColumns (column);
52892 }if (column > aaMax) {
52893 break;
52894 }if (aa_annotations[column] == null) {
52895 x++;
52896 continue;
52897 }if (aa_annotations[column].colour == null) {
52898 g.setColor (java.awt.Color.black);
52899 } else {
52900 g.setColor (aa_annotations[column].colour);
52901 }y1 = y - Clazz_floatToInt (((aa_annotations[column].value - min) / (range)) * _aa.graphHeight);
52902 if (renderHistogram) {
52903 if (y1 - y2 > 0) {
52904 g.fillRect (x * this.charWidth, y2, this.charWidth, y1 - y2);
52905 } else {
52906 g.fillRect (x * this.charWidth, y1, this.charWidth, y2 - y1);
52907 }}if (renderProfile) {
52908 var profl = this.getProfileFor (_aa, column);
52909 if (profl != null && profl[2] != 0) {
52910 var isStructureProfile = profl[0] == 1;
52911 var isCdnaProfile = profl[0] == 2;
52912 var ht = normaliseProfile ? y - _aa.graphHeight : y1;
52913 var htn = normaliseProfile ? _aa.graphHeight : (y2 - y1);
52914 var hght;
52915 var wdth;
52916 var ht2 = 0;
52917 var dc;
52918 dc =  Clazz_newCharArray (isStructureProfile ? 2 : (isCdnaProfile ? 3 : 1), '\0');
52919 var lm = g.getFontMetrics (ofont).getLineMetrics ("Q", g);
52920 var scale = 1 / (normaliseProfile ? profl[2] : 100);
52921 var ofontHeight = 1 / lm.getAscent ();
52922 var scl = 0.0;
52923 var c = 3;
52924 var valuesProcessed = 0;
52925 while (valuesProcessed < profl[1]) {
52926 if (isStructureProfile) {
52927 dc[0] = String.fromCharCode (profl[c++]);
52928 dc[1] = String.fromCharCode (profl[c++]);
52929 } else if (isCdnaProfile) {
52930 dc = jalview.analysis.CodingUtils.decodeCodon (profl[c++]);
52931 } else {
52932 dc[0] = String.fromCharCode (profl[c++]);
52933 }wdth = this.charWidth;
52934 wdth /= this.fm.charsWidth (dc, 0, dc.length);
52935 ht += scl;
52936 scl = htn * scale * profl[c++];
52937 lm = ofont.getLineMetrics (dc, 0, 1, g.getFontMetrics ().getFontRenderContext ());
52938 g.setFont (ofont.deriveFont (java.awt.geom.AffineTransform.getScaleInstance (wdth, scl / lm.getAscent ())));
52939 lm = g.getFontMetrics ().getLineMetrics (dc, 0, 1, g);
52940 var colour = null;
52941 if (isCdnaProfile) {
52942 var codonTranslation = jalview.schemes.ResidueProperties.codonTranslate ( String.instantialize (dc));
52943 colour = this.profcolour.findColourSeq (codonTranslation.charAt (0), column, null);
52944 } else {
52945 colour = this.profcolour.findColourSeq (dc[0], column, null);
52946 }g.setColor (colour === java.awt.Color.white ? java.awt.Color.lightGray : colour);
52947 hght = (ht + (scl - lm.getDescent () - lm.getBaselineOffsets ()[lm.getBaselineIndex ()]));
52948 g.drawChars (dc, 0, dc.length, x * this.charWidth, Clazz_doubleToInt (hght));
52949 valuesProcessed++;
52950 }
52951 g.setFont (ofont);
52952 }}x++;
52953 }
52954 if (_aa.threshold != null) {
52955 g.setColor (_aa.threshold.colour);
52956 var g2 = g;
52957 g2.setStroke ( new java.awt.BasicStroke (1, 2, 1, 3,  Clazz_newFloatArray (-1, [5, 3]), 0));
52958 y2 = Clazz_floatToInt (y - ((_aa.threshold.value - min) / range) * _aa.graphHeight);
52959 g.drawLine (0, y2, (eRes - sRes) * this.charWidth, y2);
52960 g2.setStroke ( new java.awt.BasicStroke ());
52961 }}, "java.awt.Graphics,jalview.datamodel.AlignmentAnnotation,~A,~N,~N,~N,~N,~N,~B,~B,~B");
52962 Clazz_defineMethod (c$, "drawGraph", 
52963 function (g, _aa, aa_annotations, width, y, sRes, eRes) {
52964 eRes = Math.min (eRes, aa_annotations.length);
52965 g.setColor (java.awt.Color.white);
52966 g.fillRect (0, 0, width, y);
52967 g.setColor ( new java.awt.Color (0, 0, 180));
52968 var x = 0;
52969 var height;
52970 for (var j = sRes; j < eRes; j++) {
52971 if (aa_annotations[j] != null) {
52972 if (aa_annotations[j].colour == null) {
52973 g.setColor (java.awt.Color.black);
52974 } else {
52975 g.setColor (aa_annotations[j].colour);
52976 }height = Clazz_floatToInt ((aa_annotations[j].value / _aa.graphMax) * y);
52977 if (height > y) {
52978 height = y;
52979 }g.fillRect (x, y - height, this.charWidth, height);
52980 }x += this.charWidth;
52981 }
52982 }, "java.awt.Graphics,jalview.datamodel.AlignmentAnnotation,~A,~N,~N,~N,~N");
52983 Clazz_defineMethod (c$, "getNotCanonicalColor", 
52984 function (lastss) {
52985 switch (lastss) {
52986 case '{':
52987 case '}':
52988 return  new java.awt.Color (255, 125, 5);
52989 case '[':
52990 case ']':
52991 return  new java.awt.Color (245, 115, 10);
52992 case '>':
52993 case '<':
52994 return  new java.awt.Color (235, 135, 15);
52995 case 'A':
52996 case 'a':
52997 return  new java.awt.Color (225, 105, 20);
52998 case 'B':
52999 case 'b':
53000 return  new java.awt.Color (215, 145, 30);
53001 case 'C':
53002 case 'c':
53003 return  new java.awt.Color (205, 95, 35);
53004 case 'D':
53005 case 'd':
53006 return  new java.awt.Color (195, 155, 45);
53007 case 'E':
53008 case 'e':
53009 return  new java.awt.Color (185, 85, 55);
53010 case 'F':
53011 case 'f':
53012 return  new java.awt.Color (175, 165, 65);
53013 case 'G':
53014 case 'g':
53015 return  new java.awt.Color (170, 75, 75);
53016 case 'H':
53017 case 'h':
53018 return  new java.awt.Color (160, 175, 85);
53019 case 'I':
53020 case 'i':
53021 return  new java.awt.Color (150, 65, 95);
53022 case 'J':
53023 case 'j':
53024 return  new java.awt.Color (140, 185, 105);
53025 case 'K':
53026 case 'k':
53027 return  new java.awt.Color (130, 55, 110);
53028 case 'L':
53029 case 'l':
53030 return  new java.awt.Color (120, 195, 120);
53031 case 'M':
53032 case 'm':
53033 return  new java.awt.Color (110, 45, 130);
53034 case 'N':
53035 case 'n':
53036 return  new java.awt.Color (100, 205, 140);
53037 case 'O':
53038 case 'o':
53039 return  new java.awt.Color (90, 35, 150);
53040 case 'P':
53041 case 'p':
53042 return  new java.awt.Color (85, 215, 160);
53043 case 'Q':
53044 case 'q':
53045 return  new java.awt.Color (75, 25, 170);
53046 case 'R':
53047 case 'r':
53048 return  new java.awt.Color (65, 225, 180);
53049 case 'S':
53050 case 's':
53051 return  new java.awt.Color (55, 15, 185);
53052 case 'T':
53053 case 't':
53054 return  new java.awt.Color (45, 235, 195);
53055 case 'U':
53056 case 'u':
53057 return  new java.awt.Color (35, 5, 205);
53058 case 'V':
53059 case 'v':
53060 return  new java.awt.Color (25, 245, 215);
53061 case 'W':
53062 case 'w':
53063 return  new java.awt.Color (15, 0, 225);
53064 case 'X':
53065 case 'x':
53066 return  new java.awt.Color (10, 255, 235);
53067 case 'Y':
53068 case 'y':
53069 return  new java.awt.Color (5, 150, 245);
53070 case 'Z':
53071 case 'z':
53072 return  new java.awt.Color (0, 80, 255);
53073 default:
53074 System.out.println ("This is not a interaction : " + lastss);
53075 return null;
53076 }
53077 }, "~S");
53078 c$.GLYPHLINE_COLOR = c$.prototype.GLYPHLINE_COLOR = java.awt.Color.gray;
53079 c$.SHEET_COLOUR = c$.prototype.SHEET_COLOUR = java.awt.Color.green;
53080 c$.HELIX_COLOUR = c$.prototype.HELIX_COLOUR = java.awt.Color.red;
53081 c$.STEM_COLOUR = c$.prototype.STEM_COLOUR = java.awt.Color.blue;
53082 });
53083 Clazz_declarePackage ("jalview.appletgui");
53084 Clazz_load (["awt2swing.Panel", "java.awt.event.ActionListener", "$.AdjustmentListener", "$.ItemListener", "$.MouseListener", "awt2swing.Checkbox", "$.Choice", "$.Scrollbar", "$.TextField"], "jalview.appletgui.FeatureColourChooser", ["awt2swing.Label", "jalview.appletgui.JVDialog", "$.PaintRefresher", "$.UserDefinedColours", "jalview.datamodel.GraphLine", "jalview.schemes.GraduatedColor", "jalview.util.MessageManager", "java.awt.Color", "$.Dimension", "$.FlowLayout", "$.Font", "$.GridLayout", "java.awt.event.ActionEvent", "java.lang.Float"], function () {
53085 c$ = Clazz_decorateAsClass (function () {
53086 this.frame = null;
53087 this.owner = null;
53088 this.fr = null;
53089 this.fs = null;
53090 this.cs = null;
53091 this.oldcs = null;
53092 this.oldgroupColours = null;
53093 this.adjusting = false;
53094 this.min = 0;
53095 this.max = 0;
53096 this.type = null;
53097 this.af = null;
53098 this.minColour = null;
53099 this.maxColour = null;
53100 this.jPanel1 = null;
53101 this.jPanel2 = null;
53102 this.threshold = null;
53103 this.jPanel3 = null;
53104 this.jPanel4 = null;
53105 this.slider = null;
53106 this.thresholdValue = null;
53107 this.thresholdIsMin = null;
53108 this.colourFromLabel = null;
53109 this.threshline = null;
53110 Clazz_instantialize (this, arguments);
53111 }, jalview.appletgui, "FeatureColourChooser", awt2swing.Panel, [java.awt.event.ActionListener, java.awt.event.AdjustmentListener, java.awt.event.ItemListener, java.awt.event.MouseListener]);
53112 Clazz_prepareFields (c$, function () {
53113 this.minColour =  new awt2swing.Panel ();
53114 this.maxColour =  new awt2swing.Panel ();
53115 this.jPanel1 =  new awt2swing.Panel ();
53116 this.jPanel2 =  new awt2swing.Panel ();
53117 this.threshold =  new awt2swing.Choice ();
53118 this.jPanel3 =  new awt2swing.Panel ();
53119 this.jPanel4 =  new awt2swing.Panel ();
53120 this.slider =  new awt2swing.Scrollbar (0);
53121 this.thresholdValue =  new awt2swing.TextField (20);
53122 this.thresholdIsMin =  new awt2swing.Checkbox ();
53123 this.colourFromLabel =  new awt2swing.Checkbox ();
53124 });
53125 Clazz_makeConstructor (c$, 
53126 function (af, type) {
53127 Clazz_superConstructor (this, jalview.appletgui.FeatureColourChooser, []);
53128 this.af = af;
53129 this.init (af.getSeqcanvas ().getFeatureRenderer (), type);
53130 }, "jalview.appletgui.AlignFrame,~S");
53131 Clazz_makeConstructor (c$, 
53132 function (fsettings, type) {
53133 Clazz_superConstructor (this, jalview.appletgui.FeatureColourChooser, []);
53134 this.fs = fsettings;
53135 this.init (fsettings.fr, type);
53136 }, "jalview.appletgui.FeatureSettings,~S");
53137 Clazz_defineMethod (c$, "init", 
53138  function (frenderer, type) {
53139 this.type = type;
53140 this.fr = frenderer;
53141 var mm = (this.fr.getMinMax ().get (type))[0];
53142 this.min = mm[0];
53143 this.max = mm[1];
53144 this.oldcs = this.fr.getFeatureColours ().get (type);
53145 if (Clazz_instanceOf (this.oldcs, jalview.schemes.GraduatedColor)) {
53146 this.cs =  new jalview.schemes.GraduatedColor (this.oldcs, this.min, this.max);
53147 } else {
53148 var bl = java.awt.Color.black;
53149 if (Clazz_instanceOf (this.oldcs, java.awt.Color)) {
53150 bl = this.oldcs;
53151 }this.cs =  new jalview.schemes.GraduatedColor (java.awt.Color.white, bl, mm[0], mm[1]);
53152 }this.minColour.setBackground (this.cs.getMinColor ());
53153 this.maxColour.setBackground (this.cs.getMaxColor ());
53154 this.minColour.setForeground (this.cs.getMinColor ());
53155 this.maxColour.setForeground (this.cs.getMaxColor ());
53156 this.colourFromLabel.setState (this.cs.isColourByLabel ());
53157 this.adjusting = true;
53158 try {
53159 this.jbInit ();
53160 } catch (ex) {
53161 if (Clazz_exceptionOf (ex, Exception)) {
53162 } else {
53163 throw ex;
53164 }
53165 }
53166 this.threshold.select (new Integer (this.cs.getThreshType () == -1 ? 0 : this.cs.getThreshType () == 1 ? 1 : 2));
53167 this.adjusting = false;
53168 this.changeColour ();
53169 this.colourFromLabel.addItemListener (this);
53170 this.slider.addAdjustmentListener (this);
53171 this.slider.addMouseListener (this);
53172 this.owner = (this.af != null) ? this.af : this.fs.frame;
53173 this.frame =  new jalview.appletgui.JVDialog (this.owner, jalview.util.MessageManager.formatMessage ("label.graduated_color_for_params",  Clazz_newArray (-1, [type])), true, 480, 248);
53174 this.frame.setMainPanel (this);
53175 this.validate ();
53176 this.frame.setVisible (true);
53177 if (this.frame.accept) {
53178 this.changeColour ();
53179 } else {
53180 this.reset ();
53181 jalview.appletgui.PaintRefresher.Refresh (this, this.fr.getViewport ().getSequenceSetId ());
53182 this.frame.setVisible (false);
53183 }}, "jalview.appletgui.FeatureRenderer,~S");
53184 Clazz_makeConstructor (c$, 
53185 function () {
53186 Clazz_superConstructor (this, jalview.appletgui.FeatureColourChooser, []);
53187 try {
53188 this.jbInit ();
53189 } catch (ex) {
53190 if (Clazz_exceptionOf (ex, Exception)) {
53191 ex.printStackTrace ();
53192 } else {
53193 throw ex;
53194 }
53195 }
53196 });
53197 Clazz_defineMethod (c$, "jbInit", 
53198  function () {
53199 var minLabel =  new awt2swing.Label (jalview.util.MessageManager.getString ("label.min"));
53200 var maxLabel =  new awt2swing.Label (jalview.util.MessageManager.getString ("label.max"));
53201 minLabel.setFont ( new java.awt.Font ("Verdana", 0, 11));
53202 maxLabel.setFont ( new java.awt.Font ("Verdana", 0, 11));
53203 this.minColour.setBounds (0, 0, 40, 27);
53204 this.maxColour.setBounds (0, 0, 40, 27);
53205 this.minColour.addMouseListener (this);
53206 this.maxColour.setFont ( new java.awt.Font ("Verdana", 0, 11));
53207 this.maxColour.addMouseListener (this);
53208 this.thresholdIsMin.addItemListener (this);
53209 this.setLayout ( new java.awt.GridLayout (4, 1));
53210 this.jPanel1.setLayout ( new java.awt.FlowLayout ());
53211 this.jPanel2.setLayout ( new java.awt.FlowLayout ());
53212 this.jPanel3.setLayout ( new java.awt.GridLayout (1, 1));
53213 this.jPanel4.setLayout ( new java.awt.FlowLayout ());
53214 this.jPanel1.setBackground (java.awt.Color.white);
53215 this.jPanel2.setBackground (java.awt.Color.white);
53216 this.jPanel4.setBackground (java.awt.Color.white);
53217 this.threshold.addItemListener (this);
53218 this.threshold.addItem (jalview.util.MessageManager.getString ("label.threshold_feature_no_thereshold"));
53219 this.threshold.addItem (jalview.util.MessageManager.getString ("label.threshold_feature_above_thereshold"));
53220 this.threshold.addItem (jalview.util.MessageManager.getString ("label.threshold_feature_below_thereshold"));
53221 this.thresholdValue.addActionListener (this);
53222 this.slider.setBackground (java.awt.Color.white);
53223 this.slider.setEnabled (false);
53224 this.slider.setSize ( new java.awt.Dimension (93, 21));
53225 this.thresholdValue.setEnabled (false);
53226 this.thresholdValue.setSize ( new java.awt.Dimension (79, 22));
53227 this.thresholdValue.setColumns (5);
53228 this.jPanel3.setBackground (java.awt.Color.white);
53229 this.colourFromLabel.setFont ( new java.awt.Font ("Verdana", 0, 11));
53230 this.colourFromLabel.setLabel (jalview.util.MessageManager.getString ("label.colour_by_label"));
53231 this.colourFromLabel.setSize ( new java.awt.Dimension (139, 22));
53232 this.thresholdIsMin.setBackground (java.awt.Color.white);
53233 this.thresholdIsMin.setLabel (jalview.util.MessageManager.getString ("label.threshold_minmax"));
53234 this.thresholdIsMin.setSize ( new java.awt.Dimension (135, 23));
53235 this.jPanel1.add (minLabel);
53236 this.jPanel1.add (this.minColour);
53237 this.jPanel1.add (maxLabel);
53238 this.jPanel1.add (this.maxColour);
53239 this.jPanel1.add (this.colourFromLabel);
53240 this.jPanel2.add (this.threshold);
53241 this.jPanel3.add (this.slider);
53242 this.jPanel4.add (this.thresholdValue);
53243 this.jPanel4.add (this.thresholdIsMin);
53244 this.add (this.jPanel1);
53245 this.add (this.jPanel2);
53246 this.add (this.jPanel3);
53247 this.add (this.jPanel4);
53248 });
53249 Clazz_overrideMethod (c$, "actionPerformed", 
53250 function (evt) {
53251 if (evt.getSource () === this.thresholdValue) {
53252 try {
53253 var f =  new Float (this.thresholdValue.getText ()).floatValue ();
53254 this.slider.setValue (Clazz_floatToInt (f * 1000));
53255 this.adjustmentValueChanged (null);
53256 } catch (ex) {
53257 if (Clazz_exceptionOf (ex, NumberFormatException)) {
53258 } else {
53259 throw ex;
53260 }
53261 }
53262 } else if (evt.getSource () === this.minColour) {
53263 this.minColour_actionPerformed (null);
53264 } else if (evt.getSource () === this.maxColour) {
53265 this.maxColour_actionPerformed (null);
53266 } else {
53267 this.changeColour ();
53268 }}, "java.awt.event.ActionEvent");
53269 Clazz_overrideMethod (c$, "itemStateChanged", 
53270 function (evt) {
53271 this.maxColour.setEnabled (!this.colourFromLabel.getState ());
53272 this.minColour.setEnabled (!this.colourFromLabel.getState ());
53273 this.changeColour ();
53274 }, "java.awt.event.ItemEvent");
53275 Clazz_overrideMethod (c$, "adjustmentValueChanged", 
53276 function (evt) {
53277 if (!this.adjusting) {
53278 this.thresholdValue.setText ((this.slider.getValue () / 1000) + "");
53279 this.valueChanged ();
53280 }}, "java.awt.event.AdjustmentEvent");
53281 Clazz_defineMethod (c$, "valueChanged", 
53282 function () {
53283 this.threshline.value = this.slider.getValue () / 1000;
53284 this.cs.setThresh (this.threshline.value);
53285 this.changeColour ();
53286 jalview.appletgui.PaintRefresher.Refresh (this, this.fr.getViewport ().getSequenceSetId ());
53287 });
53288 Clazz_defineMethod (c$, "minColour_actionPerformed", 
53289 function (newCol) {
53290 if (newCol == null) {
53291 var udc =  new jalview.appletgui.UserDefinedColours (this, this.minColour.getBackground (), this.owner, jalview.util.MessageManager.getString ("label.select_colour_minimum_value"));
53292 } else {
53293 this.minColour.setBackground (newCol);
53294 this.minColour.setForeground (newCol);
53295 this.minColour.repaint ();
53296 this.changeColour ();
53297 }}, "java.awt.Color");
53298 Clazz_defineMethod (c$, "maxColour_actionPerformed", 
53299 function (newCol) {
53300 if (newCol == null) {
53301 var udc =  new jalview.appletgui.UserDefinedColours (this, this.maxColour.getBackground (), this.owner, jalview.util.MessageManager.getString ("label.select_colour_maximum_value"));
53302 } else {
53303 this.maxColour.setBackground (newCol);
53304 this.maxColour.setForeground (newCol);
53305 this.maxColour.repaint ();
53306 this.changeColour ();
53307 }}, "java.awt.Color");
53308 Clazz_defineMethod (c$, "changeColour", 
53309 function () {
53310 if (this.adjusting) {
53311 return;
53312 }var aboveThreshold = -1;
53313 if (this.threshold.getSelectedIndex () == 1) {
53314 aboveThreshold = 1;
53315 } else if (this.threshold.getSelectedIndex () == 2) {
53316 aboveThreshold = 0;
53317 }this.slider.setEnabled (true);
53318 this.thresholdValue.setEnabled (true);
53319 var acg =  new jalview.schemes.GraduatedColor (this.minColour.getBackground (), this.maxColour.getBackground (), this.min, this.max);
53320 acg.setColourByLabel (this.colourFromLabel.getState ());
53321 this.maxColour.setEnabled (!this.colourFromLabel.getState ());
53322 this.minColour.setEnabled (!this.colourFromLabel.getState ());
53323 if (aboveThreshold == -1) {
53324 this.slider.setEnabled (false);
53325 this.thresholdValue.setEnabled (false);
53326 this.thresholdValue.setText ("");
53327 } else if (aboveThreshold != -1 && this.threshline == null) {
53328 this.threshline =  new jalview.datamodel.GraphLine ((this.max - this.min) / 2, "Threshold", java.awt.Color.black);
53329 }if (aboveThreshold != -1) {
53330 this.adjusting = true;
53331 acg.setThresh (this.threshline.value);
53332 var range = this.max * 1000 - this.min * 1000;
53333 this.slider.setMinimum (Clazz_floatToInt (this.min * 1000));
53334 this.slider.setMaximum (Clazz_floatToInt (this.max * 1000));
53335 this.slider.setValue (Clazz_floatToInt (this.threshline.value * 1000));
53336 this.thresholdValue.setText (this.threshline.value + "");
53337 this.slider.setEnabled (true);
53338 this.thresholdValue.setEnabled (true);
53339 this.adjusting = false;
53340 }acg.setThreshType (aboveThreshold);
53341 if (this.thresholdIsMin.getState () && aboveThreshold != -1) {
53342 if (aboveThreshold == 1) {
53343 acg =  new jalview.schemes.GraduatedColor (acg, this.threshline.value, this.max);
53344 } else {
53345 acg =  new jalview.schemes.GraduatedColor (acg, this.min, this.threshline.value);
53346 }}this.fr.setColour (this.type, acg);
53347 this.cs = acg;
53348 jalview.appletgui.PaintRefresher.Refresh (this, this.fr.getViewport ().getSequenceSetId ());
53349 });
53350 Clazz_defineMethod (c$, "reset", 
53351 function () {
53352 this.fr.setColour (this.type, this.oldcs);
53353 jalview.appletgui.PaintRefresher.Refresh (this, this.fr.getViewport ().getSequenceSetId ());
53354 });
53355 Clazz_overrideMethod (c$, "mouseClicked", 
53356 function (evt) {
53357 }, "java.awt.event.MouseEvent");
53358 Clazz_overrideMethod (c$, "mousePressed", 
53359 function (evt) {
53360 }, "java.awt.event.MouseEvent");
53361 Clazz_overrideMethod (c$, "mouseReleased", 
53362 function (evt) {
53363 if (evt.getSource () === this.minColour || evt.getSource () === this.maxColour) {
53364 this.actionPerformed ( new java.awt.event.ActionEvent (evt.getSource (), 1, "Clicked"));
53365 } else {
53366 jalview.appletgui.PaintRefresher.Refresh (this, this.fr.getViewport ().getSequenceSetId ());
53367 }}, "java.awt.event.MouseEvent");
53368 Clazz_overrideMethod (c$, "mouseEntered", 
53369 function (evt) {
53370 }, "java.awt.event.MouseEvent");
53371 Clazz_overrideMethod (c$, "mouseExited", 
53372 function (evt) {
53373 }, "java.awt.event.MouseEvent");
53374 });
53375 Clazz_declarePackage ("jalview.schemes");
53376 Clazz_load (null, "jalview.schemes.GraduatedColor", ["jalview.schemes.UserColourScheme", "java.awt.Color", "java.lang.Float"], function () {
53377 c$ = Clazz_decorateAsClass (function () {
53378 this.thresholdState = -1;
53379 this.lr = 0;
53380 this.lg = 0;
53381 this.lb = 0;
53382 this.dr = 0;
53383 this.dg = 0;
53384 this.db = 0;
53385 this.base = 0;
53386 this.range = 0;
53387 this.thrsh = 0;
53388 this.tolow = false;
53389 this.autoScale = true;
53390 this.ucs = null;
53391 this.colourByLabel = false;
53392 Clazz_instantialize (this, arguments);
53393 }, jalview.schemes, "GraduatedColor");
53394 Clazz_makeConstructor (c$, 
53395 function (low, high, min, max) {
53396 this.thrsh = NaN;
53397 this.tolow = min >= max;
53398 this.lr = low.getRed () / 255;
53399 this.lg = low.getGreen () / 255;
53400 this.lb = low.getBlue () / 255;
53401 this.dr = (high.getRed () / 255) - this.lr;
53402 this.dg = (high.getGreen () / 255) - this.lg;
53403 this.db = (high.getBlue () / 255) - this.lb;
53404 if (this.tolow) {
53405 this.base = max;
53406 this.range = min - max;
53407 } else {
53408 this.base = min;
53409 this.range = max - min;
53410 }}, "java.awt.Color,java.awt.Color,~N,~N");
53411 Clazz_makeConstructor (c$, 
53412 function (oldcs) {
53413 this.lr = oldcs.lr;
53414 this.lg = oldcs.lg;
53415 this.lb = oldcs.lb;
53416 this.dr = oldcs.dr;
53417 this.dg = oldcs.dg;
53418 this.db = oldcs.db;
53419 this.base = oldcs.base;
53420 this.range = oldcs.range;
53421 this.tolow = oldcs.tolow;
53422 this.thresholdState = oldcs.thresholdState;
53423 this.thrsh = oldcs.thrsh;
53424 this.autoScale = oldcs.autoScale;
53425 this.colourByLabel = oldcs.colourByLabel;
53426 }, "jalview.schemes.GraduatedColor");
53427 Clazz_makeConstructor (c$, 
53428 function (oldcs, min, max) {
53429 this.construct (oldcs);
53430 this.updateBounds (min, max);
53431 }, "jalview.schemes.GraduatedColor,~N,~N");
53432 Clazz_defineMethod (c$, "getMinColor", 
53433 function () {
53434 return  new java.awt.Color (this.lr, this.lg, this.lb);
53435 });
53436 Clazz_defineMethod (c$, "getMaxColor", 
53437 function () {
53438 return  new java.awt.Color (this.lr + this.dr, this.lg + this.dg, this.lb + this.db);
53439 });
53440 Clazz_defineMethod (c$, "getTolow", 
53441 function () {
53442 return this.tolow;
53443 });
53444 Clazz_defineMethod (c$, "setTolow", 
53445 function (tolower) {
53446 this.tolow = tolower;
53447 }, "~B");
53448 Clazz_defineMethod (c$, "isColored", 
53449 function (feature) {
53450 var val = feature.getScore ();
53451 if (Float.isNaN (val)) {
53452 return true;
53453 }if (this.thresholdState == -1) {
53454 return true;
53455 }if (Float.isNaN (this.thrsh)) {
53456 return true;
53457 }var rtn = this.thresholdState == 1;
53458 if (val <= this.thrsh) {
53459 return !rtn;
53460 } else {
53461 return rtn;
53462 }}, "jalview.datamodel.SequenceFeature");
53463 Clazz_defineMethod (c$, "isColourByLabel", 
53464 function () {
53465 return this.colourByLabel;
53466 });
53467 Clazz_defineMethod (c$, "setColourByLabel", 
53468 function (colourByLabel) {
53469 this.colourByLabel = colourByLabel;
53470 }, "~B");
53471 Clazz_defineMethod (c$, "findColor", 
53472 function (feature) {
53473 if (this.colourByLabel) {
53474 if (this.ucs == null) {
53475 this.ucs =  new jalview.schemes.UserColourScheme ();
53476 }return this.ucs.createColourFromName (feature.getDescription ());
53477 }if (this.range == 0.0) {
53478 return this.getMaxColor ();
53479 }var scr = feature.getScore ();
53480 if (Float.isNaN (scr)) {
53481 return this.getMinColor ();
53482 }var scl = (scr - this.base) / this.range;
53483 if (this.tolow) {
53484 scl = -scl;
53485 }if (scl < 0) {
53486 scl = 0;
53487 }if (scl > 1) {
53488 scl = 1;
53489 }return  new java.awt.Color (this.lr + scl * this.dr, this.lg + scl * this.dg, this.lb + scl * this.db);
53490 }, "jalview.datamodel.SequenceFeature");
53491 Clazz_defineMethod (c$, "setThresh", 
53492 function (value) {
53493 this.thrsh = value;
53494 }, "~N");
53495 Clazz_defineMethod (c$, "getThresh", 
53496 function () {
53497 return this.thrsh;
53498 });
53499 Clazz_defineMethod (c$, "setThreshType", 
53500 function (aboveThreshold) {
53501 this.thresholdState = aboveThreshold;
53502 }, "~N");
53503 Clazz_defineMethod (c$, "getThreshType", 
53504 function () {
53505 return this.thresholdState;
53506 });
53507 Clazz_defineMethod (c$, "getMax", 
53508 function () {
53509 return (this.tolow) ? this.base : (this.base + this.range);
53510 });
53511 Clazz_defineMethod (c$, "getMin", 
53512 function () {
53513 return (this.tolow) ? (this.base + this.range) : this.base;
53514 });
53515 Clazz_defineMethod (c$, "isAutoScale", 
53516 function () {
53517 return this.autoScale;
53518 });
53519 Clazz_defineMethod (c$, "setAutoScaled", 
53520 function (autoscale) {
53521 this.autoScale = autoscale;
53522 }, "~B");
53523 Clazz_defineMethod (c$, "updateBounds", 
53524 function (min, max) {
53525 if (max < min) {
53526 this.base = max;
53527 this.range = min - max;
53528 this.tolow = true;
53529 } else {
53530 this.base = min;
53531 this.range = max - min;
53532 this.tolow = false;
53533 }}, "~N,~N");
53534 });
53535 Clazz_declarePackage ("jalview.appletgui");
53536 Clazz_load (["awt2swing.Panel", "jalview.renderer.seqfeatures.FeatureRenderer"], "jalview.appletgui.FeatureRenderer", ["awt2swing.Button", "$.Choice", "$.Label", "$.ScrollPane", "$.TextArea", "$.TextField", "$.Util", "jalview.appletgui.FeatureColourChooser", "$.JVDialog", "$.UserDefinedColours", "jalview.datamodel.SearchResults", "jalview.io.FeaturesFile", "jalview.schemes.GraduatedColor", "$.UserColourScheme", "jalview.util.MessageManager", "java.awt.BorderLayout", "$.Color", "$.Font", "$.GridLayout", "java.awt.event.ActionListener", "$.ItemListener", "$.MouseAdapter", "java.lang.Error"], function () {
53537 c$ = Clazz_decorateAsClass (function () {
53538 this.featureLinks = null;
53539 this.featureIndex = 0;
53540 this.deleteFeature = false;
53541 this.colourPanel = null;
53542 if (!Clazz_isClassDefined ("jalview.appletgui.FeatureRenderer.FeatureColourPanel")) {
53543 jalview.appletgui.FeatureRenderer.$FeatureRenderer$FeatureColourPanel$ ();
53544 }
53545 Clazz_instantialize (this, arguments);
53546 }, jalview.appletgui, "FeatureRenderer", jalview.renderer.seqfeatures.FeatureRenderer);
53547 Clazz_makeConstructor (c$, 
53548 function (av) {
53549 Clazz_superConstructor (this, jalview.appletgui.FeatureRenderer);
53550 this.av = av;
53551 this.setTransparencyAvailable (!System.getProperty ("java.version").startsWith ("1.1"));
53552 }, "jalview.viewmodel.AlignmentViewport");
53553 Clazz_defineMethod (c$, "amendFeatures", 
53554 function (sequences, features, newFeatures, ap) {
53555 var bigPanel =  new awt2swing.Panel ( new java.awt.BorderLayout ());
53556 var name =  new awt2swing.TextField (16);
53557 var source =  new awt2swing.TextField (16);
53558 var description =  new awt2swing.TextArea (3, 35);
53559 var start =  new awt2swing.TextField (8);
53560 var end =  new awt2swing.TextField (8);
53561 var overlaps;
53562 var deleteButton =  new awt2swing.Button ("Delete");
53563 this.deleteFeature = false;
53564 this.colourPanel = Clazz_innerTypeInstance (jalview.appletgui.FeatureRenderer.FeatureColourPanel, this, null);
53565 this.colourPanel.setSize (110, 15);
53566 var fr = this;
53567 var panel =  new awt2swing.Panel ( new java.awt.GridLayout (3, 1));
53568 this.featureIndex = 0;
53569 var tmp;
53570 if (!newFeatures && features.length > 1) {
53571 panel =  new awt2swing.Panel ( new java.awt.GridLayout (4, 1));
53572 tmp =  new awt2swing.Panel ();
53573 tmp.add ( new awt2swing.Label ("Select Feature: "));
53574 overlaps =  new awt2swing.Choice ();
53575 for (var i = 0; i < features.length; i++) {
53576 var item = features[i].getType () + "/" + features[i].getBegin () + "-" + features[i].getEnd ();
53577 if (features[i].getFeatureGroup () != null) {
53578 item += " (" + features[i].getFeatureGroup () + ")";
53579 }overlaps.addItem (item);
53580 }
53581 tmp.add (overlaps);
53582 overlaps.addItemListener (((Clazz_isClassDefined ("jalview.appletgui.FeatureRenderer$1") ? 0 : jalview.appletgui.FeatureRenderer.$FeatureRenderer$1$ ()), Clazz_innerTypeInstance (jalview.appletgui.FeatureRenderer$1, this, Clazz_cloneFinals ("overlaps", overlaps, "name", name, "features", features, "description", description, "source", source, "start", start, "end", end, "sequences", sequences, "ap", ap))));
53583 panel.add (tmp);
53584 }tmp =  new awt2swing.Panel ();
53585 panel.add (tmp);
53586 tmp.add ( new awt2swing.Label ("Name: ", 4));
53587 tmp.add (name);
53588 tmp =  new awt2swing.Panel ();
53589 panel.add (tmp);
53590 tmp.add ( new awt2swing.Label ("Group: ", 4));
53591 tmp.add (source);
53592 tmp =  new awt2swing.Panel ();
53593 panel.add (tmp);
53594 tmp.add ( new awt2swing.Label ("Colour: ", 4));
53595 tmp.add (this.colourPanel);
53596 bigPanel.add (panel, "North");
53597 panel =  new awt2swing.Panel ();
53598 panel.add ( new awt2swing.Label ("Description: ", 4));
53599 panel.add ( new awt2swing.ScrollPane ().add (description));
53600 if (!newFeatures) {
53601 bigPanel.add (panel, "South");
53602 panel =  new awt2swing.Panel ();
53603 panel.add ( new awt2swing.Label (" Start:", 4));
53604 panel.add (start);
53605 panel.add ( new awt2swing.Label ("  End:", 4));
53606 panel.add (end);
53607 bigPanel.add (panel, "Center");
53608 } else {
53609 bigPanel.add (panel, "Center");
53610 }if (jalview.appletgui.FeatureRenderer.lastFeatureAdded == null) {
53611 if (features[0].type != null) {
53612 jalview.appletgui.FeatureRenderer.lastFeatureAdded = features[0].type;
53613 } else {
53614 jalview.appletgui.FeatureRenderer.lastFeatureAdded = "feature_1";
53615 }}if (jalview.appletgui.FeatureRenderer.lastFeatureGroupAdded == null) {
53616 if (features[0].featureGroup != null) {
53617 jalview.appletgui.FeatureRenderer.lastFeatureGroupAdded = features[0].featureGroup;
53618 } else {
53619 jalview.appletgui.FeatureRenderer.lastFeatureAdded = "Jalview";
53620 }}var title = newFeatures ? jalview.util.MessageManager.getString ("label.create_new_sequence_features") : jalview.util.MessageManager.formatMessage ("label.amend_delete_features",  Clazz_newArray (-1, [sequences[0].getName ()]));
53621 var dialog =  new jalview.appletgui.JVDialog (ap.alignFrame, title, true, 385, 240);
53622 dialog.setMainPanel (bigPanel);
53623 if (newFeatures) {
53624 name.setText (jalview.appletgui.FeatureRenderer.lastFeatureAdded);
53625 source.setText (jalview.appletgui.FeatureRenderer.lastFeatureGroupAdded);
53626 } else {
53627 dialog.ok.setLabel (jalview.util.MessageManager.getString ("label.amend"));
53628 dialog.buttonPanel.add (deleteButton, 1);
53629 deleteButton.addActionListener (((Clazz_isClassDefined ("jalview.appletgui.FeatureRenderer$2") ? 0 : jalview.appletgui.FeatureRenderer.$FeatureRenderer$2$ ()), Clazz_innerTypeInstance (jalview.appletgui.FeatureRenderer$2, this, Clazz_cloneFinals ("dialog", dialog))));
53630 name.setText (features[0].getType ());
53631 source.setText (features[0].getFeatureGroup ());
53632 }start.setText (features[0].getBegin () + "");
53633 end.setText (features[0].getEnd () + "");
53634 description.setText (features[0].getDescription ());
53635 var col = this.getColour (name.getText ());
53636 if (col == null) {
53637 col =  new jalview.schemes.UserColourScheme ().createColourFromName (name.getText ());
53638 }var fcol = this.getFeatureStyle (name.getText ());
53639 this.colourPanel.updateColor (fcol);
53640 dialog.setResizable (true);
53641 this.colourPanel.addMouseListener (((Clazz_isClassDefined ("jalview.appletgui.FeatureRenderer$3") ? 0 : jalview.appletgui.FeatureRenderer.$FeatureRenderer$3$ ()), Clazz_innerTypeInstance (jalview.appletgui.FeatureRenderer$3, this, Clazz_cloneFinals ("fr", fr, "ap", ap, "name", name, "dialog", dialog))));
53642 dialog.setVisible (true);
53643 var ffile =  new jalview.io.FeaturesFile ();
53644 if (dialog.accept) {
53645 this.lastSeq = null;
53646 jalview.appletgui.FeatureRenderer.lastFeatureAdded = name.getText ().trim ();
53647 jalview.appletgui.FeatureRenderer.lastFeatureGroupAdded = source.getText ().trim ();
53648 jalview.appletgui.FeatureRenderer.lastDescriptionAdded = description.getText ().$replace ('\n', ' ');
53649 }if (jalview.appletgui.FeatureRenderer.lastFeatureGroupAdded != null && jalview.appletgui.FeatureRenderer.lastFeatureGroupAdded.length < 1) {
53650 jalview.appletgui.FeatureRenderer.lastFeatureGroupAdded = null;
53651 }if (!newFeatures) {
53652 var sf = features[this.featureIndex];
53653 if (dialog.accept) {
53654 sf.type = jalview.appletgui.FeatureRenderer.lastFeatureAdded;
53655 sf.featureGroup = jalview.appletgui.FeatureRenderer.lastFeatureGroupAdded;
53656 sf.description = jalview.appletgui.FeatureRenderer.lastDescriptionAdded;
53657 if (!this.colourPanel.isGcol) {
53658 this.setColour (sf.type, this.colourPanel.getBackground ());
53659 }try {
53660 sf.begin = Integer.parseInt (start.getText ());
53661 sf.end = Integer.parseInt (end.getText ());
53662 } catch (ex) {
53663 if (Clazz_exceptionOf (ex, NumberFormatException)) {
53664 } else {
53665 throw ex;
53666 }
53667 }
53668 ffile.parseDescriptionHTML (sf, false);
53669 this.setVisible (jalview.appletgui.FeatureRenderer.lastFeatureAdded);
53670 }if (this.deleteFeature) {
53671 sequences[0].deleteFeature (sf);
53672 }} else {
53673 if (dialog.accept && name.getText ().length > 0) {
53674 for (var i = 0; i < sequences.length; i++) {
53675 features[i].type = jalview.appletgui.FeatureRenderer.lastFeatureAdded;
53676 features[i].featureGroup = jalview.appletgui.FeatureRenderer.lastFeatureGroupAdded;
53677 features[i].description = jalview.appletgui.FeatureRenderer.lastDescriptionAdded;
53678 sequences[i].addSequenceFeature (features[i]);
53679 ffile.parseDescriptionHTML (features[i], false);
53680 }
53681 var newColour = this.colourPanel.getBackground ();
53682 if (jalview.appletgui.FeatureRenderer.lastFeatureGroupAdded != null) {
53683 this.setGroupVisibility (jalview.appletgui.FeatureRenderer.lastFeatureGroupAdded, true);
53684 }this.setColour (jalview.appletgui.FeatureRenderer.lastFeatureAdded, newColour);
53685 this.setVisible (jalview.appletgui.FeatureRenderer.lastFeatureAdded);
53686 this.findAllFeatures (false);
53687 } else {
53688 return false;
53689 }}if ((this.av).featureSettings != null) {
53690 (this.av).featureSettings.refreshTable ();
53691 }ap.paintAlignment (true);
53692 return true;
53693 }, "~A,~A,~B,jalview.appletgui.AlignmentPanel");
53694 c$.$FeatureRenderer$FeatureColourPanel$ = function () {
53695 Clazz_pu$h(self.c$);
53696 c$ = Clazz_decorateAsClass (function () {
53697 Clazz_prepareCallback (this, arguments);
53698 this.label = "";
53699 this.maxCol = null;
53700 this.isColourByLabel = false;
53701 this.isGcol = false;
53702 Clazz_instantialize (this, arguments);
53703 }, jalview.appletgui.FeatureRenderer, "FeatureColourPanel", awt2swing.Panel);
53704 Clazz_defineMethod (c$, "updateColor", 
53705 function (a) {
53706 var b;
53707 var c = null;
53708 var d = null;
53709 var e = "";
53710 if (Clazz_instanceOf (a, java.awt.Color)) {
53711 this.isGcol = false;
53712 c = a;
53713 d = null;
53714 } else if (Clazz_instanceOf (a, jalview.schemes.GraduatedColor)) {
53715 this.isGcol = true;
53716 d = a;
53717 c = null;
53718 } else {
53719 throw  new Error (jalview.util.MessageManager.getString ("error.invalid_colour_for_mycheckbox"));
53720 }if (c != null) {
53721 this.setBackground (b = c);
53722 } else {
53723 if (d.getThreshType () != -1) {
53724 e += " " + ((d.getThreshType () == 1) ? "(>)" : "(<)");
53725 }if (this.isColourByLabel = d.isColourByLabel ()) {
53726 this.setBackground (b = java.awt.Color.white);
53727 e += " (by Label)";
53728 } else {
53729 this.setBackground (b = d.getMinColor ());
53730 this.maxCol = d.getMaxColor ();
53731 }}this.label = e;
53732 this.setBackground (b);
53733 this.repaint ();
53734 }, "~O");
53735 Clazz_makeConstructor (c$, 
53736 function () {
53737 Clazz_superConstructor (this, jalview.appletgui.FeatureRenderer.FeatureColourPanel, [null]);
53738 });
53739 Clazz_defineMethod (c$, "PaintComponent", 
53740 function (a) {
53741 var b = this.getSize ();
53742 if (this.isGcol) {
53743 if (this.isColourByLabel) {
53744 a.setColor (java.awt.Color.white);
53745 a.fillRect (Clazz_doubleToInt (b.width / 2), 0, Clazz_doubleToInt (b.width / 2), b.height);
53746 a.setColor (java.awt.Color.black);
53747 var c =  new java.awt.Font ("Verdana", 0, 10);
53748 a.setFont (c);
53749 awt2swing.Util.drawString (a, jalview.util.MessageManager.getString ("label.label"), 0, 0);
53750 } else {
53751 a.setColor (this.maxCol);
53752 a.fillRect (Clazz_doubleToInt (b.width / 2), 0, Clazz_doubleToInt (b.width / 2), b.height);
53753 }}}, "java.awt.Graphics");
53754 c$ = Clazz_p0p ();
53755 };
53756 c$.$FeatureRenderer$1$ = function () {
53757 Clazz_pu$h(self.c$);
53758 c$ = Clazz_declareAnonymous (jalview.appletgui, "FeatureRenderer$1", null, java.awt.event.ItemListener);
53759 Clazz_overrideMethod (c$, "itemStateChanged", 
53760 function (e) {
53761 var index = this.f$.overlaps.getSelectedIndex ();
53762 if (index != -1) {
53763 this.b$["jalview.appletgui.FeatureRenderer"].featureIndex = index;
53764 this.f$.name.setText (this.f$.features[index].getType ());
53765 this.f$.description.setText (this.f$.features[index].getDescription ());
53766 this.f$.source.setText (this.f$.features[index].getFeatureGroup ());
53767 this.f$.start.setText (this.f$.features[index].getBegin () + "");
53768 this.f$.end.setText (this.f$.features[index].getEnd () + "");
53769 var highlight =  new jalview.datamodel.SearchResults ();
53770 highlight.addResult (this.f$.sequences[0], this.f$.features[index].getBegin (), this.f$.features[index].getEnd ());
53771 this.f$.ap.seqPanel.seqCanvas.highlightSearchResults (highlight);
53772 }var col = this.b$["jalview.appletgui.FeatureRenderer"].getFeatureStyle (this.f$.name.getText ());
53773 if (col == null) {
53774 col =  new jalview.schemes.UserColourScheme ().createColourFromName (this.f$.name.getText ());
53775 }this.b$["jalview.appletgui.FeatureRenderer"].colourPanel.updateColor (col);
53776 }, "java.awt.event.ItemEvent");
53777 c$ = Clazz_p0p ();
53778 };
53779 c$.$FeatureRenderer$2$ = function () {
53780 Clazz_pu$h(self.c$);
53781 c$ = Clazz_declareAnonymous (jalview.appletgui, "FeatureRenderer$2", null, java.awt.event.ActionListener);
53782 Clazz_overrideMethod (c$, "actionPerformed", 
53783 function (evt) {
53784 this.b$["jalview.appletgui.FeatureRenderer"].deleteFeature = true;
53785 this.f$.dialog.setVisible (false);
53786 }, "java.awt.event.ActionEvent");
53787 c$ = Clazz_p0p ();
53788 };
53789 c$.$FeatureRenderer$3$ = function () {
53790 Clazz_pu$h(self.c$);
53791 c$ = Clazz_declareAnonymous (jalview.appletgui, "FeatureRenderer$3", java.awt.event.MouseAdapter);
53792 Clazz_overrideMethod (c$, "mousePressed", 
53793 function (evt) {
53794 if (!this.b$["jalview.appletgui.FeatureRenderer"].colourPanel.isGcol) {
53795  new jalview.appletgui.UserDefinedColours (this.f$.fr, this.f$.ap.alignFrame);
53796 } else {
53797 var fcc =  new jalview.appletgui.FeatureColourChooser (this.f$.ap.alignFrame, this.f$.name.getText ());
53798 this.f$.dialog.transferFocus ();
53799 }}, "java.awt.event.MouseEvent");
53800 c$ = Clazz_p0p ();
53801 };
53802 Clazz_defineStatics (c$,
53803 "lastFeatureAdded", null,
53804 "lastFeatureGroupAdded", null,
53805 "lastDescriptionAdded", null);
53806 });
53807 Clazz_declarePackage ("jalview.renderer.seqfeatures");
53808 Clazz_load (["jalview.viewmodel.seqfeatures.FeatureRendererModel"], "jalview.renderer.seqfeatures.FeatureRenderer", ["awt2swing.Util", "jalview.util.Comparison", "java.awt.AlphaComposite", "$.Color", "java.awt.image.BufferedImage", "java.lang.Float"], function () {
53809 c$ = Clazz_decorateAsClass (function () {
53810 this.fm = null;
53811 this.charOffset = 0;
53812 this.offscreenRender = false;
53813 this.lastSeq = null;
53814 this.s = '\0';
53815 this.i = 0;
53816 this.av_charHeight = 0;
53817 this.av_charWidth = 0;
53818 this.av_validCharWidth = false;
53819 this.av_isShowSeqFeatureHeight = false;
53820 this.offscreenImage = null;
53821 this.lastSequenceFeatures = null;
53822 this.sfSize = 0;
53823 this.sfindex = 0;
53824 this.spos = 0;
53825 this.epos = 0;
53826 this.transparencyAvailable = true;
53827 Clazz_instantialize (this, arguments);
53828 }, jalview.renderer.seqfeatures, "FeatureRenderer", jalview.viewmodel.seqfeatures.FeatureRendererModel);
53829 Clazz_defineMethod (c$, "updateAvConfig", 
53830 function () {
53831 this.av_charHeight = this.av.getCharHeight ();
53832 this.av_charWidth = this.av.getCharWidth ();
53833 this.av_validCharWidth = this.av.isValidCharWidth ();
53834 this.av_isShowSeqFeatureHeight = this.av.isShowSequenceFeaturesHeight ();
53835 });
53836 Clazz_defineMethod (c$, "renderFeature", 
53837 function (g, seq, fstart, fend, featureColour, start, end, y1) {
53838 this.updateAvConfig ();
53839 if (((fstart <= end) && (fend >= start))) {
53840 if (fstart < start) {
53841 fstart = start;
53842 }if (fend >= end) {
53843 fend = end;
53844 }var pady = (y1 + this.av_charHeight) - Clazz_doubleToInt (this.av_charHeight / 5);
53845 for (this.i = fstart; this.i <= fend; this.i++) {
53846 this.s = seq.getCharAt (this.i);
53847 if (jalview.util.Comparison.isGap (this.s)) {
53848 continue;
53849 }g.setColor (featureColour);
53850 g.fillRect ((this.i - start) * this.av_charWidth, y1, this.av_charWidth, this.av_charHeight);
53851 if (this.offscreenRender || !this.av_validCharWidth) {
53852 continue;
53853 }g.setColor (java.awt.Color.white);
53854 this.charOffset = Clazz_doubleToInt ((this.av_charWidth - this.fm.charWidth (this.s)) / 2);
53855 awt2swing.Util.drawString (g, String.valueOf (this.s), this.charOffset + (this.av_charWidth * (this.i - start)), pady);
53856 }
53857 }}, "java.awt.Graphics,jalview.datamodel.SequenceI,~N,~N,java.awt.Color,~N,~N,~N");
53858 Clazz_defineMethod (c$, "renderScoreFeature", 
53859 function (g, seq, fstart, fend, featureColour, start, end, y1, bs) {
53860 this.updateAvConfig ();
53861 if (((fstart <= end) && (fend >= start))) {
53862 if (fstart < start) {
53863 fstart = start;
53864 }if (fend >= end) {
53865 fend = end;
53866 }var pady = (y1 + this.av_charHeight) - Clazz_doubleToInt (this.av_charHeight / 5);
53867 var ystrt = 0;
53868 var yend = this.av_charHeight;
53869 if (bs[0] != 0) {
53870 if (bs[1] < 128) {
53871 yend = Clazz_doubleToInt (this.av_charHeight * (128 - bs[1]) / 512);
53872 ystrt = this.av_charHeight - Clazz_doubleToInt (yend / 2);
53873 } else {
53874 ystrt = Clazz_doubleToInt (this.av_charHeight / 2);
53875 yend = Clazz_doubleToInt (this.av_charHeight * (bs[1] - 128) / 512);
53876 }} else {
53877 yend = Clazz_doubleToInt (this.av_charHeight * bs[1] / 255);
53878 ystrt = this.av_charHeight - yend;
53879 }for (this.i = fstart; this.i <= fend; this.i++) {
53880 this.s = seq.getCharAt (this.i);
53881 if (jalview.util.Comparison.isGap (this.s)) {
53882 continue;
53883 }g.setColor (featureColour);
53884 var x = (this.i - start) * this.av_charWidth;
53885 g.drawRect (x, y1, this.av_charWidth, this.av_charHeight);
53886 g.fillRect (x, y1 + ystrt, this.av_charWidth, yend);
53887 if (this.offscreenRender || !this.av_validCharWidth) {
53888 continue;
53889 }g.setColor (java.awt.Color.black);
53890 this.charOffset = Clazz_doubleToInt ((this.av_charWidth - this.fm.charWidth (this.s)) / 2);
53891 awt2swing.Util.drawString (g, String.valueOf (this.s), this.charOffset + (this.av_charWidth * (this.i - start)), pady);
53892 }
53893 }}, "java.awt.Graphics,jalview.datamodel.SequenceI,~N,~N,java.awt.Color,~N,~N,~N,~A");
53894 Clazz_defineMethod (c$, "findFeatureColour", 
53895 function (initialCol, seq, res) {
53896 return  new java.awt.Color (this.findFeatureColour (initialCol.getRGB (), seq, res));
53897 }, "java.awt.Color,jalview.datamodel.SequenceI,~N");
53898 Clazz_defineMethod (c$, "findFeatureColour", 
53899 function (initialCol, seq, column) {
53900 if (!this.av.isShowSequenceFeatures ()) {
53901 return initialCol;
53902 }var sequenceFeatures = seq.getSequenceFeatures ();
53903 if (seq !== this.lastSeq) {
53904 this.lastSeq = seq;
53905 this.lastSequenceFeatures = sequenceFeatures;
53906 if (this.lastSequenceFeatures != null) {
53907 this.sfSize = this.lastSequenceFeatures.length;
53908 }} else {
53909 if (this.lastSequenceFeatures !== sequenceFeatures) {
53910 this.lastSequenceFeatures = sequenceFeatures;
53911 if (this.lastSequenceFeatures != null) {
53912 this.sfSize = this.lastSequenceFeatures.length;
53913 }}}if (this.lastSequenceFeatures == null || this.sfSize == 0) {
53914 return initialCol;
53915 }if (jalview.util.Comparison.isGap (this.lastSeq.getCharAt (column))) {
53916 return java.awt.Color.white.getRGB ();
53917 }if (this.transparency != 1.0 && this.offscreenImage == null) {
53918 this.offscreenImage =  new java.awt.image.BufferedImage (1, 1, 2);
53919 }this.currentColour = null;
53920 this.offscreenRender = true;
53921 if (this.offscreenImage != null) {
53922 this.offscreenImage.setRGB (0, 0, initialCol);
53923 this.drawSequence (this.offscreenImage.getGraphics (), this.lastSeq, column, column, 0);
53924 return this.offscreenImage.getRGB (0, 0);
53925 } else {
53926 this.drawSequence (null, this.lastSeq, this.lastSeq.findPosition (column), -1, -1);
53927 if (this.currentColour == null) {
53928 return initialCol;
53929 } else {
53930 return (this.currentColour).intValue ();
53931 }}}, "~N,jalview.datamodel.SequenceI,~N");
53932 Clazz_defineMethod (c$, "drawSequence", 
53933 function (g, seq, start, end, y1) {
53934 var sequenceFeatures = seq.getSequenceFeatures ();
53935 if (sequenceFeatures == null || sequenceFeatures.length == 0) {
53936 return;
53937 }if (g != null) {
53938 this.fm = g.getFontMetrics ();
53939 }this.updateFeatures ();
53940 if (this.lastSeq == null || seq !== this.lastSeq || sequenceFeatures !== this.lastSequenceFeatures) {
53941 this.lastSeq = seq;
53942 this.lastSequenceFeatures = sequenceFeatures;
53943 }if (this.transparency != 1 && g != null) {
53944 var g2 = g;
53945 g2.setComposite (java.awt.AlphaComposite.getInstance (3, this.transparency));
53946 }if (!this.offscreenRender) {
53947 this.spos = this.lastSeq.findPosition (start);
53948 this.epos = this.lastSeq.findPosition (end);
53949 }this.sfSize = this.lastSequenceFeatures.length;
53950 var type;
53951 for (var renderIndex = 0; renderIndex < this.renderOrder.length; renderIndex++) {
53952 type = this.renderOrder[renderIndex];
53953 if (type == null || !this.showFeatureOfType (type)) {
53954 continue;
53955 }for (this.sfindex = 0; this.sfindex < this.sfSize; this.sfindex++) {
53956 var sequenceFeature = this.lastSequenceFeatures[this.sfindex];
53957 if (!sequenceFeature.type.equals (type)) {
53958 continue;
53959 }if (this.featureGroups != null && sequenceFeature.featureGroup != null && sequenceFeature.featureGroup.length != 0 && this.featureGroups.containsKey (sequenceFeature.featureGroup) && !this.featureGroups.get (sequenceFeature.featureGroup).booleanValue ()) {
53960 continue;
53961 }if (!this.offscreenRender && (sequenceFeature.getBegin () > this.epos || sequenceFeature.getEnd () < this.spos)) {
53962 continue;
53963 }if (this.offscreenRender && this.offscreenImage == null) {
53964 if (sequenceFeature.begin <= start && sequenceFeature.end >= start) {
53965 this.currentColour =  new Integer (this.getColour (sequenceFeature).getRGB ());
53966 }} else if (sequenceFeature.type.equals ("disulfide bond")) {
53967 this.renderFeature (g, seq, seq.findIndex (sequenceFeature.begin) - 1, seq.findIndex (sequenceFeature.begin) - 1, this.getColour (sequenceFeature), start, end, y1);
53968 this.renderFeature (g, seq, seq.findIndex (sequenceFeature.end) - 1, seq.findIndex (sequenceFeature.end) - 1, this.getColour (sequenceFeature), start, end, y1);
53969 } else if (this.showFeature (sequenceFeature)) {
53970 if (this.av_isShowSeqFeatureHeight && !Float.isNaN (sequenceFeature.score)) {
53971 this.renderScoreFeature (g, seq, seq.findIndex (sequenceFeature.begin) - 1, seq.findIndex (sequenceFeature.end) - 1, this.getColour (sequenceFeature), start, end, y1, this.normaliseScore (sequenceFeature));
53972 } else {
53973 this.renderFeature (g, seq, seq.findIndex (sequenceFeature.begin) - 1, seq.findIndex (sequenceFeature.end) - 1, this.getColour (sequenceFeature), start, end, y1);
53974 }}}
53975 }
53976 if (this.transparency != 1.0 && g != null && this.transparencyAvailable) {
53977 var g2 = g;
53978 g2.setComposite (java.awt.AlphaComposite.getInstance (3, 1.0));
53979 }}, "java.awt.Graphics,jalview.datamodel.SequenceI,~N,~N,~N");
53980 Clazz_defineMethod (c$, "setTransparencyAvailable", 
53981 function (isTransparencyAvailable) {
53982 this.transparencyAvailable = isTransparencyAvailable;
53983 }, "~B");
53984 Clazz_overrideMethod (c$, "isTransparencyAvailable", 
53985 function () {
53986 return this.transparencyAvailable;
53987 });
53988 Clazz_overrideMethod (c$, "featuresAdded", 
53989 function () {
53990 this.lastSeq = null;
53991 this.findAllFeatures ();
53992 });
53993 });
53994 Clazz_declarePackage ("jalview.viewmodel.seqfeatures");
53995 Clazz_load (["jalview.api.FeatureRenderer", "java.beans.PropertyChangeSupport", "java.lang.Boolean", "java.util.Hashtable", "java.util.concurrent.ConcurrentHashMap"], "jalview.viewmodel.seqfeatures.FeatureRendererModel", ["jalview.schemes.GraduatedColor", "$.UserColourScheme", "jalview.util.QuickSort", "jalview.viewmodel.seqfeatures.FeatureRendererSettings", "$.FeaturesDisplayed", "java.awt.Color", "java.lang.Error", "$.Float", "java.util.ArrayList", "$.Arrays"], function () {
53996 c$ = Clazz_decorateAsClass (function () {
53997 this.transparency = 1.0;
53998 this.featureColours = null;
53999 this.featureGroups = null;
54000 this.currentColour = null;
54001 this.renderOrder = null;
54002 this.changeSupport = null;
54003 this.av = null;
54004 this.minmax = null;
54005 this.newFeatureAdded = false;
54006 this.findingFeatures = false;
54007 this.firing = null;
54008 this.featureOrder = null;
54009 Clazz_instantialize (this, arguments);
54010 }, jalview.viewmodel.seqfeatures, "FeatureRendererModel", null, jalview.api.FeatureRenderer);
54011 Clazz_prepareFields (c$, function () {
54012 this.featureColours =  new java.util.concurrent.ConcurrentHashMap ();
54013 this.featureGroups =  new java.util.concurrent.ConcurrentHashMap ();
54014 this.changeSupport =  new java.beans.PropertyChangeSupport (this);
54015 this.minmax =  new java.util.Hashtable ();
54016 this.firing = Boolean.FALSE;
54017 });
54018 Clazz_overrideMethod (c$, "getViewport", 
54019 function () {
54020 return this.av;
54021 });
54022 Clazz_defineMethod (c$, "getSettings", 
54023 function () {
54024 return  new jalview.viewmodel.seqfeatures.FeatureRendererSettings (this);
54025 });
54026 Clazz_defineMethod (c$, "transferSettings", 
54027 function (fr) {
54028 this.renderOrder = fr.renderOrder;
54029 this.featureGroups = fr.featureGroups;
54030 this.featureColours = fr.featureColours;
54031 this.transparency = fr.transparency;
54032 this.featureOrder = fr.featureOrder;
54033 }, "jalview.viewmodel.seqfeatures.FeatureRendererSettings");
54034 Clazz_defineMethod (c$, "transferSettings", 
54035 function (_fr) {
54036 var fr = _fr;
54037 var frs =  new jalview.viewmodel.seqfeatures.FeatureRendererSettings (fr);
54038 this.renderOrder = frs.renderOrder;
54039 this.featureGroups = frs.featureGroups;
54040 this.featureColours = frs.featureColours;
54041 this.transparency = frs.transparency;
54042 this.featureOrder = frs.featureOrder;
54043 if (this.av != null && this.av !== fr.getViewport ()) {
54044 if (_fr.getFeaturesDisplayed () != null) {
54045 var fd = this.getFeaturesDisplayed ();
54046 if (fd == null) {
54047 this.setFeaturesDisplayedFrom (_fr.getFeaturesDisplayed ());
54048 } else {
54049 {
54050 fd.clear ();
54051 var fdisp = _fr.getFeaturesDisplayed ().getVisibleFeatures ();
54052 while (fdisp.hasNext ()) {
54053 fd.setVisible (fdisp.next ());
54054 }
54055 }}}}}, "jalview.api.FeatureRenderer");
54056 Clazz_defineMethod (c$, "setFeaturesDisplayedFrom", 
54057 function (featuresDisplayed) {
54058 this.av.setFeaturesDisplayed ( new jalview.viewmodel.seqfeatures.FeaturesDisplayed (featuresDisplayed));
54059 }, "jalview.api.FeaturesDisplayedI");
54060 Clazz_overrideMethod (c$, "setVisible", 
54061 function (featureType) {
54062 var fdi = this.av.getFeaturesDisplayed ();
54063 if (fdi == null) {
54064 this.av.setFeaturesDisplayed (fdi =  new jalview.viewmodel.seqfeatures.FeaturesDisplayed ());
54065 }if (!fdi.isRegistered (featureType)) {
54066 this.pushFeatureType (java.util.Arrays.asList ( Clazz_newArray (-1, [featureType])));
54067 }fdi.setVisible (featureType);
54068 }, "~S");
54069 Clazz_overrideMethod (c$, "setAllVisible", 
54070 function (featureTypes) {
54071 var fdi = this.av.getFeaturesDisplayed ();
54072 if (fdi == null) {
54073 this.av.setFeaturesDisplayed (fdi =  new jalview.viewmodel.seqfeatures.FeaturesDisplayed ());
54074 }var nft =  new java.util.ArrayList ();
54075 for (var featureType, $featureType = featureTypes.iterator (); $featureType.hasNext () && ((featureType = $featureType.next ()) || true);) {
54076 if (!fdi.isRegistered (featureType)) {
54077 nft.add (featureType);
54078 }}
54079 if (nft.size () > 0) {
54080 this.pushFeatureType (nft);
54081 }fdi.setAllVisible (featureTypes);
54082 }, "java.util.List");
54083 Clazz_defineMethod (c$, "pushFeatureType", 
54084  function (types) {
54085 var ts = types.size ();
54086 var neworder =  new Array ((this.renderOrder == null ? 0 : this.renderOrder.length) + ts);
54087 types.toArray (neworder);
54088 if (this.renderOrder != null) {
54089 System.arraycopy (neworder, 0, neworder, this.renderOrder.length, ts);
54090 System.arraycopy (this.renderOrder, 0, neworder, 0, this.renderOrder.length);
54091 }this.renderOrder = neworder;
54092 }, "java.util.List");
54093 Clazz_defineMethod (c$, "getMinMax", 
54094 function () {
54095 return this.minmax;
54096 });
54097 Clazz_defineMethod (c$, "normaliseScore", 
54098 function (sequenceFeature) {
54099 var mm = (this.minmax.get (sequenceFeature.type))[0];
54100 var r =  Clazz_newByteArray (-1, [0, 255]);
54101 if (mm != null) {
54102 if (r[0] != 0 || mm[0] < 0.0) {
54103 r[0] = 1;
54104 r[1] = Clazz_doubleToByte (Clazz_doubleToInt (128.0) + 127.0 * (sequenceFeature.score / mm[1]));
54105 } else {
54106 r[1] = Clazz_floatToByte (Clazz_doubleToInt (255.0) * (sequenceFeature.score / mm[1]));
54107 }}return r;
54108 }, "jalview.datamodel.SequenceFeature");
54109 Clazz_defineMethod (c$, "updateFeatures", 
54110 function () {
54111 if (this.av.getFeaturesDisplayed () == null || this.renderOrder == null || this.newFeatureAdded) {
54112 this.findAllFeatures ();
54113 if (this.av.getFeaturesDisplayed ().getVisibleFeatureCount () < 1) {
54114 return false;
54115 }}return true;
54116 });
54117 Clazz_defineMethod (c$, "findAllFeatures", 
54118 function () {
54119 {
54120 if (this.firing.equals (Boolean.FALSE)) {
54121 this.firing = Boolean.TRUE;
54122 this.findAllFeatures (true);
54123 this.changeSupport.firePropertyChange ("changeSupport", null, null);
54124 this.firing = Boolean.FALSE;
54125 }}});
54126 Clazz_overrideMethod (c$, "findFeaturesAtRes", 
54127 function (sequence, res) {
54128 var tmp =  new java.util.ArrayList ();
54129 var features = sequence.getSequenceFeatures ();
54130 if (features != null) {
54131 for (var i = 0; i < features.length; i++) {
54132 if (!this.av.areFeaturesDisplayed () || !this.av.getFeaturesDisplayed ().isVisible (features[i].getType ())) {
54133 continue;
54134 }if (features[i].featureGroup != null && this.featureGroups != null && this.featureGroups.containsKey (features[i].featureGroup) && !this.featureGroups.get (features[i].featureGroup).booleanValue ()) {
54135 continue;
54136 }if ((features[i].getBegin () <= res) && (features[i].getEnd () >= res)) {
54137 tmp.add (features[i]);
54138 }}
54139 }return tmp;
54140 }, "jalview.datamodel.SequenceI,~N");
54141 Clazz_defineMethod (c$, "findAllFeatures", 
54142 function (newMadeVisible) {
54143 this.newFeatureAdded = false;
54144 if (this.findingFeatures) {
54145 this.newFeatureAdded = true;
54146 return;
54147 }this.findingFeatures = true;
54148 if (this.av.getFeaturesDisplayed () == null) {
54149 this.av.setFeaturesDisplayed ( new jalview.viewmodel.seqfeatures.FeaturesDisplayed ());
54150 }var featuresDisplayed = this.av.getFeaturesDisplayed ();
54151 var allfeatures =  new java.util.ArrayList ();
54152 var oldfeatures =  new java.util.ArrayList ();
54153 if (this.renderOrder != null) {
54154 for (var i = 0; i < this.renderOrder.length; i++) {
54155 if (this.renderOrder[i] != null) {
54156 oldfeatures.add (this.renderOrder[i]);
54157 }}
54158 }if (this.minmax == null) {
54159 this.minmax =  new java.util.Hashtable ();
54160 }var alignment = this.av.getAlignment ();
54161 for (var i = 0; i < alignment.getHeight (); i++) {
54162 var asq = alignment.getSequenceAt (i);
54163 var features = asq.getSequenceFeatures ();
54164 if (features == null) {
54165 continue;
54166 }var index = 0;
54167 while (index < features.length) {
54168 if (!featuresDisplayed.isRegistered (features[index].getType ())) {
54169 var fgrp = features[index].getFeatureGroup ();
54170 if (fgrp != null) {
54171 var groupDisplayed = this.featureGroups.get (fgrp);
54172 if (groupDisplayed == null) {
54173 groupDisplayed = Boolean.$valueOf (newMadeVisible);
54174 this.featureGroups.put (fgrp, groupDisplayed);
54175 }if (!groupDisplayed.booleanValue ()) {
54176 index++;
54177 continue;
54178 }}if (!(features[index].begin == 0 && features[index].end == 0)) {
54179 if (newMadeVisible && !oldfeatures.contains (features[index].getType ())) {
54180 featuresDisplayed.setVisible (features[index].getType ());
54181 this.setOrder (features[index].getType (), 0);
54182 }}}if (!allfeatures.contains (features[index].getType ())) {
54183 allfeatures.add (features[index].getType ());
54184 }if (!Float.isNaN (features[index].score)) {
54185 var nonpos = features[index].getBegin () >= 1 ? 0 : 1;
54186 var mm = this.minmax.get (features[index].getType ());
54187 if (mm == null) {
54188 mm =  Clazz_newArray (-1, [null, null]);
54189 this.minmax.put (features[index].getType (), mm);
54190 }if (mm[nonpos] == null) {
54191 mm[nonpos] =  Clazz_newFloatArray (-1, [features[index].score, features[index].score]);
54192 } else {
54193 if (mm[nonpos][0] > features[index].score) {
54194 mm[nonpos][0] = features[index].score;
54195 }if (mm[nonpos][1] < features[index].score) {
54196 mm[nonpos][1] = features[index].score;
54197 }}}index++;
54198 }
54199 }
54200 this.updateRenderOrder (allfeatures);
54201 this.findingFeatures = false;
54202 }, "~B");
54203 Clazz_defineMethod (c$, "updateRenderOrder", 
54204  function (allFeatures) {
54205 var allfeatures =  new java.util.ArrayList (allFeatures);
54206 var oldRender = this.renderOrder;
54207 this.renderOrder =  new Array (allfeatures.size ());
54208 var mmrange;
54209 var fc = null;
54210 var initOrders = (this.featureOrder == null);
54211 var opos = 0;
54212 if (oldRender != null && oldRender.length > 0) {
54213 for (var j = 0; j < oldRender.length; j++) {
54214 if (oldRender[j] != null) {
54215 if (initOrders) {
54216 this.setOrder (oldRender[j], (1 - (1 + j) / oldRender.length));
54217 }if (allfeatures.contains (oldRender[j])) {
54218 this.renderOrder[opos++] = oldRender[j];
54219 allfeatures.remove (oldRender[j]);
54220 if (this.minmax != null) {
54221 mmrange = this.minmax.get (oldRender[j]);
54222 if (mmrange != null) {
54223 fc = this.featureColours.get (oldRender[j]);
54224 if (fc != null && Clazz_instanceOf (fc, jalview.schemes.GraduatedColor) && (fc).isAutoScale ()) {
54225 (fc).updateBounds ((mmrange)[0][0], (mmrange)[0][1]);
54226 }}}}}}
54227 }if (allfeatures.size () == 0) {
54228 return;
54229 }var i = allfeatures.size () - 1;
54230 var iSize = i;
54231 var sort = false;
54232 var newf =  new Array (allfeatures.size ());
54233 var sortOrder =  Clazz_newFloatArray (allfeatures.size (), 0);
54234 for (var newfeat, $newfeat = allfeatures.iterator (); $newfeat.hasNext () && ((newfeat = $newfeat.next ()) || true);) {
54235 newf[i] = newfeat;
54236 if (this.minmax != null) {
54237 mmrange = this.minmax.get (newf[i]);
54238 if (mmrange != null) {
54239 fc = this.featureColours.get (newf[i]);
54240 if (fc != null && Clazz_instanceOf (fc, jalview.schemes.GraduatedColor) && (fc).isAutoScale ()) {
54241 (fc).updateBounds ((mmrange)[0][0], (mmrange)[0][1]);
54242 }}}if (initOrders || !this.featureOrder.containsKey (newf[i])) {
54243 var denom = initOrders ? allfeatures.size () : this.featureOrder.size ();
54244 this.setOrder (newf[i], i / denom);
54245 }sortOrder[i] = 2 - (this.featureOrder.get (newf[i])).floatValue ();
54246 if (i < iSize) {
54247 sort = sort || sortOrder[i] > sortOrder[i + 1];
54248 }i--;
54249 }
54250 if (iSize > 1 && sort) {
54251 jalview.util.QuickSort.sortFloatObject (sortOrder, newf);
54252 }sortOrder = null;
54253 System.arraycopy (newf, 0, this.renderOrder, opos, newf.length);
54254 }, "java.util.List");
54255 Clazz_overrideMethod (c$, "getFeatureStyle", 
54256 function (featureType) {
54257 var fc = this.featureColours.get (featureType);
54258 if (fc == null) {
54259 var ucs =  new jalview.schemes.UserColourScheme ();
54260 var col = ucs.createColourFromName (featureType);
54261 this.featureColours.put (featureType, fc = col);
54262 }return fc;
54263 }, "~S");
54264 Clazz_defineMethod (c$, "getColour", 
54265 function (featureType) {
54266 var fc = this.getFeatureStyle (featureType);
54267 if (Clazz_instanceOf (fc, java.awt.Color)) {
54268 return fc;
54269 } else {
54270 if (Clazz_instanceOf (fc, jalview.schemes.GraduatedColor)) {
54271 return (fc).getMaxColor ();
54272 }}throw  new Error ("Implementation Error: Unrecognised render object " + fc.getClass () + " for features of type " + featureType);
54273 }, "~S");
54274 Clazz_defineMethod (c$, "getColour", 
54275 function (feature) {
54276 var fc = this.getFeatureStyle (feature.getType ());
54277 if (Clazz_instanceOf (fc, java.awt.Color)) {
54278 return fc;
54279 } else {
54280 if (Clazz_instanceOf (fc, jalview.schemes.GraduatedColor)) {
54281 return (fc).findColor (feature);
54282 }}throw  new Error ("Implementation Error: Unrecognised render object " + fc.getClass () + " for features of type " + feature.getType ());
54283 }, "jalview.datamodel.SequenceFeature");
54284 Clazz_defineMethod (c$, "showFeature", 
54285 function (sequenceFeature) {
54286 var fc = this.getFeatureStyle (sequenceFeature.type);
54287 if (Clazz_instanceOf (fc, jalview.schemes.GraduatedColor)) {
54288 return (fc).isColored (sequenceFeature);
54289 } else {
54290 return true;
54291 }}, "jalview.datamodel.SequenceFeature");
54292 Clazz_defineMethod (c$, "showFeatureOfType", 
54293 function (type) {
54294 return this.av.getFeaturesDisplayed ().isVisible (type);
54295 }, "~S");
54296 Clazz_overrideMethod (c$, "setColour", 
54297 function (featureType, col) {
54298 {
54299 this.featureColours.put (featureType, col);
54300 }}, "~S,~O");
54301 Clazz_defineMethod (c$, "setTransparency", 
54302 function (value) {
54303 this.transparency = value;
54304 }, "~N");
54305 Clazz_defineMethod (c$, "getTransparency", 
54306 function () {
54307 return this.transparency;
54308 });
54309 Clazz_defineMethod (c$, "setOrder", 
54310 function (type, position) {
54311 if (this.featureOrder == null) {
54312 this.featureOrder =  new java.util.Hashtable ();
54313 }this.featureOrder.put (type,  new Float (position));
54314 return position;
54315 }, "~S,~N");
54316 Clazz_defineMethod (c$, "getOrder", 
54317 function (type) {
54318 if (this.featureOrder != null) {
54319 if (this.featureOrder.containsKey (type)) {
54320 return (this.featureOrder.get (type)).floatValue ();
54321 }}return -1;
54322 }, "~S");
54323 Clazz_overrideMethod (c$, "getFeatureColours", 
54324 function () {
54325 return  new java.util.concurrent.ConcurrentHashMap (this.featureColours);
54326 });
54327 Clazz_defineMethod (c$, "setFeaturePriority", 
54328 function (data) {
54329 this.setFeaturePriority (data, true);
54330 }, "~A");
54331 Clazz_defineMethod (c$, "setFeaturePriority", 
54332 function (data, visibleNew) {
54333 var av_featuresdisplayed = null;
54334 if (visibleNew) {
54335 if ((av_featuresdisplayed = this.av.getFeaturesDisplayed ()) != null) {
54336 this.av.getFeaturesDisplayed ().clear ();
54337 } else {
54338 this.av.setFeaturesDisplayed (av_featuresdisplayed =  new jalview.viewmodel.seqfeatures.FeaturesDisplayed ());
54339 }} else {
54340 av_featuresdisplayed = this.av.getFeaturesDisplayed ();
54341 }if (data == null) {
54342 return;
54343 }this.renderOrder =  new Array (data.length);
54344 if (data.length > 0) {
54345 for (var i = 0; i < data.length; i++) {
54346 var type = data[i][0].toString ();
54347 this.setColour (type, data[i][1]);
54348 if ((data[i][2]).booleanValue ()) {
54349 av_featuresdisplayed.setVisible (type);
54350 }this.renderOrder[data.length - i - 1] = type;
54351 }
54352 }}, "~A,~B");
54353 Clazz_defineMethod (c$, "addPropertyChangeListener", 
54354 function (listener) {
54355 this.changeSupport.addPropertyChangeListener (listener);
54356 }, "java.beans.PropertyChangeListener");
54357 Clazz_defineMethod (c$, "removePropertyChangeListener", 
54358 function (listener) {
54359 this.changeSupport.removePropertyChangeListener (listener);
54360 }, "java.beans.PropertyChangeListener");
54361 Clazz_defineMethod (c$, "getAllFeatureColours", 
54362 function () {
54363 return this.featureColours.keySet ();
54364 });
54365 Clazz_defineMethod (c$, "clearRenderOrder", 
54366 function () {
54367 this.renderOrder = null;
54368 });
54369 Clazz_defineMethod (c$, "hasRenderOrder", 
54370 function () {
54371 return this.renderOrder != null;
54372 });
54373 Clazz_defineMethod (c$, "getRenderOrder", 
54374 function () {
54375 if (this.renderOrder == null) {
54376 return java.util.Arrays.asList ( Clazz_newArray (-1, []));
54377 }return java.util.Arrays.asList (this.renderOrder);
54378 });
54379 Clazz_defineMethod (c$, "getFeatureGroupsSize", 
54380 function () {
54381 return this.featureGroups != null ? 0 : this.featureGroups.size ();
54382 });
54383 Clazz_overrideMethod (c$, "getFeatureGroups", 
54384 function () {
54385 return (this.featureGroups == null) ? java.util.Arrays.asList ( new Array (0)) : java.util.Arrays.asList (this.featureGroups.keySet ().toArray ( new Array (0)));
54386 });
54387 Clazz_defineMethod (c$, "checkGroupVisibility", 
54388 function (group, newGroupsVisible) {
54389 if (this.featureGroups == null) {
54390 }if (this.featureGroups.containsKey (group)) {
54391 return this.featureGroups.get (group).booleanValue ();
54392 }if (newGroupsVisible) {
54393 this.featureGroups.put (group,  new Boolean (true));
54394 return true;
54395 }return false;
54396 }, "~S,~B");
54397 Clazz_overrideMethod (c$, "getGroups", 
54398 function (visible) {
54399 if (this.featureGroups != null) {
54400 var gp =  new java.util.ArrayList ();
54401 for (var grp, $grp = this.featureGroups.keySet ().iterator (); $grp.hasNext () && ((grp = $grp.next ()) || true);) {
54402 var state = this.featureGroups.get (grp);
54403 if (state.booleanValue () == visible) {
54404 gp.add (grp);
54405 }}
54406 return gp;
54407 }return null;
54408 }, "~B");
54409 Clazz_defineMethod (c$, "setGroupVisibility", 
54410 function (group, visible) {
54411 this.featureGroups.put (group,  new Boolean (visible));
54412 }, "~S,~B");
54413 Clazz_defineMethod (c$, "setGroupVisibility", 
54414 function (toset, visible) {
54415 if (toset != null && toset.size () > 0 && this.featureGroups != null) {
54416 var rdrw = false;
54417 for (var gst, $gst = toset.iterator (); $gst.hasNext () && ((gst = $gst.next ()) || true);) {
54418 var st = this.featureGroups.get (gst);
54419 this.featureGroups.put (gst,  new Boolean (visible));
54420 if (st != null) {
54421 rdrw = rdrw || (visible != st.booleanValue ());
54422 }}
54423 if (rdrw) {
54424 }}}, "java.util.List,~B");
54425 Clazz_overrideMethod (c$, "getDisplayedFeatureCols", 
54426 function () {
54427 var fcols =  new java.util.Hashtable ();
54428 if (this.getViewport ().getFeaturesDisplayed () == null) {
54429 return fcols;
54430 }var en = this.getViewport ().getFeaturesDisplayed ().getVisibleFeatures ();
54431 while (en.hasNext ()) {
54432 var col = en.next ();
54433 fcols.put (col, this.getColour (col));
54434 }
54435 return fcols;
54436 });
54437 Clazz_defineMethod (c$, "getFeaturesDisplayed", 
54438 function () {
54439 return this.av.getFeaturesDisplayed ();
54440 });
54441 Clazz_overrideMethod (c$, "getDisplayedFeatureTypes", 
54442 function () {
54443 var typ = null;
54444 typ = this.getRenderOrder ().toArray ( new Array (0));
54445 var feature_disp = this.av.getFeaturesDisplayed ();
54446 if (feature_disp != null) {
54447 {
54448 for (var i = 0; i < typ.length; i++) {
54449 if (!feature_disp.isVisible (typ[i])) {
54450 typ[i] = null;
54451 }}
54452 }}return typ;
54453 });
54454 Clazz_overrideMethod (c$, "getDisplayedFeatureGroups", 
54455 function () {
54456 var gps = null;
54457 var _gps =  new java.util.ArrayList ();
54458 var en = this.getFeatureGroups ().iterator ();
54459 var g = 0;
54460 var valid = false;
54461 while (en.hasNext ()) {
54462 var gp = en.next ();
54463 if (this.checkGroupVisibility (gp, false)) {
54464 valid = true;
54465 _gps.add (gp);
54466 }if (!valid) {
54467 return null;
54468 } else {
54469 gps =  new Array (_gps.size ());
54470 _gps.toArray (gps);
54471 }}
54472 return gps;
54473 });
54474 });
54475 Clazz_declarePackage ("jalview.api");
54476 Clazz_declareInterface (jalview.api, "FeatureRenderer");
54477 // BH concurrent version; copy of java.util.HashMap
54478 Clazz_declarePackage ("java.util.concurrent");
54479 Clazz_load(["java.util.AbstractMap","$.AbstractSet","$.Iterator","$.Map","$.MapEntry"],"java.util.concurrent.ConcurrentHashMap",["java.lang.IllegalArgumentException","$.IllegalStateException","java.util.AbstractCollection","$.Arrays","$.ConcurrentModificationException","java.util.MapEntry.Type","java.util.NoSuchElementException"],function(){
54480 c$=Clazz_decorateAsClass(function(){
54481 this.elementCount=0;
54482 this.elementData=null;
54483 this.loadFactor=0;
54484 this.threshold=0;
54485 this.modCount=0;
54486 Clazz_instantialize(this,arguments);
54487 },java.util.concurrent,"ConcurrentHashMap",java.util.AbstractMap,[java.util.Map,Cloneable,java.io.Serializable]);
54488 Clazz_defineMethod(c$,"newElementArray",
54489 function(s){
54490 return new Array(s);
54491 },"~N");
54492 //Clazz_makeConstructor(c$,
54493 //function(){
54494 //this.construct(16);
54495 //});
54496 //Clazz_makeConstructor(c$,
54497 //function(capacity){
54498 //Clazz_superConstructor(this,java.util.ConcurrentHashMap,[]);
54499 //if(capacity>=0){
54500 //this.elementCount=0;
54501 //this.elementData=this.newElementArray(capacity==0?1:capacity);
54502 //this.loadFactor=0.75;
54503 //this.computeMaxSize();
54504 //}else{
54505 //throw new IllegalArgumentException();
54506 //}},"~N");
54507 Clazz_makeConstructor(c$,
54508 function(){
54509 this.construct(16);
54510 });
54511 Clazz_makeConstructor(c$,
54512 function(capacity){
54513 Clazz_superConstructor(this,java.util.concurrent.ConcurrentHashMap,[]);
54514 if(capacity>=0){
54515 this.elementCount=0;
54516 this.elementData=this.newElementArray(capacity==0?1:capacity);
54517 this.loadFactor=0.75;
54518 this.computeMaxSize();
54519 }else{
54520 throw new IllegalArgumentException();
54521 }},"~N");
54522 Clazz_makeConstructor(c$,
54523 function(capacity,loadFactor){
54524 Clazz_superConstructor(this,java.util.concurrent.ConcurrentHashMap,[]);
54525 if(capacity>=0&&loadFactor>0){
54526 this.elementCount=0;
54527 this.elementData=this.newElementArray(capacity==0?1:capacity);
54528 this.loadFactor=loadFactor;
54529 this.computeMaxSize();
54530 }else{
54531 throw new IllegalArgumentException();
54532 }},"~N,~N");
54533 Clazz_makeConstructor(c$,
54534 function(map){
54535 this.construct(map.size()<6?11:map.size()*2);
54536 Clazz_superCall(this,java.util.concurrent.ConcurrentHashMap,"putAll",[map]);
54537 },"java.util.Map");
54538
54539
54540 /*
54541 Clazz_makeConstructor(c$,
54542 function(capacity,loadFactor){
54543 this.doConstruct(capacity,loadFactor);
54544 },"~N,~N");
54545
54546 Clazz_defineMethod(c$, "doConstruct",
54547 function(capacity,loadFactor) {
54548 capacity || (capacity = 16);
54549 loadFactor || (loadFactor = 0.75);
54550 if (typeof capacity != "number") {
54551  var map = capacity;
54552  this.loadFactor=loadFactor;
54553  this.elementData=this.newElementArray(map.size()<6?11:map.size()*2);
54554  this.computeMaxSize();
54555  this.putAllHM(map);
54556  return;
54557 }
54558
54559 //Clazz_superConstructor(this,java.util.ConcurrentHashMap,[]);
54560 if(capacity>=0&&loadFactor>0){
54561 this.elementData=this.newElementArray(capacity==0?1:capacity);
54562 this.loadFactor=loadFactor;
54563 this.computeMaxSize();
54564 }else{
54565 throw new IllegalArgumentException();
54566 }
54567 },"~N,~N");
54568
54569 //Clazz_makeConstructor(c$,
54570 //function(map){
54571 //this.construct(map.size()<6?11:map.size()*2);
54572 //Clazz_superCall(this,java.util.ConcurrentHashMap,"putAll",[map]);
54573 //},"java.util.Map");
54574
54575 */
54576 Clazz_overrideMethod(c$,"clear",
54577 function(){
54578 if(this.elementCount>0){
54579 this.elementCount=0;
54580 java.util.Arrays.fill(this.elementData,null);
54581 this.modCount++;
54582 }});
54583 Clazz_defineMethod(c$,"clone",
54584 function(){
54585   return this.cloneHM();
54586 });
54587
54588 Clazz_defineMethod(c$,"cloneHM",
54589 function(){
54590 try{
54591 var map=this.cloneAM();//Clazz_superCall(this,java.util.concurrent.ConcurrentHashMap,"clone",[]);
54592 map.elementData=this.newElementArray(this.elementData.length);
54593 var entry;
54594 for(var i=0;i<this.elementData.length;i++){
54595 if((entry=this.elementData[i])!=null){
54596 map.elementData[i]=entry.clone();
54597 }}
54598 return map;
54599 }catch(e){
54600 if(Clazz_instanceOf(e,CloneNotSupportedException)){
54601 return null;
54602 }else{
54603 throw e;
54604 }
54605 }
54606 });
54607
54608 Clazz_defineMethod(c$,"computeMaxSize",
54609 ($fz=function(){
54610 this.threshold=Math.round((this.elementData.length*this.loadFactor));
54611 },$fz.isPrivate=true,$fz));
54612 Clazz_overrideMethod(c$,"containsKey",
54613 function(key){
54614 return this.getEntry(key)!=null;
54615 },"~O");
54616 Clazz_defineMethod(c$,"keysEqual",
54617 function(k1,entry){
54618 var k1Hash=k1==null?0:k1.hashCode();
54619 if(k1Hash!=entry.origKeyHash){
54620 return false;
54621 }if(k1==null&&entry.key==null){
54622 return true;
54623 }return k1.equals(entry.key);
54624 },"~O,java.util.concurrent.ConcurrentHashMap.Entry");
54625 Clazz_overrideMethod(c$,"containsValue",
54626 function(value){
54627 if(value!=null){
54628 for(var i=this.elementData.length;--i>=0;){
54629 var entry=this.elementData[i];
54630 while(entry!=null){
54631 if(value.equals(entry.value)){
54632 return true;
54633 }entry=entry.next;
54634 }
54635 }
54636 }else{
54637 for(var i=this.elementData.length;--i>=0;){
54638 var entry=this.elementData[i];
54639 while(entry!=null){
54640 if(entry.value==null){
54641 return true;
54642 }entry=entry.next;
54643 }
54644 }
54645 }return false;
54646 },"~O");
54647 Clazz_overrideMethod(c$,"entrySet",
54648 function(){
54649 return new java.util.concurrent.ConcurrentHashMap.ConcurrentHashMapEntrySet(this);
54650 });
54651 Clazz_overrideMethod(c$,"get",
54652 function(key){
54653 var m=this.getEntry(key);
54654 if(m!=null){
54655 return m.value;
54656 }return null;
54657 },"~O");
54658 Clazz_defineMethod(c$,"getEntry",
54659 function(key){
54660 var index=this.getModuloHash(key);
54661 return this.findEntry(key,index);
54662 },"~O");
54663 Clazz_defineMethod(c$,"getModuloHash",
54664 function(key){
54665 if(key==null){
54666 return 0;
54667 }return(key.hashCode()&0x7FFFFFFF)%this.elementData.length;
54668 },"~O");
54669 Clazz_defineMethod(c$,"findEntry",
54670 function(key,index){
54671 var m;
54672 m=this.elementData[index];
54673 if(key!=null){
54674 while(m!=null&&!this.keysEqual(key,m)){
54675 m=m.next;
54676 }
54677 }else{
54678 while(m!=null&&m.key!=null){
54679 m=m.next;
54680 }
54681 }return m;
54682 },"~O,~N");
54683 Clazz_overrideMethod(c$,"isEmpty",
54684 function(){
54685 return this.elementCount==0;
54686 });
54687 Clazz_overrideMethod(c$,"keySet",
54688 function(){
54689 if(this.$keySet==null){
54690 this.$keySet=((Clazz_isClassDefined("java.util.concurrent.ConcurrentHashMap$1")?0:java.util.concurrent.ConcurrentHashMap.$ConcurrentHashMap$1$()),Clazz_innerTypeInstance(java.util.concurrent.ConcurrentHashMap$1,this,null));
54691 }return this.$keySet;
54692 });
54693 Clazz_overrideMethod(c$,"put",
54694 function(key,value){
54695 var index=this.getModuloHash(key);
54696 var entry=this.findEntry(key,index);
54697 if(entry==null){
54698 this.modCount++;
54699 if(++this.elementCount>this.threshold){
54700 this.rehash();
54701 index=key==null?0:(key.hashCode()&0x7FFFFFFF)%this.elementData.length;
54702 }entry=this.createEntry(key,index,value);
54703 return null;
54704 }var result=entry.value;
54705 entry.value=value;
54706 return result;
54707 },"~O,~O");
54708 Clazz_defineMethod(c$,"createEntry",
54709 function(key,index,value){
54710 var entry=new java.util.concurrent.ConcurrentHashMap.Entry(key,value);
54711 entry.next=this.elementData[index];
54712 this.elementData[index]=entry;
54713 return entry;
54714 },"~O,~N,~O");
54715 Clazz_defineMethod(c$,"putAll",
54716 function(map){
54717 if(!map.isEmpty()){
54718 var capacity=this.elementCount+map.size();
54719 if(capacity>this.threshold){
54720 this.rehash(capacity);
54721 }
54722 this.putAllHM(map);
54723
54724 }},"java.util.Map");
54725 Clazz_defineMethod(c$,"rehash",
54726 function(capacity){
54727 var length=(capacity==0?1:capacity<<1);
54728 var newData=this.newElementArray(length);
54729 for(var i=0;i<this.elementData.length;i++){
54730 var entry=this.elementData[i];
54731 while(entry!=null){
54732 var key=entry.key;
54733 var index=key==null?0:(key.hashCode()&0x7FFFFFFF)%length;
54734 var next=entry.next;
54735 entry.next=newData[index];
54736 newData[index]=entry;
54737 entry=next;
54738 }
54739 }
54740 this.elementData=newData;
54741 this.computeMaxSize();
54742 },"~N");
54743 Clazz_defineMethod(c$,"rehash",
54744 function(){
54745 this.rehash(this.elementData.length);
54746 });
54747 Clazz_overrideMethod(c$,"remove",
54748 function(key){
54749 var entry=this.removeEntry(key);
54750 if(entry!=null){
54751 return entry.value;
54752 }return null;
54753 },"~O");
54754 Clazz_defineMethod(c$,"removeEntry",
54755 function(key){
54756 var index=0;
54757 var entry;
54758 var last=null;
54759 if(key!=null){
54760 index=(key.hashCode()&0x7FFFFFFF)%this.elementData.length;
54761 entry=this.elementData[index];
54762 while(entry!=null&&!this.keysEqual(key,entry)){
54763 last=entry;
54764 entry=entry.next;
54765 }
54766 }else{
54767 entry=this.elementData[0];
54768 while(entry!=null&&entry.key!=null){
54769 last=entry;
54770 entry=entry.next;
54771 }
54772 }if(entry==null){
54773 return null;
54774 }if(last==null){
54775 this.elementData[index]=entry.next;
54776 }else{
54777 last.next=entry.next;
54778 }this.modCount++;
54779 this.elementCount--;
54780 return entry;
54781 },"~O");
54782 Clazz_overrideMethod(c$,"size",
54783 function(){
54784 return this.elementCount;
54785 });
54786 Clazz_overrideMethod(c$,"values",
54787 function(){
54788 if(this.valuesCollection==null){
54789 this.valuesCollection=((Clazz_isClassDefined("java.util.concurrent.ConcurrentHashMap$2")?0:java.util.concurrent.ConcurrentHashMap.$ConcurrentHashMap$2$()),Clazz_innerTypeInstance(java.util.concurrent.ConcurrentHashMap$2,this,null));
54790 }return this.valuesCollection;
54791 });
54792 c$.$ConcurrentHashMap$1$=function(){
54793 Clazz_pu$h(self.c$);
54794 c$=Clazz_declareAnonymous(java.util.concurrent,"ConcurrentHashMap$1",java.util.AbstractSet);
54795 Clazz_overrideMethod(c$,"contains",
54796 function(object){
54797 return this.b$["java.util.concurrent.ConcurrentHashMap"].containsKey(object);
54798 },"~O");
54799 Clazz_overrideMethod(c$,"size",
54800 function(){
54801 return this.b$["java.util.concurrent.ConcurrentHashMap"].size();
54802 });
54803 Clazz_overrideMethod(c$,"clear",
54804 function(){
54805 this.b$["java.util.concurrent.ConcurrentHashMap"].clear();
54806 });
54807 Clazz_overrideMethod(c$,"remove",
54808 function(key){
54809 if(this.b$["java.util.concurrent.ConcurrentHashMap"].containsKey(key)){
54810 this.b$["java.util.concurrent.ConcurrentHashMap"].remove(key);
54811 return true;
54812 }return false;
54813 },"~O");
54814 Clazz_overrideMethod(c$,"iterator",
54815 function(){
54816 return new java.util.concurrent.ConcurrentHashMap.ConcurrentHashMapIterator(((Clazz_isClassDefined("java.util.concurrent.ConcurrentHashMap$1$1")?0:java.util.concurrent.ConcurrentHashMap.$ConcurrentHashMap$1$1$()),Clazz_innerTypeInstance(java.util.concurrent.ConcurrentHashMap$1$1,this,null)),this.b$["java.util.concurrent.ConcurrentHashMap"]);
54817 });
54818 c$=Clazz_p0p();
54819 };
54820 c$.$ConcurrentHashMap$1$1$=function(){
54821 Clazz_pu$h(self.c$);
54822 c$=Clazz_declareAnonymous(java.util.concurrent,"ConcurrentHashMap$1$1",null,java.util.MapEntry.Type);
54823 Clazz_overrideMethod(c$,"get",
54824 function(entry){
54825 return entry.key;
54826 },"java.util.MapEntry");
54827 c$=Clazz_p0p();
54828 };
54829 c$.$ConcurrentHashMap$2$=function(){
54830 Clazz_pu$h(self.c$);
54831 c$=Clazz_declareAnonymous(java.util.concurrent,"ConcurrentHashMap$2",java.util.AbstractCollection);
54832 Clazz_overrideMethod(c$,"contains",
54833 function(object){
54834 return this.b$["java.util.concurrent.ConcurrentHashMap"].containsValue(object);
54835 },"~O");
54836 Clazz_overrideMethod(c$,"size",
54837 function(){
54838 return this.b$["java.util.concurrent.ConcurrentHashMap"].size();
54839 });
54840 Clazz_overrideMethod(c$,"clear",
54841 function(){
54842 this.b$["java.util.concurrent.ConcurrentHashMap"].clear();
54843 });
54844 Clazz_overrideMethod(c$,"iterator",
54845 function(){
54846 return new java.util.concurrent.ConcurrentHashMap.ConcurrentHashMapIterator(((Clazz_isClassDefined("java.util.concurrent.ConcurrentHashMap$2$1")?0:java.util.concurrent.ConcurrentHashMap.$ConcurrentHashMap$2$1$()),Clazz_innerTypeInstance(java.util.concurrent.ConcurrentHashMap$2$1,this,null)),this.b$["java.util.concurrent.ConcurrentHashMap"]);
54847 });
54848 c$=Clazz_p0p();
54849 };
54850 c$.$ConcurrentHashMap$2$1$=function(){
54851 Clazz_pu$h(self.c$);
54852 c$=Clazz_declareAnonymous(java.util.concurrent,"ConcurrentHashMap$2$1",null,java.util.MapEntry.Type);
54853 Clazz_overrideMethod(c$,"get",
54854 function(entry){
54855 return entry.value;
54856 },"java.util.MapEntry");
54857 c$=Clazz_p0p();
54858 };
54859 Clazz_pu$h(self.c$);
54860 c$=Clazz_decorateAsClass(function(){
54861 this.origKeyHash=0;
54862 this.next=null;
54863 Clazz_instantialize(this,arguments);
54864 },java.util.concurrent.ConcurrentHashMap,"Entry",java.util.MapEntry);
54865 Clazz_makeConstructor(c$,
54866 function(a,b){
54867 Clazz_superConstructor(this,java.util.concurrent.ConcurrentHashMap.Entry,[a,b]);
54868 this.origKeyHash=(a==null?0:a.hashCode());
54869 },"~O,~O");
54870 Clazz_defineMethod(c$,"clone",
54871 function(){
54872 var a=Clazz_superCall(this,java.util.concurrent.ConcurrentHashMap.Entry,"clone",[]);
54873 if(this.next!=null){
54874 a.next=this.next.clone();
54875 }return a;
54876 });
54877 c$=Clazz_p0p();
54878 Clazz_pu$h(self.c$);
54879 c$=Clazz_decorateAsClass(function(){
54880 this.position=0;
54881 this.expectedModCount=0;
54882 this.type=null;
54883 this.canRemove=false;
54884 this.entry=null;
54885 this.lastEntry=null;
54886 this.associatedMap=null;
54887 Clazz_instantialize(this,arguments);
54888 },java.util.concurrent.ConcurrentHashMap,"ConcurrentHashMapIterator",null,java.util.Iterator);
54889 Clazz_makeConstructor(c$,
54890 function(a,b){
54891 this.associatedMap=b;
54892 this.type=a;
54893 this.expectedModCount=b.modCount;
54894 },"java.util.MapEntry.Type,java.util.concurrent.ConcurrentHashMap");
54895 Clazz_overrideMethod(c$,"hasNext",
54896 function(){
54897 if(this.entry!=null){
54898 return true;
54899 }while(this.position<this.associatedMap.elementData.length){
54900 if(this.associatedMap.elementData[this.position]==null){
54901 this.position++;
54902 }else{
54903 return true;
54904 }}
54905 return false;
54906 });
54907 Clazz_defineMethod(c$,"checkConcurrentMod",
54908 function(){
54909 if(this.expectedModCount!=this.associatedMap.modCount){
54910 throw new java.util.ConcurrentModificationException();
54911 }});
54912 Clazz_overrideMethod(c$,"next",
54913 function(){
54914 this.checkConcurrentMod();
54915 if(!this.hasNext()){
54916 throw new java.util.NoSuchElementException();
54917 }var a;
54918 if(this.entry==null){
54919 a=this.lastEntry=this.associatedMap.elementData[this.position++];
54920 this.entry=this.lastEntry.next;
54921 }else{
54922 if(this.lastEntry.next!==this.entry){
54923 this.lastEntry=this.lastEntry.next;
54924 }a=this.entry;
54925 this.entry=this.entry.next;
54926 }this.canRemove=true;
54927 return this.type.get(a);
54928 });
54929 Clazz_overrideMethod(c$,"remove",
54930 function(){
54931 this.checkConcurrentMod();
54932 if(!this.canRemove){
54933 throw new IllegalStateException();
54934 }this.canRemove=false;
54935 this.associatedMap.modCount++;
54936 if(this.lastEntry.next===this.entry){
54937 while(this.associatedMap.elementData[--this.position]==null){
54938 ;}
54939 this.associatedMap.elementData[this.position]=this.associatedMap.elementData[this.position].next;
54940 this.entry=null;
54941 }else{
54942 this.lastEntry.next=this.entry;
54943 }this.associatedMap.elementCount--;
54944 this.expectedModCount++;
54945 });
54946 c$=Clazz_p0p();
54947 Clazz_pu$h(self.c$);
54948 c$=Clazz_decorateAsClass(function(){
54949 this.associatedMap=null;
54950 Clazz_instantialize(this,arguments);
54951 },java.util.concurrent.ConcurrentHashMap,"ConcurrentHashMapEntrySet",java.util.AbstractSet);
54952 Clazz_makeConstructor(c$,
54953 function(a){
54954 Clazz_superConstructor(this,java.util.concurrent.ConcurrentHashMap.ConcurrentHashMapEntrySet,[]);
54955 this.associatedMap=a;
54956 },"java.util.concurrent.ConcurrentHashMap");
54957 Clazz_defineMethod(c$,"hashMap",
54958 function(){
54959 return this.associatedMap;
54960 });
54961 Clazz_overrideMethod(c$,"size",
54962 function(){
54963 return this.associatedMap.elementCount;
54964 });
54965 Clazz_overrideMethod(c$,"clear",
54966 function(){
54967 this.associatedMap.clear();
54968 });
54969 Clazz_overrideMethod(c$,"remove",
54970 function(a){
54971 if(this.contains(a)){
54972 this.associatedMap.remove((a).getKey());
54973 return true;
54974 }return false;
54975 },"~O");
54976 Clazz_overrideMethod(c$,"contains",
54977 function(a){
54978 if(Clazz_instanceOf(a,java.util.Map.Entry)){
54979 var b=this.associatedMap.getEntry((a).getKey());
54980 return a.equals(b);
54981 }return false;
54982 },"~O");
54983 Clazz_overrideMethod(c$,"iterator",
54984 function(){
54985 return new java.util.concurrent.ConcurrentHashMap.ConcurrentHashMapIterator(((Clazz_isClassDefined("java.util.concurrent.ConcurrentHashMap$ConcurrentHashMapEntrySet$1")?0:java.util.concurrent.ConcurrentHashMap.ConcurrentHashMapEntrySet.$ConcurrentHashMap$ConcurrentHashMapEntrySet$1$()),Clazz_innerTypeInstance(java.util.concurrent.ConcurrentHashMap$ConcurrentHashMapEntrySet$1,this,null)),this.associatedMap);
54986 });
54987 c$.$ConcurrentHashMap$ConcurrentHashMapEntrySet$1$=function(){
54988 Clazz_pu$h(self.c$);
54989 c$=Clazz_declareAnonymous(java.util.concurrent,"ConcurrentHashMap$ConcurrentHashMapEntrySet$1",null,java.util.MapEntry.Type);
54990 Clazz_overrideMethod(c$,"get",
54991 function(a){
54992 return a;
54993 },"java.util.MapEntry");
54994 c$=Clazz_p0p();
54995 };
54996 c$=Clazz_p0p();
54997 Clazz_defineStatics(c$,
54998 "DEFAULT_SIZE",16);
54999 });
55000 Clazz_declarePackage ("jalview.viewmodel.seqfeatures");
55001 Clazz_load (null, "jalview.viewmodel.seqfeatures.FeatureRendererSettings", ["jalview.schemes.GraduatedColor", "java.util.Arrays", "java.util.concurrent.ConcurrentHashMap"], function () {
55002 c$ = Clazz_decorateAsClass (function () {
55003 this.renderOrder = null;
55004 this.featureGroups = null;
55005 this.featureColours = null;
55006 this.transparency = 0;
55007 this.featureOrder = null;
55008 Clazz_instantialize (this, arguments);
55009 }, jalview.viewmodel.seqfeatures, "FeatureRendererSettings", null, Cloneable);
55010 Clazz_makeConstructor (c$, 
55011 function (renderOrder, featureGroups, featureColours, transparency, featureOrder) {
55012 this.renderOrder = java.util.Arrays.copyOf (renderOrder, renderOrder.length);
55013 this.featureGroups =  new java.util.concurrent.ConcurrentHashMap (featureGroups);
55014 this.featureColours =  new java.util.concurrent.ConcurrentHashMap (featureColours);
55015 this.transparency = transparency;
55016 this.featureOrder =  new java.util.concurrent.ConcurrentHashMap (featureOrder);
55017 }, "~A,java.util.Hashtable,java.util.Hashtable,~N,java.util.Hashtable");
55018 Clazz_makeConstructor (c$, 
55019 function (fr) {
55020 this.renderOrder = null;
55021 this.featureGroups =  new java.util.concurrent.ConcurrentHashMap ();
55022 this.featureColours =  new java.util.concurrent.ConcurrentHashMap ();
55023 this.featureOrder =  new java.util.concurrent.ConcurrentHashMap ();
55024 if (fr.renderOrder != null) {
55025 this.renderOrder =  new Array (fr.renderOrder.length);
55026 System.arraycopy (fr.renderOrder, 0, this.renderOrder, 0, fr.renderOrder.length);
55027 }if (fr.featureGroups != null) {
55028 this.featureGroups =  new java.util.concurrent.ConcurrentHashMap (fr.featureGroups);
55029 }if (fr.featureColours != null) {
55030 this.featureColours =  new java.util.concurrent.ConcurrentHashMap (fr.featureColours);
55031 }var en = fr.featureColours.keySet ().iterator ();
55032 while (en.hasNext ()) {
55033 var next = en.next ();
55034 var val = this.featureColours.get (next);
55035 if (Clazz_instanceOf (val, jalview.schemes.GraduatedColor)) {
55036 this.featureColours.put (next,  new jalview.schemes.GraduatedColor (val));
55037 }}
55038 this.transparency = fr.transparency;
55039 if (fr.featureOrder != null) {
55040 this.featureOrder =  new java.util.concurrent.ConcurrentHashMap (fr.featureOrder);
55041 }}, "jalview.viewmodel.seqfeatures.FeatureRendererModel");
55042 });
55043 Clazz_declarePackage ("jalview.viewmodel.seqfeatures");
55044 Clazz_load (["jalview.api.FeaturesDisplayedI", "java.util.HashSet"], "jalview.viewmodel.seqfeatures.FeaturesDisplayed", null, function () {
55045 c$ = Clazz_decorateAsClass (function () {
55046 this.featuresDisplayed = null;
55047 this.featuresRegistered = null;
55048 Clazz_instantialize (this, arguments);
55049 }, jalview.viewmodel.seqfeatures, "FeaturesDisplayed", null, jalview.api.FeaturesDisplayedI);
55050 Clazz_prepareFields (c$, function () {
55051 this.featuresDisplayed =  new java.util.HashSet ();
55052 this.featuresRegistered =  new java.util.HashSet ();
55053 });
55054 Clazz_makeConstructor (c$, 
55055 function (featuresDisplayed2) {
55056 var fdisp = featuresDisplayed2.getVisibleFeatures ();
55057 var ftype;
55058 while (fdisp.hasNext ()) {
55059 ftype = fdisp.next ();
55060 this.featuresDisplayed.add (ftype);
55061 this.featuresRegistered.add (ftype);
55062 }
55063 }, "jalview.api.FeaturesDisplayedI");
55064 Clazz_makeConstructor (c$, 
55065 function () {
55066 });
55067 Clazz_defineMethod (c$, "getVisibleFeatures", 
55068 function () {
55069 return this.featuresDisplayed.iterator ();
55070 });
55071 Clazz_overrideMethod (c$, "isVisible", 
55072 function (featureType) {
55073 return this.featuresDisplayed.contains (featureType);
55074 }, "~S");
55075 Clazz_overrideMethod (c$, "areVisible", 
55076 function (featureTypes) {
55077 return this.featuresDisplayed.containsAll (featureTypes);
55078 }, "java.util.Collection");
55079 Clazz_overrideMethod (c$, "clear", 
55080 function () {
55081 this.featuresDisplayed.clear ();
55082 this.featuresRegistered.clear ();
55083 });
55084 Clazz_overrideMethod (c$, "setAllVisible", 
55085 function (makeVisible) {
55086 this.featuresDisplayed.addAll (makeVisible);
55087 this.featuresRegistered.addAll (makeVisible);
55088 }, "java.util.Collection");
55089 Clazz_overrideMethod (c$, "setAllRegisteredVisible", 
55090 function () {
55091 this.featuresDisplayed.addAll (this.featuresRegistered);
55092 });
55093 Clazz_overrideMethod (c$, "setVisible", 
55094 function (featureType) {
55095 this.featuresDisplayed.add (featureType);
55096 this.featuresRegistered.add (featureType);
55097 }, "~S");
55098 Clazz_overrideMethod (c$, "isRegistered", 
55099 function (type) {
55100 return this.featuresRegistered.contains (type);
55101 }, "~S");
55102 Clazz_overrideMethod (c$, "getVisibleFeatureCount", 
55103 function () {
55104 return this.featuresDisplayed.size ();
55105 });
55106 Clazz_overrideMethod (c$, "getRegisterdFeaturesCount", 
55107 function () {
55108 return this.featuresRegistered.size ();
55109 });
55110 });
55111 Clazz_declarePackage ("jalview.api");
55112 Clazz_declareInterface (jalview.api, "FeaturesDisplayedI");
55113 Clazz_declarePackage ("java.awt");
55114 Clazz_load (["java.awt.Composite"], "java.awt.AlphaComposite", ["java.lang.Float", "$.IllegalArgumentException", "jssun.java2d.SunCompositeContext"], function () {
55115 c$ = Clazz_decorateAsClass (function () {
55116 this.extraAlpha = 0;
55117 this.rule = 0;
55118 Clazz_instantialize (this, arguments);
55119 }, java.awt, "AlphaComposite", null, java.awt.Composite);
55120 Clazz_makeConstructor (c$, 
55121  function (rule) {
55122 this.construct (rule, 1.0);
55123 }, "~N");
55124 Clazz_makeConstructor (c$, 
55125  function (rule, alpha) {
55126 if (alpha < 0.0 || alpha > 1.0) {
55127 throw  new IllegalArgumentException ("alpha value out of range");
55128 }if (rule < 1 || rule > 12) {
55129 throw  new IllegalArgumentException ("unknown composite rule");
55130 }this.rule = rule;
55131 this.extraAlpha = alpha;
55132 }, "~N,~N");
55133 c$.getInstance = Clazz_defineMethod (c$, "getInstance", 
55134 function (rule) {
55135 switch (rule) {
55136 case 1:
55137 return java.awt.AlphaComposite.Clear;
55138 case 2:
55139 return java.awt.AlphaComposite.Src;
55140 case 9:
55141 return java.awt.AlphaComposite.Dst;
55142 case 3:
55143 return java.awt.AlphaComposite.SrcOver;
55144 case 4:
55145 return java.awt.AlphaComposite.DstOver;
55146 case 5:
55147 return java.awt.AlphaComposite.SrcIn;
55148 case 6:
55149 return java.awt.AlphaComposite.DstIn;
55150 case 7:
55151 return java.awt.AlphaComposite.SrcOut;
55152 case 8:
55153 return java.awt.AlphaComposite.DstOut;
55154 case 10:
55155 return java.awt.AlphaComposite.SrcAtop;
55156 case 11:
55157 return java.awt.AlphaComposite.DstAtop;
55158 case 12:
55159 return java.awt.AlphaComposite.Xor;
55160 default:
55161 throw  new IllegalArgumentException ("unknown composite rule");
55162 }
55163 }, "~N");
55164 c$.getInstance = Clazz_defineMethod (c$, "getInstance", 
55165 function (rule, alpha) {
55166 if (alpha == 1.0) {
55167 return java.awt.AlphaComposite.getInstance (rule);
55168 }return  new java.awt.AlphaComposite (rule, alpha);
55169 }, "~N,~N");
55170 Clazz_overrideMethod (c$, "createContext", 
55171 function (srcColorModel, dstColorModel, hints) {
55172 return  new jssun.java2d.SunCompositeContext (this, srcColorModel, dstColorModel);
55173 }, "java.awt.image.ColorModel,java.awt.image.ColorModel,java.awt.RenderingHints");
55174 Clazz_defineMethod (c$, "getAlpha", 
55175 function () {
55176 return this.extraAlpha;
55177 });
55178 Clazz_defineMethod (c$, "getRule", 
55179 function () {
55180 return this.rule;
55181 });
55182 Clazz_defineMethod (c$, "derive", 
55183 function (rule) {
55184 return (this.rule == rule) ? this : java.awt.AlphaComposite.getInstance (rule, this.extraAlpha);
55185 }, "~N");
55186 Clazz_defineMethod (c$, "derive", 
55187 function (alpha) {
55188 return (this.extraAlpha == alpha) ? this : java.awt.AlphaComposite.getInstance (this.rule, alpha);
55189 }, "~N");
55190 Clazz_overrideMethod (c$, "hashCode", 
55191 function () {
55192 return (Float.floatToIntBits (this.extraAlpha) * 31 + this.rule);
55193 });
55194 Clazz_overrideMethod (c$, "equals", 
55195 function (obj) {
55196 if (!(Clazz_instanceOf (obj, java.awt.AlphaComposite))) {
55197 return false;
55198 }var ac = obj;
55199 if (this.rule != ac.rule) {
55200 return false;
55201 }if (this.extraAlpha != ac.extraAlpha) {
55202 return false;
55203 }return true;
55204 }, "~O");
55205 Clazz_defineStatics (c$,
55206 "CLEAR", 1,
55207 "SRC", 2,
55208 "DST", 9,
55209 "SRC_OVER", 3,
55210 "DST_OVER", 4,
55211 "SRC_IN", 5,
55212 "DST_IN", 6,
55213 "SRC_OUT", 7,
55214 "DST_OUT", 8,
55215 "SRC_ATOP", 10,
55216 "DST_ATOP", 11,
55217 "XOR", 12);
55218 c$.Clear = c$.prototype.Clear =  new java.awt.AlphaComposite (1);
55219 c$.Src = c$.prototype.Src =  new java.awt.AlphaComposite (2);
55220 c$.Dst = c$.prototype.Dst =  new java.awt.AlphaComposite (9);
55221 c$.SrcOver = c$.prototype.SrcOver =  new java.awt.AlphaComposite (3);
55222 c$.DstOver = c$.prototype.DstOver =  new java.awt.AlphaComposite (4);
55223 c$.SrcIn = c$.prototype.SrcIn =  new java.awt.AlphaComposite (5);
55224 c$.DstIn = c$.prototype.DstIn =  new java.awt.AlphaComposite (6);
55225 c$.SrcOut = c$.prototype.SrcOut =  new java.awt.AlphaComposite (7);
55226 c$.DstOut = c$.prototype.DstOut =  new java.awt.AlphaComposite (8);
55227 c$.SrcAtop = c$.prototype.SrcAtop =  new java.awt.AlphaComposite (10);
55228 c$.DstAtop = c$.prototype.DstAtop =  new java.awt.AlphaComposite (11);
55229 c$.Xor = c$.prototype.Xor =  new java.awt.AlphaComposite (12);
55230 Clazz_defineStatics (c$,
55231 "MIN_RULE", 1,
55232 "MAX_RULE", 12);
55233 });
55234 Clazz_declarePackage ("java.awt");
55235 Clazz_declareInterface (java.awt, "Composite");
55236 Clazz_declarePackage ("jssun.java2d");
55237 Clazz_load (["java.awt.CompositeContext"], "jssun.java2d.SunCompositeContext", ["java.lang.NullPointerException", "java.awt.image.BufferedImage", "$.WritableRaster", "jssun.java2d.loops.CompositeType"], function () {
55238 c$ = Clazz_decorateAsClass (function () {
55239 this.srcCM = null;
55240 this.dstCM = null;
55241 this.composite = null;
55242 this.comptype = null;
55243 Clazz_instantialize (this, arguments);
55244 }, jssun.java2d, "SunCompositeContext", null, java.awt.CompositeContext);
55245 Clazz_makeConstructor (c$, 
55246 function (ac, s, d) {
55247 if (s == null) {
55248 throw  new NullPointerException ("Source color model cannot be null");
55249 }if (d == null) {
55250 throw  new NullPointerException ("Destination color model cannot be null");
55251 }this.srcCM = s;
55252 this.dstCM = d;
55253 this.composite = ac;
55254 this.comptype = jssun.java2d.loops.CompositeType.forAlphaComposite (ac);
55255 }, "java.awt.AlphaComposite,java.awt.image.ColorModel,java.awt.image.ColorModel");
55256 Clazz_overrideMethod (c$, "dispose", 
55257 function () {
55258 });
55259 Clazz_overrideMethod (c$, "compose", 
55260 function (srcArg, dstIn, dstOut) {
55261 var src;
55262 var w;
55263 var h;
55264 if (dstIn !== dstOut) {
55265 dstOut.setDataElementsRaster (0, 0, dstIn);
55266 }if (Clazz_instanceOf (srcArg, java.awt.image.WritableRaster)) {
55267 src = srcArg;
55268 } else {
55269 src = srcArg.createCompatibleWritableRaster ();
55270 src.setDataElements (0, 0, srcArg);
55271 }w = Math.min (src.getWidth (), dstIn.getWidth ());
55272 h = Math.min (src.getHeight (), dstIn.getHeight ());
55273 var srcImg =  new java.awt.image.BufferedImage (this.srcCM, src, this.srcCM.isAlphaPremultiplied (), null);
55274 var dstImg =  new java.awt.image.BufferedImage (this.dstCM, dstOut, this.dstCM.isAlphaPremultiplied (), null);
55275 }, "java.awt.image.Raster,java.awt.image.Raster,java.awt.image.WritableRaster");
55276 });
55277 Clazz_declarePackage ("java.awt");
55278 Clazz_declareInterface (java.awt, "CompositeContext");
55279 Clazz_declarePackage ("java.awt.image");
55280 Clazz_load (["java.awt.Image", "$.Transparency"], "java.awt.image.BufferedImage", ["java.awt.Image", "java.lang.IllegalArgumentException", "$.NullPointerException", "java.util.Hashtable", "java.awt.GraphicsEnvironment", "$.Point", "$.Rectangle", "java.awt.image.ColorModel", "$.DirectColorModel", "$.Raster", "jssun.awt.image.OffScreenImageSource"], function () {
55281 c$ = Clazz_decorateAsClass (function () {
55282 this.imageType = 0;
55283 this.colorModel = null;
55284 this.raster = null;
55285 this.osis = null;
55286 this.properties = null;
55287 this.$isAlphaPremultiplied = false;
55288 Clazz_instantialize (this, arguments);
55289 }, java.awt.image, "BufferedImage", java.awt.Image, java.awt.Transparency);
55290 Clazz_makeConstructor (c$, 
55291 function (width, height, imageType) {
55292 Clazz_superConstructor (this, java.awt.image.BufferedImage, []);
55293 switch (imageType) {
55294 case 1:
55295 {
55296 this.colorModel =  new java.awt.image.DirectColorModel (24, 0x00ff0000, 0x0000ff00, 0x000000ff, 0x0);
55297 this.raster = this.colorModel.createCompatibleWritableRaster (width, height);
55298 }break;
55299 case 2:
55300 {
55301 this.colorModel = java.awt.image.ColorModel.getRGBdefault ();
55302 this.raster = this.colorModel.createCompatibleWritableRaster (width, height);
55303 }break;
55304 default:
55305 throw  new IllegalArgumentException ("Unknown image type " + imageType);
55306 }
55307 this.imageType = imageType;
55308 }, "~N,~N,~N");
55309 Clazz_makeConstructor (c$, 
55310 function (cm, raster, isRasterPremultiplied, properties) {
55311 Clazz_superConstructor (this, java.awt.image.BufferedImage, []);
55312 if ((raster.minX != 0) || (raster.minY != 0)) {
55313 throw  new IllegalArgumentException ("Raster " + raster + " has minX or minY not equal to zero: " + raster.minX + " " + raster.minY);
55314 }this.colorModel = cm;
55315 this.raster = raster;
55316 this.properties = properties;
55317 var cs;
55318 cs = cm.getColorSpace ();
55319 }, "java.awt.image.ColorModel,java.awt.image.WritableRaster,~B,java.util.Hashtable");
55320 Clazz_defineMethod (c$, "getType", 
55321 function () {
55322 return this.imageType;
55323 });
55324 Clazz_defineMethod (c$, "getColorModel", 
55325 function () {
55326 return this.colorModel;
55327 });
55328 Clazz_defineMethod (c$, "getRaster", 
55329 function () {
55330 return this.raster;
55331 });
55332 Clazz_defineMethod (c$, "getRGB", 
55333 function (x, y) {
55334 return 0;
55335 }, "~N,~N");
55336 Clazz_defineMethod (c$, "getRGB", 
55337 function (startX, startY, w, h, rgbArray, offset, scansize) {
55338 return rgbArray;
55339 }, "~N,~N,~N,~N,~A,~N,~N");
55340 Clazz_defineMethod (c$, "setRGB", 
55341 function (x, y, rgb) {
55342 }, "~N,~N,~N");
55343 Clazz_defineMethod (c$, "setRGB", 
55344 function (startX, startY, w, h, rgbArray, offset, scansize) {
55345 }, "~N,~N,~N,~N,~A,~N,~N");
55346 Clazz_defineMethod (c$, "getWidth", 
55347 function () {
55348 return this.raster.getWidth ();
55349 });
55350 Clazz_defineMethod (c$, "getHeight", 
55351 function () {
55352 return this.raster.getHeight ();
55353 });
55354 Clazz_defineMethod (c$, "getWidth", 
55355 function (observer) {
55356 return this.raster.getWidth ();
55357 }, "java.awt.image.ImageObserver");
55358 Clazz_defineMethod (c$, "getHeight", 
55359 function (observer) {
55360 return this.raster.getHeight ();
55361 }, "java.awt.image.ImageObserver");
55362 Clazz_overrideMethod (c$, "getSource", 
55363 function () {
55364 if (this.osis == null) {
55365 if (this.properties == null) {
55366 this.properties =  new java.util.Hashtable ();
55367 }this.osis =  new jssun.awt.image.OffScreenImageSource (this, this.properties);
55368 }return this.osis;
55369 });
55370 Clazz_defineMethod (c$, "getProperty", 
55371 function (name, observer) {
55372 return this.getProperty (name);
55373 }, "~S,java.awt.image.ImageObserver");
55374 Clazz_defineMethod (c$, "getProperty", 
55375 function (name) {
55376 if (name == null) {
55377 throw  new NullPointerException ("null property name is not allowed");
55378 }if (this.properties == null) {
55379 return java.awt.Image.UndefinedProperty;
55380 }var o = this.properties.get (name);
55381 if (o == null) {
55382 o = java.awt.Image.UndefinedProperty;
55383 }return o;
55384 }, "~S");
55385 Clazz_overrideMethod (c$, "getGraphics", 
55386 function () {
55387 return this.createGraphics ();
55388 });
55389 Clazz_defineMethod (c$, "createGraphics", 
55390 function () {
55391 var env = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment ();
55392 return env.createGraphics (this);
55393 });
55394 Clazz_defineMethod (c$, "getSubimage", 
55395 function (x, y, w, h) {
55396 return  new java.awt.image.BufferedImage (this.colorModel, this.raster.createWritableChild (x, y, w, h, 0, 0, null), this.colorModel.isAlphaPremultiplied (), this.properties);
55397 }, "~N,~N,~N,~N");
55398 Clazz_defineMethod (c$, "isAlphaPremultiplied", 
55399 function () {
55400 return false;
55401 });
55402 Clazz_overrideMethod (c$, "toString", 
55403 function () {
55404 return  String.instantialize ("BufferedImage@" + Integer.toHexString (this.hashCode ()) + ": type = " + this.imageType + " " + this.colorModel + " " + this.raster);
55405 });
55406 Clazz_defineMethod (c$, "getSources", 
55407 function () {
55408 return null;
55409 });
55410 Clazz_defineMethod (c$, "getPropertyNames", 
55411 function () {
55412 return null;
55413 });
55414 Clazz_defineMethod (c$, "getMinX", 
55415 function () {
55416 return this.raster.getMinX ();
55417 });
55418 Clazz_defineMethod (c$, "getMinY", 
55419 function () {
55420 return this.raster.getMinY ();
55421 });
55422 Clazz_defineMethod (c$, "getSampleModel", 
55423 function () {
55424 return this.raster.getSampleModel ();
55425 });
55426 Clazz_defineMethod (c$, "getNumXTiles", 
55427 function () {
55428 return 1;
55429 });
55430 Clazz_defineMethod (c$, "getNumYTiles", 
55431 function () {
55432 return 1;
55433 });
55434 Clazz_defineMethod (c$, "getMinTileX", 
55435 function () {
55436 return 0;
55437 });
55438 Clazz_defineMethod (c$, "getMinTileY", 
55439 function () {
55440 return 0;
55441 });
55442 Clazz_defineMethod (c$, "getTileWidth", 
55443 function () {
55444 return this.raster.getWidth ();
55445 });
55446 Clazz_defineMethod (c$, "getTileHeight", 
55447 function () {
55448 return this.raster.getHeight ();
55449 });
55450 Clazz_defineMethod (c$, "getTileGridXOffset", 
55451 function () {
55452 return 0;
55453 });
55454 Clazz_defineMethod (c$, "getTileGridYOffset", 
55455 function () {
55456 return 0;
55457 });
55458 Clazz_defineMethod (c$, "getTile", 
55459 function (tileX, tileY) {
55460 return this.raster;
55461 }, "~N,~N");
55462 Clazz_defineMethod (c$, "getData", 
55463 function () {
55464 var width = this.raster.getWidth ();
55465 var height = this.raster.getHeight ();
55466 var startX = this.raster.getMinX ();
55467 var startY = this.raster.getMinY ();
55468 var wr = java.awt.image.Raster.createWritableRaster (this.raster.getSampleModel (),  new java.awt.Point (this.raster.getSampleModelTranslateX (), this.raster.getSampleModelTranslateY ()));
55469 var tdata = null;
55470 for (var i = startY; i < startY + height; i++) {
55471 tdata = this.raster.getDataElements (startX, i, width, 1, tdata);
55472 wr.setDataElements (startX, i, width, 1, tdata);
55473 }
55474 return wr;
55475 });
55476 Clazz_defineMethod (c$, "getData", 
55477 function (rect) {
55478 var sm = this.raster.getSampleModel ();
55479 var nsm = sm.createCompatibleSampleModel (rect.width, rect.height);
55480 var wr = java.awt.image.Raster.createWritableRaster (nsm, rect.getLocation ());
55481 var width = rect.width;
55482 var height = rect.height;
55483 var startX = rect.x;
55484 var startY = rect.y;
55485 var tdata = null;
55486 for (var i = startY; i < startY + height; i++) {
55487 tdata = this.raster.getDataElements (startX, i, width, 1, tdata);
55488 wr.setDataElements (startX, i, width, 1, tdata);
55489 }
55490 return wr;
55491 }, "java.awt.Rectangle");
55492 Clazz_defineMethod (c$, "copyData", 
55493 function (outRaster) {
55494 if (outRaster == null) {
55495 return this.getData ();
55496 }var width = outRaster.getWidth ();
55497 var height = outRaster.getHeight ();
55498 var startX = outRaster.getMinX ();
55499 var startY = outRaster.getMinY ();
55500 var tdata = null;
55501 for (var i = startY; i < startY + height; i++) {
55502 tdata = this.raster.getDataElements (startX, i, width, 1, tdata);
55503 outRaster.setDataElements (startX, i, width, 1, tdata);
55504 }
55505 return outRaster;
55506 }, "java.awt.image.WritableRaster");
55507 Clazz_defineMethod (c$, "setData", 
55508 function (r) {
55509 var width = r.getWidth ();
55510 var height = r.getHeight ();
55511 var startX = r.getMinX ();
55512 var startY = r.getMinY ();
55513 var tdata = null;
55514 var rclip =  new java.awt.Rectangle (startX, startY, width, height);
55515 var bclip =  new java.awt.Rectangle (0, 0, this.raster.width, this.raster.height);
55516 var intersect = rclip.intersection (bclip);
55517 if (intersect.isEmpty ()) {
55518 return;
55519 }width = intersect.width;
55520 height = intersect.height;
55521 startX = intersect.x;
55522 startY = intersect.y;
55523 for (var i = startY; i < startY + height; i++) {
55524 tdata = r.getPixels (startX, i, width, 1, tdata);
55525 this.raster.setPixels (startX, i, width, 1, tdata);
55526 }
55527 }, "java.awt.image.Raster");
55528 Clazz_overrideMethod (c$, "getTransparency", 
55529 function () {
55530 return this.colorModel.getTransparency ();
55531 });
55532 Clazz_defineStatics (c$,
55533 "TYPE_CUSTOM", 0,
55534 "TYPE_INT_RGB", 1,
55535 "TYPE_INT_ARGB", 2);
55536 });
55537 Clazz_declarePackage ("java.awt");
55538 c$ = Clazz_decorateAsClass (function () {
55539 this.accelerationPriority = .5;
55540 Clazz_instantialize (this, arguments);
55541 }, java.awt, "Image");
55542 Clazz_defineMethod (c$, "getScaledInstance", 
55543 function (width, height, hints) {
55544 return null;
55545 }, "~N,~N,~N");
55546 Clazz_defineMethod (c$, "flush", 
55547 function () {
55548 });
55549 Clazz_defineMethod (c$, "setAccelerationPriority", 
55550 function (priority) {
55551 }, "~N");
55552 Clazz_defineMethod (c$, "getAccelerationPriority", 
55553 function () {
55554 return this.accelerationPriority;
55555 });
55556 c$.UndefinedProperty = c$.prototype.UndefinedProperty =  new Clazz._O ();
55557 Clazz_defineStatics (c$,
55558 "SCALE_DEFAULT", 1,
55559 "SCALE_FAST", 2,
55560 "SCALE_SMOOTH", 4,
55561 "SCALE_REPLICATE", 8,
55562 "SCALE_AREA_AVERAGING", 16);
55563 Clazz_declarePackage ("java.awt.image");
55564 Clazz_load (["java.awt.image.PackedColorModel"], "java.awt.image.DirectColorModel", ["java.lang.ClassCastException", "$.IllegalArgumentException", "$.UnsupportedOperationException", "java.awt.color.ColorSpace", "java.awt.image.ColorModel", "$.Raster"], function () {
55565 c$ = Clazz_decorateAsClass (function () {
55566 this.red_mask = 0;
55567 this.green_mask = 0;
55568 this.blue_mask = 0;
55569 this.alpha_mask = 0;
55570 this.is_LinearRGB = false;
55571 this.lRGBprecision = 0;
55572 this.tosRGB8LUT = null;
55573 this.fromsRGB8LUT8 = null;
55574 this.fromsRGB8LUT16 = null;
55575 Clazz_instantialize (this, arguments);
55576 }, java.awt.image, "DirectColorModel", java.awt.image.PackedColorModel);
55577 Clazz_makeConstructor (c$, 
55578 function (bits, rmask, gmask, bmask) {
55579 this.construct (bits, rmask, gmask, bmask, 0);
55580 }, "~N,~N,~N,~N");
55581 Clazz_makeConstructor (c$, 
55582 function (bits, rmask, gmask, bmask, amask) {
55583 Clazz_superConstructor (this, java.awt.image.DirectColorModel, [java.awt.color.ColorSpace.getInstance (1000), bits, rmask, gmask, bmask, amask, false, amask == 0 ? 1 : 3, java.awt.image.ColorModel.getDefaultTransferType (bits)]);
55584 }, "~N,~N,~N,~N,~N");
55585 Clazz_makeConstructor (c$, 
55586 function (space, bits, rmask, gmask, bmask, amask, isAlphaPremultiplied, transferType) {
55587 Clazz_superConstructor (this, java.awt.image.DirectColorModel, [space, bits, rmask, gmask, bmask, amask, isAlphaPremultiplied, amask == 0 ? 1 : 3, transferType]);
55588 }, "java.awt.color.ColorSpace,~N,~N,~N,~N,~N,~B,~N");
55589 Clazz_defineMethod (c$, "getRedMask", 
55590 function () {
55591 return this.maskArray[0];
55592 });
55593 Clazz_defineMethod (c$, "getGreenMask", 
55594 function () {
55595 return this.maskArray[1];
55596 });
55597 Clazz_defineMethod (c$, "getBlueMask", 
55598 function () {
55599 return this.maskArray[2];
55600 });
55601 Clazz_defineMethod (c$, "getAlphaMask", 
55602 function () {
55603 if (this.supportsAlpha) {
55604 return this.maskArray[3];
55605 } else {
55606 return 0;
55607 }});
55608 Clazz_defineMethod (c$, "getDefaultRGBComponents", 
55609  function (pixel) {
55610 var components = this.getComponents (pixel, null, 0);
55611 var norm = this.getNormalizedComponents (components, 0, null, 0);
55612 return this.colorSpace.toRGB (norm);
55613 }, "~N");
55614 Clazz_defineMethod (c$, "getsRGBComponentFromsRGB", 
55615  function (pixel, idx) {
55616 var c = ((pixel & this.maskArray[idx]) >>> this.maskOffsets[idx]);
55617 if (this.$isAlphaPremultiplied) {
55618 var a = ((pixel & this.maskArray[3]) >>> this.maskOffsets[3]);
55619 c = (a == 0) ? 0 : Clazz_floatToInt (((c * this.scaleFactors[idx]) * 255.0 / (a * this.scaleFactors[3])) + 0.5);
55620 } else if (this.scaleFactors[idx] != 1.0) {
55621 c = Clazz_floatToInt ((c * this.scaleFactors[idx]) + 0.5);
55622 }return c;
55623 }, "~N,~N");
55624 Clazz_defineMethod (c$, "getsRGBComponentFromLinearRGB", 
55625  function (pixel, idx) {
55626 var c = ((pixel & this.maskArray[idx]) >>> this.maskOffsets[idx]);
55627 if (this.$isAlphaPremultiplied) {
55628 var factor = ((1 << this.lRGBprecision) - 1);
55629 var a = ((pixel & this.maskArray[3]) >>> this.maskOffsets[3]);
55630 c = (a == 0) ? 0 : Clazz_floatToInt (((c * this.scaleFactors[idx]) * factor / (a * this.scaleFactors[3])) + 0.5);
55631 } else if (this.nBits[idx] != this.lRGBprecision) {
55632 if (this.lRGBprecision == 16) {
55633 c = Clazz_floatToInt ((c * this.scaleFactors[idx] * 257.0) + 0.5);
55634 } else {
55635 c = Clazz_floatToInt ((c * this.scaleFactors[idx]) + 0.5);
55636 }}return this.tosRGB8LUT[c] & 0xff;
55637 }, "~N,~N");
55638 Clazz_defineMethod (c$, "getRed", 
55639 function (pixel) {
55640 if (this.is_sRGB) {
55641 return this.getsRGBComponentFromsRGB (pixel, 0);
55642 } else if (this.is_LinearRGB) {
55643 return this.getsRGBComponentFromLinearRGB (pixel, 0);
55644 }var rgb = this.getDefaultRGBComponents (pixel);
55645 return Clazz_floatToInt (rgb[0] * 255.0 + 0.5);
55646 }, "~N");
55647 Clazz_defineMethod (c$, "getGreen", 
55648 function (pixel) {
55649 if (this.is_sRGB) {
55650 return this.getsRGBComponentFromsRGB (pixel, 1);
55651 } else if (this.is_LinearRGB) {
55652 return this.getsRGBComponentFromLinearRGB (pixel, 1);
55653 }var rgb = this.getDefaultRGBComponents (pixel);
55654 return Clazz_floatToInt (rgb[1] * 255.0 + 0.5);
55655 }, "~N");
55656 Clazz_defineMethod (c$, "getBlue", 
55657 function (pixel) {
55658 if (this.is_sRGB) {
55659 return this.getsRGBComponentFromsRGB (pixel, 2);
55660 } else if (this.is_LinearRGB) {
55661 return this.getsRGBComponentFromLinearRGB (pixel, 2);
55662 }var rgb = this.getDefaultRGBComponents (pixel);
55663 return Clazz_floatToInt (rgb[2] * 255.0 + 0.5);
55664 }, "~N");
55665 Clazz_defineMethod (c$, "getAlpha", 
55666 function (pixel) {
55667 if (!this.supportsAlpha) return 255;
55668 var a = ((pixel & this.maskArray[3]) >>> this.maskOffsets[3]);
55669 if (this.scaleFactors[3] != 1.0) {
55670 a = Clazz_floatToInt (a * this.scaleFactors[3] + 0.5);
55671 }return a;
55672 }, "~N");
55673 Clazz_defineMethod (c$, "getRGB", 
55674 function (pixel) {
55675 if (this.is_sRGB || this.is_LinearRGB) {
55676 return (this.getAlpha (pixel) << 24) | (this.getRed (pixel) << 16) | (this.getGreen (pixel) << 8) | (this.getBlue (pixel) << 0);
55677 }var rgb = this.getDefaultRGBComponents (pixel);
55678 return (this.getAlpha (pixel) << 24) | ((Clazz_floatToInt (rgb[0] * 255.0 + 0.5)) << 16) | ((Clazz_floatToInt (rgb[1] * 255.0 + 0.5)) << 8) | ((Clazz_floatToInt (rgb[2] * 255.0 + 0.5)) << 0);
55679 }, "~N");
55680 Clazz_defineMethod (c$, "getRed", 
55681 function (inData) {
55682 var pixel = 0;
55683 switch (this.transferType) {
55684 case 0:
55685 var bdata = inData;
55686 pixel = bdata[0] & 0xff;
55687 break;
55688 case 3:
55689 var idata = inData;
55690 pixel = idata[0];
55691 break;
55692 default:
55693 throw  new UnsupportedOperationException ("This method has not been " + "implemented for transferType " + this.transferType);
55694 }
55695 return this.getRed (pixel);
55696 }, "~O");
55697 Clazz_defineMethod (c$, "getGreen", 
55698 function (inData) {
55699 var pixel = 0;
55700 switch (this.transferType) {
55701 case 0:
55702 var bdata = inData;
55703 pixel = bdata[0] & 0xff;
55704 break;
55705 case 3:
55706 var idata = inData;
55707 pixel = idata[0];
55708 break;
55709 default:
55710 throw  new UnsupportedOperationException ("This method has not been " + "implemented for transferType " + this.transferType);
55711 }
55712 return this.getGreen (pixel);
55713 }, "~O");
55714 Clazz_defineMethod (c$, "getBlue", 
55715 function (inData) {
55716 var pixel = 0;
55717 switch (this.transferType) {
55718 case 0:
55719 var bdata = inData;
55720 pixel = bdata[0] & 0xff;
55721 break;
55722 case 3:
55723 var idata = inData;
55724 pixel = idata[0];
55725 break;
55726 default:
55727 throw  new UnsupportedOperationException ("This method has not been " + "implemented for transferType " + this.transferType);
55728 }
55729 return this.getBlue (pixel);
55730 }, "~O");
55731 Clazz_defineMethod (c$, "getAlpha", 
55732 function (inData) {
55733 var pixel = 0;
55734 switch (this.transferType) {
55735 case 0:
55736 var bdata = inData;
55737 pixel = bdata[0] & 0xff;
55738 break;
55739 case 3:
55740 var idata = inData;
55741 pixel = idata[0];
55742 break;
55743 default:
55744 throw  new UnsupportedOperationException ("This method has not been " + "implemented for transferType " + this.transferType);
55745 }
55746 return this.getAlpha (pixel);
55747 }, "~O");
55748 Clazz_defineMethod (c$, "getRGB", 
55749 function (inData) {
55750 var pixel = 0;
55751 switch (this.transferType) {
55752 case 0:
55753 var bdata = inData;
55754 pixel = bdata[0] & 0xff;
55755 break;
55756 case 3:
55757 var idata = inData;
55758 pixel = idata[0];
55759 break;
55760 default:
55761 throw  new UnsupportedOperationException ("This method has not been " + "implemented for transferType " + this.transferType);
55762 }
55763 return this.getRGB (pixel);
55764 }, "~O");
55765 Clazz_defineMethod (c$, "getDataElements", 
55766 function (rgb, pixel) {
55767 var intpixel = null;
55768 if (this.transferType == 3 && pixel != null) {
55769 intpixel = pixel;
55770 intpixel[0] = 0;
55771 } else {
55772 intpixel =  Clazz_newIntArray (1, 0);
55773 }var defaultCM = java.awt.image.ColorModel.getRGBdefault ();
55774 if (this === defaultCM || this.equals (defaultCM)) {
55775 intpixel[0] = rgb;
55776 return intpixel;
55777 }var red;
55778 var grn;
55779 var blu;
55780 var alp;
55781 red = (rgb >> 16) & 0xff;
55782 grn = (rgb >> 8) & 0xff;
55783 blu = rgb & 0xff;
55784 if (this.is_sRGB || this.is_LinearRGB) {
55785 var precision;
55786 var factor;
55787 if (this.is_LinearRGB) {
55788 if (this.lRGBprecision == 8) {
55789 red = this.fromsRGB8LUT8[red] & 0xff;
55790 grn = this.fromsRGB8LUT8[grn] & 0xff;
55791 blu = this.fromsRGB8LUT8[blu] & 0xff;
55792 precision = 8;
55793 factor = 0.003921569;
55794 } else {
55795 red = this.fromsRGB8LUT16[red] & 0xffff;
55796 grn = this.fromsRGB8LUT16[grn] & 0xffff;
55797 blu = this.fromsRGB8LUT16[blu] & 0xffff;
55798 precision = 16;
55799 factor = 1.5259022E-5;
55800 }} else {
55801 precision = 8;
55802 factor = 0.003921569;
55803 }if (this.supportsAlpha) {
55804 alp = (rgb >> 24) & 0xff;
55805 if (this.$isAlphaPremultiplied) {
55806 factor *= (alp * (0.003921569));
55807 precision = -1;
55808 }if (this.nBits[3] != 8) {
55809 alp = Clazz_floatToInt ((alp * (0.003921569) * ((1 << this.nBits[3]) - 1)) + 0.5);
55810 if (alp > ((1 << this.nBits[3]) - 1)) {
55811 alp = (1 << this.nBits[3]) - 1;
55812 }}intpixel[0] = alp << this.maskOffsets[3];
55813 }if (this.nBits[0] != precision) {
55814 red = Clazz_floatToInt ((red * factor * ((1 << this.nBits[0]) - 1)) + 0.5);
55815 }if (this.nBits[1] != precision) {
55816 grn = Clazz_floatToInt ((grn * factor * ((1 << this.nBits[1]) - 1)) + 0.5);
55817 }if (this.nBits[2] != precision) {
55818 blu = Clazz_floatToInt ((blu * factor * ((1 << this.nBits[2]) - 1)) + 0.5);
55819 }} else {
55820 var norm =  Clazz_newFloatArray (3, 0);
55821 var factor = 0.003921569;
55822 norm[0] = red * factor;
55823 norm[1] = grn * factor;
55824 norm[2] = blu * factor;
55825 norm = this.colorSpace.fromRGB (norm);
55826 if (this.supportsAlpha) {
55827 alp = (rgb >> 24) & 0xff;
55828 if (this.$isAlphaPremultiplied) {
55829 factor *= alp;
55830 for (var i = 0; i < 3; i++) {
55831 norm[i] *= factor;
55832 }
55833 }if (this.nBits[3] != 8) {
55834 alp = Clazz_floatToInt ((alp * (0.003921569) * ((1 << this.nBits[3]) - 1)) + 0.5);
55835 if (alp > ((1 << this.nBits[3]) - 1)) {
55836 alp = (1 << this.nBits[3]) - 1;
55837 }}intpixel[0] = alp << this.maskOffsets[3];
55838 }red = Clazz_floatToInt ((norm[0] * ((1 << this.nBits[0]) - 1)) + 0.5);
55839 grn = Clazz_floatToInt ((norm[1] * ((1 << this.nBits[1]) - 1)) + 0.5);
55840 blu = Clazz_floatToInt ((norm[2] * ((1 << this.nBits[2]) - 1)) + 0.5);
55841 }if (this.maxBits > 23) {
55842 if (red > ((1 << this.nBits[0]) - 1)) {
55843 red = (1 << this.nBits[0]) - 1;
55844 }if (grn > ((1 << this.nBits[1]) - 1)) {
55845 grn = (1 << this.nBits[1]) - 1;
55846 }if (blu > ((1 << this.nBits[2]) - 1)) {
55847 blu = (1 << this.nBits[2]) - 1;
55848 }}intpixel[0] |= (red << this.maskOffsets[0]) | (grn << this.maskOffsets[1]) | (blu << this.maskOffsets[2]);
55849 switch (this.transferType) {
55850 case 0:
55851 {
55852 var bdata;
55853 if (pixel == null) {
55854 bdata =  Clazz_newByteArray (1, 0);
55855 } else {
55856 bdata = pixel;
55857 }bdata[0] = (0xff & intpixel[0]);
55858 return bdata;
55859 }case 3:
55860 return intpixel;
55861 }
55862 throw  new UnsupportedOperationException ("This method has not been " + "implemented for transferType " + this.transferType);
55863 }, "~N,~O");
55864 Clazz_defineMethod (c$, "getComponents", 
55865 function (pixel, components, offset) {
55866 if (components == null) {
55867 components =  Clazz_newIntArray (offset + this.numComponents, 0);
55868 }for (var i = 0; i < this.numComponents; i++) {
55869 components[offset + i] = (pixel & this.maskArray[i]) >>> this.maskOffsets[i];
55870 }
55871 return components;
55872 }, "~N,~A,~N");
55873 Clazz_defineMethod (c$, "getComponents", 
55874 function (pixel, components, offset) {
55875 var intpixel = 0;
55876 switch (this.transferType) {
55877 case 0:
55878 var bdata = pixel;
55879 intpixel = bdata[0] & 0xff;
55880 break;
55881 case 3:
55882 var idata = pixel;
55883 intpixel = idata[0];
55884 break;
55885 default:
55886 throw  new UnsupportedOperationException ("This method has not been " + "implemented for transferType " + this.transferType);
55887 }
55888 return this.getComponents (intpixel, components, offset);
55889 }, "~O,~A,~N");
55890 Clazz_overrideMethod (c$, "createCompatibleWritableRaster", 
55891 function (w, h) {
55892 if ((w <= 0) || (h <= 0)) {
55893 throw  new IllegalArgumentException ("Width (" + w + ") and height (" + h + ") cannot be <= 0");
55894 }var bandmasks;
55895 if (this.supportsAlpha) {
55896 bandmasks =  Clazz_newIntArray (4, 0);
55897 bandmasks[3] = this.alpha_mask;
55898 } else {
55899 bandmasks =  Clazz_newIntArray (3, 0);
55900 }bandmasks[0] = this.red_mask;
55901 bandmasks[1] = this.green_mask;
55902 bandmasks[2] = this.blue_mask;
55903 if (this.pixel_bits > 8) {
55904 return java.awt.image.Raster.createPackedRaster (3, w, h, bandmasks, null);
55905 } else {
55906 return java.awt.image.Raster.createPackedRaster (0, w, h, bandmasks, null);
55907 }}, "~N,~N");
55908 Clazz_defineMethod (c$, "getDataElement", 
55909 function (components, offset) {
55910 var pixel = 0;
55911 for (var i = 0; i < this.numComponents; i++) {
55912 pixel |= ((components[offset + i] << this.maskOffsets[i]) & this.maskArray[i]);
55913 }
55914 return pixel;
55915 }, "~A,~N");
55916 Clazz_defineMethod (c$, "getDataElements", 
55917 function (components, offset, obj) {
55918 var pixel = 0;
55919 for (var i = 0; i < this.numComponents; i++) {
55920 pixel |= ((components[offset + i] << this.maskOffsets[i]) & this.maskArray[i]);
55921 }
55922 switch (this.transferType) {
55923 case 0:
55924 if (Clazz_instanceOf (obj, Array)) {
55925 var bdata = obj;
55926 bdata[0] = (pixel & 0xff);
55927 return bdata;
55928 } else {
55929 var bdata =  Clazz_newByteArray (-1, [(pixel & 0xff)]);
55930 return bdata;
55931 }case 3:
55932 if (Clazz_instanceOf (obj, Array)) {
55933 var idata = obj;
55934 idata[0] = pixel;
55935 return idata;
55936 } else {
55937 var idata =  Clazz_newIntArray (-1, [pixel]);
55938 return idata;
55939 }default:
55940 throw  new ClassCastException ("This method has not been " + "implemented for transferType " + this.transferType);
55941 }
55942 }, "~A,~N,~O");
55943 Clazz_overrideMethod (c$, "toString", 
55944 function () {
55945 return  String.instantialize ("DirectColorModel: rmask=" + Integer.toHexString (this.red_mask) + " gmask=" + Integer.toHexString (this.green_mask) + " bmask=" + Integer.toHexString (this.blue_mask) + " amask=" + Integer.toHexString (this.alpha_mask));
55946 });
55947 });
55948 Clazz_declarePackage ("java.awt.image");
55949 Clazz_load (["java.awt.image.ColorModel"], "java.awt.image.PackedColorModel", ["java.lang.IllegalArgumentException"], function () {
55950 c$ = Clazz_decorateAsClass (function () {
55951 this.maskArray = null;
55952 this.maskOffsets = null;
55953 this.scaleFactors = null;
55954 Clazz_instantialize (this, arguments);
55955 }, java.awt.image, "PackedColorModel", java.awt.image.ColorModel);
55956 Clazz_makeConstructor (c$, 
55957 function (space, bits, colorMaskArray, alphaMask, isAlphaPremultiplied, trans, transferType) {
55958 Clazz_superConstructor (this, java.awt.image.PackedColorModel, [bits, java.awt.image.PackedColorModel.createBitsArray (colorMaskArray, alphaMask), space, (alphaMask == 0 ? false : true), isAlphaPremultiplied, trans, transferType]);
55959 if (bits < 1 || bits > 32) {
55960 throw  new IllegalArgumentException ("Number of bits must be between 1 and 32.");
55961 }this.maskArray =  Clazz_newIntArray (this.numComponents, 0);
55962 this.maskOffsets =  Clazz_newIntArray (this.numComponents, 0);
55963 this.scaleFactors =  Clazz_newFloatArray (this.numComponents, 0);
55964 for (var i = 0; i < this.numColorComponents; i++) {
55965 this.DecomposeMask (colorMaskArray[i], i, space.getName (i));
55966 }
55967 if (alphaMask != 0) {
55968 this.DecomposeMask (alphaMask, this.numColorComponents, "alpha");
55969 if (this.nBits[this.numComponents - 1] == 1) {
55970 this.transparency = 2;
55971 }}}, "java.awt.color.ColorSpace,~N,~A,~N,~B,~N,~N");
55972 Clazz_makeConstructor (c$, 
55973 function (space, bits, rmask, gmask, bmask, amask, isAlphaPremultiplied, trans, transferType) {
55974 Clazz_superConstructor (this, java.awt.image.PackedColorModel, [bits, java.awt.image.PackedColorModel.createBitsArray (rmask, gmask, bmask, amask), space, (amask == 0 ? false : true), isAlphaPremultiplied, trans, transferType]);
55975 if (space.getType () != 5) {
55976 throw  new IllegalArgumentException ("ColorSpace must be TYPE_RGB.");
55977 }this.maskArray =  Clazz_newIntArray (this.numComponents, 0);
55978 this.maskOffsets =  Clazz_newIntArray (this.numComponents, 0);
55979 this.scaleFactors =  Clazz_newFloatArray (this.numComponents, 0);
55980 this.DecomposeMask (rmask, 0, "red");
55981 this.DecomposeMask (gmask, 1, "green");
55982 this.DecomposeMask (bmask, 2, "blue");
55983 if (amask != 0) {
55984 this.DecomposeMask (amask, 3, "alpha");
55985 if (this.nBits[3] == 1) {
55986 this.transparency = 2;
55987 }}}, "java.awt.color.ColorSpace,~N,~N,~N,~N,~N,~B,~N,~N");
55988 Clazz_defineMethod (c$, "getMask", 
55989 function (index) {
55990 return this.maskArray[index];
55991 }, "~N");
55992 Clazz_defineMethod (c$, "getMasks", 
55993 function () {
55994 return this.maskArray.clone ();
55995 });
55996 Clazz_defineMethod (c$, "DecomposeMask", 
55997  function (mask, idx, componentName) {
55998 var off = 0;
55999 var count = this.nBits[idx];
56000 this.maskArray[idx] = mask;
56001 if (mask != 0) {
56002 while ((mask & 1) == 0) {
56003 mask >>>= 1;
56004 off++;
56005 }
56006 }if (off + count > this.pixel_bits) {
56007 throw  new IllegalArgumentException (componentName + " mask " + Integer.toHexString (this.maskArray[idx]) + " overflows pixel (expecting " + this.pixel_bits + " bits");
56008 }this.maskOffsets[idx] = off;
56009 if (count == 0) {
56010 this.scaleFactors[idx] = 256.0;
56011 } else {
56012 this.scaleFactors[idx] = 255.0 / ((1 << count) - 1);
56013 }}, "~N,~N,~S");
56014 Clazz_defineMethod (c$, "equals", 
56015 function (obj) {
56016 if (!(Clazz_instanceOf (obj, java.awt.image.PackedColorModel))) {
56017 return false;
56018 }if (!Clazz_superCall (this, java.awt.image.PackedColorModel, "equals", [obj])) {
56019 return false;
56020 }var cm = obj;
56021 var numC = cm.getNumComponents ();
56022 if (numC != this.numComponents) {
56023 return false;
56024 }for (var i = 0; i < numC; i++) {
56025 if (this.maskArray[i] != cm.getMask (i)) {
56026 return false;
56027 }}
56028 return true;
56029 }, "~O");
56030 c$.createBitsArray = Clazz_defineMethod (c$, "createBitsArray", 
56031  function (colorMaskArray, alphaMask) {
56032 var numColors = colorMaskArray.length;
56033 var numAlpha = (alphaMask == 0 ? 0 : 1);
56034 var arr =  Clazz_newIntArray (numColors + numAlpha, 0);
56035 for (var i = 0; i < numColors; i++) {
56036 arr[i] = java.awt.image.PackedColorModel.countBits (colorMaskArray[i]);
56037 if (arr[i] < 0) {
56038 throw  new IllegalArgumentException ("Noncontiguous color mask (" + Integer.toHexString (colorMaskArray[i]) + "at index " + i);
56039 }}
56040 if (alphaMask != 0) {
56041 arr[numColors] = java.awt.image.PackedColorModel.countBits (alphaMask);
56042 if (arr[numColors] < 0) {
56043 throw  new IllegalArgumentException ("Noncontiguous alpha mask (" + Integer.toHexString (alphaMask));
56044 }}return arr;
56045 }, "~A,~N");
56046 c$.createBitsArray = Clazz_defineMethod (c$, "createBitsArray", 
56047  function (rmask, gmask, bmask, amask) {
56048 var arr =  Clazz_newIntArray (3 + (amask == 0 ? 0 : 1), 0);
56049 arr[0] = java.awt.image.PackedColorModel.countBits (rmask);
56050 arr[1] = java.awt.image.PackedColorModel.countBits (gmask);
56051 arr[2] = java.awt.image.PackedColorModel.countBits (bmask);
56052 if (arr[0] < 0) {
56053 throw  new IllegalArgumentException ("Noncontiguous red mask (" + Integer.toHexString (rmask));
56054 } else if (arr[1] < 0) {
56055 throw  new IllegalArgumentException ("Noncontiguous green mask (" + Integer.toHexString (gmask));
56056 } else if (arr[2] < 0) {
56057 throw  new IllegalArgumentException ("Noncontiguous blue mask (" + Integer.toHexString (bmask));
56058 }if (amask != 0) {
56059 arr[3] = java.awt.image.PackedColorModel.countBits (amask);
56060 if (arr[3] < 0) {
56061 throw  new IllegalArgumentException ("Noncontiguous alpha mask (" + Integer.toHexString (amask));
56062 }}return arr;
56063 }, "~N,~N,~N,~N");
56064 c$.countBits = Clazz_defineMethod (c$, "countBits", 
56065  function (mask) {
56066 var count = 0;
56067 if (mask != 0) {
56068 while ((mask & 1) == 0) {
56069 mask >>>= 1;
56070 }
56071 while ((mask & 1) == 1) {
56072 mask >>>= 1;
56073 count++;
56074 }
56075 }if (mask != 0) {
56076 return -1;
56077 }return count;
56078 }, "~N");
56079 });
56080 Clazz_declarePackage ("java.awt.image");
56081 Clazz_load (["java.awt.image.MultiPixelPackedSampleModel", "$.SinglePixelPackedSampleModel"], "java.awt.image.Raster", ["java.lang.IllegalArgumentException", "$.NullPointerException", "java.awt.Point", "$.Rectangle", "java.awt.image.DataBuffer", "$.DataBufferByte", "$.DataBufferInt", "$.RasterFormatException", "swingjs.api.Interface"], function () {
56082 c$ = Clazz_decorateAsClass (function () {
56083 this.sampleModel = null;
56084 this.dataBuffer = null;
56085 this.minX = 0;
56086 this.minY = 0;
56087 this.width = 0;
56088 this.height = 0;
56089 this.sampleModelTranslateX = 0;
56090 this.sampleModelTranslateY = 0;
56091 this.numBands = 0;
56092 this.numDataElements = 0;
56093 this.parent = null;
56094 Clazz_instantialize (this, arguments);
56095 }, java.awt.image, "Raster");
56096 c$.createPackedRaster = Clazz_defineMethod (c$, "createPackedRaster", 
56097 function (dataType, w, h, bandMasks, location) {
56098 var d;
56099 switch (dataType) {
56100 case 0:
56101 d =  new java.awt.image.DataBufferByte (w * h);
56102 break;
56103 case 3:
56104 d =  new java.awt.image.DataBufferInt (w * h);
56105 break;
56106 default:
56107 throw  new IllegalArgumentException ("Unsupported data type " + dataType);
56108 }
56109 return java.awt.image.Raster.createPackedRaster (d, w, h, w, bandMasks, location);
56110 }, "~N,~N,~N,~A,java.awt.Point");
56111 c$.createPackedRaster = Clazz_defineMethod (c$, "createPackedRaster", 
56112 function (dataType, w, h, bands, bitsPerBand, location) {
56113 var d;
56114 if (bands <= 0) {
56115 throw  new IllegalArgumentException ("Number of bands (" + bands + ") must be greater than 0");
56116 }if (bitsPerBand <= 0) {
56117 throw  new IllegalArgumentException ("Bits per band (" + bitsPerBand + ") must be greater than 0");
56118 }if (bands != 1) {
56119 var masks =  Clazz_newIntArray (bands, 0);
56120 var mask = (1 << bitsPerBand) - 1;
56121 var shift = (bands - 1) * bitsPerBand;
56122 if (shift + bitsPerBand > java.awt.image.DataBuffer.getDataTypeSize (dataType)) {
56123 throw  new IllegalArgumentException ("bitsPerBand(" + bitsPerBand + ") * bands is " + " greater than data type " + "size.");
56124 }switch (dataType) {
56125 case 0:
56126 case 3:
56127 break;
56128 default:
56129 throw  new IllegalArgumentException ("Unsupported data type " + dataType);
56130 }
56131 for (var i = 0; i < bands; i++) {
56132 masks[i] = mask << shift;
56133 shift = shift - bitsPerBand;
56134 }
56135 return java.awt.image.Raster.createPackedRaster (dataType, w, h, masks, location);
56136 } else {
56137 var fw = w;
56138 switch (dataType) {
56139 case 0:
56140 d =  new java.awt.image.DataBufferByte (Clazz_doubleToInt (Math.ceil (fw / (Clazz_doubleToInt (8 / bitsPerBand)))) * h);
56141 break;
56142 case 3:
56143 d =  new java.awt.image.DataBufferInt (Clazz_doubleToInt (Math.ceil (fw / (Clazz_doubleToInt (32 / bitsPerBand)))) * h);
56144 break;
56145 default:
56146 throw  new IllegalArgumentException ("Unsupported data type " + dataType);
56147 }
56148 return java.awt.image.Raster.createPackedRaster (d, w, h, bitsPerBand, location);
56149 }}, "~N,~N,~N,~N,~N,java.awt.Point");
56150 c$.createPackedRaster = Clazz_defineMethod (c$, "createPackedRaster", 
56151 function (dataBuffer, w, h, scanlineStride, bandMasks, location) {
56152 if (dataBuffer == null) {
56153 throw  new NullPointerException ("DataBuffer cannot be null");
56154 }if (location == null) {
56155 location =  new java.awt.Point (0, 0);
56156 }var dataType = dataBuffer.getDataType ();
56157 var sppsm =  new java.awt.image.SinglePixelPackedSampleModel (dataType, w, h, scanlineStride, bandMasks);
56158 switch (dataType) {
56159 case 0:
56160 case 3:
56161 break;
56162 default:
56163 throw  new IllegalArgumentException ("Unsupported data type " + dataType);
56164 }
56165 var r = swingjs.api.Interface.getInstance ("jssun.awt.image." + (dataType == 0 ? "Byte" : "Integer") + "InterleavedRaster", true);
56166 r.setParams (sppsm, dataBuffer, location);
56167 return r;
56168 }, "java.awt.image.DataBuffer,~N,~N,~N,~A,java.awt.Point");
56169 c$.createPackedRaster = Clazz_defineMethod (c$, "createPackedRaster", 
56170 function (dataBuffer, w, h, bitsPerPixel, location) {
56171 if (dataBuffer == null) {
56172 throw  new NullPointerException ("DataBuffer cannot be null");
56173 }if (location == null) {
56174 location =  new java.awt.Point (0, 0);
56175 }var dataType = dataBuffer.getDataType ();
56176 if (dataType != 0 && dataType != 3) {
56177 throw  new IllegalArgumentException ("Unsupported data type " + dataType);
56178 }if (dataBuffer.getNumBanks () != 1) {
56179 throw  new java.awt.image.RasterFormatException ("DataBuffer for packed Rasters must only have 1 bank.");
56180 }var mppsm =  new java.awt.image.MultiPixelPackedSampleModel (dataType, w, h, bitsPerPixel);
56181 if (dataType == 0 && (bitsPerPixel == 1 || bitsPerPixel == 2 || bitsPerPixel == 4)) {
56182 return  new jssun.awt.image.BytePackedRaster (mppsm, dataBuffer, location);
56183 } else {
56184 return  new jssun.awt.image.SunWritableRaster (mppsm, dataBuffer, location);
56185 }}, "java.awt.image.DataBuffer,~N,~N,~N,java.awt.Point");
56186 c$.createRaster = Clazz_defineMethod (c$, "createRaster", 
56187 function (sm, db, location) {
56188 if ((sm == null) || (db == null)) {
56189 throw  new NullPointerException ("SampleModel and DataBuffer cannot be null");
56190 }if (location == null) {
56191 location =  new java.awt.Point (0, 0);
56192 }var dataType = sm.getDataType ();
56193 if (Clazz_instanceOf (sm, java.awt.image.MultiPixelPackedSampleModel) && dataType == 0 && sm.getSampleSize (0) < 8) {
56194 return  new jssun.awt.image.BytePackedRaster (sm, db, location);
56195 }return  new java.awt.image.Raster (sm, db, location);
56196 }, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Point");
56197 c$.createWritableRaster = Clazz_defineMethod (c$, "createWritableRaster", 
56198 function (sm, location) {
56199 if (location == null) {
56200 location =  new java.awt.Point (0, 0);
56201 }return java.awt.image.Raster.createWritableRaster (sm, sm.createDataBuffer (), location);
56202 }, "java.awt.image.SampleModel,java.awt.Point");
56203 c$.createWritableRaster = Clazz_defineMethod (c$, "createWritableRaster", 
56204 function (sm, db, location) {
56205 if ((sm == null) || (db == null)) {
56206 throw  new NullPointerException ("SampleModel and DataBuffer cannot be null");
56207 }if (location == null) {
56208 location =  new java.awt.Point (0, 0);
56209 }var dataType = sm.getDataType ();
56210 if (Clazz_instanceOf (sm, java.awt.image.MultiPixelPackedSampleModel) && dataType == 0 && sm.getSampleSize (0) < 8) {
56211 return  new jssun.awt.image.BytePackedRaster (sm, db, location);
56212 }return  new jssun.awt.image.SunWritableRaster (sm, db, location);
56213 }, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Point");
56214 Clazz_makeConstructor (c$, 
56215 function (sampleModel, origin) {
56216 this.setRaster (sampleModel, sampleModel.createDataBuffer (),  new java.awt.Rectangle (origin.x, origin.y, sampleModel.getWidth (), sampleModel.getHeight ()), origin, null);
56217 }, "java.awt.image.SampleModel,java.awt.Point");
56218 Clazz_makeConstructor (c$, 
56219 function (sampleModel, dataBuffer, origin) {
56220 this.setRaster (sampleModel, dataBuffer,  new java.awt.Rectangle (origin.x, origin.y, sampleModel.getWidth (), sampleModel.getHeight ()), origin, null);
56221 }, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Point");
56222 Clazz_makeConstructor (c$, 
56223 function () {
56224 });
56225 Clazz_makeConstructor (c$, 
56226 function (sampleModel, dataBuffer, aRegion, sampleModelTranslate, parent) {
56227 this.setRaster (sampleModel, dataBuffer, aRegion, sampleModelTranslate, parent);
56228 }, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Rectangle,java.awt.Point,java.awt.image.Raster");
56229 Clazz_defineMethod (c$, "setRaster", 
56230 function (sampleModel, dataBuffer, aRegion, sampleModelTranslate, parent) {
56231 if ((sampleModel == null) || (dataBuffer == null) || (aRegion == null) || (sampleModelTranslate == null)) {
56232 throw  new NullPointerException ("SampleModel, dataBuffer, aRegion and sampleModelTranslate cannot be null");
56233 }this.sampleModel = sampleModel;
56234 this.dataBuffer = dataBuffer;
56235 this.minX = aRegion.x;
56236 this.minY = aRegion.y;
56237 this.width = aRegion.width;
56238 this.height = aRegion.height;
56239 if (this.width <= 0 || this.height <= 0) {
56240 throw  new java.awt.image.RasterFormatException ("negative or zero " + ((this.width <= 0) ? "width" : "height"));
56241 }if ((this.minX + this.width) < this.minX) {
56242 throw  new java.awt.image.RasterFormatException ("overflow condition for X coordinates of Raster");
56243 }if ((this.minY + this.height) < this.minY) {
56244 throw  new java.awt.image.RasterFormatException ("overflow condition for Y coordinates of Raster");
56245 }this.sampleModelTranslateX = sampleModelTranslate.x;
56246 this.sampleModelTranslateY = sampleModelTranslate.y;
56247 this.numBands = sampleModel.getNumBands ();
56248 this.numDataElements = sampleModel.getNumDataElements ();
56249 this.parent = parent;
56250 }, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Rectangle,java.awt.Point,java.awt.image.Raster");
56251 Clazz_defineMethod (c$, "getParent", 
56252 function () {
56253 return this.parent;
56254 });
56255 Clazz_defineMethod (c$, "getSampleModelTranslateX", 
56256 function () {
56257 return this.sampleModelTranslateX;
56258 });
56259 Clazz_defineMethod (c$, "getSampleModelTranslateY", 
56260 function () {
56261 return this.sampleModelTranslateY;
56262 });
56263 Clazz_defineMethod (c$, "createCompatibleWritableRaster", 
56264 function () {
56265 return  new jssun.awt.image.SunWritableRaster (this.sampleModel,  new java.awt.Point (0, 0));
56266 });
56267 Clazz_defineMethod (c$, "createCompatibleWritableRaster", 
56268 function (w, h) {
56269 if (w <= 0 || h <= 0) {
56270 throw  new java.awt.image.RasterFormatException ("negative " + ((w <= 0) ? "width" : "height"));
56271 }var sm = this.sampleModel.createCompatibleSampleModel (w, h);
56272 return  new jssun.awt.image.SunWritableRaster (sm,  new java.awt.Point (0, 0));
56273 }, "~N,~N");
56274 Clazz_defineMethod (c$, "createCompatibleWritableRaster", 
56275 function (rect) {
56276 if (rect == null) {
56277 throw  new NullPointerException ("Rect cannot be null");
56278 }return this.createCompatibleWritableRaster (rect.x, rect.y, rect.width, rect.height);
56279 }, "java.awt.Rectangle");
56280 Clazz_defineMethod (c$, "createCompatibleWritableRaster", 
56281 function (x, y, w, h) {
56282 var ret = this.createCompatibleWritableRaster (w, h);
56283 return ret.createWritableChild (0, 0, w, h, x, y, null);
56284 }, "~N,~N,~N,~N");
56285 Clazz_defineMethod (c$, "createTranslatedChild", 
56286 function (childMinX, childMinY) {
56287 return this.createChild (this.minX, this.minY, this.width, this.height, childMinX, childMinY, null);
56288 }, "~N,~N");
56289 Clazz_defineMethod (c$, "createChild", 
56290 function (parentX, parentY, width, height, childMinX, childMinY, bandList) {
56291 if (parentX < this.minX) {
56292 throw  new java.awt.image.RasterFormatException ("parentX lies outside raster");
56293 }if (parentY < this.minY) {
56294 throw  new java.awt.image.RasterFormatException ("parentY lies outside raster");
56295 }if ((parentX + width < parentX) || (parentX + width > this.width + this.minX)) {
56296 throw  new java.awt.image.RasterFormatException ("(parentX + width) is outside raster");
56297 }if ((parentY + height < parentY) || (parentY + height > this.height + this.minY)) {
56298 throw  new java.awt.image.RasterFormatException ("(parentY + height) is outside raster");
56299 }var subSampleModel;
56300 if (bandList == null) {
56301 subSampleModel = this.sampleModel;
56302 } else {
56303 subSampleModel = this.sampleModel.createSubsetSampleModel (bandList);
56304 }var deltaX = childMinX - parentX;
56305 var deltaY = childMinY - parentY;
56306 return  new java.awt.image.Raster (subSampleModel, this.getDataBuffer (),  new java.awt.Rectangle (childMinX, childMinY, width, height),  new java.awt.Point (this.sampleModelTranslateX + deltaX, this.sampleModelTranslateY + deltaY), this);
56307 }, "~N,~N,~N,~N,~N,~N,~A");
56308 Clazz_defineMethod (c$, "getBounds", 
56309 function () {
56310 return  new java.awt.Rectangle (this.minX, this.minY, this.width, this.height);
56311 });
56312 Clazz_defineMethod (c$, "getMinX", 
56313 function () {
56314 return this.minX;
56315 });
56316 Clazz_defineMethod (c$, "getMinY", 
56317 function () {
56318 return this.minY;
56319 });
56320 Clazz_defineMethod (c$, "getWidth", 
56321 function () {
56322 return this.width;
56323 });
56324 Clazz_defineMethod (c$, "getHeight", 
56325 function () {
56326 return this.height;
56327 });
56328 Clazz_defineMethod (c$, "getNumBands", 
56329 function () {
56330 return this.numBands;
56331 });
56332 Clazz_defineMethod (c$, "getNumDataElements", 
56333 function () {
56334 return this.sampleModel.getNumDataElements ();
56335 });
56336 Clazz_defineMethod (c$, "getTransferType", 
56337 function () {
56338 return this.sampleModel.getTransferType ();
56339 });
56340 Clazz_defineMethod (c$, "getDataBuffer", 
56341 function () {
56342 return this.dataBuffer;
56343 });
56344 Clazz_defineMethod (c$, "getSampleModel", 
56345 function () {
56346 return this.sampleModel;
56347 });
56348 Clazz_defineMethod (c$, "getDataElements", 
56349 function (x, y, outData) {
56350 return this.sampleModel.getDataElements (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, outData, this.dataBuffer);
56351 }, "~N,~N,~O");
56352 Clazz_defineMethod (c$, "getDataElements", 
56353 function (x, y, w, h, outData) {
56354 return this.sampleModel.getDataElements (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, w, h, outData, this.dataBuffer);
56355 }, "~N,~N,~N,~N,~O");
56356 Clazz_defineMethod (c$, "getPixel", 
56357 function (x, y, iArray) {
56358 return this.sampleModel.getPixel (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, iArray, this.dataBuffer);
56359 }, "~N,~N,~A");
56360 Clazz_defineMethod (c$, "getPixel", 
56361 function (x, y, fArray) {
56362 return this.sampleModel.getPixel (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, fArray, this.dataBuffer);
56363 }, "~N,~N,~A");
56364 Clazz_defineMethod (c$, "getPixel", 
56365 function (x, y, dArray) {
56366 return this.sampleModel.getPixel (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, dArray, this.dataBuffer);
56367 }, "~N,~N,~A");
56368 Clazz_defineMethod (c$, "getPixels", 
56369 function (x, y, w, h, iArray) {
56370 return this.sampleModel.getPixels (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, w, h, iArray, this.dataBuffer);
56371 }, "~N,~N,~N,~N,~A");
56372 Clazz_defineMethod (c$, "getPixels", 
56373 function (x, y, w, h, fArray) {
56374 return this.sampleModel.getPixels (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, w, h, fArray, this.dataBuffer);
56375 }, "~N,~N,~N,~N,~A");
56376 Clazz_defineMethod (c$, "getPixels", 
56377 function (x, y, w, h, dArray) {
56378 return this.sampleModel.getPixels (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, w, h, dArray, this.dataBuffer);
56379 }, "~N,~N,~N,~N,~A");
56380 Clazz_defineMethod (c$, "getSample", 
56381 function (x, y, b) {
56382 return this.sampleModel.getSample (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, b, this.dataBuffer);
56383 }, "~N,~N,~N");
56384 Clazz_defineMethod (c$, "getSampleFloat", 
56385 function (x, y, b) {
56386 return this.sampleModel.getSampleFloat (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, b, this.dataBuffer);
56387 }, "~N,~N,~N");
56388 Clazz_defineMethod (c$, "getSampleDouble", 
56389 function (x, y, b) {
56390 return this.sampleModel.getSampleDouble (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, b, this.dataBuffer);
56391 }, "~N,~N,~N");
56392 Clazz_defineMethod (c$, "getSamples", 
56393 function (x, y, w, h, b, iArray) {
56394 return this.sampleModel.getSamples (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, w, h, b, iArray, this.dataBuffer);
56395 }, "~N,~N,~N,~N,~N,~A");
56396 Clazz_defineMethod (c$, "getSamples", 
56397 function (x, y, w, h, b, fArray) {
56398 return this.sampleModel.getSamples (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, w, h, b, fArray, this.dataBuffer);
56399 }, "~N,~N,~N,~N,~N,~A");
56400 Clazz_defineMethod (c$, "getSamples", 
56401 function (x, y, w, h, b, dArray) {
56402 return this.sampleModel.getSamples (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, w, h, b, dArray, this.dataBuffer);
56403 }, "~N,~N,~N,~N,~N,~A");
56404 });
56405 Clazz_declarePackage ("java.awt.image");
56406 Clazz_load (["java.awt.image.SampleModel"], "java.awt.image.MultiPixelPackedSampleModel", ["java.lang.ArrayIndexOutOfBoundsException", "$.IllegalArgumentException", "java.awt.image.DataBuffer", "$.DataBufferByte", "$.DataBufferInt", "$.RasterFormatException"], function () {
56407 c$ = Clazz_decorateAsClass (function () {
56408 this.pixelBitStride = 0;
56409 this.bitMask = 0;
56410 this.pixelsPerDataElement = 0;
56411 this.dataElementSize = 0;
56412 this.dataBitOffset = 0;
56413 this.scanlineStride = 0;
56414 Clazz_instantialize (this, arguments);
56415 }, java.awt.image, "MultiPixelPackedSampleModel", java.awt.image.SampleModel);
56416 Clazz_makeConstructor (c$, 
56417 function (dataType, w, h, numberOfBits) {
56418 this.construct (dataType, w, h, numberOfBits, Clazz_doubleToInt ((w * numberOfBits + java.awt.image.DataBuffer.getDataTypeSize (dataType) - 1) / java.awt.image.DataBuffer.getDataTypeSize (dataType)), 0);
56419 if (dataType != 0 && dataType != 3) {
56420 throw  new IllegalArgumentException ("Unsupported data type " + dataType);
56421 }}, "~N,~N,~N,~N");
56422 Clazz_makeConstructor (c$, 
56423 function (dataType, w, h, numberOfBits, scanlineStride, dataBitOffset) {
56424 Clazz_superConstructor (this, java.awt.image.MultiPixelPackedSampleModel, [dataType, w, h, 1]);
56425 if (dataType != 0 && dataType != 3) {
56426 throw  new IllegalArgumentException ("Unsupported data type " + dataType);
56427 }this.dataType = dataType;
56428 this.pixelBitStride = numberOfBits;
56429 this.scanlineStride = scanlineStride;
56430 this.dataBitOffset = dataBitOffset;
56431 this.dataElementSize = java.awt.image.DataBuffer.getDataTypeSize (dataType);
56432 this.pixelsPerDataElement = Clazz_doubleToInt (this.dataElementSize / numberOfBits);
56433 if (this.pixelsPerDataElement * numberOfBits != this.dataElementSize) {
56434 throw  new java.awt.image.RasterFormatException ("MultiPixelPackedSampleModel does not allow pixels to span data element boundaries");
56435 }this.bitMask = (1 << numberOfBits) - 1;
56436 }, "~N,~N,~N,~N,~N,~N");
56437 Clazz_overrideMethod (c$, "createCompatibleSampleModel", 
56438 function (w, h) {
56439 var sampleModel =  new java.awt.image.MultiPixelPackedSampleModel (this.dataType, w, h, this.pixelBitStride);
56440 return sampleModel;
56441 }, "~N,~N");
56442 Clazz_overrideMethod (c$, "createDataBuffer", 
56443 function () {
56444 var dataBuffer = null;
56445 var size = this.scanlineStride * this.height;
56446 switch (this.dataType) {
56447 case 0:
56448 dataBuffer =  new java.awt.image.DataBufferByte (size + Clazz_doubleToInt ((this.dataBitOffset + 7) / 8));
56449 break;
56450 case 3:
56451 dataBuffer =  new java.awt.image.DataBufferInt (size + Clazz_doubleToInt ((this.dataBitOffset + 31) / 32));
56452 break;
56453 }
56454 return dataBuffer;
56455 });
56456 Clazz_overrideMethod (c$, "getNumDataElements", 
56457 function () {
56458 return 1;
56459 });
56460 Clazz_defineMethod (c$, "getSampleSize", 
56461 function () {
56462 var sampleSize =  Clazz_newIntArray (-1, [this.pixelBitStride]);
56463 return sampleSize;
56464 });
56465 Clazz_defineMethod (c$, "getSampleSize", 
56466 function (band) {
56467 return this.pixelBitStride;
56468 }, "~N");
56469 Clazz_defineMethod (c$, "getOffset", 
56470 function (x, y) {
56471 var offset = y * this.scanlineStride;
56472 offset += Clazz_doubleToInt ((x * this.pixelBitStride + this.dataBitOffset) / this.dataElementSize);
56473 return offset;
56474 }, "~N,~N");
56475 Clazz_defineMethod (c$, "getBitOffset", 
56476 function (x) {
56477 return (x * this.pixelBitStride + this.dataBitOffset) % this.dataElementSize;
56478 }, "~N");
56479 Clazz_defineMethod (c$, "getScanlineStride", 
56480 function () {
56481 return this.scanlineStride;
56482 });
56483 Clazz_defineMethod (c$, "getPixelBitStride", 
56484 function () {
56485 return this.pixelBitStride;
56486 });
56487 Clazz_defineMethod (c$, "getDataBitOffset", 
56488 function () {
56489 return this.dataBitOffset;
56490 });
56491 Clazz_overrideMethod (c$, "getTransferType", 
56492 function () {
56493 return 3;
56494 });
56495 Clazz_overrideMethod (c$, "createSubsetSampleModel", 
56496 function (bands) {
56497 if (bands != null) {
56498 if (bands.length != 1) throw  new java.awt.image.RasterFormatException ("MultiPixelPackedSampleModel has only one band.");
56499 }var sm = this.createCompatibleSampleModel (this.width, this.height);
56500 return sm;
56501 }, "~A");
56502 Clazz_overrideMethod (c$, "getSample", 
56503 function (x, y, b, data) {
56504 if ((x < 0) || (y < 0) || (x >= this.width) || (y >= this.height) || (b != 0)) {
56505 throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
56506 }var bitnum = this.dataBitOffset + x * this.pixelBitStride;
56507 var element = data.getElem (y * this.scanlineStride + Clazz_doubleToInt (bitnum / this.dataElementSize));
56508 var shift = this.dataElementSize - (bitnum & (this.dataElementSize - 1)) - this.pixelBitStride;
56509 return (element >> shift) & this.bitMask;
56510 }, "~N,~N,~N,java.awt.image.DataBuffer");
56511 Clazz_defineMethod (c$, "setSample", 
56512 function (x, y, b, s, data) {
56513 if ((x < 0) || (y < 0) || (x >= this.width) || (y >= this.height) || (b != 0)) {
56514 throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
56515 }var bitnum = this.dataBitOffset + x * this.pixelBitStride;
56516 var index = y * this.scanlineStride + (Clazz_doubleToInt (bitnum / this.dataElementSize));
56517 var shift = this.dataElementSize - (bitnum & (this.dataElementSize - 1)) - this.pixelBitStride;
56518 var element = data.getElem (index);
56519 element &= ~(this.bitMask << shift);
56520 element |= (s & this.bitMask) << shift;
56521 data.setElem (index, element);
56522 }, "~N,~N,~N,~N,java.awt.image.DataBuffer");
56523 Clazz_defineMethod (c$, "getDataElements", 
56524 function (x, y, obj, data) {
56525 if ((x < 0) || (y < 0) || (x >= this.width) || (y >= this.height)) {
56526 throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
56527 }var type = this.getTransferType ();
56528 var bitnum = this.dataBitOffset + x * this.pixelBitStride;
56529 var shift = this.dataElementSize - (bitnum & (this.dataElementSize - 1)) - this.pixelBitStride;
56530 var element = 0;
56531 switch (type) {
56532 case 0:
56533 var bdata;
56534 if (obj == null) bdata =  Clazz_newByteArray (1, 0);
56535  else bdata = obj;
56536 element = data.getElem (y * this.scanlineStride + Clazz_doubleToInt (bitnum / this.dataElementSize));
56537 bdata[0] = ((element >> shift) & this.bitMask);
56538 obj = bdata;
56539 break;
56540 case 3:
56541 var idata;
56542 if (obj == null) idata =  Clazz_newIntArray (1, 0);
56543  else idata = obj;
56544 element = data.getElem (y * this.scanlineStride + Clazz_doubleToInt (bitnum / this.dataElementSize));
56545 idata[0] = (element >> shift) & this.bitMask;
56546 obj = idata;
56547 break;
56548 }
56549 return obj;
56550 }, "~N,~N,~O,java.awt.image.DataBuffer");
56551 Clazz_defineMethod (c$, "getPixel", 
56552 function (x, y, iArray, data) {
56553 if ((x < 0) || (y < 0) || (x >= this.width) || (y >= this.height)) {
56554 throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
56555 }var pixels;
56556 if (iArray != null) {
56557 pixels = iArray;
56558 } else {
56559 pixels =  Clazz_newIntArray (this.numBands, 0);
56560 }var bitnum = this.dataBitOffset + x * this.pixelBitStride;
56561 var element = data.getElem (y * this.scanlineStride + Clazz_doubleToInt (bitnum / this.dataElementSize));
56562 var shift = this.dataElementSize - (bitnum & (this.dataElementSize - 1)) - this.pixelBitStride;
56563 pixels[0] = (element >> shift) & this.bitMask;
56564 return pixels;
56565 }, "~N,~N,~A,java.awt.image.DataBuffer");
56566 Clazz_defineMethod (c$, "setDataElements", 
56567 function (x, y, obj, data) {
56568 if ((x < 0) || (y < 0) || (x >= this.width) || (y >= this.height)) {
56569 throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
56570 }var type = this.getTransferType ();
56571 var bitnum = this.dataBitOffset + x * this.pixelBitStride;
56572 var index = y * this.scanlineStride + (Clazz_doubleToInt (bitnum / this.dataElementSize));
56573 var shift = this.dataElementSize - (bitnum & (this.dataElementSize - 1)) - this.pixelBitStride;
56574 var element = data.getElem (index);
56575 element &= ~(this.bitMask << shift);
56576 switch (type) {
56577 case 0:
56578 var barray = obj;
56579 element |= (((barray[0]) & 0xff) & this.bitMask) << shift;
56580 data.setElem (index, element);
56581 break;
56582 case 3:
56583 var iarray = obj;
56584 element |= (iarray[0] & this.bitMask) << shift;
56585 data.setElem (index, element);
56586 break;
56587 }
56588 }, "~N,~N,~O,java.awt.image.DataBuffer");
56589 Clazz_defineMethod (c$, "setPixel", 
56590 function (x, y, iArray, data) {
56591 if ((x < 0) || (y < 0) || (x >= this.width) || (y >= this.height)) {
56592 throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
56593 }var bitnum = this.dataBitOffset + x * this.pixelBitStride;
56594 var index = y * this.scanlineStride + (Clazz_doubleToInt (bitnum / this.dataElementSize));
56595 var shift = this.dataElementSize - (bitnum & (this.dataElementSize - 1)) - this.pixelBitStride;
56596 var element = data.getElem (index);
56597 element &= ~(this.bitMask << shift);
56598 element |= (iArray[0] & this.bitMask) << shift;
56599 data.setElem (index, element);
56600 }, "~N,~N,~A,java.awt.image.DataBuffer");
56601 Clazz_overrideMethod (c$, "equals", 
56602 function (o) {
56603 if ((o == null) || !(Clazz_instanceOf (o, java.awt.image.MultiPixelPackedSampleModel))) {
56604 return false;
56605 }var that = o;
56606 return this.width == that.width && this.height == that.height && this.numBands == that.numBands && this.dataType == that.dataType && this.pixelBitStride == that.pixelBitStride && this.bitMask == that.bitMask && this.pixelsPerDataElement == that.pixelsPerDataElement && this.dataElementSize == that.dataElementSize && this.dataBitOffset == that.dataBitOffset && this.scanlineStride == that.scanlineStride;
56607 }, "~O");
56608 Clazz_overrideMethod (c$, "hashCode", 
56609 function () {
56610 var hash = 0;
56611 hash = this.width;
56612 hash <<= 8;
56613 hash ^= this.height;
56614 hash <<= 8;
56615 hash ^= this.numBands;
56616 hash <<= 8;
56617 hash ^= this.dataType;
56618 hash <<= 8;
56619 hash ^= this.pixelBitStride;
56620 hash <<= 8;
56621 hash ^= this.bitMask;
56622 hash <<= 8;
56623 hash ^= this.pixelsPerDataElement;
56624 hash <<= 8;
56625 hash ^= this.dataElementSize;
56626 hash <<= 8;
56627 hash ^= this.dataBitOffset;
56628 hash <<= 8;
56629 hash ^= this.scanlineStride;
56630 return hash;
56631 });
56632 });
56633 Clazz_declarePackage ("java.awt.image");
56634 Clazz_load (null, "java.awt.image.SampleModel", ["java.lang.IllegalArgumentException"], function () {
56635 c$ = Clazz_decorateAsClass (function () {
56636 this.width = 0;
56637 this.height = 0;
56638 this.numBands = 0;
56639 this.dataType = 0;
56640 Clazz_instantialize (this, arguments);
56641 }, java.awt.image, "SampleModel");
56642 Clazz_makeConstructor (c$, 
56643 function (dataType, w, h, numBands) {
56644 var size = w * h;
56645 if (w <= 0 || h <= 0) {
56646 throw  new IllegalArgumentException ("Width (" + w + ") and height (" + h + ") must be > 0");
56647 }if (size >= 2147483647) {
56648 throw  new IllegalArgumentException ("Dimensions (width=" + w + " height=" + h + ") are too large");
56649 }if (dataType < 0 || (dataType > 3 && dataType != 32)) {
56650 throw  new IllegalArgumentException ("Unsupported dataType: " + dataType);
56651 }if (numBands <= 0) {
56652 throw  new IllegalArgumentException ("Number of bands must be > 0");
56653 }this.dataType = dataType;
56654 this.width = w;
56655 this.height = h;
56656 this.numBands = numBands;
56657 }, "~N,~N,~N,~N");
56658 Clazz_defineMethod (c$, "getWidth", 
56659 function () {
56660 return this.width;
56661 });
56662 Clazz_defineMethod (c$, "getHeight", 
56663 function () {
56664 return this.height;
56665 });
56666 Clazz_defineMethod (c$, "getNumBands", 
56667 function () {
56668 return this.numBands;
56669 });
56670 Clazz_defineMethod (c$, "getDataType", 
56671 function () {
56672 return this.dataType;
56673 });
56674 Clazz_defineMethod (c$, "getTransferType", 
56675 function () {
56676 return this.dataType;
56677 });
56678 Clazz_defineMethod (c$, "getPixel", 
56679 function (x, y, iArray, data) {
56680 var pixels;
56681 if (iArray != null) pixels = iArray;
56682  else pixels =  Clazz_newIntArray (this.numBands, 0);
56683 for (var i = 0; i < this.numBands; i++) {
56684 pixels[i] = this.getSample (x, y, i, data);
56685 }
56686 return pixels;
56687 }, "~N,~N,~A,java.awt.image.DataBuffer");
56688 Clazz_defineMethod (c$, "getDataElements", 
56689 function (x, y, w, h, obj, data) {
56690 var type = this.getTransferType ();
56691 var numDataElems = this.getNumDataElements ();
56692 var cnt = 0;
56693 var o = null;
56694 switch (type) {
56695 case 0:
56696 var btemp;
56697 var bdata;
56698 if (obj == null) bdata =  Clazz_newByteArray (numDataElems * w * h, 0);
56699  else bdata = obj;
56700 for (var i = y; i < y + h; i++) {
56701 for (var j = x; j < x + w; j++) {
56702 o = this.getDataElements (j, i, o, data);
56703 btemp = o;
56704 for (var k = 0; k < numDataElems; k++) {
56705 bdata[cnt++] = btemp[k];
56706 }
56707 }
56708 }
56709 obj = bdata;
56710 break;
56711 case 2:
56712 var sdata;
56713 var stemp;
56714 if (obj == null) sdata =  Clazz_newShortArray (numDataElems * w * h, 0);
56715  else sdata = obj;
56716 for (var i = y; i < y + h; i++) {
56717 for (var j = x; j < x + w; j++) {
56718 o = this.getDataElements (j, i, o, data);
56719 stemp = o;
56720 for (var k = 0; k < numDataElems; k++) {
56721 sdata[cnt++] = stemp[k];
56722 }
56723 }
56724 }
56725 obj = sdata;
56726 break;
56727 case 3:
56728 var idata;
56729 var itemp;
56730 if (obj == null) idata =  Clazz_newIntArray (numDataElems * w * h, 0);
56731  else idata = obj;
56732 for (var i = y; i < y + h; i++) {
56733 for (var j = x; j < x + w; j++) {
56734 o = this.getDataElements (j, i, o, data);
56735 itemp = o;
56736 for (var k = 0; k < numDataElems; k++) {
56737 idata[cnt++] = itemp[k];
56738 }
56739 }
56740 }
56741 obj = idata;
56742 break;
56743 }
56744 return obj;
56745 }, "~N,~N,~N,~N,~O,java.awt.image.DataBuffer");
56746 Clazz_defineMethod (c$, "setDataElements", 
56747 function (x, y, w, h, obj, data) {
56748 var cnt = 0;
56749 var type = this.getTransferType ();
56750 var numDataElems = this.getNumDataElements ();
56751 switch (type) {
56752 case 0:
56753 var barray = obj;
56754 var btemp =  Clazz_newByteArray (numDataElems, 0);
56755 for (var i = y; i < y + h; i++) {
56756 for (var j = x; j < x + w; j++) {
56757 for (var k = 0; k < numDataElems; k++) {
56758 btemp[k] = barray[cnt++];
56759 }
56760 this.setDataElements (j, i, btemp, data);
56761 }
56762 }
56763 break;
56764 case 3:
56765 var iArray = obj;
56766 var itemp =  Clazz_newIntArray (numDataElems, 0);
56767 for (var i = y; i < y + h; i++) {
56768 for (var j = x; j < x + w; j++) {
56769 for (var k = 0; k < numDataElems; k++) {
56770 itemp[k] = iArray[cnt++];
56771 }
56772 this.setDataElements (j, i, itemp, data);
56773 }
56774 }
56775 break;
56776 }
56777 }, "~N,~N,~N,~N,~O,java.awt.image.DataBuffer");
56778 Clazz_defineMethod (c$, "getPixels", 
56779 function (x, y, w, h, iArray, data) {
56780 var pixels;
56781 var Offset = 0;
56782 if (iArray != null) pixels = iArray;
56783  else pixels =  Clazz_newIntArray (this.numBands * w * h, 0);
56784 for (var i = y; i < (h + y); i++) {
56785 for (var j = x; j < (w + x); j++) {
56786 for (var k = 0; k < this.numBands; k++) {
56787 pixels[Offset++] = this.getSample (j, i, k, data);
56788 }
56789 }
56790 }
56791 return pixels;
56792 }, "~N,~N,~N,~N,~A,java.awt.image.DataBuffer");
56793 Clazz_defineMethod (c$, "getSampleFloat", 
56794 function (x, y, b, data) {
56795 var sample;
56796 sample = this.getSample (x, y, b, data);
56797 return sample;
56798 }, "~N,~N,~N,java.awt.image.DataBuffer");
56799 Clazz_defineMethod (c$, "getSampleDouble", 
56800 function (x, y, b, data) {
56801 var sample;
56802 sample = this.getSample (x, y, b, data);
56803 return sample;
56804 }, "~N,~N,~N,java.awt.image.DataBuffer");
56805 Clazz_defineMethod (c$, "getSamples", 
56806 function (x, y, w, h, b, iArray, data) {
56807 var pixels;
56808 var Offset = 0;
56809 if (iArray != null) pixels = iArray;
56810  else pixels =  Clazz_newIntArray (w * h, 0);
56811 for (var i = y; i < (h + y); i++) {
56812 for (var j = x; j < (w + x); j++) {
56813 pixels[Offset++] = this.getSample (j, i, b, data);
56814 }
56815 }
56816 return pixels;
56817 }, "~N,~N,~N,~N,~N,~A,java.awt.image.DataBuffer");
56818 Clazz_defineMethod (c$, "setPixel", 
56819 function (x, y, iArray, data) {
56820 for (var i = 0; i < this.numBands; i++) this.setSample (x, y, i, iArray[i], data);
56821
56822 }, "~N,~N,~A,java.awt.image.DataBuffer");
56823 Clazz_defineMethod (c$, "setPixel", 
56824 function (x, y, fArray, data) {
56825 for (var i = 0; i < this.numBands; i++) this.setSample (x, y, i, fArray[i], data);
56826
56827 }, "~N,~N,~A,java.awt.image.DataBuffer");
56828 Clazz_defineMethod (c$, "setPixels", 
56829 function (x, y, w, h, iArray, data) {
56830 var Offset = 0;
56831 for (var i = y; i < (y + h); i++) {
56832 for (var j = x; j < (x + w); j++) {
56833 for (var k = 0; k < this.numBands; k++) {
56834 this.setSample (j, i, k, iArray[Offset++], data);
56835 }
56836 }
56837 }
56838 }, "~N,~N,~N,~N,~A,java.awt.image.DataBuffer");
56839 Clazz_defineMethod (c$, "setSamples", 
56840 function (x, y, w, h, b, iArray, data) {
56841 var Offset = 0;
56842 for (var i = y; i < (y + h); i++) {
56843 for (var j = x; j < (x + w); j++) {
56844 this.setSample (j, i, b, iArray[Offset++], data);
56845 }
56846 }
56847 }, "~N,~N,~N,~N,~N,~A,java.awt.image.DataBuffer");
56848 });
56849 Clazz_declarePackage ("java.awt.image");
56850 Clazz_load (null, "java.awt.image.DataBuffer", ["java.lang.ArrayIndexOutOfBoundsException", "$.IllegalArgumentException", "jssun.java2d.StateTrackable", "$.StateTrackableDelegate"], function () {
56851 c$ = Clazz_decorateAsClass (function () {
56852 this.dataType = 0;
56853 this.banks = 0;
56854 this.offset = 0;
56855 this.size = 0;
56856 this.offsets = null;
56857 this.theTrackable = null;
56858 Clazz_instantialize (this, arguments);
56859 }, java.awt.image, "DataBuffer");
56860 c$.getDataTypeSize = Clazz_defineMethod (c$, "getDataTypeSize", 
56861 function (type) {
56862 if (type < 0 || type > 3) {
56863 throw  new IllegalArgumentException ("Unknown data type " + type);
56864 }return java.awt.image.DataBuffer.dataTypeSize[type];
56865 }, "~N");
56866 Clazz_makeConstructor (c$, 
56867 function (dataType, size) {
56868 this.construct (jssun.java2d.StateTrackable.State.UNTRACKABLE, dataType, size);
56869 }, "~N,~N");
56870 Clazz_makeConstructor (c$, 
56871 function (initialState, dataType, size) {
56872 this.theTrackable = jssun.java2d.StateTrackableDelegate.createInstance (initialState);
56873 this.dataType = dataType;
56874 this.banks = 1;
56875 this.size = size;
56876 this.offset = 0;
56877 this.offsets =  Clazz_newIntArray (1, 0);
56878 }, "jssun.java2d.StateTrackable.State,~N,~N");
56879 Clazz_makeConstructor (c$, 
56880 function (dataType, size, numBanks) {
56881 this.construct (jssun.java2d.StateTrackable.State.UNTRACKABLE, dataType, size, numBanks);
56882 }, "~N,~N,~N");
56883 Clazz_makeConstructor (c$, 
56884 function (initialState, dataType, size, numBanks) {
56885 this.theTrackable = jssun.java2d.StateTrackableDelegate.createInstance (initialState);
56886 this.dataType = dataType;
56887 this.banks = numBanks;
56888 this.size = size;
56889 this.offset = 0;
56890 this.offsets =  Clazz_newIntArray (this.banks, 0);
56891 }, "jssun.java2d.StateTrackable.State,~N,~N,~N");
56892 Clazz_makeConstructor (c$, 
56893 function (dataType, size, numBanks, offset) {
56894 this.construct (jssun.java2d.StateTrackable.State.UNTRACKABLE, dataType, size, numBanks, offset);
56895 }, "~N,~N,~N,~N");
56896 Clazz_makeConstructor (c$, 
56897 function (initialState, dataType, size, numBanks, offset) {
56898 this.theTrackable = jssun.java2d.StateTrackableDelegate.createInstance (initialState);
56899 this.dataType = dataType;
56900 this.banks = numBanks;
56901 this.size = size;
56902 this.offset = offset;
56903 this.offsets =  Clazz_newIntArray (numBanks, 0);
56904 for (var i = 0; i < numBanks; i++) {
56905 this.offsets[i] = offset;
56906 }
56907 }, "jssun.java2d.StateTrackable.State,~N,~N,~N,~N");
56908 Clazz_makeConstructor (c$, 
56909 function (dataType, size, numBanks, offsets) {
56910 this.construct (jssun.java2d.StateTrackable.State.UNTRACKABLE, dataType, size, numBanks, offsets);
56911 }, "~N,~N,~N,~A");
56912 Clazz_makeConstructor (c$, 
56913 function (initialState, dataType, size, numBanks, offsets) {
56914 if (numBanks != offsets.length) {
56915 throw  new ArrayIndexOutOfBoundsException ("Number of banks does not match number of bank offsets");
56916 }this.theTrackable = jssun.java2d.StateTrackableDelegate.createInstance (initialState);
56917 this.dataType = dataType;
56918 this.banks = numBanks;
56919 this.size = size;
56920 this.offset = offsets[0];
56921 this.offsets = offsets.clone ();
56922 }, "jssun.java2d.StateTrackable.State,~N,~N,~N,~A");
56923 Clazz_defineMethod (c$, "getDataType", 
56924 function () {
56925 return this.dataType;
56926 });
56927 Clazz_defineMethod (c$, "getSize", 
56928 function () {
56929 return this.size;
56930 });
56931 Clazz_defineMethod (c$, "getOffset", 
56932 function () {
56933 return this.offset;
56934 });
56935 Clazz_defineMethod (c$, "getOffsets", 
56936 function () {
56937 return this.offsets.clone ();
56938 });
56939 Clazz_defineMethod (c$, "getNumBanks", 
56940 function () {
56941 return this.banks;
56942 });
56943 Clazz_defineMethod (c$, "getElem", 
56944 function (i) {
56945 return this.getElem (0, i);
56946 }, "~N");
56947 Clazz_defineMethod (c$, "setElem", 
56948 function (i, val) {
56949 this.setElem (0, i, val);
56950 }, "~N,~N");
56951 Clazz_defineMethod (c$, "getElemFloat", 
56952 function (i) {
56953 return this.getElem (i);
56954 }, "~N");
56955 Clazz_defineMethod (c$, "getElemFloat", 
56956 function (bank, i) {
56957 return this.getElem (bank, i);
56958 }, "~N,~N");
56959 Clazz_defineMethod (c$, "setElemFloat", 
56960 function (i, val) {
56961 this.setElem (i, Clazz_floatToInt (val));
56962 }, "~N,~N");
56963 Clazz_defineMethod (c$, "setElemFloat", 
56964 function (bank, i, val) {
56965 this.setElem (bank, i, Clazz_floatToInt (val));
56966 }, "~N,~N,~N");
56967 Clazz_defineMethod (c$, "getElemDouble", 
56968 function (i) {
56969 return this.getElem (i);
56970 }, "~N");
56971 Clazz_defineMethod (c$, "getElemDouble", 
56972 function (bank, i) {
56973 return this.getElem (bank, i);
56974 }, "~N,~N");
56975 Clazz_defineMethod (c$, "setElemDouble", 
56976 function (i, val) {
56977 this.setElem (i, Clazz_doubleToInt (val));
56978 }, "~N,~N");
56979 Clazz_defineMethod (c$, "setElemDouble", 
56980 function (bank, i, val) {
56981 this.setElem (bank, i, Clazz_doubleToInt (val));
56982 }, "~N,~N,~N");
56983 c$.toIntArray = Clazz_defineMethod (c$, "toIntArray", 
56984 function (obj) {
56985 if (Clazz_instanceOf (obj, Array)) {
56986 return obj;
56987 } else if (obj == null) {
56988 return null;
56989 } else if (Clazz_instanceOf (obj, Array)) {
56990 var sdata = obj;
56991 var idata =  Clazz_newIntArray (sdata.length, 0);
56992 for (var i = 0; i < sdata.length; i++) {
56993 idata[i] = sdata[i] & 0xffff;
56994 }
56995 return idata;
56996 } else if (Clazz_instanceOf (obj, Array)) {
56997 var bdata = obj;
56998 var idata =  Clazz_newIntArray (bdata.length, 0);
56999 for (var i = 0; i < bdata.length; i++) {
57000 idata[i] = 0xff & bdata[i];
57001 }
57002 return idata;
57003 }return null;
57004 }, "~O");
57005 Clazz_defineStatics (c$,
57006 "TYPE_BYTE", 0,
57007 "TYPE_SHORT", 2,
57008 "TYPE_INT", 3,
57009 "TYPE_UNDEFINED", 32,
57010 "dataTypeSize",  Clazz_newIntArray (-1, [8, 16, 16, 32, 32, 64]));
57011 });
57012 Clazz_declarePackage ("jssun.java2d");
57013 Clazz_load (["java.lang.Enum"], "jssun.java2d.StateTrackable", null, function () {
57014 Clazz_declareInterface (jssun.java2d, "StateTrackable");
57015 Clazz_pu$h(self.c$);
57016 c$ = Clazz_declareType (jssun.java2d.StateTrackable, "State", Enum);
57017 Clazz_defineEnumConstant (c$, "IMMUTABLE", 0, []);
57018 Clazz_defineEnumConstant (c$, "STABLE", 1, []);
57019 Clazz_defineEnumConstant (c$, "DYNAMIC", 2, []);
57020 Clazz_defineEnumConstant (c$, "UNTRACKABLE", 3, []);
57021 c$ = Clazz_p0p ();
57022 });
57023 Clazz_declarePackage ("jssun.java2d");
57024 Clazz_load (["jssun.java2d.StateTrackable"], "jssun.java2d.StateTrackableDelegate", ["java.lang.IllegalStateException", "$.InternalError", "jssun.java2d.StateTracker"], function () {
57025 c$ = Clazz_decorateAsClass (function () {
57026 this.theState = null;
57027 this.theTracker = null;
57028 this.numDynamicAgents = 0;
57029 Clazz_instantialize (this, arguments);
57030 }, jssun.java2d, "StateTrackableDelegate", null, jssun.java2d.StateTrackable);
57031 c$.createInstance = Clazz_defineMethod (c$, "createInstance", 
57032 function (state) {
57033 switch (state) {
57034 case jssun.java2d.StateTrackable.State.UNTRACKABLE:
57035 return jssun.java2d.StateTrackableDelegate.UNTRACKABLE_DELEGATE;
57036 case jssun.java2d.StateTrackable.State.STABLE:
57037 return  new jssun.java2d.StateTrackableDelegate (jssun.java2d.StateTrackable.State.STABLE);
57038 case jssun.java2d.StateTrackable.State.DYNAMIC:
57039 return  new jssun.java2d.StateTrackableDelegate (jssun.java2d.StateTrackable.State.DYNAMIC);
57040 case jssun.java2d.StateTrackable.State.IMMUTABLE:
57041 return jssun.java2d.StateTrackableDelegate.IMMUTABLE_DELEGATE;
57042 default:
57043 throw  new InternalError ("unknown state");
57044 }
57045 }, "jssun.java2d.StateTrackable.State");
57046 Clazz_makeConstructor (c$, 
57047  function (state) {
57048 this.theState = state;
57049 }, "jssun.java2d.StateTrackable.State");
57050 Clazz_overrideMethod (c$, "getState", 
57051 function () {
57052 return this.theState;
57053 });
57054 Clazz_overrideMethod (c$, "getStateTracker", 
57055 function () {
57056 var st = this.theTracker;
57057 if (st == null) {
57058 switch (this.theState) {
57059 case jssun.java2d.StateTrackable.State.IMMUTABLE:
57060 st = jssun.java2d.StateTracker.ALWAYS_CURRENT;
57061 break;
57062 case jssun.java2d.StateTrackable.State.STABLE:
57063 st = ((Clazz_isClassDefined ("jssun.java2d.StateTrackableDelegate$1") ? 0 : jssun.java2d.StateTrackableDelegate.$StateTrackableDelegate$1$ ()), Clazz_innerTypeInstance (jssun.java2d.StateTrackableDelegate$1, this, null));
57064 break;
57065 case jssun.java2d.StateTrackable.State.DYNAMIC:
57066 case jssun.java2d.StateTrackable.State.UNTRACKABLE:
57067 st = jssun.java2d.StateTracker.NEVER_CURRENT;
57068 break;
57069 }
57070 this.theTracker = st;
57071 }return st;
57072 });
57073 Clazz_defineMethod (c$, "setImmutable", 
57074 function () {
57075 if (this.theState === jssun.java2d.StateTrackable.State.UNTRACKABLE || this.theState === jssun.java2d.StateTrackable.State.DYNAMIC) {
57076 throw  new IllegalStateException ("UNTRACKABLE or DYNAMIC objects cannot become IMMUTABLE");
57077 }this.theState = jssun.java2d.StateTrackable.State.IMMUTABLE;
57078 this.theTracker = null;
57079 });
57080 Clazz_defineMethod (c$, "setUntrackable", 
57081 function () {
57082 if (this.theState === jssun.java2d.StateTrackable.State.IMMUTABLE) {
57083 throw  new IllegalStateException ("IMMUTABLE objects cannot become UNTRACKABLE");
57084 }this.theState = jssun.java2d.StateTrackable.State.UNTRACKABLE;
57085 this.theTracker = null;
57086 });
57087 Clazz_defineMethod (c$, "addDynamicAgent", 
57088 function () {
57089 if (this.theState === jssun.java2d.StateTrackable.State.IMMUTABLE) {
57090 throw  new IllegalStateException ("Cannot change state from IMMUTABLE");
57091 }++this.numDynamicAgents;
57092 if (this.theState === jssun.java2d.StateTrackable.State.STABLE) {
57093 this.theState = jssun.java2d.StateTrackable.State.DYNAMIC;
57094 this.theTracker = null;
57095 }});
57096 Clazz_defineMethod (c$, "removeDynamicAgent", 
57097 function () {
57098 if (--this.numDynamicAgents == 0 && this.theState === jssun.java2d.StateTrackable.State.DYNAMIC) {
57099 this.theState = jssun.java2d.StateTrackable.State.STABLE;
57100 this.theTracker = null;
57101 }});
57102 Clazz_defineMethod (c$, "markDirty", 
57103 function () {
57104 this.theTracker = null;
57105 });
57106 c$.$StateTrackableDelegate$1$ = function () {
57107 Clazz_pu$h(self.c$);
57108 c$ = Clazz_declareAnonymous (jssun.java2d, "StateTrackableDelegate$1", null, jssun.java2d.StateTracker);
57109 Clazz_overrideMethod (c$, "isCurrent", 
57110 function () {
57111 return (this.b$["jssun.java2d.StateTrackableDelegate"].theTracker === this);
57112 });
57113 c$ = Clazz_p0p ();
57114 };
57115 c$.UNTRACKABLE_DELEGATE = c$.prototype.UNTRACKABLE_DELEGATE =  new jssun.java2d.StateTrackableDelegate (jssun.java2d.StateTrackable.State.UNTRACKABLE);
57116 c$.IMMUTABLE_DELEGATE = c$.prototype.IMMUTABLE_DELEGATE =  new jssun.java2d.StateTrackableDelegate (jssun.java2d.StateTrackable.State.IMMUTABLE);
57117 });
57118 Clazz_declarePackage ("jssun.java2d");
57119 c$ = Clazz_declareInterface (jssun.java2d, "StateTracker");
57120 c$.$StateTracker$1$ = function () {
57121 Clazz_pu$h(self.c$);
57122 c$ = Clazz_declareAnonymous (jssun.java2d, "StateTracker$1", null, jssun.java2d.StateTracker);
57123 Clazz_overrideMethod (c$, "isCurrent", 
57124 function () {
57125 return true;
57126 });
57127 c$ = Clazz_p0p ();
57128 };
57129 c$.$StateTracker$2$ = function () {
57130 Clazz_pu$h(self.c$);
57131 c$ = Clazz_declareAnonymous (jssun.java2d, "StateTracker$2", null, jssun.java2d.StateTracker);
57132 Clazz_overrideMethod (c$, "isCurrent", 
57133 function () {
57134 return false;
57135 });
57136 c$ = Clazz_p0p ();
57137 };
57138 c$.ALWAYS_CURRENT = c$.prototype.ALWAYS_CURRENT = ((Clazz_isClassDefined ("jssun.java2d.StateTracker$1") ? 0 : jssun.java2d.StateTracker.$StateTracker$1$ ()), Clazz_innerTypeInstance (jssun.java2d.StateTracker$1, this, null));
57139 c$.NEVER_CURRENT = c$.prototype.NEVER_CURRENT = ((Clazz_isClassDefined ("jssun.java2d.StateTracker$2") ? 0 : jssun.java2d.StateTracker.$StateTracker$2$ ()), Clazz_innerTypeInstance (jssun.java2d.StateTracker$2, this, null));
57140 Clazz_declarePackage ("java.awt.image");
57141 Clazz_load (["java.awt.image.DataBuffer"], "java.awt.image.DataBufferByte", ["JU.AU", "jssun.java2d.StateTrackable"], function () {
57142 c$ = Clazz_decorateAsClass (function () {
57143 this.data = null;
57144 this.bankdata = null;
57145 Clazz_instantialize (this, arguments);
57146 }, java.awt.image, "DataBufferByte", java.awt.image.DataBuffer);
57147 Clazz_makeConstructor (c$, 
57148 function (size) {
57149 Clazz_superConstructor (this, java.awt.image.DataBufferByte, [jssun.java2d.StateTrackable.State.STABLE, 0, size]);
57150 this.data =  Clazz_newByteArray (size, 0);
57151 this.bankdata =  Clazz_newByteArray (1, 0);
57152 this.bankdata[0] = this.data;
57153 }, "~N");
57154 Clazz_makeConstructor (c$, 
57155 function (size, numBanks) {
57156 Clazz_superConstructor (this, java.awt.image.DataBufferByte, [jssun.java2d.StateTrackable.State.STABLE, 0, size, numBanks]);
57157 this.bankdata =  Clazz_newByteArray (numBanks, 0);
57158 for (var i = 0; i < numBanks; i++) {
57159 this.bankdata[i] =  Clazz_newByteArray (size, 0);
57160 }
57161 this.data = this.bankdata[0];
57162 }, "~N,~N");
57163 Clazz_makeConstructor (c$, 
57164 function (dataArray, size) {
57165 Clazz_superConstructor (this, java.awt.image.DataBufferByte, [jssun.java2d.StateTrackable.State.UNTRACKABLE, 0, size]);
57166 if (JU.AU.isAI (dataArray)) {
57167 this.data = dataArray;
57168 this.bankdata =  Clazz_newByteArray (1, 0);
57169 this.bankdata[0] = this.data;
57170 } else {
57171 this.banks = dataArray.length;
57172 this.bankdata = dataArray.clone ();
57173 this.data = this.bankdata[0];
57174 }}, "~A,~N");
57175 Clazz_makeConstructor (c$, 
57176 function (dataArray, size, offset) {
57177 Clazz_superConstructor (this, java.awt.image.DataBufferByte, [jssun.java2d.StateTrackable.State.UNTRACKABLE, 0, size, 1, offset]);
57178 this.data = dataArray;
57179 this.bankdata =  Clazz_newByteArray (1, 0);
57180 this.bankdata[0] = this.data;
57181 }, "~A,~N,~N");
57182 Clazz_makeConstructor (c$, 
57183 function (dataArray, size, offsets) {
57184 Clazz_superConstructor (this, java.awt.image.DataBufferByte, [jssun.java2d.StateTrackable.State.UNTRACKABLE, 0, size, dataArray.length, offsets]);
57185 this.bankdata = dataArray.clone ();
57186 this.data = this.bankdata[0];
57187 }, "~A,~N,~A");
57188 Clazz_defineMethod (c$, "getData", 
57189 function () {
57190 this.theTrackable.setUntrackable ();
57191 return this.data;
57192 });
57193 Clazz_defineMethod (c$, "getData", 
57194 function (bank) {
57195 this.theTrackable.setUntrackable ();
57196 return this.bankdata[bank];
57197 }, "~N");
57198 Clazz_defineMethod (c$, "getBankData", 
57199 function () {
57200 this.theTrackable.setUntrackable ();
57201 return this.bankdata.clone ();
57202 });
57203 Clazz_defineMethod (c$, "getElem", 
57204 function (i) {
57205 return (this.data[i + this.offset]) & 0xff;
57206 }, "~N");
57207 Clazz_defineMethod (c$, "getElem", 
57208 function (bank, i) {
57209 return (this.bankdata[bank][i + this.offsets[bank]]) & 0xff;
57210 }, "~N,~N");
57211 Clazz_defineMethod (c$, "setElem", 
57212 function (i, val) {
57213 this.data[i + this.offset] = val;
57214 this.theTrackable.markDirty ();
57215 }, "~N,~N");
57216 Clazz_defineMethod (c$, "setElem", 
57217 function (bank, i, val) {
57218 this.bankdata[bank][i + this.offsets[bank]] = val;
57219 this.theTrackable.markDirty ();
57220 }, "~N,~N,~N");
57221 });
57222 Clazz_declarePackage ("java.awt.image");
57223 Clazz_load (["java.awt.image.DataBuffer"], "java.awt.image.DataBufferInt", ["JU.AU", "jssun.java2d.StateTrackable"], function () {
57224 c$ = Clazz_decorateAsClass (function () {
57225 this.data = null;
57226 this.bankdata = null;
57227 Clazz_instantialize (this, arguments);
57228 }, java.awt.image, "DataBufferInt", java.awt.image.DataBuffer);
57229 Clazz_makeConstructor (c$, 
57230 function (size) {
57231 Clazz_superConstructor (this, java.awt.image.DataBufferInt, [jssun.java2d.StateTrackable.State.STABLE, 3, size]);
57232 this.data =  Clazz_newIntArray (size, 0);
57233 this.bankdata =  Clazz_newIntArray (1, 0);
57234 this.bankdata[0] = this.data;
57235 }, "~N");
57236 Clazz_makeConstructor (c$, 
57237 function (size, numBanks) {
57238 Clazz_superConstructor (this, java.awt.image.DataBufferInt, [jssun.java2d.StateTrackable.State.STABLE, 3, size, numBanks]);
57239 this.bankdata =  Clazz_newIntArray (numBanks, 0);
57240 for (var i = 0; i < numBanks; i++) {
57241 this.bankdata[i] =  Clazz_newIntArray (size, 0);
57242 }
57243 this.data = this.bankdata[0];
57244 }, "~N,~N");
57245 Clazz_makeConstructor (c$, 
57246 function (dataArray, size) {
57247 Clazz_superConstructor (this, java.awt.image.DataBufferInt, [jssun.java2d.StateTrackable.State.UNTRACKABLE, 3, size]);
57248 if (JU.AU.isAI (dataArray)) {
57249 this.data = dataArray;
57250 this.bankdata =  Clazz_newIntArray (1, 0);
57251 this.bankdata[0] = this.data;
57252 } else {
57253 this.banks = dataArray.length;
57254 this.bankdata = dataArray.clone ();
57255 this.data = this.bankdata[0];
57256 }}, "~A,~N");
57257 Clazz_makeConstructor (c$, 
57258 function (dataArray, size, offset) {
57259 Clazz_superConstructor (this, java.awt.image.DataBufferInt, [jssun.java2d.StateTrackable.State.UNTRACKABLE, 3, size, 1, offset]);
57260 this.data = dataArray;
57261 this.bankdata =  Clazz_newIntArray (1, 0);
57262 this.bankdata[0] = this.data;
57263 }, "~A,~N,~N");
57264 Clazz_makeConstructor (c$, 
57265 function (dataArray, size, offsets) {
57266 Clazz_superConstructor (this, java.awt.image.DataBufferInt, [jssun.java2d.StateTrackable.State.UNTRACKABLE, 3, size, dataArray.length, offsets]);
57267 this.bankdata = dataArray.clone ();
57268 this.data = this.bankdata[0];
57269 }, "~A,~N,~A");
57270 Clazz_defineMethod (c$, "getData", 
57271 function () {
57272 this.theTrackable.setUntrackable ();
57273 return this.data;
57274 });
57275 Clazz_defineMethod (c$, "getData", 
57276 function (bank) {
57277 this.theTrackable.setUntrackable ();
57278 return this.bankdata[bank];
57279 }, "~N");
57280 Clazz_defineMethod (c$, "getBankData", 
57281 function () {
57282 this.theTrackable.setUntrackable ();
57283 return this.bankdata.clone ();
57284 });
57285 Clazz_defineMethod (c$, "getElem", 
57286 function (i) {
57287 return this.data[i + this.offset];
57288 }, "~N");
57289 Clazz_defineMethod (c$, "getElem", 
57290 function (bank, i) {
57291 return this.bankdata[bank][i + this.offsets[bank]];
57292 }, "~N,~N");
57293 Clazz_defineMethod (c$, "setElem", 
57294 function (i, val) {
57295 this.data[i + this.offset] = val;
57296 this.theTrackable.markDirty ();
57297 }, "~N,~N");
57298 Clazz_defineMethod (c$, "setElem", 
57299 function (bank, i, val) {
57300 this.bankdata[bank][i + this.offsets[bank]] = val;
57301 this.theTrackable.markDirty ();
57302 }, "~N,~N,~N");
57303 });
57304 Clazz_declarePackage ("java.awt.image");
57305 Clazz_load (["java.lang.RuntimeException"], "java.awt.image.RasterFormatException", null, function () {
57306 c$ = Clazz_declareType (java.awt.image, "RasterFormatException", RuntimeException);
57307 });
57308 Clazz_declarePackage ("java.awt.image");
57309 Clazz_load (["java.awt.image.SampleModel"], "java.awt.image.SinglePixelPackedSampleModel", ["java.lang.ArrayIndexOutOfBoundsException", "$.IllegalArgumentException", "java.util.Arrays", "java.awt.image.DataBufferByte", "$.DataBufferInt", "$.RasterFormatException"], function () {
57310 c$ = Clazz_decorateAsClass (function () {
57311 this.bitMasks = null;
57312 this.bitOffsets = null;
57313 this.bitSizes = null;
57314 this.maxBitSize = 0;
57315 this.scanlineStride = 0;
57316 Clazz_instantialize (this, arguments);
57317 }, java.awt.image, "SinglePixelPackedSampleModel", java.awt.image.SampleModel);
57318 Clazz_makeConstructor (c$, 
57319 function (dataType, w, h, bitMasks) {
57320 this.construct (dataType, w, h, w, bitMasks);
57321 if (dataType != 0 && dataType != 3) {
57322 throw  new IllegalArgumentException ("Unsupported data type " + dataType);
57323 }}, "~N,~N,~N,~A");
57324 Clazz_makeConstructor (c$, 
57325 function (dataType, w, h, scanlineStride, bitMasks) {
57326 Clazz_superConstructor (this, java.awt.image.SinglePixelPackedSampleModel, [dataType, w, h, bitMasks.length]);
57327 if (dataType != 0 && dataType != 3) {
57328 throw  new IllegalArgumentException ("Unsupported data type " + dataType);
57329 }this.dataType = dataType;
57330 this.bitMasks = bitMasks.clone ();
57331 this.scanlineStride = scanlineStride;
57332 this.bitOffsets =  Clazz_newIntArray (this.numBands, 0);
57333 this.bitSizes =  Clazz_newIntArray (this.numBands, 0);
57334 this.maxBitSize = 0;
57335 for (var i = 0; i < this.numBands; i++) {
57336 var bitOffset = 0;
57337 var bitSize = 0;
57338 var mask;
57339 mask = bitMasks[i];
57340 if (mask != 0) {
57341 while ((mask & 1) == 0) {
57342 mask = mask >>> 1;
57343 bitOffset++;
57344 }
57345 while ((mask & 1) == 1) {
57346 mask = mask >>> 1;
57347 bitSize++;
57348 }
57349 if (mask != 0) {
57350 throw  new IllegalArgumentException ("Mask " + bitMasks[i] + " must be contiguous");
57351 }}this.bitOffsets[i] = bitOffset;
57352 this.bitSizes[i] = bitSize;
57353 if (bitSize > this.maxBitSize) {
57354 this.maxBitSize = bitSize;
57355 }}
57356 }, "~N,~N,~N,~N,~A");
57357 Clazz_overrideMethod (c$, "getNumDataElements", 
57358 function () {
57359 return 1;
57360 });
57361 Clazz_defineMethod (c$, "getBufferSize", 
57362  function () {
57363 var size = this.scanlineStride * (this.height - 1) + this.width;
57364 return size;
57365 });
57366 Clazz_overrideMethod (c$, "createCompatibleSampleModel", 
57367 function (w, h) {
57368 var sampleModel =  new java.awt.image.SinglePixelPackedSampleModel (this.dataType, w, h, this.bitMasks);
57369 return sampleModel;
57370 }, "~N,~N");
57371 Clazz_overrideMethod (c$, "createDataBuffer", 
57372 function () {
57373 var dataBuffer = null;
57374 var size = this.getBufferSize ();
57375 switch (this.dataType) {
57376 case 0:
57377 dataBuffer =  new java.awt.image.DataBufferByte (size);
57378 break;
57379 case 3:
57380 dataBuffer =  new java.awt.image.DataBufferInt (size);
57381 break;
57382 }
57383 return dataBuffer;
57384 });
57385 Clazz_defineMethod (c$, "getSampleSize", 
57386 function () {
57387 var mask;
57388 var sampleSize =  Clazz_newIntArray (this.numBands, 0);
57389 for (var i = 0; i < this.numBands; i++) {
57390 sampleSize[i] = 0;
57391 mask = this.bitMasks[i] >>> this.bitOffsets[i];
57392 while ((mask & 1) != 0) {
57393 sampleSize[i]++;
57394 mask = mask >>> 1;
57395 }
57396 }
57397 return sampleSize;
57398 });
57399 Clazz_defineMethod (c$, "getSampleSize", 
57400 function (band) {
57401 var sampleSize = 0;
57402 var mask = this.bitMasks[band] >>> this.bitOffsets[band];
57403 while ((mask & 1) != 0) {
57404 sampleSize++;
57405 mask = mask >>> 1;
57406 }
57407 return sampleSize;
57408 }, "~N");
57409 Clazz_defineMethod (c$, "getOffset", 
57410 function (x, y) {
57411 var offset = y * this.scanlineStride + x;
57412 return offset;
57413 }, "~N,~N");
57414 Clazz_defineMethod (c$, "getBitOffsets", 
57415 function () {
57416 return this.bitOffsets.clone ();
57417 });
57418 Clazz_defineMethod (c$, "getBitMasks", 
57419 function () {
57420 return this.bitMasks.clone ();
57421 });
57422 Clazz_defineMethod (c$, "getScanlineStride", 
57423 function () {
57424 return this.scanlineStride;
57425 });
57426 Clazz_overrideMethod (c$, "createSubsetSampleModel", 
57427 function (bands) {
57428 if (bands.length > this.numBands) throw  new java.awt.image.RasterFormatException ("There are only " + this.numBands + " bands");
57429 var newBitMasks =  Clazz_newIntArray (bands.length, 0);
57430 for (var i = 0; i < bands.length; i++) newBitMasks[i] = this.bitMasks[bands[i]];
57431
57432 return  new java.awt.image.SinglePixelPackedSampleModel (this.dataType, this.width, this.height, this.scanlineStride, newBitMasks);
57433 }, "~A");
57434 Clazz_defineMethod (c$, "getDataElements", 
57435 function (x, y, obj, data) {
57436 if ((x < 0) || (y < 0) || (x >= this.width) || (y >= this.height)) {
57437 throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
57438 }var type = this.getTransferType ();
57439 switch (type) {
57440 case 0:
57441 var bdata;
57442 if (obj == null) bdata =  Clazz_newByteArray (1, 0);
57443  else bdata = obj;
57444 bdata[0] = data.getElem (y * this.scanlineStride + x);
57445 obj = bdata;
57446 break;
57447 case 3:
57448 var idata;
57449 if (obj == null) idata =  Clazz_newIntArray (1, 0);
57450  else idata = obj;
57451 idata[0] = data.getElem (y * this.scanlineStride + x);
57452 obj = idata;
57453 break;
57454 }
57455 return obj;
57456 }, "~N,~N,~O,java.awt.image.DataBuffer");
57457 Clazz_defineMethod (c$, "getPixel", 
57458 function (x, y, iArray, data) {
57459 if ((x < 0) || (y < 0) || (x >= this.width) || (y >= this.height)) {
57460 throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
57461 }var pixels;
57462 if (iArray == null) {
57463 pixels =  Clazz_newIntArray (this.numBands, 0);
57464 } else {
57465 pixels = iArray;
57466 }var value = data.getElem (y * this.scanlineStride + x);
57467 for (var i = 0; i < this.numBands; i++) {
57468 pixels[i] = (value & this.bitMasks[i]) >>> this.bitOffsets[i];
57469 }
57470 return pixels;
57471 }, "~N,~N,~A,java.awt.image.DataBuffer");
57472 Clazz_defineMethod (c$, "getPixels", 
57473 function (x, y, w, h, iArray, data) {
57474 if ((x < 0) || (y < 0) || (x + w > this.width) || (y + h > this.height)) {
57475 throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
57476 }var pixels;
57477 if (iArray != null) {
57478 pixels = iArray;
57479 } else {
57480 pixels =  Clazz_newIntArray (w * h * this.numBands, 0);
57481 }var lineOffset = y * this.scanlineStride + x;
57482 var dstOffset = 0;
57483 for (var i = 0; i < h; i++) {
57484 for (var j = 0; j < w; j++) {
57485 var value = data.getElem (lineOffset + j);
57486 for (var k = 0; k < this.numBands; k++) {
57487 pixels[dstOffset++] = ((value & this.bitMasks[k]) >>> this.bitOffsets[k]);
57488 }
57489 }
57490 lineOffset += this.scanlineStride;
57491 }
57492 return pixels;
57493 }, "~N,~N,~N,~N,~A,java.awt.image.DataBuffer");
57494 Clazz_overrideMethod (c$, "getSample", 
57495 function (x, y, b, data) {
57496 if ((x < 0) || (y < 0) || (x >= this.width) || (y >= this.height)) {
57497 throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
57498 }var sample = data.getElem (y * this.scanlineStride + x);
57499 return ((sample & this.bitMasks[b]) >>> this.bitOffsets[b]);
57500 }, "~N,~N,~N,java.awt.image.DataBuffer");
57501 Clazz_defineMethod (c$, "getSamples", 
57502 function (x, y, w, h, b, iArray, data) {
57503 if ((x < 0) || (y < 0) || (x + w > this.width) || (y + h > this.height)) {
57504 throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
57505 }var samples;
57506 if (iArray != null) {
57507 samples = iArray;
57508 } else {
57509 samples =  Clazz_newIntArray (w * h, 0);
57510 }var lineOffset = y * this.scanlineStride + x;
57511 var dstOffset = 0;
57512 for (var i = 0; i < h; i++) {
57513 for (var j = 0; j < w; j++) {
57514 var value = data.getElem (lineOffset + j);
57515 samples[dstOffset++] = ((value & this.bitMasks[b]) >>> this.bitOffsets[b]);
57516 }
57517 lineOffset += this.scanlineStride;
57518 }
57519 return samples;
57520 }, "~N,~N,~N,~N,~N,~A,java.awt.image.DataBuffer");
57521 Clazz_defineMethod (c$, "setDataElements", 
57522 function (x, y, obj, data) {
57523 if ((x < 0) || (y < 0) || (x >= this.width) || (y >= this.height)) {
57524 throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
57525 }var type = this.getTransferType ();
57526 switch (type) {
57527 case 0:
57528 var barray = obj;
57529 data.setElem (y * this.scanlineStride + x, (barray[0]) & 0xff);
57530 break;
57531 case 3:
57532 var iarray = obj;
57533 data.setElem (y * this.scanlineStride + x, iarray[0]);
57534 break;
57535 }
57536 }, "~N,~N,~O,java.awt.image.DataBuffer");
57537 Clazz_defineMethod (c$, "setPixel", 
57538 function (x, y, iArray, data) {
57539 if ((x < 0) || (y < 0) || (x >= this.width) || (y >= this.height)) {
57540 throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
57541 }var lineOffset = y * this.scanlineStride + x;
57542 var value = data.getElem (lineOffset);
57543 for (var i = 0; i < this.numBands; i++) {
57544 value &= ~this.bitMasks[i];
57545 value |= ((iArray[i] << this.bitOffsets[i]) & this.bitMasks[i]);
57546 }
57547 data.setElem (lineOffset, value);
57548 }, "~N,~N,~A,java.awt.image.DataBuffer");
57549 Clazz_defineMethod (c$, "setPixels", 
57550 function (x, y, w, h, iArray, data) {
57551 if ((x < 0) || (y < 0) || (x + w > this.width) || (y + h > this.height)) {
57552 throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
57553 }var lineOffset = y * this.scanlineStride + x;
57554 var srcOffset = 0;
57555 for (var i = 0; i < h; i++) {
57556 for (var j = 0; j < w; j++) {
57557 var value = data.getElem (lineOffset + j);
57558 for (var k = 0; k < this.numBands; k++) {
57559 value &= ~this.bitMasks[k];
57560 var srcValue = iArray[srcOffset++];
57561 value |= ((srcValue << this.bitOffsets[k]) & this.bitMasks[k]);
57562 }
57563 data.setElem (lineOffset + j, value);
57564 }
57565 lineOffset += this.scanlineStride;
57566 }
57567 }, "~N,~N,~N,~N,~A,java.awt.image.DataBuffer");
57568 Clazz_defineMethod (c$, "setSample", 
57569 function (x, y, b, s, data) {
57570 if ((x < 0) || (y < 0) || (x >= this.width) || (y >= this.height)) {
57571 throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
57572 }var value = data.getElem (y * this.scanlineStride + x);
57573 value &= ~this.bitMasks[b];
57574 value |= (s << this.bitOffsets[b]) & this.bitMasks[b];
57575 data.setElem (y * this.scanlineStride + x, value);
57576 }, "~N,~N,~N,~N,java.awt.image.DataBuffer");
57577 Clazz_defineMethod (c$, "setSamples", 
57578 function (x, y, w, h, b, iArray, data) {
57579 if ((x < 0) || (y < 0) || (x + w > this.width) || (y + h > this.height)) {
57580 throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
57581 }var lineOffset = y * this.scanlineStride + x;
57582 var srcOffset = 0;
57583 for (var i = 0; i < h; i++) {
57584 for (var j = 0; j < w; j++) {
57585 var value = data.getElem (lineOffset + j);
57586 value &= ~this.bitMasks[b];
57587 var sample = iArray[srcOffset++];
57588 value |= (sample << this.bitOffsets[b]) & this.bitMasks[b];
57589 data.setElem (lineOffset + j, value);
57590 }
57591 lineOffset += this.scanlineStride;
57592 }
57593 }, "~N,~N,~N,~N,~N,~A,java.awt.image.DataBuffer");
57594 Clazz_overrideMethod (c$, "equals", 
57595 function (o) {
57596 if ((o == null) || !(Clazz_instanceOf (o, java.awt.image.SinglePixelPackedSampleModel))) {
57597 return false;
57598 }var that = o;
57599 return this.width == that.width && this.height == that.height && this.numBands == that.numBands && this.dataType == that.dataType && java.util.Arrays.equals (this.bitMasks, that.bitMasks) && java.util.Arrays.equals (this.bitOffsets, that.bitOffsets) && java.util.Arrays.equals (this.bitSizes, that.bitSizes) && this.maxBitSize == that.maxBitSize && this.scanlineStride == that.scanlineStride;
57600 }, "~O");
57601 Clazz_overrideMethod (c$, "hashCode", 
57602 function () {
57603 var hash = 0;
57604 hash = this.width;
57605 hash <<= 8;
57606 hash ^= this.height;
57607 hash <<= 8;
57608 hash ^= this.numBands;
57609 hash <<= 8;
57610 hash ^= this.dataType;
57611 hash <<= 8;
57612 for (var i = 0; i < this.bitMasks.length; i++) {
57613 hash ^= this.bitMasks[i];
57614 hash <<= 8;
57615 }
57616 for (var i = 0; i < this.bitOffsets.length; i++) {
57617 hash ^= this.bitOffsets[i];
57618 hash <<= 8;
57619 }
57620 for (var i = 0; i < this.bitSizes.length; i++) {
57621 hash ^= this.bitSizes[i];
57622 hash <<= 8;
57623 }
57624 hash ^= this.maxBitSize;
57625 hash <<= 8;
57626 hash ^= this.scanlineStride;
57627 return hash;
57628 });
57629 });
57630 Clazz_declarePackage ("jssun.awt.image");
57631 Clazz_load (["java.awt.image.ImageProducer"], "jssun.awt.image.OffScreenImageSource", ["java.util.Hashtable"], function () {
57632 c$ = Clazz_decorateAsClass (function () {
57633 this.image = null;
57634 this.width = 0;
57635 this.height = 0;
57636 this.properties = null;
57637 this.theConsumer = null;
57638 Clazz_instantialize (this, arguments);
57639 }, jssun.awt.image, "OffScreenImageSource", null, java.awt.image.ImageProducer);
57640 Clazz_makeConstructor (c$, 
57641 function (image, properties) {
57642 this.image = image;
57643 if (properties != null) {
57644 this.properties = properties;
57645 } else {
57646 this.properties =  new java.util.Hashtable ();
57647 }this.width = image.getWidth ();
57648 this.height = image.getHeight ();
57649 }, "java.awt.image.BufferedImage,java.util.Hashtable");
57650 Clazz_makeConstructor (c$, 
57651 function (image) {
57652 this.construct (image, null);
57653 }, "java.awt.image.BufferedImage");
57654 Clazz_overrideMethod (c$, "addConsumer", 
57655 function (ic) {
57656 this.theConsumer = ic;
57657 this.produce ();
57658 }, "java.awt.image.ImageConsumer");
57659 Clazz_overrideMethod (c$, "isConsumer", 
57660 function (ic) {
57661 return (ic === this.theConsumer);
57662 }, "java.awt.image.ImageConsumer");
57663 Clazz_overrideMethod (c$, "removeConsumer", 
57664 function (ic) {
57665 if (this.theConsumer === ic) {
57666 this.theConsumer = null;
57667 }}, "java.awt.image.ImageConsumer");
57668 Clazz_overrideMethod (c$, "startProduction", 
57669 function (ic) {
57670 this.addConsumer (ic);
57671 }, "java.awt.image.ImageConsumer");
57672 Clazz_overrideMethod (c$, "requestTopDownLeftRightResend", 
57673 function (ic) {
57674 }, "java.awt.image.ImageConsumer");
57675 Clazz_defineMethod (c$, "sendPixels", 
57676  function () {
57677 var cm = this.image.getColorModel ();
57678 });
57679 Clazz_defineMethod (c$, "produce", 
57680  function () {
57681 try {
57682 this.theConsumer.setDimensions (this.image.getWidth (), this.image.getHeight ());
57683 this.theConsumer.setProperties (this.properties);
57684 this.sendPixels ();
57685 this.theConsumer.imageComplete (2);
57686 } catch (e) {
57687 if (Clazz_exceptionOf (e, NullPointerException)) {
57688 if (this.theConsumer != null) {
57689 this.theConsumer.imageComplete (1);
57690 }} else {
57691 throw e;
57692 }
57693 }
57694 });
57695 });
57696 Clazz_declarePackage ("java.awt.image");
57697 Clazz_load (["java.awt.image.Raster"], "java.awt.image.WritableRaster", ["java.lang.ArrayIndexOutOfBoundsException", "java.awt.Point", "$.Rectangle", "java.awt.image.RasterFormatException"], function () {
57698 c$ = Clazz_declareType (java.awt.image, "WritableRaster", java.awt.image.Raster);
57699 Clazz_defineMethod (c$, "setParams", 
57700 function (model, dataBuffer, origin) {
57701 }, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Point");
57702 Clazz_makeConstructor (c$, 
57703 function () {
57704 Clazz_superConstructor (this, java.awt.image.WritableRaster, []);
57705 });
57706 Clazz_makeConstructor (c$, 
57707 function (sampleModel, origin) {
57708 Clazz_superConstructor (this, java.awt.image.WritableRaster, []);
57709 this.setRaster (sampleModel, sampleModel.createDataBuffer (),  new java.awt.Rectangle (origin.x, origin.y, sampleModel.getWidth (), sampleModel.getHeight ()), origin, null);
57710 }, "java.awt.image.SampleModel,java.awt.Point");
57711 Clazz_makeConstructor (c$, 
57712 function (sampleModel, dataBuffer, origin) {
57713 Clazz_superConstructor (this, java.awt.image.WritableRaster, []);
57714 this.setRaster (sampleModel, dataBuffer,  new java.awt.Rectangle (origin.x, origin.y, sampleModel.getWidth (), sampleModel.getHeight ()), origin, null);
57715 }, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Point");
57716 Clazz_makeConstructor (c$, 
57717 function (sampleModel, dataBuffer, aRegion, sampleModelTranslate, parent) {
57718 Clazz_superConstructor (this, java.awt.image.WritableRaster, []);
57719 this.setRaster (sampleModel, dataBuffer, aRegion, sampleModelTranslate, parent);
57720 }, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Rectangle,java.awt.Point,java.awt.image.Raster");
57721 Clazz_defineMethod (c$, "getWritableParent", 
57722 function () {
57723 return this.parent;
57724 });
57725 Clazz_defineMethod (c$, "createWritableTranslatedChild", 
57726 function (childMinX, childMinY) {
57727 return this.createWritableChild (this.minX, this.minY, this.width, this.height, childMinX, childMinY, null);
57728 }, "~N,~N");
57729 Clazz_defineMethod (c$, "createWritableChild", 
57730 function (parentX, parentY, w, h, childMinX, childMinY, bandList) {
57731 if (parentX < this.minX) {
57732 throw  new java.awt.image.RasterFormatException ("parentX lies outside raster");
57733 }if (parentY < this.minY) {
57734 throw  new java.awt.image.RasterFormatException ("parentY lies outside raster");
57735 }if ((parentX + w < parentX) || (parentX + w > this.width + this.minX)) {
57736 throw  new java.awt.image.RasterFormatException ("(parentX + width) is outside raster");
57737 }if ((parentY + h < parentY) || (parentY + h > this.height + this.minY)) {
57738 throw  new java.awt.image.RasterFormatException ("(parentY + height) is outside raster");
57739 }var sm;
57740 if (bandList != null) {
57741 sm = this.sampleModel.createSubsetSampleModel (bandList);
57742 } else {
57743 sm = this.sampleModel;
57744 }var deltaX = childMinX - parentX;
57745 var deltaY = childMinY - parentY;
57746 return  new java.awt.image.WritableRaster (sm, this.getDataBuffer (),  new java.awt.Rectangle (childMinX, childMinY, w, h),  new java.awt.Point (this.sampleModelTranslateX + deltaX, this.sampleModelTranslateY + deltaY), this);
57747 }, "~N,~N,~N,~N,~N,~N,~A");
57748 Clazz_defineMethod (c$, "setDataElements", 
57749 function (x, y, inData) {
57750 if (Clazz_instanceOf (inData, java.awt.image.Raster)) {
57751 this.setDataElementsRaster (x, y, inData);
57752 } else {
57753 this.sampleModel.setDataElements (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, inData, this.dataBuffer);
57754 }}, "~N,~N,~O");
57755 Clazz_defineMethod (c$, "setDataElementsRaster", 
57756 function (x, y, inRaster) {
57757 var dstOffX = x + inRaster.getMinX ();
57758 var dstOffY = y + inRaster.getMinY ();
57759 var width = inRaster.getWidth ();
57760 var height = inRaster.getHeight ();
57761 if ((dstOffX < this.minX) || (dstOffY < this.minY) || (dstOffX + width > this.minX + this.width) || (dstOffY + height > this.minY + this.height)) {
57762 throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
57763 }var srcOffX = inRaster.getMinX ();
57764 var srcOffY = inRaster.getMinY ();
57765 var tdata = null;
57766 for (var startY = 0; startY < height; startY++) {
57767 tdata = inRaster.getDataElements (srcOffX, srcOffY + startY, width, 1, tdata);
57768 this.setDataElements (dstOffX, dstOffY + startY, width, 1, tdata);
57769 }
57770 }, "~N,~N,java.awt.image.Raster");
57771 Clazz_defineMethod (c$, "setDataElements", 
57772 function (x, y, w, h, inData) {
57773 this.sampleModel.setDataElements (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, w, h, inData, this.dataBuffer);
57774 }, "~N,~N,~N,~N,~O");
57775 Clazz_defineMethod (c$, "setRect", 
57776 function (srcRaster) {
57777 this.setRect (0, 0, srcRaster);
57778 }, "java.awt.image.Raster");
57779 Clazz_defineMethod (c$, "setRect", 
57780 function (dx, dy, srcRaster) {
57781 var width = srcRaster.getWidth ();
57782 var height = srcRaster.getHeight ();
57783 var srcOffX = srcRaster.getMinX ();
57784 var srcOffY = srcRaster.getMinY ();
57785 var dstOffX = dx + srcOffX;
57786 var dstOffY = dy + srcOffY;
57787 if (dstOffX < this.minX) {
57788 var skipX = this.minX - dstOffX;
57789 width -= skipX;
57790 srcOffX += skipX;
57791 dstOffX = this.minX;
57792 }if (dstOffY < this.minY) {
57793 var skipY = this.minY - dstOffY;
57794 height -= skipY;
57795 srcOffY += skipY;
57796 dstOffY = this.minY;
57797 }if (dstOffX + width > this.minX + this.width) {
57798 width = this.minX + this.width - dstOffX;
57799 }if (dstOffY + height > this.minY + this.height) {
57800 height = this.minY + this.height - dstOffY;
57801 }if (width <= 0 || height <= 0) {
57802 return;
57803 }switch (srcRaster.getSampleModel ().getDataType ()) {
57804 case 0:
57805 case 3:
57806 var iData = null;
57807 for (var startY = 0; startY < height; startY++) {
57808 iData = srcRaster.getPixels (srcOffX, srcOffY + startY, width, 1, iData);
57809 this.setPixels (dstOffX, dstOffY + startY, width, 1, iData);
57810 }
57811 break;
57812 }
57813 }, "~N,~N,java.awt.image.Raster");
57814 Clazz_defineMethod (c$, "setPixel", 
57815 function (x, y, iArray) {
57816 this.sampleModel.setPixel (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, iArray, this.dataBuffer);
57817 }, "~N,~N,~A");
57818 Clazz_defineMethod (c$, "setPixel", 
57819 function (x, y, fArray) {
57820 this.sampleModel.setPixel (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, fArray, this.dataBuffer);
57821 }, "~N,~N,~A");
57822 Clazz_defineMethod (c$, "setPixel", 
57823 function (x, y, dArray) {
57824 this.sampleModel.setPixel (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, dArray, this.dataBuffer);
57825 }, "~N,~N,~A");
57826 Clazz_defineMethod (c$, "setPixels", 
57827 function (x, y, w, h, iArray) {
57828 this.sampleModel.setPixels (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, w, h, iArray, this.dataBuffer);
57829 }, "~N,~N,~N,~N,~A");
57830 Clazz_defineMethod (c$, "setPixels", 
57831 function (x, y, w, h, fArray) {
57832 this.sampleModel.setPixels (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, w, h, fArray, this.dataBuffer);
57833 }, "~N,~N,~N,~N,~A");
57834 Clazz_defineMethod (c$, "setPixels", 
57835 function (x, y, w, h, dArray) {
57836 this.sampleModel.setPixels (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, w, h, dArray, this.dataBuffer);
57837 }, "~N,~N,~N,~N,~A");
57838 Clazz_defineMethod (c$, "setSample", 
57839 function (x, y, b, s) {
57840 this.sampleModel.setSample (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, b, s, this.dataBuffer);
57841 }, "~N,~N,~N,~N");
57842 Clazz_defineMethod (c$, "setSample", 
57843 function (x, y, b, s) {
57844 this.sampleModel.setSample (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, b, s, this.dataBuffer);
57845 }, "~N,~N,~N,~N");
57846 Clazz_defineMethod (c$, "setSample", 
57847 function (x, y, b, s) {
57848 this.sampleModel.setSample (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, b, s, this.dataBuffer);
57849 }, "~N,~N,~N,~N");
57850 Clazz_defineMethod (c$, "setSamples", 
57851 function (x, y, w, h, b, iArray) {
57852 this.sampleModel.setSamples (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, w, h, b, iArray, this.dataBuffer);
57853 }, "~N,~N,~N,~N,~N,~A");
57854 Clazz_defineMethod (c$, "setSamples", 
57855 function (x, y, w, h, b, fArray) {
57856 this.sampleModel.setSamples (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, w, h, b, fArray, this.dataBuffer);
57857 }, "~N,~N,~N,~N,~N,~A");
57858 Clazz_defineMethod (c$, "setSamples", 
57859 function (x, y, w, h, b, dArray) {
57860 this.sampleModel.setSamples (x - this.sampleModelTranslateX, y - this.sampleModelTranslateY, w, h, b, dArray, this.dataBuffer);
57861 }, "~N,~N,~N,~N,~N,~A");
57862 });
57863 Clazz_declarePackage ("jssun.java2d.loops");
57864 Clazz_load (null, "jssun.java2d.loops.CompositeType", ["java.lang.InternalError"], function () {
57865 c$ = Clazz_decorateAsClass (function () {
57866 this.uniqueID = 0;
57867 this.desc = null;
57868 this.next = null;
57869 Clazz_instantialize (this, arguments);
57870 }, jssun.java2d.loops, "CompositeType");
57871 Clazz_defineMethod (c$, "deriveSubType", 
57872 function (desc) {
57873 return  new jssun.java2d.loops.CompositeType (this, desc);
57874 }, "~S");
57875 c$.forAlphaComposite = Clazz_defineMethod (c$, "forAlphaComposite", 
57876 function (ac) {
57877 switch (ac.getRule ()) {
57878 case 1:
57879 return jssun.java2d.loops.CompositeType.Clear;
57880 case 2:
57881 if (ac.getAlpha () >= 1.0) {
57882 return jssun.java2d.loops.CompositeType.SrcNoEa;
57883 } else {
57884 return jssun.java2d.loops.CompositeType.Src;
57885 }case 9:
57886 return jssun.java2d.loops.CompositeType.Dst;
57887 case 3:
57888 if (ac.getAlpha () >= 1.0) {
57889 return jssun.java2d.loops.CompositeType.SrcOverNoEa;
57890 } else {
57891 return jssun.java2d.loops.CompositeType.SrcOver;
57892 }case 4:
57893 return jssun.java2d.loops.CompositeType.DstOver;
57894 case 5:
57895 return jssun.java2d.loops.CompositeType.SrcIn;
57896 case 6:
57897 return jssun.java2d.loops.CompositeType.DstIn;
57898 case 7:
57899 return jssun.java2d.loops.CompositeType.SrcOut;
57900 case 8:
57901 return jssun.java2d.loops.CompositeType.DstOut;
57902 case 10:
57903 return jssun.java2d.loops.CompositeType.SrcAtop;
57904 case 11:
57905 return jssun.java2d.loops.CompositeType.DstAtop;
57906 case 12:
57907 return jssun.java2d.loops.CompositeType.AlphaXor;
57908 default:
57909 throw  new InternalError ("Unrecognized alpha rule");
57910 }
57911 }, "java.awt.AlphaComposite");
57912 Clazz_makeConstructor (c$, 
57913  function (parent, desc) {
57914 this.next = parent;
57915 this.desc = desc;
57916 this.uniqueID = jssun.java2d.loops.CompositeType.makeUniqueID ();
57917 }, "jssun.java2d.loops.CompositeType,~S");
57918 c$.makeUniqueID = Clazz_defineMethod (c$, "makeUniqueID", 
57919  function () {
57920 if (jssun.java2d.loops.CompositeType.unusedUID > 255) {
57921 throw  new InternalError ("composite type id overflow");
57922 }return jssun.java2d.loops.CompositeType.unusedUID++;
57923 });
57924 Clazz_defineMethod (c$, "getUniqueID", 
57925 function () {
57926 return this.uniqueID;
57927 });
57928 Clazz_defineMethod (c$, "getDescriptor", 
57929 function () {
57930 return this.desc;
57931 });
57932 Clazz_defineMethod (c$, "getSuperType", 
57933 function () {
57934 return this.next;
57935 });
57936 Clazz_overrideMethod (c$, "hashCode", 
57937 function () {
57938 return this.desc.hashCode ();
57939 });
57940 Clazz_defineMethod (c$, "isDerivedFrom", 
57941 function (other) {
57942 var comptype = this;
57943 do {
57944 if (comptype.desc === other.desc) {
57945 return true;
57946 }comptype = comptype.next;
57947 } while (comptype != null);
57948 return false;
57949 }, "jssun.java2d.loops.CompositeType");
57950 Clazz_overrideMethod (c$, "equals", 
57951 function (o) {
57952 if (Clazz_instanceOf (o, jssun.java2d.loops.CompositeType)) {
57953 return ((o).uniqueID == this.uniqueID);
57954 }return false;
57955 }, "~O");
57956 Clazz_overrideMethod (c$, "toString", 
57957 function () {
57958 return this.desc;
57959 });
57960 Clazz_defineStatics (c$,
57961 "DESC_ANY", "Any CompositeContext",
57962 "DESC_XOR", "XOR mode",
57963 "DESC_CLEAR", "Porter-Duff Clear",
57964 "DESC_SRC", "Porter-Duff Src",
57965 "DESC_DST", "Porter-Duff Dst",
57966 "DESC_SRC_OVER", "Porter-Duff Src Over Dst",
57967 "DESC_DST_OVER", "Porter-Duff Dst Over Src",
57968 "DESC_SRC_IN", "Porter-Duff Src In Dst",
57969 "DESC_DST_IN", "Porter-Duff Dst In Src",
57970 "DESC_SRC_OUT", "Porter-Duff Src HeldOutBy Dst",
57971 "DESC_DST_OUT", "Porter-Duff Dst HeldOutBy Src",
57972 "DESC_SRC_ATOP", "Porter-Duff Src Atop Dst",
57973 "DESC_DST_ATOP", "Porter-Duff Dst Atop Src",
57974 "DESC_ALPHA_XOR", "Porter-Duff Xor",
57975 "DESC_SRC_NO_EA", "Porter-Duff Src, No Extra Alpha",
57976 "DESC_SRC_OVER_NO_EA", "Porter-Duff SrcOverDst, No Extra Alpha",
57977 "DESC_ANY_ALPHA", "Any AlphaComposite Rule");
57978 c$.Any = c$.prototype.Any =  new jssun.java2d.loops.CompositeType (null, "Any CompositeContext");
57979 c$.General = c$.prototype.General = jssun.java2d.loops.CompositeType.Any;
57980 c$.AnyAlpha = c$.prototype.AnyAlpha = jssun.java2d.loops.CompositeType.General.deriveSubType ("Any AlphaComposite Rule");
57981 c$.Xor = c$.prototype.Xor = jssun.java2d.loops.CompositeType.General.deriveSubType ("XOR mode");
57982 c$.Clear = c$.prototype.Clear = jssun.java2d.loops.CompositeType.AnyAlpha.deriveSubType ("Porter-Duff Clear");
57983 c$.Src = c$.prototype.Src = jssun.java2d.loops.CompositeType.AnyAlpha.deriveSubType ("Porter-Duff Src");
57984 c$.Dst = c$.prototype.Dst = jssun.java2d.loops.CompositeType.AnyAlpha.deriveSubType ("Porter-Duff Dst");
57985 c$.SrcOver = c$.prototype.SrcOver = jssun.java2d.loops.CompositeType.AnyAlpha.deriveSubType ("Porter-Duff Src Over Dst");
57986 c$.DstOver = c$.prototype.DstOver = jssun.java2d.loops.CompositeType.AnyAlpha.deriveSubType ("Porter-Duff Dst Over Src");
57987 c$.SrcIn = c$.prototype.SrcIn = jssun.java2d.loops.CompositeType.AnyAlpha.deriveSubType ("Porter-Duff Src In Dst");
57988 c$.DstIn = c$.prototype.DstIn = jssun.java2d.loops.CompositeType.AnyAlpha.deriveSubType ("Porter-Duff Dst In Src");
57989 c$.SrcOut = c$.prototype.SrcOut = jssun.java2d.loops.CompositeType.AnyAlpha.deriveSubType ("Porter-Duff Src HeldOutBy Dst");
57990 c$.DstOut = c$.prototype.DstOut = jssun.java2d.loops.CompositeType.AnyAlpha.deriveSubType ("Porter-Duff Dst HeldOutBy Src");
57991 c$.SrcAtop = c$.prototype.SrcAtop = jssun.java2d.loops.CompositeType.AnyAlpha.deriveSubType ("Porter-Duff Src Atop Dst");
57992 c$.DstAtop = c$.prototype.DstAtop = jssun.java2d.loops.CompositeType.AnyAlpha.deriveSubType ("Porter-Duff Dst Atop Src");
57993 c$.AlphaXor = c$.prototype.AlphaXor = jssun.java2d.loops.CompositeType.AnyAlpha.deriveSubType ("Porter-Duff Xor");
57994 c$.SrcNoEa = c$.prototype.SrcNoEa = jssun.java2d.loops.CompositeType.Src.deriveSubType ("Porter-Duff Src, No Extra Alpha");
57995 c$.SrcOverNoEa = c$.prototype.SrcOverNoEa = jssun.java2d.loops.CompositeType.SrcOver.deriveSubType ("Porter-Duff SrcOverDst, No Extra Alpha");
57996 Clazz_defineStatics (c$,
57997 "unusedUID", 1);
57998 });
57999 Clazz_declarePackage ("awt2swing");
58000 Clazz_load (["javax.swing.JScrollPane"], "awt2swing.ScrollPane", null, function () {
58001 c$ = Clazz_declareType (awt2swing, "ScrollPane", javax.swing.JScrollPane);
58002 });
58003 Clazz_declarePackage ("javax.swing");
58004 Clazz_load (["javax.swing.JComponent", "$.JScrollBar", "$.ScrollPaneConstants", "javax.swing.plaf.UIResource"], "javax.swing.JScrollPane", ["java.lang.Boolean", "$.ClassCastException", "$.IllegalArgumentException", "java.awt.Point", "$.Rectangle", "javax.swing.JViewport", "$.ScrollPaneLayout", "$.Scrollable", "$.SwingUtilities", "$.UIManager"], function () {
58005 c$ = Clazz_decorateAsClass (function () {
58006 this.viewportBorder = null;
58007 this.verticalScrollBarPolicy = 20;
58008 this.horizontalScrollBarPolicy = 30;
58009 this.viewport = null;
58010 this.verticalScrollBar = null;
58011 this.horizontalScrollBar = null;
58012 this.rowHeader = null;
58013 this.columnHeader = null;
58014 this.lowerLeft = null;
58015 this.lowerRight = null;
58016 this.upperLeft = null;
58017 this.upperRight = null;
58018 this.wheelScrollState = true;
58019 if (!Clazz_isClassDefined ("javax.swing.JScrollPane.ScrollBar")) {
58020 javax.swing.JScrollPane.$JScrollPane$ScrollBar$ ();
58021 }
58022 Clazz_instantialize (this, arguments);
58023 }, javax.swing, "JScrollPane", javax.swing.JComponent, javax.swing.ScrollPaneConstants);
58024 Clazz_makeConstructor (c$, 
58025 function (view, vsbPolicy, hsbPolicy) {
58026 Clazz_superConstructor (this, javax.swing.JScrollPane, []);
58027 this.setLayout ( new javax.swing.ScrollPaneLayout.UIResource ());
58028 this.setVerticalScrollBarPolicy (vsbPolicy);
58029 this.setHorizontalScrollBarPolicy (hsbPolicy);
58030 this.setViewport (this.createViewport ());
58031 this.setVerticalScrollBar (this.createVerticalScrollBar ());
58032 this.setHorizontalScrollBar (this.createHorizontalScrollBar ());
58033 if (view != null) {
58034 this.setViewportView (view);
58035 }this.setUIProperty ("opaque", new Boolean (true));
58036 this.updateUI ();
58037 if (!this.getComponentOrientation ().isLeftToRight ()) {
58038 this.viewport.setViewPosition ( new java.awt.Point (2147483647, 0));
58039 }}, "java.awt.Component,~N,~N");
58040 Clazz_makeConstructor (c$, 
58041 function (view) {
58042 this.construct (view, 20, 30);
58043 }, "java.awt.Component");
58044 Clazz_makeConstructor (c$, 
58045 function (vsbPolicy, hsbPolicy) {
58046 this.construct (null, vsbPolicy, hsbPolicy);
58047 }, "~N,~N");
58048 Clazz_makeConstructor (c$, 
58049 function () {
58050 this.construct (null, 20, 30);
58051 });
58052 Clazz_overrideMethod (c$, "getUI", 
58053 function () {
58054 return this.ui;
58055 });
58056 Clazz_overrideMethod (c$, "updateUI", 
58057 function () {
58058 this.setUI (javax.swing.UIManager.getUI (this));
58059 });
58060 Clazz_overrideMethod (c$, "getUIClassID", 
58061 function () {
58062 return "ScrollPaneUI";
58063 });
58064 Clazz_defineMethod (c$, "setLayout", 
58065 function (layout) {
58066 if (Clazz_instanceOf (layout, javax.swing.ScrollPaneLayout)) {
58067 Clazz_superCall (this, javax.swing.JScrollPane, "setLayout", [layout]);
58068 (layout).syncWithScrollPane (this);
58069 } else if (layout == null) {
58070 Clazz_superCall (this, javax.swing.JScrollPane, "setLayout", [layout]);
58071 } else {
58072 var s = "layout of JScrollPane must be a ScrollPaneLayout";
58073 throw  new ClassCastException (s);
58074 }}, "java.awt.LayoutManager");
58075 Clazz_overrideMethod (c$, "isValidateRoot", 
58076 function () {
58077 return true;
58078 });
58079 Clazz_defineMethod (c$, "getVerticalScrollBarPolicy", 
58080 function () {
58081 return this.verticalScrollBarPolicy;
58082 });
58083 Clazz_defineMethod (c$, "setVerticalScrollBarPolicy", 
58084 function (policy) {
58085 switch (policy) {
58086 case 20:
58087 case 21:
58088 case 22:
58089 break;
58090 default:
58091 throw  new IllegalArgumentException ("invalid verticalScrollBarPolicy");
58092 }
58093 var old = this.verticalScrollBarPolicy;
58094 this.verticalScrollBarPolicy = policy;
58095 this.firePropertyChangeInt ("verticalScrollBarPolicy", old, policy);
58096 this.revalidate ();
58097 this.repaint ();
58098 }, "~N");
58099 Clazz_defineMethod (c$, "getHorizontalScrollBarPolicy", 
58100 function () {
58101 return this.horizontalScrollBarPolicy;
58102 });
58103 Clazz_defineMethod (c$, "setHorizontalScrollBarPolicy", 
58104 function (policy) {
58105 switch (policy) {
58106 case 30:
58107 case 31:
58108 case 32:
58109 break;
58110 default:
58111 throw  new IllegalArgumentException ("invalid horizontalScrollBarPolicy");
58112 }
58113 var old = this.horizontalScrollBarPolicy;
58114 this.horizontalScrollBarPolicy = policy;
58115 this.firePropertyChangeInt ("horizontalScrollBarPolicy", old, policy);
58116 this.revalidate ();
58117 this.repaint ();
58118 }, "~N");
58119 Clazz_defineMethod (c$, "getViewportBorder", 
58120 function () {
58121 return this.viewportBorder;
58122 });
58123 Clazz_defineMethod (c$, "setViewportBorder", 
58124 function (viewportBorder) {
58125 var oldValue = this.viewportBorder;
58126 this.viewportBorder = viewportBorder;
58127 this.firePropertyChangeObject ("viewportBorder", oldValue, viewportBorder);
58128 }, "javax.swing.border.Border");
58129 Clazz_defineMethod (c$, "getViewportBorderBounds", 
58130 function () {
58131 var borderR =  new java.awt.Rectangle (this.getSize ());
58132 var insets = this.getInsets ();
58133 borderR.x = insets.left;
58134 borderR.y = insets.top;
58135 borderR.width -= insets.left + insets.right;
58136 borderR.height -= insets.top + insets.bottom;
58137 var leftToRight = javax.swing.SwingUtilities.isLeftToRight (this);
58138 var colHead = this.getColumnHeader ();
58139 if ((colHead != null) && (colHead.isVisible ())) {
58140 var colHeadHeight = colHead.getHeight ();
58141 borderR.y += colHeadHeight;
58142 borderR.height -= colHeadHeight;
58143 }var rowHead = this.getRowHeader ();
58144 if ((rowHead != null) && (rowHead.isVisible ())) {
58145 var rowHeadWidth = rowHead.getWidth ();
58146 if (leftToRight) {
58147 borderR.x += rowHeadWidth;
58148 }borderR.width -= rowHeadWidth;
58149 }var vsb = this.getVerticalScrollBar ();
58150 if ((vsb != null) && (vsb.isVisible ())) {
58151 var vsbWidth = vsb.getWidth ();
58152 if (!leftToRight) {
58153 borderR.x += vsbWidth;
58154 }borderR.width -= vsbWidth;
58155 }var hsb = this.getHorizontalScrollBar ();
58156 if ((hsb != null) && (hsb.isVisible ())) {
58157 borderR.height -= hsb.getHeight ();
58158 }return borderR;
58159 });
58160 Clazz_defineMethod (c$, "createHorizontalScrollBar", 
58161 function () {
58162 return Clazz_innerTypeInstance (javax.swing.JScrollPane.ScrollBar, this, null, 0);
58163 });
58164 Clazz_defineMethod (c$, "getHorizontalScrollBar", 
58165 function () {
58166 return this.horizontalScrollBar;
58167 });
58168 Clazz_defineMethod (c$, "setHorizontalScrollBar", 
58169 function (horizontalScrollBar) {
58170 var old = this.getHorizontalScrollBar ();
58171 this.horizontalScrollBar = horizontalScrollBar;
58172 if (horizontalScrollBar != null) {
58173 this.add (horizontalScrollBar, "HORIZONTAL_SCROLLBAR");
58174 } else if (old != null) {
58175 this.remove (old);
58176 }this.firePropertyChangeObject ("horizontalScrollBar", old, horizontalScrollBar);
58177 this.revalidate ();
58178 this.repaint ();
58179 }, "javax.swing.JScrollBar");
58180 Clazz_defineMethod (c$, "createVerticalScrollBar", 
58181 function () {
58182 return Clazz_innerTypeInstance (javax.swing.JScrollPane.ScrollBar, this, null, 1);
58183 });
58184 Clazz_defineMethod (c$, "getVerticalScrollBar", 
58185 function () {
58186 return this.verticalScrollBar;
58187 });
58188 Clazz_defineMethod (c$, "setVerticalScrollBar", 
58189 function (verticalScrollBar) {
58190 var old = this.getVerticalScrollBar ();
58191 this.verticalScrollBar = verticalScrollBar;
58192 this.add (verticalScrollBar, "VERTICAL_SCROLLBAR");
58193 this.firePropertyChangeObject ("verticalScrollBar", old, verticalScrollBar);
58194 this.revalidate ();
58195 this.repaint ();
58196 }, "javax.swing.JScrollBar");
58197 Clazz_defineMethod (c$, "createViewport", 
58198 function () {
58199 return  new javax.swing.JViewport ();
58200 });
58201 Clazz_defineMethod (c$, "getViewport", 
58202 function () {
58203 return this.viewport;
58204 });
58205 Clazz_defineMethod (c$, "setViewport", 
58206 function (viewport) {
58207 var old = this.getViewport ();
58208 this.viewport = viewport;
58209 if (viewport != null) {
58210 this.add (viewport, "VIEWPORT");
58211 } else if (old != null) {
58212 this.remove (old);
58213 }this.firePropertyChangeObject ("viewport", old, viewport);
58214 this.revalidate ();
58215 this.repaint ();
58216 }, "javax.swing.JViewport");
58217 Clazz_defineMethod (c$, "setViewportView", 
58218 function (view) {
58219 if (this.getViewport () == null) {
58220 this.setViewport (this.createViewport ());
58221 }this.getViewport ().setView (view);
58222 }, "java.awt.Component");
58223 Clazz_defineMethod (c$, "getRowHeader", 
58224 function () {
58225 return this.rowHeader;
58226 });
58227 Clazz_defineMethod (c$, "setRowHeader", 
58228 function (rowHeader) {
58229 var old = this.getRowHeader ();
58230 this.rowHeader = rowHeader;
58231 if (rowHeader != null) {
58232 this.add (rowHeader, "ROW_HEADER");
58233 } else if (old != null) {
58234 this.remove (old);
58235 }this.firePropertyChangeObject ("rowHeader", old, rowHeader);
58236 this.revalidate ();
58237 this.repaint ();
58238 }, "javax.swing.JViewport");
58239 Clazz_defineMethod (c$, "setRowHeaderView", 
58240 function (view) {
58241 if (this.getRowHeader () == null) {
58242 this.setRowHeader (this.createViewport ());
58243 }this.getRowHeader ().setView (view);
58244 }, "java.awt.Component");
58245 Clazz_defineMethod (c$, "getColumnHeader", 
58246 function () {
58247 return this.columnHeader;
58248 });
58249 Clazz_defineMethod (c$, "setColumnHeader", 
58250 function (columnHeader) {
58251 var old = this.getColumnHeader ();
58252 this.columnHeader = columnHeader;
58253 if (columnHeader != null) {
58254 this.add (columnHeader, "COLUMN_HEADER");
58255 } else if (old != null) {
58256 this.remove (old);
58257 }this.firePropertyChangeObject ("columnHeader", old, columnHeader);
58258 this.revalidate ();
58259 this.repaint ();
58260 }, "javax.swing.JViewport");
58261 Clazz_defineMethod (c$, "setColumnHeaderView", 
58262 function (view) {
58263 if (this.getColumnHeader () == null) {
58264 this.setColumnHeader (this.createViewport ());
58265 }this.getColumnHeader ().setView (view);
58266 }, "java.awt.Component");
58267 Clazz_defineMethod (c$, "getCorner", 
58268 function (key) {
58269 var isLeftToRight = this.getComponentOrientation ().isLeftToRight ();
58270 if (key.equals ("LOWER_LEADING_CORNER")) {
58271 key = isLeftToRight ? "LOWER_LEFT_CORNER" : "LOWER_RIGHT_CORNER";
58272 } else if (key.equals ("LOWER_TRAILING_CORNER")) {
58273 key = isLeftToRight ? "LOWER_RIGHT_CORNER" : "LOWER_LEFT_CORNER";
58274 } else if (key.equals ("UPPER_LEADING_CORNER")) {
58275 key = isLeftToRight ? "UPPER_LEFT_CORNER" : "UPPER_RIGHT_CORNER";
58276 } else if (key.equals ("UPPER_TRAILING_CORNER")) {
58277 key = isLeftToRight ? "UPPER_RIGHT_CORNER" : "UPPER_LEFT_CORNER";
58278 }if (key.equals ("LOWER_LEFT_CORNER")) {
58279 return this.lowerLeft;
58280 } else if (key.equals ("LOWER_RIGHT_CORNER")) {
58281 return this.lowerRight;
58282 } else if (key.equals ("UPPER_LEFT_CORNER")) {
58283 return this.upperLeft;
58284 } else if (key.equals ("UPPER_RIGHT_CORNER")) {
58285 return this.upperRight;
58286 } else {
58287 return null;
58288 }}, "~S");
58289 Clazz_defineMethod (c$, "setCorner", 
58290 function (key, corner) {
58291 var old;
58292 var isLeftToRight = this.getComponentOrientation ().isLeftToRight ();
58293 if (key.equals ("LOWER_LEADING_CORNER")) {
58294 key = isLeftToRight ? "LOWER_LEFT_CORNER" : "LOWER_RIGHT_CORNER";
58295 } else if (key.equals ("LOWER_TRAILING_CORNER")) {
58296 key = isLeftToRight ? "LOWER_RIGHT_CORNER" : "LOWER_LEFT_CORNER";
58297 } else if (key.equals ("UPPER_LEADING_CORNER")) {
58298 key = isLeftToRight ? "UPPER_LEFT_CORNER" : "UPPER_RIGHT_CORNER";
58299 } else if (key.equals ("UPPER_TRAILING_CORNER")) {
58300 key = isLeftToRight ? "UPPER_RIGHT_CORNER" : "UPPER_LEFT_CORNER";
58301 }if (key.equals ("LOWER_LEFT_CORNER")) {
58302 old = this.lowerLeft;
58303 this.lowerLeft = corner;
58304 } else if (key.equals ("LOWER_RIGHT_CORNER")) {
58305 old = this.lowerRight;
58306 this.lowerRight = corner;
58307 } else if (key.equals ("UPPER_LEFT_CORNER")) {
58308 old = this.upperLeft;
58309 this.upperLeft = corner;
58310 } else if (key.equals ("UPPER_RIGHT_CORNER")) {
58311 old = this.upperRight;
58312 this.upperRight = corner;
58313 } else {
58314 throw  new IllegalArgumentException ("invalid corner key");
58315 }if (old != null) {
58316 this.remove (old);
58317 }if (corner != null) {
58318 this.add (corner, key);
58319 }this.firePropertyChangeObject (key, old, corner);
58320 this.revalidate ();
58321 this.repaint ();
58322 }, "~S,java.awt.Component");
58323 Clazz_defineMethod (c$, "setComponentOrientation", 
58324 function (co) {
58325 Clazz_superCall (this, javax.swing.JScrollPane, "setComponentOrientation", [co]);
58326 if (this.verticalScrollBar != null) this.verticalScrollBar.setComponentOrientation (co);
58327 if (this.horizontalScrollBar != null) this.horizontalScrollBar.setComponentOrientation (co);
58328 }, "java.awt.ComponentOrientation");
58329 Clazz_defineMethod (c$, "isWheelScrollingEnabled", 
58330 function () {
58331 return this.wheelScrollState;
58332 });
58333 Clazz_defineMethod (c$, "setWheelScrollingEnabled", 
58334 function (handleWheel) {
58335 var old = this.wheelScrollState;
58336 this.wheelScrollState = handleWheel;
58337 this.firePropertyChangeBool ("wheelScrollingEnabled", old, handleWheel);
58338 }, "~B");
58339 Clazz_defineMethod (c$, "paramString", 
58340 function () {
58341 var viewportBorderString = (this.viewportBorder != null ? this.viewportBorder.toString () : "");
58342 var viewportString = (this.viewport != null ? this.viewport.toString () : "");
58343 var verticalScrollBarPolicyString;
58344 if (this.verticalScrollBarPolicy == 20) {
58345 verticalScrollBarPolicyString = "VERTICAL_SCROLLBAR_AS_NEEDED";
58346 } else if (this.verticalScrollBarPolicy == 21) {
58347 verticalScrollBarPolicyString = "VERTICAL_SCROLLBAR_NEVER";
58348 } else if (this.verticalScrollBarPolicy == 22) {
58349 verticalScrollBarPolicyString = "VERTICAL_SCROLLBAR_ALWAYS";
58350 } else verticalScrollBarPolicyString = "";
58351 var horizontalScrollBarPolicyString;
58352 if (this.horizontalScrollBarPolicy == 30) {
58353 horizontalScrollBarPolicyString = "HORIZONTAL_SCROLLBAR_AS_NEEDED";
58354 } else if (this.horizontalScrollBarPolicy == 31) {
58355 horizontalScrollBarPolicyString = "HORIZONTAL_SCROLLBAR_NEVER";
58356 } else if (this.horizontalScrollBarPolicy == 32) {
58357 horizontalScrollBarPolicyString = "HORIZONTAL_SCROLLBAR_ALWAYS";
58358 } else horizontalScrollBarPolicyString = "";
58359 var horizontalScrollBarString = (this.horizontalScrollBar != null ? this.horizontalScrollBar.toString () : "");
58360 var verticalScrollBarString = (this.verticalScrollBar != null ? this.verticalScrollBar.toString () : "");
58361 var columnHeaderString = (this.columnHeader != null ? this.columnHeader.toString () : "");
58362 var rowHeaderString = (this.rowHeader != null ? this.rowHeader.toString () : "");
58363 var lowerLeftString = (this.lowerLeft != null ? this.lowerLeft.toString () : "");
58364 var lowerRightString = (this.lowerRight != null ? this.lowerRight.toString () : "");
58365 var upperLeftString = (this.upperLeft != null ? this.upperLeft.toString () : "");
58366 var upperRightString = (this.upperRight != null ? this.upperRight.toString () : "");
58367 return Clazz_superCall (this, javax.swing.JScrollPane, "paramString", []) + ",columnHeader=" + columnHeaderString + ",horizontalScrollBar=" + horizontalScrollBarString + ",horizontalScrollBarPolicy=" + horizontalScrollBarPolicyString + ",lowerLeft=" + lowerLeftString + ",lowerRight=" + lowerRightString + ",rowHeader=" + rowHeaderString + ",upperLeft=" + upperLeftString + ",upperRight=" + upperRightString + ",verticalScrollBar=" + verticalScrollBarString + ",verticalScrollBarPolicy=" + verticalScrollBarPolicyString + ",viewport=" + viewportString + ",viewportBorder=" + viewportBorderString;
58368 });
58369 c$.$JScrollPane$ScrollBar$ = function () {
58370 Clazz_pu$h(self.c$);
58371 c$ = Clazz_decorateAsClass (function () {
58372 Clazz_prepareCallback (this, arguments);
58373 this.unitIncrementSet = false;
58374 this.blockIncrementSet = false;
58375 Clazz_instantialize (this, arguments);
58376 }, javax.swing.JScrollPane, "ScrollBar", javax.swing.JScrollBar, javax.swing.plaf.UIResource);
58377 Clazz_makeConstructor (c$, 
58378 function (a) {
58379 Clazz_superConstructor (this, javax.swing.JScrollPane.ScrollBar, [a]);
58380 this.putClientProperty ("JScrollBar.fastWheelScrolling", Boolean.TRUE);
58381 }, "~N");
58382 Clazz_defineMethod (c$, "setUnitIncrement", 
58383 function (a) {
58384 this.unitIncrementSet = true;
58385 this.putClientProperty ("JScrollBar.fastWheelScrolling", null);
58386 Clazz_superCall (this, javax.swing.JScrollPane.ScrollBar, "setUnitIncrement", [a]);
58387 }, "~N");
58388 Clazz_defineMethod (c$, "getUnitIncrement", 
58389 function (a) {
58390 var b = this.b$["javax.swing.JScrollPane"].getViewport ();
58391 if (!this.unitIncrementSet && (b != null) && (Clazz_instanceOf (b.getView (), javax.swing.Scrollable))) {
58392 var c = (b.getView ());
58393 var d = b.getViewRect ();
58394 return c.getScrollableUnitIncrement (d, this.getOrientation (), a);
58395 } else {
58396 return Clazz_superCall (this, javax.swing.JScrollPane.ScrollBar, "getUnitIncrement", [a]);
58397 }}, "~N");
58398 Clazz_defineMethod (c$, "setBlockIncrement", 
58399 function (a) {
58400 this.blockIncrementSet = true;
58401 this.putClientProperty ("JScrollBar.fastWheelScrolling", null);
58402 Clazz_superCall (this, javax.swing.JScrollPane.ScrollBar, "setBlockIncrement", [a]);
58403 }, "~N");
58404 Clazz_defineMethod (c$, "getBlockIncrement", 
58405 function (a) {
58406 var b = this.b$["javax.swing.JScrollPane"].getViewport ();
58407 if (this.blockIncrementSet || b == null) {
58408 return Clazz_superCall (this, javax.swing.JScrollPane.ScrollBar, "getBlockIncrement", [a]);
58409 } else if (Clazz_instanceOf (b.getView (), javax.swing.Scrollable)) {
58410 var c = (b.getView ());
58411 var d = b.getViewRect ();
58412 return c.getScrollableBlockIncrement (d, this.getOrientation (), a);
58413 } else if (this.getOrientation () == 1) {
58414 return b.getExtentSize ().height;
58415 } else {
58416 return b.getExtentSize ().width;
58417 }}, "~N");
58418 c$ = Clazz_p0p ();
58419 };
58420 Clazz_defineStatics (c$,
58421 "$uiClassID", "ScrollPaneUI");
58422 });
58423 Clazz_declarePackage ("javax.swing");
58424 c$ = Clazz_declareInterface (javax.swing, "ScrollPaneConstants");
58425 Clazz_defineStatics (c$,
58426 "VIEWPORT", "VIEWPORT",
58427 "VERTICAL_SCROLLBAR", "VERTICAL_SCROLLBAR",
58428 "HORIZONTAL_SCROLLBAR", "HORIZONTAL_SCROLLBAR",
58429 "ROW_HEADER", "ROW_HEADER",
58430 "COLUMN_HEADER", "COLUMN_HEADER",
58431 "LOWER_LEFT_CORNER", "LOWER_LEFT_CORNER",
58432 "LOWER_RIGHT_CORNER", "LOWER_RIGHT_CORNER",
58433 "UPPER_LEFT_CORNER", "UPPER_LEFT_CORNER",
58434 "UPPER_RIGHT_CORNER", "UPPER_RIGHT_CORNER",
58435 "LOWER_LEADING_CORNER", "LOWER_LEADING_CORNER",
58436 "LOWER_TRAILING_CORNER", "LOWER_TRAILING_CORNER",
58437 "UPPER_LEADING_CORNER", "UPPER_LEADING_CORNER",
58438 "UPPER_TRAILING_CORNER", "UPPER_TRAILING_CORNER",
58439 "VERTICAL_SCROLLBAR_POLICY", "VERTICAL_SCROLLBAR_POLICY",
58440 "HORIZONTAL_SCROLLBAR_POLICY", "HORIZONTAL_SCROLLBAR_POLICY",
58441 "VERTICAL_SCROLLBAR_AS_NEEDED", 20,
58442 "VERTICAL_SCROLLBAR_NEVER", 21,
58443 "VERTICAL_SCROLLBAR_ALWAYS", 22,
58444 "HORIZONTAL_SCROLLBAR_AS_NEEDED", 30,
58445 "HORIZONTAL_SCROLLBAR_NEVER", 31,
58446 "HORIZONTAL_SCROLLBAR_ALWAYS", 32);
58447 Clazz_declarePackage ("javax.swing");
58448 Clazz_load (["java.awt.LayoutManager", "javax.swing.ScrollPaneConstants", "javax.swing.plaf.UIResource"], "javax.swing.ScrollPaneLayout", ["java.lang.IllegalArgumentException", "java.awt.Dimension", "$.Insets", "$.Rectangle", "javax.swing.Scrollable", "$.SwingUtilities", "$.UIManager"], function () {
58449 c$ = Clazz_decorateAsClass (function () {
58450 this.viewport = null;
58451 this.vsb = null;
58452 this.hsb = null;
58453 this.rowHead = null;
58454 this.colHead = null;
58455 this.lowerLeft = null;
58456 this.lowerRight = null;
58457 this.upperLeft = null;
58458 this.upperRight = null;
58459 this.vsbPolicy = 20;
58460 this.hsbPolicy = 30;
58461 Clazz_instantialize (this, arguments);
58462 }, javax.swing, "ScrollPaneLayout", null, [java.awt.LayoutManager, javax.swing.ScrollPaneConstants]);
58463 Clazz_defineMethod (c$, "syncWithScrollPane", 
58464 function (sp) {
58465 this.viewport = sp.getViewport ();
58466 this.vsb = sp.getVerticalScrollBar ();
58467 this.hsb = sp.getHorizontalScrollBar ();
58468 this.rowHead = sp.getRowHeader ();
58469 this.colHead = sp.getColumnHeader ();
58470 this.lowerLeft = sp.getCorner ("LOWER_LEFT_CORNER");
58471 this.lowerRight = sp.getCorner ("LOWER_RIGHT_CORNER");
58472 this.upperLeft = sp.getCorner ("UPPER_LEFT_CORNER");
58473 this.upperRight = sp.getCorner ("UPPER_RIGHT_CORNER");
58474 this.vsbPolicy = sp.getVerticalScrollBarPolicy ();
58475 this.hsbPolicy = sp.getHorizontalScrollBarPolicy ();
58476 }, "javax.swing.JScrollPane");
58477 Clazz_defineMethod (c$, "addSingletonComponent", 
58478 function (oldC, newC) {
58479 if ((oldC != null) && (oldC !== newC)) {
58480 oldC.getParent ().remove (oldC);
58481 }return newC;
58482 }, "java.awt.Component,java.awt.Component");
58483 Clazz_overrideMethod (c$, "addLayoutComponent", 
58484 function (s, c) {
58485 if (s.equals ("VIEWPORT")) {
58486 this.viewport = this.addSingletonComponent (this.viewport, c);
58487 } else if (s.equals ("VERTICAL_SCROLLBAR")) {
58488 this.vsb = this.addSingletonComponent (this.vsb, c);
58489 } else if (s.equals ("HORIZONTAL_SCROLLBAR")) {
58490 this.hsb = this.addSingletonComponent (this.hsb, c);
58491 } else if (s.equals ("ROW_HEADER")) {
58492 this.rowHead = this.addSingletonComponent (this.rowHead, c);
58493 } else if (s.equals ("COLUMN_HEADER")) {
58494 this.colHead = this.addSingletonComponent (this.colHead, c);
58495 } else if (s.equals ("LOWER_LEFT_CORNER")) {
58496 this.lowerLeft = this.addSingletonComponent (this.lowerLeft, c);
58497 } else if (s.equals ("LOWER_RIGHT_CORNER")) {
58498 this.lowerRight = this.addSingletonComponent (this.lowerRight, c);
58499 } else if (s.equals ("UPPER_LEFT_CORNER")) {
58500 this.upperLeft = this.addSingletonComponent (this.upperLeft, c);
58501 } else if (s.equals ("UPPER_RIGHT_CORNER")) {
58502 this.upperRight = this.addSingletonComponent (this.upperRight, c);
58503 } else {
58504 throw  new IllegalArgumentException ("invalid layout key " + s);
58505 }}, "~S,java.awt.Component");
58506 Clazz_overrideMethod (c$, "removeLayoutComponent", 
58507 function (c) {
58508 if (c === this.viewport) {
58509 this.viewport = null;
58510 } else if (c === this.vsb) {
58511 this.vsb = null;
58512 } else if (c === this.hsb) {
58513 this.hsb = null;
58514 } else if (c === this.rowHead) {
58515 this.rowHead = null;
58516 } else if (c === this.colHead) {
58517 this.colHead = null;
58518 } else if (c === this.lowerLeft) {
58519 this.lowerLeft = null;
58520 } else if (c === this.lowerRight) {
58521 this.lowerRight = null;
58522 } else if (c === this.upperLeft) {
58523 this.upperLeft = null;
58524 } else if (c === this.upperRight) {
58525 this.upperRight = null;
58526 }}, "java.awt.Component");
58527 Clazz_defineMethod (c$, "getVerticalScrollBarPolicy", 
58528 function () {
58529 return this.vsbPolicy;
58530 });
58531 Clazz_defineMethod (c$, "setVerticalScrollBarPolicy", 
58532 function (x) {
58533 switch (x) {
58534 case 20:
58535 case 21:
58536 case 22:
58537 this.vsbPolicy = x;
58538 break;
58539 default:
58540 throw  new IllegalArgumentException ("invalid verticalScrollBarPolicy");
58541 }
58542 }, "~N");
58543 Clazz_defineMethod (c$, "getHorizontalScrollBarPolicy", 
58544 function () {
58545 return this.hsbPolicy;
58546 });
58547 Clazz_defineMethod (c$, "setHorizontalScrollBarPolicy", 
58548 function (x) {
58549 switch (x) {
58550 case 30:
58551 case 31:
58552 case 32:
58553 this.hsbPolicy = x;
58554 break;
58555 default:
58556 throw  new IllegalArgumentException ("invalid horizontalScrollBarPolicy");
58557 }
58558 }, "~N");
58559 Clazz_defineMethod (c$, "getViewport", 
58560 function () {
58561 return this.viewport;
58562 });
58563 Clazz_defineMethod (c$, "getHorizontalScrollBar", 
58564 function () {
58565 return this.hsb;
58566 });
58567 Clazz_defineMethod (c$, "getVerticalScrollBar", 
58568 function () {
58569 return this.vsb;
58570 });
58571 Clazz_defineMethod (c$, "getRowHeader", 
58572 function () {
58573 return this.rowHead;
58574 });
58575 Clazz_defineMethod (c$, "getColumnHeader", 
58576 function () {
58577 return this.colHead;
58578 });
58579 Clazz_defineMethod (c$, "getCorner", 
58580 function (key) {
58581 if (key.equals ("LOWER_LEFT_CORNER")) {
58582 return this.lowerLeft;
58583 } else if (key.equals ("LOWER_RIGHT_CORNER")) {
58584 return this.lowerRight;
58585 } else if (key.equals ("UPPER_LEFT_CORNER")) {
58586 return this.upperLeft;
58587 } else if (key.equals ("UPPER_RIGHT_CORNER")) {
58588 return this.upperRight;
58589 } else {
58590 return null;
58591 }}, "~S");
58592 Clazz_overrideMethod (c$, "preferredLayoutSize", 
58593 function (parent) {
58594 var scrollPane = parent;
58595 this.vsbPolicy = scrollPane.getVerticalScrollBarPolicy ();
58596 this.hsbPolicy = scrollPane.getHorizontalScrollBarPolicy ();
58597 var insets = parent.getInsets ();
58598 var prefWidth = insets.left + insets.right;
58599 var prefHeight = insets.top + insets.bottom;
58600 var extentSize = null;
58601 var viewSize = null;
58602 var view = null;
58603 if (this.viewport != null) {
58604 extentSize = this.viewport.getPreferredSize ();
58605 view = this.viewport.getView ();
58606 if (view != null) {
58607 viewSize = view.getPreferredSize ();
58608 } else {
58609 viewSize =  new java.awt.Dimension (0, 0);
58610 }}if (extentSize != null) {
58611 prefWidth += extentSize.width;
58612 prefHeight += extentSize.height;
58613 }var viewportBorder = scrollPane.getViewportBorder ();
58614 if (viewportBorder != null) {
58615 var vpbInsets = viewportBorder.getBorderInsets (parent);
58616 prefWidth += vpbInsets.left + vpbInsets.right;
58617 prefHeight += vpbInsets.top + vpbInsets.bottom;
58618 }if ((this.rowHead != null) && this.rowHead.isVisible ()) {
58619 prefWidth += this.rowHead.getPreferredSize ().width;
58620 }if ((this.colHead != null) && this.colHead.isVisible ()) {
58621 prefHeight += this.colHead.getPreferredSize ().height;
58622 }if ((this.vsb != null) && (this.vsbPolicy != 21)) {
58623 if (this.vsbPolicy == 22) {
58624 prefWidth += this.vsb.getPreferredSize ().width;
58625 } else if ((viewSize != null) && (extentSize != null)) {
58626 var canScroll = true;
58627 if (Clazz_instanceOf (view, javax.swing.Scrollable)) {
58628 canScroll = !(view).getScrollableTracksViewportHeight ();
58629 }if (canScroll && (viewSize.height > extentSize.height)) {
58630 prefWidth += this.vsb.getPreferredSize ().width;
58631 }}}if ((this.hsb != null) && (this.hsbPolicy != 31)) {
58632 if (this.hsbPolicy == 32) {
58633 prefHeight += this.hsb.getPreferredSize ().height;
58634 } else if ((viewSize != null) && (extentSize != null)) {
58635 var canScroll = true;
58636 if (Clazz_instanceOf (view, javax.swing.Scrollable)) {
58637 canScroll = !(view).getScrollableTracksViewportWidth ();
58638 }if (canScroll && (viewSize.width > extentSize.width)) {
58639 prefHeight += this.hsb.getPreferredSize ().height;
58640 }}}return  new java.awt.Dimension (prefWidth, prefHeight);
58641 }, "java.awt.Container");
58642 Clazz_overrideMethod (c$, "minimumLayoutSize", 
58643 function (parent) {
58644 var scrollPane = parent;
58645 this.vsbPolicy = scrollPane.getVerticalScrollBarPolicy ();
58646 this.hsbPolicy = scrollPane.getHorizontalScrollBarPolicy ();
58647 var insets = parent.getInsets ();
58648 var minWidth = insets.left + insets.right;
58649 var minHeight = insets.top + insets.bottom;
58650 if (this.viewport != null) {
58651 var size = this.viewport.getMinimumSize ();
58652 minWidth += size.width;
58653 minHeight += size.height;
58654 }var viewportBorder = scrollPane.getViewportBorder ();
58655 if (viewportBorder != null) {
58656 var vpbInsets = viewportBorder.getBorderInsets (parent);
58657 minWidth += vpbInsets.left + vpbInsets.right;
58658 minHeight += vpbInsets.top + vpbInsets.bottom;
58659 }if ((this.rowHead != null) && this.rowHead.isVisible ()) {
58660 var size = this.rowHead.getMinimumSize ();
58661 minWidth += size.width;
58662 minHeight = Math.max (minHeight, size.height);
58663 }if ((this.colHead != null) && this.colHead.isVisible ()) {
58664 var size = this.colHead.getMinimumSize ();
58665 minWidth = Math.max (minWidth, size.width);
58666 minHeight += size.height;
58667 }if ((this.vsb != null) && (this.vsbPolicy != 21)) {
58668 var size = this.vsb.getMinimumSize ();
58669 minWidth += size.width;
58670 minHeight = Math.max (minHeight, size.height);
58671 }if ((this.hsb != null) && (this.hsbPolicy != 31)) {
58672 var size = this.hsb.getMinimumSize ();
58673 minWidth = Math.max (minWidth, size.width);
58674 minHeight += size.height;
58675 }return  new java.awt.Dimension (minWidth, minHeight);
58676 }, "java.awt.Container");
58677 Clazz_overrideMethod (c$, "layoutContainer", 
58678 function (parent) {
58679 var scrollPane = parent;
58680 this.vsbPolicy = scrollPane.getVerticalScrollBarPolicy ();
58681 this.hsbPolicy = scrollPane.getHorizontalScrollBarPolicy ();
58682 var availR = scrollPane.getBounds ();
58683 availR.x = availR.y = 0;
58684 var insets = parent.getInsets ();
58685 availR.x = insets.left;
58686 availR.y = insets.top;
58687 availR.width -= insets.left + insets.right;
58688 availR.height -= insets.top + insets.bottom;
58689 var leftToRight = javax.swing.SwingUtilities.isLeftToRight (scrollPane);
58690 var colHeadR =  new java.awt.Rectangle (0, availR.y, 0, 0);
58691 if ((this.colHead != null) && (this.colHead.isVisible ())) {
58692 var colHeadHeight = Math.min (availR.height, this.colHead.getPreferredSize ().height);
58693 colHeadR.height = colHeadHeight;
58694 availR.y += colHeadHeight;
58695 availR.height -= colHeadHeight;
58696 }var rowHeadR =  new java.awt.Rectangle (0, 0, 0, 0);
58697 if ((this.rowHead != null) && (this.rowHead.isVisible ())) {
58698 var rowHeadWidth = Math.min (availR.width, this.rowHead.getPreferredSize ().width);
58699 rowHeadR.width = rowHeadWidth;
58700 availR.width -= rowHeadWidth;
58701 if (leftToRight) {
58702 rowHeadR.x = availR.x;
58703 availR.x += rowHeadWidth;
58704 } else {
58705 rowHeadR.x = availR.x + availR.width;
58706 }}var viewportBorder = scrollPane.getViewportBorder ();
58707 var vpbInsets;
58708 if (viewportBorder != null) {
58709 vpbInsets = viewportBorder.getBorderInsets (parent);
58710 availR.x += vpbInsets.left;
58711 availR.y += vpbInsets.top;
58712 availR.width -= vpbInsets.left + vpbInsets.right;
58713 availR.height -= vpbInsets.top + vpbInsets.bottom;
58714 } else {
58715 vpbInsets =  new java.awt.Insets (0, 0, 0, 0);
58716 }var view = (this.viewport != null) ? this.viewport.getView () : null;
58717 var viewPrefSize = (view != null) ? view.getPreferredSize () :  new java.awt.Dimension (0, 0);
58718 var extentSize = (this.viewport != null) ? this.viewport.toViewCoordinates (availR.getSize ()) :  new java.awt.Dimension (0, 0);
58719 var viewTracksViewportWidth = false;
58720 var viewTracksViewportHeight = false;
58721 var isEmpty = (availR.width < 0 || availR.height < 0);
58722 var sv;
58723 if (!isEmpty && Clazz_instanceOf (view, javax.swing.Scrollable)) {
58724 sv = view;
58725 viewTracksViewportWidth = sv.getScrollableTracksViewportWidth ();
58726 viewTracksViewportHeight = sv.getScrollableTracksViewportHeight ();
58727 } else {
58728 sv = null;
58729 }var vsbR =  new java.awt.Rectangle (0, availR.y - vpbInsets.top, 0, 0);
58730 var vsbNeeded;
58731 if (isEmpty) {
58732 vsbNeeded = false;
58733 } else if (this.vsbPolicy == 22) {
58734 vsbNeeded = true;
58735 } else if (this.vsbPolicy == 21) {
58736 vsbNeeded = false;
58737 } else {
58738 vsbNeeded = !viewTracksViewportHeight && (viewPrefSize.height > extentSize.height);
58739 }if ((this.vsb != null) && vsbNeeded) {
58740 this.adjustForVSB (true, availR, vsbR, vpbInsets, leftToRight);
58741 extentSize = this.viewport.toViewCoordinates (availR.getSize ());
58742 }var hsbR =  new java.awt.Rectangle (availR.x - vpbInsets.left, 0, 0, 0);
58743 var hsbNeeded;
58744 if (isEmpty) {
58745 hsbNeeded = false;
58746 } else if (this.hsbPolicy == 32) {
58747 hsbNeeded = true;
58748 } else if (this.hsbPolicy == 31) {
58749 hsbNeeded = false;
58750 } else {
58751 hsbNeeded = !viewTracksViewportWidth && (viewPrefSize.width > extentSize.width);
58752 }if ((this.hsb != null) && hsbNeeded) {
58753 this.adjustForHSB (true, availR, hsbR, vpbInsets);
58754 if ((this.vsb != null) && !vsbNeeded && (this.vsbPolicy != 21)) {
58755 extentSize = this.viewport.toViewCoordinates (availR.getSize ());
58756 vsbNeeded = viewPrefSize.height > extentSize.height;
58757 if (vsbNeeded) {
58758 this.adjustForVSB (true, availR, vsbR, vpbInsets, leftToRight);
58759 }}}if (this.viewport != null) {
58760 this.viewport.setBounds (availR);
58761 if (sv != null) {
58762 extentSize = this.viewport.toViewCoordinates (availR.getSize ());
58763 var oldHSBNeeded = hsbNeeded;
58764 var oldVSBNeeded = vsbNeeded;
58765 viewTracksViewportWidth = sv.getScrollableTracksViewportWidth ();
58766 viewTracksViewportHeight = sv.getScrollableTracksViewportHeight ();
58767 if (this.vsb != null && this.vsbPolicy == 20) {
58768 var newVSBNeeded = !viewTracksViewportHeight && (viewPrefSize.height > extentSize.height);
58769 if (newVSBNeeded != vsbNeeded) {
58770 vsbNeeded = newVSBNeeded;
58771 this.adjustForVSB (vsbNeeded, availR, vsbR, vpbInsets, leftToRight);
58772 extentSize = this.viewport.toViewCoordinates (availR.getSize ());
58773 }}if (this.hsb != null && this.hsbPolicy == 30) {
58774 var newHSBbNeeded = !viewTracksViewportWidth && (viewPrefSize.width > extentSize.width);
58775 if (newHSBbNeeded != hsbNeeded) {
58776 hsbNeeded = newHSBbNeeded;
58777 this.adjustForHSB (hsbNeeded, availR, hsbR, vpbInsets);
58778 if ((this.vsb != null) && !vsbNeeded && (this.vsbPolicy != 21)) {
58779 extentSize = this.viewport.toViewCoordinates (availR.getSize ());
58780 vsbNeeded = viewPrefSize.height > extentSize.height;
58781 if (vsbNeeded) {
58782 this.adjustForVSB (true, availR, vsbR, vpbInsets, leftToRight);
58783 }}}}if (oldHSBNeeded != hsbNeeded || oldVSBNeeded != vsbNeeded) {
58784 this.viewport.setBounds (availR);
58785 }}}vsbR.height = availR.height + vpbInsets.top + vpbInsets.bottom;
58786 hsbR.width = availR.width + vpbInsets.left + vpbInsets.right;
58787 rowHeadR.height = availR.height + vpbInsets.top + vpbInsets.bottom;
58788 rowHeadR.y = availR.y - vpbInsets.top;
58789 colHeadR.width = availR.width + vpbInsets.left + vpbInsets.right;
58790 colHeadR.x = availR.x - vpbInsets.left;
58791 if (this.rowHead != null) {
58792 this.rowHead.setBounds (rowHeadR);
58793 }if (this.colHead != null) {
58794 this.colHead.setBounds (colHeadR);
58795 }if (this.vsb != null) {
58796 if (vsbNeeded) {
58797 if (this.colHead != null && javax.swing.UIManager.getBoolean ("ScrollPane.fillUpperCorner")) {
58798 if ((leftToRight && this.upperRight == null) || (!leftToRight && this.upperLeft == null)) {
58799 vsbR.y = colHeadR.y;
58800 vsbR.height += colHeadR.height;
58801 }}this.vsb.setVisible (true);
58802 this.vsb.setBounds (vsbR);
58803 } else {
58804 this.vsb.setVisible (false);
58805 }}if (this.hsb != null) {
58806 if (hsbNeeded) {
58807 if (this.rowHead != null && javax.swing.UIManager.getBoolean ("ScrollPane.fillLowerCorner")) {
58808 if ((leftToRight && this.lowerLeft == null) || (!leftToRight && this.lowerRight == null)) {
58809 if (leftToRight) {
58810 hsbR.x = rowHeadR.x;
58811 }hsbR.width += rowHeadR.width;
58812 }}this.hsb.setVisible (true);
58813 this.hsb.setBounds (hsbR);
58814 } else {
58815 this.hsb.setVisible (false);
58816 }}if (this.lowerLeft != null) {
58817 this.lowerLeft.setBounds (leftToRight ? rowHeadR.x : vsbR.x, hsbR.y, leftToRight ? rowHeadR.width : vsbR.width, hsbR.height);
58818 }if (this.lowerRight != null) {
58819 this.lowerRight.setBounds (leftToRight ? vsbR.x : rowHeadR.x, hsbR.y, leftToRight ? vsbR.width : rowHeadR.width, hsbR.height);
58820 }if (this.upperLeft != null) {
58821 this.upperLeft.setBounds (leftToRight ? rowHeadR.x : vsbR.x, colHeadR.y, leftToRight ? rowHeadR.width : vsbR.width, colHeadR.height);
58822 }if (this.upperRight != null) {
58823 this.upperRight.setBounds (leftToRight ? vsbR.x : rowHeadR.x, colHeadR.y, leftToRight ? vsbR.width : rowHeadR.width, colHeadR.height);
58824 }}, "java.awt.Container");
58825 Clazz_defineMethod (c$, "adjustForVSB", 
58826  function (wantsVSB, available, vsbR, vpbInsets, leftToRight) {
58827 var oldWidth = vsbR.width;
58828 if (wantsVSB) {
58829 var vsbWidth = Math.max (0, Math.min (this.vsb.getPreferredSize ().width, available.width));
58830 available.width -= vsbWidth;
58831 vsbR.width = vsbWidth;
58832 if (leftToRight) {
58833 vsbR.x = available.x + available.width + vpbInsets.right;
58834 } else {
58835 vsbR.x = available.x - vpbInsets.left;
58836 available.x += vsbWidth;
58837 }} else {
58838 available.width += oldWidth;
58839 }}, "~B,java.awt.Rectangle,java.awt.Rectangle,java.awt.Insets,~B");
58840 Clazz_defineMethod (c$, "adjustForHSB", 
58841  function (wantsHSB, available, hsbR, vpbInsets) {
58842 var oldHeight = hsbR.height;
58843 if (wantsHSB) {
58844 var hsbHeight = Math.max (0, Math.min (available.height, this.hsb.getPreferredSize ().height));
58845 available.height -= hsbHeight;
58846 hsbR.y = available.y + available.height + vpbInsets.bottom;
58847 hsbR.height = hsbHeight;
58848 } else {
58849 available.height += oldHeight;
58850 }}, "~B,java.awt.Rectangle,java.awt.Rectangle,java.awt.Insets");
58851 Clazz_defineMethod (c$, "getViewportBorderBounds", 
58852 function (scrollpane) {
58853 return scrollpane.getViewportBorderBounds ();
58854 }, "javax.swing.JScrollPane");
58855 Clazz_pu$h(self.c$);
58856 c$ = Clazz_declareType (javax.swing.ScrollPaneLayout, "UIResource", javax.swing.ScrollPaneLayout, javax.swing.plaf.UIResource);
58857 c$ = Clazz_p0p ();
58858 });
58859 Clazz_declarePackage ("jalview.io");
58860 Clazz_load (["jalview.io.AlignFile", "java.lang.Enum", "$.Exception"], "jalview.io.FeaturesFile", ["jalview.analysis.SequenceIdMatcher", "jalview.datamodel.AlignedCodonFrame", "$.SequenceDummy", "$.SequenceFeature", "jalview.jsdev.GenericFileAdapter", "jalview.schemes.GraduatedColor", "$.UserColourScheme", "jalview.util.Format", "$.MapList", "$.ParseHtmlBodyAndLinks", "java.awt.Color", "java.lang.Float", "$.StringBuffer", "java.util.ArrayList", "$.Arrays", "$.HashMap", "$.Hashtable", "$.StringTokenizer", "$.Vector"], function () {
58861 c$ = Clazz_decorateAsClass (function () {
58862 this.doGffSource = true;
58863 this.gffversion = 0;
58864 if (!Clazz_isClassDefined ("jalview.io.FeaturesFile.InvalidGFF3FieldException")) {
58865 jalview.io.FeaturesFile.$FeaturesFile$InvalidGFF3FieldException$ ();
58866 }
58867 this.lastmatchedAl = null;
58868 this.matcher = null;
58869 Clazz_instantialize (this, arguments);
58870 }, jalview.io, "FeaturesFile", jalview.io.AlignFile);
58871 Clazz_makeConstructor (c$, 
58872 function () {
58873 Clazz_superConstructor (this, jalview.io.FeaturesFile, []);
58874 });
58875 Clazz_defineMethod (c$, "parse", 
58876 function (align, colours, removeHTML) {
58877 return this.parse (align, colours, null, removeHTML, false);
58878 }, "jalview.datamodel.AlignmentI,java.util.Hashtable,~B");
58879 Clazz_defineMethod (c$, "parse", 
58880 function (align, colours, removeHTML, relaxedIdMatching) {
58881 return this.parse (align, colours, null, removeHTML, relaxedIdMatching);
58882 }, "jalview.datamodel.AlignmentI,java.util.Map,~B,~B");
58883 Clazz_defineMethod (c$, "parse", 
58884 function (align, colours, featureLink, removeHTML) {
58885 return this.parse (align, colours, featureLink, removeHTML, false);
58886 }, "jalview.datamodel.AlignmentI,java.util.Map,java.util.Map,~B");
58887 Clazz_defineMethod (c$, "parse", 
58888 function (align, colours, featureLink, removeHTML, relaxedIdmatching) {
58889 var line = null;
58890 try {
58891 var seq = null;
58892 var newseqs =  new java.util.ArrayList ();
58893 var type;
58894 var desc;
58895 var token = null;
58896 var index;
58897 var start;
58898 var end;
58899 var score;
58900 var st;
58901 var sf;
58902 var featureGroup = null;
58903 var groupLink = null;
58904 var typeLink =  new java.util.Hashtable ();
58905 var GFFFile = true;
58906 var gffProps =  new java.util.HashMap ();
58907 while ((line = this.nextLine ()) != null) {
58908 if (line.startsWith ("#")) {
58909 if (line.startsWith ("##")) {
58910 this.processGffPragma (line, gffProps, align, newseqs);
58911 line = "";
58912 }continue;
58913 }st =  new java.util.StringTokenizer (line, "\t");
58914 if (st.countTokens () == 1) {
58915 if (line.trim ().equalsIgnoreCase ("GFF")) {
58916 GFFFile = true;
58917 continue;
58918 }}if (st.countTokens () > 1 && st.countTokens () < 4) {
58919 GFFFile = false;
58920 type = st.nextToken ();
58921 if (type.equalsIgnoreCase ("startgroup")) {
58922 featureGroup = st.nextToken ();
58923 if (st.hasMoreElements ()) {
58924 groupLink = st.nextToken ();
58925 featureLink.put (featureGroup, groupLink);
58926 }} else if (type.equalsIgnoreCase ("endgroup")) {
58927 st.nextToken ();
58928 featureGroup = null;
58929 groupLink = null;
58930 } else {
58931 var colour = null;
58932 var colscheme = st.nextToken ();
58933 if (colscheme.indexOf ("|") > -1 || colscheme.trim ().equalsIgnoreCase ("label")) {
58934 var gcol =  new java.util.StringTokenizer (colscheme, "|", true);
58935 var threshtype = -1;
58936 var min = 1.4E-45;
58937 var max = 3.4028235E38;
58938 var threshval = NaN;
58939 var labelCol = false;
58940 var mincol = gcol.nextToken ();
58941 if (mincol === "|") {
58942 System.err.println ("Expected either 'label' or a colour specification in the line: " + line);
58943 continue;
58944 }var maxcol = null;
58945 if (mincol.toLowerCase ().indexOf ("label") == 0) {
58946 labelCol = true;
58947 mincol = (gcol.hasMoreTokens () ? gcol.nextToken () : null);
58948 mincol = (gcol.hasMoreTokens () ? gcol.nextToken () : null);
58949 }var abso = null;
58950 var minval;
58951 var maxval;
58952 if (mincol != null) {
58953 if (mincol.equals ("|")) {
58954 mincol = "";
58955 } else {
58956 gcol.nextToken ();
58957 }maxcol = gcol.nextToken ();
58958 if (maxcol.equals ("|")) {
58959 maxcol = "";
58960 } else {
58961 gcol.nextToken ();
58962 }abso = gcol.nextToken ();
58963 gcol.nextToken ();
58964 if (abso.toLowerCase ().indexOf ("abso") != 0) {
58965 minval = abso;
58966 abso = null;
58967 } else {
58968 minval = gcol.nextToken ();
58969 gcol.nextToken ();
58970 }maxval = gcol.nextToken ();
58971 if (gcol.hasMoreTokens ()) {
58972 gcol.nextToken ();
58973 }try {
58974 if (minval.length > 0) {
58975 min =  new Float (minval).floatValue ();
58976 }} catch (e) {
58977 if (Clazz_exceptionOf (e, Exception)) {
58978 System.err.println ("Couldn't parse the minimum value for graduated colour for type (" + colscheme + ") - did you misspell 'auto' for the optional automatic colour switch ?");
58979 e.printStackTrace ();
58980 } else {
58981 throw e;
58982 }
58983 }
58984 try {
58985 if (maxval.length > 0) {
58986 max =  new Float (maxval).floatValue ();
58987 }} catch (e) {
58988 if (Clazz_exceptionOf (e, Exception)) {
58989 System.err.println ("Couldn't parse the maximum value for graduated colour for type (" + colscheme + ")");
58990 e.printStackTrace ();
58991 } else {
58992 throw e;
58993 }
58994 }
58995 } else {
58996 mincol = "FFFFFF";
58997 maxcol = "000000";
58998 }try {
58999 colour =  new jalview.schemes.GraduatedColor ( new jalview.schemes.UserColourScheme (mincol).findColour ('A'),  new jalview.schemes.UserColourScheme (maxcol).findColour ('A'), min, max);
59000 } catch (e) {
59001 if (Clazz_exceptionOf (e, Exception)) {
59002 System.err.println ("Couldn't parse the graduated colour scheme (" + colscheme + ")");
59003 e.printStackTrace ();
59004 } else {
59005 throw e;
59006 }
59007 }
59008 if (colour != null) {
59009 (colour).setColourByLabel (labelCol);
59010 (colour).setAutoScaled (abso == null);
59011 var ttype = null;
59012 var tval = null;
59013 if (gcol.hasMoreTokens ()) {
59014 ttype = gcol.nextToken ();
59015 if (ttype.toLowerCase ().startsWith ("below")) {
59016 (colour).setThreshType (0);
59017 } else if (ttype.toLowerCase ().startsWith ("above")) {
59018 (colour).setThreshType (1);
59019 } else {
59020 (colour).setThreshType (-1);
59021 if (!ttype.toLowerCase ().startsWith ("no")) {
59022 System.err.println ("Ignoring unrecognised threshold type : " + ttype);
59023 }}}if ((colour).getThreshType () != -1) {
59024 try {
59025 gcol.nextToken ();
59026 tval = gcol.nextToken ();
59027 (colour).setThresh ( new Float (tval).floatValue ());
59028 } catch (e) {
59029 if (Clazz_exceptionOf (e, Exception)) {
59030 System.err.println ("Couldn't parse threshold value as a float: (" + tval + ")");
59031 e.printStackTrace ();
59032 } else {
59033 throw e;
59034 }
59035 }
59036 }if (gcol.hasMoreTokens ()) {
59037 System.err.println ("Ignoring additional tokens in parameters in graduated colour specification\n");
59038 while (gcol.hasMoreTokens ()) {
59039 System.err.println ("|" + gcol.nextToken ());
59040 }
59041 System.err.println ("\n");
59042 }}} else {
59043 var ucs =  new jalview.schemes.UserColourScheme (colscheme);
59044 colour = ucs.findColour ('A');
59045 }if (colour != null) {
59046 colours.put (type, colour);
59047 }if (st.hasMoreElements ()) {
59048 var link = st.nextToken ();
59049 typeLink.put (type, link);
59050 if (featureLink == null) {
59051 featureLink =  new java.util.Hashtable ();
59052 }featureLink.put (type, link);
59053 }}continue;
59054 }var seqId = "";
59055 while (st.hasMoreElements ()) {
59056 if (GFFFile) {
59057 seqId = token = st.nextToken ();
59058 seq = this.findName (align, seqId, relaxedIdmatching, newseqs);
59059 if (seq != null) {
59060 desc = st.nextToken ();
59061 var group = null;
59062 if (this.doGffSource && desc.indexOf (' ') == -1) {
59063 group =  String.instantialize (desc);
59064 }type = st.nextToken ();
59065 try {
59066 var stt = st.nextToken ();
59067 if (stt.length == 0 || stt.equals ("-")) {
59068 start = 0;
59069 } else {
59070 start = Integer.parseInt (stt);
59071 }} catch (ex) {
59072 if (Clazz_exceptionOf (ex, NumberFormatException)) {
59073 start = 0;
59074 } else {
59075 throw ex;
59076 }
59077 }
59078 try {
59079 var stt = st.nextToken ();
59080 if (stt.length == 0 || stt.equals ("-")) {
59081 end = 0;
59082 } else {
59083 end = Integer.parseInt (stt);
59084 }} catch (ex) {
59085 if (Clazz_exceptionOf (ex, NumberFormatException)) {
59086 end = 0;
59087 } else {
59088 throw ex;
59089 }
59090 }
59091 if (end == 0) {
59092 start = 0;
59093 }try {
59094 score =  new Float (st.nextToken ()).floatValue ();
59095 } catch (ex) {
59096 if (Clazz_exceptionOf (ex, NumberFormatException)) {
59097 score = 0;
59098 } else {
59099 throw ex;
59100 }
59101 }
59102 sf =  new jalview.datamodel.SequenceFeature (type, desc, start, end, score, group);
59103 try {
59104 sf.setValue ("STRAND", st.nextToken ());
59105 sf.setValue ("FRAME", st.nextToken ());
59106 } catch (ex) {
59107 if (Clazz_exceptionOf (ex, Exception)) {
59108 } else {
59109 throw ex;
59110 }
59111 }
59112 if (st.hasMoreTokens ()) {
59113 var attributes =  new StringBuffer ();
59114 var sep = false;
59115 while (st.hasMoreTokens ()) {
59116 attributes.append ((sep ? "\t" : "") + st.nextElement ());
59117 sep = true;
59118 }
59119 sf.setValue ("ATTRIBUTES", attributes.toString ());
59120 }if (this.processOrAddSeqFeature (align, newseqs, seq, sf, GFFFile, relaxedIdmatching)) {
59121 while ((seq = align.findName (seq, seqId, true)) != null) {
59122 seq.addSequenceFeature ( new jalview.datamodel.SequenceFeature (sf));
59123 }
59124 }break;
59125 }}if (GFFFile && seq == null) {
59126 desc = token;
59127 } else {
59128 desc = st.nextToken ();
59129 }if (!st.hasMoreTokens ()) {
59130 System.err.println ("DEBUG: Run out of tokens when trying to identify the destination for the feature.. giving up.");
59131 return false;
59132 }token = st.nextToken ();
59133 if (!token.equals ("ID_NOT_SPECIFIED")) {
59134 seq = this.findName (align, seqId = token, relaxedIdmatching, null);
59135 st.nextToken ();
59136 } else {
59137 seqId = null;
59138 try {
59139 index = Integer.parseInt (st.nextToken ());
59140 seq = align.getSequenceAt (index);
59141 } catch (ex) {
59142 if (Clazz_exceptionOf (ex, NumberFormatException)) {
59143 seq = null;
59144 } else {
59145 throw ex;
59146 }
59147 }
59148 }if (seq == null) {
59149 System.out.println ("Sequence not found: " + line);
59150 break;
59151 }start = Integer.parseInt (st.nextToken ());
59152 end = Integer.parseInt (st.nextToken ());
59153 type = st.nextToken ();
59154 if (!colours.containsKey (type)) {
59155 var ucs =  new jalview.schemes.UserColourScheme (type);
59156 colours.put (type, ucs.findColour ('A'));
59157 }sf =  new jalview.datamodel.SequenceFeature (type, desc, "", start, end, featureGroup);
59158 if (st.hasMoreTokens ()) {
59159 try {
59160 score =  new Float (st.nextToken ()).floatValue ();
59161 } catch (ex) {
59162 if (Clazz_exceptionOf (ex, NumberFormatException)) {
59163 score = 0;
59164 } else {
59165 throw ex;
59166 }
59167 }
59168 sf.setScore (score);
59169 }if (groupLink != null && removeHTML) {
59170 sf.addLink (groupLink);
59171 sf.description += "%LINK%";
59172 }if (typeLink.containsKey (type) && removeHTML) {
59173 sf.addLink (typeLink.get (type).toString ());
59174 sf.description += "%LINK%";
59175 }this.parseDescriptionHTML (sf, removeHTML);
59176 seq.addSequenceFeature (sf);
59177 while (seqId != null && (seq = align.findName (seq, seqId, false)) != null) {
59178 seq.addSequenceFeature ( new jalview.datamodel.SequenceFeature (sf));
59179 }
59180 GFFFile = false;
59181 }
59182 }
59183 this.resetMatcher ();
59184 } catch (ex) {
59185 if (Clazz_exceptionOf (ex, Exception)) {
59186 this.warningMessage = ((this.warningMessage == null) ? "" : this.warningMessage) + "Parsing error at\n" + line;
59187 System.out.println ("Error parsing feature file: " + ex + "\n" + line);
59188 ex.printStackTrace (System.err);
59189 this.resetMatcher ();
59190 return false;
59191 } else {
59192 throw ex;
59193 }
59194 }
59195 return true;
59196 }, "jalview.datamodel.AlignmentI,java.util.Map,java.util.Map,~B,~B");
59197 Clazz_defineMethod (c$, "processGffPragma", 
59198  function (line, gffProps, align, newseqs) {
59199 var spacepos = line.indexOf (' ');
59200 var pragma = spacepos == -1 ? line.substring (2).trim () : line.substring (2, spacepos);
59201 var gffpragma = jalview.io.FeaturesFile.GFFPRAGMA.get (pragma.toLowerCase ());
59202 if (gffpragma == null) {
59203 return;
59204 }switch (gffpragma) {
59205 case jalview.io.FeaturesFile.GffPragmas.gff_version:
59206 try {
59207 this.gffversion = Integer.parseInt (line.substring (spacepos + 1));
59208 } finally {
59209 }
59210 break;
59211 case jalview.io.FeaturesFile.GffPragmas.feature_ontology:
59212 break;
59213 case jalview.io.FeaturesFile.GffPragmas.attribute_ontology:
59214 break;
59215 case jalview.io.FeaturesFile.GffPragmas.source_ontology:
59216 break;
59217 case jalview.io.FeaturesFile.GffPragmas.species_build:
59218 break;
59219 case jalview.io.FeaturesFile.GffPragmas.hash:
59220 break;
59221 case jalview.io.FeaturesFile.GffPragmas.fasta:
59222 this.process_as_fasta (align, newseqs);
59223 break;
59224 default:
59225 System.err.println ("Ignoring unknown pragma:\n" + line);
59226 }
59227 }, "~S,java.util.Map,jalview.datamodel.AlignmentI,java.util.ArrayList");
59228 Clazz_defineMethod (c$, "process_as_fasta", 
59229  function (align, newseqs) {
59230 try {
59231 this.mark ();
59232 } catch (q) {
59233 if (Clazz_exceptionOf (q, java.io.IOException)) {
59234 } else {
59235 throw q;
59236 }
59237 }
59238 var parser = jalview.jsdev.GenericFileAdapter.getFile ("FastaFile", []);
59239 var includedseqs = parser.getSeqs ();
59240 var smatcher =  new jalview.analysis.SequenceIdMatcher (newseqs);
59241 for (var p = 0, pSize = includedseqs.size (); p < pSize; p++) {
59242 var dummyseq = smatcher.findIdMatch (includedseqs.get (p));
59243 if (dummyseq != null) {
59244 var mseq = includedseqs.get (p);
59245 if (Clazz_instanceOf (dummyseq, jalview.datamodel.SequenceDummy)) {
59246 (dummyseq).become (mseq);
59247 includedseqs.set (p, dummyseq);
59248 }}}
59249 for (var seq, $seq = includedseqs.iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
59250 align.addSequence (seq);
59251 }
59252 }, "jalview.datamodel.AlignmentI,java.util.List");
59253 Clazz_defineMethod (c$, "processOrAddSeqFeature", 
59254 function (align, newseqs, seq, sf, gFFFile, relaxedIdMatching) {
59255 var attr = sf.getValue ("ATTRIBUTES");
59256 var add = true;
59257 if (gFFFile && attr != null) {
59258 var nattr = 8;
59259 for (var attset, $attset = 0, $$attset = attr.$plit ("\t"); $attset < $$attset.length && ((attset = $$attset[$attset]) || true); $attset++) {
59260 if (attset == null || attset.trim ().length == 0) {
59261 continue;
59262 }nattr++;
59263 var set =  new java.util.HashMap ();
59264 for (var pair, $pair = 0, $$pair = attset.trim ().$plit (";"); $pair < $$pair.length && ((pair = $$pair[$pair]) || true); $pair++) {
59265 pair = pair.trim ();
59266 if (pair.length == 0) {
59267 continue;
59268 }var eqpos = pair.indexOf ('=');
59269 var sppos = pair.indexOf (' ');
59270 var key = null;
59271 var value = null;
59272 if (sppos > -1 && (eqpos == -1 || sppos < eqpos)) {
59273 key = pair.substring (0, sppos);
59274 value = pair.substring (sppos + 1);
59275 } else {
59276 if (eqpos > -1 && (sppos == -1 || eqpos < sppos)) {
59277 key = pair.substring (0, eqpos);
59278 value = pair.substring (eqpos + 1);
59279 } else {
59280 key = pair;
59281 }}if (key != null) {
59282 var vals = set.get (key);
59283 if (vals == null) {
59284 vals =  new java.util.ArrayList ();
59285 set.put (key, vals);
59286 }if (value != null) {
59287 vals.add (value.trim ());
59288 }}}
59289 try {
59290 add = new Boolean (add & this.processGffKey (set, nattr, seq, sf, align, newseqs, relaxedIdMatching)).valueOf ();
59291 } catch (ivfe) {
59292 if (Clazz_exceptionOf (ivfe, jalview.io.FeaturesFile.InvalidGFF3FieldException)) {
59293 System.err.println (ivfe);
59294 } else {
59295 throw ivfe;
59296 }
59297 }
59298 }
59299 }if (add) {
59300 seq.addSequenceFeature (sf);
59301 }return add;
59302 }, "jalview.datamodel.AlignmentI,java.util.List,jalview.datamodel.SequenceI,jalview.datamodel.SequenceFeature,~B,~B");
59303 Clazz_defineMethod (c$, "processGffKey", 
59304 function (set, nattr, seq, sf, align, newseqs, relaxedIdMatching) {
59305 var attr;
59306 if (sf.getType ().equals ("similarity")) {
59307 var strand = sf.getStrand ();
59308 var querySeq = this.findNames (align, newseqs, relaxedIdMatching, set.get (attr = "Query"));
59309 if (querySeq == null || querySeq.size () != 1) {
59310 throw Clazz_innerTypeInstance (jalview.io.FeaturesFile.InvalidGFF3FieldException, this, null, attr, set, "Expecting exactly one sequence in Query field (got " + set.get (attr) + ")");
59311 }if (set.containsKey (attr = "Align")) {
59312 var alco =  new jalview.datamodel.AlignedCodonFrame ();
59313 var codonmapping = this.constructCodonMappingFromAlign (set, attr, strand);
59314 alco.addMap (seq, querySeq.get (0), codonmapping);
59315 align.addCodonFrame (alco);
59316 return false;
59317 }}return true;
59318 }, "java.util.Map,~N,jalview.datamodel.SequenceI,jalview.datamodel.SequenceFeature,jalview.datamodel.AlignmentI,java.util.List,~B");
59319 Clazz_defineMethod (c$, "constructCodonMappingFromAlign", 
59320  function (set, attr, strand) {
59321 if (strand == 0) {
59322 throw Clazz_innerTypeInstance (jalview.io.FeaturesFile.InvalidGFF3FieldException, this, null, attr, set, "Invalid strand for a codon mapping (cannot be 0)");
59323 }var fromrange =  new java.util.ArrayList ();
59324 var torange =  new java.util.ArrayList ();
59325 var lastppos = 0;
59326 var lastpframe = 0;
59327 for (var range, $range = set.get (attr).iterator (); $range.hasNext () && ((range = $range.next ()) || true);) {
59328 var ints =  new java.util.ArrayList ();
59329 var st =  new java.util.StringTokenizer (range, " ");
59330 while (st.hasMoreTokens ()) {
59331 var num = st.nextToken ();
59332 try {
59333 ints.add ( new Integer (num));
59334 } catch (nfe) {
59335 if (Clazz_exceptionOf (nfe, NumberFormatException)) {
59336 throw Clazz_innerTypeInstance (jalview.io.FeaturesFile.InvalidGFF3FieldException, this, null, attr, set, "Invalid number in field " + num);
59337 } else {
59338 throw nfe;
59339 }
59340 }
59341 }
59342 if (ints.size () != 3) {
59343 throw Clazz_innerTypeInstance (jalview.io.FeaturesFile.InvalidGFF3FieldException, this, null, attr, set, "Invalid number of fields for this attribute (" + ints.size () + ")");
59344 }fromrange.add ( new Integer (ints.get (0).intValue ()));
59345 fromrange.add ( new Integer (ints.get (0).intValue () + strand * ints.get (2).intValue ()));
59346 if (ints.get (1).equals (new Integer (lastppos)) && lastpframe > 0) {
59347 lastppos += (ints.get (2)).intValue () / 3;
59348 lastpframe = (ints.get (2)).intValue () % 3;
59349 torange.set (torange.size () - 1,  new Integer (lastppos));
59350 } else {
59351 torange.add (ints.get (1));
59352 lastppos = (ints.get (1)).intValue () + (ints.get (2)).intValue () / 3;
59353 lastpframe = (ints.get (2)).intValue () % 3;
59354 torange.add ( new Integer (lastppos));
59355 }}
59356 if (fromrange.size () % 2 == 1) {
59357 throw Clazz_innerTypeInstance (jalview.io.FeaturesFile.InvalidGFF3FieldException, this, null, attr, set, "Couldn't parse the DNA alignment range correctly");
59358 }if (torange.size () % 2 == 1) {
59359 throw Clazz_innerTypeInstance (jalview.io.FeaturesFile.InvalidGFF3FieldException, this, null, attr, set, "Couldn't parse the protein alignment range correctly");
59360 }var frommap =  Clazz_newIntArray (fromrange.size (), 0);
59361 var tomap =  Clazz_newIntArray (torange.size (), 0);
59362 var p = 0;
59363 for (var ip, $ip = fromrange.iterator (); $ip.hasNext () && ((ip = $ip.next ()) || true);) {
59364 frommap[p++] = ip.intValue ();
59365 }
59366 p = 0;
59367 for (var ip, $ip = torange.iterator (); $ip.hasNext () && ((ip = $ip.next ()) || true);) {
59368 tomap[p++] = ip.intValue ();
59369 }
59370 return  new jalview.util.MapList (frommap, tomap, 3, 1);
59371 }, "java.util.Map,~S,~N");
59372 Clazz_defineMethod (c$, "findNames", 
59373  function (align, newseqs, relaxedIdMatching, list) {
59374 var found =  new java.util.ArrayList ();
59375 for (var seqId, $seqId = list.iterator (); $seqId.hasNext () && ((seqId = $seqId.next ()) || true);) {
59376 var seq = this.findName (align, seqId, relaxedIdMatching, newseqs);
59377 if (seq != null) {
59378 found.add (seq);
59379 }}
59380 return found;
59381 }, "jalview.datamodel.AlignmentI,java.util.List,~B,java.util.List");
59382 Clazz_defineMethod (c$, "resetMatcher", 
59383  function () {
59384 this.lastmatchedAl = null;
59385 this.matcher = null;
59386 });
59387 Clazz_defineMethod (c$, "findName", 
59388  function (align, seqId, relaxedIdMatching, newseqs) {
59389 var match = null;
59390 if (relaxedIdMatching) {
59391 if (this.lastmatchedAl !== align) {
59392 this.matcher =  new jalview.analysis.SequenceIdMatcher ((this.lastmatchedAl = align).getSequencesArray ());
59393 if (newseqs != null) {
59394 this.matcher.addAll (newseqs);
59395 }}match = this.matcher.findIdMatch (seqId);
59396 } else {
59397 match = align.findName (seqId, true);
59398 if (match == null && newseqs != null) {
59399 for (var m, $m = newseqs.iterator (); $m.hasNext () && ((m = $m.next ()) || true);) {
59400 if (seqId.equals (m.getName ())) {
59401 return m;
59402 }}
59403 }}if (match == null && newseqs != null) {
59404 match =  new jalview.datamodel.SequenceDummy (seqId);
59405 if (relaxedIdMatching) {
59406 this.matcher.addAll (java.util.Arrays.asList ( Clazz_newArray (-1, [match])));
59407 }newseqs.add (match);
59408 }return match;
59409 }, "jalview.datamodel.AlignmentI,~S,~B,java.util.List");
59410 Clazz_defineMethod (c$, "parseDescriptionHTML", 
59411 function (sf, removeHTML) {
59412 if (sf.getDescription () == null) {
59413 return;
59414 }var parsed =  new jalview.util.ParseHtmlBodyAndLinks (sf.getDescription (), removeHTML, this.newline);
59415 sf.description = (removeHTML) ? parsed.getNonHtmlContent () : sf.description;
59416 for (var link, $link = parsed.getLinks ().iterator (); $link.hasNext () && ((link = $link.next ()) || true);) {
59417 sf.addLink (link);
59418 }
59419 }, "jalview.datamodel.SequenceFeature,~B");
59420 Clazz_defineMethod (c$, "printJalviewFormat", 
59421 function (seqs, visible) {
59422 return this.printJalviewFormat (seqs, visible, true, true);
59423 }, "~A,java.util.Map");
59424 Clazz_defineMethod (c$, "printJalviewFormat", 
59425 function (seqs, visible, visOnly, nonpos) {
59426 var out =  new StringBuffer ();
59427 var next;
59428 var featuresGen = false;
59429 if (visOnly && !nonpos && (visible == null || visible.size () < 1)) {
59430 return "No Features Visible";
59431 }if (visible != null && visOnly) {
59432 var en = visible.keySet ().iterator ();
59433 var type;
59434 var color;
59435 while (en.hasNext ()) {
59436 type = en.next ().toString ();
59437 if (Clazz_instanceOf (visible.get (type), jalview.schemes.GraduatedColor)) {
59438 var gc = visible.get (type);
59439 color = (gc.isColourByLabel () ? "label|" : "") + jalview.util.Format.getHexString (gc.getMinColor ()) + "|" + jalview.util.Format.getHexString (gc.getMaxColor ()) + (gc.isAutoScale () ? "|" : "|abso|") + gc.getMin () + "|" + gc.getMax () + "|";
59440 if (gc.getThreshType () != -1) {
59441 if (gc.getThreshType () == 0) {
59442 color += "below";
59443 } else {
59444 if (gc.getThreshType () != 1) {
59445 System.err.println ("WARNING: Unsupported threshold type (" + gc.getThreshType () + ") : Assuming 'above'");
59446 }color += "above";
59447 }color += "|" + gc.getThresh ();
59448 } else {
59449 color += "none";
59450 }} else if (Clazz_instanceOf (visible.get (type), java.awt.Color)) {
59451 color = jalview.util.Format.getHexString (visible.get (type));
59452 } else {
59453 color = jalview.util.Format.getHexString ( new java.awt.Color (Integer.parseInt (visible.get (type).toString ())));
59454 }out.append (type);
59455 out.append ("\t");
59456 out.append (color);
59457 out.append (this.newline);
59458 }
59459 }var groups =  new java.util.Vector ();
59460 var groupIndex = 0;
59461 var isnonpos = false;
59462 for (var i = 0; i < seqs.length; i++) {
59463 next = seqs[i].getSequenceFeatures ();
59464 if (next != null) {
59465 for (var j = 0; j < next.length; j++) {
59466 isnonpos = next[j].begin == 0 && next[j].end == 0;
59467 if ((!nonpos && isnonpos) || (!isnonpos && visOnly && !visible.containsKey (next[j].type))) {
59468 continue;
59469 }if (next[j].featureGroup != null && !groups.contains (next[j].featureGroup)) {
59470 groups.addElement (next[j].featureGroup);
59471 }}
59472 }}
59473 var group = null;
59474 do {
59475 if (groups.size () > 0 && groupIndex < groups.size ()) {
59476 group = groups.elementAt (groupIndex).toString ();
59477 out.append (this.newline);
59478 out.append ("STARTGROUP\t");
59479 out.append (group);
59480 out.append (this.newline);
59481 } else {
59482 group = null;
59483 }for (var i = 0; i < seqs.length; i++) {
59484 next = seqs[i].getSequenceFeatures ();
59485 if (next != null) {
59486 for (var j = 0; j < next.length; j++) {
59487 isnonpos = next[j].begin == 0 && next[j].end == 0;
59488 if ((!nonpos && isnonpos) || (!isnonpos && visOnly && !visible.containsKey (next[j].type))) {
59489 continue;
59490 }if (group != null && (next[j].featureGroup == null || !next[j].featureGroup.equals (group))) {
59491 continue;
59492 }if (group == null && next[j].featureGroup != null) {
59493 continue;
59494 }featuresGen = true;
59495 if (next[j].description == null || next[j].description.equals ("")) {
59496 out.append (next[j].type + "\t");
59497 } else {
59498 if (next[j].links != null && next[j].getDescription ().indexOf ("<html>") == -1) {
59499 out.append ("<html>");
59500 }out.append (next[j].description + " ");
59501 if (next[j].links != null) {
59502 for (var l = 0; l < next[j].links.size (); l++) {
59503 var label = next[j].links.elementAt (l).toString ();
59504 var href = label.substring (label.indexOf ("|") + 1);
59505 label = label.substring (0, label.indexOf ("|"));
59506 if (next[j].description.indexOf (href) == -1) {
59507 out.append ("<a href=\"" + href + "\">" + label + "</a>");
59508 }}
59509 if (next[j].getDescription ().indexOf ("</html>") == -1) {
59510 out.append ("</html>");
59511 }}out.append ("\t");
59512 }out.append (seqs[i].getName ());
59513 out.append ("\t-1\t");
59514 out.append ("" + next[j].begin);
59515 out.append ("\t");
59516 out.append ("" + next[j].end);
59517 out.append ("\t");
59518 out.append (next[j].type);
59519 if (!Float.isNaN (next[j].score)) {
59520 out.append ("\t");
59521 out.append (next[j].score);
59522 }out.append (this.newline);
59523 }
59524 }}
59525 if (group != null) {
59526 out.append ("ENDGROUP\t");
59527 out.append (group);
59528 out.append (this.newline);
59529 groupIndex++;
59530 } else {
59531 break;
59532 }} while (groupIndex < groups.size () + 1);
59533 if (!featuresGen) {
59534 return "No Features Visible";
59535 }return out.toString ();
59536 }, "~A,java.util.Map,~B,~B");
59537 Clazz_defineMethod (c$, "printGFFFormat", 
59538 function (seqs, visible) {
59539 return this.printGFFFormat (seqs, visible, true, true);
59540 }, "~A,java.util.Map");
59541 Clazz_defineMethod (c$, "printGFFFormat", 
59542 function (seqs, visible, visOnly, nonpos) {
59543 var out =  new StringBuffer ();
59544 var next;
59545 var source;
59546 var isnonpos;
59547 for (var i = 0; i < seqs.length; i++) {
59548 if (seqs[i].getSequenceFeatures () != null) {
59549 next = seqs[i].getSequenceFeatures ();
59550 for (var j = 0; j < next.length; j++) {
59551 isnonpos = next[j].begin == 0 && next[j].end == 0;
59552 if ((!nonpos && isnonpos) || (!isnonpos && visOnly && !visible.containsKey (next[j].type))) {
59553 continue;
59554 }source = next[j].featureGroup;
59555 if (source == null) {
59556 source = next[j].getDescription ();
59557 }out.append (seqs[i].getName ());
59558 out.append ("\t");
59559 out.append (source);
59560 out.append ("\t");
59561 out.append (next[j].type);
59562 out.append ("\t");
59563 out.append ("" + next[j].begin);
59564 out.append ("\t");
59565 out.append ("" + next[j].end);
59566 out.append ("\t");
59567 out.append (next[j].score);
59568 out.append ("\t");
59569 if (next[j].getValue ("STRAND") != null) {
59570 out.append (next[j].getValue ("STRAND"));
59571 out.append ("\t");
59572 } else {
59573 out.append (".\t");
59574 }if (next[j].getValue ("FRAME") != null) {
59575 out.append (next[j].getValue ("FRAME"));
59576 } else {
59577 out.append (".");
59578 }if (next[j].getValue ("ATTRIBUTES") != null) {
59579 out.append (next[j].getValue ("ATTRIBUTES"));
59580 }out.append (this.newline);
59581 }
59582 }}
59583 return out.toString ();
59584 }, "~A,java.util.Map,~B,~B");
59585 Clazz_defineMethod (c$, "parse", 
59586 function () {
59587 });
59588 Clazz_overrideMethod (c$, "print", 
59589 function () {
59590 return "USE printGFFFormat() or printJalviewFormat()";
59591 });
59592 c$.$FeaturesFile$InvalidGFF3FieldException$ = function () {
59593 Clazz_pu$h(self.c$);
59594 c$ = Clazz_decorateAsClass (function () {
59595 Clazz_prepareCallback (this, arguments);
59596 this.field = null;
59597 this.value = null;
59598 Clazz_instantialize (this, arguments);
59599 }, jalview.io.FeaturesFile, "InvalidGFF3FieldException", Exception);
59600 Clazz_makeConstructor (c$, 
59601 function (a, b, c) {
59602 Clazz_superConstructor (this, jalview.io.FeaturesFile.InvalidGFF3FieldException, [c + " (Field was " + a + " and value was " + b.get (a).toString ()]);
59603 this.field = a;
59604 this.value = b.get (a).toString ();
59605 }, "~S,java.util.Map,~S");
59606 c$ = Clazz_p0p ();
59607 };
59608 Clazz_pu$h(self.c$);
59609 c$ = Clazz_declareType (jalview.io.FeaturesFile, "GffPragmas", Enum);
59610 Clazz_defineEnumConstant (c$, "gff_version", 0, []);
59611 Clazz_defineEnumConstant (c$, "sequence_region", 1, []);
59612 Clazz_defineEnumConstant (c$, "feature_ontology", 2, []);
59613 Clazz_defineEnumConstant (c$, "attribute_ontology", 3, []);
59614 Clazz_defineEnumConstant (c$, "source_ontology", 4, []);
59615 Clazz_defineEnumConstant (c$, "species_build", 5, []);
59616 Clazz_defineEnumConstant (c$, "fasta", 6, []);
59617 Clazz_defineEnumConstant (c$, "hash", 7, []);
59618 c$ = Clazz_p0p ();
59619 Clazz_defineStatics (c$,
59620 "GFFPRAGMA", null);
59621 {
59622 jalview.io.FeaturesFile.GFFPRAGMA =  new java.util.HashMap ();
59623 jalview.io.FeaturesFile.GFFPRAGMA.put ("sequence-region", jalview.io.FeaturesFile.GffPragmas.sequence_region);
59624 jalview.io.FeaturesFile.GFFPRAGMA.put ("feature-ontology", jalview.io.FeaturesFile.GffPragmas.feature_ontology);
59625 jalview.io.FeaturesFile.GFFPRAGMA.put ("#", jalview.io.FeaturesFile.GffPragmas.hash);
59626 jalview.io.FeaturesFile.GFFPRAGMA.put ("fasta", jalview.io.FeaturesFile.GffPragmas.fasta);
59627 jalview.io.FeaturesFile.GFFPRAGMA.put ("species-build", jalview.io.FeaturesFile.GffPragmas.species_build);
59628 jalview.io.FeaturesFile.GFFPRAGMA.put ("source-ontology", jalview.io.FeaturesFile.GffPragmas.source_ontology);
59629 jalview.io.FeaturesFile.GFFPRAGMA.put ("attribute-ontology", jalview.io.FeaturesFile.GffPragmas.attribute_ontology);
59630 }});
59631 Clazz_declarePackage ("jalview.datamodel");
59632 Clazz_load (["jalview.datamodel.Sequence", "$.SequenceI"], "jalview.datamodel.SequenceDummy", null, function () {
59633 c$ = Clazz_decorateAsClass (function () {
59634 this.dummy = true;
59635 Clazz_instantialize (this, arguments);
59636 }, jalview.datamodel, "SequenceDummy", jalview.datamodel.Sequence, jalview.datamodel.SequenceI);
59637 Clazz_makeConstructor (c$, 
59638 function (sequenceId) {
59639 Clazz_superConstructor (this, jalview.datamodel.SequenceDummy, [sequenceId, "THISAPLACEHOLDER"]);
59640 }, "~S");
59641 Clazz_defineMethod (c$, "become", 
59642 function (mseq) {
59643 this.initSeqFrom (mseq, null);
59644 this.dummy = false;
59645 }, "jalview.datamodel.SequenceI");
59646 Clazz_defineMethod (c$, "isDummy", 
59647 function () {
59648 return this.dummy;
59649 });
59650 });
59651 Clazz_declarePackage ("java.awt.event");
59652 Clazz_load (["java.awt.event.MouseListener", "$.MouseMotionListener", "$.MouseWheelListener"], "java.awt.event.MouseAdapter", null, function () {
59653 c$ = Clazz_declareType (java.awt.event, "MouseAdapter", null, [java.awt.event.MouseListener, java.awt.event.MouseWheelListener, java.awt.event.MouseMotionListener]);
59654 Clazz_overrideMethod (c$, "mouseClicked", 
59655 function (e) {
59656 }, "java.awt.event.MouseEvent");
59657 Clazz_overrideMethod (c$, "mousePressed", 
59658 function (e) {
59659 }, "java.awt.event.MouseEvent");
59660 Clazz_overrideMethod (c$, "mouseReleased", 
59661 function (e) {
59662 }, "java.awt.event.MouseEvent");
59663 Clazz_overrideMethod (c$, "mouseEntered", 
59664 function (e) {
59665 }, "java.awt.event.MouseEvent");
59666 Clazz_overrideMethod (c$, "mouseExited", 
59667 function (e) {
59668 }, "java.awt.event.MouseEvent");
59669 Clazz_overrideMethod (c$, "mouseWheelMoved", 
59670 function (e) {
59671 }, "java.awt.event.MouseWheelEvent");
59672 Clazz_overrideMethod (c$, "mouseDragged", 
59673 function (e) {
59674 }, "java.awt.event.MouseEvent");
59675 Clazz_overrideMethod (c$, "mouseMoved", 
59676 function (e) {
59677 }, "java.awt.event.MouseEvent");
59678 });
59679 Clazz_declarePackage ("jalview.appletgui");
59680 Clazz_load (["awt2swing.Checkbox", "$.Panel", "jalview.api.FeatureSettingsControllerI", "java.awt.event.ActionListener", "$.AdjustmentListener", "$.ItemListener", "$.MouseListener", "$.MouseMotionListener"], "jalview.appletgui.FeatureSettings", ["awt2swing.Button", "$.Frame", "$.Label", "$.MenuItem", "$.PopupMenu", "$.ScrollPane", "$.Scrollbar", "$.Util", "jalview.appletgui.FeatureColourChooser", "$.UserDefinedColours", "jalview.bin.JalviewLite", "jalview.schemes.GraduatedColor", "jalview.util.MessageManager", "java.awt.BorderLayout", "$.Color", "$.Font", "$.GridLayout", "$.Toolkit", "java.awt.event.WindowAdapter", "java.lang.Boolean", "$.Error", "java.util.Vector"], function () {
59681 c$ = Clazz_decorateAsClass (function () {
59682 this.fr = null;
59683 this.ap = null;
59684 this.av = null;
59685 this.frame = null;
59686 this.groupPanel = null;
59687 this.featurePanel = null;
59688 this.scrollPane = null;
59689 this.linkImage = null;
59690 this.transparency = null;
59691 this.groupItemListener = null;
59692 this.selectedCheck = null;
59693 this.dragging = false;
59694 if (!Clazz_isClassDefined ("jalview.appletgui.FeatureSettings.MyCheckbox")) {
59695 jalview.appletgui.FeatureSettings.$FeatureSettings$MyCheckbox$ ();
59696 }
59697 Clazz_instantialize (this, arguments);
59698 }, jalview.appletgui, "FeatureSettings", awt2swing.Panel, [java.awt.event.ItemListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.ActionListener, java.awt.event.AdjustmentListener, jalview.api.FeatureSettingsControllerI]);
59699 Clazz_prepareFields (c$, function () {
59700 this.featurePanel =  new awt2swing.Panel ();
59701 this.groupItemListener = ((Clazz_isClassDefined ("jalview.appletgui.FeatureSettings$1") ? 0 : jalview.appletgui.FeatureSettings.$FeatureSettings$1$ ()), Clazz_innerTypeInstance (jalview.appletgui.FeatureSettings$1, this, null));
59702 });
59703 Clazz_makeConstructor (c$, 
59704 function (ap) {
59705 Clazz_superConstructor (this, jalview.appletgui.FeatureSettings, []);
59706 this.ap = ap;
59707 this.av = ap.av;
59708 ap.av.featureSettings = this;
59709 this.fr = ap.seqPanel.seqCanvas.getFeatureRenderer ();
59710 this.transparency =  new awt2swing.Scrollbar (0, 100 - Clazz_floatToInt (this.fr.getTransparency () * 100), 1, 1, 100);
59711 if (this.fr.isTransparencyAvailable ()) {
59712 this.transparency.addAdjustmentListener (this);
59713 } else {
59714 this.transparency.setEnabled (false);
59715 }var url = this.getClass ().getResource ("/images/link.gif");
59716 if (url != null) {
59717 this.linkImage = java.awt.Toolkit.getDefaultToolkit ().getImage (url);
59718 }if (this.av.isShowSequenceFeatures () || !this.fr.hasRenderOrder ()) {
59719 this.fr.findAllFeatures (true);
59720 }this.discoverAllFeatureData ();
59721 this.setLayout ( new java.awt.BorderLayout ());
59722 this.scrollPane =  new awt2swing.ScrollPane ();
59723 this.scrollPane.add (this.featurePanel);
59724 if (this.fr.getAllFeatureColours () != null && this.fr.getAllFeatureColours ().size () > 0) {
59725 this.add (this.scrollPane, "Center");
59726 }var invert =  new awt2swing.Button ("Invert Selection");
59727 invert.addActionListener (this);
59728 var lowerPanel =  new awt2swing.Panel ( new java.awt.GridLayout (2, 1, 5, 10));
59729 lowerPanel.add (invert);
59730 var tPanel =  new awt2swing.Panel ( new java.awt.BorderLayout ());
59731 if (this.fr.isTransparencyAvailable ()) {
59732 tPanel.add (this.transparency, "Center");
59733 tPanel.add ( new awt2swing.Label ("Transparency"), "East");
59734 } else {
59735 tPanel.add ( new awt2swing.Label ("Transparency not available in this web browser"), "Center");
59736 }lowerPanel.add (tPanel, "South");
59737 this.add (lowerPanel, "South");
59738 if (this.groupPanel != null) {
59739 this.groupPanel.setLayout ( new java.awt.GridLayout (Clazz_doubleToInt ((this.fr.getFeatureGroupsSize ()) / 4) + 1, 4));
59740 this.groupPanel.validate ();
59741 this.add (this.groupPanel, "North");
59742 }this.frame =  new awt2swing.Frame ();
59743 this.frame.add (this);
59744 var me = this;
59745 this.frame.addWindowListener (((Clazz_isClassDefined ("jalview.appletgui.FeatureSettings$2") ? 0 : jalview.appletgui.FeatureSettings.$FeatureSettings$2$ ()), Clazz_innerTypeInstance (jalview.appletgui.FeatureSettings$2, this, Clazz_cloneFinals ("me", me))));
59746 var height = this.featurePanel.getComponentCount () * 50 + 60;
59747 height = Math.max (200, height);
59748 height = Math.min (400, height);
59749 var width = 300;
59750 jalview.bin.JalviewLite.addFrame (this.frame, jalview.util.MessageManager.getString ("label.feature_settings"), width, height);
59751 }, "jalview.appletgui.AlignmentPanel");
59752 Clazz_defineMethod (c$, "PaintComponent", 
59753 function (g) {
59754 g.setColor (java.awt.Color.black);
59755 awt2swing.Util.drawString (g, jalview.util.MessageManager.getString ("label.no_features_added_to_this_alignment"), 10, 20);
59756 awt2swing.Util.drawString (g, jalview.util.MessageManager.getString ("label.features_can_be_added_from_searches_1"), 10, 40);
59757 awt2swing.Util.drawString (g, jalview.util.MessageManager.getString ("label.features_can_be_added_from_searches_2"), 10, 60);
59758 }, "java.awt.Graphics");
59759 Clazz_defineMethod (c$, "popupSort", 
59760 function (check, minmax, x, y) {
59761 var type = check.type;
59762 var typeCol = this.fr.getFeatureStyle (type);
59763 var men =  new awt2swing.PopupMenu (jalview.util.MessageManager.formatMessage ("label.settings_for_type",  Clazz_newArray (-1, [type])));
59764 var scr =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.sort_by_score"));
59765 men.add (scr);
59766 var me = this;
59767 scr.addActionListener (((Clazz_isClassDefined ("jalview.appletgui.FeatureSettings$3") ? 0 : jalview.appletgui.FeatureSettings.$FeatureSettings$3$ ()), Clazz_innerTypeInstance (jalview.appletgui.FeatureSettings$3, this, Clazz_cloneFinals ("me", me, "type", type))));
59768 var dens =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.sort_by_density"));
59769 dens.addActionListener (((Clazz_isClassDefined ("jalview.appletgui.FeatureSettings$4") ? 0 : jalview.appletgui.FeatureSettings.$FeatureSettings$4$ ()), Clazz_innerTypeInstance (jalview.appletgui.FeatureSettings$4, this, Clazz_cloneFinals ("me", me, "type", type))));
59770 men.add (dens);
59771 if (minmax != null) {
59772 var typeMinMax = minmax.get (type);
59773 if (typeMinMax != null && (typeMinMax)[0] != null) {
59774 var mxcol =  new awt2swing.MenuItem ((Clazz_instanceOf (typeCol, java.awt.Color)) ? "Graduated Colour" : "Single Colour");
59775 men.add (mxcol);
59776 mxcol.addActionListener (((Clazz_isClassDefined ("jalview.appletgui.FeatureSettings$5") ? 0 : jalview.appletgui.FeatureSettings.$FeatureSettings$5$ ()), Clazz_innerTypeInstance (jalview.appletgui.FeatureSettings$5, this, Clazz_cloneFinals ("typeCol", typeCol, "me", me, "type", type, "check", check))));
59777 }}this.featurePanel.add (men);
59778 men.show (this.featurePanel, x, y);
59779 }, "jalview.appletgui.FeatureSettings.MyCheckbox,java.util.Hashtable,~N,~N");
59780 Clazz_overrideMethod (c$, "discoverAllFeatureData", 
59781 function () {
59782 if (this.fr.getAllFeatureColours () != null && this.fr.getAllFeatureColours ().size () > 0) {
59783 this.rebuildGroups ();
59784 }this.resetTable (false);
59785 });
59786 Clazz_defineMethod (c$, "rebuildGroups", 
59787 function () {
59788 var rdrw = false;
59789 if (this.groupPanel == null) {
59790 this.groupPanel =  new awt2swing.Panel ();
59791 } else {
59792 rdrw = true;
59793 this.groupPanel.removeAll ();
59794 }for (var group, $group = this.fr.getFeatureGroups ().iterator (); $group.hasNext () && ((group = $group.next ()) || true);) {
59795 var vis = this.fr.checkGroupVisibility (group, false);
59796 var check = Clazz_innerTypeInstance (jalview.appletgui.FeatureSettings.MyCheckbox, this, null, group, vis, (this.fr.featureLinks != null && this.fr.featureLinks.containsKey (group)));
59797 check.addMouseListener (this);
59798 check.setFont ( new java.awt.Font ("Serif", 1, 12));
59799 check.addItemListener (this.groupItemListener);
59800 check.setVisible (vis);
59801 this.groupPanel.add (check);
59802 }
59803 if (rdrw) {
59804 this.groupPanel.validate ();
59805 }});
59806 Clazz_defineMethod (c$, "resetTable", 
59807 function (groupsChanged) {
59808 var tmpfeatures;
59809 var group = null;
59810 var type;
59811 var visibleChecks =  new java.util.Vector ();
59812 var alignment = this.av.getAlignment ();
59813 for (var i = 0; i < alignment.getHeight (); i++) {
59814 if (alignment.getSequenceAt (i).getSequenceFeatures () == null) {
59815 continue;
59816 }tmpfeatures = alignment.getSequenceAt (i).getSequenceFeatures ();
59817 var index = 0;
59818 while (index < tmpfeatures.length) {
59819 group = tmpfeatures[index].featureGroup;
59820 if (group == null || this.fr.checkGroupVisibility (group, true)) {
59821 type = tmpfeatures[index].getType ();
59822 if (!visibleChecks.contains (type)) {
59823 visibleChecks.addElement (type);
59824 }}index++;
59825 }
59826 }
59827 var comps;
59828 var cSize = this.featurePanel.getComponentCount ();
59829 var check;
59830 for (var i = 0; i < cSize; i++) {
59831 comps = this.featurePanel.getComponents ();
59832 check = comps[i];
59833 if (!visibleChecks.contains (check.type)) {
59834 this.featurePanel.remove (i);
59835 cSize--;
59836 i--;
59837 }}
59838 if (this.fr.getRenderOrder () != null) {
59839 var rol = this.fr.getRenderOrder ();
59840 for (var ro = rol.size () - 1; ro > -1; ro--) {
59841 var item = rol.get (ro);
59842 if (!visibleChecks.contains (item)) {
59843 continue;
59844 }visibleChecks.removeElement (item);
59845 this.addCheck (false, item);
59846 }
59847 }var en = visibleChecks.elements ();
59848 while (en.hasMoreElements ()) {
59849 this.addCheck (groupsChanged, en.nextElement ().toString ());
59850 }
59851 this.featurePanel.setLayout ( new java.awt.GridLayout (this.featurePanel.getComponentCount (), 1, 10, 5));
59852 this.featurePanel.validate ();
59853 if (this.scrollPane != null) {
59854 this.scrollPane.validate ();
59855 }this.itemStateChanged (null);
59856 }, "~B");
59857 Clazz_defineMethod (c$, "addCheck", 
59858 function (groupsChanged, type) {
59859 var addCheck;
59860 var comps = this.featurePanel.getComponents ();
59861 var check;
59862 addCheck = true;
59863 for (var i = 0; i < this.featurePanel.getComponentCount (); i++) {
59864 check = comps[i];
59865 if (check.type.equals (type)) {
59866 addCheck = false;
59867 break;
59868 }}
59869 if (addCheck) {
59870 var selected = false;
59871 if (groupsChanged || this.av.getFeaturesDisplayed ().isVisible (type)) {
59872 selected = true;
59873 }check = Clazz_innerTypeInstance (jalview.appletgui.FeatureSettings.MyCheckbox, this, null, type, selected, (this.fr.featureLinks != null && this.fr.featureLinks.containsKey (type)), this.fr.getFeatureStyle (type));
59874 check.addMouseListener (this);
59875 check.addMouseMotionListener (this);
59876 check.addItemListener (this);
59877 if (groupsChanged) {
59878 this.featurePanel.add (check, 0);
59879 } else {
59880 this.featurePanel.add (check);
59881 }}}, "~B,~S");
59882 Clazz_overrideMethod (c$, "actionPerformed", 
59883 function (evt) {
59884 for (var i = 0; i < this.featurePanel.getComponentCount (); i++) {
59885 var check = this.featurePanel.getComponent (i);
59886 check.setState (!check.getState ());
59887 }
59888 this.selectionChanged ();
59889 }, "java.awt.event.ActionEvent");
59890 Clazz_overrideMethod (c$, "itemStateChanged", 
59891 function (evt) {
59892 this.selectionChanged ();
59893 }, "java.awt.event.ItemEvent");
59894 Clazz_defineMethod (c$, "selectionChanged", 
59895 function () {
59896 var comps = this.featurePanel.getComponents ();
59897 var cSize = comps.length;
59898 var tmp =  Clazz_newArray (cSize, 3, null);
59899 var tmpSize = 0;
59900 for (var i = 0; i < cSize; i++) {
59901 var check = comps[i];
59902 tmp[tmpSize][0] = check.type;
59903 tmp[tmpSize][1] = this.fr.getFeatureStyle (check.type);
59904 tmp[tmpSize][2] =  new Boolean (check.getState ());
59905 tmpSize++;
59906 }
59907 var data =  Clazz_newArray (tmpSize, 3, null);
59908 System.arraycopy (tmp, 0, data, 0, tmpSize);
59909 this.fr.setFeaturePriority (data);
59910 this.ap.paintAlignment (true);
59911 });
59912 Clazz_overrideMethod (c$, "mousePressed", 
59913 function (evt) {
59914 this.selectedCheck = evt.getSource ();
59915 if (this.fr.featureLinks != null && this.fr.featureLinks.containsKey (this.selectedCheck.type)) {
59916 if (evt.getX () > this.selectedCheck.stringWidth + 20) {
59917 evt.consume ();
59918 }}}, "java.awt.event.MouseEvent");
59919 Clazz_overrideMethod (c$, "mouseDragged", 
59920 function (evt) {
59921 if ((evt.getSource ()).getParent () !== this.featurePanel) {
59922 return;
59923 }this.dragging = true;
59924 }, "java.awt.event.MouseEvent");
59925 Clazz_overrideMethod (c$, "mouseReleased", 
59926 function (evt) {
59927 if ((evt.getSource ()).getParent () !== this.featurePanel) {
59928 return;
59929 }var comp = null;
59930 var target = null;
59931 var height = evt.getY () + evt.getComponent ().getLocation ().y;
59932 if (height > this.featurePanel.getSize ().height) {
59933 comp = this.featurePanel.getComponent (this.featurePanel.getComponentCount () - 1);
59934 } else if (height < 0) {
59935 comp = this.featurePanel.getComponent (0);
59936 } else {
59937 comp = this.featurePanel.getComponentAt (evt.getX (), evt.getY () + evt.getComponent ().getLocation ().y);
59938 }if (comp != null && Clazz_instanceOf (comp, awt2swing.Checkbox)) {
59939 target = comp;
59940 }if (this.selectedCheck != null && target != null && this.selectedCheck !== target) {
59941 var targetIndex = -1;
59942 for (var i = 0; i < this.featurePanel.getComponentCount (); i++) {
59943 if (target === this.featurePanel.getComponent (i)) {
59944 targetIndex = i;
59945 break;
59946 }}
59947 this.featurePanel.remove (this.selectedCheck);
59948 this.featurePanel.add (this.selectedCheck, targetIndex);
59949 this.featurePanel.validate ();
59950 this.itemStateChanged (null);
59951 }}, "java.awt.event.MouseEvent");
59952 Clazz_defineMethod (c$, "setUserColour", 
59953 function (feature, originalColour) {
59954 if (Clazz_instanceOf (originalColour, java.awt.Color) || Clazz_instanceOf (originalColour, jalview.schemes.GraduatedColor)) {
59955 this.fr.setColour (feature, originalColour);
59956 } else {
59957 throw  new Error (jalview.util.MessageManager.getString ("error.implementation_error_unsupported_feature_colour_object"));
59958 }this.refreshTable ();
59959 }, "~S,~O");
59960 Clazz_defineMethod (c$, "refreshTable", 
59961 function () {
59962 this.featurePanel.removeAll ();
59963 this.resetTable (false);
59964 this.ap.paintAlignment (true);
59965 });
59966 Clazz_overrideMethod (c$, "mouseEntered", 
59967 function (evt) {
59968 }, "java.awt.event.MouseEvent");
59969 Clazz_overrideMethod (c$, "mouseExited", 
59970 function (evt) {
59971 }, "java.awt.event.MouseEvent");
59972 Clazz_overrideMethod (c$, "mouseClicked", 
59973 function (evt) {
59974 var check = evt.getSource ();
59975 if ((evt.getModifiers () & 4) != 0) {
59976 this.popupSort (check, this.fr.getMinMax (), evt.getX (), evt.getY ());
59977 }if (this.fr.featureLinks != null && this.fr.featureLinks.containsKey (check.type)) {
59978 if (evt.getX () > check.stringWidth + 20) {
59979 evt.consume ();
59980 var link = this.fr.featureLinks.get (check.type).toString ();
59981 this.ap.alignFrame.showURL (link.substring (link.indexOf ("|") + 1), link.substring (0, link.indexOf ("|")));
59982 }}if (check.getParent () !== this.featurePanel) {
59983 return;
59984 }if (evt.getClickCount () > 1) {
59985 var fcol = this.fr.getFeatureStyle (check.type);
59986 if (Clazz_instanceOf (fcol, java.awt.Color)) {
59987  new jalview.appletgui.UserDefinedColours (this, check.type, fcol);
59988 } else {
59989  new jalview.appletgui.FeatureColourChooser (this, check.type);
59990 check.updateColor (this.fr.getFeatureStyle (check.type));
59991 }}}, "java.awt.event.MouseEvent");
59992 Clazz_overrideMethod (c$, "mouseMoved", 
59993 function (evt) {
59994 }, "java.awt.event.MouseEvent");
59995 Clazz_overrideMethod (c$, "adjustmentValueChanged", 
59996 function (evt) {
59997 this.fr.setTransparency ((100 - this.transparency.getValue ()) / 100);
59998 this.ap.seqPanel.seqCanvas.repaint ();
59999 }, "java.awt.event.AdjustmentEvent");
60000 c$.$FeatureSettings$MyCheckbox$ = function () {
60001 Clazz_pu$h(self.c$);
60002 c$ = Clazz_decorateAsClass (function () {
60003 Clazz_prepareCallback (this, arguments);
60004 this.type = null;
60005 this.stringWidth = 0;
60006 this.hasLink = false;
60007 this.gcol = null;
60008 this.col = null;
60009 Clazz_instantialize (this, arguments);
60010 }, jalview.appletgui.FeatureSettings, "MyCheckbox", awt2swing.Checkbox);
60011 Clazz_defineMethod (c$, "updateColor", 
60012 function (a) {
60013 if (Clazz_instanceOf (a, java.awt.Color)) {
60014 this.col = a;
60015 this.gcol = null;
60016 } else if (Clazz_instanceOf (a, jalview.schemes.GraduatedColor)) {
60017 this.gcol = a;
60018 this.col = null;
60019 } else {
60020 throw  new Error (jalview.util.MessageManager.getString ("error.invalid_colour_for_mycheckbox"));
60021 }if (this.col != null) {
60022 this.setBackground (this.col);
60023 } else {
60024 var b = this.type;
60025 if (this.gcol.getThreshType () != -1) {
60026 b += " " + ((this.gcol.getThreshType () == 1) ? "(>)" : "(<)");
60027 }if (this.gcol.isColourByLabel ()) {
60028 this.setBackground (java.awt.Color.white);
60029 b += " (by Label)";
60030 } else {
60031 this.setBackground (this.gcol.getMinColor ());
60032 }this.setLabel (b);
60033 }this.repaint ();
60034 }, "~O");
60035 Clazz_makeConstructor (c$, 
60036 function (a, b, c) {
60037 Clazz_superConstructor (this, jalview.appletgui.FeatureSettings.MyCheckbox, [a, b]);
60038 this.type = a;
60039 var d = this.b$["jalview.appletgui.FeatureSettings"].av.nullFrame.getFontMetrics (this.b$["jalview.appletgui.FeatureSettings"].av.nullFrame.getFont ());
60040 this.stringWidth = d.stringWidth (a);
60041 this.hasLink = c;
60042 }, "~S,~B,~B");
60043 Clazz_makeConstructor (c$, 
60044 function (a, b, c, d) {
60045 this.construct (a, b, c);
60046 this.updateColor (d);
60047 }, "~S,~B,~B,~O");
60048 Clazz_defineMethod (c$, "PaintComponent", 
60049 function (a) {
60050 var b = this.getSize ();
60051 if (this.gcol != null) {
60052 if (this.gcol.isColourByLabel ()) {
60053 a.setColor (java.awt.Color.white);
60054 a.fillRect (Clazz_doubleToInt (b.width / 2), 0, Clazz_doubleToInt (b.width / 2), b.height);
60055 } else {
60056 var c = this.gcol.getMaxColor ();
60057 a.setColor (c);
60058 a.fillRect (Clazz_doubleToInt (b.width / 2), 0, Clazz_doubleToInt (b.width / 2), b.height);
60059 }}if (this.hasLink) {
60060 a.drawImage (this.b$["jalview.appletgui.FeatureSettings"].linkImage, this.stringWidth + 25, Clazz_doubleToInt ((this.getSize ().height - this.b$["jalview.appletgui.FeatureSettings"].linkImage.getHeight (this)) / 2), this);
60061 }}, "java.awt.Graphics");
60062 c$ = Clazz_p0p ();
60063 };
60064 c$.$FeatureSettings$1$ = function () {
60065 Clazz_pu$h(self.c$);
60066 c$ = Clazz_declareAnonymous (jalview.appletgui, "FeatureSettings$1", null, java.awt.event.ItemListener);
60067 Clazz_overrideMethod (c$, "itemStateChanged", 
60068 function (evt) {
60069 var source = evt.getSource ();
60070 this.b$["jalview.appletgui.FeatureSettings"].fr.setGroupVisibility (source.getLabel (), source.getState ());
60071 this.b$["jalview.appletgui.FeatureSettings"].ap.seqPanel.seqCanvas.repaint ();
60072 if (this.b$["jalview.appletgui.FeatureSettings"].ap.overviewPanel != null) {
60073 this.b$["jalview.appletgui.FeatureSettings"].ap.overviewPanel.updateOverviewImage ();
60074 }this.b$["jalview.appletgui.FeatureSettings"].resetTable (true);
60075 return;
60076 }, "java.awt.event.ItemEvent");
60077 c$ = Clazz_p0p ();
60078 };
60079 c$.$FeatureSettings$2$ = function () {
60080 Clazz_pu$h(self.c$);
60081 c$ = Clazz_declareAnonymous (jalview.appletgui, "FeatureSettings$2", java.awt.event.WindowAdapter);
60082 Clazz_overrideMethod (c$, "windowClosing", 
60083 function (e) {
60084 if (this.f$.me.av.featureSettings === this.f$.me) {
60085 this.f$.me.av.featureSettings = null;
60086 this.f$.me.ap = null;
60087 this.f$.me.av = null;
60088 }}, "java.awt.event.WindowEvent");
60089 c$ = Clazz_p0p ();
60090 };
60091 c$.$FeatureSettings$3$ = function () {
60092 Clazz_pu$h(self.c$);
60093 c$ = Clazz_declareAnonymous (jalview.appletgui, "FeatureSettings$3", null, java.awt.event.ActionListener);
60094 Clazz_overrideMethod (c$, "actionPerformed", 
60095 function (e) {
60096 this.f$.me.ap.alignFrame.avc.sortAlignmentByFeatureScore ( Clazz_newArray (-1, [this.f$.type]));
60097 }, "java.awt.event.ActionEvent");
60098 c$ = Clazz_p0p ();
60099 };
60100 c$.$FeatureSettings$4$ = function () {
60101 Clazz_pu$h(self.c$);
60102 c$ = Clazz_declareAnonymous (jalview.appletgui, "FeatureSettings$4", null, java.awt.event.ActionListener);
60103 Clazz_overrideMethod (c$, "actionPerformed", 
60104 function (e) {
60105 this.f$.me.ap.alignFrame.avc.sortAlignmentByFeatureDensity ( Clazz_newArray (-1, [this.f$.type]));
60106 }, "java.awt.event.ActionEvent");
60107 c$ = Clazz_p0p ();
60108 };
60109 c$.$FeatureSettings$5$ = function () {
60110 Clazz_pu$h(self.c$);
60111 c$ = Clazz_declareAnonymous (jalview.appletgui, "FeatureSettings$5", null, java.awt.event.ActionListener);
60112 Clazz_overrideMethod (c$, "actionPerformed", 
60113 function (e) {
60114 if (Clazz_instanceOf (this.f$.typeCol, java.awt.Color)) {
60115  new jalview.appletgui.FeatureColourChooser (this.f$.me, this.f$.type);
60116 this.f$.check.updateColor (this.b$["jalview.appletgui.FeatureSettings"].fr.getFeatureStyle (this.f$.type));
60117 } else {
60118  new jalview.appletgui.UserDefinedColours (this.f$.me, this.f$.check.type, (this.f$.typeCol));
60119 }}, "java.awt.event.ActionEvent");
60120 c$ = Clazz_p0p ();
60121 };
60122 });
60123 Clazz_declarePackage ("jalview.api");
60124 Clazz_declareInterface (jalview.api, "FeatureSettingsControllerI");
60125 Clazz_declarePackage ("jalview.appletgui");
60126 Clazz_load (["awt2swing.Panel", "java.awt.event.MouseListener", "$.MouseMotionListener", "java.lang.Thread", "java.util.Vector"], "jalview.appletgui.IdPanel", ["jalview.appletgui.APopupMenu", "$.IdCanvas", "$.PaintRefresher", "$.Tooltip", "jalview.datamodel.SequenceGroup", "jalview.util.UrlLink", "java.awt.BorderLayout", "java.lang.Float", "$.StringBuffer"], function () {
60127 c$ = Clazz_decorateAsClass (function () {
60128 this.idCanvas = null;
60129 this.av = null;
60130 this.alignPanel = null;
60131 this.scrollThread = null;
60132 this.lastid = -1;
60133 this.mouseDragging = false;
60134 this.links = null;
60135 this.tooltip = null;
60136 if (!Clazz_isClassDefined ("jalview.appletgui.IdPanel.ScrollThread")) {
60137 jalview.appletgui.IdPanel.$IdPanel$ScrollThread$ ();
60138 }
60139 Clazz_instantialize (this, arguments);
60140 }, jalview.appletgui, "IdPanel", awt2swing.Panel, [java.awt.event.MouseListener, java.awt.event.MouseMotionListener]);
60141 Clazz_prepareFields (c$, function () {
60142 this.links =  new java.util.Vector ();
60143 });
60144 Clazz_makeConstructor (c$, 
60145 function (av, parent) {
60146 Clazz_superConstructor (this, jalview.appletgui.IdPanel, []);
60147 this.setName ("idPanel");
60148 this.av = av;
60149 this.alignPanel = parent;
60150 this.idCanvas =  new jalview.appletgui.IdCanvas (av);
60151 this.setLayout ( new java.awt.BorderLayout ());
60152 this.add (this.idCanvas, "Center");
60153 this.idCanvas.addMouseListener (this);
60154 this.idCanvas.addMouseMotionListener (this);
60155 if (av.applet != null) {
60156 av.applet.getLinkParams (this.links);
60157 }{
60158 var srsPos = this.links.indexOf ("SRS|http://srs.ebi.ac.uk/srsbin/cgi-bin/wgetz?-newId+(([uniprot-all:$SEQUENCE_ID$]))+-view+SwissEntry");
60159 if (srsPos > -1) {
60160 this.links.setElementAt ("EMBL-EBI Search|http://www.ebi.ac.uk/ebisearch/search.ebi?db=allebi&query=$SEQUENCE_ID$", srsPos);
60161 }}if (this.links.size () < 1) {
60162 this.links =  new java.util.Vector ();
60163 this.links.addElement ("EMBL-EBI Search|http://www.ebi.ac.uk/ebisearch/search.ebi?db=allebi&query=$SEQUENCE_ID$");
60164 }}, "jalview.appletgui.AlignViewport,jalview.appletgui.AlignmentPanel");
60165 Clazz_overrideMethod (c$, "mouseMoved", 
60166 function (e) {
60167 var seq = this.alignPanel.seqPanel.findSeq (e);
60168 var sequence = this.av.getAlignment ().getSequenceAt (seq);
60169 var tooltiptext =  new StringBuffer ();
60170 if (sequence != null) {
60171 if (sequence.getDescription () != null) {
60172 tooltiptext.append (sequence.getDescription ());
60173 tooltiptext.append ("\n");
60174 }var sf = sequence.getSequenceFeatures ();
60175 for (var sl = 0; sf != null && sl < sf.length; sl++) {
60176 if (sf[sl].begin == sf[sl].end && sf[sl].begin == 0) {
60177 var nl = false;
60178 if (sf[sl].getFeatureGroup () != null) {
60179 tooltiptext.append (sf[sl].getFeatureGroup ());
60180 nl = true;
60181 };if (sf[sl].getType () != null) {
60182 tooltiptext.append (" ");
60183 tooltiptext.append (sf[sl].getType ());
60184 nl = true;
60185 };if (sf[sl].getDescription () != null) {
60186 tooltiptext.append (" ");
60187 tooltiptext.append (sf[sl].getDescription ());
60188 nl = true;
60189 };if (!Float.isNaN (sf[sl].getScore ()) && sf[sl].getScore () != 0) {
60190 tooltiptext.append (" Score = ");
60191 tooltiptext.append (sf[sl].getScore ());
60192 nl = true;
60193 };if (sf[sl].getStatus () != null && sf[sl].getStatus ().length > 0) {
60194 tooltiptext.append (" (");
60195 tooltiptext.append (sf[sl].getStatus ());
60196 tooltiptext.append (")");
60197 nl = true;
60198 };if (nl) {
60199 tooltiptext.append ("\n");
60200 }}}
60201 }if (tooltiptext.length () == 0) {
60202 if (this.tooltip != null) {
60203 this.tooltip.setVisible (false);
60204 }this.tooltip = null;
60205 tooltiptext = null;
60206 return;
60207 }if (this.tooltip == null) {
60208 this.tooltip =  new jalview.appletgui.Tooltip (sequence.getDisplayId (true) + "\n" + tooltiptext.toString (), this.idCanvas);
60209 } else {
60210 this.tooltip.setTip (sequence.getDisplayId (true) + "\n" + tooltiptext.toString ());
60211 }tooltiptext = null;
60212 }, "java.awt.event.MouseEvent");
60213 Clazz_overrideMethod (c$, "mouseDragged", 
60214 function (e) {
60215 this.mouseDragging = true;
60216 var seq = Math.max (0, this.alignPanel.seqPanel.findSeq (e));
60217 if (seq < this.lastid) {
60218 this.selectSeqs (this.lastid - 1, seq);
60219 } else if (seq > this.lastid) {
60220 this.selectSeqs (this.lastid + 1, seq);
60221 }this.lastid = seq;
60222 this.alignPanel.paintAlignment (false);
60223 }, "java.awt.event.MouseEvent");
60224 Clazz_overrideMethod (c$, "mouseClicked", 
60225 function (e) {
60226 if (e.getClickCount () < 2) {
60227 return;
60228 }var seq = this.alignPanel.seqPanel.findSeq (e);
60229 var sq = this.av.getAlignment ().getSequenceAt (seq);
60230 if (sq == null) {
60231 return;
60232 }var id = sq.getName ();
60233 var target = null;
60234 var url = null;
60235 var i = 0;
60236 while (url == null && i < this.links.size ()) {
60237 url = this.links.elementAt (i++).toString ();
60238 var urlLink = null;
60239 try {
60240 urlLink =  new jalview.util.UrlLink (url);
60241 target = urlLink.getTarget ();
60242 } catch (foo) {
60243 if (Clazz_exceptionOf (foo, Exception)) {
60244 System.err.println ("Exception for URLLink '" + url + "'");
60245 foo.printStackTrace ();
60246 url = null;
60247 continue;
60248 } else {
60249 throw foo;
60250 }
60251 }
60252 ;if (!urlLink.isValid ()) {
60253 System.err.println (urlLink.getInvalidMessage ());
60254 url = null;
60255 continue;
60256 }var urls = urlLink.makeUrls (id, true);
60257 if (urls == null || urls[0] == null || urls[0].length < 1) {
60258 url = null;
60259 continue;
60260 }url = urls[1];
60261 }
60262 try {
60263 this.alignPanel.alignFrame.showURL (url, target);
60264 } catch (ex) {
60265 if (Clazz_exceptionOf (ex, Exception)) {
60266 ex.printStackTrace ();
60267 } else {
60268 throw ex;
60269 }
60270 }
60271 }, "java.awt.event.MouseEvent");
60272 Clazz_overrideMethod (c$, "mouseEntered", 
60273 function (e) {
60274 if (this.scrollThread != null) {
60275 this.scrollThread.running = false;
60276 }}, "java.awt.event.MouseEvent");
60277 Clazz_overrideMethod (c$, "mouseExited", 
60278 function (e) {
60279 if (this.av.getWrapAlignment ()) {
60280 return;
60281 }if (this.mouseDragging && e.getY () < 0 && this.av.getStartSeq () > 0) {
60282 this.scrollThread = Clazz_innerTypeInstance (jalview.appletgui.IdPanel.ScrollThread, this, null, true);
60283 }if (this.mouseDragging && e.getY () >= this.getSize ().height && this.av.getAlignment ().getHeight () > this.av.getEndSeq ()) {
60284 this.scrollThread = Clazz_innerTypeInstance (jalview.appletgui.IdPanel.ScrollThread, this, null, false);
60285 }}, "java.awt.event.MouseEvent");
60286 Clazz_overrideMethod (c$, "mousePressed", 
60287 function (e) {
60288 if (e.getClickCount () > 1) {
60289 return;
60290 }var y = e.getY ();
60291 if (this.av.getWrapAlignment ()) {
60292 y -= 2 * this.av.getCharHeight ();
60293 }var seq = this.alignPanel.seqPanel.findSeq (e);
60294 if ((e.getModifiers () & 4) == 4) {
60295 var sq = this.av.getAlignment ().getSequenceAt (seq);
60296 var nlinks =  new java.util.Vector ();
60297 for (var l = 0, lSize = this.links.size (); l < lSize; l++) {
60298 nlinks.addElement (this.links.elementAt (l));
60299 }
60300 var sf = sq == null ? null : sq.getSequenceFeatures ();
60301 for (var sl = 0; sf != null && sl < sf.length; sl++) {
60302 if (sf[sl].begin == sf[sl].end && sf[sl].begin == 0) {
60303 if (sf[sl].links != null && sf[sl].links.size () > 0) {
60304 for (var l = 0, lSize = sf[sl].links.size (); l < lSize; l++) {
60305 nlinks.addElement (sf[sl].links.elementAt (l));
60306 }
60307 }}}
60308 var popup =  new jalview.appletgui.APopupMenu (this.alignPanel, sq, nlinks);
60309 this.add (popup);
60310 popup.show (this, e.getX (), e.getY ());
60311 return;
60312 }if ((this.av.getSelectionGroup () == null) || ((!e.isControlDown () && !e.isShiftDown ()) && this.av.getSelectionGroup () != null)) {
60313 this.av.setSelectionGroup ( new jalview.datamodel.SequenceGroup ());
60314 this.av.getSelectionGroup ().setStartRes (0);
60315 this.av.getSelectionGroup ().setEndRes (this.av.getAlignment ().getWidth () - 1);
60316 }if (e.isShiftDown () && this.lastid != -1) {
60317 this.selectSeqs (this.lastid, seq);
60318 } else {
60319 this.selectSeq (seq);
60320 }this.alignPanel.paintAlignment (false);
60321 }, "java.awt.event.MouseEvent");
60322 Clazz_defineMethod (c$, "selectSeq", 
60323 function (seq) {
60324 this.lastid = seq;
60325 var pickedSeq = this.av.getAlignment ().getSequenceAt (seq);
60326 this.av.getSelectionGroup ().addOrRemove (pickedSeq, true);
60327 }, "~N");
60328 Clazz_defineMethod (c$, "selectSeqs", 
60329 function (start, end) {
60330 this.lastid = start;
60331 if (end >= this.av.getAlignment ().getHeight ()) {
60332 end = this.av.getAlignment ().getHeight () - 1;
60333 }if (end < start) {
60334 var tmp = start;
60335 start = end;
60336 end = tmp;
60337 this.lastid = end;
60338 }if (this.av.getSelectionGroup () == null) {
60339 this.av.setSelectionGroup ( new jalview.datamodel.SequenceGroup ());
60340 }for (var i = start; i <= end; i++) {
60341 this.av.getSelectionGroup ().addSequence (this.av.getAlignment ().getSequenceAt (i), i == end);
60342 }
60343 }, "~N,~N");
60344 Clazz_overrideMethod (c$, "mouseReleased", 
60345 function (e) {
60346 if (this.scrollThread != null) {
60347 this.scrollThread.running = false;
60348 }if (this.av.getSelectionGroup () != null) {
60349 this.av.getSelectionGroup ().recalcConservation ();
60350 }this.mouseDragging = false;
60351 jalview.appletgui.PaintRefresher.Refresh (this, this.av.getSequenceSetId ());
60352 this.av.sendSelection ();
60353 }, "java.awt.event.MouseEvent");
60354 Clazz_defineMethod (c$, "highlightSearchResults", 
60355 function (list) {
60356 this.idCanvas.setHighlighted (list);
60357 if (list == null) {
60358 return;
60359 }var index = this.av.getAlignment ().findIndex (list.get (0));
60360 if (this.av.getStartSeq () > index || this.av.getEndSeq () < index) {
60361 this.alignPanel.setScrollValues (this.av.getStartRes (), index);
60362 }}, "java.util.List");
60363 c$.$IdPanel$ScrollThread$ = function () {
60364 Clazz_pu$h(self.c$);
60365 c$ = Clazz_decorateAsClass (function () {
60366 Clazz_prepareCallback (this, arguments);
60367 this.running = false;
60368 this.up = true;
60369 Clazz_instantialize (this, arguments);
60370 }, jalview.appletgui.IdPanel, "ScrollThread", Thread);
60371 Clazz_makeConstructor (c$, 
60372 function (a) {
60373 Clazz_superConstructor (this, jalview.appletgui.IdPanel.ScrollThread, []);
60374 this.up = a;
60375 this.start ();
60376 }, "~B");
60377 Clazz_defineMethod (c$, "stopScrolling", 
60378 function () {
60379 this.running = false;
60380 });
60381 Clazz_overrideMethod (c$, "run", 
60382 function () {
60383 this.running = true;
60384 while (this.running) {
60385 if (this.b$["jalview.appletgui.IdPanel"].alignPanel.scrollUp (this.up)) {
60386 var a = this.b$["jalview.appletgui.IdPanel"].av.getStartSeq ();
60387 if (!this.up) {
60388 a = this.b$["jalview.appletgui.IdPanel"].av.getEndSeq ();
60389 }if (a < this.b$["jalview.appletgui.IdPanel"].lastid) {
60390 this.b$["jalview.appletgui.IdPanel"].selectSeqs (this.b$["jalview.appletgui.IdPanel"].lastid - 1, a);
60391 } else if (a > this.b$["jalview.appletgui.IdPanel"].lastid && a < this.b$["jalview.appletgui.IdPanel"].av.getAlignment ().getHeight ()) {
60392 this.b$["jalview.appletgui.IdPanel"].selectSeqs (this.b$["jalview.appletgui.IdPanel"].lastid + 1, a);
60393 }this.b$["jalview.appletgui.IdPanel"].lastid = a;
60394 } else {
60395 this.running = false;
60396 }this.b$["jalview.appletgui.IdPanel"].alignPanel.paintAlignment (true);
60397 try {
60398 Thread.sleep (100);
60399 } catch (ex) {
60400 if (Clazz_exceptionOf (ex, Exception)) {
60401 } else {
60402 throw ex;
60403 }
60404 }
60405 }
60406 });
60407 c$ = Clazz_p0p ();
60408 };
60409 });
60410 Clazz_declarePackage ("jalview.appletgui");
60411 Clazz_load (["awt2swing.PopupMenu", "java.awt.event.ActionListener", "$.ItemListener", "awt2swing.CheckboxMenuItem", "$.Menu", "$.MenuItem", "jalview.util.MessageManager"], "jalview.appletgui.APopupMenu", ["awt2swing.Frame", "jalview.analysis.AAFrequency", "$.AlignmentAnnotationUtils", "$.AlignmentUtils", "$.Conservation", "jalview.appletgui.AppletJmol", "$.CutAndPasteTransfer", "$.EditNameDialog", "$.SliderPanel", "$.UserDefinedColours", "jalview.bin.JalviewLite", "jalview.commands.ChangeCaseCommand", "$.EditCommand", "jalview.datamodel.SequenceFeature", "jalview.io.AppletFormatAdapter", "$.SequenceAnnotationReport", "jalview.schemes.Blosum62ColourScheme", "$.BuriedColourScheme", "$.ClustalxColourScheme", "$.HelixColourScheme", "$.HydrophobicColourScheme", "$.NucleotideColourScheme", "$.PIDColourScheme", "$.ResidueProperties", "$.StrandColourScheme", "$.TaylorColourScheme", "$.TurnColourScheme", "$.ZappoColourScheme", "jalview.util.DBRefUtils", "$.UrlLink", "java.lang.StringBuffer", "$.StringBuilder", "java.util.Arrays", "$.Collections", "$.LinkedHashMap", "$.TreeMap"], function () {
60412 c$ = Clazz_decorateAsClass (function () {
60413 this.groupMenu = null;
60414 this.editGroupName = null;
60415 this.clustalColour = null;
60416 this.zappoColour = null;
60417 this.taylorColour = null;
60418 this.hydrophobicityColour = null;
60419 this.helixColour = null;
60420 this.strandColour = null;
60421 this.turnColour = null;
60422 this.buriedColour = null;
60423 this.abovePIDColour = null;
60424 this.userDefinedColour = null;
60425 this.PIDColour = null;
60426 this.BLOSUM62Colour = null;
60427 this.noColourmenuItem = null;
60428 this.conservationMenuItem = null;
60429 this.ap = null;
60430 this.unGroupMenuItem = null;
60431 this.createGroupMenuItem = null;
60432 this.nucleotideMenuItem = null;
60433 this.colourMenu = null;
60434 this.showBoxes = null;
60435 this.showText = null;
60436 this.showColourText = null;
60437 this.displayNonconserved = null;
60438 this.seqShowAnnotationsMenu = null;
60439 this.seqHideAnnotationsMenu = null;
60440 this.seqAddReferenceAnnotations = null;
60441 this.groupShowAnnotationsMenu = null;
60442 this.groupHideAnnotationsMenu = null;
60443 this.groupAddReferenceAnnotations = null;
60444 this.editMenu = null;
60445 this.copy = null;
60446 this.cut = null;
60447 this.toUpper = null;
60448 this.toLower = null;
60449 this.toggleCase = null;
60450 this.outputmenu = null;
60451 this.seqMenu = null;
60452 this.pdb = null;
60453 this.hideSeqs = null;
60454 this.repGroup = null;
60455 this.sequenceName = null;
60456 this.sequenceFeature = null;
60457 this.editSequence = null;
60458 this.sequenceDetails = null;
60459 this.selSeqDetails = null;
60460 this.makeReferenceSeq = null;
60461 this.seq = null;
60462 this.revealAll = null;
60463 this.revealSeq = null;
60464 this.revealSeq_index = -1;
60465 this.menu1 = null;
60466 Clazz_instantialize (this, arguments);
60467 }, jalview.appletgui, "APopupMenu", awt2swing.PopupMenu, [java.awt.event.ActionListener, java.awt.event.ItemListener]);
60468 Clazz_prepareFields (c$, function () {
60469 this.groupMenu =  new awt2swing.Menu ();
60470 this.editGroupName =  new awt2swing.MenuItem ();
60471 this.clustalColour =  new awt2swing.MenuItem ();
60472 this.zappoColour =  new awt2swing.MenuItem ();
60473 this.taylorColour =  new awt2swing.MenuItem ();
60474 this.hydrophobicityColour =  new awt2swing.MenuItem ();
60475 this.helixColour =  new awt2swing.MenuItem ();
60476 this.strandColour =  new awt2swing.MenuItem ();
60477 this.turnColour =  new awt2swing.MenuItem ();
60478 this.buriedColour =  new awt2swing.MenuItem ();
60479 this.abovePIDColour =  new awt2swing.CheckboxMenuItem ();
60480 this.userDefinedColour =  new awt2swing.MenuItem ();
60481 this.PIDColour =  new awt2swing.MenuItem ();
60482 this.BLOSUM62Colour =  new awt2swing.MenuItem ();
60483 this.noColourmenuItem =  new awt2swing.MenuItem ();
60484 this.conservationMenuItem =  new awt2swing.CheckboxMenuItem ();
60485 this.unGroupMenuItem =  new awt2swing.MenuItem ();
60486 this.createGroupMenuItem =  new awt2swing.MenuItem ();
60487 this.nucleotideMenuItem =  new awt2swing.MenuItem ();
60488 this.colourMenu =  new awt2swing.Menu ();
60489 this.showBoxes =  new awt2swing.CheckboxMenuItem ();
60490 this.showText =  new awt2swing.CheckboxMenuItem ();
60491 this.showColourText =  new awt2swing.CheckboxMenuItem ();
60492 this.displayNonconserved =  new awt2swing.CheckboxMenuItem ();
60493 this.seqShowAnnotationsMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("label.show_annotations"));
60494 this.seqHideAnnotationsMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("label.hide_annotations"));
60495 this.seqAddReferenceAnnotations =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.add_reference_annotations"));
60496 this.groupShowAnnotationsMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("label.show_annotations"));
60497 this.groupHideAnnotationsMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("label.hide_annotations"));
60498 this.groupAddReferenceAnnotations =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.add_reference_annotations"));
60499 this.editMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("action.edit"));
60500 this.copy =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("action.copy"));
60501 this.cut =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("action.cut"));
60502 this.toUpper =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.to_upper_case"));
60503 this.toLower =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.to_lower_case"));
60504 this.toggleCase =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.toggle_case"));
60505 this.outputmenu =  new awt2swing.Menu ();
60506 this.seqMenu =  new awt2swing.Menu ();
60507 this.pdb =  new awt2swing.MenuItem ();
60508 this.hideSeqs =  new awt2swing.MenuItem ();
60509 this.repGroup =  new awt2swing.MenuItem ();
60510 this.sequenceName =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.edit_name_description"));
60511 this.sequenceFeature =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.create_sequence_feature"));
60512 this.editSequence =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.edit_sequence"));
60513 this.sequenceDetails =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.sequence_details") + "...");
60514 this.selSeqDetails =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.sequence_details") + "...");
60515 this.makeReferenceSeq =  new awt2swing.MenuItem ();
60516 this.revealAll =  new awt2swing.MenuItem ();
60517 this.revealSeq =  new awt2swing.MenuItem ();
60518 this.menu1 =  new awt2swing.Menu ();
60519 });
60520 Clazz_makeConstructor (c$, 
60521 function (apanel, seq, links) {
60522 Clazz_superConstructor (this, jalview.appletgui.APopupMenu, []);
60523 this.ap = apanel;
60524 this.seq = seq;
60525 try {
60526 this.jbInit ();
60527 } catch (e) {
60528 if (Clazz_exceptionOf (e, Exception)) {
60529 e.printStackTrace ();
60530 } else {
60531 throw e;
60532 }
60533 }
60534 for (var i = 0; i < jalview.io.AppletFormatAdapter.WRITEABLE_FORMATS.length; i++) {
60535 var item =  new awt2swing.MenuItem (jalview.io.AppletFormatAdapter.WRITEABLE_FORMATS[i]);
60536 item.addActionListener (this);
60537 this.outputmenu.add (item);
60538 }
60539 this.buildAnnotationSubmenus ();
60540 var sg = this.ap.av.getSelectionGroup ();
60541 if (sg != null && sg.getSize () > 0) {
60542 this.editGroupName.setLabel (jalview.util.MessageManager.formatMessage ("label.name_param",  Clazz_newArray (-1, [sg.getName ()])));
60543 this.showText.setState (sg.getDisplayText ());
60544 this.showColourText.setState (sg.getColourText ());
60545 this.showBoxes.setState (sg.getDisplayBoxes ());
60546 this.displayNonconserved.setState (sg.getShowNonconserved ());
60547 if (!this.ap.av.getAlignment ().getGroups ().contains (sg)) {
60548 this.menu1.setLabel (jalview.util.MessageManager.getString ("action.edit_new_group"));
60549 this.groupMenu.remove (this.unGroupMenuItem);
60550 } else {
60551 this.menu1.setLabel (jalview.util.MessageManager.getString ("action.edit_group"));
60552 this.groupMenu.remove (this.createGroupMenuItem);
60553 }} else {
60554 this.remove (this.hideSeqs);
60555 this.remove (this.groupMenu);
60556 }if (links != null && links.size () > 0) {
60557 var linkMenu =  new awt2swing.Menu (jalview.util.MessageManager.getString ("action.link"));
60558 for (var i = 0; i < links.size (); i++) {
60559 var link = links.elementAt (i);
60560 var urlLink =  new jalview.util.UrlLink (link);
60561 if (!urlLink.isValid ()) {
60562 System.err.println (urlLink.getInvalidMessage ());
60563 continue;
60564 }var target = urlLink.getTarget ();
60565 var label = urlLink.getLabel ();
60566 if (seq != null && urlLink.isDynamic ()) {
60567 var dbr = jalview.util.DBRefUtils.selectRefs (seq.getDBRef (),  Clazz_newArray (-1, [target]));
60568 var id = seq.getName ();
60569 var descr = seq.getDescription ();
60570 if (descr != null && descr.length < 1) {
60571 descr = null;
60572 }if (dbr != null) {
60573 for (var r = 0; r < dbr.length; r++) {
60574 if (id != null && dbr[r].getAccessionId ().equals (id)) {
60575 id = null;
60576 }var urls = urlLink.makeUrls (dbr[r].getAccessionId (), true);
60577 if (urls != null) {
60578 for (var u = 0; u < urls.length; u += 2) {
60579 this.addshowLink (linkMenu, label + "|" + urls[u], urls[u + 1]);
60580 }
60581 }}
60582 }if (id != null) {
60583 var urls = urlLink.makeUrls (id, true);
60584 if (urls != null) {
60585 for (var u = 0; u < urls.length; u += 2) {
60586 this.addshowLink (linkMenu, label, urls[u + 1]);
60587 }
60588 }}if (descr != null && urlLink.getRegexReplace () != null) {
60589 var urls = urlLink.makeUrls (descr, true);
60590 if (urls != null) {
60591 for (var u = 0; u < urls.length; u += 2) {
60592 this.addshowLink (linkMenu, label, urls[u + 1]);
60593 }
60594 }}} else {
60595 this.addshowLink (linkMenu, target, urlLink.getUrl_prefix ());
60596 }}
60597 if (linkMenu.getItemCount () > 0) {
60598 if (seq != null) {
60599 this.seqMenu.add (linkMenu);
60600 } else {
60601 this.add (linkMenu);
60602 }}}if (seq != null) {
60603 this.seqMenu.setLabel (seq.getName ());
60604 if (seq === this.ap.av.getAlignment ().getSeqrep ()) {
60605 this.makeReferenceSeq.setLabel (jalview.util.MessageManager.getString ("action.unmark_as_reference"));
60606 } else {
60607 this.makeReferenceSeq.setLabel (jalview.util.MessageManager.getString ("action.set_as_reference"));
60608 }this.repGroup.setLabel (jalview.util.MessageManager.formatMessage ("label.represent_group_with",  Clazz_newArray (-1, [seq.getName ()])));
60609 } else {
60610 this.remove (this.seqMenu);
60611 }if (!this.ap.av.hasHiddenRows ()) {
60612 this.remove (this.revealAll);
60613 this.remove (this.revealSeq);
60614 } else {
60615 var index = this.ap.av.getAlignment ().findIndex (seq);
60616 if (this.ap.av.adjustForHiddenSeqs (index) - this.ap.av.adjustForHiddenSeqs (index - 1) > 1) {
60617 this.revealSeq_index = index;
60618 } else {
60619 this.remove (this.revealSeq);
60620 }}}, "jalview.appletgui.AlignmentPanel,jalview.datamodel.SequenceI,java.util.Vector");
60621 Clazz_defineMethod (c$, "buildAnnotationSubmenus", 
60622  function () {
60623 var selectedSequence = (this.seq == null ? java.util.Collections.emptyList () : java.util.Arrays.asList ([this.seq]));
60624 this.buildAnnotationTypesMenus (this.seqShowAnnotationsMenu, this.seqHideAnnotationsMenu, selectedSequence);
60625 this.configureReferenceAnnotationsMenu (this.seqAddReferenceAnnotations, selectedSequence);
60626 var selectedGroup = (this.ap.av.getSelectionGroup () == null ? java.util.Collections.emptyList () : this.ap.av.getSelectionGroup ().getSequences ());
60627 this.buildAnnotationTypesMenus (this.groupShowAnnotationsMenu, this.groupHideAnnotationsMenu, selectedGroup);
60628 this.configureReferenceAnnotationsMenu (this.groupAddReferenceAnnotations, selectedGroup);
60629 });
60630 Clazz_defineMethod (c$, "configureReferenceAnnotationsMenu", 
60631  function (menuItem, forSequences) {
60632 menuItem.setEnabled (false);
60633 var tipEntries =  new java.util.TreeMap ();
60634 var candidates =  new java.util.LinkedHashMap ();
60635 var al = this.ap.av.getAlignment ();
60636 jalview.analysis.AlignmentUtils.findAddableReferenceAnnotations (forSequences, tipEntries, candidates, al);
60637 if (!candidates.isEmpty ()) {
60638 var tooltip =  new StringBuilder (64);
60639 tooltip.append (jalview.util.MessageManager.getString ("label.add_annotations_for"));
60640 menuItem.setEnabled (true);
60641 menuItem.addActionListener (((Clazz_isClassDefined ("jalview.appletgui.APopupMenu$1") ? 0 : jalview.appletgui.APopupMenu.$APopupMenu$1$ ()), Clazz_innerTypeInstance (jalview.appletgui.APopupMenu$1, this, Clazz_cloneFinals ("candidates", candidates))));
60642 }}, "awt2swing.MenuItem,java.util.List");
60643 Clazz_defineMethod (c$, "addReferenceAnnotations_actionPerformed", 
60644 function (candidates) {
60645 var selectionGroup = this.ap.av.getSelectionGroup ();
60646 var alignment = this.ap.getAlignment ();
60647 jalview.analysis.AlignmentUtils.addReferenceAnnotations (candidates, alignment, selectionGroup);
60648 this.refresh ();
60649 }, "java.util.Map");
60650 Clazz_defineMethod (c$, "addshowLink", 
60651  function (linkMenu, target, url) {
60652 this.addshowLink (linkMenu, target, target, url);
60653 }, "awt2swing.Menu,~S,~S");
60654 Clazz_defineMethod (c$, "addshowLink", 
60655  function (linkMenu, target, label, url) {
60656 var item =  new awt2swing.MenuItem (label);
60657 item.addActionListener (((Clazz_isClassDefined ("jalview.appletgui.APopupMenu$2") ? 0 : jalview.appletgui.APopupMenu.$APopupMenu$2$ ()), Clazz_innerTypeInstance (jalview.appletgui.APopupMenu$2, this, Clazz_cloneFinals ("url", url, "target", target))));
60658 linkMenu.add (item);
60659 }, "awt2swing.Menu,~S,~S,~S");
60660 Clazz_overrideMethod (c$, "itemStateChanged", 
60661 function (evt) {
60662 if (evt.getSource () === this.abovePIDColour) {
60663 this.abovePIDColour_itemStateChanged ();
60664 } else if (evt.getSource () === this.showColourText) {
60665 this.showColourText_itemStateChanged ();
60666 } else if (evt.getSource () === this.showText) {
60667 this.showText_itemStateChanged ();
60668 } else if (evt.getSource () === this.showBoxes) {
60669 this.showBoxes_itemStateChanged ();
60670 } else if (evt.getSource () === this.displayNonconserved) {
60671 this.showNonconserved_itemStateChanged ();
60672 }}, "java.awt.event.ItemEvent");
60673 Clazz_overrideMethod (c$, "actionPerformed", 
60674 function (evt) {
60675 var source = evt.getSource ();
60676 if (source === this.clustalColour) {
60677 this.clustalColour_actionPerformed ();
60678 } else if (source === this.zappoColour) {
60679 this.zappoColour_actionPerformed ();
60680 } else if (source === this.taylorColour) {
60681 this.taylorColour_actionPerformed ();
60682 } else if (source === this.hydrophobicityColour) {
60683 this.hydrophobicityColour_actionPerformed ();
60684 } else if (source === this.helixColour) {
60685 this.helixColour_actionPerformed ();
60686 } else if (source === this.strandColour) {
60687 this.strandColour_actionPerformed ();
60688 } else if (source === this.turnColour) {
60689 this.turnColour_actionPerformed ();
60690 } else if (source === this.buriedColour) {
60691 this.buriedColour_actionPerformed ();
60692 } else if (source === this.nucleotideMenuItem) {
60693 this.nucleotideMenuItem_actionPerformed ();
60694 } else if (source === this.userDefinedColour) {
60695 this.userDefinedColour_actionPerformed ();
60696 } else if (source === this.PIDColour) {
60697 this.PIDColour_actionPerformed ();
60698 } else if (source === this.BLOSUM62Colour) {
60699 this.BLOSUM62Colour_actionPerformed ();
60700 } else if (source === this.noColourmenuItem) {
60701 this.noColourmenuItem_actionPerformed ();
60702 } else if (source === this.conservationMenuItem) {
60703 this.conservationMenuItem_itemStateChanged ();
60704 } else if (source === this.unGroupMenuItem) {
60705 this.unGroupMenuItem_actionPerformed ();
60706 } else if (source === this.createGroupMenuItem) {
60707 this.createGroupMenuItem_actionPerformed ();
60708 } else if (source === this.sequenceName) {
60709 this.editName ();
60710 } else if (source === this.makeReferenceSeq) {
60711 this.makeReferenceSeq_actionPerformed ();
60712 } else if (source === this.sequenceDetails) {
60713 this.showSequenceDetails ();
60714 } else if (source === this.selSeqDetails) {
60715 this.showSequenceSelectionDetails ();
60716 } else if (source === this.pdb) {
60717 this.addPDB ();
60718 } else if (source === this.hideSeqs) {
60719 this.hideSequences (false);
60720 } else if (source === this.repGroup) {
60721 this.hideSequences (true);
60722 } else if (source === this.revealSeq) {
60723 this.ap.av.showSequence (this.revealSeq_index);
60724 } else if (source === this.revealAll) {
60725 this.ap.av.showAllHiddenSeqs ();
60726 } else if (source === this.editGroupName) {
60727 var dialog =  new jalview.appletgui.EditNameDialog (this.getGroup ().getName (), this.getGroup ().getDescription (), "       Group Name", "Group Description", this.ap.alignFrame, "Edit Group Name / Description", 500, 100, true);
60728 if (dialog.accept) {
60729 this.getGroup ().setName (dialog.getName ().$replace (' ', '_'));
60730 this.getGroup ().setDescription (dialog.getDescription ());
60731 }} else if (source === this.copy) {
60732 this.ap.alignFrame.copy_actionPerformed ();
60733 } else if (source === this.cut) {
60734 this.ap.alignFrame.cut_actionPerformed ();
60735 } else if (source === this.editSequence) {
60736 var sg = this.ap.av.getSelectionGroup ();
60737 if (sg != null) {
60738 if (this.seq == null) {
60739 this.seq = sg.getSequenceAt (0);
60740 }var dialog =  new jalview.appletgui.EditNameDialog (this.seq.getSequenceAsString (sg.getStartRes (), sg.getEndRes () + 1), null, "Edit Sequence ", null, this.ap.alignFrame, "Edit Sequence", 500, 100, true);
60741 if (dialog.accept) {
60742 var editCommand =  new jalview.commands.EditCommand (jalview.util.MessageManager.getString ("label.edit_sequences"), jalview.commands.EditCommand.Action.REPLACE, dialog.getName ().$replace (' ', this.ap.av.getGapCharacter ()), sg.getSequencesAsArray (this.ap.av.getHiddenRepSequences ()), sg.getStartRes (), sg.getEndRes () + 1, this.ap.av.getAlignment ());
60743 this.ap.alignFrame.addHistoryItem (editCommand);
60744 this.ap.av.firePropertyChange ("alignment", null, this.ap.av.getAlignment ().getSequences ());
60745 }}} else if (source === this.toUpper || source === this.toLower || source === this.toggleCase) {
60746 var sg = this.ap.av.getSelectionGroup ();
60747 if (sg != null) {
60748 var startEnd = this.ap.av.getVisibleRegionBoundaries (sg.getStartRes (), sg.getEndRes () + 1);
60749 var description;
60750 var caseChange;
60751 if (source === this.toggleCase) {
60752 description = "Toggle Case";
60753 caseChange = jalview.commands.ChangeCaseCommand.TOGGLE_CASE;
60754 } else if (source === this.toUpper) {
60755 description = "To Upper Case";
60756 caseChange = jalview.commands.ChangeCaseCommand.TO_UPPER;
60757 } else {
60758 description = "To Lower Case";
60759 caseChange = jalview.commands.ChangeCaseCommand.TO_LOWER;
60760 }var caseCommand =  new jalview.commands.ChangeCaseCommand (description, sg.getSequencesAsArray (this.ap.av.getHiddenRepSequences ()), startEnd, caseChange);
60761 this.ap.alignFrame.addHistoryItem (caseCommand);
60762 this.ap.av.firePropertyChange ("alignment", null, this.ap.av.getAlignment ().getSequences ());
60763 }} else if (source === this.sequenceFeature) {
60764 var sg = this.ap.av.getSelectionGroup ();
60765 if (sg == null) {
60766 return;
60767 }var rsize = 0;
60768 var gSize = sg.getSize ();
60769 var rseqs;
60770 var seqs =  new Array (gSize);
60771 var tfeatures;
60772 var features =  new Array (gSize);
60773 for (var i = 0; i < gSize; i++) {
60774 var start = sg.getSequenceAt (i).findPosition (sg.getStartRes ());
60775 var end = sg.findEndRes (sg.getSequenceAt (i));
60776 if (start <= end) {
60777 seqs[rsize] = sg.getSequenceAt (i);
60778 features[rsize] =  new jalview.datamodel.SequenceFeature (null, null, null, start, end, "Jalview");
60779 rsize++;
60780 }}
60781 rseqs =  new Array (rsize);
60782 tfeatures =  new Array (rsize);
60783 System.arraycopy (seqs, 0, rseqs, 0, rsize);
60784 System.arraycopy (features, 0, tfeatures, 0, rsize);
60785 features = tfeatures;
60786 seqs = rseqs;
60787 if (this.ap.seqPanel.seqCanvas.getFeatureRenderer ().amendFeatures (seqs, features, true, this.ap)) {
60788 this.ap.alignFrame.sequenceFeatures.setState (true);
60789 this.ap.av.setShowSequenceFeatures (true);
60790 ;this.ap.highlightSearchResults (null);
60791 }} else {
60792 this.outputText (evt);
60793 }}, "java.awt.event.ActionEvent");
60794 Clazz_defineMethod (c$, "outputText", 
60795 function (e) {
60796 var cap =  new jalview.appletgui.CutAndPasteTransfer (true, this.ap.alignFrame);
60797 var frame =  new awt2swing.Frame ();
60798 frame.add (cap);
60799 jalview.bin.JalviewLite.addFrame (frame, jalview.util.MessageManager.formatMessage ("label.selection_output_command",  Clazz_newArray (-1, [e.getActionCommand ()])), 600, 500);
60800 cap.setText ( new jalview.io.AppletFormatAdapter ().formatSequences (e.getActionCommand (), this.ap.av.getShowJVSuffix (), this.ap, true));
60801 }, "java.awt.event.ActionEvent");
60802 Clazz_defineMethod (c$, "showSequenceSelectionDetails", 
60803 function () {
60804 this.createSequenceDetailsReport (this.ap.av.getSequenceSelection ());
60805 });
60806 Clazz_defineMethod (c$, "showSequenceDetails", 
60807 function () {
60808 this.createSequenceDetailsReport ( Clazz_newArray (-1, [this.seq]));
60809 });
60810 Clazz_defineMethod (c$, "createSequenceDetailsReport", 
60811 function (sequences) {
60812 var cap =  new jalview.appletgui.CutAndPasteTransfer (false, this.ap.alignFrame);
60813 var contents =  new StringBuffer ();
60814 for (var seq, $seq = 0, $$seq = sequences; $seq < $$seq.length && ((seq = $$seq[$seq]) || true); $seq++) {
60815 contents.append (jalview.util.MessageManager.formatMessage ("label.annotation_for_displayid",  Clazz_newArray (-1, [seq.getDisplayId (true)])));
60816  new jalview.io.SequenceAnnotationReport (null).createSequenceAnnotationReport (contents, seq, true, true, false, (this.ap.seqPanel.seqCanvas.fr != null) ? this.ap.seqPanel.seqCanvas.fr.getMinMax () : null);
60817 contents.append ("</p>");
60818 }
60819 var frame =  new awt2swing.Frame ();
60820 frame.add (cap);
60821 jalview.bin.JalviewLite.addFrame (frame, "Sequence Details for " + (sequences.length == 1 ? sequences[0].getDisplayId (true) : "Selection"), 600, 500);
60822 cap.setText (jalview.util.MessageManager.formatMessage ("label.html_content",  Clazz_newArray (-1, [contents.toString ()])));
60823 }, "~A");
60824 Clazz_defineMethod (c$, "editName", 
60825 function () {
60826 var dialog =  new jalview.appletgui.EditNameDialog (this.seq.getName (), this.seq.getDescription (), "       Sequence Name", "Sequence Description", this.ap.alignFrame, "Edit Sequence Name / Description", 500, 100, true);
60827 if (dialog.accept) {
60828 this.seq.setName (dialog.getName ());
60829 this.seq.setDescription (dialog.getDescription ());
60830 this.ap.paintAlignment (false);
60831 }});
60832 Clazz_defineMethod (c$, "addPDB", 
60833 function () {
60834 if (this.seq.getPDBId () != null) {
60835 var entry = this.seq.getPDBId ().firstElement ();
60836 if (this.ap.av.applet.jmolAvailable) {
60837  new jalview.appletgui.AppletJmol (entry,  Clazz_newArray (-1, [this.seq]), null, this.ap, jalview.io.AppletFormatAdapter.URL);
60838 }} else {
60839 var cap =  new jalview.appletgui.CutAndPasteTransfer (true, this.ap.alignFrame);
60840 cap.setText (jalview.util.MessageManager.getString ("label.paste_pdb_file"));
60841 cap.setPDBImport (this.seq);
60842 var frame =  new awt2swing.Frame ();
60843 frame.add (cap);
60844 jalview.bin.JalviewLite.addFrame (frame, jalview.util.MessageManager.formatMessage ("label.paste_pdb_file_for_sequence",  Clazz_newArray (-1, [this.seq.getName ()])), 400, 300);
60845 }});
60846 Clazz_defineMethod (c$, "jbInit", 
60847  function () {
60848 this.groupMenu.setLabel (jalview.util.MessageManager.getString ("label.selection"));
60849 this.sequenceFeature.addActionListener (this);
60850 this.editGroupName.addActionListener (this);
60851 this.unGroupMenuItem.setLabel (jalview.util.MessageManager.getString ("action.remove_group"));
60852 this.unGroupMenuItem.addActionListener (this);
60853 this.createGroupMenuItem.setLabel (jalview.util.MessageManager.getString ("action.create_group"));
60854 this.createGroupMenuItem.addActionListener (this);
60855 this.nucleotideMenuItem.setLabel (jalview.util.MessageManager.getString ("label.nucleotide"));
60856 this.nucleotideMenuItem.addActionListener (this);
60857 this.conservationMenuItem.addItemListener (this);
60858 this.abovePIDColour.addItemListener (this);
60859 this.colourMenu.setLabel (jalview.util.MessageManager.getString ("label.group_colour"));
60860 this.showBoxes.setLabel (jalview.util.MessageManager.getString ("action.boxes"));
60861 this.showBoxes.setState (true);
60862 this.showBoxes.addItemListener (this);
60863 this.sequenceName.addActionListener (this);
60864 this.sequenceDetails.addActionListener (this);
60865 this.selSeqDetails.addActionListener (this);
60866 this.displayNonconserved.setLabel (jalview.util.MessageManager.getString ("label.show_non_conversed"));
60867 this.displayNonconserved.setState (false);
60868 this.displayNonconserved.addItemListener (this);
60869 this.showText.setLabel (jalview.util.MessageManager.getString ("action.text"));
60870 this.showText.addItemListener (this);
60871 this.showColourText.setLabel (jalview.util.MessageManager.getString ("label.colour_text"));
60872 this.showColourText.addItemListener (this);
60873 this.outputmenu.setLabel (jalview.util.MessageManager.getString ("label.out_to_textbox"));
60874 this.seqMenu.setLabel (jalview.util.MessageManager.getString ("label.sequence"));
60875 this.pdb.setLabel (jalview.util.MessageManager.getString ("label.view_pdb_structure"));
60876 this.hideSeqs.setLabel (jalview.util.MessageManager.getString ("action.hide_sequences"));
60877 this.repGroup.setLabel (jalview.util.MessageManager.formatMessage ("label.represent_group_with",  Clazz_newArray (-1, [""])));
60878 this.revealAll.setLabel (jalview.util.MessageManager.getString ("action.reveal_all"));
60879 this.revealSeq.setLabel (jalview.util.MessageManager.getString ("action.reveal_sequences"));
60880 this.menu1.setLabel (jalview.util.MessageManager.getString ("label.group") + ":");
60881 this.add (this.groupMenu);
60882 this.add (this.seqMenu);
60883 this.add (this.hideSeqs);
60884 this.add (this.revealSeq);
60885 this.add (this.revealAll);
60886 this.groupMenu.add (this.groupShowAnnotationsMenu);
60887 this.groupMenu.add (this.groupHideAnnotationsMenu);
60888 this.groupMenu.add (this.groupAddReferenceAnnotations);
60889 this.groupMenu.add (this.editMenu);
60890 this.groupMenu.add (this.outputmenu);
60891 this.groupMenu.add (this.sequenceFeature);
60892 this.groupMenu.add (this.createGroupMenuItem);
60893 this.groupMenu.add (this.unGroupMenuItem);
60894 this.groupMenu.add (this.menu1);
60895 this.colourMenu.add (this.noColourmenuItem);
60896 this.colourMenu.add (this.clustalColour);
60897 this.colourMenu.add (this.BLOSUM62Colour);
60898 this.colourMenu.add (this.PIDColour);
60899 this.colourMenu.add (this.zappoColour);
60900 this.colourMenu.add (this.taylorColour);
60901 this.colourMenu.add (this.hydrophobicityColour);
60902 this.colourMenu.add (this.helixColour);
60903 this.colourMenu.add (this.strandColour);
60904 this.colourMenu.add (this.turnColour);
60905 this.colourMenu.add (this.buriedColour);
60906 this.colourMenu.add (this.nucleotideMenuItem);
60907 this.colourMenu.add (this.userDefinedColour);
60908 this.colourMenu.addSeparator ();
60909 this.colourMenu.add (this.abovePIDColour);
60910 this.colourMenu.add (this.conservationMenuItem);
60911 this.noColourmenuItem.setLabel (jalview.util.MessageManager.getString ("label.none"));
60912 this.noColourmenuItem.addActionListener (this);
60913 this.clustalColour.setLabel (jalview.util.MessageManager.getString ("label.clustalx_colours"));
60914 this.clustalColour.addActionListener (this);
60915 this.zappoColour.setLabel (jalview.util.MessageManager.getString ("label.zappo"));
60916 this.zappoColour.addActionListener (this);
60917 this.taylorColour.setLabel (jalview.util.MessageManager.getString ("label.taylor"));
60918 this.taylorColour.addActionListener (this);
60919 this.hydrophobicityColour.setLabel (jalview.util.MessageManager.getString ("label.hydrophobicity"));
60920 this.hydrophobicityColour.addActionListener (this);
60921 this.helixColour.setLabel (jalview.util.MessageManager.getString ("label.helix_propensity"));
60922 this.helixColour.addActionListener (this);
60923 this.strandColour.setLabel (jalview.util.MessageManager.getString ("label.strand_propensity"));
60924 this.strandColour.addActionListener (this);
60925 this.turnColour.setLabel (jalview.util.MessageManager.getString ("label.turn_propensity"));
60926 this.turnColour.addActionListener (this);
60927 this.buriedColour.setLabel (jalview.util.MessageManager.getString ("label.buried_index"));
60928 this.buriedColour.addActionListener (this);
60929 this.abovePIDColour.setLabel (jalview.util.MessageManager.getString ("label.above_identity_percentage"));
60930 this.userDefinedColour.setLabel (jalview.util.MessageManager.getString ("action.user_defined"));
60931 this.userDefinedColour.addActionListener (this);
60932 this.PIDColour.setLabel (jalview.util.MessageManager.getString ("action.percentage_identity"));
60933 this.PIDColour.addActionListener (this);
60934 this.BLOSUM62Colour.setLabel ("BLOSUM62");
60935 this.BLOSUM62Colour.addActionListener (this);
60936 this.conservationMenuItem.setLabel (jalview.util.MessageManager.getString ("label.conservation"));
60937 this.editMenu.add (this.copy);
60938 this.copy.addActionListener (this);
60939 this.editMenu.add (this.cut);
60940 this.cut.addActionListener (this);
60941 this.editMenu.add (this.editSequence);
60942 this.editSequence.addActionListener (this);
60943 this.editMenu.add (this.toUpper);
60944 this.toUpper.addActionListener (this);
60945 this.editMenu.add (this.toLower);
60946 this.toLower.addActionListener (this);
60947 this.editMenu.add (this.toggleCase);
60948 this.seqMenu.add (this.seqShowAnnotationsMenu);
60949 this.seqMenu.add (this.seqHideAnnotationsMenu);
60950 this.seqMenu.add (this.seqAddReferenceAnnotations);
60951 this.seqMenu.add (this.sequenceName);
60952 this.seqMenu.add (this.makeReferenceSeq);
60953 if (!this.ap.av.applet.useXtrnalSviewer) {
60954 this.seqMenu.add (this.pdb);
60955 }this.seqMenu.add (this.repGroup);
60956 this.menu1.add (this.editGroupName);
60957 this.menu1.add (this.colourMenu);
60958 this.menu1.add (this.showBoxes);
60959 this.menu1.add (this.showText);
60960 this.menu1.add (this.showColourText);
60961 this.menu1.add (this.displayNonconserved);
60962 this.toggleCase.addActionListener (this);
60963 this.pdb.addActionListener (this);
60964 this.hideSeqs.addActionListener (this);
60965 this.repGroup.addActionListener (this);
60966 this.revealAll.addActionListener (this);
60967 this.revealSeq.addActionListener (this);
60968 this.makeReferenceSeq.addActionListener (this);
60969 });
60970 Clazz_defineMethod (c$, "refresh", 
60971 function () {
60972 this.ap.paintAlignment (true);
60973 });
60974 Clazz_defineMethod (c$, "clustalColour_actionPerformed", 
60975 function () {
60976 var sg = this.getGroup ();
60977 sg.cs =  new jalview.schemes.ClustalxColourScheme (sg, this.ap.av.getHiddenRepSequences ());
60978 this.refresh ();
60979 });
60980 Clazz_defineMethod (c$, "zappoColour_actionPerformed", 
60981 function () {
60982 this.getGroup ().cs =  new jalview.schemes.ZappoColourScheme ();
60983 this.refresh ();
60984 });
60985 Clazz_defineMethod (c$, "taylorColour_actionPerformed", 
60986 function () {
60987 this.getGroup ().cs =  new jalview.schemes.TaylorColourScheme ();
60988 this.refresh ();
60989 });
60990 Clazz_defineMethod (c$, "hydrophobicityColour_actionPerformed", 
60991 function () {
60992 this.getGroup ().cs =  new jalview.schemes.HydrophobicColourScheme ();
60993 this.refresh ();
60994 });
60995 Clazz_defineMethod (c$, "helixColour_actionPerformed", 
60996 function () {
60997 this.getGroup ().cs =  new jalview.schemes.HelixColourScheme ();
60998 this.refresh ();
60999 });
61000 Clazz_defineMethod (c$, "strandColour_actionPerformed", 
61001 function () {
61002 this.getGroup ().cs =  new jalview.schemes.StrandColourScheme ();
61003 this.refresh ();
61004 });
61005 Clazz_defineMethod (c$, "turnColour_actionPerformed", 
61006 function () {
61007 this.getGroup ().cs =  new jalview.schemes.TurnColourScheme ();
61008 this.refresh ();
61009 });
61010 Clazz_defineMethod (c$, "buriedColour_actionPerformed", 
61011 function () {
61012 this.getGroup ().cs =  new jalview.schemes.BuriedColourScheme ();
61013 this.refresh ();
61014 });
61015 Clazz_defineMethod (c$, "nucleotideMenuItem_actionPerformed", 
61016 function () {
61017 this.getGroup ().cs =  new jalview.schemes.NucleotideColourScheme ();
61018 this.refresh ();
61019 });
61020 Clazz_defineMethod (c$, "abovePIDColour_itemStateChanged", 
61021 function () {
61022 var sg = this.getGroup ();
61023 if (sg.cs == null) {
61024 return;
61025 }if (this.abovePIDColour.getState ()) {
61026 sg.cs.setConsensus (jalview.analysis.AAFrequency.calculate (sg.getSequences (this.ap.av.getHiddenRepSequences ()), 0, this.ap.av.getAlignment ().getWidth ()));
61027 var threshold = jalview.appletgui.SliderPanel.setPIDSliderSource (this.ap, sg.cs, this.getGroup ().getName ());
61028 sg.cs.setThreshold (threshold, this.ap.av.isIgnoreGapsConsensus ());
61029 jalview.appletgui.SliderPanel.showPIDSlider ();
61030 } else {
61031 sg.cs.setThreshold (0, this.ap.av.isIgnoreGapsConsensus ());
61032 }this.refresh ();
61033 });
61034 Clazz_defineMethod (c$, "userDefinedColour_actionPerformed", 
61035 function () {
61036  new jalview.appletgui.UserDefinedColours (this.ap, this.getGroup ());
61037 });
61038 Clazz_defineMethod (c$, "PIDColour_actionPerformed", 
61039 function () {
61040 var sg = this.getGroup ();
61041 sg.cs =  new jalview.schemes.PIDColourScheme ();
61042 sg.cs.setConsensus (jalview.analysis.AAFrequency.calculate (sg.getSequences (this.ap.av.getHiddenRepSequences ()), 0, this.ap.av.getAlignment ().getWidth ()));
61043 this.refresh ();
61044 });
61045 Clazz_defineMethod (c$, "BLOSUM62Colour_actionPerformed", 
61046 function () {
61047 var sg = this.getGroup ();
61048 sg.cs =  new jalview.schemes.Blosum62ColourScheme ();
61049 sg.cs.setConsensus (jalview.analysis.AAFrequency.calculate (sg.getSequences (this.ap.av.getHiddenRepSequences ()), 0, this.ap.av.getAlignment ().getWidth ()));
61050 this.refresh ();
61051 });
61052 Clazz_defineMethod (c$, "noColourmenuItem_actionPerformed", 
61053 function () {
61054 this.getGroup ().cs = null;
61055 this.refresh ();
61056 });
61057 Clazz_defineMethod (c$, "conservationMenuItem_itemStateChanged", 
61058 function () {
61059 var sg = this.getGroup ();
61060 if (sg.cs == null) {
61061 return;
61062 }if (this.conservationMenuItem.getState ()) {
61063 sg.cs.setConservation (jalview.analysis.Conservation.calculateConservation ("Group", jalview.schemes.ResidueProperties.propHash, 3, sg.getSequences (this.ap.av.getHiddenRepSequences ()), 0, this.ap.av.getAlignment ().getWidth (), false, this.ap.av.getConsPercGaps (), false));
61064 jalview.appletgui.SliderPanel.setConservationSlider (this.ap, sg.cs, sg.getName ());
61065 jalview.appletgui.SliderPanel.showConservationSlider ();
61066 } else {
61067 sg.cs.setConservation (null);
61068 }this.refresh ();
61069 });
61070 Clazz_defineMethod (c$, "getGroup", 
61071 function () {
61072 var sg = this.ap.av.getSelectionGroup ();
61073 if (sg != null) {
61074 this.ap.av.getAlignment ().addGroup (sg);
61075 }return sg;
61076 });
61077 Clazz_defineMethod (c$, "unGroupMenuItem_actionPerformed", 
61078 function () {
61079 var sg = this.ap.av.getSelectionGroup ();
61080 this.ap.av.getAlignment ().deleteGroup (sg);
61081 this.ap.av.setSelectionGroup (null);
61082 this.ap.paintAlignment (true);
61083 });
61084 Clazz_defineMethod (c$, "createGroupMenuItem_actionPerformed", 
61085 function () {
61086 this.getGroup ();
61087 this.refresh ();
61088 });
61089 Clazz_defineMethod (c$, "showColourText_itemStateChanged", 
61090 function () {
61091 this.getGroup ().setColourText (this.showColourText.getState ());
61092 this.refresh ();
61093 });
61094 Clazz_defineMethod (c$, "showText_itemStateChanged", 
61095 function () {
61096 this.getGroup ().setDisplayText (this.showText.getState ());
61097 this.refresh ();
61098 });
61099 Clazz_defineMethod (c$, "makeReferenceSeq_actionPerformed", 
61100 function () {
61101 if (!this.ap.av.getAlignment ().hasSeqrep ()) {
61102 this.ap.av.setDisplayReferenceSeq (true);
61103 this.ap.av.setColourByReferenceSeq (true);
61104 this.ap.av.getAlignment ().setSeqrep (this.seq);
61105 } else {
61106 if (this.ap.av.getAlignment ().getSeqrep () === this.seq) {
61107 this.ap.av.getAlignment ().setSeqrep (null);
61108 } else {
61109 this.ap.av.getAlignment ().setSeqrep (this.seq);
61110 }}this.refresh ();
61111 });
61112 Clazz_defineMethod (c$, "showNonconserved_itemStateChanged", 
61113 function () {
61114 this.getGroup ().setShowNonconserved (this.displayNonconserved.getState ());
61115 this.refresh ();
61116 });
61117 Clazz_defineMethod (c$, "showBoxes_itemStateChanged", 
61118 function () {
61119 this.getGroup ().setDisplayBoxes (this.showBoxes.getState ());
61120 this.refresh ();
61121 });
61122 Clazz_defineMethod (c$, "hideSequences", 
61123 function (representGroup) {
61124 var sg = this.ap.av.getSelectionGroup ();
61125 if (sg == null || sg.getSize () < 1) {
61126 this.ap.av.hideSequence ( Clazz_newArray (-1, [this.seq]));
61127 return;
61128 }this.ap.av.setSelectionGroup (null);
61129 if (representGroup) {
61130 this.ap.av.hideRepSequences (this.seq, sg);
61131 return;
61132 }var gsize = sg.getSize ();
61133 var hseqs;
61134 hseqs =  new Array (gsize);
61135 var index = 0;
61136 for (var i = 0; i < gsize; i++) {
61137 hseqs[index++] = sg.getSequenceAt (i);
61138 }
61139 this.ap.av.hideSequence (hseqs);
61140 this.ap.av.sendSelection ();
61141 }, "~B");
61142 Clazz_defineMethod (c$, "buildAnnotationTypesMenus", 
61143 function (showMenu, hideMenu, forSequences) {
61144 showMenu.removeAll ();
61145 hideMenu.removeAll ();
61146 var all = java.util.Arrays.asList (["All"]);
61147 this.addAnnotationTypeToShowHide (showMenu, forSequences, "", all, true, true);
61148 this.addAnnotationTypeToShowHide (hideMenu, forSequences, "", all, true, false);
61149 showMenu.addSeparator ();
61150 hideMenu.addSeparator ();
61151 var annotations = this.ap.getAlignment ().getAlignmentAnnotation ();
61152 var shownTypes =  new java.util.LinkedHashMap ();
61153 var hiddenTypes =  new java.util.LinkedHashMap ();
61154 jalview.analysis.AlignmentAnnotationUtils.getShownHiddenTypes (shownTypes, hiddenTypes, jalview.analysis.AlignmentAnnotationUtils.asList (annotations), forSequences);
61155 for (var calcId, $calcId = hiddenTypes.keySet ().iterator (); $calcId.hasNext () && ((calcId = $calcId.next ()) || true);) {
61156 for (var type, $type = hiddenTypes.get (calcId).iterator (); $type.hasNext () && ((type = $type.next ()) || true);) {
61157 this.addAnnotationTypeToShowHide (showMenu, forSequences, calcId, type, false, true);
61158 }
61159 }
61160 showMenu.setEnabled (!hiddenTypes.isEmpty ());
61161 for (var calcId, $calcId = shownTypes.keySet ().iterator (); $calcId.hasNext () && ((calcId = $calcId.next ()) || true);) {
61162 for (var type, $type = shownTypes.get (calcId).iterator (); $type.hasNext () && ((type = $type.next ()) || true);) {
61163 this.addAnnotationTypeToShowHide (hideMenu, forSequences, calcId, type, false, false);
61164 }
61165 }
61166 hideMenu.setEnabled (!shownTypes.isEmpty ());
61167 }, "awt2swing.Menu,awt2swing.Menu,java.util.List");
61168 Clazz_defineMethod (c$, "addAnnotationTypeToShowHide", 
61169 function (showOrHideMenu, forSequences, calcId, types, allTypes, actionIsShow) {
61170 var label = types.toString ();
61171 label = label.substring (1, label.length - 1);
61172 var item =  new awt2swing.MenuItem (label);
61173 item.addActionListener (((Clazz_isClassDefined ("jalview.appletgui.APopupMenu$3") ? 0 : jalview.appletgui.APopupMenu.$APopupMenu$3$ ()), Clazz_innerTypeInstance (jalview.appletgui.APopupMenu$3, this, Clazz_cloneFinals ("types", types, "forSequences", forSequences, "allTypes", allTypes, "actionIsShow", actionIsShow))));
61174 showOrHideMenu.add (item);
61175 }, "awt2swing.Menu,java.util.List,~S,java.util.List,~B,~B");
61176 c$.$APopupMenu$1$ = function () {
61177 Clazz_pu$h(self.c$);
61178 c$ = Clazz_declareAnonymous (jalview.appletgui, "APopupMenu$1", null, java.awt.event.ActionListener);
61179 Clazz_overrideMethod (c$, "actionPerformed", 
61180 function (e) {
61181 this.b$["jalview.appletgui.APopupMenu"].addReferenceAnnotations_actionPerformed (this.f$.candidates);
61182 }, "java.awt.event.ActionEvent");
61183 c$ = Clazz_p0p ();
61184 };
61185 c$.$APopupMenu$2$ = function () {
61186 Clazz_pu$h(self.c$);
61187 c$ = Clazz_declareAnonymous (jalview.appletgui, "APopupMenu$2", null, java.awt.event.ActionListener);
61188 Clazz_overrideMethod (c$, "actionPerformed", 
61189 function (e) {
61190 this.b$["jalview.appletgui.APopupMenu"].ap.alignFrame.showURL (this.f$.url, this.f$.target);
61191 }, "java.awt.event.ActionEvent");
61192 c$ = Clazz_p0p ();
61193 };
61194 c$.$APopupMenu$3$ = function () {
61195 Clazz_pu$h(self.c$);
61196 c$ = Clazz_declareAnonymous (jalview.appletgui, "APopupMenu$3", null, java.awt.event.ActionListener);
61197 Clazz_overrideMethod (c$, "actionPerformed", 
61198 function (e) {
61199 jalview.analysis.AlignmentUtils.showOrHideSequenceAnnotations (this.b$["jalview.appletgui.APopupMenu"].ap.getAlignment (), this.f$.types, this.f$.forSequences, this.f$.allTypes, this.f$.actionIsShow);
61200 this.b$["jalview.appletgui.APopupMenu"].refresh ();
61201 }, "java.awt.event.ActionEvent");
61202 c$ = Clazz_p0p ();
61203 };
61204 Clazz_defineStatics (c$,
61205 "ALL_ANNOTATIONS", "All");
61206 });
61207 Clazz_declarePackage ("jalview.analysis");
61208 Clazz_load (null, "jalview.analysis.AlignmentAnnotationUtils", ["java.util.ArrayList", "$.Arrays", "$.BitSet", "$.Collections", "$.HashMap"], function () {
61209 c$ = Clazz_declareType (jalview.analysis, "AlignmentAnnotationUtils");
61210 c$.getShownHiddenTypes = Clazz_defineMethod (c$, "getShownHiddenTypes", 
61211 function (shownTypes, hiddenTypes, annotations, forSequences) {
61212 var visibleGraphGroups = jalview.analysis.AlignmentAnnotationUtils.getVisibleLineGraphGroups (annotations);
61213 var groupLabels =  new java.util.HashMap ();
61214 var addedToShown =  new java.util.ArrayList ();
61215 var addedToHidden =  new java.util.ArrayList ();
61216 for (var aa, $aa = annotations.iterator (); $aa.hasNext () && ((aa = $aa.next ()) || true);) {
61217 if (aa.annotations == null) {
61218 continue;
61219 }if (forSequences != null && (aa.sequenceRef != null && forSequences.contains (aa.sequenceRef))) {
61220 var calcId = aa.getCalcId ();
61221 var labelAsList =  new java.util.ArrayList ();
61222 var displayLabel = aa.label;
61223 labelAsList.add (displayLabel);
61224 if (aa.graph == 2 && aa.graphGroup > -1) {
61225 if (!groupLabels.containsKey (calcId)) {
61226 groupLabels.put (calcId,  new java.util.HashMap ());
61227 }var groupLabelsForCalcId = groupLabels.get (calcId);
61228 if (groupLabelsForCalcId.containsKey (new Integer (aa.graphGroup))) {
61229 if (!groupLabelsForCalcId.get (new Integer (aa.graphGroup)).contains (displayLabel)) {
61230 groupLabelsForCalcId.get (new Integer (aa.graphGroup)).add (displayLabel);
61231 }} else {
61232 groupLabelsForCalcId.put (new Integer (aa.graphGroup), labelAsList);
61233 }} else {
61234 var rememberAs = calcId + "!" + displayLabel;
61235 if (aa.visible && !addedToShown.contains (rememberAs)) {
61236 if (!shownTypes.containsKey (calcId)) {
61237 shownTypes.put (calcId,  new java.util.ArrayList ());
61238 }shownTypes.get (calcId).add (labelAsList);
61239 addedToShown.add (rememberAs);
61240 } else {
61241 if (!aa.visible && !addedToHidden.contains (rememberAs)) {
61242 if (!hiddenTypes.containsKey (calcId)) {
61243 hiddenTypes.put (calcId,  new java.util.ArrayList ());
61244 }hiddenTypes.get (calcId).add (labelAsList);
61245 addedToHidden.add (rememberAs);
61246 }}}}}
61247 for (var calcId, $calcId = groupLabels.keySet ().iterator (); $calcId.hasNext () && ((calcId = $calcId.next ()) || true);) {
61248 for (var group, $group = groupLabels.get (calcId).keySet ().iterator (); $group.hasNext () && ((group = $group.next ()) || true);) {
61249 var groupLabel = groupLabels.get (calcId).get (new Integer (group));
61250 java.util.Collections.sort (groupLabel);
61251 if (visibleGraphGroups.get (group)) {
61252 if (!shownTypes.containsKey (calcId)) {
61253 shownTypes.put (calcId,  new java.util.ArrayList ());
61254 }if (!shownTypes.get (calcId).contains (groupLabel)) {
61255 shownTypes.get (calcId).add (groupLabel);
61256 }} else {
61257 if (!hiddenTypes.containsKey (calcId)) {
61258 hiddenTypes.put (calcId,  new java.util.ArrayList ());
61259 }if (!hiddenTypes.get (calcId).contains (groupLabel)) {
61260 hiddenTypes.get (calcId).add (groupLabel);
61261 }}}
61262 }
61263 }, "java.util.Map,java.util.Map,java.util.List,java.util.List");
61264 c$.getVisibleLineGraphGroups = Clazz_defineMethod (c$, "getVisibleLineGraphGroups", 
61265 function (annotations) {
61266 var result =  new java.util.BitSet ();
61267 for (var ann, $ann = annotations.iterator (); $ann.hasNext () && ((ann = $ann.next ()) || true);) {
61268 if (ann.graph == 2 && ann.visible) {
61269 var gg = ann.graphGroup;
61270 if (gg > -1) {
61271 result.set (gg);
61272 }}}
61273 return result;
61274 }, "java.util.List");
61275 c$.asList = Clazz_defineMethod (c$, "asList", 
61276 function (anns) {
61277 return (anns == null ? java.util.Collections.emptyList () : java.util.Arrays.asList (anns));
61278 }, "~A");
61279 });
61280 Clazz_declarePackage ("jalview.appletgui");
61281 Clazz_load (["awt2swing.Panel", "java.awt.event.ActionListener", "$.AdjustmentListener", "$.MouseListener", "awt2swing.Button", "$.Checkbox", "$.Label", "$.Scrollbar", "$.TextField", "java.awt.BorderLayout", "$.FlowLayout"], "jalview.appletgui.SliderPanel", ["awt2swing.Frame", "jalview.bin.JalviewLite", "jalview.util.MessageManager", "java.awt.Color", "$.Font", "java.awt.event.WindowAdapter"], function () {
61282 c$ = Clazz_decorateAsClass (function () {
61283 this.ap = null;
61284 this.forConservation = true;
61285 this.cs = null;
61286 this.slider = null;
61287 this.valueField = null;
61288 this.label = null;
61289 this.jPanel1 = null;
61290 this.jPanel2 = null;
61291 this.applyButton = null;
61292 this.undoButton = null;
61293 this.flowLayout1 = null;
61294 this.allGroupsCheck = null;
61295 this.borderLayout1 = null;
61296 this.borderLayout2 = null;
61297 this.flowLayout2 = null;
61298 Clazz_instantialize (this, arguments);
61299 }, jalview.appletgui, "SliderPanel", awt2swing.Panel, [java.awt.event.ActionListener, java.awt.event.AdjustmentListener, java.awt.event.MouseListener]);
61300 Clazz_prepareFields (c$, function () {
61301 this.slider =  new awt2swing.Scrollbar ();
61302 this.valueField =  new awt2swing.TextField ();
61303 this.label =  new awt2swing.Label ();
61304 this.jPanel1 =  new awt2swing.Panel ();
61305 this.jPanel2 =  new awt2swing.Panel ();
61306 this.applyButton =  new awt2swing.Button ();
61307 this.undoButton =  new awt2swing.Button ();
61308 this.flowLayout1 =  new java.awt.FlowLayout ();
61309 this.allGroupsCheck =  new awt2swing.Checkbox ();
61310 this.borderLayout1 =  new java.awt.BorderLayout ();
61311 this.borderLayout2 =  new java.awt.BorderLayout ();
61312 this.flowLayout2 =  new java.awt.FlowLayout ();
61313 });
61314 c$.setConservationSlider = Clazz_defineMethod (c$, "setConservationSlider", 
61315 function (ap, cs, source) {
61316 var sp = null;
61317 if (jalview.appletgui.SliderPanel.conservationSlider == null) {
61318 sp =  new jalview.appletgui.SliderPanel (ap, cs.getConservationInc (), true, cs);
61319 jalview.appletgui.SliderPanel.conservationSlider =  new awt2swing.Frame ();
61320 jalview.appletgui.SliderPanel.conservationSlider.add (sp);
61321 } else {
61322 sp = jalview.appletgui.SliderPanel.conservationSlider.getComponent (0);
61323 sp.cs = cs;
61324 }jalview.appletgui.SliderPanel.conservationSlider.setTitle (jalview.util.MessageManager.formatMessage ("label.conservation_colour_increment",  Clazz_newArray (-1, [source])));
61325 if (ap.av.getAlignment ().getGroups () != null) {
61326 sp.setAllGroupsCheckEnabled (true);
61327 } else {
61328 sp.setAllGroupsCheckEnabled (false);
61329 }return sp.getValue ();
61330 }, "jalview.appletgui.AlignmentPanel,jalview.schemes.ColourSchemeI,~S");
61331 c$.showConservationSlider = Clazz_defineMethod (c$, "showConservationSlider", 
61332 function () {
61333 try {
61334 jalview.appletgui.SliderPanel.PIDSlider.setVisible (false);
61335 jalview.appletgui.SliderPanel.PIDSlider = null;
61336 } catch (ex) {
61337 if (Clazz_exceptionOf (ex, Exception)) {
61338 } else {
61339 throw ex;
61340 }
61341 }
61342 if (!jalview.appletgui.SliderPanel.conservationSlider.isVisible ()) {
61343 jalview.bin.JalviewLite.addFrame (jalview.appletgui.SliderPanel.conservationSlider, jalview.appletgui.SliderPanel.conservationSlider.getTitle (), 420, 100);
61344 jalview.appletgui.SliderPanel.conservationSlider.addWindowListener (((Clazz_isClassDefined ("jalview.appletgui.SliderPanel$1") ? 0 : jalview.appletgui.SliderPanel.$SliderPanel$1$ ()), Clazz_innerTypeInstance (jalview.appletgui.SliderPanel$1, this, null)));
61345 }});
61346 c$.setPIDSliderSource = Clazz_defineMethod (c$, "setPIDSliderSource", 
61347 function (ap, cs, source) {
61348 var pid = null;
61349 if (jalview.appletgui.SliderPanel.PIDSlider == null) {
61350 pid =  new jalview.appletgui.SliderPanel (ap, 50, false, cs);
61351 jalview.appletgui.SliderPanel.PIDSlider =  new awt2swing.Frame ();
61352 jalview.appletgui.SliderPanel.PIDSlider.add (pid);
61353 } else {
61354 pid = jalview.appletgui.SliderPanel.PIDSlider.getComponent (0);
61355 pid.cs = cs;
61356 }jalview.appletgui.SliderPanel.PIDSlider.setTitle (jalview.util.MessageManager.formatMessage ("label.percentage_identity_thereshold",  Clazz_newArray (-1, [source])));
61357 if (ap.av.getAlignment ().getGroups () != null) {
61358 pid.setAllGroupsCheckEnabled (true);
61359 } else {
61360 pid.setAllGroupsCheckEnabled (false);
61361 }return pid.getValue ();
61362 }, "jalview.appletgui.AlignmentPanel,jalview.schemes.ColourSchemeI,~S");
61363 c$.showPIDSlider = Clazz_defineMethod (c$, "showPIDSlider", 
61364 function () {
61365 try {
61366 jalview.appletgui.SliderPanel.conservationSlider.setVisible (false);
61367 jalview.appletgui.SliderPanel.conservationSlider = null;
61368 } catch (ex) {
61369 if (Clazz_exceptionOf (ex, Exception)) {
61370 } else {
61371 throw ex;
61372 }
61373 }
61374 if (!jalview.appletgui.SliderPanel.PIDSlider.isVisible ()) {
61375 jalview.bin.JalviewLite.addFrame (jalview.appletgui.SliderPanel.PIDSlider, jalview.appletgui.SliderPanel.PIDSlider.getTitle (), 420, 100);
61376 jalview.appletgui.SliderPanel.PIDSlider.addWindowListener (((Clazz_isClassDefined ("jalview.appletgui.SliderPanel$2") ? 0 : jalview.appletgui.SliderPanel.$SliderPanel$2$ ()), Clazz_innerTypeInstance (jalview.appletgui.SliderPanel$2, this, null)));
61377 }});
61378 Clazz_makeConstructor (c$, 
61379 function (ap, value, forConserve, cs) {
61380 Clazz_superConstructor (this, jalview.appletgui.SliderPanel, []);
61381 try {
61382 this.jbInit ();
61383 } catch (e) {
61384 if (Clazz_exceptionOf (e, Exception)) {
61385 e.printStackTrace ();
61386 } else {
61387 throw e;
61388 }
61389 }
61390 this.ap = ap;
61391 this.cs = cs;
61392 this.forConservation = forConserve;
61393 this.undoButton.setVisible (false);
61394 this.applyButton.setVisible (false);
61395 if (this.forConservation) {
61396 this.label.setText (jalview.util.MessageManager.getString ("label.modify_conservation_visibility"));
61397 this.slider.setMinimum (0);
61398 this.slider.setMaximum (50 + this.slider.getVisibleAmount ());
61399 this.slider.setUnitIncrement (1);
61400 } else {
61401 this.label.setText (jalview.util.MessageManager.getString ("label.colour_residues_above_occurence"));
61402 this.slider.setMinimum (0);
61403 this.slider.setMaximum (100 + this.slider.getVisibleAmount ());
61404 this.slider.setBlockIncrement (1);
61405 }this.slider.addAdjustmentListener (this);
61406 this.slider.addMouseListener (this);
61407 this.slider.setValue (value);
61408 this.valueField.setText (value + "");
61409 }, "jalview.appletgui.AlignmentPanel,~N,~B,jalview.schemes.ColourSchemeI");
61410 Clazz_defineMethod (c$, "valueChanged", 
61411 function (i) {
61412 if (this.cs == null) {
61413 return;
61414 }var toChange = this.cs;
61415 var allGroups = null;
61416 if (this.allGroupsCheck.getState ()) {
61417 allGroups = this.ap.av.getAlignment ().getGroups ().listIterator ();
61418 }while (toChange != null) {
61419 if (this.forConservation) {
61420 toChange.setConservationInc (i);
61421 } else {
61422 toChange.setThreshold (i, this.ap.av.isIgnoreGapsConsensus ());
61423 }if (allGroups != null && allGroups.hasNext ()) {
61424 while ((toChange = allGroups.next ().cs) == null && allGroups.hasNext ()) {
61425 ;}
61426 } else {
61427 toChange = null;
61428 }}
61429 this.ap.seqPanel.seqCanvas.repaint ();
61430 }, "~N");
61431 Clazz_defineMethod (c$, "setAllGroupsCheckEnabled", 
61432 function (b) {
61433 this.allGroupsCheck.setEnabled (b);
61434 }, "~B");
61435 Clazz_overrideMethod (c$, "actionPerformed", 
61436 function (evt) {
61437 if (evt.getSource () === this.applyButton) {
61438 this.applyButton_actionPerformed ();
61439 } else if (evt.getSource () === this.undoButton) {
61440 this.undoButton_actionPerformed ();
61441 } else if (evt.getSource () === this.valueField) {
61442 this.valueField_actionPerformed ();
61443 }}, "java.awt.event.ActionEvent");
61444 Clazz_overrideMethod (c$, "adjustmentValueChanged", 
61445 function (evt) {
61446 this.valueField.setText (this.slider.getValue () + "");
61447 this.valueChanged (this.slider.getValue ());
61448 }, "java.awt.event.AdjustmentEvent");
61449 Clazz_defineMethod (c$, "valueField_actionPerformed", 
61450 function () {
61451 try {
61452 var i = Integer.parseInt (this.valueField.getText ());
61453 this.slider.setValue (i);
61454 } catch (ex) {
61455 if (Clazz_exceptionOf (ex, Exception)) {
61456 this.valueField.setText (this.slider.getValue () + "");
61457 } else {
61458 throw ex;
61459 }
61460 }
61461 });
61462 Clazz_defineMethod (c$, "setValue", 
61463 function (value) {
61464 this.slider.setValue (value);
61465 }, "~N");
61466 Clazz_defineMethod (c$, "getValue", 
61467 function () {
61468 return Integer.parseInt (this.valueField.getText ());
61469 });
61470 Clazz_defineMethod (c$, "jbInit", 
61471  function () {
61472 this.setLayout (this.borderLayout2);
61473 this.slider.setBackground (java.awt.Color.white);
61474 this.slider.setFont ( new java.awt.Font ("Verdana", 0, 11));
61475 this.slider.setOrientation (0);
61476 this.valueField.setFont ( new java.awt.Font ("Verdana", 0, 11));
61477 this.valueField.setText ("   ");
61478 this.valueField.addActionListener (this);
61479 this.valueField.setColumns (3);
61480 this.label.setFont ( new java.awt.Font ("Verdana", 0, 11));
61481 this.label.setText (jalview.util.MessageManager.getString ("label.set_this_label_text"));
61482 this.jPanel1.setLayout (this.borderLayout1);
61483 this.jPanel2.setLayout (this.flowLayout1);
61484 this.applyButton.setFont ( new java.awt.Font ("Verdana", 0, 11));
61485 this.applyButton.setLabel (jalview.util.MessageManager.getString ("action.apply"));
61486 this.applyButton.addActionListener (this);
61487 this.undoButton.setEnabled (false);
61488 this.undoButton.setFont ( new java.awt.Font ("Verdana", 0, 11));
61489 this.undoButton.setLabel (jalview.util.MessageManager.getString ("action.undo"));
61490 this.undoButton.addActionListener (this);
61491 this.allGroupsCheck.setEnabled (false);
61492 this.allGroupsCheck.setFont ( new java.awt.Font ("Verdana", 0, 11));
61493 this.allGroupsCheck.setLabel (jalview.util.MessageManager.getString ("action.apply_threshold_all_groups"));
61494 this.allGroupsCheck.setName (jalview.util.MessageManager.getString ("action.apply_all_groups"));
61495 this.setBackground (java.awt.Color.white);
61496 this.setForeground (java.awt.Color.black);
61497 this.jPanel2.add (this.label, null);
61498 this.jPanel2.add (this.applyButton, null);
61499 this.jPanel2.add (this.undoButton, null);
61500 this.jPanel2.add (this.allGroupsCheck);
61501 this.jPanel1.add (this.valueField, "East");
61502 this.jPanel1.add (this.slider, "Center");
61503 this.add (this.jPanel1, "South");
61504 this.add (this.jPanel2, "Center");
61505 });
61506 Clazz_defineMethod (c$, "applyButton_actionPerformed", 
61507 function () {
61508 });
61509 Clazz_defineMethod (c$, "undoButton_actionPerformed", 
61510 function () {
61511 });
61512 Clazz_overrideMethod (c$, "mousePressed", 
61513 function (evt) {
61514 }, "java.awt.event.MouseEvent");
61515 Clazz_overrideMethod (c$, "mouseReleased", 
61516 function (evt) {
61517 this.ap.paintAlignment (true);
61518 }, "java.awt.event.MouseEvent");
61519 Clazz_overrideMethod (c$, "mouseClicked", 
61520 function (evt) {
61521 }, "java.awt.event.MouseEvent");
61522 Clazz_overrideMethod (c$, "mouseEntered", 
61523 function (evt) {
61524 }, "java.awt.event.MouseEvent");
61525 Clazz_overrideMethod (c$, "mouseExited", 
61526 function (evt) {
61527 }, "java.awt.event.MouseEvent");
61528 c$.$SliderPanel$1$ = function () {
61529 Clazz_pu$h(self.c$);
61530 c$ = Clazz_declareAnonymous (jalview.appletgui, "SliderPanel$1", java.awt.event.WindowAdapter);
61531 Clazz_overrideMethod (c$, "windowClosing", 
61532 function (e) {
61533 jalview.appletgui.SliderPanel.conservationSlider = null;
61534 }, "java.awt.event.WindowEvent");
61535 c$ = Clazz_p0p ();
61536 };
61537 c$.$SliderPanel$2$ = function () {
61538 Clazz_pu$h(self.c$);
61539 c$ = Clazz_declareAnonymous (jalview.appletgui, "SliderPanel$2", java.awt.event.WindowAdapter);
61540 Clazz_overrideMethod (c$, "windowClosing", 
61541 function (e) {
61542 jalview.appletgui.SliderPanel.PIDSlider = null;
61543 }, "java.awt.event.WindowEvent");
61544 c$ = Clazz_p0p ();
61545 };
61546 Clazz_defineStatics (c$,
61547 "conservationSlider", null,
61548 "PIDSlider", null);
61549 });
61550 Clazz_declarePackage ("jalview.commands");
61551 Clazz_load (["jalview.commands.CommandI"], "jalview.commands.ChangeCaseCommand", ["java.lang.StringBuffer"], function () {
61552 c$ = Clazz_decorateAsClass (function () {
61553 this.description = null;
61554 this.caseChange = -1;
61555 this.seqs = null;
61556 this.regions = null;
61557 Clazz_instantialize (this, arguments);
61558 }, jalview.commands, "ChangeCaseCommand", null, jalview.commands.CommandI);
61559 Clazz_makeConstructor (c$, 
61560 function (description, seqs, regions, caseChange) {
61561 this.description = description;
61562 this.seqs = seqs;
61563 this.regions = regions;
61564 this.caseChange = caseChange;
61565 this.doCommand (null);
61566 }, "~S,~A,java.util.List,~N");
61567 Clazz_overrideMethod (c$, "getDescription", 
61568 function () {
61569 return this.description;
61570 });
61571 Clazz_overrideMethod (c$, "getSize", 
61572 function () {
61573 return 1;
61574 });
61575 Clazz_overrideMethod (c$, "doCommand", 
61576 function (views) {
61577 this.changeCase (true);
61578 }, "~A");
61579 Clazz_overrideMethod (c$, "undoCommand", 
61580 function (views) {
61581 this.changeCase (false);
61582 }, "~A");
61583 Clazz_defineMethod (c$, "changeCase", 
61584 function (doCommand) {
61585 var sequence;
61586 var start;
61587 var end;
61588 var nextChar;
61589 for (var r, $r = this.regions.iterator (); $r.hasNext () && ((r = $r.next ()) || true);) {
61590 start = r[0];
61591 for (var s = 0; s < this.seqs.length; s++) {
61592 sequence = this.seqs[s].getSequenceAsString ();
61593 var newSeq =  new StringBuffer ();
61594 if (r[1] > sequence.length) {
61595 end = sequence.length;
61596 } else {
61597 end = r[1];
61598 }if (start > 0) {
61599 newSeq.append (sequence.substring (0, start));
61600 }if ((this.caseChange == jalview.commands.ChangeCaseCommand.TO_UPPER && doCommand) || (this.caseChange == jalview.commands.ChangeCaseCommand.TO_LOWER && !doCommand)) {
61601 newSeq.append (sequence.substring (start, end).toUpperCase ());
61602 } else if ((this.caseChange == jalview.commands.ChangeCaseCommand.TO_LOWER && doCommand) || (this.caseChange == jalview.commands.ChangeCaseCommand.TO_UPPER && !doCommand)) {
61603 newSeq.append (sequence.substring (start, end).toLowerCase ());
61604 } else {
61605 for (var c = start; c < end; c++) {
61606 nextChar = sequence.charAt (c);
61607 if ('a' <= nextChar && nextChar <= 'z') {
61608 nextChar = String.fromCharCode (nextChar.charCodeAt (0) - (32));
61609 } else if ('A' <= nextChar && nextChar <= 'Z') {
61610 nextChar = String.fromCharCode (nextChar.charCodeAt (0) + (32));
61611 }newSeq.append (nextChar);
61612 }
61613 }if (end < sequence.length) {
61614 newSeq.append (sequence.substring (end));
61615 }this.seqs[s].setSequence (newSeq.toString ());
61616 }
61617 }
61618 }, "~B");
61619 Clazz_defineStatics (c$,
61620 "TO_LOWER", 0,
61621 "TO_UPPER", 1,
61622 "TOGGLE_CASE", 2);
61623 });
61624 Clazz_declarePackage ("jalview.io");
61625 Clazz_load (null, "jalview.io.SequenceAnnotationReport", ["jalview.util.DBRefUtils", "$.UrlLink", "java.lang.Float", "java.util.ArrayList"], function () {
61626 c$ = Clazz_decorateAsClass (function () {
61627 this.linkImageURL = null;
61628 Clazz_instantialize (this, arguments);
61629 }, jalview.io, "SequenceAnnotationReport");
61630 Clazz_makeConstructor (c$, 
61631 function (linkImageURL) {
61632 this.linkImageURL = linkImageURL;
61633 }, "~S");
61634 Clazz_defineMethod (c$, "appendFeatures", 
61635 function (tooltipText2, rpos, features) {
61636 this.appendFeatures (tooltipText2, rpos, features, null);
61637 }, "StringBuffer,~N,java.util.List");
61638 Clazz_defineMethod (c$, "appendFeatures", 
61639 function (tooltipText2, rpos, features, minmax) {
61640 var tmpString;
61641 if (features != null) {
61642 for (var feature, $feature = features.iterator (); $feature.hasNext () && ((feature = $feature.next ()) || true);) {
61643 if (feature.getType ().equals ("disulfide bond")) {
61644 if (feature.getBegin () == rpos || feature.getEnd () == rpos) {
61645 if (tooltipText2.length () > 6) {
61646 tooltipText2.append ("<br>");
61647 }tooltipText2.append ("disulfide bond " + feature.getBegin () + ":" + feature.getEnd ());
61648 }} else {
61649 if (tooltipText2.length () > 6) {
61650 tooltipText2.append ("<br>");
61651 }var linkOnly = feature.getValue ("linkonly") != null;
61652 if (!linkOnly) {
61653 tooltipText2.append (feature.getType () + " ");
61654 if (rpos != 0) {
61655 tooltipText2.append ("" + feature.begin);
61656 }if (feature.begin != feature.end) {
61657 tooltipText2.append (" " + feature.end);
61658 }if (feature.getDescription () != null && !feature.description.equals (feature.getType ())) {
61659 tmpString = feature.getDescription ();
61660 var tmp2up = tmpString.toUpperCase ();
61661 var startTag = tmp2up.indexOf ("<HTML>");
61662 if (startTag > -1) {
61663 tmpString = tmpString.substring (startTag + 6);
61664 tmp2up = tmp2up.substring (startTag + 6);
61665 }var endTag = tmp2up.indexOf ("</BODY>");
61666 if (endTag > -1) {
61667 tmpString = tmpString.substring (0, endTag);
61668 tmp2up = tmp2up.substring (0, endTag);
61669 }endTag = tmp2up.indexOf ("</HTML>");
61670 if (endTag > -1) {
61671 tmpString = tmpString.substring (0, endTag);
61672 }if (startTag > -1) {
61673 tooltipText2.append ("; " + tmpString);
61674 } else {
61675 if (tmpString.indexOf ("<") > -1 || tmpString.indexOf (">") > -1) {
61676 tmpString = tmpString.replaceAll ("<", "&lt;");
61677 tmpString = tmpString.replaceAll (">", "&gt;");
61678 tooltipText2.append ("; ");
61679 tooltipText2.append (tmpString);
61680 } else {
61681 tooltipText2.append ("; " + tmpString);
61682 }}}if (!Float.isNaN (feature.getScore ())) {
61683 var rng = (minmax == null) ? null : (minmax.get (feature.getType ()));
61684 if (rng != null && rng[0] != null && rng[0][0] != rng[0][1]) {
61685 tooltipText2.append (" Score=" + feature.getScore ());
61686 }}if (feature.getValue ("status") != null) {
61687 var status = feature.getValue ("status").toString ();
61688 if (status.length > 0) {
61689 tooltipText2.append ("; (" + feature.getValue ("status") + ")");
61690 }}}}if (feature.links != null) {
61691 if (this.linkImageURL != null) {
61692 tooltipText2.append (" <img src=\"" + this.linkImageURL + "\">");
61693 } else {
61694 for (var urlstring, $urlstring = feature.links.iterator (); $urlstring.hasNext () && ((urlstring = $urlstring.next ()) || true);) {
61695 try {
61696 for (var urllink, $urllink = 0, $$urllink = this.createLinksFrom (null, urlstring); $urllink < $$urllink.length && ((urllink = $$urllink[$urllink]) || true); $urllink++) {
61697 tooltipText2.append ("<br/> <a href=\"" + urllink[3] + "\" target=\"" + urllink[0] + "\">" + (urllink[0].toLowerCase ().equals (urllink[1].toLowerCase ()) ? urllink[0] : (urllink[0] + ":" + urllink[1])) + "</a></br>");
61698 }
61699 } catch (x) {
61700 if (Clazz_exceptionOf (x, Exception)) {
61701 System.err.println ("problem when creating links from " + urlstring);
61702 x.printStackTrace ();
61703 } else {
61704 throw x;
61705 }
61706 }
61707 }
61708 }}}
61709 }}, "StringBuffer,~N,java.util.List,java.util.Hashtable");
61710 Clazz_defineMethod (c$, "createLinksFrom", 
61711 function (seq, link) {
61712 var urlSets =  new java.util.ArrayList ();
61713 var uniques =  new java.util.ArrayList ();
61714 var urlLink =  new jalview.util.UrlLink (link);
61715 if (!urlLink.isValid ()) {
61716 System.err.println (urlLink.getInvalidMessage ());
61717 return null;
61718 }var target = urlLink.getTarget ();
61719 var label = urlLink.getLabel ();
61720 if (seq != null && urlLink.isDynamic ()) {
61721 var dbr = jalview.util.DBRefUtils.selectRefs (seq.getDBRef (),  Clazz_newArray (-1, [target]));
61722 var id = seq.getName ();
61723 var descr = seq.getDescription ();
61724 if (descr != null && descr.length < 1) {
61725 descr = null;
61726 }if (dbr != null) {
61727 for (var r = 0; r < dbr.length; r++) {
61728 if (id != null && dbr[r].getAccessionId ().equals (id)) {
61729 id = null;
61730 }var urls = urlLink.makeUrls (dbr[r].getAccessionId (), true);
61731 if (urls != null) {
61732 for (var u = 0; u < urls.length; u += 2) {
61733 var unq = urls[u] + "|" + urls[u + 1];
61734 if (!uniques.contains (unq)) {
61735 urlSets.add ( Clazz_newArray (-1, [target, label, urls[u], urls[u + 1]]));
61736 uniques.add (unq);
61737 }}
61738 }}
61739 }if (id != null) {
61740 var urls = urlLink.makeUrls (id, true);
61741 if (urls != null) {
61742 for (var u = 0; u < urls.length; u += 2) {
61743 var unq = urls[u] + "|" + urls[u + 1];
61744 if (!uniques.contains (unq)) {
61745 urlSets.add ( Clazz_newArray (-1, [target, label, urls[u], urls[u + 1]]));
61746 uniques.add (unq);
61747 }}
61748 }}if (descr != null && urlLink.getRegexReplace () != null) {
61749 var urls = urlLink.makeUrls (descr, true);
61750 if (urls != null) {
61751 for (var u = 0; u < urls.length; u += 2) {
61752 var unq = urls[u] + "|" + urls[u + 1];
61753 if (!uniques.contains (unq)) {
61754 urlSets.add ( Clazz_newArray (-1, [target, label, urls[u], urls[u + 1]]));
61755 uniques.add (unq);
61756 }}
61757 }}} else {
61758 var unq = label + "|" + urlLink.getUrl_prefix ();
61759 if (!uniques.contains (unq)) {
61760 uniques.add (unq);
61761 urlSets.add ( Clazz_newArray (-1, [target, label, null, urlLink.getUrl_prefix ()]));
61762 }}return urlSets.toArray ( Clazz_newArray (-1, []));
61763 }, "jalview.datamodel.SequenceI,~S");
61764 Clazz_defineMethod (c$, "createSequenceAnnotationReport", 
61765 function (tip, sequence, showDbRefs, showNpFeats, minmax) {
61766 this.createSequenceAnnotationReport (tip, sequence, showDbRefs, showNpFeats, true, minmax);
61767 }, "StringBuffer,jalview.datamodel.SequenceI,~B,~B,java.util.Hashtable");
61768 Clazz_defineMethod (c$, "createSequenceAnnotationReport", 
61769 function (tip, sequence, showDbRefs, showNpFeats, tableWrap, minmax) {
61770 var tmp;
61771 tip.append ("<i>");
61772 var maxWidth = 0;
61773 if (sequence.getDescription () != null) {
61774 tmp = sequence.getDescription ();
61775 tip.append ("<br>" + tmp);
61776 maxWidth = Math.max (maxWidth, tmp.length);
61777 }var ds = sequence;
61778 while (ds.getDatasetSequence () != null) {
61779 ds = ds.getDatasetSequence ();
61780 }
61781 var dbrefs = ds.getDBRef ();
61782 if (showDbRefs && dbrefs != null) {
61783 for (var i = 0; i < dbrefs.length; i++) {
61784 tip.append ("<br>");
61785 tmp = dbrefs[i].getSource () + " " + dbrefs[i].getAccessionId ();
61786 tip.append (tmp);
61787 maxWidth = Math.max (maxWidth, tmp.length);
61788 }
61789 }var features = sequence.getSequenceFeatures ();
61790 if (showNpFeats && features != null) {
61791 for (var i = 0; i < features.length; i++) {
61792 if (features[i].begin == 0 && features[i].end == 0) {
61793 var sz = -tip.length ();
61794 var tfeat =  new java.util.ArrayList ();
61795 tfeat.add (features[i]);
61796 this.appendFeatures (tip, 0, tfeat, minmax);
61797 sz += tip.length ();
61798 maxWidth = Math.max (maxWidth, sz);
61799 }}
61800 }if (tableWrap && maxWidth > 60) {
61801 tip.insert (0, "<table width=350 border=0><tr><td><i>");
61802 tip.append ("</i></td></tr></table>");
61803 }}, "StringBuffer,jalview.datamodel.SequenceI,~B,~B,~B,java.util.Hashtable");
61804 });
61805 Clazz_declarePackage ("jalview.util");
61806 Clazz_load (null, "jalview.util.UrlLink", ["jalview.jsdev.RegExp", "java.util.Vector"], function () {
61807 c$ = Clazz_decorateAsClass (function () {
61808 this.url_suffix = null;
61809 this.url_prefix = null;
61810 this.target = null;
61811 this.label = null;
61812 this.regexReplace = null;
61813 this.dynamic = false;
61814 this.invalidMessage = null;
61815 Clazz_instantialize (this, arguments);
61816 }, jalview.util, "UrlLink");
61817 Clazz_makeConstructor (c$, 
61818 function (link) {
61819 var sep = link.indexOf ("|");
61820 var psqid = link.indexOf ("$SEQUENCE_ID");
61821 if (psqid > -1) {
61822 this.dynamic = true;
61823 var p = sep;
61824 do {
61825 sep = p;
61826 p = link.indexOf ("|", sep + 1);
61827 } while (p > sep && p < psqid);
61828 this.label = link.substring (0, sep);
61829 if (this.label.indexOf ("|") > -1) {
61830 this.target = this.label.substring (0, this.label.indexOf ("|"));
61831 } else if (this.label.indexOf (" ") > 2) {
61832 this.target = this.label.substring (0, this.label.indexOf (" "));
61833 } else {
61834 this.target = this.label;
61835 }this.url_prefix = link.substring (sep + 1, psqid);
61836 if (link.indexOf ("$SEQUENCE_ID=/") == psqid && (p = link.indexOf ("/=$", psqid + 14)) > psqid + 14) {
61837 this.url_suffix = link.substring (p + 3);
61838 this.regexReplace = link.substring (psqid + 14, p);
61839 try {
61840 var rg = jalview.jsdev.RegExp.perlCode ("/" + this.regexReplace + "/");
61841 if (rg == null) {
61842 this.invalidMessage = "Invalid Regular Expression : '" + this.regexReplace + "'\n";
61843 }} catch (e) {
61844 if (Clazz_exceptionOf (e, Exception)) {
61845 this.invalidMessage = "Invalid Regular Expression : '" + this.regexReplace + "'\n";
61846 } else {
61847 throw e;
61848 }
61849 }
61850 } else {
61851 this.regexReplace = null;
61852 if (link.indexOf ("$SEQUENCE_ID$") == psqid) {
61853 this.url_suffix = link.substring (psqid + 13);
61854 this.regexReplace = null;
61855 } else {
61856 this.invalidMessage = "Warning: invalid regex structure for URL link : " + link;
61857 }}} else {
61858 this.target = link.substring (0, sep);
61859 this.label = link.substring (0, sep = link.lastIndexOf ("|"));
61860 this.url_prefix = link.substring (sep + 1);
61861 this.regexReplace = null;
61862 this.url_suffix = null;
61863 }}, "~S");
61864 Clazz_defineMethod (c$, "getUrl_suffix", 
61865 function () {
61866 return this.url_suffix;
61867 });
61868 Clazz_defineMethod (c$, "getUrl_prefix", 
61869 function () {
61870 return this.url_prefix;
61871 });
61872 Clazz_defineMethod (c$, "getTarget", 
61873 function () {
61874 return this.target;
61875 });
61876 Clazz_defineMethod (c$, "getLabel", 
61877 function () {
61878 return this.label;
61879 });
61880 Clazz_defineMethod (c$, "getRegexReplace", 
61881 function () {
61882 return this.regexReplace;
61883 });
61884 Clazz_defineMethod (c$, "getInvalidMessage", 
61885 function () {
61886 return this.invalidMessage;
61887 });
61888 Clazz_defineMethod (c$, "isValid", 
61889 function () {
61890 return this.invalidMessage == null;
61891 });
61892 Clazz_defineMethod (c$, "makeUrls", 
61893 function (idstring, onlyIfMatches) {
61894 if (this.dynamic) {
61895 if (this.regexReplace != null) {
61896 var rg = jalview.jsdev.RegExp.perlCode ("/" + this.regexReplace + "/");
61897 if (rg.search (idstring)) {
61898 var ns = rg.numSubs ();
61899 if (ns == 0) {
61900 return  Clazz_newArray (-1, [rg.stringMatchedI (ns), this.url_prefix + rg.stringMatched () + this.url_suffix]);
61901 } else {
61902 for (var s = 0; s <= rg.numSubs (); s++) {
61903 System.err.println ("Sub " + s + " : " + rg.matchedFromI (s) + " : " + rg.matchedToI (s) + " : '" + rg.stringMatchedI (s) + "'");
61904 }
61905 var subs =  new java.util.Vector ();
61906 var s = 0;
61907 while (s <= ns) {
61908 if (s + 1 <= ns && rg.matchedToI (s) > -1 && rg.matchedToI (s + 1) > -1 && rg.matchedToI (s + 1) < rg.matchedToI (s)) {
61909 var r = s + 1;
61910 var mtch = "";
61911 while (r <= ns && rg.matchedToI (r) <= rg.matchedToI (s)) {
61912 if (rg.matchedFromI (r) > -1) {
61913 mtch += rg.stringMatchedI (r);
61914 }r++;
61915 }
61916 if (mtch.length > 0) {
61917 subs.addElement (mtch);
61918 subs.addElement (this.url_prefix + mtch + this.url_suffix);
61919 }s = r;
61920 } else {
61921 if (rg.matchedFromI (s) > -1) {
61922 subs.addElement (rg.stringMatchedI (s));
61923 subs.addElement (this.url_prefix + rg.stringMatchedI (s) + this.url_suffix);
61924 }s++;
61925 }}
61926 var res =  new Array (subs.size ());
61927 for (var r = 0, rs = subs.size (); r < rs; r++) {
61928 res[r] = subs.elementAt (r);
61929 }
61930 subs.removeAllElements ();
61931 return res;
61932 }}if (onlyIfMatches) {
61933 return null;
61934 }}if (idstring.indexOf ("|") > -1) {
61935 idstring = idstring.substring (idstring.lastIndexOf ("|") + 1);
61936 }return  Clazz_newArray (-1, [idstring, this.url_prefix + idstring + this.url_suffix]);
61937 } else {
61938 return  Clazz_newArray (-1, ["", this.url_prefix]);
61939 }}, "~S,~B");
61940 Clazz_overrideMethod (c$, "toString", 
61941 function () {
61942 return this.label + "|" + this.url_prefix + (this.dynamic ? ("$SEQUENCE_ID" + ((this.regexReplace != null) ? "=" + this.regexReplace + "=$" : "$")) : "") + ((this.url_suffix == null) ? "" : this.url_suffix);
61943 });
61944 Clazz_defineMethod (c$, "isDynamic", 
61945 function () {
61946 return this.dynamic;
61947 });
61948 Clazz_defineMethod (c$, "setLabel", 
61949 function (newlabel) {
61950 this.label = newlabel;
61951 }, "~S");
61952 });
61953 Clazz_declarePackage ("jalview.appletgui");
61954 Clazz_load (["awt2swing.Panel"], "jalview.appletgui.IdCanvas", ["awt2swing.Util", "jalview.appletgui.AnnotationLabels", "$.AnnotationPanel", "$.PaintRefresher", "java.awt.Color", "$.Font"], function () {
61955 c$ = Clazz_decorateAsClass (function () {
61956 this.av = null;
61957 this.showScores = true;
61958 this.maxIdLength = -1;
61959 this.maxIdStr = null;
61960 this.image = null;
61961 this.gg = null;
61962 this.imgHeight = 0;
61963 this.$fastPaint = false;
61964 this.searchResults = null;
61965 this.avcharHeight = 0;
61966 Clazz_instantialize (this, arguments);
61967 }, jalview.appletgui, "IdCanvas", awt2swing.Panel);
61968 Clazz_makeConstructor (c$, 
61969 function (av) {
61970 Clazz_superConstructor (this, jalview.appletgui.IdCanvas, []);
61971 this.setLayout (null);
61972 this.av = av;
61973 jalview.appletgui.PaintRefresher.Register (this, av.getSequenceSetId ());
61974 }, "jalview.appletgui.AlignViewport");
61975 Clazz_defineMethod (c$, "drawIdString", 
61976 function (gg, hiddenRows, s, i, starty, ypos) {
61977 var charHeight = this.av.getCharHeight ();
61978 if (this.searchResults != null && this.searchResults.contains (s)) {
61979 gg.setColor (java.awt.Color.black);
61980 gg.fillRect (0, ((i - starty) * charHeight) + ypos, this.getSize ().width, charHeight);
61981 gg.setColor (java.awt.Color.white);
61982 } else if (this.av.getSelectionGroup () != null && this.av.getSelectionGroup ().getSequences (null).contains (s)) {
61983 gg.setColor (java.awt.Color.lightGray);
61984 gg.fillRect (0, ((i - starty) * charHeight) + ypos, this.getSize ().width, charHeight);
61985 gg.setColor (java.awt.Color.white);
61986 } else {
61987 gg.setColor (this.av.getSequenceColour (s));
61988 gg.fillRect (0, ((i - starty) * charHeight) + ypos, this.getSize ().width, charHeight);
61989 gg.setColor (java.awt.Color.black);
61990 }awt2swing.Util.drawString (gg, s.getDisplayId (this.av.getShowJVSuffix ()), 0, ((i - starty) * charHeight) + ypos + charHeight - (Clazz_doubleToInt (charHeight / 5)));
61991 if (hiddenRows) {
61992 this.drawMarker (i, starty, ypos);
61993 }}, "java.awt.Graphics,~B,jalview.datamodel.SequenceI,~N,~N,~N");
61994 Clazz_defineMethod (c$, "fastPaint", 
61995 function (vertical) {
61996 if (this.gg == null) {
61997 this.repaint ();
61998 return;
61999 }this.gg.copyArea (0, 0, this.getSize ().width, this.imgHeight, 0, -vertical * this.av.getCharHeight ());
62000 var ss = this.av.startSeq;
62001 var es = this.av.endSeq;
62002 var transY = 0;
62003 if (vertical > 0) {
62004 ss = es - vertical;
62005 if (ss < this.av.startSeq) {
62006 ss = this.av.startSeq;
62007 } else {
62008 transY = this.imgHeight - vertical * this.av.getCharHeight ();
62009 }} else if (vertical < 0) {
62010 es = ss - vertical;
62011 if (es > this.av.endSeq) {
62012 es = this.av.endSeq;
62013 }}this.gg.translate (0, transY);
62014 this.drawIds (ss, es);
62015 this.gg.translate (0, -transY);
62016 this.$fastPaint = true;
62017 this.repaint ();
62018 }, "~N");
62019 Clazz_overrideMethod (c$, "paintComponent", 
62020 function (g) {
62021 if (this.getSize ().height < 0 || this.getSize ().width < 0) {
62022 return;
62023 }if (this.$fastPaint) {
62024 this.$fastPaint = false;
62025 g.drawImage (this.image, 0, 0, this);
62026 return;
62027 }this.imgHeight = this.getSize ().height;
62028 this.imgHeight -= this.imgHeight % this.av.getCharHeight ();
62029 if (this.imgHeight < 1) {
62030 return;
62031 }if (this.image == null || this.imgHeight != this.image.getHeight (this)) {
62032 this.image = this.createImage (this.getSize ().width, this.imgHeight);
62033 this.gg = this.image.getGraphics ();
62034 this.gg.setFont (this.av.getFont ());
62035 }this.gg.setColor (java.awt.Color.white);
62036 var italic =  new java.awt.Font (this.av.getFont ().getName (), 2, this.av.getFont ().getSize ());
62037 this.gg.setFont (italic);
62038 this.gg.fillRect (0, 0, this.getSize ().width, this.getSize ().height);
62039 this.drawIds (this.av.startSeq, this.av.endSeq);
62040 g.drawImage (this.image, 0, 0, this);
62041 }, "java.awt.Graphics");
62042 Clazz_defineMethod (c$, "drawIds", 
62043 function (starty, endy) {
62044 var italic =  new java.awt.Font (this.av.getFont ().getName (), 2, this.av.getFont ().getSize ());
62045 this.avcharHeight = this.av.getCharHeight ();
62046 this.gg.setFont (italic);
62047 var currentColor = java.awt.Color.white;
62048 var currentTextColor = java.awt.Color.black;
62049 var doHiddenCheck = this.av.isDisplayReferenceSeq () || this.av.hasHiddenRows ();
62050 var hiddenRows = this.av.hasHiddenRows () && this.av.getShowHiddenMarkers ();
62051 if (this.av.getWrapAlignment ()) {
62052 var maxwidth = this.av.getAlignment ().getWidth ();
62053 var alheight = this.av.getAlignment ().getHeight ();
62054 if (this.av.hasHiddenColumns ()) {
62055 maxwidth = this.av.getColumnSelection ().findColumnPosition (maxwidth) - 1;
62056 }var annotationHeight = 0;
62057 var labels = null;
62058 if (this.av.isShowAnnotation ()) {
62059 var ap =  new jalview.appletgui.AnnotationPanel (this.av);
62060 annotationHeight = ap.adjustPanelHeight ();
62061 labels =  new jalview.appletgui.AnnotationLabels (this.av);
62062 }var hgap = this.avcharHeight;
62063 if (this.av.getScaleAboveWrapped ()) {
62064 hgap += this.avcharHeight;
62065 }var cHeight = alheight * this.avcharHeight + hgap + annotationHeight;
62066 var rowSize = this.av.getEndRes () - this.av.getStartRes ();
62067 for (var ypos = hgap, row = this.av.startRes; (ypos <= this.getSize ().height) && (row < maxwidth); ypos += cHeight, row += rowSize) {
62068 for (var i = starty; i < alheight; i++) {
62069 var s = this.av.getAlignment ().getSequenceAt (i);
62070 this.gg.setFont (italic);
62071 if (doHiddenCheck) {
62072 this.setHiddenFont (s);
62073 }this.drawIdString (this.gg, hiddenRows, s, i, 0, ypos);
62074 }
62075 if (labels != null) {
62076 this.gg.translate (0, ypos + (alheight * this.avcharHeight));
62077 labels.drawComponent (this.gg, this.getSize ().width);
62078 this.gg.translate (0, -ypos - (alheight * this.avcharHeight));
62079 }}
62080 } else {
62081 var seq;
62082 for (var i = starty; i < endy; i++) {
62083 seq = this.av.getAlignment ().getSequenceAt (i);
62084 if (seq == null) {
62085 continue;
62086 }this.gg.setFont (italic);
62087 if (doHiddenCheck) {
62088 this.setHiddenFont (seq);
62089 }if ((this.searchResults != null) && this.searchResults.contains (seq)) {
62090 currentColor = java.awt.Color.black;
62091 currentTextColor = java.awt.Color.white;
62092 } else if ((this.av.getSelectionGroup () != null) && this.av.getSelectionGroup ().getSequences (null).contains (seq)) {
62093 currentColor = java.awt.Color.lightGray;
62094 currentTextColor = java.awt.Color.black;
62095 } else {
62096 currentColor = this.av.getSequenceColour (seq);
62097 currentTextColor = java.awt.Color.black;
62098 }this.gg.setColor (currentColor);
62099 this.gg.fillRect (0, (i - starty) * this.avcharHeight, this.getSize ().width, this.avcharHeight);
62100 this.gg.setColor (currentTextColor);
62101 awt2swing.Util.drawString (this.gg, seq.getDisplayId (this.av.getShowJVSuffix ()), 0, (((i - starty) * this.avcharHeight) + this.avcharHeight) - (Clazz_doubleToInt (this.avcharHeight / 5)));
62102 if (hiddenRows) {
62103 this.drawMarker (i, starty, 0);
62104 }}
62105 }}, "~N,~N");
62106 Clazz_defineMethod (c$, "setHighlighted", 
62107 function (list) {
62108 this.searchResults = list;
62109 this.repaint ();
62110 }, "java.util.List");
62111 Clazz_defineMethod (c$, "drawMarker", 
62112 function (i, starty, yoffset) {
62113 var hseqs = this.av.getAlignment ().getHiddenSequences ().hiddenSequences;
62114 var hSize = hseqs.length;
62115 var hiddenIndex = i;
62116 var lastIndex = i - 1;
62117 var nextIndex = i + 1;
62118 for (var j = 0; j < hSize; j++) {
62119 if (hseqs[j] != null) {
62120 if (j - 1 < hiddenIndex) {
62121 hiddenIndex++;
62122 }if (j - 1 < lastIndex) {
62123 lastIndex++;
62124 }if (j - 1 < nextIndex) {
62125 nextIndex++;
62126 }}}
62127 var below = (hiddenIndex > lastIndex + 1);
62128 var above = (nextIndex > hiddenIndex + 1);
62129 this.gg.setColor (java.awt.Color.blue);
62130 if (below) {
62131 this.gg.fillPolygon ( Clazz_newIntArray (-1, [this.getSize ().width - this.avcharHeight, this.getSize ().width - this.avcharHeight, this.getSize ().width]),  Clazz_newIntArray (-1, [(i - starty) * this.avcharHeight + yoffset, (i - starty) * this.avcharHeight + yoffset + Clazz_doubleToInt (this.avcharHeight / 4), (i - starty) * this.avcharHeight + yoffset]), 3);
62132 }if (above) {
62133 this.gg.fillPolygon ( Clazz_newIntArray (-1, [this.getSize ().width - this.avcharHeight, this.getSize ().width - this.avcharHeight, this.getSize ().width]),  Clazz_newIntArray (-1, [(i - starty + 1) * this.avcharHeight + yoffset, (i - starty + 1) * this.avcharHeight + yoffset - Clazz_doubleToInt (this.avcharHeight / 4), (i - starty + 1) * this.avcharHeight + yoffset]), 3);
62134 }}, "~N,~N,~N");
62135 Clazz_defineMethod (c$, "setHiddenFont", 
62136 function (seq) {
62137 var bold =  new java.awt.Font (this.av.getFont ().getName (), 1, this.av.getFont ().getSize ());
62138 if (this.av.isHiddenRepSequence (seq)) {
62139 this.gg.setFont (bold);
62140 return true;
62141 }return false;
62142 }, "jalview.datamodel.SequenceI");
62143 });
62144 Clazz_declarePackage ("jalview.appletgui");
62145 Clazz_load (["awt2swing.Panel", "java.awt.event.MouseListener", "$.MouseMotionListener"], "jalview.appletgui.IdwidthAdjuster", ["java.awt.Color", "$.Toolkit"], function () {
62146 c$ = Clazz_decorateAsClass (function () {
62147 this.active = false;
62148 this.oldX = 0;
62149 this.image = null;
62150 this.ap = null;
62151 Clazz_instantialize (this, arguments);
62152 }, jalview.appletgui, "IdwidthAdjuster", awt2swing.Panel, [java.awt.event.MouseListener, java.awt.event.MouseMotionListener]);
62153 Clazz_makeConstructor (c$, 
62154 function (ap) {
62155 Clazz_superConstructor (this, jalview.appletgui.IdwidthAdjuster, []);
62156 this.setName ("IdwidthAdjuster");
62157 this.setLayout (null);
62158 this.ap = ap;
62159 var url = this.getClass ().getResource ("/images/idwidth.gif");
62160 if (url != null) {
62161 this.image = java.awt.Toolkit.getDefaultToolkit ().getImage (url);
62162 }this.addMouseListener (this);
62163 this.addMouseMotionListener (this);
62164 }, "jalview.appletgui.AlignmentPanel");
62165 Clazz_overrideMethod (c$, "mousePressed", 
62166 function (evt) {
62167 this.oldX = evt.getX ();
62168 }, "java.awt.event.MouseEvent");
62169 Clazz_overrideMethod (c$, "mouseReleased", 
62170 function (evt) {
62171 this.active = false;
62172 this.repaint ();
62173 }, "java.awt.event.MouseEvent");
62174 Clazz_overrideMethod (c$, "mouseEntered", 
62175 function (evt) {
62176 this.active = true;
62177 this.repaint ();
62178 }, "java.awt.event.MouseEvent");
62179 Clazz_overrideMethod (c$, "mouseExited", 
62180 function (evt) {
62181 this.active = false;
62182 this.repaint ();
62183 }, "java.awt.event.MouseEvent");
62184 Clazz_overrideMethod (c$, "mouseDragged", 
62185 function (evt) {
62186 this.active = true;
62187 var d = this.ap.idPanel.idCanvas.getSize ();
62188 var dif = evt.getX () - this.oldX;
62189 var newWidth = d.width + dif;
62190 if (newWidth > 20 || dif > 0) {
62191 this.ap.setIdWidth (newWidth, d.height);
62192 this.setSize (newWidth, this.getSize ().height);
62193 this.oldX = evt.getX ();
62194 }}, "java.awt.event.MouseEvent");
62195 Clazz_overrideMethod (c$, "mouseMoved", 
62196 function (evt) {
62197 }, "java.awt.event.MouseEvent");
62198 Clazz_overrideMethod (c$, "mouseClicked", 
62199 function (evt) {
62200 }, "java.awt.event.MouseEvent");
62201 Clazz_defineMethod (c$, "PaintComponent", 
62202 function (g) {
62203 g.setColor (java.awt.Color.white);
62204 g.fillRect (0, 0, this.getSize ().width, this.getSize ().height);
62205 if (this.active) {
62206 if (this.image != null) {
62207 g.drawImage (this.image, this.getSize ().width - 20, 2, this);
62208 }}}, "java.awt.Graphics");
62209 });
62210 Clazz_declarePackage ("jalview.appletgui");
62211 Clazz_load (["awt2swing.Panel", "java.awt.event.MouseListener", "$.MouseMotionListener"], "jalview.appletgui.ScalePanel", ["awt2swing.MenuItem", "$.PopupMenu", "$.Util", "jalview.datamodel.SequenceGroup", "jalview.util.MessageManager", "java.awt.Color", "java.awt.event.ActionListener"], function () {
62212 c$ = Clazz_decorateAsClass (function () {
62213 this.offy = 4;
62214 this.$width = 0;
62215 this.av = null;
62216 this.ap = null;
62217 this.stretchingGroup = false;
62218 this.min = 0;
62219 this.max = 0;
62220 this.mouseDragging = false;
62221 this.reveal = null;
62222 Clazz_instantialize (this, arguments);
62223 }, jalview.appletgui, "ScalePanel", awt2swing.Panel, [java.awt.event.MouseMotionListener, java.awt.event.MouseListener]);
62224 Clazz_makeConstructor (c$, 
62225 function (av, ap) {
62226 Clazz_superConstructor (this, jalview.appletgui.ScalePanel, []);
62227 this.setName ("scalePanel");
62228 this.setLayout (null);
62229 this.av = av;
62230 this.ap = ap;
62231 this.addMouseListener (this);
62232 this.addMouseMotionListener (this);
62233 }, "jalview.appletgui.AlignViewport,jalview.appletgui.AlignmentPanel");
62234 Clazz_overrideMethod (c$, "mousePressed", 
62235 function (evt) {
62236 var x = (Clazz_doubleToInt (evt.getX () / this.av.getCharWidth ())) + this.av.getStartRes ();
62237 var res;
62238 if (this.av.hasHiddenColumns ()) {
62239 res = this.av.getColumnSelection ().adjustForHiddenColumns (x);
62240 } else {
62241 res = x;
62242 }this.min = res;
62243 this.max = res;
62244 if ((evt.getModifiers () & 4) == 4) {
62245 var pop =  new awt2swing.PopupMenu ();
62246 if (this.reveal != null) {
62247 var item =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.reveal"));
62248 item.addActionListener (((Clazz_isClassDefined ("jalview.appletgui.ScalePanel$1") ? 0 : jalview.appletgui.ScalePanel.$ScalePanel$1$ ()), Clazz_innerTypeInstance (jalview.appletgui.ScalePanel$1, this, null)));
62249 pop.add (item);
62250 if (this.av.getColumnSelection ().hasManyHiddenColumns ()) {
62251 item =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("action.reveal_all"));
62252 item.addActionListener (((Clazz_isClassDefined ("jalview.appletgui.ScalePanel$2") ? 0 : jalview.appletgui.ScalePanel.$ScalePanel$2$ ()), Clazz_innerTypeInstance (jalview.appletgui.ScalePanel$2, this, null)));
62253 pop.add (item);
62254 }this.add (pop);
62255 pop.show (this, evt.getX (), evt.getY ());
62256 } else if (this.av.getColumnSelection ().contains (res)) {
62257 var item =  new awt2swing.MenuItem (jalview.util.MessageManager.getString ("label.hide_columns"));
62258 item.addActionListener (((Clazz_isClassDefined ("jalview.appletgui.ScalePanel$3") ? 0 : jalview.appletgui.ScalePanel.$ScalePanel$3$ ()), Clazz_innerTypeInstance (jalview.appletgui.ScalePanel$3, this, Clazz_cloneFinals ("res", res))));
62259 pop.add (item);
62260 this.add (pop);
62261 pop.show (this, evt.getX (), evt.getY ());
62262 }} else {
62263 if (!evt.isControlDown () && !evt.isShiftDown ()) {
62264 this.av.getColumnSelection ().clear ();
62265 }this.av.getColumnSelection ().addElement (res);
62266 var sg =  new jalview.datamodel.SequenceGroup ();
62267 for (var i = 0; i < this.av.getAlignment ().getSequences ().size (); i++) {
62268 sg.addSequence (this.av.getAlignment ().getSequenceAt (i), false);
62269 }
62270 sg.setStartRes (res);
62271 sg.setEndRes (res);
62272 this.av.setSelectionGroup (sg);
62273 if (evt.isShiftDown ()) {
62274 var min = Math.min (this.av.getColumnSelection ().getMin (), res);
62275 var max = Math.max (this.av.getColumnSelection ().getMax (), res);
62276 for (var i = min; i < max; i++) {
62277 this.av.getColumnSelection ().addElement (i);
62278 }
62279 sg.setStartRes (min);
62280 sg.setEndRes (max);
62281 }}this.ap.paintAlignment (true);
62282 this.av.sendSelection ();
62283 }, "java.awt.event.MouseEvent");
62284 Clazz_overrideMethod (c$, "mouseReleased", 
62285 function (evt) {
62286 this.mouseDragging = false;
62287 var res = (Clazz_doubleToInt (evt.getX () / this.av.getCharWidth ())) + this.av.getStartRes ();
62288 if (res > this.av.getAlignment ().getWidth ()) {
62289 res = this.av.getAlignment ().getWidth () - 1;
62290 }if (this.av.hasHiddenColumns ()) {
62291 res = this.av.getColumnSelection ().adjustForHiddenColumns (res);
62292 }if (!this.stretchingGroup) {
62293 this.ap.paintAlignment (false);
62294 return;
62295 }var sg = this.av.getSelectionGroup ();
62296 if (res > sg.getStartRes ()) {
62297 sg.setEndRes (res);
62298 } else if (res < sg.getStartRes ()) {
62299 sg.setStartRes (res);
62300 }this.stretchingGroup = false;
62301 this.ap.paintAlignment (false);
62302 this.av.sendSelection ();
62303 }, "java.awt.event.MouseEvent");
62304 Clazz_overrideMethod (c$, "mouseDragged", 
62305 function (evt) {
62306 this.mouseDragging = true;
62307 var res = (Clazz_doubleToInt (evt.getX () / this.av.getCharWidth ())) + this.av.getStartRes ();
62308 if (res < 0) {
62309 res = 0;
62310 }if (this.av.hasHiddenColumns ()) {
62311 res = this.av.getColumnSelection ().adjustForHiddenColumns (res);
62312 }if (res > this.av.getAlignment ().getWidth ()) {
62313 res = this.av.getAlignment ().getWidth () - 1;
62314 }if (res < this.min) {
62315 this.min = res;
62316 }if (res > this.max) {
62317 this.max = res;
62318 }var sg = this.av.getSelectionGroup ();
62319 if (sg != null) {
62320 this.stretchingGroup = true;
62321 if (!this.av.getColumnSelection ().contains (res)) {
62322 this.av.getColumnSelection ().addElement (res);
62323 }if (res > sg.getStartRes ()) {
62324 sg.setEndRes (res);
62325 }if (res < sg.getStartRes ()) {
62326 sg.setStartRes (res);
62327 }var col;
62328 for (var i = this.min; i <= this.max; i++) {
62329 col = this.av.getColumnSelection ().adjustForHiddenColumns (i);
62330 if ((col < sg.getStartRes ()) || (col > sg.getEndRes ())) {
62331 this.av.getColumnSelection ().removeElement (col);
62332 } else {
62333 this.av.getColumnSelection ().addElement (col);
62334 }}
62335 this.ap.paintAlignment (false);
62336 }}, "java.awt.event.MouseEvent");
62337 Clazz_overrideMethod (c$, "mouseEntered", 
62338 function (evt) {
62339 if (this.mouseDragging) {
62340 this.ap.seqPanel.scrollCanvas (null);
62341 }}, "java.awt.event.MouseEvent");
62342 Clazz_overrideMethod (c$, "mouseExited", 
62343 function (evt) {
62344 if (this.mouseDragging) {
62345 this.ap.seqPanel.scrollCanvas (evt);
62346 }}, "java.awt.event.MouseEvent");
62347 Clazz_overrideMethod (c$, "mouseClicked", 
62348 function (evt) {
62349 }, "java.awt.event.MouseEvent");
62350 Clazz_overrideMethod (c$, "mouseMoved", 
62351 function (evt) {
62352 if (!this.av.hasHiddenColumns ()) {
62353 return;
62354 }var res = (Clazz_doubleToInt (evt.getX () / this.av.getCharWidth ())) + this.av.getStartRes ();
62355 res = this.av.getColumnSelection ().adjustForHiddenColumns (res);
62356 this.reveal = null;
62357 for (var region, $region = this.av.getColumnSelection ().getHiddenColumns ().iterator (); $region.hasNext () && ((region = $region.next ()) || true);) {
62358 if (res + 1 == region[0] || res - 1 == region[1]) {
62359 this.reveal = region;
62360 break;
62361 }}
62362 this.repaint ();
62363 }, "java.awt.event.MouseEvent");
62364 Clazz_overrideMethod (c$, "paintComponent", 
62365 function (g) {
62366 if (this.av.getWrapAlignment ()) return;
62367 this.drawScale (g, this.av.getStartRes (), this.av.getEndRes (), this.getSize ().width, this.getSize ().height);
62368 }, "java.awt.Graphics");
62369 Clazz_defineMethod (c$, "drawScale", 
62370 function (gg, startx, endx, width, height) {
62371 gg.setFont (this.av.getFont ());
62372 gg.setColor (java.awt.Color.white);
62373 gg.fillRect (0, 0, width, height);
62374 gg.setColor (java.awt.Color.black);
62375 var cs = this.av.getColumnSelection ();
62376 gg.setColor ( new java.awt.Color (220, 0, 0));
62377 var avcharWidth = this.av.getCharWidth ();
62378 var avcharHeight = this.av.getCharHeight ();
62379 for (var i = 0; i < cs.size (); i++) {
62380 var sel = cs.columnAt (i);
62381 if (this.av.hasHiddenColumns ()) {
62382 sel = this.av.getColumnSelection ().findColumnPosition (sel);
62383 }if ((sel >= startx) && (sel <= endx)) {
62384 gg.fillRect ((sel - startx) * avcharWidth, 0, avcharWidth, this.getSize ().height);
62385 }}
62386 gg.setColor (java.awt.Color.black);
62387 var scalestartx = (Clazz_doubleToInt (startx / 10)) * 10;
62388 var fm = gg.getFontMetrics (this.av.getFont ());
62389 var y = avcharHeight - fm.getDescent ();
62390 if ((scalestartx % 10) == 0) {
62391 scalestartx += 5;
62392 }var string;
62393 var maxX = 0;
62394 for (var i = scalestartx; i < endx; i += 5) {
62395 if ((i % 10) == 0) {
62396 string = String.valueOf (this.av.getColumnSelection ().adjustForHiddenColumns (i));
62397 if ((i - startx - 1) * avcharWidth > maxX) {
62398 awt2swing.Util.drawString (gg, string, (i - startx - 1) * avcharWidth, y);
62399 maxX = (i - startx + 1) * avcharWidth + fm.stringWidth (string);
62400 }gg.drawLine (((i - startx - 1) * avcharWidth) + (Clazz_doubleToInt (avcharWidth / 2)), y + 2, ((i - startx - 1) * avcharWidth) + (Clazz_doubleToInt (avcharWidth / 2)), y + (fm.getDescent () * 2));
62401 } else {
62402 gg.drawLine (((i - startx - 1) * avcharWidth) + (Clazz_doubleToInt (avcharWidth / 2)), y + fm.getDescent (), ((i - startx - 1) * avcharWidth) + (Clazz_doubleToInt (avcharWidth / 2)), y + (fm.getDescent () * 2));
62403 }}
62404 if (this.av.hasHiddenColumns ()) {
62405 gg.setColor (java.awt.Color.blue);
62406 var res;
62407 if (this.av.getShowHiddenMarkers ()) {
62408 for (var i = 0; i < this.av.getColumnSelection ().getHiddenColumns ().size (); i++) {
62409 res = this.av.getColumnSelection ().findHiddenRegionPosition (i) - startx;
62410 if (res < 0 || res > endx - scalestartx) {
62411 continue;
62412 }gg.fillPolygon ( Clazz_newIntArray (-1, [res * avcharWidth - Clazz_doubleToInt (avcharHeight / 4), res * avcharWidth + Clazz_doubleToInt (avcharHeight / 4), res * avcharWidth]),  Clazz_newIntArray (-1, [y - Clazz_doubleToInt (avcharHeight / 2), y - Clazz_doubleToInt (avcharHeight / 2), y + 8]), 3);
62413 }
62414 }if (this.reveal != null && this.reveal[0] > startx && this.reveal[0] < endx) {
62415 awt2swing.Util.drawString (gg, jalview.util.MessageManager.getString ("label.reveal_columns"), this.reveal[0] * avcharWidth, 0);
62416 }}}, "java.awt.Graphics,~N,~N,~N,~N");
62417 c$.$ScalePanel$1$ = function () {
62418 Clazz_pu$h(self.c$);
62419 c$ = Clazz_declareAnonymous (jalview.appletgui, "ScalePanel$1", null, java.awt.event.ActionListener);
62420 Clazz_overrideMethod (c$, "actionPerformed", 
62421 function (e) {
62422 this.b$["jalview.appletgui.ScalePanel"].av.showColumn (this.b$["jalview.appletgui.ScalePanel"].reveal[0]);
62423 this.b$["jalview.appletgui.ScalePanel"].reveal = null;
62424 this.b$["jalview.appletgui.ScalePanel"].ap.paintAlignment (true);
62425 if (this.b$["jalview.appletgui.ScalePanel"].ap.overviewPanel != null) {
62426 this.b$["jalview.appletgui.ScalePanel"].ap.overviewPanel.updateOverviewImage ();
62427 }}, "java.awt.event.ActionEvent");
62428 c$ = Clazz_p0p ();
62429 };
62430 c$.$ScalePanel$2$ = function () {
62431 Clazz_pu$h(self.c$);
62432 c$ = Clazz_declareAnonymous (jalview.appletgui, "ScalePanel$2", null, java.awt.event.ActionListener);
62433 Clazz_overrideMethod (c$, "actionPerformed", 
62434 function (e) {
62435 this.b$["jalview.appletgui.ScalePanel"].av.showAllHiddenColumns ();
62436 this.b$["jalview.appletgui.ScalePanel"].reveal = null;
62437 this.b$["jalview.appletgui.ScalePanel"].ap.paintAlignment (true);
62438 if (this.b$["jalview.appletgui.ScalePanel"].ap.overviewPanel != null) {
62439 this.b$["jalview.appletgui.ScalePanel"].ap.overviewPanel.updateOverviewImage ();
62440 }}, "java.awt.event.ActionEvent");
62441 c$ = Clazz_p0p ();
62442 };
62443 c$.$ScalePanel$3$ = function () {
62444 Clazz_pu$h(self.c$);
62445 c$ = Clazz_declareAnonymous (jalview.appletgui, "ScalePanel$3", null, java.awt.event.ActionListener);
62446 Clazz_overrideMethod (c$, "actionPerformed", 
62447 function (e) {
62448 this.b$["jalview.appletgui.ScalePanel"].av.hideColumns (this.f$.res, this.f$.res);
62449 if (this.b$["jalview.appletgui.ScalePanel"].av.getSelectionGroup () != null && this.b$["jalview.appletgui.ScalePanel"].av.getSelectionGroup ().getSize () == this.b$["jalview.appletgui.ScalePanel"].av.getAlignment ().getHeight ()) {
62450 this.b$["jalview.appletgui.ScalePanel"].av.setSelectionGroup (null);
62451 }this.b$["jalview.appletgui.ScalePanel"].ap.paintAlignment (true);
62452 if (this.b$["jalview.appletgui.ScalePanel"].ap.overviewPanel != null) {
62453 this.b$["jalview.appletgui.ScalePanel"].ap.overviewPanel.updateOverviewImage ();
62454 }}, "java.awt.event.ActionEvent");
62455 c$ = Clazz_p0p ();
62456 };
62457 });
62458 Clazz_declarePackage ("jalview.appletgui");
62459 Clazz_load (["awt2swing.Panel", "jalview.structure.SelectionListener", "$.SequenceListener", "java.awt.event.MouseListener", "$.MouseMotionListener", "java.lang.Thread"], "jalview.appletgui.SeqPanel", ["jalview.api.AlignViewportI", "jalview.appletgui.APopupMenu", "$.AlignViewport", "$.PaintRefresher", "$.SeqCanvas", "$.SliderPanel", "$.Tooltip", "jalview.commands.EditCommand", "jalview.datamodel.ColumnSelection", "$.SearchResults", "$.SequenceGroup", "jalview.schemes.ResidueProperties", "jalview.structure.StructureSelectionManager", "jalview.util.Comparison", "$.MappingUtils", "$.MessageManager", "java.awt.BorderLayout", "$.Font", "java.lang.StringBuffer", "$.StringBuilder", "java.util.Vector"], function () {
62460 c$ = Clazz_decorateAsClass (function () {
62461 this.seqCanvas = null;
62462 this.ap = null;
62463 this.lastres = 0;
62464 this.startseq = 0;
62465 this.av = null;
62466 this.seqEditOccurred = false;
62467 this.scrollThread = null;
62468 this.mouseDragging = false;
62469 this.editingSeqs = false;
62470 this.groupEditing = false;
62471 this.oldSeq = -1;
62472 this.changeEndSeq = false;
62473 this.changeStartSeq = false;
62474 this.changeEndRes = false;
62475 this.changeStartRes = false;
62476 this.stretchGroup = null;
62477 this.keyboardNo1 = null;
62478 this.keyboardNo2 = null;
62479 this.mouseWheelPressed = false;
62480 this.lastMousePress = null;
62481 this.editCommand = null;
62482 this.ssm = null;
62483 this.startWrapBlock = -1;
62484 this.wrappedBlock = -1;
62485 this.lastMessage = null;
62486 this.tooltip = null;
62487 if (!Clazz_isClassDefined ("jalview.appletgui.SeqPanel.ScrollThread")) {
62488 jalview.appletgui.SeqPanel.$SeqPanel$ScrollThread$ ();
62489 }
62490 Clazz_instantialize (this, arguments);
62491 }, jalview.appletgui, "SeqPanel", awt2swing.Panel, [java.awt.event.MouseMotionListener, java.awt.event.MouseListener, jalview.structure.SequenceListener, jalview.structure.SelectionListener]);
62492 Clazz_makeConstructor (c$, 
62493 function (avp, p) {
62494 Clazz_superConstructor (this, jalview.appletgui.SeqPanel, []);
62495 this.av = avp;
62496 this.setName ("seqPanel");
62497 this.seqCanvas =  new jalview.appletgui.SeqCanvas (avp);
62498 this.setLayout ( new java.awt.BorderLayout ());
62499 this.add (this.seqCanvas);
62500 this.ap = p;
62501 this.seqCanvas.addMouseMotionListener (this);
62502 this.seqCanvas.addMouseListener (this);
62503 this.ssm = jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.av.applet);
62504 this.ssm.addStructureViewerListener (this);
62505 this.ssm.addSelectionListener (this);
62506 this.seqCanvas.repaint ();
62507 }, "jalview.appletgui.AlignViewport,jalview.appletgui.AlignmentPanel");
62508 Clazz_defineMethod (c$, "endEditing", 
62509 function () {
62510 if (this.editCommand != null && this.editCommand.getSize () > 0) {
62511 this.ap.alignFrame.addHistoryItem (this.editCommand);
62512 this.av.firePropertyChange ("alignment", null, this.av.getAlignment ().getSequences ());
62513 }this.startseq = -1;
62514 this.lastres = -1;
62515 this.editingSeqs = false;
62516 this.groupEditing = false;
62517 this.keyboardNo1 = null;
62518 this.keyboardNo2 = null;
62519 this.editCommand = null;
62520 });
62521 Clazz_defineMethod (c$, "setCursorRow", 
62522 function () {
62523 this.seqCanvas.cursorY = this.getKeyboardNo1 () - 1;
62524 this.scrollToVisible ();
62525 });
62526 Clazz_defineMethod (c$, "setCursorColumn", 
62527 function () {
62528 this.seqCanvas.cursorX = this.getKeyboardNo1 () - 1;
62529 this.scrollToVisible ();
62530 });
62531 Clazz_defineMethod (c$, "setCursorRowAndColumn", 
62532 function () {
62533 if (this.keyboardNo2 == null) {
62534 this.keyboardNo2 =  new StringBuffer ();
62535 } else {
62536 this.seqCanvas.cursorX = this.getKeyboardNo1 () - 1;
62537 this.seqCanvas.cursorY = this.getKeyboardNo2 () - 1;
62538 this.scrollToVisible ();
62539 }});
62540 Clazz_defineMethod (c$, "setCursorPosition", 
62541 function () {
62542 var sequence = this.av.getAlignment ().getSequenceAt (this.seqCanvas.cursorY);
62543 this.seqCanvas.cursorX = sequence.findIndex (this.getKeyboardNo1 ()) - 1;
62544 this.scrollToVisible ();
62545 });
62546 Clazz_defineMethod (c$, "moveCursor", 
62547 function (dx, dy) {
62548 this.seqCanvas.cursorX += dx;
62549 this.seqCanvas.cursorY += dy;
62550 if (this.av.hasHiddenColumns () && !this.av.getColumnSelection ().isVisible (this.seqCanvas.cursorX)) {
62551 var original = this.seqCanvas.cursorX - dx;
62552 var maxWidth = this.av.getAlignment ().getWidth ();
62553 while (!this.av.getColumnSelection ().isVisible (this.seqCanvas.cursorX) && this.seqCanvas.cursorX < maxWidth && this.seqCanvas.cursorX > 0) {
62554 this.seqCanvas.cursorX += dx;
62555 }
62556 if (this.seqCanvas.cursorX >= maxWidth || !this.av.getColumnSelection ().isVisible (this.seqCanvas.cursorX)) {
62557 this.seqCanvas.cursorX = original;
62558 }}this.scrollToVisible ();
62559 }, "~N,~N");
62560 Clazz_defineMethod (c$, "scrollToVisible", 
62561 function () {
62562 if (this.seqCanvas.cursorX < 0) {
62563 this.seqCanvas.cursorX = 0;
62564 } else if (this.seqCanvas.cursorX > this.av.getAlignment ().getWidth () - 1) {
62565 this.seqCanvas.cursorX = this.av.getAlignment ().getWidth () - 1;
62566 }if (this.seqCanvas.cursorY < 0) {
62567 this.seqCanvas.cursorY = 0;
62568 } else if (this.seqCanvas.cursorY > this.av.getAlignment ().getHeight () - 1) {
62569 this.seqCanvas.cursorY = this.av.getAlignment ().getHeight () - 1;
62570 }this.endEditing ();
62571 if (this.av.getWrapAlignment ()) {
62572 this.ap.scrollToWrappedVisible (this.seqCanvas.cursorX);
62573 } else {
62574 while (this.seqCanvas.cursorY < this.av.startSeq) {
62575 this.ap.scrollUp (true);
62576 }
62577 while (this.seqCanvas.cursorY + 1 > this.av.endSeq) {
62578 this.ap.scrollUp (false);
62579 }
62580 while (this.seqCanvas.cursorX < this.av.getColumnSelection ().adjustForHiddenColumns (this.av.startRes)) {
62581 if (!this.ap.scrollRight (false)) {
62582 break;
62583 }}
62584 while (this.seqCanvas.cursorX > this.av.getColumnSelection ().adjustForHiddenColumns (this.av.endRes)) {
62585 if (!this.ap.scrollRight (true)) {
62586 break;
62587 }}
62588 }this.setStatusMessage (this.av.getAlignment ().getSequenceAt (this.seqCanvas.cursorY), this.seqCanvas.cursorX, this.seqCanvas.cursorY);
62589 this.seqCanvas.repaint ();
62590 });
62591 Clazz_defineMethod (c$, "setSelectionAreaAtCursor", 
62592 function (topLeft) {
62593 var sequence = this.av.getAlignment ().getSequenceAt (this.seqCanvas.cursorY);
62594 if (this.av.getSelectionGroup () != null) {
62595 var sg = this.av.getSelectionGroup ();
62596 var min = this.av.getAlignment ().getHeight ();
62597 var max = 0;
62598 for (var i = 0; i < sg.getSize (); i++) {
62599 var index = this.av.getAlignment ().findIndex (sg.getSequenceAt (i));
62600 if (index > max) {
62601 max = index;
62602 }if (index < min) {
62603 min = index;
62604 }}
62605 max++;
62606 if (topLeft) {
62607 sg.setStartRes (this.seqCanvas.cursorX);
62608 if (sg.getEndRes () < this.seqCanvas.cursorX) {
62609 sg.setEndRes (this.seqCanvas.cursorX);
62610 }min = this.seqCanvas.cursorY;
62611 } else {
62612 sg.setEndRes (this.seqCanvas.cursorX);
62613 if (sg.getStartRes () > this.seqCanvas.cursorX) {
62614 sg.setStartRes (this.seqCanvas.cursorX);
62615 }max = this.seqCanvas.cursorY + 1;
62616 }if (min > max) {
62617 this.av.setSelectionGroup (null);
62618 } else {
62619 sg.clear ();
62620 for (var i = min; i < max; i++) {
62621 sg.addSequence (this.av.getAlignment ().getSequenceAt (i), false);
62622 }
62623 }}if (this.av.getSelectionGroup () == null) {
62624 var sg =  new jalview.datamodel.SequenceGroup ();
62625 sg.setStartRes (this.seqCanvas.cursorX);
62626 sg.setEndRes (this.seqCanvas.cursorX);
62627 sg.addSequence (sequence, false);
62628 this.av.setSelectionGroup (sg);
62629 }this.ap.paintAlignment (false);
62630 this.av.sendSelection ();
62631 }, "~B");
62632 Clazz_defineMethod (c$, "insertGapAtCursor", 
62633 function (group) {
62634 this.groupEditing = group;
62635 this.startseq = this.seqCanvas.cursorY;
62636 this.lastres = this.seqCanvas.cursorX;
62637 this.editSequence (true, this.seqCanvas.cursorX + this.getKeyboardNo1 ());
62638 this.endEditing ();
62639 }, "~B");
62640 Clazz_defineMethod (c$, "deleteGapAtCursor", 
62641 function (group) {
62642 this.groupEditing = group;
62643 this.startseq = this.seqCanvas.cursorY;
62644 this.lastres = this.seqCanvas.cursorX + this.getKeyboardNo1 ();
62645 this.editSequence (false, this.seqCanvas.cursorX);
62646 this.endEditing ();
62647 }, "~B");
62648 Clazz_defineMethod (c$, "numberPressed", 
62649 function (value) {
62650 if (this.keyboardNo1 == null) {
62651 this.keyboardNo1 =  new StringBuffer ();
62652 }if (this.keyboardNo2 != null) {
62653 this.keyboardNo2.append (value);
62654 } else {
62655 this.keyboardNo1.append (value);
62656 }}, "~S");
62657 Clazz_defineMethod (c$, "getKeyboardNo1", 
62658 function () {
62659 try {
62660 if (this.keyboardNo1 != null) {
62661 var value = Integer.parseInt (this.keyboardNo1.toString ());
62662 this.keyboardNo1 = null;
62663 return value;
62664 }} catch (x) {
62665 if (Clazz_exceptionOf (x, Exception)) {
62666 } else {
62667 throw x;
62668 }
62669 }
62670 this.keyboardNo1 = null;
62671 return 1;
62672 });
62673 Clazz_defineMethod (c$, "getKeyboardNo2", 
62674 function () {
62675 try {
62676 if (this.keyboardNo2 != null) {
62677 var value = Integer.parseInt (this.keyboardNo2.toString ());
62678 this.keyboardNo2 = null;
62679 return value;
62680 }} catch (x) {
62681 if (Clazz_exceptionOf (x, Exception)) {
62682 } else {
62683 throw x;
62684 }
62685 }
62686 this.keyboardNo2 = null;
62687 return 1;
62688 });
62689 Clazz_defineMethod (c$, "setStatusMessage", 
62690 function (sequence, res, seq) {
62691 var text =  new StringBuilder (32);
62692 var seqno = seq == -1 ? "" : " " + (seq + 1);
62693 text.append ("Sequence" + seqno + " ID: " + sequence.getName ());
62694 var residue = null;
62695 var displayChar = String.valueOf (sequence.getCharAt (res));
62696 if (this.av.getAlignment ().isNucleotide ()) {
62697 residue = jalview.schemes.ResidueProperties.nucleotideName.get (displayChar);
62698 if (residue != null) {
62699 text.append (" Nucleotide: ").append (residue);
62700 }} else {
62701 residue = "X".equalsIgnoreCase (displayChar) ? "X" : jalview.schemes.ResidueProperties.aa2Triplet.get (displayChar);
62702 if (residue != null) {
62703 text.append (" Residue: ").append (residue);
62704 }}var pos = -1;
62705 if (residue != null) {
62706 pos = sequence.findPosition (res);
62707 text.append (" (").append (Integer.toString (pos)).append (")");
62708 }this.ap.alignFrame.setStatus (text.toString ());
62709 }, "jalview.datamodel.SequenceI,~N,~N");
62710 Clazz_defineMethod (c$, "setStatusMessage", 
62711  function (results) {
62712 var matches = results.getResults ();
62713 if (!matches.isEmpty ()) {
62714 var m = matches.get (0);
62715 var seq = m.getSequence ();
62716 var sequenceIndex = this.av.getAlignment ().findIndex (seq);
62717 var start = m.getStart () - 1;
62718 this.setStatusMessage (seq, start, sequenceIndex);
62719 }}, "jalview.datamodel.SearchResults");
62720 Clazz_overrideMethod (c$, "mousePressed", 
62721 function (evt) {
62722 this.lastMousePress = evt.getPoint ();
62723 if ((evt.getModifiers () & 8) == 8 && !this.av.MAC) {
62724 this.mouseWheelPressed = true;
62725 return;
62726 }if (evt.isShiftDown () || evt.isControlDown () || evt.isAltDown ()) {
62727 if (evt.isControlDown () || evt.isAltDown ()) {
62728 this.groupEditing = true;
62729 }this.editingSeqs = true;
62730 } else {
62731 this.doMousePressedDefineMode (evt);
62732 return;
62733 }var seq = this.findSeq (evt);
62734 var res = this.findRes (evt);
62735 if (seq < 0 || res < 0) {
62736 return;
62737 }if ((seq < this.av.getAlignment ().getHeight ()) && (res < this.av.getAlignment ().getSequenceAt (seq).getLength ())) {
62738 this.startseq = seq;
62739 this.lastres = res;
62740 } else {
62741 this.startseq = -1;
62742 this.lastres = -1;
62743 }return;
62744 }, "java.awt.event.MouseEvent");
62745 Clazz_overrideMethod (c$, "mouseClicked", 
62746 function (evt) {
62747 var sequence = this.av.getAlignment ().getSequenceAt (this.findSeq (evt));
62748 if (evt.getClickCount () > 1) {
62749 if (this.av.getSelectionGroup () != null && this.av.getSelectionGroup ().getSize () == 1 && this.av.getSelectionGroup ().getEndRes () - this.av.getSelectionGroup ().getStartRes () < 2) {
62750 this.av.setSelectionGroup (null);
62751 }var features = this.findFeaturesAtRes (sequence, sequence.findPosition (this.findRes (evt)));
62752 if (features != null && features.length > 0) {
62753 var highlight =  new jalview.datamodel.SearchResults ();
62754 highlight.addResult (sequence, features[0].getBegin (), features[0].getEnd ());
62755 this.seqCanvas.highlightSearchResults (highlight);
62756 }if (features != null && features.length > 0) {
62757 this.seqCanvas.getFeatureRenderer ().amendFeatures ( Clazz_newArray (-1, [sequence]), features, false, this.ap);
62758 this.seqCanvas.highlightSearchResults (null);
62759 }}}, "java.awt.event.MouseEvent");
62760 Clazz_overrideMethod (c$, "mouseReleased", 
62761 function (evt) {
62762 this.mouseDragging = false;
62763 this.mouseWheelPressed = false;
62764 this.ap.paintAlignment (true);
62765 if (!this.editingSeqs) {
62766 this.doMouseReleasedDefineMode (evt);
62767 return;
62768 }this.endEditing ();
62769 }, "java.awt.event.MouseEvent");
62770 Clazz_defineMethod (c$, "findRes", 
62771 function (evt) {
62772 var res = 0;
62773 var x = evt.getX ();
62774 if (this.av.getWrapAlignment ()) {
62775 var hgap = this.av.getCharHeight ();
62776 if (this.av.getScaleAboveWrapped ()) {
62777 hgap += this.av.getCharHeight ();
62778 }var cHeight = this.av.getAlignment ().getHeight () * this.av.getCharHeight () + hgap + this.seqCanvas.getAnnotationHeight ();
62779 var y = evt.getY ();
62780 y -= hgap;
62781 x -= this.seqCanvas.LABEL_WEST;
62782 var cwidth = this.seqCanvas.getWrappedCanvasWidth (this.getSize ().width);
62783 if (cwidth < 1) {
62784 return 0;
62785 }this.wrappedBlock = Clazz_doubleToInt (y / cHeight);
62786 this.wrappedBlock += Clazz_doubleToInt (this.av.getStartRes () / cwidth);
62787 res = this.wrappedBlock * cwidth + Clazz_doubleToInt (x / this.av.getCharWidth ());
62788 } else {
62789 res = (Clazz_doubleToInt (x / this.av.getCharWidth ())) + this.av.getStartRes ();
62790 }if (this.av.hasHiddenColumns ()) {
62791 res = this.av.getColumnSelection ().adjustForHiddenColumns (res);
62792 }return res;
62793 }, "java.awt.event.MouseEvent");
62794 Clazz_defineMethod (c$, "findSeq", 
62795 function (evt) {
62796 var sqnum = this.findAlRow (evt);
62797 return (sqnum < 0) ? 0 : sqnum;
62798 }, "java.awt.event.MouseEvent");
62799 Clazz_defineMethod (c$, "findAlRow", 
62800  function (evt) {
62801 var seq = 0;
62802 var y = evt.getY ();
62803 if (this.av.getWrapAlignment ()) {
62804 var hgap = this.av.getCharHeight ();
62805 if (this.av.getScaleAboveWrapped ()) {
62806 hgap += this.av.getCharHeight ();
62807 }var cHeight = this.av.getAlignment ().getHeight () * this.av.getCharHeight () + hgap + this.seqCanvas.getAnnotationHeight ();
62808 y -= hgap;
62809 seq = Math.min (Clazz_doubleToInt ((y % cHeight) / this.av.getCharHeight ()), this.av.getAlignment ().getHeight () - 1);
62810 if (seq < 0) {
62811 seq = -1;
62812 }} else {
62813 seq = Math.min ((Clazz_doubleToInt (y / this.av.getCharHeight ())) + this.av.getStartSeq (), this.av.getAlignment ().getHeight () - 1);
62814 if (seq < 0) {
62815 seq = -1;
62816 }}return seq;
62817 }, "java.awt.event.MouseEvent");
62818 Clazz_defineMethod (c$, "doMousePressed", 
62819 function (evt) {
62820 var seq = this.findSeq (evt);
62821 var res = this.findRes (evt);
62822 if (seq < this.av.getAlignment ().getHeight () && res < this.av.getAlignment ().getSequenceAt (seq).getLength ()) {
62823 this.startseq = seq;
62824 this.lastres = res;
62825 } else {
62826 this.startseq = -1;
62827 this.lastres = -1;
62828 }return;
62829 }, "java.awt.event.MouseEvent");
62830 Clazz_overrideMethod (c$, "mouseOverSequence", 
62831 function (sequence, index, pos) {
62832 var tmp = sequence.hashCode () + index + "";
62833 if (this.lastMessage == null || !this.lastMessage.equals (tmp)) {
62834 this.ssm.mouseOverSequence (sequence, index, pos, this.av);
62835 }this.lastMessage = tmp;
62836 }, "jalview.datamodel.SequenceI,~N,~N");
62837 Clazz_overrideMethod (c$, "highlightSequence", 
62838 function (results) {
62839 if (this.av.isFollowHighlight ()) {
62840 if (this.ap.scrollToPosition (results, true)) {
62841 this.ap.alignFrame.repaint ();
62842 }}this.setStatusMessage (results);
62843 this.seqCanvas.highlightSearchResults (results);
62844 }, "jalview.datamodel.SearchResults");
62845 Clazz_overrideMethod (c$, "getVamsasSource", 
62846 function () {
62847 return this.ap == null ? null : this.ap.av;
62848 });
62849 Clazz_overrideMethod (c$, "updateColours", 
62850 function (seq, index) {
62851 System.out.println ("update the seqPanel colours");
62852 }, "jalview.datamodel.SequenceI,~N");
62853 Clazz_overrideMethod (c$, "mouseMoved", 
62854 function (evt) {
62855 var res = this.findRes (evt);
62856 var seq = this.findSeq (evt);
62857 if (seq >= this.av.getAlignment ().getHeight () || seq < 0 || res < 0) {
62858 if (this.tooltip != null) {
62859 this.tooltip.setTip ("");
62860 }return;
62861 }var sequence = this.av.getAlignment ().getSequenceAt (seq);
62862 if (res > sequence.getLength ()) {
62863 if (this.tooltip != null) {
62864 this.tooltip.setTip ("");
62865 }return;
62866 }var respos = sequence.findPosition (res);
62867 if (this.ssm != null) {
62868 this.mouseOverSequence (sequence, res, respos);
62869 }var text =  new StringBuilder ();
62870 text.append ("Sequence ").append (Integer.toString (seq + 1)).append (" ID: ").append (sequence.getName ());
62871 var obj = null;
62872 var ch = String.valueOf (sequence.getCharAt (res));
62873 if (this.av.getAlignment ().isNucleotide ()) {
62874 obj = jalview.schemes.ResidueProperties.nucleotideName.get (ch);
62875 if (obj != null) {
62876 text.append (" Nucleotide: ").append (obj);
62877 }} else {
62878 obj = "X".equalsIgnoreCase (ch) ? "X" : jalview.schemes.ResidueProperties.aa2Triplet.get (ch);
62879 if (obj != null) {
62880 text.append (" Residue: ").append (obj);
62881 }}if (obj != null) {
62882 text.append (" (").append (Integer.toString (respos)).append (")");
62883 }this.ap.alignFrame.setStatus (text.toString ());
62884 var tooltipText =  new StringBuilder ();
62885 var groups = this.av.getAlignment ().findAllGroups (sequence);
62886 if (groups != null) {
62887 for (var g = 0; g < groups.length; g++) {
62888 if (groups[g].getStartRes () <= res && groups[g].getEndRes () >= res) {
62889 if (!groups[g].getName ().startsWith ("JTreeGroup") && !groups[g].getName ().startsWith ("JGroup")) {
62890 tooltipText.append (groups[g].getName ()).append (" ");
62891 }if (groups[g].getDescription () != null) {
62892 tooltipText.append (groups[g].getDescription ());
62893 }tooltipText.append ("\n");
62894 }}
62895 }var allFeatures = this.findFeaturesAtRes (sequence, sequence.findPosition (res));
62896 var index = 0;
62897 while (index < allFeatures.length) {
62898 var sf = allFeatures[index];
62899 tooltipText.append (sf.getType () + " " + sf.begin + ":" + sf.end);
62900 if (sf.getDescription () != null) {
62901 tooltipText.append (" " + sf.getDescription ());
62902 }if (sf.getValue ("status") != null) {
62903 var status = sf.getValue ("status").toString ();
62904 if (status.length > 0) {
62905 tooltipText.append (" (" + sf.getValue ("status") + ")");
62906 }}tooltipText.append ("\n");
62907 index++;
62908 }
62909 if (this.tooltip == null) {
62910 this.tooltip =  new jalview.appletgui.Tooltip (tooltipText.toString (), this.seqCanvas);
62911 } else {
62912 this.tooltip.setTip (tooltipText.toString ());
62913 }}, "java.awt.event.MouseEvent");
62914 Clazz_defineMethod (c$, "findFeaturesAtRes", 
62915 function (sequence, res) {
62916 var tmp =  new java.util.Vector ();
62917 var features = sequence.getSequenceFeatures ();
62918 if (features != null) {
62919 for (var i = 0; i < features.length; i++) {
62920 if (this.av.getFeaturesDisplayed () == null || !this.av.getFeaturesDisplayed ().isVisible (features[i].getType ())) {
62921 continue;
62922 }if (features[i].featureGroup != null && !this.seqCanvas.fr.checkGroupVisibility (features[i].featureGroup, false)) {
62923 continue;
62924 }if ((features[i].getBegin () <= res) && (features[i].getEnd () >= res)) {
62925 tmp.addElement (features[i]);
62926 }}
62927 }features =  new Array (tmp.size ());
62928 tmp.copyInto (features);
62929 return features;
62930 }, "jalview.datamodel.SequenceI,~N");
62931 Clazz_overrideMethod (c$, "mouseDragged", 
62932 function (evt) {
62933 if (this.mouseWheelPressed) {
62934 var oldWidth = this.av.getCharWidth ();
62935 if (Math.abs (evt.getY () - this.lastMousePress.y) > Math.abs (evt.getX () - this.lastMousePress.x)) {
62936 var fontSize = this.av.font.getSize ();
62937 if (evt.getY () < this.lastMousePress.y && this.av.getCharHeight () > 1) {
62938 fontSize--;
62939 } else if (evt.getY () > this.lastMousePress.y) {
62940 fontSize++;
62941 }if (fontSize < 1) {
62942 fontSize = 1;
62943 }this.av.setFont ( new java.awt.Font (this.av.font.getName (), this.av.font.getStyle (), fontSize));
62944 this.av.setCharWidth (oldWidth);
62945 } else {
62946 if (evt.getX () < this.lastMousePress.x && this.av.getCharWidth () > 1) {
62947 this.av.setCharWidth (this.av.getCharWidth () - 1);
62948 } else if (evt.getX () > this.lastMousePress.x) {
62949 this.av.setCharWidth (this.av.getCharWidth () + 1);
62950 }if (this.av.getCharWidth () < 1) {
62951 this.av.setCharWidth (1);
62952 }}this.ap.fontChanged ();
62953 var fm = this.getFontMetrics (this.av.getFont ());
62954 this.av.validCharWidth = fm.charWidth ('M') <= this.av.getCharWidth ();
62955 this.lastMousePress = evt.getPoint ();
62956 this.ap.paintAlignment (false);
62957 this.ap.annotationPanel.image = null;
62958 return;
62959 }if (!this.editingSeqs) {
62960 this.doMouseDraggedDefineMode (evt);
62961 return;
62962 }var res = this.findRes (evt);
62963 if (res < 0) {
62964 res = 0;
62965 }if ((this.lastres == -1) || (this.lastres == res)) {
62966 return;
62967 }if ((res < this.av.getAlignment ().getWidth ()) && (res < this.lastres)) {
62968 this.editSequence (false, res);
62969 } else {
62970 this.editSequence (true, res);
62971 }this.mouseDragging = true;
62972 if (this.scrollThread != null) {
62973 this.scrollThread.setEvent (evt);
62974 }}, "java.awt.event.MouseEvent");
62975 Clazz_defineMethod (c$, "editSequence", 
62976 function (insertGap, startres) {
62977 var fixedLeft = -1;
62978 var fixedRight = -1;
62979 var fixedColumns = false;
62980 var sg = this.av.getSelectionGroup ();
62981 var seq = this.av.getAlignment ().getSequenceAt (this.startseq);
62982 if (!this.groupEditing && this.av.hasHiddenRows ()) {
62983 if (this.av.isHiddenRepSequence (seq)) {
62984 sg = this.av.getRepresentedSequences (seq);
62985 this.groupEditing = true;
62986 }}var message =  new StringBuffer ();
62987 if (this.groupEditing) {
62988 message.append (jalview.util.MessageManager.getString ("action.edit_group")).append (":");
62989 if (this.editCommand == null) {
62990 this.editCommand =  new jalview.commands.EditCommand (jalview.util.MessageManager.getString ("action.edit_group"));
62991 }} else {
62992 message.append (jalview.util.MessageManager.getString ("label.edit_sequence")).append (" " + seq.getName ());
62993 var label = seq.getName ();
62994 if (label.length > 10) {
62995 label = label.substring (0, 10);
62996 }if (this.editCommand == null) {
62997 this.editCommand =  new jalview.commands.EditCommand (jalview.util.MessageManager.formatMessage ("label.edit_params",  Clazz_newArray (-1, [label])));
62998 }}if (insertGap) {
62999 message.append (" insert ");
63000 } else {
63001 message.append (" delete ");
63002 }message.append (Math.abs (startres - this.lastres) + " gaps.");
63003 this.ap.alignFrame.setStatus (message.toString ());
63004 if (this.groupEditing || (sg != null && sg.getSequences (this.av.getHiddenRepSequences ()).contains (seq))) {
63005 fixedColumns = true;
63006 if (sg == null) {
63007 if (!this.av.isHiddenRepSequence (seq)) {
63008 this.endEditing ();
63009 return;
63010 }sg = this.av.getRepresentedSequences (seq);
63011 }fixedLeft = sg.getStartRes ();
63012 fixedRight = sg.getEndRes ();
63013 if ((startres < fixedLeft && this.lastres >= fixedLeft) || (startres >= fixedLeft && this.lastres < fixedLeft) || (startres > fixedRight && this.lastres <= fixedRight) || (startres <= fixedRight && this.lastres > fixedRight)) {
63014 this.endEditing ();
63015 return;
63016 }if (fixedLeft > startres) {
63017 fixedRight = fixedLeft - 1;
63018 fixedLeft = 0;
63019 } else if (fixedRight < startres) {
63020 fixedLeft = fixedRight;
63021 fixedRight = -1;
63022 }}if (this.av.hasHiddenColumns ()) {
63023 fixedColumns = true;
63024 var y1 = this.av.getColumnSelection ().getHiddenBoundaryLeft (startres);
63025 var y2 = this.av.getColumnSelection ().getHiddenBoundaryRight (startres);
63026 if ((insertGap && startres > y1 && this.lastres < y1) || (!insertGap && startres < y2 && this.lastres > y2)) {
63027 this.endEditing ();
63028 return;
63029 }if (fixedLeft < y1 && (fixedRight > y2 || fixedRight == -1)) {
63030 if (startres >= y2) {
63031 fixedLeft = y2;
63032 } else {
63033 fixedRight = y2 - 1;
63034 }}}if (this.groupEditing) {
63035 var groupSeqs = sg.getSequences (this.av.getHiddenRepSequences ()).toArray ( new Array (0));
63036 if (insertGap) {
63037 if (sg.getStartRes () == 0 && sg.getEndRes () == fixedRight && sg.getEndRes () == this.av.getAlignment ().getWidth () - 1) {
63038 sg.setEndRes (this.av.getAlignment ().getWidth () + startres - this.lastres);
63039 fixedRight = sg.getEndRes ();
63040 }var blank = false;
63041 for (fixedRight = fixedRight; fixedRight > this.lastres; fixedRight--) {
63042 blank = true;
63043 for (var gs, $gs = 0, $$gs = groupSeqs; $gs < $$gs.length && ((gs = $$gs[$gs]) || true); $gs++) {
63044 for (var j = 0; j < startres - this.lastres; j++) {
63045 if (!jalview.util.Comparison.isGap (gs.getCharAt (fixedRight - j))) {
63046 blank = false;
63047 break;
63048 }}
63049 }
63050 if (blank) {
63051 break;
63052 }}
63053 if (!blank) {
63054 if (sg.getSize () == this.av.getAlignment ().getHeight ()) {
63055 if ((this.av.hasHiddenColumns () && startres < this.av.getColumnSelection ().getHiddenBoundaryRight (startres))) {
63056 this.endEditing ();
63057 return;
63058 }var alWidth = this.av.getAlignment ().getWidth ();
63059 if (this.av.hasHiddenRows ()) {
63060 var hwidth = this.av.getAlignment ().getHiddenSequences ().getWidth ();
63061 if (hwidth > alWidth) {
63062 alWidth = hwidth;
63063 }}sg.setEndRes (sg.getEndRes () + startres - this.lastres);
63064 fixedRight = alWidth + startres - this.lastres;
63065 } else {
63066 this.endEditing ();
63067 return;
63068 }}} else if (!insertGap) {
63069 for (var gs, $gs = 0, $$gs = groupSeqs; $gs < $$gs.length && ((gs = $$gs[$gs]) || true); $gs++) {
63070 for (var j = startres; j < this.lastres; j++) {
63071 if (gs.getLength () <= j) {
63072 continue;
63073 }if (!jalview.util.Comparison.isGap (gs.getCharAt (j))) {
63074 this.endEditing ();
63075 return;
63076 }}
63077 }
63078 }if (insertGap) {
63079 if (fixedColumns && fixedRight != -1) {
63080 for (var j = this.lastres; j < startres; j++) {
63081 this.insertChar (j, groupSeqs, fixedRight);
63082 }
63083 } else {
63084 this.editCommand.appendEdit (jalview.commands.EditCommand.Action.INSERT_GAP, groupSeqs, startres, startres - this.lastres, this.av.getAlignment (), true);
63085 }} else {
63086 if (fixedColumns && fixedRight != -1) {
63087 for (var j = this.lastres; j > startres; j--) {
63088 this.deleteChar (startres, groupSeqs, fixedRight);
63089 }
63090 } else {
63091 this.editCommand.appendEdit (jalview.commands.EditCommand.Action.DELETE_GAP, groupSeqs, startres, this.lastres - startres, this.av.getAlignment (), true);
63092 }}} else {
63093 if (insertGap) {
63094 if (fixedColumns && fixedRight != -1) {
63095 for (var j = this.lastres; j < startres; j++) {
63096 this.insertChar (j,  Clazz_newArray (-1, [seq]), fixedRight);
63097 }
63098 } else {
63099 this.editCommand.appendEdit (jalview.commands.EditCommand.Action.INSERT_GAP,  Clazz_newArray (-1, [seq]), this.lastres, startres - this.lastres, this.av.getAlignment (), true);
63100 }} else {
63101 if (fixedColumns && fixedRight != -1) {
63102 for (var j = this.lastres; j > startres; j--) {
63103 if (!jalview.util.Comparison.isGap (seq.getCharAt (startres))) {
63104 this.endEditing ();
63105 break;
63106 }this.deleteChar (startres,  Clazz_newArray (-1, [seq]), fixedRight);
63107 }
63108 } else {
63109 var max = 0;
63110 for (var m = startres; m < this.lastres; m++) {
63111 if (!jalview.util.Comparison.isGap (seq.getCharAt (m))) {
63112 break;
63113 }max++;
63114 }
63115 if (max > 0) {
63116 this.editCommand.appendEdit (jalview.commands.EditCommand.Action.DELETE_GAP,  Clazz_newArray (-1, [seq]), startres, max, this.av.getAlignment (), true);
63117 }}}}this.lastres = startres;
63118 this.seqCanvas.repaint ();
63119 }, "~B,~N");
63120 Clazz_defineMethod (c$, "insertChar", 
63121 function (j, seq, fixedColumn) {
63122 var blankColumn = fixedColumn;
63123 for (var s = 0; s < seq.length; s++) {
63124 for (blankColumn = fixedColumn; blankColumn > j; blankColumn--) {
63125 if (jalview.util.Comparison.isGap (seq[s].getCharAt (blankColumn))) {
63126 break;
63127 }}
63128 if (blankColumn <= j) {
63129 blankColumn = fixedColumn;
63130 this.endEditing ();
63131 return;
63132 }}
63133 this.editCommand.appendEdit (jalview.commands.EditCommand.Action.DELETE_GAP, seq, blankColumn, 1, this.av.getAlignment (), true);
63134 this.editCommand.appendEdit (jalview.commands.EditCommand.Action.INSERT_GAP, seq, j, 1, this.av.getAlignment (), true);
63135 }, "~N,~A,~N");
63136 Clazz_defineMethod (c$, "deleteChar", 
63137 function (j, seq, fixedColumn) {
63138 this.editCommand.appendEdit (jalview.commands.EditCommand.Action.DELETE_GAP, seq, j, 1, this.av.getAlignment (), true);
63139 this.editCommand.appendEdit (jalview.commands.EditCommand.Action.INSERT_GAP, seq, fixedColumn, 1, this.av.getAlignment (), true);
63140 }, "~N,~A,~N");
63141 Clazz_defineMethod (c$, "doMousePressedDefineMode", 
63142 function (evt) {
63143 if (this.scrollThread != null) {
63144 this.scrollThread.running = false;
63145 this.scrollThread = null;
63146 }var res = this.findRes (evt);
63147 var seq = this.findSeq (evt);
63148 this.oldSeq = seq;
63149 this.startWrapBlock = this.wrappedBlock;
63150 if (seq == -1) {
63151 return;
63152 }var sequence = this.av.getAlignment ().getSequenceAt (seq);
63153 if (sequence == null || res > sequence.getLength ()) {
63154 return;
63155 }this.stretchGroup = this.av.getSelectionGroup ();
63156 if (this.stretchGroup == null) {
63157 this.stretchGroup = this.av.getAlignment ().findGroup (sequence);
63158 if (this.stretchGroup != null && res > this.stretchGroup.getStartRes () && res < this.stretchGroup.getEndRes ()) {
63159 this.av.setSelectionGroup (this.stretchGroup);
63160 } else {
63161 this.stretchGroup = null;
63162 }} else if (!this.stretchGroup.getSequences (null).contains (sequence) || this.stretchGroup.getStartRes () > res || this.stretchGroup.getEndRes () < res) {
63163 this.stretchGroup = null;
63164 var allGroups = this.av.getAlignment ().findAllGroups (sequence);
63165 if (allGroups != null) {
63166 for (var i = 0; i < allGroups.length; i++) {
63167 if (allGroups[i].getStartRes () <= res && allGroups[i].getEndRes () >= res) {
63168 this.stretchGroup = allGroups[i];
63169 break;
63170 }}
63171 }this.av.setSelectionGroup (this.stretchGroup);
63172 }if ((evt.getModifiers () & 4) == 4) {
63173 var allFeatures = this.findFeaturesAtRes (sequence, sequence.findPosition (res));
63174 var links = null;
63175 if (allFeatures != null) {
63176 for (var i = 0; i < allFeatures.length; i++) {
63177 if (allFeatures[i].links != null) {
63178 if (links == null) {
63179 links =  new java.util.Vector ();
63180 }for (var j = 0; j < allFeatures[i].links.size (); j++) {
63181 links.addElement (allFeatures[i].links.elementAt (j));
63182 }
63183 }}
63184 }var popup =  new jalview.appletgui.APopupMenu (this.ap, null, links);
63185 this.add (popup);
63186 popup.show (this, evt.getX (), evt.getY ());
63187 return;
63188 }if (this.av.cursorMode) {
63189 this.seqCanvas.cursorX = this.findRes (evt);
63190 this.seqCanvas.cursorY = this.findSeq (evt);
63191 this.seqCanvas.repaint ();
63192 return;
63193 }if (this.stretchGroup == null) {
63194 var sg =  new jalview.datamodel.SequenceGroup ();
63195 sg.setStartRes (res);
63196 sg.setEndRes (res);
63197 sg.addSequence (sequence, false);
63198 this.av.setSelectionGroup (sg);
63199 this.stretchGroup = sg;
63200 if (this.av.getConservationSelected ()) {
63201 jalview.appletgui.SliderPanel.setConservationSlider (this.ap, this.av.getGlobalColourScheme (), "Background");
63202 }if (this.av.getAbovePIDThreshold ()) {
63203 jalview.appletgui.SliderPanel.setPIDSliderSource (this.ap, this.av.getGlobalColourScheme (), "Background");
63204 }}}, "java.awt.event.MouseEvent");
63205 Clazz_defineMethod (c$, "doMouseReleasedDefineMode", 
63206 function (evt) {
63207 if (this.stretchGroup == null) {
63208 return;
63209 }this.stretchGroup.recalcConservation ();
63210 if (this.stretchGroup.cs != null) {
63211 this.stretchGroup.cs.alignmentChanged (this.stretchGroup, this.av.getHiddenRepSequences ());
63212 if (this.stretchGroup.cs.conservationApplied ()) {
63213 jalview.appletgui.SliderPanel.setConservationSlider (this.ap, this.stretchGroup.cs, this.stretchGroup.getName ());
63214 } else {
63215 jalview.appletgui.SliderPanel.setPIDSliderSource (this.ap, this.stretchGroup.cs, this.stretchGroup.getName ());
63216 }}this.changeEndRes = false;
63217 this.changeStartRes = false;
63218 this.stretchGroup = null;
63219 jalview.appletgui.PaintRefresher.Refresh (this.ap, this.av.getSequenceSetId ());
63220 this.ap.paintAlignment (true);
63221 this.av.sendSelection ();
63222 }, "java.awt.event.MouseEvent");
63223 Clazz_defineMethod (c$, "doMouseDraggedDefineMode", 
63224 function (evt) {
63225 var res = this.findRes (evt);
63226 var y = this.findSeq (evt);
63227 if (this.wrappedBlock != this.startWrapBlock) {
63228 return;
63229 }if (this.stretchGroup == null) {
63230 return;
63231 }this.mouseDragging = true;
63232 if (y > this.av.getAlignment ().getHeight ()) {
63233 y = this.av.getAlignment ().getHeight () - 1;
63234 }if (res >= this.av.getAlignment ().getWidth ()) {
63235 res = this.av.getAlignment ().getWidth () - 1;
63236 }if (this.stretchGroup.getEndRes () == res) {
63237 this.changeEndRes = true;
63238 } else if (this.stretchGroup.getStartRes () == res) {
63239 this.changeStartRes = true;
63240 }if (res < 0) {
63241 res = 0;
63242 }if (this.changeEndRes) {
63243 if (res > (this.stretchGroup.getStartRes () - 1)) {
63244 this.stretchGroup.setEndRes (res);
63245 }} else if (this.changeStartRes) {
63246 if (res < (this.stretchGroup.getEndRes () + 1)) {
63247 this.stretchGroup.setStartRes (res);
63248 }}var dragDirection = 0;
63249 if (y > this.oldSeq) {
63250 dragDirection = 1;
63251 } else if (y < this.oldSeq) {
63252 dragDirection = -1;
63253 }while ((y != this.oldSeq) && (this.oldSeq > -1) && (y < this.av.getAlignment ().getHeight ())) {
63254 var seq = this.av.getAlignment ().getSequenceAt (this.oldSeq);
63255 this.oldSeq += dragDirection;
63256 if (this.oldSeq < 0) {
63257 break;
63258 }var nextSeq = this.av.getAlignment ().getSequenceAt (this.oldSeq);
63259 if (this.stretchGroup.getSequences (null).contains (nextSeq)) {
63260 this.stretchGroup.deleteSequence (seq, false);
63261 } else {
63262 if (seq != null) {
63263 this.stretchGroup.addSequence (seq, false);
63264 }this.stretchGroup.addSequence (nextSeq, false);
63265 }}
63266 if (this.oldSeq < 0) {
63267 this.oldSeq = -1;
63268 }if (res > this.av.endRes || res < this.av.startRes || y < this.av.startSeq || y > this.av.endSeq) {
63269 this.mouseExited (evt);
63270 }if (this.scrollThread != null) {
63271 this.scrollThread.setEvent (evt);
63272 }this.seqCanvas.repaint ();
63273 }, "java.awt.event.MouseEvent");
63274 Clazz_overrideMethod (c$, "mouseEntered", 
63275 function (e) {
63276 if (this.oldSeq < 0) {
63277 this.oldSeq = 0;
63278 }if (this.scrollThread != null) {
63279 this.scrollThread.running = false;
63280 this.scrollThread = null;
63281 }}, "java.awt.event.MouseEvent");
63282 Clazz_overrideMethod (c$, "mouseExited", 
63283 function (e) {
63284 if (this.av.getWrapAlignment ()) {
63285 return;
63286 }if (this.mouseDragging && this.scrollThread == null) {
63287 this.scrollThread = Clazz_innerTypeInstance (jalview.appletgui.SeqPanel.ScrollThread, this, null);
63288 }}, "java.awt.event.MouseEvent");
63289 Clazz_defineMethod (c$, "scrollCanvas", 
63290 function (evt) {
63291 if (evt == null) {
63292 if (this.scrollThread != null) {
63293 this.scrollThread.running = false;
63294 this.scrollThread = null;
63295 }this.mouseDragging = false;
63296 } else {
63297 if (this.scrollThread == null) {
63298 this.scrollThread = Clazz_innerTypeInstance (jalview.appletgui.SeqPanel.ScrollThread, this, null);
63299 }this.mouseDragging = true;
63300 this.scrollThread.setEvent (evt);
63301 }}, "java.awt.event.MouseEvent");
63302 Clazz_overrideMethod (c$, "selection", 
63303 function (seqsel, colsel, source) {
63304 if (this.av != null && (this.av === source || !this.av.followSelection || (Clazz_instanceOf (source, jalview.appletgui.AlignViewport) && (source).getSequenceSetId ().equals (this.av.getSequenceSetId ())))) {
63305 return;
63306 }if (this.selectionFromTranslation (seqsel, colsel, source)) {
63307 return;
63308 }var repaint = false;
63309 var copycolsel = true;
63310 if (this.av.getSelectionGroup () == null || !this.av.isSelectionGroupChanged (true)) {
63311 var sgroup = null;
63312 if (seqsel != null && seqsel.getSize () > 0) {
63313 if (this.av.getAlignment () == null) {
63314 System.out.println ("Selection message: alignviewport av SeqSetId=" + this.av.getSequenceSetId () + " ViewId=" + this.av.getViewId () + " 's alignment is NULL! returning immediatly.");
63315 return;
63316 }sgroup = seqsel.intersect (this.av.getAlignment (), (this.av.hasHiddenRows ()) ? this.av.getHiddenRepSequences () : null);
63317 if ((sgroup == null || sgroup.getSize () == 0) && (colsel == null || colsel.size () == 0)) {
63318 copycolsel = false;
63319 }}if (sgroup != null && sgroup.getSize () > 0) {
63320 this.av.setSelectionGroup (sgroup);
63321 } else {
63322 this.av.setSelectionGroup (null);
63323 }repaint = this.av.isSelectionGroupChanged (true);
63324 }if (copycolsel && (this.av.getColumnSelection () == null || !this.av.isColSelChanged (true))) {
63325 if (colsel == null || colsel.size () == 0) {
63326 if (this.av.getColumnSelection () != null) {
63327 this.av.getColumnSelection ().clear ();
63328 }} else {
63329 if (this.av.getColumnSelection () == null) {
63330 this.av.setColumnSelection ( new jalview.datamodel.ColumnSelection (colsel));
63331 } else {
63332 this.av.getColumnSelection ().setElementsFrom (colsel);
63333 }}repaint = new Boolean (repaint | this.av.isColSelChanged (true)).valueOf ();
63334 }if (copycolsel && this.av.hasHiddenColumns () && (this.av.getColumnSelection () == null || this.av.getColumnSelection ().getHiddenColumns () == null)) {
63335 System.err.println ("Bad things");
63336 }if (repaint) {
63337 this.ap.scalePanelHolder.repaint ();
63338 this.ap.repaint ();
63339 }}, "jalview.datamodel.SequenceGroup,jalview.datamodel.ColumnSelection,jalview.structure.SelectionSource");
63340 Clazz_defineMethod (c$, "scrollTo", 
63341 function (row, column) {
63342 row = row < 0 ? this.ap.av.startSeq : row;
63343 column = column < 0 ? this.ap.av.startRes : column;
63344 this.ap.scrollTo (column, column, row, true, true);
63345 }, "~N,~N");
63346 Clazz_defineMethod (c$, "scrollToRow", 
63347 function (row) {
63348 row = row < 0 ? this.ap.av.startSeq : row;
63349 this.ap.scrollTo (this.ap.av.startRes, this.ap.av.startRes, row, true, true);
63350 }, "~N");
63351 Clazz_defineMethod (c$, "scrollToColumn", 
63352 function (column) {
63353 column = column < 0 ? this.ap.av.startRes : column;
63354 this.ap.scrollTo (column, column, this.ap.av.startSeq, true, true);
63355 }, "~N");
63356 Clazz_defineMethod (c$, "selectionFromTranslation", 
63357 function (seqsel, colsel, source) {
63358 if (!(Clazz_instanceOf (source, jalview.api.AlignViewportI))) {
63359 return false;
63360 }var sourceAv = source;
63361 if (sourceAv.getCodingComplement () !== this.av && this.av.getCodingComplement () !== sourceAv) {
63362 return false;
63363 }var sg = jalview.util.MappingUtils.mapSequenceGroup (seqsel, sourceAv, this.av);
63364 this.av.setSelectionGroup (sg);
63365 this.av.isSelectionGroupChanged (true);
63366 var cs = jalview.util.MappingUtils.mapColumnSelection (colsel, sourceAv, this.av);
63367 this.av.setColumnSelection (cs);
63368 this.av.isColSelChanged (true);
63369 this.ap.scalePanelHolder.repaint ();
63370 this.ap.repaint ();
63371 return true;
63372 }, "jalview.datamodel.SequenceGroup,jalview.datamodel.ColumnSelection,jalview.structure.SelectionSource");
63373 c$.$SeqPanel$ScrollThread$ = function () {
63374 Clazz_pu$h(self.c$);
63375 c$ = Clazz_decorateAsClass (function () {
63376 Clazz_prepareCallback (this, arguments);
63377 this.evt = null;
63378 this.running = false;
63379 Clazz_instantialize (this, arguments);
63380 }, jalview.appletgui.SeqPanel, "ScrollThread", Thread);
63381 Clazz_makeConstructor (c$, 
63382 function () {
63383 Clazz_superConstructor (this, jalview.appletgui.SeqPanel.ScrollThread, []);
63384 this.start ();
63385 });
63386 Clazz_defineMethod (c$, "setEvent", 
63387 function (a) {
63388 this.evt = a;
63389 }, "java.awt.event.MouseEvent");
63390 Clazz_defineMethod (c$, "stopScrolling", 
63391 function () {
63392 this.running = false;
63393 });
63394 Clazz_overrideMethod (c$, "run", 
63395 function () {
63396 this.running = true;
63397 while (this.running) {
63398 if (this.evt != null) {
63399 if (this.b$["jalview.appletgui.SeqPanel"].mouseDragging && this.evt.getY () < 0 && this.b$["jalview.appletgui.SeqPanel"].av.getStartSeq () > 0) {
63400 this.running = this.b$["jalview.appletgui.SeqPanel"].ap.scrollUp (true);
63401 }if (this.b$["jalview.appletgui.SeqPanel"].mouseDragging && this.evt.getY () >= this.b$["jalview.appletgui.SeqPanel"].getSize ().height && this.b$["jalview.appletgui.SeqPanel"].av.getAlignment ().getHeight () > this.b$["jalview.appletgui.SeqPanel"].av.getEndSeq ()) {
63402 this.running = this.b$["jalview.appletgui.SeqPanel"].ap.scrollUp (false);
63403 }if (this.b$["jalview.appletgui.SeqPanel"].mouseDragging && this.evt.getX () < 0) {
63404 this.running = this.b$["jalview.appletgui.SeqPanel"].ap.scrollRight (false);
63405 } else if (this.b$["jalview.appletgui.SeqPanel"].mouseDragging && this.evt.getX () >= this.b$["jalview.appletgui.SeqPanel"].getSize ().width) {
63406 this.running = this.b$["jalview.appletgui.SeqPanel"].ap.scrollRight (true);
63407 }}try {
63408 Thread.sleep (75);
63409 } catch (ex) {
63410 if (Clazz_exceptionOf (ex, Exception)) {
63411 } else {
63412 throw ex;
63413 }
63414 }
63415 }
63416 });
63417 c$ = Clazz_p0p ();
63418 };
63419 });
63420 Clazz_declarePackage ("jalview.structure");
63421 Clazz_declareInterface (jalview.structure, "SelectionListener");
63422 Clazz_declarePackage ("jalview.appletgui");
63423 Clazz_load (["awt2swing.Panel"], "jalview.appletgui.SeqCanvas", ["awt2swing.Util", "jalview.appletgui.AnnotationPanel", "$.FeatureRenderer", "$.PaintRefresher", "$.SequenceRenderer", "jalview.util.Comparison", "java.awt.Color"], function () {
63424 c$ = Clazz_decorateAsClass (function () {
63425 this.fr = null;
63426 this.sr = null;
63427 this.img = null;
63428 this.gg = null;
63429 this.imgWidth = 0;
63430 this.imgHeight = 0;
63431 this.av = null;
63432 this.searchResults = null;
63433 this.$fastPaint = false;
63434 this.cursorX = 0;
63435 this.cursorY = 0;
63436 this.avcharHeight = 0;
63437 this.avcharWidth = 0;
63438 this.lastsr = 0;
63439 this.LABEL_WEST = 0;
63440 this.LABEL_EAST = 0;
63441 this.annotations = null;
63442 Clazz_instantialize (this, arguments);
63443 }, jalview.appletgui, "SeqCanvas", awt2swing.Panel);
63444 Clazz_makeConstructor (c$, 
63445 function (av) {
63446 Clazz_superConstructor (this, jalview.appletgui.SeqCanvas, []);
63447 this.av = av;
63448 this.fr =  new jalview.appletgui.FeatureRenderer (av);
63449 this.sr =  new jalview.appletgui.SequenceRenderer (av);
63450 jalview.appletgui.PaintRefresher.Register (this, av.getSequenceSetId ());
63451 this.updateViewport ();
63452 }, "jalview.appletgui.AlignViewport");
63453 Clazz_defineMethod (c$, "updateViewport", 
63454  function () {
63455 this.avcharHeight = this.av.getCharHeight ();
63456 this.avcharWidth = this.av.getCharWidth ();
63457 });
63458 Clazz_defineMethod (c$, "getViewport", 
63459 function () {
63460 return this.av;
63461 });
63462 Clazz_defineMethod (c$, "getFeatureRenderer", 
63463 function () {
63464 return this.fr;
63465 });
63466 Clazz_defineMethod (c$, "getSequenceRenderer", 
63467 function () {
63468 return this.sr;
63469 });
63470 Clazz_defineMethod (c$, "drawNorthScale", 
63471  function (g, startx, endx, ypos) {
63472 var scalestartx = startx - startx % 10 + 10;
63473 g.setColor (java.awt.Color.black);
63474 for (var i = scalestartx; i < endx; i += 10) {
63475 var value = i;
63476 if (this.av.hasHiddenColumns ()) {
63477 value = this.av.getColumnSelection ().adjustForHiddenColumns (value);
63478 }awt2swing.Util.drawString (g, String.valueOf (value), (i - startx - 1) * this.avcharWidth, ypos - (Clazz_doubleToInt (this.avcharHeight / 2)));
63479 g.drawLine (((i - startx - 1) * this.avcharWidth) + (Clazz_doubleToInt (this.avcharWidth / 2)), (ypos + 2) - (Clazz_doubleToInt (this.avcharHeight / 2)), ((i - startx - 1) * this.avcharWidth) + (Clazz_doubleToInt (this.avcharWidth / 2)), ypos - 2);
63480 }
63481 }, "java.awt.Graphics,~N,~N,~N");
63482 Clazz_defineMethod (c$, "drawWestScale", 
63483  function (g, startx, endx, ypos) {
63484 var fm = this.getFontMetrics (this.av.getFont ());
63485 ypos += this.avcharHeight;
63486 if (this.av.hasHiddenColumns ()) {
63487 startx = this.av.getColumnSelection ().adjustForHiddenColumns (startx);
63488 endx = this.av.getColumnSelection ().adjustForHiddenColumns (endx);
63489 }var maxwidth = this.av.getAlignment ().getWidth ();
63490 if (this.av.hasHiddenColumns ()) {
63491 maxwidth = this.av.getColumnSelection ().findColumnPosition (maxwidth) - 1;
63492 }for (var i = 0; i < this.av.getAlignment ().getHeight (); i++) {
63493 var seq = this.av.getAlignment ().getSequenceAt (i);
63494 var index = startx;
63495 var value = -1;
63496 while (index < endx) {
63497 if (jalview.util.Comparison.isGap (seq.getCharAt (index))) {
63498 index++;
63499 continue;
63500 }value = this.av.getAlignment ().getSequenceAt (i).findPosition (index);
63501 break;
63502 }
63503 if (value != -1) {
63504 var x = this.LABEL_WEST - fm.stringWidth (String.valueOf (value)) - Clazz_doubleToInt (this.avcharWidth / 2);
63505 awt2swing.Util.drawString (g, value + "", x, (ypos + (i * this.avcharHeight)) - (Clazz_doubleToInt (this.avcharHeight / 5)));
63506 }}
63507 }, "java.awt.Graphics,~N,~N,~N");
63508 Clazz_defineMethod (c$, "drawEastScale", 
63509  function (g, startx, endx, ypos) {
63510 ypos += this.avcharHeight;
63511 if (this.av.hasHiddenColumns ()) {
63512 endx = this.av.getColumnSelection ().adjustForHiddenColumns (endx);
63513 }var seq;
63514 for (var i = 0; i < this.av.getAlignment ().getHeight (); i++) {
63515 seq = this.av.getAlignment ().getSequenceAt (i);
63516 var index = endx;
63517 var value = -1;
63518 while (index > startx) {
63519 if (jalview.util.Comparison.isGap (seq.getCharAt (index))) {
63520 index--;
63521 continue;
63522 }value = seq.findPosition (index);
63523 break;
63524 }
63525 if (value != -1) {
63526 awt2swing.Util.drawString (g, String.valueOf (value), 0, (ypos + (i * this.avcharHeight)) - (Clazz_doubleToInt (this.avcharHeight / 5)));
63527 }}
63528 }, "java.awt.Graphics,~N,~N,~N");
63529 Clazz_defineMethod (c$, "fastPaint", 
63530 function (horizontal, vertical) {
63531 if (this.$fastPaint || this.gg == null) {
63532 return;
63533 }this.updateViewport ();
63534 if (this.lastsr + horizontal != this.av.startRes) {
63535 horizontal = this.av.startRes - this.lastsr;
63536 }this.lastsr = this.av.startRes;
63537 this.$fastPaint = true;
63538 this.gg.copyArea (horizontal * this.avcharWidth, vertical * this.avcharHeight, this.imgWidth - horizontal * this.avcharWidth, this.imgHeight - vertical * this.avcharHeight, -horizontal * this.avcharWidth, -vertical * this.avcharHeight);
63539 var sr = this.av.startRes;
63540 var er = this.av.endRes;
63541 var ss = this.av.startSeq;
63542 var es = this.av.endSeq;
63543 var transX = 0;
63544 var transY = 0;
63545 if (horizontal > 0) {
63546 transX = (er - sr - horizontal) * this.avcharWidth;
63547 sr = er - horizontal;
63548 } else if (horizontal < 0) {
63549 er = sr - horizontal;
63550 } else if (vertical > 0) {
63551 ss = es - vertical;
63552 if (ss < this.av.startSeq) {
63553 ss = this.av.startSeq;
63554 } else {
63555 transY = this.imgHeight - vertical * this.avcharHeight;
63556 }} else if (vertical < 0) {
63557 es = ss - vertical;
63558 if (es > this.av.endSeq) {
63559 es = this.av.endSeq;
63560 }}this.gg.translate (transX, transY);
63561 this.drawPanel (this.gg, sr, er, ss, es, 0);
63562 this.gg.translate (-transX, -transY);
63563 this.repaint ();
63564 }, "~N,~N");
63565 Clazz_overrideMethod (c$, "paintComponent", 
63566 function (g) {
63567 if (this.img != null && (this.$fastPaint || (this.getSize ().width != g.getClipBounds ().width) || (this.getSize ().height != g.getClipBounds ().height))) {
63568 g.drawImage (this.img, 0, 0, this);
63569 this.$fastPaint = false;
63570 return;
63571 }if (this.$fastPaint) {
63572 g.drawImage (this.img, 0, 0, this);
63573 this.$fastPaint = false;
63574 return;
63575 }this.updateViewport ();
63576 this.imgWidth = this.getSize ().width;
63577 this.imgHeight = this.getSize ().height;
63578 this.imgWidth -= this.imgWidth % this.avcharWidth;
63579 this.imgHeight -= this.imgHeight % this.avcharHeight;
63580 if (this.imgWidth < 1 || this.imgHeight < 1) {
63581 return;
63582 }if (this.img == null || this.imgWidth != this.img.getWidth (this) || this.imgHeight != this.img.getHeight (this)) {
63583 this.img = this.createImage (this.imgWidth, this.imgHeight);
63584 this.gg = this.img.getGraphics ();
63585 this.gg.setFont (this.av.getFont ());
63586 }this.gg.setColor (java.awt.Color.white);
63587 this.gg.fillRect (0, 0, this.imgWidth, this.imgHeight);
63588 if (this.av.getWrapAlignment ()) {
63589 this.drawWrappedPanel (this.gg, this.imgWidth, this.imgHeight, this.av.startRes);
63590 } else {
63591 this.drawPanel (this.gg, this.av.startRes, this.av.endRes, this.av.startSeq, this.av.endSeq, 0);
63592 }g.drawImage (this.img, 0, 0, this);
63593 }, "java.awt.Graphics");
63594 Clazz_defineMethod (c$, "getWrappedCanvasWidth", 
63595 function (cwidth) {
63596 cwidth -= cwidth % this.av.getCharWidth ();
63597 var fm = this.getFontMetrics (this.av.getFont ());
63598 this.LABEL_EAST = 0;
63599 this.LABEL_WEST = 0;
63600 if (this.av.getScaleRightWrapped ()) {
63601 this.LABEL_EAST = fm.stringWidth (this.getMask ());
63602 }if (this.av.getScaleLeftWrapped ()) {
63603 this.LABEL_WEST = fm.stringWidth (this.getMask ());
63604 }return Clazz_doubleToInt ((cwidth - this.LABEL_EAST - this.LABEL_WEST) / this.av.getCharWidth ());
63605 }, "~N");
63606 Clazz_defineMethod (c$, "getMask", 
63607 function () {
63608 var mask = "0";
63609 var maxWidth = 0;
63610 var tmp;
63611 var alignment = this.av.getAlignment ();
63612 for (var i = 0; i < alignment.getHeight (); i++) {
63613 tmp = alignment.getSequenceAt (i).getEnd ();
63614 if (tmp > maxWidth) {
63615 maxWidth = tmp;
63616 }}
63617 for (var i = maxWidth; i > 0; i /= 10) {
63618 mask += "0";
63619 }
63620 return mask;
63621 });
63622 Clazz_defineMethod (c$, "drawWrappedPanel", 
63623  function (g, canvasWidth, canvasHeight, startRes) {
63624 var al = this.av.getAlignment ();
63625 var fm = this.getFontMetrics (this.av.getFont ());
63626 if (this.av.getScaleRightWrapped ()) {
63627 this.LABEL_EAST = fm.stringWidth (this.getMask ());
63628 }if (this.av.getScaleLeftWrapped ()) {
63629 this.LABEL_WEST = fm.stringWidth (this.getMask ());
63630 }var hgap = this.avcharHeight;
63631 if (this.av.getScaleAboveWrapped ()) {
63632 hgap += this.avcharHeight;
63633 }var cWidth = Clazz_doubleToInt ((canvasWidth - this.LABEL_EAST - this.LABEL_WEST) / this.avcharWidth);
63634 var cHeight = this.av.getAlignment ().getHeight () * this.avcharHeight;
63635 this.av.setWrappedWidth (cWidth);
63636 this.av.endRes = this.av.startRes + cWidth;
63637 var endx;
63638 var ypos = hgap;
63639 var maxwidth = this.av.getAlignment ().getWidth () - 1;
63640 if (this.av.hasHiddenColumns ()) {
63641 maxwidth = this.av.getColumnSelection ().findColumnPosition (maxwidth) - 1;
63642 }while ((ypos <= canvasHeight) && (startRes < maxwidth)) {
63643 endx = startRes + cWidth - 1;
63644 if (endx > maxwidth) {
63645 endx = maxwidth;
63646 }g.setColor (java.awt.Color.black);
63647 if (this.av.getScaleLeftWrapped ()) {
63648 this.drawWestScale (g, startRes, endx, ypos);
63649 }if (this.av.getScaleRightWrapped ()) {
63650 g.translate (canvasWidth - this.LABEL_EAST, 0);
63651 this.drawEastScale (g, startRes, endx, ypos);
63652 g.translate (-(canvasWidth - this.LABEL_EAST), 0);
63653 }g.translate (this.LABEL_WEST, 0);
63654 if (this.av.getScaleAboveWrapped ()) {
63655 this.drawNorthScale (g, startRes, endx, ypos);
63656 }if (this.av.hasHiddenColumns () && this.av.getShowHiddenMarkers ()) {
63657 g.setColor (java.awt.Color.blue);
63658 var res;
63659 for (var i = 0; i < this.av.getColumnSelection ().getHiddenColumns ().size (); i++) {
63660 res = this.av.getColumnSelection ().findHiddenRegionPosition (i) - startRes;
63661 if (res < 0 || res > endx - startRes) {
63662 continue;
63663 }this.gg.fillPolygon ( Clazz_newIntArray (-1, [res * this.avcharWidth - Clazz_doubleToInt (this.avcharHeight / 4), res * this.avcharWidth + Clazz_doubleToInt (this.avcharHeight / 4), res * this.avcharWidth]),  Clazz_newIntArray (-1, [ypos - (Clazz_doubleToInt (this.avcharHeight / 2)), ypos - (Clazz_doubleToInt (this.avcharHeight / 2)), ypos - (Clazz_doubleToInt (this.avcharHeight / 2)) + 8]), 3);
63664 }
63665 }if (g.getClip () == null) {
63666 g.setClip (0, 0, cWidth * this.avcharWidth, canvasHeight);
63667 }this.drawPanel (g, startRes, endx, 0, al.getHeight (), ypos);
63668 g.setClip (null);
63669 if (this.av.isShowAnnotation ()) {
63670 g.translate (0, cHeight + ypos + 4);
63671 if (this.annotations == null) {
63672 this.annotations =  new jalview.appletgui.AnnotationPanel (this.av);
63673 }this.annotations.drawComponent (g, startRes, endx + 1);
63674 g.translate (0, -cHeight - ypos - 4);
63675 }g.translate (-this.LABEL_WEST, 0);
63676 ypos += cHeight + this.getAnnotationHeight () + hgap;
63677 startRes += cWidth;
63678 }
63679 }, "java.awt.Graphics,~N,~N,~N");
63680 Clazz_defineMethod (c$, "getAnnotationHeight", 
63681 function () {
63682 if (!this.av.isShowAnnotation ()) {
63683 return 0;
63684 }if (this.annotations == null) {
63685 this.annotations =  new jalview.appletgui.AnnotationPanel (this.av);
63686 }return this.annotations.adjustPanelHeight ();
63687 });
63688 Clazz_defineMethod (c$, "drawPanel", 
63689  function (g1, startRes, endRes, startSeq, endSeq, offset) {
63690 if (!this.av.hasHiddenColumns ()) {
63691 this.draw (g1, startRes, endRes, startSeq, endSeq, offset);
63692 } else {
63693 var screenY = 0;
63694 var blockStart = startRes;
63695 var blockEnd = endRes;
63696 if (this.av.hasHiddenColumns ()) {
63697 for (var region, $region = this.av.getColumnSelection ().getHiddenColumns ().iterator (); $region.hasNext () && ((region = $region.next ()) || true);) {
63698 var hideStart = region[0];
63699 var hideEnd = region[1];
63700 if (hideStart <= blockStart) {
63701 blockStart += (hideEnd - hideStart) + 1;
63702 continue;
63703 }blockEnd = hideStart - 1;
63704 g1.translate (screenY * this.avcharWidth, 0);
63705 this.draw (g1, blockStart, blockEnd, startSeq, endSeq, offset);
63706 if (this.av.getShowHiddenMarkers ()) {
63707 g1.setColor (java.awt.Color.blue);
63708 g1.drawLine ((blockEnd - blockStart + 1) * this.avcharWidth - 1, 0 + offset, (blockEnd - blockStart + 1) * this.avcharWidth - 1, (endSeq - startSeq) * this.avcharHeight + offset);
63709 }g1.translate (-screenY * this.avcharWidth, 0);
63710 screenY += blockEnd - blockStart + 1;
63711 blockStart = hideEnd + 1;
63712 }
63713 }if (screenY <= (endRes - startRes)) {
63714 blockEnd = blockStart + (endRes - startRes) - screenY;
63715 g1.translate (screenY * this.avcharWidth, 0);
63716 this.draw (g1, blockStart, blockEnd, startSeq, endSeq, offset);
63717 g1.translate (-screenY * this.avcharWidth, 0);
63718 }}}, "java.awt.Graphics,~N,~N,~N,~N,~N");
63719 Clazz_defineMethod (c$, "draw", 
63720 function (g, startRes, endRes, startSeq, endSeq, offset) {
63721 g.setFont (this.av.getFont ());
63722 this.sr.prepare (g, this.av.isRenderGaps ());
63723 this.updateViewport ();
63724 var nextSeq;
63725 for (var i = startSeq; i < endSeq; i++) {
63726 nextSeq = this.av.getAlignment ().getSequenceAt (i);
63727 if (nextSeq == null) {
63728 continue;
63729 }this.sr.drawSequence (nextSeq, this.av.getAlignment ().findAllGroups (nextSeq), startRes, endRes, offset + ((i - startSeq) * this.avcharHeight));
63730 if (this.av.isShowSequenceFeatures ()) {
63731 this.fr.drawSequence (g, nextSeq, startRes, endRes, offset + ((i - startSeq) * this.avcharHeight));
63732 }if (this.searchResults != null) {
63733 var visibleResults = this.searchResults.getResults (nextSeq, startRes, endRes);
63734 if (visibleResults != null) {
63735 for (var r = 0; r < visibleResults.length; r += 2) {
63736 this.sr.drawHighlightedText (nextSeq, visibleResults[r], visibleResults[r + 1], (visibleResults[r] - startRes) * this.avcharWidth, offset + ((i - startSeq) * this.avcharHeight));
63737 }
63738 }}if (this.av.cursorMode && this.cursorY == i && this.cursorX >= startRes && this.cursorX <= endRes) {
63739 this.sr.drawCursor (nextSeq, this.cursorX, (this.cursorX - startRes) * this.avcharWidth, offset + ((i - startSeq) * this.avcharHeight));
63740 }}
63741 if (this.av.getSelectionGroup () != null || this.av.getAlignment ().getGroups ().size () > 0) {
63742 this.drawGroupsBoundaries (g, startRes, endRes, startSeq, endSeq, offset);
63743 }}, "java.awt.Graphics,~N,~N,~N,~N,~N");
63744 Clazz_defineMethod (c$, "drawGroupsBoundaries", 
63745  function (g, startRes, endRes, startSeq, endSeq, offset) {
63746 var group = this.av.getSelectionGroup ();
63747 var sx = -1;
63748 var sy = -1;
63749 var ex = -1;
63750 var groupIndex = -1;
63751 if ((group == null) && (this.av.getAlignment ().getGroups ().size () > 0)) {
63752 group = this.av.getAlignment ().getGroups ().get (0);
63753 groupIndex = 0;
63754 }if (group != null) {
63755 do {
63756 var oldY = -1;
63757 var i = 0;
63758 var inGroup = false;
63759 var top = -1;
63760 var bottom = -1;
63761 var alHeight = this.av.getAlignment ().getHeight () - 1;
63762 for (i = startSeq; i < endSeq; i++) {
63763 sx = (group.getStartRes () - startRes) * this.avcharWidth;
63764 sy = offset + ((i - startSeq) * this.avcharHeight);
63765 ex = (((group.getEndRes () + 1) - group.getStartRes ()) * this.avcharWidth) - 1;
63766 if (sx + ex < 0 || sx > this.imgWidth) {
63767 continue;
63768 }if ((sx <= (endRes - startRes) * this.avcharWidth) && group.getSequences (null).contains (this.av.getAlignment ().getSequenceAt (i))) {
63769 if ((bottom == -1) && (i >= alHeight || !group.getSequences (null).contains (this.av.getAlignment ().getSequenceAt (i + 1)))) {
63770 bottom = sy + this.avcharHeight;
63771 }if (!inGroup) {
63772 if (((top == -1) && (i == 0)) || !group.getSequences (null).contains (this.av.getAlignment ().getSequenceAt (i - 1))) {
63773 top = sy;
63774 }oldY = sy;
63775 inGroup = true;
63776 if (group === this.av.getSelectionGroup ()) {
63777 g.setColor (java.awt.Color.red);
63778 } else {
63779 g.setColor (group.getOutlineColour ());
63780 }}} else {
63781 if (inGroup) {
63782 if (sx >= 0 && sx < this.imgWidth) {
63783 g.drawLine (sx, oldY, sx, sy);
63784 }if (sx + ex < this.imgWidth) {
63785 g.drawLine (sx + ex, oldY, sx + ex, sy);
63786 }if (sx < 0) {
63787 ex += sx;
63788 sx = 0;
63789 }if (sx + ex > this.imgWidth) {
63790 ex = this.imgWidth;
63791 } else if (sx + ex >= (endRes - startRes + 1) * this.avcharWidth) {
63792 ex = (endRes - startRes + 1) * this.avcharWidth;
63793 }if (top != -1) {
63794 g.drawLine (sx, top, sx + ex, top);
63795 top = -1;
63796 }if (bottom != -1) {
63797 g.drawLine (sx, bottom, sx + ex, bottom);
63798 bottom = -1;
63799 }inGroup = false;
63800 }}}
63801 if (inGroup) {
63802 sy = offset + ((i - startSeq) * this.avcharHeight);
63803 if (sx >= 0 && sx < this.imgWidth) {
63804 g.drawLine (sx, oldY, sx, sy);
63805 }if (sx + ex < this.imgWidth) {
63806 g.drawLine (sx + ex, oldY, sx + ex, sy);
63807 }if (sx < 0) {
63808 ex += sx;
63809 sx = 0;
63810 }if (sx + ex > this.imgWidth) {
63811 ex = this.imgWidth;
63812 } else if (sx + ex >= (endRes - startRes + 1) * this.avcharWidth) {
63813 ex = (endRes - startRes + 1) * this.avcharWidth;
63814 }if (top != -1) {
63815 g.drawLine (sx, top, sx + ex, top);
63816 top = -1;
63817 }if (bottom != -1) {
63818 g.drawLine (sx, bottom - 1, sx + ex, bottom - 1);
63819 bottom = -1;
63820 }inGroup = false;
63821 }groupIndex++;
63822 if (groupIndex >= this.av.getAlignment ().getGroups ().size ()) {
63823 break;
63824 }group = this.av.getAlignment ().getGroups ().get (groupIndex);
63825 } while (groupIndex < this.av.getAlignment ().getGroups ().size ());
63826 }}, "java.awt.Graphics,~N,~N,~N,~N,~N");
63827 Clazz_defineMethod (c$, "highlightSearchResults", 
63828 function (results) {
63829 this.searchResults = results;
63830 this.repaint ();
63831 }, "jalview.datamodel.SearchResults");
63832 });
63833 Clazz_declarePackage ("jalview.appletgui");
63834 Clazz_load (["jalview.api.SequenceRenderer"], "jalview.appletgui.SequenceRenderer", ["awt2swing.Util", "jalview.util.Comparison", "java.awt.Color", "$.Font"], function () {
63835 c$ = Clazz_decorateAsClass (function () {
63836 this.av = null;
63837 this.fm = null;
63838 this.renderGaps = true;
63839 this.currentSequenceGroup = null;
63840 this.allGroups = null;
63841 this.resBoxColour = null;
63842 this.graphics = null;
63843 this.forOverview = false;
63844 Clazz_instantialize (this, arguments);
63845 }, jalview.appletgui, "SequenceRenderer", null, jalview.api.SequenceRenderer);
63846 Clazz_makeConstructor (c$, 
63847 function (av) {
63848 this.av = av;
63849 }, "jalview.appletgui.AlignViewport");
63850 Clazz_defineMethod (c$, "prepare", 
63851 function (g, renderGaps) {
63852 this.graphics = g;
63853 this.fm = g.getFontMetrics ();
63854 this.renderGaps = renderGaps;
63855 }, "java.awt.Graphics,~B");
63856 Clazz_overrideMethod (c$, "getResidueBoxColour", 
63857 function (seq, i) {
63858 this.allGroups = this.av.getAlignment ().findAllGroups (seq);
63859 if (this.inCurrentSequenceGroup (i)) {
63860 if (this.currentSequenceGroup.getDisplayBoxes ()) {
63861 this.getBoxColour (this.currentSequenceGroup.cs, seq, i);
63862 }} else if (this.av.getShowBoxes ()) {
63863 this.getBoxColour (this.av.getGlobalColourScheme (), seq, i);
63864 }return this.resBoxColour;
63865 }, "jalview.datamodel.SequenceI,~N");
63866 Clazz_overrideMethod (c$, "getResidueColour", 
63867 function (seq, position, fr) {
63868 var col = this.getResidueBoxColour (seq, position);
63869 if (fr != null) {
63870 col = fr.findFeatureColour (col, seq, position);
63871 }return col;
63872 }, "jalview.datamodel.SequenceI,~N,jalview.api.FeatureRenderer");
63873 Clazz_defineMethod (c$, "getBoxColour", 
63874 function (cs, seq, i) {
63875 if (cs != null) {
63876 this.resBoxColour = cs.findColourSeq (seq.getCharAt (i), i, seq);
63877 } else if (this.forOverview && !jalview.util.Comparison.isGap (seq.getCharAt (i))) {
63878 this.resBoxColour = java.awt.Color.lightGray;
63879 } else {
63880 this.resBoxColour = java.awt.Color.white;
63881 }}, "jalview.schemes.ColourSchemeI,jalview.datamodel.SequenceI,~N");
63882 Clazz_defineMethod (c$, "findSequenceColour", 
63883 function (seq, i) {
63884 this.allGroups = this.av.getAlignment ().findAllGroups (seq);
63885 this.drawBoxes (seq, i, i, 0);
63886 return this.resBoxColour;
63887 }, "jalview.datamodel.SequenceI,~N");
63888 Clazz_defineMethod (c$, "drawSequence", 
63889 function (seq, sg, start, end, y1) {
63890 if (seq == null) {
63891 return;
63892 }this.allGroups = sg;
63893 this.drawBoxes (seq, start, end, y1);
63894 if (this.av.validCharWidth) {
63895 this.drawText (seq, start, end, y1);
63896 }}, "jalview.datamodel.SequenceI,~A,~N,~N,~N");
63897 Clazz_defineMethod (c$, "drawBoxes", 
63898 function (seq, start, end, y1) {
63899 var i = start;
63900 var length = seq.getLength ();
63901 var curStart = -1;
63902 var curWidth = this.av.getCharWidth ();
63903 var avCharWidth = this.av.getCharWidth ();
63904 var avCharHeight = this.av.getCharHeight ();
63905 var tempColour = null;
63906 while (i <= end) {
63907 this.resBoxColour = java.awt.Color.white;
63908 if (i < length) {
63909 if (this.inCurrentSequenceGroup (i)) {
63910 if (this.currentSequenceGroup.getDisplayBoxes ()) {
63911 this.getBoxColour (this.currentSequenceGroup.cs, seq, i);
63912 }} else if (this.av.getShowBoxes ()) {
63913 this.getBoxColour (this.av.getGlobalColourScheme (), seq, i);
63914 }}if (this.resBoxColour !== tempColour) {
63915 if (tempColour != null) {
63916 this.graphics.fillRect (avCharWidth * (curStart - start), y1, curWidth, avCharHeight);
63917 }this.graphics.setColor (this.resBoxColour);
63918 curStart = i;
63919 curWidth = avCharWidth;
63920 tempColour = this.resBoxColour;
63921 } else {
63922 curWidth += avCharWidth;
63923 }i++;
63924 }
63925 this.graphics.fillRect (avCharWidth * (curStart - start), y1, curWidth, avCharHeight);
63926 }, "jalview.datamodel.SequenceI,~N,~N,~N");
63927 Clazz_defineMethod (c$, "drawText", 
63928 function (seq, start, end, y1) {
63929 var avCharWidth = this.av.getCharWidth ();
63930 var avCharHeight = this.av.getCharHeight ();
63931 var boldFont = null;
63932 var bold = false;
63933 if (this.av.isUpperCasebold ()) {
63934 boldFont =  new java.awt.Font (this.av.getFont ().getName (), 1, avCharHeight);
63935 this.graphics.setFont (this.av.getFont ());
63936 }y1 += avCharHeight - Clazz_doubleToInt (avCharHeight / 5);
63937 var charOffset = 0;
63938 if (end + 1 >= seq.getLength ()) {
63939 end = seq.getLength () - 1;
63940 }var s = ' ';
63941 var srep = this.av.isDisplayReferenceSeq ();
63942 for (var i = start; i <= end; i++) {
63943 this.graphics.setColor (java.awt.Color.black);
63944 s = seq.getCharAt (i);
63945 if (!this.renderGaps && jalview.util.Comparison.isGap (s)) {
63946 continue;
63947 }if (this.inCurrentSequenceGroup (i)) {
63948 if (!this.currentSequenceGroup.getDisplayText ()) {
63949 continue;
63950 }if (this.currentSequenceGroup.getColourText ()) {
63951 this.getBoxColour (this.currentSequenceGroup.cs, seq, i);
63952 this.graphics.setColor (this.resBoxColour.darker ());
63953 }if (this.currentSequenceGroup.getShowNonconserved ()) {
63954 s = this.getDisplayChar (srep, i, s, '.');
63955 }} else {
63956 if (!this.av.getShowText ()) {
63957 continue;
63958 }if (this.av.getColourText ()) {
63959 this.getBoxColour (this.av.getGlobalColourScheme (), seq, i);
63960 if (this.av.getShowBoxes ()) {
63961 this.graphics.setColor (this.resBoxColour.darker ());
63962 } else {
63963 this.graphics.setColor (this.resBoxColour);
63964 }}if (this.av.getShowUnconserved ()) {
63965 s = this.getDisplayChar (srep, i, s, '.');
63966 }}if (this.av.isUpperCasebold ()) {
63967 this.fm = this.graphics.getFontMetrics ();
63968 if ('A' <= s && s <= 'Z') {
63969 if (!bold) {
63970 this.graphics.setFont (boldFont);
63971 }bold = true;
63972 } else if (bold) {
63973 this.graphics.setFont (this.av.font);
63974 bold = false;
63975 }}charOffset = Clazz_doubleToInt ((avCharWidth - this.fm.charWidth (s)) / 2);
63976 awt2swing.Util.drawString (this.graphics, String.valueOf (s), charOffset + avCharWidth * (i - start), y1);
63977 }
63978 }, "jalview.datamodel.SequenceI,~N,~N,~N");
63979 Clazz_defineMethod (c$, "getDisplayChar", 
63980  function (usesrep, position, s, c) {
63981 var conschar = (usesrep) ? this.av.getAlignment ().getSeqrep ().getCharAt (position) : this.av.getAlignmentConsensusAnnotation ().annotations[position].displayCharacter.charAt (0);
63982 if (conschar != '-' && s == conschar) {
63983 s = c;
63984 }return s;
63985 }, "~B,~N,~S,~S");
63986 Clazz_defineMethod (c$, "inCurrentSequenceGroup", 
63987 function (res) {
63988 if (this.allGroups == null) {
63989 return false;
63990 }for (var i = 0; i < this.allGroups.length; i++) {
63991 if (this.allGroups[i].getStartRes () <= res && this.allGroups[i].getEndRes () >= res) {
63992 this.currentSequenceGroup = this.allGroups[i];
63993 return true;
63994 }}
63995 return false;
63996 }, "~N");
63997 Clazz_defineMethod (c$, "drawHighlightedText", 
63998 function (seq, start, end, x1, y1) {
63999 var avCharWidth = this.av.getCharWidth ();
64000 var avCharHeight = this.av.getCharHeight ();
64001 var pady = Clazz_doubleToInt (avCharHeight / 5);
64002 var charOffset = 0;
64003 this.graphics.setColor (java.awt.Color.black);
64004 this.graphics.fillRect (x1, y1, avCharWidth * (end - start + 1), avCharHeight);
64005 this.graphics.setColor (java.awt.Color.white);
64006 var s = '~';
64007 if (this.av.validCharWidth) {
64008 for (var i = start; i <= end; i++) {
64009 if (i < seq.getLength ()) {
64010 s = seq.getCharAt (i);
64011 }charOffset = Clazz_doubleToInt ((avCharWidth - this.fm.charWidth (s)) / 2);
64012 awt2swing.Util.drawString (this.graphics, String.valueOf (s), charOffset + x1 + avCharWidth * (i - start), y1 + avCharHeight - pady);
64013 }
64014 }}, "jalview.datamodel.SequenceI,~N,~N,~N,~N");
64015 Clazz_defineMethod (c$, "drawCursor", 
64016 function (seq, res, x1, y1) {
64017 var pady = Clazz_doubleToInt (this.av.getCharHeight () / 5);
64018 var charOffset = 0;
64019 this.graphics.setColor (java.awt.Color.black);
64020 this.graphics.fillRect (x1, y1, this.av.getCharWidth (), this.av.getCharHeight ());
64021 this.graphics.setColor (java.awt.Color.white);
64022 this.graphics.setColor (java.awt.Color.white);
64023 var s = seq.getCharAt (res);
64024 if (this.av.validCharWidth) {
64025 charOffset = Clazz_doubleToInt ((this.av.getCharWidth () - this.fm.charWidth (s)) / 2);
64026 awt2swing.Util.drawString (this.graphics, String.valueOf (s), charOffset + x1, (y1 + this.av.getCharHeight ()) - pady);
64027 }}, "jalview.datamodel.SequenceI,~N,~N,~N");
64028 });
64029 Clazz_declarePackage ("jalview.api");
64030 Clazz_declareInterface (jalview.api, "SequenceRenderer");
64031 Clazz_declarePackage ("jalview.appletgui");
64032 Clazz_load (["awt2swing.Panel", "jalview.appletgui.AnnotationRowFilter", "$.TitledPanel", "java.awt.event.ActionListener", "$.AdjustmentListener", "$.ItemListener", "$.MouseListener", "awt2swing.Checkbox", "$.Choice", "$.TextField", "java.awt.BorderLayout", "$.CardLayout"], "jalview.appletgui.AnnotationColumnChooser", ["awt2swing.Frame", "jalview.bin.JalviewLite", "jalview.datamodel.ColumnSelection", "$.GraphLine", "jalview.util.MessageManager", "jalview.viewmodel.annotationfilter.AnnotationFilterParameter", "java.awt.Color", "$.Dimension", "java.awt.event.MouseAdapter", "$.TextListener", "java.lang.Float", "java.util.Vector", "javax.swing.JPanel"], function () {
64033 c$ = Clazz_decorateAsClass (function () {
64034 this.annotations = null;
64035 this.actionPanel = null;
64036 this.thresholdPanel = null;
64037 this.switchableViewsPanel = null;
64038 this.switchableViewsLayout = null;
64039 this.noGraphFilterView = null;
64040 this.graphFilterView = null;
64041 this.annotationComboBoxPanel = null;
64042 this.borderLayout1 = null;
64043 this.gBorderLayout = null;
64044 this.ngBorderLayout = null;
64045 this.threshold = null;
64046 this.gStructureFilterPanel = null;
64047 this.ngStructureFilterPanel = null;
64048 this.currentStructureFilterPanel = null;
64049 this.currentSearchPanel = null;
64050 this.gSearchPanel = null;
64051 this.ngSearchPanel = null;
64052 this.currentFurtherActionPanel = null;
64053 this.gFurtherActionPanel = null;
64054 this.ngFurtherActionPanel = null;
64055 this.actionOption = 1;
64056 this.oldColumnSelection = null;
64057 if (!Clazz_isClassDefined ("jalview.appletgui.AnnotationColumnChooser.FurtherActionPanel")) {
64058 jalview.appletgui.AnnotationColumnChooser.$AnnotationColumnChooser$FurtherActionPanel$ ();
64059 }
64060 if (!Clazz_isClassDefined ("jalview.appletgui.AnnotationColumnChooser.StructureFilterPanel")) {
64061 jalview.appletgui.AnnotationColumnChooser.$AnnotationColumnChooser$StructureFilterPanel$ ();
64062 }
64063 if (!Clazz_isClassDefined ("jalview.appletgui.AnnotationColumnChooser.SearchPanel")) {
64064 jalview.appletgui.AnnotationColumnChooser.$AnnotationColumnChooser$SearchPanel$ ();
64065 }
64066 Clazz_instantialize (this, arguments);
64067 }, jalview.appletgui, "AnnotationColumnChooser", jalview.appletgui.AnnotationRowFilter, [java.awt.event.ActionListener, java.awt.event.AdjustmentListener, java.awt.event.ItemListener, java.awt.event.MouseListener]);
64068 Clazz_prepareFields (c$, function () {
64069 this.annotations =  new awt2swing.Choice ();
64070 this.actionPanel =  new awt2swing.Panel ();
64071 this.thresholdPanel =  new jalview.appletgui.TitledPanel ();
64072 this.switchableViewsPanel =  new awt2swing.Panel ( new java.awt.CardLayout ());
64073 this.switchableViewsLayout = (this.switchableViewsPanel.getLayout ());
64074 this.noGraphFilterView =  new awt2swing.Panel ();
64075 this.graphFilterView =  new awt2swing.Panel ();
64076 this.annotationComboBoxPanel =  new awt2swing.Panel ();
64077 this.borderLayout1 =  new java.awt.BorderLayout ();
64078 this.gBorderLayout =  new java.awt.BorderLayout ();
64079 this.ngBorderLayout =  new java.awt.BorderLayout ();
64080 this.threshold =  new awt2swing.Choice ();
64081 });
64082 Clazz_makeConstructor (c$, 
64083 function () {
64084 Clazz_superConstructor (this, jalview.appletgui.AnnotationColumnChooser, []);
64085 try {
64086 this.jbInit ();
64087 } catch (ex) {
64088 if (Clazz_exceptionOf (ex, Exception)) {
64089 ex.printStackTrace ();
64090 } else {
64091 throw ex;
64092 }
64093 }
64094 });
64095 Clazz_makeConstructor (c$, 
64096 function (av, ap) {
64097 Clazz_superConstructor (this, jalview.appletgui.AnnotationColumnChooser, [av, ap]);
64098 this.frame =  new awt2swing.Frame ();
64099 this.frame.add (this);
64100 jalview.bin.JalviewLite.addFrame (this.frame, jalview.util.MessageManager.getString ("label.select_by_annotation"), 520, 215);
64101 this.slider.addAdjustmentListener (this);
64102 this.slider.addMouseListener (this);
64103 if (av.getAlignment ().getAlignmentAnnotation () == null) {
64104 return;
64105 }this.setOldColumnSelection (av.getColumnSelection ());
64106 this.adjusting = true;
64107 var list =  new java.util.Vector ();
64108 var index = 1;
64109 for (var i = 0; i < av.getAlignment ().getAlignmentAnnotation ().length; i++) {
64110 var label = av.getAlignment ().getAlignmentAnnotation ()[i].label;
64111 if (!list.contains (label)) {
64112 list.addElement (label);
64113 } else {
64114 list.addElement (label + "_" + (index++));
64115 }}
64116 for (var i = 0; i < list.size (); i++) {
64117 this.annotations.addItem (list.elementAt (i).toString ());
64118 }
64119 this.populateThresholdComboBox (this.threshold);
64120 if (av.getAnnotationColumnSelectionState () != null) {
64121 this.currentSearchPanel = av.getAnnotationColumnSelectionState ().getCurrentSearchPanel ();
64122 this.currentStructureFilterPanel = av.getAnnotationColumnSelectionState ().getCurrentStructureFilterPanel ();
64123 this.annotations.select (new Integer (av.getAnnotationColumnSelectionState ().getAnnotations ().getSelectedIndex ()));
64124 this.threshold.select (new Integer (av.getAnnotationColumnSelectionState ().getThreshold ().getSelectedIndex ()));
64125 this.actionOption = av.getAnnotationColumnSelectionState ().getActionOption ();
64126 }try {
64127 this.jbInit ();
64128 } catch (ex) {
64129 if (Clazz_exceptionOf (ex, Exception)) {
64130 } else {
64131 throw ex;
64132 }
64133 }
64134 this.adjusting = false;
64135 this.updateView ();
64136 this.frame.invalidate ();
64137 this.frame.pack ();
64138 }, "jalview.appletgui.AlignViewport,jalview.appletgui.AlignmentPanel");
64139 Clazz_defineMethod (c$, "jbInit", 
64140  function () {
64141 this.ok.setLabel (jalview.util.MessageManager.getString ("action.ok"));
64142 this.cancel.setLabel (jalview.util.MessageManager.getString ("action.cancel"));
64143 this.thresholdValue.setEnabled (false);
64144 this.thresholdValue.setColumns (7);
64145 this.ok.addActionListener (this);
64146 this.cancel.addActionListener (this);
64147 this.annotations.addItemListener (this);
64148 this.thresholdValue.addActionListener (this);
64149 this.threshold.addItemListener (this);
64150 this.slider.setBackground (java.awt.Color.white);
64151 this.slider.setEnabled (false);
64152 this.slider.setPreferredSize ( new java.awt.Dimension (100, 32));
64153 this.thresholdPanel.setBackground (java.awt.Color.white);
64154 this.actionPanel.setBackground (java.awt.Color.white);
64155 this.graphFilterView.setLayout (this.gBorderLayout);
64156 this.graphFilterView.setBackground (java.awt.Color.white);
64157 this.noGraphFilterView.setLayout (this.ngBorderLayout);
64158 this.noGraphFilterView.setBackground (java.awt.Color.white);
64159 this.annotationComboBoxPanel.setBackground (java.awt.Color.white);
64160 this.gSearchPanel = Clazz_innerTypeInstance (jalview.appletgui.AnnotationColumnChooser.SearchPanel, this, null, this);
64161 this.ngSearchPanel = Clazz_innerTypeInstance (jalview.appletgui.AnnotationColumnChooser.SearchPanel, this, null, this);
64162 this.gFurtherActionPanel = Clazz_innerTypeInstance (jalview.appletgui.AnnotationColumnChooser.FurtherActionPanel, this, null, this);
64163 this.ngFurtherActionPanel = Clazz_innerTypeInstance (jalview.appletgui.AnnotationColumnChooser.FurtherActionPanel, this, null, this);
64164 this.gStructureFilterPanel = Clazz_innerTypeInstance (jalview.appletgui.AnnotationColumnChooser.StructureFilterPanel, this, null, this);
64165 this.ngStructureFilterPanel = Clazz_innerTypeInstance (jalview.appletgui.AnnotationColumnChooser.StructureFilterPanel, this, null, this);
64166 this.thresholdPanel.setTitle ("Threshold Filter");
64167 this.thresholdPanel.add (this.getThreshold ());
64168 this.thresholdPanel.add (this.slider);
64169 this.thresholdPanel.add (this.thresholdValue);
64170 this.actionPanel.add (this.ok);
64171 this.actionPanel.add (this.cancel);
64172 var staticPanel =  new javax.swing.JPanel ();
64173 staticPanel.setLayout ( new java.awt.BorderLayout ());
64174 staticPanel.setBackground (java.awt.Color.white);
64175 staticPanel.add (this.gSearchPanel, "North");
64176 staticPanel.add (this.gStructureFilterPanel, "South");
64177 this.graphFilterView.add (staticPanel, "North");
64178 this.graphFilterView.add (this.thresholdPanel, "Center");
64179 this.graphFilterView.add (this.gFurtherActionPanel, "South");
64180 this.noGraphFilterView.add (this.ngSearchPanel, "First");
64181 this.noGraphFilterView.add (this.ngStructureFilterPanel, "Center");
64182 this.noGraphFilterView.add (this.ngFurtherActionPanel, "Center");
64183 this.annotationComboBoxPanel.add (this.getAnnotations ());
64184 this.switchableViewsPanel.add (this.noGraphFilterView, jalview.appletgui.AnnotationColumnChooser.NO_GRAPH_VIEW);
64185 this.switchableViewsPanel.add (this.graphFilterView, jalview.appletgui.AnnotationColumnChooser.GRAPH_VIEW);
64186 this.setLayout (this.borderLayout1);
64187 this.add (this.annotationComboBoxPanel, "First");
64188 this.add (this.switchableViewsPanel, "Center");
64189 this.add (this.actionPanel, "South");
64190 this.selectedAnnotationChanged ();
64191 this.validate ();
64192 });
64193 Clazz_overrideMethod (c$, "reset", 
64194 function () {
64195 if (this.getOldColumnSelection () != null) {
64196 this.av.getColumnSelection ().clear ();
64197 if (this.av.getAnnotationColumnSelectionState () != null) {
64198 var oldSelection = this.av.getAnnotationColumnSelectionState ().getOldColumnSelection ();
64199 if (oldSelection != null && oldSelection.getHiddenColumns () != null && !oldSelection.getHiddenColumns ().isEmpty ()) {
64200 for (var itr = oldSelection.getHiddenColumns ().iterator (); itr.hasNext (); ) {
64201 var positions = itr.next ();
64202 this.av.hideColumns (positions[0], positions[1]);
64203 }
64204 }this.av.setColumnSelection (oldSelection);
64205 }this.ap.paintAlignment (true);
64206 }});
64207 Clazz_overrideMethod (c$, "adjustmentValueChanged", 
64208 function (evt) {
64209 if (!this.adjusting) {
64210 this.thresholdValue.setText ((this.slider.getValue () / 1000) + "");
64211 this.valueChanged (!this.sliderDragging);
64212 }}, "java.awt.event.AdjustmentEvent");
64213 Clazz_defineMethod (c$, "addSliderMouseListeners", 
64214 function () {
64215 this.slider.addMouseListener (((Clazz_isClassDefined ("jalview.appletgui.AnnotationColumnChooser$1") ? 0 : jalview.appletgui.AnnotationColumnChooser.$AnnotationColumnChooser$1$ ()), Clazz_innerTypeInstance (jalview.appletgui.AnnotationColumnChooser$1, this, null)));
64216 });
64217 Clazz_overrideMethod (c$, "valueChanged", 
64218 function (updateAllAnnotation) {
64219 if (this.slider.isEnabled ()) {
64220 this.getCurrentAnnotation ().threshold.value = this.slider.getValue () / 1000;
64221 this.updateView ();
64222 this.ap.paintAlignment (false);
64223 }}, "~B");
64224 Clazz_defineMethod (c$, "getThreshold", 
64225 function () {
64226 return this.threshold;
64227 });
64228 Clazz_defineMethod (c$, "setThreshold", 
64229 function (threshold) {
64230 this.threshold = threshold;
64231 }, "awt2swing.Choice");
64232 Clazz_defineMethod (c$, "getAnnotations", 
64233 function () {
64234 return this.annotations;
64235 });
64236 Clazz_defineMethod (c$, "setAnnotations", 
64237 function (annotations) {
64238 this.annotations = annotations;
64239 }, "awt2swing.Choice");
64240 Clazz_overrideMethod (c$, "updateView", 
64241 function () {
64242 if (this.adjusting) {
64243 return;
64244 }var filterParams =  new jalview.viewmodel.annotationfilter.AnnotationFilterParameter ();
64245 this.setCurrentAnnotation (this.av.getAlignment ().getAlignmentAnnotation ()[this.getAnnotations ().getSelectedIndex ()]);
64246 var selectedThresholdItem = this.getSelectedThresholdItem (this.getThreshold ().getSelectedIndex ());
64247 this.slider.setEnabled (true);
64248 this.thresholdValue.setEnabled (true);
64249 if (selectedThresholdItem == -1) {
64250 this.slider.setEnabled (false);
64251 this.thresholdValue.setEnabled (false);
64252 this.thresholdValue.setText ("");
64253 } else if (selectedThresholdItem != -1) {
64254 if (this.getCurrentAnnotation ().threshold == null) {
64255 this.getCurrentAnnotation ().setThreshold ( new jalview.datamodel.GraphLine ((this.getCurrentAnnotation ().graphMax - this.getCurrentAnnotation ().graphMin) / 2, "Threshold", java.awt.Color.black));
64256 }this.adjusting = true;
64257 var range = this.getCurrentAnnotation ().graphMax * 1000 - this.getCurrentAnnotation ().graphMin * 1000;
64258 this.slider.setMinimum (Clazz_floatToInt (this.getCurrentAnnotation ().graphMin * 1000));
64259 this.slider.setMaximum (Clazz_floatToInt (this.getCurrentAnnotation ().graphMax * 1000));
64260 this.slider.setValue (Clazz_floatToInt (this.getCurrentAnnotation ().threshold.value * 1000));
64261 this.thresholdValue.setText (this.getCurrentAnnotation ().threshold.value + "");
64262 this.slider.setEnabled (true);
64263 this.thresholdValue.setEnabled (true);
64264 this.adjusting = false;
64265 filterParams.setThresholdType (jalview.viewmodel.annotationfilter.AnnotationFilterParameter.ThresholdType.NO_THRESHOLD);
64266 if (this.getCurrentAnnotation ().graph != 0) {
64267 filterParams.setThresholdValue (this.getCurrentAnnotation ().threshold.value);
64268 if (selectedThresholdItem == 1) {
64269 filterParams.setThresholdType (jalview.viewmodel.annotationfilter.AnnotationFilterParameter.ThresholdType.ABOVE_THRESHOLD);
64270 } else if (selectedThresholdItem == 0) {
64271 filterParams.setThresholdType (jalview.viewmodel.annotationfilter.AnnotationFilterParameter.ThresholdType.BELOW_THRESHOLD);
64272 }}}if (this.currentStructureFilterPanel != null) {
64273 if (this.currentStructureFilterPanel.alphaHelix.getState ()) {
64274 filterParams.setFilterAlphaHelix (true);
64275 }if (this.currentStructureFilterPanel.betaStrand.getState ()) {
64276 filterParams.setFilterBetaSheet (true);
64277 }if (this.currentStructureFilterPanel.turn.getState ()) {
64278 filterParams.setFilterTurn (true);
64279 }}if (this.currentSearchPanel != null) {
64280 if (!this.currentSearchPanel.searchBox.getText ().isEmpty ()) {
64281 this.currentSearchPanel.description.setEnabled (true);
64282 this.currentSearchPanel.displayName.setEnabled (true);
64283 filterParams.setRegexString (this.currentSearchPanel.searchBox.getText ());
64284 if (this.currentSearchPanel.displayName.getState ()) {
64285 filterParams.addRegexSearchField (jalview.viewmodel.annotationfilter.AnnotationFilterParameter.SearchableAnnotationField.DISPLAY_STRING);
64286 }if (this.currentSearchPanel.description.getState ()) {
64287 filterParams.addRegexSearchField (jalview.viewmodel.annotationfilter.AnnotationFilterParameter.SearchableAnnotationField.DESCRIPTION);
64288 }} else {
64289 this.currentSearchPanel.description.setEnabled (false);
64290 this.currentSearchPanel.displayName.setEnabled (false);
64291 }}this.av.getColumnSelection ().filterAnnotations (this.getCurrentAnnotation ().annotations, filterParams);
64292 this.av.showAllHiddenColumns ();
64293 if (this.getActionOption () == jalview.appletgui.AnnotationColumnChooser.ACTION_OPTION_HIDE) {
64294 this.av.hideSelectedColumns ();
64295 }filterParams = null;
64296 this.av.setAnnotationColumnSelectionState (this);
64297 this.ap.paintAlignment (true);
64298 });
64299 Clazz_defineMethod (c$, "getOldColumnSelection", 
64300 function () {
64301 return this.oldColumnSelection;
64302 });
64303 Clazz_defineMethod (c$, "setOldColumnSelection", 
64304 function (currentColumnSelection) {
64305 if (currentColumnSelection != null) {
64306 this.oldColumnSelection =  new jalview.datamodel.ColumnSelection (currentColumnSelection);
64307 }}, "jalview.datamodel.ColumnSelection");
64308 Clazz_defineMethod (c$, "getCurrentFutherActionPanel", 
64309 function () {
64310 return this.currentFurtherActionPanel;
64311 });
64312 Clazz_defineMethod (c$, "setCurrentFutherActionPanel", 
64313 function (currentFutherActionPanel) {
64314 this.currentFurtherActionPanel = currentFutherActionPanel;
64315 }, "jalview.appletgui.AnnotationColumnChooser.FurtherActionPanel");
64316 Clazz_defineMethod (c$, "getCurrentSearchPanel", 
64317 function () {
64318 return this.currentSearchPanel;
64319 });
64320 Clazz_defineMethod (c$, "setCurrentSearchPanel", 
64321 function (currentSearchPanel) {
64322 this.currentSearchPanel = currentSearchPanel;
64323 }, "jalview.appletgui.AnnotationColumnChooser.SearchPanel");
64324 Clazz_defineMethod (c$, "getActionOption", 
64325 function () {
64326 return this.actionOption;
64327 });
64328 Clazz_defineMethod (c$, "setActionOption", 
64329 function (actionOption) {
64330 this.actionOption = actionOption;
64331 }, "~N");
64332 Clazz_defineMethod (c$, "getCurrentStructureFilterPanel", 
64333 function () {
64334 return this.currentStructureFilterPanel;
64335 });
64336 Clazz_defineMethod (c$, "setCurrentStructureFilterPanel", 
64337 function (currentStructureFilterPanel) {
64338 this.currentStructureFilterPanel = currentStructureFilterPanel;
64339 }, "jalview.appletgui.AnnotationColumnChooser.StructureFilterPanel");
64340 Clazz_overrideMethod (c$, "itemStateChanged", 
64341 function (e) {
64342 if (e.getSource () === this.annotations) {
64343 this.selectedAnnotationChanged ();
64344 } else if (e.getSource () === this.threshold) {
64345 this.threshold_actionPerformed (null);
64346 }}, "java.awt.event.ItemEvent");
64347 Clazz_defineMethod (c$, "selectedAnnotationChanged", 
64348 function () {
64349 var currentView = jalview.appletgui.AnnotationColumnChooser.NO_GRAPH_VIEW;
64350 if (this.av.getAlignment ().getAlignmentAnnotation ()[this.getAnnotations ().getSelectedIndex ()].graph != 0) {
64351 currentView = jalview.appletgui.AnnotationColumnChooser.GRAPH_VIEW;
64352 }this.gSearchPanel.syncState ();
64353 this.gFurtherActionPanel.syncState ();
64354 this.gStructureFilterPanel.syncState ();
64355 this.ngSearchPanel.syncState ();
64356 this.ngFurtherActionPanel.syncState ();
64357 this.ngStructureFilterPanel.syncState ();
64358 this.switchableViewsLayout.show (this.switchableViewsPanel, currentView);
64359 this.updateView ();
64360 });
64361 Clazz_overrideMethod (c$, "actionPerformed", 
64362 function (evt) {
64363 if (evt.getSource () === this.thresholdValue) {
64364 try {
64365 var f =  new Float (this.thresholdValue.getText ()).floatValue ();
64366 this.slider.setValue (Clazz_floatToInt (f * 1000));
64367 this.adjustmentValueChanged (null);
64368 } catch (ex) {
64369 if (Clazz_exceptionOf (ex, NumberFormatException)) {
64370 } else {
64371 throw ex;
64372 }
64373 }
64374 } else if (evt.getSource () === this.ok) {
64375 this.ok_actionPerformed (null);
64376 } else if (evt.getSource () === this.cancel) {
64377 this.cancel_actionPerformed (null);
64378 } else if (evt.getSource () === this.thresholdValue) {
64379 this.thresholdValue_actionPerformed (null);
64380 } else {
64381 this.updateView ();
64382 }}, "java.awt.event.ActionEvent");
64383 Clazz_overrideMethod (c$, "mouseClicked", 
64384 function (e) {
64385 }, "java.awt.event.MouseEvent");
64386 Clazz_overrideMethod (c$, "mousePressed", 
64387 function (e) {
64388 if (e.getSource () === this.slider) {
64389 this.updateView ();
64390 }}, "java.awt.event.MouseEvent");
64391 Clazz_overrideMethod (c$, "mouseReleased", 
64392 function (e) {
64393 if (e.getSource () === this.slider) {
64394 this.updateView ();
64395 }}, "java.awt.event.MouseEvent");
64396 Clazz_overrideMethod (c$, "mouseEntered", 
64397 function (e) {
64398 if (e.getSource () === this.slider) {
64399 this.updateView ();
64400 }}, "java.awt.event.MouseEvent");
64401 Clazz_overrideMethod (c$, "mouseExited", 
64402 function (e) {
64403 if (e.getSource () === this.slider) {
64404 this.updateView ();
64405 }}, "java.awt.event.MouseEvent");
64406 c$.$AnnotationColumnChooser$FurtherActionPanel$ = function () {
64407 Clazz_pu$h(self.c$);
64408 c$ = Clazz_decorateAsClass (function () {
64409 Clazz_prepareCallback (this, arguments);
64410 this.aColChooser = null;
64411 this.furtherAction = null;
64412 Clazz_instantialize (this, arguments);
64413 }, jalview.appletgui.AnnotationColumnChooser, "FurtherActionPanel", awt2swing.Panel, java.awt.event.ItemListener);
64414 Clazz_prepareFields (c$, function () {
64415 this.furtherAction =  new awt2swing.Choice ();
64416 });
64417 Clazz_makeConstructor (c$, 
64418 function (a) {
64419 Clazz_superConstructor (this, jalview.appletgui.AnnotationColumnChooser.FurtherActionPanel, []);
64420 this.aColChooser = a;
64421 this.furtherAction.addItem ("Select");
64422 this.furtherAction.addItem ("Hide");
64423 this.furtherAction.addItemListener (this);
64424 this.syncState ();
64425 this.add (this.furtherAction);
64426 }, "jalview.appletgui.AnnotationColumnChooser");
64427 Clazz_defineMethod (c$, "syncState", 
64428 function () {
64429 if (this.aColChooser.getActionOption () == jalview.appletgui.AnnotationColumnChooser.ACTION_OPTION_HIDE) {
64430 this.furtherAction.select ("Hide");
64431 } else {
64432 this.furtherAction.select ("Select");
64433 }});
64434 Clazz_overrideMethod (c$, "itemStateChanged", 
64435 function (a) {
64436 this.aColChooser.setCurrentFutherActionPanel (this);
64437 if (this.furtherAction.getSelectedItem ().toString ().equalsIgnoreCase ("Select")) {
64438 this.b$["jalview.appletgui.AnnotationColumnChooser"].setActionOption (1);
64439 this.b$["jalview.appletgui.AnnotationColumnChooser"].updateView ();
64440 } else {
64441 this.b$["jalview.appletgui.AnnotationColumnChooser"].setActionOption (jalview.appletgui.AnnotationColumnChooser.ACTION_OPTION_HIDE);
64442 this.b$["jalview.appletgui.AnnotationColumnChooser"].updateView ();
64443 }}, "java.awt.event.ItemEvent");
64444 c$ = Clazz_p0p ();
64445 };
64446 c$.$AnnotationColumnChooser$StructureFilterPanel$ = function () {
64447 Clazz_pu$h(self.c$);
64448 c$ = Clazz_decorateAsClass (function () {
64449 Clazz_prepareCallback (this, arguments);
64450 this.aColChooser = null;
64451 this.alphaHelix = null;
64452 this.betaStrand = null;
64453 this.turn = null;
64454 this.all = null;
64455 Clazz_instantialize (this, arguments);
64456 }, jalview.appletgui.AnnotationColumnChooser, "StructureFilterPanel", jalview.appletgui.TitledPanel, java.awt.event.ItemListener);
64457 Clazz_prepareFields (c$, function () {
64458 this.alphaHelix =  new awt2swing.Checkbox ();
64459 this.betaStrand =  new awt2swing.Checkbox ();
64460 this.turn =  new awt2swing.Checkbox ();
64461 this.all =  new awt2swing.Checkbox ();
64462 });
64463 Clazz_makeConstructor (c$, 
64464 function (a) {
64465 Clazz_superConstructor (this, jalview.appletgui.AnnotationColumnChooser.StructureFilterPanel, []);
64466 this.aColChooser = a;
64467 this.alphaHelix.setLabel (jalview.util.MessageManager.getString ("label.alpha_helix"));
64468 this.alphaHelix.setBackground (java.awt.Color.white);
64469 this.alphaHelix.addItemListener (this);
64470 this.betaStrand.setLabel (jalview.util.MessageManager.getString ("label.beta_strand"));
64471 this.betaStrand.setBackground (java.awt.Color.white);
64472 this.betaStrand.addItemListener (this);
64473 this.turn.setLabel (jalview.util.MessageManager.getString ("label.turn"));
64474 this.turn.setBackground (java.awt.Color.white);
64475 this.turn.addItemListener (this);
64476 this.all.setLabel (jalview.util.MessageManager.getString ("label.select_all"));
64477 this.all.setBackground (java.awt.Color.white);
64478 this.all.addItemListener (this);
64479 this.setBackground (java.awt.Color.white);
64480 this.setTitle ("Structure Filter");
64481 this.add (this.all);
64482 this.add (this.alphaHelix);
64483 this.add (this.betaStrand);
64484 this.add (this.turn);
64485 }, "jalview.appletgui.AnnotationColumnChooser");
64486 Clazz_defineMethod (c$, "alphaHelix_actionPerformed", 
64487 function () {
64488 this.updateSelectAllState ();
64489 this.aColChooser.setCurrentStructureFilterPanel (this);
64490 this.aColChooser.updateView ();
64491 });
64492 Clazz_defineMethod (c$, "betaStrand_actionPerformed", 
64493 function () {
64494 this.updateSelectAllState ();
64495 this.aColChooser.setCurrentStructureFilterPanel (this);
64496 this.aColChooser.updateView ();
64497 });
64498 Clazz_defineMethod (c$, "turn_actionPerformed", 
64499 function () {
64500 this.updateSelectAllState ();
64501 this.aColChooser.setCurrentStructureFilterPanel (this);
64502 this.aColChooser.updateView ();
64503 });
64504 Clazz_defineMethod (c$, "all_actionPerformed", 
64505 function () {
64506 if (this.all.getState ()) {
64507 this.alphaHelix.setState (true);
64508 this.betaStrand.setState (true);
64509 this.turn.setState (true);
64510 } else {
64511 this.alphaHelix.setState (false);
64512 this.betaStrand.setState (false);
64513 this.turn.setState (false);
64514 }this.aColChooser.setCurrentStructureFilterPanel (this);
64515 this.aColChooser.updateView ();
64516 });
64517 Clazz_defineMethod (c$, "updateSelectAllState", 
64518 function () {
64519 if (this.alphaHelix.getState () && this.betaStrand.getState () && this.turn.getState ()) {
64520 this.all.setState (true);
64521 } else {
64522 this.all.setState (false);
64523 }});
64524 Clazz_defineMethod (c$, "syncState", 
64525 function () {
64526 var a = this.aColChooser.getCurrentStructureFilterPanel ();
64527 if (a != null) {
64528 this.alphaHelix.setState (a.alphaHelix.getState ());
64529 this.betaStrand.setState (a.betaStrand.getState ());
64530 this.turn.setState (a.turn.getState ());
64531 if (a.all.getState ()) {
64532 this.all.setState (true);
64533 this.alphaHelix.setState (true);
64534 this.betaStrand.setState (true);
64535 this.turn.setState (true);
64536 }}});
64537 Clazz_overrideMethod (c$, "itemStateChanged", 
64538 function (a) {
64539 if (a.getSource () === this.alphaHelix) {
64540 this.alphaHelix_actionPerformed ();
64541 } else if (a.getSource () === this.betaStrand) {
64542 this.betaStrand_actionPerformed ();
64543 } else if (a.getSource () === this.turn) {
64544 this.turn_actionPerformed ();
64545 } else if (a.getSource () === this.all) {
64546 this.all_actionPerformed ();
64547 }}, "java.awt.event.ItemEvent");
64548 c$ = Clazz_p0p ();
64549 };
64550 c$.$AnnotationColumnChooser$SearchPanel$ = function () {
64551 Clazz_pu$h(self.c$);
64552 c$ = Clazz_decorateAsClass (function () {
64553 Clazz_prepareCallback (this, arguments);
64554 this.aColChooser = null;
64555 this.displayName = null;
64556 this.description = null;
64557 this.searchBox = null;
64558 Clazz_instantialize (this, arguments);
64559 }, jalview.appletgui.AnnotationColumnChooser, "SearchPanel", jalview.appletgui.TitledPanel, java.awt.event.ItemListener);
64560 Clazz_prepareFields (c$, function () {
64561 this.displayName =  new awt2swing.Checkbox ();
64562 this.description =  new awt2swing.Checkbox ();
64563 this.searchBox =  new awt2swing.TextField (10);
64564 });
64565 Clazz_makeConstructor (c$, 
64566 function (a) {
64567 Clazz_superConstructor (this, jalview.appletgui.AnnotationColumnChooser.SearchPanel, []);
64568 this.aColChooser = a;
64569 this.searchBox.addTextListener (((Clazz_isClassDefined ("jalview.appletgui.AnnotationColumnChooser$SearchPanel$1") ? 0 : jalview.appletgui.AnnotationColumnChooser.SearchPanel.$AnnotationColumnChooser$SearchPanel$1$ ()), Clazz_innerTypeInstance (jalview.appletgui.AnnotationColumnChooser$SearchPanel$1, this, null)));
64570 this.displayName.setLabel (jalview.util.MessageManager.getString ("label.display_name"));
64571 this.displayName.setEnabled (false);
64572 this.displayName.addItemListener (this);
64573 this.description.setLabel (jalview.util.MessageManager.getString ("label.description"));
64574 this.description.setEnabled (false);
64575 this.description.addItemListener (this);
64576 this.setTitle ("Search Filter");
64577 this.syncState ();
64578 this.add (this.searchBox);
64579 this.add (this.displayName);
64580 this.add (this.description);
64581 }, "jalview.appletgui.AnnotationColumnChooser");
64582 Clazz_defineMethod (c$, "displayNameCheckboxAction", 
64583 function () {
64584 this.aColChooser.setCurrentSearchPanel (this);
64585 this.aColChooser.updateView ();
64586 });
64587 Clazz_defineMethod (c$, "discriptionCheckboxAction", 
64588 function () {
64589 this.aColChooser.setCurrentSearchPanel (this);
64590 this.aColChooser.updateView ();
64591 });
64592 Clazz_defineMethod (c$, "searchStringAction", 
64593 function () {
64594 this.aColChooser.setCurrentSearchPanel (this);
64595 this.aColChooser.updateView ();
64596 });
64597 Clazz_defineMethod (c$, "syncState", 
64598 function () {
64599 var a = this.aColChooser.getCurrentSearchPanel ();
64600 if (a != null) {
64601 this.description.setEnabled (a.description.isEnabled ());
64602 this.description.setState (a.description.getState ());
64603 this.displayName.setEnabled (a.displayName.isEnabled ());
64604 this.displayName.setState (a.displayName.getState ());
64605 this.searchBox.setText (a.searchBox.getText ());
64606 }});
64607 Clazz_overrideMethod (c$, "itemStateChanged", 
64608 function (a) {
64609 if (a.getSource () === this.displayName) {
64610 this.displayNameCheckboxAction ();
64611 } else if (a.getSource () === this.description) {
64612 this.discriptionCheckboxAction ();
64613 }}, "java.awt.event.ItemEvent");
64614 c$.$AnnotationColumnChooser$SearchPanel$1$ = function () {
64615 Clazz_pu$h(self.c$);
64616 c$ = Clazz_declareAnonymous (jalview.appletgui, "AnnotationColumnChooser$SearchPanel$1", null, java.awt.event.TextListener);
64617 Clazz_overrideMethod (c$, "textValueChanged", 
64618 function (a) {
64619 this.b$["jalview.appletgui.AnnotationColumnChooser.SearchPanel"].searchStringAction ();
64620 }, "java.awt.event.TextEvent");
64621 c$ = Clazz_p0p ();
64622 };
64623 c$ = Clazz_p0p ();
64624 };
64625 c$.$AnnotationColumnChooser$1$ = function () {
64626 Clazz_pu$h(self.c$);
64627 c$ = Clazz_declareAnonymous (jalview.appletgui, "AnnotationColumnChooser$1", java.awt.event.MouseAdapter);
64628 Clazz_defineMethod (c$, "mousePressed", 
64629 function (e) {
64630 this.b$["jalview.appletgui.AnnotationColumnChooser"].sliderDragging = true;
64631 Clazz_superCall (this, jalview.appletgui.AnnotationColumnChooser$1, "mousePressed", [e]);
64632 }, "java.awt.event.MouseEvent");
64633 Clazz_defineMethod (c$, "mouseDragged", 
64634 function (e) {
64635 this.b$["jalview.appletgui.AnnotationColumnChooser"].sliderDragging = true;
64636 Clazz_superCall (this, jalview.appletgui.AnnotationColumnChooser$1, "mouseDragged", [e]);
64637 }, "java.awt.event.MouseEvent");
64638 Clazz_overrideMethod (c$, "mouseReleased", 
64639 function (evt) {
64640 if (this.b$["jalview.appletgui.AnnotationColumnChooser"].sliderDragging) {
64641 this.b$["jalview.appletgui.AnnotationColumnChooser"].sliderDragging = false;
64642 this.b$["jalview.appletgui.AnnotationColumnChooser"].valueChanged (true);
64643 }this.b$["jalview.appletgui.AnnotationColumnChooser"].ap.paintAlignment (true);
64644 }, "java.awt.event.MouseEvent");
64645 c$ = Clazz_p0p ();
64646 };
64647 Clazz_defineStatics (c$,
64648 "ACTION_OPTION_SELECT", 1,
64649 "ACTION_OPTION_HIDE", 2,
64650 "NO_GRAPH_VIEW", "0",
64651 "GRAPH_VIEW", "1");
64652 });
64653 Clazz_declarePackage ("jalview.appletgui");
64654 Clazz_load (["awt2swing.Panel", "$.Button", "$.Checkbox", "$.Scrollbar", "$.TextField"], "jalview.appletgui.AnnotationRowFilter", ["jalview.util.MessageManager", "java.lang.Float", "java.util.Vector"], function () {
64655 c$ = Clazz_decorateAsClass (function () {
64656 this.av = null;
64657 this.ap = null;
64658 this.annmap = null;
64659 this.enableSeqAss = false;
64660 this.currentAnnotation = null;
64661 this.adjusting = false;
64662 this.currentColours = null;
64663 this.minColour = null;
64664 this.maxColour = null;
64665 this.seqAssociated = null;
64666 this.thresholdIsMin = null;
64667 this.slider = null;
64668 this.thresholdValue = null;
64669 this.frame = null;
64670 this.ok = null;
64671 this.cancel = null;
64672 this.sliderDragging = false;
64673 Clazz_instantialize (this, arguments);
64674 }, jalview.appletgui, "AnnotationRowFilter", awt2swing.Panel);
64675 Clazz_prepareFields (c$, function () {
64676 this.currentColours =  new awt2swing.Checkbox ();
64677 this.minColour =  new awt2swing.Panel ();
64678 this.maxColour =  new awt2swing.Panel ();
64679 this.seqAssociated =  new awt2swing.Checkbox ();
64680 this.thresholdIsMin =  new awt2swing.Checkbox ();
64681 this.slider =  new awt2swing.Scrollbar (0);
64682 this.thresholdValue =  new awt2swing.TextField (20);
64683 this.ok =  new awt2swing.Button ();
64684 this.cancel =  new awt2swing.Button ();
64685 });
64686 Clazz_makeConstructor (c$, 
64687 function (av, ap) {
64688 Clazz_superConstructor (this, jalview.appletgui.AnnotationRowFilter, []);
64689 this.av = av;
64690 this.ap = ap;
64691 }, "jalview.appletgui.AlignViewport,jalview.appletgui.AlignmentPanel");
64692 Clazz_makeConstructor (c$, 
64693 function () {
64694 Clazz_superConstructor (this, jalview.appletgui.AnnotationRowFilter, []);
64695 });
64696 Clazz_defineMethod (c$, "getAnnotationItems", 
64697 function (isSeqAssociated) {
64698 var list =  new java.util.Vector ();
64699 var index = 1;
64700 var anmap =  Clazz_newIntArray (this.av.getAlignment ().getAlignmentAnnotation ().length, 0);
64701 for (var i = 0; i < this.av.getAlignment ().getAlignmentAnnotation ().length; i++) {
64702 if (this.av.getAlignment ().getAlignmentAnnotation ()[i].sequenceRef == null) {
64703 if (isSeqAssociated) {
64704 continue;
64705 }} else {
64706 this.enableSeqAss = true;
64707 }var label = this.av.getAlignment ().getAlignmentAnnotation ()[i].label;
64708 if (!list.contains (label)) {
64709 anmap[list.size ()] = i;
64710 list.add (label);
64711 } else {
64712 if (!isSeqAssociated) {
64713 anmap[list.size ()] = i;
64714 list.add (label + "_" + (index++));
64715 }}}
64716 this.annmap =  Clazz_newIntArray (list.size (), 0);
64717 System.arraycopy (anmap, 0, this.annmap, 0, this.annmap.length);
64718 return list;
64719 }, "~B");
64720 Clazz_defineMethod (c$, "getSelectedThresholdItem", 
64721 function (indexValue) {
64722 var selectedThresholdItem = -1;
64723 if (indexValue == 1) {
64724 selectedThresholdItem = 1;
64725 } else if (indexValue == 2) {
64726 selectedThresholdItem = 0;
64727 }return selectedThresholdItem;
64728 }, "~N");
64729 Clazz_defineMethod (c$, "modelChanged", 
64730 function () {
64731 this.seqAssociated.setEnabled (this.enableSeqAss);
64732 });
64733 Clazz_defineMethod (c$, "ok_actionPerformed", 
64734 function (e) {
64735 this.updateView ();
64736 this.frame.setVisible (false);
64737 }, "java.awt.event.ActionEvent");
64738 Clazz_defineMethod (c$, "cancel_actionPerformed", 
64739 function (e) {
64740 this.reset ();
64741 this.ap.paintAlignment (true);
64742 this.frame.setVisible (false);
64743 }, "java.awt.event.ActionEvent");
64744 Clazz_defineMethod (c$, "thresholdCheck_actionPerformed", 
64745 function (e) {
64746 this.updateView ();
64747 }, "java.awt.event.ActionEvent");
64748 Clazz_defineMethod (c$, "annotations_actionPerformed", 
64749 function (e) {
64750 this.updateView ();
64751 }, "java.awt.event.ActionEvent");
64752 Clazz_defineMethod (c$, "threshold_actionPerformed", 
64753 function (e) {
64754 this.updateView ();
64755 }, "java.awt.event.ActionEvent");
64756 Clazz_defineMethod (c$, "thresholdValue_actionPerformed", 
64757 function (e) {
64758 try {
64759 var f = Float.parseFloat (this.thresholdValue.getText ());
64760 this.slider.setValue (Clazz_floatToInt (f * 1000));
64761 this.updateView ();
64762 } catch (ex) {
64763 if (Clazz_exceptionOf (ex, NumberFormatException)) {
64764 } else {
64765 throw ex;
64766 }
64767 }
64768 }, "java.awt.event.ActionEvent");
64769 Clazz_defineMethod (c$, "populateThresholdComboBox", 
64770 function (threshold) {
64771 threshold.addItem (jalview.util.MessageManager.getString ("label.threshold_feature_no_thereshold"));
64772 threshold.addItem (jalview.util.MessageManager.getString ("label.threshold_feature_above_thereshold"));
64773 threshold.addItem (jalview.util.MessageManager.getString ("label.threshold_feature_below_thereshold"));
64774 }, "awt2swing.Choice");
64775 Clazz_defineMethod (c$, "getCurrentAnnotation", 
64776 function () {
64777 return this.currentAnnotation;
64778 });
64779 Clazz_defineMethod (c$, "setCurrentAnnotation", 
64780 function (currentAnnotation) {
64781 this.currentAnnotation = currentAnnotation;
64782 }, "jalview.datamodel.AlignmentAnnotation");
64783 });
64784 Clazz_declarePackage ("jalview.appletgui");
64785 Clazz_load (["awt2swing.Panel", "java.awt.Insets"], "jalview.appletgui.TitledPanel", ["awt2swing.Util"], function () {
64786 c$ = Clazz_decorateAsClass (function () {
64787 this.title = null;
64788 this.$insets = null;
64789 Clazz_instantialize (this, arguments);
64790 }, jalview.appletgui, "TitledPanel", awt2swing.Panel);
64791 Clazz_prepareFields (c$, function () {
64792 this.$insets =  new java.awt.Insets (10, 10, 10, 10);
64793 });
64794 Clazz_makeConstructor (c$, 
64795 function () {
64796 this.construct ("");
64797 });
64798 Clazz_makeConstructor (c$, 
64799 function (title) {
64800 Clazz_superConstructor (this, jalview.appletgui.TitledPanel, []);
64801 this.setTitle (title);
64802 }, "~S");
64803 Clazz_defineMethod (c$, "getInsets", 
64804 function () {
64805 return this.$insets;
64806 });
64807 Clazz_defineMethod (c$, "paintComponent", 
64808 function (g) {
64809 Clazz_superCall (this, jalview.appletgui.TitledPanel, "paintComponent", [g]);
64810 g.setColor (this.getForeground ());
64811 g.drawRect (5, 5, this.getWidth () - 10, this.getHeight () - 10);
64812 var width = g.getFontMetrics ().stringWidth (this.getTitle ());
64813 g.setColor (this.getBackground ());
64814 g.fillRect (10, 0, width, 10);
64815 g.setColor (this.getForeground ());
64816 awt2swing.Util.drawString (g, this.getTitle (), 10, 10);
64817 }, "java.awt.Graphics");
64818 Clazz_defineMethod (c$, "getTitle", 
64819 function () {
64820 return this.title;
64821 });
64822 Clazz_defineMethod (c$, "setTitle", 
64823 function (title) {
64824 this.title = title;
64825 }, "~S");
64826 });
64827 Clazz_declarePackage ("java.awt");
64828 Clazz_load (["java.awt.LayoutManager2", "java.io.ObjectStreamField", "java.util.Hashtable", "$.Vector"], "java.awt.CardLayout", ["java.lang.IllegalArgumentException", "java.awt.Dimension"], function () {
64829 c$ = Clazz_decorateAsClass (function () {
64830 this.vector = null;
64831 if (!Clazz_isClassDefined ("java.awt.CardLayout.Card")) {
64832 java.awt.CardLayout.$CardLayout$Card$ ();
64833 }
64834 this.currentCard = 0;
64835 this.hgap = 0;
64836 this.vgap = 0;
64837 Clazz_instantialize (this, arguments);
64838 }, java.awt, "CardLayout", null, [java.awt.LayoutManager2, java.io.Serializable]);
64839 Clazz_prepareFields (c$, function () {
64840 this.vector =  new java.util.Vector ();
64841 });
64842 Clazz_makeConstructor (c$, 
64843 function () {
64844 this.construct (0, 0);
64845 });
64846 Clazz_makeConstructor (c$, 
64847 function (hgap, vgap) {
64848 this.hgap = hgap;
64849 this.vgap = vgap;
64850 }, "~N,~N");
64851 Clazz_defineMethod (c$, "getHgap", 
64852 function () {
64853 return this.hgap;
64854 });
64855 Clazz_defineMethod (c$, "setHgap", 
64856 function (hgap) {
64857 this.hgap = hgap;
64858 }, "~N");
64859 Clazz_defineMethod (c$, "getVgap", 
64860 function () {
64861 return this.vgap;
64862 });
64863 Clazz_defineMethod (c$, "setVgap", 
64864 function (vgap) {
64865 this.vgap = vgap;
64866 }, "~N");
64867 Clazz_defineMethod (c$, "addLayoutComponent", 
64868 function (comp, constraints) {
64869 {
64870 if (constraints == null) {
64871 constraints = "";
64872 }if (Clazz_instanceOf (constraints, String)) {
64873 this.addLayoutComponent (constraints, comp);
64874 } else {
64875 throw  new IllegalArgumentException ("cannot add to layout: constraint must be a string");
64876 }}}, "java.awt.Component,~O");
64877 Clazz_defineMethod (c$, "addLayoutComponent", 
64878 function (name, comp) {
64879 {
64880 if (!this.vector.isEmpty ()) {
64881 comp.setVisible (false);
64882 }for (var i = 0; i < this.vector.size (); i++) {
64883 if ((this.vector.get (i)).name.equals (name)) {
64884 (this.vector.get (i)).comp = comp;
64885 return;
64886 }}
64887 this.vector.add (Clazz_innerTypeInstance (java.awt.CardLayout.Card, this, null, name, comp));
64888 }}, "~S,java.awt.Component");
64889 Clazz_overrideMethod (c$, "removeLayoutComponent", 
64890 function (comp) {
64891 {
64892 for (var i = 0; i < this.vector.size (); i++) {
64893 if ((this.vector.get (i)).comp === comp) {
64894 if (comp.isVisible () && (comp.getParent () != null)) {
64895 this.next (comp.getParent ());
64896 }this.vector.remove (i);
64897 if (this.currentCard > i) {
64898 this.currentCard--;
64899 }break;
64900 }}
64901 }}, "java.awt.Component");
64902 Clazz_overrideMethod (c$, "preferredLayoutSize", 
64903 function (parent) {
64904 {
64905 var insets = parent.getInsets ();
64906 var ncomponents = parent.getComponentCount ();
64907 var w = 0;
64908 var h = 0;
64909 for (var i = 0; i < ncomponents; i++) {
64910 var comp = parent.getComponent (i);
64911 var d = comp.getPreferredSize ();
64912 if (d.width > w) {
64913 w = d.width;
64914 }if (d.height > h) {
64915 h = d.height;
64916 }}
64917 return  new java.awt.Dimension (insets.left + insets.right + w + this.hgap * 2, insets.top + insets.bottom + h + this.vgap * 2);
64918 }}, "java.awt.Container");
64919 Clazz_overrideMethod (c$, "minimumLayoutSize", 
64920 function (parent) {
64921 {
64922 var insets = parent.getInsets ();
64923 var ncomponents = parent.getComponentCount ();
64924 var w = 0;
64925 var h = 0;
64926 for (var i = 0; i < ncomponents; i++) {
64927 var comp = parent.getComponent (i);
64928 var d = comp.getMinimumSize ();
64929 if (d.width > w) {
64930 w = d.width;
64931 }if (d.height > h) {
64932 h = d.height;
64933 }}
64934 return  new java.awt.Dimension (insets.left + insets.right + w + this.hgap * 2, insets.top + insets.bottom + h + this.vgap * 2);
64935 }}, "java.awt.Container");
64936 Clazz_overrideMethod (c$, "maximumLayoutSize", 
64937 function (target) {
64938 return  new java.awt.Dimension (2147483647, 2147483647);
64939 }, "java.awt.Container");
64940 Clazz_overrideMethod (c$, "getLayoutAlignmentX", 
64941 function (parent) {
64942 return 0.5;
64943 }, "java.awt.Container");
64944 Clazz_overrideMethod (c$, "getLayoutAlignmentY", 
64945 function (parent) {
64946 return 0.5;
64947 }, "java.awt.Container");
64948 Clazz_overrideMethod (c$, "invalidateLayout", 
64949 function (target) {
64950 }, "java.awt.Container");
64951 Clazz_overrideMethod (c$, "layoutContainer", 
64952 function (parent) {
64953 {
64954 var insets = parent.getInsets ();
64955 var ncomponents = parent.getComponentCount ();
64956 var comp = null;
64957 var currentFound = false;
64958 for (var i = 0; i < ncomponents; i++) {
64959 comp = parent.getComponent (i);
64960 comp.setBounds (this.hgap + insets.left, this.vgap + insets.top, parent.width - (this.hgap * 2 + insets.left + insets.right), parent.height - (this.vgap * 2 + insets.top + insets.bottom));
64961 if (comp.isVisible ()) {
64962 currentFound = true;
64963 }}
64964 if (!currentFound && ncomponents > 0) {
64965 parent.getComponent (0).setVisible (true);
64966 }}}, "java.awt.Container");
64967 Clazz_defineMethod (c$, "checkLayout", 
64968 function (parent) {
64969 if (parent.getLayout () !== this) {
64970 throw  new IllegalArgumentException ("wrong parent for CardLayout");
64971 }}, "java.awt.Container");
64972 Clazz_defineMethod (c$, "first", 
64973 function (parent) {
64974 {
64975 this.checkLayout (parent);
64976 var ncomponents = parent.getComponentCount ();
64977 for (var i = 0; i < ncomponents; i++) {
64978 var comp = parent.getComponent (i);
64979 if (comp.isVisible ()) {
64980 comp.setVisible (false);
64981 break;
64982 }}
64983 if (ncomponents > 0) {
64984 this.currentCard = 0;
64985 parent.getComponent (0).setVisible (true);
64986 parent.validate ();
64987 }}}, "java.awt.Container");
64988 Clazz_defineMethod (c$, "next", 
64989 function (parent) {
64990 {
64991 this.checkLayout (parent);
64992 var ncomponents = parent.getComponentCount ();
64993 for (var i = 0; i < ncomponents; i++) {
64994 var comp = parent.getComponent (i);
64995 if (comp.isVisible ()) {
64996 comp.setVisible (false);
64997 this.currentCard = (i + 1) % ncomponents;
64998 comp = parent.getComponent (this.currentCard);
64999 comp.setVisible (true);
65000 parent.validate ();
65001 return;
65002 }}
65003 this.showDefaultComponent (parent);
65004 }}, "java.awt.Container");
65005 Clazz_defineMethod (c$, "previous", 
65006 function (parent) {
65007 {
65008 this.checkLayout (parent);
65009 var ncomponents = parent.getComponentCount ();
65010 for (var i = 0; i < ncomponents; i++) {
65011 var comp = parent.getComponent (i);
65012 if (comp.isVisible ()) {
65013 comp.setVisible (false);
65014 this.currentCard = ((i > 0) ? i - 1 : ncomponents - 1);
65015 comp = parent.getComponent (this.currentCard);
65016 comp.setVisible (true);
65017 parent.validate ();
65018 return;
65019 }}
65020 this.showDefaultComponent (parent);
65021 }}, "java.awt.Container");
65022 Clazz_defineMethod (c$, "showDefaultComponent", 
65023 function (parent) {
65024 if (parent.getComponentCount () > 0) {
65025 this.currentCard = 0;
65026 parent.getComponent (0).setVisible (true);
65027 parent.validate ();
65028 }}, "java.awt.Container");
65029 Clazz_defineMethod (c$, "last", 
65030 function (parent) {
65031 {
65032 this.checkLayout (parent);
65033 var ncomponents = parent.getComponentCount ();
65034 for (var i = 0; i < ncomponents; i++) {
65035 var comp = parent.getComponent (i);
65036 if (comp.isVisible ()) {
65037 comp.setVisible (false);
65038 break;
65039 }}
65040 if (ncomponents > 0) {
65041 this.currentCard = ncomponents - 1;
65042 parent.getComponent (this.currentCard).setVisible (true);
65043 parent.validate ();
65044 }}}, "java.awt.Container");
65045 Clazz_defineMethod (c$, "show", 
65046 function (parent, name) {
65047 {
65048 this.checkLayout (parent);
65049 var next = null;
65050 var ncomponents = this.vector.size ();
65051 for (var i = 0; i < ncomponents; i++) {
65052 var card = this.vector.get (i);
65053 if (card.name.equals (name)) {
65054 next = card.comp;
65055 this.currentCard = i;
65056 break;
65057 }}
65058 if ((next != null) && !next.isVisible ()) {
65059 ncomponents = parent.getComponentCount ();
65060 for (var i = 0; i < ncomponents; i++) {
65061 var comp = parent.getComponent (i);
65062 if (comp.isVisible ()) {
65063 comp.setVisible (false);
65064 break;
65065 }}
65066 next.setVisible (true);
65067 parent.validate ();
65068 }}}, "java.awt.Container,~S");
65069 Clazz_overrideMethod (c$, "toString", 
65070 function () {
65071 return this.getClass ().getName () + "[hgap=" + this.hgap + ",vgap=" + this.vgap + "]";
65072 });
65073 c$.$CardLayout$Card$ = function () {
65074 Clazz_pu$h(self.c$);
65075 c$ = Clazz_decorateAsClass (function () {
65076 Clazz_prepareCallback (this, arguments);
65077 this.name = null;
65078 this.comp = null;
65079 Clazz_instantialize (this, arguments);
65080 }, java.awt.CardLayout, "Card", null, java.io.Serializable);
65081 Clazz_makeConstructor (c$, 
65082 function (a, b) {
65083 this.name = a;
65084 this.comp = b;
65085 }, "~S,java.awt.Component");
65086 c$ = Clazz_p0p ();
65087 };
65088 c$.serialPersistentFields = c$.prototype.serialPersistentFields =  Clazz_newArray (-1, [ new java.io.ObjectStreamField ("tab", java.util.Hashtable),  new java.io.ObjectStreamField ("hgap", Integer.TYPE),  new java.io.ObjectStreamField ("vgap", Integer.TYPE),  new java.io.ObjectStreamField ("vector", java.util.Vector),  new java.io.ObjectStreamField ("currentCard", Integer.TYPE)]);
65089 });
65090 Clazz_load(null,"java.io.ObjectStreamField",["java.lang.Boolean","$.Byte","$.Character","$.Double","$.Float","$.Long","$.NullPointerException","$.Short","java.util.Arrays"],function(){
65091 c$=Clazz_decorateAsClass(function(){
65092 this.name=null;
65093 this.type=null;
65094 this.offset=0;
65095 this.typeString=null;
65096 this.unshared=false;
65097 this.isDeserialized=false;
65098 Clazz_instantialize(this,arguments);
65099 },java.io,"ObjectStreamField",null,Comparable);
65100 Clazz_makeConstructor(c$,
65101 function(name,cl){
65102 if(name==null||cl==null){
65103 throw new NullPointerException();
65104 }this.name=name;
65105 this.type=cl;
65106 },"~S,Class");
65107 Clazz_makeConstructor(c$,
65108 function(name,cl,unshared){
65109 if(name==null||cl==null){
65110 throw new NullPointerException();
65111 }this.name=name;
65112 this.type=cl;
65113 this.unshared=unshared;
65114 },"~S,Class,~B");
65115 Clazz_makeConstructor(c$,
65116 function(signature,name){
65117 if(name==null){
65118 throw new NullPointerException();
65119 }this.name=name;
65120 this.typeString=signature.$replace('.', '/');
65121 this.isDeserialized=true;
65122 },"~S,~S");
65123 Clazz_overrideMethod(c$,"compareTo",
65124 function(o){
65125 var f=o;
65126 var thisPrimitive=this.isPrimitive();
65127 var fPrimitive=f.isPrimitive();
65128 if(thisPrimitive!=fPrimitive){
65129 return thisPrimitive?-1:1;
65130 }return this.getName().compareTo(f.getName());
65131 },"~O");
65132 Clazz_overrideMethod(c$,"equals",
65133 function(arg0){
65134 return this.compareTo(arg0)==0;
65135 },"~O");
65136 Clazz_overrideMethod(c$,"hashCode",
65137 function(){
65138 return this.getName().hashCode();
65139 });
65140 Clazz_defineMethod(c$,"getName",
65141 function(){
65142 return this.name;
65143 });
65144 Clazz_defineMethod(c$,"getOffset",
65145 function(){
65146 return this.offset;
65147 });
65148 Clazz_defineMethod(c$,"getTypeInternal",
65149 ($fz=function(){
65150 return this.type;
65151 },$fz.isPrivate=true,$fz));
65152 Clazz_defineMethod(c$,"getType",
65153 function(){
65154 var cl=this.getTypeInternal();
65155 if(this.isDeserialized&&!cl.isPrimitive()){
65156 return Clazz._O;
65157 }return cl;
65158 });
65159 Clazz_defineMethod(c$,"getTypeCode",
65160 function(){
65161 var t=this.getTypeInternal();
65162 if(t===Integer.TYPE){
65163 return'I';
65164 }if(t===Byte.TYPE){
65165 return'B';
65166 }if(t===Character.TYPE){
65167 return'C';
65168 }if(t===Short.TYPE){
65169 return'S';
65170 }if(t===Boolean.TYPE){
65171 return'Z';
65172 }if(t===Long.TYPE){
65173 return'J';
65174 }if(t===Float.TYPE){
65175 return'F';
65176 }if(t===Double.TYPE){
65177 return'D';
65178 }if(t.isArray()){
65179 return'[';
65180 }return'L';
65181 });
65182 Clazz_defineMethod(c$,"getTypeString",
65183 function(){
65184 if(this.isPrimitive()){
65185 return null;
65186 }if(this.typeString==null){
65187 var t=this.getTypeInternal();
65188 var typeName=t.getName().$replace('.', '/');
65189 var str=(t.isArray())?typeName:("L"+typeName+';');
65190 this.typeString=str.intern();
65191 }return this.typeString;
65192 });
65193 Clazz_defineMethod(c$,"isPrimitive",
65194 function(){
65195 var t=this.getTypeInternal();
65196 return t!=null&&t.isPrimitive();
65197 });
65198 Clazz_defineMethod(c$,"setOffset",
65199 function(newValue){
65200 this.offset=newValue;
65201 },"~N");
65202 Clazz_overrideMethod(c$,"toString",
65203 function(){
65204 return this.getClass().getName()+'(' + this.getName () + ':' + this.getTypeInternal () + ')';
65205 });
65206 c$.sortFields=Clazz_defineMethod(c$,"sortFields",
65207 function(fields){
65208 if(fields.length>1){
65209 var fieldDescComparator=((Clazz_isClassDefined("java.io.ObjectStreamField$1")?0:java.io.ObjectStreamField.$ObjectStreamField$1$()),Clazz_innerTypeInstance(java.io.ObjectStreamField$1,this,null));
65210 java.util.Arrays.sort(fields,fieldDescComparator);
65211 }},"~A");
65212 Clazz_defineMethod(c$,"resolve",
65213 function(loader){
65214 if(this.typeString.length==1){
65215 switch(this.typeString.charAt(0)){
65216 case'I':
65217 this.type=Integer.TYPE;
65218 return;
65219 case'B':
65220 this.type=Byte.TYPE;
65221 return;
65222 case'C':
65223 this.type=Character.TYPE;
65224 return;
65225 case'S':
65226 this.type=Short.TYPE;
65227 return;
65228 case'Z':
65229 this.type=Boolean.TYPE;
65230 return;
65231 case'J':
65232 this.type=Long.TYPE;
65233 return;
65234 case'F':
65235 this.type=Float.TYPE;
65236 return;
65237 case'D':
65238 this.type=Double.TYPE;
65239 return;
65240 }
65241 }var className=this.typeString.$replace('/', '.');
65242 if((className.charAt(0)).charCodeAt(0)==('L').charCodeAt(0)){
65243 className=className.substring(1,className.length-1);
65244 }try{
65245 var cl=Clazz._4Name(className,false,loader);
65246 this.type=cl;
65247 }catch(e){
65248 if(Clazz_instanceOf(e,ClassNotFoundException)){
65249 }else{
65250 throw e;
65251 }
65252 }
65253 },"ClassLoader");
65254 Clazz_defineMethod(c$,"isUnshared",
65255 function(){
65256 return this.unshared;
65257 });
65258 c$.$ObjectStreamField$1$=function(){
65259 Clazz_pu$h(self.c$);
65260 c$=Clazz_declareAnonymous(java.io,"ObjectStreamField$1",null,java.util.Comparator);
65261 Clazz_overrideMethod(c$,"compare",
65262 function(f1,f2){
65263 return f1.compareTo(f2);
65264 },"java.io.ObjectStreamField,java.io.ObjectStreamField");
65265 c$=Clazz_p0p();
65266 };
65267 });
65268 Clazz_declarePackage ("jalview.appletgui");
65269 Clazz_load (["awt2swing.Panel", "java.awt.event.ActionListener", "awt2swing.Button", "$.Checkbox", "$.Label", "$.TextField", "java.awt.GridLayout"], "jalview.appletgui.Finder", ["awt2swing.Frame", "jalview.analysis.Finder", "jalview.bin.JalviewLite", "jalview.datamodel.SequenceFeature", "jalview.util.MessageManager", "java.awt.Font", "$.Rectangle", "java.awt.event.KeyAdapter", "$.WindowAdapter"], function () {
65270 c$ = Clazz_decorateAsClass (function () {
65271 this.av = null;
65272 this.ap = null;
65273 this.frame = null;
65274 this.searchResults = null;
65275 this.seqIndex = 0;
65276 this.resIndex = -1;
65277 this.jLabel1 = null;
65278 this.textfield = null;
65279 this.findAll = null;
65280 this.findNext = null;
65281 this.actionsPanel = null;
65282 this.gridLayout1 = null;
65283 this.createNewGroup = null;
65284 this.caseSensitive = null;
65285 this.searchDescription = null;
65286 Clazz_instantialize (this, arguments);
65287 }, jalview.appletgui, "Finder", awt2swing.Panel, java.awt.event.ActionListener);
65288 Clazz_prepareFields (c$, function () {
65289 this.jLabel1 =  new awt2swing.Label ();
65290 this.textfield =  new awt2swing.TextField ();
65291 this.findAll =  new awt2swing.Button ();
65292 this.findNext =  new awt2swing.Button ();
65293 this.actionsPanel =  new awt2swing.Panel ();
65294 this.gridLayout1 =  new java.awt.GridLayout ();
65295 this.createNewGroup =  new awt2swing.Button ();
65296 this.caseSensitive =  new awt2swing.Checkbox ();
65297 this.searchDescription =  new awt2swing.Checkbox ();
65298 });
65299 Clazz_makeConstructor (c$, 
65300 function (ap) {
65301 Clazz_superConstructor (this, jalview.appletgui.Finder, []);
65302 try {
65303 this.jbInit ();
65304 } catch (e) {
65305 if (Clazz_exceptionOf (e, Exception)) {
65306 e.printStackTrace ();
65307 } else {
65308 throw e;
65309 }
65310 }
65311 this.av = ap.av;
65312 this.ap = ap;
65313 this.frame =  new awt2swing.Frame ();
65314 this.frame.add (this);
65315 jalview.bin.JalviewLite.addFrame (this.frame, jalview.util.MessageManager.getString ("action.find"), 340, 120);
65316 this.frame.repaint ();
65317 this.frame.addWindowListener (((Clazz_isClassDefined ("jalview.appletgui.Finder$1") ? 0 : jalview.appletgui.Finder.$Finder$1$ ()), Clazz_innerTypeInstance (jalview.appletgui.Finder$1, this, Clazz_cloneFinals ("ap", ap))));
65318 this.textfield.requestFocus ();
65319 }, "jalview.appletgui.AlignmentPanel");
65320 Clazz_overrideMethod (c$, "actionPerformed", 
65321 function (evt) {
65322 if (evt.getSource () === this.textfield) {
65323 this.doSearch (false);
65324 } else if (evt.getSource () === this.findNext) {
65325 this.doSearch (false);
65326 } else if (evt.getSource () === this.findAll) {
65327 this.resIndex = -1;
65328 this.seqIndex = 0;
65329 this.doSearch (true);
65330 } else if (evt.getSource () === this.createNewGroup) {
65331 this.createNewGroup_actionPerformed ();
65332 }}, "java.awt.event.ActionEvent");
65333 Clazz_defineMethod (c$, "createNewGroup_actionPerformed", 
65334 function () {
65335 var seqs =  new Array (this.searchResults.getSize ());
65336 var features =  new Array (this.searchResults.getSize ());
65337 for (var i = 0; i < this.searchResults.getSize (); i++) {
65338 seqs[i] = this.searchResults.getResultSequence (i);
65339 features[i] =  new jalview.datamodel.SequenceFeature (this.textfield.getText ().trim (), "Search Results", null, this.searchResults.getResultStart (i), this.searchResults.getResultEnd (i), "Search Results");
65340 }
65341 if (this.ap.seqPanel.seqCanvas.getFeatureRenderer ().amendFeatures (seqs, features, true, this.ap)) {
65342 this.ap.alignFrame.sequenceFeatures.setState (true);
65343 this.av.setShowSequenceFeatures (true);
65344 this.ap.highlightSearchResults (null);
65345 }});
65346 Clazz_defineMethod (c$, "doSearch", 
65347 function (findAll) {
65348 if (this.ap.av.applet.currentAlignFrame != null) {
65349 this.ap = this.ap.av.applet.currentAlignFrame.alignPanel;
65350 this.av = this.ap.av;
65351 }this.createNewGroup.setEnabled (false);
65352 var finder =  new jalview.analysis.Finder (this.av.getAlignment (), this.av.getSelectionGroup (), this.seqIndex, this.resIndex);
65353 finder.setCaseSensitive (this.caseSensitive.getState ());
65354 finder.setIncludeDescription (this.searchDescription.getState ());
65355 finder.setFindAll (findAll);
65356 var searchString = this.textfield.getText ();
65357 finder.find (searchString);
65358 this.seqIndex = finder.getSeqIndex ();
65359 this.resIndex = finder.getResIndex ();
65360 this.searchResults = finder.getSearchResults ();
65361 var idMatch = finder.getIdMatch ();
65362 var haveResults = false;
65363 if ((idMatch.size () > 0)) {
65364 haveResults = true;
65365 this.ap.idPanel.highlightSearchResults (idMatch);
65366 } else {
65367 this.ap.idPanel.highlightSearchResults (null);
65368 }if (this.searchResults.getSize () > 0) {
65369 haveResults = true;
65370 this.createNewGroup.setEnabled (true);
65371 } else {
65372 this.searchResults = null;
65373 }this.ap.highlightSearchResults (this.searchResults);
65374 if (!haveResults) {
65375 this.ap.alignFrame.setStatus (jalview.util.MessageManager.getString ("label.finished_searching"));
65376 this.resIndex = -1;
65377 this.seqIndex = 0;
65378 } else {
65379 if (findAll) {
65380 var message = (idMatch.size () > 0) ? "" + idMatch.size () + " IDs" : "";
65381 if (idMatch.size () > 0 && this.searchResults != null && this.searchResults.getSize () > 0) {
65382 message += " and ";
65383 }if (this.searchResults != null) {
65384 message += this.searchResults.getSize () + " subsequence matches.";
65385 }this.ap.alignFrame.setStatus (jalview.util.MessageManager.formatMessage ("label.search_results",  Clazz_newArray (-1, [searchString, message])));
65386 } else {
65387 this.ap.alignFrame.setStatus (jalview.util.MessageManager.formatMessage ("label.found_match_for",  Clazz_newArray (-1, [searchString])));
65388 }}}, "~B");
65389 Clazz_defineMethod (c$, "jbInit", 
65390  function () {
65391 this.jLabel1.setFont ( new java.awt.Font ("Verdana", 0, 12));
65392 this.jLabel1.setText (jalview.util.MessageManager.getString ("action.find"));
65393 this.jLabel1.setBounds ( new java.awt.Rectangle (3, 30, 34, 15));
65394 this.setLayout (null);
65395 this.textfield.setFont ( new java.awt.Font ("Verdana", 0, 10));
65396 this.textfield.setText ("");
65397 this.textfield.setBounds ( new java.awt.Rectangle (40, 17, 133, 21));
65398 this.textfield.addKeyListener (((Clazz_isClassDefined ("jalview.appletgui.Finder$2") ? 0 : jalview.appletgui.Finder.$Finder$2$ ()), Clazz_innerTypeInstance (jalview.appletgui.Finder$2, this, null)));
65399 this.textfield.addActionListener (this);
65400 this.findAll.setFont ( new java.awt.Font ("Verdana", 0, 10));
65401 this.findAll.setLabel (jalview.util.MessageManager.getString ("action.find_all"));
65402 this.findAll.addActionListener (this);
65403 this.findNext.setEnabled (false);
65404 this.findNext.setFont ( new java.awt.Font ("Verdana", 0, 10));
65405 this.findNext.setLabel (jalview.util.MessageManager.getString ("action.find_next"));
65406 this.findNext.addActionListener (this);
65407 this.actionsPanel.setBounds ( new java.awt.Rectangle (195, 5, 141, 64));
65408 this.actionsPanel.setLayout (this.gridLayout1);
65409 this.gridLayout1.setHgap (0);
65410 this.gridLayout1.setRows (3);
65411 this.gridLayout1.setVgap (2);
65412 this.createNewGroup.setEnabled (false);
65413 this.createNewGroup.setFont ( new java.awt.Font ("Verdana", 0, 10));
65414 this.createNewGroup.setLabel (jalview.util.MessageManager.getString ("label.new_feature"));
65415 this.createNewGroup.addActionListener (this);
65416 this.caseSensitive.setLabel (jalview.util.MessageManager.getString ("label.match_case"));
65417 this.caseSensitive.setBounds ( new java.awt.Rectangle (30, 39, 126, 23));
65418 this.searchDescription.setLabel (jalview.util.MessageManager.getString ("label.include_description"));
65419 this.searchDescription.setBounds ( new java.awt.Rectangle (30, 59, 170, 23));
65420 this.actionsPanel.add (this.findNext, null);
65421 this.actionsPanel.add (this.findAll, null);
65422 this.actionsPanel.add (this.createNewGroup, null);
65423 this.add (this.caseSensitive);
65424 this.add (this.textfield, null);
65425 this.add (this.jLabel1, null);
65426 this.add (this.actionsPanel, null);
65427 this.add (this.searchDescription);
65428 });
65429 Clazz_defineMethod (c$, "textfield_keyTyped", 
65430 function (e) {
65431 this.findNext.setEnabled (true);
65432 }, "java.awt.event.KeyEvent");
65433 c$.$Finder$1$ = function () {
65434 Clazz_pu$h(self.c$);
65435 c$ = Clazz_declareAnonymous (jalview.appletgui, "Finder$1", java.awt.event.WindowAdapter);
65436 Clazz_overrideMethod (c$, "windowClosing", 
65437 function (evt) {
65438 this.f$.ap.highlightSearchResults (null);
65439 }, "java.awt.event.WindowEvent");
65440 c$ = Clazz_p0p ();
65441 };
65442 c$.$Finder$2$ = function () {
65443 Clazz_pu$h(self.c$);
65444 c$ = Clazz_declareAnonymous (jalview.appletgui, "Finder$2", java.awt.event.KeyAdapter);
65445 Clazz_overrideMethod (c$, "keyTyped", 
65446 function (e) {
65447 this.b$["jalview.appletgui.Finder"].textfield_keyTyped (e);
65448 }, "java.awt.event.KeyEvent");
65449 c$ = Clazz_p0p ();
65450 };
65451 });
65452 Clazz_declarePackage ("jalview.analysis");
65453 Clazz_load (null, "jalview.analysis.Finder", ["jalview.datamodel.SearchResults", "jalview.jsdev.RegExp", "jalview.util.Comparison", "java.lang.StringBuffer", "java.util.Vector"], function () {
65454 c$ = Clazz_decorateAsClass (function () {
65455 this.searchResults = null;
65456 this.alignment = null;
65457 this.selection = null;
65458 this.idMatch = null;
65459 this.caseSensitive = false;
65460 this.includeDescription = false;
65461 this.findAll = false;
65462 this.regex = null;
65463 this.seqIndex = 0;
65464 this.resIndex = -1;
65465 Clazz_instantialize (this, arguments);
65466 }, jalview.analysis, "Finder");
65467 Clazz_makeConstructor (c$, 
65468 function (alignment, selection) {
65469 this.alignment = alignment;
65470 this.selection = selection;
65471 }, "jalview.datamodel.AlignmentI,jalview.datamodel.SequenceGroup");
65472 Clazz_makeConstructor (c$, 
65473 function (alignment, selectionGroup, seqIndex, resIndex) {
65474 this.construct (alignment, selectionGroup);
65475 this.seqIndex = seqIndex;
65476 this.resIndex = resIndex;
65477 }, "jalview.datamodel.AlignmentI,jalview.datamodel.SequenceGroup,~N,~N");
65478 Clazz_defineMethod (c$, "find", 
65479 function (searchString) {
65480 var hasResults = false;
65481 if (!this.caseSensitive) {
65482 searchString = searchString.toUpperCase ();
65483 }this.regex = jalview.jsdev.RegExp.newRegex ([searchString]);
65484 this.regex.setIgnoreCase (!this.caseSensitive);
65485 this.searchResults =  new jalview.datamodel.SearchResults ();
65486 this.idMatch =  new java.util.Vector ();
65487 var seq;
65488 var item = null;
65489 var found = false;
65490 var end = this.alignment.getHeight ();
65491 if (this.selection != null) {
65492 if ((this.selection.getSize () < 1) || ((this.selection.getEndRes () - this.selection.getStartRes ()) < 2)) {
65493 this.selection = null;
65494 }}while (!found && (this.seqIndex < end)) {
65495 seq = this.alignment.getSequenceAt (this.seqIndex);
65496 if ((this.selection != null && this.selection.getSize () > 0) && !this.selection.getSequences (null).contains (seq)) {
65497 this.seqIndex++;
65498 this.resIndex = -1;
65499 continue;
65500 }if (this.resIndex < 0) {
65501 this.resIndex = 0;
65502 try {
65503 var res = Integer.parseInt (searchString);
65504 if (seq.getEnd () >= res) {
65505 this.searchResults.addResult (seq, res, res);
65506 hasResults = true;
65507 if (!this.findAll) {
65508 found = true;
65509 break;
65510 }}} catch (ex) {
65511 if (Clazz_exceptionOf (ex, NumberFormatException)) {
65512 } else {
65513 throw ex;
65514 }
65515 }
65516 if (this.regex.search (seq.getName ())) {
65517 this.idMatch.addElement (seq);
65518 hasResults = true;
65519 if (!this.findAll) {
65520 found = true;
65521 break;
65522 }}if (this.isIncludeDescription () && seq.getDescription () != null && this.regex.search (seq.getDescription ())) {
65523 this.idMatch.addElement (seq);
65524 hasResults = true;
65525 if (!this.findAll) {
65526 found = true;
65527 break;
65528 }}}item = seq.getSequenceAsString ();
65529 if ((this.selection != null) && (this.selection.getEndRes () < this.alignment.getWidth () - 1)) {
65530 item = item.substring (0, this.selection.getEndRes () + 1);
65531 }var noGapsSB =  new StringBuffer ();
65532 var insertCount = 0;
65533 var spaces =  new java.util.Vector ();
65534 for (var j = 0; j < item.length; j++) {
65535 if (!jalview.util.Comparison.isGap (item.charAt (j))) {
65536 noGapsSB.append (item.charAt (j));
65537 spaces.addElement ( new Integer (insertCount));
65538 } else {
65539 insertCount++;
65540 }}
65541 var noGaps = noGapsSB.toString ();
65542 for (var r = this.resIndex; r < noGaps.length; r++) {
65543 if (this.regex.searchFrom (noGaps, r)) {
65544 this.resIndex = this.regex.matchedFrom ();
65545 if ((this.selection != null && this.selection.getSize () > 0) && ((this.resIndex + Integer.parseInt (spaces.elementAt (this.resIndex).toString ())) < this.selection.getStartRes ())) {
65546 continue;
65547 }var sres = seq.findPosition (this.resIndex + Integer.parseInt (spaces.elementAt (this.resIndex).toString ()));
65548 var eres = seq.findPosition (this.regex.matchedTo () - 1 + Integer.parseInt (spaces.elementAt (this.regex.matchedTo () - 1).toString ()));
65549 this.searchResults.addResult (seq, sres, eres);
65550 hasResults = true;
65551 if (!this.findAll) {
65552 found = true;
65553 this.resIndex++;
65554 break;
65555 }r = this.resIndex;
65556 } else {
65557 break;
65558 }}
65559 if (!found) {
65560 this.seqIndex++;
65561 this.resIndex = -1;
65562 }}
65563 return hasResults;
65564 }, "~S");
65565 Clazz_defineMethod (c$, "getAlignment", 
65566 function () {
65567 return this.alignment;
65568 });
65569 Clazz_defineMethod (c$, "setAlignment", 
65570 function (alignment) {
65571 this.alignment = alignment;
65572 }, "jalview.datamodel.AlignmentI");
65573 Clazz_defineMethod (c$, "isCaseSensitive", 
65574 function () {
65575 return this.caseSensitive;
65576 });
65577 Clazz_defineMethod (c$, "setCaseSensitive", 
65578 function (caseSensitive) {
65579 this.caseSensitive = caseSensitive;
65580 }, "~B");
65581 Clazz_defineMethod (c$, "isFindAll", 
65582 function () {
65583 return this.findAll;
65584 });
65585 Clazz_defineMethod (c$, "setFindAll", 
65586 function (findAll) {
65587 this.findAll = findAll;
65588 }, "~B");
65589 Clazz_defineMethod (c$, "getSelection", 
65590 function () {
65591 return this.selection;
65592 });
65593 Clazz_defineMethod (c$, "setSelection", 
65594 function (selection) {
65595 this.selection = selection;
65596 }, "jalview.datamodel.SequenceGroup");
65597 Clazz_defineMethod (c$, "getIdMatch", 
65598 function () {
65599 return this.idMatch;
65600 });
65601 Clazz_defineMethod (c$, "getRegex", 
65602 function () {
65603 return this.regex;
65604 });
65605 Clazz_defineMethod (c$, "getSearchResults", 
65606 function () {
65607 return this.searchResults;
65608 });
65609 Clazz_defineMethod (c$, "getResIndex", 
65610 function () {
65611 return this.resIndex;
65612 });
65613 Clazz_defineMethod (c$, "setResIndex", 
65614 function (resIndex) {
65615 this.resIndex = resIndex;
65616 }, "~N");
65617 Clazz_defineMethod (c$, "getSeqIndex", 
65618 function () {
65619 return this.seqIndex;
65620 });
65621 Clazz_defineMethod (c$, "setSeqIndex", 
65622 function (seqIndex) {
65623 this.seqIndex = seqIndex;
65624 }, "~N");
65625 Clazz_defineMethod (c$, "isIncludeDescription", 
65626 function () {
65627 return this.includeDescription;
65628 });
65629 Clazz_defineMethod (c$, "setIncludeDescription", 
65630 function (includeDescription) {
65631 this.includeDescription = includeDescription;
65632 }, "~B");
65633 });
65634 Clazz_declarePackage ("java.awt.event");
65635 Clazz_load (["java.awt.event.KeyListener"], "java.awt.event.KeyAdapter", null, function () {
65636 c$ = Clazz_declareType (java.awt.event, "KeyAdapter", null, java.awt.event.KeyListener);
65637 Clazz_overrideMethod (c$, "keyTyped", 
65638 function (e) {
65639 }, "java.awt.event.KeyEvent");
65640 Clazz_overrideMethod (c$, "keyPressed", 
65641 function (e) {
65642 }, "java.awt.event.KeyEvent");
65643 Clazz_overrideMethod (c$, "keyReleased", 
65644 function (e) {
65645 }, "java.awt.event.KeyEvent");
65646 });
65647 Clazz_declarePackage ("jalview.appletgui");
65648 Clazz_load (["awt2swing.Panel", "java.awt.event.ItemListener", "awt2swing.Button", "$.Checkbox", "$.Choice", "java.awt.Font"], "jalview.appletgui.FontChooser", ["awt2swing.Frame", "$.Label", "jalview.appletgui.JVDialog", "jalview.bin.JalviewLite", "jalview.util.MessageManager", "java.awt.BorderLayout", "$.Color", "$.FlowLayout", "$.Toolkit", "java.awt.event.ActionListener"], function () {
65649 c$ = Clazz_decorateAsClass (function () {
65650 this.fontSize = null;
65651 this.fontStyle = null;
65652 this.fontName = null;
65653 this.scaleAsCdna = null;
65654 this.ok = null;
65655 this.cancel = null;
65656 this.ap = null;
65657 this.tp = null;
65658 this.oldFont = null;
65659 this.oldCharWidth = 0;
65660 this.oldScaleProtein = false;
65661 this.lastSelected = null;
65662 this.lastSelStyle = 0;
65663 this.lastSelSize = 0;
65664 this.$init = true;
65665 this.frame = null;
65666 Clazz_instantialize (this, arguments);
65667 }, jalview.appletgui, "FontChooser", awt2swing.Panel, java.awt.event.ItemListener);
65668 Clazz_prepareFields (c$, function () {
65669 this.fontSize =  new awt2swing.Choice ();
65670 this.fontStyle =  new awt2swing.Choice ();
65671 this.fontName =  new awt2swing.Choice ();
65672 this.scaleAsCdna =  new awt2swing.Checkbox ();
65673 this.ok =  new awt2swing.Button ();
65674 this.cancel =  new awt2swing.Button ();
65675 });
65676 Clazz_makeConstructor (c$, 
65677 function (tp) {
65678 Clazz_superConstructor (this, jalview.appletgui.FontChooser, []);
65679 try {
65680 this.jbInit ();
65681 } catch (e) {
65682 if (Clazz_exceptionOf (e, Exception)) {
65683 e.printStackTrace ();
65684 } else {
65685 throw e;
65686 }
65687 }
65688 this.tp = tp;
65689 this.oldFont = tp.getTreeFont ();
65690 this.init ();
65691 }, "jalview.appletgui.TreePanel");
65692 Clazz_makeConstructor (c$, 
65693 function (ap) {
65694 Clazz_superConstructor (this, jalview.appletgui.FontChooser, []);
65695 this.ap = ap;
65696 this.oldFont = ap.av.getFont ();
65697 this.oldCharWidth = ap.av.getViewStyle ().getCharWidth ();
65698 this.oldScaleProtein = ap.av.getViewStyle ().isScaleProteinAsCdna ();
65699 try {
65700 this.jbInit ();
65701 } catch (e) {
65702 if (Clazz_exceptionOf (e, Exception)) {
65703 e.printStackTrace ();
65704 } else {
65705 throw e;
65706 }
65707 }
65708 this.init ();
65709 }, "jalview.appletgui.AlignmentPanel");
65710 Clazz_defineMethod (c$, "init", 
65711 function () {
65712 var fonts = java.awt.Toolkit.getDefaultToolkit ().getFontList ();
65713 for (var i = 0; i < fonts.length; i++) {
65714 this.fontName.addItem (fonts[i]);
65715 }
65716 for (var i = 1; i < 31; i++) {
65717 this.fontSize.addItem (i + "");
65718 }
65719 this.fontStyle.addItem ("plain");
65720 this.fontStyle.addItem ("bold");
65721 this.fontStyle.addItem ("italic");
65722 this.fontName.select (this.oldFont.getName ());
65723 this.fontSize.select (this.oldFont.getSize () + "");
65724 this.fontStyle.select (new Integer (this.oldFont.getStyle ()));
65725 this.frame =  new awt2swing.Frame ();
65726 this.frame.add (this);
65727 jalview.bin.JalviewLite.addFrame (this.frame, jalview.util.MessageManager.getString ("action.change_font"), 440, 115);
65728 this.$init = false;
65729 });
65730 Clazz_overrideMethod (c$, "itemStateChanged", 
65731 function (evt) {
65732 var source = evt.getSource ();
65733 if (source === this.fontName) {
65734 this.fontName_actionPerformed ();
65735 } else if (source === this.fontSize) {
65736 this.fontSize_actionPerformed ();
65737 } else if (source === this.fontStyle) {
65738 this.fontStyle_actionPerformed ();
65739 } else if (source === this.scaleAsCdna) {
65740 this.scaleAsCdna_actionPerformed ();
65741 }}, "java.awt.event.ItemEvent");
65742 Clazz_defineMethod (c$, "ok_actionPerformed", 
65743 function () {
65744 this.frame.setVisible (false);
65745 if (this.ap != null) {
65746 if (this.ap.getOverviewPanel () != null) {
65747 this.ap.getOverviewPanel ().updateOverviewImage ();
65748 }}});
65749 Clazz_defineMethod (c$, "cancel_actionPerformed", 
65750 function () {
65751 if (this.ap != null) {
65752 this.ap.av.setScaleProteinAsCdna (this.oldScaleProtein);
65753 if (this.ap.av.getCodingComplement () != null) {
65754 this.ap.av.getCodingComplement ().setScaleProteinAsCdna (this.oldScaleProtein);
65755 this.ap.alignFrame.getSplitFrame ().repaint ();
65756 }this.ap.av.setFont (this.oldFont);
65757 var style = this.ap.av.getViewStyle ();
65758 if (style.getCharWidth () != this.oldCharWidth) {
65759 style.setCharWidth (this.oldCharWidth);
65760 this.ap.av.setViewStyle (style);
65761 }this.ap.paintAlignment (true);
65762 } else if (this.tp != null) {
65763 this.tp.setTreeFont (this.oldFont);
65764 this.tp.treeCanvas.repaint ();
65765 }this.fontName.select (this.oldFont.getName ());
65766 this.fontSize.select (this.oldFont.getSize () + "");
65767 this.fontStyle.select (new Integer (this.oldFont.getStyle ()));
65768 this.frame.setVisible (false);
65769 });
65770 Clazz_defineMethod (c$, "changeFont", 
65771 function () {
65772 if (this.lastSelected == null) {
65773 this.lastSelected = this.oldFont;
65774 this.lastSelSize = this.oldFont.getSize ();
65775 this.lastSelStyle = this.oldFont.getStyle ();
65776 }var newFont =  new java.awt.Font (this.fontName.getSelectedItem ().toString (), this.fontStyle.getSelectedIndex (), Integer.parseInt (this.fontSize.getSelectedItem ().toString ()));
65777 var fm = this.getGraphics ().getFontMetrics (newFont);
65778 var mw = fm.getStringBounds ("M", this.getGraphics ()).getWidth ();
65779 var iw = fm.getStringBounds ("I", this.getGraphics ()).getWidth ();
65780 if (mw < 1 || iw < 1) {
65781 this.fontName.select (this.lastSelected.getName ());
65782 this.fontStyle.select (new Integer (this.lastSelStyle));
65783 this.fontSize.select ("" + this.lastSelSize);
65784 var d =  new jalview.appletgui.JVDialog (this.frame, jalview.util.MessageManager.getString ("label.invalid_font"), true, 350, 200);
65785 var mp =  new awt2swing.Panel ();
65786 d.cancel.setVisible (false);
65787 mp.setLayout ( new java.awt.FlowLayout ());
65788 mp.add ( new awt2swing.Label ("Font doesn't have letters defined\nso cannot be used\nwith alignment data."));
65789 d.setMainPanel (mp);
65790 d.setVisible (true);
65791 return;
65792 }if (this.tp != null) {
65793 this.tp.setTreeFont (newFont);
65794 } else if (this.ap != null) {
65795 this.ap.av.setFont (newFont);
65796 this.ap.fontChanged ();
65797 }this.lastSelected = newFont;
65798 });
65799 Clazz_defineMethod (c$, "fontName_actionPerformed", 
65800 function () {
65801 if (this.$init) {
65802 return;
65803 }this.changeFont ();
65804 });
65805 Clazz_defineMethod (c$, "fontSize_actionPerformed", 
65806 function () {
65807 if (this.$init) {
65808 return;
65809 }this.changeFont ();
65810 });
65811 Clazz_defineMethod (c$, "fontStyle_actionPerformed", 
65812 function () {
65813 if (this.$init) {
65814 return;
65815 }this.changeFont ();
65816 });
65817 Clazz_defineMethod (c$, "jbInit", 
65818  function () {
65819 this.setLayout ( new java.awt.BorderLayout ());
65820 this.setBackground (java.awt.Color.white);
65821 var fontLabel =  new awt2swing.Label (jalview.util.MessageManager.getString ("label.font"));
65822 fontLabel.setFont (jalview.appletgui.FontChooser.VERDANA_11PT);
65823 fontLabel.setAlignment (4);
65824 this.fontSize.setFont (jalview.appletgui.FontChooser.VERDANA_11PT);
65825 this.fontSize.addItemListener (this);
65826 this.fontStyle.setFont (jalview.appletgui.FontChooser.VERDANA_11PT);
65827 this.fontStyle.addItemListener (this);
65828 var sizeLabel =  new awt2swing.Label (jalview.util.MessageManager.getString ("label.size"));
65829 sizeLabel.setAlignment (4);
65830 sizeLabel.setFont (jalview.appletgui.FontChooser.VERDANA_11PT);
65831 var styleLabel =  new awt2swing.Label (jalview.util.MessageManager.getString ("label.style"));
65832 styleLabel.setAlignment (4);
65833 styleLabel.setFont (jalview.appletgui.FontChooser.VERDANA_11PT);
65834 this.fontName.setFont (jalview.appletgui.FontChooser.VERDANA_11PT);
65835 this.fontName.addItemListener (this);
65836 this.scaleAsCdna.setLabel (jalview.util.MessageManager.getString ("label.scale_as_cdna"));
65837 this.scaleAsCdna.setFont (jalview.appletgui.FontChooser.VERDANA_11PT);
65838 this.scaleAsCdna.addItemListener (this);
65839 this.scaleAsCdna.setState (this.ap.av.isScaleProteinAsCdna ());
65840 this.ok.setFont (jalview.appletgui.FontChooser.VERDANA_11PT);
65841 this.ok.setLabel (jalview.util.MessageManager.getString ("action.ok"));
65842 this.ok.addActionListener (((Clazz_isClassDefined ("jalview.appletgui.FontChooser$1") ? 0 : jalview.appletgui.FontChooser.$FontChooser$1$ ()), Clazz_innerTypeInstance (jalview.appletgui.FontChooser$1, this, null)));
65843 this.cancel.setFont (jalview.appletgui.FontChooser.VERDANA_11PT);
65844 this.cancel.setLabel (jalview.util.MessageManager.getString ("action.cancel"));
65845 this.cancel.addActionListener (((Clazz_isClassDefined ("jalview.appletgui.FontChooser$2") ? 0 : jalview.appletgui.FontChooser.$FontChooser$2$ ()), Clazz_innerTypeInstance (jalview.appletgui.FontChooser$2, this, null)));
65846 var fontPanel =  new awt2swing.Panel ();
65847 fontPanel.setLayout ( new java.awt.BorderLayout ());
65848 var stylePanel =  new awt2swing.Panel ();
65849 stylePanel.setLayout ( new java.awt.BorderLayout ());
65850 var sizePanel =  new awt2swing.Panel ();
65851 sizePanel.setLayout ( new java.awt.BorderLayout ());
65852 var scalePanel =  new awt2swing.Panel ();
65853 scalePanel.setLayout ( new java.awt.BorderLayout ());
65854 var okCancelPanel =  new awt2swing.Panel ();
65855 var optionsPanel =  new awt2swing.Panel ();
65856 fontPanel.setBackground (java.awt.Color.white);
65857 stylePanel.setBackground (java.awt.Color.white);
65858 sizePanel.setBackground (java.awt.Color.white);
65859 okCancelPanel.setBackground (java.awt.Color.white);
65860 optionsPanel.setBackground (java.awt.Color.white);
65861 fontPanel.add (fontLabel, "West");
65862 fontPanel.add (this.fontName, "Center");
65863 stylePanel.add (styleLabel, "West");
65864 stylePanel.add (this.fontStyle, "Center");
65865 sizePanel.add (sizeLabel, "West");
65866 sizePanel.add (this.fontSize, "Center");
65867 scalePanel.add (this.scaleAsCdna, "Center");
65868 okCancelPanel.add (this.ok, null);
65869 okCancelPanel.add (this.cancel, null);
65870 optionsPanel.add (fontPanel, null);
65871 optionsPanel.add (sizePanel, null);
65872 optionsPanel.add (stylePanel, null);
65873 this.add (optionsPanel, "North");
65874 if (this.ap.alignFrame.getSplitFrame () != null) {
65875 this.add (scalePanel, "Center");
65876 }this.add (okCancelPanel, "South");
65877 });
65878 Clazz_defineMethod (c$, "scaleAsCdna_actionPerformed", 
65879 function () {
65880 this.ap.av.setScaleProteinAsCdna (this.scaleAsCdna.getState ());
65881 this.ap.av.getCodingComplement ().setScaleProteinAsCdna (this.scaleAsCdna.getState ());
65882 this.ap.alignFrame.getSplitFrame ().adjustLayout ();
65883 this.ap.paintAlignment (true);
65884 this.ap.alignFrame.getSplitFrame ().repaint ();
65885 });
65886 c$.$FontChooser$1$ = function () {
65887 Clazz_pu$h(self.c$);
65888 c$ = Clazz_declareAnonymous (jalview.appletgui, "FontChooser$1", null, java.awt.event.ActionListener);
65889 Clazz_overrideMethod (c$, "actionPerformed", 
65890 function (e) {
65891 this.b$["jalview.appletgui.FontChooser"].ok_actionPerformed ();
65892 }, "java.awt.event.ActionEvent");
65893 c$ = Clazz_p0p ();
65894 };
65895 c$.$FontChooser$2$ = function () {
65896 Clazz_pu$h(self.c$);
65897 c$ = Clazz_declareAnonymous (jalview.appletgui, "FontChooser$2", null, java.awt.event.ActionListener);
65898 Clazz_overrideMethod (c$, "actionPerformed", 
65899 function (e) {
65900 this.b$["jalview.appletgui.FontChooser"].cancel_actionPerformed ();
65901 }, "java.awt.event.ActionEvent");
65902 c$ = Clazz_p0p ();
65903 };
65904 c$.VERDANA_11PT = c$.prototype.VERDANA_11PT =  new java.awt.Font ("Verdana", 0, 11);
65905 });
65906 Clazz_declarePackage ("jalview.appletgui");
65907 Clazz_load (["awt2swing.Panel", "java.awt.event.MouseListener", "$.MouseMotionListener"], "jalview.appletgui.OverviewPanel", ["awt2swing.Frame", "jalview.appletgui.FeatureRenderer", "$.SequenceRenderer", "java.awt.Color", "$.Dimension", "java.awt.event.ComponentAdapter", "java.lang.Thread"], function () {
65908 c$ = Clazz_decorateAsClass (function () {
65909 this.miniMe = null;
65910 this.offscreen = null;
65911 this.av = null;
65912 this.ap = null;
65913 this.scalew = 1;
65914 this.scaleh = 1;
65915 this.$width = 0;
65916 this.sequencesHeight = 0;
65917 this.graphHeight = 20;
65918 this.boxX = -1;
65919 this.boxY = -1;
65920 this.boxWidth = -1;
65921 this.boxHeight = -1;
65922 this.resizing = false;
65923 this.sr = null;
65924 this.fr = null;
65925 this.nullFrame = null;
65926 this.resizeAgain = false;
65927 Clazz_instantialize (this, arguments);
65928 }, jalview.appletgui, "OverviewPanel", awt2swing.Panel, [Runnable, java.awt.event.MouseMotionListener, java.awt.event.MouseListener]);
65929 Clazz_makeConstructor (c$, 
65930 function (ap) {
65931 Clazz_superConstructor (this, jalview.appletgui.OverviewPanel, []);
65932 this.av = ap.av;
65933 this.ap = ap;
65934 this.setLayout (null);
65935 this.nullFrame =  new awt2swing.Frame ();
65936 this.nullFrame.addNotify ();
65937 this.sr =  new jalview.appletgui.SequenceRenderer (this.av);
65938 this.sr.graphics = this.nullFrame.getGraphics ();
65939 this.sr.renderGaps = false;
65940 this.sr.forOverview = true;
65941 this.fr =  new jalview.appletgui.FeatureRenderer (this.av);
65942 var initialScale = this.av.getAlignment ().getWidth () / this.av.getAlignment ().getHeight ();
65943 if (this.av.getSequenceConsensusHash () == null) {
65944 this.graphHeight = 0;
65945 }if (this.av.getAlignment ().getWidth () > this.av.getAlignment ().getHeight ()) {
65946 this.$width = 400;
65947 this.sequencesHeight = Clazz_floatToInt (400 / initialScale);
65948 if (this.sequencesHeight < 40) {
65949 this.sequencesHeight = 40;
65950 }} else {
65951 this.$width = Clazz_floatToInt (400 * initialScale);
65952 this.sequencesHeight = 300;
65953 if (this.$width < 120) {
65954 this.$width = 120;
65955 }}this.setSize ( new java.awt.Dimension (this.$width, this.sequencesHeight + this.graphHeight));
65956 this.addComponentListener (((Clazz_isClassDefined ("jalview.appletgui.OverviewPanel$1") ? 0 : jalview.appletgui.OverviewPanel.$OverviewPanel$1$ ()), Clazz_innerTypeInstance (jalview.appletgui.OverviewPanel$1, this, null)));
65957 this.addMouseMotionListener (this);
65958 this.addMouseListener (this);
65959 this.updateOverviewImage ();
65960 }, "jalview.appletgui.AlignmentPanel");
65961 Clazz_overrideMethod (c$, "mouseEntered", 
65962 function (evt) {
65963 }, "java.awt.event.MouseEvent");
65964 Clazz_overrideMethod (c$, "mouseExited", 
65965 function (evt) {
65966 }, "java.awt.event.MouseEvent");
65967 Clazz_overrideMethod (c$, "mouseClicked", 
65968 function (evt) {
65969 }, "java.awt.event.MouseEvent");
65970 Clazz_overrideMethod (c$, "mouseMoved", 
65971 function (evt) {
65972 }, "java.awt.event.MouseEvent");
65973 Clazz_overrideMethod (c$, "mousePressed", 
65974 function (evt) {
65975 this.boxX = evt.getX ();
65976 this.boxY = evt.getY ();
65977 this.checkValid ();
65978 }, "java.awt.event.MouseEvent");
65979 Clazz_overrideMethod (c$, "mouseReleased", 
65980 function (evt) {
65981 this.boxX = evt.getX ();
65982 this.boxY = evt.getY ();
65983 this.checkValid ();
65984 }, "java.awt.event.MouseEvent");
65985 Clazz_overrideMethod (c$, "mouseDragged", 
65986 function (evt) {
65987 this.boxX = evt.getX ();
65988 this.boxY = evt.getY ();
65989 this.checkValid ();
65990 }, "java.awt.event.MouseEvent");
65991 Clazz_defineMethod (c$, "checkValid", 
65992 function () {
65993 if (this.boxY < 0) {
65994 this.boxY = 0;
65995 }if (this.boxY > (this.sequencesHeight - this.boxHeight)) {
65996 this.boxY = this.sequencesHeight - this.boxHeight + 1;
65997 }if (this.boxX < 0) {
65998 this.boxX = 0;
65999 }if (this.boxX > (this.$width - this.boxWidth)) {
66000 if (this.av.hasHiddenColumns ()) {
66001 this.boxWidth = Clazz_floatToInt ((this.av.endRes - this.av.startRes + 1) * this.av.getCharWidth () * this.scalew);
66002 }this.boxX = this.$width - this.boxWidth;
66003 }var col = Clazz_floatToInt (this.boxX / this.scalew / this.av.getCharWidth ());
66004 var row = Clazz_floatToInt (this.boxY / this.scaleh / this.av.getCharHeight ());
66005 if (this.av.hasHiddenColumns ()) {
66006 if (!this.av.getColumnSelection ().isVisible (col)) {
66007 return;
66008 }col = this.av.getColumnSelection ().findColumnPosition (col);
66009 }if (this.av.hasHiddenRows ()) {
66010 row = this.av.getAlignment ().getHiddenSequences ().findIndexWithoutHiddenSeqs (row);
66011 }this.ap.setScrollValues (col, row);
66012 this.ap.paintAlignment (false);
66013 });
66014 Clazz_defineMethod (c$, "updateOverviewImage", 
66015 function () {
66016 if (this.resizing) {
66017 this.resizeAgain = true;
66018 return;
66019 }if (this.av.isShowSequenceFeatures ()) {
66020 this.fr.transferSettings (this.ap.seqPanel.seqCanvas.fr);
66021 }this.resizing = true;
66022 if ((this.getSize ().width > 0) && (this.getSize ().height > 0)) {
66023 this.$width = this.getSize ().width;
66024 this.sequencesHeight = this.getSize ().height - this.graphHeight;
66025 }this.setSize ( new java.awt.Dimension (this.$width, this.sequencesHeight + this.graphHeight));
66026 var thread =  new Thread (this);
66027 thread.start ();
66028 this.repaint ();
66029 });
66030 Clazz_overrideMethod (c$, "run", 
66031 function () {
66032 this.miniMe = null;
66033 var alwidth = this.av.getAlignment ().getWidth ();
66034 var alheight = this.av.getAlignment ().getHeight ();
66035 if (this.av.isShowSequenceFeatures ()) {
66036 this.fr.transferSettings (this.ap.seqPanel.seqCanvas.getFeatureRenderer ());
66037 }if (this.getSize ().width > 0 && this.getSize ().height > 0) {
66038 this.$width = this.getSize ().width;
66039 this.sequencesHeight = this.getSize ().height - this.graphHeight;
66040 }this.setSize ( new java.awt.Dimension (this.$width, this.sequencesHeight + this.graphHeight));
66041 var fullsizeWidth = alwidth * this.av.getCharWidth ();
66042 var fullsizeHeight = alheight * this.av.getCharHeight ();
66043 this.scalew = this.$width / fullsizeWidth;
66044 this.scaleh = this.sequencesHeight / fullsizeHeight;
66045 this.miniMe = this.nullFrame.createImage (this.$width, this.sequencesHeight + this.graphHeight);
66046 this.offscreen = this.nullFrame.createImage (this.$width, this.sequencesHeight + this.graphHeight);
66047 var mg = this.miniMe.getGraphics ();
66048 var sampleCol = alwidth / this.$width;
66049 var sampleRow = alheight / this.sequencesHeight;
66050 var lastcol = 0;
66051 var lastrow = 0;
66052 var xstart = 0;
66053 var ystart = 0;
66054 var color = java.awt.Color.yellow;
66055 var row;
66056 var col;
66057 var sameRow = 0;
66058 var sameCol = 0;
66059 var seq;
66060 var hasHiddenRows = this.av.hasHiddenRows ();
66061 var hasHiddenCols = this.av.hasHiddenColumns ();
66062 var hiddenRow = false;
66063 var alignment = this.av.getAlignment ();
66064 for (row = 0; row <= this.sequencesHeight; row++) {
66065 if (Clazz_floatToInt (row * sampleRow) == lastrow) {
66066 sameRow++;
66067 continue;
66068 }hiddenRow = false;
66069 if (hasHiddenRows) {
66070 seq = alignment.getHiddenSequences ().getHiddenSequence (lastrow);
66071 if (seq == null) {
66072 var index = alignment.getHiddenSequences ().findIndexWithoutHiddenSeqs (lastrow);
66073 seq = alignment.getSequenceAt (index);
66074 } else {
66075 hiddenRow = true;
66076 }} else {
66077 seq = alignment.getSequenceAt (lastrow);
66078 }for (col = 0; col < this.$width; col++) {
66079 if (Clazz_floatToInt (col * sampleCol) == lastcol && Clazz_floatToInt (row * sampleRow) == lastrow) {
66080 sameCol++;
66081 continue;
66082 }lastcol = Clazz_floatToInt (col * sampleCol);
66083 if (seq.getLength () > lastcol) {
66084 color = this.sr.getResidueBoxColour (seq, lastcol);
66085 if (this.av.isShowSequenceFeatures ()) {
66086 color = this.fr.findFeatureColour (color, seq, lastcol);
66087 }} else {
66088 color = java.awt.Color.white;
66089 }if (hiddenRow || (hasHiddenCols && !this.av.getColumnSelection ().isVisible (lastcol))) {
66090 color = color.darker ().darker ();
66091 }mg.setColor (color);
66092 if (sameCol == 1 && sameRow == 1) {
66093 mg.drawLine (xstart, ystart, xstart, ystart);
66094 } else {
66095 mg.fillRect (xstart, ystart, sameCol, sameRow);
66096 }xstart = col;
66097 sameCol = 1;
66098 }
66099 lastrow = Clazz_floatToInt (row * sampleRow);
66100 ystart = row;
66101 sameRow = 1;
66102 }
66103 if (this.av.getAlignmentConservationAnnotation () != null) {
66104 for (col = 0; col < this.$width; col++) {
66105 lastcol = Clazz_floatToInt (col * sampleCol);
66106 {
66107 mg.translate (col, this.sequencesHeight);
66108 this.ap.annotationPanel.renderer.drawGraph (mg, this.av.getAlignmentConservationAnnotation (), this.av.getAlignmentConservationAnnotation ().annotations, Clazz_floatToInt (sampleCol) + 1, this.graphHeight, Clazz_floatToInt (col * sampleCol), Clazz_floatToInt (col * sampleCol) + 1);
66109 mg.translate (-col, -this.sequencesHeight);
66110 }}
66111 }System.gc ();
66112 this.resizing = false;
66113 this.setBoxPosition ();
66114 if (this.resizeAgain) {
66115 this.resizeAgain = false;
66116 this.updateOverviewImage ();
66117 }});
66118 Clazz_defineMethod (c$, "setBoxPosition", 
66119 function () {
66120 var fullsizeWidth = this.av.getAlignment ().getWidth () * this.av.getCharWidth ();
66121 var fullsizeHeight = (this.av.getAlignment ().getHeight () + this.av.getAlignment ().getHiddenSequences ().getSize ()) * this.av.getCharHeight ();
66122 var startRes = this.av.getStartRes ();
66123 var endRes = this.av.getEndRes ();
66124 if (this.av.hasHiddenColumns ()) {
66125 startRes = this.av.getColumnSelection ().adjustForHiddenColumns (startRes);
66126 endRes = this.av.getColumnSelection ().adjustForHiddenColumns (endRes);
66127 }var startSeq = this.av.startSeq;
66128 var endSeq = this.av.endSeq;
66129 if (this.av.hasHiddenRows ()) {
66130 startSeq = this.av.getAlignment ().getHiddenSequences ().adjustForHiddenSeqs (startSeq);
66131 endSeq = this.av.getAlignment ().getHiddenSequences ().adjustForHiddenSeqs (endSeq);
66132 }this.scalew = this.$width / fullsizeWidth;
66133 this.scaleh = this.sequencesHeight / fullsizeHeight;
66134 this.boxX = Clazz_floatToInt (startRes * this.av.getCharWidth () * this.scalew);
66135 this.boxY = Clazz_floatToInt (startSeq * this.av.getCharHeight () * this.scaleh);
66136 if (this.av.hasHiddenColumns ()) {
66137 this.boxWidth = Clazz_floatToInt ((endRes - startRes + 1) * this.av.getCharWidth () * this.scalew);
66138 } else {
66139 this.boxWidth = Clazz_floatToInt ((endRes - startRes + 1) * this.av.getCharWidth () * this.scalew);
66140 }this.boxHeight = Clazz_floatToInt ((endSeq - startSeq) * this.av.getCharHeight () * this.scaleh);
66141 this.repaint ();
66142 });
66143 Clazz_overrideMethod (c$, "update", 
66144 function (g) {
66145 this.paint (g);
66146 }, "java.awt.Graphics");
66147 Clazz_overrideMethod (c$, "paintComponent", 
66148 function (g) {
66149 var og = this.offscreen.getGraphics ();
66150 if (this.miniMe != null) {
66151 og.drawImage (this.miniMe, 0, 0, this);
66152 og.setColor (java.awt.Color.red);
66153 og.drawRect (this.boxX, this.boxY, this.boxWidth, this.boxHeight);
66154 og.drawRect (this.boxX + 1, this.boxY + 1, this.boxWidth - 2, this.boxHeight - 2);
66155 g.drawImage (this.offscreen, 0, 0, this);
66156 }}, "java.awt.Graphics");
66157 c$.$OverviewPanel$1$ = function () {
66158 Clazz_pu$h(self.c$);
66159 c$ = Clazz_declareAnonymous (jalview.appletgui, "OverviewPanel$1", java.awt.event.ComponentAdapter);
66160 Clazz_overrideMethod (c$, "componentResized", 
66161 function (evt) {
66162 if (this.b$["jalview.appletgui.OverviewPanel"].getSize ().width != this.b$["jalview.appletgui.OverviewPanel"].$width || this.b$["jalview.appletgui.OverviewPanel"].getSize ().height != this.b$["jalview.appletgui.OverviewPanel"].sequencesHeight + this.b$["jalview.appletgui.OverviewPanel"].graphHeight) {
66163 this.b$["jalview.appletgui.OverviewPanel"].updateOverviewImage ();
66164 }}, "java.awt.event.ComponentEvent");
66165 c$ = Clazz_p0p ();
66166 };
66167 });
66168 Clazz_declarePackage ("jalview.appletgui");
66169 Clazz_load (["jalview.appletgui.EmbmenuFrame", "java.awt.event.ActionListener", "$.ItemListener", "awt2swing.Button", "$.CheckboxMenuItem", "$.Choice", "$.Label", "$.Menu", "$.MenuBar", "$.MenuItem", "$.Panel", "java.awt.BorderLayout", "$.FlowLayout"], "jalview.appletgui.PCAPanel", ["awt2swing.Frame", "jalview.appletgui.AlignFrame", "$.CutAndPasteTransfer", "$.RotatableCanvas", "jalview.bin.JalviewLite", "jalview.datamodel.Alignment", "jalview.util.MessageManager", "jalview.viewmodel.PCAModel", "java.awt.Color", "$.Font", "java.lang.Thread"], function () {
66170 c$ = Clazz_decorateAsClass (function () {
66171 this.rc = null;
66172 this.av = null;
66173 this.pcaModel = null;
66174 this.top = 0;
66175 this.jPanel2 = null;
66176 this.jLabel1 = null;
66177 this.jLabel2 = null;
66178 this.jLabel3 = null;
66179 this.xCombobox = null;
66180 this.yCombobox = null;
66181 this.zCombobox = null;
66182 this.resetButton = null;
66183 this.flowLayout1 = null;
66184 this.borderLayout1 = null;
66185 this.menuBar1 = null;
66186 this.menu1 = null;
66187 this.menu2 = null;
66188 this.calcSettings = null;
66189 this.labels = null;
66190 this.protSetting = null;
66191 this.nuclSetting = null;
66192 this.values = null;
66193 this.inputData = null;
66194 Clazz_instantialize (this, arguments);
66195 }, jalview.appletgui, "PCAPanel", jalview.appletgui.EmbmenuFrame, [Runnable, java.awt.event.ActionListener, java.awt.event.ItemListener]);
66196 Clazz_prepareFields (c$, function () {
66197 this.jPanel2 =  new awt2swing.Panel ();
66198 this.jLabel1 =  new awt2swing.Label ();
66199 this.jLabel2 =  new awt2swing.Label ();
66200 this.jLabel3 =  new awt2swing.Label ();
66201 this.xCombobox =  new awt2swing.Choice ();
66202 this.yCombobox =  new awt2swing.Choice ();
66203 this.zCombobox =  new awt2swing.Choice ();
66204 this.resetButton =  new awt2swing.Button ();
66205 this.flowLayout1 =  new java.awt.FlowLayout ();
66206 this.borderLayout1 =  new java.awt.BorderLayout ();
66207 this.menuBar1 =  new awt2swing.MenuBar ();
66208 this.menu1 =  new awt2swing.Menu ();
66209 this.menu2 =  new awt2swing.Menu ();
66210 this.calcSettings =  new awt2swing.Menu ();
66211 this.labels =  new awt2swing.CheckboxMenuItem ();
66212 this.protSetting =  new awt2swing.CheckboxMenuItem ();
66213 this.nuclSetting =  new awt2swing.CheckboxMenuItem ();
66214 this.values =  new awt2swing.MenuItem ();
66215 this.inputData =  new awt2swing.MenuItem ();
66216 });
66217 Clazz_makeConstructor (c$, 
66218 function (av) {
66219 Clazz_superConstructor (this, jalview.appletgui.PCAPanel, []);
66220 try {
66221 this.jbInit ();
66222 } catch (e) {
66223 if (Clazz_exceptionOf (e, Exception)) {
66224 e.printStackTrace ();
66225 } else {
66226 throw e;
66227 }
66228 }
66229 for (var i = 1; i < 8; i++) {
66230 this.xCombobox.addItem ("dim " + i);
66231 this.yCombobox.addItem ("dim " + i);
66232 this.zCombobox.addItem ("dim " + i);
66233 }
66234 this.av = av;
66235 var selected = av.getSelectionGroup () != null && av.getSelectionGroup ().getSize () > 0;
66236 var seqstrings = av.getAlignmentView (selected);
66237 var nucleotide = av.getAlignment ().isNucleotide ();
66238 var seqs;
66239 if (!selected) {
66240 seqs = av.getAlignment ().getSequencesArray ();
66241 } else {
66242 seqs = av.getSelectionGroup ().getSequencesInOrder (av.getAlignment ());
66243 }var sq = seqstrings.getSequences ();
66244 var length = sq[0].getWidth ();
66245 for (var i = 0; i < seqs.length; i++) {
66246 if (sq[i].getWidth () != length) {
66247 System.out.println ("Sequences must be equal length for PCA analysis");
66248 return;
66249 }}
66250 this.pcaModel =  new jalview.viewmodel.PCAModel (seqstrings, seqs, nucleotide);
66251 this.rc =  new jalview.appletgui.RotatableCanvas (av);
66252 this.embedMenuIfNeeded (this.rc);
66253 this.add (this.rc, "Center");
66254 jalview.bin.JalviewLite.addFrame (this, jalview.util.MessageManager.getString ("label.principal_component_analysis"), 475, 400);
66255 var worker =  new Thread (this);
66256 worker.start ();
66257 }, "jalview.appletgui.AlignViewport");
66258 Clazz_overrideMethod (c$, "run", 
66259 function () {
66260 this.calcSettings.setEnabled (false);
66261 this.rc.setEnabled (false);
66262 try {
66263 this.nuclSetting.setState (this.pcaModel.isNucleotide ());
66264 this.protSetting.setState (!this.pcaModel.isNucleotide ());
66265 this.pcaModel.run ();
66266 this.xCombobox.select (new Integer (0));
66267 this.yCombobox.select (new Integer (1));
66268 this.zCombobox.select (new Integer (2));
66269 this.pcaModel.updateRc (this.rc);
66270 this.top = this.pcaModel.getTop ();
66271 } catch (x) {
66272 if (Clazz_exceptionOf (x, OutOfMemoryError)) {
66273 System.err.println ("Out of memory when calculating PCA.");
66274 return;
66275 } else {
66276 throw x;
66277 }
66278 }
66279 this.calcSettings.setEnabled (true);
66280 this.rc.setEnabled (true);
66281 this.rc.repaint ();
66282 this.repaint ();
66283 });
66284 Clazz_defineMethod (c$, "doDimensionChange", 
66285 function () {
66286 if (this.top == 0) {
66287 return;
66288 }var dim1 = this.top - this.xCombobox.getSelectedIndex ();
66289 var dim2 = this.top - this.yCombobox.getSelectedIndex ();
66290 var dim3 = this.top - this.zCombobox.getSelectedIndex ();
66291 this.pcaModel.updateRcView (dim1, dim2, dim3);
66292 this.rc.img = null;
66293 this.rc.rotmat.setIdentity ();
66294 this.rc.initAxes ();
66295 this.rc.paint (this.rc.getGraphics ());
66296 });
66297 Clazz_overrideMethod (c$, "actionPerformed", 
66298 function (evt) {
66299 if (evt.getSource () === this.inputData) {
66300 this.showOriginalData ();
66301 }if (evt.getSource () === this.resetButton) {
66302 this.xCombobox.select (new Integer (0));
66303 this.yCombobox.select (new Integer (1));
66304 this.zCombobox.select (new Integer (2));
66305 this.doDimensionChange ();
66306 }if (evt.getSource () === this.values) {
66307 this.values_actionPerformed ();
66308 }}, "java.awt.event.ActionEvent");
66309 Clazz_overrideMethod (c$, "itemStateChanged", 
66310 function (evt) {
66311 if (evt.getSource () === this.xCombobox) {
66312 this.xCombobox_actionPerformed ();
66313 } else if (evt.getSource () === this.yCombobox) {
66314 this.yCombobox_actionPerformed ();
66315 } else if (evt.getSource () === this.zCombobox) {
66316 this.zCombobox_actionPerformed ();
66317 } else if (evt.getSource () === this.labels) {
66318 this.labels_itemStateChanged (evt);
66319 } else if (evt.getSource () === this.nuclSetting) {
66320 if (!this.pcaModel.isNucleotide ()) {
66321 this.pcaModel.setNucleotide (true);
66322  new Thread (this).start ();
66323 }} else if (evt.getSource () === this.protSetting) {
66324 if (this.pcaModel.isNucleotide ()) {
66325 this.pcaModel.setNucleotide (false);
66326  new Thread (this).start ();
66327 }}}, "java.awt.event.ItemEvent");
66328 Clazz_defineMethod (c$, "xCombobox_actionPerformed", 
66329 function () {
66330 this.doDimensionChange ();
66331 });
66332 Clazz_defineMethod (c$, "yCombobox_actionPerformed", 
66333 function () {
66334 this.doDimensionChange ();
66335 });
66336 Clazz_defineMethod (c$, "zCombobox_actionPerformed", 
66337 function () {
66338 this.doDimensionChange ();
66339 });
66340 Clazz_defineMethod (c$, "values_actionPerformed", 
66341 function () {
66342 var cap =  new jalview.appletgui.CutAndPasteTransfer (false, null);
66343 var frame =  new awt2swing.Frame ();
66344 frame.add (cap);
66345 jalview.bin.JalviewLite.addFrame (frame, jalview.util.MessageManager.getString ("label.pca_details"), 500, 500);
66346 cap.setText (this.pcaModel.getDetails ());
66347 });
66348 Clazz_defineMethod (c$, "showOriginalData", 
66349 function () {
66350 var gc = '-';
66351 try {
66352 gc = this.av.getGapCharacter ();
66353 } catch (ex) {
66354 if (Clazz_exceptionOf (ex, Exception)) {
66355 } else {
66356 throw ex;
66357 }
66358 }
66359 ;var alAndColsel = this.pcaModel.getSeqtrings ().getAlignmentAndColumnSelection (gc);
66360 if (alAndColsel != null && alAndColsel[0] != null) {
66361 var al =  new jalview.datamodel.Alignment (alAndColsel[0]);
66362 var af =  new jalview.appletgui.AlignFrame (al, this.av.applet, "Original Data for PCA", false);
66363 af.viewport.setHiddenColumns (alAndColsel[1]);
66364 }});
66365 Clazz_defineMethod (c$, "labels_itemStateChanged", 
66366 function (itemEvent) {
66367 this.rc.showLabels (this.labels.getState ());
66368 }, "java.awt.event.ItemEvent");
66369 Clazz_defineMethod (c$, "jbInit", 
66370  function () {
66371 this.setLayout (this.borderLayout1);
66372 this.jPanel2.setLayout (this.flowLayout1);
66373 this.jLabel1.setFont ( new java.awt.Font ("Verdana", 0, 12));
66374 this.jLabel1.setText ("x=");
66375 this.jLabel2.setFont ( new java.awt.Font ("Verdana", 0, 12));
66376 this.jLabel2.setText ("y=");
66377 this.jLabel3.setFont ( new java.awt.Font ("Verdana", 0, 12));
66378 this.jLabel3.setText ("z=");
66379 this.jPanel2.setBackground (java.awt.Color.white);
66380 this.zCombobox.setFont ( new java.awt.Font ("Verdana", 0, 12));
66381 this.zCombobox.addItemListener (this);
66382 this.yCombobox.setFont ( new java.awt.Font ("Verdana", 0, 12));
66383 this.yCombobox.addItemListener (this);
66384 this.xCombobox.setFont ( new java.awt.Font ("Verdana", 0, 12));
66385 this.xCombobox.addItemListener (this);
66386 this.resetButton.setFont ( new java.awt.Font ("Verdana", 0, 12));
66387 this.resetButton.setLabel (jalview.util.MessageManager.getString ("action.reset"));
66388 this.resetButton.addActionListener (this);
66389 this.setMenuBar (this.menuBar1);
66390 this.menu1.setLabel (jalview.util.MessageManager.getString ("action.file"));
66391 this.menu2.setLabel (jalview.util.MessageManager.getString ("action.view"));
66392 this.calcSettings.setLabel (jalview.util.MessageManager.getString ("action.change_params"));
66393 this.labels.setLabel (jalview.util.MessageManager.getString ("label.labels"));
66394 this.labels.addItemListener (this);
66395 this.values.setLabel (jalview.util.MessageManager.getString ("label.output_values"));
66396 this.values.addActionListener (this);
66397 this.inputData.setLabel (jalview.util.MessageManager.getString ("label.input_data"));
66398 this.nuclSetting.setLabel (jalview.util.MessageManager.getString ("label.nucleotide_matrix"));
66399 this.nuclSetting.addItemListener (this);
66400 this.protSetting.setLabel (jalview.util.MessageManager.getString ("label.protein_matrix"));
66401 this.protSetting.addItemListener (this);
66402 this.add (this.jPanel2, "South");
66403 this.jPanel2.add (this.jLabel1, null);
66404 this.jPanel2.add (this.xCombobox, null);
66405 this.jPanel2.add (this.jLabel2, null);
66406 this.jPanel2.add (this.yCombobox, null);
66407 this.jPanel2.add (this.jLabel3, null);
66408 this.jPanel2.add (this.zCombobox, null);
66409 this.jPanel2.add (this.resetButton, null);
66410 this.menuBar1.add (this.menu1);
66411 this.menuBar1.add (this.menu2);
66412 this.menuBar1.add (this.calcSettings);
66413 this.menu2.add (this.labels);
66414 this.menu1.add (this.values);
66415 this.menu1.add (this.inputData);
66416 this.calcSettings.add (this.nuclSetting);
66417 this.calcSettings.add (this.protSetting);
66418 this.inputData.addActionListener (this);
66419 });
66420 });
66421 Clazz_declarePackage ("jalview.appletgui");
66422 Clazz_load (["awt2swing.Panel", "jalview.api.RotatableCanvasI", "java.awt.event.KeyListener", "$.MouseListener", "$.MouseMotionListener", "jalview.math.RotatableMatrix"], "jalview.appletgui.RotatableCanvas", ["awt2swing.Util", "jalview.appletgui.PaintRefresher", "jalview.datamodel.SequenceGroup", "jalview.util.Format", "$.MessageManager", "java.awt.Color", "$.Dimension", "$.Font"], function () {
66423 c$ = Clazz_decorateAsClass (function () {
66424 this.idmat = null;
66425 this.objmat = null;
66426 this.rotmat = null;
66427 this.tooltip = null;
66428 this.toolx = 0;
66429 this.tooly = 0;
66430 this.$drawAxes = true;
66431 this.omx = 0;
66432 this.mx = 0;
66433 this.omy = 0;
66434 this.my = 0;
66435 this.img = null;
66436 this.ig = null;
66437 this.prefsize = null;
66438 this.centre = null;
66439 this.$width = null;
66440 this.max = null;
66441 this.min = null;
66442 this.maxwidth = 0;
66443 this.scale = 0;
66444 this.npoint = 0;
66445 this.points = null;
66446 this.orig = null;
66447 this.axes = null;
66448 this.startx = 0;
66449 this.starty = 0;
66450 this.lastx = 0;
66451 this.lasty = 0;
66452 this.rectx1 = 0;
66453 this.recty1 = 0;
66454 this.rectx2 = 0;
66455 this.recty2 = 0;
66456 this.scalefactor = 1;
66457 this.av = null;
66458 this.$showLabels = false;
66459 Clazz_instantialize (this, arguments);
66460 }, jalview.appletgui, "RotatableCanvas", awt2swing.Panel, [java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.KeyListener, jalview.api.RotatableCanvasI]);
66461 Clazz_prepareFields (c$, function () {
66462 this.idmat =  new jalview.math.RotatableMatrix (3, 3);
66463 this.objmat =  new jalview.math.RotatableMatrix (3, 3);
66464 this.rotmat =  new jalview.math.RotatableMatrix (3, 3);
66465 this.centre =  Clazz_newFloatArray (3, 0);
66466 this.$width =  Clazz_newFloatArray (3, 0);
66467 this.max =  Clazz_newFloatArray (3, 0);
66468 this.min =  Clazz_newFloatArray (3, 0);
66469 });
66470 Clazz_makeConstructor (c$, 
66471 function (av) {
66472 Clazz_superConstructor (this, jalview.appletgui.RotatableCanvas, []);
66473 this.av = av;
66474 }, "jalview.viewmodel.AlignmentViewport");
66475 Clazz_defineMethod (c$, "showLabels", 
66476 function (b) {
66477 this.$showLabels = b;
66478 this.repaint ();
66479 }, "~B");
66480 Clazz_overrideMethod (c$, "setPoints", 
66481 function (points, npoint) {
66482 this.points = points;
66483 this.npoint = npoint;
66484 jalview.appletgui.PaintRefresher.Register (this, this.av.getSequenceSetId ());
66485 this.prefsize = this.getPreferredSize ();
66486 this.orig =  Clazz_newFloatArray (npoint, 3, 0);
66487 for (var i = 0; i < npoint; i++) {
66488 var sp = points.elementAt (i);
66489 for (var j = 0; j < 3; j++) {
66490 this.orig[i][j] = sp.coord[j];
66491 }
66492 }
66493 for (var i = 0; i < 3; i++) {
66494 for (var j = 0; j < 3; j++) {
66495 if (i != j) {
66496 this.idmat.addElement (i, j, 0);
66497 this.objmat.addElement (i, j, 0);
66498 this.rotmat.addElement (i, j, 0);
66499 } else {
66500 this.idmat.addElement (i, j, 0);
66501 this.objmat.addElement (i, j, 0);
66502 this.rotmat.addElement (i, j, 0);
66503 }}
66504 }
66505 this.axes =  Clazz_newFloatArray (3, 3, 0);
66506 this.initAxes ();
66507 this.findCentre ();
66508 this.findWidth ();
66509 this.scale = this.findScale ();
66510 this.addMouseListener (this);
66511 this.addKeyListener (this);
66512 this.addMouseMotionListener (this);
66513 }, "java.util.Vector,~N");
66514 Clazz_defineMethod (c$, "initAxes", 
66515 function () {
66516 for (var i = 0; i < 3; i++) {
66517 for (var j = 0; j < 3; j++) {
66518 if (i != j) {
66519 this.axes[i][j] = 0;
66520 } else {
66521 this.axes[i][j] = 1;
66522 }}
66523 }
66524 });
66525 Clazz_defineMethod (c$, "findWidth", 
66526 function () {
66527 this.max =  Clazz_newFloatArray (3, 0);
66528 this.min =  Clazz_newFloatArray (3, 0);
66529 this.max[0] = -1.0E30;
66530 this.max[1] = -1.0E30;
66531 this.max[2] = -1.0E30;
66532 this.min[0] = 1e30;
66533 this.min[1] = 1e30;
66534 this.min[2] = 1e30;
66535 for (var i = 0; i < 3; i++) {
66536 for (var j = 0; j < this.npoint; j++) {
66537 var sp = this.points.elementAt (j);
66538 if (sp.coord[i] >= this.max[i]) {
66539 this.max[i] = sp.coord[i];
66540 }if (sp.coord[i] <= this.min[i]) {
66541 this.min[i] = sp.coord[i];
66542 }}
66543 }
66544 this.$width[0] = Math.abs (this.max[0] - this.min[0]);
66545 this.$width[1] = Math.abs (this.max[1] - this.min[1]);
66546 this.$width[2] = Math.abs (this.max[2] - this.min[2]);
66547 this.maxwidth = this.$width[0];
66548 if (this.$width[1] > this.$width[0]) {
66549 this.maxwidth = this.$width[1];
66550 }if (this.$width[2] > this.$width[1]) {
66551 this.maxwidth = this.$width[2];
66552 }});
66553 Clazz_defineMethod (c$, "findScale", 
66554 function () {
66555 var dim;
66556 var width;
66557 var height;
66558 if (this.getSize ().width != 0) {
66559 width = this.getSize ().width;
66560 height = this.getSize ().height;
66561 } else {
66562 width = this.prefsize.width;
66563 height = this.prefsize.height;
66564 }if (width < height) {
66565 dim = width;
66566 } else {
66567 dim = height;
66568 }return dim * this.scalefactor / (2 * this.maxwidth);
66569 });
66570 Clazz_defineMethod (c$, "findCentre", 
66571 function () {
66572 this.findWidth ();
66573 this.centre[0] = (this.max[0] + this.min[0]) / 2;
66574 this.centre[1] = (this.max[1] + this.min[1]) / 2;
66575 this.centre[2] = (this.max[2] + this.min[2]) / 2;
66576 });
66577 Clazz_overrideMethod (c$, "getPreferredSize", 
66578 function () {
66579 if (this.prefsize != null) {
66580 return this.prefsize;
66581 } else {
66582 return  new java.awt.Dimension (400, 400);
66583 }});
66584 Clazz_overrideMethod (c$, "getMinimumSize", 
66585 function () {
66586 return this.getPreferredSize ();
66587 });
66588 Clazz_overrideMethod (c$, "update", 
66589 function (g) {
66590 this.paint (g);
66591 }, "java.awt.Graphics");
66592 Clazz_defineMethod (c$, "PaintComponent", 
66593 function (g) {
66594 if (this.points == null) {
66595 g.setFont ( new java.awt.Font ("Verdana", 0, 18));
66596 awt2swing.Util.drawString (g, jalview.util.MessageManager.getString ("label.calculating_pca") + "....", 20, Clazz_doubleToInt (this.getSize ().height / 2));
66597 } else {
66598 if ((this.img == null) || (this.prefsize.width != this.getSize ().width) || (this.prefsize.height != this.getSize ().height)) {
66599 this.prefsize.width = this.getSize ().width;
66600 this.prefsize.height = this.getSize ().height;
66601 this.scale = this.findScale ();
66602 this.img = this.createImage (this.getSize ().width, this.getSize ().height);
66603 this.ig = this.img.getGraphics ();
66604 }this.drawBackground (this.ig, java.awt.Color.black);
66605 this.drawScene (this.ig);
66606 if (this.$drawAxes == true) {
66607 this.drawAxes (this.ig);
66608 }if (this.tooltip != null) {
66609 this.ig.setColor (java.awt.Color.red);
66610 awt2swing.Util.drawString (this.ig, this.tooltip, this.toolx, this.tooly);
66611 }g.drawImage (this.img, 0, 0, this);
66612 }}, "java.awt.Graphics");
66613 Clazz_defineMethod (c$, "drawAxes", 
66614 function (g) {
66615 g.setColor (java.awt.Color.yellow);
66616 for (var i = 0; i < 3; i++) {
66617 g.drawLine (Clazz_doubleToInt (this.getSize ().width / 2), Clazz_doubleToInt (this.getSize ().height / 2), Clazz_floatToInt (this.axes[i][0] * this.scale * this.max[0] + Clazz_doubleToInt (this.getSize ().width / 2)), Clazz_floatToInt (this.axes[i][1] * this.scale * this.max[1] + Clazz_doubleToInt (this.getSize ().height / 2)));
66618 }
66619 }, "java.awt.Graphics");
66620 Clazz_defineMethod (c$, "drawBackground", 
66621 function (g, col) {
66622 g.setColor (col);
66623 g.fillRect (0, 0, this.prefsize.width, this.prefsize.height);
66624 }, "java.awt.Graphics,java.awt.Color");
66625 Clazz_defineMethod (c$, "drawScene", 
66626 function (g) {
66627 var halfwidth = Clazz_doubleToInt (this.getSize ().width / 2);
66628 var halfheight = Clazz_doubleToInt (this.getSize ().height / 2);
66629 for (var i = 0; i < this.npoint; i++) {
66630 var sp = this.points.elementAt (i);
66631 var x = Clazz_floatToInt ((sp.coord[0] - this.centre[0]) * this.scale) + halfwidth;
66632 var y = Clazz_floatToInt ((sp.coord[1] - this.centre[1]) * this.scale) + halfheight;
66633 var z = sp.coord[1] - this.centre[2];
66634 if (this.av.getSequenceColour (sp.sequence) === java.awt.Color.black) {
66635 g.setColor (java.awt.Color.white);
66636 } else {
66637 g.setColor (this.av.getSequenceColour (sp.sequence));
66638 }if (this.av.getSelectionGroup () != null) {
66639 if (this.av.getSelectionGroup ().getSequences (null).contains ((this.points.elementAt (i)).sequence)) {
66640 g.setColor (java.awt.Color.gray);
66641 }}if (z < 0) {
66642 g.setColor (g.getColor ().darker ());
66643 }g.fillRect (x - 3, y - 3, 6, 6);
66644 if (this.$showLabels) {
66645 g.setColor (java.awt.Color.red);
66646 awt2swing.Util.drawString (g, (this.points.elementAt (i)).sequence.getName (), x - 3, y - 4);
66647 }}
66648 }, "java.awt.Graphics");
66649 Clazz_defineMethod (c$, "minimumsize", 
66650 function () {
66651 return this.prefsize;
66652 });
66653 Clazz_defineMethod (c$, "preferredsize", 
66654 function () {
66655 return this.prefsize;
66656 });
66657 Clazz_overrideMethod (c$, "keyTyped", 
66658 function (evt) {
66659 }, "java.awt.event.KeyEvent");
66660 Clazz_overrideMethod (c$, "keyReleased", 
66661 function (evt) {
66662 }, "java.awt.event.KeyEvent");
66663 Clazz_overrideMethod (c$, "keyPressed", 
66664 function (evt) {
66665 if (evt.getKeyCode () == 38) {
66666 this.scalefactor = (this.scalefactor * 1.1);
66667 this.scale = this.findScale ();
66668 } else if (evt.getKeyCode () == 40) {
66669 this.scalefactor = (this.scalefactor * 0.9);
66670 this.scale = this.findScale ();
66671 } else if (evt.getKeyChar () == 's') {
66672 System.err.println ("DEBUG: Rectangle selection");
66673 if (this.rectx2 != -1 && this.recty2 != -1) {
66674 this.rectSelect (this.rectx1, this.recty1, this.rectx2, this.recty2);
66675 }}this.repaint ();
66676 }, "java.awt.event.KeyEvent");
66677 Clazz_defineMethod (c$, "printPoints", 
66678 function () {
66679 for (var i = 0; i < this.npoint; i++) {
66680 var sp = this.points.elementAt (i);
66681 jalview.util.Format.printLong (System.out, "%5d ", i);
66682 for (var j = 0; j < 3; j++) {
66683 jalview.util.Format.printDouble (System.out, "%13.3f  ", sp.coord[j]);
66684 }
66685 System.out.println ();
66686 }
66687 });
66688 Clazz_overrideMethod (c$, "mouseClicked", 
66689 function (evt) {
66690 }, "java.awt.event.MouseEvent");
66691 Clazz_overrideMethod (c$, "mouseEntered", 
66692 function (evt) {
66693 }, "java.awt.event.MouseEvent");
66694 Clazz_overrideMethod (c$, "mouseExited", 
66695 function (evt) {
66696 }, "java.awt.event.MouseEvent");
66697 Clazz_overrideMethod (c$, "mouseReleased", 
66698 function (evt) {
66699 }, "java.awt.event.MouseEvent");
66700 Clazz_overrideMethod (c$, "mousePressed", 
66701 function (evt) {
66702 var x = evt.getX ();
66703 var y = evt.getY ();
66704 this.mx = x;
66705 this.my = y;
66706 this.omx = this.mx;
66707 this.omy = this.my;
66708 this.startx = x;
66709 this.starty = y;
66710 this.rectx1 = x;
66711 this.recty1 = y;
66712 this.rectx2 = -1;
66713 this.recty2 = -1;
66714 var found = this.findPoint (x, y);
66715 if (found != null) {
66716 if (this.av.getSelectionGroup () != null) {
66717 this.av.getSelectionGroup ().addOrRemove (found, true);
66718 this.av.getSelectionGroup ().setEndRes (this.av.getAlignment ().getWidth () - 1);
66719 } else {
66720 this.av.setSelectionGroup ( new jalview.datamodel.SequenceGroup ());
66721 this.av.getSelectionGroup ().addOrRemove (found, true);
66722 this.av.getSelectionGroup ().setEndRes (this.av.getAlignment ().getWidth () - 1);
66723 }jalview.appletgui.PaintRefresher.Refresh (this, this.av.getSequenceSetId ());
66724 this.av.sendSelection ();
66725 }this.repaint ();
66726 }, "java.awt.event.MouseEvent");
66727 Clazz_overrideMethod (c$, "mouseMoved", 
66728 function (evt) {
66729 var found = this.findPoint (evt.getX (), evt.getY ());
66730 if (found == null) {
66731 this.tooltip = null;
66732 } else {
66733 this.tooltip = found.getName ();
66734 this.toolx = evt.getX ();
66735 this.tooly = evt.getY ();
66736 }this.repaint ();
66737 }, "java.awt.event.MouseEvent");
66738 Clazz_overrideMethod (c$, "mouseDragged", 
66739 function (evt) {
66740 this.mx = evt.getX ();
66741 this.my = evt.getY ();
66742 this.rotmat.setIdentity ();
66743 this.rotmat.rotate (this.my - this.omy, 'x');
66744 this.rotmat.rotate (this.mx - this.omx, 'y');
66745 for (var i = 0; i < this.npoint; i++) {
66746 var sp = this.points.elementAt (i);
66747 sp.coord[0] -= this.centre[0];
66748 sp.coord[1] -= this.centre[1];
66749 sp.coord[2] -= this.centre[2];
66750 sp.coord = this.rotmat.vectorMultiply (sp.coord);
66751 sp.coord[0] += this.centre[0];
66752 sp.coord[1] += this.centre[1];
66753 sp.coord[2] += this.centre[2];
66754 }
66755 for (var i = 0; i < 3; i++) {
66756 this.axes[i] = this.rotmat.vectorMultiply (this.axes[i]);
66757 }
66758 this.omx = this.mx;
66759 this.omy = this.my;
66760 this.paint (this.getGraphics ());
66761 }, "java.awt.event.MouseEvent");
66762 Clazz_defineMethod (c$, "rectSelect", 
66763 function (x1, y1, x2, y2) {
66764 for (var i = 0; i < this.npoint; i++) {
66765 var sp = this.points.elementAt (i);
66766 var tmp1 = Clazz_doubleToInt ((sp.coord[0] - this.centre[0]) * this.scale + this.getSize ().width / 2.0);
66767 var tmp2 = Clazz_doubleToInt ((sp.coord[1] - this.centre[1]) * this.scale + this.getSize ().height / 2.0);
66768 if (tmp1 > x1 && tmp1 < x2 && tmp2 > y1 && tmp2 < y2) {
66769 if (this.av != null) {
66770 if (!this.av.getSelectionGroup ().getSequences (null).contains (sp.sequence)) {
66771 this.av.getSelectionGroup ().addSequence (sp.sequence, true);
66772 }}}}
66773 }, "~N,~N,~N,~N");
66774 Clazz_defineMethod (c$, "findPoint", 
66775 function (x, y) {
66776 var halfwidth = Clazz_doubleToInt (this.getSize ().width / 2);
66777 var halfheight = Clazz_doubleToInt (this.getSize ().height / 2);
66778 var found = -1;
66779 for (var i = 0; i < this.npoint; i++) {
66780 var sp = this.points.elementAt (i);
66781 var px = Clazz_floatToInt ((sp.coord[0] - this.centre[0]) * this.scale) + halfwidth;
66782 var py = Clazz_floatToInt ((sp.coord[1] - this.centre[1]) * this.scale) + halfheight;
66783 if (Math.abs (px - x) < 3 && Math.abs (py - y) < 3) {
66784 found = i;
66785 }}
66786 if (found != -1) {
66787 return (this.points.elementAt (found)).sequence;
66788 } else {
66789 return null;
66790 }}, "~N,~N");
66791 });
66792 Clazz_declarePackage ("jalview.api");
66793 Clazz_declareInterface (jalview.api, "RotatableCanvasI");
66794 Clazz_declarePackage ("jalview.math");
66795 c$ = Clazz_decorateAsClass (function () {
66796 this.matrix = null;
66797 this.temp = null;
66798 this.rot = null;
66799 Clazz_instantialize (this, arguments);
66800 }, jalview.math, "RotatableMatrix");
66801 Clazz_makeConstructor (c$, 
66802 function (rows, cols) {
66803 this.matrix =  Clazz_newFloatArray (rows, cols, 0);
66804 this.temp =  Clazz_newFloatArray (3, 0);
66805 this.rot =  Clazz_newFloatArray (3, 3, 0);
66806 }, "~N,~N");
66807 Clazz_defineMethod (c$, "addElement", 
66808 function (i, j, value) {
66809 this.matrix[i][j] = value;
66810 }, "~N,~N,~N");
66811 Clazz_defineMethod (c$, "print", 
66812 function () {
66813 System.out.println (this.matrix[0][0] + " " + this.matrix[0][1] + " " + this.matrix[0][2]);
66814 System.out.println (this.matrix[1][0] + " " + this.matrix[1][1] + " " + this.matrix[1][2]);
66815 System.out.println (this.matrix[2][0] + " " + this.matrix[2][1] + " " + this.matrix[2][2]);
66816 });
66817 Clazz_defineMethod (c$, "rotate", 
66818 function (degrees, axis) {
66819 var costheta = Math.cos ((degrees * 3.141592653589793) / 180.0);
66820 var sintheta = Math.sin ((degrees * 3.141592653589793) / 180.0);
66821 if (axis == 'z') {
66822 this.rot[0][0] = costheta;
66823 this.rot[0][1] = -sintheta;
66824 this.rot[0][2] = 0.0;
66825 this.rot[1][0] = sintheta;
66826 this.rot[1][1] = costheta;
66827 this.rot[1][2] = 0.0;
66828 this.rot[2][0] = 0.0;
66829 this.rot[2][1] = 0.0;
66830 this.rot[2][2] = 1.0;
66831 this.preMultiply (this.rot);
66832 }if (axis == 'x') {
66833 this.rot[0][0] = 1.0;
66834 this.rot[0][1] = 0.0;
66835 this.rot[0][2] = 0.0;
66836 this.rot[1][0] = 0.0;
66837 this.rot[1][1] = costheta;
66838 this.rot[1][2] = sintheta;
66839 this.rot[2][0] = 0.0;
66840 this.rot[2][1] = -sintheta;
66841 this.rot[2][2] = costheta;
66842 this.preMultiply (this.rot);
66843 }if (axis == 'y') {
66844 this.rot[0][0] = costheta;
66845 this.rot[0][1] = 0.0;
66846 this.rot[0][2] = -sintheta;
66847 this.rot[1][0] = 0.0;
66848 this.rot[1][1] = 1.0;
66849 this.rot[1][2] = 0.0;
66850 this.rot[2][0] = sintheta;
66851 this.rot[2][1] = 0.0;
66852 this.rot[2][2] = costheta;
66853 this.preMultiply (this.rot);
66854 }}, "~N,~S");
66855 Clazz_defineMethod (c$, "vectorMultiply", 
66856 function (vect) {
66857 this.temp[0] = vect[0];
66858 this.temp[1] = vect[1];
66859 this.temp[2] = vect[2];
66860 for (var i = 0; i < 3; i++) {
66861 this.temp[i] = (this.matrix[i][0] * vect[0]) + (this.matrix[i][1] * vect[1]) + (this.matrix[i][2] * vect[2]);
66862 }
66863 vect[0] = this.temp[0];
66864 vect[1] = this.temp[1];
66865 vect[2] = this.temp[2];
66866 return vect;
66867 }, "~A");
66868 Clazz_defineMethod (c$, "preMultiply", 
66869 function (mat) {
66870 var tmp =  Clazz_newFloatArray (3, 3, 0);
66871 for (var i = 0; i < 3; i++) {
66872 for (var j = 0; j < 3; j++) {
66873 tmp[i][j] = (mat[i][0] * this.matrix[0][j]) + (mat[i][1] * this.matrix[1][j]) + (mat[i][2] * this.matrix[2][j]);
66874 }
66875 }
66876 for (var i = 0; i < 3; i++) {
66877 for (var j = 0; j < 3; j++) {
66878 this.matrix[i][j] = tmp[i][j];
66879 }
66880 }
66881 }, "~A");
66882 Clazz_defineMethod (c$, "postMultiply", 
66883 function (mat) {
66884 var tmp =  Clazz_newFloatArray (3, 3, 0);
66885 for (var i = 0; i < 3; i++) {
66886 for (var j = 0; j < 3; j++) {
66887 tmp[i][j] = (this.matrix[i][0] * mat[0][j]) + (this.matrix[i][1] * mat[1][j]) + (this.matrix[i][2] * mat[2][j]);
66888 }
66889 }
66890 for (var i = 0; i < 3; i++) {
66891 for (var j = 0; j < 3; j++) {
66892 this.matrix[i][j] = tmp[i][j];
66893 }
66894 }
66895 }, "~A");
66896 Clazz_defineMethod (c$, "setIdentity", 
66897 function () {
66898 this.matrix[0][0] = 1.0;
66899 this.matrix[1][1] = 1.0;
66900 this.matrix[2][2] = 1.0;
66901 this.matrix[0][1] = 0.0;
66902 this.matrix[0][2] = 0.0;
66903 this.matrix[1][0] = 0.0;
66904 this.matrix[1][2] = 0.0;
66905 this.matrix[2][0] = 0.0;
66906 this.matrix[2][1] = 0.0;
66907 });
66908 Clazz_declarePackage ("jalview.viewmodel");
66909 Clazz_load (null, "jalview.viewmodel.PCAModel", ["jalview.analysis.PCA", "jalview.datamodel.SequencePoint", "java.lang.StringBuffer", "java.util.Vector"], function () {
66910 c$ = Clazz_decorateAsClass (function () {
66911 this.pca = null;
66912 this.top = 0;
66913 this.seqstrings = null;
66914 this.seqs = null;
66915 this.score_matrix = null;
66916 this.nucleotide = false;
66917 this.points = null;
66918 this.jvCalcMode = true;
66919 Clazz_instantialize (this, arguments);
66920 }, jalview.viewmodel, "PCAModel");
66921 Clazz_makeConstructor (c$, 
66922 function (seqstrings2, seqs2, nucleotide2) {
66923 this.seqstrings = seqstrings2;
66924 this.seqs = seqs2;
66925 this.nucleotide = nucleotide2;
66926 this.score_matrix = nucleotide2 ? "PID" : "BLOSUM62";
66927 }, "jalview.datamodel.AlignmentView,~A,~B");
66928 Clazz_defineMethod (c$, "isJvCalcMode", 
66929 function () {
66930 return this.jvCalcMode;
66931 });
66932 Clazz_defineMethod (c$, "run", 
66933 function () {
66934 this.pca =  new jalview.analysis.PCA (this.seqstrings.getSequenceStrings (' '), this.nucleotide, this.score_matrix);
66935 this.pca.setJvCalcMode (this.jvCalcMode);
66936 this.pca.run ();
66937 var ii = 0;
66938 while ((ii < this.seqs.length) && (this.seqs[ii] != null)) {
66939 ii++;
66940 }
66941 var comps =  Clazz_newDoubleArray (ii, ii, 0);
66942 for (var i = 0; i < ii; i++) {
66943 if (this.pca.getEigenvalue (i) > 1e-4) {
66944 comps[i] = this.pca.component (i);
66945 }}
66946 this.top = this.pca.getM ().rows - 1;
66947 this.points =  new java.util.Vector ();
66948 var scores = this.pca.getComponents (this.top - 1, this.top - 2, this.top - 3, 100);
66949 for (var i = 0; i < this.pca.getM ().rows; i++) {
66950 var sp =  new jalview.datamodel.SequencePoint (this.seqs[i], scores[i]);
66951 this.points.addElement (sp);
66952 }
66953 });
66954 Clazz_defineMethod (c$, "updateRc", 
66955 function (rc) {
66956 rc.setPoints (this.points, this.pca.getM ().rows);
66957 }, "jalview.api.RotatableCanvasI");
66958 Clazz_defineMethod (c$, "isNucleotide", 
66959 function () {
66960 return this.nucleotide;
66961 });
66962 Clazz_defineMethod (c$, "setNucleotide", 
66963 function (nucleotide) {
66964 this.nucleotide = nucleotide;
66965 }, "~B");
66966 Clazz_defineMethod (c$, "getTop", 
66967 function () {
66968 return this.top;
66969 });
66970 Clazz_defineMethod (c$, "updateRcView", 
66971 function (dim1, dim2, dim3) {
66972 var scores = this.pca.getComponents (dim1 - 1, dim2 - 1, dim3 - 1, 100);
66973 for (var i = 0; i < this.pca.getM ().rows; i++) {
66974 (this.points.elementAt (i)).coord = scores[i];
66975 }
66976 }, "~N,~N,~N");
66977 Clazz_defineMethod (c$, "getDetails", 
66978 function () {
66979 return this.pca.getDetails ();
66980 });
66981 Clazz_defineMethod (c$, "getSeqtrings", 
66982 function () {
66983 return this.seqstrings;
66984 });
66985 Clazz_defineMethod (c$, "getPointsasCsv", 
66986 function (transformed, xdim, ydim, zdim) {
66987 var csv =  new StringBuffer ();
66988 csv.append ("\"Sequence\"");
66989 if (transformed) {
66990 csv.append (",");
66991 csv.append ("" + xdim);
66992 csv.append (",");
66993 csv.append ("" + ydim);
66994 csv.append (",");
66995 csv.append ("" + zdim);
66996 } else {
66997 for (var d = 1, dmax = this.pca.component (1).length; d <= dmax; d++) {
66998 csv.append ("," + d);
66999 }
67000 }csv.append ("\n");
67001 for (var s = 0; s < this.seqs.length; s++) {
67002 csv.append ("\"" + this.seqs[s].getName () + "\"");
67003 var fl;
67004 if (!transformed) {
67005 fl = this.pca.component (s);
67006 for (var d = fl.length - 1; d >= 0; d--) {
67007 csv.append (",");
67008 csv.append (fl[d]);
67009 }
67010 } else {
67011 fl = this.getPointPosition (s);
67012 for (var d = 0; d < fl.length; d++) {
67013 csv.append (",");
67014 csv.append (fl[d]);
67015 }
67016 }csv.append ("\n");
67017 }
67018 return csv.toString ();
67019 }, "~B,~N,~N,~N");
67020 Clazz_defineMethod (c$, "getPointPosition", 
67021 function (s) {
67022 var pts =  Clazz_newDoubleArray (3, 0);
67023 var p = this.points.elementAt (s).coord;
67024 pts[0] = p[0];
67025 pts[1] = p[1];
67026 pts[2] = p[2];
67027 return pts;
67028 }, "~N");
67029 Clazz_defineMethod (c$, "setJvCalcMode", 
67030 function (state) {
67031 this.jvCalcMode = state;
67032 }, "~B");
67033 Clazz_defineMethod (c$, "getScore_matrix", 
67034 function () {
67035 return this.score_matrix;
67036 });
67037 Clazz_defineMethod (c$, "setScore_matrix", 
67038 function (score_matrix) {
67039 this.score_matrix = score_matrix;
67040 }, "~S");
67041 });
67042 Clazz_declarePackage ("jalview.analysis");
67043 Clazz_load (["java.lang.StringBuffer"], "jalview.analysis.PCA", ["jalview.datamodel.BinarySequence", "jalview.math.Matrix", "jalview.schemes.ResidueProperties"], function () {
67044 c$ = Clazz_decorateAsClass (function () {
67045 this.m = null;
67046 this.symm = null;
67047 this.m2 = null;
67048 this.eigenvalue = null;
67049 this.eigenvector = null;
67050 this.details = null;
67051 this.jvCalcMode = true;
67052 Clazz_instantialize (this, arguments);
67053 }, jalview.analysis, "PCA", null, Runnable);
67054 Clazz_prepareFields (c$, function () {
67055 this.details =  new StringBuffer ();
67056 });
67057 Clazz_makeConstructor (c$, 
67058 function (s) {
67059 this.construct (s, false);
67060 }, "~A");
67061 Clazz_makeConstructor (c$, 
67062 function (s, nucleotides) {
67063 this.construct (s, nucleotides, null);
67064 }, "~A,~B");
67065 Clazz_makeConstructor (c$, 
67066 function (s, nucleotides, s_m) {
67067 var bs =  new Array (s.length);
67068 var ii = 0;
67069 while ((ii < s.length) && (s[ii] != null)) {
67070 bs[ii] =  new jalview.datamodel.BinarySequence (s[ii], nucleotides);
67071 bs[ii].encode ();
67072 ii++;
67073 }
67074 var bs2 =  new Array (s.length);
67075 ii = 0;
67076 var smtrx = null;
67077 var sm = s_m;
67078 if (sm != null) {
67079 smtrx = jalview.schemes.ResidueProperties.getScoreMatrix (sm);
67080 }if (smtrx == null) {
67081 smtrx = jalview.schemes.ResidueProperties.getScoreMatrix (sm = (nucleotides ? "DNA" : "BLOSUM62"));
67082 }this.details.append ("PCA calculation using " + sm + " sequence similarity matrix\n========\n\n");
67083 while ((ii < s.length) && (s[ii] != null)) {
67084 bs2[ii] =  new jalview.datamodel.BinarySequence (s[ii], nucleotides);
67085 if (smtrx != null) {
67086 try {
67087 bs2[ii].matrixEncode (smtrx);
67088 } catch (x) {
67089 if (Clazz_exceptionOf (x, jalview.datamodel.BinarySequence.InvalidSequenceTypeException)) {
67090 this.details.append ("Unexpected mismatch of sequence type and score matrix. Calculation will not be valid!\n\n");
67091 } else {
67092 throw x;
67093 }
67094 }
67095 }ii++;
67096 }
67097 var count = 0;
67098 while ((count < bs.length) && (bs[count] != null)) {
67099 count++;
67100 }
67101 var seqmat =  Clazz_newDoubleArray (count, bs[0].getDBinary ().length, 0);
67102 var seqmat2 =  Clazz_newDoubleArray (count, bs2[0].getDBinary ().length, 0);
67103 var i = 0;
67104 while (i < count) {
67105 seqmat[i] = bs[i].getDBinary ();
67106 seqmat2[i] = bs2[i].getDBinary ();
67107 i++;
67108 }
67109 this.m =  new jalview.math.Matrix (seqmat, count, bs[0].getDBinary ().length);
67110 this.m2 =  new jalview.math.Matrix (seqmat2, count, bs2[0].getDBinary ().length);
67111 }, "~A,~B,~S");
67112 Clazz_defineMethod (c$, "getM", 
67113 function () {
67114 return this.m;
67115 });
67116 Clazz_defineMethod (c$, "getEigenvalue", 
67117 function (i) {
67118 return this.eigenvector.d[i];
67119 }, "~N");
67120 Clazz_defineMethod (c$, "getComponents", 
67121 function (l, n, mm, factor) {
67122 var out =  Clazz_newFloatArray (this.m.rows, 3, 0);
67123 for (var i = 0; i < this.m.rows; i++) {
67124 out[i][0] = this.component (i, l) * factor;
67125 out[i][1] = this.component (i, n) * factor;
67126 out[i][2] = this.component (i, mm) * factor;
67127 }
67128 return out;
67129 }, "~N,~N,~N,~N");
67130 Clazz_defineMethod (c$, "component", 
67131 function (n) {
67132 var out =  Clazz_newDoubleArray (this.m.rows, 0);
67133 for (var i = 0; i < this.m.rows; i++) {
67134 out[i] = this.component (i, n);
67135 }
67136 return out;
67137 }, "~N");
67138 Clazz_defineMethod (c$, "component", 
67139 function (row, n) {
67140 var out = 0.0;
67141 for (var i = 0; i < this.symm.cols; i++) {
67142 out += (this.symm.value[row][i] * this.eigenvector.value[i][n]);
67143 }
67144 return out / this.eigenvector.d[n];
67145 }, "~N,~N");
67146 Clazz_defineMethod (c$, "getDetails", 
67147 function () {
67148 return this.details.toString ();
67149 });
67150 Clazz_overrideMethod (c$, "run", 
67151 function () {
67152 var ps = ((Clazz_isClassDefined ("jalview.analysis.PCA$1") ? 0 : jalview.analysis.PCA.$PCA$1$ ()), Clazz_innerTypeInstance (jalview.analysis.PCA$1, this, null, System.out));
67153 try {
67154 this.details.append ("PCA Calculation Mode is " + (this.jvCalcMode ? "Jalview variant" : "Original SeqSpace") + "\n");
67155 var mt = this.m.transpose ();
67156 this.details.append (" --- OrigT * Orig ---- \n");
67157 if (!this.jvCalcMode) {
67158 this.eigenvector = mt.preMultiply (this.m);
67159 } else {
67160 this.eigenvector = mt.preMultiply (this.m2);
67161 }this.eigenvector.print (ps);
67162 this.symm = this.eigenvector.copy ();
67163 this.eigenvector.tred ();
67164 this.details.append (" ---Tridiag transform matrix ---\n");
67165 this.details.append (" --- D vector ---\n");
67166 this.eigenvector.printD (ps);
67167 ps.println ();
67168 this.details.append ("--- E vector ---\n");
67169 this.eigenvector.printE (ps);
67170 ps.println ();
67171 this.eigenvector.tqli ();
67172 } catch (q) {
67173 if (Clazz_exceptionOf (q, Exception)) {
67174 q.printStackTrace ();
67175 this.details.append ("\n*** Unexpected exception when performing PCA ***\n" + q.getLocalizedMessage ());
67176 this.details.append ("*** Matrices below may not be fully diagonalised. ***\n");
67177 } else {
67178 throw q;
67179 }
67180 }
67181 this.details.append (" --- New diagonalization matrix ---\n");
67182 this.eigenvector.print (ps);
67183 this.details.append (" --- Eigenvalues ---\n");
67184 this.eigenvector.printD (ps);
67185 ps.println ();
67186 });
67187 Clazz_defineMethod (c$, "setJvCalcMode", 
67188 function (calcMode) {
67189 this.jvCalcMode = calcMode;
67190 }, "~B");
67191 c$.$PCA$1$ = function () {
67192 Clazz_pu$h(self.c$);
67193 c$ = Clazz_declareAnonymous (jalview.analysis, "PCA$1", java.io.PrintStream);
67194 Clazz_defineMethod (c$, "print", 
67195 function (x) {
67196 this.b$["jalview.analysis.PCA"].details.append (x);
67197 }, "~S");
67198 Clazz_defineMethod (c$, "println", 
67199 function () {
67200 this.b$["jalview.analysis.PCA"].details.append ("\n");
67201 });
67202 c$ = Clazz_p0p ();
67203 };
67204 });
67205 Clazz_declarePackage ("jalview.datamodel");
67206 Clazz_load (["jalview.datamodel.Sequence", "java.lang.Exception"], "jalview.datamodel.BinarySequence", ["jalview.schemes.ResidueProperties"], function () {
67207 c$ = Clazz_decorateAsClass (function () {
67208 if (!Clazz_isClassDefined ("jalview.datamodel.BinarySequence.InvalidSequenceTypeException")) {
67209 jalview.datamodel.BinarySequence.$BinarySequence$InvalidSequenceTypeException$ ();
67210 }
67211 this.binary = null;
67212 this.dbinary = null;
67213 this.isNa = false;
67214 Clazz_instantialize (this, arguments);
67215 }, jalview.datamodel, "BinarySequence", jalview.datamodel.Sequence);
67216 Clazz_makeConstructor (c$, 
67217 function (s, isNa) {
67218 Clazz_superConstructor (this, jalview.datamodel.BinarySequence, ["", s, 0, s.length]);
67219 this.isNa = isNa;
67220 }, "~S,~B");
67221 Clazz_defineMethod (c$, "initMatrixGetNoRes", 
67222  function () {
67223 var nores = (this.isNa) ? 10 : 23;
67224 this.dbinary =  Clazz_newDoubleArray (this.getSequence ().length * nores, 0);
67225 for (var i = 0; i < this.dbinary.length; i++) {
67226 this.dbinary[i] = 0.0;
67227 }
67228 return nores;
67229 });
67230 Clazz_defineMethod (c$, "getSymbolmatrix", 
67231  function () {
67232 return (this.isNa) ? jalview.schemes.ResidueProperties.nucleotideIndex : jalview.schemes.ResidueProperties.aaIndex;
67233 });
67234 Clazz_defineMethod (c$, "encode", 
67235 function () {
67236 var nores = this.initMatrixGetNoRes ();
67237 var sindex = this.getSymbolmatrix ();
67238 for (var i = 0; i < this.getSequence ().length; i++) {
67239 var aanum = nores - 1;
67240 try {
67241 aanum = sindex[this.getCharAt (i).charCodeAt (0)];
67242 } catch (e) {
67243 if (Clazz_exceptionOf (e, NullPointerException)) {
67244 aanum = nores - 1;
67245 } else {
67246 throw e;
67247 }
67248 }
67249 if (aanum >= nores) {
67250 aanum = nores - 1;
67251 }this.dbinary[(i * nores) + aanum] = 1.0;
67252 }
67253 });
67254 Clazz_defineMethod (c$, "matrixEncode", 
67255 function (matrix) {
67256 if (this.isNa != matrix.isDNA ()) {
67257 throw Clazz_innerTypeInstance (jalview.datamodel.BinarySequence.InvalidSequenceTypeException, this, null, "matrix " + matrix.getClass ().getCanonicalName () + " is not a valid matrix for " + (this.isNa ? "nucleotide" : "protein") + "sequences");
67258 }this.matrixEncode (matrix.isDNA () ? jalview.schemes.ResidueProperties.nucleotideIndex : jalview.schemes.ResidueProperties.aaIndex, matrix.getMatrix ());
67259 }, "jalview.schemes.ScoreMatrix");
67260 Clazz_defineMethod (c$, "matrixEncode", 
67261  function (aaIndex, matrix) {
67262 var nores = this.initMatrixGetNoRes ();
67263 for (var i = 0, iSize = this.getSequence ().length; i < iSize; i++) {
67264 var aanum = nores - 1;
67265 try {
67266 aanum = aaIndex[this.getCharAt (i).charCodeAt (0)];
67267 } catch (e) {
67268 if (Clazz_exceptionOf (e, NullPointerException)) {
67269 aanum = nores - 1;
67270 } else {
67271 throw e;
67272 }
67273 }
67274 if (aanum >= nores) {
67275 aanum = nores - 1;
67276 }for (var j = 0; j < nores; j++) {
67277 this.dbinary[(i * nores) + j] = matrix[aanum][j];
67278 }
67279 }
67280 }, "~A,~A");
67281 Clazz_defineMethod (c$, "toBinaryString", 
67282 function () {
67283 var out = "";
67284 for (var i = 0; i < this.binary.length; i++) {
67285 out += ( new Integer (this.binary[i])).toString ();
67286 if (i < (this.binary.length - 1)) {
67287 out += " ";
67288 }}
67289 return out;
67290 });
67291 Clazz_defineMethod (c$, "getDBinary", 
67292 function () {
67293 return this.dbinary;
67294 });
67295 c$.$BinarySequence$InvalidSequenceTypeException$ = function () {
67296 Clazz_pu$h(self.c$);
67297 c$ = Clazz_decorateAsClass (function () {
67298 Clazz_prepareCallback (this, arguments);
67299 Clazz_instantialize (this, arguments);
67300 }, jalview.datamodel.BinarySequence, "InvalidSequenceTypeException", Exception);
67301 c$ = Clazz_p0p ();
67302 };
67303 });
67304 Clazz_declarePackage ("jalview.math");
67305 Clazz_load (null, "jalview.math.Matrix", ["jalview.util.Format", "$.MessageManager", "java.lang.Exception"], function () {
67306 c$ = Clazz_decorateAsClass (function () {
67307 this.value = null;
67308 this.rows = 0;
67309 this.cols = 0;
67310 this.d = null;
67311 this.e = null;
67312 this.maxIter = 45;
67313 Clazz_instantialize (this, arguments);
67314 }, jalview.math, "Matrix");
67315 Clazz_makeConstructor (c$, 
67316 function (value, rows, cols) {
67317 this.rows = rows;
67318 this.cols = cols;
67319 this.value = value;
67320 }, "~A,~N,~N");
67321 Clazz_defineMethod (c$, "transpose", 
67322 function () {
67323 var out =  Clazz_newDoubleArray (this.cols, this.rows, 0);
67324 for (var i = 0; i < this.cols; i++) {
67325 for (var j = 0; j < this.rows; j++) {
67326 out[i][j] = this.value[j][i];
67327 }
67328 }
67329 return  new jalview.math.Matrix (out, this.cols, this.rows);
67330 });
67331 Clazz_defineMethod (c$, "print", 
67332 function (ps) {
67333 for (var i = 0; i < this.rows; i++) {
67334 for (var j = 0; j < this.cols; j++) {
67335 jalview.util.Format.printDouble (ps, "%8.2f", this.value[i][j]);
67336 }
67337 ps.println ();
67338 }
67339 }, "java.io.PrintStream");
67340 Clazz_defineMethod (c$, "preMultiply", 
67341 function ($in) {
67342 var tmp =  Clazz_newDoubleArray ($in.rows, this.cols, 0);
67343 for (var i = 0; i < $in.rows; i++) {
67344 for (var j = 0; j < this.cols; j++) {
67345 tmp[i][j] = 0.0;
67346 for (var k = 0; k < $in.cols; k++) {
67347 tmp[i][j] += ($in.value[i][k] * this.value[k][j]);
67348 }
67349 }
67350 }
67351 return  new jalview.math.Matrix (tmp, $in.rows, this.cols);
67352 }, "jalview.math.Matrix");
67353 Clazz_defineMethod (c$, "vectorPostMultiply", 
67354 function ($in) {
67355 var out =  Clazz_newDoubleArray ($in.length, 0);
67356 for (var i = 0; i < $in.length; i++) {
67357 out[i] = 0.0;
67358 for (var k = 0; k < $in.length; k++) {
67359 out[i] += (this.value[i][k] * $in[k]);
67360 }
67361 }
67362 return out;
67363 }, "~A");
67364 Clazz_defineMethod (c$, "postMultiply", 
67365 function ($in) {
67366 var out =  Clazz_newDoubleArray (this.rows, $in.cols, 0);
67367 for (var i = 0; i < this.rows; i++) {
67368 for (var j = 0; j < $in.cols; j++) {
67369 out[i][j] = 0.0;
67370 for (var k = 0; k < this.rows; k++) {
67371 out[i][j] = out[i][j] + (this.value[i][k] * $in.value[k][j]);
67372 }
67373 }
67374 }
67375 return  new jalview.math.Matrix (out, this.cols, $in.rows);
67376 }, "jalview.math.Matrix");
67377 Clazz_defineMethod (c$, "copy", 
67378 function () {
67379 var newmat =  Clazz_newDoubleArray (this.rows, this.cols, 0);
67380 for (var i = 0; i < this.rows; i++) {
67381 for (var j = 0; j < this.cols; j++) {
67382 newmat[i][j] = this.value[i][j];
67383 }
67384 }
67385 return  new jalview.math.Matrix (newmat, this.rows, this.cols);
67386 });
67387 Clazz_defineMethod (c$, "tred", 
67388 function () {
67389 var n = this.rows;
67390 var l;
67391 var k;
67392 var j;
67393 var i;
67394 var scale;
67395 var hh;
67396 var h;
67397 var g;
67398 var f;
67399 this.d =  Clazz_newDoubleArray (this.rows, 0);
67400 this.e =  Clazz_newDoubleArray (this.rows, 0);
67401 for (i = n; i >= 2; i--) {
67402 l = i - 1;
67403 h = 0.0;
67404 scale = 0.0;
67405 if (l > 1) {
67406 for (k = 1; k <= l; k++) {
67407 scale += Math.abs (this.value[i - 1][k - 1]);
67408 }
67409 if (scale == 0.0) {
67410 this.e[i - 1] = this.value[i - 1][l - 1];
67411 } else {
67412 for (k = 1; k <= l; k++) {
67413 this.value[i - 1][k - 1] /= scale;
67414 h += (this.value[i - 1][k - 1] * this.value[i - 1][k - 1]);
67415 }
67416 f = this.value[i - 1][l - 1];
67417 if (f > 0) {
67418 g = -1.0 * Math.sqrt (h);
67419 } else {
67420 g = Math.sqrt (h);
67421 }this.e[i - 1] = scale * g;
67422 h -= (f * g);
67423 this.value[i - 1][l - 1] = f - g;
67424 f = 0.0;
67425 for (j = 1; j <= l; j++) {
67426 this.value[j - 1][i - 1] = this.value[i - 1][j - 1] / h;
67427 g = 0.0;
67428 for (k = 1; k <= j; k++) {
67429 g += (this.value[j - 1][k - 1] * this.value[i - 1][k - 1]);
67430 }
67431 for (k = j + 1; k <= l; k++) {
67432 g += (this.value[k - 1][j - 1] * this.value[i - 1][k - 1]);
67433 }
67434 this.e[j - 1] = g / h;
67435 f += (this.e[j - 1] * this.value[i - 1][j - 1]);
67436 }
67437 hh = f / (h + h);
67438 for (j = 1; j <= l; j++) {
67439 f = this.value[i - 1][j - 1];
67440 g = this.e[j - 1] - (hh * f);
67441 this.e[j - 1] = g;
67442 for (k = 1; k <= j; k++) {
67443 this.value[j - 1][k - 1] -= ((f * this.e[k - 1]) + (g * this.value[i - 1][k - 1]));
67444 }
67445 }
67446 }} else {
67447 this.e[i - 1] = this.value[i - 1][l - 1];
67448 }this.d[i - 1] = h;
67449 }
67450 this.d[0] = 0.0;
67451 this.e[0] = 0.0;
67452 for (i = 1; i <= n; i++) {
67453 l = i - 1;
67454 if (this.d[i - 1] != 0.0) {
67455 for (j = 1; j <= l; j++) {
67456 g = 0.0;
67457 for (k = 1; k <= l; k++) {
67458 g += (this.value[i - 1][k - 1] * this.value[k - 1][j - 1]);
67459 }
67460 for (k = 1; k <= l; k++) {
67461 this.value[k - 1][j - 1] -= (g * this.value[k - 1][i - 1]);
67462 }
67463 }
67464 }this.d[i - 1] = this.value[i - 1][i - 1];
67465 this.value[i - 1][i - 1] = 1.0;
67466 for (j = 1; j <= l; j++) {
67467 this.value[j - 1][i - 1] = 0.0;
67468 this.value[i - 1][j - 1] = 0.0;
67469 }
67470 }
67471 });
67472 Clazz_defineMethod (c$, "tqli", 
67473 function () {
67474 var n = this.rows;
67475 var m;
67476 var l;
67477 var iter;
67478 var i;
67479 var k;
67480 var s;
67481 var r;
67482 var p;
67483 ;var g;
67484 var f;
67485 var dd;
67486 var c;
67487 var b;
67488 for (i = 2; i <= n; i++) {
67489 this.e[i - 2] = this.e[i - 1];
67490 }
67491 this.e[n - 1] = 0.0;
67492 for (l = 1; l <= n; l++) {
67493 iter = 0;
67494 do {
67495 for (m = l; m <= (n - 1); m++) {
67496 dd = Math.abs (this.d[m - 1]) + Math.abs (this.d[m]);
67497 if ((Math.abs (this.e[m - 1]) + dd) == dd) {
67498 break;
67499 }}
67500 if (m != l) {
67501 iter++;
67502 if (iter == this.maxIter) {
67503 throw  new Exception (jalview.util.MessageManager.formatMessage ("exception.matrix_too_many_iteration",  Clazz_newArray (-1, ["tqli", Integer.$valueOf (this.maxIter).toString ()])));
67504 } else {
67505 }g = (this.d[l] - this.d[l - 1]) / (2.0 * this.e[l - 1]);
67506 r = Math.sqrt ((g * g) + 1.0);
67507 g = this.d[m - 1] - this.d[l - 1] + (this.e[l - 1] / (g + this.sign (r, g)));
67508 c = 1.0;
67509 s = c;
67510 p = 0.0;
67511 for (i = m - 1; i >= l; i--) {
67512 f = s * this.e[i - 1];
67513 b = c * this.e[i - 1];
67514 if (Math.abs (f) >= Math.abs (g)) {
67515 c = g / f;
67516 r = Math.sqrt ((c * c) + 1.0);
67517 this.e[i] = f * r;
67518 s = 1.0 / r;
67519 c *= s;
67520 } else {
67521 s = f / g;
67522 r = Math.sqrt ((s * s) + 1.0);
67523 this.e[i] = g * r;
67524 c = 1.0 / r;
67525 s *= c;
67526 }g = this.d[i] - p;
67527 r = ((this.d[i - 1] - g) * s) + (2.0 * c * b);
67528 p = s * r;
67529 this.d[i] = g + p;
67530 g = (c * r) - b;
67531 for (k = 1; k <= n; k++) {
67532 f = this.value[k - 1][i];
67533 this.value[k - 1][i] = (s * this.value[k - 1][i - 1]) + (c * f);
67534 this.value[k - 1][i - 1] = (c * this.value[k - 1][i - 1]) - (s * f);
67535 }
67536 }
67537 this.d[l - 1] = this.d[l - 1] - p;
67538 this.e[l - 1] = g;
67539 this.e[m - 1] = 0.0;
67540 }} while (m != l);
67541 }
67542 });
67543 Clazz_defineMethod (c$, "tred2", 
67544 function () {
67545 var n = this.rows;
67546 var l;
67547 var k;
67548 var j;
67549 var i;
67550 var scale;
67551 var hh;
67552 var h;
67553 var g;
67554 var f;
67555 this.d =  Clazz_newDoubleArray (this.rows, 0);
67556 this.e =  Clazz_newDoubleArray (this.rows, 0);
67557 for (i = n - 1; i >= 1; i--) {
67558 l = i - 1;
67559 h = 0.0;
67560 scale = 0.0;
67561 if (l > 0) {
67562 for (k = 0; k < l; k++) {
67563 scale += Math.abs (this.value[i][k]);
67564 }
67565 if (scale == 0.0) {
67566 this.e[i] = this.value[i][l];
67567 } else {
67568 for (k = 0; k < l; k++) {
67569 this.value[i][k] /= scale;
67570 h += (this.value[i][k] * this.value[i][k]);
67571 }
67572 f = this.value[i][l];
67573 if (f > 0) {
67574 g = -1.0 * Math.sqrt (h);
67575 } else {
67576 g = Math.sqrt (h);
67577 }this.e[i] = scale * g;
67578 h -= (f * g);
67579 this.value[i][l] = f - g;
67580 f = 0.0;
67581 for (j = 0; j < l; j++) {
67582 this.value[j][i] = this.value[i][j] / h;
67583 g = 0.0;
67584 for (k = 0; k < j; k++) {
67585 g += (this.value[j][k] * this.value[i][k]);
67586 }
67587 for (k = j; k < l; k++) {
67588 g += (this.value[k][j] * this.value[i][k]);
67589 }
67590 this.e[j] = g / h;
67591 f += (this.e[j] * this.value[i][j]);
67592 }
67593 hh = f / (h + h);
67594 for (j = 0; j < l; j++) {
67595 f = this.value[i][j];
67596 g = this.e[j] - (hh * f);
67597 this.e[j] = g;
67598 for (k = 0; k < j; k++) {
67599 this.value[j][k] -= ((f * this.e[k]) + (g * this.value[i][k]));
67600 }
67601 }
67602 }} else {
67603 this.e[i] = this.value[i][l];
67604 }this.d[i] = h;
67605 }
67606 this.d[0] = 0.0;
67607 this.e[0] = 0.0;
67608 for (i = 0; i < n; i++) {
67609 l = i - 1;
67610 if (this.d[i] != 0.0) {
67611 for (j = 0; j < l; j++) {
67612 g = 0.0;
67613 for (k = 0; k < l; k++) {
67614 g += (this.value[i][k] * this.value[k][j]);
67615 }
67616 for (k = 0; k < l; k++) {
67617 this.value[k][j] -= (g * this.value[k][i]);
67618 }
67619 }
67620 }this.d[i] = this.value[i][i];
67621 this.value[i][i] = 1.0;
67622 for (j = 0; j < l; j++) {
67623 this.value[j][i] = 0.0;
67624 this.value[i][j] = 0.0;
67625 }
67626 }
67627 });
67628 Clazz_defineMethod (c$, "tqli2", 
67629 function () {
67630 var n = this.rows;
67631 var m;
67632 var l;
67633 var iter;
67634 var i;
67635 var k;
67636 var s;
67637 var r;
67638 var p;
67639 ;var g;
67640 var f;
67641 var dd;
67642 var c;
67643 var b;
67644 for (i = 2; i <= n; i++) {
67645 this.e[i - 2] = this.e[i - 1];
67646 }
67647 this.e[n - 1] = 0.0;
67648 for (l = 1; l <= n; l++) {
67649 iter = 0;
67650 do {
67651 for (m = l; m <= (n - 1); m++) {
67652 dd = Math.abs (this.d[m - 1]) + Math.abs (this.d[m]);
67653 if ((Math.abs (this.e[m - 1]) + dd) == dd) {
67654 break;
67655 }}
67656 if (m != l) {
67657 iter++;
67658 if (iter == this.maxIter) {
67659 throw  new Exception (jalview.util.MessageManager.formatMessage ("exception.matrix_too_many_iteration",  Clazz_newArray (-1, ["tqli2", Integer.$valueOf (this.maxIter).toString ()])));
67660 } else {
67661 }g = (this.d[l] - this.d[l - 1]) / (2.0 * this.e[l - 1]);
67662 r = Math.sqrt ((g * g) + 1.0);
67663 g = this.d[m - 1] - this.d[l - 1] + (this.e[l - 1] / (g + this.sign (r, g)));
67664 c = 1.0;
67665 s = c;
67666 p = 0.0;
67667 for (i = m - 1; i >= l; i--) {
67668 f = s * this.e[i - 1];
67669 b = c * this.e[i - 1];
67670 if (Math.abs (f) >= Math.abs (g)) {
67671 c = g / f;
67672 r = Math.sqrt ((c * c) + 1.0);
67673 this.e[i] = f * r;
67674 s = 1.0 / r;
67675 c *= s;
67676 } else {
67677 s = f / g;
67678 r = Math.sqrt ((s * s) + 1.0);
67679 this.e[i] = g * r;
67680 c = 1.0 / r;
67681 s *= c;
67682 }g = this.d[i] - p;
67683 r = ((this.d[i - 1] - g) * s) + (2.0 * c * b);
67684 p = s * r;
67685 this.d[i] = g + p;
67686 g = (c * r) - b;
67687 for (k = 1; k <= n; k++) {
67688 f = this.value[k - 1][i];
67689 this.value[k - 1][i] = (s * this.value[k - 1][i - 1]) + (c * f);
67690 this.value[k - 1][i - 1] = (c * this.value[k - 1][i - 1]) - (s * f);
67691 }
67692 }
67693 this.d[l - 1] = this.d[l - 1] - p;
67694 this.e[l - 1] = g;
67695 this.e[m - 1] = 0.0;
67696 }} while (m != l);
67697 }
67698 });
67699 Clazz_defineMethod (c$, "sign", 
67700 function (a, b) {
67701 if (b < 0) {
67702 return -Math.abs (a);
67703 } else {
67704 return Math.abs (a);
67705 }}, "~N,~N");
67706 Clazz_defineMethod (c$, "getColumn", 
67707 function (n) {
67708 var out =  Clazz_newDoubleArray (this.rows, 0);
67709 for (var i = 0; i < this.rows; i++) {
67710 out[i] = this.value[i][n];
67711 }
67712 return out;
67713 }, "~N");
67714 Clazz_defineMethod (c$, "printD", 
67715 function (ps) {
67716 for (var j = 0; j < this.rows; j++) {
67717 jalview.util.Format.printDouble (ps, "%15.4e", this.d[j]);
67718 }
67719 }, "java.io.PrintStream");
67720 Clazz_defineMethod (c$, "printE", 
67721 function (ps) {
67722 for (var j = 0; j < this.rows; j++) {
67723 jalview.util.Format.printDouble (ps, "%15.4e", this.e[j]);
67724 }
67725 }, "java.io.PrintStream");
67726 });
67727 Clazz_declarePackage ("jalview.datamodel");
67728 c$ = Clazz_decorateAsClass (function () {
67729 this.isPlaceholder = false;
67730 this.sequence = null;
67731 this.coord = null;
67732 Clazz_instantialize (this, arguments);
67733 }, jalview.datamodel, "SequencePoint");
67734 Clazz_makeConstructor (c$, 
67735 function (sequence, coord) {
67736 this.sequence = sequence;
67737 this.coord = coord;
67738 }, "jalview.datamodel.SequenceI,~A");
67739 Clazz_declarePackage ("jalview.appletgui");
67740 Clazz_load (["awt2swing.Panel", "java.awt.event.ActionListener", "awt2swing.Button", "$.ScrollPane", "$.TextArea", "java.awt.BorderLayout", "java.util.Vector"], "jalview.appletgui.PairwiseAlignPanel", ["jalview.analysis.AlignSeq", "jalview.appletgui.AlignFrame", "jalview.datamodel.Alignment", "jalview.util.Format", "$.MessageManager", "java.awt.Font"], function () {
67741 c$ = Clazz_decorateAsClass (function () {
67742 this.sequences = null;
67743 this.ap = null;
67744 this.scrollPane = null;
67745 this.textarea = null;
67746 this.viewInEditorButton = null;
67747 this.jPanel1 = null;
67748 this.borderLayout1 = null;
67749 Clazz_instantialize (this, arguments);
67750 }, jalview.appletgui, "PairwiseAlignPanel", awt2swing.Panel, java.awt.event.ActionListener);
67751 Clazz_prepareFields (c$, function () {
67752 this.sequences =  new java.util.Vector ();
67753 this.scrollPane =  new awt2swing.ScrollPane ();
67754 this.textarea =  new awt2swing.TextArea ();
67755 this.viewInEditorButton =  new awt2swing.Button ();
67756 this.jPanel1 =  new awt2swing.Panel ();
67757 this.borderLayout1 =  new java.awt.BorderLayout ();
67758 });
67759 Clazz_makeConstructor (c$, 
67760 function (ap) {
67761 Clazz_superConstructor (this, jalview.appletgui.PairwiseAlignPanel, []);
67762 try {
67763 this.jbInit ();
67764 } catch (e) {
67765 if (Clazz_exceptionOf (e, Exception)) {
67766 e.printStackTrace ();
67767 } else {
67768 throw e;
67769 }
67770 }
67771 this.ap = ap;
67772 this.sequences =  new java.util.Vector ();
67773 var seqs;
67774 var seqStrings = ap.av.getViewAsString (true);
67775 if (ap.av.getSelectionGroup () == null) {
67776 seqs = ap.av.getAlignment ().getSequencesArray ();
67777 } else {
67778 seqs = ap.av.getSelectionGroup ().getSequencesInOrder (ap.av.getAlignment ());
67779 }var scores =  Clazz_newFloatArray (seqs.length, seqs.length, 0);
67780 var totscore = 0;
67781 var count = ap.av.getSelectionGroup ().getSize ();
67782 var type = (ap.av.getAlignment ().isNucleotide ()) ? "dna" : "pep";
67783 var seq;
67784 for (var i = 1; i < count; i++) {
67785 for (var j = 0; j < i; j++) {
67786 var as =  new jalview.analysis.AlignSeq (seqs[i], seqStrings[i], seqs[j], seqStrings[j], type);
67787 if (as.s1str.length == 0 || as.s2str.length == 0) {
67788 continue;
67789 }as.calcScoreMatrix ();
67790 as.traceAlignment ();
67791 as.printAlignment (System.out);
67792 scores[i][j] = as.getMaxScore () / as.getASeq1 ().length;
67793 totscore = totscore + scores[i][j];
67794 this.textarea.append (as.getOutput ());
67795 this.sequences.add (as.getAlignedSeq1 ());
67796 this.sequences.add (as.getAlignedSeq1 ());
67797 }
67798 }
67799 if (count > 2) {
67800 System.out.println ("Pairwise alignment scaled similarity score matrix\n");
67801 for (var i = 0; i < count; i++) {
67802 jalview.util.Format.print (System.out, "%s \n", ("" + i) + " " + seqs[i].getName ());
67803 }
67804 System.out.println ("\n");
67805 for (var i = 0; i < count; i++) {
67806 for (var j = 0; j < i; j++) {
67807 jalview.util.Format.printDouble (System.out, "%7.3f", scores[i][j] / totscore);
67808 }
67809 }
67810 System.out.println ("\n");
67811 }}, "jalview.appletgui.AlignmentPanel");
67812 Clazz_overrideMethod (c$, "actionPerformed", 
67813 function (evt) {
67814 if (evt.getSource () === this.viewInEditorButton) {
67815 this.viewInEditorButton_actionPerformed ();
67816 }}, "java.awt.event.ActionEvent");
67817 Clazz_defineMethod (c$, "viewInEditorButton_actionPerformed", 
67818 function () {
67819 var seq =  new Array (this.sequences.size ());
67820 for (var i = 0; i < this.sequences.size (); i++) {
67821 seq[i] = this.sequences.elementAt (i);
67822 }
67823  new jalview.appletgui.AlignFrame ( new jalview.datamodel.Alignment (seq), this.ap.av.applet, "Pairwise Aligned Sequences", false);
67824 });
67825 Clazz_defineMethod (c$, "jbInit", 
67826  function () {
67827 this.setLayout (this.borderLayout1);
67828 this.textarea.setFont ( new java.awt.Font ("Monospaced", 0, 12));
67829 this.textarea.setText ("");
67830 this.viewInEditorButton.setFont ( new java.awt.Font ("Verdana", 0, 12));
67831 this.viewInEditorButton.setLabel (jalview.util.MessageManager.getString ("label.view_alignment_editor"));
67832 this.viewInEditorButton.addActionListener (this);
67833 this.add (this.scrollPane, "Center");
67834 this.scrollPane.add (this.textarea);
67835 this.add (this.jPanel1, "South");
67836 this.jPanel1.add (this.viewInEditorButton, null);
67837 });
67838 });
67839 Clazz_declarePackage ("jalview.appletgui");
67840 Clazz_load (["jalview.appletgui.SliderPanel", "java.awt.event.WindowListener", "java.util.Stack"], "jalview.appletgui.RedundancyPanel", ["awt2swing.Frame", "jalview.analysis.AlignSeq", "jalview.appletgui.PaintRefresher", "jalview.bin.JalviewLite", "jalview.commands.EditCommand", "jalview.util.MessageManager", "java.awt.event.AdjustmentListener", "java.lang.Thread", "java.util.ArrayList", "$.Vector"], function () {
67841 c$ = Clazz_decorateAsClass (function () {
67842 this.historyList = null;
67843 this.redundancy = null;
67844 this.originalSequences = null;
67845 this.frame = null;
67846 this.redundantSeqs = null;
67847 Clazz_instantialize (this, arguments);
67848 }, jalview.appletgui, "RedundancyPanel", jalview.appletgui.SliderPanel, [Runnable, java.awt.event.WindowListener]);
67849 Clazz_prepareFields (c$, function () {
67850 this.historyList =  new java.util.Stack ();
67851 });
67852 Clazz_makeConstructor (c$, 
67853 function (ap) {
67854 Clazz_superConstructor (this, jalview.appletgui.RedundancyPanel, [ap, 0, false, null]);
67855 this.redundantSeqs =  new java.util.Vector ();
67856 this.ap = ap;
67857 this.undoButton.setVisible (true);
67858 this.applyButton.setVisible (true);
67859 this.allGroupsCheck.setVisible (false);
67860 this.label.setText (jalview.util.MessageManager.getString ("label.enter_redundancy_threshold"));
67861 this.valueField.setText ("100");
67862 this.slider.setVisibleAmount (1);
67863 this.slider.setMinimum (0);
67864 this.slider.setMaximum (100 + this.slider.getVisibleAmount ());
67865 this.slider.setValue (100);
67866 this.slider.addAdjustmentListener (((Clazz_isClassDefined ("jalview.appletgui.RedundancyPanel$1") ? 0 : jalview.appletgui.RedundancyPanel.$RedundancyPanel$1$ ()), Clazz_innerTypeInstance (jalview.appletgui.RedundancyPanel$1, this, null)));
67867 this.frame =  new awt2swing.Frame ();
67868 this.frame.add (this);
67869 jalview.bin.JalviewLite.addFrame (this.frame, jalview.util.MessageManager.getString ("label.redundancy_threshold_selection"), 400, 100);
67870 this.frame.addWindowListener (this);
67871 var worker =  new Thread (this);
67872 worker.start ();
67873 }, "jalview.appletgui.AlignmentPanel");
67874 Clazz_overrideMethod (c$, "run", 
67875 function () {
67876 this.label.setText (jalview.util.MessageManager.getString ("label.calculating"));
67877 this.slider.setVisible (false);
67878 this.applyButton.setEnabled (false);
67879 this.valueField.setVisible (false);
67880 this.validate ();
67881 var omitHidden = null;
67882 var sg = this.ap.av.getSelectionGroup ();
67883 var height;
67884 var start;
67885 var end;
67886 if ((sg != null) && (sg.getSize () >= 1)) {
67887 this.originalSequences = sg.getSequencesInOrder (this.ap.av.getAlignment ());
67888 start = sg.getStartRes ();
67889 end = sg.getEndRes ();
67890 } else {
67891 this.originalSequences = this.ap.av.getAlignment ().getSequencesArray ();
67892 start = 0;
67893 end = this.ap.av.getAlignment ().getWidth ();
67894 }height = this.originalSequences.length;
67895 this.redundancy = jalview.analysis.AlignSeq.computeRedundancyMatrix (this.originalSequences, omitHidden, start, end, false);
67896 this.label.setText (jalview.util.MessageManager.getString ("label.enter_redundancy_threshold"));
67897 this.slider.setVisible (true);
67898 this.applyButton.setEnabled (true);
67899 this.valueField.setVisible (true);
67900 this.validate ();
67901 this.sliderValueChanged ();
67902 });
67903 Clazz_defineMethod (c$, "sliderValueChanged", 
67904 function () {
67905 if (this.redundancy == null) {
67906 return;
67907 }var value = this.slider.getValue ();
67908 var redundantSequences =  new java.util.ArrayList ();
67909 for (var i = 0; i < this.redundancy.length; i++) {
67910 if (value <= this.redundancy[i]) {
67911 redundantSequences.add (this.originalSequences[i]);
67912 }}
67913 this.ap.idPanel.idCanvas.setHighlighted (redundantSequences);
67914 jalview.appletgui.PaintRefresher.Refresh (this, this.ap.av.getSequenceSetId (), true, true);
67915 });
67916 Clazz_overrideMethod (c$, "applyButton_actionPerformed", 
67917 function () {
67918 var del =  new java.util.Vector ();
67919 this.undoButton.setEnabled (true);
67920 var value = this.slider.getValue ();
67921 var sg = this.ap.av.getSelectionGroup ();
67922 for (var i = 0; i < this.redundancy.length; i++) {
67923 if (value <= this.redundancy[i]) {
67924 del.addElement (this.originalSequences[i]);
67925 }}
67926 if (del.size () > 0) {
67927 var deleted =  new Array (del.size ());
67928 var width = 0;
67929 for (var i = 0; i < del.size (); i++) {
67930 deleted[i] = del.elementAt (i);
67931 if (deleted[i].getLength () > width) {
67932 width = deleted[i].getLength ();
67933 }}
67934 var cut =  new jalview.commands.EditCommand (jalview.util.MessageManager.getString ("action.remove_redundancy"), jalview.commands.EditCommand.Action.CUT, deleted, 0, width, this.ap.av.getAlignment ());
67935 var alignment = this.ap.av.getAlignment ();
67936 for (var i = 0; i < del.size (); i++) {
67937 alignment.deleteSequence (deleted[i]);
67938 if (sg != null) {
67939 sg.deleteSequence (deleted[i], false);
67940 }}
67941 this.historyList.push (cut);
67942 this.ap.alignFrame.addHistoryItem (cut);
67943 jalview.appletgui.PaintRefresher.Refresh (this, this.ap.av.getSequenceSetId (), true, true);
67944 this.ap.av.firePropertyChange ("alignment", null, this.ap.av.getAlignment ().getSequences ());
67945 }});
67946 Clazz_overrideMethod (c$, "undoButton_actionPerformed", 
67947 function () {
67948 var command = this.historyList.pop ();
67949 command.undoCommand (null);
67950 if (this.ap.av.getHistoryList ().contains (command)) {
67951 this.ap.av.getHistoryList ().remove (command);
67952 this.ap.alignFrame.updateEditMenuBar ();
67953 this.ap.av.firePropertyChange ("alignment", null, this.ap.av.getAlignment ().getSequences ());
67954 }this.ap.paintAlignment (true);
67955 if (this.historyList.size () == 0) {
67956 this.undoButton.setEnabled (false);
67957 }});
67958 Clazz_defineMethod (c$, "valueField_actionPerformed", 
67959 function (e) {
67960 try {
67961 var i = Integer.parseInt (this.valueField.getText ());
67962 this.slider.setValue (i);
67963 } catch (ex) {
67964 if (Clazz_exceptionOf (ex, Exception)) {
67965 this.valueField.setText (this.slider.getValue () + "");
67966 } else {
67967 throw ex;
67968 }
67969 }
67970 }, "java.awt.event.ActionEvent");
67971 Clazz_overrideMethod (c$, "windowOpened", 
67972 function (evt) {
67973 }, "java.awt.event.WindowEvent");
67974 Clazz_overrideMethod (c$, "windowClosing", 
67975 function (evt) {
67976 this.ap.idPanel.idCanvas.setHighlighted (null);
67977 }, "java.awt.event.WindowEvent");
67978 Clazz_overrideMethod (c$, "windowClosed", 
67979 function (evt) {
67980 }, "java.awt.event.WindowEvent");
67981 Clazz_overrideMethod (c$, "windowActivated", 
67982 function (evt) {
67983 }, "java.awt.event.WindowEvent");
67984 Clazz_overrideMethod (c$, "windowDeactivated", 
67985 function (evt) {
67986 }, "java.awt.event.WindowEvent");
67987 Clazz_overrideMethod (c$, "windowIconified", 
67988 function (evt) {
67989 }, "java.awt.event.WindowEvent");
67990 Clazz_overrideMethod (c$, "windowDeiconified", 
67991 function (evt) {
67992 }, "java.awt.event.WindowEvent");
67993 c$.$RedundancyPanel$1$ = function () {
67994 Clazz_pu$h(self.c$);
67995 c$ = Clazz_declareAnonymous (jalview.appletgui, "RedundancyPanel$1", null, java.awt.event.AdjustmentListener);
67996 Clazz_overrideMethod (c$, "adjustmentValueChanged", 
67997 function (evt) {
67998 this.b$["jalview.appletgui.RedundancyPanel"].valueField.setText (this.b$["jalview.appletgui.RedundancyPanel"].slider.getValue () + "");
67999 this.b$["jalview.appletgui.RedundancyPanel"].sliderValueChanged ();
68000 }, "java.awt.event.AdjustmentEvent");
68001 c$ = Clazz_p0p ();
68002 };
68003 });
68004 Clazz_declarePackage ("jalview.appletgui");
68005 Clazz_load (["jalview.appletgui.EmbmenuFrame", "java.awt.event.ActionListener", "$.ItemListener", "java.lang.Thread", "awt2swing.CheckboxMenuItem", "$.Menu", "$.MenuBar", "$.MenuItem", "$.ScrollPane", "java.awt.BorderLayout"], "jalview.appletgui.TreePanel", ["awt2swing.Frame", "jalview.analysis.NJTree", "jalview.api.analysis.ViewBasedAnalysisI", "jalview.appletgui.AlignFrame", "$.CutAndPasteTransfer", "$.FontChooser", "$.TreeCanvas", "jalview.bin.JalviewLite", "jalview.datamodel.Alignment", "jalview.io.NewickFile", "jalview.schemes.ResidueProperties", "jalview.util.MessageManager", "java.awt.Color", "$.Font"], function () {
68006 c$ = Clazz_decorateAsClass (function () {
68007 this.seq = null;
68008 this.$type = null;
68009 this.pwtype = null;
68010 this.start = 0;
68011 this.end = 0;
68012 this.treeCanvas = null;
68013 this.tree = null;
68014 this.ap = null;
68015 this.av = null;
68016 if (!Clazz_isClassDefined ("jalview.appletgui.TreePanel.TreeLoader")) {
68017 jalview.appletgui.TreePanel.$TreePanel$TreeLoader$ ();
68018 }
68019 this.borderLayout1 = null;
68020 this.scrollPane = null;
68021 this.jMenuBar1 = null;
68022 this.jMenu2 = null;
68023 this.fontSize = null;
68024 this.bootstrapMenu = null;
68025 this.distanceMenu = null;
68026 this.placeholdersMenu = null;
68027 this.fitToWindow = null;
68028 this.fileMenu = null;
68029 this.newickOutput = null;
68030 this.inputData = null;
68031 Clazz_instantialize (this, arguments);
68032 }, jalview.appletgui, "TreePanel", jalview.appletgui.EmbmenuFrame, [java.awt.event.ActionListener, java.awt.event.ItemListener]);
68033 Clazz_prepareFields (c$, function () {
68034 this.borderLayout1 =  new java.awt.BorderLayout ();
68035 this.scrollPane =  new awt2swing.ScrollPane ();
68036 this.jMenuBar1 =  new awt2swing.MenuBar ();
68037 this.jMenu2 =  new awt2swing.Menu ();
68038 this.fontSize =  new awt2swing.MenuItem ();
68039 this.bootstrapMenu =  new awt2swing.CheckboxMenuItem ();
68040 this.distanceMenu =  new awt2swing.CheckboxMenuItem ();
68041 this.placeholdersMenu =  new awt2swing.CheckboxMenuItem ();
68042 this.fitToWindow =  new awt2swing.CheckboxMenuItem ();
68043 this.fileMenu =  new awt2swing.Menu ();
68044 this.newickOutput =  new awt2swing.MenuItem ();
68045 this.inputData =  new awt2swing.MenuItem ();
68046 });
68047 Clazz_defineMethod (c$, "getTree", 
68048 function () {
68049 return this.tree;
68050 });
68051 Clazz_defineMethod (c$, "finalize", 
68052 function () {
68053 this.ap = null;
68054 this.av = null;
68055 Clazz_superCall (this, jalview.appletgui.TreePanel, "finalize", []);
68056 });
68057 Clazz_makeConstructor (c$, 
68058 function (ap, type, pwtype) {
68059 Clazz_superConstructor (this, jalview.appletgui.TreePanel, []);
68060 try {
68061 this.jbInit ();
68062 this.setMenuBar (this.jMenuBar1);
68063 } catch (ex) {
68064 if (Clazz_exceptionOf (ex, Exception)) {
68065 ex.printStackTrace ();
68066 } else {
68067 throw ex;
68068 }
68069 }
68070 this.initTreePanel (ap, type, pwtype, null);
68071 }, "jalview.appletgui.AlignmentPanel,~S,~S");
68072 Clazz_makeConstructor (c$, 
68073 function (ap, type, pwtype, newtree) {
68074 Clazz_superConstructor (this, jalview.appletgui.TreePanel, []);
68075 try {
68076 this.jbInit ();
68077 this.setMenuBar (this.jMenuBar1);
68078 } catch (e) {
68079 if (Clazz_exceptionOf (e, Exception)) {
68080 e.printStackTrace ();
68081 } else {
68082 throw e;
68083 }
68084 }
68085 this.initTreePanel (ap, type, pwtype, newtree);
68086 }, "jalview.appletgui.AlignmentPanel,~S,~S,jalview.io.NewickFile");
68087 Clazz_defineMethod (c$, "initTreePanel", 
68088 function (ap, type, pwtype, newTree) {
68089 this.ap = ap;
68090 this.av = ap.av;
68091 this.$type = type;
68092 this.pwtype = pwtype;
68093 this.treeCanvas =  new jalview.appletgui.TreeCanvas (ap, this.scrollPane);
68094 var tl = Clazz_innerTypeInstance (jalview.appletgui.TreePanel.TreeLoader, this, null, newTree);
68095 tl.start ();
68096 this.embedMenuIfNeeded (this.treeCanvas);
68097 this.scrollPane.add (this.treeCanvas, "Center");
68098 }, "jalview.appletgui.AlignmentPanel,~S,~S,jalview.io.NewickFile");
68099 Clazz_defineMethod (c$, "showOriginalData", 
68100 function () {
68101 if (this.tree.seqData != null) {
68102 var gc = '-';
68103 try {
68104 gc = this.av.getGapCharacter ();
68105 } catch (ex) {
68106 if (Clazz_exceptionOf (ex, Exception)) {
68107 } else {
68108 throw ex;
68109 }
68110 }
68111 ;var alAndColsel = this.tree.seqData.getAlignmentAndColumnSelection (gc);
68112 if (alAndColsel != null && alAndColsel[0] != null) {
68113 var al =  new jalview.datamodel.Alignment (alAndColsel[0]);
68114 var af =  new jalview.appletgui.AlignFrame (al, this.av.applet, "Original Data for Tree", false);
68115 af.viewport.setHiddenColumns (alAndColsel[1]);
68116 }} else {
68117 System.out.println ("Original Tree Data not available");
68118 }});
68119 Clazz_overrideMethod (c$, "actionPerformed", 
68120 function (evt) {
68121 if (evt.getSource () === this.newickOutput) {
68122 this.newickOutput_actionPerformed ();
68123 } else if (evt.getSource () === this.fontSize) {
68124 this.fontSize_actionPerformed ();
68125 } else if (evt.getSource () === this.inputData) {
68126 this.showOriginalData ();
68127 }}, "java.awt.event.ActionEvent");
68128 Clazz_overrideMethod (c$, "itemStateChanged", 
68129 function (evt) {
68130 if (evt.getSource () === this.fitToWindow) {
68131 this.treeCanvas.fitToWindow = this.fitToWindow.getState ();
68132 } else if (evt.getSource () === this.distanceMenu) {
68133 this.treeCanvas.setShowDistances (this.distanceMenu.getState ());
68134 } else if (evt.getSource () === this.bootstrapMenu) {
68135 this.treeCanvas.setShowBootstrap (this.bootstrapMenu.getState ());
68136 } else if (evt.getSource () === this.placeholdersMenu) {
68137 this.treeCanvas.setMarkPlaceholders (this.placeholdersMenu.getState ());
68138 }this.treeCanvas.repaint ();
68139 }, "java.awt.event.ItemEvent");
68140 Clazz_defineMethod (c$, "newickOutput_actionPerformed", 
68141 function () {
68142 var fout =  new jalview.io.NewickFile (this.tree.getTopNode ());
68143 var output = fout.print (false, true);
68144 var cap =  new jalview.appletgui.CutAndPasteTransfer (false, null);
68145 cap.setText (output);
68146 var frame =  new awt2swing.Frame ();
68147 frame.add (cap);
68148 jalview.bin.JalviewLite.addFrame (frame, this.$type + " " + this.pwtype, 500, 100);
68149 });
68150 Clazz_defineMethod (c$, "getTreeFont", 
68151 function () {
68152 return this.treeCanvas.$font;
68153 });
68154 Clazz_defineMethod (c$, "setTreeFont", 
68155 function (font) {
68156 this.treeCanvas.$font = font;
68157 this.treeCanvas.repaint ();
68158 }, "java.awt.Font");
68159 Clazz_defineMethod (c$, "fontSize_actionPerformed", 
68160 function () {
68161 if (this.treeCanvas == null) {
68162 return;
68163 } new jalview.appletgui.FontChooser (this);
68164 });
68165 Clazz_defineMethod (c$, "jbInit", 
68166  function () {
68167 this.setLayout (this.borderLayout1);
68168 this.setBackground (java.awt.Color.white);
68169 this.setFont ( new java.awt.Font ("Verdana", 0, 12));
68170 this.jMenu2.setLabel (jalview.util.MessageManager.getString ("action.view"));
68171 this.fontSize.setLabel (jalview.util.MessageManager.getString ("action.font"));
68172 this.fontSize.addActionListener (this);
68173 this.bootstrapMenu.setLabel (jalview.util.MessageManager.getString ("label.show_bootstrap_values"));
68174 this.bootstrapMenu.addItemListener (this);
68175 this.distanceMenu.setLabel (jalview.util.MessageManager.getString ("label.show_distances"));
68176 this.distanceMenu.addItemListener (this);
68177 this.placeholdersMenu.setLabel (jalview.util.MessageManager.getString ("label.mark_unassociated_leaves"));
68178 this.placeholdersMenu.addItemListener (this);
68179 this.fitToWindow.setState (true);
68180 this.fitToWindow.setLabel (jalview.util.MessageManager.getString ("label.fit_to_window"));
68181 this.fitToWindow.addItemListener (this);
68182 this.fileMenu.setLabel (jalview.util.MessageManager.getString ("action.file"));
68183 this.newickOutput.setLabel (jalview.util.MessageManager.getString ("label.newick_format"));
68184 this.newickOutput.addActionListener (this);
68185 this.inputData.setLabel (jalview.util.MessageManager.getString ("label.input_data"));
68186 this.add (this.scrollPane, "Center");
68187 this.jMenuBar1.add (this.fileMenu);
68188 this.jMenuBar1.add (this.jMenu2);
68189 this.jMenu2.add (this.fitToWindow);
68190 this.jMenu2.add (this.fontSize);
68191 this.jMenu2.add (this.distanceMenu);
68192 this.jMenu2.add (this.bootstrapMenu);
68193 this.jMenu2.add (this.placeholdersMenu);
68194 this.fileMenu.add (this.newickOutput);
68195 this.fileMenu.add (this.inputData);
68196 this.inputData.addActionListener (this);
68197 });
68198 c$.$TreePanel$TreeLoader$ = function () {
68199 Clazz_pu$h(self.c$);
68200 c$ = Clazz_decorateAsClass (function () {
68201 Clazz_prepareCallback (this, arguments);
68202 this.newtree = null;
68203 this.odata = null;
68204 Clazz_instantialize (this, arguments);
68205 }, jalview.appletgui.TreePanel, "TreeLoader", Thread);
68206 Clazz_makeConstructor (c$, 
68207 function (a) {
68208 Clazz_superConstructor (this, jalview.appletgui.TreePanel.TreeLoader, []);
68209 this.newtree = a;
68210 }, "jalview.io.NewickFile");
68211 Clazz_overrideMethod (c$, "run", 
68212 function () {
68213 if (this.newtree != null) {
68214 if (this.odata == null) {
68215 this.b$["jalview.appletgui.TreePanel"].tree =  new jalview.analysis.NJTree (this.b$["jalview.appletgui.TreePanel"].av.getAlignment ().getSequencesArray (), this.newtree);
68216 } else {
68217 this.b$["jalview.appletgui.TreePanel"].tree =  new jalview.analysis.NJTree (this.b$["jalview.appletgui.TreePanel"].av.getAlignment ().getSequencesArray (), this.odata, this.newtree);
68218 }} else {
68219 var a;
68220 var b;
68221 var c;
68222 var d = this.b$["jalview.appletgui.TreePanel"].av.getSelectionGroup () != null && this.b$["jalview.appletgui.TreePanel"].av.getSelectionGroup ().getSize () > 1;
68223 var e = this.b$["jalview.appletgui.TreePanel"].av.getAlignmentView (d);
68224 if (!d) {
68225 a = 0;
68226 b = this.b$["jalview.appletgui.TreePanel"].av.getAlignment ().getWidth ();
68227 c = this.b$["jalview.appletgui.TreePanel"].av.getAlignment ().getSequencesArray ();
68228 } else {
68229 a = this.b$["jalview.appletgui.TreePanel"].av.getSelectionGroup ().getStartRes ();
68230 b = this.b$["jalview.appletgui.TreePanel"].av.getSelectionGroup ().getEndRes () + 1;
68231 c = this.b$["jalview.appletgui.TreePanel"].av.getSelectionGroup ().getSequencesInOrder (this.b$["jalview.appletgui.TreePanel"].av.getAlignment ());
68232 }var f = jalview.schemes.ResidueProperties.getScoreModel (this.b$["jalview.appletgui.TreePanel"].pwtype);
68233 if (Clazz_instanceOf (f, jalview.api.analysis.ViewBasedAnalysisI)) {
68234 try {
68235 f = f.getClass ().newInstance ();
68236 (f).configureFromAlignmentView (this.b$["jalview.appletgui.TreePanel"].treeCanvas.ap);
68237 } catch (q) {
68238 if (Clazz_exceptionOf (q, Exception)) {
68239 System.err.println ("Couldn't create a scoremodel instance for " + f.getName ());
68240 q.printStackTrace ();
68241 } else {
68242 throw q;
68243 }
68244 }
68245 this.b$["jalview.appletgui.TreePanel"].tree =  new jalview.analysis.NJTree (c, e, this.b$["jalview.appletgui.TreePanel"].$type, this.b$["jalview.appletgui.TreePanel"].pwtype, f, a, b);
68246 } else {
68247 this.b$["jalview.appletgui.TreePanel"].tree =  new jalview.analysis.NJTree (c, e, this.b$["jalview.appletgui.TreePanel"].$type, this.b$["jalview.appletgui.TreePanel"].pwtype, null, a, b);
68248 }}this.b$["jalview.appletgui.TreePanel"].tree.reCount (this.b$["jalview.appletgui.TreePanel"].tree.getTopNode ());
68249 this.b$["jalview.appletgui.TreePanel"].tree.findHeight (this.b$["jalview.appletgui.TreePanel"].tree.getTopNode ());
68250 this.b$["jalview.appletgui.TreePanel"].treeCanvas.setTree (this.b$["jalview.appletgui.TreePanel"].tree);
68251 if (this.newtree != null) {
68252 var a = this.newtree.HasDistances () && this.b$["jalview.appletgui.TreePanel"].av.applet.getDefaultParameter ("showTreeDistances", this.newtree.HasDistances ());
68253 var b = this.newtree.HasBootstrap () && this.b$["jalview.appletgui.TreePanel"].av.applet.getDefaultParameter ("showTreeBootstraps", this.newtree.HasBootstrap ());
68254 this.b$["jalview.appletgui.TreePanel"].distanceMenu.setState (a);
68255 this.b$["jalview.appletgui.TreePanel"].bootstrapMenu.setState (b);
68256 this.b$["jalview.appletgui.TreePanel"].treeCanvas.setShowBootstrap (b);
68257 this.b$["jalview.appletgui.TreePanel"].treeCanvas.setShowDistances (a);
68258 this.b$["jalview.appletgui.TreePanel"].treeCanvas.setMarkPlaceholders (this.b$["jalview.appletgui.TreePanel"].av.applet.getDefaultParameter ("showUnlinkedTreeNodes", false));
68259 }this.b$["jalview.appletgui.TreePanel"].treeCanvas.repaint ();
68260 this.b$["jalview.appletgui.TreePanel"].av.setCurrentTree (this.b$["jalview.appletgui.TreePanel"].tree);
68261 });
68262 c$ = Clazz_p0p ();
68263 };
68264 });
68265 Clazz_declarePackage ("jalview.analysis");
68266 Clazz_load (["java.util.Vector"], ["jalview.analysis.Cluster", "$.NJTree"], ["jalview.analysis.SequenceIdMatcher", "jalview.datamodel.AlignmentView", "$.CigarArray", "$.NodeTransformI", "$.SeqCigar", "$.Sequence", "$.SequenceI", "$.SequenceNode", "jalview.io.NewickFile", "jalview.schemes.ResidueProperties", "jalview.util.Format", "java.lang.StringBuffer"], function () {
68267 c$ = Clazz_decorateAsClass (function () {
68268 this.$cluster = null;
68269 this.sequence = null;
68270 this.seqData = null;
68271 this.done = null;
68272 this.noseqs = 0;
68273 this.noClus = 0;
68274 this.distance = null;
68275 this.mini = 0;
68276 this.minj = 0;
68277 this.ri = 0;
68278 this.rj = 0;
68279 this.groups = null;
68280 this.maxdist = null;
68281 this.top = null;
68282 this.maxDistValue = 0;
68283 this.maxheight = 0;
68284 this.ycount = 0;
68285 this.node = null;
68286 this.type = null;
68287 this.pwtype = null;
68288 this.found = null;
68289 this.leaves = null;
68290 this.hasDistances = true;
68291 this.hasBootstrap = false;
68292 this.hasRootDistance = true;
68293 this._lycount = 0;
68294 this._lylimit = 0;
68295 Clazz_instantialize (this, arguments);
68296 }, jalview.analysis, "NJTree");
68297 Clazz_prepareFields (c$, function () {
68298 this.groups =  new java.util.Vector ();
68299 });
68300 Clazz_makeConstructor (c$, 
68301 function (seqs, odata, treefile) {
68302 this.construct (seqs, treefile);
68303 if (odata != null) {
68304 this.seqData = odata;
68305 }}, "~A,jalview.datamodel.AlignmentView,jalview.io.NewickFile");
68306 Clazz_makeConstructor (c$, 
68307 function (seqs, treefile) {
68308 this.sequence = seqs;
68309 this.top = treefile.getTree ();
68310 this.hasDistances = treefile.HasDistances ();
68311 this.hasBootstrap = treefile.HasBootstrap ();
68312 this.hasRootDistance = treefile.HasRootDistance ();
68313 this.maxheight = this.findHeight (this.top);
68314 var algnIds =  new jalview.analysis.SequenceIdMatcher (seqs);
68315 var leaves =  new java.util.Vector ();
68316 this.findLeaves (this.top, leaves);
68317 var i = 0;
68318 var namesleft = seqs.length;
68319 var j;
68320 var nam;
68321 var realnam;
68322 var one2many =  new java.util.Vector ();
68323 var countOne2Many = 0;
68324 while (i < leaves.size ()) {
68325 j = leaves.elementAt (i++);
68326 realnam = j.getName ();
68327 nam = null;
68328 if (namesleft > -1) {
68329 nam = algnIds.findIdMatch (realnam);
68330 }if (nam != null) {
68331 j.setElement (nam);
68332 if (one2many.contains (nam)) {
68333 countOne2Many++;
68334 } else {
68335 one2many.addElement (nam);
68336 namesleft--;
68337 }} else {
68338 j.setElement ( new jalview.datamodel.Sequence (realnam, "THISISAPLACEHLDER"));
68339 j.setPlaceholder (true);
68340 }}
68341 }, "~A,jalview.io.NewickFile");
68342 Clazz_makeConstructor (c$, 
68343 function (sequence, seqData, type, pwtype, sm, start, end) {
68344 this.sequence = sequence;
68345 this.node =  new java.util.Vector ();
68346 this.type = type;
68347 this.pwtype = pwtype;
68348 if (seqData != null) {
68349 this.seqData = seqData;
68350 } else {
68351 var seqs =  new Array (sequence.length);
68352 for (var i = 0; i < sequence.length; i++) {
68353 seqs[i] =  new jalview.datamodel.SeqCigar (sequence[i], start, end);
68354 }
68355 var sdata =  new jalview.datamodel.CigarArray (seqs);
68356 sdata.addOperation ('M', end - start + 1);
68357 this.seqData =  new jalview.datamodel.AlignmentView (sdata, start);
68358 }if (!(type.equals ("NJ"))) {
68359 type = "AV";
68360 }if (sm == null && !(pwtype.equals ("PID"))) {
68361 if (jalview.schemes.ResidueProperties.getScoreMatrix (pwtype) == null) {
68362 pwtype = "BLOSUM62";
68363 }}var i = 0;
68364 this.done =  Clazz_newIntArray (sequence.length, 0);
68365 while ((i < sequence.length) && (sequence[i] != null)) {
68366 this.done[i] = 0;
68367 i++;
68368 }
68369 this.noseqs = i++;
68370 this.distance = this.findDistances (sm);
68371 this.makeLeaves ();
68372 this.noClus = this.$cluster.size ();
68373 this.cluster ();
68374 }, "~A,jalview.datamodel.AlignmentView,~S,~S,jalview.api.analysis.ScoreModelI,~N,~N");
68375 Clazz_overrideMethod (c$, "toString", 
68376 function () {
68377 var fout =  new jalview.io.NewickFile (this.getTopNode ());
68378 return fout.print (this.isHasBootstrap (), this.isHasDistances (), this.isHasRootDistance ());
68379 });
68380 Clazz_defineMethod (c$, "UpdatePlaceHolders", 
68381 function (list) {
68382 var leaves =  new java.util.Vector ();
68383 this.findLeaves (this.top, leaves);
68384 var sz = leaves.size ();
68385 var seqmatcher = null;
68386 var i = 0;
68387 while (i < sz) {
68388 var leaf = leaves.elementAt (i++);
68389 if (list.contains (leaf.element ())) {
68390 leaf.setPlaceholder (false);
68391 } else {
68392 if (seqmatcher == null) {
68393 var seqs =  new Array (list.size ());
68394 for (var j = 0; j < seqs.length; j++) {
68395 seqs[j] = list.get (j);
68396 }
68397 seqmatcher =  new jalview.analysis.SequenceIdMatcher (seqs);
68398 }var nam = seqmatcher.findIdMatch (leaf.getName ());
68399 if (nam != null) {
68400 if (!leaf.isPlaceholder ()) {
68401 }leaf.setPlaceholder (false);
68402 leaf.setElement (nam);
68403 } else {
68404 if (!leaf.isPlaceholder ()) {
68405 leaf.setElement ( new jalview.datamodel.Sequence (leaf.getName (), "THISISAPLACEHLDER"));
68406 }leaf.setPlaceholder (true);
68407 }}}
68408 }, "java.util.List");
68409 Clazz_defineMethod (c$, "renameAssociatedNodes", 
68410 function () {
68411 this.applyToNodes (((Clazz_isClassDefined ("jalview.analysis.NJTree$1") ? 0 : jalview.analysis.NJTree.$NJTree$1$ ()), Clazz_innerTypeInstance (jalview.analysis.NJTree$1, this, null)));
68412 });
68413 Clazz_defineMethod (c$, "cluster", 
68414 function () {
68415 while (this.noClus > 2) {
68416 if (this.type.equals ("NJ")) {
68417 this.findMinNJDistance ();
68418 } else {
68419 this.findMinDistance ();
68420 }var c = this.joinClusters (this.mini, this.minj);
68421 this.done[this.minj] = 1;
68422 this.$cluster.setElementAt (null, this.minj);
68423 this.$cluster.setElementAt (c, this.mini);
68424 this.noClus--;
68425 }
68426 var onefound = false;
68427 var one = -1;
68428 var two = -1;
68429 for (var i = 0; i < this.noseqs; i++) {
68430 if (this.done[i] != 1) {
68431 if (onefound == false) {
68432 two = i;
68433 onefound = true;
68434 } else {
68435 one = i;
68436 }}}
68437 this.joinClusters (one, two);
68438 this.top = (this.node.elementAt (one));
68439 this.reCount (this.top);
68440 this.findHeight (this.top);
68441 this.findMaxDist (this.top);
68442 });
68443 Clazz_defineMethod (c$, "joinClusters", 
68444 function (i, j) {
68445 var dist = this.distance[i][j];
68446 var noi = (this.$cluster.elementAt (i)).value.length;
68447 var noj = (this.$cluster.elementAt (j)).value.length;
68448 var value =  Clazz_newIntArray (noi + noj, 0);
68449 for (var ii = 0; ii < noi; ii++) {
68450 value[ii] = (this.$cluster.elementAt (i)).value[ii];
68451 }
68452 for (var ii = noi; ii < (noi + noj); ii++) {
68453 value[ii] = (this.$cluster.elementAt (j)).value[ii - noi];
68454 }
68455 var c =  new jalview.analysis.Cluster (value);
68456 this.ri = this.findr (i, j);
68457 this.rj = this.findr (j, i);
68458 if (this.type.equals ("NJ")) {
68459 this.findClusterNJDistance (i, j);
68460 } else {
68461 this.findClusterDistance (i, j);
68462 }var sn =  new jalview.datamodel.SequenceNode ();
68463 sn.setLeft ((this.node.elementAt (i)));
68464 sn.setRight ((this.node.elementAt (j)));
68465 var tmpi = (this.node.elementAt (i));
68466 var tmpj = (this.node.elementAt (j));
68467 if (this.type.equals ("NJ")) {
68468 this.findNewNJDistances (tmpi, tmpj, dist);
68469 } else {
68470 this.findNewDistances (tmpi, tmpj, dist);
68471 }tmpi.setParent (sn);
68472 tmpj.setParent (sn);
68473 this.node.setElementAt (sn, i);
68474 return c;
68475 }, "~N,~N");
68476 Clazz_defineMethod (c$, "findNewNJDistances", 
68477 function (tmpi, tmpj, dist) {
68478 tmpi.dist = ((dist + this.ri) - this.rj) / 2;
68479 tmpj.dist = (dist - tmpi.dist);
68480 if (tmpi.dist < 0) {
68481 tmpi.dist = 0;
68482 }if (tmpj.dist < 0) {
68483 tmpj.dist = 0;
68484 }}, "jalview.datamodel.SequenceNode,jalview.datamodel.SequenceNode,~N");
68485 Clazz_defineMethod (c$, "findNewDistances", 
68486 function (tmpi, tmpj, dist) {
68487 var ih = 0;
68488 var jh = 0;
68489 var sni = tmpi;
68490 var snj = tmpj;
68491 while (sni != null) {
68492 ih = ih + sni.dist;
68493 sni = sni.left ();
68494 }
68495 while (snj != null) {
68496 jh = jh + snj.dist;
68497 snj = snj.left ();
68498 }
68499 tmpi.dist = ((dist / 2) - ih);
68500 tmpj.dist = ((dist / 2) - jh);
68501 }, "jalview.datamodel.SequenceNode,jalview.datamodel.SequenceNode,~N");
68502 Clazz_defineMethod (c$, "findClusterDistance", 
68503 function (i, j) {
68504 var noi = (this.$cluster.elementAt (i)).value.length;
68505 var noj = (this.$cluster.elementAt (j)).value.length;
68506 var newdist =  Clazz_newFloatArray (this.noseqs, 0);
68507 for (var l = 0; l < this.noseqs; l++) {
68508 if ((l != i) && (l != j)) {
68509 newdist[l] = ((this.distance[i][l] * noi) + (this.distance[j][l] * noj)) / (noi + noj);
68510 } else {
68511 newdist[l] = 0;
68512 }}
68513 for (var ii = 0; ii < this.noseqs; ii++) {
68514 this.distance[i][ii] = newdist[ii];
68515 this.distance[ii][i] = newdist[ii];
68516 }
68517 }, "~N,~N");
68518 Clazz_defineMethod (c$, "findClusterNJDistance", 
68519 function (i, j) {
68520 var newdist =  Clazz_newFloatArray (this.noseqs, 0);
68521 for (var l = 0; l < this.noseqs; l++) {
68522 if ((l != i) && (l != j)) {
68523 newdist[l] = ((this.distance[i][l] + this.distance[j][l]) - this.distance[i][j]) / 2;
68524 } else {
68525 newdist[l] = 0;
68526 }}
68527 for (var ii = 0; ii < this.noseqs; ii++) {
68528 this.distance[i][ii] = newdist[ii];
68529 this.distance[ii][i] = newdist[ii];
68530 }
68531 }, "~N,~N");
68532 Clazz_defineMethod (c$, "findr", 
68533 function (i, j) {
68534 var tmp = 1;
68535 for (var k = 0; k < this.noseqs; k++) {
68536 if ((k != i) && (k != j) && (this.done[k] != 1)) {
68537 tmp = tmp + this.distance[i][k];
68538 }}
68539 if (this.noClus > 2) {
68540 tmp = tmp / (this.noClus - 2);
68541 }return tmp;
68542 }, "~N,~N");
68543 Clazz_defineMethod (c$, "findMinNJDistance", 
68544 function () {
68545 var min = 100000;
68546 for (var i = 0; i < (this.noseqs - 1); i++) {
68547 for (var j = i + 1; j < this.noseqs; j++) {
68548 if ((this.done[i] != 1) && (this.done[j] != 1)) {
68549 var tmp = this.distance[i][j] - (this.findr (i, j) + this.findr (j, i));
68550 if (tmp < min) {
68551 this.mini = i;
68552 this.minj = j;
68553 min = tmp;
68554 }}}
68555 }
68556 return min;
68557 });
68558 Clazz_defineMethod (c$, "findMinDistance", 
68559 function () {
68560 var min = 100000;
68561 for (var i = 0; i < (this.noseqs - 1); i++) {
68562 for (var j = i + 1; j < this.noseqs; j++) {
68563 if ((this.done[i] != 1) && (this.done[j] != 1)) {
68564 if (this.distance[i][j] < min) {
68565 this.mini = i;
68566 this.minj = j;
68567 min = this.distance[i][j];
68568 }}}
68569 }
68570 return min;
68571 });
68572 Clazz_defineMethod (c$, "findDistances", 
68573 function (_pwmatrix) {
68574 var distance =  Clazz_newFloatArray (this.noseqs, this.noseqs, 0);
68575 if (_pwmatrix == null) {
68576 _pwmatrix = jalview.schemes.ResidueProperties.getScoreModel (this.pwtype);
68577 if (_pwmatrix == null) {
68578 _pwmatrix = jalview.schemes.ResidueProperties.getScoreMatrix ("BLOSUM62");
68579 }}distance = _pwmatrix.findDistances (this.seqData);
68580 return distance;
68581 }, "jalview.api.analysis.ScoreModelI");
68582 Clazz_defineMethod (c$, "makeLeaves", 
68583 function () {
68584 this.$cluster =  new java.util.Vector ();
68585 for (var i = 0; i < this.noseqs; i++) {
68586 var sn =  new jalview.datamodel.SequenceNode ();
68587 sn.setElement (this.sequence[i]);
68588 sn.setName (this.sequence[i].getName ());
68589 this.node.addElement (sn);
68590 var value =  Clazz_newIntArray (1, 0);
68591 value[0] = i;
68592 var c =  new jalview.analysis.Cluster (value);
68593 this.$cluster.addElement (c);
68594 }
68595 });
68596 Clazz_defineMethod (c$, "findLeaves", 
68597 function (node, leaves) {
68598 if (node == null) {
68599 return leaves;
68600 }if ((node.left () == null) && (node.right () == null)) {
68601 leaves.addElement (node);
68602 return leaves;
68603 } else {
68604 this.findLeaves (node.left (), leaves);
68605 this.findLeaves (node.right (), leaves);
68606 }return leaves;
68607 }, "jalview.datamodel.SequenceNode,java.util.Vector");
68608 Clazz_defineMethod (c$, "findLeaf", 
68609 function (node, count) {
68610 this.found = this._findLeaf (node, count);
68611 return this.found;
68612 }, "jalview.datamodel.SequenceNode,~N");
68613 Clazz_defineMethod (c$, "_findLeaf", 
68614 function (node, count) {
68615 if (node == null) {
68616 return null;
68617 }if (node.ycount == count) {
68618 this.found = node.element ();
68619 return this.found;
68620 } else {
68621 this._findLeaf (node.left (), count);
68622 this._findLeaf (node.right (), count);
68623 }return this.found;
68624 }, "jalview.datamodel.SequenceNode,~N");
68625 Clazz_defineMethod (c$, "printNode", 
68626 function (node) {
68627 if (node == null) {
68628 return;
68629 }if ((node.left () == null) && (node.right () == null)) {
68630 System.out.println ("Leaf = " + (node.element ()).getName ());
68631 System.out.println ("Dist " + node.dist);
68632 System.out.println ("Boot " + node.getBootstrap ());
68633 } else {
68634 System.out.println ("Dist " + node.dist);
68635 this.printNode (node.left ());
68636 this.printNode (node.right ());
68637 }}, "jalview.datamodel.SequenceNode");
68638 Clazz_defineMethod (c$, "findMaxDist", 
68639 function (node) {
68640 if (node == null) {
68641 return;
68642 }if ((node.left () == null) && (node.right () == null)) {
68643 var dist = node.dist;
68644 if (dist > this.maxDistValue) {
68645 this.maxdist = node;
68646 this.maxDistValue = dist;
68647 }} else {
68648 this.findMaxDist (node.left ());
68649 this.findMaxDist (node.right ());
68650 }}, "jalview.datamodel.SequenceNode");
68651 Clazz_defineMethod (c$, "getGroups", 
68652 function () {
68653 return this.groups;
68654 });
68655 Clazz_defineMethod (c$, "getMaxHeight", 
68656 function () {
68657 return this.maxheight;
68658 });
68659 Clazz_defineMethod (c$, "groupNodes", 
68660 function (node, threshold) {
68661 if (node == null) {
68662 return;
68663 }if ((node.height / this.maxheight) > threshold) {
68664 this.groups.addElement (node);
68665 } else {
68666 this.groupNodes (node.left (), threshold);
68667 this.groupNodes (node.right (), threshold);
68668 }}, "jalview.datamodel.SequenceNode,~N");
68669 Clazz_defineMethod (c$, "findHeight", 
68670 function (node) {
68671 if (node == null) {
68672 return this.maxheight;
68673 }if ((node.left () == null) && (node.right () == null)) {
68674 node.height = (node.parent ()).height + node.dist;
68675 if (node.height > this.maxheight) {
68676 return node.height;
68677 } else {
68678 return this.maxheight;
68679 }} else {
68680 if (node.parent () != null) {
68681 node.height = (node.parent ()).height + node.dist;
68682 } else {
68683 this.maxheight = 0;
68684 node.height = 0.0;
68685 }this.maxheight = this.findHeight ((node.left ()));
68686 this.maxheight = this.findHeight ((node.right ()));
68687 }return this.maxheight;
68688 }, "jalview.datamodel.SequenceNode");
68689 Clazz_defineMethod (c$, "reRoot", 
68690 function () {
68691 if (this.maxdist != null) {
68692 this.ycount = 0;
68693 var tmpdist = this.maxdist.dist;
68694 var sn =  new jalview.datamodel.SequenceNode ();
68695 sn.setParent (null);
68696 var snr = this.maxdist.parent ();
68697 this.changeDirection (snr, this.maxdist);
68698 System.out.println ("Printing reversed tree");
68699 this.printN (snr);
68700 snr.dist = tmpdist / 2;
68701 this.maxdist.dist = tmpdist / 2;
68702 snr.setParent (sn);
68703 this.maxdist.setParent (sn);
68704 sn.setRight (snr);
68705 sn.setLeft (this.maxdist);
68706 this.top = sn;
68707 this.ycount = 0;
68708 this.reCount (this.top);
68709 this.findHeight (this.top);
68710 }return this.top;
68711 });
68712 Clazz_defineMethod (c$, "hasOriginalSequenceData", 
68713 function () {
68714 return this.seqData != null;
68715 });
68716 Clazz_defineMethod (c$, "printOriginalSequenceData", 
68717 function (gapChar) {
68718 if (this.seqData == null) {
68719 return null;
68720 }var sb =  new StringBuffer ();
68721 var seqdatas = this.seqData.getSequenceStrings (gapChar);
68722 for (var i = 0; i < seqdatas.length; i++) {
68723 sb.append ( new jalview.util.Format ("%-15s").form (this.sequence[i].getName ()));
68724 sb.append (" " + seqdatas[i] + "\n");
68725 }
68726 return sb.toString ();
68727 }, "~S");
68728 Clazz_defineMethod (c$, "printN", 
68729 function (node) {
68730 if (node == null) {
68731 return;
68732 }if ((node.left () != null) && (node.right () != null)) {
68733 this.printN (node.left ());
68734 this.printN (node.right ());
68735 } else {
68736 System.out.println (" name = " + (node.element ()).getName ());
68737 }System.out.println (" dist = " + node.dist + " " + node.count + " " + node.height);
68738 }, "jalview.datamodel.SequenceNode");
68739 Clazz_defineMethod (c$, "reCount", 
68740 function (node) {
68741 this.ycount = 0;
68742 this._lycount = 0;
68743 this._reCount (node);
68744 }, "jalview.datamodel.SequenceNode");
68745 Clazz_defineMethod (c$, "_reCount", 
68746 function (node) {
68747 if (node == null) {
68748 return;
68749 }this._lycount++;
68750 if ((node.left () != null) && (node.right () != null)) {
68751 this._reCount (node.left ());
68752 this._reCount (node.right ());
68753 var l = node.left ();
68754 var r = node.right ();
68755 node.count = l.count + r.count;
68756 node.ycount = (l.ycount + r.ycount) / 2;
68757 } else {
68758 node.count = 1;
68759 node.ycount = this.ycount++;
68760 }this._lycount--;
68761 }, "jalview.datamodel.SequenceNode");
68762 Clazz_defineMethod (c$, "swapNodes", 
68763 function (node) {
68764 if (node == null) {
68765 return;
68766 }var tmp = node.left ();
68767 node.setLeft (node.right ());
68768 node.setRight (tmp);
68769 }, "jalview.datamodel.SequenceNode");
68770 Clazz_defineMethod (c$, "changeDirection", 
68771 function (node, dir) {
68772 if (node == null) {
68773 return;
68774 }if (node.parent () !== this.top) {
68775 this.changeDirection (node.parent (), node);
68776 var tmp = node.parent ();
68777 if (dir === node.left ()) {
68778 node.setParent (dir);
68779 node.setLeft (tmp);
68780 } else if (dir === node.right ()) {
68781 node.setParent (dir);
68782 node.setRight (tmp);
68783 }} else {
68784 if (dir === node.left ()) {
68785 node.setParent (node.left ());
68786 if (this.top.left () === node) {
68787 node.setRight (this.top.right ());
68788 } else {
68789 node.setRight (this.top.left ());
68790 }} else {
68791 node.setParent (node.right ());
68792 if (this.top.left () === node) {
68793 node.setLeft (this.top.right ());
68794 } else {
68795 node.setLeft (this.top.left ());
68796 }}}}, "jalview.datamodel.SequenceNode,jalview.datamodel.SequenceNode");
68797 Clazz_defineMethod (c$, "getMaxDist", 
68798 function () {
68799 return this.maxdist;
68800 });
68801 Clazz_defineMethod (c$, "getTopNode", 
68802 function () {
68803 return this.top;
68804 });
68805 Clazz_defineMethod (c$, "isHasDistances", 
68806 function () {
68807 return this.hasDistances;
68808 });
68809 Clazz_defineMethod (c$, "isHasBootstrap", 
68810 function () {
68811 return this.hasBootstrap;
68812 });
68813 Clazz_defineMethod (c$, "isHasRootDistance", 
68814 function () {
68815 return this.hasRootDistance;
68816 });
68817 Clazz_defineMethod (c$, "applyToNodes", 
68818 function (nodeTransformI) {
68819 for (var nodes = this.node.elements (); nodes.hasMoreElements (); nodeTransformI.transform (nodes.nextElement ())) {
68820 ;}
68821 }, "jalview.datamodel.NodeTransformI");
68822 c$.$NJTree$1$ = function () {
68823 Clazz_pu$h(self.c$);
68824 c$ = Clazz_declareAnonymous (jalview.analysis, "NJTree$1", null, jalview.datamodel.NodeTransformI);
68825 Clazz_defineMethod (c$, "transform", 
68826 function (node) {
68827 var el = node.element ();
68828 if (el != null && Clazz_instanceOf (el, jalview.datamodel.SequenceI)) {
68829 node.setName ((el).getName ());
68830 }}, "jalview.datamodel.BinaryNode");
68831 c$ = Clazz_p0p ();
68832 };
68833 c$ = Clazz_decorateAsClass (function () {
68834 this.value = null;
68835 Clazz_instantialize (this, arguments);
68836 }, jalview.analysis, "Cluster");
68837 Clazz_makeConstructor (c$, 
68838 function (value) {
68839 this.value = value;
68840 }, "~A");
68841 });
68842 Clazz_declarePackage ("jalview.datamodel");
68843 Clazz_declareInterface (jalview.datamodel, "NodeTransformI");
68844 Clazz_declarePackage ("jalview.appletgui");
68845 Clazz_load (["awt2swing.Panel", "java.awt.event.MouseListener", "$.MouseMotionListener", "java.util.Hashtable"], "jalview.appletgui.TreeCanvas", ["awt2swing.Util", "jalview.analysis.Conservation", "jalview.appletgui.PaintRefresher", "jalview.datamodel.SequenceGroup", "$.SequenceI", "$.SequenceNode", "jalview.schemes.ColourSchemeProperty", "$.ResidueProperties", "$.UserColourScheme", "jalview.util.Format", "$.MappingUtils", "java.awt.Color", "$.Dimension", "$.Point", "$.Rectangle", "java.util.Vector"], function () {
68846 c$ = Clazz_decorateAsClass (function () {
68847 this.tree = null;
68848 this.scrollPane = null;
68849 this.av = null;
68850 this.$font = null;
68851 this.fitToWindow = true;
68852 this.showDistances = false;
68853 this.showBootstrap = false;
68854 this.markPlaceholders = false;
68855 this.offx = 20;
68856 this.offy = 0;
68857 this.threshold = 0;
68858 this.longestName = null;
68859 this.labelLength = -1;
68860 this.nameHash = null;
68861 this.nodeHash = null;
68862 this.highlightNode = null;
68863 this.ap = null;
68864 Clazz_instantialize (this, arguments);
68865 }, jalview.appletgui, "TreeCanvas", awt2swing.Panel, [java.awt.event.MouseListener, java.awt.event.MouseMotionListener]);
68866 Clazz_prepareFields (c$, function () {
68867 this.nameHash =  new java.util.Hashtable ();
68868 this.nodeHash =  new java.util.Hashtable ();
68869 });
68870 Clazz_makeConstructor (c$, 
68871 function (ap, scroller) {
68872 Clazz_superConstructor (this, jalview.appletgui.TreeCanvas, []);
68873 this.ap = ap;
68874 this.av = ap.av;
68875 this.$font = this.av.getFont ();
68876 this.scrollPane = scroller;
68877 this.addMouseListener (this);
68878 this.addMouseMotionListener (this);
68879 this.setLayout (null);
68880 jalview.appletgui.PaintRefresher.Register (this, this.av.getSequenceSetId ());
68881 }, "jalview.appletgui.AlignmentPanel,awt2swing.ScrollPane");
68882 Clazz_defineMethod (c$, "treeSelectionChanged", 
68883 function (sequence) {
68884 var selected = this.av.getSelectionGroup ();
68885 if (selected == null) {
68886 selected =  new jalview.datamodel.SequenceGroup ();
68887 this.av.setSelectionGroup (selected);
68888 }selected.setEndRes (this.av.getAlignment ().getWidth () - 1);
68889 selected.addOrRemove (sequence, true);
68890 }, "jalview.datamodel.SequenceI");
68891 Clazz_defineMethod (c$, "setTree", 
68892 function (tree) {
68893 this.tree = tree;
68894 tree.findHeight (tree.getTopNode ());
68895 var leaves = tree.findLeaves (tree.getTopNode (),  new java.util.Vector ());
68896 var has_placeholders = false;
68897 this.longestName = "";
68898 for (var i = 0; i < leaves.size (); i++) {
68899 var lf = leaves.elementAt (i);
68900 if (lf.isPlaceholder ()) {
68901 has_placeholders = true;
68902 }if (this.longestName.length < (lf.element ()).getName ().length) {
68903 this.longestName = " * " + (lf.element ()).getName ();
68904 }}
68905 this.setMarkPlaceholders (has_placeholders);
68906 }, "jalview.analysis.NJTree");
68907 Clazz_defineMethod (c$, "drawNode", 
68908 function (g, node, chunk, scale, width, offx, offy) {
68909 if (node == null) {
68910 return;
68911 }if (node.left () == null && node.right () == null) {
68912 var height = node.height;
68913 var dist = node.dist;
68914 var xstart = Clazz_floatToInt ((height - dist) * scale) + offx;
68915 var xend = Clazz_floatToInt (height * scale) + offx;
68916 var ypos = Clazz_floatToInt (node.ycount * chunk) + offy;
68917 if (Clazz_instanceOf (node.element (), jalview.datamodel.SequenceI)) {
68918 var seq = node.element ();
68919 if (this.av.getSequenceColour (seq) === java.awt.Color.white) {
68920 g.setColor (java.awt.Color.black);
68921 } else {
68922 g.setColor (this.av.getSequenceColour (seq).darker ());
68923 }} else {
68924 g.setColor (java.awt.Color.black);
68925 }g.drawLine (xstart, ypos, xend, ypos);
68926 var nodeLabel = "";
68927 if (this.showDistances && node.dist > 0) {
68928 nodeLabel =  new jalview.util.Format ("%-.2f").formDouble (node.dist);
68929 }if (this.showBootstrap) {
68930 var btstrap = node.getBootstrap ();
68931 if (btstrap > -1) {
68932 if (this.showDistances) {
68933 nodeLabel = nodeLabel + " : ";
68934 }nodeLabel = nodeLabel + String.valueOf (node.getBootstrap ());
68935 }}if (!nodeLabel.equals ("")) {
68936 awt2swing.Util.drawString (g, nodeLabel, xstart + 2, ypos - 2);
68937 }var name = (this.markPlaceholders && node.isPlaceholder ()) ? (" * " + node.getName ()) : node.getName ();
68938 var fm = g.getFontMetrics (this.$font);
68939 var charWidth = fm.stringWidth (name) + 3;
68940 var charHeight = fm.getHeight ();
68941 var rect =  new java.awt.Rectangle (xend + 10, ypos - charHeight, charWidth, charHeight);
68942 this.nameHash.put (node.element (), rect);
68943 var selected = this.av.getSelectionGroup ();
68944 if (selected != null && selected.getSequences (null).contains (node.element ())) {
68945 g.setColor (java.awt.Color.gray);
68946 g.fillRect (xend + 10, ypos - charHeight + 3, charWidth, charHeight);
68947 g.setColor (java.awt.Color.white);
68948 }awt2swing.Util.drawString (g, name, xend + 10, ypos);
68949 g.setColor (java.awt.Color.black);
68950 } else {
68951 this.drawNode (g, node.left (), chunk, scale, width, offx, offy);
68952 this.drawNode (g, node.right (), chunk, scale, width, offx, offy);
68953 var height = node.height;
68954 var dist = node.dist;
68955 var xstart = Clazz_floatToInt ((height - dist) * scale) + offx;
68956 var xend = Clazz_floatToInt (height * scale) + offx;
68957 var ypos = Clazz_floatToInt (node.ycount * chunk) + offy;
68958 g.setColor (node.color.darker ());
68959 g.drawLine (xstart, ypos, xend, ypos);
68960 if (node === this.highlightNode) {
68961 g.fillRect (xend - 3, ypos - 3, 6, 6);
68962 } else {
68963 g.fillRect (xend - 2, ypos - 2, 4, 4);
68964 }var ystart = Clazz_floatToInt ((node.left ()).ycount * chunk) + offy;
68965 var yend = Clazz_floatToInt ((node.right ()).ycount * chunk) + offy;
68966 var pos =  new java.awt.Rectangle (xend - 2, ypos - 2, 5, 5);
68967 this.nodeHash.put (node, pos);
68968 g.drawLine (Clazz_floatToInt (height * scale) + offx, ystart, Clazz_floatToInt (height * scale) + offx, yend);
68969 var nodeLabel = "";
68970 if (this.showDistances && (node.dist > 0)) {
68971 nodeLabel =  new jalview.util.Format ("%-.2f").formDouble (node.dist);
68972 }if (this.showBootstrap) {
68973 var btstrap = node.getBootstrap ();
68974 if (btstrap > -1) {
68975 if (this.showDistances) {
68976 nodeLabel = nodeLabel + " : ";
68977 }nodeLabel = nodeLabel + String.valueOf (node.getBootstrap ());
68978 }}if (!nodeLabel.equals ("")) {
68979 awt2swing.Util.drawString (g, nodeLabel, xstart + 2, ypos - 2);
68980 }}}, "java.awt.Graphics,jalview.datamodel.SequenceNode,~N,~N,~N,~N,~N");
68981 Clazz_defineMethod (c$, "findElement", 
68982 function (x, y) {
68983 var keys = this.nameHash.keys ();
68984 while (keys.hasMoreElements ()) {
68985 var ob = keys.nextElement ();
68986 var rect = this.nameHash.get (ob);
68987 if (x >= rect.x && x <= (rect.x + rect.width) && y >= rect.y && y <= (rect.y + rect.height)) {
68988 return ob;
68989 }}
68990 keys = this.nodeHash.keys ();
68991 while (keys.hasMoreElements ()) {
68992 var ob = keys.nextElement ();
68993 var rect = this.nodeHash.get (ob);
68994 if (x >= rect.x && x <= (rect.x + rect.width) && y >= rect.y && y <= (rect.y + rect.height)) {
68995 return ob;
68996 }}
68997 return null;
68998 }, "~N,~N");
68999 Clazz_defineMethod (c$, "pickNodes", 
69000 function (pickBox) {
69001 var width = this.getSize ().width;
69002 var height = this.getSize ().height;
69003 var top = this.tree.getTopNode ();
69004 var wscale = (width * .8 - this.offx * 2) / this.tree.getMaxHeight ();
69005 if (top.count == 0) {
69006 top.count = (top.left ()).count + (top.right ()).count;
69007 }var chunk = (height - this.offy) / top.count;
69008 this.pickNode (pickBox, top, chunk, wscale, width, this.offx, this.offy);
69009 }, "java.awt.Rectangle");
69010 Clazz_defineMethod (c$, "pickNode", 
69011 function (pickBox, node, chunk, scale, width, offx, offy) {
69012 if (node == null) {
69013 return;
69014 }if (node.left () == null && node.right () == null) {
69015 var height = node.height;
69016 var xend = Clazz_floatToInt (height * scale) + offx;
69017 var ypos = Clazz_floatToInt (node.ycount * chunk) + offy;
69018 if (pickBox.contains ( new java.awt.Point (xend, ypos))) {
69019 if (Clazz_instanceOf (node.element (), jalview.datamodel.SequenceI)) {
69020 var seq = node.element ();
69021 var sg = this.av.getSelectionGroup ();
69022 if (sg != null) {
69023 sg.addOrRemove (seq, true);
69024 }}}} else {
69025 this.pickNode (pickBox, node.left (), chunk, scale, width, offx, offy);
69026 this.pickNode (pickBox, node.right (), chunk, scale, width, offx, offy);
69027 }}, "java.awt.Rectangle,jalview.datamodel.SequenceNode,~N,~N,~N,~N,~N");
69028 Clazz_defineMethod (c$, "setColor", 
69029 function (node, c) {
69030 if (node == null) {
69031 return;
69032 }if (node.left () == null && node.right () == null) {
69033 node.color = c;
69034 if (Clazz_instanceOf (node.element (), jalview.datamodel.SequenceI)) {
69035 this.av.setSequenceColour (node.element (), c);
69036 }} else {
69037 node.color = c;
69038 this.setColor (node.left (), c);
69039 this.setColor (node.right (), c);
69040 }}, "jalview.datamodel.SequenceNode,java.awt.Color");
69041 Clazz_overrideMethod (c$, "update", 
69042 function (g) {
69043 this.paint (g);
69044 }, "java.awt.Graphics");
69045 Clazz_overrideMethod (c$, "paintComponent", 
69046 function (g) {
69047 if (this.tree == null) {
69048 return;
69049 }if (this.nameHash.size () == 0) {
69050 this.repaint ();
69051 }var width = this.scrollPane.getSize ().width;
69052 var height = this.scrollPane.getSize ().height;
69053 if (!this.fitToWindow) {
69054 height = g.getFontMetrics (this.$font).getHeight () * this.nameHash.size ();
69055 }if (this.getSize ().width > width) {
69056 this.setSize ( new java.awt.Dimension (width, height));
69057 this.scrollPane.validate ();
69058 return;
69059 }this.setSize ( new java.awt.Dimension (width, height));
69060 g.setFont (this.$font);
69061 this.draw (g, width, height);
69062 this.validate ();
69063 }, "java.awt.Graphics");
69064 Clazz_defineMethod (c$, "draw", 
69065 function (g, width, height) {
69066 this.offy = this.$font.getSize () + 10;
69067 g.setColor (java.awt.Color.white);
69068 g.fillRect (0, 0, width, height);
69069 this.labelLength = g.getFontMetrics (this.$font).stringWidth (this.longestName) + 20;
69070 var wscale = (width - this.labelLength - this.offx * 2) / this.tree.getMaxHeight ();
69071 var top = this.tree.getTopNode ();
69072 if (top.count == 0) {
69073 top.count = (top.left ()).count + (top.right ()).count;
69074 }var chunk = (height - this.offy) / top.count;
69075 this.drawNode (g, this.tree.getTopNode (), chunk, wscale, width, this.offx, this.offy);
69076 if (this.threshold != 0) {
69077 if (this.av.getCurrentTree () === this.tree) {
69078 g.setColor (java.awt.Color.red);
69079 } else {
69080 g.setColor (java.awt.Color.gray);
69081 }var x = Clazz_floatToInt (this.threshold * (this.getSize ().width - this.labelLength - 2 * this.offx) + this.offx);
69082 g.drawLine (x, 0, x, this.getSize ().height);
69083 }}, "java.awt.Graphics,~N,~N");
69084 Clazz_overrideMethod (c$, "mouseReleased", 
69085 function (e) {
69086 }, "java.awt.event.MouseEvent");
69087 Clazz_overrideMethod (c$, "mouseEntered", 
69088 function (e) {
69089 }, "java.awt.event.MouseEvent");
69090 Clazz_overrideMethod (c$, "mouseExited", 
69091 function (e) {
69092 }, "java.awt.event.MouseEvent");
69093 Clazz_overrideMethod (c$, "mouseClicked", 
69094 function (evt) {
69095 if (this.highlightNode != null) {
69096 if (evt.getClickCount () > 1) {
69097 this.tree.swapNodes (this.highlightNode);
69098 this.tree.reCount (this.tree.getTopNode ());
69099 this.tree.findHeight (this.tree.getTopNode ());
69100 } else {
69101 var leaves =  new java.util.Vector ();
69102 this.tree.findLeaves (this.highlightNode, leaves);
69103 for (var i = 0; i < leaves.size (); i++) {
69104 var seq = (leaves.elementAt (i)).element ();
69105 this.treeSelectionChanged (seq);
69106 }
69107 }jalview.appletgui.PaintRefresher.Refresh (this, this.av.getSequenceSetId ());
69108 this.repaint ();
69109 this.av.sendSelection ();
69110 }}, "java.awt.event.MouseEvent");
69111 Clazz_overrideMethod (c$, "mouseDragged", 
69112 function (ect) {
69113 }, "java.awt.event.MouseEvent");
69114 Clazz_overrideMethod (c$, "mouseMoved", 
69115 function (evt) {
69116 this.av.setCurrentTree (this.tree);
69117 var ob = this.findElement (evt.getX (), evt.getY ());
69118 if (Clazz_instanceOf (ob, jalview.datamodel.SequenceNode)) {
69119 this.highlightNode = ob;
69120 this.repaint ();
69121 } else {
69122 if (this.highlightNode != null) {
69123 this.highlightNode = null;
69124 this.repaint ();
69125 }}}, "java.awt.event.MouseEvent");
69126 Clazz_overrideMethod (c$, "mousePressed", 
69127 function (e) {
69128 this.av.setCurrentTree (this.tree);
69129 var x = e.getX ();
69130 var y = e.getY ();
69131 var ob = this.findElement (x, y);
69132 if (Clazz_instanceOf (ob, jalview.datamodel.SequenceI)) {
69133 this.treeSelectionChanged (ob);
69134 jalview.appletgui.PaintRefresher.Refresh (this, this.av.getSequenceSetId ());
69135 this.repaint ();
69136 this.av.sendSelection ();
69137 return;
69138 } else if (!(Clazz_instanceOf (ob, jalview.datamodel.SequenceNode))) {
69139 if (this.tree.getMaxHeight () != 0) {
69140 this.threshold = (x - this.offx) / (this.getSize ().width - this.labelLength - 2 * this.offx);
69141 this.tree.getGroups ().removeAllElements ();
69142 this.tree.groupNodes (this.tree.getTopNode (), this.threshold);
69143 this.setColor (this.tree.getTopNode (), java.awt.Color.black);
69144 this.av.setSelectionGroup (null);
69145 this.av.getAlignment ().deleteAllGroups ();
69146 this.av.clearSequenceColours ();
69147 var codingComplement = this.av.getCodingComplement ();
69148 if (codingComplement != null) {
69149 codingComplement.setSelectionGroup (null);
69150 codingComplement.getAlignment ().deleteAllGroups ();
69151 codingComplement.clearSequenceColours ();
69152 }this.colourGroups ();
69153 }}jalview.appletgui.PaintRefresher.Refresh (this, this.av.getSequenceSetId ());
69154 this.repaint ();
69155 }, "java.awt.event.MouseEvent");
69156 Clazz_defineMethod (c$, "colourGroups", 
69157 function () {
69158 for (var i = 0; i < this.tree.getGroups ().size (); i++) {
69159 var col =  new java.awt.Color (Clazz_doubleToInt (Math.random () * 255), Clazz_doubleToInt (Math.random () * 255), Clazz_doubleToInt (Math.random () * 255));
69160 this.setColor (this.tree.getGroups ().elementAt (i), col.brighter ());
69161 var l = this.tree.findLeaves (this.tree.getGroups ().elementAt (i),  new java.util.Vector ());
69162 var sequences =  new java.util.Vector ();
69163 for (var j = 0; j < l.size (); j++) {
69164 var s1 = (l.elementAt (j)).element ();
69165 if (!sequences.contains (s1)) {
69166 sequences.addElement (s1);
69167 }}
69168 var cs = null;
69169 var sg =  new jalview.datamodel.SequenceGroup (sequences, "", cs, true, true, false, 0, this.av.getAlignment ().getWidth () - 1);
69170 if (this.av.getGlobalColourScheme () != null) {
69171 if (Clazz_instanceOf (this.av.getGlobalColourScheme (), jalview.schemes.UserColourScheme)) {
69172 cs =  new jalview.schemes.UserColourScheme ((this.av.getGlobalColourScheme ()).getColours ());
69173 } else {
69174 cs = jalview.schemes.ColourSchemeProperty.getColour (sg, jalview.schemes.ColourSchemeProperty.getColourName (this.av.getGlobalColourScheme ()));
69175 }if (cs != null) {
69176 cs.setThreshold (this.av.getGlobalColourScheme ().getThreshold (), this.av.isIgnoreGapsConsensus ());
69177 }}sg.cs = cs;
69178 sg.setName ("JTreeGroup:" + sg.hashCode ());
69179 sg.setIdColour (col);
69180 if (this.av.getGlobalColourScheme () != null && this.av.getGlobalColourScheme ().conservationApplied ()) {
69181 var c =  new jalview.analysis.Conservation ("Group", jalview.schemes.ResidueProperties.propHash, 3, sg.getSequences (null), sg.getStartRes (), sg.getEndRes ());
69182 c.calculate ();
69183 c.verdict (false, this.av.getConsPercGaps ());
69184 cs.setConservation (c);
69185 sg.cs = cs;
69186 }this.av.getAlignment ().addGroup (sg);
69187 this.av.getAlignment ().addGroup (sg);
69188 var codingComplement = this.av.getCodingComplement ();
69189 if (codingComplement != null) {
69190 var mappedGroup = jalview.util.MappingUtils.mapSequenceGroup (sg, this.av, codingComplement);
69191 if (mappedGroup.getSequences ().size () > 0) {
69192 codingComplement.getAlignment ().addGroup (mappedGroup);
69193 for (var seq, $seq = mappedGroup.getSequences ().iterator (); $seq.hasNext () && ((seq = $seq.next ()) || true);) {
69194 codingComplement.setSequenceColour (seq, col);
69195 }
69196 }}}
69197 this.ap.updateAnnotation ();
69198 if (this.av.getCodingComplement () != null) {
69199 (this.av.getCodingComplement ()).firePropertyChange ("alignment", null, this.ap.av.getAlignment ().getSequences ());
69200 }});
69201 Clazz_defineMethod (c$, "setShowDistances", 
69202 function (state) {
69203 this.showDistances = state;
69204 this.repaint ();
69205 }, "~B");
69206 Clazz_defineMethod (c$, "setShowBootstrap", 
69207 function (state) {
69208 this.showBootstrap = state;
69209 this.repaint ();
69210 }, "~B");
69211 Clazz_defineMethod (c$, "setMarkPlaceholders", 
69212 function (state) {
69213 this.markPlaceholders = state;
69214 this.repaint ();
69215 }, "~B");
69216 Clazz_defineStatics (c$,
69217 "PLACEHOLDER", " * ");
69218 });
69219 Clazz_declarePackage ("jalview.commands");
69220 Clazz_load (["jalview.commands.EditCommand"], "jalview.commands.RemoveGapColCommand", ["jalview.util.Comparison"], function () {
69221 c$ = Clazz_decorateAsClass (function () {
69222 this.columnsDeleted = 0;
69223 Clazz_instantialize (this, arguments);
69224 }, jalview.commands, "RemoveGapColCommand", jalview.commands.EditCommand);
69225 Clazz_makeConstructor (c$, 
69226 function (description, seqs, start, end, al) {
69227 Clazz_superConstructor (this, jalview.commands.RemoveGapColCommand, []);
69228 this.description = description;
69229 var j;
69230 var jSize = seqs.length;
69231 var startCol = -1;
69232 var endCol = -1;
69233 this.columnsDeleted = 0;
69234 this.clearEdits ();
69235 var $delete = true;
69236 for (var i = start; i <= end; i++) {
69237 $delete = true;
69238 for (j = 0; j < jSize; j++) {
69239 if (seqs[j].getLength () > i) {
69240 if (!jalview.util.Comparison.isGap (seqs[j].getCharAt (i))) {
69241 if ($delete) {
69242 endCol = i;
69243 }$delete = false;
69244 break;
69245 }}}
69246 if ($delete && startCol == -1) {
69247 startCol = i;
69248 }if (!$delete && startCol > -1) {
69249 this.appendEdit (jalview.commands.EditCommand.Action.DELETE_GAP, seqs, startCol - this.columnsDeleted, endCol - startCol, al, false, null);
69250 this.columnsDeleted += (endCol - startCol);
69251 startCol = -1;
69252 endCol = -1;
69253 }}
69254 if ($delete && startCol > -1) {
69255 this.appendEdit (jalview.commands.EditCommand.Action.DELETE_GAP, seqs, startCol - this.columnsDeleted, end - startCol + 1, al, false, null);
69256 this.columnsDeleted += (end - startCol + 1);
69257 }this.performEdit (0, null);
69258 }, "~S,~A,~N,~N,jalview.datamodel.AlignmentI");
69259 Clazz_overrideMethod (c$, "getSize", 
69260 function () {
69261 return this.columnsDeleted;
69262 });
69263 });
69264 Clazz_declarePackage ("jalview.commands");
69265 Clazz_load (["jalview.commands.EditCommand"], "jalview.commands.RemoveGapsCommand", ["jalview.util.Comparison"], function () {
69266 c$ = Clazz_declareType (jalview.commands, "RemoveGapsCommand", jalview.commands.EditCommand);
69267 Clazz_makeConstructor (c$, 
69268 function (description, seqs, al) {
69269 Clazz_superConstructor (this, jalview.commands.RemoveGapsCommand, []);
69270 this.description = description;
69271 var width = 0;
69272 for (var i = 0; i < seqs.length; i++) {
69273 if (seqs[i].getLength () > width) {
69274 width = seqs[i].getLength ();
69275 }}
69276 this.findGaps (seqs, 0, width, al);
69277 }, "~S,~A,jalview.datamodel.AlignmentI");
69278 Clazz_makeConstructor (c$, 
69279 function (description, seqs, start, end, al) {
69280 Clazz_superConstructor (this, jalview.commands.RemoveGapsCommand, []);
69281 this.description = description;
69282 this.findGaps (seqs, start, end, al);
69283 }, "~S,~A,~N,~N,jalview.datamodel.AlignmentI");
69284 Clazz_defineMethod (c$, "findGaps", 
69285 function (seqs, start, end, al) {
69286 var startCol = -1;
69287 var endCol = -1;
69288 var deletedCols = 0;
69289 var j;
69290 var jSize;
69291 this.clearEdits ();
69292 var $delete = true;
69293 var sequence;
69294 for (var s = 0; s < seqs.length; s++) {
69295 deletedCols = 0;
69296 startCol = -1;
69297 endCol = -1;
69298 sequence = seqs[s].getSequence (start, end + 1);
69299 jSize = sequence.length;
69300 for (j = 0; j < jSize; j++) {
69301 $delete = true;
69302 if (!jalview.util.Comparison.isGap (sequence[j])) {
69303 if ($delete) {
69304 endCol = j;
69305 }$delete = false;
69306 }if ($delete && startCol == -1) {
69307 startCol = j;
69308 }if (!$delete && startCol > -1) {
69309 this.appendEdit (jalview.commands.EditCommand.Action.DELETE_GAP,  Clazz_newArray (-1, [seqs[s]]), start + startCol - deletedCols, endCol - startCol, al, false, null);
69310 deletedCols += (endCol - startCol);
69311 startCol = -1;
69312 endCol = -1;
69313 }}
69314 if ($delete && startCol > -1) {
69315 this.appendEdit (jalview.commands.EditCommand.Action.DELETE_GAP,  Clazz_newArray (-1, [seqs[s]]), start + startCol - deletedCols, jSize - startCol, al, false, null);
69316 }}
69317 this.performEdit (0, null);
69318 }, "~A,~N,~N,jalview.datamodel.AlignmentI");
69319 });
69320 Clazz_declarePackage ("jalview.commands");
69321 Clazz_load (["jalview.commands.EditCommand"], "jalview.commands.SlideSequencesCommand", ["jalview.util.Comparison"], function () {
69322 c$ = Clazz_decorateAsClass (function () {
69323 this.gapsInsertedBegin = false;
69324 Clazz_instantialize (this, arguments);
69325 }, jalview.commands, "SlideSequencesCommand", jalview.commands.EditCommand);
69326 Clazz_makeConstructor (c$, 
69327 function (description, seqsLeft, seqsRight, slideSize, gapChar) {
69328 Clazz_superConstructor (this, jalview.commands.SlideSequencesCommand, []);
69329 this.description = description;
69330 var lSize = seqsLeft.length;
69331 this.gapsInsertedBegin = false;
69332 var i;
69333 var j;
69334 for (i = 0; i < lSize; i++) {
69335 for (j = 0; j < slideSize; j++) {
69336 if (!jalview.util.Comparison.isGap (seqsLeft[i].getCharAt (j))) {
69337 this.gapsInsertedBegin = true;
69338 break;
69339 }}
69340 }
69341 var e = null;
69342 if (!this.gapsInsertedBegin) {
69343 e = Clazz_innerTypeInstance (jalview.commands.EditCommand.Edit, this, null, jalview.commands.EditCommand.Action.DELETE_GAP, seqsLeft, 0, slideSize, gapChar);
69344 this.setEdit (e);
69345 } else {
69346 e = Clazz_innerTypeInstance (jalview.commands.EditCommand.Edit, this, null, jalview.commands.EditCommand.Action.INSERT_GAP, seqsRight, 0, slideSize, gapChar);
69347 this.setEdit (e);
69348 }jalview.commands.EditCommand.performEdit (e, null);
69349 }, "~S,~A,~A,~N,~S");
69350 Clazz_defineMethod (c$, "getGapsInsertedBegin", 
69351 function () {
69352 return this.gapsInsertedBegin;
69353 });
69354 Clazz_defineMethod (c$, "appendSlideCommand", 
69355 function (command) {
69356 var same = false;
69357 if (command.getEdit (0).seqs.length == this.getEdit (0).seqs.length) {
69358 same = true;
69359 for (var i = 0; i < command.getEdit (0).seqs.length; i++) {
69360 if (this.getEdit (0).seqs[i] !== command.getEdit (0).seqs[i]) {
69361 same = false;
69362 }}
69363 }if (same) {
69364 command.addEdit (this.getEdit (0));
69365 }return same;
69366 }, "jalview.commands.SlideSequencesCommand");
69367 });
69368 Clazz_declarePackage ("jalview.commands");
69369 Clazz_load (["jalview.commands.EditCommand"], "jalview.commands.TrimRegionCommand", null, function () {
69370 c$ = Clazz_decorateAsClass (function () {
69371 this.colSel = null;
69372 this.start = null;
69373 this.shiftList = null;
69374 this.selectionGroup = null;
69375 this.deletedHiddenColumns = null;
69376 this.columnsDeleted = 0;
69377 Clazz_instantialize (this, arguments);
69378 }, jalview.commands, "TrimRegionCommand", jalview.commands.EditCommand);
69379 Clazz_makeConstructor (c$, 
69380 function (description, command, seqs, column, al, colSel, selectedRegion) {
69381 Clazz_superConstructor (this, jalview.commands.TrimRegionCommand, []);
69382 this.description = description;
69383 this.selectionGroup = selectedRegion;
69384 this.colSel = colSel;
69385 if (command.equalsIgnoreCase (jalview.commands.TrimRegionCommand.TRIM_LEFT)) {
69386 if (column == 0) {
69387 return;
69388 }this.columnsDeleted = column;
69389 this.setEdit (Clazz_innerTypeInstance (jalview.commands.EditCommand.Edit, this, null, jalview.commands.EditCommand.Action.CUT, seqs, 0, column, al));
69390 } else if (command.equalsIgnoreCase (jalview.commands.TrimRegionCommand.TRIM_RIGHT)) {
69391 var width = al.getWidth () - column - 1;
69392 if (width < 2) {
69393 return;
69394 }this.columnsDeleted = width - 1;
69395 this.setEdit (Clazz_innerTypeInstance (jalview.commands.EditCommand.Edit, this, null, jalview.commands.EditCommand.Action.CUT, seqs, column + 1, width, al));
69396 }var i;
69397 var isize = this.getEdit (0).seqs.length;
69398 this.start =  Clazz_newIntArray (isize, 0);
69399 for (i = 0; i < isize; i++) {
69400 this.start[i] = this.getEdit (0).seqs[i].getStart ();
69401 }
69402 this.performEdit (0, null);
69403 }, "~S,~S,~A,~N,jalview.datamodel.AlignmentI,jalview.datamodel.ColumnSelection,jalview.datamodel.SequenceGroup");
69404 Clazz_defineMethod (c$, "cut", 
69405 function (command) {
69406 var column;
69407 var j;
69408 var jSize = command.seqs.length;
69409 for (j = 0; j < jSize; j++) {
69410 if (command.position == 0) {
69411 column = command.seqs[j].findPosition (command.number);
69412 command.seqs[j].setStart (column);
69413 } else {
69414 column = command.seqs[j].findPosition (command.position) - 1;
69415 command.seqs[j].setEnd (column);
69416 }}
69417 Clazz_superCall (this, jalview.commands.TrimRegionCommand, "cut", [command, null]);
69418 if (command.position == 0) {
69419 this.deletedHiddenColumns = this.colSel.compensateForEdit (0, command.number);
69420 if (this.selectionGroup != null) {
69421 this.selectionGroup.adjustForRemoveLeft (command.number);
69422 }} else {
69423 this.deletedHiddenColumns = this.colSel.compensateForEdit (command.position, command.number);
69424 if (this.selectionGroup != null) {
69425 this.selectionGroup.adjustForRemoveRight (command.position);
69426 }}}, "jalview.commands.EditCommand.Edit");
69427 Clazz_defineMethod (c$, "paste", 
69428 function (command) {
69429 Clazz_superCall (this, jalview.commands.TrimRegionCommand, "paste", [command, null]);
69430 var column;
69431 var j;
69432 var jSize = command.seqs.length;
69433 for (j = 0; j < jSize; j++) {
69434 if (command.position == 0) {
69435 command.seqs[j].setStart (this.start[j]);
69436 } else {
69437 column = command.seqs[j].findPosition (command.number + command.position) - 1;
69438 command.seqs[j].setEnd (column);
69439 }}
69440 if (command.position == 0) {
69441 this.colSel.compensateForEdit (0, -command.number);
69442 if (this.selectionGroup != null) {
69443 this.selectionGroup.adjustForRemoveLeft (-command.number);
69444 }}if (this.deletedHiddenColumns != null) {
69445 var region;
69446 for (var i = 0; i < this.deletedHiddenColumns.size (); i++) {
69447 region = this.deletedHiddenColumns.get (i);
69448 this.colSel.hideColumns (region[0], region[1]);
69449 }
69450 }}, "jalview.commands.EditCommand.Edit");
69451 Clazz_overrideMethod (c$, "getSize", 
69452 function () {
69453 return this.columnsDeleted;
69454 });
69455 Clazz_defineStatics (c$,
69456 "TRIM_LEFT", "TrimLeft",
69457 "TRIM_RIGHT", "TrimRight");
69458 });
69459 Clazz_declarePackage ("jalview.controller");
69460 Clazz_load (["jalview.api.AlignViewControllerI"], "jalview.controller.AlignViewController", ["jalview.analysis.AlignmentSorter", "$.Grouping", "jalview.commands.OrderCommand", "jalview.datamodel.ColumnSelection", "jalview.io.FeaturesFile", "jalview.util.MessageManager", "java.awt.Color", "java.util.ArrayList", "$.BitSet"], function () {
69461 c$ = Clazz_decorateAsClass (function () {
69462 this.viewport = null;
69463 this.alignPanel = null;
69464 this.avcg = null;
69465 Clazz_instantialize (this, arguments);
69466 }, jalview.controller, "AlignViewController", null, jalview.api.AlignViewControllerI);
69467 Clazz_overrideMethod (c$, "finalize", 
69468 function () {
69469 this.viewport = null;
69470 this.alignPanel = null;
69471 this.avcg = null;
69472 });
69473 Clazz_makeConstructor (c$, 
69474 function (alignFrame, viewport, alignPanel) {
69475 this.avcg = alignFrame;
69476 this.viewport = viewport;
69477 this.alignPanel = alignPanel;
69478 }, "jalview.api.AlignViewControllerGuiI,jalview.api.AlignViewportI,jalview.api.AlignmentViewPanel");
69479 Clazz_overrideMethod (c$, "setViewportAndAlignmentPanel", 
69480 function (viewport, alignPanel) {
69481 this.alignPanel = alignPanel;
69482 this.viewport = viewport;
69483 }, "jalview.api.AlignViewportI,jalview.api.AlignmentViewPanel");
69484 Clazz_overrideMethod (c$, "makeGroupsFromSelection", 
69485 function () {
69486 var sg = this.viewport.getSelectionGroup ();
69487 var cs = this.viewport.getColumnSelection ();
69488 var gps = null;
69489 if (sg != null && (cs == null || cs.getSelected () == null || cs.size () == 0)) {
69490 gps = jalview.analysis.Grouping.makeGroupsFrom (this.viewport.getSequenceSelection (), this.viewport.getAlignmentView (true).getSequenceStrings (this.viewport.getGapCharacter ()), this.viewport.getAlignment ().getGroups ());
69491 } else {
69492 if (cs != null) {
69493 gps = jalview.analysis.Grouping.makeGroupsFromCols ((sg == null) ? this.viewport.getAlignment ().getSequencesArray () : sg.getSequences ().toArray ( new Array (0)), cs, this.viewport.getAlignment ().getGroups ());
69494 }}if (gps != null) {
69495 this.viewport.getAlignment ().deleteAllGroups ();
69496 this.viewport.clearSequenceColours ();
69497 this.viewport.setSelectionGroup (null);
69498 for (var g = 0; g < gps.length; g++) {
69499 gps[g].setshowSequenceLogo (this.viewport.isShowSequenceLogo ());
69500 this.viewport.getAlignment ().addGroup (gps[g]);
69501 var col =  new java.awt.Color (Clazz_doubleToInt (Math.random () * 255), Clazz_doubleToInt (Math.random () * 255), Clazz_doubleToInt (Math.random () * 255));
69502 col = col.brighter ();
69503 for (var sq, $sq = gps[g].getSequences (null).iterator (); $sq.hasNext () && ((sq = $sq.next ()) || true);) {
69504 this.viewport.setSequenceColour (sq, col);
69505 }
69506 }
69507 return true;
69508 }return false;
69509 });
69510 Clazz_overrideMethod (c$, "createGroup", 
69511 function () {
69512 var sg = this.viewport.getSelectionGroup ();
69513 if (sg != null) {
69514 this.viewport.getAlignment ().addGroup (sg);
69515 return true;
69516 }return false;
69517 });
69518 Clazz_overrideMethod (c$, "unGroup", 
69519 function () {
69520 var sg = this.viewport.getSelectionGroup ();
69521 if (sg != null) {
69522 this.viewport.getAlignment ().deleteGroup (sg);
69523 return true;
69524 }return false;
69525 });
69526 Clazz_overrideMethod (c$, "deleteGroups", 
69527 function () {
69528 if (this.viewport.getAlignment ().getGroups () != null && this.viewport.getAlignment ().getGroups ().size () > 0) {
69529 this.viewport.getAlignment ().deleteAllGroups ();
69530 this.viewport.clearSequenceColours ();
69531 this.viewport.setSelectionGroup (null);
69532 return true;
69533 }return false;
69534 });
69535 Clazz_overrideMethod (c$, "markColumnsContainingFeatures", 
69536 function (invert, extendCurrent, toggle, featureType) {
69537 var bs =  new java.util.BitSet ();
69538 var alw;
69539 var alStart;
69540 var sqcol = (this.viewport.getSelectionGroup () == null ? this.viewport.getAlignment () : this.viewport.getSelectionGroup ());
69541 alStart = sqcol.getStartRes ();
69542 alw = sqcol.getEndRes () + 1;
69543 var seqs = sqcol.getSequences ();
69544 var nseq = 0;
69545 for (var sq, $sq = seqs.iterator (); $sq.hasNext () && ((sq = $sq.next ()) || true);) {
69546 var tfeat = 0;
69547 if (sq != null) {
69548 var sf = sq.getSequenceFeatures ();
69549 if (sf != null) {
69550 var ist = sq.findIndex (sq.getStart ());
69551 var iend = sq.findIndex (sq.getEnd ());
69552 if (iend < alStart || ist > alw) {
69553 continue;
69554 }for (var sfpos, $sfpos = 0, $$sfpos = sf; $sfpos < $$sfpos.length && ((sfpos = $$sfpos[$sfpos]) || true); $sfpos++) {
69555 if (sfpos != null && (featureType.equals (sfpos.getType ()))) {
69556 tfeat++;
69557 var i = sq.findIndex (sfpos.getBegin ());
69558 var j = sq.findIndex (sfpos.getEnd ());
69559 if (j < alStart || i > alw) {
69560 continue;
69561 }if (i < alStart) {
69562 i = alStart;
69563 }if (i < ist) {
69564 i = ist;
69565 }if (j > alw) {
69566 j = alw;
69567 }for (; i <= j; i++) {
69568 bs.set (i - 1);
69569 }
69570 }}
69571 }if (tfeat > 0) {
69572 nseq++;
69573 }}}
69574 var cs = this.viewport.getColumnSelection ();
69575 if (bs.cardinality () > 0 || invert) {
69576 if (cs == null) {
69577 cs =  new jalview.datamodel.ColumnSelection ();
69578 } else {
69579 if (!extendCurrent) {
69580 cs.clear ();
69581 }}if (invert) {
69582 for (var i = bs.nextClearBit (alStart), ibs = bs.nextSetBit (alStart); i >= alStart && i < (alw); ) {
69583 if (ibs < 0 || i < ibs) {
69584 if (toggle && cs.contains (i)) {
69585 cs.removeElement (i++);
69586 } else {
69587 cs.addElement (i++);
69588 }} else {
69589 i = bs.nextClearBit (ibs);
69590 ibs = bs.nextSetBit (i);
69591 }}
69592 } else {
69593 for (var i = bs.nextSetBit (alStart); i >= alStart; i = bs.nextSetBit (i + 1)) {
69594 if (toggle && cs.contains (i)) {
69595 cs.removeElement (i);
69596 } else {
69597 cs.addElement (i);
69598 }}
69599 }this.viewport.setColumnSelection (cs);
69600 this.alignPanel.paintAlignment (true);
69601 this.avcg.setStatus (jalview.util.MessageManager.formatMessage ("label.view_controller_toggled_marked",  Clazz_newArray (-1, [(toggle ? jalview.util.MessageManager.getString ("label.toggled") : jalview.util.MessageManager.getString ("label.marked")), (invert ? (Integer.$valueOf ((alw - alStart) - bs.cardinality ()).toString ()) : (Integer.$valueOf (bs.cardinality ()).toString ())), featureType, Integer.$valueOf (nseq).toString ()])));
69602 return true;
69603 } else {
69604 this.avcg.setStatus (jalview.util.MessageManager.formatMessage ("label.no_feature_of_type_found",  Clazz_newArray (-1, [featureType])));
69605 if (!extendCurrent && cs != null) {
69606 cs.clear ();
69607 this.alignPanel.paintAlignment (true);
69608 }return false;
69609 }}, "~B,~B,~B,~S");
69610 Clazz_overrideMethod (c$, "sortAlignmentByFeatureDensity", 
69611 function (typ) {
69612 this.sortBy (typ, "Sort by Density", jalview.analysis.AlignmentSorter.FEATURE_DENSITY);
69613 }, "~A");
69614 Clazz_defineMethod (c$, "sortBy", 
69615 function (typ, methodText, method) {
69616 var fr = this.alignPanel.getFeatureRenderer ();
69617 if (typ == null) {
69618 typ = fr == null ? null : fr.getDisplayedFeatureTypes ();
69619 }var gps = null;
69620 gps = fr == null ? null : fr.getDisplayedFeatureGroups ();
69621 if (typ != null) {
69622 var types =  new java.util.ArrayList ();
69623 for (var i = 0; i < typ.length; i++) {
69624 if (typ[i] != null) {
69625 types.add (typ[i]);
69626 }typ =  new Array (types.size ());
69627 types.toArray (typ);
69628 }
69629 }if (gps != null) {
69630 var grps =  new java.util.ArrayList ();
69631 for (var i = 0; i < gps.length; i++) {
69632 if (gps[i] != null) {
69633 grps.add (gps[i]);
69634 }}
69635 gps =  new Array (grps.size ());
69636 grps.toArray (gps);
69637 }var al = this.viewport.getAlignment ();
69638 var start;
69639 var stop;
69640 var sg = this.viewport.getSelectionGroup ();
69641 if (sg != null) {
69642 start = sg.getStartRes ();
69643 stop = sg.getEndRes ();
69644 } else {
69645 start = 0;
69646 stop = al.getWidth ();
69647 }var oldOrder = al.getSequencesArray ();
69648 jalview.analysis.AlignmentSorter.sortByFeature (typ, gps, start, stop, al, method);
69649 this.avcg.addHistoryItem ( new jalview.commands.OrderCommand (methodText, oldOrder, this.viewport.getAlignment ()));
69650 this.alignPanel.paintAlignment (true);
69651 }, "~A,~S,~S");
69652 Clazz_overrideMethod (c$, "sortAlignmentByFeatureScore", 
69653 function (typ) {
69654 this.sortBy (typ, "Sort by Feature Score", jalview.analysis.AlignmentSorter.FEATURE_SCORE);
69655 }, "~A");
69656 Clazz_overrideMethod (c$, "parseFeaturesFile", 
69657 function (file, protocol, relaxedIdMatching) {
69658 var featuresFile = false;
69659 try {
69660 featuresFile =  new jalview.io.FeaturesFile (file, protocol).parse (this.viewport.getAlignment ().getDataset (), this.alignPanel.getFeatureRenderer ().getFeatureColours (), false, relaxedIdMatching);
69661 } catch (ex) {
69662 if (Clazz_exceptionOf (ex, Exception)) {
69663 ex.printStackTrace ();
69664 } else {
69665 throw ex;
69666 }
69667 }
69668 if (featuresFile) {
69669 this.avcg.refreshFeatureUI (true);
69670 if (this.alignPanel.getFeatureRenderer () != null) {
69671 this.alignPanel.getFeatureRenderer ().findAllFeatures (true);
69672 }if (this.avcg.getFeatureSettingsUI () != null) {
69673 this.avcg.getFeatureSettingsUI ().discoverAllFeatureData ();
69674 }this.alignPanel.paintAlignment (true);
69675 }return featuresFile;
69676 }, "~S,~S,~B");
69677 });
69678 Clazz_declarePackage ("jalview.api");
69679 Clazz_declareInterface (jalview.api, "AlignViewControllerI");
69680 Clazz_declarePackage ("jalview.analysis");
69681 Clazz_load (null, "jalview.analysis.Grouping", ["jalview.datamodel.SequenceGroup", "java.lang.StringBuilder", "java.util.ArrayList", "$.HashMap"], function () {
69682 c$ = Clazz_declareType (jalview.analysis, "Grouping");
69683 c$.makeGroupsFrom = Clazz_defineMethod (c$, "makeGroupsFrom", 
69684 function (sequences, selectedChars, list) {
69685 var gps =  new java.util.HashMap ();
69686 var width = 0;
69687 var i;
69688 var pgroup =  new java.util.HashMap ();
69689 if (list != null) {
69690 for (var sg, $sg = list.iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
69691 for (var sq, $sq = sg.getSequences (null).iterator (); $sq.hasNext () && ((sq = $sq.next ()) || true);) {
69692 pgroup.put (sq.toString (), sg);
69693 }
69694 }
69695 }for (i = 0; i < sequences.length; i++) {
69696 var schar = selectedChars[i];
69697 var pgp = pgroup.get ((sequences[i]).toString ());
69698 if (pgp != null) {
69699 schar = pgp.getName () + ":" + schar;
69700 }var svec = gps.get (schar);
69701 if (svec == null) {
69702 svec =  new java.util.ArrayList ();
69703 gps.put (schar, svec);
69704 }if (width < sequences[i].getLength ()) {
69705 width = sequences[i].getLength ();
69706 }svec.add (sequences[i]);
69707 }
69708 var groups =  new Array (gps.size ());
69709 i = 0;
69710 for (var key, $key = gps.keySet ().iterator (); $key.hasNext () && ((key = $key.next ()) || true);) {
69711 var group =  new jalview.datamodel.SequenceGroup (gps.get (key), "Subseq: " + key, null, true, true, false, 0, width - 1);
69712 groups[i++] = group;
69713 }
69714 gps.clear ();
69715 pgroup.clear ();
69716 return groups;
69717 }, "~A,~A,java.util.List");
69718 c$.makeGroupsFromCols = Clazz_defineMethod (c$, "makeGroupsFromCols", 
69719 function (sequences, cs, list) {
69720 var gps =  new java.util.HashMap ();
69721 var pgroup =  new java.util.HashMap ();
69722 if (list != null) {
69723 for (var sg, $sg = list.iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
69724 for (var sq, $sq = sg.getSequences (null).iterator (); $sq.hasNext () && ((sq = $sq.next ()) || true);) {
69725 pgroup.put (sq.toString (), sg);
69726 }
69727 }
69728 }var spos =  Clazz_newIntArray (cs.getSelected ().size (), 0);
69729 var width = -1;
69730 var i = 0;
69731 for (var pos, $pos = cs.getSelected ().iterator (); $pos.hasNext () && ((pos = $pos.next ()) || true);) {
69732 spos[i++] = pos.intValue ();
69733 }
69734 ;for (i = 0; i < sequences.length; i++) {
69735 var slen = sequences[i].getLength ();
69736 if (width < slen) {
69737 width = slen;
69738 }var pgp = pgroup.get ((sequences[i]).toString ());
69739 var schar =  new StringBuilder ();
69740 if (pgp != null) {
69741 schar.append (pgp.getName () + ":");
69742 }for (var p, $p = 0, $$p = spos; $p < $$p.length && ((p = $$p[$p]) || true); $p++) {
69743 if (p >= slen) {
69744 schar.append ("~");
69745 } else {
69746 schar.append (sequences[i].getCharAt (p));
69747 }}
69748 var svec = gps.get (schar.toString ());
69749 if (svec == null) {
69750 svec =  new java.util.ArrayList ();
69751 gps.put (schar.toString (), svec);
69752 }svec.add (sequences[i]);
69753 }
69754 var groups =  new Array (gps.size ());
69755 i = 0;
69756 for (var key, $key = gps.keySet ().iterator (); $key.hasNext () && ((key = $key.next ()) || true);) {
69757 var group =  new jalview.datamodel.SequenceGroup (gps.get (key), "Subseq: " + key, null, true, true, false, 0, width - 1);
69758 groups[i++] = group;
69759 }
69760 gps.clear ();
69761 pgroup.clear ();
69762 return groups;
69763 }, "~A,jalview.datamodel.ColumnSelection,java.util.List");
69764 c$.divideByFeature = Clazz_defineMethod (c$, "divideByFeature", 
69765 function (featureLabels, groupLabels, start, stop, sequences, exgroups, method) {
69766 }, "~A,~A,~N,~N,~A,java.util.Vector,~S");
69767 });
69768 Clazz_declarePackage ("jalview.io");
69769 Clazz_load (null, "jalview.io.AlignmentProperties", ["java.lang.StringBuffer"], function () {
69770 c$ = Clazz_decorateAsClass (function () {
69771 this.alignment = null;
69772 Clazz_instantialize (this, arguments);
69773 }, jalview.io, "AlignmentProperties");
69774 Clazz_makeConstructor (c$, 
69775 function (alignment) {
69776 this.alignment = alignment;
69777 }, "jalview.datamodel.AlignmentI");
69778 Clazz_defineMethod (c$, "writeProperties", 
69779 function (sb, html) {
69780 var nl = html ? "<br>" : System.getProperty ("line.separator");
69781 var avg = 0;
69782 var min = 2147483647;
69783 var max = 0;
69784 for (var i = 0; i < this.alignment.getHeight (); i++) {
69785 var size = 1 + this.alignment.getSequenceAt (i).getEnd () - this.alignment.getSequenceAt (i).getStart ();
69786 avg += size;
69787 if (size > max) {
69788 max = size;
69789 }if (size < min) {
69790 min = size;
69791 }}
69792 avg = avg / this.alignment.getHeight ();
69793 sb.append (nl);
69794 sb.append ("Sequences: " + this.alignment.getHeight ());
69795 sb.append (nl);
69796 sb.append ("Minimum Sequence Length: " + min);
69797 sb.append (nl);
69798 sb.append ("Maximum Sequence Length: " + max);
69799 sb.append (nl);
69800 sb.append ("Average Length: " + Clazz_floatToInt (avg));
69801 if ((this.alignment).alignmentProperties != null) {
69802 sb.append (nl);
69803 sb.append (nl);
69804 if (html) {
69805 sb.append ("<table border=\"1\">");
69806 }var props = (this.alignment).alignmentProperties;
69807 var en = props.keys ();
69808 while (en.hasMoreElements ()) {
69809 var key = en.nextElement ().toString ();
69810 var vals = props.get (key).toString ();
69811 if (html) {
69812 var val =  new StringBuffer ();
69813 var pos = 0;
69814 var npos;
69815 do {
69816 npos = vals.indexOf ("\n", pos);
69817 if (npos == -1) {
69818 val.append (vals.substring (pos));
69819 } else {
69820 val.append (vals.substring (pos, npos));
69821 val.append ("<br>");
69822 }pos = npos + 1;
69823 } while (npos != -1);
69824 sb.append ("<tr><td>" + key + "</td><td>" + val + "</td></tr>");
69825 } else {
69826 sb.append (nl + key + "\t" + vals);
69827 }}
69828 if (html) {
69829 sb.append ("</table>");
69830 }}}, "StringBuffer,~B");
69831 Clazz_defineMethod (c$, "formatAsString", 
69832 function () {
69833 return this.formatReport (false);
69834 });
69835 Clazz_defineMethod (c$, "formatReport", 
69836 function (html) {
69837 var sb =  new StringBuffer ();
69838 this.writeProperties (sb, html);
69839 return sb;
69840 }, "~B");
69841 Clazz_defineMethod (c$, "formatAsHtml", 
69842 function () {
69843 return this.formatReport (true);
69844 });
69845 });
69846 Clazz_declarePackage ("jalview.schemes");
69847 Clazz_load (null, "jalview.schemes.RNAHelicesColourChooser", ["jalview.schemes.RNAHelicesColour", "java.util.Hashtable", "$.Vector"], function () {
69848 c$ = Clazz_decorateAsClass (function () {
69849 this.av = null;
69850 this.ap = null;
69851 this.oldcs = null;
69852 this.oldgroupColours = null;
69853 this.currentAnnotation = null;
69854 this.adjusting = false;
69855 Clazz_instantialize (this, arguments);
69856 }, jalview.schemes, "RNAHelicesColourChooser");
69857 Clazz_makeConstructor (c$, 
69858 function (av, ap) {
69859 this.oldcs = av.getGlobalColourScheme ();
69860 if (av.getAlignment ().getGroups () != null) {
69861 this.oldgroupColours =  new java.util.Hashtable ();
69862 for (var sg, $sg = ap.getAlignment ().getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
69863 if (sg.cs != null) {
69864 this.oldgroupColours.put (sg, sg.cs);
69865 }}
69866 }this.av = av;
69867 this.ap = ap;
69868 if (Clazz_instanceOf (this.oldcs, jalview.schemes.RNAHelicesColour)) {
69869 var rhc = this.oldcs;
69870 }this.adjusting = true;
69871 var list =  new java.util.Vector ();
69872 var index = 1;
69873 for (var i = 0; i < av.getAlignment ().getAlignmentAnnotation ().length; i++) {
69874 var label = av.getAlignment ().getAlignmentAnnotation ()[i].label;
69875 if (!list.contains (label)) list.addElement (label);
69876  else list.addElement (label + "_" + (index++));
69877 }
69878 this.adjusting = false;
69879 this.changeColour ();
69880 }, "jalview.api.AlignViewportI,jalview.api.AlignmentViewPanel");
69881 Clazz_defineMethod (c$, "changeColour", 
69882 function () {
69883 if (this.adjusting) {
69884 return;
69885 }var rhc = null;
69886 rhc =  new jalview.schemes.RNAHelicesColour (this.av.getAlignment ());
69887 this.av.setGlobalColourScheme (rhc);
69888 if (this.av.getAlignment ().getGroups () != null) {
69889 for (var sg, $sg = this.ap.getAlignment ().getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
69890 if (sg.cs == null) {
69891 continue;
69892 }sg.cs =  new jalview.schemes.RNAHelicesColour (sg);
69893 }
69894 }this.ap.paintAlignment (false);
69895 });
69896 Clazz_defineMethod (c$, "reset", 
69897 function () {
69898 this.av.setGlobalColourScheme (this.oldcs);
69899 if (this.av.getAlignment ().getGroups () != null) {
69900 for (var sg, $sg = this.ap.getAlignment ().getGroups ().iterator (); $sg.hasNext () && ((sg = $sg.next ()) || true);) {
69901 sg.cs = this.oldgroupColours.get (sg);
69902 }
69903 }});
69904 Clazz_defineMethod (c$, "annotations_actionPerformed", 
69905 function (e) {
69906 this.changeColour ();
69907 }, "java.awt.event.ActionEvent");
69908 });
69909 Clazz_declarePackage ("jalview.schemes");
69910 Clazz_load (["jalview.schemes.ResidueColourScheme"], "jalview.schemes.RNAInteractionColourScheme", ["jalview.schemes.ResidueProperties", "java.awt.Color"], function () {
69911 c$ = Clazz_declareType (jalview.schemes, "RNAInteractionColourScheme", jalview.schemes.ResidueColourScheme);
69912 Clazz_overrideMethod (c$, "findColour", 
69913 function (c) {
69914 return this.colors[jalview.schemes.ResidueProperties.nucleotideIndex[c.charCodeAt (0)]];
69915 }, "~S");
69916 Clazz_overrideMethod (c$, "findColourSeq", 
69917 function (c, j, seq) {
69918 var currentColour;
69919 if ((this.threshold == 0) || this.aboveThreshold (c, j)) {
69920 try {
69921 currentColour = this.colors[jalview.schemes.ResidueProperties.nucleotideIndex[c.charCodeAt (0)]];
69922 } catch (ex) {
69923 if (Clazz_exceptionOf (ex, Exception)) {
69924 return java.awt.Color.white;
69925 } else {
69926 throw ex;
69927 }
69928 }
69929 } else {
69930 return java.awt.Color.white;
69931 }if (this.conservationColouring) {
69932 currentColour = this.applyConservation (currentColour, j);
69933 }return currentColour;
69934 }, "~S,~N,jalview.datamodel.SequenceI");
69935 });
69936 Clazz_declarePackage("java.net");
69937 c$=Clazz_declareType(java.net,"URLEncoder");
69938 c$.encode=Clazz_defineMethod(c$,"encode",
69939 function(s){
69940 return encodeURIComponent(arguments[0]);
69941 },"~S");
69942 c$.encode=Clazz_defineMethod(c$,"encode",
69943 function(s,enc){
69944 return encodeURIComponent(arguments[0]);
69945 },"~S,~S");
69946 Clazz_defineStatics(c$,
69947 "digits","0123456789ABCDEF");
69948 Clazz_declarePackage ("jalview.io");
69949 Clazz_load (null, "jalview.io.JnetAnnotationMaker", ["jalview.datamodel.AlignmentAnnotation", "$.Annotation", "jalview.util.MessageManager", "java.lang.Exception", "$.Float"], function () {
69950 c$ = Clazz_declareType (jalview.io, "JnetAnnotationMaker");
69951 c$.add_annotation = Clazz_defineMethod (c$, "add_annotation", 
69952 function (prediction, al, firstSeq, noMsa) {
69953 jalview.io.JnetAnnotationMaker.add_annotation (prediction, al, firstSeq, noMsa, Clazz_castNullAs ("Array"));
69954 }, "jalview.io.AlignFile,jalview.datamodel.AlignmentI,~N,~B");
69955 c$.add_annotation = Clazz_defineMethod (c$, "add_annotation", 
69956 function (prediction, al, firstSeq, noMsa, delMap) {
69957 var i = 0;
69958 var preds = prediction.getSeqsAsArray ();
69959 var seqRef = al.getSequenceAt (firstSeq);
69960 var width = preds[0].getSequence ().length;
69961 var gapmap = al.getSequenceAt (firstSeq).gapMap ();
69962 if ((delMap != null && delMap.length > width) || (delMap == null && gapmap.length != width)) {
69963 throw ( new Exception (jalview.util.MessageManager.formatMessage ("exception.number_of_residues_in_query_sequence_differ_from_prediction",  Clazz_newArray (-1, [(delMap == null ? "" : jalview.util.MessageManager.getString ("label.mapped")), al.getSequenceAt (firstSeq).getName (), al.getSequenceAt (firstSeq).getSequenceAsString (), Integer.$valueOf (width).toString ()]))));
69964 }var annot;
69965 var annotations = null;
69966 var existingAnnotations = 0;
69967 if (al.getAlignmentAnnotation () != null) {
69968 existingAnnotations = al.getAlignmentAnnotation ().length;
69969 }var sol =  new Array (al.getWidth ());
69970 var firstsol = true;
69971 while (i < preds.length) {
69972 var id = preds[i].getName ().toUpperCase ();
69973 if (id.startsWith ("LUPAS") || id.startsWith ("JNET") || id.startsWith ("JPRED")) {
69974 if (id.startsWith ("JNETSOL")) {
69975 var amnt = (id.endsWith ("25") ? 3 : id.endsWith ("5") ? 6 : 9);
69976 for (var spos = 0; spos < width; spos++) {
69977 var sposw = (delMap == null) ? gapmap[spos] : gapmap[delMap[spos]];
69978 if (firstsol) {
69979 sol[sposw] =  new jalview.datamodel.Annotation (0);
69980 }if (preds[i].getCharAt (spos) == 'B' && (sol[sposw].value == 0 || sol[sposw].value < amnt)) {
69981 sol[sposw].value = amnt;
69982 }}
69983 firstsol = false;
69984 } else {
69985 annotations =  new Array (al.getWidth ());
69986 if (id.equals ("JNETPRED") || id.equals ("JNETPSSM") || id.equals ("JNETFREQ") || id.equals ("JNETHMM") || id.equals ("JNETALIGN") || id.equals ("JPRED")) {
69987 if (delMap == null) {
69988 for (var j = 0; j < width; j++) {
69989 annotations[gapmap[j]] =  new jalview.datamodel.Annotation ("", "", preds[i].getCharAt (j), 0);
69990 }
69991 } else {
69992 for (var j = 0; j < width; j++) {
69993 annotations[gapmap[delMap[j]]] =  new jalview.datamodel.Annotation ("", "", preds[i].getCharAt (j), 0);
69994 }
69995 }} else if (id.equals ("JNETCONF")) {
69996 if (delMap == null) {
69997 for (var j = 0; j < width; j++) {
69998 var value =  new Float (preds[i].getCharAt (j) + "").floatValue ();
69999 annotations[gapmap[j]] =  new jalview.datamodel.Annotation (preds[i].getCharAt (j) + "", "", preds[i].getCharAt (j), value);
70000 }
70001 } else {
70002 for (var j = 0; j < width; j++) {
70003 var value =  new Float (preds[i].getCharAt (j) + "").floatValue ();
70004 annotations[gapmap[delMap[j]]] =  new jalview.datamodel.Annotation (preds[i].getCharAt (j) + "", "", preds[i].getCharAt (j), value);
70005 }
70006 }} else {
70007 if (delMap == null) {
70008 for (var j = 0; j < width; j++) {
70009 annotations[gapmap[j]] =  new jalview.datamodel.Annotation (preds[i].getCharAt (j) + "", "", ' ', 0);
70010 }
70011 } else {
70012 for (var j = 0; j < width; j++) {
70013 annotations[gapmap[delMap[j]]] =  new jalview.datamodel.Annotation (preds[i].getCharAt (j) + "", "", ' ', 0);
70014 }
70015 }}if (id.equals ("JNETCONF")) {
70016 annot =  new jalview.datamodel.AlignmentAnnotation (preds[i].getName (), "JNet Output", annotations, 0, 10, 1);
70017 } else {
70018 annot =  new jalview.datamodel.AlignmentAnnotation (preds[i].getName (), "JNet Output", annotations);
70019 }if (seqRef != null) {
70020 annot.createSequenceMapping (seqRef, 1, true);
70021 seqRef.addAlignmentAnnotation (annot);
70022 }al.addAnnotation (annot);
70023 al.setAnnotationIndex (annot, al.getAlignmentAnnotation ().length - existingAnnotations - 1);
70024 }if (noMsa) {
70025 al.deleteSequence (preds[i]);
70026 }}i++;
70027 }
70028 if (!firstsol) {
70029 annot =  new jalview.datamodel.AlignmentAnnotation ("Jnet Burial", "<html>Prediction of Solvent Accessibility<br/>levels are<ul><li>0 - Exposed</li><li>3 - 25% or more S.A. accessible</li><li>6 - 5% or more S.A. accessible</li><li>9 - Buried (<5% exposed)</li></ul>", sol, 0, 9, 1);
70030 annot.validateRangeAndDisplay ();
70031 if (seqRef != null) {
70032 annot.createSequenceMapping (seqRef, 1, true);
70033 seqRef.addAlignmentAnnotation (annot);
70034 }al.addAnnotation (annot);
70035 al.setAnnotationIndex (annot, al.getAlignmentAnnotation ().length - existingAnnotations - 1);
70036 }}, "jalview.io.AlignFile,jalview.datamodel.AlignmentI,~N,~B,~A");
70037 });
70038 Clazz_declarePackage ("jalview.javascript");
70039 Clazz_load (null, "jalview.javascript.JSFunctionExec", ["jalview.bin.JalviewLite", "java.lang.StringBuffer", "$.Thread", "java.net.MalformedURLException", "$.URL", "netscape.javascript.JSException", "$.JSObject"], function () {
70040 c$ = Clazz_decorateAsClass (function () {
70041 this.jvlite = null;
70042 this.jsExecQueue = null;
70043 this.executor = null;
70044 Clazz_instantialize (this, arguments);
70045 }, jalview.javascript, "JSFunctionExec", null, Runnable);
70046 Clazz_makeConstructor (c$, 
70047 function (applet) {
70048 this.jvlite = applet;
70049 this.jsExecQueue = this.jvlite.getJsExecQueue ();
70050 this.jvlite.setExecutor (this);
70051 }, "jalview.bin.JalviewLite");
70052 Clazz_overrideMethod (c$, "finalize", 
70053 function () {
70054 this.jvlite = null;
70055 this.executor = null;
70056 if (this.jsExecQueue != null) {
70057 this.jsExecQueue.clear ();
70058 }this.jsExecQueue = null;
70059 });
70060 Clazz_defineMethod (c$, "stopQueue", 
70061 function () {
70062 if (this.jsExecQueue != null) {
70063 var q = null;
70064 {
70065 q = this.jsExecQueue;
70066 this.jsExecQueue = null;
70067 }if (q != null) {
70068 for (var jx, $jx = q.iterator (); $jx.hasNext () && ((jx = $jx.next ()) || true);) {
70069 jx.jvlite = null;
70070 }
70071 q.removeAllElements ();
70072 {
70073 q.notifyAll ();
70074 }}}this.jvlite = null;
70075 this.executor = null;
70076 });
70077 Clazz_defineMethod (c$, "run", 
70078 function () {
70079 while (this.jsExecQueue != null) {
70080 if (this.jsExecQueue.size () > 0) {
70081 var r = this.jsExecQueue.elementAt (0);
70082 this.jsExecQueue.removeElementAt (0);
70083 try {
70084 r.run ();
70085 } catch (e$$) {
70086 if (Clazz_exceptionOf (e$$, Exception)) {
70087 var ex = e$$;
70088 {
70089 ex.printStackTrace ();
70090 }
70091 } else if (Clazz_exceptionOf (e$$, Error)) {
70092 var ex = e$$;
70093 {
70094 ex.printStackTrace ();
70095 }
70096 } else {
70097 throw e$$;
70098 }
70099 }
70100 } else {
70101 try {
70102 {
70103 this.jsExecQueue.wait (1000);
70104 }} catch (ex) {
70105 if (Clazz_exceptionOf (ex, Exception)) {
70106 } else {
70107 throw ex;
70108 }
70109 }
70110 ;}}
70111 });
70112 Clazz_defineMethod (c$, "executeJavascriptFunction", 
70113 function (_listener, objects) {
70114 this.executeJavascriptFunction (false, _listener, objects);
70115 }, "~S,~A");
70116 Clazz_defineMethod (c$, "executeJavascriptFunction", 
70117 function (async, _listener, $arguments) {
70118 this.executeJavascriptFunction (async, _listener, $arguments, null);
70119 }, "~B,~S,~A");
70120 Clazz_defineMethod (c$, "executeJavascriptFunction", 
70121 function (async, _listener, $arguments, dbgMsg) {
70122 var objects =  new Array ($arguments != null ? $arguments.length : 0);
70123 if ($arguments != null) {
70124 System.arraycopy ($arguments, 0, objects, 0, $arguments.length);
70125 }var jsex =  new Array (1);
70126 var exec = ((Clazz_isClassDefined ("jalview.javascript.JSFunctionExec$1") ? 0 : jalview.javascript.JSFunctionExec.$JSFunctionExec$1$ ()), Clazz_innerTypeInstance (jalview.javascript.JSFunctionExec$1, this, Clazz_cloneFinals ("dbgMsg", dbgMsg, "_listener", _listener, "objects", objects, "jsex", jsex, "async", async)));
70127 if (async) {
70128 if (this.executor == null) {
70129 this.executor =  new Thread ( new jalview.javascript.JSFunctionExec (this.jvlite));
70130 this.executor.start ();
70131 }{
70132 this.jsExecQueue.addElement (exec);
70133 this.jsExecQueue.notify ();
70134 }} else {
70135 exec.run ();
70136 if (jsex[0] != null) {
70137 throw (jsex[0]);
70138 }}}, "~B,~S,~A,~S");
70139 c$.$JSFunctionExec$1$ = function () {
70140 Clazz_pu$h(self.c$);
70141 c$ = Clazz_declareAnonymous (jalview.javascript, "JSFunctionExec$1", null, Runnable);
70142 Clazz_defineMethod (c$, "run", 
70143 function () {
70144 try {
70145 var scriptObject = null;
70146 try {
70147 scriptObject = netscape.javascript.JSObject.getWindow (this.b$["jalview.javascript.JSFunctionExec"].jvlite);
70148 } catch (ex) {
70149 if (Clazz_exceptionOf (ex, Exception)) {
70150 } else {
70151 throw ex;
70152 }
70153 }
70154 ;if (scriptObject != null) {
70155 if (jalview.bin.JalviewLite.debug && this.f$.dbgMsg != null) {
70156 System.err.println (this.f$.dbgMsg);
70157 }scriptObject.call (this.f$._listener, this.f$.objects);
70158 }} catch (jex) {
70159 if (Clazz_exceptionOf (jex, Exception)) {
70160 if (!(Clazz_instanceOf (jex, java.net.MalformedURLException))) {
70161 if (jalview.bin.JalviewLite.debug) {
70162 System.err.println (jex);
70163 }if (Clazz_instanceOf (jex, netscape.javascript.JSException) && this.b$["jalview.javascript.JSFunctionExec"].jvlite.jsfallbackEnabled) {
70164 this.f$.jsex[0] = jex;
70165 if (jalview.bin.JalviewLite.debug) {
70166 System.err.println ("Falling back to javascript: url call");
70167 }var sb =  new StringBuffer ("javascript:" + this.f$._listener + "(");
70168 for (var i = 0; this.f$.objects != null && i < this.f$.objects.length; i++) {
70169 if (i > 0) {
70170 sb.append (",");
70171 }sb.append ("\"");
70172 if (this.f$.objects[i] != null && !(this.f$.objects[i].getClass ().getName ().indexOf ("jalview") == 0)) {
70173 sb.append (this.f$.objects[i].toString ());
70174 }sb.append ("\"");
70175 }
70176 sb.append (")");
70177 if (jalview.bin.JalviewLite.debug) {
70178 System.err.println (sb.toString ());
70179 }var url = null;
70180 try {
70181 url =  new java.net.URL (sb.toString ());
70182 this.b$["jalview.javascript.JSFunctionExec"].jvlite.getAppletContext ().showDocument (url);
70183 jex = null;
70184 } catch (uex) {
70185 if (Clazz_exceptionOf (uex, Exception)) {
70186 jex = uex;
70187 } else {
70188 throw uex;
70189 }
70190 }
70191 }if (jex != null) {
70192 if (this.f$.async) {
70193 jex.printStackTrace ();
70194 } else {
70195 this.f$.jsex[0] = jex;
70196 }};}} else {
70197 throw jex;
70198 }
70199 }
70200 });
70201 c$ = Clazz_p0p ();
70202 };
70203 });
70204 Clazz_declarePackage ("netscape.javascript");
70205 Clazz_load (["java.lang.Exception"], "netscape.javascript.JSException", null, function () {
70206 c$ = Clazz_declareType (netscape.javascript, "JSException", Exception);
70207 });
70208 Clazz_declarePackage ("netscape.javascript");
70209 c$ = Clazz_declareType (netscape.javascript, "JSObject");
70210 c$.getWindow = Clazz_defineMethod (c$, "getWindow", 
70211 function (jvlite) {
70212 {
70213 return window;
70214 }}, "jalview.bin.JalviewLite");
70215 Clazz_defineMethod (c$, "call", 
70216 function (func, params) {
70217 {
70218 alert("call " + func);
70219 func.apply(null, params);
70220 }}, "~S,~A");
70221 Clazz_defineMethod (c$, "eval", 
70222 function (string) {
70223 {
70224 alert("evval " + string);
70225 }return this.eval (string);
70226 }, "~S");
70227 Clazz_declarePackage ("jalview.javascript");
70228 Clazz_load (["jalview.javascript.JSFunctionExec", "$.JsCallBack", "jalview.structure.SelectionListener"], "jalview.javascript.JsSelectionSender", ["jalview.appletgui.AlignViewport", "netscape.javascript.JSException"], function () {
70229 c$ = Clazz_decorateAsClass (function () {
70230 this._af = null;
70231 this._listener = null;
70232 Clazz_instantialize (this, arguments);
70233 }, jalview.javascript, "JsSelectionSender", jalview.javascript.JSFunctionExec, [jalview.structure.SelectionListener, jalview.javascript.JsCallBack]);
70234 Clazz_makeConstructor (c$, 
70235 function (jvlite, af, listener) {
70236 Clazz_superConstructor (this, jalview.javascript.JsSelectionSender, [jvlite]);
70237 this._af = af;
70238 this._listener = listener;
70239 }, "jalview.bin.JalviewLite,jalview.appletgui.AlignFrame,~S");
70240 Clazz_overrideMethod (c$, "selection", 
70241 function (seqsel, colsel, source) {
70242 try {
70243 var setid = "";
70244 var viewid = "";
70245 var src = this._af;
70246 if (source != null) {
70247 if (Clazz_instanceOf (source, jalview.appletgui.AlignViewport) && (source).applet.currentAlignFrame.viewport === source) {
70248 src = (source).applet.currentAlignFrame;
70249 }}var seqs =  Clazz_newArray (-1, []);
70250 var cols =  Clazz_newArray (-1, []);
70251 var strt = 0;
70252 var end = (src == null) ? -1 : src.alignPanel.av.getAlignment ().getWidth ();
70253 if (seqsel != null && seqsel.getSize () > 0) {
70254 seqs =  new Array (seqsel.getSize ());
70255 for (var i = 0; i < seqs.length; i++) {
70256 seqs[i] = seqsel.getSequenceAt (i).getName ();
70257 }
70258 if (strt < seqsel.getStartRes ()) {
70259 strt = seqsel.getStartRes ();
70260 }if (end == -1 || end > seqsel.getEndRes ()) {
70261 end = seqsel.getEndRes ();
70262 }}if (colsel != null && colsel.size () > 0) {
70263 if (end == -1) {
70264 end = colsel.getMax () + 1;
70265 }cols =  new Array (colsel.getSelected ().size ());
70266 var d = 0;
70267 var r = -1;
70268 for (var i = 0; i < cols.length; i++) {
70269 cols[i] = "" + (1 + colsel.getSelected ().elementAt (i).intValue ());
70270 }
70271 } else {
70272 if (seqsel != null && seqsel.getSize () > 0) {
70273 cols =  new Array (2);
70274 cols[0] = "" + (1 + strt) + "-" + (1 + end);
70275 };}System.err.println ("Relaying selection to jsfunction:" + this._listener);
70276 this.executeJavascriptFunction (this._listener,  Clazz_newArray (-1, [src, setid, this.jvlite.arrayToSeparatorList (seqs), this.jvlite.arrayToSeparatorList (cols)]));
70277 } catch (ex) {
70278 if (Clazz_exceptionOf (ex, Exception)) {
70279 System.err.println ("Jalview Javascript exec error: Couldn't send selection message using function '" + this._listener + "'");
70280 ex.printStackTrace ();
70281 if (Clazz_instanceOf (ex, netscape.javascript.JSException)) {
70282 System.err.println ("Javascript Exception: " + (ex).getCause ().toString ());
70283 }} else {
70284 throw ex;
70285 }
70286 }
70287 }, "jalview.datamodel.SequenceGroup,jalview.datamodel.ColumnSelection,jalview.structure.SelectionSource");
70288 Clazz_overrideMethod (c$, "getAlignFrame", 
70289 function () {
70290 return this._af;
70291 });
70292 Clazz_overrideMethod (c$, "getListenerFunction", 
70293 function () {
70294 return this._listener;
70295 });
70296 });
70297 Clazz_declarePackage ("jalview.javascript");
70298 Clazz_declareInterface (jalview.javascript, "JsCallBack");
70299 Clazz_declarePackage ("jalview.javascript");
70300 Clazz_load (["jalview.javascript.JSFunctionExec", "$.JsCallBack", "jalview.structure.VamsasListener"], "jalview.javascript.MouseOverListener", ["jalview.appletgui.AlignViewport", "netscape.javascript.JSException"], function () {
70301 c$ = Clazz_decorateAsClass (function () {
70302 this._af = null;
70303 this._listener = null;
70304 this.last = null;
70305 this.i = -1;
70306 Clazz_instantialize (this, arguments);
70307 }, jalview.javascript, "MouseOverListener", jalview.javascript.JSFunctionExec, [jalview.structure.VamsasListener, jalview.javascript.JsCallBack]);
70308 Clazz_overrideMethod (c$, "mouseOverSequence", 
70309 function (seq, index, source) {
70310 if (seq !== this.last || this.i != index) {
70311 this.last = seq;
70312 this.i = index;
70313 var src = null;
70314 try {
70315 if (source != null) {
70316 if (Clazz_instanceOf (source, jalview.appletgui.AlignViewport) && (source).applet.currentAlignFrame.viewport === source) {
70317 src = (source).applet.currentAlignFrame;
70318 }}this.executeJavascriptFunction (this._listener,  Clazz_newArray (-1, [src, seq.getDisplayId (false), "" + (1 + this.i), "" + seq.findPosition (this.i)]));
70319 } catch (ex) {
70320 if (Clazz_exceptionOf (ex, Exception)) {
70321 System.err.println ("JalviewLite javascript error: Couldn't send mouseOver with handler '" + this._listener + "'");
70322 if (Clazz_instanceOf (ex, netscape.javascript.JSException)) {
70323 System.err.println ("Javascript Exception: " + (ex).getMessage ());
70324 }ex.printStackTrace ();
70325 } else {
70326 throw ex;
70327 }
70328 }
70329 }}, "jalview.datamodel.SequenceI,~N,jalview.structure.VamsasSource");
70330 Clazz_makeConstructor (c$, 
70331 function (applet, af, listener) {
70332 Clazz_superConstructor (this, jalview.javascript.MouseOverListener, [applet]);
70333 this._af = af;
70334 this._listener = listener;
70335 }, "jalview.bin.JalviewLite,jalview.appletgui.AlignFrame,~S");
70336 Clazz_overrideMethod (c$, "getAlignFrame", 
70337 function () {
70338 return this._af;
70339 });
70340 Clazz_overrideMethod (c$, "getListenerFunction", 
70341 function () {
70342 return this._listener;
70343 });
70344 });
70345 Clazz_declarePackage ("jalview.javascript");
70346 Clazz_load (["jalview.javascript.JSFunctionExec", "$.JsCallBack", "jalview.structure.StructureListener"], "jalview.javascript.MouseOverStructureListener", ["jalview.api.AlignmentViewPanel", "jalview.appletgui.FeatureRenderer", "jalview.ext.jmol.JmolCommands", "jalview.structure.StructureSelectionManager", "java.net.URL", "java.util.ArrayList"], function () {
70347 c$ = Clazz_decorateAsClass (function () {
70348 this._listenerfn = null;
70349 this.modelSet = null;
70350 Clazz_instantialize (this, arguments);
70351 }, jalview.javascript, "MouseOverStructureListener", jalview.javascript.JSFunctionExec, [jalview.javascript.JsCallBack, jalview.structure.StructureListener]);
70352 Clazz_makeConstructor (c$, 
70353 function (jalviewLite, listener, modelList) {
70354 Clazz_superConstructor (this, jalview.javascript.MouseOverStructureListener, [jalviewLite]);
70355 this._listenerfn = listener;
70356 this.modelSet = modelList;
70357 if (this.modelSet != null) {
70358 for (var i = 0; i < this.modelSet.length; i++) {
70359 try {
70360 if ( new java.net.URL (this.modelSet[i]).openConnection () != null) {
70361 continue;
70362 }} catch (x) {
70363 if (Clazz_exceptionOf (x, Exception)) {
70364 } else {
70365 throw x;
70366 }
70367 }
70368 ;try {
70369 var db = this.jvlite.getDocumentBase ().toString ();
70370 db = db.substring (0, db.lastIndexOf ("/"));
70371 if ( new java.net.URL (db + "/" + this.modelSet[i]).openConnection () != null) {
70372 this.modelSet[i] = db + "/" + this.modelSet[i];
70373 continue;
70374 }} catch (x) {
70375 if (Clazz_exceptionOf (x, Exception)) {
70376 } else {
70377 throw x;
70378 }
70379 }
70380 ;try {
70381 if ( new java.net.URL (this.jvlite.getCodeBase () + this.modelSet[i]).openConnection () != null) {
70382 this.modelSet[i] = this.jvlite.getCodeBase () + this.modelSet[i];
70383 continue;
70384 }} catch (x) {
70385 if (Clazz_exceptionOf (x, Exception)) {
70386 } else {
70387 throw x;
70388 }
70389 }
70390 ;}
70391 }}, "jalview.bin.JalviewLite,~S,~A");
70392 Clazz_overrideMethod (c$, "getPdbFile", 
70393 function () {
70394 return this.modelSet;
70395 });
70396 Clazz_defineMethod (c$, "mouseOverStructure", 
70397 function (atomIndex, strInfo) {
70398 }, "~N,~S");
70399 Clazz_overrideMethod (c$, "highlightAtoms", 
70400 function (atoms) {
70401 for (var atom, $atom = atoms.iterator (); $atom.hasNext () && ((atom = $atom.next ()) || true);) {
70402 try {
70403 this.executeJavascriptFunction (this._listenerfn,  Clazz_newArray (-1, ["mouseover", "" + atom.getPdbFile (), "" + atom.getChain (), "" + (atom.getPdbResNum ()), "" + atom.getAtomIndex ()]));
70404 } catch (ex) {
70405 if (Clazz_exceptionOf (ex, Exception)) {
70406 System.err.println ("Couldn't execute callback with " + this._listenerfn + " for atomSpec: " + atom);
70407 ex.printStackTrace ();
70408 } else {
70409 throw ex;
70410 }
70411 }
70412 }
70413 }, "java.util.List");
70414 Clazz_overrideMethod (c$, "updateColours", 
70415 function (srce) {
70416 var source = srce;
70417 var ssm = jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.jvlite);
70418 if (Clazz_instanceOf (source, jalview.api.AlignmentViewPanel)) {
70419 var sequence =  new Array (this.modelSet.length);
70420 for (var m = 0; m < this.modelSet.length; m++) {
70421 var sm = ssm.getMapping (this.modelSet[m]);
70422 if (sm != null && sm.length > 0) {
70423 sequence[m] =  new Array (sm.length);
70424 for (var i = 0; i < sm.length; i++) {
70425 sequence[m][i] = sm[i].getSequence ();
70426 }
70427 } else {
70428 sequence[m] =  new Array (0);
70429 }}
70430 var sr = (source).getSequenceRenderer ();
70431 var fr = (source).av.isShowSequenceFeatures () ?  new jalview.appletgui.FeatureRenderer ((source).av) : null;
70432 if (fr != null) {
70433 (fr).transferSettings ((source).getFeatureRenderer ());
70434 };var ccomands =  new java.util.ArrayList ();
70435 var pdbfn =  new java.util.ArrayList ();
70436 var colcommands = jalview.ext.jmol.JmolCommands.getColourBySequenceCommand (ssm, this.modelSet, sequence, sr, fr, (source).getAlignment ());
70437 if (colcommands == null) {
70438 return;
70439 }var sz = 0;
70440 for (var ccset, $ccset = 0, $$ccset = colcommands; $ccset < $$ccset.length && ((ccset = $$ccset[$ccset]) || true); $ccset++) {
70441 sz += ccset.commands.length;
70442 ccomands.add (ccset.commands);
70443 pdbfn.add (ccset.mapping);
70444 }
70445 var mclass;
70446 var mhandle;
70447 var ccomandset =  new Array (sz);
70448 sz = 0;
70449 for (var ccset, $ccset = ccomands.iterator (); $ccset.hasNext () && ((ccset = $ccset.next ()) || true);) {
70450 System.arraycopy (ccset, 0, ccomandset, sz, ccset.length);
70451 sz += ccset.length;
70452 }
70453 if (this.jvlite.isJsMessageSetChanged (mclass = "colourstruct", mhandle = (source).av.getViewId (), ccomandset)) {
70454 this.jvlite.setJsMessageSet (mclass, mhandle, ccomandset);
70455 var st =  Clazz_newArray (-1, ["colourstruct", "" + (source).av.getViewId (), "" + ccomandset.length, this.jvlite.arrayToSeparatorList (pdbfn.toArray ( new Array (pdbfn.size ())))]);
70456 try {
70457 this.executeJavascriptFunction (true, this._listenerfn, st);
70458 } catch (ex) {
70459 if (Clazz_exceptionOf (ex, Exception)) {
70460 System.err.println ("Couldn't execute callback with " + this._listenerfn + " using args { " + st[0] + ", " + st[1] + ", " + st[2] + "," + st[3] + "}");
70461 ex.printStackTrace ();
70462 } else {
70463 throw ex;
70464 }
70465 }
70466 }}}, "~O");
70467 Clazz_overrideMethod (c$, "getAlignFrame", 
70468 function () {
70469 return null;
70470 });
70471 Clazz_overrideMethod (c$, "getListenerFunction", 
70472 function () {
70473 return this._listenerfn;
70474 });
70475 Clazz_defineMethod (c$, "finalise", 
70476 function () {
70477 this.jvlite = null;
70478 Clazz_superCall (this, jalview.javascript.MouseOverStructureListener, "finalize", []);
70479 });
70480 Clazz_overrideMethod (c$, "releaseReferences", 
70481 function (svl) {
70482 }, "~O");
70483 Clazz_overrideMethod (c$, "isListeningFor", 
70484 function (seq) {
70485 return true;
70486 }, "jalview.datamodel.SequenceI");
70487 });
70488 Clazz_declarePackage ("jalview.ext.jmol");
70489 Clazz_load (null, "jalview.ext.jmol.JmolCommands", ["jalview.structure.StructureMappingcommandSet", "jalview.util.Comparison", "java.lang.StringBuffer", "java.util.ArrayList"], function () {
70490 c$ = Clazz_declareType (jalview.ext.jmol, "JmolCommands");
70491 c$.getColourBySequenceCommand = Clazz_defineMethod (c$, "getColourBySequenceCommand", 
70492 function (ssm, files, sequence, sr, fr, alignment) {
70493 var cset =  new java.util.ArrayList ();
70494 for (var pdbfnum = 0; pdbfnum < files.length; pdbfnum++) {
70495 var mapping = ssm.getMapping (files[pdbfnum]);
70496 var command =  new StringBuffer ();
70497 var smc;
70498 var str =  new java.util.ArrayList ();
70499 if (mapping == null || mapping.length < 1) {
70500 continue;
70501 }var lastPos = -1;
70502 for (var s = 0; s < sequence[pdbfnum].length; s++) {
70503 for (var sp, m = 0; m < mapping.length; m++) {
70504 if (mapping[m].getSequence () === sequence[pdbfnum][s] && (sp = alignment.findIndex (sequence[pdbfnum][s])) > -1) {
70505 var asp = alignment.getSequenceAt (sp);
70506 for (var r = 0; r < asp.getLength (); r++) {
70507 if (jalview.util.Comparison.isGap (asp.getCharAt (r))) {
70508 continue;
70509 }var pos = mapping[m].getPDBResNum (asp.findPosition (r));
70510 if (pos < 1 || pos == lastPos) {
70511 continue;
70512 }lastPos = pos;
70513 var col = sr.getResidueBoxColour (sequence[pdbfnum][s], r);
70514 if (fr != null) {
70515 col = fr.findFeatureColour (col, sequence[pdbfnum][s], r);
70516 }var newSelcom = (mapping[m].getChain () !== " " ? ":" + mapping[m].getChain () : "") + "/" + (pdbfnum + 1) + ".1" + ";color[" + col.getRed () + "," + col.getGreen () + "," + col.getBlue () + "]";
70517 if (command.length () > newSelcom.length && command.substring (command.length () - newSelcom.length).equals (newSelcom)) {
70518 command = jalview.ext.jmol.JmolCommands.condenseCommand (command, pos);
70519 continue;
70520 }command.append (";");
70521 if (command.length () > 51200) {
70522 str.add (command.toString ());
70523 command.setLength (0);
70524 }command.append ("select " + pos);
70525 command.append (newSelcom);
70526 }
70527 break;
70528 }}
70529 }
70530 {
70531 str.add (command.toString ());
70532 command.setLength (0);
70533 }cset.add ( new jalview.structure.StructureMappingcommandSet (jalview.ext.jmol.JmolCommands, files[pdbfnum], str.toArray ( new Array (str.size ()))));
70534 }
70535 return cset.toArray ( new Array (cset.size ()));
70536 }, "jalview.structure.StructureSelectionManager,~A,~A,jalview.api.SequenceRenderer,jalview.api.FeatureRenderer,jalview.datamodel.AlignmentI");
70537 c$.condenseCommand = Clazz_defineMethod (c$, "condenseCommand", 
70538 function (command, pos) {
70539 var p = command.length ();
70540 var q = p;
70541 do {
70542 p -= 6;
70543 if (p < 1) {
70544 p = 0;
70545 };} while ((q = command.indexOf ("select", p)) == -1 && p > 0);
70546 var sb =  new StringBuffer (command.substring (0, q + 7));
70547 command = command.$delete (0, q + 7);
70548 var start;
70549 if (command.indexOf ("-") > -1) {
70550 start = command.substring (0, command.indexOf ("-"));
70551 } else {
70552 start = command.substring (0, command.indexOf (":"));
70553 }sb.append (start + "-" + pos + command.substring (command.indexOf (":")));
70554 return sb;
70555 }, "StringBuffer,~N");
70556 });
70557 Clazz_declarePackage ("jalview.structure");
70558 c$ = Clazz_decorateAsClass (function () {
70559 this.mapping = null;
70560 this.commands = null;
70561 this.handledBy = null;
70562 Clazz_instantialize (this, arguments);
70563 }, jalview.structure, "StructureMappingcommandSet");
70564 Clazz_makeConstructor (c$, 
70565 function (handledBy, files, commands) {
70566 this.mapping = files;
70567 this.handledBy = handledBy;
70568 this.commands = commands;
70569 }, "~O,~S,~A");
70570 Clazz_declarePackage ("java.util");
70571 Clazz_load (["java.util.Hashtable"], "java.util.Properties", ["java.lang.IllegalArgumentException"], function () {
70572 c$ = Clazz_decorateAsClass (function () {
70573 this.defaults = null;
70574 if (!Clazz_isClassDefined ("java.util.Properties.LineReader")) {
70575 java.util.Properties.$Properties$LineReader$ ();
70576 }
70577 Clazz_instantialize (this, arguments);
70578 }, java.util, "Properties", java.util.Hashtable);
70579 Clazz_makeConstructor (c$, 
70580 function () {
70581 this.construct (null);
70582 });
70583 Clazz_makeConstructor (c$, 
70584 function (defaults) {
70585 Clazz_superConstructor (this, java.util.Properties, []);
70586 this.defaults = defaults;
70587 }, "java.util.Properties");
70588 Clazz_defineMethod (c$, "setProperty", 
70589 function (key, value) {
70590 return this.put (key, value);
70591 }, "~S,~S");
70592 Clazz_defineMethod (c$, "load", 
70593 function (reader) {
70594 this.load0 (Clazz_innerTypeInstance (java.util.Properties.LineReader, this, null, reader));
70595 }, "java.io.Reader");
70596 Clazz_defineMethod (c$, "load", 
70597 function (inStream) {
70598 this.load0 (Clazz_innerTypeInstance (java.util.Properties.LineReader, this, null, inStream));
70599 }, "java.io.InputStream");
70600 Clazz_defineMethod (c$, "load0", 
70601  function (lr) {
70602 var convtBuf =  Clazz_newCharArray (1024, '\0');
70603 var limit;
70604 var keyLen;
70605 var valueStart;
70606 var c;
70607 var hasSep;
70608 var precedingBackslash;
70609 while ((limit = lr.readLine ()) >= 0) {
70610 c = String.fromCharCode ( 0);
70611 keyLen = 0;
70612 valueStart = limit;
70613 hasSep = false;
70614 precedingBackslash = false;
70615 while (keyLen < limit) {
70616 c = lr.lineBuf[keyLen];
70617 if ((c == '=' || c == ':') && !precedingBackslash) {
70618 valueStart = keyLen + 1;
70619 hasSep = true;
70620 break;
70621 } else if ((c == ' ' || c == '\t' || c == '\f') && !precedingBackslash) {
70622 valueStart = keyLen + 1;
70623 break;
70624 }if (c == '\\') {
70625 precedingBackslash = !precedingBackslash;
70626 } else {
70627 precedingBackslash = false;
70628 }keyLen++;
70629 }
70630 while (valueStart < limit) {
70631 c = lr.lineBuf[valueStart];
70632 if (c != ' ' && c != '\t' && c != '\f') {
70633 if (!hasSep && (c == '=' || c == ':')) {
70634 hasSep = true;
70635 } else {
70636 break;
70637 }}valueStart++;
70638 }
70639 var key = this.loadConvert (lr.lineBuf, 0, keyLen, convtBuf);
70640 var value = this.loadConvert (lr.lineBuf, valueStart, limit - valueStart, convtBuf);
70641 this.put (key, value);
70642 }
70643 }, "java.util.Properties.LineReader");
70644 Clazz_defineMethod (c$, "loadConvert", 
70645  function ($in, off, len, convtBuf) {
70646 if (convtBuf.length < len) {
70647 var newLen = len * 2;
70648 if (newLen < 0) {
70649 newLen = 2147483647;
70650 }convtBuf =  Clazz_newCharArray (newLen, '\0');
70651 }var aChar;
70652 var out = convtBuf;
70653 var outLen = 0;
70654 var end = off + len;
70655 while (off < end) {
70656 aChar = $in[off++];
70657 if (aChar == '\\') {
70658 aChar = $in[off++];
70659 if (aChar == 'u') {
70660 var value = 0;
70661 for (var i = 0; i < 4; i++) {
70662 aChar = $in[off++];
70663 switch (aChar) {
70664 case '0':
70665 case '1':
70666 case '2':
70667 case '3':
70668 case '4':
70669 case '5':
70670 case '6':
70671 case '7':
70672 case '8':
70673 case '9':
70674 value = (value << 4) + aChar.charCodeAt (0) - 48;
70675 break;
70676 case 'a':
70677 case 'b':
70678 case 'c':
70679 case 'd':
70680 case 'e':
70681 case 'f':
70682 value = (value << 4) + 10 + aChar.charCodeAt (0) - 97;
70683 break;
70684 case 'A':
70685 case 'B':
70686 case 'C':
70687 case 'D':
70688 case 'E':
70689 case 'F':
70690 value = (value << 4) + 10 + aChar.charCodeAt (0) - 65;
70691 break;
70692 default:
70693 throw  new IllegalArgumentException ("Malformed \\uxxxx encoding.");
70694 }
70695 }
70696 out[outLen++] = String.fromCharCode (value);
70697 } else {
70698 if (aChar == 't') aChar = '\t';
70699  else if (aChar == 'r') aChar = '\r';
70700  else if (aChar == 'n') aChar = '\n';
70701  else if (aChar == 'f') aChar = '\f';
70702 out[outLen++] = aChar;
70703 }} else {
70704 out[outLen++] = aChar;
70705 }}
70706 return  String.instantialize (out, 0, outLen);
70707 }, "~A,~N,~N,~A");
70708 Clazz_defineMethod (c$, "getProperty", 
70709 function (key) {
70710 var oval = Clazz_superCall (this, java.util.Properties, "get", [key]);
70711 var sval = (Clazz_instanceOf (oval, String)) ? oval : null;
70712 return ((sval == null) && (this.defaults != null)) ? this.defaults.getProperty (key) : sval;
70713 }, "~S");
70714 Clazz_defineMethod (c$, "getProperty", 
70715 function (key, defaultValue) {
70716 var val = this.getProperty (key);
70717 return (val == null) ? defaultValue : val;
70718 }, "~S,~S");
70719 Clazz_defineMethod (c$, "propertyNames", 
70720 function () {
70721 var h =  new java.util.Hashtable ();
70722 this.enumerate (h);
70723 return h.keys ();
70724 });
70725 Clazz_defineMethod (c$, "stringPropertyNames", 
70726 function () {
70727 var h =  new java.util.Hashtable ();
70728 this.enumerateStringProperties (h);
70729 return h.keySet ();
70730 });
70731 Clazz_defineMethod (c$, "enumerate", 
70732  function (h) {
70733 if (this.defaults != null) {
70734 this.defaults.enumerate (h);
70735 }for (var e = this.keys (); e.hasMoreElements (); ) {
70736 var key = e.nextElement ();
70737 h.put (key, this.get (key));
70738 }
70739 }, "java.util.Hashtable");
70740 Clazz_defineMethod (c$, "enumerateStringProperties", 
70741  function (h) {
70742 if (this.defaults != null) {
70743 this.defaults.enumerateStringProperties (h);
70744 }for (var e = this.keys (); e.hasMoreElements (); ) {
70745 var k = e.nextElement ();
70746 var v = this.get (k);
70747 if (Clazz_instanceOf (k, String) && Clazz_instanceOf (v, String)) {
70748 h.put (k, v);
70749 }}
70750 }, "java.util.Hashtable");
70751 c$.$Properties$LineReader$ = function () {
70752 Clazz_pu$h(self.c$);
70753 c$ = Clazz_decorateAsClass (function () {
70754 Clazz_prepareCallback (this, arguments);
70755 this.inByteBuf = null;
70756 this.inCharBuf = null;
70757 this.lineBuf = null;
70758 this.inLimit = 0;
70759 this.inOff = 0;
70760 this.inStream = null;
70761 this.reader = null;
70762 Clazz_instantialize (this, arguments);
70763 }, java.util.Properties, "LineReader");
70764 Clazz_prepareFields (c$, function () {
70765 this.lineBuf =  Clazz_newCharArray (1024, '\0');
70766 });
70767 Clazz_makeConstructor (c$, 
70768 function (a) {
70769 this.inStream = a;
70770 this.inByteBuf =  Clazz_newByteArray (8192, 0);
70771 }, "java.io.InputStream");
70772 Clazz_makeConstructor (c$, 
70773 function (a) {
70774 this.reader = a;
70775 this.inCharBuf =  Clazz_newCharArray (8192, '\0');
70776 }, "java.io.Reader");
70777 Clazz_defineMethod (c$, "readLine", 
70778 function () {
70779 var a = 0;
70780 var b = String.fromCharCode (0);
70781 var c = true;
70782 var d = false;
70783 var e = true;
70784 var f = false;
70785 var g = false;
70786 var h = false;
70787 while (true) {
70788 if (this.inOff >= this.inLimit) {
70789 this.inLimit = (this.inStream == null) ? this.reader.read (this.inCharBuf) : this.inStream.read (this.inByteBuf);
70790 this.inOff = 0;
70791 if (this.inLimit <= 0) {
70792 if (a == 0 || d) {
70793 return -1;
70794 }return a;
70795 }}if (this.inStream != null) {
70796 b = String.fromCharCode (0xff & this.inByteBuf[this.inOff++]);
70797 } else {
70798 b = this.inCharBuf[this.inOff++];
70799 }if (h) {
70800 h = false;
70801 if (b == '\n') {
70802 continue;
70803 }}if (c) {
70804 if (b == ' ' || b == '\t' || b == '\f') {
70805 continue;
70806 }if (!f && (b == '\r' || b == '\n')) {
70807 continue;
70808 }c = false;
70809 f = false;
70810 }if (e) {
70811 e = false;
70812 if (b == '#' || b == '!') {
70813 d = true;
70814 continue;
70815 }}if (b != '\n' && b != '\r') {
70816 this.lineBuf[a++] = b;
70817 if (a == this.lineBuf.length) {
70818 var i = this.lineBuf.length * 2;
70819 {
70820 }var j =  Clazz_newCharArray (i, '\0');
70821 System.arraycopy (this.lineBuf, 0, j, 0, this.lineBuf.length);
70822 this.lineBuf = j;
70823 }if (b == '\\') {
70824 g = !g;
70825 } else {
70826 g = false;
70827 }} else {
70828 if (d || a == 0) {
70829 d = false;
70830 e = true;
70831 c = true;
70832 a = 0;
70833 continue;
70834 }if (this.inOff >= this.inLimit) {
70835 this.inLimit = (this.inStream == null) ? this.reader.read (this.inCharBuf) : this.inStream.read (this.inByteBuf);
70836 this.inOff = 0;
70837 if (this.inLimit <= 0) {
70838 return a;
70839 }}if (g) {
70840 a -= 1;
70841 c = true;
70842 f = true;
70843 g = false;
70844 if (b == '\r') {
70845 h = true;
70846 }} else {
70847 return a;
70848 }}}
70849 });
70850 c$ = Clazz_p0p ();
70851 };
70852 });
70853 Clazz_declarePackage ("jssun.util");
70854 Clazz_load (["java.util.Enumeration"], "jssun.util.ResourceBundleEnumeration", ["java.util.NoSuchElementException"], function () {
70855 c$ = Clazz_decorateAsClass (function () {
70856 this.set = null;
70857 this.iterator = null;
70858 this.enumeration = null;
70859 this.next = null;
70860 Clazz_instantialize (this, arguments);
70861 }, jssun.util, "ResourceBundleEnumeration", null, java.util.Enumeration);
70862 Clazz_makeConstructor (c$, 
70863 function (set, enumeration) {
70864 this.set = set;
70865 this.iterator = set.iterator ();
70866 this.enumeration = enumeration;
70867 }, "java.util.Set,java.util.Enumeration");
70868 Clazz_defineMethod (c$, "hasMoreElements", 
70869 function () {
70870 if (this.next == null) {
70871 if (this.iterator.hasNext ()) {
70872 this.next = this.iterator.next ();
70873 } else if (this.enumeration != null) {
70874 while (this.next == null && this.enumeration.hasMoreElements ()) {
70875 this.next = this.enumeration.nextElement ();
70876 if (this.set.contains (this.next)) {
70877 this.next = null;
70878 }}
70879 }}return this.next != null;
70880 });
70881 Clazz_defineMethod (c$, "nextElement", 
70882 function () {
70883 if (this.hasMoreElements ()) {
70884 var result = this.next;
70885 this.next = null;
70886 return result;
70887 } else {
70888 throw  new java.util.NoSuchElementException ();
70889 }});
70890 });
70891 Clazz_declarePackage ("jalview.io");
70892 Clazz_load (["jalview.io.AlignFile"], "jalview.io.FastaFile", ["jalview.datamodel.AlignmentAnnotation", "$.Annotation", "java.lang.StringBuffer"], function () {
70893 c$ = Clazz_decorateAsClass (function () {
70894 this.len = 72;
70895 this.out = null;
70896 Clazz_instantialize (this, arguments);
70897 }, jalview.io, "FastaFile", jalview.io.AlignFile);
70898 Clazz_makeConstructor (c$, 
70899 function () {
70900 Clazz_superConstructor (this, jalview.io.FastaFile, []);
70901 });
70902 Clazz_overrideMethod (c$, "parse", 
70903 function () {
70904 var sb =  new StringBuffer ();
70905 var firstLine = true;
70906 var line;
70907 var uline;
70908 var seq = null;
70909 var annotation = false;
70910 while ((uline = this.nextLine ()) != null) {
70911 line = uline.trim ();
70912 if (line.length > 0) {
70913 if (line.charAt (0) == '>') {
70914 if (line.startsWith (">#_")) {
70915 if (annotation) {
70916 this.annotations.addElement (this.makeAnnotation (seq, sb));
70917 }} else {
70918 annotation = false;
70919 }if (!firstLine) {
70920 seq.setSequence (sb.toString ());
70921 if (!annotation) {
70922 this.seqs.addElement (seq);
70923 }}seq = this.parseId (line.substring (1));
70924 firstLine = false;
70925 sb =  new StringBuffer ();
70926 if (line.startsWith (">#_")) {
70927 annotation = true;
70928 }} else {
70929 sb.append (annotation ? uline : line);
70930 }}}
70931 if (annotation) {
70932 this.annotations.addElement (this.makeAnnotation (seq, sb));
70933 } else if (!firstLine) {
70934 seq.setSequence (sb.toString ());
70935 this.seqs.addElement (seq);
70936 }});
70937 Clazz_defineMethod (c$, "makeAnnotation", 
70938  function (seq, sb) {
70939 var anots =  new Array (sb.length ());
70940 var cb;
70941 for (var i = 0; i < anots.length; i++) {
70942 var cn = sb.charAt (i);
70943 if (cn != ' ') {
70944 anots[i] =  new jalview.datamodel.Annotation ("" + cn, null, ' ', NaN);
70945 }}
70946 var aa =  new jalview.datamodel.AlignmentAnnotation (seq.getName ().substring (2), seq.getDescription (), anots);
70947 return aa;
70948 }, "jalview.datamodel.SequenceI,StringBuffer");
70949 Clazz_defineMethod (c$, "addAnnotations", 
70950 function (al) {
70951 this.addProperties (al);
70952 for (var i = 0; i < this.annotations.size (); i++) {
70953 var aa = this.annotations.elementAt (i);
70954 aa.setPadGaps (true, al.getGapCharacter ());
70955 al.addAnnotation (aa);
70956 }
70957 }, "jalview.datamodel.Alignment");
70958 Clazz_defineMethod (c$, "print", 
70959 function (s) {
70960 this.out =  new StringBuffer ();
70961 var i = 0;
70962 while ((i < s.length) && (s[i] != null)) {
70963 this.out.append (">" + this.printId (s[i]));
70964 if (s[i].getDescription () != null) {
70965 this.out.append (" " + s[i].getDescription ());
70966 }this.out.append (this.newline);
70967 var nochunks = (Clazz_doubleToInt (s[i].getLength () / this.len)) + 1;
70968 for (var j = 0; j < nochunks; j++) {
70969 var start = j * this.len;
70970 var end = start + this.len;
70971 if (end < s[i].getLength ()) {
70972 this.out.append (s[i].getSequenceAsString (start, end) + this.newline);
70973 } else if (start < s[i].getLength ()) {
70974 this.out.append (s[i].getSequenceAsString (start, s[i].getLength ()) + this.newline);
70975 }}
70976 i++;
70977 }
70978 return this.out.toString ();
70979 }, "~A");
70980 Clazz_defineMethod (c$, "print", 
70981 function () {
70982 return this.print (this.getSeqsAsArray ());
70983 });
70984 });
70985 Clazz_declarePackage ("swingjs.plaf");
70986 Clazz_load (["swingjs.plaf.JSPanelUI"], "swingjs.plaf.JSMenuBarUI", ["java.awt.Dimension", "javax.swing.LookAndFeel"], function () {
70987 c$ = Clazz_declareType (swingjs.plaf, "JSMenuBarUI", swingjs.plaf.JSPanelUI);
70988 Clazz_makeConstructor (c$, 
70989 function () {
70990 Clazz_superConstructor (this, swingjs.plaf.JSMenuBarUI, []);
70991 this.isContainer = true;
70992 this.setDoc ();
70993 });
70994 Clazz_overrideMethod (c$, "getDOMObject", 
70995 function () {
70996 if (this.domNode == null) this.domNode = this.createDOMObject ("div", this.id, []);
70997 return this.domNode;
70998 });
70999 Clazz_overrideMethod (c$, "setHTMLSize", 
71000 function (obj, addCSS) {
71001 return  new java.awt.Dimension (this.c.getWidth (), this.c.getHeight ());
71002 }, "swingjs.api.DOMNode,~B");
71003 Clazz_defineMethod (c$, "getPreferredSize", 
71004 function (c) {
71005 return null;
71006 }, "javax.swing.JComponent");
71007 Clazz_overrideMethod (c$, "installJSUI", 
71008 function () {
71009 javax.swing.LookAndFeel.installColorsAndFont (this.c, "MenuBar.background", "MenuBar.foreground", "MenuBar.font");
71010 });
71011 Clazz_overrideMethod (c$, "uninstallJSUI", 
71012 function () {
71013 });
71014 });
71015 Clazz_declarePackage ("swingjs.plaf");
71016 Clazz_load (["swingjs.plaf.JSComponentUI"], "swingjs.plaf.JSMenuUI", ["java.awt.Dimension", "javax.swing.LookAndFeel"], function () {
71017 c$ = Clazz_declareType (swingjs.plaf, "JSMenuUI", swingjs.plaf.JSComponentUI);
71018 Clazz_makeConstructor (c$, 
71019 function () {
71020 Clazz_superConstructor (this, swingjs.plaf.JSMenuUI, []);
71021 this.isContainer = true;
71022 this.setDoc ();
71023 });
71024 Clazz_overrideMethod (c$, "getDOMObject", 
71025 function () {
71026 if (this.domNode == null) this.domNode = this.createDOMObject ("select", this.id, []);
71027 return this.domNode;
71028 });
71029 Clazz_overrideMethod (c$, "setHTMLSize", 
71030 function (obj, addCSS) {
71031 return  new java.awt.Dimension (this.c.getWidth (), this.c.getHeight ());
71032 }, "swingjs.api.DOMNode,~B");
71033 Clazz_defineMethod (c$, "getPreferredSize", 
71034 function (c) {
71035 return null;
71036 }, "javax.swing.JComponent");
71037 Clazz_overrideMethod (c$, "installJSUI", 
71038 function () {
71039 javax.swing.LookAndFeel.installColorsAndFont (this.c, "Menu.background", "Menu.foreground", "Menu.font");
71040 });
71041 Clazz_overrideMethod (c$, "uninstallJSUI", 
71042 function () {
71043 });
71044 });
71045 Clazz_declarePackage ("swingjs.plaf");
71046 Clazz_load (["swingjs.plaf.JSButtonUI"], "swingjs.plaf.JSMenuItemUI", ["javax.swing.LookAndFeel", "$.UIManager", "javax.swing.plaf.UIResource", "swingjs.api.DOMNode", "swingjs.plaf.JSButtonListener"], function () {
71047 c$ = Clazz_decorateAsClass (function () {
71048 this.$domBtn = null;
71049 this.$shiftOffset = 0;
71050 this.$defaultTextShiftOffset = 0;
71051 Clazz_instantialize (this, arguments);
71052 }, swingjs.plaf, "JSMenuItemUI", swingjs.plaf.JSButtonUI);
71053 Clazz_overrideMethod (c$, "getDOMObject", 
71054 function () {
71055 if (this.domNode == null) this.$domBtn = this.enableNode = this.valueNode = this.domNode = this.createDOMObject ("input", this.id, ["type", "button"]);
71056 this.setCssFont (swingjs.api.DOMNode.setAttr (this.domNode, "value", (this.c).getText ()), this.c.getFont ());
71057 return this.domNode;
71058 });
71059 Clazz_overrideMethod (c$, "verifyButtonClick", 
71060 function (isRelease) {
71061 return true;
71062 }, "~B");
71063 Clazz_overrideMethod (c$, "installJSUI", 
71064 function () {
71065 this.installDefaults (this.c);
71066 this.installListeners (this.c);
71067 this.installKeyboardActions (this.c);
71068 });
71069 Clazz_overrideMethod (c$, "uninstallJSUI", 
71070 function () {
71071 this.uninstallKeyboardActions (this.c);
71072 this.uninstallListeners (this.c);
71073 });
71074 Clazz_overrideMethod (c$, "installListeners", 
71075 function (b) {
71076 var listener =  new swingjs.plaf.JSButtonListener (b);
71077 if (listener != null) {
71078 b.addMouseListener (listener);
71079 b.addMouseMotionListener (listener);
71080 b.addFocusListener (listener);
71081 b.addPropertyChangeListener (listener);
71082 b.addChangeListener (listener);
71083 }}, "javax.swing.AbstractButton");
71084 Clazz_overrideMethod (c$, "uninstallListeners", 
71085 function (b) {
71086 var listener = this.getButtonListener (b);
71087 if (listener != null) {
71088 b.removeMouseListener (listener);
71089 b.removeMouseMotionListener (listener);
71090 b.removeFocusListener (listener);
71091 b.removeChangeListener (listener);
71092 b.removePropertyChangeListener (listener);
71093 }}, "javax.swing.AbstractButton");
71094 Clazz_overrideMethod (c$, "installKeyboardActions", 
71095 function (b) {
71096 var listener = this.getButtonListener (b);
71097 if (listener != null) {
71098 listener.installKeyboardActions (b);
71099 }}, "javax.swing.AbstractButton");
71100 Clazz_overrideMethod (c$, "uninstallKeyboardActions", 
71101 function (b) {
71102 var listener = this.getButtonListener (b);
71103 if (listener != null) {
71104 listener.uninstallKeyboardActions (b);
71105 }}, "javax.swing.AbstractButton");
71106 Clazz_overrideMethod (c$, "getPropertyPrefix", 
71107 function () {
71108 return "Button.";
71109 });
71110 Clazz_overrideMethod (c$, "installDefaults", 
71111 function (b) {
71112 var pp = this.getPropertyPrefix ();
71113 this.$defaultTextShiftOffset = javax.swing.UIManager.getInt (pp + "textShiftOffset");
71114 if (b.getMargin () == null || (Clazz_instanceOf (b.getMargin (), javax.swing.plaf.UIResource))) {
71115 b.setMargin (javax.swing.UIManager.getInsets (pp + "margin"));
71116 }javax.swing.LookAndFeel.installColorsAndFont (b, pp + "background", pp + "foreground", pp + "font");
71117 javax.swing.LookAndFeel.installProperty (b, "iconTextGap",  new Integer (4));
71118 }, "javax.swing.AbstractButton");
71119 });
71120 Clazz_declarePackage ("swingjs.plaf");
71121 Clazz_load (["swingjs.plaf.JSCheckBoxUI"], "swingjs.plaf.JSCheckBoxMenuItemUI", null, function () {
71122 c$ = Clazz_declareType (swingjs.plaf, "JSCheckBoxMenuItemUI", swingjs.plaf.JSCheckBoxUI);
71123 Clazz_overrideMethod (c$, "getDOMObject", 
71124 function () {
71125 return this.getButtonObject ("checkBox");
71126 });
71127 Clazz_overrideMethod (c$, "getPropertyPrefix", 
71128 function () {
71129 return "CheckBoxMenuItem.";
71130 });
71131 });
71132 Clazz_declarePackage ("swingjs.plaf");
71133 Clazz_load (["swingjs.plaf.JSRadioButtonUI"], "swingjs.plaf.JSCheckBoxUI", null, function () {
71134 c$ = Clazz_declareType (swingjs.plaf, "JSCheckBoxUI", swingjs.plaf.JSRadioButtonUI);
71135 Clazz_overrideMethod (c$, "getDOMObject", 
71136 function () {
71137 return this.getButtonObject ("checkBox");
71138 });
71139 Clazz_overrideMethod (c$, "getPropertyPrefix", 
71140 function () {
71141 return "CheckBox.";
71142 });
71143 });
71144 Clazz_declarePackage ("swingjs.plaf");
71145 Clazz_load (["swingjs.plaf.JSComponentUI"], "swingjs.plaf.JSLabelUI", ["swingjs.api.DOMNode"], function () {
71146 c$ = Clazz_declareType (swingjs.plaf, "JSLabelUI", swingjs.plaf.JSComponentUI);
71147 Clazz_overrideMethod (c$, "getDOMObject", 
71148 function () {
71149 if (this.domNode == null) this.textNode = this.domNode = this.createDOMObject ("label", this.id, []);
71150 swingjs.plaf.JSComponentUI.vCenter (this.domNode, 10);
71151 return this.setCssFont (swingjs.api.DOMNode.setAttr (this.domNode, "innerHTML", (this.c).getText ()), this.c.getFont ());
71152 });
71153 Clazz_overrideMethod (c$, "installJSUI", 
71154 function () {
71155 });
71156 Clazz_overrideMethod (c$, "uninstallJSUI", 
71157 function () {
71158 });
71159 });
71160 Clazz_declarePackage ("swingjs.plaf");
71161 Clazz_load (["swingjs.plaf.JSMenuUI"], "swingjs.plaf.JSPopupMenuUI", ["java.awt.Dimension", "javax.swing.LookAndFeel"], function () {
71162 c$ = Clazz_declareType (swingjs.plaf, "JSPopupMenuUI", swingjs.plaf.JSMenuUI);
71163 Clazz_makeConstructor (c$, 
71164 function () {
71165 Clazz_superConstructor (this, swingjs.plaf.JSPopupMenuUI, []);
71166 this.isContainer = true;
71167 this.setDoc ();
71168 });
71169 Clazz_overrideMethod (c$, "getDOMObject", 
71170 function () {
71171 if (this.domNode == null) this.domNode = this.createDOMObject ("select", this.id, []);
71172 return this.domNode;
71173 });
71174 Clazz_overrideMethod (c$, "setHTMLSize", 
71175 function (obj, addCSS) {
71176 return  new java.awt.Dimension (this.c.getWidth (), this.c.getHeight ());
71177 }, "swingjs.api.DOMNode,~B");
71178 Clazz_defineMethod (c$, "getPreferredSize", 
71179 function (c) {
71180 return null;
71181 }, "javax.swing.JComponent");
71182 Clazz_overrideMethod (c$, "installJSUI", 
71183 function () {
71184 javax.swing.LookAndFeel.installColorsAndFont (this.c, "PopupMenu.background", "PopupMenu.foreground", "PopupMenu.font");
71185 });
71186 Clazz_overrideMethod (c$, "uninstallJSUI", 
71187 function () {
71188 });
71189 });
71190 Clazz_declarePackage ("swingjs.plaf");
71191 Clazz_load (["swingjs.plaf.JSSeparatorUI"], "swingjs.plaf.JSPopupMenuSeparatorUI", ["swingjs.api.DOMNode"], function () {
71192 c$ = Clazz_declareType (swingjs.plaf, "JSPopupMenuSeparatorUI", swingjs.plaf.JSSeparatorUI);
71193 Clazz_overrideMethod (c$, "getDOMObject", 
71194 function () {
71195 if (this.domNode == null) this.textNode = this.domNode = this.createDOMObject ("label", this.id, []);
71196 swingjs.plaf.JSComponentUI.vCenter (this.domNode, 10);
71197 return this.setCssFont (swingjs.api.DOMNode.setAttr (this.domNode, "innerHTML", (this.c).getText ()), this.c.getFont ());
71198 });
71199 Clazz_overrideMethod (c$, "installJSUI", 
71200 function () {
71201 });
71202 Clazz_overrideMethod (c$, "uninstallJSUI", 
71203 function () {
71204 });
71205 });
71206 //Clazz_declarePackage ("swingjs.plaf");
71207 //Clazz_load (["swingjs.plaf.JSSliderUI"], "swingjs.plaf.JSScrollBarUI", null, function () {
71208 //c$ = Clazz_declareType (swingjs.plaf, "JSScrollBarUI", swingjs.plaf.JSSliderUI);
71209 //});
71210
71211
71212 Clazz_declarePackage ("swingjs.plaf");
71213 Clazz_load (["swingjs.plaf.JSComponentUI"], "swingjs.plaf.JSScrollBarUI", null, function () {
71214 c$ = Clazz_declareType (swingjs.plaf, "JSScrollBarUI", swingjs.plaf.JSComponentUI);
71215 Clazz_overrideMethod (c$, "getDOMObject", 
71216 function () {
71217 if (this.domNode == null) this.domNode = this.createDOMObject ("div", this.id, []);
71218 return this.domNode;
71219 });
71220 Clazz_overrideMethod (c$, "installJSUI", 
71221 function () {
71222 });
71223 Clazz_overrideMethod (c$, "uninstallJSUI", 
71224 function () {
71225 });
71226 });
71227 Clazz_declarePackage ("swingjs");
71228 Clazz_load (null, "swingjs.JSImagekit", ["java.util.Arrays", "swingjs.JSImage", "swingjs.api.Interface"], function () {
71229 c$ = Clazz_declareType (swingjs, "JSImagekit");
71230 Clazz_makeConstructor (c$, 
71231 function () {
71232 });
71233 Clazz_defineMethod (c$, "createImageFromBytes", 
71234 function (data, imageoffset, imagelength) {
71235 var w = 0;
71236 var h = 0;
71237 var argb = null;
71238 var b = null;
71239 var type = null;
71240 if (data == null) {
71241 w = imageoffset;
71242 h = imagelength;
71243 } else {
71244 if (imagelength < 0) imagelength = data.length;
71245 b = java.util.Arrays.copyOfRange (data, imageoffset, imagelength);
71246 if (b.length < 54) return null;
71247 switch (this.getSourceType (b)) {
71248 case 3:
71249 var ie = swingjs.api.Interface.getInstance ("javajs.img.BMPDecoder", true);
71250 var o = ie.decodeWindowsBMP (b);
71251 if (o == null || o[0] == null) return null;
71252 w = (o[1]).intValue ();
71253 h = (o[2]).intValue ();
71254 argb = o[0];
71255 break;
71256 case 1:
71257 var pt = 2;
71258 while (true) {
71259 switch (this.getInt (b, pt)) {
71260 case 49407:
71261 case 49919:
71262 h = this.getIntRev (b, pt + 5);
71263 w = this.getIntRev (b, pt + 7);
71264 pt = 0;
71265 break;
71266 }
71267 if (pt == 0) break;
71268 pt += 2 + this.getIntRev (b, pt + 2);
71269 }
71270 type = "jpeg";
71271 break;
71272 case 0:
71273 w = this.getLong (b, 16);
71274 h = this.getLong (b, 20);
71275 type = "png";
71276 break;
71277 case 2:
71278 w = this.getInt (b, 6);
71279 h = this.getInt (b, 8);
71280 type = "gif";
71281 break;
71282 case -1:
71283 System.out.println ("JSImagekit: Unknown image type: " + b[0] + " " + b[1] + " " + b[2] + " " + b[3]);
71284 data = null;
71285 break;
71286 }
71287 }if (w == 0 || h == 0) return null;
71288 var jsimage =  new swingjs.JSImage (argb, w, h);
71289 if (data != null && argb == null) jsimage.getDOMImage (b, type);
71290 return jsimage;
71291 }, "~A,~N,~N");
71292 Clazz_defineMethod (c$, "getLong", 
71293  function (b, pt) {
71294 return ((b[pt] & 0xFF) << 24) + ((b[pt + 1] & 0xFF) << 16) + ((b[pt + 2] & 0xFF) << 8) + (b[pt + 3] & 0xFF);
71295 }, "~A,~N");
71296 Clazz_defineMethod (c$, "getInt", 
71297  function (b, pt) {
71298 return (b[pt] & 0xFF) + ((b[pt + 1] & 0xFF) << 8);
71299 }, "~A,~N");
71300 Clazz_defineMethod (c$, "getIntRev", 
71301  function (b, pt) {
71302 return ((b[pt] & 0xFF) << 8) + (b[pt + 1] & 0xFF);
71303 }, "~A,~N");
71304 Clazz_defineMethod (c$, "getSourceType", 
71305  function (b) {
71306 return ((b[0] & 0xFF) == 0x89 && b[1] == 80 && b[2] == 78 && b[3] == 71 ? 0 : (b[0] & 0xFF) == 0xFF && (b[1] & 0xFF) == 0xD8 ? 1 : b[0] == 71 && b[1] == 73 && b[2] == 70 ? 2 : b[0] == 66 && b[1] == 77 ? 3 : -1);
71307 }, "~A");
71308 Clazz_defineStatics (c$,
71309 "UNK", -1,
71310 "PNG", 0,
71311 "JPG", 1,
71312 "GIF", 2,
71313 "BMP", 3,
71314 "JPG_SOF0", 0xC0FF,
71315 "JPG_SOF2", 0xC2FF);
71316 });
71317 Clazz_declarePackage ("swingjs");
71318 Clazz_load (["java.awt.image.BufferedImage"], "swingjs.JSImage", ["JU.Base64", "swingjs.api.DOMNode"], function () {
71319 c$ = Clazz_decorateAsClass (function () {
71320 this.typeRequested = 0;
71321 this.pix = null;
71322 this._imgNode = null;
71323 this.width = 0;
71324 this.height = 0;
71325 Clazz_instantialize (this, arguments);
71326 }, swingjs, "JSImage", java.awt.image.BufferedImage);
71327 Clazz_makeConstructor (c$, 
71328 function (argb, width, height) {
71329 Clazz_superConstructor (this, swingjs.JSImage, [width, height, 2]);
71330 this.width = width;
71331 this.height = height;
71332 this.pix = argb;
71333 }, "~A,~N,~N");
71334 Clazz_defineMethod (c$, "toIntARGB", 
71335 function (imgData) {
71336 var n = Clazz_doubleToInt (imgData.length / 4);
71337 var iData =  Clazz_newIntArray (n, 0);
71338 for (var i = 0, j = 0; i < n; j++) iData[i++] = (imgData[j++] << 16) | (imgData[j++] << 8) | imgData[j++] | 0xFF000000;
71339
71340 return iData;
71341 }, "~A");
71342 Clazz_defineMethod (c$, "getDOMImage", 
71343 function (b, type) {
71344 var dataurl = "data:image/" + type + ";base64," + JU.Base64.getBase64 (b).toString ();
71345 var me = this;
71346 var img = null;
71347 {
71348 img = new Image(this.width, this.height);
71349 //img.onLoad = function() { me.setDOMImage(img); };
71350 img.src = dataurl;
71351 }this.setDOMImage (img);
71352 }, "~A,~S");
71353 Clazz_defineMethod (c$, "setDOMImage", 
71354 function (img) {
71355 var canvas = swingjs.api.DOMNode.createElement ("canvas", "JSImage");
71356 var w = this.width;
71357 var h = this.height;
71358 this._imgNode = img;
71359 {
71360 canvas.width = w;
71361 canvas.height = h;
71362 var ctx = canvas.getContext("2d");
71363 ctx.drawImage(img, 0, 0, w, h);
71364 var data = ctx.getImageData(0, 0, w, h).data;
71365 img._pbuf32 = this.toIntARGB(data);
71366 }}, "swingjs.api.DOMNode");
71367 Clazz_defineMethod (c$, "getHeight", 
71368 function (o) {
71369 return this.height;
71370 }, "java.awt.image.ImageObserver");
71371 Clazz_defineMethod (c$, "getWidth", 
71372 function (o) {
71373 return this.width;
71374 }, "java.awt.image.ImageObserver");
71375 });
71376 Clazz_declarePackage ("jssun.awt.image");
71377 Clazz_load (["jssun.awt.image.IntegerComponentRaster"], "jssun.awt.image.IntegerInterleavedRaster", ["java.lang.ArrayIndexOutOfBoundsException", "java.awt.Point", "$.Rectangle", "java.awt.image.DataBufferInt", "$.RasterFormatException", "$.SinglePixelPackedSampleModel"], function () {
71378 c$ = Clazz_decorateAsClass (function () {
71379 this.$maxX = 0;
71380 this.$maxY = 0;
71381 Clazz_instantialize (this, arguments);
71382 }, jssun.awt.image, "IntegerInterleavedRaster", jssun.awt.image.IntegerComponentRaster);
71383 Clazz_makeConstructor (c$, 
71384 function (sampleModel, origin) {
71385 Clazz_superConstructor (this, jssun.awt.image.IntegerInterleavedRaster, []);
71386 this.setIntInterRaster (sampleModel, sampleModel.createDataBuffer (),  new java.awt.Rectangle (origin.x, origin.y, sampleModel.getWidth (), sampleModel.getHeight ()), origin, null);
71387 }, "java.awt.image.SampleModel,java.awt.Point");
71388 Clazz_makeConstructor (c$, 
71389 function (sampleModel, dataBuffer, origin) {
71390 Clazz_superConstructor (this, jssun.awt.image.IntegerInterleavedRaster, []);
71391 this.setParams (sampleModel, dataBuffer, origin);
71392 }, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Point");
71393 Clazz_makeConstructor (c$, 
71394 function () {
71395 Clazz_superConstructor (this, jssun.awt.image.IntegerInterleavedRaster, []);
71396 });
71397 Clazz_overrideMethod (c$, "setParams", 
71398 function (sampleModel, dataBuffer, origin) {
71399 this.setIntInterRaster (sampleModel, dataBuffer,  new java.awt.Rectangle (origin.x, origin.y, sampleModel.getWidth (), sampleModel.getHeight ()), origin, null);
71400 }, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Point");
71401 Clazz_makeConstructor (c$, 
71402 function (sampleModel, dataBuffer, aRegion, origin, parent) {
71403 Clazz_superConstructor (this, jssun.awt.image.IntegerInterleavedRaster, []);
71404 this.setIntInterRaster (sampleModel, dataBuffer, aRegion, origin, parent);
71405 }, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Rectangle,java.awt.Point,jssun.awt.image.IntegerInterleavedRaster");
71406 Clazz_defineMethod (c$, "setIntInterRaster", 
71407  function (sampleModel, dataBuffer, aRegion, origin, parent) {
71408 this.setIntCompRaster (sampleModel, dataBuffer, aRegion, origin, parent);
71409 this.$maxX = this.minX + this.width;
71410 this.$maxY = this.minY + this.height;
71411 if (!(Clazz_instanceOf (dataBuffer, java.awt.image.DataBufferInt))) {
71412 throw  new java.awt.image.RasterFormatException ("IntegerInterleavedRasters must haveinteger DataBuffers");
71413 }var dbi = dataBuffer;
71414 this.data = jssun.awt.image.SunWritableRaster.stealData (dbi, 0);
71415 if (Clazz_instanceOf (sampleModel, java.awt.image.SinglePixelPackedSampleModel)) {
71416 var sppsm = sampleModel;
71417 this.scanlineStride = sppsm.getScanlineStride ();
71418 this.pixelStride = 1;
71419 this.dataOffsets =  Clazz_newIntArray (1, 0);
71420 this.dataOffsets[0] = dbi.getOffset ();
71421 this.bandOffset = this.dataOffsets[0];
71422 var xOffset = aRegion.x - origin.x;
71423 var yOffset = aRegion.y - origin.y;
71424 this.dataOffsets[0] += xOffset + yOffset * this.scanlineStride;
71425 this.numDataElems = sppsm.getNumDataElements ();
71426 } else {
71427 throw  new java.awt.image.RasterFormatException ("IntegerInterleavedRasters must have SinglePixelPackedSampleModel");
71428 }this.verify ();
71429 }, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Rectangle,java.awt.Point,jssun.awt.image.IntegerInterleavedRaster");
71430 Clazz_overrideMethod (c$, "getDataOffsets", 
71431 function () {
71432 return this.dataOffsets.clone ();
71433 });
71434 Clazz_overrideMethod (c$, "getDataOffset", 
71435 function (band) {
71436 return this.dataOffsets[band];
71437 }, "~N");
71438 Clazz_overrideMethod (c$, "getScanlineStride", 
71439 function () {
71440 return this.scanlineStride;
71441 });
71442 Clazz_overrideMethod (c$, "getPixelStride", 
71443 function () {
71444 return this.pixelStride;
71445 });
71446 Clazz_overrideMethod (c$, "getDataStorage", 
71447 function () {
71448 return this.data;
71449 });
71450 Clazz_defineMethod (c$, "getDataElements", 
71451 function (x, y, obj) {
71452 if ((x < this.minX) || (y < this.minY) || (x >= this.$maxX) || (y >= this.$maxY)) {
71453 throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
71454 }var outData;
71455 if (obj == null) {
71456 outData =  Clazz_newIntArray (1, 0);
71457 } else {
71458 outData = obj;
71459 }var off = (y - this.minY) * this.scanlineStride + (x - this.minX) + this.dataOffsets[0];
71460 outData[0] = this.data[off];
71461 return outData;
71462 }, "~N,~N,~O");
71463 Clazz_defineMethod (c$, "getDataElements", 
71464 function (x, y, w, h, obj) {
71465 if ((x < this.minX) || (y < this.minY) || (x + w > this.$maxX) || (y + h > this.$maxY)) {
71466 throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
71467 }var outData;
71468 if (Clazz_instanceOf (obj, Array)) {
71469 outData = obj;
71470 } else {
71471 outData =  Clazz_newIntArray (w * h, 0);
71472 }var yoff = (y - this.minY) * this.scanlineStride + (x - this.minX) + this.dataOffsets[0];
71473 var off = 0;
71474 for (var ystart = 0; ystart < h; ystart++) {
71475 System.arraycopy (this.data, yoff, outData, off, w);
71476 off += w;
71477 yoff += this.scanlineStride;
71478 }
71479 return outData;
71480 }, "~N,~N,~N,~N,~O");
71481 Clazz_defineMethod (c$, "setDataElements", 
71482 function (x, y, obj) {
71483 if ((x < this.minX) || (y < this.minY) || (x >= this.$maxX) || (y >= this.$maxY)) {
71484 throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
71485 }var inData = obj;
71486 var off = (y - this.minY) * this.scanlineStride + (x - this.minX) + this.dataOffsets[0];
71487 this.data[off] = inData[0];
71488 this.markDirty ();
71489 }, "~N,~N,~O");
71490 Clazz_defineMethod (c$, "setDataElements", 
71491 function (x, y, inRaster) {
71492 var dstOffX = x + inRaster.getMinX ();
71493 var dstOffY = y + inRaster.getMinY ();
71494 var width = inRaster.getWidth ();
71495 var height = inRaster.getHeight ();
71496 if ((dstOffX < this.minX) || (dstOffY < this.minY) || (dstOffX + width > this.$maxX) || (dstOffY + height > this.$maxY)) {
71497 throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
71498 }this.setDataElements (dstOffX, dstOffY, width, height, inRaster);
71499 }, "~N,~N,java.awt.image.Raster");
71500 Clazz_defineMethod (c$, "setDataElements", 
71501  function (dstX, dstY, width, height, inRaster) {
71502 if (width <= 0 || height <= 0) {
71503 return;
71504 }var srcOffX = inRaster.getMinX ();
71505 var srcOffY = inRaster.getMinY ();
71506 var tdata = null;
71507 if (Clazz_instanceOf (inRaster, jssun.awt.image.IntegerInterleavedRaster)) {
71508 var ict = inRaster;
71509 tdata = ict.getDataStorage ();
71510 var tss = ict.getScanlineStride ();
71511 var toff = ict.getDataOffset (0);
71512 var srcOffset = toff;
71513 var dstOffset = this.dataOffsets[0] + (dstY - this.minY) * this.scanlineStride + (dstX - this.minX);
71514 for (var startY = 0; startY < height; startY++) {
71515 System.arraycopy (tdata, srcOffset, this.data, dstOffset, width);
71516 srcOffset += tss;
71517 dstOffset += this.scanlineStride;
71518 }
71519 this.markDirty ();
71520 return;
71521 }var odata = null;
71522 for (var startY = 0; startY < height; startY++) {
71523 odata = inRaster.getDataElements (srcOffX, srcOffY + startY, width, 1, odata);
71524 this.setDataElements (dstX, dstY + startY, width, 1, odata);
71525 }
71526 }, "~N,~N,~N,~N,java.awt.image.Raster");
71527 Clazz_defineMethod (c$, "setDataElements", 
71528 function (x, y, w, h, obj) {
71529 if ((x < this.minX) || (y < this.minY) || (x + w > this.$maxX) || (y + h > this.$maxY)) {
71530 throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
71531 }var inData = obj;
71532 var yoff = (y - this.minY) * this.scanlineStride + (x - this.minX) + this.dataOffsets[0];
71533 var off = 0;
71534 for (var ystart = 0; ystart < h; ystart++) {
71535 System.arraycopy (inData, off, this.data, yoff, w);
71536 off += w;
71537 yoff += this.scanlineStride;
71538 }
71539 this.markDirty ();
71540 }, "~N,~N,~N,~N,~O");
71541 Clazz_overrideMethod (c$, "createWritableChild", 
71542 function (x, y, width, height, x0, y0, bandList) {
71543 if (x < this.minX) {
71544 throw  new java.awt.image.RasterFormatException ("x lies outside raster");
71545 }if (y < this.minY) {
71546 throw  new java.awt.image.RasterFormatException ("y lies outside raster");
71547 }if ((x + width < x) || (x + width > this.minX + this.width)) {
71548 throw  new java.awt.image.RasterFormatException ("(x + width) is outside raster");
71549 }if ((y + height < y) || (y + height > this.minY + this.height)) {
71550 throw  new java.awt.image.RasterFormatException ("(y + height) is outside raster");
71551 }var sm;
71552 if (bandList != null) sm = this.sampleModel.createSubsetSampleModel (bandList);
71553  else sm = this.sampleModel;
71554 var deltaX = x0 - x;
71555 var deltaY = y0 - y;
71556 return  new jssun.awt.image.IntegerInterleavedRaster (sm, this.dataBuffer,  new java.awt.Rectangle (x0, y0, width, height),  new java.awt.Point (this.sampleModelTranslateX + deltaX, this.sampleModelTranslateY + deltaY), this);
71557 }, "~N,~N,~N,~N,~N,~N,~A");
71558 Clazz_overrideMethod (c$, "createChild", 
71559 function (x, y, width, height, x0, y0, bandList) {
71560 return this.createWritableChild (x, y, width, height, x0, y0, bandList);
71561 }, "~N,~N,~N,~N,~N,~N,~A");
71562 Clazz_defineMethod (c$, "createCompatibleWritableRaster", 
71563 function (w, h) {
71564 if (w <= 0 || h <= 0) {
71565 throw  new java.awt.image.RasterFormatException ("negative " + ((w <= 0) ? "width" : "height"));
71566 }var sm = this.sampleModel.createCompatibleSampleModel (w, h);
71567 return  new jssun.awt.image.IntegerInterleavedRaster (sm,  new java.awt.Point (0, 0));
71568 }, "~N,~N");
71569 Clazz_defineMethod (c$, "createCompatibleWritableRaster", 
71570 function () {
71571 return this.createCompatibleWritableRaster (this.width, this.height);
71572 });
71573 Clazz_overrideMethod (c$, "toString", 
71574 function () {
71575 return  String.instantialize ("IntegerInterleavedRaster: width = " + this.width + " height = " + this.height + " #Bands = " + this.numBands + " xOff = " + this.sampleModelTranslateX + " yOff = " + this.sampleModelTranslateY + " dataOffset[0] " + this.dataOffsets[0]);
71576 });
71577 });
71578 Clazz_declarePackage ("jssun.awt.image");
71579 Clazz_load (["jssun.awt.image.SunWritableRaster"], "jssun.awt.image.IntegerComponentRaster", ["java.lang.ArrayIndexOutOfBoundsException", "java.awt.Point", "$.Rectangle", "java.awt.image.DataBufferInt", "$.RasterFormatException", "$.SinglePixelPackedSampleModel"], function () {
71580 c$ = Clazz_decorateAsClass (function () {
71581 this.bandOffset = 0;
71582 this.dataOffsets = null;
71583 this.scanlineStride = 0;
71584 this.pixelStride = 0;
71585 this.data = null;
71586 this.numDataElems = 0;
71587 this.type = 0;
71588 this.maxX = 0;
71589 this.maxY = 0;
71590 Clazz_instantialize (this, arguments);
71591 }, jssun.awt.image, "IntegerComponentRaster", jssun.awt.image.SunWritableRaster);
71592 Clazz_makeConstructor (c$, 
71593 function (sampleModel, origin) {
71594 Clazz_superConstructor (this, jssun.awt.image.IntegerComponentRaster, []);
71595 this.setIntCompRaster (sampleModel, sampleModel.createDataBuffer (),  new java.awt.Rectangle (origin.x, origin.y, sampleModel.getWidth (), sampleModel.getHeight ()), origin, null);
71596 }, "java.awt.image.SampleModel,java.awt.Point");
71597 Clazz_makeConstructor (c$, 
71598 function (sampleModel, dataBuffer, origin) {
71599 Clazz_superConstructor (this, jssun.awt.image.IntegerComponentRaster, []);
71600 this.setIntCompRaster (sampleModel, dataBuffer,  new java.awt.Rectangle (origin.x, origin.y, sampleModel.getWidth (), sampleModel.getHeight ()), origin, null);
71601 }, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Point");
71602 Clazz_makeConstructor (c$, 
71603 function () {
71604 Clazz_superConstructor (this, jssun.awt.image.IntegerComponentRaster, []);
71605 });
71606 Clazz_makeConstructor (c$, 
71607 function (sampleModel, dataBuffer, aRegion, origin, parent) {
71608 Clazz_superConstructor (this, jssun.awt.image.IntegerComponentRaster, []);
71609 this.setIntCompRaster (sampleModel, dataBuffer, aRegion, origin, parent);
71610 }, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Rectangle,java.awt.Point,java.awt.image.Raster");
71611 Clazz_defineMethod (c$, "setIntCompRaster", 
71612 function (sampleModel, dataBuffer, aRegion, origin, parent) {
71613 this.setSunRaster (sampleModel, dataBuffer, aRegion, origin, parent);
71614 this.maxX = this.minX + this.width;
71615 this.maxY = this.minY + this.height;
71616 if (!(Clazz_instanceOf (dataBuffer, java.awt.image.DataBufferInt))) {
71617 throw  new java.awt.image.RasterFormatException ("IntegerComponentRasters must haveinteger DataBuffers");
71618 }var dbi = dataBuffer;
71619 if (dbi.getNumBanks () != 1) {
71620 throw  new java.awt.image.RasterFormatException ("DataBuffer for IntegerComponentRasters must only have 1 bank.");
71621 }this.data = jssun.awt.image.SunWritableRaster.stealData (dbi, 0);
71622 if (Clazz_instanceOf (sampleModel, java.awt.image.SinglePixelPackedSampleModel)) {
71623 var sppsm = sampleModel;
71624 var boffsets = sppsm.getBitOffsets ();
71625 var notByteBoundary = false;
71626 for (var i = 1; i < boffsets.length; i++) {
71627 if ((boffsets[i] % 8) != 0) {
71628 notByteBoundary = true;
71629 }}
71630 this.type = (notByteBoundary ? 9 : 10);
71631 this.scanlineStride = sppsm.getScanlineStride ();
71632 this.pixelStride = 1;
71633 this.dataOffsets =  Clazz_newIntArray (1, 0);
71634 this.dataOffsets[0] = dbi.getOffset ();
71635 this.bandOffset = this.dataOffsets[0];
71636 var xOffset = aRegion.x - origin.x;
71637 var yOffset = aRegion.y - origin.y;
71638 this.dataOffsets[0] += xOffset + yOffset * this.scanlineStride;
71639 this.numDataElems = sppsm.getNumDataElements ();
71640 } else {
71641 throw  new java.awt.image.RasterFormatException ("IntegerComponentRasters must have SinglePixelPackedSampleModel");
71642 }this.verify ();
71643 }, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Rectangle,java.awt.Point,java.awt.image.Raster");
71644 Clazz_defineMethod (c$, "getDataOffsets", 
71645 function () {
71646 return this.dataOffsets.clone ();
71647 });
71648 Clazz_defineMethod (c$, "getDataOffset", 
71649 function (band) {
71650 return this.dataOffsets[band];
71651 }, "~N");
71652 Clazz_defineMethod (c$, "getScanlineStride", 
71653 function () {
71654 return this.scanlineStride;
71655 });
71656 Clazz_defineMethod (c$, "getPixelStride", 
71657 function () {
71658 return this.pixelStride;
71659 });
71660 Clazz_defineMethod (c$, "getDataStorage", 
71661 function () {
71662 return this.data;
71663 });
71664 Clazz_defineMethod (c$, "getDataElements", 
71665 function (x, y, obj) {
71666 if ((x < this.minX) || (y < this.minY) || (x >= this.maxX) || (y >= this.maxY)) {
71667 throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
71668 }var outData;
71669 if (obj == null) {
71670 outData =  Clazz_newIntArray (this.numDataElements, 0);
71671 } else {
71672 outData = obj;
71673 }var off = (y - this.minY) * this.scanlineStride + (x - this.minX) * this.pixelStride;
71674 for (var band = 0; band < this.numDataElements; band++) {
71675 outData[band] = this.data[this.dataOffsets[band] + off];
71676 }
71677 return outData;
71678 }, "~N,~N,~O");
71679 Clazz_defineMethod (c$, "getDataElements", 
71680 function (x, y, w, h, obj) {
71681 if ((x < this.minX) || (y < this.minY) || (x + w > this.maxX) || (y + h > this.maxY)) {
71682 throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
71683 }var outData;
71684 if (Clazz_instanceOf (obj, Array)) {
71685 outData = obj;
71686 } else {
71687 outData =  Clazz_newIntArray (this.numDataElements * w * h, 0);
71688 }var yoff = (y - this.minY) * this.scanlineStride + (x - this.minX) * this.pixelStride;
71689 var xoff;
71690 var off = 0;
71691 var xstart;
71692 var ystart;
71693 for (ystart = 0; ystart < h; ystart++, yoff += this.scanlineStride) {
71694 xoff = yoff;
71695 for (xstart = 0; xstart < w; xstart++, xoff += this.pixelStride) {
71696 for (var c = 0; c < this.numDataElements; c++) {
71697 outData[off++] = this.data[this.dataOffsets[c] + xoff];
71698 }
71699 }
71700 }
71701 return outData;
71702 }, "~N,~N,~N,~N,~O");
71703 Clazz_defineMethod (c$, "setDataElements", 
71704 function (x, y, obj) {
71705 if ((x < this.minX) || (y < this.minY) || (x >= this.maxX) || (y >= this.maxY)) {
71706 throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
71707 }var inData = obj;
71708 var off = (y - this.minY) * this.scanlineStride + (x - this.minX) * this.pixelStride;
71709 for (var i = 0; i < this.numDataElements; i++) {
71710 this.data[this.dataOffsets[i] + off] = inData[i];
71711 }
71712 this.markDirty ();
71713 }, "~N,~N,~O");
71714 Clazz_overrideMethod (c$, "setDataElementsRaster", 
71715 function (x, y, inRaster) {
71716 var dstOffX = x + inRaster.getMinX ();
71717 var dstOffY = y + inRaster.getMinY ();
71718 var width = inRaster.getWidth ();
71719 var height = inRaster.getHeight ();
71720 if ((dstOffX < this.minX) || (dstOffY < this.minY) || (dstOffX + width > this.maxX) || (dstOffY + height > this.maxY)) {
71721 throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
71722 }this.setDataElementsRaster4 (dstOffX, dstOffY, width, height, inRaster);
71723 }, "~N,~N,java.awt.image.Raster");
71724 Clazz_defineMethod (c$, "setDataElementsRaster4", 
71725  function (dstX, dstY, width, height, inRaster) {
71726 if (width <= 0 || height <= 0) {
71727 return;
71728 }var srcOffX = inRaster.getMinX ();
71729 var srcOffY = inRaster.getMinY ();
71730 var tdata = null;
71731 if (Clazz_instanceOf (inRaster, jssun.awt.image.IntegerComponentRaster) && (this.pixelStride == 1) && (this.numDataElements == 1)) {
71732 var ict = inRaster;
71733 if (ict.getNumDataElements () != 1) {
71734 throw  new ArrayIndexOutOfBoundsException ("Number of bands does not match");
71735 }tdata = ict.getDataStorage ();
71736 var tss = ict.getScanlineStride ();
71737 var toff = ict.getDataOffset (0);
71738 var srcOffset = toff;
71739 var dstOffset = this.dataOffsets[0] + (dstY - this.minY) * this.scanlineStride + (dstX - this.minX);
71740 if (ict.getPixelStride () == this.pixelStride) {
71741 width *= this.pixelStride;
71742 for (var startY = 0; startY < height; startY++) {
71743 System.arraycopy (tdata, srcOffset, this.data, dstOffset, width);
71744 srcOffset += tss;
71745 dstOffset += this.scanlineStride;
71746 }
71747 this.markDirty ();
71748 return;
71749 }}var odata = null;
71750 for (var startY = 0; startY < height; startY++) {
71751 odata = inRaster.getDataElements (srcOffX, srcOffY + startY, width, 1, odata);
71752 this.setDataElements (dstX, dstY + startY, width, 1, odata);
71753 }
71754 }, "~N,~N,~N,~N,java.awt.image.Raster");
71755 Clazz_defineMethod (c$, "setDataElements", 
71756 function (x, y, w, h, obj) {
71757 if ((x < this.minX) || (y < this.minY) || (x + w > this.maxX) || (y + h > this.maxY)) {
71758 throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
71759 }var inData = obj;
71760 var yoff = (y - this.minY) * this.scanlineStride + (x - this.minX) * this.pixelStride;
71761 var xoff;
71762 var off = 0;
71763 var xstart;
71764 var ystart;
71765 for (ystart = 0; ystart < h; ystart++, yoff += this.scanlineStride) {
71766 xoff = yoff;
71767 for (xstart = 0; xstart < w; xstart++, xoff += this.pixelStride) {
71768 for (var c = 0; c < this.numDataElements; c++) {
71769 this.data[this.dataOffsets[c] + xoff] = inData[off++];
71770 }
71771 }
71772 }
71773 this.markDirty ();
71774 }, "~N,~N,~N,~N,~O");
71775 Clazz_overrideMethod (c$, "createWritableChild", 
71776 function (x, y, width, height, x0, y0, bandList) {
71777 if (x < this.minX) {
71778 throw  new java.awt.image.RasterFormatException ("x lies outside raster");
71779 }if (y < this.minY) {
71780 throw  new java.awt.image.RasterFormatException ("y lies outside raster");
71781 }if ((x + width < x) || (x + width > this.minX + this.width)) {
71782 throw  new java.awt.image.RasterFormatException ("(x + width) is outside raster");
71783 }if ((y + height < y) || (y + height > this.minY + this.height)) {
71784 throw  new java.awt.image.RasterFormatException ("(y + height) is outside raster");
71785 }var sm;
71786 if (bandList != null) sm = this.sampleModel.createSubsetSampleModel (bandList);
71787  else sm = this.sampleModel;
71788 var deltaX = x0 - x;
71789 var deltaY = y0 - y;
71790 return  new jssun.awt.image.IntegerComponentRaster (sm, this.dataBuffer,  new java.awt.Rectangle (x0, y0, width, height),  new java.awt.Point (this.sampleModelTranslateX + deltaX, this.sampleModelTranslateY + deltaY), this);
71791 }, "~N,~N,~N,~N,~N,~N,~A");
71792 Clazz_overrideMethod (c$, "createChild", 
71793 function (x, y, width, height, x0, y0, bandList) {
71794 return this.createWritableChild (x, y, width, height, x0, y0, bandList);
71795 }, "~N,~N,~N,~N,~N,~N,~A");
71796 Clazz_defineMethod (c$, "createCompatibleWritableRaster", 
71797 function (w, h) {
71798 if (w <= 0 || h <= 0) {
71799 throw  new java.awt.image.RasterFormatException ("negative " + ((w <= 0) ? "width" : "height"));
71800 }var sm = this.sampleModel.createCompatibleSampleModel (w, h);
71801 return  new jssun.awt.image.IntegerComponentRaster (sm,  new java.awt.Point (0, 0));
71802 }, "~N,~N");
71803 Clazz_defineMethod (c$, "createCompatibleWritableRaster", 
71804 function () {
71805 return this.createCompatibleWritableRaster (this.width, this.height);
71806 });
71807 Clazz_defineMethod (c$, "verify", 
71808 function () {
71809 if (this.width <= 0 || this.height <= 0 || this.height > (Clazz_doubleToInt (2147483647 / this.width))) {
71810 throw  new java.awt.image.RasterFormatException ("Invalid raster dimension");
71811 }if (this.dataOffsets[0] < 0) {
71812 throw  new java.awt.image.RasterFormatException ("Data offset (" + this.dataOffsets[0] + ") must be >= 0");
71813 }if (this.minX - this.sampleModelTranslateX < 0 || this.minY - this.sampleModelTranslateY < 0) {
71814 throw  new java.awt.image.RasterFormatException ("Incorrect origin/translate: (" + this.minX + ", " + this.minY + ") / (" + this.sampleModelTranslateX + ", " + this.sampleModelTranslateY + ")");
71815 }if (this.scanlineStride < 0 || this.scanlineStride > (Clazz_doubleToInt (2147483647 / this.height))) {
71816 throw  new java.awt.image.RasterFormatException ("Incorrect scanline stride: " + this.scanlineStride);
71817 }if (this.height > 1 || this.minY - this.sampleModelTranslateY > 0) {
71818 if (this.scanlineStride > this.data.length) {
71819 throw  new java.awt.image.RasterFormatException ("Incorrect scanline stride: " + this.scanlineStride);
71820 }}var lastScanOffset = (this.height - 1) * this.scanlineStride;
71821 if (this.pixelStride < 0 || this.pixelStride > (Clazz_doubleToInt (2147483647 / this.width)) || this.pixelStride > this.data.length) {
71822 throw  new java.awt.image.RasterFormatException ("Incorrect pixel stride: " + this.pixelStride);
71823 }var lastPixelOffset = (this.width - 1) * this.pixelStride;
71824 if (lastPixelOffset > (2147483647 - lastScanOffset)) {
71825 throw  new java.awt.image.RasterFormatException ("Incorrect raster attributes");
71826 }lastPixelOffset += lastScanOffset;
71827 var index;
71828 var maxIndex = 0;
71829 for (var i = 0; i < this.numDataElements; i++) {
71830 if (this.dataOffsets[i] > (2147483647 - lastPixelOffset)) {
71831 throw  new java.awt.image.RasterFormatException ("Incorrect band offset: " + this.dataOffsets[i]);
71832 }index = lastPixelOffset + this.dataOffsets[i];
71833 if (index > maxIndex) {
71834 maxIndex = index;
71835 }}
71836 if (this.data.length <= maxIndex) {
71837 throw  new java.awt.image.RasterFormatException ("Data array too small (should be > " + maxIndex + " )");
71838 }});
71839 Clazz_overrideMethod (c$, "toString", 
71840 function () {
71841 return  String.instantialize ("IntegerComponentRaster: width = " + this.width + " height = " + this.height + " #Bands = " + this.numBands + " #DataElements " + this.numDataElements + " xOff = " + this.sampleModelTranslateX + " yOff = " + this.sampleModelTranslateY + " dataOffset[0] " + this.dataOffsets[0]);
71842 });
71843 Clazz_defineStatics (c$,
71844 "TYPE_CUSTOM", 0,
71845 "TYPE_BYTE_SAMPLES", 1,
71846 "TYPE_USHORT_SAMPLES", 2,
71847 "TYPE_INT_SAMPLES", 3,
71848 "TYPE_BYTE_BANDED_SAMPLES", 4,
71849 "TYPE_USHORT_BANDED_SAMPLES", 5,
71850 "TYPE_INT_BANDED_SAMPLES", 6,
71851 "TYPE_BYTE_PACKED_SAMPLES", 7,
71852 "TYPE_USHORT_PACKED_SAMPLES", 8,
71853 "TYPE_INT_PACKED_SAMPLES", 9,
71854 "TYPE_INT_8BIT_SAMPLES", 10,
71855 "TYPE_BYTE_BINARY_SAMPLES", 11);
71856 });
71857 Clazz_declarePackage ("jssun.awt.image");
71858 Clazz_load (["java.awt.image.WritableRaster", "jssun.awt.image.DataStealer"], "jssun.awt.image.SunWritableRaster", ["jssun.java2d.StateTrackable", "$.StateTrackableDelegate"], function () {
71859 c$ = Clazz_decorateAsClass (function () {
71860 this.theTrackable = null;
71861 Clazz_instantialize (this, arguments);
71862 }, jssun.awt.image, "SunWritableRaster", java.awt.image.WritableRaster);
71863 c$.getStealer = Clazz_defineMethod (c$, "getStealer", 
71864  function () {
71865 return (jssun.awt.image.SunWritableRaster.stealer == null ? jssun.awt.image.SunWritableRaster.stealer = ((Clazz_isClassDefined ("jssun.awt.image.SunWritableRaster$1") ? 0 : jssun.awt.image.SunWritableRaster.$SunWritableRaster$1$ ()), Clazz_innerTypeInstance (jssun.awt.image.SunWritableRaster$1, this, null)) : jssun.awt.image.SunWritableRaster.stealer);
71866 });
71867 c$.stealData = Clazz_defineMethod (c$, "stealData", 
71868 function (dbb, bank) {
71869 return jssun.awt.image.SunWritableRaster.getStealer ().getData (dbb, bank);
71870 }, "java.awt.image.DataBufferByte,~N");
71871 c$.stealData = Clazz_defineMethod (c$, "stealData", 
71872 function (dbi, bank) {
71873 return jssun.awt.image.SunWritableRaster.getStealer ().getData (dbi, bank);
71874 }, "java.awt.image.DataBufferInt,~N");
71875 c$.stealTrackable = Clazz_defineMethod (c$, "stealTrackable", 
71876 function (db) {
71877 return jssun.awt.image.SunWritableRaster.getStealer ().getTrackable (db);
71878 }, "java.awt.image.DataBuffer");
71879 c$.setTrackable = Clazz_defineMethod (c$, "setTrackable", 
71880 function (db, trackable) {
71881 jssun.awt.image.SunWritableRaster.getStealer ().setTrackable (db, trackable);
71882 }, "java.awt.image.DataBuffer,jssun.java2d.StateTrackableDelegate");
71883 c$.makeTrackable = Clazz_defineMethod (c$, "makeTrackable", 
71884 function (db) {
71885 jssun.awt.image.SunWritableRaster.getStealer ().setTrackable (db, jssun.java2d.StateTrackableDelegate.createInstance (jssun.java2d.StateTrackable.State.STABLE));
71886 }, "java.awt.image.DataBuffer");
71887 c$.markDirty = Clazz_defineMethod (c$, "markDirty", 
71888 function (db) {
71889 jssun.awt.image.SunWritableRaster.getStealer ().getTrackable (db).markDirty ();
71890 }, "java.awt.image.DataBuffer");
71891 c$.markDirty = Clazz_defineMethod (c$, "markDirty", 
71892 function (wr) {
71893 if (Clazz_instanceOf (wr, jssun.awt.image.SunWritableRaster)) {
71894 (wr).markDirty ();
71895 } else {
71896 jssun.awt.image.SunWritableRaster.markDirty (wr.getDataBuffer ());
71897 }}, "java.awt.image.WritableRaster");
71898 Clazz_makeConstructor (c$, 
71899 function (sampleModel, origin) {
71900 Clazz_superConstructor (this, jssun.awt.image.SunWritableRaster, [sampleModel, origin]);
71901 this.theTrackable = jssun.awt.image.SunWritableRaster.stealTrackable (this.dataBuffer);
71902 }, "java.awt.image.SampleModel,java.awt.Point");
71903 Clazz_makeConstructor (c$, 
71904 function (sampleModel, dataBuffer, origin) {
71905 Clazz_superConstructor (this, jssun.awt.image.SunWritableRaster, [sampleModel, dataBuffer, origin]);
71906 this.theTrackable = jssun.awt.image.SunWritableRaster.stealTrackable (dataBuffer);
71907 }, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Point");
71908 Clazz_makeConstructor (c$, 
71909 function () {
71910 Clazz_superConstructor (this, jssun.awt.image.SunWritableRaster, []);
71911 });
71912 Clazz_makeConstructor (c$, 
71913 function (sampleModel, dataBuffer, aRegion, sampleModelTranslate, parent) {
71914 Clazz_superConstructor (this, jssun.awt.image.SunWritableRaster, []);
71915 this.setSunRaster (sampleModel, dataBuffer, aRegion, sampleModelTranslate, parent);
71916 }, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Rectangle,java.awt.Point,java.awt.image.Raster");
71917 Clazz_defineMethod (c$, "setSunRaster", 
71918 function (sampleModel, dataBuffer, aRegion, sampleModelTranslate, parent) {
71919 this.setRaster (sampleModel, dataBuffer, aRegion, sampleModelTranslate, parent);
71920 this.theTrackable = jssun.awt.image.SunWritableRaster.stealTrackable (dataBuffer);
71921 }, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Rectangle,java.awt.Point,java.awt.image.Raster");
71922 Clazz_defineMethod (c$, "markDirty", 
71923 function () {
71924 this.theTrackable.markDirty ();
71925 });
71926 c$.$SunWritableRaster$1$ = function () {
71927 Clazz_pu$h(self.c$);
71928 c$ = Clazz_declareAnonymous (jssun.awt.image, "SunWritableRaster$1", null, jssun.awt.image.DataStealer);
71929 Clazz_defineMethod (c$, "getData", 
71930 function (dbb, bank) {
71931 return dbb.bankdata[bank];
71932 }, "java.awt.image.DataBufferByte,~N");
71933 Clazz_defineMethod (c$, "getData", 
71934 function (dbi, bank) {
71935 return dbi.bankdata[bank];
71936 }, "java.awt.image.DataBufferInt,~N");
71937 Clazz_defineMethod (c$, "getTrackable", 
71938 function (db) {
71939 return db.theTrackable;
71940 }, "java.awt.image.DataBuffer");
71941 Clazz_defineMethod (c$, "setTrackable", 
71942 function (db, trackable) {
71943 db.theTrackable = trackable;
71944 }, "java.awt.image.DataBuffer,jssun.java2d.StateTrackableDelegate");
71945 c$ = Clazz_p0p ();
71946 };
71947 Clazz_defineStatics (c$,
71948 "stealer", null);
71949 });
71950 Clazz_declarePackage ("jssun.awt.image");
71951 Clazz_declareInterface (jssun.awt.image, "DataStealer");
71952 })(Clazz
71953 ,Clazz.getClassName
71954 ,Clazz.newLongArray
71955 ,Clazz.doubleToByte
71956 ,Clazz.doubleToInt
71957 ,Clazz.doubleToLong
71958 ,Clazz.declarePackage
71959 ,Clazz.instanceOf
71960 ,Clazz.load
71961 ,Clazz.instantialize
71962 ,Clazz.decorateAsClass
71963 ,Clazz.floatToInt
71964 ,Clazz.floatToLong
71965 ,Clazz.makeConstructor
71966 ,Clazz.defineEnumConstant
71967 ,Clazz.exceptionOf
71968 ,Clazz.newIntArray
71969 ,Clazz.defineStatics
71970 ,Clazz.newFloatArray
71971 ,Clazz.declareType
71972 ,Clazz.prepareFields
71973 ,Clazz.superConstructor
71974 ,Clazz.newByteArray
71975 ,Clazz.declareInterface
71976 ,Clazz.p0p
71977 ,Clazz.pu$h
71978 ,Clazz.newShortArray
71979 ,Clazz.innerTypeInstance
71980 ,Clazz.isClassDefined
71981 ,Clazz.prepareCallback
71982 ,Clazz.newArray
71983 ,Clazz.castNullAs
71984 ,Clazz.floatToShort
71985 ,Clazz.superCall
71986 ,Clazz.decorateAsType
71987 ,Clazz.newBooleanArray
71988 ,Clazz.newCharArray
71989 ,Clazz.implementOf
71990 ,Clazz.newDoubleArray
71991 ,Clazz.overrideConstructor
71992 ,Clazz.clone
71993 ,Clazz.doubleToShort
71994 ,Clazz.getInheritedLevel
71995 ,Clazz.getParamsType
71996 ,Clazz.isAF
71997 ,Clazz.isAI
71998 ,Clazz.isAS
71999 ,Clazz.isASS
72000 ,Clazz.isAP
72001 ,Clazz.isAFloat
72002 ,Clazz.isAII
72003 ,Clazz.isAFF
72004 ,Clazz.isAFFF
72005 ,Clazz.tryToSearchAndExecute
72006 ,Clazz.getStackTrace
72007 ,Clazz.inheritArgs
72008 ,Clazz.alert
72009 ,Clazz.defineMethod
72010 ,Clazz.overrideMethod
72011 ,Clazz.declareAnonymous
72012 ,Clazz.checkPrivateMethod
72013 ,Clazz.cloneFinals
72014 );