/** * Utility method for creating an ExtendedGeneralPath. * * @param text The text representation of the path specification. * @param wr The winding rule to use for creating the path. */ public static Shape createShape(String text, int wr) throws ParseException { AWTPolygonProducer ph = new AWTPolygonProducer(); ph.setWindingRule(wr); PointsParser p = new PointsParser(ph); p.parse(text); return ph.getShape(); }
public static void main(String args[]) { Path pathToFile = null; try { pathToFile = Paths.get(args[0]); } catch (ArrayIndexOutOfBoundsException e) { printHelp(); System.exit(1); } List<Point> points = null; try { points = PointsParser.FromFileToArrayList(pathToFile); } catch (Exception e) { System.out.println(e.getMessage()); System.exit(1); } double min = Point.getMinimalDistanceOfPoints(points); System.out.println((int) Math.round(min)); }