Package flash.swf.tags

Examples of flash.swf.tags.PlaceObject


            definitions.put(definitionName, definitionSprite);
            graphics.definitions = definitions;
            graphics.definition(node.definition, definitionSprite);
        }

        PlaceObject po3 = placeObject(definitionSprite, node.createGraphicContext());
        return po3;
    }
View Full Code Here


            placeObject(clipShape, clipContext);
            spriteStack.pop();
           
            // Set the depth of the mask to that of the bitmap image fill
            clipContext.setTransform(context.getTransform());
            PlaceObject po3clip = placeObject(clipSprite, clipContext);
            po3clip.setClipDepth(po3clip.depth+1);
           
            // Then, process the bitmap image fill
            ShapeWithStyle sws = new ShapeWithStyle();
            sws.shapeRecords = shapeRecords;
            int lineStyleIndex = 0;
            int fillStyle0Index = 1;
            int fillStyle1Index = 0;
            if (windings.length > 0)
                ShapeHelper.setPathStyles(shapeRecords, lineStyleIndex, fillStyle0Index, fillStyle1Index);
            else
                ShapeHelper.setStyles(shapeRecords, lineStyleIndex, fillStyle0Index, fillStyle1Index);

            FillStyle fillStyle = createFillStyle(fill, edgeBounds);
            sws.fillstyles = new ArrayList<FillStyle>(1);
            sws.fillstyles.add(fillStyle);
           
            DefineShape imageShape = new DefineShape(Tag.stagDefineShape4);
            imageShape.shapeWithStyle = sws;
            imageShape.bounds = edgeBounds;
            imageShape.edgeBounds = edgeBounds;
            if ((fill != null) &&( windings.length > 0))
            {
                Winding windingValue = windings[0];
                imageShape.usesFillWindingRule = (windingValue == Winding.NON_ZERO);
            }
            PlaceObject po3 = placeObject(imageShape, context);       
            
            if (stroke != null)
            {
                //make a copy of ShapeRecord for strokes
                ArrayList<ShapeRecord> shapeRecords2 = new ArrayList<ShapeRecord>(shapeRecords);
                Collections.copy(shapeRecords2, shapeRecords);

                //generate the define sprite for the stroke object with no clipping
                ShapeWithStyle swsStroke = new ShapeWithStyle();
                swsStroke.shapeRecords = shapeRecords2;
   
                lineStyleIndex = 1;
                fillStyle0Index = 0;
                fillStyle1Index = 0;
                ShapeHelper.replaceStyles(shapeRecords2, lineStyleIndex, fillStyle0Index, fillStyle1Index);

                // Consider linestyle stroke widths with bounds calculation              
                AbstractStrokeNode strokeNode = (AbstractStrokeNode) stroke;
                LineStyle ls = createGenericLineStyle(strokeNode);
                Rect shapeBounds =  node.getBounds(shapeRecords2, ls);             
               
                LineStyle lineStyle = createLineStyle(stroke, shapeBounds);
                swsStroke.linestyles = new ArrayList<LineStyle>(1);
                swsStroke.linestyles.add(lineStyle);

                DefineShape strokeShape = new DefineShape(Tag.stagDefineShape4);
                strokeShape.shapeWithStyle = swsStroke;
                strokeShape.bounds = shapeBounds;
                strokeShape.edgeBounds = edgeBounds;
                po3 = placeObject(strokeShape, context);   
            }            
            spriteStack.pop();

            po3 = placeObject(imageSprite, new GraphicContext());
           
            // If filters were not processed, place the topmost sprite in display list and apply filters
            // This is done to force processing of masks before filters
            if (filters != null)
            {
                DefineSprite sprite = spriteStack.pop();   
                GraphicContext gc = new GraphicContext();
                gc.filters = filters;
                PlaceObject poFilter = placeObject(sprite, gc);
                return poFilter;           
            }
           
            return po3;
           
        }
        else
        {
          DefineShape shape = createDefineShape(node, shapeRecords, fill, stroke, context.getTransform(), windings);
          PlaceObject po3 = placeObject(shape, context);
          return po3;
        }
      
    }
