Examples of StyleChangeRecord


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

        if (shapeRecords != null && shapeRecords.size() > 0)
        {
            ShapeRecord firstRecord = shapeRecords.get(0);
            if (firstRecord instanceof StyleChangeRecord)
            {
                StyleChangeRecord scr = (StyleChangeRecord)firstRecord;
                scr.setDefinedStyles(fs0, fs1, ls, styles);
            }
        }
    }
View Full Code Here

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

            for (int i = 0; i < shapeRecords.size(); i++)
            {
                ShapeRecord record = shapeRecords.get(i);
                if (record instanceof StyleChangeRecord)
                {
                    StyleChangeRecord scr = (StyleChangeRecord)record;
                   
                    scr.setDefinedStyles(fs0, fs1, (!scr.isStateLineStyle() && ls > 0) ? ls : -1, styles);
                }
            }
        }
    }
View Full Code Here

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

            for (int i = 0; i < shapeRecords.size(); i++)
            {
                ShapeRecord record = shapeRecords.get(i);
                if (record instanceof StyleChangeRecord)
                {
                    StyleChangeRecord old_scr = (StyleChangeRecord) record;
                    StyleChangeRecord new_scr =  new StyleChangeRecord();
                    int old_scrLineStyleIndex = 0;
                   
                    if (old_scr.getLinestyle() != null)
                        old_scrLineStyleIndex = styleContext.getLineStyles().indexOf(old_scr.getLinestyle());
                   
                    new_scr.setDefinedStyles(fs0, fs1, ((!old_scr.isStateLineStyle() && (ls > 0)) ? ls: old_scrLineStyleIndex), styleContext);
                   
                    if (old_scr.isStateMoveTo())
                        new_scr.setMove(old_scr.getMoveDeltaX(), old_scr.getMoveDeltaY());
                   
                    shapeRecords.set(i, new_scr);
                   
                }
            }
View Full Code Here

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

        y *= TWIPS_PER_PIXEL;

        int moveX = (int)x;
        int moveY = (int)y;

        StyleChangeRecord scr = new StyleChangeRecord();
       
        scr.setMove(moveX, moveY);

        return scr;
    }
