Package org.apache.batik.gvt

Examples of org.apache.batik.gvt.GraphicsNode.paint()


        aBridge.getCurrentTransform().setTransform(generator.getState().getTransform());

        graphics.setPaintingState(generator.getState());
        graphics.setOutputStream(pdfInfo.outputStream);
        try {
            root.paint(graphics);
            generator.add(graphics.getString());
        } catch (Exception e) {
            SVGEventProducer eventProducer = SVGEventProducer.Provider.get(
                    context.getUserAgent().getEventBroadcaster());
            eventProducer.svgRenderingError(this, e, getDocumentURI(doc));
View Full Code Here


            graphics.setBackgroundColor((Color)hints.get(ImageTranscoder.KEY_BACKGROUND_COLOR));
        }
        graphics.setGraphicContext(new org.apache.batik.ext.awt.g2d.GraphicContext());
        graphics.setRenderingHints(rc.getRenderingHints());

        gvtRoot.paint(graphics, rc);

        try {
            graphics.finish();
        } catch (Exception ex) {
            ex.printStackTrace();
View Full Code Here

        double sx = bounds.getWidth()/sizes[idx].getWidth();
        double sy = bounds.getHeight()/sizes[idx].getHeight();
       
        // System.out.println("Scale: [" + sx + ", " + sy + "]");
        // g2d.scale(sx, sy);
        gn.paint(g2d);
    }

    /**
     * Returns the bounds of the area covered by this node's primitive paint.
     */
 
View Full Code Here

        GraphicsNode gn = getGraphicsNode();
        if (getUsePrimitivePaint()){
            gn.primitivePaint(g2d);
        }
        else{
            gn.paint(g2d);
        }

        // Paint did the work...
        return true;
    }
View Full Code Here

        GraphicsNode gn = pp.getGraphicsNode();
        Rectangle2D gnBBox = gn.getBounds();
        Rectangle2D rect = pp.getPatternRect();

        // if (!pp.getOverflow()) {
            gn.paint(pattGraphic);
        // } else {
        // /* Commented out until SVN version of Batik is included */
        //     // For overflow we need to paint the content from
        //     // all the tiles who's overflow will intersect one
        //     // tile (left->right, top->bottom).  Then we can
View Full Code Here

                float w = (float) area.getWidth();
                float h = (float) area.getHeight();
                g2d.translate(area.getX(), area.getY());
                g2d.scale(w / iw, h / ih);

                root.paint(g2d);
            }

            public Dimension getImageSize() {
                return new Dimension(svg.getSize().getWidthMpt(), svg.getSize().getHeightMpt());
            }
View Full Code Here

     */
    public void paint(Graphics2D g2d) {

        GraphicsNode gNode = svgComponent.getGraphicsNode();
        if (gNode != null) {
            gNode.paint(g2d);
        }
    }

    /**
     * add a listener to receive a callback after Batik has finished rendering
View Full Code Here

        GraphicsNode gn = getGraphicsNode();
        if (getUsePrimitivePaint()){
            gn.primitivePaint(g2d);
        }
        else{
            gn.paint(g2d);
        }

        // Paint did the work...
        return true;
    }
View Full Code Here

        // double sx = bounds.getWidth()/sizes[idx].getWidth();
        // double sy = bounds.getHeight()/sizes[idx].getHeight();
        // System.err.println("Scale: [" + sx + ", " + sy + "]");

        gn.paint(g2d);
    }

    // This function can be tweaked to any extent.  This is a very
    // simple measure of 'goodness'.  It has two main flaws as is,
    // mostly in regards to distance calc with 'unbounded' ranges.
View Full Code Here

        if (hints.containsKey(ImageTranscoder.KEY_BACKGROUND_COLOR)) {
            graphics.setBackgroundColor((Color)hints.get(ImageTranscoder.KEY_BACKGROUND_COLOR));
        }
        graphics.setGraphicContext(new org.apache.batik.ext.awt.g2d.GraphicContext());

        gvtRoot.paint(graphics);

        try {
            graphics.finish();
        } catch (Exception ex) {
            ex.printStackTrace();
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.