use of org.knime.base.data.xml.SvgCell 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;
}
Aggregations