case CSSPrimitiveValue.CSS_URI:
String uri = paintDef.getStringValue();
Element paintElement = ctx.getReferencedElement(paintedElement, uri);
//logger.debug("Fill -> Uri: \"" + uri + "\" -> Referenced Element: \"" + paintElement.getNodeName() + "\" Class: \"" + paintElement.getClass() + "\"");
if (paintElement instanceof SVGOMLinearGradientElement){
SVGOMLinearGradientElement linearGradient = (SVGOMLinearGradientElement)paintElement;
return linearGradient;
// Bridge bridge = ctx.getBridge(paintElement);
// logger.debug("Bridge: " + bridge.getLocalName() + " Class: " + bridge.getClass());
// SVGLinearGradientElementBridge l = (SVGLinearGradientElementBridge)bridge;
// SVGOMLinearGradientElement linearGradient = (SVGOMLinearGradientElement)paintElement;
// SVGAnimatedEnumeration spreadMethod = linearGradient.getSpreadMethod();
}else if (paintElement instanceof SVGOMRadialGradientElement){
SVGOMRadialGradientElement radialGradElement = (SVGOMRadialGradientElement)paintElement;
// logger.error("Radial gradient encountered -> Not supported yet.");
return radialGradElement;
}else{
logger.error("Couldnt read referenced Fill or Stroke from URI.");
return null;
}
/*
return PaintServer.convertURIPaint(paintedElement,
paintedNode,
paintDef,
opacity,
ctx);
*/
default:
throw new IllegalArgumentException
("Paint argument is not an appropriate CSS value");
}
} else { // List
Value v = paintDef.item(0);
switch (v.getPrimitiveType()) {
case CSSPrimitiveValue.CSS_RGBCOLOR:
return PaintServer.convertRGBICCColor(paintedElement, v,
(ICCColor)paintDef.item(1),
opacity, ctx);
case CSSPrimitiveValue.CSS_URI: {
// Paint result = PaintServer.silentConvertURIPaint(paintedElement,
// paintedNode,
// v, opacity, ctx);
// if (result != null)
// return result;
String uri = v.getStringValue();
Element paintElement = ctx.getReferencedElement(paintedElement, uri);
//logger.debug("Fill -> Uri: \"" + uri + "\" -> Referenced Element: \"" + paintElement.getNodeName() + "\" Class: \"" + paintElement.getClass() + "\"");
if (paintElement instanceof SVGOMLinearGradientElement){
SVGOMLinearGradientElement linearGradient = (SVGOMLinearGradientElement)paintElement;
return linearGradient;
}else if (paintElement instanceof SVGOMRadialGradientElement){
SVGOMRadialGradientElement radialGradElement = (SVGOMRadialGradientElement)paintElement;
// logger.error("Radial gradient encountered -> Not supported yet.");
return radialGradElement;