Package org.apache.flex.swf.types

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


            else
            {
                EdgeRecord edge = (EdgeRecord)shape;
                if (edge instanceof StraightEdgeRecord)
                {
                    StraightEdgeRecord straightEdge = (StraightEdgeRecord)edge;
                    out.println("<line dx=\"" + straightEdge.getDeltaX() + "\" dy=\"" +
                                straightEdge.getDeltaY() + "\" />");
                }
                else
                {
                    CurvedEdgeRecord curvedEdge = (CurvedEdgeRecord)edge;
                    out.print("<curve ");
View Full Code Here


            else
            {
                EdgeRecord edge = (EdgeRecord)shape;
                if (edge instanceof StraightEdgeRecord)
                {
                    StraightEdgeRecord straightEdge = (StraightEdgeRecord)edge;
                    out.print("SER" + "\t");
                    out.print(straightEdge.getDeltaX() + "\t" + straightEdge.getDeltaY());
                    x += straightEdge.getDeltaX();
                    y += straightEdge.getDeltaY();
                    out.print("\t\t");
                }
                else
                {
                    CurvedEdgeRecord curvedEdge = (CurvedEdgeRecord)edge;
View Full Code Here

            if (isEdge)
            {
                final boolean isStraight = bitStream.readBit();
                if (isStraight)
                {
                    final StraightEdgeRecord straightEdge = readStraightEdgeRecord();
                    list.add(straightEdge);
                }
                else
                {
                    final CurvedEdgeRecord curvedEdge = readCurvedEdgeRecord();
View Full Code Here

        return new ShowFrameTag();
    }

    private StraightEdgeRecord readStraightEdgeRecord() throws IOException
    {
        StraightEdgeRecord straightEdgeRecord = null;
        final int nbits = 2 + bitStream.readUB(4);
        final boolean isGeneralLine = bitStream.readBit();
        if (isGeneralLine)
        {
            final int dx = bitStream.readSB(nbits);
            final int dy = bitStream.readSB(nbits);
            straightEdgeRecord = new StraightEdgeRecord(dx, dy);
        }
        else
        {
            final boolean isVertLine = bitStream.readBit();
            if (isVertLine)
            {
                final int dy = bitStream.readSB(nbits);
                straightEdgeRecord = new StraightEdgeRecord(0, dy);
            }
            else
            {
                final int dx = bitStream.readSB(nbits);
                straightEdgeRecord = new StraightEdgeRecord(dx, 0);
            }
        }
        return straightEdgeRecord;
    }
View Full Code Here

        StyleChangeRecord scr = new StyleChangeRecord();
        scr.setMove(0, dya);
        scr.setDefinedStyles(-1, 1, -1, styles);
        shapeRecords.add(scr);
       
        shapeRecords.add(new StraightEdgeRecord(0, -dya));
        shapeRecords.add(new StraightEdgeRecord(dxa, 0));
       
        scr = new StyleChangeRecord();
        scr.setDefinedStyles(-1, 2, -1, styles);
        shapeRecords.add(scr);
       
        shapeRecords.add(new StraightEdgeRecord(dxb, 0));
       
        scr = new StyleChangeRecord();
        scr.setDefinedStyles(-1, 3, -1, styles);
        shapeRecords.add(scr);
       
        shapeRecords.add(new StraightEdgeRecord(dxc, 0));
        shapeRecords.add(new StraightEdgeRecord(0, dya));
       
        scr = new StyleChangeRecord();
        scr.setDefinedStyles(-1, 6, -1, styles);
        shapeRecords.add(scr);
       
        shapeRecords.add(new StraightEdgeRecord(0, dyb));
       
        scr = new StyleChangeRecord();
        scr.setDefinedStyles(-1, 9, -1, styles);
        shapeRecords.add(scr);
       
        shapeRecords.add(new StraightEdgeRecord(0, dyc));
        shapeRecords.add(new StraightEdgeRecord(-dxc, 0));
       
        scr = new StyleChangeRecord();
        scr.setDefinedStyles(-1, 8, -1, styles);
        shapeRecords.add(scr);
       
        shapeRecords.add(new StraightEdgeRecord(-dxb, 0));
       
        scr = new StyleChangeRecord();
        scr.setDefinedStyles(-1, 7, -1, styles);
        shapeRecords.add(scr);
       
        shapeRecords.add(new StraightEdgeRecord(-dxa, 0));
        shapeRecords.add(new StraightEdgeRecord(0, -dyc));
       
        scr = new StyleChangeRecord();
        scr.setDefinedStyles(-1, 4, -1, styles);
        shapeRecords.add(scr);

        shapeRecords.add(new StraightEdgeRecord(0, -dyb));

        // down 1
       
        scr = new StyleChangeRecord();
        scr.setMove(dxa, 0);
        scr.setDefinedStyles(2, 1, -1, styles);
        shapeRecords.add(scr);
       
        shapeRecords.add(new StraightEdgeRecord(0, dya));
       
        scr = new StyleChangeRecord();
        scr.setDefinedStyles(5, 4, -1, styles);
        shapeRecords.add(scr);
       
        shapeRecords.add(new StraightEdgeRecord(0, dyb));
       
        scr = new StyleChangeRecord();
        scr.setDefinedStyles(8, 7, -1, styles);
        shapeRecords.add(scr);
       
        shapeRecords.add(new StraightEdgeRecord(0, dyc));

        // down 2
        scr = new StyleChangeRecord();
        scr.setMove(dxa + dxb, 0);
        scr.setDefinedStyles(3, 2, -1, styles);
        shapeRecords.add(scr);
       
        shapeRecords.add(new StraightEdgeRecord(0, dya));
       
        scr = new StyleChangeRecord();
        scr.setDefinedStyles(6, 5, -1, styles);
        shapeRecords.add(scr);
       
        shapeRecords.add(new StraightEdgeRecord(0, dyb));
       
        scr = new StyleChangeRecord();
        scr.setDefinedStyles(9, 8, -1, styles);
        shapeRecords.add(scr);
       
        shapeRecords.add(new StraightEdgeRecord(0, dyc));

        // right 1
        scr = new StyleChangeRecord();
        scr.setMove(0, dya);
        scr.setDefinedStyles(1, 4, -1, styles);
        shapeRecords.add(scr);
       
        shapeRecords.add(new StraightEdgeRecord(dxa, 0));
       
        scr = new StyleChangeRecord();
        scr.setDefinedStyles(2, 5, -1, styles);
        shapeRecords.add(scr);

        shapeRecords.add(new StraightEdgeRecord(dxb, 0));
       
        scr = new StyleChangeRecord();
        scr.setDefinedStyles(3, 6, -1, styles);
        shapeRecords.add(scr);

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

        // right 2       
        scr = new StyleChangeRecord();
        scr.setMove(0, dya + dyb);
        scr.setDefinedStyles(4, 7, -1, styles);
        shapeRecords.add(scr);
        shapeRecords.add(new StraightEdgeRecord(dxa, 0));

        scr = new StyleChangeRecord();
        scr.setDefinedStyles(5, 8, -1, styles);
        shapeRecords.add(scr);

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

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

                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();
                coordinates[i][1] = coordinates[i-1][1] + ser.getDeltaY();
            }
            else if (record instanceof CurvedEdgeRecord)
            {
                CurvedEdgeRecord cer = (CurvedEdgeRecord)record;                   
                coordinates[i][0] = coordinates[i-1][0] + cer.getControlDeltaX() + cer.getAnchorDeltaX();
View Full Code Here

        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));
        shapeWithStyle.addShapeRecord(new StraightEdgeRecord(width, 0));
        shapeWithStyle.addShapeRecord(new StraightEdgeRecord(0, height));

        return shape;
    }
View Full Code Here

        }
        shapeWithStyle.addShapeRecord(scr);

        for (int i = 0; i < coords.length; ++i)
        {
            shapeWithStyle.addShapeRecord(new StraightEdgeRecord(coords[i][0], coords[i][1]));
        }
    }
