Package org.apache.fop.fo.properties

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


        m.addShorthand(generics[PR_FONT]);
        addPropertyMaker("font-weight", m);
    }

    private void createHyphenationProperties() {
        PropertyMaker m;

        // country
        m  = new StringProperty.Maker(PR_COUNTRY);
        m.setInherited(true);
        m.setDefault("none");
        m.addShorthand(generics[PR_XML_LANG]);
        addPropertyMaker("country", m);

        // language
        m  = new StringProperty.Maker(PR_LANGUAGE);
        m.setInherited(true);
        m.setDefault("none");
        m.addShorthand(generics[PR_XML_LANG]);
        addPropertyMaker("language", m);

        // script
        m  = new StringProperty.Maker(PR_SCRIPT);
        m.setInherited(true);
        m.setDefault("auto");
        addPropertyMaker("script", m);

        // hyphenate
        m  = new EnumProperty.Maker(PR_HYPHENATE);
        m.useGeneric(genericBoolean);
        m.setInherited(true);
        m.setDefault("false");
        addPropertyMaker("hyphenate", m);

        // hyphenation-character
        m  = new CharacterProperty.Maker(PR_HYPHENATION_CHARACTER);
        m.setInherited(true);
        m.setDefault("-");
        addPropertyMaker("hyphenation-character", m);

        // hyphenation-push-character-count
        m  = new NumberProperty.PositiveIntegerMaker(PR_HYPHENATION_PUSH_CHARACTER_COUNT);
        m.setInherited(true);
        m.setDefault("2");
        addPropertyMaker("hyphenation-push-character-count", m);

        // hyphenation-remain-character-count
        m  = new NumberProperty.PositiveIntegerMaker(PR_HYPHENATION_REMAIN_CHARACTER_COUNT);
        m.setInherited(true);
        m.setDefault("2");
        addPropertyMaker("hyphenation-remain-character-count", m);
    }
View Full Code Here


        m.setDefault("2");
        addPropertyMaker("hyphenation-remain-character-count", m);
    }

    private void createMarginBlockProperties() {
        PropertyMaker m;
        CorrespondingPropertyMaker corr;

        // margin-top
        m  = new LengthProperty.Maker(PR_MARGIN_TOP);
        m.setInherited(false);
        m.setDefault("0pt");
        m.addShorthand(generics[PR_MARGIN]);
        m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
        addPropertyMaker("margin-top", m);

        // margin-bottom
        m  = new LengthProperty.Maker(PR_MARGIN_BOTTOM);
        m.setInherited(false);
        m.setDefault("0pt");
        m.addShorthand(generics[PR_MARGIN]);
        m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
        addPropertyMaker("margin-bottom", m);

        // margin-left
        m  = new LengthProperty.Maker(PR_MARGIN_LEFT);
        m.setInherited(false);
        m.setDefault("0pt");
        m.addShorthand(generics[PR_MARGIN]);
        m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
        addPropertyMaker("margin-left", m);

        // margin-right
        m  = new LengthProperty.Maker(PR_MARGIN_RIGHT);
        m.setInherited(false);
        m.setDefault("0pt");
        m.addShorthand(generics[PR_MARGIN]);
        m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
        addPropertyMaker("margin-right", m);

        // space-before
        m  = new SpaceProperty.Maker(PR_SPACE_BEFORE);
        m.useGeneric(genericSpace);
        corr = new SpacePropertyMaker(m);
        corr.setCorresponding(PR_MARGIN_TOP, PR_MARGIN_TOP, PR_MARGIN_RIGHT, PR_MARGIN_LEFT);
        corr.setUseParent(false);
        corr.setRelative(true);
        addPropertyMaker("space-before", m);

        // space-after
        m  = new SpaceProperty.Maker(PR_SPACE_AFTER);
        m.useGeneric(genericSpace);
        corr = new SpacePropertyMaker(m);
        corr.setCorresponding(PR_MARGIN_BOTTOM, PR_MARGIN_BOTTOM, PR_MARGIN_LEFT, PR_MARGIN_RIGHT);
        corr.setUseParent(false);
        corr.setRelative(true);
        addPropertyMaker("space-after", m);

        // start-indent
        m = new LengthProperty.Maker(PR_START_INDENT);
        m.setInherited(true);
        m.setDefault("0pt");
        m.setPercentBase(LengthBase.CONTAINING_REFAREA_WIDTH);
        IndentPropertyMaker sCorr = new IndentPropertyMaker(m);
        sCorr.setCorresponding(PR_MARGIN_LEFT, PR_MARGIN_RIGHT, PR_MARGIN_TOP, PR_MARGIN_TOP);
        sCorr.setUseParent(false);
        sCorr.setRelative(true);
        sCorr.setPaddingCorresponding(new int[] {
             PR_PADDING_LEFT, PR_PADDING_RIGHT, PR_PADDING_TOP, PR_PADDING_TOP
        });
        sCorr.setBorderWidthCorresponding(new int[] {
            PR_BORDER_LEFT_WIDTH, PR_BORDER_RIGHT_WIDTH, PR_BORDER_TOP_WIDTH, PR_BORDER_TOP_WIDTH
        });
        addPropertyMaker("start-indent", m);

        // end-indent
        m = new LengthProperty.Maker(PR_END_INDENT);
        m.setInherited(true);
        m.setDefault("0pt");
        m.setPercentBase(LengthBase.CONTAINING_REFAREA_WIDTH);
        IndentPropertyMaker eCorr = new IndentPropertyMaker(m);
        eCorr.setCorresponding(PR_MARGIN_RIGHT, PR_MARGIN_LEFT,
                               PR_MARGIN_BOTTOM, PR_MARGIN_BOTTOM);
        eCorr.setUseParent(false);
        eCorr.setRelative(true);
View Full Code Here

        });
        addPropertyMaker("end-indent", m);
    }

    private void createMarginInlineProperties() {
        PropertyMaker m;

        // space-end
        m  = new SpaceProperty.Maker(PR_SPACE_END);
        m.useGeneric(genericSpace);
        addPropertyMaker("space-end", m);

        // space-start
        m  = new SpaceProperty.Maker(PR_SPACE_START);
        m.useGeneric(genericSpace);
        addPropertyMaker("space-start", m);
    }
