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
set gap char modified
[jalview.git]
/
src
/
jalview
/
gui
/
SequenceRenderer.java
diff --git
a/src/jalview/gui/SequenceRenderer.java
b/src/jalview/gui/SequenceRenderer.java
index
69db54d
..
54785ef
100755
(executable)
--- a/
src/jalview/gui/SequenceRenderer.java
+++ b/
src/jalview/gui/SequenceRenderer.java
@@
-35,7
+35,7
@@
public class SequenceRenderer implements RendererI
void getBoxColour(ColourSchemeI cs, SequenceI seq, int i)
\r
{
\r
if (cs != null)
\r
void getBoxColour(ColourSchemeI cs, SequenceI seq, int i)
\r
{
\r
if (cs != null)
\r
- resBoxColour = cs.findColour(seq.getSequence(i, i + 1), i, av.getConsensus(false));
\r
+ resBoxColour = cs.findColour(seq.getSequence(i, i + 1), i);
\r
else
\r
resBoxColour = Color.white;
\r
}
\r
else
\r
resBoxColour = Color.white;
\r
}
\r
@@
-46,18
+46,18
@@
public class SequenceRenderer implements RendererI
\r
graphics = g;
\r
\r
\r
graphics = g;
\r
\r
- drawBoxes(seq, start, end, x1, y1, (int) width, height, pid);
\r
+ drawBoxes(seq, start, end, x1, y1, (int) width, height);
\r
\r
fm = g.getFontMetrics();
\r
drawText(seq,start,end,x1,y1,(int)width,height);
\r
\r
}
\r
\r
\r
fm = g.getFontMetrics();
\r
drawText(seq,start,end,x1,y1,(int)width,height);
\r
\r
}
\r
\r
- public void drawBoxes(SequenceI seq,int start, int end, int x1, int y1, int width, int height,Vector freq) {
\r
+ public void drawBoxes(SequenceI seq,int start, int end, int x1, int y1, int width, int height) {
\r
int i = start;
\r
int length = seq.getLength();
\r
\r
int i = start;
\r
int length = seq.getLength();
\r
\r
- int curStart = x1;
\r
+ int curStart = -1;
\r
int curWidth = width;
\r
\r
Color tempColour = null;
\r
int curWidth = width;
\r
\r
Color tempColour = null;
\r
@@
-76,7
+76,8
@@
public class SequenceRenderer implements RendererI
\r
if (resBoxColour != tempColour)
\r
{
\r
\r
if (resBoxColour != tempColour)
\r
{
\r
- graphics.fillRect(x1+width*(curStart-start),y1,curWidth,height);
\r
+ if(tempColour!=null)
\r
+ graphics.fillRect(x1+width*(curStart-start),y1,curWidth,height);
\r
graphics.setColor(resBoxColour);
\r
\r
curStart = i;
\r
graphics.setColor(resBoxColour);
\r
\r
curStart = i;
\r
@@
-89,7
+90,9
@@
public class SequenceRenderer implements RendererI
\r
i++;
\r
}
\r
\r
i++;
\r
}
\r
- graphics.fillRect(x1+width*(curStart-start),y1,curWidth,height);
\r
+
\r
+
\r
+ graphics.fillRect(x1+width*(curStart-start),y1,curWidth,height);
\r
}
\r
\r
public void drawText(SequenceI seq,int start, int end, int x1, int y1, int width, int height)
\r
}
\r
\r
public void drawText(SequenceI seq,int start, int end, int x1, int y1, int width, int height)
\r
@@
-98,17
+101,19
@@
public class SequenceRenderer implements RendererI
int charOffset=0;
\r
char s;
\r
// Need to find the sequence position here.
\r
int charOffset=0;
\r
char s;
\r
// Need to find the sequence position here.
\r
+
\r
+ graphics.setColor(Color.black);
\r
+ String sequence = seq.getSequence();
\r
for (int i = start; i <= end; i++)
\r
{
\r
for (int i = start; i <= end; i++)
\r
{
\r
- if(i<seq.getLength())
\r
- s = seq.getSequence().charAt(i);
\r
+ if(i<sequence.length())
\r
+ s = sequence.charAt(i);
\r
else
\r
s = ' ';
\r
\r
if(!renderGaps && jalview.util.Comparison.isGap(s))
\r
continue;
\r
\r
else
\r
s = ' ';
\r
\r
if(!renderGaps && jalview.util.Comparison.isGap(s))
\r
continue;
\r
\r
- graphics.setColor(Color.black);
\r
\r
if (inCurrentSequenceGroup(i))
\r
{
\r
\r
if (inCurrentSequenceGroup(i))
\r
{
\r
@@
-129,13
+134,18
@@
public class SequenceRenderer implements RendererI
if(av.getColourText())
\r
{
\r
getBoxColour(av.getGlobalColourScheme(), seq, i);
\r
if(av.getColourText())
\r
{
\r
getBoxColour(av.getGlobalColourScheme(), seq, i);
\r
- graphics.setColor(resBoxColour.darker());
\r
+ if(av.getShowBoxes())
\r
+ graphics.setColor(resBoxColour.darker());
\r
+ else
\r
+ graphics.setColor(resBoxColour);
\r
}
\r
}
\r
\r
}
\r
}
\r
\r
- charOffset = (width - fm.charWidth(s))/2;
\r
- graphics.drawString(String.valueOf(s), charOffset + x1 + width * (i - start), y1 + height - pady);
\r
- }
\r
+ charOffset = (width - fm.charWidth(s))/2;
\r
+ graphics.drawString(String.valueOf(s),
\r
+ charOffset + x1 + width * (i - start),
\r
+ y1 + height - pady);
\r
+ }
\r
\r
\r
}
\r
\r
\r
}
\r
@@
-170,7
+180,7
@@
public class SequenceRenderer implements RendererI
if(i<seq.getLength())
\r
s = seq.getSequence().charAt(i);
\r
\r
if(i<seq.getLength())
\r
s = seq.getSequence().charAt(i);
\r
\r
- charOffset = (width - fm.charWidth(s))/2;
\r
+ charOffset = (width - fm.charWidth(s))/2;
\r
graphics.drawString(String.valueOf(s), charOffset + x1 + width * (i - start), y1 + height - pady);
\r
}
\r
}
\r
graphics.drawString(String.valueOf(s), charOffset + x1 + width * (i - start), y1 + height - pady);
\r
}
\r
}
\r