Examples of LineStyle2


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

                out.print("width=\"" + ls.getWidth() + "\" ");
            }

            if (lineStyle instanceof LineStyle2)
            {
                LineStyle2 lineStyle2 = (LineStyle2)lineStyle;

                if (lineStyle2.getJoinStyle() == LineStyle2.JS_MITER_JOIN)
                {
                    out.print("miterLimit=\"" + lineStyle2.getMiterLimitFactor() + "\" ");
                }

                if (lineStyle2.isHasFillFlag())
                {
                    out.println(">");
                    indent();
                    FillStyleArray fillStyles = new FillStyleArray(1);
                    fillStyles.add(lineStyle2.getFillType());
                    printFillStyles(fillStyles);
                    indent();
                    out.println("</linestyle>");
                }
                else
View Full Code Here

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

    private ILineStyle readLineStyle(TagType tagType) throws MalformedTagException
    {
        ILineStyle result = null;
        if (tagType == TagType.DefineShape4)
        {
            final LineStyle2 s = new LineStyle2();
            s.setWidth(bitStream.readUI16());
            s.setStartCapStyle(bitStream.readUB(2));
            s.setJoinStyle(bitStream.readUB(2));
            s.setHasFillFlag(bitStream.readBit());
            s.setNoHScaleFlag(bitStream.readBit());
            s.setNoVScaleFlag(bitStream.readBit());
            s.setPixelHintingFlag(bitStream.readBit());
            bitStream.readUB(5);
            s.setNoClose(bitStream.readBit());
            s.setEndCapStyle(bitStream.readUB(2));

            if (s.getJoinStyle() == LineStyle2.JS_MITER_JOIN)
            {
                s.setMiterLimitFactor(bitStream.readUI16()); // 8.8 fixed point
            }

            if (s.isHasFillFlag())
            {
                IFillStyle fillStyle = readFillStyle(tagType);
                s.setFillType((FillStyle)fillStyle);
                // Default to #00000000 when there's no color,
                // to match behavior of old SWF reader
                s.setColor(new RGBA(0, 0, 0, 0));
            }
            else
            {
                s.setColor(readRGBA());
            }
            result = s;
        }
        else if (tagType == TagType.DefineMorphShape)
        {
View Full Code Here

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

            return null;
    }

    private LineStyle2 createGenericLineStyle(AbstractStrokeNode stroke)
    {
        LineStyle2 ls = new LineStyle2();
        ls.setWidth((int)StrictMath.rint(stroke.getWeight() * ISWFConstants.TWIPS_PER_PIXEL));

        int startCapStyle = createCaps(stroke.caps);
        int endCapStyle = startCapStyle;
        int jointStyle = createJoints(stroke.joints);
       
        boolean noHScaleFlag = stroke.scaleMode == ScaleMode.VERTICAL || stroke.scaleMode == ScaleMode.NONE;
        boolean noVScaleFlag = stroke.scaleMode == ScaleMode.HORIZONTAL || stroke.scaleMode == ScaleMode.NONE;
       
        // The 4.5.1 Flex Compiler switches these two flags.                  
        // A bug has been logged in JIRA against the old compiler for this issue
        // http://bugs.adobe.com/jira/browse/SDK-31114
        ls.setNoHScaleFlag(noHScaleFlag);
        ls.setNoVScaleFlag(noVScaleFlag);
       
        ls.setJoinStyle(jointStyle);
        ls.setStartCapStyle(startCapStyle);
        ls.setEndCapStyle(endCapStyle);
        ls.setPixelHintingFlag(stroke.pixelHinting);
       
        if (jointStyle == 2)
        {
            // Encoded in SWF as an 8.8 fixed point value
            ls.setMiterLimitFactor((float)(stroke.miterLimit));
        }
       
        return ls;
    }
View Full Code Here

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

        return ls;
    }
   
    protected LineStyle2 createLineStyle(LinearGradientStrokeNode stroke, Rect bounds)
    {
        LineStyle2 ls = createGenericLineStyle(stroke);
        ls.setFillType(createFillStyle(stroke, bounds));
        ls.setHasFillFlag(true);
        return ls;
    }
View Full Code Here

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

        return ls;
    }

    protected LineStyle2 createLineStyle(RadialGradientStrokeNode stroke, Rect edgeBounds)
    {
        LineStyle2 ls = createGenericLineStyle(stroke);
        ls.setFillType(createFillStyle(stroke, edgeBounds));
        ls.setHasFillFlag(true);
        return ls;
    }
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.