Package java.awt

Examples of java.awt.Graphics2D.translate()


      g2d.setStroke(basicStroke);

      g2d.drawLine(0, getIconHeight() / 2, getIconWidth(), getIconHeight() / 2);
      g2d.setColor(origColor);

      g2d.translate(-x, -y);
      g2d.setStroke(origStroke);
      g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, hint);
    }

    public int getIconWidth()
View Full Code Here


            if (getTextMatteColor() != null) {
                FontRenderContext context = g2.getFontRenderContext();
                GlyphVector glyphVector = g2.getFont()
                        .createGlyphVector(context, string);
                Shape outline = glyphVector.getOutline();
                g2.translate(x, y);
                g2.setStroke(getTextMatteStroke());
                g2.setColor(getTextMatteColor());
                g2.draw(outline);
                g2.translate(-x, -y);
View Full Code Here

                Shape outline = glyphVector.getOutline();
                g2.translate(x, y);
                g2.setStroke(getTextMatteStroke());
                g2.setColor(getTextMatteColor());
                g2.draw(outline);
                g2.translate(-x, -y);

                g2.setColor(getLineColor());
            }
        }
        g.drawString(string, x, y);
View Full Code Here

    final Rectangle2D.Double drawAreaBounds = new Rectangle2D.Double
        (x - extraPadding, y - extraPadding, width + 2 * extraPadding, height + 2 * extraPadding);

    clone.clip(drawAreaBounds);
    clone.translate(x, y);
    if (shouldFill)
    {
      configureFillColor(layoutContext, clone);
      clone.fill(scaledShape);
    }
View Full Code Here

 
  public void render(Graphics2D grx, Rectangle2D rectangle)
      throws JRException
  {
    Graphics2D graphics = (Graphics2D) grx.create();
    graphics.translate(rectangle.getX(), rectangle.getY());
    graphics.setColor(FILL);
   
    if (clip != null)
    {
      graphics.clip(clip);
View Full Code Here

    AffineTransform transform = ViewBox.getPreserveAspectRatioTransform(
        new float[]{0, 0, (float) documentSize.getWidth(), (float) documentSize.getHeight()},
        SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_NONE, true,
        (float) rectangle.getWidth(), (float) rectangle.getHeight());
    Graphics2D graphics = (Graphics2D) grx.create();
    graphics.translate(rectangle.getX(), rectangle.getY());
    graphics.transform(transform);

    // CompositeGraphicsNode not thread safe
    synchronized (rootNode)
    {
View Full Code Here


        // fill grid
        int gr=getGrid();
        if( (gr > 0) && _param.gridDisplay) {
            g2.translate(_param.xmargin,_param.ymargin);
            Stroke oldStroke = g2.getStroke();

            g2.setStroke(_gridStrocke);
            g2.setColor(_gridColor);
           
View Full Code Here

            for(int j=0;j<=ny;j++){
                g2.drawLine(0,j*gr,lx,j*gr);
                //g2.fillRect(0,j*gr,lx,1);
            }
            g2.setStroke(oldStroke);
            g2.translate(-_param.xmargin,-_param.ymargin);
        }

        // Display page format limits if option is enable
        if (isPrintViewEnabled) {
            g2.setColor(Color.WHITE);
View Full Code Here

    //
    //   Printable interface
    //
    public int print(Graphics g, PageFormat pf, int pnum) throws PrinterException {
        Graphics2D g2 = (Graphics2D)g;
        g2.translate((int) pf.getImageableX(), (int) pf.getImageableY());

        // shape the graphic if option has been selected   
        if (_scaleSheet) {
            double s = computePrintScaleFactor(pf);
            g2.scale(s, s);
View Full Code Here

        if (pageIndex >= totalNumPages) {
            response = NO_SUCH_PAGE;
        }
        else {
            // shift Graphic to line up with beginning of print-imageable region
            g2.translate(pf.getImageableX(), pf.getImageableY());
            // shift Graphic to line up with beginning of next page to print
            g2.translate(0f, -pageIndex * pageHeight);
            // scale the page so the width fits...
            g2.scale(scale, scale);
            // for faster printing, turn off double buffering
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.