Package com.volantis.mcs.themes

Examples of com.volantis.mcs.themes.PropertyValueArray


    // Javadoc inherited.
    public Prioritised[] split(StyleProperties properties) {

        // Reset the state.
        for (Iterator i = priority2Values.values().iterator(); i.hasNext();) {
            PropertyValueArray array = (PropertyValueArray) i.next();
            array.clear();
        }

        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().
                    createPropertyValue(propertyValue.getProperty(),
                        compiledValue, priority);
            }

            PropertyValueArray array = (PropertyValueArray)
                    priority2Values.get(priority);
            if (array == null) {
                array = new SparsePropertyValueArray();
                priority2Values.put(priority, array);
            }

            array.setPropertyValue(propertyValue);
        }

        Prioritised[] prioritised = new Prioritised[priority2Values.size()];
        int p = 0;
        for (Iterator i = priority2Values.entrySet().iterator(); i.hasNext();
             p += 1) {

            Map.Entry entry = (Map.Entry) i.next();
            Priority priority = (Priority) entry.getKey();
            PropertyValueArray array = (PropertyValueArray) entry.getValue();
            prioritised[p] = new Prioritised(priority,
                    array.toPropertyValueArray());
        }
        return prioritised;
    }
View Full Code Here


    // Javadoc inherited.
    public DeviceStyles getMatchingStyles(
            StatefulPseudoClassSet pseudoClasses) {

        if (nestedStyles != null) {
            PropertyValueArray array = null;
            for (int i = 0; i < nestedStyles.length; i++) {
                DeviceStylesImpl deviceStyles =  nestedStyles[i];
                PseudoStyleEntity entity = deviceStyles.pseudoStyleEntity;
                if (entity instanceof StatefulPseudoClassSet) {
                    StatefulPseudoClassSet other =
View Full Code Here

        for (int i = 0; i < PropertyGroups.EDGE_COUNT; i += 1) {
            StyleProperty styleProperty = PropertyGroups.BORDER_STYLE_PROPERTIES[i];
            StyleProperty widthProperty = PropertyGroups.BORDER_WIDTH_PROPERTIES[i];

            PropertyValueArray optimiseValues;

            optimiseValues = new SparsePropertyValueArray();
            optimiseValues.setStyleValue(styleProperty, BorderStyleKeywords.NONE);
            optimiseValues.setStyleValue(widthProperty, length10);

            PropertyValueArray noOptValues = new SparsePropertyValueArray();
            noOptValues.setStyleValue(styleProperty, BorderStyleKeywords.SOLID);
            noOptValues.setStyleValue(widthProperty, length10);

            checkCanOptimizeWithParticularPropertyValues(
                    optimiseValues,
                    noOptValues,
                    STYLES, INNER);
View Full Code Here

TOP

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

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.