g.setStroke(stroke);
g.drawLine(0, middleY, width, middleY);
int upTip = (int) ((float) height * .25);
int downTip = (int) ((float) height * .75);
Polygon poly = null;
if (arrowHeadType == OMArrowHead.ARROWHEAD_DIRECTION_FORWARD
|| arrowHeadType == OMArrowHead.ARROWHEAD_DIRECTION_BOTH) {
int rightWingX = (int) ((float) width * .75);
poly = new Polygon(new int[] { width, rightWingX, rightWingX }, new int[] {
middleY, upTip, downTip }, 3);
g.fill(poly);
g.draw(poly); // Seems to help with rendering problem.
}
if (arrowHeadType == OMArrowHead.ARROWHEAD_DIRECTION_BACKWARD
|| arrowHeadType == OMArrowHead.ARROWHEAD_DIRECTION_BOTH) {
int leftWingX = (int) ((float) width * .25);
poly = new Polygon(new int[] { 0, leftWingX, leftWingX }, new int[] {
middleY, upTip, downTip }, 3);
g.fill(poly);
g.draw(poly); // Seems to help with rendering problem.
}