Package java.awt

Examples of java.awt.Graphics2D.rotate()


    if (_clockwise) {
      g2.translate(x + getIconWidth(), y);
      g2.rotate(Math.PI / 2);
    } else {
      g2.translate(x, y + getIconHeight());
      g2.rotate(-Math.PI / 2);
    }
    int extraSpace = 0;
    if (_icon != null) {
      extraSpace = _icon.getIconHeight() + 10;
      _icon.paintIcon(c, g, x + 5, y);
View Full Code Here


           
            int w = bufImg.getWidth(null);
            int h = bufImg.getHeight(null);
            BufferedImage bufNewImg = new BufferedImage(w, h, bufImgType);
            Graphics2D g = bufNewImg.createGraphics();
            g.rotate(Math.toRadians(Double.parseDouble(angle)), w/2, h/2);
            g.drawImage(bufImg,0,0,null);
            g.dispose();
           
            String mimeType = imageName.substring(imageName.lastIndexOf(".") + 1);
            ImageIO.write((RenderedImage) bufNewImg, mimeType, new File(imageServerPath + "/" + productId + "/" + filenameToUse));
View Full Code Here

                if ((i + 15) % 60 == second) {
                    g.setColor(new Color(255, 0, 0, 128));
                    g.setStroke(secondHand);
                    g.drawLine(0, 0, radius-margin*4, 0);
                }
                g.rotate(Math.PI*2/60);
            }
            g.dispose();
        }
       
        public Image getIconImage() {
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

            FontMetrics metrics = g.getFontMetrics();
            int infoWidth = metrics.stringWidth(text);
            int infoDescent = metrics.getDescent();
            if(AppConstants.WATERMARK_STYLE_CROSS.equalsIgnoreCase(vo.getParams().getWatermarkTextStyle())){
                //cross text watermark style
                g.rotate(Math.toRadians(-45),sw*1.0f/2,sh*1.0f/2);
                g.drawString(vo.getParams().getWatermarkText(), (sw- infoWidth)/2, sh/2);
            } else if(AppConstants.WATERMARK_STYLE_TINY.equalsIgnoreCase(vo.getParams().getWatermarkTextStyle())){
                g.drawString(vo.getParams().getWatermarkText(), sw - infoWidth - 10, sh - infoDescent-10)
            }
            g.dispose();
View Full Code Here

            {
                 int w = retval.getWidth();   
                 int h = retval.getHeight();   
                 BufferedImage rotatedImg = new BufferedImage(w, h, retval.getType());   
                 Graphics2D g = rotatedImg.createGraphics();   
                 g.rotate(Math.toRadians(rotation), w/2, h/2);   
                 g.drawImage(retval, null, 0, 0);   
            }
        }
        catch (ImagingOpException e)
        {
View Full Code Here

                if (i != null) {
                    tmp.translate(i.left + x, i.top + y);
                } else {
                        tmp.translate(x, y);
                }
                tmp.rotate(textRotation);

                painting = true;
                // uncomment to highlight text area
                // Color c = g2.getColor();
                // g2.setColor(Color.RED);
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

                case VERTICAL: {
                    dataRenderer.setSize(Math.max(getHeight() - (buttonPadding.top + buttonPadding.bottom + 2), 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

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.