Examples of canUseShorthand()


Examples of com.volantis.mcs.dom2theme.impl.optimizer.BasicShorthandAnalyzer.canUseShorthand()

        BasicShorthandAnalyzer analyzer = new BasicShorthandAnalyzer(
                StyleShorthands.BORDER_WIDTH, checkerMock, shorthandSetMock);
        analyzer.analyze(TargetEntity.ELEMENT, inputValues, deviceValuesMock);

        assertFalse("Shouldn't be able to use shorthand",
                analyzer.canUseShorthand());
        assertTrue("Should be able to clear all", analyzer.allClearable());
        assertEquals("Should all be initial", 4, analyzer.getInitialCount());
        assertEquals("Should be normal priority",
                Priority.NORMAL, analyzer.getShorthandPriority());
    }
View Full Code Here

Examples of com.volantis.mcs.dom2theme.impl.optimizer.BasicShorthandAnalyzer.canUseShorthand()

        BasicShorthandAnalyzer analyzer = new BasicShorthandAnalyzer(
                StyleShorthands.BORDER_WIDTH, checkerMock, shorthandSetMock);
        analyzer.analyze(TargetEntity.ELEMENT, inputValues, deviceValuesMock);

        assertTrue("Should be able to use shorthand",
                analyzer.canUseShorthand());
        assertFalse("Should not be able to clear all", analyzer.allClearable());
        assertEquals("None should be initial", 0, analyzer.getInitialCount());
        assertEquals("Should be normal priority",
                Priority.NORMAL, analyzer.getShorthandPriority());
    }
View Full Code Here

Examples of com.volantis.mcs.dom2theme.impl.optimizer.BasicShorthandAnalyzer.canUseShorthand()

                StyleShorthands.BORDER_LEFT, checkerMock, shorthandSetMock);
        analyzer.analyze(TargetEntity.ELEMENT, inputValues, deviceValuesMock);
        analyzer.updateShorthand(outputValues);

        assertTrue("Should be able to use shorthand",
                analyzer.canUseShorthand());

        // red should be the color overide
        // none was specified
        // initial value was got for width as style is none
        assertEquals("Shorthand should match:",
View Full Code Here

Examples of com.volantis.mcs.dom2theme.impl.optimizer.BasicShorthandAnalyzer.canUseShorthand()

        ShorthandAnalyzer analyzer = new BasicShorthandAnalyzer(
                StyleShorthands.BORDER_LEFT, checkerMock, shorthandSetMock);
        analyzer.analyze(TargetEntity.ELEMENT, inputValues, deviceValuesMock);

        assertTrue("Should be able to use shorthand",
                analyzer.canUseShorthand());

        analyzer.updateShorthand(outputValues);

        assertEquals("Shorthand should match:",
                "border-left:red dashed thick !important",
View Full Code Here

Examples of com.volantis.mcs.dom2theme.impl.optimizer.ShorthandAnalyzer.canUseShorthand()

        int cost = 0;

        for (int i = 0; i < PropertyGroups.EDGE_COUNT; i += 1) {
            ShorthandAnalyzer edgeAnalyzer = analyzer.getEdgeAnalyzer(i);

            if (edgeAnalyzer.canUseShorthand()) {
                cost += edgeAnalyzer.getShorthandCost(requiredForIndividual, requiredForShorthand);
            }
        }

        cost += individualStrategy.cost(analyzer, inputValues, requiredForIndividual, requiredForShorthand);
View Full Code Here

Examples of com.volantis.mcs.dom2theme.impl.optimizer.ShorthandAnalyzer.canUseShorthand()

        BorderAnalyzer analyzer = (BorderAnalyzer) shorthandAnalyzer;

        for (int i = 0; i < PropertyGroups.EDGE_COUNT; i += 1) {
            ShorthandAnalyzer edgeAnalyzer = analyzer.getEdgeAnalyzer(i);

            if (edgeAnalyzer.canUseShorthand()) {
                edgeAnalyzer.updateShorthand(outputValues, requiredForIndividual, requiredForShorthand);
            }
        }

        individualStrategy.update(shorthandAnalyzer, outputValues, requiredForIndividual, requiredForShorthand);
View Full Code Here

Examples of com.volantis.mcs.dom2theme.impl.optimizer.ShorthandAnalyzer.canUseShorthand()

        for (int c = 0; c < BorderAnalyzer.CHARACTERISTIC_COUNT; c += 1) {
            ShorthandAnalyzer characteristicAnalyzer =
                    analyzer.getCharacteristicAnalyzer(c);

            if (characteristicAnalyzer.canUseShorthand()) {
                cost += characteristicAnalyzer.getShorthandCost(
                        requiredForIndividual, requiredForShorthand);
            }
        }
View Full Code Here

Examples of com.volantis.mcs.dom2theme.impl.optimizer.ShorthandAnalyzer.canUseShorthand()

                StyleShorthands.BORDER_LEFT, checkerMock, shorthandSetMock);
        analyzer.analyze(TargetEntity.ELEMENT, inputValues, deviceValuesMock);
        analyzer.updateShorthand(outputValues);

        assertTrue("Should be able to use shorthand",
                analyzer.canUseShorthand());

        // red should be the color overide
        // none was specified
        // initial value was got for width as style is none
        assertEquals("Shorthand should match:",
View Full Code Here

Examples of com.volantis.mcs.dom2theme.impl.optimizer.ShorthandAnalyzer.canUseShorthand()

        ShorthandAnalyzer analyzer = new BasicShorthandAnalyzer(
                StyleShorthands.BORDER_LEFT, checkerMock, shorthandSetMock);
        analyzer.analyze(TargetEntity.ELEMENT, inputValues, deviceValuesMock);

        assertTrue("Should be able to use shorthand",
                analyzer.canUseShorthand());

        analyzer.updateShorthand(outputValues);

        assertEquals("Shorthand should match:",
                "border-left:red dashed thick !important",
View Full Code Here

Examples of com.volantis.mcs.dom2theme.impl.optimizer.ShorthandAnalyzer.canUseShorthand()

        for (int c = 0; c < BorderAnalyzer.CHARACTERISTIC_COUNT; c += 1) {
            ShorthandAnalyzer characteristicAnalyzer =
                    analyzer.getCharacteristicAnalyzer(c);

            if (characteristicAnalyzer.canUseShorthand()) {
                characteristicAnalyzer.updateShorthand(outputValues,
                        requiredForIndividual, requiredForShorthand);
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.