Package java.awt.geom

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


     */
    private Point2D getUnitDirection() {
        Location dLoc = destination_.getLocation();
        Point2D unitVec =
                new Point2D.Double(dLoc.getCol() - currentLocation_.getX(), dLoc.getRow() - currentLocation_.getY());
        double dist = unitVec.distance(new Point2D.Double(0, 0));
        unitVec.setLocation(unitVec.getX()/dist, unitVec.getY()/dist);
        return unitVec;
    }

    public Point2D getCurrentLocation() {
View Full Code Here


                gen.writeln(gen.formatDouble4(offset) + " setdash");
                */
                Point2D ptLen = new Point2D.Double(patternLen, 0);
                //interpret as absolute length
                getTransform().deltaTransform(ptLen, ptLen);
                double transLen = UnitConv.pt2mm(ptLen.distance(0, 0));
                gen.writeText("LT1," + gen.formatDouble4(transLen) + ",1;");
            } else {
                gen.writeText("LT;");
            }

View Full Code Here

           
            float lw = bs.getLineWidth();
            Point2D ptSrc = new Point2D.Double(lw, 0);
            //Pen widths are set as absolute metric values (WU0;)
            Point2D ptDest = getTransform().deltaTransform(ptSrc, null);
            double transDist = UnitConv.pt2mm(ptDest.distance(0, 0));
            //System.out.println("--" + ptDest.distance(0, 0) + " " + transDist);
            gen.writeText(";PW" + gen.formatDouble4(transDist) + ";");
           
        } else {
            handleUnsupportedFeature("Unsupported Stroke: " + stroke.getClass().getName());
View Full Code Here

                gen.writeln(gen.formatDouble4(offset) + " setdash");
                */
                Point2D ptLen = new Point2D.Double(patternLen, 0);
                //interpret as absolute length
                getTransform().deltaTransform(ptLen, ptLen);
                double transLen = UnitConv.pt2mm(ptLen.distance(0, 0));
                gen.writeText("LT1," + gen.formatDouble4(transLen) + ",1;");
            } else {
                gen.writeText("LT;");
            }

View Full Code Here

            float lw = bs.getLineWidth();
            Point2D ptSrc = new Point2D.Double(lw, 0);
            //Pen widths are set as absolute metric values (WU0;)
            Point2D ptDest = getTransform().deltaTransform(ptSrc, null);
            double transDist = UnitConv.pt2mm(ptDest.distance(0, 0));
            //System.out.println("--" + ptDest.distance(0, 0) + " " + transDist);
            gen.writeText(";PW" + gen.formatDouble4(transDist) + ";");

        } else {
            handleUnsupportedFeature("Unsupported Stroke: " + stroke.getClass().getName());
View Full Code Here

                gen.writeln(gen.formatDouble4(offset) + " setdash");
                */
                Point2D ptLen = new Point2D.Double(patternLen, 0);
                //interpret as absolute length
                getTransform().deltaTransform(ptLen, ptLen);
                double transLen = UnitConv.pt2mm(ptLen.distance(0, 0));
                gen.writeText("LT1," + gen.formatDouble4(transLen) + ",1;");
            } else {
                gen.writeText("LT;");
            }

View Full Code Here

            float lw = bs.getLineWidth();
            Point2D ptSrc = new Point2D.Double(lw, 0);
            //Pen widths are set as absolute metric values (WU0;)
            Point2D ptDest = getTransform().deltaTransform(ptSrc, null);
            double transDist = UnitConv.pt2mm(ptDest.distance(0, 0));
            //System.out.println("--" + ptDest.distance(0, 0) + " " + transDist);
            gen.writeText(";PW" + gen.formatDouble4(transDist) + ";");

        } else {
            handleUnsupportedFeature("Unsupported Stroke: " + stroke.getClass().getName());
View Full Code Here

                gen.writeln(gen.formatDouble4(offset) + " setdash");
                */
                Point2D ptLen = new Point2D.Double(patternLen, 0);
                //interpret as absolute length
                getTransform().deltaTransform(ptLen, ptLen);
                double transLen = UnitConv.pt2mm(ptLen.distance(0, 0));
                gen.writeText("LT1," + gen.formatDouble4(transLen) + ",1;");
            } else {
                gen.writeText("LT;");
            }

View Full Code Here

           
            float lw = bs.getLineWidth();
            Point2D ptSrc = new Point2D.Double(lw, 0);
            //Pen widths are set as absolute metric values (WU0;)
            Point2D ptDest = getTransform().deltaTransform(ptSrc, null);
            double transDist = UnitConv.pt2mm(ptDest.distance(0, 0));
            //System.out.println("--" + ptDest.distance(0, 0) + " " + transDist);
            gen.writeText(";PW" + gen.formatDouble4(transDist) + ";");
           
        } else {
            handleUnsupportedFeature("Unsupported Stroke: " + stroke.getClass().getName());
View Full Code Here

            do {
              retry = false;
              for( int j = 0; j < coll3.size(); j++ ) {
                rcv2 = (Receiver) coll3.get( j );
                pt = rcv.getAnchor();
                if( pt.distance( rcv2.getAnchor() ) < 0.05 ) {
                  pt2 = new Point2D.Double( Math.min( 1.0, pt.getX() + 0.05 ),
                                Math.min( 1.0, pt.getY() + 0.05 ));
                  rcv.setAnchor( pt2 );
                  if( pt2.distance( pt ) > 0.05 ) retry = true;
                }
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.