Package com.volantis.styling.values

Examples of com.volantis.styling.values.MutablePropertyValues


    }

    private WapTV5_WMLVersion1_3Style getStyle(Styles styles) {
        if (styles != null) {

            MutablePropertyValues propertyValues = styles.getPropertyValues();
            // if there are no propertyValues then we want to return null
            if (propertyValues != null) {
                WapTV5_WMLVersion1_3Style style = null;
                style = new WapTV5_WMLVersion1_3Style(propertyValues, this);
                return style;
View Full Code Here


        Styles styles = attributes.getStyles();

        if (styles != null) {
            Styles nestedStyles = styles.findNestedStyles(pseudoEntity);
            if (nestedStyles != null) {
                MutablePropertyValues propertyValues =
                    nestedStyles.getPropertyValues();
                // if there are no properties then we want to return null
                if (propertyValues != null) {
                    style = new WapTV5_WMLVersion1_3Style(propertyValues, this);
                }
View Full Code Here

        styleElementStart(context, attributes);

        // Get the property values for this element and push them into
        // the format styling engine.
        Styles styles = protocolAttributes.getStyles();
        MutablePropertyValues propertyValues = styles.getPropertyValues();

        // If the layoutName is not null it means a layout has been specified
        // using either the link element or the mcs-project file. In order to
        // get the layout and container references to be updated in a
        // consistant way the layout name will be specified as one of the
        // styles property values. when the
        // StylableXDIMEElement#updateLayoutAndContainerReferences is called
        // the value correct layout will be used and a suppressing container
        // will be placed between the anonymous layout and the specified layout
        if (layoutName != null) {

            StyleValue styleLayout = propertyValues.getComputedValue(
                                    StylePropertyDetails.MCS_LAYOUT);

            //if a layout has been specified using the styles for the body
            //and the link element or the mcs-project.xml file an error is
            //thrown as this is not allowed.
            if (styleLayout != null &&
                    styleLayout != MCSLayoutKeywords.CURRENT) {
                throw new IllegalStateException(
                        exceptionLocalizer.format("invalid-body-layout"));
            } else {
                if (logger.isDebugEnabled()) {
                    logger.debug("The MCS_LAYOUT value specified using " +
                            "the link element is being set on the body " +
                            "styles");
                }
            }

            propertyValues.setComputedValue(
                StylePropertyDetails.MCS_LAYOUT,
                STYLE_VALUE_FACTORY.getString(null, layoutName));
        }

        // Store the style properties into the device layout context to allow
        // it to inherit from them.
        ImmutablePropertyValues immutablePropertyValues =
                propertyValues.createImmutablePropertyValues();
        DeviceLayoutContext dlc = pageContext.getDeviceLayoutContext();
        dlc.setInheritableStyleValues(immutablePropertyValues);

        try {
            // Initialise the canvas.
View Full Code Here

        styleElementStart(context, attributes);

        // Get the property values for this element and push them into
        // the format styling engine.
        Styles styles = protocolAttributes.getStyles();
        MutablePropertyValues propertyValues = styles.getPropertyValues();

        // If the layoutName is not null it means a layout has been specified
        // using either the link element or the mcs-project file. In order to
        // get the layout and container references to be updated in a
        // consistant way the layout name will be specified as one of the
        // styles property values. when the
        // StylableXDIMEElement#updateLayoutAndContainerReferences is called
        // the value correct layout will be used and a suppressing container
        // will be placed between the anonymous layout and the specified layout
        if (layoutName != null) {

            StyleValue styleLayout = propertyValues.getComputedValue(
                                    StylePropertyDetails.MCS_LAYOUT);

            //if a layout has been specified using the styles for the body
            //and the link element or the mcs-project.xml file an error is
            //thrown as this is not allowed.
            if (styleLayout != null &&
                    styleLayout != MCSLayoutKeywords.CURRENT) {
                throw new IllegalStateException(
                        exceptionLocalizer.format("invalid-body-layout"));
            } else {
                if (logger.isDebugEnabled()) {
                    logger.debug("The MCS_LAYOUT value specified using " +
                            "the link element is being set on the body " +
                            "styles");
                }
            }

            propertyValues.setComputedValue(
                StylePropertyDetails.MCS_LAYOUT,
                STYLE_VALUE_FACTORY.getString(null, layoutName));
        }

        // Store the style properties into the device layout context to allow
        // it to inherit from them.
        ImmutablePropertyValues immutablePropertyValues =
                propertyValues.createImmutablePropertyValues();
        DeviceLayoutContext dlc = pageContext.getDeviceLayoutContext();
        dlc.setInheritableStyleValues(immutablePropertyValues);

        try {
            // Initialise the canvas, no layout is passed in as that will be
View Full Code Here

    }

    public void mergeColumnStylesIntoCellStyles(
            Styles cellStyles, boolean firstRow, boolean firstColumn) {

        MutablePropertyValues cellValues = cellStyles.getPropertyValues();



        // If the cell is transparent then it will show through the row
        // background, or if that is also transparent the cell background. If
        // the row has a background image set then setting the cell's colour
        // to the column's color would obscure the row image. So in that case
        // don't set the cell background.
        //
        // todo Support columns in output markup so that these styles can be
        // todo added to the element. This code would then become protocol
        // todo dependent and would have to be moved into the protocols.
        if (layerIsTransparent(CELL)) {
            if (layerIsTransparent(ROW) && layerIsTransparent(ROW_GROUP)) {

                if (layerIsTransparent(COLUMN)) {
                    setBackgroundFromLayer(cellValues, COLUMN_GROUP);
                } else {
                    setBackgroundFromLayer(cellValues, COLUMN);
                }
            }
        }

        // Only set the width of the cell on the first row.
        if (firstRow) {

            // The column width sets the absolute minimum width for all cells
            // in that column. The actual minimum width for the column is
            // approximately the largest of the minimum widths of all the cells
            // in that column. So we only need to set the column width on the
            // cell if the cell is auto, or the column's width is larger than
            // the cell.

            StyleValue cellWidth = cellValues.getStyleValue(
                    StylePropertyDetails.WIDTH);
            if (cellWidth == WidthKeywords.AUTO) {

                StyleValues columnValues = getLayer(COLUMN);
                StyleValue columnWidth = columnValues.getStyleValue(
                        StylePropertyDetails.WIDTH);

                // The minimum width of the cell will be the largest of the
                // specified width and the MCW (the minimum content width
                // determined by the content). So setting the width of the cell to
                // the width of the column will have the same effect as it would
                // have on the column itself.
                cellValues.setComputedValue(StylePropertyDetails.WIDTH,
                        columnWidth);
            } else {
                // todo compare sizes, not sure what to do if one is length
                // todo and other is percentage.
            }
View Full Code Here

            StyleValue containerRef = null;
            StyleValue display = null;

            // Determine the formatting styles that were specified.
            if (styles != null) {
                MutablePropertyValues propertyValues = styles.getPropertyValues();
                layoutRef = propertyValues.getComputedValue(
                        StylePropertyDetails.MCS_LAYOUT);

                containerRef = propertyValues.getComputedValue(
                        StylePropertyDetails.MCS_CONTAINER);

                display = propertyValues.getComputedValue(
                        StylePropertyDetails.DISPLAY);
            } else {
                LOGGER.debug("No styles were specified for this element, so the " +
                        "output will appear in the current container if it is " +
                        "valid");
View Full Code Here

                .getStyleValue(StylePropertyDetails.HEIGHT);

        mergedStyles = merger.merge(mergedStyles, originalCell.getStyles());

        // update the cell with the merged styles
        MutablePropertyValues mergedValues =
            mergedStyles.getPropertyValues();

        mergedValues.setComputedValue(
                StylePropertyDetails.DISPLAY, DisplayKeywords.TABLE_CELL);

        mergedValues.setComputedValue(
                StylePropertyDetails.WIDTH, calculatedWidth);
        mergedValues.setComputedValue(
                StylePropertyDetails.HEIGHT, calculatedHeight);

        cell.setStyles(mergedStyles);
    }
View Full Code Here

     * Internal div is a container for content and is needed only for effects.
     * To work properly its padding and bottom must be set to 0. Additionally
     * for NetFront 3.4 the background-color needs to be set explicitely (VBM 2006091317)
     */
    private void setInternalDivStyles(Styles style, Styles parent) {
        MutablePropertyValues props = style.getPropertyValues();
       
        props.setComputedAndSpecifiedValue(StylePropertyDetails.PADDING_BOTTOM,
            STYLE_VALUE_FACTORY.getLength(null, 0,LengthUnit.PX));
        props.setComputedAndSpecifiedValue(StylePropertyDetails.PADDING_LEFT,
          STYLE_VALUE_FACTORY.getLength(null, 0,LengthUnit.PX));
        props.setComputedAndSpecifiedValue(StylePropertyDetails.PADDING_RIGHT,
          STYLE_VALUE_FACTORY.getLength(null, 0,LengthUnit.PX));
        props.setComputedAndSpecifiedValue(StylePropertyDetails.PADDING_TOP,
          STYLE_VALUE_FACTORY.getLength(null, 0,LengthUnit.PX));

        props.setComputedAndSpecifiedValue(StylePropertyDetails.BORDER_BOTTOM_WIDTH,
            STYLE_VALUE_FACTORY.getLength(null, 0,LengthUnit.PX));
        props.setComputedAndSpecifiedValue(StylePropertyDetails.BORDER_LEFT_WIDTH,
          STYLE_VALUE_FACTORY.getLength(null, 0,LengthUnit.PX));
        props.setComputedAndSpecifiedValue(StylePropertyDetails.BORDER_RIGHT_WIDTH,
            STYLE_VALUE_FACTORY.getLength(null, 0,LengthUnit.PX));
        props.setComputedAndSpecifiedValue(StylePropertyDetails.BORDER_TOP_WIDTH,
            STYLE_VALUE_FACTORY.getLength(null, 0,LengthUnit.PX));
       
        // See VBM 2006091317
        props.setComputedAndSpecifiedValue(StylePropertyDetails.BACKGROUND_COLOR,
                parent.getPropertyValues().getComputedValue(StylePropertyDetails.BACKGROUND_COLOR));
    }
View Full Code Here

                        "Element " + name + " is not a tr");
            }

            Styles styles = element.getStyles();
            if (styles != null) {
                MutablePropertyValues propertyValues = styles.getPropertyValues();
                for (int i = 0; i < PropertyGroups.PADDING_PROPERTIES.length; i++) {
                    StyleProperty property = PropertyGroups.PADDING_PROPERTIES[i];
                    StyleValue value = propertyValues.getComputedValue(property);
                    propertyUpdater.update(property, propertyValues);
                    int length = getPixelLength(value);
                    if (length >= 0) {
                        total += length;
                        count += 1;
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.