StyleSheet ss = null;
CSSEngine engine = ((SVGOMDocument) doc).getCSSEngine();
try {
if (inlineCss != null) {
InputSource source = new InputSource(new StringReader(inlineCss));
ss = engine.parseStyleSheet(source, new URL("http://www.timepedia.org"),
"screen");
engine.setUserAgentStyleSheet(ss);
} else if (altCss != null) {
ss = engine.parseStyleSheet(new InputSource(altCss),
new URL("http://www.timepedia.org"), "screen");
engine.setUserAgentStyleSheet(ss);
} else {
InputStream asStream = getClass().getClassLoader().getResourceAsStream(
"org/timepedia/chronoscope/public/Chronoscope.css");
InputSource source = new InputSource(new InputStreamReader(asStream));
ss = engine.parseStyleSheet(source, new URL("http://www.timepedia.org"),
"screen");
engine.setUserAgentStyleSheet(ss);
}
} catch (MalformedURLException e) {