Package com.jgraph.gaeawt.java.awt.geom

Examples of com.jgraph.gaeawt.java.awt.geom.AffineTransform


    @Override
    public void drawGlyphVector(Graphics2D g, GlyphVector glyphVector,
            float x, float y) {

        AffineTransform at = g.getTransform();
        Rectangle c = g.getClipBounds();
        if (at != null){
            int atType = at.getType();
            if (atType == AffineTransform.TYPE_TRANSLATION) {
                c.translate((int)Math.round(at.getTranslateX()), (int)Math.round(at.getTranslateY()));
            }
        }

        WritableRaster wr = ((BufferedImageGraphics2D)g).getWritableRaster();

        Rectangle rBounds = wr.getBounds();

        int color = g.getColor().getRGB();

        drawClipGlyphVector(wr, color, glyphVector, (int)Math.round(x + at.getTranslateX()), (int)Math.round(y + at.getTranslateY()),
        Math.max(c.x,rBounds.x),
        Math.max(c.y,rBounds.y),
        Math.min((int)Math.round(c.getMaxX()), (int)Math.round(rBounds.getMaxX())),
        Math.min((int)Math.round(c.getMaxY()), (int)Math.round(rBounds.getMaxY())));
View Full Code Here


    }

    @SuppressWarnings("deprecation")
    @Override
    public void drawString(Graphics2D g, String str, float x, float y) {
        AffineTransform at = g.getTransform();
        Rectangle c = g.getClipBounds();
        if (at != null){
            int atType = at.getType();
            if (atType == AffineTransform.TYPE_TRANSLATION) {
                c.translate((int)Math.round(at.getTranslateX()), (int)Math.round(at.getTranslateY()));
            }
        }
        WritableRaster wr = ((BufferedImageGraphics2D)g).getWritableRaster();
        Rectangle rBounds = wr.getBounds();

        int color = g.getColor().getRGB();

        drawClipString(wr, color, str, (FontPeerImpl) (g.getFont().getPeer()),
                (int)Math.round(x + at.getTranslateX()), (int)Math.round(y + at.getTranslateY()),
                Math.max(c.x,rBounds.x),
                Math.max(c.y,rBounds.y),
                Math.min((int)Math.round(c.getMaxX()), (int)Math.round(rBounds.getMaxX())),
                Math.min((int)Math.round(c.getMaxY()), (int)Math.round(rBounds.getMaxY())));
View Full Code Here

         * 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

    {
      double scaleX = xform.getScaleX();
      double scaleY = xform.getScaleY();
      double scaledX = dstX / scaleX;
      double scaledY = dstY / scaleY;
      AffineTransform at = new AffineTransform();
      at.setToTranslation(scaledX, scaledY);
      xform.concatenate(at);
      sysxform.concatenate(xform);
      blit(srcX, srcY, srcSurf, 0, 0, dstSurf, width, height, sysxform,
          comp, bgcolor, clip);
    }
View Full Code Here

      Composite comp, Color bgcolor, MultiRectArea clip)
  {

    if (sysxform == null)
    {
      sysxform = new AffineTransform();
    }
    int type = sysxform.getType();
    switch (type)
    {
      case AffineTransform.TYPE_TRANSLATION:
View Full Code Here

        .getBounds();

    int translateX = transDstBlitBounds.x - transSrcBounds.x;
    int translateY = transDstBlitBounds.y - transSrcBounds.y;

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

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

    int clipRects[];
    if (clip != null)
    {
      clipRects = clip.rect;
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

     *
     * @param frc specified FontRenderContext
     */
    public Rectangle2D getMaxCharBounds(FontRenderContext frc) {
        if (frc != null){
            AffineTransform at = frc.getTransform();
            return at.createTransformedShape(maxCharBounds).getBounds2D();
        }
        return maxCharBounds;
    }
View Full Code Here

            (AffineTransform) transform.clone(), composite,
            bgcolor, clip);
      }
      else
      {
        AffineTransform xform = new AffineTransform();
        xform.setToScale((float) width / w, (float) height / h);
        blitter.blit(0, 0, srcSurf, x, y, dstSurf, w, h,
            (AffineTransform) transform.clone(), xform, composite,
            bgcolor, clip);
      }
    }
View Full Code Here

            srcH, (AffineTransform) transform.clone(), composite,
            bgcolor, clip);
      }
      else
      {
        AffineTransform xform = new AffineTransform();
        xform.setToScale((float) dstW / srcW, (float) dstH / srcH);
        blitter.blit(srcX, srcY, srcSurf, dstX, dstY, dstSurf, srcW,
            srcH, (AffineTransform) transform.clone(), xform,
            composite, bgcolor, clip);
      }
    }
View Full Code Here

TOP

Related Classes of com.jgraph.gaeawt.java.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.