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

Examples of com.google.code.appengine.awt.geom.AffineTransform


         * Returns the outline shape
         * @return outline
         */
        @Override
        Shape getOutline() {
            AffineTransform t = AffineTransform.getTranslateInstance(x, y);
            return t.createTransformedShape(
                    TextDecorator.extendOutline(
                            this,
                            getGlyphVector().getOutline(),
                            decoration
                    )
View Full Code Here


            return ga.getAdvance();
        }

        @Override
        Shape getOutline() {
            AffineTransform t = AffineTransform.getTranslateInstance(x, y);
            return t.createTransformedShape(
                    TextDecorator.extendOutline(this, getVisualBounds(), decoration)
            );
        }
View Full Code Here

        if( this.shapes.size() > 0 && this.shapes.size() > labelIndex )
        {
          //Shape shape = (Shape)this.shapes.get( labelIndex);

          //---get the original transform so can reset it
          AffineTransform affineTransform = g2d.getTransform();

          //---translate the Shape into position
          g2d.translate( rectangle.x, rectangle.y );

          if( this.fillPointsFlags.size() > 0 )
View Full Code Here

                renderer.clip(shape);
            }
            // The new clipping region is the current shape
            else if (mode == EMFConstants.RGN_COPY) {
                // rest the clip ...
                AffineTransform at = renderer.getTransform();
                // temporarly switch to the base transformation to
                // aplly the base clipping area
                renderer.resetTransformation();
                // set the clip
                renderer.setClip(renderer.getInitialClip());
View Full Code Here

        // MWT_IDENTITY   Resets the current world transformation by using
        // the identity matrix. If this mode is specified, the XFORM structure
        // pointed to by lpXform is ignored.
        if (mode == EMFConstants.MWT_IDENTITY) {
            if (renderer.getPath() != null) {
                renderer.setPathTransform(new AffineTransform());
            } else {
                renderer.resetTransformation();
            }
        }
View Full Code Here

    return text.toString();
  }

  private static boolean isIdentity(GlyphVector gv) {
    for(int i=0;i!=gv.getNumGlyphs();++i) {
      AffineTransform tr = gv.getGlyphTransform(i);
      if(tr != null && !tr.isIdentity()) {
        return false;
      }
    }
    return true;
  }
View Full Code Here

        Rectangle srcBounds = src.getBounds();
        Rectangle dstBounds = dst.getBounds();
        Rectangle normDstBounds = new Rectangle(0, 0, dstBounds.width, dstBounds.height);
        Rectangle bounds = getBounds2D(src).getBounds().intersection(normDstBounds);

        AffineTransform inv = null;
        try {
             inv = at.createInverse();
        } catch (NoninvertibleTransformException e) {
            return -1;
        }

        double[] m = new double[6];
        inv.getMatrix(m);

        int minSrcX = srcBounds.x;
        int minSrcY = srcBounds.y;
        int maxSrcX = srcBounds.x + srcBounds.width;
        int maxSrcY = srcBounds.y + srcBounds.height;
View Full Code Here

        final int TRANSFORM_MASK = AffineTransform.TYPE_GENERAL_ROTATION
                | AffineTransform.TYPE_GENERAL_TRANSFORM;
        Rectangle2D bounds;

        AffineTransform transform = getTransform();
        AffineTransform frcTransform = frc.getTransform();

        // XXX: for transforms where an angle between basis vectors is not 90
        // degrees Rectanlge2D class doesn't fit as Logical bounds.
        if ((transform.getType() & TRANSFORM_MASK) == 0) {
            int width = 0;
            for (int i = start; i < end; i++) {
                width += peer.charWidth(chars[i]);
            }
            LineMetrics nlm = peer.getLineMetrics();
            bounds = transform.createTransformedShape(
                    new Rectangle2D.Float(0, -nlm.getAscent(), width, nlm
                            .getHeight())).getBounds2D();
        } else {
            int len = end - start;
            char[] subChars = new char[len];
            System.arraycopy(chars, start, subChars, 0, len);
            bounds = createGlyphVector(frc, subChars).getLogicalBounds();
        }
       
        if (!(frcTransform.isIdentity()))
            return frcTransform.createTransformedShape(bounds).getBounds2D();
       
        return bounds;
    }
View Full Code Here

        }

        FontPeerImpl peer = (FontPeerImpl)this.getPeer();

        Rectangle2D bounds = peer.getMaxCharBounds(frc);
        AffineTransform transform = getTransform();
        // !! Documentation doesn't describe meaning of max char bounds
        // for the fonts that have rotate transforms. For all transforms
        // returned bounds are the bounds of transformed maxCharBounds
        // Rectangle2D that corresponds to the font with identity transform.
        // TODO: resolve this issue to return correct bounds
        bounds = transform.createTransformedShape(bounds).getBounds2D();

        return bounds;
    }
View Full Code Here

        if (transform != null) {
            if (transform instanceof TransformAttribute) {
                return ((TransformAttribute) transform).getTransform();
            }
            if (transform instanceof AffineTransform) {
                return new AffineTransform((AffineTransform) transform);
            }
        } else {
            transform = new AffineTransform();
        }
        return (AffineTransform) transform;

    }
View Full Code Here

TOP

Related Classes of com.google.code.appengine.awt.geom.AffineTransform

Copyright © 2018 www.massapicom. 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.