View Full Code Here

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

            if (r == null)
                continue;

            if (r instanceof StyleChangeRecord)
            {
                StyleChangeRecord scr = (StyleChangeRecord)r;
                x = scr.getMoveDeltaX();
                y = scr.getMoveDeltaY();
                scr.setMove(x, y);
               
                if (firstMove)
                {
                    x1 = x;
                    y1 = y;
View Full Code Here

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

        for(int i=0; i<records.size(); i++)
        {
            record = records.get(i);
            if (record instanceof StyleChangeRecord)
            {
                StyleChangeRecord scr = (StyleChangeRecord)record;
                coordinates[i][0] = scr.getMoveDeltaX();
                coordinates[i][1] = scr.getMoveDeltaY();
            }
            else if (record instanceof StraightEdgeRecord)
            {
                StraightEdgeRecord ser = (StraightEdgeRecord)record;
                coordinates[i][0] = coordinates[i-1][0] + ser.getDeltaX();
View Full Code Here

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

        int dya = stt;
        int dyb = sbt - stt;
        int dyc = height - sbt;

        StyleChangeRecord startStyle = new StyleChangeRecord();
        startStyle.setMove(0, dya);
        shapeWithStyle.addShapeRecord(startStyle);

        // border
        addEdgesWithFill(styles, shapeWithStyle, new int[][] { {0, -dya}, {dxa, 0}}, 0, 1);
        addEdgesWithFill(styles, shapeWithStyle, new int[][] {{dxb, 0}}, 0, 2);
        addEdgesWithFill(styles, shapeWithStyle, new int[][] { {dxc, 0}, {0, dya}}, 0, 3);
        addEdgesWithFill(styles, shapeWithStyle, new int[][] {{0, dyb}}, 0, 6);
        addEdgesWithFill(styles, shapeWithStyle, new int[][] { {0, dyc}, {-dxc, 0}}, 0, 9);
        addEdgesWithFill(styles, shapeWithStyle, new int[][] {{-dxb, 0}}, 0, 8);
        addEdgesWithFill(styles, shapeWithStyle, new int[][] { {-dxa, 0}, {0, -dyc}}, 0, 7);
        addEdgesWithFill(styles, shapeWithStyle, new int[][] {{0, -dyb}}, 0, 4);

        // down 1
        StyleChangeRecord down1Style = new StyleChangeRecord();
        down1Style.setMove(dxa, 0);
        shapeWithStyle.addShapeRecord(down1Style);
        addEdgesWithFill(styles, shapeWithStyle, new int[][] {{0, dya}}, 2, 1);
        addEdgesWithFill(styles, shapeWithStyle, new int[][] {{0, dyb}}, 5, 4);
        addEdgesWithFill(styles, shapeWithStyle, new int[][] {{0, dyc}}, 8, 7);

        // down 2
        StyleChangeRecord down2Style = new StyleChangeRecord();
        down2Style.setMove(dxa + dxb, 0);
        shapeWithStyle.addShapeRecord(down2Style);
        addEdgesWithFill(styles, shapeWithStyle, new int[][] {{0, dya}}, 3, 2);
        addEdgesWithFill(styles, shapeWithStyle, new int[][] {{0, dyb}}, 6, 5);
        addEdgesWithFill(styles, shapeWithStyle, new int[][] {{0, dyc}}, 9, 8);

        // right 1
        StyleChangeRecord right1Style = new StyleChangeRecord();
        right1Style.setMove(0, dya);
        shapeWithStyle.addShapeRecord(right1Style);
        addEdgesWithFill(styles, shapeWithStyle, new int[][] {{dxa, 0}}, 1, 4);
        addEdgesWithFill(styles, shapeWithStyle, new int[][] {{dxb, 0}}, 2, 5);
        addEdgesWithFill(styles, shapeWithStyle, new int[][] {{dxc, 0}}, 3, 6);

        // right 2
        StyleChangeRecord right2Style = new StyleChangeRecord();
        right2Style.setMove(0, dya + dyb);
        shapeWithStyle.addShapeRecord(right2Style);
        addEdgesWithFill(styles, shapeWithStyle, new int[][] {{dxa, 0}}, 4, 7);
        addEdgesWithFill(styles, shapeWithStyle, new int[][] {{dxb, 0}}, 5, 8);
        addEdgesWithFill(styles, shapeWithStyle, new int[][] {{dxc, 0}}, 6, 9);
View Full Code Here

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

        fs.setBitmapCharacter(image);
        fs.setBitmapMatrix(tsm);
        fs.setFillStyleType(FillStyle.CLIPPED_BITMAP_FILL);
        fillStyles.add(fs);

        StyleChangeRecord startStyle = new StyleChangeRecord();
        // We use fillstyle1, because it matches what FlashAuthoring generates.
        startStyle.setDefinedStyles(null, fs, null, styles);
        startStyle.setMove(width, height);
        shapeWithStyle.addShapeRecord(startStyle);

        // border
        shapeWithStyle.addShapeRecord(new StraightEdgeRecord(-1 * width, 0));
        shapeWithStyle.addShapeRecord(new StraightEdgeRecord(0, -1 * height));
 
View Full Code Here

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

        return shape;
    }

    private void addEdgesWithFill(Styles styles, ShapeWithStyle shapeWithStyle, int[][] coords, int left, int right)
    {
        StyleChangeRecord scr = new StyleChangeRecord();
        if ((left != 0) || (right != 0))
        {
            IFillStyle fillStyle0 = null;
            if (left > 0)
            {
                fillStyle0 = styles.getFillStyles().get(left - 1);
            }

            IFillStyle fillStyle1 = null;
            if (right > 0)
            {
                fillStyle1 = styles.getFillStyles().get(right - 1);
            }

            scr.setDefinedStyles(fillStyle0, fillStyle1, null, styles);
        }
        shapeWithStyle.addShapeRecord(scr);

        for (int i = 0; i < coords.length; ++i)
        {
View Full Code Here

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

        {
            dx *= ISWFConstants.TWIPS_PER_PIXEL;
            dy *= ISWFConstants.TWIPS_PER_PIXEL;
        }

        StyleChangeRecord scr = new StyleChangeRecord();
        scr.setMove((int)Math.rint(dx), (int)Math.rint(dy));

        //Reset rounding counters, as this info is only useful per sub-shape/fill closure
        dxSumTwips = 0;
        dySumTwips = 0;

        int fillStyle0Index = -1;
        int fillStyle1Index = -1;
        int lineStyleIndex = -1;

        //Check styles
        if (lineStyleHasChanged)
        {
            lineStyleIndex = lineStyle;
            lineStyleHasChanged = false;
        }

        if (fillStyle0HasChanged && useFillStyle0)
        {
            fillStyle0Index = fillStyle0;
            fillStyle0HasChanged = false;
        }

        if (fillStyle1HasChanged && useFillStyle1)
        {
            fillStyle1Index = fillStyle1;
            fillStyle1HasChanged = false;
        }

        if (font123)
            scr.setDefinedFontStyles(fillStyle0Index, fillStyle1Index, lineStyleIndex, styles);
        else
            scr.setDefinedStyles(fillStyle0Index, fillStyle1Index, lineStyleIndex, styles);

        lastMoveTo.x = x;
        lastMoveTo.y = y;
        pen.x = x;
        pen.y = y;
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.