Package org.apache.flex.swf.tags

Examples of org.apache.flex.swf.tags.DefineShape4Tag


       
        ShapeWithStyle sws = new ShapeWithStyle(styles);
        sws.addShapeRecords(shapeRecords);
       
        DefineShape4Tag DefineShapeTag4 = new DefineShape4Tag();
        DefineShapeTag4.setShapes(sws);
        DefineShapeTag4.setShapeBounds(shapeBounds);
        DefineShapeTag4.setEdgeBounds(edgeBounds);
        if ((fill != null) &&( windings.length > 0))
        {
          Winding windingValue = windings[0];
            DefineShapeTag4.setUsesFillWindingRule(windingValue == Winding.NON_ZERO);
        }
       
        return DefineShapeTag4;
    }
View Full Code Here


            else
                ShapeHelper.setStyles(shapeRecords, lineStyleIndex, fillStyle0Index, fillStyle1Index, styles);
           
            sws.addShapeRecords(shapeRecords);
           
            DefineShape4Tag imageShape = new DefineShape4Tag();
            imageShape.setShapes(sws);
            imageShape.setShapeBounds(edgeBounds);
            imageShape.setEdgeBounds(edgeBounds);
            if ((fill != null) &&( windings.length > 0))
            {
                Winding windingValue = windings[0];
                imageShape.setUsesFillWindingRule(windingValue == Winding.NON_ZERO);
            }
            PlaceObject3Tag po3 = PlaceObject3Tag(imageShape, context);       
            
            if (stroke != null)
            {
                //make a copy of ShapeRecord for strokes
                ArrayList<ShapeRecord> shapeRecords2 = new ArrayList<ShapeRecord>(shapeRecords);
                Collections.copy(shapeRecords2, shapeRecords);

                Styles strokeStyles = new Styles(new FillStyleArray(), new LineStyleArray());

                //generate the define sprite for the stroke object with no clipping
                ShapeWithStyle swsStroke = new ShapeWithStyle(strokeStyles);

                // 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.getLineStyles().add(lineStyle);
               
                lineStyleIndex = 1;
                fillStyle0Index = 0;
                fillStyle1Index = 0;
                ShapeHelper.replaceStyles(shapeRecords2, lineStyleIndex, fillStyle0Index, fillStyle1Index, strokeStyles);
        
                swsStroke.addShapeRecords(shapeRecords2);

                DefineShape4Tag strokeShape = new DefineShape4Tag();
                strokeShape.setShapes(swsStroke);
                strokeShape.setShapeBounds(shapeBounds);
                strokeShape.setEdgeBounds(edgeBounds);
                po3 = PlaceObject3Tag(strokeShape, context);   
            }            
            spriteStack.pop();
           
            po3 = PlaceObject3Tag(imageSprite, new GraphicContext());
View Full Code Here

     * @throws MalformedTagException
     * @see SWFWriter#writeDefineShape4
     */
    private DefineShape4Tag readDefineShape4() throws IOException, MalformedTagException
    {
        final DefineShape4Tag tag = new DefineShape4Tag();
        tag.setCharacterID(bitStream.readUI16());
        tag.setShapeBounds(readRect());
        tag.setEdgeBounds(readRect());
        bitStream.readUB(5); // skip reserved UB[5]
        tag.setUsesFillWindingRule(bitStream.readBit());
        tag.setUsesNonScalingStrokes(bitStream.readBit());
        tag.setUsesScalingStrokes(bitStream.readBit());
        // 8 bits. No need to align.
        final ShapeWithStyle shapeWithStyle = readShapeWithStyle(TagType.DefineShape4);
        tag.setShapes(shapeWithStyle);
        return tag;
    }
View Full Code Here

        ShapeHelper.setStyles(shapeRecords, 0, 1, 0, styles);
        sws.addShapeRecords(shapeRecords);
       

        // Wrap up into a SWF DefineShape Tag
        DefineShape4Tag defineShape = new DefineShape4Tag();
        defineShape.setShapeBounds(TypeHelper.rect(width, height));
        defineShape.setEdgeBounds(defineShape.getShapeBounds());
        defineShape.setShapes(sws);

        return defineShape;
    }
View Full Code Here

        shapeRecords.add(new StraightEdgeRecord(dxc, 0));

        ShapeWithStyle sws = new ShapeWithStyle(styles);
        sws.addShapeRecords(shapeRecords);
       
        DefineShape4Tag shape = new DefineShape4Tag();
        shape.setShapeBounds(TypeHelper.rect(width, height));
        shape.setEdgeBounds(shape.getShapeBounds());
        shape.setShapes(sws);
        return shape;
    }
View Full Code Here

        return sprite;  
    }

    private DefineShapeTag buildSlicedShape(DefineBitsTag image, Rect r, int width, int height)
    {
        DefineShape4Tag shape = new DefineShape4Tag();

        Rect bounds = new Rect(0, width, 0, height);
        shape.setShapeBounds(bounds);
        shape.setEdgeBounds(bounds);

        FillStyleArray fillStyles = new FillStyleArray();
        LineStyleArray lineStyles = new LineStyleArray();
        Styles styles = new Styles(fillStyles, lineStyles);
        ShapeWithStyle shapeWithStyle = new ShapeWithStyle(styles);
        shape.setShapes(shapeWithStyle);

        // translate into source bitmap
        Matrix tsm = new Matrix();
        // unity in twips
        tsm.setScale(ISWFConstants.TWIPS_PER_PIXEL, ISWFConstants.TWIPS_PER_PIXEL);
View Full Code Here

        open(tag);
        out.print(" id=\"" + id(tag) + "\"");
        out.print(" bounds=\"" + tag.getShapeBounds() + "\"");
        if (tag.getTagType() == TagType.DefineShape4)
        {
            DefineShape4Tag shape4Tag = (DefineShape4Tag)tag;
            out.print(" edgebounds=\"" + shape4Tag.getEdgeBounds() + "\"");
            out.print(" usesNonScalingStrokes=\"" + shape4Tag.isUsesNonScalingStrokes() + "\"");
            out.print(" usesScalingStrokes=\"" + shape4Tag.isUsesScalingStrokes() + "\"");
        }

        end();

        printShapeWithStyles(tag.getShapes());
View Full Code Here

TOP

Related Classes of org.apache.flex.swf.tags.DefineShape4Tag

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.