Package java.awt.geom

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


          trans = AffineTransform.getScaleInstance(smallest, smallest);
          double width = smallest * img.getWidth();
          double height = smallest * img.getHeight();
          double tx = (width < iconSize ? (0d + iconSize - width) / 2 : 0d);
          double ty = (height < iconSize ? (0d + iconSize - height) / 2 : 0d);
          trans.concatenate(AffineTransform.getTranslateInstance(tx, ty));
        } else {
          double tx = (img.getWidth() < iconSize ? (0d + iconSize - img.getWidth()) / 2 : 0d);
          double ty = (img.getHeight() < iconSize ? (0d + iconSize - img.getHeight()) / 2 : 0d);
          trans = AffineTransform.getTranslateInstance(tx, ty);
        }
View Full Code Here


          {
            /*
              NOTE: The text rendering matrix is recomputed before each glyph is painted
              during a text-showing operation.
            */
            AffineTransform trm = (AffineTransform)ctm.clone(); trm.concatenate(tm);
            float charHeight = font.getHeight(textChar,fontSize);
            Rectangle2D charBox = new Rectangle2D.Double(
              trm.getTranslateX(),
              contextHeight - trm.getTranslateY() - font.getAscent(fontSize) * tm.getScaleY(),
              charWidth * tm.getScaleX(),
 
View Full Code Here

        of the current transformation matrix (ctm) and the text matrix (tm).
      */
      AffineTransform trm = topDown
        ? new AffineTransform(1, 0, 0, -1, 0, scanner.getCanvasSize().getHeight())
        : new AffineTransform();
      trm.concatenate(ctm);
      trm.concatenate(tm);
      return trm.transform(point, null);
    }

    /**
 
View Full Code Here

      */
      AffineTransform trm = topDown
        ? new AffineTransform(1, 0, 0, -1, 0, scanner.getCanvasSize().getHeight())
        : new AffineTransform();
      trm.concatenate(ctm);
      trm.concatenate(tm);
      return trm.transform(point, null);
    }

    /**
      Resolves the given user-space point to its equivalent device-space one [PDF:1.6:4.2.3],
View Full Code Here

                         * and then rotate the text before computing the bounds. The scale results in some whitespace around
                         * the unrotated top and bottom of the text that normally wouldn't be present if unscaled, but
                         * is added by the standard Excel autosize.
                         */
                        AffineTransform trans = new AffineTransform();
                        trans.concatenate(AffineTransform.getRotateInstance(style.getRotation()*2.0*Math.PI/360.0));
                        trans.concatenate(
                        AffineTransform.getScaleInstance(1, fontHeightMultiple)
                        );
                        width = Math.max(width, ((layout.getOutline(trans).getBounds().getWidth() / colspan) / defaultCharWidth) + cell.getCellStyle().getIndention());
                    } else {
View Full Code Here

                         * the unrotated top and bottom of the text that normally wouldn't be present if unscaled, but
                         * is added by the standard Excel autosize.
                         */
                        AffineTransform trans = new AffineTransform();
                        trans.concatenate(AffineTransform.getRotateInstance(style.getRotation()*2.0*Math.PI/360.0));
                        trans.concatenate(
                        AffineTransform.getScaleInstance(1, fontHeightMultiple)
                        );
                        width = Math.max(width, ((layout.getOutline(trans).getBounds().getWidth() / colspan) / defaultCharWidth) + cell.getCellStyle().getIndention());
                    } else {
                        width = Math.max(width, ((layout.getBounds().getWidth() / colspan) / defaultCharWidth) + cell.getCellStyle().getIndention());
View Full Code Here

                         * and then rotate the text before computing the bounds. The scale results in some whitespace around
                         * the unrotated top and bottom of the text that normally wouldn't be present if unscaled, but
                         * is added by the standard Excel autosize.
                         */
                        AffineTransform trans = new AffineTransform();
                        trans.concatenate(AffineTransform.getRotateInstance(style.getRotation()*2.0*Math.PI/360.0));
                        trans.concatenate(
                        AffineTransform.getScaleInstance(1, fontHeightMultiple)
                        );
                        width = Math.max(width, ((layout.getOutline(trans).getBounds().getWidth() / colspan) / defaultCharWidth) + cell.getCellStyle().getIndention());
                    } else {
View Full Code Here

                         * the unrotated top and bottom of the text that normally wouldn't be present if unscaled, but
                         * is added by the standard Excel autosize.
                         */
                        AffineTransform trans = new AffineTransform();
                        trans.concatenate(AffineTransform.getRotateInstance(style.getRotation()*2.0*Math.PI/360.0));
                        trans.concatenate(
                        AffineTransform.getScaleInstance(1, fontHeightMultiple)
                        );
                        width = Math.max(width, ((layout.getOutline(trans).getBounds().getWidth() / colspan) / defaultCharWidth) + cell.getCellStyle().getIndention());
                    } else {
                        width = Math.max(width, ((layout.getBounds().getWidth() / colspan) / defaultCharWidth) + cell.getCellStyle().getIndention());
View Full Code Here

        AffineTransform s = AffineTransform.getScaleInstance(scale, scale);
        AffineTransform r = AffineTransform.getRotateInstance(angle);
        AffineTransform t = AffineTransform.getTranslateInstance(x, y);

        AffineTransform at = t;
        at.concatenate(r);
        at.concatenate(s);

        return at;
    }
View Full Code Here

        AffineTransform r = AffineTransform.getRotateInstance(angle);
        AffineTransform t = AffineTransform.getTranslateInstance(x, y);

        AffineTransform at = t;
        at.concatenate(r);
        at.concatenate(s);

        return at;
    }

    public static void main(String[] args) {
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.