Package org.xhtmlrenderer.render

Examples of org.xhtmlrenderer.render.BlockBox


        GC gc = new GC(_printer);
        RenderingContext c = null;
        try {
            // LAYOUT
            LayoutContext layout = newLayoutcontext(gc);
            BlockBox rootBox;

            try {
                long start = System.currentTimeMillis();

                rootBox = BoxBuilder.createRootBox(layout, doc);

                PageBox first = Layer.createPageBox(layout, "first");
                rootBox.setContainingBlock(new ViewportBox(new Rectangle(0, 0,
                    first.getContentWidth(layout), first
                        .getContentHeight(layout))));
                rootBox.layout(layout);

                long end = System.currentTimeMillis();
                XRLog.layout(Level.INFO, "Layout took " + (end - start) + "ms");
            } catch (Throwable e) {
                XRLog.exception(e.getMessage(), e);
                return;
            }

            Layer root = rootBox.getLayer();
            Dimension intrinsic_size = root.getPaintingDimension(layout);
            root.trimEmptyPages(layout, intrinsic_size.height);
            root.assignPagePaintingPositions(layout, Layer.PAGED_MODE_PRINT);

            // RENDER
View Full Code Here


                    previousIB = currentIB;
                    currentIB = currentIB.getParent() instanceof LineBox ?
                            null : (InlineLayoutBox) currentIB.getParent();
                }
            } else {
               BlockBox child = (BlockBox)node;

               if (child.getStyle().isNonFlowContent()) {
                   remainingWidth -= processOutOfFlowContent(
                           c, currentLine, child, remainingWidth, pendingFloats);
               } else if (child.getStyle().isInlineBlock() || child.getStyle().isInlineTable()) {
                   layoutInlineBlockContent(c, box, child, initialY);

                   if (child.getWidth() > remainingWidth && currentLine.isContainsContent()) {
                       saveLine(currentLine, c, box, minimumLineHeight,
                               maxAvailableWidth, pendingFloats,  hasFirstLinePEs,
                               pendingInlineLayers, markerData, contentStart,
                               isAlwaysBreak(c, box, breakAtLine, lineOffset));
                       lineOffset++;
                       markerData = null;
                       contentStart = 0;
                       previousLine = currentLine;
                       currentLine = newLine(c, previousLine, box);
                       currentIB = addOpenInlineBoxes(
                               c, currentLine, openInlineBoxes, maxAvailableWidth, iBMap);
                       previousIB = currentIB == null || currentIB.getParent() instanceof LineBox ?
                               null : (InlineLayoutBox) currentIB.getParent();
                       remainingWidth = maxAvailableWidth;
                       remainingWidth -= c.getBlockFormattingContext().getFloatDistance(c, currentLine, remainingWidth);

                       child.reset(c);
                       layoutInlineBlockContent(c, box, child, initialY);
                   }

                   if (currentIB == null) {
                       currentLine.addChildForLayout(c, child);
                   } else {
                       currentIB.addInlineChild(c, child);
                   }

                   currentLine.setContainsContent(true);
                   currentLine.setContainsBlockLevelContent(true);

                   remainingWidth -= child.getWidth();

                   if (currentIB != null && currentIB.isStartsHere()) {
                       pendingLeftMBP -= currentIB.getStyle().getMarginBorderPadding(
                               c, maxAvailableWidth, CalculatedStyle.LEFT);
                   }

                   needFirstLetter = false;

                   if (child.getWidth() == 0) {
                       zeroWidthInlineBlock = true;
                   }
               }
            }
        }
View Full Code Here

        return null;
    }

    private void setCellWidths(LayoutContext c) {
        for (Iterator i = getChildIterator(); i.hasNext(); ) {
            BlockBox box = (BlockBox)i.next();
            if (box.getStyle().isTableSection()) {
                ((TableSectionBox)box).setCellWidths(c);
            }
        }
    }
View Full Code Here

        return _pdfVersion == null ? '0' : _pdfVersion.charValue();
    }

    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

        return _pdfVersion == null ? '0' : _pdfVersion.charValue();
    }

    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

TOP

Related Classes of org.xhtmlrenderer.render.BlockBox

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.