Shape (final Rectangle bounds, Point pointTarget, final BalloonImpl balloon) { pointTarget = new Point(pointTarget.x, Math.min(bounds.y, pointTarget.y)); final Shaper shaper = new Shaper(balloon, bounds, pointTarget, SwingConstants.TOP); shaper.line(balloon.getPointerWidth(this) / 2, balloon.getPointerLength(this)).toRightCurve().roundRightDown().toBottomCurve() .roundLeftDown() .toLeftCurve().roundLeftUp().toTopCurve().roundUpRight() .lineTo(pointTarget.x - balloon.getPointerWidth(this) / 2, shaper.getCurrent().y).lineTo(pointTarget.x, pointTarget.y); shaper.close(); return shaper.getShape(); }