Package java.awt

Examples of java.awt.Graphics2D.rotate()


               
                // PLAYER SHIP
                g2d.setTransform(new AffineTransform());
                g2d.setColor(fo1.color);               
                g2d.translate((fo1.getPosition().x*scaleFactor-viewCoordUL.x), (fo1.getPosition().y*scaleFactor-viewCoordUL.y));
                g2d.rotate(theta);
                g2d.scale(scaleFactor, scaleFactor);
                g2d.drawPolygon(ship);
               
                // POSITION
                g2d.setTransform(new AffineTransform());
View Full Code Here


        Graphics2D watermarkGraphics = (Graphics2D)graphics.create();
        watermarkGraphics.clipRect(0, 0, component.getWidth(), component.getHeight());
        watermarkGraphics.setComposite(AlphaComposite.getInstance
            (AlphaComposite.SRC_OVER, opacity));
        watermarkGraphics.rotate(theta);

        // Calculate the separation in between each repetition of the watermark
        int dX = (int)(1.5 * boxPane.getWidth());
        int dY = 2 * boxPane.getHeight();

 
View Full Code Here

                    dataRenderer.setSize(Math.max(contentWidth, 0),
                        Math.max(getWidth() - (buttonPadding.left + buttonPadding.right + 2), 0));

                    contentGraphics.translate(buttonPadding.top + 1, buttonPadding.left + 1);
                    contentGraphics.rotate(-Math.PI / 2d);
                    contentGraphics.translate(-dataRenderer.getWidth(), 0);

                    break;
                }
View Full Code Here

                    break;
                default:
                    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();
View Full Code Here

        for (int i = 0; i < c; i++) {
            float f = ((i + 1) / (float)c);
            Color col = new Color(0.0f, 1 - f, 0.0f);
            copy.setColor(col);
            copy.fillRect(70, 90, 50, 50);
            copy.rotate(-2 * Math.PI / (double)c, 70, 90);
        }
        copy.dispose();
       
        //Some text
        copy = (Graphics2D)g2d.create();
View Full Code Here

        }
        copy.dispose();
       
        //Some text
        copy = (Graphics2D)g2d.create();
        copy.rotate(-0.25);
        copy.setColor(Color.RED);
        copy.setFont(new Font("sans-serif", Font.PLAIN, 36));
        copy.drawString("Hello world!", 140, 140);
        copy.setColor(Color.RED.darker());
        copy.setFont(new Font("serif", Font.PLAIN, 36));
View Full Code Here

            for (int i = 0; i < c; i++) {
                float f = ((i + 1) / (float)c);
                Color col = new Color(0.0f, 1 - f, 0.0f);
                copy.setColor(col);
                copy.fillRect(70, 90, 50, 50);
                copy.rotate(-2 * Math.PI / (double)c, 70, 90);
            }
            copy.dispose();
           
            //Some text
            g2d.rotate(-0.25);
View Full Code Here

                BorderPainter painter = getBorderPainter(i);

                double angle = i * Math.PI / 2;
                g2.setClip(g.getClip()); // Restore initial clip
                g2.translate(intCorners[i][0], intCorners[i][1]);
                g2.rotate(angle);
                g2.clip(shape);
                painter.paint(shape, g2, color, i);
                g2.rotate(-angle);
                g2.translate(-intCorners[i][0], -intCorners[i][1]);
            }
View Full Code Here

                g2.setClip(g.getClip()); // Restore initial clip
                g2.translate(intCorners[i][0], intCorners[i][1]);
                g2.rotate(angle);
                g2.clip(shape);
                painter.paint(shape, g2, color, i);
                g2.rotate(-angle);
                g2.translate(-intCorners[i][0], -intCorners[i][1]);
            }
        }
        g2.dispose();
    }
View Full Code Here

      g.setColor(getForeground());
      g.setFont(f);
      g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);

      g.rotate(-Math.PI / 2);
      g.translate(-bi.getHeight(), bi.getWidth());
      g.drawString(caption, WIDHT_MARGIN , -HEIGHT_MARGIN - fm.getDescent());

      Icon icon = new ImageIcon(bi);
      setIcon(icon);
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.