Package com.volantis.styling.values

Examples of com.volantis.styling.values.MutablePropertyValues


     * @param divHr
     */
    private void addBorderStyling(Element divHr) {

        Styles styles = divHr.getStyles();
        MutablePropertyValues propertyValues = styles.getPropertyValues();

        // Handle border-bottom style attribute
        if (BORDER_BOTTOM_PROPERTY.equals(borderProperty)) {
            propertyValues.setComputedValue(
                    StylePropertyDetails.BORDER_BOTTOM_WIDTH, height);
            propertyValues.setComputedValue(
                    StylePropertyDetails.BORDER_BOTTOM_STYLE,
                    BorderStyleKeywords.SOLID);
            propertyValues.setComputedValue(
                    StylePropertyDetails.BORDER_BOTTOM_COLOR, color);
        } else {
            propertyValues.setComputedValue(
                    StylePropertyDetails.BORDER_TOP_WIDTH, height);
            propertyValues.setComputedValue(
                    StylePropertyDetails.BORDER_TOP_STYLE,
                    BorderStyleKeywords.SOLID);
            propertyValues.setComputedValue(
                    StylePropertyDetails.BORDER_TOP_COLOR, color);
        }

        // Handle width attribute
        propertyValues.setComputedValue(StylePropertyDetails.WIDTH, width);

        // Handle text-align style attribute
        propertyValues.setComputedValue(StylePropertyDetails.TEXT_ALIGN, align);

        // Clear Background color as it should not effect styling, but it does
        // on a LG U8150.
        propertyValues.setComputedValue(StylePropertyDetails.BACKGROUND_COLOR,
                BackgroundColorKeywords.TRANSPARENT);

    }
View Full Code Here


     * append the margin default values if they have not already been set
     * @param divHr Emulation Element
     */
    protected void setMargins(Element divHr) {
        Styles styles = divHr.getStyles();
        MutablePropertyValues propertyValues = styles.getPropertyValues();

        // Handle margin-top and margin-bottom
        propertyValues.setComputedValue(StylePropertyDetails.MARGIN_BOTTOM,
                marginBottom);

        propertyValues.setComputedValue(StylePropertyDetails.MARGIN_TOP,
                marginTop);
    }
View Full Code Here

    //javadoc inherited
    protected void initialiseState(HorizontalRuleAttributes hrAttrs) {
        super.initialiseState(hrAttrs);

        MutablePropertyValues propertyValues =
                hrAttrs.getStyles().getPropertyValues();

        if (propertyValues.wasExplicitlySpecified(StylePropertyDetails.MARGIN_TOP)) {
            marginTop = propertyValues.getComputedValue(
                    StylePropertyDetails.MARGIN_TOP);
        } else {
            marginTop = DEFAULT_VERTICAL_SPACING;
        }

        if (propertyValues.wasExplicitlySpecified(StylePropertyDetails.MARGIN_BOTTOM)) {
            marginBottom = propertyValues.getComputedValue(
                    StylePropertyDetails.MARGIN_BOTTOM);
        } else {
            marginBottom = DEFAULT_VERTICAL_SPACING;
        }
    }
View Full Code Here

//                        StylePropertyDetails.BORDER_TOP_STYLE, null);
//                styles.getPropertyValues().setComputedValue(
//                        StylePropertyDetails.BORDER_TOP_WIDTH, null);
//            }

        MutablePropertyValues propertyValues = styles.getPropertyValues();
        propertyValues.setComputedAndSpecifiedValue(property, value);
    }
