Examples of BorderInfo


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

                Block[][] blocks = new Block[getTableCell().getNumberRowsSpanned()][getTableCell()
                        .getNumberColumnsSpanned()];
                GridUnit[] gridUnits = (GridUnit[]) primaryGridUnit.getRows().get(startRow);
                for (int x = 0; x < getTableCell().getNumberColumnsSpanned(); x++) {
                    GridUnit gu = gridUnits[x];
                    BorderInfo border = gu.getBorderBefore(borderBeforeWhich);
                    int borderWidth = border.getRetainedWidth() / 2;
                    if (borderWidth > 0) {
                        addBorder(blocks, startRow, x, Trait.BORDER_BEFORE, border, firstOnPage);
                        adjustYOffset(blocks[startRow][x], -borderWidth);
                        adjustBPD(blocks[startRow][x], -borderWidth);
                    }
                }
                gridUnits = (GridUnit[]) primaryGridUnit.getRows().get(endRow);
                for (int x = 0; x < getTableCell().getNumberColumnsSpanned(); x++) {
                    GridUnit gu = gridUnits[x];
                    BorderInfo border = gu.getBorderAfter(borderAfterWhich);
                    int borderWidth = border.getRetainedWidth() / 2;
                    if (borderWidth > 0) {
                        addBorder(blocks, endRow, x, Trait.BORDER_AFTER, border, lastOnPage);
                        adjustBPD(blocks[endRow][x], -borderWidth);
                    }
                }
                for (int y = startRow; y <= endRow; y++) {
                    gridUnits = (GridUnit[]) primaryGridUnit.getRows().get(y);
                    BorderInfo border = gridUnits[0].getBorderStart();
                    int borderWidth = border.getRetainedWidth() / 2;
                    if (borderWidth > 0) {
                        addBorder(blocks, y, 0, Trait.BORDER_START, border, inFirstColumn);
                        adjustXOffset(blocks[y][0], borderWidth);
                        adjustIPD(blocks[y][0], -borderWidth);
                    }
                    border = gridUnits[gridUnits.length - 1].getBorderEnd();
                    borderWidth = border.getRetainedWidth() / 2;
                    if (borderWidth > 0) {
                        addBorder(blocks, y, gridUnits.length - 1, Trait.BORDER_END, border,
                                inLastColumn);
                        adjustIPD(blocks[y][gridUnits.length - 1], -borderWidth);
                    }
View Full Code Here

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

public class CollapsingBorderModelEyeCatching extends CollapsingBorderModel {

    /** {@inheritDoc} */
    public BorderSpecification determineWinner(BorderSpecification border1,
            BorderSpecification border2, boolean discard) {
        BorderInfo bi1 = border1.getBorderInfo();
        BorderInfo bi2 = border2.getBorderInfo();
        if (discard) {
            if (bi1.getWidth().isDiscard()) {
                if (bi2.getWidth().isDiscard()) {
                    return new BorderSpecification(
                            CommonBorderPaddingBackground.getDefaultBorderInfo(), 0/*TODO*/);
                } else {
                    return border2;
                }
            } else if (bi2.getWidth().isDiscard()) {
                return border1;
            }
        }
        // Otherwise, fall back to the default resolution algorithm
        return determineWinner(border1, border2);
View Full Code Here

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

    }

    /** {@inheritDoc} */
    public BorderSpecification determineWinner(BorderSpecification border1,
            BorderSpecification border2) {
        BorderInfo bi1 = border1.getBorderInfo();
        BorderInfo bi2 = border2.getBorderInfo();
        // Rule 1
        if (bi1.getStyle() == Constants.EN_HIDDEN) {
            return border1;
        } else if (bi2.getStyle() == Constants.EN_HIDDEN) {
            return border2;
        }
        // Rule 2
        if (bi2.getStyle() == Constants.EN_NONE) {
            return border1;
        } else if (bi1.getStyle() == Constants.EN_NONE) {
            return border2;
        }
        // Rule 3
        int width1 = bi1.getRetainedWidth();
        int width2 = bi2.getRetainedWidth();
        if (width1 > width2) {
            return border1;
        } else if (width1 == width2) {
            int cmp = compareStyles(bi1.getStyle(), bi2.getStyle());
            if (cmp > 0) {
                return border1;
            } else if (cmp < 0) {
                return border2;
            }
View Full Code Here

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

        return (GridUnit) ((List) ((List) part.getRowGroups().get(0)).get(0)).get(0);
    }

    private static void checkBorder(String errorMsge, BorderSpecification border,
            int expectedLength, Color expectedColor) {
        BorderInfo borderInfo = border.getBorderInfo();
        if (expectedLength == 0) {
            assertEquals(errorMsge, Constants.EN_NONE, borderInfo.getStyle());
        } else {
            assertEquals(errorMsge, expectedLength, borderInfo.getWidth().getLengthValue());
            assertEquals(errorMsge, expectedColor, borderInfo.getColor());
        }
    }
View Full Code Here

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

    private void addAreaForEmptyGridUnit(EmptyGridUnit gu, int rowIndex, int colIndex,
            int actualRowHeight,
            int borderBeforeWhich, int borderAfterWhich, boolean lastOnPage) {

        //get effective borders
        BorderInfo borderBefore = gu.getBorderBefore(borderBeforeWhich);
        BorderInfo borderAfter = gu.getBorderAfter(borderAfterWhich);
        BorderInfo borderStart = gu.getBorderStart();
        BorderInfo borderEnd = gu.getBorderEnd();
        if (borderBefore.getRetainedWidth() == 0
                && borderAfter.getRetainedWidth() == 0
                && borderStart.getRetainedWidth() == 0
                && borderEnd.getRetainedWidth() == 0) {
            return; //no borders, no area necessary
        }

        TableLayoutManager tableLM = tclm.getTableLM();
        Table table = tableLM.getTable();
        TableColumn col = tclm.getColumns().getColumn(colIndex + 1);

        //position information
        boolean firstOnPage = (rowIndex == firstRowOnPageIndex);
        boolean inFirstColumn = (colIndex == 0);
        boolean inLastColumn = (colIndex == table.getNumberOfColumns() - 1);

        //determine the block area's size
        int ipd = col.getColumnWidth().getValue(tableLM);
        ipd -= (borderStart.getRetainedWidth() + borderEnd.getRetainedWidth()) / 2;
        int bpd = actualRowHeight;
        bpd -= (borderBefore.getRetainedWidth() + borderAfter.getRetainedWidth()) / 2;

        //generate the block area
        Block block = new Block();
View Full Code Here

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

        return (GridUnit) ((List) ((List) part.getRowGroups().get(0)).get(0)).get(0);
    }

    private static void checkBorder(String errorMsge, BorderSpecification border,
            int expectedLength, Color expectedColor) {
        BorderInfo borderInfo = border.getBorderInfo();
        if (expectedLength == 0) {
            assertEquals(errorMsge, Constants.EN_NONE, borderInfo.getStyle());
        } else {
            assertEquals(errorMsge, expectedLength, borderInfo.getWidth().getLengthValue());
            assertEquals(errorMsge, expectedColor, borderInfo.getColor());
        }
    }
View Full Code Here

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

public class CollapsingBorderModelEyeCatching extends CollapsingBorderModel {

    /** {@inheritDoc} */
    public BorderSpecification determineWinner(BorderSpecification border1,
            BorderSpecification border2, boolean discard) {
        BorderInfo bi1 = border1.getBorderInfo();
        BorderInfo bi2 = border2.getBorderInfo();
        if (discard) {
            if (bi1.getWidth().isDiscard()) {
                if (bi2.getWidth().isDiscard()) {
                    return new BorderSpecification(
                            CommonBorderPaddingBackground.getDefaultBorderInfo(), 0/*TODO*/);
                } else {
                    return border2;
                }
            } else if (bi2.getWidth().isDiscard()) {
                return border1;
            }
        }
        // Otherwise, fall back to the default resolution algorithm
        return determineWinner(border1, border2);
View Full Code Here

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

    }

    /** {@inheritDoc} */
    public BorderSpecification determineWinner(BorderSpecification border1,
            BorderSpecification border2) {
        BorderInfo bi1 = border1.getBorderInfo();
        BorderInfo bi2 = border2.getBorderInfo();
        // Rule 1
        if (bi1.getStyle() == Constants.EN_HIDDEN) {
            return border1;
        } else if (bi2.getStyle() == Constants.EN_HIDDEN) {
            return border2;
        }
        // Rule 2
        if (bi2.getStyle() == Constants.EN_NONE) {
            return border1;
        } else if (bi1.getStyle() == Constants.EN_NONE) {
            return border2;
        }
        // Rule 3
        int width1 = bi1.getRetainedWidth();
        int width2 = bi2.getRetainedWidth();
        if (width1 > width2) {
            return border1;
        } else if (width1 == width2) {
            int cmp = compareStyles(bi1.getStyle(), bi2.getStyle());
            if (cmp > 0) {
                return border1;
            } else if (cmp < 0) {
                return border2;
            }
View Full Code Here

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

        return (GridUnit) ((List) ((List) part.getRowGroups().get(0)).get(0)).get(0);
    }

    private static void checkBorder(String errorMsge, BorderSpecification border,
            int expectedLength, Color expectedColor) {
        BorderInfo borderInfo = border.getBorderInfo();
        if (expectedLength == 0) {
            assertEquals(errorMsge, Constants.EN_NONE, borderInfo.getStyle());
        } else {
            assertEquals(errorMsge, expectedLength, borderInfo.getWidth().getLengthValue());
            assertEquals(errorMsge, expectedColor, borderInfo.getColor());
        }
    }
View Full Code Here

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

                Block[][] blocks = new Block[getTableCell().getNumberRowsSpanned()][getTableCell()
                        .getNumberColumnsSpanned()];
                GridUnit[] gridUnits = (GridUnit[]) primaryGridUnit.getRows().get(startRow);
                for (int x = 0; x < getTableCell().getNumberColumnsSpanned(); x++) {
                    GridUnit gu = gridUnits[x];
                    BorderInfo border = gu.getBorderBefore(borderBeforeWhich);
                    int borderWidth = border.getRetainedWidth() / 2;
                    if (borderWidth > 0) {
                        addBorder(blocks, startRow, x, Trait.BORDER_BEFORE, border, firstOnPage);
                        adjustYOffset(blocks[startRow][x], -borderWidth);
                        adjustBPD(blocks[startRow][x], -borderWidth);
                    }
                }
                gridUnits = (GridUnit[]) primaryGridUnit.getRows().get(endRow);
                for (int x = 0; x < getTableCell().getNumberColumnsSpanned(); x++) {
                    GridUnit gu = gridUnits[x];
                    BorderInfo border = gu.getBorderAfter(borderAfterWhich);
                    int borderWidth = border.getRetainedWidth() / 2;
                    if (borderWidth > 0) {
                        addBorder(blocks, endRow, x, Trait.BORDER_AFTER, border, lastOnPage);
                        adjustBPD(blocks[endRow][x], -borderWidth);
                    }
                }
                for (int y = startRow; y <= endRow; y++) {
                    gridUnits = (GridUnit[]) primaryGridUnit.getRows().get(y);
                    BorderInfo border = gridUnits[0].getBorderStart();
                    int borderWidth = border.getRetainedWidth() / 2;
                    if (borderWidth > 0) {
                        addBorder(blocks, y, 0, Trait.BORDER_START, border, inFirstColumn);
                        adjustXOffset(blocks[y][0], borderWidth);
                        adjustIPD(blocks[y][0], -borderWidth);
                    }
                    border = gridUnits[gridUnits.length - 1].getBorderEnd();
                    borderWidth = border.getRetainedWidth() / 2;
                    if (borderWidth > 0) {
                        addBorder(blocks, y, gridUnits.length - 1, Trait.BORDER_END, border,
                                inLastColumn);
                        adjustIPD(blocks[y][gridUnits.length - 1], -borderWidth);
                    }
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.