View Full Code Here

        Frame frame = new Frame();
        movie.frames = new ArrayList<Frame>();
        movie.frames.add(frame);

        PlaceObject po3 = new PlaceObject(Tag.stagPlaceObject3);
        po3.matrix = new Matrix();
        po3.setRef(sprite);
        po3.depth = depth;
        frame.controlTags.add(po3);

        TagEncoder tagEncoder = new TagEncoder();
        MovieEncoder movieEncoder = new MovieEncoder(tagEncoder);
View Full Code Here

        linestyles = defineShape.shapeWithStyle.linestyles;
    }

    public void PlaceObject2(Attributes attributes) throws SAXParseException
    {
        PlaceObject tag = new PlaceObject(stagPlaceObject2);
        tag.depth = parseInt(getAttribute(attributes, "depth"));
        if (hasAttribute(attributes, "className"))
        {
            tag.setClassName(getAttribute(attributes, "className"));
        }
        if (hasAttribute(attributes, "hasImage"))
        {
            tag.setHasImage(getAttribute(attributes, "hasImage").equals("true"));
        }
        if (hasAttribute(attributes, "idref"))
        {
            int idref = parseInt(getAttribute(attributes, "idref"));
            tag.setRef(findCharacter(idref));
        }
        if (hasAttribute(attributes, "name"))
        {
            tag.setName(getAttribute(attributes, "name"));
        }
        if (hasAttribute(attributes, "clipDepth"))
        {
            tag.setClipDepth(parseInt(getAttribute(attributes, "clipDepth")));
        }
        if (hasAttribute(attributes, "ratio"))
        {
            tag.setRatio(parseInt(getAttribute(attributes, "ratio")));
        }
        if (hasAttribute(attributes, "cxform"))
        {
            tag.setCxform(parseCXForm(getAttribute(attributes, "cxform")));
        }
        if (hasAttribute(attributes, "matrix"))
        {
            tag.setMatrix(parseMatrix(getAttribute(attributes, "matrix")));
        }

        stack.push(tag);
        text = new StringBuilder();
    }
View Full Code Here

        text = new StringBuilder();
    }

    public void PlaceObject2() throws SAXException
    {
        PlaceObject tag = (PlaceObject)stack.pop();
        //try
        //{
            //String code = text.toString();
            text = null;
View Full Code Here

     * this node when added to the display list
     */
    protected PlaceObject mask(MaskableNode node, DefineSprite parentSprite)
    {
        MaskingNode mask = node.getMask();
        PlaceObject po3 = super.mask(node, parentSprite);

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

View Full Code Here

        // Keep track of whether a node had a mask and filters as this
        // scenario needs to be special cased to match the rendering order
        // of the ActionScript drawing API.
        boolean hasMaskAndFilters = node.mask != null && node.filters != null;

        PlaceObject po3 = super.graphicContentNode(node);

        // We skip text nodes because they already generate a symbol class
        // and will handle advanced graphics there
        if (po3 != null && !(node instanceof TextNode) && hasAdvancedGraphics(node))
        {
View Full Code Here

     * @param node - the Group node
     * @return the PlaceObject definition that would place the Group on stage
     */
    protected PlaceObject group(GroupNode node)
    {
        PlaceObject po3 = super.group(node);

        if (po3 != null && hasAdvancedGraphics(node))
            advancedGraphics(node, po3.ref, SymbolClassType.SPRITE);

        return po3;
View Full Code Here

            // SymbolClass so that it will be associated with the FXG asset.
            graphicClass.addAdditionalSymbolClass(spriteSymbolClass);

            // Create a DefineSprite to hold this TextGraphic
            DefineSprite textSprite = createDefineSprite(className);
            PlaceObject po3 = placeObject(textSprite, node.createGraphicContext());
            spriteStack.push(textSprite);

            StringBuilder buf = new StringBuilder(4096);
            buf.append("package ").append(packageName).append("\n");
            buf.append("{\n\n");
View Full Code Here

     * this node when added to the display list
     */
    protected PlaceObject mask(MaskableNode node, DefineSprite parentSprite)
    {
        MaskingNode mask = node.getMask();
        PlaceObject po3 = super.mask(node, parentSprite);

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

View Full Code Here

TOP

Related Classes of flash.swf.tags.PlaceObject

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.