Package java.awt

Examples of java.awt.Graphics2D.scale()


     
      // Now change coordinate system for circuit, including
      // translation and possible scaling
      if (g2 != null) {
        if (scale < 1.0) {
          g2.scale(scale, scale);
          imWidth /= scale;
          imHeight /= scale;
        }
        double dx = Math.max(0.0, (imWidth - bds.getWidth()) / 2);
        g2.translate(-bds.getX() + dx, -bds.getY());
View Full Code Here


      g2 = (Graphics2D) getGraphics().create();
      g2.clip(drawAreaBounds);
      g2.translate(x, y);
      g2.translate(alignmentX, alignmentY);
      g2.clip(new Rectangle2D.Float(0, 0, clipWidth, clipHeight));
      g2.scale(deviceScaleFactor, deviceScaleFactor);

      scaleTransform = null;
    }
    else
    {
View Full Code Here

    final int imageWidth = (int) StrictGeomUtility.toExternalValue(width);
    final int imageHeight = (int) StrictGeomUtility.toExternalValue(height);
    // first clip.
    final BufferedImage bi = ImageUtils.createTransparentImage(imageWidth, imageHeight);
    final Graphics2D graphics = (Graphics2D) bi.getGraphics();
    graphics.scale(deviceScaleFactor, deviceScaleFactor);

    if (image instanceof BufferedImage)
    {
      if (graphics.drawImage(image, null, null) == false)
      {
View Full Code Here

      g2 = (Graphics2D) getGraphics().create();
      g2.clip(drawAreaBounds);
      g2.translate(x, y);
      g2.translate(alignmentX, alignmentY);
      g2.clip(new Rectangle2D.Float(0, 0, clipWidth, clipHeight));
      g2.scale(deviceScaleFactor, deviceScaleFactor);

      scaleTransform = null;
    }
    else
    {
View Full Code Here

    else
    {
      g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
    }

    g2.scale(scale, scale);
    // the clipping bounds are a sub-area of the whole drawable
    // we only want to print a certain area ...

    final StyleSheet style = box.getStyleSheet();
    final String fontName = (String) style.getStyleProperty(TextStyleKeys.FONT);
View Full Code Here

      reportDrawable.setResourceBundleFactory(getResourceBundleFactory());
      reportDrawable.setStyleSheet(getStyleSheet());
    }

    final Graphics2D derived = (Graphics2D) g2.create();
    derived.scale(scaleX, scaleY);
    final Rectangle2D scaledArea = (Rectangle2D) area.clone();
    scaledArea.setRect(scaledArea.getX() * scaleX, scaledArea.getY() * scaleY,
        scaledArea.getWidth() * scaleX, scaledArea.getHeight() * scaleY);
    super.draw(derived, scaledArea);
    derived.dispose();
View Full Code Here

     */
    public void paint(Graphics g) {

        Graphics2D g2 = (Graphics2D)g;

        g2.scale(_param.scale,_param.scale);

        // fill background
        if(_param.backgr!=null){
            g2.setColor(_param.backgr);
            g2.fillRect(0,0,_param.width,_param.height);
View Full Code Here

        g2.translate((int) pf.getImageableX(), (int) pf.getImageableY());

        // shape the graphic if option has been selected   
        if (_scaleSheet) {
            double s = computePrintScaleFactor(pf);
            g2.scale(s, s);
        }

        // First, print a background if option has been selected
        if ( (_param.backgr != null) && _printBackgroundColor){
            g2.setColor(_param.backgr);
View Full Code Here

      g2.setColor(Color.WHITE);
    g2.setTransform(t);
    g2.fillRect(0,0,(int)w,(int)h);
   
    // apply scale factor
    g2.scale(s,s);
   
    // draw the diagram

    comp.printDiagram(g2);
View Full Code Here

            // shift Graphic to line up with beginning of print-imageable region
            g2.translate(pf.getImageableX(), pf.getImageableY());
            // shift Graphic to line up with beginning of next page to print
            g2.translate(0f, -pageIndex * pageHeight);
            // scale the page so the width fits...
            g2.scale(scale, scale);
            // for faster printing, turn off double buffering
            disableDoubleBuffering(componentToBePrinted);
            componentToBePrinted.paint(g2); //repaint the page for printing
            enableDoubleBuffering(componentToBePrinted);
            response = Printable.PAGE_EXISTS;
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.