Package java.awt

Examples of java.awt.Graphics2D.rotate()


                gfx.translate(x, y);
                gfx.translate(translatex, translatey);

                if (rotate) {
                    gfx.rotate(Math.toRadians(90));
                    gfx.translate(0, -w);
                    painter.paint(gfx, context.getComponent(), h, w);
                    gfx.translate(0, w);
                    gfx.rotate(Math.toRadians(-90));
                } else if (flip) {
View Full Code Here


                if (rotate) {
                    gfx.rotate(Math.toRadians(90));
                    gfx.translate(0, -w);
                    painter.paint(gfx, context.getComponent(), h, w);
                    gfx.translate(0, w);
                    gfx.rotate(Math.toRadians(-90));
                } else if (flip) {
                    gfx.scale(-1, 1);
                    gfx.translate(-w, 0);
                    painter.paint(gfx, context.getComponent(), w, h);
                    gfx.translate(w, 0);
View Full Code Here

                // it is not a instance of Graphics2D
                BufferedImage img = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
                Graphics2D    gfx = img.createGraphics();

                if (rotate) {
                    gfx.rotate(Math.toRadians(90));
                    gfx.translate(0, -w);
                    painter.paint(gfx, context.getComponent(), h, w);
                } else if (flip) {
                    gfx.scale(-1, 1);
                    gfx.translate(-w, 0);
View Full Code Here

    }

    private void paintForegroundEnabledAndVertical(Graphics2D g, int width, int height) {
        Graphics2D g2 = (Graphics2D) g.create();
        g2.translate(0, height);
        g2.rotate(Math.toRadians(-90));

        paintForegroundEnabled(g2, height, width);
    }

    private void paintForegroundFocusedAndVertical(Graphics2D g, JComponent c, int width, int height) {
View Full Code Here

    }

    private void paintForegroundFocusedAndVertical(Graphics2D g, JComponent c, int width, int height) {
        Graphics2D g2 = (Graphics2D) g.create();
        g2.translate(0, height);
        g2.rotate(Math.toRadians(-90));

        paintForegroundFocused(g2, c, height, width);
    }

    private void paintForegroundFocused(Graphics2D g, JComponent c, int width, int height) {
View Full Code Here

      g.setRenderingHint(
        RenderingHints.KEY_ANTIALIASING,
        RenderingHints.VALUE_ANTIALIAS_ON);
     
      g.setColor(Color.RED);
      g.rotate(theta, w / 2, h / 2);
     
      g.fillRect(50, 50, 100, 100);

      picture.setPts(time);
      writer.encodeVideo(videoStreamIndex, image,
View Full Code Here

          RenderingHints.KEY_ANTIALIASING,
          RenderingHints.VALUE_ANTIALIAS_ON);

        double theta = videoTime / 1000000d;
        g.setColor(Color.RED);
        g.rotate(theta, w / 2, h / 2);
       
        g.fillRect(50, 50, 100, 100);
       
        picture.setPts(videoTime);
        writer.encodeVideo(videoStreamIndex, image, videoTime,
View Full Code Here

    updateFont();

    if (vertical)
    {
      g2 = (Graphics2D) state.g.create();
      g2.rotate(-Math.PI / 2, x + w / 2, y + h / 2);
    }

    if (state.fontColor == null)
    {
      state.fontColor = parseColor(state.fontColorValue);
View Full Code Here

      int w = rect.width;
      int h = rect.height;

      if (!mxUtils.isTrue(style, mxConstants.STYLE_HORIZONTAL, true))
      {
        g.rotate(-Math.PI / 2, x + w / 2, y + h / 2);
        g.translate(w / 2 - h / 2, h / 2 - w / 2);

        int tmp = w;
        w = h;
        h = tmp;
View Full Code Here

      int w = rect.width;
      int h = rect.height;

      if (!horizontal)
      {
        g.rotate(-Math.PI / 2, x + w / 2, y + h / 2);
        g.translate(w / 2 - h / 2, h / 2 - w / 2);
      }

      Color fontColor = mxUtils.getColor(style,
          mxConstants.STYLE_FONTCOLOR, Color.black);
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.