Package com.volantis.mcs.themes

Examples of com.volantis.mcs.themes.StyleValue


        // Nothing to do if list style images are not supported.
        if (!supportedProperties.contains(LIST_STYLE_IMAGE)) {
            return;
        }

        StyleValue image = null;
        StyleValue styleValue = getSupportedStyleValue(inputValues,
                LIST_STYLE_IMAGE);
        if (styleValue != null) {
            image = resolveImage(LIST_STYLE_IMAGE, styleValue);

            inputValues.setComputedValue(LIST_STYLE_IMAGE, image);
View Full Code Here


    }

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

        StyleValue specified = values.getSpecifiedValue(property);
        StyleValue computed = null;

        if (specified instanceof StyleInherit) {
            computed = inheritableValues.getStyleValue(property);

        } else if (specified == null) {
View Full Code Here

            StyleProperty property = group[i];
            int bit = 1 << i;

            all |= bit;

            StyleValue styleValue = inputValues.getStyleValue(property);
            if (styleValue == null) {
                // The property was not set so there is nothing to do, this
                // will probably mean that the shorthand cannot be used.
            } else {

                StyleValue deviceValue = deviceValues.getStyleValue(property);

                // The property is set.
                set |= bit;

                // Check the status of the value to see what can be done
View Full Code Here

        for (int index = 0; index < group.length; index++) {
            StyleProperty property = group[index];
            if (required.contains(property)) {
                // Calculate the cost of the property and it's concrete value.
                StyleValue value = inputValues.getStyleValue(property);
                value = getConcreteValue(index, value);
                cost += property.getName().length();
                cost += 1; // The ':'.
                cost += value.getStandardCost();
                if (isImportant(index)) {
                    cost += Priority.IMPORTANT.getStandardCost();
                }
            }
        }
View Full Code Here

     *                     it is important.
     */
    private void copyValue(
            StyleProperty property, MutableStyleProperties outputValues,
            int index) {
        StyleValue styleValue = inputValues.getStyleValue(property);
        if (styleValue != null) {
            int bit = 1 << index;
            boolean important = (this.important & bit) != 0;
            outputValues.setPropertyValue(
                ThemeFactory.getDefaultInstance().createPropertyValue(property,
View Full Code Here

        int count = group.length;
        StyleValue[] values = new StyleValue[count];
        for (int index = 0; index < group.length; index++) {
            StyleProperty property = group[index];
            if (isRequiredShorthandProperty(index)) {
                final StyleValue concreteValue = getConcreteValue(index,
                        inputValues.getStyleValue(property));
                values[index] = concreteValue;
            }

            requiredForShorthand.remove(property);
View Full Code Here

        for (int index = 0; index < group.length; index++) {
            // Only values that can not be treated as initial values affect the
            // cost of the shorthand.
            StyleProperty property = group[index];
            if (isRequiredShorthandProperty(index)) {
                StyleValue value = getConcreteValue(index,
                        inputValues.getStyleValue(property));
                if (value != null) {
                    cost += separatorCost;
                    cost += value.getStandardCost();
                    separatorCost = 1; // The ' '.
                }
            }

            requiredForIndividual.remove(property);
View Full Code Here

     *         {@link OptimizerHelper#ANY}. Note this may be null if property
     *         is not required
     */
    protected StyleValue getConcreteValue(int index, StyleValue logicalValue) {

        StyleValue concreteValue;

        if (logicalValue == null) {
            throw new IllegalArgumentException("logicalValue cannot be null");
        }

View Full Code Here

     *
     * @param index The index of the property within the group.
     * @return The initial value, will not be null.
     */
    protected StyleValue getRequiredInitialValue(int index) {
        StyleValue result;

        // Then we definitely can't use null or it would upset the
        // styling, so we instead use the initial value of the property.
        final StyleProperty property = group[index];
        result = (StyleValue) INITIAL_VALUE_OVERRIDES.get(property);
View Full Code Here

            MutableStyleProperties outputValues,
            MutableStylePropertySet requiredForIndividual,
            MutableStylePropertySet requiredForShorthand) {

        if (systemFontRequired) {
            StyleValue systemFont = inputValues.getStyleValue(
                    StylePropertyDetails.MCS_SYSTEM_FONT);

            StyleValue[] values = new StyleValue[FontShorthandValue.PROPERTIES.length];
            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) {
                    values[i] = 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.