Package com.volantis.styling.properties

Examples of com.volantis.styling.properties.StyleProperty


        // Tell log4j to log everything for your test packages.
        category.setLevel(Level.ALL);

        // Test removing background-attachment from CSS Mobile Profile.
        final String ssversion = DevicePolicyConstants.CSS_MOBILE_PROFILE1;
        final StyleProperty property = StylePropertyDetails.BACKGROUND_ATTACHMENT;
        final String policy = createCssPropertyPolicyName(property);
        DefaultDevice device = createDevice("Master", ssversion, null);

        // Test the default setup, it should have background-attachment.
        cssConfigurator.initialise(config,
View Full Code Here


        // Tell log4j to log everything for your test packages.
        category.setLevel(Level.ALL);

        // Use mcs-line-gap as that is not enabled in any CSS version
        // as it is internal.
        final StyleProperty property = StylePropertyDetails.MCS_LINE_GAP;
        final String policy = createCssPropertyPolicyName(property);

        // Create a vaguely realistic device hierarchy subset:
        // +-+ Master (none)
        //   +-+ PC  (CSS1)
View Full Code Here

     * @return
     */
    private Styles updateStyles(Styles dstStyles, Map srcStylesMap){
        MutablePropertyValues props = dstStyles.getPropertyValues();
        StyleValue styleValue;
        StyleProperty styleProperty;
       
        for(Iterator iter = srcStylesMap.keySet().iterator();iter.hasNext();){
            styleProperty = (StyleProperty)iter.next();
            styleValue = (StyleValue)srcStylesMap.get(styleProperty);
            props.setComputedAndSpecifiedValue(styleProperty,styleValue);           
View Full Code Here

            // to have no properties for a selector.
            if (properties != null) {
                Iterator p = properties.propertyValueIterator();
                while (p.hasNext()) {
                    PropertyValue propertyValue = (PropertyValue) p.next();
                    StyleProperty property = propertyValue.getProperty();
                    StyleValue value = propertyValue.getValue();
                    StyleValue activated = activateStyleValue(property, value);
                    if (activated != value) {
                        propertyValue =
                            ThemeFactory.getDefaultInstance().createPropertyValue(
View Full Code Here

                new MutablePropertyValuesMock("values", expectations);

        StylePropertyDefinitions definitions =
                StylePropertyDetails.getDefinitions();
        for (Iterator i = definitions.stylePropertyIterator(); i.hasNext();) {
            StyleProperty prop = (StyleProperty)i.next();
            if (!property.equals(prop) ){
                values.expects.getComputedValue(prop).
                        returns(null).any();
            } else {
                values.expects.getComputedValue(property).returns(value).any();
View Full Code Here

                new MutablePropertyValuesMock("values", expectations);

        StylePropertyDefinitions definitions =
                StylePropertyDetails.getDefinitions();
        for (Iterator i = definitions.stylePropertyIterator(); i.hasNext();) {
            StyleProperty prop = (StyleProperty)i.next();
            PropertyValue propertyValue = null;
            if (array != null) {
                propertyValue = array.getPropertyValue(prop);
            }
            if (propertyValue == null) {
View Full Code Here

        // ===================================================================
        //   Test when setting Styles values
        // ===================================================================

        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);
View Full Code Here

            // Now see what order they should be in.
            MenuItemComponentRenderer first;
            MenuItemComponentRenderer second;

            final StyleProperty ORDER_PROPERTY
                    = StylePropertyDetails.MCS_MENU_ITEM_ORDER;

            StyleValue order = properties.getComputedValue(ORDER_PROPERTY);
            if (order == MCSMenuItemOrderKeywords.IMAGE_FIRST) {
                    first = imageRenderer;
                    second = textRenderer;
            } else if (order == MCSMenuItemOrderKeywords.TEXT_FIRST) {
                    first = textRenderer;
                    second = imageRenderer;
            } else {
                    throw new IllegalStateException
                            ("Unknown keyword " + order + " for "
                             + ORDER_PROPERTY.getName());
            }

            // Determine which component, or components is active.
            final StyleProperty ACTIVE_AREA_PROPERTY
                    = StylePropertyDetails.MCS_MENU_ITEM_ACTIVE_AREA;

            // Get the enumeration value from the properties.
            StyleValue activeArea = properties.getComputedValue(ACTIVE_AREA_PROPERTY);

            ActiveMenuItemComponent activeComponent;
            if (activeArea == MCSMenuItemActiveAreaKeywords.IMAGE_ONLY) {
                if (first == imageRenderer) {
                    activeComponent = ActiveMenuItemComponent.FIRST;
                } else {
                    activeComponent = ActiveMenuItemComponent.SECOND;
                }
            } else if (activeArea == MCSMenuItemActiveAreaKeywords.TEXT_ONLY) {
                if (first == textRenderer) {
                    activeComponent = ActiveMenuItemComponent.FIRST;
                } else {
                    activeComponent = ActiveMenuItemComponent.SECOND;
                }
            } else if (activeArea == MCSMenuItemActiveAreaKeywords.BOTH) {
                activeComponent = ActiveMenuItemComponent.BOTH;
            } else {
                throw new IllegalStateException
                        ("Unknown keyword " + activeArea + " for "
                        + ACTIVE_AREA_PROPERTY.getName());
            }

            // Now see what separator should be used.
            separator = selector.selectMenuItemSeparator(menu);
View Full Code Here

                                                            boolean provideAltText) {

        MenuItemComponentRenderer renderer;

        // Use the correct property for this selection.
        final StyleProperty PROPERTY
                = StylePropertyDetails.MCS_MENU_IMAGE_STYLE;

        // Get the keyword value.
        StyleValue value = properties.getComputedValue(PROPERTY);

        // Choose the appropriate image renderer based on the
        // mcs-menu-image-style property.
        if (value == MCSMenuImageStyleKeywords.NONE) {
            renderer = null;
        } else if (value == MCSMenuImageStyleKeywords.PLAIN) {
            renderer = factory.createPlainImageRenderer(provideAltText);
        } else if (value == MCSMenuImageStyleKeywords.ROLLOVER) {
            renderer = factory.createRolloverImageRenderer(provideAltText);
        } else {
            throw new IllegalStateException
                    ("Unknown keyword " + value
                    + " for " + PROPERTY.getName());
        }

        return renderer;
    }
View Full Code Here

    private MenuItemComponentRenderer selectTextRenderer(PropertyValues properties) {

        MenuItemComponentRenderer renderer;

        // Use the correct property for this selection.
        final StyleProperty PROPERTY
                = StylePropertyDetails.MCS_MENU_TEXT_STYLE;

        // Get the keyword value.
        StyleValue value = properties.getComputedValue(PROPERTY);

        // Choose the appropriate text renderer based on the
        // mcs-menu-text-style.
        if (value == MCSMenuTextStyleKeywords.NONE) {
            renderer = null;
        } else if (value == MCSMenuTextStyleKeywords.PLAIN) {
            renderer = factory.createPlainTextRenderer();
        } else {
            throw new IllegalStateException
                    ("Unknown keyword " + value
                    + " for " + PROPERTY.getName());
        }

        return renderer;
    }
View Full Code Here

TOP

Related Classes of com.volantis.styling.properties.StyleProperty

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.