public static void applyStyle(Element element, Style style) {
if (style != null && element != null) {
if (style instanceof ShapeStyle) {
applyShapeStyle(element, (ShapeStyle) style);
} else if (style instanceof FontStyle) {
FontStyle fontStyle = (FontStyle) style;
element.getStyle().setProperty("fontSize", "" + fontStyle.getFontSize());
element.getStyle().setProperty("color", fontStyle.getFillColor());
element.getStyle().setProperty("fontFamily", fontStyle.getFontFamily());
element.getStyle().setProperty("fontWeight", fontStyle.getFontWeight());
element.getStyle().setProperty("fontStyle", fontStyle.getFontStyle());
} else if (style instanceof PictureStyle) {
PictureStyle picturStyle = (PictureStyle) style;
if (SC.isIE()) { //TODO: it's a VML decoder, why make this check?
element.getStyle().setProperty("filter", "alpha(opacity=" + 100 * picturStyle.getOpacity() + ")");
} else {