Package com.google.code.appengine.awt.geom

Examples of com.google.code.appengine.awt.geom.AffineTransform.createTransformedShape()


        // if s == null the clip is reset to the imageBounds
        if (s == null && imageBounds != null) {
            s = new Rectangle(imageBounds);
            AffineTransform at = getTransform();
            if (at != null) {
                s = at.createTransformedShape(s);
            }
        }

        writePath(s);
        os.writeTag(new SelectClipPath(EMFConstants.RGN_COPY));
View Full Code Here


        } else if (vertical == TEXT_BOTTOM) {
            at.translate(0, - bounds.getHeight() - bounds.getY());
        }

        // transform the bounds
        bounds = at.createTransformedShape(bounds).getBounds2D();
        // create the result with the same transformation
        Point2D result = at.transform(new Point2D.Double(0, 0), new Point2D.Double());

        // space between string and border
        double adjustment = (getFont().getSize2D() * 2) / 10;
View Full Code Here

        at.translate(anchor.getX(), anchor.getY());
        at.scale(
                anchor.getWidth()/bounds.getWidth(),
                anchor.getHeight()/bounds.getHeight()
        );
        return at.createTransformedShape(path);
    }
}
View Full Code Here

                tx.translate(exterior.getX(), exterior.getY());
                tx.scale(scaleX, scaleY);
                tx.translate(-interior.getX(), -interior.getY());
            }
            anchor = tx.createTransformedShape(anchor).getBounds2D();
        }

        int angle = getRotation();
        if(angle != 0){
            double centerX = anchor.getX() + anchor.getWidth()/2;
View Full Code Here

            AffineTransform trans = new AffineTransform();
            trans.translate(centerX, centerY);
            trans.rotate(Math.toRadians(angle));
            trans.translate(-centerX, -centerY);

            Rectangle2D rect = trans.createTransformedShape(anchor).getBounds2D();
            if((anchor.getWidth() < anchor.getHeight() && rect.getWidth() > rect.getHeight()) ||
                (anchor.getWidth() > anchor.getHeight() && rect.getWidth() < rect.getHeight())    ){
                trans = new AffineTransform();
                trans.translate(centerX, centerY);
                trans.rotate(Math.PI/2);
View Full Code Here

                (anchor.getWidth() > anchor.getHeight() && rect.getWidth() < rect.getHeight())    ){
                trans = new AffineTransform();
                trans.translate(centerX, centerY);
                trans.rotate(Math.PI/2);
                trans.translate(-centerX, -centerY);
                anchor = trans.createTransformedShape(anchor).getBounds2D();
            }
        }
        return anchor;
    }
View Full Code Here

    public abstract FontRenderContext getFontRenderContext();

    public Shape getGlyphOutline(int glyphIndex, float x, float y) {
        Shape initialShape = getGlyphOutline(glyphIndex);
        AffineTransform trans = AffineTransform.getTranslateInstance(x, y);
        return trans.createTransformedShape(initialShape);
    }

    public abstract Shape getGlyphVisualBounds(int glyphIndex);

    public abstract Shape getGlyphOutline(int glyphIndex);
View Full Code Here

    public void draw(Graphics2D g2, float x, float y) {
        AffineTransform at = AffineTransform.getTranslateInstance(x, y);
        if (fStroke == STROKE){
            Stroke oldStroke = g2.getStroke();
            g2.setStroke(new BasicStroke());
            g2.draw(at.createTransformedShape(fShape));
            g2.setStroke(oldStroke);
        } else {
            g2.fill(at.createTransformedShape(fShape));
        }
View Full Code Here

            Stroke oldStroke = g2.getStroke();
            g2.setStroke(new BasicStroke());
            g2.draw(at.createTransformedShape(fShape));
            g2.setStroke(oldStroke);
        } else {
            g2.fill(at.createTransformedShape(fShape));
        }

    }

    @Override
View Full Code Here

                    (oldBounds.getHeight() - witdh)
                        / oldBounds.getHeight());
            }

            // recalculate shape and its oldBounds
            shape = at.createTransformedShape(shape);
            Rectangle2D newBounds = shape.getBounds2D();

            // move the shape to the old origin + the line width offset
            AffineTransform moveBackTransform = AffineTransform.getTranslateInstance(
                oldBounds.getX() - newBounds.getX() + witdh / 2,
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.