Package com.volantis.mcs.protocols.vdxml.style

Examples of com.volantis.mcs.protocols.vdxml.style.VDXMLStyleProperties


       
        // If the pane/layout's style didn't have any vdxml component, then
        // the vdxml style will be null. In this case, we need to create an
        // empty one to put the defaults in.
        if (style == null) {
            style = new VDXMLStyleProperties();
        }

        // Dump in default values for display contexts, if the user has
        // not specified them.
        style = VDXMLStyleProperties.DEFAULTS.merge(style);
View Full Code Here


     */
    private void openStyled(Element element, Writer out) throws IOException {

        // If the block/inline element had associated style information
        Styles styles = element.getStyles();
        VDXMLStyleProperties style = STYLE_FACTORY.getVDXMLStyle(styles);
        if (style != null) {
            // Then we will may need to write out some styling markup.

            // First, calculate if the style has any properties that are not
            // already in effect from the parent.
            VDXMLStyleProperties current = (VDXMLStyleProperties)
                    summaryStyles.peek();
            VDXMLStyleProperties canonical = style.removeDuplicate(current);
            // If there were some non-duplicate values
            if (!canonical.isEmpty()) {
                // Then we definitely need to write out some styling markup.

                // Before we do, see if we can use the synthetic reverse video
                // property instead of the more verbose explicit background
                // and foreground color changes.
                // If the colours we are to use are reversed from the current
                if (current.isReverseVideo(canonical)) {
                    // Then set the synthetic reverse video property to
                    // be the inverse of the parent value.
                    VDXMLBinaryValue currentReverseVideo = (VDXMLBinaryValue)
                            current.getReverseVideo().getValue();
                    canonical.setReverseVideo(
                            new VDXMLReverseVideoStyleProperty(
                                    currentReverseVideo.inverse()));
                }

                // Save away the styles we are using for the end call so child
                // elements can use these values to re-establish non-boolean
                // styles which they changed.
                canonicalStyles.push(canonical);

                // Update the summary state properties so child elements can
                // figure out what styles are in effect at the moment.
                VDXMLStyleProperties summary = current.merge(canonical);
                summaryStyles.push(summary);

                // Write out the styles as the start of a range (for booleans)
                writeStyle(VDXMLStyleRange.START, canonical, out);

View Full Code Here

     */
    private void closeStyled(Element element, Writer out) throws IOException {

        // If this element is styled...
        Styles styles = element.getStyles();
        VDXMLStyleProperties style = STYLE_FACTORY.getVDXMLStyle(styles);
        if (style != null) {
            // Then we need to see if we need some closing VDXML style markup.

            // Extract the style values we created for this element
            VDXMLStyleProperties canonical =
                    (VDXMLStyleProperties) canonicalStyles.pop();
            VDXMLStyleProperties summary =
                    (VDXMLStyleProperties) summaryStyles.pop();
            // And the parent style values as well.
            VDXMLStyleProperties parentCanonical =
                    (VDXMLStyleProperties) canonicalStyles.peek();
            VDXMLStyleProperties parentSummary =
                    (VDXMLStyleProperties) summaryStyles.peek();

            // Log what we are up to.
            if (logger.isDebugEnabled()) {
                logger.debug("Output close " + element.getName() +
                        ": actual:" + style + ", canonical:" + canonical +
                        ", summary:" + summary +
                        ", parent canonical:" + parentCanonical +
                        ", parent summary:" + parentSummary);
            }

            // Calculate the correct properties to wind up the tag style.
            VDXMLStyleProperties ending;
            // For normal properties, this means re-stating the parent summary
            // values if the child changed them.
            VDXMLStyleProperties parentNormal = parentSummary.normalOnly();
            ending = parentNormal.removeMissing(canonical);
            // For boolean properties, this means ending the existing ranges
            // using the child values.
            VDXMLStyleProperties childBoolean = canonical.booleanOnly();
            ending = ending.merge(childBoolean);

            // If we found any properties
            if (!ending.isEmpty()) {
                // render them.
View Full Code Here

TOP

Related Classes of com.volantis.mcs.protocols.vdxml.style.VDXMLStyleProperties

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.