public void fillstyle(Attributes attributes) throws SAXParseException
{
DefineShape defineShape = (DefineShape)stack.peek();
boolean hasAlpha = (defineShape.code == stagDefineShape3);
FillStyle fillstyle = new FillStyle();
if (hasAttribute(attributes, "color"))
{
fillstyle.setType(FillStyle.FILL_SOLID);
fillstyle.color = hasAlpha ? parseRGBA(getAttribute(attributes, "color")) :
parseRGB(getAttribute(attributes, "color"));
}
if (hasAttribute(attributes, "gradient"))
{
// todo support radial gradients
fillstyle.setType(FillStyle.FILL_LINEAR_GRADIENT);
fillstyle.gradient = parseGradient(getAttribute(attributes, "gradient"), hasAlpha);
fillstyle.matrix = parseMatrix(getAttribute(attributes, "matrix"));
}
if (hasAttribute(attributes, "idref"))
{
// todo support clipped bitmaps
fillstyle.setType(FillStyle.FILL_BITS); // tiled
int idref = parseInt(getAttribute(attributes, "idref"));
// todo check to make sure bitmapId points to a bitmap
fillstyle.bitmap = findCharacter(idref);
fillstyle.matrix = parseMatrix(getAttribute(attributes, "matrix"));
}