Package org.apache.flex.swf.types

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


    private void printShape(Shape shapes)
    {
        if (shapes == null)
            return;

        Styles styles = null;

        if (shapes instanceof ShapeWithStyle)
        {
            styles = new Styles(((ShapeWithStyle)shapes).getFillStyles(),
                                ((ShapeWithStyle)shapes).getLineStyles());
        }

        for (ShapeRecord shape : shapes.getShapeRecords())
        {
            indent();
            if (shape instanceof StyleChangeRecord)
            {
                StyleChangeRecord styleChange = (StyleChangeRecord)shape;
                out.print("<styleChange ");
                if (styleChange.isStateMoveTo())
                {
                    out.print("dx=\"" + styleChange.getMoveDeltaX() + "\" dy=\"" +
                              styleChange.getMoveDeltaY() + "\" ");
                }
                if (styleChange.isStateFillStyle0())
                {
                    out.print("fillStyle0=\"" +
                              (styles.getFillStyles().indexOf(styleChange.getFillstyle0()) + 1) + "\" ");
                }
                if (styleChange.isStateFillStyle1())
                {
                    out.print("fillStyle1=\"" +
                              (styles.getFillStyles().indexOf(styleChange.getFillstyle1()) + 1) + "\" ");
                }
                if (styleChange.isStateLineStyle())
                {
                    out.print("lineStyle=\"" +
                              (styles.getFillStyles().indexOf(styleChange.getLinestyle()) + 1) + "\" ");
                }
                if (styleChange.isStateNewStyles())
                {
                    out.println(">");
                    indent++;
View Full Code Here


        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);

        // Create styles context.
        final CurrentStyles currentStyles = new CurrentStyles();
        currentStyles.styles = styles;
        currentStyles.numFillBits = numFillBits;
View Full Code Here

            bitStream.byteAlign();
            final int numFillBits = bitStream.readUB(4);
            final int numLineBits = bitStream.readUB(4);

            // update StyleChangeRecord
            final Styles newStyles = new Styles(fillStyles, lineStyles);
            styleChange.setNumFillBits(numFillBits);
            styleChange.setNumLineBits(numLineBits);
            styleChange.setNewStyles(newStyles);

            // update style context variable
View Full Code Here

    private void writeShapeWithStyle(ShapeWithStyle shape, TagType tagType)
    {
        writeFillStyles(shape.getFillStyles(), tagType);
        writeLineStyles(shape.getLineStyles(), tagType);
        CurrentStyles currentStyles = new CurrentStyles();
        currentStyles.styles = new Styles(shape.getFillStyles(), shape.getLineStyles());
        currentStyles.numFillBits = requireUBCount(shape.getFillStyles().size());
        currentStyles.numLineBits = requireUBCount(shape.getLineStyles().size());
        writeShape(shape, tagType, currentStyles);
    }
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);
       
        // Build Raw SWF Shape
        List<ShapeRecord> shapeRecords = ShapeHelper.rectangle(width, height);
View Full Code Here

        for (int i = 0; i < 9; i++)
        {
            FillStyle fs = new FillStyle(FillStyle.NON_SMOOTHED_REPEATING_BITMAP, matrix, bitmap.getTag());
            fillStyleArray.add(fs);
        }
        Styles styles = new Styles(fillStyleArray, lineStyleArray);
       
        int dxa = slt;
        int dxb = srt - slt;
        int dxc = (int)(bitmap.getWidth() * ISWFConstants.TWIPS_PER_PIXEL) - srt;

View Full Code Here

        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();
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
        Matrix tsm = new Matrix();
View Full Code Here

        {
          shapeBounds = edgeBounds;
        }


        Styles styles = new Styles(fillStyles, lineStyles);


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

TOP

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

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.