Package org.apache.fop.area

Examples of org.apache.fop.area.Block


     * @param childArea the child area
     * @return the parent area of the child
     */
    public Area getParentArea(Area childArea) {
        if (curBlockArea == null) {
            curBlockArea = new Block();
            // Set up dimensions
            // Must get dimensions from parent area
            /*Area parentArea =*/ parentLM.getParentArea(curBlockArea);
           
            TraitSetter.setProducerID(curBlockArea, getTable().getId());
View Full Code Here


     */
    public Block getRowArea(TableRow row) {
        if (row == null || !row.getCommonBorderPaddingBackground().hasBackground()) {
            return null;
        } else {
            Block block = new Block();
            block.addTrait(Trait.IS_REFERENCE_AREA, Boolean.TRUE);
            block.setPositioning(Block.ABSOLUTE);
            return block;
        }
    }
View Full Code Here

     * @param ipd inline-progression-dimension of the row
     * @param yoffset Y offset at which to paint
     */
    public void addRowBackgroundArea(TableRow row, int bpd, int ipd, int yoffset) {
        //Add row background if any
        Block rowBackground = getRowArea(row);
        if (rowBackground != null) {
            rowBackground.setBPD(bpd);
            rowBackground.setIPD(ipd);
            rowBackground.setXOffset(this.startXOffset);
            rowBackground.setYOffset(yoffset);
            getTableLM().addChildArea(rowBackground);
            TraitSetter.addBackground(rowBackground,
                    row.getCommonBorderPaddingBackground(), getTableLM());
        }
    }
View Full Code Here

                // we need to know in advance the separator bpd: the actual separator
                // could be different from page to page, but its bpd would likely be
                // always the same

                // create a Block area that will contain the separator areas
                separatorArea = new Block();
                separatorArea.setIPD(pslm.getCurrentPV()
                            .getRegionReference(Constants.FO_REGION_BODY).getIPD());
                // create a StaticContentLM for the footnote separator
                footnoteSeparatorLM = (StaticContentLayoutManager)
                    pslm.getLayoutManagerMaker().makeStaticContentLayoutManager(
View Full Code Here

    protected void addAreas(PositionIterator posIter, LayoutContext context) {
        if (footnoteSeparatorLM != null) {
            StaticContent footnoteSeparator = pslm.getPageSequence().getStaticContent(
                    "xsl-footnote-separator");
            // create a Block area that will contain the separator areas
            separatorArea = new Block();
            separatorArea.setIPD(
                    pslm.getCurrentPV().getRegionReference(Constants.FO_REGION_BODY).getIPD());
            // create a StaticContentLM for the footnote separator
            footnoteSeparatorLM = (StaticContentLayoutManager)
                pslm.getLayoutManagerMaker().makeStaticContentLayoutManager(
View Full Code Here

                viewportBlockArea.setYOffset(offset.y);
            } else {
                //nop
            }

            referenceArea = new Block();
            referenceArea.addTrait(Trait.IS_REFERENCE_AREA, Boolean.TRUE);
            TraitSetter.setProducerID(referenceArea, getBlockContainerFO().getId());

            if (abProps.absolutePosition == EN_ABSOLUTE) {
                viewportBlockArea.setPositioning(Block.ABSOLUTE);
View Full Code Here

     */
    protected void renderBeforeFloat(BeforeFloat bf) {
        List blocks = bf.getChildAreas();
        if (blocks != null) {
            renderBlocks(null, blocks);
            Block sep = bf.getSeparator();
            if (sep != null) {
                renderBlock(sep);
            }
        }
    }
View Full Code Here

     */
    protected void renderFootnote(Footnote footnote) {
        currentBPPosition += footnote.getTop();
        List blocks = footnote.getChildAreas();
        if (blocks != null) {
            Block sep = footnote.getSeparator();
            if (sep != null) {
                renderBlock(sep);
            }
            renderBlocks(null, blocks);
        }
View Full Code Here

                    int dx = xoffset;
                    for (int x = 0; x < gridUnits.length; x++) {
                        GridUnit gu = gridUnits[x];
                        if (gu.hasBorders()) {
                            //Blocks for painting grid unit borders
                            Block block = new Block();
                            block.addTrait(Trait.IS_REFERENCE_AREA, Boolean.TRUE);
                            block.setPositioning(Block.ABSOLUTE);
   
                            int bpd = spannedGridRowHeights[y - startRow];
                            bpd -= gu.getBorders().getBorderBeforeWidth(false) / 2;
                            bpd -= gu.getBorders().getBorderAfterWidth(false) / 2;
                            block.setBPD(bpd);
                            if (log.isTraceEnabled()) {
                                log.trace("pgu: " + primaryGridUnit + "; gu: " + gu + "; yoffset: "
                                        + (dy - gu.getBorders().getBorderBeforeWidth(false) / 2)
                                        + "; bpd: " + bpd);
                            }
                            int ipd = gu.getColumn().getColumnWidth().getValue(
                                    (PercentBaseContext) getParent());
                            int borderStartWidth = gu.getBorders().getBorderStartWidth(false) / 2;
                            ipd -= borderStartWidth;
                            ipd -= gu.getBorders().getBorderEndWidth(false) / 2;
                            block.setIPD(ipd);
                            block.setXOffset(dx + borderStartWidth);
                            block.setYOffset(dy - gu.getBorders().getBorderBeforeWidth(false) / 2);
                            outer[0] = gu.getFlag(GridUnit.FIRST_IN_TABLE);
                            outer[1] = gu.getFlag(GridUnit.LAST_IN_TABLE);
                            outer[2] = gu.getFlag(GridUnit.IN_FIRST_COLUMN);
                            outer[3] = gu.getFlag(GridUnit.IN_LAST_COLUMN);
                            TraitSetter.addCollapsingBorders(block, gu.getBorders(), outer, this);
                            parentLM.addChildArea(block);
                        }
                        dx += gu.getColumn().getColumnWidth().getValue(
                                (PercentBaseContext) getParent());
                    }
                    dy += spannedGridRowHeights[y - startRow];
                }
            }
        }
        TraitSetter.addPadding(curBlockArea, primaryGridUnit.getBorders(),
                false, false, false, false, this);

        //Handle display-align
        int contentBPD = getContentHeight(primaryGridUnit);
        if (usedBPD < contentBPD) {
            if (getTableCell().getDisplayAlign() == EN_CENTER) {
                Block space = new Block();
                space.setBPD((contentBPD - usedBPD) / 2);
                curBlockArea.addBlock(space);
            } else if (getTableCell().getDisplayAlign() == EN_AFTER) {
                Block space = new Block();
                space.setBPD((contentBPD - usedBPD));
                curBlockArea.addBlock(space);
            }
        }

        AreaAdditionUtil.addAreas(this, parentIter, layoutContext);
View Full Code Here

     * @param childArea the child area to get the parent for
     * @return the parent area
     */
    public Area getParentArea(Area childArea) {
        if (curBlockArea == null) {
            curBlockArea = new Block();
            curBlockArea.addTrait(Trait.IS_REFERENCE_AREA, Boolean.TRUE);
            TraitSetter.setProducerID(curBlockArea, getTableCell().getId());
            curBlockArea.setPositioning(Block.ABSOLUTE);
            int indent = startBorderWidth;
            if (!isSeparateBorderModel()) {
View Full Code Here

TOP

Related Classes of org.apache.fop.area.Block

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.