Package org.apache.fop.fo.properties

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


        }
        int propID = FOPropertyMapping.getPropertyId(propName);
        if (propID < 0) {
            collector.notifyAssertionFailure("Property not found: " + propName);
        } else {
            Property prop;
            prop = propertyList.getParentPropertyList().get(propID);
            if (component != null) {
                //Access subcomponent
                Property mainProp = prop;
                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));
                }
                SpaceProperty sp = mainProp.getSpace();
                if (sp != null) {
                    prop = sp.getComponent(FOPropertyMapping.getSubPropertyId(component));
                }
            }
            String s;
View Full Code Here


     * @param context Percentage evaluation context
     */
    public SpaceVal(SpaceProperty spaceprop, PercentBaseContext context) {
        space = createSpaceProperty(spaceprop, context);
        conditional = (spaceprop.getConditionality().getEnum() == Constants.EN_DISCARD);
        Property precProp = spaceprop.getPrecedence();
        if (precProp.getNumber() != null) {
            precedence = precProp.getNumber().intValue();
            forcing = false;
        } else {
            forcing = (precProp.getEnum() == Constants.EN_FORCE);
            precedence = 0;
        }
    }
View Full Code Here

     * retrieved property values.
     * {@inheritDoc}
     */
    public Property get(int propId, boolean bTryInherit, boolean bTryDefault)
        throws PropertyException {
        Property p = values[propId];
        if (p == null) {
            p = super.get(propId, bTryInherit, bTryDefault);
            values[propId] = p;
        }
        return p;
View Full Code Here

         * Check the value of the column-number property.
         */
        public Property make(PropertyList propertyList, String value, FObj fo)
                    throws PropertyException {

            Property p = super.make(propertyList, value, fo);

            int columnIndex = p.getNumeric().getValue();
            int colSpan = propertyList.get(Constants.PR_NUMBER_COLUMNS_SPANNED)
                                .getNumeric().getValue();

            // only check whether the column-number is occupied in case it was
            // specified on a fo:table-cell or fo:table-column
View Full Code Here

     * @throws Exception exception
     */
    @Test
    public void testIsInfinite1() throws Exception {
        //  Create fixture
        Property maximumRepeats = mock(Property.class);
        ConditionalPageMasterReference cpmr = createCPMR("empty");

        when(maximumRepeats.getEnum()).thenReturn(EN_NO_LIMIT);

        RepeatablePageMasterAlternatives objectUnderTest
        = createRepeatablePageMasterAlternatives(cpmr, maximumRepeats);

        assertTrue("is infinite", objectUnderTest.isInfinite());
View Full Code Here

     * @throws Exception exception
     */
    @Test
    public void testIsInfinite2() throws Exception {
        //  Create fixture
        Property maximumRepeats = mock(Property.class);
        ConditionalPageMasterReference cpmr = createCPMR("empty");

        NumericProperty numericProperty = mock(NumericProperty.class);

        final int maxRepeatNum = 0;
        assertTrue(maxRepeatNum != EN_NO_LIMIT);

        when(maximumRepeats.getEnum()).thenReturn(maxRepeatNum);
        when(maximumRepeats.getNumeric()).thenReturn(numericProperty);

        RepeatablePageMasterAlternatives objectUnderTest
        = createRepeatablePageMasterAlternatives(createCPMR("empty"),
                maximumRepeats);

View Full Code Here

     * @throws Exception exception
     */
    @Test
    public void testCanProcess1() throws Exception {
        //  Create fixture
        Property maximumRepeats = mock(Property.class);
        ConditionalPageMasterReference cpmr = createCPMR("empty");

        when(maximumRepeats.getEnum()).thenReturn(EN_NO_LIMIT);
        when(cpmr.isValid(anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean()))
        .thenReturn(true);

        RepeatablePageMasterAlternatives objectUnderTest
        = createRepeatablePageMasterAlternatives(cpmr, maximumRepeats);
View Full Code Here

     * @throws Exception exception
     */
    @Test
    public void testCanProcess2() throws Exception {
        //  Create fixture
        Property maximumRepeats = mock(Property.class);
        NumericProperty numericProperty = mock(NumericProperty.class);

        final int maxRepeatNum = 0;

        when(maximumRepeats.getEnum()).thenReturn(maxRepeatNum);
        when(maximumRepeats.getNumeric()).thenReturn(numericProperty);

        RepeatablePageMasterAlternatives objectUnderTest
        = createRepeatablePageMasterAlternatives(createCPMR("empty"),
                maximumRepeats);

View Full Code Here

            // if prop value is empty string, force to StringProperty
            return StringProperty.getInstance("");
        }
        ListProperty propList = null;
        while (true) {
            Property prop = parseAdditiveExpr();
            if (currentToken == TOK_EOF) {
                if (propList != null) {
                    propList.addProperty(prop);
                    return propList;
                } else {
View Full Code Here

     * Try to parse an addition or subtraction expression and return the
     * resulting Property.
     */
    private Property parseAdditiveExpr() throws PropertyException {
        // Evaluate and put result on the operand stack
        Property prop = parseMultiplicativeExpr();
        loop:
        while (true) {
            switch (currentToken) {
            case TOK_PLUS:
                next();
                prop = evalAddition(prop.getNumeric(),
                                    parseMultiplicativeExpr().getNumeric());
                break;
            case TOK_MINUS:
                next();
                prop = evalSubtraction(prop.getNumeric(),
                                    parseMultiplicativeExpr().getNumeric());
                break;
            default:
                break loop;
            }
View Full Code Here

TOP

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

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.