public Point2D.Double findEnd(ConnectionFigure connection) { Figure endFigure = connection.getEndConnector().getOwner(); Point2D.Double from; if (connection.getPointCount() <= 2 || connection.getLiner() != null) { if (connection.getStartConnector() == null) { from = connection.getStartPoint(); } else { Rectangle2D.Double r1 = getConnectorTarget(connection.getStartConnector().getOwner()).getBounds(); from = new Point2D.Double(r1.x + r1.width / 2, r1.y + r1.height / 2); } } else { from = connection.getPoint(connection.getPointCount() - 2); } return chop(endFigure, from); }