public static Point2D.Double getMaxAndMin(File file) throws Exception {
        double maxX = 0;
        double maxY = 0;
        Scanner scan = new Scanner(file);
        String line;

        Pattern px = Pattern.compile("x\\d?\\w*=\\w*\"(\\d+(:?\\.\\d+)?)\"");
        Pattern py = Pattern.compile("y\\d?\\w*=\\w*\"(\\d+(:?\\.\\d+)?)\"");
        Matcher m;
        while (scan.hasNextLine()) {
            line = scan.nextLine();
            m = px.matcher(line);

            while (m.find()) {
                maxX = Math.max(maxX, Double.parseDouble(m.group(1)));
            }

            m = py.matcher(line);

            while (m.find()) {
                maxY = Math.max(maxY, Double.parseDouble(m.group(1)));
            }
        }

        return new Point2D.Double(maxX, maxY + 20);
    }