Package org.apache.fop.layout

Examples of org.apache.fop.layout.LineArea


                         int leaderLengthMinimum, int leaderLengthOptimum,
                         int leaderLengthMaximum, int ruleThickness,
                         int ruleStyle, int leaderPatternWidth,
                         int leaderAlignment) {

        LineArea la = ba.getCurrentLineArea();
        // this should start a new page
        if (la == null) {
            return -1;
        }

        la.changeFont(fontState);
        la.changeColor(red, green, blue);

        // check whether leader fits into the (rest of the) line
        // using length.optimum to determine where to break the line as defined
        // in the xsl:fo spec: "User agents may choose to use the value of 'leader-length.optimum'
        // to determine where to break the line" (7.20.4)
        // if leader is longer then create a new LineArea and put leader there
        if (leaderLengthOptimum <= (la.getRemainingWidth())) {
            la.addLeader(leaderPattern, leaderLengthMinimum,
                         leaderLengthOptimum, leaderLengthMaximum, ruleStyle,
                         ruleThickness, leaderPatternWidth, leaderAlignment);
        } else {
            la = ba.createNextLineArea();
            if (la == null) {
                // not enough room
                return -1;
            }
            la.changeFont(fontState);
            la.changeColor(red, green, blue);

            // check whether leader fits into LineArea at all, otherwise
            // clip it (should honor the clip option of containing area)
            if (leaderLengthMinimum <= la.getContentWidth()) {
                la.addLeader(leaderPattern, leaderLengthMinimum,
                             leaderLengthOptimum, leaderLengthMaximum,
                             ruleStyle, ruleThickness, leaderPatternWidth,
                             leaderAlignment);
            } else {
                MessageHandler.errorln("Leader doesn't fit into line, it will be clipped to fit.");
                la.addLeader(leaderPattern, la.getRemainingWidth(),
                             leaderLengthOptimum, leaderLengthMaximum,
                             ruleStyle, ruleThickness, leaderPatternWidth,
                             leaderAlignment);
            }
        }
View Full Code Here


        // initialize id
        String id = this.properties.get("id").getString();
        blockArea.getIDReferences().initializeID(id, blockArea);

        LineArea la = blockArea.getCurrentLineArea();
        if (la == null) {
            return new Status(Status.AREA_FULL_NONE);
        }
        la.changeFont(propMgr.getFontState(area.getFontInfo()));
        la.changeColor(red, green, blue);
        la.changeWrapOption(wrapOption);
        la.changeWhiteSpaceCollapse(whiteSpaceCollapse);
        blockArea.setupLinkSet(this.getLinkSet());
        int result = la.addCharacter(characterValue, this.getLinkSet(),
                                     textDecoration);
        if (result == Character.DOESNOT_FIT) {
            la = blockArea.createNextLineArea();
            if (la == null) {
                return new Status(Status.AREA_FULL_NONE);
            }
            la.changeFont(propMgr.getFontState(area.getFontInfo()));
            la.changeColor(red, green, blue);
            la.changeWrapOption(wrapOption);
            la.changeWhiteSpaceCollapse(whiteSpaceCollapse);
            blockArea.setupLinkSet(this.getLinkSet());
            la.addCharacter(characterValue, this.getLinkSet(),
                            textDecoration);
        }
        return new Status(Status.OK);

    }
View Full Code Here

        // initialize id
        String id = this.properties.get("id").getString();
        blockArea.getIDReferences().initializeID(id, blockArea);

        LineArea la = blockArea.getCurrentLineArea();
        if (la == null) {
            return new Status(Status.AREA_FULL_NONE);
        }
        la.changeFont(propMgr.getFontState(area.getFontInfo()));
        la.changeColor(red, green, blue);
        la.changeWrapOption(wrapOption);
        la.changeWhiteSpaceCollapse(whiteSpaceCollapse);
        blockArea.setupLinkSet(this.getLinkSet());
        int result = la.addCharacter(characterValue, this.getLinkSet(),
                                     textDecoration);
        if (result == Character.DOESNOT_FIT) {
            la = blockArea.createNextLineArea();
            if (la == null) {
                return new Status(Status.AREA_FULL_NONE);
            }
            la.changeFont(propMgr.getFontState(area.getFontInfo()));
            la.changeColor(red, green, blue);
            la.changeWrapOption(wrapOption);
            la.changeWhiteSpaceCollapse(whiteSpaceCollapse);
            blockArea.setupLinkSet(this.getLinkSet());
            la.addCharacter(characterValue, this.getLinkSet(),
                            textDecoration);
        }
        return new Status(Status.OK);

    }
