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
JAL-4366 JAL-4371 allow cruft after inferred pdb ids, ex 1xyz_A.pdb yields 1xyzA
[jalview.git]
/
src
/
jalview
/
renderer
/
AnnotationRenderer.java
diff --git
a/src/jalview/renderer/AnnotationRenderer.java
b/src/jalview/renderer/AnnotationRenderer.java
index
2380ac9
..
b5dac0d
100644
(file)
--- a/
src/jalview/renderer/AnnotationRenderer.java
+++ b/
src/jalview/renderer/AnnotationRenderer.java
@@
-95,7
+95,7
@@
public class AnnotationRenderer
private boolean av_ignoreGapsConsensus;
private boolean av_ignoreGapsConsensus;
- private boolean vectorRendition = false;
+ private boolean renderingVectors = false;
private boolean glyphLineDrawn = false;
private boolean glyphLineDrawn = false;
@@
-175,7
+175,6
@@
public class AnnotationRenderer
int x, int y, int iconOffset, int startRes, int column,
boolean validRes, boolean validEnd)
{
int x, int y, int iconOffset, int startRes, int column,
boolean validRes, boolean validEnd)
{
- g.setColor(STEM_COLOUR);
int sCol = (lastSSX / charWidth)
+ hiddenColumns.visibleToAbsoluteColumn(startRes);
int x1 = lastSSX;
int sCol = (lastSSX / charWidth)
+ hiddenColumns.visibleToAbsoluteColumn(startRes);
int x1 = lastSSX;
@@
-185,11
+184,19
@@
public class AnnotationRenderer
: row_annotations[column - 1].secondaryStructure;
boolean diffupstream = sCol == 0 || row_annotations[sCol - 1] == null
: row_annotations[column - 1].secondaryStructure;
boolean diffupstream = sCol == 0 || row_annotations[sCol - 1] == null
- || dc != row_annotations[sCol - 1].secondaryStructure;
+ || dc != row_annotations[sCol - 1].secondaryStructure
+ || !validEnd;
boolean diffdownstream = !validRes || !validEnd
|| row_annotations[column] == null
|| dc != row_annotations[column].secondaryStructure;
boolean diffdownstream = !validRes || !validEnd
|| row_annotations[column] == null
|| dc != row_annotations[column].secondaryStructure;
+ if (diffupstream || diffdownstream)
+ {
+ // draw glyphline under arrow
+ drawGlyphLine(g, lastSSX, x, y, iconOffset);
+ }
+ g.setColor(STEM_COLOUR);
+
if (column > 0 && Rna.isClosingParenthesis(dc))
{
if (diffupstream)
if (column > 0 && Rna.isClosingParenthesis(dc))
{
if (diffupstream)
@@
-202,7
+209,8
@@
public class AnnotationRenderer
*/
fillPolygon(g, new int[] { lastSSX + 5, lastSSX + 5, lastSSX },
new int[]
*/
fillPolygon(g, new int[] { lastSSX + 5, lastSSX + 5, lastSSX },
new int[]
- { y + iconOffset, y + 14 + iconOffset, y + 8 + iconOffset },
+ { y + iconOffset + 1, y + 13 + iconOffset,
+ y + 7 + iconOffset },
3);
x1 += 5;
}
3);
x1 += 5;
}
@@
-220,9
+228,10
@@
public class AnnotationRenderer
* if annotation ending with an opeing base pair half of the stem,
* display a forward arrow
*/
* if annotation ending with an opeing base pair half of the stem,
* display a forward arrow
*/
- fillPolygon(g, new int[] { x2 - 5, x2 - 5, x2 },
+ fillPolygon(g, new int[] { x2 - 6, x2 - 6, x2 - 1 },
new int[]
new int[]
- { y + iconOffset, y + 14 + iconOffset, y + 8 + iconOffset },
+ { y + iconOffset + 1, y + 13 + iconOffset,
+ y + 7 + iconOffset },
3);
x2 -= 5;
}
3);
x2 -= 5;
}
@@
-232,7
+241,8
@@
public class AnnotationRenderer
}
}
// draw arrow body
}
}
// draw arrow body
- fillRect(g, x1, y + 4 + iconOffset, x2 - x1, 7);
+ unsetAntialias(g);
+ fillRect(g, x1, y + 4 + iconOffset, x2 - x1, 6);
}
void drawNotCanonicalAnnot(Graphics g, Color nonCanColor,
}
void drawNotCanonicalAnnot(Graphics g, Color nonCanColor,
@@
-251,7
+261,8
@@
public class AnnotationRenderer
: row_annotations[column - 1].displayCharacter;
boolean diffupstream = sCol == 0 || row_annotations[sCol - 1] == null
: row_annotations[column - 1].displayCharacter;
boolean diffupstream = sCol == 0 || row_annotations[sCol - 1] == null
- || !dc.equals(row_annotations[sCol - 1].displayCharacter);
+ || !dc.equals(row_annotations[sCol - 1].displayCharacter)
+ || !validEnd;
boolean diffdownstream = !validRes || !validEnd
|| row_annotations[column] == null
|| !dc.equals(row_annotations[column].displayCharacter);
boolean diffdownstream = !validRes || !validEnd
|| row_annotations[column] == null
|| !dc.equals(row_annotations[column].displayCharacter);
@@
-469,11
+480,9
@@
public class AnnotationRenderer
{
if (g instanceof EpsGraphics2D || g instanceof SVGGraphics2D)
{
{
if (g instanceof EpsGraphics2D || g instanceof SVGGraphics2D)
{
- this.setVectorRendition(true);
+ this.setVectorRendering(true);
}
Graphics2D g2d = (Graphics2D) g;
}
Graphics2D g2d = (Graphics2D) g;
- // flag used for vector rendition
- this.glyphLineDrawn = false;
long stime = System.currentTimeMillis();
boolean usedFaded = false;
long stime = System.currentTimeMillis();
boolean usedFaded = false;
@@
-624,6
+633,9
@@
public class AnnotationRenderer
// first pass sets up state for drawing continuation from left-hand
// column
// of startRes
// first pass sets up state for drawing continuation from left-hand
// column
// of startRes
+
+ // flag used for vector rendition
+ this.glyphLineDrawn = false;
x = (startRes == 0) ? 0 : -1;
while (x < endRes - startRes)
{
x = (startRes == 0) ? 0 : -1;
while (x < endRes - startRes)
{
@@
-910,7
+922,7
@@
public class AnnotationRenderer
// temp = x;
break;
default:
// temp = x;
break;
default:
- if (isVectorRendition())
+ if (isVectorRendering())
{
// draw single full width glyphline
drawGlyphLine(g, lastSSX, endRes - x, y, iconOffset);
{
// draw single full width glyphline
drawGlyphLine(g, lastSSX, endRes - x, y, iconOffset);
@@
-1051,7
+1063,7
@@
public class AnnotationRenderer
x, y, iconOffset, startRes, column, validRes, validEnd);
break;
default:
x, y, iconOffset, startRes, column, validRes, validEnd);
break;
default:
- if (isVectorRendition())
+ if (isVectorRendering())
{
// draw single full width glyphline
drawGlyphLine(g, lastSSX, endRes - x, y, iconOffset);
{
// draw single full width glyphline
drawGlyphLine(g, lastSSX, endRes - x, y, iconOffset);
@@
-1249,7
+1261,7
@@
public class AnnotationRenderer
int x1 = lastSSX;
int x2 = (x * charWidth);
int x1 = lastSSX;
int x2 = (x * charWidth);
- if (USE_FILL_ROUND_RECT || isVectorRendition())
+ if (USE_FILL_ROUND_RECT || isVectorRendering())
{
// draw glyph line behind helix (visible in EPS or SVG output)
drawGlyphLine(g, lastSSX, x, y, iconOffset);
{
// draw glyph line behind helix (visible in EPS or SVG output)
drawGlyphLine(g, lastSSX, x, y, iconOffset);
@@
-1266,7
+1278,6
@@
public class AnnotationRenderer
}
else
{
}
else
{
- // g.setColor(Color.orange);
fillRoundRect(g, lastSSX, y + 3 + iconOffset, x2 - x1 - ofs, 8, 0,
0);
}
fillRoundRect(g, lastSSX, y + 3 + iconOffset, x2 - x1 - ofs, 8, 0,
0);
}
@@
-1277,7
+1288,6
@@
public class AnnotationRenderer
}
else
{
}
else
{
- // g.setColor(Color.magenta);
fillRoundRect(g, lastSSX + ofs, y + 3 + iconOffset, x2 - x1 - ofs,
8, 0, 0);
}
fillRoundRect(g, lastSSX + ofs, y + 3 + iconOffset, x2 - x1 - ofs,
8, 0, 0);
}
@@
-1876,7
+1886,7
@@
public class AnnotationRenderer
private void setAntialias(Graphics g)
{
private void setAntialias(Graphics g)
{
- if (isVectorRendition())
+ if (isVectorRendering())
{
// no need to antialias vector drawings
return;
{
// no need to antialias vector drawings
return;
@@
-1891,7
+1901,7
@@
public class AnnotationRenderer
private void unsetAntialias(Graphics g)
{
private void unsetAntialias(Graphics g)
{
- if (isVectorRendition())
+ if (isVectorRendering())
{
// no need to antialias vector drawings
return;
{
// no need to antialias vector drawings
return;
@@
-1901,13
+1911,13
@@
public class AnnotationRenderer
RenderingHints.VALUE_ANTIALIAS_OFF);
}
RenderingHints.VALUE_ANTIALIAS_OFF);
}
- public void setVectorRendition(boolean b)
+ public void setVectorRendering(boolean b)
{
{
- vectorRendition = b;
+ renderingVectors = b;
}
}
- public boolean isVectorRendition()
+ public boolean isVectorRendering()
{
{
- return vectorRendition;
+ return renderingVectors;
}
}
}
}