if (lineStyle == GraphConstants.STYLE_BEZIER && n > 2) {
bezier = new Bezier(p);
p2 = bezier.getPoint(bezier.getPointCount() - 1);
} else if (lineStyle == GraphConstants.STYLE_SPLINE && n > 2) {
spline = new Spline2D(p);
double[] point = spline.getPoint(0.9875);
// Extrapolate p2 away from the end point, pe, to avoid integer
// rounding errors becoming too large when creating the line end
double scaledX = pe.getX() - ((pe.getX() - point[0]) * 128);
double scaledY = pe.getY() - ((pe.getY() - point[1]) * 128);