Examples of FillStyle


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

        // translate into source bitmap
        Matrix tsm = new Matrix();
        // unity in twips
        tsm.setScale(ISWFConstants.TWIPS_PER_PIXEL, ISWFConstants.TWIPS_PER_PIXEL);

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

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

       
        FillStyleArray fillStyles = new FillStyleArray(1);
        LineStyleArray lineStyles = new LineStyleArray();
        if (fill != null)
        {
            FillStyle fillStyle = createFillStyle(fill, edgeBounds);
            if(fillStyle != null)
                fillStyles.add(fillStyle);
        }

        if (stroke != null)
View Full Code Here

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

           
            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);
View Full Code Here

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

            return null;
    }

    protected FillStyle createFillStyle(SolidColorFillNode fill)
    {
        FillStyle fs = new FillStyle();
        fs.setColor(TypeHelper.splitColor(TypeHelper.colorARGB(fill.color, fill.alpha)));
        fs.setFillStyleType(FillStyle.SOLID_FILL);
        return fs;
    }
View Full Code Here

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

        return fs;
    }

    protected FillStyle createFillStyle(BitmapFillNode fill, Rect bounds)
    {
        FillStyle fs = new FillStyle();
       
        if (ImageHelper.bitmapFillModeIsRepeat(fill))
            fs.setFillStyleType(FillStyle.REPEATING_BITMAP_FILL);
        else
            fs.setFillStyleType(FillStyle.CLIPPED_BITMAP_FILL);

        String sourceFormatted = parseSource(fill.source);
       
        if (sourceFormatted == null)
        {
            // Source is required after FXG 1.0
            // Missing source attribute in <BitmapGraphic> or <BitmapFill>.
            problems.add(new FXGMissingAttributeProblem(fill.getDocumentPath(), fill.getStartLine(),
                    fill.getStartColumn(), FXGConstants.FXG_SOURCE_ATTRIBUTE, fill.getNodeName()));
            return null;
        }

        DefineImage img = createDefineBitsTag(fill, sourceFormatted);
        if(img != null)
        {
            fs.setBitmapCharacter(img.getTag());
       
            fs.setBitmapMatrix(TypeHelper.bitmapFillMatrix(fill, img, bounds).toSWFMatrix());
        }
        return fs;
    }
View Full Code Here

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

        return fs;
    }

    protected FillStyle createFillStyle(LinearGradientFillNode node, Rect bounds)
    {
        FillStyle fs = new FillStyle();
        fs.setFillStyleType(FillStyle.LINEAR_GRADIENT_FILL);
        fs.setGradientMatrix(TypeHelper.linearGradientMatrix(node, bounds));
        Gradient gradient = new Gradient();
        populateGradient(gradient, node.entries, node.interpolationMethod, node.spreadMethod);
        fs.setGradient(gradient);

        return fs;
    }
View Full Code Here

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

        return fs;
    }

    protected FillStyle createFillStyle(LinearGradientStrokeNode node, Rect bounds)
    {
        FillStyle fs = new FillStyle();
        fs.setFillStyleType(FillStyle.LINEAR_GRADIENT_FILL);
        fs.setGradientMatrix(TypeHelper.linearGradientMatrix(node, bounds));
        Gradient gradient = new Gradient();
        populateGradient(gradient, node.entries, node.interpolationMethod, node.spreadMethod);
        fs.setGradient(gradient);

        return fs;
    }
View Full Code Here

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

        return fs;
    }

    protected FillStyle createFillStyle(RadialGradientFillNode node, Rect bounds)
    {
        FillStyle fs = new FillStyle();
        fs.setFillStyleType(FillStyle.FOCAL_RADIAL_GRADIENT_FILL);
        fs.setGradientMatrix(TypeHelper.radialGradientMatrix(node, bounds));
        FocalGradient gradient = new FocalGradient();
        populateGradient(gradient, node.entries, node.interpolationMethod, node.spreadMethod);
        gradient.setFocalPoint((float)node.focalPointRatio);
        fs.setGradient(gradient);

        return fs;
    }
View Full Code Here

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

        return fs;
    }

    protected FillStyle createFillStyle(RadialGradientStrokeNode node, Rect bounds)
    {
        FillStyle fs = new FillStyle();
        fs.setFillStyleType(FillStyle.FOCAL_RADIAL_GRADIENT_FILL);
        fs.setGradientMatrix(TypeHelper.radialGradientMatrix(node, bounds));
        FocalGradient gradient = new FocalGradient();
        populateGradient(gradient, node.entries, node.interpolationMethod, node.spreadMethod);
        gradient.setFocalPoint((float)node.focalPointRatio);
        fs.setGradient(gradient);

        return fs;
    }
View Full Code Here

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

        {
            indent();
            out.print("<fillstyle");

            int fillStyleType;
            FillStyle fillStyle = (FillStyle)iFillStyle;
            fillStyleType = fillStyle.getFillStyleType();

            out.print(" type=\"" + fillStyleType + "\"");
            if (fillStyleType == FillStyle.SOLID_FILL)
            {
                out.print(" color=\"" + printColor(fillStyle.getColor()) + "\"");
            }
            if ((fillStyleType & FillStyle.LINEAR_GRADIENT_FILL) != 0)
            {
                if (fillStyleType == FillStyle.RADIAL_GRADIENT_FILL)
                    out.print(" typeName=\"radial\"");
                else if (fillStyleType == FillStyle.FOCAL_RADIAL_GRADIENT_FILL)
                    out.print(" typeName=\"focal\" focalPoint=\"" +
                              ((FocalGradient)fillStyle.getGradient()).getFocalPoint() + "\"");
                // todo print linear or radial or focal
                out.print(" gradient=\"" + formatGradient(fillStyle.getGradient().getGradientRecords()) + "\"");
                out.print(" matrix=\"" + fillStyle.getGradientMatrix() + "\"");
            }
            if ((fillStyleType & FillStyle.REPEATING_BITMAP_FILL) != 0)
            {
                // todo print tiled or clipped
                out.print(" idref=\"" + idRef(fillStyle.getBitmapCharacter()) + "\"");
                out.print(" matrix=\"" + fillStyle.getBitmapMatrix() + "\"");
            }
            out.println(" />");
        }
    }
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.