View Full Code Here

                                         HorizontalRuleAttributes hrAttrs)
            throws ProtocolException {

        Element hr = domOutputBuffer.addStyledElement("hr", hrAttrs);
        Styles styles = hr.getStyles();
        MutablePropertyValues propertyValues = styles.getPropertyValues();

        // Don't need to set these as specified as these values are not the
        // initial values and hence can never be cleared.
        propertyValues.setComputedValue(
                StylePropertyDetails.BORDER_TOP_WIDTH, height);
        propertyValues.setComputedValue(
                StylePropertyDetails.BORDER_RIGHT_WIDTH, STYLE_LENGTH_0);
        propertyValues.setComputedValue(
                StylePropertyDetails.BORDER_BOTTOM_WIDTH, STYLE_LENGTH_0);
        propertyValues.setComputedValue(
                StylePropertyDetails.BORDER_LEFT_WIDTH, STYLE_LENGTH_0);
        propertyValues.setComputedValue(
                        StylePropertyDetails.BORDER_TOP_STYLE,
                        BorderStyleKeywords.SOLID);

        // Set this specified as if the color is the same as color then it
        // will be cleared unless it is explicitly specified and some devices
        // do not support inheriting border colors from the color property.
        propertyValues.setComputedAndSpecifiedValue(
                StylePropertyDetails.BORDER_TOP_COLOR, color);

        return hr;
    }
View Full Code Here

        Styles styles = element.getStyles();
        // Styles should never be null, but at the moment we create
        // non-papi related content improperly with null styles.
        // Work around this by creating a styles here anyway.
        if (styles == null) {
            MutablePropertyValues values = stylingFactory.createPropertyValues(
                    StylePropertyDetails.getDefinitions());
            styles = stylingFactory.createStyles(values);
            element.setStyles(styles);
        }
        return styles;
View Full Code Here

                    wrapper = factory.createElement(WMLConstants.BLOCH_ELEMENT);
                    // Find the styles for the wrapper. For now we just create
                    // an empty one, but really we should have a BLOCK element
                    // here for the content which would have the real styles
                    // on it.
                    MutablePropertyValues values =
                            stylingFactory.createPropertyValues(
                                    StylePropertyDetails.getDefinitions());
                    values.setComputedValue(StylePropertyDetails.WHITE_SPACE,
                            WhiteSpaceKeywords.NORMAL);
                    wrapper.setStyles(stylingFactory.createStyles(values));

                    if (logger.isDebugEnabled()) {
                        logger.debug("Opened new wrapper paragraph");
View Full Code Here

        boolean requiresWidth = false;
        boolean requiresMarginTop = false;
        boolean requiresMarginBottom = false;

        if (styles != null && styles.getPropertyValues() != null) {
            MutablePropertyValues propertyValues = styles.getPropertyValues();
            requiresColor = propertyValues.
                    getComputedValue(StylePropertyDetails.COLOR) != null;
            requiresWidth = propertyValues.
                    getComputedValue(StylePropertyDetails.WIDTH) != null;
            requiresMarginTop = propertyValues.
                    getComputedValue(StylePropertyDetails.MARGIN_TOP) != null;
            requiresMarginBottom = propertyValues.
                    getComputedValue(StylePropertyDetails.MARGIN_BOTTOM) != null;
        } else { // no styles are required to be applied
            emulator = new HorizontalRuleEmulatorWithBorderStylingOnDIV(
                    HorizontalRuleEmulatorWithBorderStylingOnDIV.
                    BORDER_BOTTOM_PROPERTY
View Full Code Here

     * @return
     */
    private HorizontalRuleEmulator investigateMultipleDivEmulator(Styles styles) {
        HorizontalRuleEmulator emulator = null;

        MutablePropertyValues propertyValues = styles.getPropertyValues();

        StyleValue marginTopValue = propertyValues.getComputedValue(
                StylePropertyDetails.MARGIN_TOP);
       
        StyleValue marginBottomValue = propertyValues.getComputedValue(
                StylePropertyDetails.MARGIN_BOTTOM);

        // Legal values for margin-bottom and margin-top are either length or keyword 'auto'.
        // Acording to the CSS specs if 'margin-top' or 'margin-bottom' are 'auto',
        // their used value is 0.
View Full Code Here

     */
    private Map getPropertyAndSupportTypes(Styles styles,
                                           DeviceElementCapability dec) {
        Map propertiesAndSupportTypes = null;
        if (styles != null) {
            MutablePropertyValues propertyValues = styles.getPropertyValues();

            if (propertyValues != null) {
                propertiesAndSupportTypes = dec
                        .getSupportType(propertyValues);
            }
View Full Code Here

TOP

Related Classes of com.volantis.styling.values.MutablePropertyValues

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.