* @param externalGraphicPath the path to set.
* @throws MalformedURLException
*/
public void setStrokeExternalGraphicStrokePath( String externalGraphicPath ) throws MalformedURLException {
if (strokeExternalGraphicStroke == null) {
Graphic graphic = null;
LineSymbolizerWrapper lineSymbolizerWrapper = adapt(LineSymbolizerWrapper.class);
PolygonSymbolizerWrapper polygonSymbolizerWrapper = adapt(PolygonSymbolizerWrapper.class);
if (lineSymbolizerWrapper != null) {
graphic = lineSymbolizerWrapper.getStrokeGraphicStroke();
if (graphic == null) {
graphic = sb.createGraphic();
lineSymbolizerWrapper.setStrokeGraphicStroke(graphic);
}
} else if (polygonSymbolizerWrapper != null) {
graphic = polygonSymbolizerWrapper.getStrokeGraphicStroke();
if (graphic == null) {
graphic = sb.createGraphic();
polygonSymbolizerWrapper.setStrokeGraphicStroke(graphic);
}
} else {
return;
}
graphic.graphicalSymbols().clear();
String urlStr = externalGraphicPath;
if (!externalGraphicPath.startsWith("http:") && !externalGraphicPath.startsWith("file:")) { //$NON-NLS-1$ //$NON-NLS-2$
urlStr = "file:" + externalGraphicPath; //$NON-NLS-1$
}
strokeExternalGraphicStroke = sb.createExternalGraphic(new URL(urlStr), getFormat(externalGraphicPath));
graphic.graphicalSymbols().add(strokeExternalGraphicStroke);
} else {
setExternalGraphicPath(externalGraphicPath, strokeExternalGraphicStroke);
}
}