public boolean detectCollision(Point p) {
        if (arrowLinkCurve == null)
            return false;
        Rectangle2D rec = getControlPoint(p);
        // flatten the curve and test for intersection (bug fix, fc, 16.1.2004).
        FlatteningPathIterator pi = new FlatteningPathIterator(
                arrowLinkCurve.getPathIterator(null),
                MAXIMAL_RECTANGLE_SIZE_FOR_COLLISION_DETECTION / 4, 10/*
																	 * =maximal
																	 * 2^10=1024
																	 * points.
																	 */);
        double oldCoordinateX = 0, oldCoordinateY = 0;
        while (pi.isDone() == false) {
            double[] coordinates = new double[6];
            int type = pi.currentSegment(coordinates);
            switch (type) {
                case PathIterator.SEG_LINETO:
                    if (rec.intersectsLine(oldCoordinateX, oldCoordinateY,
                            coordinates[0], coordinates[1]))
                        return true;
				/*
				 * this case needs the same action as the next case, thus no
				 * "break"
				 */
                case PathIterator.SEG_MOVETO:
                    oldCoordinateX = coordinates[0];
                    oldCoordinateY = coordinates[1];
                    break;
                case PathIterator.SEG_QUADTO:
                case PathIterator.SEG_CUBICTO:
                case PathIterator.SEG_CLOSE:
                default:
                    break;
            }
            pi.next();
        }
        return false;
    }