Package java.awt.geom

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


                    AffineTransform transform = new AffineTransform();
                    Rectangle2D bounds2D = path.getBounds2D();                   
                    transform.translate(bounds2D.getCenterX(), bounds2D.getCenterY());
                    double min = Math.min(bounds2D.getWidth(), bounds2D.getHeight());
                    double scale = (min + epsilon) / min;
                    transform.scale(scale, scale);
                    transform.translate(-bounds2D.getCenterX(), -bounds2D.getCenterY());
                    halfDoorPath = path.createTransformedShape(transform);
                    break;
                  }
                }
View Full Code Here


      itemBounds.add(xLabel + labelBounds.getWidth() / 2,
          yLabel + labelFontMetrics.getDescent());
    } else if (item instanceof Compass) {
      Compass compass = (Compass)item;
      AffineTransform transform = AffineTransform.getTranslateInstance(compass.getX(), compass.getY());
      transform.scale(compass.getDiameter(), compass.getDiameter());
      transform.rotate(compass.getNorthDirection());
      return COMPASS.createTransformedShape(transform).getBounds2D();
    }
    return itemBounds;
  }
View Full Code Here

      // Compute camera drawing at scale
      AffineTransform cameraTransform = new AffineTransform();
      float [][] points = camera.getPoints();
      double yScale = Point2D.distance(points [0][0], points [0][1], points [3][0], points [3][1]);
      double xScale = Point2D.distance(points [0][0], points [0][1], points [1][0], points [1][1]);
      cameraTransform.scale(xScale, yScale);   
      Shape scaledCameraBody =
          new Area(CAMERA_BODY).createTransformedArea(cameraTransform);
      Shape scaledCameraHead =
          new Area(CAMERA_HEAD).createTransformedArea(cameraTransform);
     
View Full Code Here

        y += (size.height - bounds.height) / 2;
      }
      if (bounds.width < size.width) {
        x += (size.width - bounds.width) / 2;
      }
      retVal.scale(bounds.width / originalDimension.getWidth(), bounds.height / originalDimension.getHeight());
      retVal.translate(x, y);
    }
    return retVal;
  }
View Full Code Here

                //this.getBaseFont() +
                //" "  + this + " " + TIMES_ROMAN );
            }
        }
        AffineTransform at = new AffineTransform();
        at.scale( xScale, yScale );
       
        Graphics2D g2d = (Graphics2D)g;
        g2d.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON );
        g2d.setFont( awtFont.deriveFont( at ).deriveFont( fontSize ) );
        //g2d.getFontRenderContext().getTransform().scale( xScale, yScale );
View Full Code Here

            {
                throw new WrappedIOException( f );
            }
        }
        AffineTransform at = new AffineTransform();
        at.scale( xScale, yScale );
        Graphics2D g2d = (Graphics2D)g;
        g2d.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON );
        g2d.setFont( awtFont.deriveFont( at ).deriveFont( fontSize ) );
        g2d.drawString( string, (int)x, (int)y );
    }
View Full Code Here

        }

        if (properties.getAffineTransform() != null) {
      AffineTransform currentAf = properties.getAffineTransform();
      AffineTransform af = new AffineTransform();
      af.scale(properties.getAffineTransform().getScaleX(), currentAf.getScaleY());

      if (currentAf.getTranslateX() != 0 || currentAf.getTranslateY() != 0) {
          af.translate(r.nextDouble() * currentAf.getTranslateX(), r.nextDouble() * currentAf.getTranslateY());
      }

 
View Full Code Here

  ip = new FileImageInputProvider(new File(imagesPath));
  ip.getProperties().setScaleColors(false);
  ip.getProperties().setGroupByChannel(true);
  ip.getProperties().setParallelPreprocessing(true);
  AffineTransform af = new AffineTransform();
  af.scale(2, 2);
  ip.getProperties().setAffineTransform(af);

  image1 = ip.getNextInput();
  assertEquals(3, image1.length, 0);
View Full Code Here

        double sx = (double)getWidth()/source.getWidth();
        double sy = (double)getHeight()/source.getHeight();

        AffineTransform transform = new AffineTransform();
        transform.translate(-source.getMinX(), -source.getMinY());
        transform.scale(sx, sy);
        transform.translate(getMinX(), getMinY());
        transform.preConcatenate(usr2dev);

        Interpolation interp =
            Interpolation.getInstance(Interpolation.INTERP_NEAREST);
View Full Code Here

        return clip;
    }

    public void scale(double sx, double sy) {
        AffineTransform at = new AffineTransform();
        at.scale(sx, sy);
        transform.concatenate(at);
    }
    //===============================================
    public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) {
        throw new RuntimeException("Not implemented");
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.