Examples of DeviceElementCapability


Examples of com.volantis.mcs.protocols.capability.DeviceElementCapability

    }

    public void initialize(InternalDevice device,
                           DeviceCapabilityManagerBuilder builder) {
        // By default, WMLRoot supports underline emulation
        defaultElementCapabilities.add(new DeviceElementCapability("u",
                CapabilitySupportLevel.FULL));
        super.initialize(device, builder);

        elementName2EmulatedTag = new HashMap();
       
View Full Code Here

Examples of com.volantis.mcs.protocols.capability.DeviceElementCapability

        // If the device doesn't support the emulation element, then we
        // can't emulate it (regardless of whether the css is supported).
        if (canEmulateElement("marquee")) {
            // We can emulate the styles - check if we need to...
            DeviceElementCapability dec = deviceCapabilityManager.
                    getDeviceElementCapability("marquee", true);

            boolean supportsDisplayKeyword;
            final CSSVersion cssVersion = getCssVersion();
            if (cssVersion == null) {
                supportsDisplayKeyword = false;
            } else {
                CSSProperty display = cssVersion.getProperty(
                        StylePropertyDetails.DISPLAY);
                // In for the marquee css properties to have an effect, the
                // display must be set to marquee. If this keyword isn't
                // supported, then all marquee properties must be emulated.
                supportsDisplayKeyword = display.supportsKeyword(
                        DisplayKeywords.MCS_MARQUEE);
            }

            // The value of mcs-marquee-style determines if the other marquee
            // styles apply. So, if the mcs-marquee-style property css isn't
            // supported by the device, then we need to emulate all of the
            // others in order to display the requested marquee effects.
            boolean marqueeStyleCssSupported = supportsDisplayKeyword &&
                    cssVersion.getProperty(
                            StylePropertyDetails.MCS_MARQUEE_STYLE) != null;
            boolean behaviourSupported = CapabilitySupportLevel.FULL.equals(
                    dec.getSupportType(DeviceCapabilityConstants.MARQUEE_BEHAVIOR_ATT));
            // Emulate only if the css is not supported, and the attribute is.
            if (!marqueeStyleCssSupported && behaviourSupported) {

                // This renderer must be added before the other marquee
                // renderers; it ensures there is a marquee element, and the
                // others will not add attribute values to any other element
                AttributeAndOrElementStyleEmulationPropertyRenderer renderer =
                        new AttributeAndOrElementStyleEmulationPropertyRenderer(
                                new MarqueeEmulationRenderer(
                                        DeviceCapabilityConstants.MARQUEE_BEHAVIOR_ATT, false));
                styleEmulationPropertyRendererSelector.register(
                        StylePropertyDetails.MCS_MARQUEE_STYLE, renderer);

                // If we're going to be rendering this element, then need
                // to support it when transforming...
                fakePermittedChildren.add("marquee");


                // The rest of the marquee styles must be emulated if the
                // marquee style is emulated (and cannot be if it is not).

                // Marquee repetition.
                boolean marqueeLoopCssSupported = marqueeStyleCssSupported &&
                        (cssVersion.getProperty(
                                StylePropertyDetails.MCS_MARQUEE_REPETITION) != null);
                boolean loopSupported = CapabilitySupportLevel.FULL.equals(
                        dec.getSupportType(DeviceCapabilityConstants.MARQUEE_LOOP_ATT));
                if (!marqueeLoopCssSupported && loopSupported) {

                    AttributeAndOrElementStyleEmulationPropertyRenderer loopRenderer =
                            new AttributeAndOrElementStyleEmulationPropertyRenderer(
                                    new MarqueeEmulationAttributePropertyRenderer(
                                            DeviceCapabilityConstants.MARQUEE_LOOP_ATT, false));
                    styleEmulationPropertyRendererSelector.register(
                            StylePropertyDetails.MCS_MARQUEE_REPETITION,
                            loopRenderer);
                }

                // Marquee direction.
                boolean marqueeDirCssSupported = marqueeStyleCssSupported &&
                        (cssVersion.getProperty(StylePropertyDetails.MCS_MARQUEE_DIRECTION) != null);
                boolean directionSupported = CapabilitySupportLevel.FULL.equals(
                        dec.getSupportType(DeviceCapabilityConstants.MARQUEE_DIRECTION_ATT));
                if (!marqueeDirCssSupported && directionSupported) {

                    AttributeAndOrElementStyleEmulationPropertyRenderer dirRenderer =
                            new AttributeAndOrElementStyleEmulationPropertyRenderer(
                                    new MarqueeEmulationAttributePropertyRenderer(
                                            DeviceCapabilityConstants.MARQUEE_DIRECTION_ATT, false));
                    styleEmulationPropertyRendererSelector.register(
                            StylePropertyDetails.MCS_MARQUEE_DIRECTION, dirRenderer);
                }

                // Marquee background colour.
                if (!supportsDisplayKeyword &&
                        CapabilitySupportLevel.FULL.equals(dec.getSupportType(
                                DeviceCapabilityConstants.MARQUEE_BGCOLOR_ATT))) {
                    AttributeAndOrElementStyleEmulationPropertyRenderer bgColorRenderer
                            = new AttributeAndOrElementStyleEmulationPropertyRenderer(
                                    new MarqueeEmulationAttributePropertyRenderer(
                                            DeviceCapabilityConstants.MARQUEE_BGCOLOR_ATT, false));
View Full Code Here

Examples of com.volantis.mcs.protocols.capability.DeviceElementCapability

     */
    private boolean canEmulateElement(String elementName) {

        // Start by assuming that we don't need to emulate the element.
        boolean canEmulate = false;
        DeviceElementCapability dec = deviceCapabilityManager.
                getDeviceElementCapability(elementName, true);
        if (dec.getElementSupportLevel() != null &&
            dec.getElementSupportLevel() != CapabilitySupportLevel.NONE) {
            canEmulate = true;
        }
        return canEmulate;
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.capability.DeviceElementCapability

            DeviceCapabilityManager deviceCapabilityManager,
            boolean supportsCSS) {

        HorizontalRuleEmulator emulator = null;

        DeviceElementCapability hrElementCapability =
                deviceCapabilityManager.getDeviceElementCapability("hr", true);

        if (attributes != null) {

            Map hrPropertiesAndSupportTypes = getPropertyAndSupportTypes(
                    attributes.getStyles(), hrElementCapability);

            CapabilitySupportLevel hrSupportLevel =
                    hrElementCapability.getElementSupportLevel();           

            if (hrPropertiesAndSupportTypes != null &&
                    emulationRequired(hrPropertiesAndSupportTypes,
                                      hrSupportLevel)) {

                if (hrSupportLevel == CapabilitySupportLevel.PARTIAL) {
                    emulator = investigateHREmulator(hrPropertiesAndSupportTypes);
                } else if (!supportsCSS) {
                // Does the device support the bgcolor attribute?
                emulator = new TableAttrHREmulator();
                }

                if (emulator == null) {
                    DeviceElementCapability divElementCapability =
                    deviceCapabilityManager.getDeviceElementCapability("div", true);

                    CapabilitySupportLevel divSupportLevel =
                            divElementCapability.getElementSupportLevel();
                    if (divSupportLevel == CapabilitySupportLevel.FULL) {
                        emulator = new HorizontalRuleEmulatorWithBorderStylingOnDIV(
                                HorizontalRuleEmulatorWithBorderStylingOnDIV.
                                    BORDER_BOTTOM_PROPERTY);
                    } else if (divSupportLevel == CapabilitySupportLevel.PARTIAL) {
View Full Code Here

Examples of com.volantis.mcs.protocols.capability.DeviceElementCapability

        // Check that unspecified values are unspecified.
        int actualNumber = 0;

        for (int i = 0; i < numSupportedElements; i++) {
            String elementName = supportedElements[i];
            DeviceElementCapability dec =
                    manager.getDeviceElementCapability(elementName, true);
            if (!expectedDefaults.contains(dec)) {
                // Commented out due to bugs in support level detection
                // assertEquals(CapabilitySupportLevel.NONE,
                //         dec.getElementSupportLevel());
View Full Code Here

Examples of com.volantis.mcs.protocols.capability.DeviceElementCapability

    }

    public void initialize(InternalDevice device,
                           DeviceCapabilityManagerBuilder builder) {
        // By default, HTML_Version3_2 supports u and strike emulation
        defaultElementCapabilities.add(new DeviceElementCapability("u",
                CapabilitySupportLevel.FULL));
        defaultElementCapabilities.add(new DeviceElementCapability("strike",
                    CapabilitySupportLevel.FULL));
        super.initialize(device, builder);
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.capability.DeviceElementCapability

             currentElementIndex < elements.length; currentElementIndex++) {

            // Inspect the currect element name
            String currentElementName = elements[currentElementIndex];

            DeviceElementCapability currentElementCapability =
                    deviceCapabilityManager.getDeviceElementCapability(
                            currentElementName, true);
            CapabilitySupportLevel currentElementsSupportForStyleProperty =
                currentElementCapability.getSupportType(styleProperty);

            // Note that we can safely use "==", rather than Object.equals(),
            // as CapabilitySupportLevel is a type safe enumeration
            // and each enumeration value is static.
            if (CapabilitySupportLevel.FULL == currentElementsSupportForStyleProperty) {
View Full Code Here

Examples of com.volantis.mcs.protocols.capability.DeviceElementCapability

     * @return true if device supports specified attribute
     */
    private boolean isAttributeSupported(String attributeName) {
        boolean attributeSupported = true;

        DeviceElementCapability elementCapability =
            capabilities.getDeviceElementCapability(elementName);

        CapabilitySupportLevel attributeSupportType =
            elementCapability.getSupportType(attributeName);

        if (attributeSupportType != null) {
            if (attributeSupportType == CapabilitySupportLevel.FULL) {
                attributeSupported = true;
            } else if (attributeSupportType == CapabilitySupportLevel.NONE) {
View Full Code Here

Examples of com.volantis.mcs.protocols.capability.DeviceElementCapability

    private boolean isKeywordSupported(StyleKeyword styleKeyword,
            boolean backwordCompatible) {

        boolean keywordSupported = false;

        DeviceElementCapability elementCapability =
            capabilities.getDeviceElementCapability(elementName);

        CapabilitySupportLevel propertySupportType =
            elementCapability.getSupportType(getStyleProperty());

        // For compatibility with previous versions we assume keyword
        // is supported only if compatibility level is FULL.
        if (propertySupportType != null) {
            if (backwordCompatible) {
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.