Package java.awt

Examples of java.awt.Graphics2D.transform()


        Shape clip = g.getClip();

        //
        // Append transform to selected area
        //
        g.transform(curTxf);

        //
        // Delegate rendering to painter
        //
        try{
View Full Code Here


        }

        public void paint(Graphics g) {
            if (s != null) {
                Graphics2D g2d = (Graphics2D)g;
                g2d.transform(paintingTransform);
                g2d.setColor(new Color(255, 255, 255, 128));
                g2d.fill(s);
                g2d.setColor(Color.black);
                g2d.setStroke(new BasicStroke());
                g2d.draw(s);
View Full Code Here

        g2d.fillRect(visRect.x,     visRect.y,
                     visRect.width, visRect.height);

        if (image != null) {
            if (paintingTransform != null) {
                g2d.transform(paintingTransform);
            }
            g2d.drawRenderedImage(image, null);
            g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                 RenderingHints.VALUE_ANTIALIAS_OFF);
            Iterator it = overlays.iterator();
View Full Code Here

      // Sets the transform
      Dimension dim = getSize();
      double sx = ((double)dim.width) / PREFERRED_WIDTH;
      double sy = ((double)dim.height) / PREFERRED_HEIGHT;
      g2d.transform(AffineTransform.getScaleInstance(sx, sy));
     
      // Turns the antialiasing on
      g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
         RenderingHints.VALUE_ANTIALIAS_ON);
     
View Full Code Here

     
      // Sets the transform
      Dimension dim = getSize();
      double sx = ((double)dim.width) / PREFERRED_WIDTH;
      double sy = ((double)dim.height) / PREFERRED_HEIGHT;
      g2d.transform(AffineTransform.getScaleInstance(sx, sy));
     
      // The vertical lines
      g2d.setPaint(gridLinesColor);
      g2d.setStroke(GRID_LINES_STROKE);
      for (int i = 1; i < 20; i++) {
View Full Code Here

        g2d.fillRect(visRect.x,     visRect.y,
                     visRect.width, visRect.height);

        if (image != null) {
            if (paintingTransform != null) {
                g2d.transform(paintingTransform);
            }
            g2d.drawRenderedImage(image, null);
            g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                 RenderingHints.VALUE_ANTIALIAS_OFF);
            Iterator it = overlays.iterator();
View Full Code Here

        g.fillRect(0, 0, wr.getWidth(), wr.getHeight());
        g.setComposite(AlphaComposite.SrcOver);
        g.translate(-wr.getMinX(), -wr.getMinY());

        // Set transform
        g.transform(node2dev);


        // Invoke primitive paint.
        if (usePrimitivePaint) {
            node.primitivePaint(g);
View Full Code Here

        }

        public void paint(Graphics g) {
            if (s != null) {
                Graphics2D g2d = (Graphics2D)g;
                g2d.transform(paintingTransform);
                g2d.setColor(new Color(255, 255, 255, 128));
                g2d.fill(s);
                g2d.setColor(Color.black);
                g2d.setStroke(new BasicStroke());
                g2d.draw(s);
View Full Code Here

        // and positive is down and to the right. (0,0) is where the
        // viewBox puts it.
        g2d.translate(fx, fy);
        AffineTransform at = AffineTransform.getScaleInstance(sx, sy);
        if (!at.isIdentity()) {
            g2d.transform(at);
        }

        Rectangle2D area = new Rectangle2D.Double(0.0, 0.0, imw, imh);
        painter.paint(g2d, area);
View Full Code Here

        if (r != null) {
            /*
             *  Fill in the negative quadrants to give a hint of how the plot has been rotated.
             */
            Graphics2D g2r = (Graphics2D) g2.create();
            g2r.transform(r);
           
            g2r.setPaint(Color.lightGray);
            g2r.fillRect(-size, 0, size, size);
            g2r.fillRect(0, -size, size, size);
            g2r.dispose();
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.