Package java.awt.geom

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


        g2.setColor(RED);
        g2.fill(sha);

        f = new Font("sansserif",Font.ITALIC,w/8);
        AffineTransform fontAT = new AffineTransform();
        fontAT.shear(-0.2, 0.0);
        Font derivedFont = f.deriveFont(fontAT);
        tl = new TextLayout("Italic-Shear", derivedFont, frc);
        sw = (float) tl.getBounds().getWidth();
        sh = (float) tl.getBounds().getHeight();
        sha = tl.getOutline(AffineTransform.getTranslateInstance(w/2-sw/2,h*0.80f+sh/2));
 
View Full Code Here


      charAttsList.add(cf);
      text = new TextLayout(chars[i] + "", getFont(fontName), new FontRenderContext(null,
        false, false));
      textAt = new AffineTransform();
      textAt.rotate(rotation);
      textAt.shear(shearX, shearY);
      shape = text.getOutline(textAt);
      width += (int)shape.getBounds2D().getWidth();
      if (height < (int)shape.getBounds2D().getHeight() + rise)
      {
        height = (int)shape.getBounds2D().getHeight() + rise;
View Full Code Here

        AffineTransform at = new AffineTransform();
        at.rotate(rotationSlider.getValue() * Math.PI / 180);
        double scale = scalingSlider.getValue() / 100.0;
        at.scale(scale, scale);
        double shear = shearingSlider.getValue() / 10.0;
        at.shear(shear, 0);
        for (JXTransformer t : transformers) {
            t.setTransform(at);
        }
    }

View Full Code Here

        TextLayout text = new TextLayout(cf.getChar() + "", getFont(cf.getName()),
          gfx.getFontRenderContext());
        AffineTransform textAt = new AffineTransform();
        textAt.translate(curWidth, height - cf.getRise());
        textAt.rotate(cf.getRotation());
        textAt.shear(cf.getShearX(), cf.getShearY());
        Shape shape = text.getOutline(textAt);
        curWidth += shape.getBounds().getWidth();
        gfx.setXORMode(Color.BLACK);
        gfx.fill(shape);
      }
View Full Code Here

        setTransform(transform);
    }

    public void shear(double sx, double sy) {
        AffineTransform transform = getTransform();
        transform.shear(sx, sy);
        setTransform(transform);
    }
}
View Full Code Here

  public static BufferedImage getTransformedImage(BufferedImage image,double scaleX,double scaleY,double shearX,double shearY){
    AffineTransform transform = new AffineTransform();
    if ( scaleX > 0 && scaleY > 0 )
      transform.scale(scaleX, scaleY);
    if ( shearX > 0 && shearY > 0 )
      transform.shear(shearX, shearY);
   
    AffineTransformOp op = new AffineTransformOp(transform,AffineTransformOp.TYPE_BILINEAR);
    BufferedImage dest = new BufferedImage(image.getWidth(),image.getHeight(),image.getType());
    op.filter(image, dest);
    return dest;
View Full Code Here

      charAttsList.add(cf);
      text = new TextLayout(chars[i] + "", getFont(fontName), new FontRenderContext(null,
        false, false));
      textAt = new AffineTransform();
      textAt.rotate(rotation);
      textAt.shear(shearX, shearY);
      shape = text.getOutline(textAt);
      width += (int)shape.getBounds2D().getWidth();
      if (height < (int)shape.getBounds2D().getHeight() + rise)
      {
        height = (int)shape.getBounds2D().getHeight() + rise;
View Full Code Here

        text = new TextLayout(cf.getChar() + "", getFont(cf.getName()),
          gfx.getFontRenderContext());
        textAt = new AffineTransform();
        textAt.translate(curWidth, height - cf.getRise());
        textAt.rotate(cf.getRotation());
        textAt.shear(cf.getShearX(), cf.getShearY());
        shape = text.getOutline(textAt);
        curWidth += shape.getBounds().getWidth();
        gfx.setXORMode(Color.BLACK);
        gfx.fill(shape);
      }
View Full Code Here

      charAttsList.add(cf);
      text = new TextLayout(chars[i] + "", getFont(fontName), new FontRenderContext(null,
        false, false));
      textAt = new AffineTransform();
      textAt.rotate(rotation);
      textAt.shear(shearX, shearY);
      shape = text.getOutline(textAt);
      width += (int)shape.getBounds2D().getWidth();
      if (height < (int)shape.getBounds2D().getHeight() + rise)
      {
        height = (int)shape.getBounds2D().getHeight() + rise;
View Full Code Here

        text = new TextLayout(cf.getChar() + "", getFont(cf.getName()),
          gfx.getFontRenderContext());
        textAt = new AffineTransform();
        textAt.translate(curWidth, height - cf.getRise());
        textAt.rotate(cf.getRotation());
        textAt.shear(cf.getShearX(), cf.getShearY());
        shape = text.getOutline(textAt);
        curWidth += shape.getBounds().getWidth();
        gfx.setXORMode(Color.BLACK);
        gfx.fill(shape);
      }
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.