Package java.awt

Examples of java.awt.Graphics2D.scale()


        }

        if (image != null) {
            Graphics2D imageGraphics = (Graphics2D)graphics.create();
            imageGraphics.translate(imageX, imageY);
            imageGraphics.scale(scaleX, scaleY);

            // Apply an alpha composite if the opacity value is less than
            // the current alpha
            float alpha = 1.0f;
View Full Code Here


            }

            bufferedImageGraphics.setRenderingHint(RenderingHints.KEY_INTERPOLATION, interpolationHint);

            // Draw the image
            bufferedImageGraphics.scale(scaleX, scaleY);
            paint(bufferedImageGraphics);

            bufferedImageGraphics.dispose();

            // Set the scaled image as the new instance
View Full Code Here

                                                (int)(scaleY*
                                                      textureImage.getHeight()),
                                                BufferedImage.TYPE_INT_ARGB);

                        Graphics2D g = newImage.createGraphics();
                        g.scale(scaleX, scaleY);
                        g.drawImage(textureImage, 0, 0, null);
                        g.dispose();

                        textureImage = newImage;
                    }
View Full Code Here

                    break;
            }
            graphics.translate(translateX,translateY);
            graphics.rotate((float)Math.toRadians(rotationAngle));
        }
        graphics.scale( scaling, scaling );
        PageDrawer drawer = new PageDrawer();
        drawer.drawPage( graphics, this, pageDimension );
        drawer.dispose();
        graphics.dispose();
        return retval;
View Full Code Here

    public int print(Graphics graphics, PageFormat pageFormat, int pageIndex) throws PrinterException {
        Graphics2D g2 = (Graphics2D) graphics;
        g2.translate(pageFormat.getImageableX(), pageFormat.getImageableY());
        Rectangle componentBounds = mComponent.getBounds(null);
        g2.translate(-componentBounds.x, -componentBounds.y);
        g2.scale(mScaleX, mScaleY);
        boolean wasBuffered = mComponent.isDoubleBuffered();
        mComponent.paint(g2);
        mComponent.setDoubleBuffered(wasBuffered);

        return PAGE_EXISTS;
View Full Code Here

        if (scrollpane.getComponentOrientation().isLeftToRight()) {
            g2.translate(c.getWidth() - insets.right - vBarWidth, c.getHeight() - insets.bottom - hBarHeight);
            g2.setClip(0, 0, vBarWidth, hBarHeight);
        } else {
            g2.translate(15 + insets.right, c.getHeight() - insets.bottom - hBarHeight);
            g2.scale(-1, 1);
            g2.setClip(0, 0, vBarWidth, hBarHeight);
        }
        cornerPainter.paint(g2, c, 15, 15);
    }
View Full Code Here

         g2d.translate(tx, ty);

         double sx = getPageWidthInPixel(pageFormat) / edgesWitdthInPixel;
         double sy = getPageHeightInPixel(pageFormat) / edgesHeightInPixel;

         g2d.scale(sx, sy);

         paintGraphComponents(g2d);
         super.paintChildren(g2d);

      }
View Full Code Here

        for (int i=0; i<runCount; i++) {
          int firstInRun = tabRuns[i];
          Rectangle r = rects[firstInRun];
          g.translate(r.x, r.y);
          g.translate(0,TAB_HEIGHT-1);
          g2d.scale(1, -1);
          paintTabOverlappingBackground(g, tabPlacement,
                    -9, TAB_HEIGHT, firstInRun);
          paintTabOverlappingBorder(g, tabPlacement,
                    -9, TAB_HEIGHT-1, firstInRun);
          g2d.setTransform(oldTransform);
View Full Code Here

    switch (tabPlacement) {

      case SwingConstants.BOTTOM:
        g.translate(0,h);
        g2d.scale(1, -1);
        // Fall through.

      case SwingConstants.TOP:
      case SwingConstants.LEFT:
      case SwingConstants.RIGHT:
View Full Code Here

    switch (tabPlacement) {

      case SwingConstants.BOTTOM:
        g.translate(0,h-1);
        g2d.scale(1, -1);
        // Fall through.

      case SwingConstants.TOP:
      case SwingConstants.LEFT:
      case SwingConstants.RIGHT:
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.