View Full Code Here

        {
            numSegments = abs_dy/MAX_EDGE_SIZE + 1;
        }
        else
        {
            StraightEdgeRecord ser = new StraightEdgeRecord(dx, dy);
            shapeRecords.add(ser);
            return shapeRecords;
        }

        int xSeg = dx/numSegments;
        int ySeg = dy/numSegments;
        for (int i=0; i < numSegments; i++)
        {
            if (i == numSegments-1)
            {
                //make up for any rounding errors
                int lastx = dx - xSeg*(numSegments-1);
                int lasty = dy - ySeg*(numSegments-1);
                StraightEdgeRecord ser = new StraightEdgeRecord(lastx, lasty);
                shapeRecords.add(ser);
            }
            else
            {
                StraightEdgeRecord ser = new StraightEdgeRecord(xSeg, ySeg);
                shapeRecords.add(ser);
            }
        }
       
        return shapeRecords;
View Full Code Here

                    firstMove = false;
                }
            }
            else if (r instanceof StraightEdgeRecord)
            {
                StraightEdgeRecord ser = (StraightEdgeRecord)r;
                x = x + ser.getDeltaX();
                y = y + ser.getDeltaY();
            }
            else if (r instanceof CurvedEdgeRecord)
            {
                CurvedEdgeRecord cer = (CurvedEdgeRecord)r;
               
View Full Code Here

TOP

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

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.