Package flash.css

Examples of flash.css.StyleDeclaration


        SelectorList selectors = rule.getSelectorList();
        int nSelectors = selectors.getLength();
        for (int i = 0; i < nSelectors; i++)
        {
            Selector selector = selectors.item(i);
            StyleDeclaration declaration = rule.getStyleDeclaration();

            // If we have a list of selectors, copy the shared
            // StyleDeclaration so that we can independently track
            // subject and selectors per instance.
            if (i > 0)
                declaration = declaration.shallowCopy();

            if (selector.getSelectorType() == Selector.SAC_ELEMENT_NODE_SELECTOR)
            {
                addSimpleTypeSelector((ElementSelector)selector, declaration, mediaList, isLocal);
            }
View Full Code Here


            fontFaceRules.add(fontFaceRule);

            //    add embed for font
            String propName = "_embed__font_" + family + "_" + (bold? "bold":"medium") + "_" + (italic? "italic":"normal");
            Map<String, Object> embedParams = fontFaceRule.getEmbedParams();
            StyleDeclaration styleDeclaration = fontFaceRule.getStyleDeclaration();
            String path = styleDeclaration.getPath();

            if (path.indexOf('\\') > -1)
            {
                embedParams.put( Transcoder.FILE, path.replace('\\', '/') );
                embedParams.put( Transcoder.PATHSEP, "true" );
            }
            else
            {
                embedParams.put( Transcoder.FILE, path );           
            }

            embedParams.put( Transcoder.LINE, Integer.toString(styleDeclaration.getLineNumber()) );
            AtEmbed atEmbed = AtEmbed.create(propName, source, styleDeclaration.getPath(),
                                             styleDeclaration.getLineNumber(), embedParams, false);
            addAtEmbed(atEmbed);
        }
        else if (Trace.font)
        {
            Trace.trace("Font face already existed for " + family + " bold? " + bold + " italic? " + italic);
View Full Code Here

        if (declarations == null)
            declarations = new LinkedHashMap<String, StyleDeclaration>();

        StyleSelector selector = declaration.getSelector();
        String selectorString = selector.toString();
        StyleDeclaration existingDeclaration = declarations.get(selectorString);
        // This may be the first time we've seen this declaration
        if (existingDeclaration == null)
        {
            existingDeclaration = declaration;
            declarations.put(selectorString, existingDeclaration);
        }

        // TODO: We should resolve the differences between Descriptor and
        // StyleProperty and just merge them into the same entity. Special
        // processing could be done on those descriptors directly.

        // Extract the properties from the declaration and record them in a
        // style declaration block. We merge properties from new declaration
        // blocks to existing declaration blocks because selectors can be
        // declared multiple times with different properties. This is primarily
        // done to avoid redundant ClassReferences when it can be determined at
        // compile time that only the last occurrence of a selector with the
        // same property will matter at runtime (because the last one wins).
        // This helps keep SWF size down by avoiding linking in unused classes.
        StyleDeclarationBlock block = existingDeclaration.getDeclarationBlock(selector, mediaList);
        extractProperties(declaration, block.getProperties(), block.getEffectStyles());

        // If the new declaration does not have a media list, we merge its
        // properties into all other existing declaration blocks for this
        // selector that have any of the same properties. This is necessary to
        // ensure that later declaration blocks clobber all earlier declaration
        // blocks.
        if (mediaList == null)
        {
            Map<String, StyleProperty> properties = block.getProperties();

            List<StyleDeclarationBlock> existingBlocks = existingDeclaration.getDeclarationBlocks();
            for (StyleDeclarationBlock existingBlock : existingBlocks)
            {
                if (existingBlock != block)
                {
                    Map<String, StyleProperty> existingProperties = existingBlock.getProperties();
View Full Code Here

        if (declarations == null)
            declarations = new LinkedHashMap<String, StyleDeclaration>();

        StyleSelector selector = declaration.getSelector();
        String selectorString = selector.toString();
        StyleDeclaration existingDeclaration = declarations.get(selectorString);
        // This may be the first time we've seen this declaration
        if (existingDeclaration == null)
        {
            existingDeclaration = declaration;
            declarations.put(selectorString, existingDeclaration);
        }

        // TODO: We should resolve the differences between Descriptor and
        // StyleProperty and just merge them into the same entity. Special
        // processing could be done on those descriptors directly.

        // Extract the properties from the declaration and record them in a
        // style declaration block. We merge properties from new declaration
        // blocks to existing declaration blocks because selectors can be
        // declared multiple times with different properties. This is primarily
        // done to avoid redundant ClassReferences when it can be determined at
        // compile time that only the last occurrence of a selector with the
        // same property will matter at runtime (because the last one wins).
        // This helps keep SWF size down by avoiding linking in unused classes.
        StyleDeclarationBlock block = existingDeclaration.getDeclarationBlock(selector, mediaList);
        extractProperties(declaration, block.getProperties(), block.getEffectStyles());

        // If the new declaration does not have a media list, we merge its
        // properties into all other existing declaration blocks for this
        // selector that have any of the same properties. This is necessary to
        // ensure that later declaration blocks clobber all earlier declaration
        // blocks.
        if (mediaList == null)
        {
            Map<String, StyleProperty> properties = block.getProperties();

            List<StyleDeclarationBlock> existingBlocks = existingDeclaration.getDeclarationBlocks();
            for (StyleDeclarationBlock existingBlock : existingBlocks)
            {
                if (existingBlock != block)
                {
                    Map<String, StyleProperty> existingProperties = existingBlock.getProperties();
View Full Code Here

        SelectorList selectors = rule.getSelectorList();
        int nSelectors = selectors.getLength();
        for (int i = 0; i < nSelectors; i++)
        {
            Selector selector = selectors.item(i);
            StyleDeclaration declaration = rule.getStyleDeclaration();

            // If we have a list of selectors, copy the shared
            // StyleDeclaration so that we can independently track
            // subject and selectors per instance.
            if (i > 0)
                declaration = declaration.shallowCopy();

            if (selector.getSelectorType() == Selector.SAC_ELEMENT_NODE_SELECTOR)
            {
                addSimpleTypeSelector((ElementSelector)selector, declaration, mediaList, isLocal);
            }
View Full Code Here

            fontFaceRules.add(fontFaceRule);

            //    add embed for font
            String propName = "_embed__font_" + family + "_" + (bold? "bold":"medium") + "_" + (italic? "italic":"normal");
            Map<String, Object> embedParams = fontFaceRule.getEmbedParams();
            StyleDeclaration styleDeclaration = fontFaceRule.getStyleDeclaration();
            String path = styleDeclaration.getPath();

            if (path.indexOf('\\') > -1)
            {
                embedParams.put( Transcoder.FILE, path.replace('\\', '/') );
                embedParams.put( Transcoder.PATHSEP, "true" );
            }
            else
            {
                embedParams.put( Transcoder.FILE, path );           
            }

            embedParams.put( Transcoder.LINE, Integer.toString(styleDeclaration.getLineNumber()) );
            AtEmbed atEmbed = AtEmbed.create(propName, source, styleDeclaration.getPath(),
                                             styleDeclaration.getLineNumber(), embedParams, false);
            addAtEmbed(atEmbed);
        }
        else if (Trace.font)
        {
            Trace.trace("Font face already existed for " + family + " bold? " + bold + " italic? " + italic);
View Full Code Here

        SelectorList selectors = rule.getSelectorList();
        int nSelectors = selectors.getLength();
        for (int i = 0; i < nSelectors; i++)
        {
            Selector selector = selectors.item(i);
            StyleDeclaration declaration = rule.getStyleDeclaration();

            // If we have a list of selectors, copy the shared
            // StyleDeclaration so that we can independently track
            // subject and selectors per instance.
            if (i > 0)
                declaration = declaration.shallowCopy();

            if (selector.getSelectorType() == Selector.SAC_ELEMENT_NODE_SELECTOR)
            {
                addSimpleTypeSelector((ElementSelector)selector, declaration, mediaList, isLocal);
            }
View Full Code Here

            fontFaceRules.add(fontFaceRule);

            //    add embed for font
            String propName = "_embed__font_" + family + "_" + (bold? "bold":"medium") + "_" + (italic? "italic":"normal");
            Map<String, Object> embedParams = fontFaceRule.getEmbedParams();
            StyleDeclaration styleDeclaration = fontFaceRule.getStyleDeclaration();
            String path = styleDeclaration.getPath();

            if (path.indexOf('\\') > -1)
            {
                embedParams.put( Transcoder.FILE, path.replace('\\', '/') );
                embedParams.put( Transcoder.PATHSEP, "true" );
            }
            else
            {
                embedParams.put( Transcoder.FILE, path );           
            }

            embedParams.put( Transcoder.LINE, Integer.toString(styleDeclaration.getLineNumber()) );
            AtEmbed atEmbed = AtEmbed.create(propName, source, styleDeclaration.getPath(),
                                             styleDeclaration.getLineNumber(), embedParams, false);
            addAtEmbed(atEmbed);
        }
        else if (Trace.font)
        {
            Trace.trace("Font face already existed for " + family + " bold? " + bold + " italic? " + italic);
View Full Code Here

TOP

Related Classes of flash.css.StyleDeclaration

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.