Package com.volantis.mcs.themes

Examples of com.volantis.mcs.themes.StylePercentage


        assertEquals(expectedRendering, actualRendering);
    }

    public void testRenderWithWidthSpecifiedUsingPercentage() {
        StylePercentage percentageWidth =
            StyleValueFactory.getDefaultInstance().getPercentage(null, 10);

        CSSBorderWidthPropertyRenderer borderPropertyRenderer =
                new CSSBorderWidthPropertyRenderer("border-top-width");
View Full Code Here


                WIDTH, "100%", "10%", INNER);

        // ===================================================================
        //   Test when setting Styles values
        // ===================================================================
        StylePercentage optimizeValue =
            StyleValueFactory.getDefaultInstance().getPercentage(null, 100);
        StylePercentage noOptValue =
            StyleValueFactory.getDefaultInstance().getPercentage(null, 10);

        checkCanOptimizeWithParticularPropertyValues(StylePropertyDetails.WIDTH,
                optimizeValue, noOptValue, STYLES, INNER);
    }
View Full Code Here

        checkCanOptimizeWithParticularAttributeValues(WIDTH, "0", "10%", CELL);

        // ===================================================================
        //   Test when setting Styles values
        // ===================================================================
        StylePercentage optimizeValue =
            StyleValueFactory.getDefaultInstance().getPercentage(null, 0);
        StylePercentage noOptValue =
            StyleValueFactory.getDefaultInstance().getPercentage(null, 10);

        checkCanOptimizeWithParticularPropertyValues(StylePropertyDetails.WIDTH,
                optimizeValue, noOptValue, STYLES, CELL);
    }
View Full Code Here

        checkCanOptimizeWithParticularAttributeValues(HEIGHT, "0", "10%", CELL);

        // ===================================================================
        //   Test when setting Styles values
        // ===================================================================
        StylePercentage optimizeValue =
            StyleValueFactory.getDefaultInstance().getPercentage(null, 0);
        StylePercentage noOptValue =
            StyleValueFactory.getDefaultInstance().getPercentage(null, 10);

        checkCanOptimizeWithParticularPropertyValues(
                StylePropertyDetails.HEIGHT, optimizeValue, noOptValue,
                STYLES, CELL);
View Full Code Here

                WIDTH, "100%", "10%", INNER);

        // ===================================================================
        //   Test when setting Styles values
        // ===================================================================
        StylePercentage optimizeValue =
            StyleValueFactory.getDefaultInstance().getPercentage(null, 100);
        StylePercentage noOptValue =
            StyleValueFactory.getDefaultInstance().getPercentage(null, 10);

        checkCanOptimizeWithParticularPropertyValues(StylePropertyDetails.WIDTH,
                optimizeValue, noOptValue, STYLES, INNER);
    }
View Full Code Here

                propertyValues.getStyleValue(StylePropertyDetails.WIDTH);

        if (widthValue != null) {
            if (emulateWidthPercentages && widthValue instanceof StylePercentage) {
                if (useableWidth != -1) {
                    StylePercentage percentage = (StylePercentage) widthValue;
                    double pixelWidth = useableWidth * percentage.getPercentage() / 100.0;
                    StyleLength length = StyleValueFactory.getDefaultInstance()
                            .getLength(null, pixelWidth, LengthUnit.PX);
                    propertyValues.setComputedValue(StylePropertyDetails.WIDTH, length);
                } else {
                    propertyValues.clearPropertyValue(StylePropertyDetails.WIDTH);
View Full Code Here

        StyleValue widthValue = element.getStyles().getPropertyValues().getStyleValue(
                StylePropertyDetails.WIDTH);
        if (widthValue == WidthKeywords.AUTO) {
           
        } else if (widthValue instanceof StylePercentage) {
            StylePercentage percentage = (StylePercentage) widthValue;
            result = convertWidthPercentageToPixels(percentage.getPercentage(),
                    useableWidth);
        } else if (widthValue instanceof StyleLength) {
            StyleLength length = (StyleLength) widthValue;
            if (length.getUnit() == LengthUnit.PX) {
                result = (int) length.getNumber();
View Full Code Here

                if (number > 0) {
                    return new HTMLSizeAsStyle(number, length.getUnit(),
                            property);
                }
            } else if (styleValue instanceof StylePercentage) {
                StylePercentage percentage = (StylePercentage) styleValue;
                double number = percentage.getPercentage();
                if (number > 0) {
                    return new HTMLSizeAsStyle(number, LengthUnit.PC,
                            property);
                }
            }
View Full Code Here

                    final StyleLength length = (StyleLength) value;
                    if (length.getNumber() == 0.0) {
                        result = false;
                    }
                } else if (value instanceof StylePercentage) {
                    final StylePercentage percentage = (StylePercentage) value;
                    if (percentage.getPercentage() == 0.0) {
                        result = false;
                    }
                }
            }
            return result;
View Full Code Here

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

TOP

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

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.