Package org.xhtmlrenderer.render

Examples of org.xhtmlrenderer.render.BlockBox.layout()


  private void layout(int width) {
    Rectangle rect = new Rectangle(0, 0, width, DEFAULT_HEIGHT);
    sharedContext.set_TempCanvas(rect);
    BlockBox root = BoxBuilder.createRootBox(layoutContext, doc);
    root.setContainingBlock(new ViewportBox(rect));
    root.layout(layoutContext);
    this.root = root;
  }

  private Document loadDocument(final String uri) {
    return sharedContext.getUac().getXMLResource(uri).getDocument();
View Full Code Here


    public void layout() {
        LayoutContext c = newLayoutContext();
        BlockBox root = BoxBuilder.createRootBox(c, _doc);
        root.setContainingBlock(new ViewportBox(getInitialExtents(c)));
        root.layout(c);
        Dimension dim = root.getLayer().getPaintingDimension(c);
        root.getLayer().trimEmptyPages(c, dim.height);
        root.getLayer().layoutPages(c);
        _root = root;
    }
View Full Code Here

    Rectangle rect = new Rectangle(0, 0, width, DEFAULT_HEIGHT);
    sharedContext.set_TempCanvas(rect);
    LayoutContext c = newLayoutContext();
    BlockBox root = BoxBuilder.createRootBox(c, doc);
    root.setContainingBlock(new ViewportBox(rect));
    root.layout(c);
    this.root = root;
  }

  private LayoutContext newLayoutContext() {
    LayoutContext result = sharedContext.newLayoutContextInstance();
View Full Code Here

                root = BoxBuilder.createRootBox(c, doc);
                setRootBox(root);           
            }
           
            root.setContainingBlock(new ViewportBox(getInitialExtents(c)));
            root.layout(c);
           
            long end = System.currentTimeMillis();
           
            XRLog.layout(Level.INFO, "Layout took " + (end - start) + "ms");
           
View Full Code Here

  private void layout(int width) {
    Rectangle rect = new Rectangle(0, 0, width, DEFAULT_HEIGHT);
    sharedContext.set_TempCanvas(rect);
    BlockBox root = BoxBuilder.createRootBox(layoutContext, doc);
    root.setContainingBlock(new ViewportBox(rect));
    root.layout(layoutContext);
    this.root = root;
  }

  private Document loadDocument(final String uri) {
    return sharedContext.getUac().getXMLResource(uri).getDocument();
View Full Code Here

    Rectangle rect = new Rectangle(0, 0, width, DEFAULT_HEIGHT);
    sharedContext.set_TempCanvas(rect);
    LayoutContext c = newLayoutContext();
    BlockBox root = BoxBuilder.createRootBox(c, doc);
    root.setContainingBlock(new ViewportBox(rect));
    root.layout(c);
    this.root = root;
  }

  private Document loadDocument(final String uri) {
    return sharedContext.getUac().getXMLResource(uri).getDocument();
View Full Code Here

            // FIXME Not right in the face of pagination, but what
            // to do?  Not sure if just laying out and positioning
            // repeatedly will converge on the correct position,
            // so just guess for now
            c.reInit(true);
            master.layout(c);
           
            BoxDimensions before = master.getBoxDimensions();
            master.reset(c);
            BoxDimensions after = master.getBoxDimensions();
            master.setBoxDimensions(before);
View Full Code Here

    public void layout() {
        LayoutContext c = newLayoutContext();
        BlockBox root = BoxBuilder.createRootBox(c, _doc);
        root.setContainingBlock(new ViewportBox(getInitialExtents(c)));
        root.layout(c);
        Dimension dim = root.getLayer().getPaintingDimension(c);
        root.getLayer().trimEmptyPages(c, dim.height);
        root.getLayer().layoutPages(c);
        _root = root;
    }
View Full Code Here

    Rectangle rect = new Rectangle(0, 0, width, DEFAULT_HEIGHT);
    sharedContext.set_TempCanvas(rect);
    LayoutContext c = newLayoutContext();
    BlockBox root = BoxBuilder.createRootBox(c, doc);
    root.setContainingBlock(new ViewportBox(rect));
    root.layout(c);
    this.root = root;
  }

  private Document loadDocument(final String uri) {
    return sharedContext.getUac().getXMLResource(uri).getDocument();
View Full Code Here

  private void layout(int width) {
    Rectangle rect = new Rectangle(0, 0, width, DEFAULT_HEIGHT);
    sharedContext.set_TempCanvas(rect);
    BlockBox root = BoxBuilder.createRootBox(layoutContext, doc);
    root.setContainingBlock(new ViewportBox(rect));
    root.layout(layoutContext);
    this.root = root;
  }

  private Document loadDocument(final String uri) {
    return sharedContext.getUac().getXMLResource(uri).getDocument();
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.