Package com.volantis.mcs.themes

Examples of com.volantis.mcs.themes.StyleValue


    // Javadoc inherited.
    public StyleValue evaluate(EvaluationContext context) {
        List evaluatedValues = new ArrayList();
        for (int i = 0; i < compiledValues.size(); i++) {
            StyleValue value = (StyleValue) compiledValues.get(i);
            StyleValue evaluatedValue;
            if (value instanceof StyleCompiledExpression) {
                StyleCompiledExpression expression =
                        (StyleCompiledExpression) value;
                evaluatedValue = expression.evaluate(context);
            } else {
View Full Code Here


    // Javadoc inherited.
    public String getDescription() {
        StringBuffer description = new StringBuffer();
        for(Iterator i = compiledValues.iterator(); i.hasNext(); ) {
            StyleValue value = (StyleValue) i.next();
            description.append(value.getStandardCSS()).append(' ');
        }
        return description.toString();
    }
View Full Code Here

    public List evaluate(EvaluationContext context) {
        List evaluated;
        if (containsExpression) {
            evaluated = new ArrayList();
            for (int i = 0; i < values.size(); i++) {
                StyleValue value = (StyleValue) values.get(i);
                if (value instanceof StyleCompiledExpression) {
                    StyleCompiledExpression expression =
                            (StyleCompiledExpression) value;
                    value = expression.evaluate(context);
                }
View Full Code Here

    // Javadoc inherited.
    public IterationAction next(StyleProperty property) {

        // If the value is a compiled expression then evaluate it and store
        // the result back into the properties.
        StyleValue value = values.getComputedValue(property);

        if (value instanceof StyleCompiledExpression) {
            StyleValue evaluatedValue;
            StyleCompiledExpression expression =
                    (StyleCompiledExpression) value;
            evaluatedValue = expression.evaluate(context);
            values.setComputedValue(property, evaluatedValue);
        }
View Full Code Here

        assertEquals("Count mismatch", expectedValues.length,
                shorthandValue.getCount());

        for (int i = 0; i < expectedValues.length; i++) {
            StyleValue expectedValue = expectedValues[i];
            StyleValue value = shorthandValue.getValue(i);
            assertEquals("Value " + i + " mismatch", expectedValue, value);
        }

        // todo check that the other properties are cleared.
    }
View Full Code Here

            MutableStyleProperties outputValues,
            DeviceValues deviceValues) {

        for (int i = 0; i < individualProperties.length; i++) {
            StyleProperty property = individualProperties[i];
            StyleValue styleValue = inputValues.getStyleValue(property);
            PropertyValue optimized;
            if (styleValue != null) {
                optimized = optimizeImpl(property, styleValue,
                        inputValues, deviceValues);
                if (optimized != null) {
View Full Code Here

    private PropertyValue optimizeImpl(
            StyleProperty property, StyleValue inputValue,
            PropertyValues inputValues,
            DeviceValues deviceValues) {

        StyleValue deviceValue = deviceValues.getStyleValue(property);
        PropertyStatus status = checker.checkStatus(property, inputValue,
                StatusUsage.INDIVIDUAL, inputValues, deviceValue);
        if (status.isRequiredForIndividual()) {
            // If the priority that would be used by the device is greater than
            // normal then make this property important to ensure that it has
View Full Code Here

            fail();
        } catch (IllegalArgumentException e) {
            // expected
        }
       
        final StyleValue defaultStyleValue =
            StyleValueFactory.getDefaultInstance().getColorByRGB(null, 100);
        analyzer = new EdgeCharacteristicAnalyzer(
                StyleShorthands.BORDER_COLOR, checkerMock, defaultStyleValue,
                shorthandSetMock);
        analyzer.analyze(TargetEntity.ELEMENT, inputValues, deviceValuesMock);
       
        // verify test
        // 2 is because of ':' and ';' in getShorthandCost()
        assertEquals(StyleShorthands.BORDER_COLOR.getName().length() +
                defaultStyleValue.getStandardCost() + 2,
                analyzer.getShorthandCost(propertySet, propertySet));
    }
View Full Code Here

            PropertyDetails details, StyleValue inputValue) {

        // If the property is automatically inherited and the value
        // matches the inherited value then it can be cleared.
        StyleProperty property = details.getProperty();
        StyleValue parentValue = parentValues.getStyleValue(property);
        return OptimizerHelper.styleValueEqualsWithAny(inputValue, parentValue);
    }
View Full Code Here

     * Determine whether or not this group causes fragmentation.
     *
     * @param styles    used to determine whether this group causes fragmentation
     */
    private void setCausesFragmentation(Styles styles) {
        StyleValue breakAfter = styles.getPropertyValues().
                getSpecifiedValue(StylePropertyDetails.MCS_BREAK_AFTER);
        // Only fragment if mcs-break-after == always.
        if (breakAfter == MCSBreakAfterKeywords.ALWAYS) {
            causesFragmentation = true;
        }
View Full Code Here

TOP

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

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.