View Full Code Here

        m.useGeneric(genericSpace);
        addPropertyMaker("space-start", m);
    }

    private void createRelativePosProperties() {
        PropertyMaker m;

        // relative-position
        m  = new EnumProperty.Maker(PR_RELATIVE_POSITION);
        m.setInherited(false);
        m.addEnum("static", getEnumProperty(EN_STATIC, "STATIC"));
        m.addEnum("relative", getEnumProperty(EN_RELATIVE, "RELATIVE"));
        m.setDefault("static");
        m.addShorthand(generics[PR_POSITION]);
        addPropertyMaker("relative-position", m);
    }
View Full Code Here

        m.addShorthand(generics[PR_POSITION]);
        addPropertyMaker("relative-position", m);
    }

    private void createAreaAlignmentProperties() {
        PropertyMaker m;

        // alignment-adjust
        m  = new LengthProperty.Maker(PR_ALIGNMENT_ADJUST);
        m.setInherited(false);
        m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
        m.addEnum("baseline", getEnumProperty(EN_BASELINE, "BASELINE"));
        m.addEnum("before-edge", getEnumProperty(EN_BEFORE_EDGE, "BEFORE_EDGE"));
        m.addEnum("text-before-edge", getEnumProperty(EN_TEXT_BEFORE_EDGE, "TEXT_BEFORE_EDGE"));
        m.addEnum("middle", getEnumProperty(EN_MIDDLE, "MIDDLE"));
        m.addEnum("central", getEnumProperty(EN_CENTRAL, "CENTRAL"));
        m.addEnum("after-edge", getEnumProperty(EN_AFTER_EDGE, "AFTER_EDGE"));
        m.addEnum("text-after-edge", getEnumProperty(EN_TEXT_AFTER_EDGE, "TEXT_AFTER_EDGE"));
        m.addEnum("ideographic", getEnumProperty(EN_IDEOGRAPHIC, "IDEOGRAPHIC"));
        m.addEnum("alphabetic", getEnumProperty(EN_ALPHABETIC, "ALPHABETIC"));
        m.addEnum("hanging", getEnumProperty(EN_HANGING, "HANGING"));
        m.addEnum("mathematical", getEnumProperty(EN_MATHEMATICAL, "MATHEMATICAL"));
        m.setDefault("auto");
        m.setPercentBase(LengthBase.ALIGNMENT_ADJUST);
        m.addShorthand(generics[PR_VERTICAL_ALIGN]);
        addPropertyMaker("alignment-adjust", m);

        // alignment-baseline
        m  = new EnumProperty.Maker(PR_ALIGNMENT_BASELINE);
        m.setInherited(false);
        m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
        m.addEnum("baseline", getEnumProperty(EN_BASELINE, "BASELINE"));
        m.addEnum("before-edge", getEnumProperty(EN_BEFORE_EDGE, "BEFORE_EDGE"));
        m.addEnum("text-before-edge", getEnumProperty(EN_TEXT_BEFORE_EDGE, "TEXT_BEFORE_EDGE"));
        m.addEnum("middle", getEnumProperty(EN_MIDDLE, "MIDDLE"));
        m.addEnum("central", getEnumProperty(EN_CENTRAL, "CENTRAL"));
        m.addEnum("after-edge", getEnumProperty(EN_AFTER_EDGE, "AFTER_EDGE"));
        m.addEnum("text-after-edge", getEnumProperty(EN_TEXT_AFTER_EDGE, "TEXT_AFTER_EDGE"));
        m.addEnum("ideographic", getEnumProperty(EN_IDEOGRAPHIC, "IDEOGRAPHIC"));
        m.addEnum("alphabetic", getEnumProperty(EN_ALPHABETIC, "ALPHABETIC"));
        m.addEnum("hanging", getEnumProperty(EN_HANGING, "HANGING"));
        m.addEnum("mathematical", getEnumProperty(EN_MATHEMATICAL, "MATHEMATICAL"));
        m.setDefault("auto");
        m.addShorthand(generics[PR_VERTICAL_ALIGN]);
        addPropertyMaker("alignment-baseline", m);

        // baseline-shift
        m  = new LengthProperty.Maker(PR_BASELINE_SHIFT);
        m.setInherited(false);
        m.addEnum("baseline", getEnumProperty(EN_BASELINE, "BASELINE"));
        m.addEnum("sub", getEnumProperty(EN_SUB, "SUB"));
        m.addEnum("super", getEnumProperty(EN_SUPER, "SUPER"));
        m.setDefault("baseline");
        m.addShorthand(generics[PR_VERTICAL_ALIGN]);
        m.setPercentBase(LengthBase.CUSTOM_BASE);
        addPropertyMaker("baseline-shift", m);

        // display-align
        m  = new EnumProperty.Maker(PR_DISPLAY_ALIGN);
        m.setInherited(true);
        m.addEnum("before", getEnumProperty(EN_BEFORE, "BEFORE"));
        m.addEnum("after", getEnumProperty(EN_AFTER, "AFTER"));
        m.addEnum("center", getEnumProperty(EN_CENTER, "CENTER"));
        m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
/*LF*/  m.addEnum("distribute", getEnumProperty(EN_X_DISTRIBUTE, "DISTRIBUTE"));
/*LF*/  m.addEnum("fill", getEnumProperty(EN_X_FILL, "FILL"));
        m.setDefault("auto");
        addPropertyMaker("display-align", m);

        // dominant-baseline
        m  = new EnumProperty.Maker(PR_DOMINANT_BASELINE);
        m.setInherited(false);
        m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
        m.addEnum("use-script", getEnumProperty(EN_USE_SCRIPT, "USE_SCRIPT"));
        m.addEnum("no-change", getEnumProperty(EN_NO_CHANGE, "NO_CHANGE"));
        m.addEnum("reset-size", getEnumProperty(EN_RESET_SIZE, "RESET_SIZE"));
        m.addEnum("ideographic", getEnumProperty(EN_IDEOGRAPHIC, "IDEOGRAPHIC"));
        m.addEnum("alphabetic", getEnumProperty(EN_ALPHABETIC, "ALPHABETIC"));
        m.addEnum("hanging", getEnumProperty(EN_HANGING, "HANGING"));
        m.addEnum("mathematical", getEnumProperty(EN_MATHEMATICAL, "MATHEMATICAL"));
        m.addEnum("central", getEnumProperty(EN_CENTRAL, "CENTRAL"));
        m.addEnum("middle", getEnumProperty(EN_MIDDLE, "MIDDLE"));
        m.addEnum("text-after-edge", getEnumProperty(EN_TEXT_AFTER_EDGE, "TEXT_AFTER_EDGE"));
        m.addEnum("text-before-edge", getEnumProperty(EN_TEXT_BEFORE_EDGE, "TEXT_BEFORE_EDGE"));
        m.setDefault("auto");
        m.addShorthand(generics[PR_VERTICAL_ALIGN]);
        addPropertyMaker("dominant-baseline", m);

        // relative-align
        m  = new EnumProperty.Maker(PR_RELATIVE_ALIGN);
        m.setInherited(true);
        m.addEnum("before", getEnumProperty(EN_BEFORE, "BEFORE"));
        m.addEnum("baseline", getEnumProperty(EN_BASELINE, "BASELINE"));
        m.setDefault("before");
        addPropertyMaker("relative-align", m);
    }