View Full Code Here

                         int leaderLengthMinimum, int leaderLengthOptimum,
                         int leaderLengthMaximum, int ruleThickness,
                         int ruleStyle, int leaderPatternWidth,
                         int leaderAlignment) {

        LineArea la = ba.getCurrentLineArea();
        // this should start a new page
        if (la == null) {
            return -1;
        }

        la.changeFont(fontState);
        la.changeColor(red, green, blue);

        // check whether leader fits into the (rest of the) line
        // using length.optimum to determine where to break the line as defined
        // in the xsl:fo spec: "User agents may choose to use the value of 'leader-length.optimum'
        // to determine where to break the line" (7.20.4)
        // if leader is longer then create a new LineArea and put leader there
        if (leaderLengthOptimum <= (la.getRemainingWidth())) {
            la.addLeader(leaderPattern, leaderLengthMinimum,
                         leaderLengthOptimum, leaderLengthMaximum, ruleStyle,
                         ruleThickness, leaderPatternWidth, leaderAlignment);
        } else {
            la = ba.createNextLineArea();
            if (la == null) {
                // not enough room
                return -1;
            }
            la.changeFont(fontState);
            la.changeColor(red, green, blue);

            // check whether leader fits into LineArea at all, otherwise
            // clip it (should honor the clip option of containing area)
            if (leaderLengthMinimum <= la.getContentWidth()) {
                la.addLeader(leaderPattern, leaderLengthMinimum,
                             leaderLengthOptimum, leaderLengthMaximum,
                             ruleStyle, ruleThickness, leaderPatternWidth,
                             leaderAlignment);
            } else {
                log.error("Leader doesn't fit into line, it will be clipped to fit.");
                la.addLeader(leaderPattern, la.getRemainingWidth(),
                             leaderLengthOptimum, leaderLengthMaximum,
                             ruleStyle, ruleThickness, leaderPatternWidth,
                             leaderAlignment);
            }
        }
View Full Code Here

                e.setLocation(systemId, line, column);
            }
            throw e;
        }

        LineArea la = blockArea.getCurrentLineArea();
        if (la == null) {
            return Status.AREA_FULL_NONE;
        }
        la.changeFont(propMgr.getFontState(area.getFontInfo()));
        la.changeColor(red, green, blue);
        la.changeWrapOption(wrapOption);
        la.changeWhiteSpaceCollapse(whiteSpaceCollapse);
        blockArea.setupLinkSet(this.getLinkSet());
        int result = la.addCharacter(characterValue, this.getLinkSet(),
                                     textDecoration);
        if (result == Character.DOESNOT_FIT) {
            la = blockArea.createNextLineArea();
            if (la == null) {
                return Status.AREA_FULL_NONE;
            }
            la.changeFont(propMgr.getFontState(area.getFontInfo()));
            la.changeColor(red, green, blue);
            la.changeWrapOption(wrapOption);
            la.changeWhiteSpaceCollapse(whiteSpaceCollapse);
            blockArea.setupLinkSet(this.getLinkSet());
            la.addCharacter(characterValue, this.getLinkSet(),
                            textDecoration);
        }
        return Status.OK;

    }
