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
Replaced image
[jalview.git]
/
src
/
jalview
/
appletgui
/
SequenceRenderer.java
diff --git
a/src/jalview/appletgui/SequenceRenderer.java
b/src/jalview/appletgui/SequenceRenderer.java
index
9dbb05c
..
9103c1d
100755
(executable)
--- a/
src/jalview/appletgui/SequenceRenderer.java
+++ b/
src/jalview/appletgui/SequenceRenderer.java
@@
-40,10
+40,18
@@
public class SequenceRenderer
this.av = av;
\r
}
\r
\r
this.av = av;
\r
}
\r
\r
- public void renderGaps(boolean b)
\r
+ /**
\r
+ * DOCUMENT ME!
\r
+ *
\r
+ * @param b DOCUMENT ME!
\r
+ */
\r
+ public void prepare(Graphics g, boolean renderGaps)
\r
{
\r
{
\r
- renderGaps = b;
\r
- }
\r
+ graphics = g;
\r
+ fm = g.getFontMetrics();
\r
+
\r
+ this.renderGaps = renderGaps;
\r
+ }
\r
\r
public Color getResidueBoxColour(SequenceI seq, int i)
\r
{
\r
\r
public Color getResidueBoxColour(SequenceI seq, int i)
\r
{
\r
@@
-88,18
+96,15
@@
public class SequenceRenderer
return resBoxColour;
\r
}
\r
\r
return resBoxColour;
\r
}
\r
\r
- public void drawSequence(Graphics g, SequenceI seq, SequenceGroup[] sg,
\r
+ public void drawSequence(SequenceI seq, SequenceGroup[] sg,
\r
int start, int end, int y1)
\r
{
\r
allGroups = sg;
\r
\r
int start, int end, int y1)
\r
{
\r
allGroups = sg;
\r
\r
- graphics = g;
\r
-
\r
drawBoxes(seq, start, end, y1);
\r
\r
if(av.validCharWidth)
\r
{
\r
drawBoxes(seq, start, end, y1);
\r
\r
if(av.validCharWidth)
\r
{
\r
- fm = g.getFontMetrics();
\r
drawText(seq, start, end, y1);
\r
}
\r
}
\r
drawText(seq, start, end, y1);
\r
}
\r
}
\r
@@
-241,13
+246,12
@@
public class SequenceRenderer
return false;
\r
}
\r
\r
return false;
\r
}
\r
\r
- public void drawHighlightedText(SequenceI seq, int start, int end, int x1,
\r
- int y1, int width, int height)
\r
+ public void drawHighlightedText(SequenceI seq, int start, int end, int x1, int y1)
\r
{
\r
{
\r
- int pady = height / 5;
\r
+ int pady = av.charHeight / 5;
\r
int charOffset = 0;
\r
graphics.setColor(Color.black);
\r
int charOffset = 0;
\r
graphics.setColor(Color.black);
\r
- graphics.fillRect(x1, y1, width * (end - start + 1), height);
\r
+ graphics.fillRect(x1, y1, av.charWidth * (end - start + 1), av.charHeight);
\r
graphics.setColor(Color.white);
\r
\r
char s = '~';
\r
graphics.setColor(Color.white);
\r
\r
char s = '~';
\r
@@
-261,10
+265,10
@@
public class SequenceRenderer
s = seq.getSequence().charAt(i);
\r
}
\r
\r
s = seq.getSequence().charAt(i);
\r
}
\r
\r
- charOffset = (width - fm.charWidth(s)) / 2;
\r
+ charOffset = (av.charWidth - fm.charWidth(s)) / 2;
\r
graphics.drawString(String.valueOf(s),
\r
graphics.drawString(String.valueOf(s),
\r
- charOffset + x1 + width * (i - start),
\r
- y1 + height - pady);
\r
+ charOffset + x1 + av.charWidth * (i - start),
\r
+ y1 + av.charHeight - pady);
\r
}
\r
}
\r
}
\r
}
\r
}
\r
}
\r