X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=bin%2Fjalview%2Fappletgui%2FOverviewPanel.js;h=41baadd620fbd961337217241ce3814693acd35d;hp=cadd6b708806619a92198a171996626ca185fa01;hb=7301a2415adab88038b291fc54caeeb3a5a47a44;hpb=6154cb57a6eac3bb1344b8342495f5bb701ee921 diff --git a/bin/jalview/appletgui/OverviewPanel.js b/bin/jalview/appletgui/OverviewPanel.js index cadd6b7..41baadd 100644 --- a/bin/jalview/appletgui/OverviewPanel.js +++ b/bin/jalview/appletgui/OverviewPanel.js @@ -1,262 +1,262 @@ -Clazz.declarePackage ("jalview.appletgui"); -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 () { -c$ = Clazz.decorateAsClass (function () { -this.miniMe = null; -this.offscreen = null; -this.av = null; -this.ap = null; -this.scalew = 1; -this.scaleh = 1; -this.$width = 0; -this.sequencesHeight = 0; -this.graphHeight = 20; -this.boxX = -1; -this.boxY = -1; -this.boxWidth = -1; -this.boxHeight = -1; -this.resizing = false; -this.sr = null; -this.fr = null; -this.nullFrame = null; -this.resizeAgain = false; -Clazz.instantialize (this, arguments); -}, jalview.appletgui, "OverviewPanel", awt2swing.Panel, [Runnable, java.awt.event.MouseMotionListener, java.awt.event.MouseListener]); -Clazz.makeConstructor (c$, -function (ap) { -Clazz.superConstructor (this, jalview.appletgui.OverviewPanel, []); -this.av = ap.av; -this.ap = ap; -this.setLayout (null); -this.nullFrame = new awt2swing.Frame (); -this.nullFrame.addNotify (); -this.sr = new jalview.appletgui.SequenceRenderer (this.av); -this.sr.graphics = this.nullFrame.getGraphics (); -this.sr.renderGaps = false; -this.sr.forOverview = true; -this.fr = new jalview.appletgui.FeatureRenderer (this.av); -var initialScale = this.av.getAlignment ().getWidth () / this.av.getAlignment ().getHeight (); -if (this.av.getSequenceConsensusHash () == null) { -this.graphHeight = 0; -}if (this.av.getAlignment ().getWidth () > this.av.getAlignment ().getHeight ()) { -this.$width = 400; -this.sequencesHeight = Clazz.floatToInt (400 / initialScale); -if (this.sequencesHeight < 40) { -this.sequencesHeight = 40; -}} else { -this.$width = Clazz.floatToInt (400 * initialScale); -this.sequencesHeight = 300; -if (this.$width < 120) { -this.$width = 120; -}}this.setSize ( new java.awt.Dimension (this.$width, this.sequencesHeight + this.graphHeight)); -this.addComponentListener (((Clazz.isClassDefined ("jalview.appletgui.OverviewPanel$1") ? 0 : jalview.appletgui.OverviewPanel.$OverviewPanel$1$ ()), Clazz.innerTypeInstance (jalview.appletgui.OverviewPanel$1, this, null))); -this.addMouseMotionListener (this); -this.addMouseListener (this); -this.updateOverviewImage (); -}, "jalview.appletgui.AlignmentPanel"); -Clazz.overrideMethod (c$, "mouseEntered", -function (evt) { -}, "java.awt.event.MouseEvent"); -Clazz.overrideMethod (c$, "mouseExited", -function (evt) { -}, "java.awt.event.MouseEvent"); -Clazz.overrideMethod (c$, "mouseClicked", -function (evt) { -}, "java.awt.event.MouseEvent"); -Clazz.overrideMethod (c$, "mouseMoved", -function (evt) { -}, "java.awt.event.MouseEvent"); -Clazz.overrideMethod (c$, "mousePressed", -function (evt) { -this.boxX = evt.getX (); -this.boxY = evt.getY (); -this.checkValid (); -}, "java.awt.event.MouseEvent"); -Clazz.overrideMethod (c$, "mouseReleased", -function (evt) { -this.boxX = evt.getX (); -this.boxY = evt.getY (); -this.checkValid (); -}, "java.awt.event.MouseEvent"); -Clazz.overrideMethod (c$, "mouseDragged", -function (evt) { -this.boxX = evt.getX (); -this.boxY = evt.getY (); -this.checkValid (); -}, "java.awt.event.MouseEvent"); -Clazz.defineMethod (c$, "checkValid", -function () { -if (this.boxY < 0) { -this.boxY = 0; -}if (this.boxY > (this.sequencesHeight - this.boxHeight)) { -this.boxY = this.sequencesHeight - this.boxHeight + 1; -}if (this.boxX < 0) { -this.boxX = 0; -}if (this.boxX > (this.$width - this.boxWidth)) { -if (this.av.hasHiddenColumns ()) { -this.boxWidth = Clazz.floatToInt ((this.av.endRes - this.av.startRes + 1) * this.av.getCharWidth () * this.scalew); -}this.boxX = this.$width - this.boxWidth; -}var col = Clazz.floatToInt (this.boxX / this.scalew / this.av.getCharWidth ()); -var row = Clazz.floatToInt (this.boxY / this.scaleh / this.av.getCharHeight ()); -if (this.av.hasHiddenColumns ()) { -if (!this.av.getColumnSelection ().isVisible (col)) { -return; -}col = this.av.getColumnSelection ().findColumnPosition (col); -}if (this.av.hasHiddenRows ()) { -row = this.av.getAlignment ().getHiddenSequences ().findIndexWithoutHiddenSeqs (row); -}this.ap.setScrollValues (col, row); -this.ap.paintAlignment (false); -}); -Clazz.defineMethod (c$, "updateOverviewImage", -function () { -if (this.resizing) { -this.resizeAgain = true; -return; -}if (this.av.isShowSequenceFeatures ()) { -this.fr.transferSettings (this.ap.seqPanel.seqCanvas.fr); -}this.resizing = true; -if ((this.getSize ().width > 0) && (this.getSize ().height > 0)) { -this.$width = this.getSize ().width; -this.sequencesHeight = this.getSize ().height - this.graphHeight; -}this.setSize ( new java.awt.Dimension (this.$width, this.sequencesHeight + this.graphHeight)); -var thread = new Thread (this); -thread.start (); -this.repaint (); -}); -Clazz.overrideMethod (c$, "run", -function () { -this.miniMe = null; -var alwidth = this.av.getAlignment ().getWidth (); -var alheight = this.av.getAlignment ().getHeight (); -if (this.av.isShowSequenceFeatures ()) { -this.fr.transferSettings (this.ap.seqPanel.seqCanvas.getFeatureRenderer ()); -}if (this.getSize ().width > 0 && this.getSize ().height > 0) { -this.$width = this.getSize ().width; -this.sequencesHeight = this.getSize ().height - this.graphHeight; -}this.setSize ( new java.awt.Dimension (this.$width, this.sequencesHeight + this.graphHeight)); -var fullsizeWidth = alwidth * this.av.getCharWidth (); -var fullsizeHeight = alheight * this.av.getCharHeight (); -this.scalew = this.$width / fullsizeWidth; -this.scaleh = this.sequencesHeight / fullsizeHeight; -this.miniMe = this.nullFrame.createImage (this.$width, this.sequencesHeight + this.graphHeight); -this.offscreen = this.nullFrame.createImage (this.$width, this.sequencesHeight + this.graphHeight); -var mg = this.miniMe.getGraphics (); -var sampleCol = alwidth / this.$width; -var sampleRow = alheight / this.sequencesHeight; -var lastcol = 0; -var lastrow = 0; -var xstart = 0; -var ystart = 0; -var color = java.awt.Color.yellow; -var row; -var col; -var sameRow = 0; -var sameCol = 0; -var seq; -var hasHiddenRows = this.av.hasHiddenRows (); -var hasHiddenCols = this.av.hasHiddenColumns (); -var hiddenRow = false; -var alignment = this.av.getAlignment (); -for (row = 0; row <= this.sequencesHeight; row++) { -if (Clazz.floatToInt (row * sampleRow) == lastrow) { -sameRow++; -continue; -}hiddenRow = false; -if (hasHiddenRows) { -seq = alignment.getHiddenSequences ().getHiddenSequence (lastrow); -if (seq == null) { -var index = alignment.getHiddenSequences ().findIndexWithoutHiddenSeqs (lastrow); -seq = alignment.getSequenceAt (index); -} else { -hiddenRow = true; -}} else { -seq = alignment.getSequenceAt (lastrow); -}for (col = 0; col < this.$width; col++) { -if (Clazz.floatToInt (col * sampleCol) == lastcol && Clazz.floatToInt (row * sampleRow) == lastrow) { -sameCol++; -continue; -}lastcol = Clazz.floatToInt (col * sampleCol); -if (seq.getLength () > lastcol) { -color = this.sr.getResidueBoxColour (seq, lastcol); -if (this.av.isShowSequenceFeatures ()) { -color = this.fr.findFeatureColour (color, seq, lastcol); -}} else { -color = java.awt.Color.white; -}if (hiddenRow || (hasHiddenCols && !this.av.getColumnSelection ().isVisible (lastcol))) { -color = color.darker ().darker (); -}mg.setColor (color); -if (sameCol == 1 && sameRow == 1) { -mg.drawLine (xstart, ystart, xstart, ystart); -} else { -mg.fillRect (xstart, ystart, sameCol, sameRow); -}xstart = col; -sameCol = 1; -} -lastrow = Clazz.floatToInt (row * sampleRow); -ystart = row; -sameRow = 1; -} -if (this.av.getAlignmentConservationAnnotation () != null) { -for (col = 0; col < this.$width; col++) { -lastcol = Clazz.floatToInt (col * sampleCol); -{ -mg.translate (col, this.sequencesHeight); -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); -mg.translate (-col, -this.sequencesHeight); -}} -}System.gc (); -this.resizing = false; -this.setBoxPosition (); -if (this.resizeAgain) { -this.resizeAgain = false; -this.updateOverviewImage (); -}}); -Clazz.defineMethod (c$, "setBoxPosition", -function () { -var fullsizeWidth = this.av.getAlignment ().getWidth () * this.av.getCharWidth (); -var fullsizeHeight = (this.av.getAlignment ().getHeight () + this.av.getAlignment ().getHiddenSequences ().getSize ()) * this.av.getCharHeight (); -var startRes = this.av.getStartRes (); -var endRes = this.av.getEndRes (); -if (this.av.hasHiddenColumns ()) { -startRes = this.av.getColumnSelection ().adjustForHiddenColumns (startRes); -endRes = this.av.getColumnSelection ().adjustForHiddenColumns (endRes); -}var startSeq = this.av.startSeq; -var endSeq = this.av.endSeq; -if (this.av.hasHiddenRows ()) { -startSeq = this.av.getAlignment ().getHiddenSequences ().adjustForHiddenSeqs (startSeq); -endSeq = this.av.getAlignment ().getHiddenSequences ().adjustForHiddenSeqs (endSeq); -}this.scalew = this.$width / fullsizeWidth; -this.scaleh = this.sequencesHeight / fullsizeHeight; -this.boxX = Clazz.floatToInt (startRes * this.av.getCharWidth () * this.scalew); -this.boxY = Clazz.floatToInt (startSeq * this.av.getCharHeight () * this.scaleh); -if (this.av.hasHiddenColumns ()) { -this.boxWidth = Clazz.floatToInt ((endRes - startRes + 1) * this.av.getCharWidth () * this.scalew); -} else { -this.boxWidth = Clazz.floatToInt ((endRes - startRes + 1) * this.av.getCharWidth () * this.scalew); -}this.boxHeight = Clazz.floatToInt ((endSeq - startSeq) * this.av.getCharHeight () * this.scaleh); -this.repaint (); -}); -Clazz.overrideMethod (c$, "update", -function (g) { -this.paint (g); -}, "java.awt.Graphics"); -Clazz.overrideMethod (c$, "paintComponent", -function (g) { -var og = this.offscreen.getGraphics (); -if (this.miniMe != null) { -og.drawImage (this.miniMe, 0, 0, this); -og.setColor (java.awt.Color.red); -og.drawRect (this.boxX, this.boxY, this.boxWidth, this.boxHeight); -og.drawRect (this.boxX + 1, this.boxY + 1, this.boxWidth - 2, this.boxHeight - 2); -g.drawImage (this.offscreen, 0, 0, this); -}}, "java.awt.Graphics"); -c$.$OverviewPanel$1$ = function () { -Clazz.pu$h (); -c$ = Clazz.declareAnonymous (jalview.appletgui, "OverviewPanel$1", java.awt.event.ComponentAdapter); -Clazz.overrideMethod (c$, "componentResized", -function (evt) { -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) { -this.b$["jalview.appletgui.OverviewPanel"].updateOverviewImage (); -}}, "java.awt.event.ComponentEvent"); -c$ = Clazz.p0p (); -}; -}); +Clazz.declarePackage ("jalview.appletgui"); +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 () { +c$ = Clazz.decorateAsClass (function () { +this.miniMe = null; +this.offscreen = null; +this.av = null; +this.ap = null; +this.scalew = 1; +this.scaleh = 1; +this.$width = 0; +this.sequencesHeight = 0; +this.graphHeight = 20; +this.boxX = -1; +this.boxY = -1; +this.boxWidth = -1; +this.boxHeight = -1; +this.resizing = false; +this.sr = null; +this.fr = null; +this.nullFrame = null; +this.resizeAgain = false; +Clazz.instantialize (this, arguments); +}, jalview.appletgui, "OverviewPanel", awt2swing.Panel, [Runnable, java.awt.event.MouseMotionListener, java.awt.event.MouseListener]); +Clazz.makeConstructor (c$, +function (ap) { +Clazz.superConstructor (this, jalview.appletgui.OverviewPanel, []); +this.av = ap.av; +this.ap = ap; +this.setLayout (null); +this.nullFrame = new awt2swing.Frame (); +this.nullFrame.addNotify (); +this.sr = new jalview.appletgui.SequenceRenderer (this.av); +this.sr.graphics = this.nullFrame.getGraphics (); +this.sr.renderGaps = false; +this.sr.forOverview = true; +this.fr = new jalview.appletgui.FeatureRenderer (this.av); +var initialScale = this.av.getAlignment ().getWidth () / this.av.getAlignment ().getHeight (); +if (this.av.getSequenceConsensusHash () == null) { +this.graphHeight = 0; +}if (this.av.getAlignment ().getWidth () > this.av.getAlignment ().getHeight ()) { +this.$width = 400; +this.sequencesHeight = Clazz.floatToInt (400 / initialScale); +if (this.sequencesHeight < 40) { +this.sequencesHeight = 40; +}} else { +this.$width = Clazz.floatToInt (400 * initialScale); +this.sequencesHeight = 300; +if (this.$width < 120) { +this.$width = 120; +}}this.setSize ( new java.awt.Dimension (this.$width, this.sequencesHeight + this.graphHeight)); +this.addComponentListener (((Clazz.isClassDefined ("jalview.appletgui.OverviewPanel$1") ? 0 : jalview.appletgui.OverviewPanel.$OverviewPanel$1$ ()), Clazz.innerTypeInstance (jalview.appletgui.OverviewPanel$1, this, null))); +this.addMouseMotionListener (this); +this.addMouseListener (this); +this.updateOverviewImage (); +}, "jalview.appletgui.AlignmentPanel"); +Clazz.overrideMethod (c$, "mouseEntered", +function (evt) { +}, "java.awt.event.MouseEvent"); +Clazz.overrideMethod (c$, "mouseExited", +function (evt) { +}, "java.awt.event.MouseEvent"); +Clazz.overrideMethod (c$, "mouseClicked", +function (evt) { +}, "java.awt.event.MouseEvent"); +Clazz.overrideMethod (c$, "mouseMoved", +function (evt) { +}, "java.awt.event.MouseEvent"); +Clazz.overrideMethod (c$, "mousePressed", +function (evt) { +this.boxX = evt.getX (); +this.boxY = evt.getY (); +this.checkValid (); +}, "java.awt.event.MouseEvent"); +Clazz.overrideMethod (c$, "mouseReleased", +function (evt) { +this.boxX = evt.getX (); +this.boxY = evt.getY (); +this.checkValid (); +}, "java.awt.event.MouseEvent"); +Clazz.overrideMethod (c$, "mouseDragged", +function (evt) { +this.boxX = evt.getX (); +this.boxY = evt.getY (); +this.checkValid (); +}, "java.awt.event.MouseEvent"); +Clazz.defineMethod (c$, "checkValid", +function () { +if (this.boxY < 0) { +this.boxY = 0; +}if (this.boxY > (this.sequencesHeight - this.boxHeight)) { +this.boxY = this.sequencesHeight - this.boxHeight + 1; +}if (this.boxX < 0) { +this.boxX = 0; +}if (this.boxX > (this.$width - this.boxWidth)) { +if (this.av.hasHiddenColumns ()) { +this.boxWidth = Clazz.floatToInt ((this.av.endRes - this.av.startRes + 1) * this.av.getCharWidth () * this.scalew); +}this.boxX = this.$width - this.boxWidth; +}var col = Clazz.floatToInt (this.boxX / this.scalew / this.av.getCharWidth ()); +var row = Clazz.floatToInt (this.boxY / this.scaleh / this.av.getCharHeight ()); +if (this.av.hasHiddenColumns ()) { +if (!this.av.getColumnSelection ().isVisible (col)) { +return; +}col = this.av.getColumnSelection ().findColumnPosition (col); +}if (this.av.hasHiddenRows ()) { +row = this.av.getAlignment ().getHiddenSequences ().findIndexWithoutHiddenSeqs (row); +}this.ap.setScrollValues (col, row); +this.ap.paintAlignment (false); +}); +Clazz.defineMethod (c$, "updateOverviewImage", +function () { +if (this.resizing) { +this.resizeAgain = true; +return; +}if (this.av.isShowSequenceFeatures ()) { +this.fr.transferSettings (this.ap.seqPanel.seqCanvas.fr); +}this.resizing = true; +if ((this.getSize ().width > 0) && (this.getSize ().height > 0)) { +this.$width = this.getSize ().width; +this.sequencesHeight = this.getSize ().height - this.graphHeight; +}this.setSize ( new java.awt.Dimension (this.$width, this.sequencesHeight + this.graphHeight)); +var thread = new Thread (this); +thread.start (); +this.repaint (); +}); +Clazz.overrideMethod (c$, "run", +function () { +this.miniMe = null; +var alwidth = this.av.getAlignment ().getWidth (); +var alheight = this.av.getAlignment ().getHeight (); +if (this.av.isShowSequenceFeatures ()) { +this.fr.transferSettings (this.ap.seqPanel.seqCanvas.getFeatureRenderer ()); +}if (this.getSize ().width > 0 && this.getSize ().height > 0) { +this.$width = this.getSize ().width; +this.sequencesHeight = this.getSize ().height - this.graphHeight; +}this.setSize ( new java.awt.Dimension (this.$width, this.sequencesHeight + this.graphHeight)); +var fullsizeWidth = alwidth * this.av.getCharWidth (); +var fullsizeHeight = alheight * this.av.getCharHeight (); +this.scalew = this.$width / fullsizeWidth; +this.scaleh = this.sequencesHeight / fullsizeHeight; +this.miniMe = this.nullFrame.createImage (this.$width, this.sequencesHeight + this.graphHeight); +this.offscreen = this.nullFrame.createImage (this.$width, this.sequencesHeight + this.graphHeight); +var mg = this.miniMe.getGraphics (); +var sampleCol = alwidth / this.$width; +var sampleRow = alheight / this.sequencesHeight; +var lastcol = 0; +var lastrow = 0; +var xstart = 0; +var ystart = 0; +var color = java.awt.Color.yellow; +var row; +var col; +var sameRow = 0; +var sameCol = 0; +var seq; +var hasHiddenRows = this.av.hasHiddenRows (); +var hasHiddenCols = this.av.hasHiddenColumns (); +var hiddenRow = false; +var alignment = this.av.getAlignment (); +for (row = 0; row <= this.sequencesHeight; row++) { +if (Clazz.floatToInt (row * sampleRow) == lastrow) { +sameRow++; +continue; +}hiddenRow = false; +if (hasHiddenRows) { +seq = alignment.getHiddenSequences ().getHiddenSequence (lastrow); +if (seq == null) { +var index = alignment.getHiddenSequences ().findIndexWithoutHiddenSeqs (lastrow); +seq = alignment.getSequenceAt (index); +} else { +hiddenRow = true; +}} else { +seq = alignment.getSequenceAt (lastrow); +}for (col = 0; col < this.$width; col++) { +if (Clazz.floatToInt (col * sampleCol) == lastcol && Clazz.floatToInt (row * sampleRow) == lastrow) { +sameCol++; +continue; +}lastcol = Clazz.floatToInt (col * sampleCol); +if (seq.getLength () > lastcol) { +color = this.sr.getResidueBoxColour (seq, lastcol); +if (this.av.isShowSequenceFeatures ()) { +color = this.fr.findFeatureColour (color, seq, lastcol); +}} else { +color = java.awt.Color.white; +}if (hiddenRow || (hasHiddenCols && !this.av.getColumnSelection ().isVisible (lastcol))) { +color = color.darker ().darker (); +}mg.setColor (color); +if (sameCol == 1 && sameRow == 1) { +mg.drawLine (xstart, ystart, xstart, ystart); +} else { +mg.fillRect (xstart, ystart, sameCol, sameRow); +}xstart = col; +sameCol = 1; +} +lastrow = Clazz.floatToInt (row * sampleRow); +ystart = row; +sameRow = 1; +} +if (this.av.getAlignmentConservationAnnotation () != null) { +for (col = 0; col < this.$width; col++) { +lastcol = Clazz.floatToInt (col * sampleCol); +{ +mg.translate (col, this.sequencesHeight); +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); +mg.translate (-col, -this.sequencesHeight); +}} +}System.gc (); +this.resizing = false; +this.setBoxPosition (); +if (this.resizeAgain) { +this.resizeAgain = false; +this.updateOverviewImage (); +}}); +Clazz.defineMethod (c$, "setBoxPosition", +function () { +var fullsizeWidth = this.av.getAlignment ().getWidth () * this.av.getCharWidth (); +var fullsizeHeight = (this.av.getAlignment ().getHeight () + this.av.getAlignment ().getHiddenSequences ().getSize ()) * this.av.getCharHeight (); +var startRes = this.av.getStartRes (); +var endRes = this.av.getEndRes (); +if (this.av.hasHiddenColumns ()) { +startRes = this.av.getColumnSelection ().adjustForHiddenColumns (startRes); +endRes = this.av.getColumnSelection ().adjustForHiddenColumns (endRes); +}var startSeq = this.av.startSeq; +var endSeq = this.av.endSeq; +if (this.av.hasHiddenRows ()) { +startSeq = this.av.getAlignment ().getHiddenSequences ().adjustForHiddenSeqs (startSeq); +endSeq = this.av.getAlignment ().getHiddenSequences ().adjustForHiddenSeqs (endSeq); +}this.scalew = this.$width / fullsizeWidth; +this.scaleh = this.sequencesHeight / fullsizeHeight; +this.boxX = Clazz.floatToInt (startRes * this.av.getCharWidth () * this.scalew); +this.boxY = Clazz.floatToInt (startSeq * this.av.getCharHeight () * this.scaleh); +if (this.av.hasHiddenColumns ()) { +this.boxWidth = Clazz.floatToInt ((endRes - startRes + 1) * this.av.getCharWidth () * this.scalew); +} else { +this.boxWidth = Clazz.floatToInt ((endRes - startRes + 1) * this.av.getCharWidth () * this.scalew); +}this.boxHeight = Clazz.floatToInt ((endSeq - startSeq) * this.av.getCharHeight () * this.scaleh); +this.repaint (); +}); +Clazz.overrideMethod (c$, "update", +function (g) { +this.paint (g); +}, "java.awt.Graphics"); +Clazz.overrideMethod (c$, "paintComponent", +function (g) { +var og = this.offscreen.getGraphics (); +if (this.miniMe != null) { +og.drawImage (this.miniMe, 0, 0, this); +og.setColor (java.awt.Color.red); +og.drawRect (this.boxX, this.boxY, this.boxWidth, this.boxHeight); +og.drawRect (this.boxX + 1, this.boxY + 1, this.boxWidth - 2, this.boxHeight - 2); +g.drawImage (this.offscreen, 0, 0, this); +}}, "java.awt.Graphics"); +c$.$OverviewPanel$1$ = function () { +Clazz.pu$h (); +c$ = Clazz.declareAnonymous (jalview.appletgui, "OverviewPanel$1", java.awt.event.ComponentAdapter); +Clazz.overrideMethod (c$, "componentResized", +function (evt) { +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) { +this.b$["jalview.appletgui.OverviewPanel"].updateOverviewImage (); +}}, "java.awt.event.ComponentEvent"); +c$ = Clazz.p0p (); +}; +});