Examples of MutableStyleProperties


Examples of com.volantis.mcs.themes.MutableStyleProperties

                StylePropertyDetails.BORDER_TOP_WIDTH,
                StyleValueFactory.getDefaultInstance().getLength(
                    null, 1.0, LengthUnit.PX),
                PropertyStatus.REQUIRED);

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

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

        assertEquals("border-color:black;border-style:solid;border-width:1px 0 0",
                outputValues.getStandardCSS());
    }
View Full Code Here

Examples of com.volantis.mcs.themes.MutableStyleProperties

        setBoxProperties(inputValues, PropertyGroups.BORDER_STYLE_PROPERTIES,
                BorderStyleKeywords.SOLID, PropertyStatus.REQUIRED);
        setBoxProperties(inputValues, PropertyGroups.BORDER_WIDTH_PROPERTIES,
                BorderWidthKeywords.THICK, PropertyStatus.REQUIRED);

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

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

        assertEquals("border:black solid thick !important",
                outputValues.getStandardCSS());
    }
View Full Code Here

Examples of com.volantis.mcs.themes.MutableStyleProperties

                shorthandSetMock);

        setBoxProperties(inputValues, PropertyGroups.BORDER_COLOR_PROPERTIES,
                StyleColorNames.BLACK, PropertyStatus.REQUIRED);

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

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

        assertEquals("border-color:black !important",
                outputValues.getStandardCSS());
    }
View Full Code Here

Examples of com.volantis.mcs.themes.MutableStyleProperties

        setPropertyValue(inputValues, StylePropertyDetails.BORDER_TOP_STYLE,
                BorderStyleKeywords.SOLID, PropertyStatus.REQUIRED);
        setPropertyValue(inputValues, StylePropertyDetails.BORDER_TOP_WIDTH,
                BorderWidthKeywords.THICK, PropertyStatus.REQUIRED);

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

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

        assertEquals("border-top:black solid thick !important",
                outputValues.getStandardCSS());
    }
View Full Code Here

Examples of com.volantis.mcs.themes.MutableStyleProperties

        setPropertyValue(inputValues, StylePropertyDetails.BORDER_TOP_STYLE,
                BorderStyleKeywords.SOLID, PropertyStatus.REQUIRED);
        setPropertyValue(inputValues, StylePropertyDetails.BORDER_TOP_WIDTH,
                BorderWidthKeywords.THICK, PropertyStatus.REQUIRED);

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

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

        assertEquals("border-top:solid thick",
                outputValues.getStandardCSS());
    }
View Full Code Here

Examples of com.volantis.mcs.themes.MutableStyleProperties

        // Iterate over the entities in the path drilling down to the
        // appropriate nested styles reference.
        pseudoPath.iterate(this);

        // Get the style properties associated with the path.
        MutableStyleProperties styleProperties =
                outputStyles.getPathProperties(pseudoPath);

        // Get the property values for the styles that need updating.
        propertyValues = nestedStyles.getPropertyValues();

        styleProperties.iteratePropertyValues(this);
    }
View Full Code Here

Examples of com.volantis.mcs.themes.MutableStyleProperties

        styles.iterate(this);

        DeviceValues deviceValues = deviceStyles.getValues();

        MutableStyleProperties outputProperties =
                propertiesOptimizer.calculateOutputProperties(elementName,
                        pseudoStylePath, inputValues, parentValues,
                        deviceValues);

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

Examples of com.volantis.mcs.themes.MutableStyleProperties

            String css,
            StyleValue[] expectedValues,
            Priority expectedPriority,
            final DeviceValuesMock deviceValuesMock) {

        MutableStyleProperties outputValues =
            ThemeFactory.getDefaultInstance().createMutableStyleProperties();
        PropertyValues inputValues = helper.parseDeclarations(css);

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

        ShorthandValue shorthandValue =
                outputValues.getShorthandValue(StyleShorthands.MARGIN);

        assertNotNull("Shorthand value should be set", shorthandValue);

        Priority priority = shorthandValue.getPriority();
        assertEquals("Priority mismatch", expectedPriority, priority);
View Full Code Here

Examples of com.volantis.mcs.themes.MutableStyleProperties

    private void doIndividualTest(
            String css,
            PropertyValue[] expectedValues,
            final DeviceValuesMock deviceValuesMock) {

        MutableStyleProperties outputValues =
            ThemeFactory.getDefaultInstance().createMutableStyleProperties();
        PropertyValues inputValues = helper.parseDeclarations(css);
       
        optimizer.optimize(TargetEntity.ELEMENT, inputValues, outputValues,
                deviceValuesMock);

        for (int i = 0; i < expectedValues.length; i++) {
            PropertyValue expectedValue = expectedValues[i];
            StyleProperty property = expectedValue.getProperty();

            PropertyValue propertyValue = outputValues.getPropertyValue(
                    property);

            assertEquals("Value " + i + " mismatch", expectedValue,
                    propertyValue);
        }
View Full Code Here

Examples of com.volantis.mcs.themes.MutableStyleProperties

        parser = parserFactory.createStrictParser();
    }

    public PropertyValues parseDeclarations(String css) {
        final MutablePropertyValues values = STYLING_FACTORY.createPropertyValues();
        final MutableStyleProperties properties = parser.parseDeclarations(css);
        properties.iteratePropertyValues(new PropertyValueIteratee() {
            public IterationAction next(PropertyValue propertyValue) {
                values.setComputedValue(propertyValue.getProperty(),
                        propertyValue.getValue());
                return IterationAction.CONTINUE;
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.