Package org.apache.fop.fo.properties

Examples of org.apache.fop.fo.properties.LengthRangeProperty


        if (log.isTraceEnabled()) {
            log.trace("len of part: " + len);
        }

        if (start == 0) {
            LengthRangeProperty bpd = pgu.getCell()
                    .getBlockProgressionDimension();
            if (!bpd.getMinimum(tclm.getTableLM()).isAuto()) {
                int min = bpd.getMinimum(tclm.getTableLM())
                            .getLength().getValue(tclm.getTableLM());
                if (min > 0) {
                    len = Math.max(len, min);
                }
            }
            if (!bpd.getOptimum(tclm.getTableLM()).isAuto()) {
                int opt = bpd.getOptimum(tclm.getTableLM())
                            .getLength().getValue(tclm.getTableLM());
                if (opt > 0) {
                    len = Math.max(len, opt);
                }
            }
            if (pgu.getRow() != null) {
                bpd = pgu.getRow().getBlockProgressionDimension();
                if (!bpd.getMinimum(tclm.getTableLM()).isAuto()) {
                    int min = bpd.getMinimum(tclm.getTableLM()).getLength()
                                .getValue(tclm.getTableLM());
                    if (min > 0) {
                        len = Math.max(len, min);
                    }
                }
View Full Code Here


                        //Determine the table-row if any
                        if (tableRow == null && primary.getRow() != null) {
                            tableRow = primary.getRow();
                           
                            //Check for bpd on row, see CSS21, 17.5.3 Table height algorithms
                            LengthRangeProperty bpd = tableRow.getBlockProgressionDimension();
                            if (!bpd.getMinimum(getTableLM()).isAuto()) {
                                minContentHeight = Math.max(
                                        minContentHeight,
                                        bpd.getMinimum(
                                                getTableLM()).getLength().getValue(getTableLM()));
                            }
                            MinOptMaxUtil.restrict(explicitRowHeights[rgi], bpd, getTableLM());
                           
                        }

                        //Calculate width of cell
                        int spanWidth = 0;
                        for (int i = primary.getStartCol();
                                i < primary.getStartCol()
                                        + primary.getCell().getNumberColumnsSpanned();
                                i++) {
                            if (getTableLM().getColumns().getColumn(i + 1) != null) {
                                spanWidth += getTableLM().getColumns().getColumn(i + 1)
                                    .getColumnWidth().getValue(getTableLM());
                            }
                        }
                        LayoutContext childLC = new LayoutContext(0);
                        childLC.setStackLimit(context.getStackLimit()); //necessary?
                        childLC.setRefIPD(spanWidth);
                       
                        //Get the element list for the cell contents
                        LinkedList elems = primary.getCellLM().getNextKnuthElements(
                                                childLC, alignment);
                        //Temporary? Multiple calls in case of break conditions.
                        //TODO Revisit when table layout is restartable
                        while (!primary.getCellLM().isFinished()) {
                            LinkedList additionalElems = primary.getCellLM().getNextKnuthElements(
                                    childLC, alignment);
                            elems.addAll(additionalElems);
                        }
                        ElementListObserver.observe(elems, "table-cell", primary.getCell().getId());

                        if ((elems.size() > 0)
                                && ((KnuthElement)elems.getLast()).isForcedBreak()) {
                            // a descendant of this block has break-after
                            log.debug("Descendant of table-cell signals break: "
                                    + primary.getCellLM().isFinished());
                        }
                       
                        primary.setElements(elems);
                       
                        if (childLC.isKeepWithNextPending()) {
                            log.debug("child LM signals pending keep-with-next");
                            primary.setFlag(GridUnit.KEEP_WITH_NEXT_PENDING, true);
                        }
                        if (childLC.isKeepWithPreviousPending()) {
                            log.debug("child LM signals pending keep-with-previous");
                            primary.setFlag(GridUnit.KEEP_WITH_PREVIOUS_PENDING, true);
                        }
                    }

                   
                    //Calculate height of cell contents
                    primary.setContentLength(ElementListUtils.calcContentLength(
                            primary.getElements()));
                    maxCellHeight = Math.max(maxCellHeight, primary.getContentLength());

                    //Calculate height of row, see CSS21, 17.5.3 Table height algorithms
                    if (gu.isLastGridUnitRowSpan()) {
                        int effCellContentHeight = minContentHeight;
                        LengthRangeProperty bpd = primary.getCell().getBlockProgressionDimension();
                        if (!bpd.getMinimum(getTableLM()).isAuto()) {
                            effCellContentHeight = Math.max(
                                effCellContentHeight,
                                bpd.getMinimum(getTableLM()).getLength().getValue(getTableLM()));
                        }
                        if (!bpd.getOptimum(getTableLM()).isAuto()) {
                            effCellContentHeight = Math.max(
                                effCellContentHeight,
                                bpd.getOptimum(getTableLM()).getLength().getValue(getTableLM()));
                        }
                        if (gu.getRowSpanIndex() == 0) {
                            //TODO ATM only non-row-spanned cells are taken for this
                            MinOptMaxUtil.restrict(explicitRowHeights[rgi], bpd, tableLM);
                        }
View Full Code Here

            TableRow tableRowFO = rowGroup[rgi].getTableRow();
            if (tableRowFO == null) {
                rowHeights[rgi] = new MinOptMax(0, 0, Integer.MAX_VALUE);
                explicitRowHeight = new MinOptMax(0, 0, Integer.MAX_VALUE);
            } else {
                LengthRangeProperty rowBPD = tableRowFO.getBlockProgressionDimension();
                rowHeights[rgi] = MinOptMaxUtil.toMinOptMax(rowBPD, tableLM);
                explicitRowHeight = MinOptMaxUtil.toMinOptMax(rowBPD, tableLM);
            }
            for (Iterator iter = row.getGridUnits().iterator(); iter.hasNext();) {
                GridUnit gu = (GridUnit) iter.next();
                if (!gu.isEmpty() && gu.getColSpanIndex() == 0 && gu.isLastGridUnitRowSpan()) {
                    PrimaryGridUnit primary = gu.getPrimary();
                    int effectiveCellBPD = 0;
                    LengthRangeProperty cellBPD = primary.getCell().getBlockProgressionDimension();
                    if (!cellBPD.getMinimum(tableLM).isAuto()) {
                        effectiveCellBPD = cellBPD.getMinimum(tableLM).getLength()
                                .getValue(tableLM);
                    }
                    if (!cellBPD.getOptimum(tableLM).isAuto()) {
                        effectiveCellBPD = cellBPD.getOptimum(tableLM).getLength()
                                .getValue(tableLM);
                    }
                    if (gu.getRowSpanIndex() == 0) {
                        effectiveCellBPD = Math.max(effectiveCellBPD, explicitRowHeight.opt);
                    }
View Full Code Here

                prop = null;
                LengthPairProperty lpp = mainProp.getLengthPair();
                if (lpp != null) {
                    prop = lpp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
                LengthRangeProperty lrp = mainProp.getLengthRange();
                if (lrp != null) {
                    prop = lrp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
                KeepProperty kp = mainProp.getKeep();
                if (kp != null) {
                    prop = kp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
View Full Code Here

                prop = null;
                LengthPairProperty lpp = mainProp.getLengthPair();
                if (lpp != null) {
                    prop = lpp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
                LengthRangeProperty lrp = mainProp.getLengthRange();
                if (lrp != null) {
                    prop = lrp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
                KeepProperty kp = mainProp.getKeep();
                if (kp != null) {
                    prop = kp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
View Full Code Here

            TableRow tableRowFO = rowGroup[rgi].getTableRow();
            if (tableRowFO == null) {
                rowHeights[rgi] = MAX_STRETCH;
                explicitRowHeight = MAX_STRETCH;
            } else {
                LengthRangeProperty rowBPD = tableRowFO.getBlockProgressionDimension();
                rowHeights[rgi] = rowBPD.toMinOptMax(tableLM);
                explicitRowHeight = rowBPD.toMinOptMax(tableLM);
            }
            for (Iterator iter = row.getGridUnits().iterator(); iter.hasNext();) {
                GridUnit gu = (GridUnit) iter.next();
                if (!gu.isEmpty() && gu.getColSpanIndex() == 0 && gu.isLastGridUnitRowSpan()) {
                    PrimaryGridUnit primary = gu.getPrimary();
                    int effectiveCellBPD = 0;
                    LengthRangeProperty cellBPD = primary.getCell().getBlockProgressionDimension();
                    if (!cellBPD.getMinimum(tableLM).isAuto()) {
                        effectiveCellBPD = cellBPD.getMinimum(tableLM).getLength()
                                .getValue(tableLM);
                    }
                    if (!cellBPD.getOptimum(tableLM).isAuto()) {
                        effectiveCellBPD = cellBPD.getOptimum(tableLM).getLength()
                                .getValue(tableLM);
                    }
                    if (gu.getRowSpanIndex() == 0) {
                        effectiveCellBPD = Math.max(effectiveCellBPD, explicitRowHeight.getOpt());
                    }
View Full Code Here

                prop = null;
                LengthPairProperty lpp = mainProp.getLengthPair();
                if (lpp != null) {
                    prop = lpp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
                LengthRangeProperty lrp = mainProp.getLengthRange();
                if (lrp != null) {
                    prop = lrp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
                KeepProperty kp = mainProp.getKeep();
                if (kp != null) {
                    prop = kp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
View Full Code Here

            TableRow tableRowFO = rowGroup[rgi].getTableRow();
            if (tableRowFO == null) {
                rowHeights[rgi] = MAX_STRETCH;
                explicitRowHeight = MAX_STRETCH;
            } else {
                LengthRangeProperty rowBPD = tableRowFO.getBlockProgressionDimension();
                rowHeights[rgi] = rowBPD.toMinOptMax(tableLM);
                explicitRowHeight = rowBPD.toMinOptMax(tableLM);
            }
            for (Iterator iter = row.getGridUnits().iterator(); iter.hasNext();) {
                GridUnit gu = (GridUnit) iter.next();
                if (!gu.isEmpty() && gu.getColSpanIndex() == 0 && gu.isLastGridUnitRowSpan()) {
                    PrimaryGridUnit primary = gu.getPrimary();
                    int effectiveCellBPD = 0;
                    LengthRangeProperty cellBPD = primary.getCell().getBlockProgressionDimension();
                    if (!cellBPD.getMinimum(tableLM).isAuto()) {
                        effectiveCellBPD = cellBPD.getMinimum(tableLM).getLength()
                                .getValue(tableLM);
                    }
                    if (!cellBPD.getOptimum(tableLM).isAuto()) {
                        effectiveCellBPD = cellBPD.getOptimum(tableLM).getLength()
                                .getValue(tableLM);
                    }
                    if (gu.getRowSpanIndex() == 0) {
                        effectiveCellBPD = Math.max(effectiveCellBPD, explicitRowHeight.getOpt());
                    }
View Full Code Here

                        //Determine the table-row if any
                        if (tableRow == null && primary.getRow() != null) {
                            tableRow = primary.getRow();
                           
                            //Check for bpd on row, see CSS21, 17.5.3 Table height algorithms
                            LengthRangeProperty bpd = tableRow.getBlockProgressionDimension();
                            if (!bpd.getMinimum(getTableLM()).isAuto()) {
                                minContentHeight = Math.max(
                                        minContentHeight,
                                        bpd.getMinimum(
                                                getTableLM()).getLength().getValue(getTableLM()));
                            }
                            MinOptMaxUtil.restrict(explicitRowHeights[rgi], bpd, getTableLM());
                           
                        }

                        //Calculate width of cell
                        int spanWidth = 0;
                        for (int i = primary.getStartCol();
                                i < primary.getStartCol()
                                        + primary.getCell().getNumberColumnsSpanned();
                                i++) {
                            if (getTableLM().getColumns().getColumn(i + 1) != null) {
                                spanWidth += getTableLM().getColumns().getColumn(i + 1)
                                    .getColumnWidth().getValue(getTableLM());
                            }
                        }
                        LayoutContext childLC = new LayoutContext(0);
                        childLC.setStackLimit(context.getStackLimit()); //necessary?
                        childLC.setRefIPD(spanWidth);
                       
                        //Get the element list for the cell contents
                        LinkedList elems = primary.getCellLM().getNextKnuthElements(
                                                childLC, alignment);
                        //Temporary? Multiple calls in case of break conditions.
                        //TODO Revisit when table layout is restartable
                        while (!primary.getCellLM().isFinished()) {
                            LinkedList additionalElems = primary.getCellLM().getNextKnuthElements(
                                    childLC, alignment);
                            elems.addAll(additionalElems);
                        }
                        ElementListObserver.observe(elems, "table-cell", primary.getCell().getId());

                        if ((elems.size() > 0)
                                && ((KnuthElement)elems.getLast()).isForcedBreak()) {
                            // a descendant of this block has break-after
                            log.debug("Descendant of table-cell signals break: "
                                    + primary.getCellLM().isFinished());
                        }
                       
                        primary.setElements(elems);
                       
                        if (childLC.isKeepWithNextPending()) {
                            log.debug("child LM signals pending keep-with-next");
                            primary.setFlag(GridUnit.KEEP_WITH_NEXT_PENDING, true);
                        }
                        if (childLC.isKeepWithPreviousPending()) {
                            log.debug("child LM signals pending keep-with-previous");
                            primary.setFlag(GridUnit.KEEP_WITH_PREVIOUS_PENDING, true);
                        }
                    }

                   
                    //Calculate height of cell contents
                    primary.setContentLength(ElementListUtils.calcContentLength(
                            primary.getElements()));
                    maxCellHeight = Math.max(maxCellHeight, primary.getContentLength());

                    //Calculate height of row, see CSS21, 17.5.3 Table height algorithms
                    if (gu.isLastGridUnitRowSpan()) {
                        int effCellContentHeight = minContentHeight;
                        LengthRangeProperty bpd = primary.getCell().getBlockProgressionDimension();
                        if (!bpd.getMinimum(getTableLM()).isAuto()) {
                            effCellContentHeight = Math.max(
                                effCellContentHeight,
                                bpd.getMinimum(getTableLM()).getLength().getValue(getTableLM()));
                        }
                        if (!bpd.getOptimum(getTableLM()).isAuto()) {
                            effCellContentHeight = Math.max(
                                effCellContentHeight,
                                bpd.getOptimum(getTableLM()).getLength().getValue(getTableLM()));
                        }
                        if (gu.getRowSpanIndex() == 0) {
                            //TODO ATM only non-row-spanned cells are taken for this
                            MinOptMaxUtil.restrict(explicitRowHeights[rgi], bpd, tableLM);
                        }
View Full Code Here

                    if (log.isTraceEnabled()) {
                        log.trace("len of part: " + len);
                    }

                    if (start[i] == 0) {
                        LengthRangeProperty bpd = gridUnits[i].getCell()
                                .getBlockProgressionDimension();
                        if (!bpd.getMinimum(getTableLM()).isAuto()) {
                            int min = bpd.getMinimum(getTableLM())
                                        .getLength().getValue(getTableLM());
                            if (min > 0) {
                                len = Math.max(len, bpd.getMinimum(getTableLM())
                                        .getLength().getValue(getTableLM()));
                            }
                        }
                        if (!bpd.getOptimum(getTableLM()).isAuto()) {
                            int opt = bpd.getOptimum(getTableLM())
                                        .getLength().getValue(getTableLM());
                            if (opt > 0) {
                                len = Math.max(len, opt);
                            }
                        }
                        if (gridUnits[i].getRow() != null) {
                            bpd = gridUnits[i].getRow().getBlockProgressionDimension();
                            if (!bpd.getMinimum(getTableLM()).isAuto()) {
                                int min = bpd.getMinimum(getTableLM()).getLength()
                                            .getValue(getTableLM());
                                if (min > 0) {
                                    len = Math.max(len, min);
                                }
                            }
View Full Code Here

TOP

Related Classes of org.apache.fop.fo.properties.LengthRangeProperty

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.