git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1858fc1
)
Drawpanel needs fewer args
author
amwaterhouse
<Andrew Waterhouse>
Fri, 24 Feb 2006 11:37:13 +0000
(11:37 +0000)
committer
amwaterhouse
<Andrew Waterhouse>
Fri, 24 Feb 2006 11:37:13 +0000
(11:37 +0000)
src/jalview/appletgui/SeqCanvas.java
patch
|
blob
|
history
diff --git
a/src/jalview/appletgui/SeqCanvas.java
b/src/jalview/appletgui/SeqCanvas.java
index
618ec8a
..
ac5ff89
100755
(executable)
--- a/
src/jalview/appletgui/SeqCanvas.java
+++ b/
src/jalview/appletgui/SeqCanvas.java
@@
-204,7
+204,7
@@
public class SeqCanvas
\r
gg.translate(transX, transY);
\r
\r
\r
gg.translate(transX, transY);
\r
\r
- drawPanel(gg, sr, er, ss, es, sr, ss, 0);
\r
+ drawPanel(gg, sr, er, ss, es, 0);
\r
gg.translate( -transX, -transY);
\r
\r
repaint();
\r
gg.translate( -transX, -transY);
\r
\r
repaint();
\r
@@
-266,8
+266,7
@@
public class SeqCanvas
}
\r
else
\r
{
\r
}
\r
else
\r
{
\r
- drawPanel(gg, av.startRes, av.endRes, av.startSeq, av.endSeq, av.startRes,
\r
- av.startSeq, 0);
\r
+ drawPanel(gg, av.startRes, av.endRes, av.startSeq, av.endSeq, 0);
\r
}
\r
\r
g.drawImage(img, 0, 0, this);
\r
}
\r
\r
g.drawImage(img, 0, 0, this);
\r
@@
-384,7
+383,7
@@
public class SeqCanvas
if(g.getClip()==null)
\r
g.setClip(0, 0, cWidth * av.charWidth, canvasHeight);
\r
\r
if(g.getClip()==null)
\r
g.setClip(0, 0, cWidth * av.charWidth, canvasHeight);
\r
\r
- drawPanel(g, startRes, endx, 0, al.getHeight(), startRes, 0, ypos);
\r
+ drawPanel(g, startRes, endx, 0, al.getHeight(), ypos);
\r
g.setClip(null);
\r
\r
\r
g.setClip(null);
\r
\r
\r
@@
-425,8
+424,7
@@
public class SeqCanvas
return annotations.adjustPanelHeight();
\r
}
\r
\r
return annotations.adjustPanelHeight();
\r
}
\r
\r
- synchronized public void drawPanel(Graphics g, int x1, int x2, int y1, int y2,
\r
- int startx, int starty, int offset)
\r
+ synchronized public void drawPanel(Graphics g, int startRes, int endRes, int startSeq, int endSeq, int offset)
\r
{
\r
\r
g.setFont(av.getFont());
\r
{
\r
\r
g.setFont(av.getFont());
\r
@@
-435,36
+433,34
@@
public class SeqCanvas
SequenceI nextSeq;
\r
/// First draw the sequences
\r
/////////////////////////////
\r
SequenceI nextSeq;
\r
/// First draw the sequences
\r
/////////////////////////////
\r
- for (int i = y1; i < y2; i++)
\r
+ for (int i = startSeq; i < endSeq; i++)
\r
{
\r
nextSeq = av.alignment.getSequenceAt(i);
\r
\r
{
\r
nextSeq = av.alignment.getSequenceAt(i);
\r
\r
- sr.drawSequence(g, nextSeq, av.alignment.findAllGroups(nextSeq), x1, x2,
\r
- (x1 - startx) * av.charWidth,
\r
+ sr.drawSequence(g, nextSeq, av.alignment.findAllGroups(nextSeq), startRes, endRes,
\r
+ (startRes - startRes) * av.charWidth,
\r
offset +
\r
offset +
\r
- (i - starty) * av.charHeight,
\r
+ (i - startSeq) * av.charHeight,
\r
av.charWidth, av.charHeight);
\r
\r
if (av.showSequenceFeatures)
\r
{
\r
av.charWidth, av.charHeight);
\r
\r
if (av.showSequenceFeatures)
\r
{
\r
- fr.drawSequence(g, nextSeq, x1, x2,
\r
- (x1 - startx) * av.charWidth,
\r
- offset +
\r
- (i - starty) * av.charHeight,
\r
+ fr.drawSequence(g, nextSeq, startRes, endRes,
\r
+ offset +(i - startSeq) * av.charHeight,
\r
av.charWidth, av.charHeight);
\r
}
\r
/// Highlight search Results once all sequences have been drawn
\r
//////////////////////////////////////////////////////////
\r
if (searchResults != null)
\r
{
\r
av.charWidth, av.charHeight);
\r
}
\r
/// Highlight search Results once all sequences have been drawn
\r
//////////////////////////////////////////////////////////
\r
if (searchResults != null)
\r
{
\r
- int[] visibleResults = searchResults.getResults(nextSeq, x1, x2);
\r
+ int[] visibleResults = searchResults.getResults(nextSeq, startRes, endRes);
\r
if (visibleResults != null)
\r
for (int r = 0; r < visibleResults.length; r += 2)
\r
{
\r
sr.drawHighlightedText(nextSeq, visibleResults[r],
\r
visibleResults[r + 1],
\r
if (visibleResults != null)
\r
for (int r = 0; r < visibleResults.length; r += 2)
\r
{
\r
sr.drawHighlightedText(nextSeq, visibleResults[r],
\r
visibleResults[r + 1],
\r
- (visibleResults[r] - startx) * av.charWidth,
\r
- offset + ( (i - starty) * av.charHeight),
\r
+ (visibleResults[r] - startRes) * av.charWidth,
\r
+ offset + ( (i - startSeq) * av.charHeight),
\r
av.charWidth, av.charHeight);
\r
}
\r
}
\r
av.charWidth, av.charHeight);
\r
}
\r
}
\r
@@
-494,10
+490,10
@@
public class SeqCanvas
int top = -1;
\r
int bottom = -1;
\r
\r
int top = -1;
\r
int bottom = -1;
\r
\r
- for (i = y1; i < y2; i++)
\r
+ for (i = startSeq; i < endSeq; i++)
\r
{
\r
{
\r
- sx = (group.getStartRes() - startx) * av.charWidth;
\r
- sy = offset + ((i - starty) * av.charHeight);
\r
+ sx = (group.getStartRes() - startRes) * av.charWidth;
\r
+ sy = offset + ((i - startSeq) * av.charHeight);
\r
ex = (((group.getEndRes() + 1) - group.getStartRes()) * av.charWidth) -
\r
1;
\r
\r
ex = (((group.getEndRes() + 1) - group.getStartRes()) * av.charWidth) -
\r
1;
\r
\r
@@
-506,14
+502,14
@@
public class SeqCanvas
continue;
\r
}
\r
\r
continue;
\r
}
\r
\r
- if ( (sx <= (x2-x1)*av.charWidth) &&
\r
+ if ( (sx <= (endRes-startRes)*av.charWidth) &&
\r
group.sequences.contains(av.alignment.getSequenceAt(
\r
i)))
\r
{
\r
\r
if (bottom == -1)
\r
{
\r
group.sequences.contains(av.alignment.getSequenceAt(
\r
i)))
\r
{
\r
\r
if (bottom == -1)
\r
{
\r
- if(i == y2-1 || // Dont check for i+1 if on the bottom row
\r
+ if(i == endSeq-1 || // Dont check for i+1 if on the bottom row
\r
!group.sequences.contains(av.alignment.getSequenceAt(i+1 )))
\r
\r
bottom = sy + av.charHeight;
\r
!group.sequences.contains(av.alignment.getSequenceAt(i+1 )))
\r
\r
bottom = sy + av.charHeight;
\r
@@
-561,8
+557,8
@@
public class SeqCanvas
if (sx + ex > imgWidth)
\r
ex = imgWidth;
\r
\r
if (sx + ex > imgWidth)
\r
ex = imgWidth;
\r
\r
- else if (sx + ex >= (x2 - x1 + 1) * av.charWidth)
\r
- ex = (x2 - x1 + 1) * av.charWidth;
\r
+ else if (sx + ex >= (endRes - startRes + 1) * av.charWidth)
\r
+ ex = (endRes - startRes + 1) * av.charWidth;
\r
\r
if (top != -1)
\r
{
\r
\r
if (top != -1)
\r
{
\r
@@
-583,7
+579,7
@@
public class SeqCanvas
\r
if (inGroup)
\r
{
\r
\r
if (inGroup)
\r
{
\r
- sy = offset + ( (i - starty) * av.charHeight);
\r
+ sy = offset + ( (i - startSeq) * av.charHeight);
\r
if (sx >= 0 && sx < imgWidth)
\r
g.drawLine(sx, oldY, sx, sy);
\r
\r
if (sx >= 0 && sx < imgWidth)
\r
g.drawLine(sx, oldY, sx, sy);
\r
\r
@@
-598,8
+594,8
@@
public class SeqCanvas
\r
if (sx + ex > imgWidth)
\r
ex = imgWidth;
\r
\r
if (sx + ex > imgWidth)
\r
ex = imgWidth;
\r
- else if (sx + ex >= (x2 - x1 + 1) * av.charWidth)
\r
- ex = (x2 - x1 + 1) * av.charWidth;
\r
+ else if (sx + ex >= (endRes - startRes + 1) * av.charWidth)
\r
+ ex = (endRes - startRes + 1) * av.charWidth;
\r
\r
if (top != -1)
\r
{
\r
\r
if (top != -1)
\r
{
\r