X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=site%2Fj2s%2Fjalview%2Fappletgui%2FIdPanel.js;h=b8695b5eb0a121729fc4b5755e7c338135d3c8d4;hp=48705bef436e33b7bc0cec6e2ed5d6652d6cf6aa;hb=b9b7a352eee79b7764c3b09c9d19663075061d8c;hpb=8ffd05b3abe52c0b6b79b011c0966361f82d5fe6 diff --git a/site/j2s/jalview/appletgui/IdPanel.js b/site/j2s/jalview/appletgui/IdPanel.js index 48705be..b8695b5 100644 --- a/site/j2s/jalview/appletgui/IdPanel.js +++ b/site/j2s/jalview/appletgui/IdPanel.js @@ -1,285 +1,285 @@ -Clazz.declarePackage ("jalview.appletgui"); -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 () { -c$ = Clazz.decorateAsClass (function () { -this.idCanvas = null; -this.av = null; -this.alignPanel = null; -this.scrollThread = null; -this.lastid = -1; -this.mouseDragging = false; -this.links = null; -this.tooltip = null; -if (!Clazz.isClassDefined ("jalview.appletgui.IdPanel.ScrollThread")) { -jalview.appletgui.IdPanel.$IdPanel$ScrollThread$ (); -} -Clazz.instantialize (this, arguments); -}, jalview.appletgui, "IdPanel", awt2swing.Panel, [java.awt.event.MouseListener, java.awt.event.MouseMotionListener]); -Clazz.prepareFields (c$, function () { -this.links = new java.util.Vector (); -}); -Clazz.makeConstructor (c$, -function (av, parent) { -Clazz.superConstructor (this, jalview.appletgui.IdPanel, []); -this.setName ("idPanel"); -this.av = av; -this.alignPanel = parent; -this.idCanvas = new jalview.appletgui.IdCanvas (av); -this.setLayout ( new java.awt.BorderLayout ()); -this.add (this.idCanvas, "Center"); -this.idCanvas.addMouseListener (this); -this.idCanvas.addMouseMotionListener (this); -if (av.applet != null) { -av.applet.getLinkParams (this.links); -}{ -var srsPos = this.links.indexOf ("SRS|http://srs.ebi.ac.uk/srsbin/cgi-bin/wgetz?-newId+(([uniprot-all:$SEQUENCE_ID$]))+-view+SwissEntry"); -if (srsPos > -1) { -this.links.setElementAt ("EMBL-EBI Search|http://www.ebi.ac.uk/ebisearch/search.ebi?db=allebi&query=$SEQUENCE_ID$", srsPos); -}}if (this.links.size () < 1) { -this.links = new java.util.Vector (); -this.links.addElement ("EMBL-EBI Search|http://www.ebi.ac.uk/ebisearch/search.ebi?db=allebi&query=$SEQUENCE_ID$"); -}}, "jalview.appletgui.AlignViewport,jalview.appletgui.AlignmentPanel"); -Clazz.overrideMethod (c$, "mouseMoved", -function (e) { -var seq = this.alignPanel.seqPanel.findSeq (e); -var sequence = this.av.getAlignment ().getSequenceAt (seq); -var tooltiptext = new StringBuffer (); -if (sequence != null) { -if (sequence.getDescription () != null) { -tooltiptext.append (sequence.getDescription ()); -tooltiptext.append ("\n"); -}var sf = sequence.getSequenceFeatures (); -for (var sl = 0; sf != null && sl < sf.length; sl++) { -if (sf[sl].begin == sf[sl].end && sf[sl].begin == 0) { -var nl = false; -if (sf[sl].getFeatureGroup () != null) { -tooltiptext.append (sf[sl].getFeatureGroup ()); -nl = true; -};if (sf[sl].getType () != null) { -tooltiptext.append (" "); -tooltiptext.append (sf[sl].getType ()); -nl = true; -};if (sf[sl].getDescription () != null) { -tooltiptext.append (" "); -tooltiptext.append (sf[sl].getDescription ()); -nl = true; -};if (!Float.isNaN (sf[sl].getScore ()) && sf[sl].getScore () != 0) { -tooltiptext.append (" Score = "); -tooltiptext.append (sf[sl].getScore ()); -nl = true; -};if (sf[sl].getStatus () != null && sf[sl].getStatus ().length > 0) { -tooltiptext.append (" ("); -tooltiptext.append (sf[sl].getStatus ()); -tooltiptext.append (")"); -nl = true; -};if (nl) { -tooltiptext.append ("\n"); -}}} -}if (tooltiptext.length () == 0) { -if (this.tooltip != null) { -this.tooltip.setVisible (false); -}this.tooltip = null; -tooltiptext = null; -return; -}if (this.tooltip == null) { -this.tooltip = new jalview.appletgui.Tooltip (sequence.getDisplayId (true) + "\n" + tooltiptext.toString (), this.idCanvas); -} else { -this.tooltip.setTip (sequence.getDisplayId (true) + "\n" + tooltiptext.toString ()); -}tooltiptext = null; -}, "java.awt.event.MouseEvent"); -Clazz.overrideMethod (c$, "mouseDragged", -function (e) { -this.mouseDragging = true; -var seq = Math.max (0, this.alignPanel.seqPanel.findSeq (e)); -if (seq < this.lastid) { -this.selectSeqs (this.lastid - 1, seq); -} else if (seq > this.lastid) { -this.selectSeqs (this.lastid + 1, seq); -}this.lastid = seq; -this.alignPanel.paintAlignment (false); -}, "java.awt.event.MouseEvent"); -Clazz.overrideMethod (c$, "mouseClicked", -function (e) { -if (e.getClickCount () < 2) { -return; -}var seq = this.alignPanel.seqPanel.findSeq (e); -var sq = this.av.getAlignment ().getSequenceAt (seq); -if (sq == null) { -return; -}var id = sq.getName (); -var target = null; -var url = null; -var i = 0; -while (url == null && i < this.links.size ()) { -url = this.links.elementAt (i++).toString (); -var urlLink = null; -try { -urlLink = new jalview.util.UrlLink (url); -target = urlLink.getTarget (); -} catch (foo) { -if (Clazz.exceptionOf (foo, Exception)) { -System.err.println ("Exception for URLLink '" + url + "'"); -foo.printStackTrace (); -url = null; -continue; -} else { -throw foo; -} -} -;if (!urlLink.isValid ()) { -System.err.println (urlLink.getInvalidMessage ()); -url = null; -continue; -}var urls = urlLink.makeUrls (id, true); -if (urls == null || urls[0] == null || urls[0].length < 1) { -url = null; -continue; -}url = urls[1]; -} -try { -this.alignPanel.alignFrame.showURL (url, target); -} catch (ex) { -if (Clazz.exceptionOf (ex, Exception)) { -ex.printStackTrace (); -} else { -throw ex; -} -} -}, "java.awt.event.MouseEvent"); -Clazz.overrideMethod (c$, "mouseEntered", -function (e) { -if (this.scrollThread != null) { -this.scrollThread.running = false; -}}, "java.awt.event.MouseEvent"); -Clazz.overrideMethod (c$, "mouseExited", -function (e) { -if (this.av.getWrapAlignment ()) { -return; -}if (this.mouseDragging && e.getY () < 0 && this.av.getStartSeq () > 0) { -this.scrollThread = Clazz.innerTypeInstance (jalview.appletgui.IdPanel.ScrollThread, this, null, true); -}if (this.mouseDragging && e.getY () >= this.getSize ().height && this.av.getAlignment ().getHeight () > this.av.getEndSeq ()) { -this.scrollThread = Clazz.innerTypeInstance (jalview.appletgui.IdPanel.ScrollThread, this, null, false); -}}, "java.awt.event.MouseEvent"); -Clazz.overrideMethod (c$, "mousePressed", -function (e) { -if (e.getClickCount () > 1) { -return; -}var y = e.getY (); -if (this.av.getWrapAlignment ()) { -y -= 2 * this.av.getCharHeight (); -}var seq = this.alignPanel.seqPanel.findSeq (e); -if ((e.getModifiers () & 4) == 4) { -var sq = this.av.getAlignment ().getSequenceAt (seq); -var nlinks = new java.util.Vector (); -for (var l = 0, lSize = this.links.size (); l < lSize; l++) { -nlinks.addElement (this.links.elementAt (l)); -} -var sf = sq == null ? null : sq.getSequenceFeatures (); -for (var sl = 0; sf != null && sl < sf.length; sl++) { -if (sf[sl].begin == sf[sl].end && sf[sl].begin == 0) { -if (sf[sl].links != null && sf[sl].links.size () > 0) { -for (var l = 0, lSize = sf[sl].links.size (); l < lSize; l++) { -nlinks.addElement (sf[sl].links.elementAt (l)); -} -}}} -var popup = new jalview.appletgui.APopupMenu (this.alignPanel, sq, nlinks); -this.add (popup); -popup.show (this, e.getX (), e.getY ()); -return; -}if ((this.av.getSelectionGroup () == null) || ((!e.isControlDown () && !e.isShiftDown ()) && this.av.getSelectionGroup () != null)) { -this.av.setSelectionGroup ( new jalview.datamodel.SequenceGroup ()); -this.av.getSelectionGroup ().setStartRes (0); -this.av.getSelectionGroup ().setEndRes (this.av.getAlignment ().getWidth () - 1); -}if (e.isShiftDown () && this.lastid != -1) { -this.selectSeqs (this.lastid, seq); -} else { -this.selectSeq (seq); -}this.alignPanel.paintAlignment (false); -}, "java.awt.event.MouseEvent"); -Clazz.defineMethod (c$, "selectSeq", -function (seq) { -this.lastid = seq; -var pickedSeq = this.av.getAlignment ().getSequenceAt (seq); -this.av.getSelectionGroup ().addOrRemove (pickedSeq, true); -}, "~N"); -Clazz.defineMethod (c$, "selectSeqs", -function (start, end) { -this.lastid = start; -if (end >= this.av.getAlignment ().getHeight ()) { -end = this.av.getAlignment ().getHeight () - 1; -}if (end < start) { -var tmp = start; -start = end; -end = tmp; -this.lastid = end; -}if (this.av.getSelectionGroup () == null) { -this.av.setSelectionGroup ( new jalview.datamodel.SequenceGroup ()); -}for (var i = start; i <= end; i++) { -this.av.getSelectionGroup ().addSequence (this.av.getAlignment ().getSequenceAt (i), i == end); -} -}, "~N,~N"); -Clazz.overrideMethod (c$, "mouseReleased", -function (e) { -if (this.scrollThread != null) { -this.scrollThread.running = false; -}if (this.av.getSelectionGroup () != null) { -this.av.getSelectionGroup ().recalcConservation (); -}this.mouseDragging = false; -jalview.appletgui.PaintRefresher.Refresh (this, this.av.getSequenceSetId ()); -this.av.sendSelection (); -}, "java.awt.event.MouseEvent"); -Clazz.defineMethod (c$, "highlightSearchResults", -function (list) { -this.idCanvas.setHighlighted (list); -if (list == null) { -return; -}var index = this.av.getAlignment ().findIndex (list.get (0)); -if (this.av.getStartSeq () > index || this.av.getEndSeq () < index) { -this.alignPanel.setScrollValues (this.av.getStartRes (), index); -}}, "java.util.List"); -c$.$IdPanel$ScrollThread$ = function () { -Clazz.pu$h(self.c$); -c$ = Clazz.decorateAsClass (function () { -Clazz.prepareCallback (this, arguments); -this.running = false; -this.up = true; -Clazz.instantialize (this, arguments); -}, jalview.appletgui.IdPanel, "ScrollThread", Thread); -Clazz.makeConstructor (c$, -function (a) { -Clazz.superConstructor (this, jalview.appletgui.IdPanel.ScrollThread, []); -this.up = a; -this.start (); -}, "~B"); -Clazz.defineMethod (c$, "stopScrolling", -function () { -this.running = false; -}); -Clazz.overrideMethod (c$, "run", -function () { -this.running = true; -while (this.running) { -if (this.b$["jalview.appletgui.IdPanel"].alignPanel.scrollUp (this.up)) { -var a = this.b$["jalview.appletgui.IdPanel"].av.getStartSeq (); -if (!this.up) { -a = this.b$["jalview.appletgui.IdPanel"].av.getEndSeq (); -}if (a < this.b$["jalview.appletgui.IdPanel"].lastid) { -this.b$["jalview.appletgui.IdPanel"].selectSeqs (this.b$["jalview.appletgui.IdPanel"].lastid - 1, a); -} else if (a > this.b$["jalview.appletgui.IdPanel"].lastid && a < this.b$["jalview.appletgui.IdPanel"].av.getAlignment ().getHeight ()) { -this.b$["jalview.appletgui.IdPanel"].selectSeqs (this.b$["jalview.appletgui.IdPanel"].lastid + 1, a); -}this.b$["jalview.appletgui.IdPanel"].lastid = a; -} else { -this.running = false; -}this.b$["jalview.appletgui.IdPanel"].alignPanel.paintAlignment (true); -try { -Thread.sleep (100); -} catch (ex) { -if (Clazz.exceptionOf (ex, Exception)) { -} else { -throw ex; -} -} -} -}); -c$ = Clazz.p0p (); -}; -}); +Clazz.declarePackage ("jalview.appletgui"); +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 () { +c$ = Clazz.decorateAsClass (function () { +this.idCanvas = null; +this.av = null; +this.alignPanel = null; +this.scrollThread = null; +this.lastid = -1; +this.mouseDragging = false; +this.links = null; +this.tooltip = null; +if (!Clazz.isClassDefined ("jalview.appletgui.IdPanel.ScrollThread")) { +jalview.appletgui.IdPanel.$IdPanel$ScrollThread$ (); +} +Clazz.instantialize (this, arguments); +}, jalview.appletgui, "IdPanel", awt2swing.Panel, [java.awt.event.MouseListener, java.awt.event.MouseMotionListener]); +Clazz.prepareFields (c$, function () { +this.links = new java.util.Vector (); +}); +Clazz.makeConstructor (c$, +function (av, parent) { +Clazz.superConstructor (this, jalview.appletgui.IdPanel, []); +this.setName ("idPanel"); +this.av = av; +this.alignPanel = parent; +this.idCanvas = new jalview.appletgui.IdCanvas (av); +this.setLayout ( new java.awt.BorderLayout ()); +this.add (this.idCanvas, "Center"); +this.idCanvas.addMouseListener (this); +this.idCanvas.addMouseMotionListener (this); +if (av.applet != null) { +av.applet.getLinkParams (this.links); +}{ +var srsPos = this.links.indexOf ("SRS|http://srs.ebi.ac.uk/srsbin/cgi-bin/wgetz?-newId+(([uniprot-all:$SEQUENCE_ID$]))+-view+SwissEntry"); +if (srsPos > -1) { +this.links.setElementAt ("EMBL-EBI Search|http://www.ebi.ac.uk/ebisearch/search.ebi?db=allebi&query=$SEQUENCE_ID$", srsPos); +}}if (this.links.size () < 1) { +this.links = new java.util.Vector (); +this.links.addElement ("EMBL-EBI Search|http://www.ebi.ac.uk/ebisearch/search.ebi?db=allebi&query=$SEQUENCE_ID$"); +}}, "jalview.appletgui.AlignViewport,jalview.appletgui.AlignmentPanel"); +Clazz.overrideMethod (c$, "mouseMoved", +function (e) { +var seq = this.alignPanel.seqPanel.findSeq (e); +var sequence = this.av.getAlignment ().getSequenceAt (seq); +var tooltiptext = new StringBuffer (); +if (sequence != null) { +if (sequence.getDescription () != null) { +tooltiptext.append (sequence.getDescription ()); +tooltiptext.append ("\n"); +}var sf = sequence.getSequenceFeatures (); +for (var sl = 0; sf != null && sl < sf.length; sl++) { +if (sf[sl].begin == sf[sl].end && sf[sl].begin == 0) { +var nl = false; +if (sf[sl].getFeatureGroup () != null) { +tooltiptext.append (sf[sl].getFeatureGroup ()); +nl = true; +};if (sf[sl].getType () != null) { +tooltiptext.append (" "); +tooltiptext.append (sf[sl].getType ()); +nl = true; +};if (sf[sl].getDescription () != null) { +tooltiptext.append (" "); +tooltiptext.append (sf[sl].getDescription ()); +nl = true; +};if (!Float.isNaN (sf[sl].getScore ()) && sf[sl].getScore () != 0) { +tooltiptext.append (" Score = "); +tooltiptext.append (sf[sl].getScore ()); +nl = true; +};if (sf[sl].getStatus () != null && sf[sl].getStatus ().length > 0) { +tooltiptext.append (" ("); +tooltiptext.append (sf[sl].getStatus ()); +tooltiptext.append (")"); +nl = true; +};if (nl) { +tooltiptext.append ("\n"); +}}} +}if (tooltiptext.length () == 0) { +if (this.tooltip != null) { +this.tooltip.setVisible (false); +}this.tooltip = null; +tooltiptext = null; +return; +}if (this.tooltip == null) { +this.tooltip = new jalview.appletgui.Tooltip (sequence.getDisplayId (true) + "\n" + tooltiptext.toString (), this.idCanvas); +} else { +this.tooltip.setTip (sequence.getDisplayId (true) + "\n" + tooltiptext.toString ()); +}tooltiptext = null; +}, "java.awt.event.MouseEvent"); +Clazz.overrideMethod (c$, "mouseDragged", +function (e) { +this.mouseDragging = true; +var seq = Math.max (0, this.alignPanel.seqPanel.findSeq (e)); +if (seq < this.lastid) { +this.selectSeqs (this.lastid - 1, seq); +} else if (seq > this.lastid) { +this.selectSeqs (this.lastid + 1, seq); +}this.lastid = seq; +this.alignPanel.paintAlignment (false); +}, "java.awt.event.MouseEvent"); +Clazz.overrideMethod (c$, "mouseClicked", +function (e) { +if (e.getClickCount () < 2) { +return; +}var seq = this.alignPanel.seqPanel.findSeq (e); +var sq = this.av.getAlignment ().getSequenceAt (seq); +if (sq == null) { +return; +}var id = sq.getName (); +var target = null; +var url = null; +var i = 0; +while (url == null && i < this.links.size ()) { +url = this.links.elementAt (i++).toString (); +var urlLink = null; +try { +urlLink = new jalview.util.UrlLink (url); +target = urlLink.getTarget (); +} catch (foo) { +if (Clazz.exceptionOf (foo, Exception)) { +System.err.println ("Exception for URLLink '" + url + "'"); +foo.printStackTrace (); +url = null; +continue; +} else { +throw foo; +} +} +;if (!urlLink.isValid ()) { +System.err.println (urlLink.getInvalidMessage ()); +url = null; +continue; +}var urls = urlLink.makeUrls (id, true); +if (urls == null || urls[0] == null || urls[0].length < 1) { +url = null; +continue; +}url = urls[1]; +} +try { +this.alignPanel.alignFrame.showURL (url, target); +} catch (ex) { +if (Clazz.exceptionOf (ex, Exception)) { +ex.printStackTrace (); +} else { +throw ex; +} +} +}, "java.awt.event.MouseEvent"); +Clazz.overrideMethod (c$, "mouseEntered", +function (e) { +if (this.scrollThread != null) { +this.scrollThread.running = false; +}}, "java.awt.event.MouseEvent"); +Clazz.overrideMethod (c$, "mouseExited", +function (e) { +if (this.av.getWrapAlignment ()) { +return; +}if (this.mouseDragging && e.getY () < 0 && this.av.getStartSeq () > 0) { +this.scrollThread = Clazz.innerTypeInstance (jalview.appletgui.IdPanel.ScrollThread, this, null, true); +}if (this.mouseDragging && e.getY () >= this.getSize ().height && this.av.getAlignment ().getHeight () > this.av.getEndSeq ()) { +this.scrollThread = Clazz.innerTypeInstance (jalview.appletgui.IdPanel.ScrollThread, this, null, false); +}}, "java.awt.event.MouseEvent"); +Clazz.overrideMethod (c$, "mousePressed", +function (e) { +if (e.getClickCount () > 1) { +return; +}var y = e.getY (); +if (this.av.getWrapAlignment ()) { +y -= 2 * this.av.getCharHeight (); +}var seq = this.alignPanel.seqPanel.findSeq (e); +if ((e.getModifiers () & 4) == 4) { +var sq = this.av.getAlignment ().getSequenceAt (seq); +var nlinks = new java.util.Vector (); +for (var l = 0, lSize = this.links.size (); l < lSize; l++) { +nlinks.addElement (this.links.elementAt (l)); +} +var sf = sq == null ? null : sq.getSequenceFeatures (); +for (var sl = 0; sf != null && sl < sf.length; sl++) { +if (sf[sl].begin == sf[sl].end && sf[sl].begin == 0) { +if (sf[sl].links != null && sf[sl].links.size () > 0) { +for (var l = 0, lSize = sf[sl].links.size (); l < lSize; l++) { +nlinks.addElement (sf[sl].links.elementAt (l)); +} +}}} +var popup = new jalview.appletgui.APopupMenu (this.alignPanel, sq, nlinks); +this.add (popup); +popup.show (this, e.getX (), e.getY ()); +return; +}if ((this.av.getSelectionGroup () == null) || ((!e.isControlDown () && !e.isShiftDown ()) && this.av.getSelectionGroup () != null)) { +this.av.setSelectionGroup ( new jalview.datamodel.SequenceGroup ()); +this.av.getSelectionGroup ().setStartRes (0); +this.av.getSelectionGroup ().setEndRes (this.av.getAlignment ().getWidth () - 1); +}if (e.isShiftDown () && this.lastid != -1) { +this.selectSeqs (this.lastid, seq); +} else { +this.selectSeq (seq); +}this.alignPanel.paintAlignment (false); +}, "java.awt.event.MouseEvent"); +Clazz.defineMethod (c$, "selectSeq", +function (seq) { +this.lastid = seq; +var pickedSeq = this.av.getAlignment ().getSequenceAt (seq); +this.av.getSelectionGroup ().addOrRemove (pickedSeq, true); +}, "~N"); +Clazz.defineMethod (c$, "selectSeqs", +function (start, end) { +this.lastid = start; +if (end >= this.av.getAlignment ().getHeight ()) { +end = this.av.getAlignment ().getHeight () - 1; +}if (end < start) { +var tmp = start; +start = end; +end = tmp; +this.lastid = end; +}if (this.av.getSelectionGroup () == null) { +this.av.setSelectionGroup ( new jalview.datamodel.SequenceGroup ()); +}for (var i = start; i <= end; i++) { +this.av.getSelectionGroup ().addSequence (this.av.getAlignment ().getSequenceAt (i), i == end); +} +}, "~N,~N"); +Clazz.overrideMethod (c$, "mouseReleased", +function (e) { +if (this.scrollThread != null) { +this.scrollThread.running = false; +}if (this.av.getSelectionGroup () != null) { +this.av.getSelectionGroup ().recalcConservation (); +}this.mouseDragging = false; +jalview.appletgui.PaintRefresher.Refresh (this, this.av.getSequenceSetId ()); +this.av.sendSelection (); +}, "java.awt.event.MouseEvent"); +Clazz.defineMethod (c$, "highlightSearchResults", +function (list) { +this.idCanvas.setHighlighted (list); +if (list == null) { +return; +}var index = this.av.getAlignment ().findIndex (list.get (0)); +if (this.av.getStartSeq () > index || this.av.getEndSeq () < index) { +this.alignPanel.setScrollValues (this.av.getStartRes (), index); +}}, "java.util.List"); +c$.$IdPanel$ScrollThread$ = function () { +Clazz.pu$h(self.c$); +c$ = Clazz.decorateAsClass (function () { +Clazz.prepareCallback (this, arguments); +this.running = false; +this.up = true; +Clazz.instantialize (this, arguments); +}, jalview.appletgui.IdPanel, "ScrollThread", Thread); +Clazz.makeConstructor (c$, +function (a) { +Clazz.superConstructor (this, jalview.appletgui.IdPanel.ScrollThread, []); +this.up = a; +this.start (); +}, "~B"); +Clazz.defineMethod (c$, "stopScrolling", +function () { +this.running = false; +}); +Clazz.overrideMethod (c$, "run", +function () { +this.running = true; +while (this.running) { +if (this.b$["jalview.appletgui.IdPanel"].alignPanel.scrollUp (this.up)) { +var a = this.b$["jalview.appletgui.IdPanel"].av.getStartSeq (); +if (!this.up) { +a = this.b$["jalview.appletgui.IdPanel"].av.getEndSeq (); +}if (a < this.b$["jalview.appletgui.IdPanel"].lastid) { +this.b$["jalview.appletgui.IdPanel"].selectSeqs (this.b$["jalview.appletgui.IdPanel"].lastid - 1, a); +} else if (a > this.b$["jalview.appletgui.IdPanel"].lastid && a < this.b$["jalview.appletgui.IdPanel"].av.getAlignment ().getHeight ()) { +this.b$["jalview.appletgui.IdPanel"].selectSeqs (this.b$["jalview.appletgui.IdPanel"].lastid + 1, a); +}this.b$["jalview.appletgui.IdPanel"].lastid = a; +} else { +this.running = false; +}this.b$["jalview.appletgui.IdPanel"].alignPanel.paintAlignment (true); +try { +Thread.sleep (100); +} catch (ex) { +if (Clazz.exceptionOf (ex, Exception)) { +} else { +throw ex; +} +} +} +}); +c$ = Clazz.p0p (); +}; +});