public void collect( CssContext c, Shape clip, Layer layer, List blockContent, List inlineContent, BoxRangeLists rangeLists) { if (layer.isInline()) { collectInlineLayer(c, clip, layer, blockContent, inlineContent, rangeLists); } else { collect(c, clip, layer, layer.getMaster(), blockContent, inlineContent, rangeLists); } }
private void collectInlineLayer( CssContext c, Shape clip, Layer layer, List blockContent, List inlineContent, BoxRangeLists rangeLists) { InlineLayoutBox iB = (InlineLayoutBox)layer.getMaster(); List content = iB.getElementWithContent(); for (int i = 0; i < content.size(); i++) { Box b = (Box)content.get(i); if (b.intersects(c, clip)) { if (b instanceof InlineLayoutBox) { inlineContent.add(b); } else { BlockBox bb = (BlockBox)b; if (bb.isInline()) { if (intersectsAny(c, clip, b)) { inlineContent.add(b); } } else { collect(c, clip, layer, bb, blockContent, inlineContent, rangeLists); } } } } }
public void collect( CssContext c, Shape clip, Layer layer, List blockContent, List inlineContent, BoxRangeLists rangeLists) { if (layer.isInline()) { collectInlineLayer(c, clip, layer, blockContent, inlineContent, rangeLists); } else { collect(c, clip, layer, layer.getMaster(), blockContent, inlineContent, rangeLists); } }
private void collectInlineLayer( CssContext c, Shape clip, Layer layer, List blockContent, List inlineContent, BoxRangeLists rangeLists) { InlineLayoutBox iB = (InlineLayoutBox)layer.getMaster(); List content = iB.getElementWithContent(); for (int i = 0; i < content.size(); i++) { Box b = (Box)content.get(i); if (b.intersects(c, clip)) { if (b instanceof InlineLayoutBox) { inlineContent.add(b); } else { BlockBox bb = (BlockBox)b; if (bb.isInline()) { if (intersectsAny(c, clip, b)) { inlineContent.add(b); } } else { collect(c, clip, layer, bb, blockContent, inlineContent, rangeLists); } } } } }
BoxRangeLists rangeLists = new BoxRangeLists(); List blocks = new ArrayList(); List lines = new ArrayList(); BoxCollector collector = new BoxCollector(); collector.collect(c, c.getOutputDevice().getClip(), this, startingPoint, blocks, lines, rangeLists); Map collapsedTableBorders = collectCollapsedTableBorders(c, blocks); paintBackgroundsAndBorders(c, blocks, collapsedTableBorders, rangeLists); paintListMarkers(c, blocks, rangeLists); paintInlineContent(c, lines, rangeLists); paintSelection(c, lines); // XXX only do when there is a selection paintReplacedElements(c, blocks, rangeLists); } private void paintListMarkers(RenderingContext c, List blocks, BoxRangeLists rangeLists) {
public void paintAsLayer(RenderingContext c, BlockBox startingPoint) { BoxRangeLists rangeLists = new BoxRangeLists(); List blocks = new ArrayList(); List lines = new ArrayList(); BoxCollector collector = new BoxCollector(); collector.collect(c, c.getOutputDevice().getClip(), this, startingPoint, blocks, lines, rangeLists); Map collapsedTableBorders = collectCollapsedTableBorders(c, blocks); paintBackgroundsAndBorders(c, blocks, collapsedTableBorders, rangeLists); paintListMarkers(c, blocks, rangeLists); paintInlineContent(c, lines, rangeLists); paintSelection(c, lines); // XXX only do when there is a selection paintReplacedElements(c, blocks, rangeLists); }
for (int i = 0; i < container.getChildCount(); i++) { Box child = container.getChild(i); collect(c, clip, layer, child, blockContent, inlineContent, rangeLists);
for (int i = 0; i < container.getChildCount(); i++) { Box child = container.getChild(i); collect(c, clip, layer, child, blockContent, inlineContent, rangeLists);
collector.collect(c, c.getOutputDevice().getClip(), this, blocks, lines, rangeLists);
collector.collect(c, c.getOutputDevice().getClip(), this, blocks, lines, rangeLists);