Package org.apache.flex.swf.types

Examples of org.apache.flex.swf.types.LineStyleArray


        // replace styles
        if (stateNewStyles && isDefineShape234)
        {
            // read from SWF
            final FillStyleArray fillStyles = readFillStyleArray(tagType);
            final LineStyleArray lineStyles = readLineStyleArray(tagType);
            bitStream.byteAlign();
            final int numFillBits = bitStream.readUB(4);
            final int numLineBits = bitStream.readUB(4);

            // update StyleChangeRecord
View Full Code Here


        return result;
    }

    private LineStyleArray readLineStyleArray(TagType tagType) throws MalformedTagException
    {
        final LineStyleArray lineStyleArray = new LineStyleArray();
        final int count = readExtensibleCount();

        for (int i = 0; i < count; i++)
        {
            lineStyleArray.add(readLineStyle(tagType));
        }
        return lineStyleArray;
    }
View Full Code Here

    private ShapeWithStyle readShapeWithStyle(TagType tagType) throws IOException, MalformedTagException
    {
        // Read styles from SWF.
        final FillStyleArray fillStyles = readFillStyleArray(tagType);
        final LineStyleArray lineStyles = readLineStyleArray(tagType);
        bitStream.byteAlign();
        final int numFillBits = bitStream.readUB(4);
        final int numLineBits = bitStream.readUB(4);
        final Styles styles = new Styles(fillStyles, lineStyles);
View Full Code Here

        }

        // Apply Fill Styles
        FillStyleArray styleArray = new FillStyleArray();
        styleArray.add(fs);
        LineStyleArray lineStyleArray = new LineStyleArray();
       
        Styles styles = new Styles(styleArray, lineStyleArray);

        ShapeWithStyle sws = new ShapeWithStyle(styles);
       
View Full Code Here

        int srt = r.xMax();
        int stt = r.yMin();
        int sbt = r.yMax();

        FillStyleArray fillStyleArray = new FillStyleArray(9);
        LineStyleArray lineStyleArray = new LineStyleArray();
        List<ShapeRecord> shapeRecords = new ArrayList<ShapeRecord>(50);

        // Apply runtime scale of 20x for twips
        Matrix matrix = new Matrix();
       
View Full Code Here

        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
View Full Code Here

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

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

        // translate into source bitmap
View Full Code Here

        int lineStyleIndex = stroke == null ? 0 : 1;
        int fillStyle0Index = fill == null ? 0 : 1;
        int fillStyle1Index = 0;
       
        FillStyleArray fillStyles = new FillStyleArray(1);
        LineStyleArray lineStyles = new LineStyleArray();
        if (fill != null)
        {
            FillStyle fillStyle = createFillStyle(fill, edgeBounds);
            if(fillStyle != null)
                fillStyles.add(fillStyle);
        }

        if (stroke != null)
        {
          //find the shapeBounds with stroke
          LineStyle ls = createGenericLineStyle((AbstractStrokeNode)stroke);
            shapeBounds = (node == null) ? ShapeHelper.getBounds(shapeRecords, ls, (AbstractStrokeNode)stroke) : node.getBounds(shapeRecords, ls);         

            LineStyle lineStyle = createLineStyle(stroke, shapeBounds);
            lineStyles.add(lineStyle);           
        }
        else
        {
          shapeBounds = edgeBounds;
        }
View Full Code Here

            clipContext.setTransform(context.getTransform());
            PlaceObject3Tag po3clip = PlaceObject3Tag(clipSprite, clipContext);
            po3clip.setClipDepth(po3clip.getDepth() + 1);
            po3clip.setHasClipDepth(true);
           
            Styles styles = new Styles(new FillStyleArray(), new LineStyleArray());
            // Then, process the bitmap image fill
            ShapeWithStyle sws = new ShapeWithStyle(styles);
           
            int lineStyleIndex = 0;
            int fillStyle0Index = 1;
            int fillStyle1Index = 0;

            FillStyle fillStyle = createFillStyle(fill, edgeBounds);
            if(fillStyle != null)
                sws.getFillStyles().add(fillStyle);

            if (windings.length > 0)
                ShapeHelper.setPathStyles(shapeRecords, lineStyleIndex, fillStyle0Index, fillStyle1Index, styles);
            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              
View Full Code Here

     * <p>
     * Creates an empty Flash Shape with the pen starting at [0.0, 0.0].
     */
    public ShapeBuilder()
    {
        this(new Styles(new FillStyleArray(), new LineStyleArray()));
    }
View Full Code Here

TOP

Related Classes of org.apache.flex.swf.types.LineStyleArray

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.