Package com.volantis.styling.values

Examples of com.volantis.styling.values.PropertyValues


            // SUITABLE CORPUS OF TEST DOCUMENTS AND MAY BE WRONG. The methods
            // are all intentionally small, both from a readability
            // perspective, and to allow re-ordering for a more performant
            // implementation if the current one proves expensive.

            final PropertyValues propertyValues =
                element.getStyles().getPropertyValues();
            final StyleValue colorValue = propertyValues.getComputedValue(
                StylePropertyDetails.COLOR);

            final Element parent = getParent(element);

            if (colorIsInheritableFromParent(colorValue, parent)) {
View Full Code Here


                }
                return true;
            }

            // We need to compare the parent and context color values.
            final PropertyValues parentPropertyValues =
                    parent.getStyles().getPropertyValues();

            final StyleValue parentColorValue =
                    parentPropertyValues.getComputedValue(
                            StylePropertyDetails.COLOR);

            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug("parent colorValue=" + parentColorValue);
            }
View Full Code Here

            this.include = include;
        }

        // javadoc inherited
        public boolean hasVisualEffect(final Element element) {
            final PropertyValues propertyValues =
                element.getStyles().getPropertyValues();
            final StyleValue styleValue =
                propertyValues.getComputedValue(StylePropertyDetails.DISPLAY);
            boolean found = false;
            for (int i = 0; i < keywords.length && !found; i++) {
                found = keywords[i].equals(styleValue);
            }
            return include && found || !include && !found;
View Full Code Here

            this.nullIsSame = nullIsSame;
        }

        // javadoc inherited
        public boolean hasVisualEffect(final Element element) {
            final PropertyValues propertyValues =
                element.getStyles().getPropertyValues();
            final StyleValue value = propertyValues.getComputedValue(property);
            boolean same = value == null && nullIsSame ||
                value != null && value.equals(this.value);
            return !same;
        }
View Full Code Here

            this.property = property;
        }

        // javadoc inherited
        public boolean hasVisualEffect(final Element element) {
            final PropertyValues propertyValues =
                element.getStyles().getPropertyValues();
            final StyleValue value = propertyValues.getComputedValue(property);
            boolean result = true;
            if (value != null) {
                if (value instanceof StyleLength) {
                    final StyleLength length = (StyleLength) value;
                    if (length.getNumber() == 0.0) {
View Full Code Here

     * </p>
     */
    private static class TextAlignAnalyser implements Analyser {
        // javadoc inherited
        public boolean hasVisualEffect(final Element element) {
            final PropertyValues propertyValues =
                element.getStyles().getPropertyValues();
            boolean important = true;
            final StyleValue textAlignValue =
                propertyValues.getComputedValue(
                    StylePropertyDetails.TEXT_ALIGN);
            if (textAlignValue == null ||
                    textAlignValue == TextAlignKeywords._INTERNAL_DEFERRED_INHERIT) {
                important = false;
            }
            if (important) {
                final StyleValue displayValue = propertyValues.getComputedValue(
                    StylePropertyDetails.DISPLAY);
                if ((displayValue == null ||
                        !displayValue.equals(DisplayKeywords.BLOCK) &&
                        !displayValue.equals(DisplayKeywords.LIST_ITEM) &&
                        !displayValue.equals(DisplayKeywords.RUN_IN) &&
View Full Code Here

     * </p>
     */
    private static class WhitespaceAnalyser implements Analyser {
        // javadoc inherited
        public boolean hasVisualEffect(final Element element) {
            final PropertyValues propertyValues =
                element.getStyles().getPropertyValues();
            boolean important = true;
            final StyleValue whitespaceValue = propertyValues.getComputedValue(
                StylePropertyDetails.WHITE_SPACE);
            // if no value is set, it is not important
            if (whitespaceValue == null) {
                important = false;
            }
            // if it is the same as the parent value, then it is not important,
            // as it is an inherited property
            if (important) {
                final Element parent = getParent(element);
                if (parent != null) {
                    final Styles parentStyles = parent.getStyles();
                    if (parentStyles != null) {
                        final StyleValue parentValue =
                            parentStyles.getPropertyValues().getComputedValue(
                                StylePropertyDetails.WHITE_SPACE);
                        if (whitespaceValue.equals(parentValue)) {
                            important = false;
                        }
                    }
                } else {
                    important =
                        !whitespaceValue.equals(WhiteSpaceKeywords.NORMAL);
                }
            }
            // check if there is an element we can apply this on
            if (important) {
                important = false;
                for (Node child = element.getHead();
                     child != null && !important;
                     child = child.getNext()) {

                    if (child instanceof Text) {
                        final Text text = (Text) child;
                        important = text.getLength() > 0;
                    } else {
                        final Element childElement = (Element) child;
                        final Styles childStyles = childElement.getStyles();
                        if (childStyles != null) {
                            final PropertyValues childValues =
                                childStyles.getPropertyValues();
                            final StyleValue childValue =
                                childValues.getComputedValue(
                                    StylePropertyDetails.WHITE_SPACE);
                            important = childValue == null;
                        } else {
                            important = true;
                        }
View Full Code Here

     * </p>
     */
    private static class WidthAnalyser implements Analyser {
        // javadoc inherited
        public boolean hasVisualEffect(Element element) {
            final PropertyValues propertyValues =
                element.getStyles().getPropertyValues();
            final StyleValue value = propertyValues.getComputedValue(
                StylePropertyDetails.WIDTH);
            boolean result = true;
            if (value instanceof StylePercentage) {
                final StylePercentage percentage = (StylePercentage) value;
                if (percentage.getPercentage() == 100.0) {
                    result = false;
                }
            }
            if (result) {
                if (value == null || value.equals(WidthKeywords.AUTO)) {
                    final StyleValue displayValue =
                        propertyValues.getComputedValue(
                            StylePropertyDetails.WIDTH);
                    result = DisplayKeywords.BLOCK.equals(displayValue);
                }
            }
            return result;
View Full Code Here

            if ((dimensions > 0) &&
                    (menuReference.getIndex().getSpecified() <
                    dimensions)) {
                // The menu is targeted at a pane that is spatially
                // iterated but not fully specified
                final PropertyValues properties = menu.getElementDetails().
                        getStyles().getPropertyValues();

                StyleValue keyword = properties.getComputedValue(
                        StylePropertyDetails.MCS_MENU_ITEM_ITERATOR_ALLOCATION);
                if (keyword == MCSMenuItemIteratorAllocationKeywords.AUTOMATIC) {
                    // The entry's menu is performing automatic iteration
                    // allocation
                    result = true;
View Full Code Here

        String href = getLinkFromReference(attributes.getHref());

        boolean post = false;

        Styles styles = attributes.getStyles();
        PropertyValues propertyValues = styles.getPropertyValues();
        StyleValue styleValue;

        styleValue = propertyValues.getComputedValue(
                StylePropertyDetails.MCS_HTTP_METHOD_HINT);
        if (styleValue == MCSHttpMethodHintKeywords.POST) {
            post = true;

            if (href != null) {
View Full Code Here

TOP

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

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.