View Full Code Here

                         int leaderLengthMinimum, int leaderLengthOptimum,
                         int leaderLengthMaximum, int ruleThickness,
                         int ruleStyle, int leaderPatternWidth,
                         int leaderAlignment) {

        LineArea la = ba.getCurrentLineArea();
        // this should start a new page
        if (la == null) {
            return -1;
        }

        la.changeFont(fontState);
        la.changeColor(red, green, blue);

        // check whether leader fits into the (rest of the) line
        // using length.optimum to determine where to break the line as defined
        // in the xsl:fo spec: "User agents may choose to use the value of 'leader-length.optimum'
        // to determine where to break the line" (7.20.4)
        // if leader is longer then create a new LineArea and put leader there
        if (leaderLengthOptimum <= la.getRemainingWidth()) {
            la.addLeader(leaderPattern, leaderLengthMinimum,
                         leaderLengthOptimum, leaderLengthMaximum, ruleStyle,
                         ruleThickness, leaderPatternWidth, leaderAlignment);
        } else {
            la = ba.createNextLineArea();
            if (la == null) {
                // not enough room
                return -1;
            }
            la.changeFont(fontState);
            la.changeColor(red, green, blue);

            // check whether leader fits into LineArea at all, otherwise
            // clip it (should honor the clip option of containing area)
            if (leaderLengthMinimum <= la.getContentWidth()) {
                la.addLeader(leaderPattern, leaderLengthMinimum,
                             leaderLengthOptimum, leaderLengthMaximum,
                             ruleStyle, ruleThickness, leaderPatternWidth,
                             leaderAlignment);
            } else {
                log.error("Leader doesn't fit into line, it will be clipped to fit.");
                la.addLeader(leaderPattern, la.getRemainingWidth(),
                             la.getRemainingWidth(), la.getRemainingWidth(),
                             ruleStyle, ruleThickness, leaderPatternWidth,
                             leaderAlignment);
            }
        }
        return 1;
View Full Code Here

        // initialize id
        String id = this.properties.get("id").getString();
        blockArea.getIDReferences().initializeID(id, blockArea);

        LineArea la = blockArea.getCurrentLineArea();
        if(la == null) {
            return new Status(Status.AREA_FULL_NONE);
        }
        la.changeFont(propMgr.getFontState(area.getFontInfo()));
        la.changeColor(red, green, blue);
        la.changeWrapOption(wrapOption);
        la.changeWhiteSpaceCollapse(whiteSpaceCollapse);
        blockArea.setupLinkSet(this.getLinkSet());
        int result = la.addCharacter(characterValue, this.getLinkSet(), textDecoration);
        if (result == Character.DOESNOT_FIT) {
            la = blockArea.createNextLineArea();
            if(la == null) {
                return new Status(Status.AREA_FULL_NONE);
            }
            la.changeFont(propMgr.getFontState(area.getFontInfo()));
            la.changeColor(red, green, blue);
            la.changeWrapOption(wrapOption);
            la.changeWhiteSpaceCollapse(whiteSpaceCollapse);
            blockArea.setupLinkSet(this.getLinkSet());
            la.addCharacter(characterValue, this.getLinkSet(), textDecoration);
        }
        return new Status(Status.OK);

    }
