Package org.apache.fop.fo.properties

Examples of org.apache.fop.fo.properties.CommonBorderPaddingBackground$BorderInfo


     * @param isLast true if this is the last time a layout manager instance needs to generate
     *               border and padding
     */
    protected void addKnuthElementsForBorderPaddingAfter(List returnList, boolean isLast) {
        //Border and Padding (after)
        CommonBorderPaddingBackground borderAndPadding = getBorderPaddingBackground();
        if (borderAndPadding != null) {
            if (borderAndPadding.getPaddingAfter(false, this) > 0) {
                returnList.add(new PaddingElement(
                        getAuxiliaryPosition(),
                        borderAndPadding.getPaddingLengthProperty(
                                CommonBorderPaddingBackground.AFTER),
                        RelSide.AFTER, false, isLast, this));
            }
            if (borderAndPadding.getBorderAfterWidth(false) > 0) {
                returnList.add(new BorderElement(
                        getAuxiliaryPosition(),
                        borderAndPadding.getBorderInfo(CommonBorderPaddingBackground.AFTER)
                                .getWidth(),
                        RelSide.AFTER, false, isLast, this));
            }
        }
    }
View Full Code Here


        //somehow. There was some code here that hints in this direction but it was disabled.

        ImageLayout imageLayout = new ImageLayout(fobj, this, intrinsicSize);
        Rectangle placement = imageLayout.getPlacement();

        CommonBorderPaddingBackground borderProps = fobj.getCommonBorderPaddingBackground();

        //Determine extra BPD from borders and padding
        int beforeBPD = borderProps.getPadding(CommonBorderPaddingBackground.BEFORE, false, this);
        beforeBPD += borderProps.getBorderWidth(CommonBorderPaddingBackground.BEFORE, false);

        placement.y += beforeBPD;

        //Determine extra IPD from borders and padding
        int startIPD = borderProps.getPadding(CommonBorderPaddingBackground.START, false, this);
        startIPD += borderProps.getBorderWidth(CommonBorderPaddingBackground.START, false);

        placement.x += startIPD;

        Area viewportArea = getChildArea();
        TraitSetter.setProducerID(viewportArea, fobj.getId());
View Full Code Here

         * At least, avoid adding it to the bpd sequence.
         */
        if (returnList instanceof BlockKnuthSequence) {
            return;
        }
        CommonBorderPaddingBackground borderAndPadding =
                ((InlineLevel)fobj).getCommonBorderPaddingBackground();
        if (borderAndPadding != null) {
            int ipStart = borderAndPadding.getBorderStartWidth(false)
                         + borderAndPadding.getPaddingStart(false, this);
            if (ipStart > 0) {
                returnList.add(0,new KnuthBox(ipStart, getAuxiliaryPosition(), true));
            }
        }
    }
View Full Code Here

         * At least, avoid adding it to the bpd sequence.
         */
        if (returnList instanceof BlockKnuthSequence) {
            return;
        }
        CommonBorderPaddingBackground borderAndPadding =
                ((InlineLevel)fobj).getCommonBorderPaddingBackground();
        if (borderAndPadding != null) {
            int ipEnd = borderAndPadding.getBorderEndWidth(false)
                        + borderAndPadding.getPaddingEnd(false, this);
            if (ipEnd > 0) {
                returnList.add(new KnuthBox(ipEnd, getAuxiliaryPosition(), true));
            }
        }
    }
