Package org.apache.flex.compiler.internal.fxg.dom

Examples of org.apache.flex.compiler.internal.fxg.dom.IMaskingNode


    protected PlaceObject3Tag mask(IMaskableNode node, DefineSpriteTag parentSprite)
    {
        PlaceObject3Tag po3 = null;

        IMaskingNode mask = node.getMask();
        if (mask instanceof GroupNode)
        {
            // According to FXG Spec.: The masking element inherits the target
            // group's coordinate space, as though it were a direct child
            // element. In the case when mask is inside a shape, it doesn't
View Full Code Here


     * this node when added to the display list
     */
    @Override
    protected PlaceObject3Tag mask(IMaskableNode node, DefineSpriteTag parentSprite)
    {
        IMaskingNode mask = node.getMask();
        PlaceObject3Tag po3 = super.mask(node, parentSprite);

        if (mask != null)
        {
            MaskType maskType = node.getMaskType();

            if (maskType != MaskType.CLIP)
            {
                // Record the display list position that the mask was placed.
                // The ActionScript display list is 0 based, but SWF the depth
                // counter starts at 1, so we subtract 1.
                int maskIndex = getSpriteDepth(parentSprite) - 1;
                mask.setMaskIndex(maskIndex);
            }

            if (maskType == MaskType.LUMINOSITY)
            {
                // Create a new SymbolClass to map to this mask's
View Full Code Here

     * @param symbolClassType - determines the base type for the SymbolClass
     */
    private void advancedGraphics(GraphicContentNode node, ICharacterTag symbol,
            SymbolClassType symbolClassType)
    {
        IMaskingNode maskNode = node.getMask();

        // Create a new SymbolClass to map to this mask's
        // DefineSpriteTag (see below)
        String className = graphicClass.getClassName();
        if (maskNode != null)
            className += "_Maskee";

        className = createUniqueName(className);

        FXGSymbolClass symbolClass = new FXGSymbolClass();
        symbolClass.setPackageName(packageName);
        symbolClass.setClassName(className);

        // Then record this SymbolClass with the top-level graphic
        // SymbolClass so that it will be associated with the FXG asset.
        graphicClass.addAdditionalSymbolClass(symbolClass);

        StringBuilder buf = new StringBuilder(512);
        buf.append("package ").append(packageName).append("\n");
        buf.append("{\n\n");

        // Determine Base Class
        String baseClassName = null;
        if (symbolClassType == SymbolClassType.SPRITE)
        {
            buf.append("import flash.display.Sprite;\n");
            baseClassName = "Sprite";
        }
        else
        {
            buf.append("import flash.display.Shape;\n");
            baseClassName = "Shape";
        }

        // Advanced BlendModes
        String blendModeClass = null;
        BlendMode blendmode = node.blendMode;
        if(blendmode != null && blendmode.needsPixelBenderSupport()) {
            blendModeClass = blendmode.getClassName();
           
            addDependency(blendModeClass); //add dependency to this class
            buf.append("import ").append(blendModeClass).append(";\n\n");
        }
       
        // Class Definition and Constructor
        buf.append("public class ").append(className).append(" extends ").append(baseClassName).append("\n");
        buf.append("{\n");
        buf.append("    public function ").append(className).append("()\n");
        buf.append("    {\n");
        buf.append("        super();\n");
        buf.append("        this.cacheAsBitmap = true;\n");

        // Alpha and Luminosity Masks
        if (maskNode != null)
        {
            int maskIndex = maskNode.getMaskIndex();
            if (symbolClassType == SymbolClassType.SPRITE)
                buf.append("        this.mask = this.getChildAt(").append(maskIndex).append(");\n");
            else
                buf.append("        this.mask = this.parent.getChildAt(").append(maskIndex).append(");\n");
        }
View Full Code Here

            if (hasAdvancedGraphics(node))
                buf.append("        this.cacheAsBitmap = true;\n");

            // Alpha Masks
            IMaskingNode maskNode = node.getMask();
            if (maskNode != null &&
                    (node.getMaskType() == MaskType.ALPHA ||
                     node.getMaskType() == MaskType.LUMINOSITY))
            {
                int maskIndex = maskNode.getMaskIndex();
                buf.append("        this.mask = this.parent.getChildAt(").append(maskIndex).append(");\n");
            }

            // BlendMode Shader
            if (blendModeClass != null)
View Full Code Here

TOP

Related Classes of org.apache.flex.compiler.internal.fxg.dom.IMaskingNode

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.