Package org.apache.fop.fo

Examples of org.apache.fop.fo.PropertyList


        Length distance = pInfo.getPropertyList().get(
                Constants.PR_PROVISIONAL_DISTANCE_BETWEEN_STARTS).getLength();
        Length separation = pInfo.getPropertyList().getNearestSpecified(
                Constants.PR_PROVISIONAL_LABEL_SEPARATION).getLength();

        PropertyList pList = pInfo.getPropertyList();
        while (pList != null && !(pList.getFObj() instanceof ListItem)) {
            pList = pList.getParentPropertyList();
        }
        if (pList == null) {
            throw new PropertyException("label-end() called from outside an fo:list-item");
        }
        Length startIndent = pList.get(Constants.PR_START_INDENT).getLength();

        LengthBase base = new LengthBase(pInfo.getPropertyList(),
                                         LengthBase.CONTAINING_REFAREA_WIDTH);
        PercentLength refWidth = new PercentLength(1.0, base);
View Full Code Here


     * @return the computed indent property
     * @throws PropertyException if a property exception occurs
     * @see CorrespondingPropertyMaker#compute(PropertyList)
     */
    public Property computeConforming(PropertyList propertyList) throws PropertyException {
        PropertyList pList = getWMPropertyList(propertyList);
        if (pList == null) {
            return null;
        }
        // Calculate the values as described in 5.3.2.

        Numeric padding = getCorresponding(paddingCorresponding, propertyList).getNumeric();
        Numeric border = getCorresponding(borderWidthCorresponding, propertyList).getNumeric();

        int marginProp = pList.selectFromWritingMode(lrtb, rltb, tbrl, tblr);
        // Calculate the absolute margin.
        if (propertyList.getExplicitOrShorthand(marginProp) == null) {
            Property indent = propertyList.getExplicit(baseMaker.propId);
            if (indent == null) {
                //Neither indent nor margin is specified, use inherited
View Full Code Here

     * @return the computed indent property
     * @throws PropertyException if a property exception occurs
     * @see CorrespondingPropertyMaker#compute(PropertyList)
     */
    public Property computeAlternativeRuleset(PropertyList propertyList) throws PropertyException {
        PropertyList pList = getWMPropertyList(propertyList);
        if (pList == null) {
            return null;
        }

        // Calculate the values as described in 5.3.2.

        Numeric padding = getCorresponding(paddingCorresponding, propertyList).getNumeric();
        Numeric border = getCorresponding(borderWidthCorresponding, propertyList).getNumeric();

        int marginProp = pList.selectFromWritingMode(lrtb, rltb, tbrl, tblr);

        //Determine whether the nearest anscestor indent was specified through
        //start-indent|end-indent or through a margin property.
        boolean marginNearest = false;
        PropertyList pl = propertyList.getParentPropertyList();
        while (pl != null) {
            if (pl.getExplicit(baseMaker.propId) != null) {
                break;
            } else if (pl.getExplicitOrShorthand(marginProp) != null) {
                marginNearest = true;
                break;
            }
            pl = pl.getParentPropertyList();
        }

        // Calculate the absolute margin.
        if (propertyList.getExplicitOrShorthand(marginProp) == null) {
            Property indent = propertyList.getExplicit(baseMaker.propId);
View Full Code Here

        }
    }

    private Property getCorresponding(int[] corresponding, PropertyList propertyList)
                throws PropertyException {
        PropertyList pList = getWMPropertyList(propertyList);
        if (pList != null) {
            int wmcorr = pList.selectFromWritingMode
                ( corresponding[0], corresponding[1], corresponding[2], corresponding[3] );
            return propertyList.get(wmcorr);
        } else {
            return null;
        }
View Full Code Here

                p = this.compute(propertyList);
            }
        }
        if (p == null && tryInherit) {
            // else inherit (if has parent and is inheritable)
            PropertyList parentPropertyList = propertyList.getParentPropertyList();
            if (parentPropertyList != null && isInherited()) {
                p = parentPropertyList.get(propId, true, false);
            }
        }
        return p;
    }
View Full Code Here

        FOTreeBuilderContext builderContext = getBuilderContext();
        // Push a new property list maker which will make MarkerPropertyLists.
        savePropertyListMaker = builderContext.getPropertyListMaker();
        builderContext.setPropertyListMaker(new PropertyListMaker() {
            public PropertyList make(FObj fobj, PropertyList parentPropertyList) {
                PropertyList pList = new MarkerPropertyList(fobj, parentPropertyList);
                descendantPropertyLists.put(fobj, pList);
                return pList;
            }
        });
    }
View Full Code Here

        if (!relative) {
            return false;
        }

        PropertyList pList = getWMPropertyList(propertyList);
        if (pList != null) {
            int correspondingId = pList.selectFromWritingMode(lrtb, rltb, tbrl, tblr);

            if (pList.getExplicit(correspondingId) != null) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

     * @return Property A computed Property value or null if no rules
     * are specified (in foproperties.xml) to compute the value.
     * @throws PropertyException if a property exception occurs
     */
    public Property compute(PropertyList propertyList) throws PropertyException {
        PropertyList pList = getWMPropertyList(propertyList);
        if (pList == null) {
            return null;
        }
        int correspondingId = pList.selectFromWritingMode(lrtb, rltb, tbrl, tblr);

        Property p = propertyList.getExplicitOrShorthand(correspondingId);
        if (p != null) {
            FObj parentFO = propertyList.getParentFObj();
            p = baseMaker.convertProperty(p, propertyList, parentFO);
View Full Code Here

    }

    private static CommonTextDecoration calcTextDecoration(PropertyList pList)
                throws PropertyException {
        CommonTextDecoration deco = null;
        PropertyList parentList = pList.getParentPropertyList();
        if (parentList != null) {
            //Parent is checked first
            deco = calcTextDecoration(parentList);
        }
        //For rules, see XSL 1.0, chapters 5.5.6 and 7.16.4
View Full Code Here

        FOEventHandler foEventHandler = getFOEventHandler();
        // Push a new property list maker which will make MarkerPropertyLists.
        savePropertyListMaker = foEventHandler.getPropertyListMaker();
        foEventHandler.setPropertyListMaker(new PropertyListMaker() {
            public PropertyList make(FObj fobj, PropertyList parentPropertyList) {
                PropertyList pList = new MarkerPropertyList(fobj, parentPropertyList);
                descendantPropertyLists.put(fobj, pList);
                return pList;
            }
        });
    }
View Full Code Here

TOP

Related Classes of org.apache.fop.fo.PropertyList

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.