Examples of distance()


Examples of java.awt.geom.Point2D.distance()

        Line2D swLine = new Line2D.Double(midEast, oldCrop.getLowerLeft());

        LinkedList<Line2D> lines = new LinkedList<Line2D>();
        lines.add(nwLine);
        lines.add(swLine);
        double oldDiagonalScale = midEast.distance(oldCrop.getUpperLeft());
        double newDiagonalScale = getMinimumDistance(midEast, lines, underlay);
        if (newDiagonalScale < 0) {
            newDiagonalScale = Double.MAX_VALUE;
        }
        lines.clear();
View Full Code Here

Examples of java.awt.geom.Point2D.distance()

            newDiagonalScale = Double.MAX_VALUE;
        }
        lines.clear();
        lines.add(neLine);
        lines.add(seLine);
        double oldEastScale = midEast.distance(oldCrop.getUpperRight());
        double newEastScale = getMinimumDistance(midEast, lines, underlay);
        if (newEastScale < 0) {
            newEastScale = Double.MAX_VALUE;
        }
        double scale = Math.min(
View Full Code Here

Examples of java.awt.geom.Point2D.distance()

        double diagScale = newDiag / oldDiag;

        Point2D sw = oldCrop.getLowerLeft();
        Line2D south = getSouthCropLine(oldCrop);

        double oldSouth = sw.distance(se);
        double newSouth = getMinimumDistance(
            se, Collections.singleton(south), underlay
        );
        double southScale = newSouth / oldSouth;
View Full Code Here

Examples of java.awt.geom.Point2D.distance()

        double northScale = newNorth / oldNorth;

        Point2D sw = oldCrop.getLowerLeft();
        Line2D west = getWestCropLine(oldCrop);

        double oldWest = sw.distance(nw);
        double newWest = getMinimumDistance(
            nw, Collections.singleton(west), underlay
        );
        double westScale = newWest / oldWest;
View Full Code Here

Examples of java.awt.geom.Point2D.distance()

        double diagScale = newDiag / oldDiag;

        Point2D nw = oldCrop.getUpperLeft();
        Line2D north = getNorthCropLine(oldCrop);

        double oldNorth = nw.distance(ne);
        double newNorth = getMinimumDistance(
            ne, Collections.singleton(north), underlay
        );
        double northScale = newNorth / oldNorth;
View Full Code Here

Examples of java.awt.geom.Point2D.distance()

        hoverPoint = cursor;
        showAddIndicator = true;
        hoverStop = null;
        for(MultiGradientFill.Stop stop: getFill().getStops()) {
            Point2D pt = Util.interpolatePoint(getStart(), getEnd(), stop.getPosition());
            if(pt.distance(cursor) < 10) {
                showAddIndicator = false;
                hoverStop = stop;
            }
        }
    }
View Full Code Here

Examples of java.awt.geom.Point2D.distance()

        Point2D end = getEnd();

        //check if starting to drag a stop
        for(MultiGradientFill.Stop stop: getFill().getStops()) {
            Point2D pt = Util.interpolatePoint(start,end,stop.getPosition());
            if(pt.distance(cursor) < 5) {
                onStop = true;
                activeStop = stop;
                return;
            }
        }
View Full Code Here

Examples of java.awt.geom.Point2D.distance()

                draggingStop = true;
            }
        }
        if(onStop) {
            Point2D stopPoint = Util.interpolatePoint(getStart(),getEnd(),activeStop.getPosition());
            double d = stopPoint.distance(cursor);
            if(d > 20) {
                couldDelete = true;
            } else {
                couldDelete = false;
            }
View Full Code Here

Examples of java.awt.geom.Point2D.distance()

            update(constrain);
        }

        private void update(boolean constrain) {
            Point2D center = new Point2D.Double(node.getTranslateX(),node.getTranslateY());
            double radius = center.distance(x,y);
            if(outer) {
                node.setRadius(radius);
            } else {
                node.setInnerRadius(radius);
            }
View Full Code Here

Examples of java.awt.geom.Point2D.distance()

        u.startTimer();
        int transparent = new Color(0,0,0,0).getRGB();
        for(int x=0; x<width; x++) {
            for(int y=0; y<height; y++) {
                Point2D pt = new Point(x,y);
                if(pt.distance(c) > width/2 || pt.distance(c) < width/2-ringWidth) {
                    img.setRGB(x,y,transparent);
                } else {
                    double angle = GeomUtil.calcAngle(c, pt);
                    int color = Color.HSBtoRGB((float) (angle/360f),1,1);
                    img.setRGB(x,y,color);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.