Example usage for com.itextpdf.awt.geom Point2D equals

List of usage examples for com.itextpdf.awt.geom Point2D equals

Introduction

In this page you can find the example usage for com.itextpdf.awt.geom Point2D equals.

Prototype

@Override
    public boolean equals(Object obj) 

Source Link

Usage

From source file:mkl.testarea.itext5.pdfcleanup.PdfCleanUpRegionFilter.java

License:Open Source License

private static List<Point2D> getPathApproximation(Path path) {
    List<Point2D> approx = new ArrayList<Point2D>() {
        @Override/*from  ww  w.ja v  a 2 s  . c  o  m*/
        public boolean addAll(Collection<? extends Point2D> c) {
            Point2D prevPoint = (size() - 1 < 0 ? null : get(size() - 1));
            boolean ret = false;

            for (Point2D pt : c) {
                if (!pt.equals(prevPoint)) {
                    add(pt);
                    prevPoint = pt;
                    ret = true;
                }
            }

            return true;
        }
    };

    for (Subpath subpath : path.getSubpaths()) {
        approx.addAll(subpath.getPiecewiseLinearApproximation());
    }

    return approx;
}