View Full Code Here

    public int getBeforeBorderWidth(int rowIndex, int which) {
        if (isSeparateBorderModel) {
            if (getCell() == null) {
                return 0;
            } else {
                CommonBorderPaddingBackground cellBorders = getCell()
                        .getCommonBorderPaddingBackground();
                switch (which) {
                case ConditionalBorder.NORMAL:
                case ConditionalBorder.LEADING_TRAILING:
                    return cellBorders.getBorderBeforeWidth(false) + halfBorderSeparationBPD;
                case ConditionalBorder.REST:
                    if (cellBorders.getBorderInfo(CommonBorderPaddingBackground.BEFORE).getWidth()
                            .isDiscard()) {
                        return 0;
                    } else {
                        return cellBorders.getBorderBeforeWidth(true) + halfBorderSeparationBPD;
                    }
                default:
                    assert false;
                    return 0;
                }
View Full Code Here

    public int getAfterBorderWidth(int rowIndex, int which) {
        if (isSeparateBorderModel) {
            if (getCell() == null) {
                return 0;
            } else {
                CommonBorderPaddingBackground cellBorders = getCell()
                        .getCommonBorderPaddingBackground();
                switch (which) {
                case ConditionalBorder.NORMAL:
                case ConditionalBorder.LEADING_TRAILING:
                    return cellBorders.getBorderAfterWidth(false) + halfBorderSeparationBPD;
                case ConditionalBorder.REST:
                    if (cellBorders.getBorderInfo(CommonBorderPaddingBackground.AFTER).getWidth()
                            .isDiscard()) {
                        return 0;
                    } else {
                        return cellBorders.getBorderAfterWidth(true) + halfBorderSeparationBPD;
                    }
                default:
                    assert false;
                    return 0;
                }
View Full Code Here

    }

    ActiveCell(PrimaryGridUnit pgu, EffRow row, int rowIndex, int previousRowsLength,
            TableLayoutManager tableLM) {
        this.pgu = pgu;
        CommonBorderPaddingBackground bordersPaddings = pgu.getCell()
                .getCommonBorderPaddingBackground();
        TableCellLayoutManager cellLM = pgu.getCellLM();
        paddingBeforeNormal = bordersPaddings.getPaddingBefore(false, cellLM);
        paddingBeforeLeading = bordersPaddings.getPaddingBefore(true, cellLM);
        paddingAfterNormal = bordersPaddings.getPaddingAfter(false, cellLM);
        paddingAfterTrailing = bordersPaddings.getPaddingAfter(true, cellLM);
        bpBeforeNormal = paddingBeforeNormal
                + pgu.getBeforeBorderWidth(0, ConditionalBorder.NORMAL);
        bpBeforeLeading = paddingBeforeLeading
                + pgu.getBeforeBorderWidth(0, ConditionalBorder.REST);
        bpAfterNormal = paddingAfterNormal + pgu.getAfterBorderWidth(ConditionalBorder.NORMAL);
View Full Code Here

        addId();

        int borderBeforeWidth = primaryGridUnit.getBeforeBorderWidth(startRow, borderBeforeWhich);
        int borderAfterWidth = primaryGridUnit.getAfterBorderWidth(endRow, borderAfterWhich);

        CommonBorderPaddingBackground padding = primaryGridUnit.getCell()
                .getCommonBorderPaddingBackground();
        int paddingRectBPD = totalHeight - borderBeforeWidth - borderAfterWidth;
        int cellBPD = paddingRectBPD;
        cellBPD -= padding.getPaddingBefore(borderBeforeWhich == ConditionalBorder.REST, this);
        cellBPD -= padding.getPaddingAfter(borderAfterWhich == ConditionalBorder.REST, this);

        addBackgroundAreas(painter, firstRowHeight, borderBeforeWidth, paddingRectBPD);

        if (isSeparateBorderModel()) {
            if (!emptyCell || getTableCell().showEmptyCells()) {
View Full Code Here

    private static void adjustBPD(Block block, int amount) {
        block.setBPD(block.getBPD() + amount);
    }

    private Block getBackgroundArea(int bpd, int borderBeforeWidth) {
        CommonBorderPaddingBackground padding = getTableCell().getCommonBorderPaddingBackground();
        int paddingStart = padding.getPaddingStart(false, this);
        int paddingEnd = padding.getPaddingEnd(false, this);

        Block block = new Block();
        TraitSetter.setProducerID(block, getTable().getId());
        block.setPositioning(Block.ABSOLUTE);
        block.setIPD(cellIPD + paddingStart + paddingEnd);
View Full Code Here

     * @return a BorderAndPadding object
     * @throws PropertyException if there's a problem while processing the properties
     */
    public CommonBorderPaddingBackground getBorderPaddingBackgroundProps()
                throws PropertyException {
        return new CommonBorderPaddingBackground(this, getFObj());
    }
View Full Code Here

TOP

Related Classes of org.apache.fop.fo.properties.CommonBorderPaddingBackground$BorderInfo

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.