private void drawArrow(Graphics g, byte style, float x1, float y1, float x2, float y2) {

		arrowWeight = 5 + 2 * lineWeight;

		switch (style) {

		case ArrowRectangle.STYLE1:
			if (polygon == null)
				polygon = new Polygon();
			else polygon.reset();
			arrowx = x1 - x2;
			arrowy = y1 - y2;
			float a = 1.0f / (float) Math.hypot(arrowx, arrowy);
			arrowx *= a;
			arrowy *= a;
			polygon.addPoint((int) (x1 + arrowx * lineWeight), (int) (y1 + arrowy * lineWeight));
			wingx = arrowWeight * (arrowx * COS45 + arrowy * SIN45);
			wingy = arrowWeight * (arrowy * COS45 - arrowx * SIN45);
			polygon.addPoint((int) (x1 - wingx), (int) (y1 - wingy));
			wingx = arrowWeight * (arrowx * COS45 - arrowy * SIN45);
			wingy = arrowWeight * (arrowy * COS45 + arrowx * SIN45);
			polygon.addPoint((int) (x1 - wingx), (int) (y1 - wingy));
			g.fillPolygon(polygon);
			break;

		case ArrowRectangle.STYLE2:
			arrowx = x1 - x2;
			arrowy = y1 - y2;
			a = 1.0f / (float) Math.hypot(arrowx, arrowy);
			arrowx *= a;
			arrowy *= a;
			wingx = arrowWeight * (arrowx * COS45 + arrowy * SIN45);
			wingy = arrowWeight * (arrowy * COS45 - arrowx * SIN45);
			g.drawLine((int) (x1 + arrowx * lineWeight), (int) (y1 + arrowy * lineWeight), (int) (x1 - wingx),
					(int) (y1 - wingy));
			wingx = arrowWeight * (arrowx * COS45 - arrowy * SIN45);
			wingy = arrowWeight * (arrowy * COS45 + arrowx * SIN45);
			g.drawLine((int) (x1 + arrowx * lineWeight), (int) (y1 + arrowy * lineWeight), (int) (x1 - wingx),
					(int) (y1 - wingy));
			break;

		case ArrowRectangle.STYLE3:
			if (polygon == null)
				polygon = new Polygon();
			else polygon.reset();
			polygon.addPoint((int) x1, (int) y1);
			arrowx = x1 - x2;
			arrowy = y1 - y2;
			a = 1.0f / (float) Math.hypot(arrowx, arrowy);
			arrowx *= a;
			arrowy *= a;
			wingx = arrowWeight * (arrowx * COS45 + arrowy * SIN45);
			wingy = arrowWeight * (arrowy * COS45 - arrowx * SIN45);
			polygon.addPoint((int) (x1 - wingx), (int) (y1 - wingy));
			polygon.addPoint((int) (x1 + arrowx * arrowWeight), (int) (y1 + arrowy * arrowWeight));
			wingx = arrowWeight * (arrowx * COS45 - arrowy * SIN45);
			wingy = arrowWeight * (arrowy * COS45 + arrowx * SIN45);
			polygon.addPoint((int) (x1 - wingx), (int) (y1 - wingy));
			g.fillPolygon(polygon);
			break;

		case ArrowRectangle.STYLE4:
			if (polygon == null)
				polygon = new Polygon();
			else polygon.reset();
			arrowx = x1 - x2;
			arrowy = y1 - y2;
			a = 1.0f / (float) Math.hypot(arrowx, arrowy);
			arrowx *= a;
			arrowy *= a;
			x1 += arrowx * lineWeight;
			y1 += arrowy * lineWeight;
			polygon.addPoint((int) x1, (int) y1);
			wingx = arrowWeight * (arrowx * COS45 + arrowy * SIN45);
			wingy = arrowWeight * (arrowy * COS45 - arrowx * SIN45);
			polygon.addPoint((int) (x1 - wingx), (int) (y1 - wingy));
			polygon
					.addPoint((int) (x1 - 1.41421f * arrowx * arrowWeight),
							(int) (y1 - 1.41421f * arrowy * arrowWeight));
			wingx = arrowWeight * (arrowx * COS45 - arrowy * SIN45);
			wingy = arrowWeight * (arrowy * COS45 + arrowx * SIN45);
			polygon.addPoint((int) (x1 - wingx), (int) (y1 - wingy));
			g.fillPolygon(polygon);
			break;

		case ArrowRectangle.STYLE5:
			g.fillOval((int) (x1 - arrowWeight * 0.5f), (int) (y1 - arrowWeight * 0.5f), arrowWeight, arrowWeight);
			break;

		}

	}