Package flash.swf.types

Examples of flash.swf.types.LineStyle


    private void printLineStyles(ArrayList linestyles, boolean alpha)
    {
      Iterator it = linestyles.iterator();
      while (it.hasNext())
      {
        LineStyle lineStyle = (LineStyle)it.next();
        indent();
        out.print("<linestyle ");
        String color = alpha ? printRGBA(lineStyle.color) : printRGB(lineStyle.color);
        out.print("color='" + color + "' ");
        out.print("width='" + lineStyle.width + "' ");
        if (lineStyle.flags != 0)
          out.print("flags='" + lineStyle.flags + "' ");
        if (lineStyle.hasMiterJoint())
        {
          out.print("miterLimit='" + lineStyle.miterLimit + "' ");
        }
        if (lineStyle.hasFillStyle())
        {
          out.println(">");
          indent();
          ArrayList<FillStyle> fillStyles = new ArrayList<FillStyle>(1);
          fillStyles.add(lineStyle.fillStyle);
View Full Code Here


        return a;
    }

    private LineStyle decodeLineStyle(int shape) throws IOException
    {
        LineStyle s = new LineStyle();
        s.width = r.readUI16();

        if (shape == stagDefineShape4)
        {
            s.flags = r.readUI16();
            if (s.hasMiterJoint())
                s.miterLimit = r.readUI16();    // 8.8 fixedpoint
        }
        if ((shape == stagDefineShape4) && (s.hasFillStyle()))
        {
            s.fillStyle = decodeFillStyle(shape);
        }
        else if ((shape == stagDefineShape3) || (shape == stagDefineShape4))
        {
View Full Code Here

    {}

    public void linestyle(Attributes attributes) throws SAXParseException
    {
        DefineShape defineShape = (DefineShape)stack.peek();
        LineStyle linestyle = new LineStyle();
        if (defineShape.code == stagDefineShape3)
        {
            linestyle.color = parseRGBA(getAttribute(attributes, "color"));
        }
        else
View Full Code Here

    {
    }

    public static LineStyle build(Paint paint, Stroke thickness)
    {
        LineStyle ls = new LineStyle();

        if (paint != null && paint instanceof Color)
            ls.color = SwfUtils.colorToInt((Color)paint);

        if (thickness != null && thickness instanceof BasicStroke)
View Full Code Here

      {
        it = lineStyles.iterator();
        int width = SwfConstants.TWIPS_PER_PIXEL;
        while (it.hasNext())
        {
          LineStyle ls = (LineStyle)it.next();
          if (ls == null)
            continue;
          else
          {
            if (width < ls.width)
View Full Code Here

    private void printLineStyles(ArrayList linestyles, boolean alpha)
    {
      Iterator it = linestyles.iterator();
      while (it.hasNext())
      {
        LineStyle lineStyle = (LineStyle)it.next();
        indent();
        out.print("<linestyle ");
        String color = alpha ? printRGBA(lineStyle.color) : printRGB(lineStyle.color);
        out.print("color='" + color + "' ");
        out.print("width='" + lineStyle.width + "' ");
        if (lineStyle.flags != 0)
          out.print("flags='" + lineStyle.flags + "' ");
        if (lineStyle.hasMiterJoint())
        {
          out.print("miterLimit='" + lineStyle.miterLimit + "' ");
        }
        if (lineStyle.hasFillStyle())
        {
          out.println(">");
          indent();
          ArrayList<FillStyle> fillStyles = new ArrayList<FillStyle>(1);
          fillStyles.add(lineStyle.fillStyle);
View Full Code Here

        }

        if (stroke != null)
        {
          //find the shapeBounds with stroke
          LineStyle ls = createGenericLineStyle((AbstractStrokeNode)stroke);
            shapeBounds = (node == null) ? ShapeHelper.getBounds(shapeRecords, ls, (AbstractStrokeNode)stroke) : node.getBounds(shapeRecords, ls);         

            LineStyle lineStyle = createLineStyle(stroke, shapeBounds);
            sws.linestyles = new ArrayList<LineStyle>();
            sws.linestyles.add(lineStyle);           
        }
        else
        {
View Full Code Here

                fillStyle1Index = 0;
                ShapeHelper.replaceStyles(shapeRecords2, lineStyleIndex, fillStyle0Index, fillStyle1Index);

                // Consider linestyle stroke widths with bounds calculation              
                AbstractStrokeNode strokeNode = (AbstractStrokeNode) stroke;
                LineStyle ls = createGenericLineStyle(strokeNode);
                Rect shapeBounds =  node.getBounds(shapeRecords2, ls);             
               
                LineStyle lineStyle = createLineStyle(stroke, shapeBounds);
                swsStroke.linestyles = new ArrayList<LineStyle>(1);
                swsStroke.linestyles.add(lineStyle);

                DefineShape strokeShape = new DefineShape(Tag.stagDefineShape4);
                strokeShape.shapeWithStyle = swsStroke;
View Full Code Here

            return null;
    }

    private LineStyle createGenericLineStyle(AbstractStrokeNode stroke)
    {
        LineStyle ls = new LineStyle();
        ls.width = (int)StrictMath.rint(stroke.getWeight() * SwfConstants.TWIPS_PER_PIXEL);

        int flags = 0;
        int startCapStyle = createCaps(stroke.caps);
        int endCapStyle = startCapStyle;
View Full Code Here

        ls.flags = flags;
        return ls;
    }
    protected LineStyle createLineStyle(SolidColorStrokeNode stroke)
    {
        LineStyle ls = createGenericLineStyle(stroke);
        ls.color = TypeHelper.colorARGB(stroke.color, stroke.alpha);
        return ls;
    }
View Full Code Here

TOP

Related Classes of flash.swf.types.LineStyle

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.