Package java.awt

Examples of java.awt.Graphics2D.rotate()


      for (int i = 0; i < mapWithHoly.length; i++) {
        mapWithHoly[i] = new Point((x - 1)
            - (int) mapWithHoly[i].getX(),
            (x - 1) - (int) mapWithHoly[i].getY());
      }
      bgGraphic.rotate(180 * Math.PI / 180, 160.5, 160.5);
      bgGraphic.drawImage(imgBackground, 0, 0, null);
      break;
    case BOTTOMLEFT:
      for (int i = 0; i < mapWithPath.length; i++) {
        mapWithPath[i] = new Point((int) mapWithPath[i].getY(),
View Full Code Here


      }
      for (int i = 0; i < mapWithHoly.length; i++) {
        mapWithHoly[i] = new Point((int) mapWithHoly[i].getY(),
            (x - 1) - (int) mapWithHoly[i].getX());
      }
      bgGraphic.rotate(270 * Math.PI / 180, 160.5, 160.5);
      bgGraphic.drawImage(imgBackground, 0, 0, null);
      break;
   
    default:
      logger.severe("Unknown BoardLocation");
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

        double scaleY = (double)height / (double) this.height;
        graphics.scale(scaleX, scaleY);
       
        // center rotation point on region and rotate
        graphics.translate(Math.round((double)getWidth()/2),Math.round((double)getHeight()/2));
        graphics.rotate(Math.toRadians(angle));
       
        // draw
        graphics.drawImage(bimage,-x,-y,null);
       
      }
View Full Code Here

          .min(0, (int) (dx + p.getX()));

      g2.translate(p.getX() - offset, p.getY());
      if (applyTransform) {
        angle = getLabelAngle(label);
        g2.rotate(angle);
      }
      if (isOpaque() && mainLabel) {
        g.setColor(getBackground());
        g.fillRect((int) (-sw / 2 - 1), (int) (-sh / 2 - 1), sw + 2,
            sh + 2);
View Full Code Here

        dy = -metrics.getDescent();
      }
      g.drawString(label, dx, dy);
      if (applyTransform) {
        // Undo the transform
        g2.rotate(-angle);
      }
      g2.translate(-p.getX() + offset, -p.getY());
    }
  }
View Full Code Here

      height = width;
      width = tempH;
    }
    BufferedImage img = new BufferedImage(width, height, getType(image));
    Graphics2D g2D = img.createGraphics();
    g2D.rotate(Math.toRadians(angle), width >>> 1, height >>> 1);
    g2D.drawImage(image, null, (width >>> 1) - (image.getWidth() >>> 1),
        (height >>> 1) - (image.getHeight() >>> 1));
    g2D.dispose();
    return img;
  }
View Full Code Here

        if (scale != 1) {
            g2.scale((double)scale, (double)scale);
        }
        int rotation = getRotation();
        if (rotation != 0) {
            g2.rotate(Math.toRadians(rotation));
        }
        drawImage(g2, "face", getFaceStyle());
        drawImage(g2, "hair", getHairStyle());
        drawImage(g2, "eyes", getEyeStyle());
        drawImage(g2, "nose", getNoseStyle());
View Full Code Here

        * scale.x),
        (int) (se.position.y + (currentSprite.offsety - currentSprite.sizey / 2)
        * scale.y));
        Point size = new Point((int) (currentSprite.sizex * scale.x),
        (int) (currentSprite.sizey * scale.y));
        g2.rotate(se.theta, position.x + size.x / 2, position.y
        + size.y / 2);
        //g2.draw(new Rectangle(position.x, position.y, size.x, size.y));
        g2.drawImage(fungoImg, position.x, position.y, size.x, size.y,
        this);
        g2.rotate(-se.theta, (position.x + size.x / 2),
View Full Code Here

        g2.rotate(se.theta, position.x + size.x / 2, position.y
        + size.y / 2);
        //g2.draw(new Rectangle(position.x, position.y, size.x, size.y));
        g2.drawImage(fungoImg, position.x, position.y, size.x, size.y,
        this);
        g2.rotate(-se.theta, (position.x + size.x / 2),
        (position.y + size.y / 2));
      }
    }

    /*
 
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.