Package java.awt.geom

Examples of java.awt.geom.AffineTransform.deltaTransform()


                        at.deltaTransform(new Point2D.Float(x1, y1), null));

                Point2D dst = new Point2D.Double();
                assertEquals(
                        new Point2D.Double(x2, y2),
                        at.deltaTransform(new Point2D.Double(x1, y1), dst));
                assertEquals(
                        new Point2D.Double(x2, y2),
                        dst);
            }
        }
View Full Code Here


    public void testDeltaTransform2() {
        AffineTransform at = new AffineTransform(0, 1, -2, 0, 3, 4);
        double[] src = new double[]{0, 0, 0, 0, 0, 0, 1, 1, 0, 0};
        double[] dst = new double[6];
        double[] expected = new double[]{0, 0, 0, 0, -2, 1};
        at.deltaTransform(src, 4, dst, 2, 2);
        assertEquals(expected, dst, 6, 0.0);
    }

    public void testInversTransform1() {
        try {
View Full Code Here

             * between user and device space.
             * Take the absolute value in case there is negative
             * scaling in effect.
             */
            deviceTransform = getTransform();
            deviceTransform.deltaTransform(penSize, penSize);
            deviceLineWidth = Math.min(Math.abs(penSize.x),
                                       Math.abs(penSize.y));

            /* If the requested line is too thin then map our
             * minimum line width back to user space and set
View Full Code Here

                    /* Convert the minimum line width from device
                     * space to user space.
                     */
                    inverse = deviceTransform.createInverse();
                    inverse.deltaTransform(minPenSize, minPenSize);

                    minLineWidth = Math.max(Math.abs(minPenSize.x),
                                            Math.abs(minPenSize.y));

                    /* Use all of the parameters from the current
View Full Code Here

             */
            Font currentFont = getFont();
            float fontSize = currentFont.getSize2D();

            Point2D.Double pty = new Point2D.Double(0.0, 1.0);
            fontTransform.deltaTransform(pty, pty);
            double scaleFactorY = Math.sqrt(pty.x*pty.x+pty.y*pty.y);
            float scaledFontSizeY = (float)(fontSize * scaleFactorY);

            Point2D.Double pt = new Point2D.Double(1.0, 0.0);
            fontTransform.deltaTransform(pt, pt);
View Full Code Here

            fontTransform.deltaTransform(pty, pty);
            double scaleFactorY = Math.sqrt(pty.x*pty.x+pty.y*pty.y);
            float scaledFontSizeY = (float)(fontSize * scaleFactorY);

            Point2D.Double pt = new Point2D.Double(1.0, 0.0);
            fontTransform.deltaTransform(pt, pt);
            double scaleFactorX = Math.sqrt(pt.x*pt.x+pt.y*pt.y);
            float scaledFontSizeX = (float)(fontSize * scaleFactorX);

            float awScale =(float)(scaleFactorX/scaleFactorY);
            /* don't let rounding errors be interpreted as non-uniform scale */
 
View Full Code Here

         * represent the amount of scaling GDI will be asked
         * to perform.
         */
        Point2D.Float unitVectorX = new Point2D.Float(1, 0);
        Point2D.Float unitVectorY = new Point2D.Float(0, 1);
        fullTransform.deltaTransform(unitVectorX, unitVectorX);
        fullTransform.deltaTransform(unitVectorY, unitVectorY);

        Point2D.Float origin = new Point2D.Float(0, 0);
        double scaleX = unitVectorX.distance(origin);
        double scaleY = unitVectorY.distance(origin);
View Full Code Here

         * to perform.
         */
        Point2D.Float unitVectorX = new Point2D.Float(1, 0);
        Point2D.Float unitVectorY = new Point2D.Float(0, 1);
        fullTransform.deltaTransform(unitVectorX, unitVectorX);
        fullTransform.deltaTransform(unitVectorY, unitVectorY);

        Point2D.Float origin = new Point2D.Float(0, 0);
        double scaleX = unitVectorX.distance(origin);
        double scaleY = unitVectorY.distance(origin);

View Full Code Here

                float lineWidth = lineStroke.getLineWidth();
                Point2D.Float penSize = new Point2D.Float(lineWidth,
                                                          lineWidth);

                deviceTransform.deltaTransform(penSize, penSize);
                float deviceLineWidth = Math.min(Math.abs(penSize.x),
                                                 Math.abs(penSize.y));

                /* transform upper left coordinate */
                Point2D.Float ul_pos = new Point2D.Float(x, y);
View Full Code Here

         * represent the amount of scaling PS will be asked
         * to perform.
         */
        Point2D.Float unitVectorX = new Point2D.Float(1, 0);
        Point2D.Float unitVectorY = new Point2D.Float(0, 1);
        fullTransform.deltaTransform(unitVectorX, unitVectorX);
        fullTransform.deltaTransform(unitVectorY, unitVectorY);

        Point2D.Float origin = new Point2D.Float(0, 0);
        double scaleX = unitVectorX.distance(origin);
        double scaleY = unitVectorY.distance(origin);
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.