use of org.w3c.dom.DOMImplementation in project knime-core by knime.
the class HistogramColumn method createSvgImageCell.
/**
* @param histogramData A {@link HistogramModel}.
* @return The SVG image cell.
*/
private DataCell createSvgImageCell(final HistogramModel<?> histogramData, final boolean paintLabels) {
DOMImplementation domImpl = new SVGDOMImplementation();
String svgNS = "http://www.w3.org/2000/svg";
Document myFactory = domImpl.createDocument(svgNS, "svg", null);
SVGGraphics2D g = new SVGGraphics2D(myFactory);
g.setSVGCanvasSize(new Dimension(m_width, m_height));
paint(histogramData, paintLabels, g);
myFactory.replaceChild(g.getRoot(), myFactory.getDocumentElement());
DataCell dc = new SvgCell((SVGDocument) myFactory);
return dc;
}
use of org.w3c.dom.DOMImplementation in project Payara by payara.
the class CombinedXPath method writeXML.
private static synchronized void writeXML(final Node node, final Writer writer) {
try {
if (lsSerializer == null) {
final DOMImplementation domImpl = DOMImplementationRegistry.newInstance().getDOMImplementation("");
final DOMImplementationLS domLS = (DOMImplementationLS) domImpl.getFeature("LS", "3.0");
lsOutput = domLS.createLSOutput();
lsOutput.setEncoding("UTF-8");
lsSerializer = domLS.createLSSerializer();
}
lsOutput.setCharacterStream(writer);
lsSerializer.write(node, lsOutput);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
}
Aggregations