Examples of ShapeWithStyle


Examples of flash.swf.types.ShapeWithStyle

    {
        DefineShape tag = new DefineShape(TagValues.stagDefineShape3);
        int id = parseInt(getAttribute(attributes, "id"));
        createCharacter(id, tag);
        tag.bounds = parseRect(getAttribute(attributes, "bounds"));
        tag.shapeWithStyle = new ShapeWithStyle();
        tag.shapeWithStyle.fillstyles = new ArrayList();
        tag.shapeWithStyle.linestyles = new ArrayList();
        tag.shapeWithStyle.shapeRecords = new ArrayList();

        stack.push(tag);
View Full Code Here

Examples of flash.swf.types.ShapeWithStyle

        matrix.scaleY = (int)Math.rint(SwfConstants.TWIPS_PER_PIXEL * SwfConstants.FIXED_POINT_MULTIPLE);
        matrix.hasScale = true; //Apply runtime scale of 20 (for twips)
        FillStyle fs = new FillStyle(FillStyle.FILL_BITS | FillStyle.FILL_BITS_CLIP, matrix, tag);

        // Apply Fill Styles
        ShapeWithStyle sws = new ShapeWithStyle();
        sws.fillstyles = new ArrayList<FillStyle>();
        int fsIndex = sws.fillstyles.add(fs) ? sws.fillstyles.lastIndexOf(fs) + 1 : 0;
        sws.linestyles = new ArrayList<LineStyle>();

        // Build Raw SWF Shape
View Full Code Here

Examples of flash.swf.types.ShapeWithStyle

            Shape shape = builder.build();
            assertTrue("Incorrect no. of Shape Records: " + shape.shapeRecords.size(), shape.shapeRecords.size() == 17); //16 quadratic curves + 1 style change record

            //Build valid SWF DefineShape tag
            ShapeWithStyle sws = new ShapeWithStyle();
            sws.shapeRecords = shape.shapeRecords;
            sws.linestyles = new ArrayList();
            sws.fillstyles = new ArrayList();
            sws.fillstyles.add(new FillStyle(SwfUtils.colorToInt(0, 0, 200, 255)));
            DefineShape tag = new DefineShape(Tag.stagDefineShape3);
View Full Code Here

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

    private DefineShapeTag readDefineShape() throws IOException, MalformedTagException
    {
        final DefineShapeTag tag = new DefineShapeTag();
        tag.setCharacterID(bitStream.readUI16());
        tag.setShapeBounds(readRect());
        final ShapeWithStyle shapeWithStyle = readShapeWithStyle(TagType.DefineShape);
        tag.setShapes(shapeWithStyle);
        return tag;
    }
View Full Code Here

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

    private DefineShape2Tag readDefineShape2() throws IOException, MalformedTagException
    {
        final DefineShape2Tag tag = new DefineShape2Tag();
        tag.setCharacterID(bitStream.readUI16());
        tag.setShapeBounds(readRect());
        final ShapeWithStyle shapeWithStyle = readShapeWithStyle(TagType.DefineShape2);
        tag.setShapes(shapeWithStyle);
        return tag;
    }
View Full Code Here

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

    private DefineShape3Tag readDefineShape3() throws IOException, MalformedTagException
    {
        final DefineShape3Tag tag = new DefineShape3Tag();
        tag.setCharacterID(bitStream.readUI16());
        tag.setShapeBounds(readRect());
        final ShapeWithStyle shapeWithStyle = readShapeWithStyle(TagType.DefineShape3);
        tag.setShapes(shapeWithStyle);
        return tag;
    }
View Full Code Here

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

        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

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

        currentStyles.styles = styles;
        currentStyles.numFillBits = numFillBits;
        currentStyles.numLineBits = numLineBits;

        // Create ShapeWithStyle tag.
        final ShapeWithStyle shapes = new ShapeWithStyle(styles);
        shapes.setNumFillBits(numFillBits);
        shapes.setNumLineBits(numLineBits);

        // Read ShapeRecords and passing in the style context.
        final List<ShapeRecord> shapeRecords = readShapeRecords(tagType, shapes, currentStyles);
        shapes.addShapeRecords(shapeRecords);
        return shapes;
    }
View Full Code Here

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

        styleArray.add(fs);
        LineStyleArray lineStyleArray = new LineStyleArray();
       
        Styles styles = new Styles(styleArray, lineStyleArray);

        ShapeWithStyle sws = new ShapeWithStyle(styles);
       
        // Build Raw SWF Shape
        List<ShapeRecord> shapeRecords = ShapeHelper.rectangle(width, height);
        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));
View Full Code Here

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

        scr.setDefinedStyles(6, 9, -1, styles);
        shapeRecords.add(scr);

        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);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.