try {
XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xMainShape);
//int lineColor = AnyConverter.toInt(xProp.getPropertyValue("LineColor"));
if(((FillStyle)xProp.getPropertyValue("FillStyle")) == FillStyle.SOLID){
int color = AnyConverter.toInt(xProp.getPropertyValue("FillColor"));
return new Color(false, color, 0, 0);
} else{
int startColor = ((Gradient)xProp.getPropertyValue("FillGradient")).StartColor;
int endColor = ((Gradient)xProp.getPropertyValue("FillGradient")).EndColor;
return new Color(true, startColor, startColor, endColor);
}
} catch (Exception ex) {
System.err.println(ex.getLocalizedMessage());
}
return null;