git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'develop' into bug/JAL-2346annotationChoice
[jalview.git]
/
src
/
jalview
/
appletgui
/
SeqCanvas.java
diff --git
a/src/jalview/appletgui/SeqCanvas.java
b/src/jalview/appletgui/SeqCanvas.java
index
5d6bb07
..
ed8a46d
100755
(executable)
--- a/
src/jalview/appletgui/SeqCanvas.java
+++ b/
src/jalview/appletgui/SeqCanvas.java
@@
-27,6
+27,7
@@
import jalview.datamodel.SequenceI;
import jalview.renderer.ScaleRenderer;
import jalview.renderer.ScaleRenderer.ScaleMark;
import jalview.viewmodel.AlignmentViewport;
import jalview.renderer.ScaleRenderer;
import jalview.renderer.ScaleRenderer.ScaleMark;
import jalview.viewmodel.AlignmentViewport;
+import jalview.viewmodel.ViewportRanges;
import java.awt.Color;
import java.awt.FontMetrics;
import java.awt.Color;
import java.awt.FontMetrics;
@@
-211,17
+212,19
@@
public class SeqCanvas extends Panel
return;
}
return;
}
+ ViewportRanges ranges = av.getRanges();
+
updateViewport();
// Its possible on certain browsers that the call to fastpaint
// is faster than it can paint, so this check here catches
// this possibility
updateViewport();
// 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 != ranges.getStartRes())
{
{
- horizontal = av.startRes - lastsr;
+ horizontal = ranges.getStartRes() - lastsr;
}
}
- lastsr = av.startRes;
+ lastsr = ranges.getStartRes();
fastPaint = true;
gg.copyArea(horizontal * avcharWidth, vertical * avcharHeight, imgWidth
fastPaint = true;
gg.copyArea(horizontal * avcharWidth, vertical * avcharHeight, imgWidth
@@
-229,7
+232,9
@@
public class SeqCanvas extends Panel
imgHeight - vertical * avcharHeight, -horizontal * avcharWidth,
-vertical * avcharHeight);
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 = ranges.getStartRes(), er = ranges.getEndRes(), ss = ranges
+ .getStartSeq(), es = ranges
+ .getEndSeq(), transX = 0, transY = 0;
if (horizontal > 0) // scrollbar pulled right, image to the left
{
if (horizontal > 0) // scrollbar pulled right, image to the left
{
@@
-244,21
+249,23
@@
public class SeqCanvas extends Panel
else if (vertical > 0) // scroll down
{
ss = es - vertical;
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 < ranges.getStartSeq()) // ie scrolling too fast, more than a page
+ // at a
+ // time
{
{
- ss = av.startSeq;
+ ss = ranges.getStartSeq();
}
else
{
}
else
{
- transY = imgHeight - vertical * avcharHeight;
+ transY = imgHeight - ((vertical + 1) * avcharHeight);
}
}
else if (vertical < 0)
{
es = ss - vertical;
}
}
else if (vertical < 0)
{
es = ss - vertical;
- if (es > av.endSeq)
+ if (es > ranges.getEndSeq())
{
{
- es = av.endSeq;
+ es = ranges.getEndSeq();
}
}
}
}
@@
-329,13
+336,16
@@
public class SeqCanvas extends Panel
gg.setColor(Color.white);
gg.fillRect(0, 0, imgWidth, imgHeight);
gg.setColor(Color.white);
gg.fillRect(0, 0, imgWidth, imgHeight);
+ ViewportRanges ranges = av.getRanges();
+
if (av.getWrapAlignment())
{
if (av.getWrapAlignment())
{
- drawWrappedPanel(gg, imgWidth, imgHeight, av.startRes);
+ drawWrappedPanel(gg, imgWidth, imgHeight, ranges.getStartRes());
}
else
{
}
else
{
- drawPanel(gg, av.startRes, av.endRes, av.startSeq, av.endSeq, 0);
+ drawPanel(gg, ranges.getStartRes(), ranges.getEndRes(),
+ ranges.getStartSeq(), ranges.getEndSeq(), 0);
}
g.drawImage(img, 0, 0, this);
}
g.drawImage(img, 0, 0, this);
@@
-421,7
+431,7
@@
public class SeqCanvas extends Panel
av.setWrappedWidth(cWidth);
av.setWrappedWidth(cWidth);
- av.endRes = av.startRes + cWidth;
+ av.getRanges().setEndRes(av.getRanges().getStartRes() + cWidth);
int endx;
int ypos = hgap;
int endx;
int ypos = hgap;
@@
-610,7
+620,7
@@
public class SeqCanvas extends Panel
// / First draw the sequences
// ///////////////////////////
// / First draw the sequences
// ///////////////////////////
- for (int i = startSeq; i < endSeq; i++)
+ for (int i = startSeq; i <= endSeq; i++)
{
nextSeq = av.getAlignment().getSequenceAt(i);
{
nextSeq = av.getAlignment().getSequenceAt(i);
@@
-625,7
+635,7
@@
public class SeqCanvas extends Panel
if (av.isShowSequenceFeatures())
{
fr.drawSequence(g, nextSeq, startRes, endRes, offset
if (av.isShowSequenceFeatures())
{
fr.drawSequence(g, nextSeq, startRes, endRes, offset
- + ((i - startSeq) * avcharHeight));
+ + ((i - startSeq) * avcharHeight), false);
}
// / Highlight search Results once all sequences have been drawn
}
// / Highlight search Results once all sequences have been drawn
@@
-694,7
+704,7
@@
public class SeqCanvas extends Panel
int bottom = -1;
int alHeight = av.getAlignment().getHeight() - 1;
int bottom = -1;
int alHeight = av.getAlignment().getHeight() - 1;
- for (i = startSeq; i < endSeq; i++)
+ for (i = startSeq; i <= endSeq; i++)
{
sx = (group.getStartRes() - startRes) * avcharWidth;
sy = offset + ((i - startSeq) * avcharHeight);
{
sx = (group.getStartRes() - startRes) * avcharWidth;
sy = offset + ((i - startSeq) * avcharHeight);