Examples of BreakElement


Examples of org.apache.fop.layoutmgr.BreakElement

                        //Clear keep pending flag
                        context.setFlags(LayoutContext.KEEP_WITH_NEXT_PENDING, false);
                        childLC.setFlags(LayoutContext.KEEP_WITH_PREVIOUS_PENDING, false);
                        // add an infinite penalty to forbid a break between
                        // blocks
                        contentList.add(new BreakElement(
                                new Position(this), KnuthElement.INFINITE, context));
                        //contentList.add(new KnuthPenalty(0,
                        //        KnuthElement.INFINITE, false,
                        //        new Position(this), false));
                    } else if (!((ListElement) contentList.getLast()).isGlue()) {
                        // add a null penalty to allow a break between blocks
                        contentList.add(new BreakElement(
                                new Position(this), 0, context));
                        //contentList.add(new KnuthPenalty(0, 0, false,
                        //        new Position(this), false));
                    } else {
                        // the last element in contentList is a glue;
View Full Code Here

Examples of org.apache.fop.layoutmgr.BreakElement

                    if (last.isPenalty()) {
                        KnuthPenalty pen = (KnuthPenalty)last;
                        pen.setP(-KnuthPenalty.INFINITE);
                        pen.setBreakClass(rowFO.getBreakBefore());
                    } else if (last instanceof BreakElement) {
                        BreakElement breakPoss = (BreakElement)last;
                        breakPoss.setPenaltyValue(-KnuthPenalty.INFINITE);
                        breakPoss.setBreakClass(rowFO.getBreakBefore());
                    }
                } else {
                    if (!firstBreakBeforeServed) {
                        //returnList.add(new KnuthPenalty(0, -KnuthPenalty.INFINITE,
                        //        false, rowFO.getBreakBefore(), new Position(getTableLM()), true));
                        returnList.add(new BreakElement(new Position(getTableLM()),
                                0, -KnuthPenalty.INFINITE, rowFO.getBreakBefore(), context));
                        iter.backToPreviousRow();
                        firstBreakBeforeServed = true;
                        break;
                    }
                }
            }
            firstBreakBeforeServed = true;
           
            //Border resolution
            if (!isSeparateBorderModel()) {
                resolveNormalBeforeAfterBordersForRowGroup(rowGroup, iter);
            }
           
            //Element list creation
            createElementsForRowGroup(context, alignment, bodyType,
                        returnList, rowGroup);
           
            //Handle keeps
            if (context.isKeepWithNextPending()) {
                log.debug("child LM (row group) signals pending keep-with-next");
            }
            if (context.isKeepWithPreviousPending()) {
                log.debug("child LM (row group) signals pending keep-with-previous");
                if (returnList.size() > 0) {
                    //Modify last penalty
                    ListElement last = (ListElement)returnList.getLast();
                    if (last.isPenalty()) {
                        BreakElement breakPoss = (BreakElement)last;
                        //Only honor keep if there's no forced break
                        if (!breakPoss.isForcedBreak()) {
                            breakPoss.setPenaltyValue(KnuthPenalty.INFINITE);
                        }
                    }
                }
            }
           
            //Check for break-after on the table-row at the end of the row group
            rowFO = rowGroup[rowGroup.length - 1].getTableRow();
            if (rowFO != null && rowFO.getBreakAfter() != Constants.EN_AUTO) {
                log.info("break-after found");
                if (returnList.size() > 0) {
                    ListElement last = (ListElement)returnList.getLast();
                    if (last instanceof KnuthPenalty) {
                        KnuthPenalty pen = (KnuthPenalty)last;
                        pen.setP(-KnuthPenalty.INFINITE);
                        pen.setBreakClass(rowFO.getBreakAfter());
                    } else if (last instanceof BreakElement) {
                        BreakElement breakPoss = (BreakElement)last;
                        breakPoss.setPenaltyValue(-KnuthPenalty.INFINITE);
                        breakPoss.setBreakClass(rowFO.getBreakAfter());
                    }
                }
            }
        }
       
View Full Code Here

Examples of org.apache.fop.layoutmgr.BreakElement

                int p = 0;
                if (keepWithNextActive || mustKeepTogether()) {
                    p = KnuthPenalty.INFINITE;
                }
                //returnList.add(new KnuthPenalty(penaltyHeight, p, false, stepPosition, false));
                returnList.add(new BreakElement(stepPosition, penaltyHeight, p, 0, context));
            }
        }

        return returnList;
    }
View Full Code Here

