Package com.volantis.mcs.themes

Examples of com.volantis.mcs.themes.StyleValue


    public int getShorthandCost(
            MutableStylePropertySet requiredForIndividual,
            MutableStylePropertySet requiredForShorthand) {
        int cost = 0;
        if (systemFontRequired) {
            StyleValue systemFont = inputValues.getStyleValue(
                    StylePropertyDetails.MCS_SYSTEM_FONT);
            cost += StyleShorthands.FONT.getName().length() + 1 +
                    systemFont.getStandardCost();

            for (int i = 0; i < FontShorthandValue.PROPERTIES.length; i++) {
                StyleProperty property = FontShorthandValue.PROPERTIES[i];
                StyleValue value = inputValues.getStyleValue(property);
                if (value != UnknownFontValue.INSTANCE && value != null) {
                    cost += 1 + property.getName().length() + 1 +
                            value.getStandardCost();
                }
            }
        } else {
            cost = standardAnalyzer.getShorthandCost(requiredForIndividual,
                    requiredForShorthand);
View Full Code Here


        characteristicCount = 0;
        for (int i = 0;
             i < characteristicAnalyzers.length && canUseSingleBorder; i++) {

            EdgeCharacteristicAnalyzer analyser = characteristicAnalyzers[i];
            StyleValue value = analyser.getCommonValue();
            if (value == null && !analyser.allClearable()) {
                canUseSingleBorder = false;
            } else {

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

        cost += 1; // The ':'.
        int separatorCost = 0;

        StyleValue[] values = characteristics;
        for (int i = 0; i < characteristicCount; i++) {
            StyleValue value = values[i];

            if (value != null) {
                cost += separatorCost;
                cost += value.getStandardCost();
                separatorCost = 1;
            }
        }

        return cost;
View Full Code Here

        PropertyValues values = styles.getPropertyValues();

        if (values != null) {

            // If this styles has display:none ...
            StyleValue display = values.getComputedValue(
                    StylePropertyDetails.DISPLAY);
            if (display == DisplayKeywords.NONE) {
                // ... then it cannot increment or reset a counter.
            } else {
                // ... else it can increment and reset counters.
                // So process the counters.

                // Process any resets before any increments.
                StyleValue reset = values.getComputedValue(
                        StylePropertyDetails.COUNTER_RESET);
                if (reset != null) {
                    reset.visit(counterResetter, null);
                }
                StyleValue increment = values.getComputedValue(
                        StylePropertyDetails.COUNTER_INCREMENT);
                if (increment != null) {
                    increment.visit(counterIncrementer, null);
                }
            }
        }
    }
View Full Code Here

        InitialValueFinder initialValueFinder = new InitialValueFinder();
        Styles styles = new StylesImpl();
        MutablePropertyValues propertyValues = styles.getPropertyValues();
        while (iterator.hasNext()) {
            StyleProperty property = (StyleProperty) iterator.next();
            StyleValue value;
            if (property.getStandardDetails().isInherited()) {
                value = parentValues.getStyleValue(property);
            } else  {
                value = initialValueFinder.getInitialValue(
                        propertyValues, property.getStandardDetails());
View Full Code Here

    public void visit(StyleList value, Object object) {

        // Iterate over the elements of the list.
        List list = value.getList();
        for (int i = 0; i < list.size(); i++) {
            StyleValue styleValue = (StyleValue) list.get(i);
            styleValue.visit(this, null);
        }
    }
View Full Code Here

    // Javadoc inherited.
    public void visit(StylePair value, Object object) {

        // Suck "string, int" out of the pair
        StyleValue first = value.getFirst();
        if (first instanceof StyleIdentifier) {
            StyleIdentifier styleIdentifier = (StyleIdentifier) first;
            String name = styleIdentifier.getName();
            Integer integer = null;

            StyleValue second = value.getSecond();
            if (second instanceof StyleInteger) {
                StyleInteger styleInteger = (StyleInteger) second;
                integer = new Integer(styleInteger.getInteger());
            }
View Full Code Here

    public String getStandardCSS() {
        StringBuffer buffer = new StringBuffer();
        if (computedValues != null) {
            String separator = "";
            for (int i = 0; i < computedValues.length; i++) {
                StyleValue propertyValue = computedValues[i];
                if (propertyValue != null) {
                    StyleProperty property = definitions.getStyleProperty(i);
                    buffer.append(separator)
                            .append(property.getName())
                            .append(":")
                            .append(propertyValue.getStandardCSS());
                    separator = ";";
                }
            }
        }
        return buffer.toString();
View Full Code Here

        int counterValue = context.getCounterValue(counterName);

        CounterFormatter formatter = formatterSelector.selectFormatter(
                formatStyle, counterValue);

        StyleValue result = formatter.formatAsStyleValue(formatStyle, counterValue);

        return result;
    }
View Full Code Here

    // Javadoc inherited.
    public void overrideUnlessExplicitlySpecified(
            StyleProperty property, StyleValue value) {

        if (!wasExplicitlySpecified(property)) {
            StyleValue actual = getComputedValue(property);
            if (actual == null ? value != null : !actual.equals(value)) {
                setComputedAndSpecifiedValue(property, value);
            }
        }
    }
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.