X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FSeqCanvas.java;h=fd74c4a459cfea6a961849aa51f64f761d18a0c0;hb=571d15a897c11bdc2dda76ce03686604596f220d;hp=821136fa448053f3bcf9a0c327dc787aee04efcf;hpb=db93a1adcbe0a4eaaf06e0a70ade0d6c5c1961c3;p=jalview.git diff --git a/src/jalview/appletgui/SeqCanvas.java b/src/jalview/appletgui/SeqCanvas.java index 821136f..fd74c4a 100755 --- a/src/jalview/appletgui/SeqCanvas.java +++ b/src/jalview/appletgui/SeqCanvas.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b2) - * Copyright (C) 2015 The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors * * This file is part of Jalview. * @@ -21,7 +21,7 @@ package jalview.appletgui; import jalview.datamodel.AlignmentI; -import jalview.datamodel.SearchResults; +import jalview.datamodel.SearchResultsI; import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; import jalview.renderer.ScaleRenderer; @@ -50,8 +50,6 @@ public class SeqCanvas extends Panel AlignViewport av; - SearchResults searchResults = null; - boolean fastPaint = false; int cursorX = 0; @@ -218,12 +216,12 @@ public class SeqCanvas extends Panel // Its possible on certain browsers that the call to fastpaint // is faster than it can paint, so this check here catches // this possibility - if (lastsr + horizontal != av.startRes) + if (lastsr + horizontal != av.getStartRes()) { - horizontal = av.startRes - lastsr; + horizontal = av.getStartRes() - lastsr; } - lastsr = av.startRes; + lastsr = av.getStartRes(); fastPaint = true; gg.copyArea(horizontal * avcharWidth, vertical * avcharHeight, imgWidth @@ -231,7 +229,8 @@ public class SeqCanvas extends Panel imgHeight - vertical * avcharHeight, -horizontal * avcharWidth, -vertical * avcharHeight); - int sr = av.startRes, er = av.endRes, ss = av.startSeq, es = av.endSeq, transX = 0, transY = 0; + int sr = av.getStartRes(), er = av.getEndRes(), ss = av.getStartSeq(), es = av + .getEndSeq(), transX = 0, transY = 0; if (horizontal > 0) // scrollbar pulled right, image to the left { @@ -246,9 +245,10 @@ public class SeqCanvas extends Panel else if (vertical > 0) // scroll down { ss = es - vertical; - if (ss < av.startSeq) // ie scrolling too fast, more than a page at a time + if (ss < av.getStartSeq()) // ie scrolling too fast, more than a page at a + // time { - ss = av.startSeq; + ss = av.getStartSeq(); } else { @@ -258,9 +258,9 @@ public class SeqCanvas extends Panel else if (vertical < 0) { es = ss - vertical; - if (es > av.endSeq) + if (es > av.getEndSeq()) { - es = av.endSeq; + es = av.getEndSeq(); } } @@ -333,11 +333,12 @@ public class SeqCanvas extends Panel if (av.getWrapAlignment()) { - drawWrappedPanel(gg, imgWidth, imgHeight, av.startRes); + drawWrappedPanel(gg, imgWidth, imgHeight, av.getStartRes()); } else { - drawPanel(gg, av.startRes, av.endRes, av.startSeq, av.endSeq, 0); + drawPanel(gg, av.getStartRes(), av.getEndRes(), av.getStartSeq(), + av.getEndSeq(), 0); } g.drawImage(img, 0, 0, this); @@ -423,7 +424,7 @@ public class SeqCanvas extends Panel av.setWrappedWidth(cWidth); - av.endRes = av.startRes + cWidth; + av.setEndRes(av.getStartRes() + cWidth); int endx; int ypos = hgap; @@ -632,9 +633,10 @@ public class SeqCanvas extends Panel // / Highlight search Results once all sequences have been drawn // //////////////////////////////////////////////////////// - if (searchResults != null) + if (av.hasSearchResults()) { - int[] visibleResults = searchResults.getResults(nextSeq, startRes, + int[] visibleResults = av.getSearchResults().getResults(nextSeq, + startRes, endRes); if (visibleResults != null) { @@ -843,10 +845,9 @@ public class SeqCanvas extends Panel } } - public void highlightSearchResults(SearchResults results) + public void highlightSearchResults(SearchResultsI results) { - searchResults = results; - + av.setSearchResults(results); repaint(); }