View Full Code Here

     * @throws PropertyException if there is a problem evaluating the property
     */
    public Property get(int propId, boolean bTryInherit,
                         boolean bTryDefault) throws PropertyException {

        PropertyMaker propertyMaker = findMaker(propId & Constants.PROPERTY_MASK);
        if (propertyMaker != null) {
            return propertyMaker.get(propId & Constants.COMPOUND_MASK, this,
                                         bTryInherit, bTryDefault);
        }
        return null;
    }
View Full Code Here

                    || (subpropId == -1 && subPropertyName != null)) {
                handleInvalidProperty(new QName(null, attributeName));
            }
            FObj parentFO = fobj.findNearestAncestorFObj();

            PropertyMaker propertyMaker = findMaker(propId);
            if (propertyMaker == null) {
                log.warn("No PropertyMaker registered for " + attributeName
                        + ". Ignoring property.");
                return;
            }

            try {
                Property prop = null;
                if (subPropertyName == null) { // base attribute only found
                    /* Do nothing if the base property has already been created.
                     * This is e.g. the case when a compound attribute was
                     * specified before the base attribute; in these cases
                     * the base attribute was already created in
                     * findBaseProperty()
                     */
                    if (getExplicit(propId) != null) {
                        return;
                    }
                    prop = propertyMaker.make(this, attributeValue, parentFO);
                } else { // e.g. "leader-length.maximum"
                    Property baseProperty
                        = findBaseProperty(attributes, parentFO, propId,
                                basePropertyName, propertyMaker);
                    prop = propertyMaker.make(baseProperty, subpropId,
                            this, attributeValue, parentFO);
                }
                if (prop != null) {
                    putExplicit(propId, prop);
                }
View Full Code Here

     * @param propId ID of property
     * @return new Property object
     * @throws PropertyException if there's a problem while processing the property
     */
    private Property getShorthand(int propId) throws PropertyException {
        PropertyMaker propertyMaker = findMaker(propId);

        if (propertyMaker != null) {
            return propertyMaker.getShorthand(this);
        } else {
            //log.error("no Maker for " + propertyName);
            return null;
        }
    }
View Full Code Here

     * @param propId ID of property
     * @return new Property object
     * @throws PropertyException if there's a problem while processing the property
     */
    private Property makeProperty(int propId) throws PropertyException {
        PropertyMaker propertyMaker = findMaker(propId);
        if (propertyMaker != null) {
            return propertyMaker.make(this);
        } else {
            //log.error("property " + propertyName
            //                       + " ignored");
        }
        return null;
View Full Code Here

     * @return isInherited value from the requested Property.Maker
     */
    private boolean isInherited(int propId) {
        if (inheritableProperty == null) {
            inheritableProperty = new boolean[Constants.PROPERTY_COUNT + 1];
            PropertyMaker maker = null;
            for (int prop = 1; prop <= Constants.PROPERTY_COUNT; prop++) {
                maker = findMaker(prop);
                inheritableProperty[prop] = (maker != null && maker.isInherited());
            }
        }

        return inheritableProperty[propId];
    }
View Full Code Here

TOP

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

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.