Examples of org.apache.fop.layoutmgr.BreakElement

        LinkedList returnList = new LinkedList();
       
        for (int p = 0; p < knuthParagraphs.size(); p++) {
            // null penalty between paragraphs
            if (p > 0 && !((BlockLevelLayoutManager) parentLM).mustKeepTogether()) {
                returnList.add(new BreakElement(
                        new Position(this), 0, context));
                //returnList.add(new KnuthPenalty(0, 0, false, new Position(this), false));
            }
       
            lineLayouts = (LineLayoutPossibilities)lineLayoutsList.get(p);
            KnuthSequence seq = (KnuthSequence) knuthParagraphs.get(p);

            if (!seq.isInlineSequence()) {
                LinkedList targetList = new LinkedList();
                ListIterator listIter = seq.listIterator();
                while (listIter.hasNext()) {
                    KnuthElement tempElement;
                    tempElement = (KnuthElement) listIter.next();
                    if (tempElement.getLayoutManager() != this) {
                        tempElement.setPosition(notifyPos(new NonLeafPosition(this,
                                tempElement.getPosition())));
                    }
                    targetList.add(tempElement);
                }
                returnList.addAll(targetList);
            } else if (seq.isInlineSequence() && alignment == EN_JUSTIFY) {
                /* justified vertical alignment (not in the XSL FO recommendation):
                   create a multi-layout sequence whose elements will contain
                   a conventional Position */
                Position returnPosition = new LeafPosition(this, p);
                createElements(returnList, lineLayouts, returnPosition);
            } else {
                /* "normal" vertical alignment: create a sequence whose boxes
                   represent effective lines, and contain LineBreakPositions */
                Position returnPosition = new LeafPosition(this, p);
                int startIndex = 0;
                for (int i = 0;
                        i < lineLayouts.getChosenLineCount();
                        i++) {
                    if (!((BlockLevelLayoutManager) parentLM).mustKeepTogether()
                            && i >= fobj.getOrphans()
                            && i <= lineLayouts.getChosenLineCount() - fobj.getWidows()
                            && returnList.size() > 0) {
                        // null penalty allowing a page break between lines
                        returnList.add(new BreakElement(
                                returnPosition, 0, context));
                        //returnList.add(new KnuthPenalty(0, 0, false, returnPosition, false));
                    }
                    int endIndex = ((LineBreakPosition) lineLayouts.getChosenPosition(i)).getLeafPos();
                    // create a list of the FootnoteBodyLM handling footnotes
View Full Code Here

Examples of org.apache.fop.layoutmgr.BreakElement

                    if (last.isPenalty()) {
                        KnuthPenalty pen = (KnuthPenalty)last;
                        pen.setP(-KnuthPenalty.INFINITE);
                        pen.setBreakClass(rowFO.getBreakBefore());
                    } else if (last instanceof BreakElement) {
                        BreakElement breakPoss = (BreakElement)last;
                        breakPoss.setPenaltyValue(-KnuthPenalty.INFINITE);
                        breakPoss.setBreakClass(rowFO.getBreakBefore());
                    }
                } else {
                    if (!firstBreakBeforeServed) {
                        //returnList.add(new KnuthPenalty(0, -KnuthPenalty.INFINITE,
                        //        false, rowFO.getBreakBefore(), new Position(getTableLM()), true));
                        returnList.add(new BreakElement(new Position(getTableLM()),
                                0, -KnuthPenalty.INFINITE, rowFO.getBreakBefore(), context));
                        iter.backToPreviousRow();
                        firstBreakBeforeServed = true;
                        break;
                    }
                }
            }
            firstBreakBeforeServed = true;
           
            //Border resolution
            if (!isSeparateBorderModel()) {
                resolveNormalBeforeAfterBordersForRowGroup(rowGroup, iter);
            }
           
            //Element list creation
            createElementsForRowGroup(context, alignment, bodyType,
                        returnList, rowGroup);
           
            //Handle keeps
            if (context.isKeepWithNextPending()) {
                log.debug("child LM (row group) signals pending keep-with-next");
            }
            if (context.isKeepWithPreviousPending()) {
                log.debug("child LM (row group) signals pending keep-with-previous");
                if (returnList.size() > 0) {
                    //Modify last penalty
                    ListElement last = (ListElement)returnList.getLast();
                    if (last.isPenalty()) {
                        BreakElement breakPoss = (BreakElement)last;
                        //Only honor keep if there's no forced break
                        if (!breakPoss.isForcedBreak()) {
                            breakPoss.setPenaltyValue(KnuthPenalty.INFINITE);
                        }
                    }
                }
            }
           
            //Check for break-after on the table-row at the end of the row group
            rowFO = rowGroup[rowGroup.length - 1].getTableRow();
            if (rowFO != null && rowFO.getBreakAfter() != Constants.EN_AUTO) {
                log.info("break-after found");
                if (returnList.size() > 0) {
                    ListElement last = (ListElement)returnList.getLast();
                    if (last instanceof KnuthPenalty) {
                        KnuthPenalty pen = (KnuthPenalty)last;
                        pen.setP(-KnuthPenalty.INFINITE);
                        pen.setBreakClass(rowFO.getBreakAfter());
                    } else if (last instanceof BreakElement) {
                        BreakElement breakPoss = (BreakElement)last;
                        breakPoss.setPenaltyValue(-KnuthPenalty.INFINITE);
                        breakPoss.setBreakClass(rowFO.getBreakAfter());
                    }
                }
            }
        }
       
