Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / jalview / appletgui / SeqPanel.js
1 Clazz.declarePackage ("jalview.appletgui");
2 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 () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.seqCanvas = null;
5 this.ap = null;
6 this.lastres = 0;
7 this.startseq = 0;
8 this.av = null;
9 this.seqEditOccurred = false;
10 this.scrollThread = null;
11 this.mouseDragging = false;
12 this.editingSeqs = false;
13 this.groupEditing = false;
14 this.oldSeq = -1;
15 this.changeEndSeq = false;
16 this.changeStartSeq = false;
17 this.changeEndRes = false;
18 this.changeStartRes = false;
19 this.stretchGroup = null;
20 this.keyboardNo1 = null;
21 this.keyboardNo2 = null;
22 this.mouseWheelPressed = false;
23 this.lastMousePress = null;
24 this.editCommand = null;
25 this.ssm = null;
26 this.startWrapBlock = -1;
27 this.wrappedBlock = -1;
28 this.lastMessage = null;
29 this.tooltip = null;
30 if (!Clazz.isClassDefined ("jalview.appletgui.SeqPanel.ScrollThread")) {
31 jalview.appletgui.SeqPanel.$SeqPanel$ScrollThread$ ();
32 }
33 Clazz.instantialize (this, arguments);
34 }, jalview.appletgui, "SeqPanel", awt2swing.Panel, [java.awt.event.MouseMotionListener, java.awt.event.MouseListener, jalview.structure.SequenceListener, jalview.structure.SelectionListener]);
35 Clazz.makeConstructor (c$, 
36 function (avp, p) {
37 Clazz.superConstructor (this, jalview.appletgui.SeqPanel, []);
38 this.av = avp;
39 this.setName ("seqPanel");
40 this.seqCanvas =  new jalview.appletgui.SeqCanvas (avp);
41 this.setLayout ( new java.awt.BorderLayout ());
42 this.add (this.seqCanvas);
43 this.ap = p;
44 this.seqCanvas.addMouseMotionListener (this);
45 this.seqCanvas.addMouseListener (this);
46 this.ssm = jalview.structure.StructureSelectionManager.getStructureSelectionManager (this.av.applet);
47 this.ssm.addStructureViewerListener (this);
48 this.ssm.addSelectionListener (this);
49 this.seqCanvas.repaint ();
50 }, "jalview.appletgui.AlignViewport,jalview.appletgui.AlignmentPanel");
51 Clazz.defineMethod (c$, "endEditing", 
52 function () {
53 if (this.editCommand != null && this.editCommand.getSize () > 0) {
54 this.ap.alignFrame.addHistoryItem (this.editCommand);
55 this.av.firePropertyChange ("alignment", null, this.av.getAlignment ().getSequences ());
56 }this.startseq = -1;
57 this.lastres = -1;
58 this.editingSeqs = false;
59 this.groupEditing = false;
60 this.keyboardNo1 = null;
61 this.keyboardNo2 = null;
62 this.editCommand = null;
63 });
64 Clazz.defineMethod (c$, "setCursorRow", 
65 function () {
66 this.seqCanvas.cursorY = this.getKeyboardNo1 () - 1;
67 this.scrollToVisible ();
68 });
69 Clazz.defineMethod (c$, "setCursorColumn", 
70 function () {
71 this.seqCanvas.cursorX = this.getKeyboardNo1 () - 1;
72 this.scrollToVisible ();
73 });
74 Clazz.defineMethod (c$, "setCursorRowAndColumn", 
75 function () {
76 if (this.keyboardNo2 == null) {
77 this.keyboardNo2 =  new StringBuffer ();
78 } else {
79 this.seqCanvas.cursorX = this.getKeyboardNo1 () - 1;
80 this.seqCanvas.cursorY = this.getKeyboardNo2 () - 1;
81 this.scrollToVisible ();
82 }});
83 Clazz.defineMethod (c$, "setCursorPosition", 
84 function () {
85 var sequence = this.av.getAlignment ().getSequenceAt (this.seqCanvas.cursorY);
86 this.seqCanvas.cursorX = sequence.findIndex (this.getKeyboardNo1 ()) - 1;
87 this.scrollToVisible ();
88 });
89 Clazz.defineMethod (c$, "moveCursor", 
90 function (dx, dy) {
91 this.seqCanvas.cursorX += dx;
92 this.seqCanvas.cursorY += dy;
93 if (this.av.hasHiddenColumns () && !this.av.getColumnSelection ().isVisible (this.seqCanvas.cursorX)) {
94 var original = this.seqCanvas.cursorX - dx;
95 var maxWidth = this.av.getAlignment ().getWidth ();
96 while (!this.av.getColumnSelection ().isVisible (this.seqCanvas.cursorX) && this.seqCanvas.cursorX < maxWidth && this.seqCanvas.cursorX > 0) {
97 this.seqCanvas.cursorX += dx;
98 }
99 if (this.seqCanvas.cursorX >= maxWidth || !this.av.getColumnSelection ().isVisible (this.seqCanvas.cursorX)) {
100 this.seqCanvas.cursorX = original;
101 }}this.scrollToVisible ();
102 }, "~N,~N");
103 Clazz.defineMethod (c$, "scrollToVisible", 
104 function () {
105 if (this.seqCanvas.cursorX < 0) {
106 this.seqCanvas.cursorX = 0;
107 } else if (this.seqCanvas.cursorX > this.av.getAlignment ().getWidth () - 1) {
108 this.seqCanvas.cursorX = this.av.getAlignment ().getWidth () - 1;
109 }if (this.seqCanvas.cursorY < 0) {
110 this.seqCanvas.cursorY = 0;
111 } else if (this.seqCanvas.cursorY > this.av.getAlignment ().getHeight () - 1) {
112 this.seqCanvas.cursorY = this.av.getAlignment ().getHeight () - 1;
113 }this.endEditing ();
114 if (this.av.getWrapAlignment ()) {
115 this.ap.scrollToWrappedVisible (this.seqCanvas.cursorX);
116 } else {
117 while (this.seqCanvas.cursorY < this.av.startSeq) {
118 this.ap.scrollUp (true);
119 }
120 while (this.seqCanvas.cursorY + 1 > this.av.endSeq) {
121 this.ap.scrollUp (false);
122 }
123 while (this.seqCanvas.cursorX < this.av.getColumnSelection ().adjustForHiddenColumns (this.av.startRes)) {
124 if (!this.ap.scrollRight (false)) {
125 break;
126 }}
127 while (this.seqCanvas.cursorX > this.av.getColumnSelection ().adjustForHiddenColumns (this.av.endRes)) {
128 if (!this.ap.scrollRight (true)) {
129 break;
130 }}
131 }this.setStatusMessage (this.av.getAlignment ().getSequenceAt (this.seqCanvas.cursorY), this.seqCanvas.cursorX, this.seqCanvas.cursorY);
132 this.seqCanvas.repaint ();
133 });
134 Clazz.defineMethod (c$, "setSelectionAreaAtCursor", 
135 function (topLeft) {
136 var sequence = this.av.getAlignment ().getSequenceAt (this.seqCanvas.cursorY);
137 if (this.av.getSelectionGroup () != null) {
138 var sg = this.av.getSelectionGroup ();
139 var min = this.av.getAlignment ().getHeight ();
140 var max = 0;
141 for (var i = 0; i < sg.getSize (); i++) {
142 var index = this.av.getAlignment ().findIndex (sg.getSequenceAt (i));
143 if (index > max) {
144 max = index;
145 }if (index < min) {
146 min = index;
147 }}
148 max++;
149 if (topLeft) {
150 sg.setStartRes (this.seqCanvas.cursorX);
151 if (sg.getEndRes () < this.seqCanvas.cursorX) {
152 sg.setEndRes (this.seqCanvas.cursorX);
153 }min = this.seqCanvas.cursorY;
154 } else {
155 sg.setEndRes (this.seqCanvas.cursorX);
156 if (sg.getStartRes () > this.seqCanvas.cursorX) {
157 sg.setStartRes (this.seqCanvas.cursorX);
158 }max = this.seqCanvas.cursorY + 1;
159 }if (min > max) {
160 this.av.setSelectionGroup (null);
161 } else {
162 sg.clear ();
163 for (var i = min; i < max; i++) {
164 sg.addSequence (this.av.getAlignment ().getSequenceAt (i), false);
165 }
166 }}if (this.av.getSelectionGroup () == null) {
167 var sg =  new jalview.datamodel.SequenceGroup ();
168 sg.setStartRes (this.seqCanvas.cursorX);
169 sg.setEndRes (this.seqCanvas.cursorX);
170 sg.addSequence (sequence, false);
171 this.av.setSelectionGroup (sg);
172 }this.ap.paintAlignment (false);
173 this.av.sendSelection ();
174 }, "~B");
175 Clazz.defineMethod (c$, "insertGapAtCursor", 
176 function (group) {
177 this.groupEditing = group;
178 this.startseq = this.seqCanvas.cursorY;
179 this.lastres = this.seqCanvas.cursorX;
180 this.editSequence (true, this.seqCanvas.cursorX + this.getKeyboardNo1 ());
181 this.endEditing ();
182 }, "~B");
183 Clazz.defineMethod (c$, "deleteGapAtCursor", 
184 function (group) {
185 this.groupEditing = group;
186 this.startseq = this.seqCanvas.cursorY;
187 this.lastres = this.seqCanvas.cursorX + this.getKeyboardNo1 ();
188 this.editSequence (false, this.seqCanvas.cursorX);
189 this.endEditing ();
190 }, "~B");
191 Clazz.defineMethod (c$, "numberPressed", 
192 function (value) {
193 if (this.keyboardNo1 == null) {
194 this.keyboardNo1 =  new StringBuffer ();
195 }if (this.keyboardNo2 != null) {
196 this.keyboardNo2.append (value);
197 } else {
198 this.keyboardNo1.append (value);
199 }}, "~S");
200 Clazz.defineMethod (c$, "getKeyboardNo1", 
201 function () {
202 try {
203 if (this.keyboardNo1 != null) {
204 var value = Integer.parseInt (this.keyboardNo1.toString ());
205 this.keyboardNo1 = null;
206 return value;
207 }} catch (x) {
208 if (Clazz.exceptionOf (x, Exception)) {
209 } else {
210 throw x;
211 }
212 }
213 this.keyboardNo1 = null;
214 return 1;
215 });
216 Clazz.defineMethod (c$, "getKeyboardNo2", 
217 function () {
218 try {
219 if (this.keyboardNo2 != null) {
220 var value = Integer.parseInt (this.keyboardNo2.toString ());
221 this.keyboardNo2 = null;
222 return value;
223 }} catch (x) {
224 if (Clazz.exceptionOf (x, Exception)) {
225 } else {
226 throw x;
227 }
228 }
229 this.keyboardNo2 = null;
230 return 1;
231 });
232 Clazz.defineMethod (c$, "setStatusMessage", 
233 function (sequence, res, seq) {
234 var text =  new StringBuilder (32);
235 var seqno = seq == -1 ? "" : " " + (seq + 1);
236 text.append ("Sequence" + seqno + " ID: " + sequence.getName ());
237 var residue = null;
238 var displayChar = String.valueOf (sequence.getCharAt (res));
239 if (this.av.getAlignment ().isNucleotide ()) {
240 residue = jalview.schemes.ResidueProperties.nucleotideName.get (displayChar);
241 if (residue != null) {
242 text.append (" Nucleotide: ").append (residue);
243 }} else {
244 residue = "X".equalsIgnoreCase (displayChar) ? "X" : jalview.schemes.ResidueProperties.aa2Triplet.get (displayChar);
245 if (residue != null) {
246 text.append (" Residue: ").append (residue);
247 }}var pos = -1;
248 if (residue != null) {
249 pos = sequence.findPosition (res);
250 text.append (" (").append (Integer.toString (pos)).append (")");
251 }this.ap.alignFrame.setStatus (text.toString ());
252 }, "jalview.datamodel.SequenceI,~N,~N");
253 Clazz.defineMethod (c$, "setStatusMessage", 
254  function (results) {
255 var matches = results.getResults ();
256 if (!matches.isEmpty ()) {
257 var m = matches.get (0);
258 var seq = m.getSequence ();
259 var sequenceIndex = this.av.getAlignment ().findIndex (seq);
260 var start = m.getStart () - 1;
261 this.setStatusMessage (seq, start, sequenceIndex);
262 }}, "jalview.datamodel.SearchResults");
263 Clazz.overrideMethod (c$, "mousePressed", 
264 function (evt) {
265 this.lastMousePress = evt.getPoint ();
266 if ((evt.getModifiers () & 8) == 8 && !this.av.MAC) {
267 this.mouseWheelPressed = true;
268 return;
269 }if (evt.isShiftDown () || evt.isControlDown () || evt.isAltDown ()) {
270 if (evt.isControlDown () || evt.isAltDown ()) {
271 this.groupEditing = true;
272 }this.editingSeqs = true;
273 } else {
274 this.doMousePressedDefineMode (evt);
275 return;
276 }var seq = this.findSeq (evt);
277 var res = this.findRes (evt);
278 if (seq < 0 || res < 0) {
279 return;
280 }if ((seq < this.av.getAlignment ().getHeight ()) && (res < this.av.getAlignment ().getSequenceAt (seq).getLength ())) {
281 this.startseq = seq;
282 this.lastres = res;
283 } else {
284 this.startseq = -1;
285 this.lastres = -1;
286 }return;
287 }, "java.awt.event.MouseEvent");
288 Clazz.overrideMethod (c$, "mouseClicked", 
289 function (evt) {
290 var sequence = this.av.getAlignment ().getSequenceAt (this.findSeq (evt));
291 if (evt.getClickCount () > 1) {
292 if (this.av.getSelectionGroup () != null && this.av.getSelectionGroup ().getSize () == 1 && this.av.getSelectionGroup ().getEndRes () - this.av.getSelectionGroup ().getStartRes () < 2) {
293 this.av.setSelectionGroup (null);
294 }var features = this.findFeaturesAtRes (sequence, sequence.findPosition (this.findRes (evt)));
295 if (features != null && features.length > 0) {
296 var highlight =  new jalview.datamodel.SearchResults ();
297 highlight.addResult (sequence, features[0].getBegin (), features[0].getEnd ());
298 this.seqCanvas.highlightSearchResults (highlight);
299 }if (features != null && features.length > 0) {
300 this.seqCanvas.getFeatureRenderer ().amendFeatures ( Clazz.newArray (-1, [sequence]), features, false, this.ap);
301 this.seqCanvas.highlightSearchResults (null);
302 }}}, "java.awt.event.MouseEvent");
303 Clazz.overrideMethod (c$, "mouseReleased", 
304 function (evt) {
305 this.mouseDragging = false;
306 this.mouseWheelPressed = false;
307 this.ap.paintAlignment (true);
308 if (!this.editingSeqs) {
309 this.doMouseReleasedDefineMode (evt);
310 return;
311 }this.endEditing ();
312 }, "java.awt.event.MouseEvent");
313 Clazz.defineMethod (c$, "findRes", 
314 function (evt) {
315 var res = 0;
316 var x = evt.getX ();
317 if (this.av.getWrapAlignment ()) {
318 var hgap = this.av.getCharHeight ();
319 if (this.av.getScaleAboveWrapped ()) {
320 hgap += this.av.getCharHeight ();
321 }var cHeight = this.av.getAlignment ().getHeight () * this.av.getCharHeight () + hgap + this.seqCanvas.getAnnotationHeight ();
322 var y = evt.getY ();
323 y -= hgap;
324 x -= this.seqCanvas.LABEL_WEST;
325 var cwidth = this.seqCanvas.getWrappedCanvasWidth (this.getSize ().width);
326 if (cwidth < 1) {
327 return 0;
328 }this.wrappedBlock = Clazz.doubleToInt (y / cHeight);
329 this.wrappedBlock += Clazz.doubleToInt (this.av.getStartRes () / cwidth);
330 res = this.wrappedBlock * cwidth + Clazz.doubleToInt (x / this.av.getCharWidth ());
331 } else {
332 res = (Clazz.doubleToInt (x / this.av.getCharWidth ())) + this.av.getStartRes ();
333 }if (this.av.hasHiddenColumns ()) {
334 res = this.av.getColumnSelection ().adjustForHiddenColumns (res);
335 }return res;
336 }, "java.awt.event.MouseEvent");
337 Clazz.defineMethod (c$, "findSeq", 
338 function (evt) {
339 var sqnum = this.findAlRow (evt);
340 return (sqnum < 0) ? 0 : sqnum;
341 }, "java.awt.event.MouseEvent");
342 Clazz.defineMethod (c$, "findAlRow", 
343  function (evt) {
344 var seq = 0;
345 var y = evt.getY ();
346 if (this.av.getWrapAlignment ()) {
347 var hgap = this.av.getCharHeight ();
348 if (this.av.getScaleAboveWrapped ()) {
349 hgap += this.av.getCharHeight ();
350 }var cHeight = this.av.getAlignment ().getHeight () * this.av.getCharHeight () + hgap + this.seqCanvas.getAnnotationHeight ();
351 y -= hgap;
352 seq = Math.min (Clazz.doubleToInt ((y % cHeight) / this.av.getCharHeight ()), this.av.getAlignment ().getHeight () - 1);
353 if (seq < 0) {
354 seq = -1;
355 }} else {
356 seq = Math.min ((Clazz.doubleToInt (y / this.av.getCharHeight ())) + this.av.getStartSeq (), this.av.getAlignment ().getHeight () - 1);
357 if (seq < 0) {
358 seq = -1;
359 }}return seq;
360 }, "java.awt.event.MouseEvent");
361 Clazz.defineMethod (c$, "doMousePressed", 
362 function (evt) {
363 var seq = this.findSeq (evt);
364 var res = this.findRes (evt);
365 if (seq < this.av.getAlignment ().getHeight () && res < this.av.getAlignment ().getSequenceAt (seq).getLength ()) {
366 this.startseq = seq;
367 this.lastres = res;
368 } else {
369 this.startseq = -1;
370 this.lastres = -1;
371 }return;
372 }, "java.awt.event.MouseEvent");
373 Clazz.overrideMethod (c$, "mouseOverSequence", 
374 function (sequence, index, pos) {
375 var tmp = sequence.hashCode () + index + "";
376 if (this.lastMessage == null || !this.lastMessage.equals (tmp)) {
377 this.ssm.mouseOverSequence (sequence, index, pos, this.av);
378 }this.lastMessage = tmp;
379 }, "jalview.datamodel.SequenceI,~N,~N");
380 Clazz.overrideMethod (c$, "highlightSequence", 
381 function (results) {
382 if (this.av.isFollowHighlight ()) {
383 if (this.ap.scrollToPosition (results, true)) {
384 this.ap.alignFrame.repaint ();
385 }}this.setStatusMessage (results);
386 this.seqCanvas.highlightSearchResults (results);
387 }, "jalview.datamodel.SearchResults");
388 Clazz.overrideMethod (c$, "getVamsasSource", 
389 function () {
390 return this.ap == null ? null : this.ap.av;
391 });
392 Clazz.overrideMethod (c$, "updateColours", 
393 function (seq, index) {
394 System.out.println ("update the seqPanel colours");
395 }, "jalview.datamodel.SequenceI,~N");
396 Clazz.overrideMethod (c$, "mouseMoved", 
397 function (evt) {
398 var res = this.findRes (evt);
399 var seq = this.findSeq (evt);
400 if (seq >= this.av.getAlignment ().getHeight () || seq < 0 || res < 0) {
401 if (this.tooltip != null) {
402 this.tooltip.setTip ("");
403 }return;
404 }var sequence = this.av.getAlignment ().getSequenceAt (seq);
405 if (res > sequence.getLength ()) {
406 if (this.tooltip != null) {
407 this.tooltip.setTip ("");
408 }return;
409 }var respos = sequence.findPosition (res);
410 if (this.ssm != null) {
411 this.mouseOverSequence (sequence, res, respos);
412 }var text =  new StringBuilder ();
413 text.append ("Sequence ").append (Integer.toString (seq + 1)).append (" ID: ").append (sequence.getName ());
414 var obj = null;
415 var ch = String.valueOf (sequence.getCharAt (res));
416 if (this.av.getAlignment ().isNucleotide ()) {
417 obj = jalview.schemes.ResidueProperties.nucleotideName.get (ch);
418 if (obj != null) {
419 text.append (" Nucleotide: ").append (obj);
420 }} else {
421 obj = "X".equalsIgnoreCase (ch) ? "X" : jalview.schemes.ResidueProperties.aa2Triplet.get (ch);
422 if (obj != null) {
423 text.append (" Residue: ").append (obj);
424 }}if (obj != null) {
425 text.append (" (").append (Integer.toString (respos)).append (")");
426 }this.ap.alignFrame.setStatus (text.toString ());
427 var tooltipText =  new StringBuilder ();
428 var groups = this.av.getAlignment ().findAllGroups (sequence);
429 if (groups != null) {
430 for (var g = 0; g < groups.length; g++) {
431 if (groups[g].getStartRes () <= res && groups[g].getEndRes () >= res) {
432 if (!groups[g].getName ().startsWith ("JTreeGroup") && !groups[g].getName ().startsWith ("JGroup")) {
433 tooltipText.append (groups[g].getName ()).append (" ");
434 }if (groups[g].getDescription () != null) {
435 tooltipText.append (groups[g].getDescription ());
436 }tooltipText.append ("\n");
437 }}
438 }var allFeatures = this.findFeaturesAtRes (sequence, sequence.findPosition (res));
439 var index = 0;
440 while (index < allFeatures.length) {
441 var sf = allFeatures[index];
442 tooltipText.append (sf.getType () + " " + sf.begin + ":" + sf.end);
443 if (sf.getDescription () != null) {
444 tooltipText.append (" " + sf.getDescription ());
445 }if (sf.getValue ("status") != null) {
446 var status = sf.getValue ("status").toString ();
447 if (status.length > 0) {
448 tooltipText.append (" (" + sf.getValue ("status") + ")");
449 }}tooltipText.append ("\n");
450 index++;
451 }
452 if (this.tooltip == null) {
453 this.tooltip =  new jalview.appletgui.Tooltip (tooltipText.toString (), this.seqCanvas);
454 } else {
455 this.tooltip.setTip (tooltipText.toString ());
456 }}, "java.awt.event.MouseEvent");
457 Clazz.defineMethod (c$, "findFeaturesAtRes", 
458 function (sequence, res) {
459 var tmp =  new java.util.Vector ();
460 var features = sequence.getSequenceFeatures ();
461 if (features != null) {
462 for (var i = 0; i < features.length; i++) {
463 if (this.av.getFeaturesDisplayed () == null || !this.av.getFeaturesDisplayed ().isVisible (features[i].getType ())) {
464 continue;
465 }if (features[i].featureGroup != null && !this.seqCanvas.fr.checkGroupVisibility (features[i].featureGroup, false)) {
466 continue;
467 }if ((features[i].getBegin () <= res) && (features[i].getEnd () >= res)) {
468 tmp.addElement (features[i]);
469 }}
470 }features =  new Array (tmp.size ());
471 tmp.copyInto (features);
472 return features;
473 }, "jalview.datamodel.SequenceI,~N");
474 Clazz.overrideMethod (c$, "mouseDragged", 
475 function (evt) {
476 if (this.mouseWheelPressed) {
477 var oldWidth = this.av.getCharWidth ();
478 if (Math.abs (evt.getY () - this.lastMousePress.y) > Math.abs (evt.getX () - this.lastMousePress.x)) {
479 var fontSize = this.av.font.getSize ();
480 if (evt.getY () < this.lastMousePress.y && this.av.getCharHeight () > 1) {
481 fontSize--;
482 } else if (evt.getY () > this.lastMousePress.y) {
483 fontSize++;
484 }if (fontSize < 1) {
485 fontSize = 1;
486 }this.av.setFont ( new java.awt.Font (this.av.font.getName (), this.av.font.getStyle (), fontSize));
487 this.av.setCharWidth (oldWidth);
488 } else {
489 if (evt.getX () < this.lastMousePress.x && this.av.getCharWidth () > 1) {
490 this.av.setCharWidth (this.av.getCharWidth () - 1);
491 } else if (evt.getX () > this.lastMousePress.x) {
492 this.av.setCharWidth (this.av.getCharWidth () + 1);
493 }if (this.av.getCharWidth () < 1) {
494 this.av.setCharWidth (1);
495 }}this.ap.fontChanged ();
496 var fm = this.getFontMetrics (this.av.getFont ());
497 this.av.validCharWidth = fm.charWidth ('M') <= this.av.getCharWidth ();
498 this.lastMousePress = evt.getPoint ();
499 this.ap.paintAlignment (false);
500 this.ap.annotationPanel.image = null;
501 return;
502 }if (!this.editingSeqs) {
503 this.doMouseDraggedDefineMode (evt);
504 return;
505 }var res = this.findRes (evt);
506 if (res < 0) {
507 res = 0;
508 }if ((this.lastres == -1) || (this.lastres == res)) {
509 return;
510 }if ((res < this.av.getAlignment ().getWidth ()) && (res < this.lastres)) {
511 this.editSequence (false, res);
512 } else {
513 this.editSequence (true, res);
514 }this.mouseDragging = true;
515 if (this.scrollThread != null) {
516 this.scrollThread.setEvent (evt);
517 }}, "java.awt.event.MouseEvent");
518 Clazz.defineMethod (c$, "editSequence", 
519 function (insertGap, startres) {
520 var fixedLeft = -1;
521 var fixedRight = -1;
522 var fixedColumns = false;
523 var sg = this.av.getSelectionGroup ();
524 var seq = this.av.getAlignment ().getSequenceAt (this.startseq);
525 if (!this.groupEditing && this.av.hasHiddenRows ()) {
526 if (this.av.isHiddenRepSequence (seq)) {
527 sg = this.av.getRepresentedSequences (seq);
528 this.groupEditing = true;
529 }}var message =  new StringBuffer ();
530 if (this.groupEditing) {
531 message.append (jalview.util.MessageManager.getString ("action.edit_group")).append (":");
532 if (this.editCommand == null) {
533 this.editCommand =  new jalview.commands.EditCommand (jalview.util.MessageManager.getString ("action.edit_group"));
534 }} else {
535 message.append (jalview.util.MessageManager.getString ("label.edit_sequence")).append (" " + seq.getName ());
536 var label = seq.getName ();
537 if (label.length > 10) {
538 label = label.substring (0, 10);
539 }if (this.editCommand == null) {
540 this.editCommand =  new jalview.commands.EditCommand (jalview.util.MessageManager.formatMessage ("label.edit_params",  Clazz.newArray (-1, [label])));
541 }}if (insertGap) {
542 message.append (" insert ");
543 } else {
544 message.append (" delete ");
545 }message.append (Math.abs (startres - this.lastres) + " gaps.");
546 this.ap.alignFrame.setStatus (message.toString ());
547 if (this.groupEditing || (sg != null && sg.getSequences (this.av.getHiddenRepSequences ()).contains (seq))) {
548 fixedColumns = true;
549 if (sg == null) {
550 if (!this.av.isHiddenRepSequence (seq)) {
551 this.endEditing ();
552 return;
553 }sg = this.av.getRepresentedSequences (seq);
554 }fixedLeft = sg.getStartRes ();
555 fixedRight = sg.getEndRes ();
556 if ((startres < fixedLeft && this.lastres >= fixedLeft) || (startres >= fixedLeft && this.lastres < fixedLeft) || (startres > fixedRight && this.lastres <= fixedRight) || (startres <= fixedRight && this.lastres > fixedRight)) {
557 this.endEditing ();
558 return;
559 }if (fixedLeft > startres) {
560 fixedRight = fixedLeft - 1;
561 fixedLeft = 0;
562 } else if (fixedRight < startres) {
563 fixedLeft = fixedRight;
564 fixedRight = -1;
565 }}if (this.av.hasHiddenColumns ()) {
566 fixedColumns = true;
567 var y1 = this.av.getColumnSelection ().getHiddenBoundaryLeft (startres);
568 var y2 = this.av.getColumnSelection ().getHiddenBoundaryRight (startres);
569 if ((insertGap && startres > y1 && this.lastres < y1) || (!insertGap && startres < y2 && this.lastres > y2)) {
570 this.endEditing ();
571 return;
572 }if (fixedLeft < y1 && (fixedRight > y2 || fixedRight == -1)) {
573 if (startres >= y2) {
574 fixedLeft = y2;
575 } else {
576 fixedRight = y2 - 1;
577 }}}if (this.groupEditing) {
578 var groupSeqs = sg.getSequences (this.av.getHiddenRepSequences ()).toArray ( new Array (0));
579 if (insertGap) {
580 if (sg.getStartRes () == 0 && sg.getEndRes () == fixedRight && sg.getEndRes () == this.av.getAlignment ().getWidth () - 1) {
581 sg.setEndRes (this.av.getAlignment ().getWidth () + startres - this.lastres);
582 fixedRight = sg.getEndRes ();
583 }var blank = false;
584 for (fixedRight = fixedRight; fixedRight > this.lastres; fixedRight--) {
585 blank = true;
586 for (var gs, $gs = 0, $$gs = groupSeqs; $gs < $$gs.length && ((gs = $$gs[$gs]) || true); $gs++) {
587 for (var j = 0; j < startres - this.lastres; j++) {
588 if (!jalview.util.Comparison.isGap (gs.getCharAt (fixedRight - j))) {
589 blank = false;
590 break;
591 }}
592 }
593 if (blank) {
594 break;
595 }}
596 if (!blank) {
597 if (sg.getSize () == this.av.getAlignment ().getHeight ()) {
598 if ((this.av.hasHiddenColumns () && startres < this.av.getColumnSelection ().getHiddenBoundaryRight (startres))) {
599 this.endEditing ();
600 return;
601 }var alWidth = this.av.getAlignment ().getWidth ();
602 if (this.av.hasHiddenRows ()) {
603 var hwidth = this.av.getAlignment ().getHiddenSequences ().getWidth ();
604 if (hwidth > alWidth) {
605 alWidth = hwidth;
606 }}sg.setEndRes (sg.getEndRes () + startres - this.lastres);
607 fixedRight = alWidth + startres - this.lastres;
608 } else {
609 this.endEditing ();
610 return;
611 }}} else if (!insertGap) {
612 for (var gs, $gs = 0, $$gs = groupSeqs; $gs < $$gs.length && ((gs = $$gs[$gs]) || true); $gs++) {
613 for (var j = startres; j < this.lastres; j++) {
614 if (gs.getLength () <= j) {
615 continue;
616 }if (!jalview.util.Comparison.isGap (gs.getCharAt (j))) {
617 this.endEditing ();
618 return;
619 }}
620 }
621 }if (insertGap) {
622 if (fixedColumns && fixedRight != -1) {
623 for (var j = this.lastres; j < startres; j++) {
624 this.insertChar (j, groupSeqs, fixedRight);
625 }
626 } else {
627 this.editCommand.appendEdit (jalview.commands.EditCommand.Action.INSERT_GAP, groupSeqs, startres, startres - this.lastres, this.av.getAlignment (), true);
628 }} else {
629 if (fixedColumns && fixedRight != -1) {
630 for (var j = this.lastres; j > startres; j--) {
631 this.deleteChar (startres, groupSeqs, fixedRight);
632 }
633 } else {
634 this.editCommand.appendEdit (jalview.commands.EditCommand.Action.DELETE_GAP, groupSeqs, startres, this.lastres - startres, this.av.getAlignment (), true);
635 }}} else {
636 if (insertGap) {
637 if (fixedColumns && fixedRight != -1) {
638 for (var j = this.lastres; j < startres; j++) {
639 this.insertChar (j,  Clazz.newArray (-1, [seq]), fixedRight);
640 }
641 } else {
642 this.editCommand.appendEdit (jalview.commands.EditCommand.Action.INSERT_GAP,  Clazz.newArray (-1, [seq]), this.lastres, startres - this.lastres, this.av.getAlignment (), true);
643 }} else {
644 if (fixedColumns && fixedRight != -1) {
645 for (var j = this.lastres; j > startres; j--) {
646 if (!jalview.util.Comparison.isGap (seq.getCharAt (startres))) {
647 this.endEditing ();
648 break;
649 }this.deleteChar (startres,  Clazz.newArray (-1, [seq]), fixedRight);
650 }
651 } else {
652 var max = 0;
653 for (var m = startres; m < this.lastres; m++) {
654 if (!jalview.util.Comparison.isGap (seq.getCharAt (m))) {
655 break;
656 }max++;
657 }
658 if (max > 0) {
659 this.editCommand.appendEdit (jalview.commands.EditCommand.Action.DELETE_GAP,  Clazz.newArray (-1, [seq]), startres, max, this.av.getAlignment (), true);
660 }}}}this.lastres = startres;
661 this.seqCanvas.repaint ();
662 }, "~B,~N");
663 Clazz.defineMethod (c$, "insertChar", 
664 function (j, seq, fixedColumn) {
665 var blankColumn = fixedColumn;
666 for (var s = 0; s < seq.length; s++) {
667 for (blankColumn = fixedColumn; blankColumn > j; blankColumn--) {
668 if (jalview.util.Comparison.isGap (seq[s].getCharAt (blankColumn))) {
669 break;
670 }}
671 if (blankColumn <= j) {
672 blankColumn = fixedColumn;
673 this.endEditing ();
674 return;
675 }}
676 this.editCommand.appendEdit (jalview.commands.EditCommand.Action.DELETE_GAP, seq, blankColumn, 1, this.av.getAlignment (), true);
677 this.editCommand.appendEdit (jalview.commands.EditCommand.Action.INSERT_GAP, seq, j, 1, this.av.getAlignment (), true);
678 }, "~N,~A,~N");
679 Clazz.defineMethod (c$, "deleteChar", 
680 function (j, seq, fixedColumn) {
681 this.editCommand.appendEdit (jalview.commands.EditCommand.Action.DELETE_GAP, seq, j, 1, this.av.getAlignment (), true);
682 this.editCommand.appendEdit (jalview.commands.EditCommand.Action.INSERT_GAP, seq, fixedColumn, 1, this.av.getAlignment (), true);
683 }, "~N,~A,~N");
684 Clazz.defineMethod (c$, "doMousePressedDefineMode", 
685 function (evt) {
686 if (this.scrollThread != null) {
687 this.scrollThread.running = false;
688 this.scrollThread = null;
689 }var res = this.findRes (evt);
690 var seq = this.findSeq (evt);
691 this.oldSeq = seq;
692 this.startWrapBlock = this.wrappedBlock;
693 if (seq == -1) {
694 return;
695 }var sequence = this.av.getAlignment ().getSequenceAt (seq);
696 if (sequence == null || res > sequence.getLength ()) {
697 return;
698 }this.stretchGroup = this.av.getSelectionGroup ();
699 if (this.stretchGroup == null) {
700 this.stretchGroup = this.av.getAlignment ().findGroup (sequence);
701 if (this.stretchGroup != null && res > this.stretchGroup.getStartRes () && res < this.stretchGroup.getEndRes ()) {
702 this.av.setSelectionGroup (this.stretchGroup);
703 } else {
704 this.stretchGroup = null;
705 }} else if (!this.stretchGroup.getSequences (null).contains (sequence) || this.stretchGroup.getStartRes () > res || this.stretchGroup.getEndRes () < res) {
706 this.stretchGroup = null;
707 var allGroups = this.av.getAlignment ().findAllGroups (sequence);
708 if (allGroups != null) {
709 for (var i = 0; i < allGroups.length; i++) {
710 if (allGroups[i].getStartRes () <= res && allGroups[i].getEndRes () >= res) {
711 this.stretchGroup = allGroups[i];
712 break;
713 }}
714 }this.av.setSelectionGroup (this.stretchGroup);
715 }if ((evt.getModifiers () & 4) == 4) {
716 var allFeatures = this.findFeaturesAtRes (sequence, sequence.findPosition (res));
717 var links = null;
718 if (allFeatures != null) {
719 for (var i = 0; i < allFeatures.length; i++) {
720 if (allFeatures[i].links != null) {
721 if (links == null) {
722 links =  new java.util.Vector ();
723 }for (var j = 0; j < allFeatures[i].links.size (); j++) {
724 links.addElement (allFeatures[i].links.elementAt (j));
725 }
726 }}
727 }var popup =  new jalview.appletgui.APopupMenu (this.ap, null, links);
728 this.add (popup);
729 popup.show (this, evt.getX (), evt.getY ());
730 return;
731 }if (this.av.cursorMode) {
732 this.seqCanvas.cursorX = this.findRes (evt);
733 this.seqCanvas.cursorY = this.findSeq (evt);
734 this.seqCanvas.repaint ();
735 return;
736 }if (this.stretchGroup == null) {
737 var sg =  new jalview.datamodel.SequenceGroup ();
738 sg.setStartRes (res);
739 sg.setEndRes (res);
740 sg.addSequence (sequence, false);
741 this.av.setSelectionGroup (sg);
742 this.stretchGroup = sg;
743 if (this.av.getConservationSelected ()) {
744 jalview.appletgui.SliderPanel.setConservationSlider (this.ap, this.av.getGlobalColourScheme (), "Background");
745 }if (this.av.getAbovePIDThreshold ()) {
746 jalview.appletgui.SliderPanel.setPIDSliderSource (this.ap, this.av.getGlobalColourScheme (), "Background");
747 }}}, "java.awt.event.MouseEvent");
748 Clazz.defineMethod (c$, "doMouseReleasedDefineMode", 
749 function (evt) {
750 if (this.stretchGroup == null) {
751 return;
752 }this.stretchGroup.recalcConservation ();
753 if (this.stretchGroup.cs != null) {
754 this.stretchGroup.cs.alignmentChanged (this.stretchGroup, this.av.getHiddenRepSequences ());
755 if (this.stretchGroup.cs.conservationApplied ()) {
756 jalview.appletgui.SliderPanel.setConservationSlider (this.ap, this.stretchGroup.cs, this.stretchGroup.getName ());
757 } else {
758 jalview.appletgui.SliderPanel.setPIDSliderSource (this.ap, this.stretchGroup.cs, this.stretchGroup.getName ());
759 }}this.changeEndRes = false;
760 this.changeStartRes = false;
761 this.stretchGroup = null;
762 jalview.appletgui.PaintRefresher.Refresh (this.ap, this.av.getSequenceSetId ());
763 this.ap.paintAlignment (true);
764 this.av.sendSelection ();
765 }, "java.awt.event.MouseEvent");
766 Clazz.defineMethod (c$, "doMouseDraggedDefineMode", 
767 function (evt) {
768 var res = this.findRes (evt);
769 var y = this.findSeq (evt);
770 if (this.wrappedBlock != this.startWrapBlock) {
771 return;
772 }if (this.stretchGroup == null) {
773 return;
774 }this.mouseDragging = true;
775 if (y > this.av.getAlignment ().getHeight ()) {
776 y = this.av.getAlignment ().getHeight () - 1;
777 }if (res >= this.av.getAlignment ().getWidth ()) {
778 res = this.av.getAlignment ().getWidth () - 1;
779 }if (this.stretchGroup.getEndRes () == res) {
780 this.changeEndRes = true;
781 } else if (this.stretchGroup.getStartRes () == res) {
782 this.changeStartRes = true;
783 }if (res < 0) {
784 res = 0;
785 }if (this.changeEndRes) {
786 if (res > (this.stretchGroup.getStartRes () - 1)) {
787 this.stretchGroup.setEndRes (res);
788 }} else if (this.changeStartRes) {
789 if (res < (this.stretchGroup.getEndRes () + 1)) {
790 this.stretchGroup.setStartRes (res);
791 }}var dragDirection = 0;
792 if (y > this.oldSeq) {
793 dragDirection = 1;
794 } else if (y < this.oldSeq) {
795 dragDirection = -1;
796 }while ((y != this.oldSeq) && (this.oldSeq > -1) && (y < this.av.getAlignment ().getHeight ())) {
797 var seq = this.av.getAlignment ().getSequenceAt (this.oldSeq);
798 this.oldSeq += dragDirection;
799 if (this.oldSeq < 0) {
800 break;
801 }var nextSeq = this.av.getAlignment ().getSequenceAt (this.oldSeq);
802 if (this.stretchGroup.getSequences (null).contains (nextSeq)) {
803 this.stretchGroup.deleteSequence (seq, false);
804 } else {
805 if (seq != null) {
806 this.stretchGroup.addSequence (seq, false);
807 }this.stretchGroup.addSequence (nextSeq, false);
808 }}
809 if (this.oldSeq < 0) {
810 this.oldSeq = -1;
811 }if (res > this.av.endRes || res < this.av.startRes || y < this.av.startSeq || y > this.av.endSeq) {
812 this.mouseExited (evt);
813 }if (this.scrollThread != null) {
814 this.scrollThread.setEvent (evt);
815 }this.seqCanvas.repaint ();
816 }, "java.awt.event.MouseEvent");
817 Clazz.overrideMethod (c$, "mouseEntered", 
818 function (e) {
819 if (this.oldSeq < 0) {
820 this.oldSeq = 0;
821 }if (this.scrollThread != null) {
822 this.scrollThread.running = false;
823 this.scrollThread = null;
824 }}, "java.awt.event.MouseEvent");
825 Clazz.overrideMethod (c$, "mouseExited", 
826 function (e) {
827 if (this.av.getWrapAlignment ()) {
828 return;
829 }if (this.mouseDragging && this.scrollThread == null) {
830 this.scrollThread = Clazz.innerTypeInstance (jalview.appletgui.SeqPanel.ScrollThread, this, null);
831 }}, "java.awt.event.MouseEvent");
832 Clazz.defineMethod (c$, "scrollCanvas", 
833 function (evt) {
834 if (evt == null) {
835 if (this.scrollThread != null) {
836 this.scrollThread.running = false;
837 this.scrollThread = null;
838 }this.mouseDragging = false;
839 } else {
840 if (this.scrollThread == null) {
841 this.scrollThread = Clazz.innerTypeInstance (jalview.appletgui.SeqPanel.ScrollThread, this, null);
842 }this.mouseDragging = true;
843 this.scrollThread.setEvent (evt);
844 }}, "java.awt.event.MouseEvent");
845 Clazz.overrideMethod (c$, "selection", 
846 function (seqsel, colsel, source) {
847 if (this.av != null && (this.av === source || !this.av.followSelection || (Clazz.instanceOf (source, jalview.appletgui.AlignViewport) && (source).getSequenceSetId ().equals (this.av.getSequenceSetId ())))) {
848 return;
849 }if (this.selectionFromTranslation (seqsel, colsel, source)) {
850 return;
851 }var repaint = false;
852 var copycolsel = true;
853 if (this.av.getSelectionGroup () == null || !this.av.isSelectionGroupChanged (true)) {
854 var sgroup = null;
855 if (seqsel != null && seqsel.getSize () > 0) {
856 if (this.av.getAlignment () == null) {
857 System.out.println ("Selection message: alignviewport av SeqSetId=" + this.av.getSequenceSetId () + " ViewId=" + this.av.getViewId () + " 's alignment is NULL! returning immediatly.");
858 return;
859 }sgroup = seqsel.intersect (this.av.getAlignment (), (this.av.hasHiddenRows ()) ? this.av.getHiddenRepSequences () : null);
860 if ((sgroup == null || sgroup.getSize () == 0) && (colsel == null || colsel.size () == 0)) {
861 copycolsel = false;
862 }}if (sgroup != null && sgroup.getSize () > 0) {
863 this.av.setSelectionGroup (sgroup);
864 } else {
865 this.av.setSelectionGroup (null);
866 }repaint = this.av.isSelectionGroupChanged (true);
867 }if (copycolsel && (this.av.getColumnSelection () == null || !this.av.isColSelChanged (true))) {
868 if (colsel == null || colsel.size () == 0) {
869 if (this.av.getColumnSelection () != null) {
870 this.av.getColumnSelection ().clear ();
871 }} else {
872 if (this.av.getColumnSelection () == null) {
873 this.av.setColumnSelection ( new jalview.datamodel.ColumnSelection (colsel));
874 } else {
875 this.av.getColumnSelection ().setElementsFrom (colsel);
876 }}repaint = new Boolean (repaint | this.av.isColSelChanged (true)).valueOf ();
877 }if (copycolsel && this.av.hasHiddenColumns () && (this.av.getColumnSelection () == null || this.av.getColumnSelection ().getHiddenColumns () == null)) {
878 System.err.println ("Bad things");
879 }if (repaint) {
880 this.ap.scalePanelHolder.repaint ();
881 this.ap.repaint ();
882 }}, "jalview.datamodel.SequenceGroup,jalview.datamodel.ColumnSelection,jalview.structure.SelectionSource");
883 Clazz.defineMethod (c$, "scrollTo", 
884 function (row, column) {
885 row = row < 0 ? this.ap.av.startSeq : row;
886 column = column < 0 ? this.ap.av.startRes : column;
887 this.ap.scrollTo (column, column, row, true, true);
888 }, "~N,~N");
889 Clazz.defineMethod (c$, "scrollToRow", 
890 function (row) {
891 row = row < 0 ? this.ap.av.startSeq : row;
892 this.ap.scrollTo (this.ap.av.startRes, this.ap.av.startRes, row, true, true);
893 }, "~N");
894 Clazz.defineMethod (c$, "scrollToColumn", 
895 function (column) {
896 column = column < 0 ? this.ap.av.startRes : column;
897 this.ap.scrollTo (column, column, this.ap.av.startSeq, true, true);
898 }, "~N");
899 Clazz.defineMethod (c$, "selectionFromTranslation", 
900 function (seqsel, colsel, source) {
901 if (!(Clazz.instanceOf (source, jalview.api.AlignViewportI))) {
902 return false;
903 }var sourceAv = source;
904 if (sourceAv.getCodingComplement () !== this.av && this.av.getCodingComplement () !== sourceAv) {
905 return false;
906 }var sg = jalview.util.MappingUtils.mapSequenceGroup (seqsel, sourceAv, this.av);
907 this.av.setSelectionGroup (sg);
908 this.av.isSelectionGroupChanged (true);
909 var cs = jalview.util.MappingUtils.mapColumnSelection (colsel, sourceAv, this.av);
910 this.av.setColumnSelection (cs);
911 this.av.isColSelChanged (true);
912 this.ap.scalePanelHolder.repaint ();
913 this.ap.repaint ();
914 return true;
915 }, "jalview.datamodel.SequenceGroup,jalview.datamodel.ColumnSelection,jalview.structure.SelectionSource");
916 c$.$SeqPanel$ScrollThread$ = function () {
917 Clazz.pu$h(self.c$);
918 c$ = Clazz.decorateAsClass (function () {
919 Clazz.prepareCallback (this, arguments);
920 this.evt = null;
921 this.running = false;
922 Clazz.instantialize (this, arguments);
923 }, jalview.appletgui.SeqPanel, "ScrollThread", Thread);
924 Clazz.makeConstructor (c$, 
925 function () {
926 Clazz.superConstructor (this, jalview.appletgui.SeqPanel.ScrollThread, []);
927 this.start ();
928 });
929 Clazz.defineMethod (c$, "setEvent", 
930 function (a) {
931 this.evt = a;
932 }, "java.awt.event.MouseEvent");
933 Clazz.defineMethod (c$, "stopScrolling", 
934 function () {
935 this.running = false;
936 });
937 Clazz.overrideMethod (c$, "run", 
938 function () {
939 this.running = true;
940 while (this.running) {
941 if (this.evt != null) {
942 if (this.b$["jalview.appletgui.SeqPanel"].mouseDragging && this.evt.getY () < 0 && this.b$["jalview.appletgui.SeqPanel"].av.getStartSeq () > 0) {
943 this.running = this.b$["jalview.appletgui.SeqPanel"].ap.scrollUp (true);
944 }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 ()) {
945 this.running = this.b$["jalview.appletgui.SeqPanel"].ap.scrollUp (false);
946 }if (this.b$["jalview.appletgui.SeqPanel"].mouseDragging && this.evt.getX () < 0) {
947 this.running = this.b$["jalview.appletgui.SeqPanel"].ap.scrollRight (false);
948 } else if (this.b$["jalview.appletgui.SeqPanel"].mouseDragging && this.evt.getX () >= this.b$["jalview.appletgui.SeqPanel"].getSize ().width) {
949 this.running = this.b$["jalview.appletgui.SeqPanel"].ap.scrollRight (true);
950 }}try {
951 Thread.sleep (75);
952 } catch (ex) {
953 if (Clazz.exceptionOf (ex, Exception)) {
954 } else {
955 throw ex;
956 }
957 }
958 }
959 });
960 c$ = Clazz.p0p ();
961 };
962 });