View Full Code Here

                         float blue, int leaderPattern, int leaderLengthMinimum,
                         int leaderLengthOptimum, int leaderLengthMaximum,
                         int ruleThickness, int ruleStyle, int leaderPatternWidth,
                         int leaderAlignment) {

        LineArea la = ba.getCurrentLineArea();
        //this should start a new page
        if (la == null) {
            return -1;
        }

        la.changeFont(fontState);
        la.changeColor(red, green, blue);

        //check whether leader fits into the (rest of the) line
        //using length.optimum to determine where to break the line as defined
        // in the xsl:fo spec: "User agents may choose to use the value of 'leader-length.optimum'
        // to determine where to break the line" (7.20.4)
        //if leader is longer then create a new LineArea and put leader there
        if (leaderLengthOptimum <= (la.getRemainingWidth())) {
            la.addLeader(leaderPattern,
                                           leaderLengthMinimum, leaderLengthOptimum,
                                           leaderLengthMaximum, ruleStyle, ruleThickness,
                                           leaderPatternWidth, leaderAlignment);
        } else {
            la = ba.createNextLineArea();
            if(la == null) {
                // not enough room
                return -1;
            }
            la.changeFont(fontState);
            la.changeColor(red, green, blue);

            //check whether leader fits into LineArea at all, otherwise
            //clip it (should honor the clip option of containing area)
            if (leaderLengthMinimum <=
                      la.getContentWidth()) {
                la.addLeader(leaderPattern,
                                               leaderLengthMinimum, leaderLengthOptimum,
                                               leaderLengthMaximum, ruleStyle, ruleThickness,
                                               leaderPatternWidth, leaderAlignment);
            } else {
                MessageHandler.errorln("Leader doesn't fit into line, it will be clipped to fit.");
                la.addLeader(leaderPattern,
                                               la.getRemainingWidth(),
                                               leaderLengthOptimum, leaderLengthMaximum,
                                               ruleStyle, ruleThickness, leaderPatternWidth,
                                               leaderAlignment);
            }
        }
View Full Code Here

                         float blue, int leaderPattern, int leaderLengthMinimum,
                         int leaderLengthOptimum, int leaderLengthMaximum,
                         int ruleThickness, int ruleStyle, int leaderPatternWidth,
                         int leaderAlignment) {

        LineArea la = ba.getCurrentLineArea();
        //this should start a new page
        if (la == null) {
            return -1;
        }

        la.changeFont(fontState);
        la.changeColor(red, green, blue);

        //check whether leader fits into the (rest of the) line
        //using length.optimum to determine where to break the line as defined
        // in the xsl:fo spec: "User agents may choose to use the value of 'leader-length.optimum'
        // to determine where to break the line" (7.20.4)
        //if leader is longer then create a new LineArea and put leader there
        if (leaderLengthOptimum <= (la.getRemainingWidth())) {
            la.addLeader(leaderPattern,
                                           leaderLengthMinimum, leaderLengthOptimum,
                                           leaderLengthMaximum, ruleStyle, ruleThickness,
                                           leaderPatternWidth, leaderAlignment);
        } else {
            la = ba.createNextLineArea();
            if(la == null) {
                // not enough room
                return -1;
            }
            la.changeFont(fontState);
            la.changeColor(red, green, blue);

            //check whether leader fits into LineArea at all, otherwise
            //clip it (should honor the clip option of containing area)
            if (leaderLengthMinimum <=
                      la.getContentWidth()) {
                la.addLeader(leaderPattern,
                                               leaderLengthMinimum, leaderLengthOptimum,
                                               leaderLengthMaximum, ruleStyle, ruleThickness,
                                               leaderPatternWidth, leaderAlignment);
            } else {
                MessageHandler.errorln("Leader doesn't fit into line, it will be clipped to fit.");
                la.addLeader(leaderPattern,
                                               la.getRemainingWidth(),
                                               leaderLengthOptimum, leaderLengthMaximum,
                                               ruleStyle, ruleThickness, leaderPatternWidth,
                                               leaderAlignment);
            }
        }
View Full Code Here

        // initialize id
        String id = this.properties.get("id").getString();
        blockArea.getIDReferences().initializeID(id, blockArea);

        LineArea la = blockArea.getCurrentLineArea();
        if(la == null) {
            return new Status(Status.AREA_FULL_NONE);
        }
        la.changeFont(fontstate);
        la.changeColor(red, green, blue);
        la.changeWrapOption(wrapOption);
        la.changeWhiteSpaceCollapse(whiteSpaceCollapse);
        blockArea.setupLinkSet(this.getLinkSet());
        int result = la.addCharacter(characterValue, this.getLinkSet(), textDecoration);
        if (result == Character.DOESNOT_FIT) {
            la = blockArea.createNextLineArea();
            if(la == null) {
                return new Status(Status.AREA_FULL_NONE);
            }
            la.changeFont(fontstate);
            la.changeColor(red, green, blue);
            la.changeWrapOption(wrapOption);
            la.changeWhiteSpaceCollapse(whiteSpaceCollapse);
            blockArea.setupLinkSet(this.getLinkSet());
            la.addCharacter(characterValue, this.getLinkSet(), textDecoration);
        }
        return new Status(Status.OK);

    }
View Full Code Here

TOP

Related Classes of org.apache.fop.layout.LineArea

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.