Package com.volantis.mcs.themes

Examples of com.volantis.mcs.themes.StyleValue


        final MutablePropertyValues values =
                styles.getPropertyValues();
        if (properties != null) {
            values.iterateStyleProperties(new StylePropertyIteratee() {
                public IterationAction next(StyleProperty property) {
                    StyleValue value = properties.getStyleValue(property);
                    values.setComputedValue(property, value);
                    if (specified) {
                        values.setSpecifiedValue(property, value);
                    }
                    return IterationAction.CONTINUE;
View Full Code Here


    protected boolean checkInitialValue(
            PropertyDetails details, StyleValue inputValue,
            StyleValues inputValues) {

        // If the value matches the initial value then it can be cleared.
        StyleValue initialValue = initialValueFinder.getInitialValue(
                inputValues, details);

        return OptimizerHelper.styleValueEqualsWithAny(inputValue,
                initialValue);
    }
View Full Code Here

        // If these conditions are not met then individual properties have to
        // be used.
        canUseShorthand = super.canUseShorthand();
        if (canUseShorthand) {

            StyleValue topLeft = getCornerValue(inputValues, 0);
            StyleValue topRight = getCornerValue(inputValues, 1);
            StyleValue bottomRight = getCornerValue(inputValues, 2);
            StyleValue bottomLeft = getCornerValue(inputValues, 3);

            if(areEqual(topLeft, topRight, bottomRight, bottomLeft)) {
                cornerCount = 1;
                corners[0] = topLeft;
            } else {
View Full Code Here

    // java inherit
    protected int getShorthandValuesCost() {
        int cost = 0;
        int separatorCost = 0;
        for (int i = 0; i < cornerCount; i++) {
            StyleValue edge = corners[i];
            cost += separatorCost;
            cost += edge.getStandardCost();
            separatorCost = 1; // The ' '.
        }
        return cost;
    }   
View Full Code Here

     *         {@link StyleURI}.
     */
    protected StyleValue resolveImage(
            StyleProperty property, StyleValue value) {

        StyleValue image = StyleKeywords.NONE;
        if (value == StyleKeywords.NONE) {
            // Nothing to do.
        } else if (value instanceof StyleURI) {
            // Nothing to do.
            image = value;
View Full Code Here

     *         {@link StyleURI}.
     */
    protected StyleValue resolveVideo(
            StyleProperty property, StyleValue value) {

        StyleValue image = StyleKeywords.NONE;
        if (value == StyleKeywords.NONE) {
            // There is nothing to do, use the background image component if
            // there is one.
        } else if (value instanceof StyleURI) {
            // The value is already a URI so assume that it works and use
View Full Code Here

     */
    protected StyleValue resolveText(
            StyleProperty property, StyleValue value,
            EncodingCollection requiredEncodings) {

        StyleValue text = null;
        if (value == StyleKeywords.NONE) {
            return null;
        } else if (value instanceof StyleString) {
            // The value is already a URI so assume that it works and use
            // it instead of the image.
View Full Code Here

        if (!supportedProperties.contains(BACKGROUND_IMAGE)) {
            return;
        }

        // Get the value of the background dynamic visual.
        StyleValue inputVideoValue = inputValues.getStyleValue(
                StylePropertyDetails.MCS_BACKGROUND_DYNAMIC_VISUAL);
        StyleValue inputImageValue = getSupportedStyleValue(
                inputValues, BACKGROUND_IMAGE);

        StyleValue resolvedImage = null;
        if (inputVideoValue != null) {
            resolvedImage = resolveVideo(
                    StylePropertyDetails.MCS_BACKGROUND_DYNAMIC_VISUAL,
                    inputVideoValue);
        }

        // If the background-image has not been overridden by the background
        // dynamic visual then try and resolve it too.
        if (resolvedImage == null ||
                resolvedImage == BackgroundImageKeywords.NONE) {
            if (inputImageValue != null) {
                resolvedImage = resolveImage(BACKGROUND_IMAGE, inputImageValue);
            }
        }

        // Set the property if the image has not changed.
        if (resolvedImage != null && !resolvedImage.equals(inputImageValue)) {
            inputValues.setComputedValue(BACKGROUND_IMAGE, resolvedImage);
        }
    }
View Full Code Here

    }

    // Javadoc inherited.
    public void normalize(MutablePropertyValues inputValues) {

        StyleValue display = inputValues.getComputedValue(
                StylePropertyDetails.DISPLAY);
        StyleValue overflow = inputValues.getComputedValue(
                StylePropertyDetails.OVERFLOW);
        StyleValue marqueeStyle = inputValues.getComputedValue(
                StylePropertyDetails.MCS_MARQUEE_STYLE);

        // The marquee style outputProperties are only relevant if
        // a) the display is set to BLOCK
        // b) marquee style is set to any value but NONE
View Full Code Here

        properties = addSystemFont(properties);

        for (Iterator i = properties.propertyValueIterator(); i.hasNext();) {
            PropertyValue propertyValue = (PropertyValue) i.next();

            StyleValue value = propertyValue.getValue();

            // Compile the value.
            StyleValue compiledValue = compiler.compile(value);

            // If compiling changed the value then create a new property value.
            Priority priority = propertyValue.getPriority();
            if (compiledValue != value) {
                propertyValue = ThemeFactory.getDefaultInstance().
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.