Package org.xhtmlrenderer.render

Examples of org.xhtmlrenderer.render.RenderingContext


        getSharedContext().setCanvas(this);

        XRLog.layout(Level.FINEST, "new context end");
       
        RenderingContext result = getSharedContext().newRenderingContextInstance();
        result.setFontContext(new Java2DFontContext(g));
        result.setOutputDevice(new Java2DOutputDevice(g));
       
        getSharedContext().getTextRenderer().setup(result.getFontContext());
       
        if (rootBox != null) {
            result.setRootLayer(rootBox.getLayer());
        }

        return result;
    }
View Full Code Here


        if (root == null) {
            //Uu.p("dispatching an initial resize event");
            //queue.dispatchLayoutEvent(new ReflowEvent(ReflowEvent.CANVAS_RESIZED, this.getSize()));
            XRLog.render(Level.FINE, "skipping the actual painting");
        } else {
            RenderingContext c = newRenderingContext((Graphics2D) g.create());
            long start = System.currentTimeMillis();
            doRender(c, root);
            long end = System.currentTimeMillis();
            XRLog.render(Level.FINE, "RENDERING TOOK " + (end - start) + " ms");
        }
View Full Code Here

        if (pageNo < 0 || pageNo >= root.getPages().size()) {
            throw new IllegalArgumentException("Page " + pageNo + " is not between 0 " +
                    "and " + root.getPages().size());
        }

        RenderingContext c = newRenderingContext(g);

        PageBox page = (PageBox)root.getPages().get(pageNo);
        c.setPageCount(root.getPages().size());
        c.setPage(pageNo, page);

        page.paintBackground(c, 0, Layer.PAGED_MODE_PRINT);
        page.paintMarginAreas(c, 0, Layer.PAGED_MODE_PRINT);
        page.paintBorder(c, 0, Layer.PAGED_MODE_PRINT);
View Full Code Here

        g.setClip(working);
    }

    public void assignPagePrintPositions(Graphics2D g) {
        RenderingContext c = newRenderingContext(g);
        getRootLayer().assignPagePaintingPositions(c, Layer.PAGED_MODE_PRINT);
    }
View Full Code Here

            try {
                if ( renderingHints != null ) {
                    newG.getRenderingHints().putAll(renderingHints);
                }

                RenderingContext rc = sharedContext.newRenderingContextInstance();
                rc.setFontContext(new Java2DFontContext(newG));
                rc.setOutputDevice(outputDevice);
                sharedContext.getTextRenderer().setup(rc.getFontContext());

                root.getLayer().paint(rc);
            } finally {
                if (newG != null) newG.dispose();
            }
View Full Code Here

      Graphics2D newG = (Graphics2D) outputImage.getGraphics();
      if ( renderingHints != null ) {
        newG.getRenderingHints().putAll(renderingHints);
      }

      RenderingContext rc = sharedContext.newRenderingContextInstance();
      rc.setFontContext(new Java2DFontContext(newG));
      rc.setOutputDevice(outputDevice);
      sharedContext.getTextRenderer().setup(rc.getFontContext());

      root.getLayer().paint(rc);

      newG.dispose();
      rendered = true;
View Full Code Here

        if (root == null) {
            //Uu.p("dispatching an initial resize event");
            //queue.dispatchLayoutEvent(new ReflowEvent(ReflowEvent.CANVAS_RESIZED, this.getSize()));
            XRLog.render(Level.FINE, "skipping the actual painting");
        } else {
            RenderingContext c = newRenderingContext((Graphics2D) g);
            long start = System.currentTimeMillis();
            doRender(c, root);
            long end = System.currentTimeMillis();
            XRLog.render(Level.FINE, "RENDERING TOOK " + (end - start) + " ms");
        }
View Full Code Here

        if (pageNo < 0 || pageNo >= root.getPages().size()) {
            throw new IllegalArgumentException("Page " + pageNo + " is not between 0 " +
                    "and " + root.getPages().size());
        }

        RenderingContext c = newRenderingContext(g);

        PageBox page = (PageBox)root.getPages().get(pageNo);
        c.setPageCount(root.getPages().size());
        c.setPage(pageNo, page);
       
        page.paintBackground(c, 0, Layer.PAGED_MODE_PRINT);
        page.paintMarginAreas(c, 0, Layer.PAGED_MODE_PRINT);
        page.paintBorder(c, 0, Layer.PAGED_MODE_PRINT);
       
View Full Code Here

       
        g.setClip(working);
    }
   
    public void assignPagePrintPositions(Graphics2D g) {
        RenderingContext c = newRenderingContext(g);
        getRootLayer().assignPagePaintingPositions(c, Layer.PAGED_MODE_PRINT);
    }
View Full Code Here

       
        return new Rectangle(0, 0, first.getContentWidth(c), first.getContentHeight(c));
    }
   
    private RenderingContext newRenderingContext() {
        RenderingContext result = _sharedContext.newRenderingContextInstance();
        result.setFontContext(new ITextFontContext());
       
       
        result.setOutputDevice(_outputDevice);
       
        _sharedContext.getTextRenderer().setup(result.getFontContext());
       
        result.setRootLayer(_root.getLayer());

        return result;
    }
View Full Code Here

TOP

Related Classes of org.xhtmlrenderer.render.RenderingContext

Copyright © 2018 www.massapicom. 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.