View Full Code Here

Examples of org.apache.fop.layoutmgr.BreakElement

                        //Clear keep pending flag
                        context.setFlags(LayoutContext.KEEP_WITH_NEXT_PENDING, false);
                        childLC.setFlags(LayoutContext.KEEP_WITH_PREVIOUS_PENDING, false);
                        // add an infinite penalty to forbid a break between
                        // blocks
                        contentList.add(new BreakElement(
                                new Position(this), KnuthElement.INFINITE, context));
                        //contentList.add(new KnuthPenalty(0,
                        //        KnuthElement.INFINITE, false,
                        //        new Position(this), false));
                    } else if (!((ListElement) contentList.getLast()).isGlue()) {
                        // add a null penalty to allow a break between blocks
                        contentList.add(new BreakElement(
                                new Position(this), 0, context));
                        //contentList.add(new KnuthPenalty(0, 0, false,
                        //        new Position(this), false));
                    } else {
                        // the last element in contentList is a glue;
View Full Code Here

Examples of org.apache.fop.layoutmgr.BreakElement

        LinkedList returnList = new LinkedList();
       
        for (int p = 0; p < knuthParagraphs.size(); p++) {
            // null penalty between paragraphs
            if (p > 0 && !((BlockLevelLayoutManager) parentLM).mustKeepTogether()) {
                returnList.add(new BreakElement(
                        new Position(this), 0, context));
                //returnList.add(new KnuthPenalty(0, 0, false, new Position(this), false));
            }
       
            lineLayouts = (LineLayoutPossibilities)lineLayoutsList.get(p);
            KnuthSequence seq = (KnuthSequence) knuthParagraphs.get(p);

            if (!seq.isInlineSequence()) {
                LinkedList targetList = new LinkedList();
                ListIterator listIter = seq.listIterator();
                while (listIter.hasNext()) {
                    KnuthElement tempElement;
                    tempElement = (KnuthElement) listIter.next();
                    if (tempElement.getLayoutManager() != this) {
                        tempElement.setPosition(notifyPos(new NonLeafPosition(this,
                                tempElement.getPosition())));
                    }
                    targetList.add(tempElement);
                }
                returnList.addAll(targetList);
            } else if (seq.isInlineSequence() && alignment == EN_JUSTIFY) {
                /* justified vertical alignment (not in the XSL FO recommendation):
                   create a multi-layout sequence whose elements will contain
                   a conventional Position */
                Position returnPosition = new LeafPosition(this, p);
                createElements(returnList, lineLayouts, returnPosition);
            } else {
                /* "normal" vertical alignment: create a sequence whose boxes
                   represent effective lines, and contain LineBreakPositions */
                Position returnPosition = new LeafPosition(this, p);
                int startIndex = 0;
                for (int i = 0;
                        i < lineLayouts.getChosenLineCount();
                        i++) {
                    if (!((BlockLevelLayoutManager) parentLM).mustKeepTogether()
                            && i >= fobj.getOrphans()
                            && i <= lineLayouts.getChosenLineCount() - fobj.getWidows()
                            && returnList.size() > 0) {
                        // null penalty allowing a page break between lines
                        returnList.add(new BreakElement(
                                returnPosition, 0, context));
                        //returnList.add(new KnuthPenalty(0, 0, false, returnPosition, false));
                    }
                    int endIndex = ((LineBreakPosition) lineLayouts.getChosenPosition(i)).getLeafPos();
                    // create a list of the FootnoteBodyLM handling footnotes
View Full Code Here

Examples of org.apache.fop.layoutmgr.BreakElement

                }
                p = -KnuthPenalty.INFINITE; //Overrides any keeps (see 4.8 in XSL 1.0)
                clearBreakCondition();
            }
            //returnList.add(new KnuthPenalty(effPenaltyLen, p, false, penaltyPos, false));
            returnList.add(new BreakElement(penaltyPos, effPenaltyLen, p, 0, context));

            log.debug("step=" + step + " (+" + increase + ")"
                    + " box=" + boxLen
                    + " penalty=" + penaltyLen
                    + " effPenalty=" + effPenaltyLen);
View Full Code Here

Examples of org.apache.fop.layoutmgr.BreakElement

                int p = 0;
                if (keepWithNextActive || mustKeepTogether()) {
                    p = KnuthPenalty.INFINITE;
                }
                //returnList.add(new KnuthPenalty(penaltyHeight, p, false, stepPosition, false));
                returnList.add(new BreakElement(stepPosition, penaltyHeight, p, 0, context));
            }
        }

        return returnList;
    }
View Full Code Here

Examples of weblogic.html.BreakElement

   * Prints message to browser.
   */
  static private void printElement(String message, ServletPage sp)
    throws IOException {
    sp.getBody()
      .addElement(new BreakElement())
      .addElement(new StringElement(message));
  }
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.