Arrow Location on Stroke

If I change a Link’s stroke and add to arrow heads and adjust the arrowWidth,arrowHeight and arrowShaftLength to a larger number, the arrow is painted over by the stroke. Any clues on how to get around this?

Actually, the arrowhead is drawn after the stroke, so it appears on top. If you specify a brush for the stroke, it will fill the arrowhead with that brush, thereby hiding the end of the stroke underneath the arrowhead.

Actually this is what I am talking about (Picture are worth 1000 words). Notice how the Stroke is messing up the arrow.

Ah, that’s a flaw of JGoStroke. If you just have the case where there are only two points in the stroke (i.e. one straight segment), you can modify JGoStroke.paint as follows:
public void paint(Graphics2D g, JGoView view)
{
JGoPen pen = getPen();
if (pen == null || pen.getStyle() == JGoPen.NONE)
return;
int npoints = getNumPoints();
JGoPen highlight = getHighlight();
if (highlight != null && highlight.getStyle() != JGoPen.NONE) {
if (npoints == 2) {
Point frompnt = getPoint(0);
Point topnt = getPoint(1);
int tox = topnt.x;
int toy = topnt.y;
if (hasArrowAtEnd() && getArrowShaftLength() > 0) {
if (myArrowInfo == null)
myArrowInfo = new ArrowInfo();
int[] headx = myArrowInfo.getXs();
int[] heady = myArrowInfo.getYs();
calculateFilledArrowhead(frompnt.x, frompnt.y, topnt.x, topnt.y, 1, headx, heady);
tox = headx[0];
toy = heady[0];
}
drawLine(g, highlight, frompnt.x, frompnt.y, tox, toy);
} else {
drawPath(g, highlight, null, getPath(view));
}
}
if (npoints == 2) {
Point frompnt = getPoint(0);
Point topnt = getPoint(1);
int tox = topnt.x;
int toy = topnt.y;
if (hasArrowAtEnd() && getArrowShaftLength() > 0) {
if (myArrowInfo == null)
myArrowInfo = new ArrowInfo();
int[] headx = myArrowInfo.getXs();
int[] heady = myArrowInfo.getYs();
calculateFilledArrowhead(frompnt.x, frompnt.y, topnt.x, topnt.y, 1, headx, heady);
tox = headx[0];
toy = heady[0];
}
drawLine(g, pen, frompnt.x, frompnt.y, tox, toy);
} else {
drawPath(g, pen, null, getPath(view));
}
drawArrowHeads(g);
}

No I am also using setCubic(true)… :) sorry

OK, so the fix is somewhat more complicated. I’ll see if we can do this for 5.2.

Thanks, all help is appreciated.