if (fillImageBorderElement == null) {
throw new InvalidPropertyException("Invalid FillImageBorder property.", null);
}
FillImageBorder fillImageBorder = new FillImageBorder();
PropertyLoader propertyLoader = PropertyLoader.forClassLoader(classLoader);
if (fillImageBorderElement.hasAttribute("color")) {
Color color = ColorPeer.toColor(fillImageBorderElement.getAttribute("color"));
fillImageBorder.setColor(color);
}
if (fillImageBorderElement.hasAttribute("border-insets")) {
Insets insets = InsetsPeer.toInsets(fillImageBorderElement.getAttribute("border-insets"));
fillImageBorder.setBorderInsets(insets);
}
if (fillImageBorderElement.hasAttribute("content-insets")) {
Insets insets = InsetsPeer.toInsets(fillImageBorderElement.getAttribute("content-insets"));
fillImageBorder.setContentInsets(insets);
}
NodeList borderPartList = fillImageBorderElement.getElementsByTagName("border-part");
int borderPartCount = borderPartList.getLength();
for (int i = 0; i < borderPartCount; ++i) {
Element borderPartElement = (Element) borderPartList.item(i);
String position = borderPartElement.getAttribute("position");
FillImage fillImage = (FillImage) propertyLoader.getPropertyValue(FillImageBorder.class, FillImage.class,
borderPartElement);
if ("top-left".equals(position)) {
fillImageBorder.setFillImage(FillImageBorder.TOP_LEFT, fillImage);
} else if ("top".equals(position)) {