Package com.volantis.mcs.themes

Examples of com.volantis.mcs.themes.StyleValue


    public TextAlignNormalizer(ImmutableStylePropertySet supportedProperties) {
        super(supportedProperties);
    }

    public void normalize(MutablePropertyValues inputValues) {
        StyleValue display = getSupportedStyleValue(inputValues,
                StylePropertyDetails.DISPLAY);

        if (display == DisplayKeywords.INLINE ||
                inputValues.shouldExcludeFromCSS(
                        StylePropertyDetails.TEXT_ALIGN)) {
View Full Code Here


     *
     * @param values to be searched and updated.
     */
    public void translate(MutablePropertyValues values) {

        StyleValue align = values.getComputedValue(StylePropertyDetails.TEXT_ALIGN);
        StyleValue direction = values.getComputedValue(StylePropertyDetails.DIRECTION);

        StyleValue newAlign = null;

        if (align != null) {
            if (align == TextAlignKeywords.START) {
                if (direction == DirectionStyleKeywords.LTR) {
                    newAlign = TextAlignKeywords.LEFT;
View Full Code Here

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

        // Before analysing the standard properties need to determine whether
        // or not to use a background dynamic visual or not.
        StyleValue image = inputValues.getComputedValue(
                StylePropertyDetails.BACKGROUND_IMAGE);

        // If no image was found then a number of the other properties
        // have no effect so clear them. The only property left is color so
        // if that cannot be thrown away then create a shorthand containing
View Full Code Here

            // All the priorities are equal and all the properties are set
            // so it is possible that the values on all edges may be equal.


            // Now check to see how many properties are needed.
            StyleValue top = getEdgeValue(inputValues, PropertyGroups.TOP);
            StyleValue right = getEdgeValue(inputValues, PropertyGroups.RIGHT);
            StyleValue bottom = getEdgeValue(inputValues,
                    PropertyGroups.BOTTOM);
            StyleValue left = getEdgeValue(inputValues, PropertyGroups.LEFT);

            // If there is only one value, it applies to all sides. If there are
            // two values, the top and bottom borders are set to the first value
            // and the right and left are set to the second. If there are three
            // values, the top is set to the first value, the left and right are
            // set to the second, and the bottom is set to the third. If there are
            // four values, they apply to the top, right, bottom, and left,
            // respectively.

            StyleValue commonTopBottom = commonValue(top, bottom);
            StyleValue commonRightLeft = commonValue(left, right);

            if (commonRightLeft != null) {
                if (commonTopBottom != null) {
                    StyleValue commonTopRight =
                            commonValue(commonTopBottom, commonRightLeft);
                    if (commonTopRight != null) {
                        // All the values are the same so only write out one value.
                        edgeCount = 1;
                        edges[0] = getConcreteValue(PropertyGroups.TOP,
View Full Code Here

            AssetResolver resolver) {
        super(supportedProperties, resolver);
    }

    public void normalize(MutablePropertyValues inputValues) {
        StyleValue value = getSupportedStyleValue(inputValues,
                MCS_INPUT_FORMAT);
        if (value != null) {
            StyleValue resolved = resolveText(MCS_INPUT_FORMAT, value,
                    REQUIRED_ENCODINGS);
            if (resolved != value) {
                inputValues.setComputedValue(MCS_INPUT_FORMAT, resolved);
            }
        }
View Full Code Here

            MutableStylePropertySet requiredForShorthand) {

        int cost = 0;
        int separatorCost = 0;
        for (int i = 0; i < edgeCount; i++) {
            StyleValue edge = edges[i];
            cost += separatorCost;
            cost += edge.getStandardCost();
            separatorCost = 1; // The ' '.
        }

        clearProperties(requiredForIndividual, requiredForShorthand);
View Full Code Here

        // the widths are set to 0 then the value of any of the other properties
        // for the same edge are irrelevant so mark them as being able to take
        // any value.
        for (int i = 0; i < PropertyGroups.EDGE_COUNT; i++) {
            StyleProperty property;
            StyleValue value;
            boolean ignoreColor = false;
            boolean ignoreStyle = false;
            boolean ignoreWidth = false;

            property = PropertyGroups.BORDER_STYLE_PROPERTIES[i];
View Full Code Here

    // Javadoc inherited.
    public StyleValue compile(StyleValue value) {

        // Save this away just in case we are being called from with the visit
        // method.
        StyleValue previousCompiledValue = compiledValue;

        // Pass through the value by default.
        compiledValue = value;

        value.visit(this, null);

        StyleValue currentCompiledValue = compiledValue;

        // Reset the previous state.
        compiledValue = previousCompiledValue;

        return currentCompiledValue;
View Full Code Here

        // compiled version of the list, otherwise just return it.
        List compiledList = new ArrayList();
        List list = value.getList();
        boolean containsCompiledValue = false;
        for (int i = 0; i < list.size(); i++) {
            StyleValue item = (StyleValue) list.get(i);

            // Compile the item if the value changes then remember.
            StyleValue compiledItem = compile(item);
            if (compiledItem == null) {
                throw new IllegalStateException("List item " + i +
                        " '" + String.valueOf(item) +
                        "' could not be compiled");
            } else {
View Full Code Here

        // try and compile them. If any of them were compiled then create a
        // compiled version of the list, otherwise just return it.
        List compiledList = new ArrayList();
        boolean containsCompiledValue = false;
        for (int i = 0; i < arguments.size(); i++) {
            StyleValue item = (StyleValue) arguments.get(i);

            // Compile the item if the value changes then remember.
            StyleValue compiledItem = compile(item);
            if (compiledItem == null) {
                throw new IllegalStateException("Argument " + i +
                        " '" + String.valueOf(item) +
                        "' could not be compiled");
            } else {
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.