Package com.volantis.mcs.themes

Examples of com.volantis.mcs.themes.MutableStyleProperties


        // =====================================================================
        //   Test Expectations
        // =====================================================================


        MutableStyleProperties outputValues =
            ThemeFactory.getDefaultInstance().createMutableStyleProperties();

        ShorthandOptimizer optimizer = new FontOptimizer(checker,
                shorthandsMock);

        checker.prepare(rootStyleProperties, TargetEntity.ELEMENT);

        optimizer.optimize(TargetEntity.ELEMENT, inputValues, outputValues,
                deviceValuesMock);

        assertEquals("font:caption;font-size:medium",
                outputValues.getStandardCSS());
    }
View Full Code Here


        // =====================================================================
        //   Test Expectations
        // =====================================================================


        MutableStyleProperties outputValues =
            ThemeFactory.getDefaultInstance().createMutableStyleProperties();

        ShorthandOptimizer optimizer = new FontOptimizer(checker,
                shorthandsMock);

        checker.prepare(rootStyleProperties, TargetEntity.ELEMENT);

        optimizer.optimize(TargetEntity.ELEMENT, inputValues, outputValues,
                deviceValuesMock);

        assertEquals("font:medium/90% Foo", outputValues.getStandardCSS());
    }
View Full Code Here

        setPropertyValue(inputValues,
                StylePropertyDetails.BACKGROUND_IMAGE,
                BackgroundImageKeywords.NONE,
                PropertyStatus.REQUIRED);

        MutableStyleProperties outputValues =
            ThemeFactory.getDefaultInstance().createMutableStyleProperties();

        optimizer.optimize(TargetEntity.ELEMENT, inputValues, outputValues,
                deviceValuesMock);

        assertEquals("background-attachment:scroll;background-image:none",
                outputValues.getStandardCSS());
    }
View Full Code Here

        setPropertyValue(inputValues,
                StylePropertyDetails.BACKGROUND_COLOR,
                StyleColorNames.RED,
                PropertyStatus.REQUIRED);

        MutableStyleProperties outputValues =
            ThemeFactory.getDefaultInstance().createMutableStyleProperties();

        optimizer.optimize(TargetEntity.ELEMENT, inputValues, outputValues,
                deviceValuesMock);

        assertEquals("background-color:red",
                outputValues.getStandardCSS());
    }
View Full Code Here

            final StyleValuesMock parentValuesMock =
                    new StyleValuesMock("parentValuesMock", expectations);

            StylingFactory stylingFactory = StylingFactory.getDefaultInstance();

            final MutableStyleProperties inputProperties =
                    parser.parseDeclarations(inputCSS);
            final MutablePropertyValues inputValues = stylingFactory.createPropertyValues(
                    StylePropertyDetails.getDefinitions());
            inputProperties.iteratePropertyValues(new PropertyValueIteratee() {
                public IterationAction next(PropertyValue propertyValue) {
                    inputValues.setComputedValue(propertyValue.getProperty(),
                            propertyValue.getValue());
                    return IterationAction.CONTINUE;
                }
            });

            final MutableStyleProperties outputValues =
                ThemeFactory.getDefaultInstance().createMutableStyleProperties();

            checker.setInputValues(inputValues);

            if (normalizer != null) {
View Full Code Here

        MutablePropertyValues values =
                STYLING_FACTORY.createPropertyValues();
        values.setComputedValue(StylePropertyDetails.BORDER_COLLAPSE,
                BorderCollapseKeywords.SEPARATE);

        MutableStyleProperties properties = optimizer.calculateOutputProperties(
                "a", PseudoStylePath.EMPTY_PATH,
                values, parentProperties, deviceValuesMock);

        System.out.println("properties: " + properties);
View Full Code Here

        MutablePropertyValues values = STYLING_FACTORY.createPropertyValues();
        values.setComputedValue(StylePropertyDetails.BORDER_COLLAPSE,
                BorderCollapseKeywords.SEPARATE);

        MutableStyleProperties properties = optimizer.calculateOutputProperties(
                "a", PseudoStylePath.EMPTY_PATH,
                values, parentProperties, deviceValuesMock);

        assertNotNull(properties);
        assertEquals("border-collapse:separate !important",
                properties.getStandardCSS());
    }
View Full Code Here

        values.setComputedValue(StylePropertyDetails.COLOR,
                StyleColorNames.RED);
        values.setComputedValue(StylePropertyDetails.BACKGROUND_COLOR,
                StyleColorNames.RED);

        MutableStyleProperties properties = optimizer.calculateOutputProperties(
                "a", PseudoStylePath.EMPTY_PATH,
                values, parentProperties, deviceValuesMock);

        assertNotNull(properties);
        assertEquals("color:red", properties.getStandardCSS());
    }
View Full Code Here

                    StyleValueFactory.getDefaultInstance().getString(
                        null, "content"))));
        values.setComputedValue(StylePropertyDetails.COLOR,
                StyleColorNames.RED);

        MutableStyleProperties properties = optimizer.calculateOutputProperties(
                "a", PseudoStylePath.EMPTY_PATH,
                values, parentProperties, deviceValuesMock);

        assertNotNull(properties);
        assertEquals("color:red", properties.getStandardCSS());
    }
View Full Code Here

        values.setComputedValue(StylePropertyDetails.BORDER_TOP_STYLE,
                BorderStyleKeywords.NONE);
        values.setComputedValue(StylePropertyDetails.BORDER_TOP_WIDTH,
                BorderWidthKeywords.THICK);

        MutableStyleProperties properties = optimizer.calculateOutputProperties(
                "a", PseudoStylePath.EMPTY_PATH,
                values, parentProperties, deviceValuesMock);

        assertNotNull(properties);
        assertEquals("border-top-style:none", properties.getStandardCSS());
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.themes.MutableStyleProperties

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.