提交 a9450223 编写于 作者: S serge-rider

SVG (batik) dependencies fix

上级 6dbac567
......@@ -18,17 +18,7 @@
%license
</license>
<plugin
id="org.jkiss.dbeaver.data.office"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.jkiss.bundle.apache.poi"
download-size="0"
install-size="0"
version="0.0.0"/>
<plugin id="org.jkiss.dbeaver.data.office" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
<plugin id="org.jkiss.bundle.apache.poi" download-size="0" install-size="0" version="0.0.0"/>
</feature>
......@@ -19,13 +19,6 @@
</license>
<plugin id="org.jkiss.dbeaver.ext.ui.svg" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
<plugin id="org.apache.xmlgraphics.batik-svggen" download-size="0" install-size="0" version="0.0.0"/>
<plugin id="org.apache.xmlgraphics.batik-codec" download-size="0" install-size="0" version="0.0.0"/>
<plugin id="org.apache.xmlgraphics.batik-awt-util" download-size="0" install-size="0" version="0.0.0"/>
<plugin id="org.apache.xmlgraphics.batik-constants" download-size="0" install-size="0" version="0.0.0"/>
<plugin id="org.apache.xmlgraphics.batik-i18n" download-size="0" install-size="0" version="0.0.0"/>
<plugin id="org.apache.xmlgraphics.batik-util" download-size="0" install-size="0" version="0.0.0"/>
<plugin id="org.apache.xmlgraphics.commons" download-size="0" install-size="0" version="0.0.0"/>
<plugin id="org.jkiss.bundle.apache.batik" download-size="0" install-size="0" version="0.0.0"/>
</feature>
......@@ -12,8 +12,6 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.gef,
org.jkiss.dbeaver.core,
org.jkiss.dbeaver.ext.erd,
org.apache.xmlgraphics.batik-svggen;bundle-version="1.9.1",
org.apache.xmlgraphics.batik-awt-util;bundle-version="1.9.1",
org.apache.xmlgraphics.batik-codec;bundle-version="1.9.1"
org.jkiss.bundle.apache.batik
Bundle-ActivationPolicy: lazy
Bundle-Localization: OSGI-INF/l10n/bundle
......@@ -40,14 +40,21 @@ import java.io.File;
public class ERDExportSVG implements ERDExportFormatHandler {
private static final Log log = Log.getLog(ERDExportSVG.class);
static {
// For some reason image writers aren't registered in Batik registry automatically
// Probably because of cut dependencies (which are fucking huge for Batic codec)
ImageWriterRegistry.getInstance().register(new PNGImageWriter());
private static boolean pngWriterRegistered;
private static synchronized void checkWriterRegister() {
if (!pngWriterRegistered) {
// For some reason image writers aren't registered in Batik registry automatically
// Probably because of cut dependencies (which are fucking huge for Batic codec)
ImageWriterRegistry.getInstance().register(new PNGImageWriter());
pngWriterRegistered = true;
}
}
@Override
public void exportDiagram(EntityDiagram diagram, IFigure diagramFigure, DiagramPart diagramPart, File targetFile) throws DBException {
checkWriterRegister();
try {
IFigure figure = diagramPart.getFigure();
Rectangle contentBounds = figure instanceof FreeformLayeredPane ? ((FreeformLayeredPane) figure).getFreeformExtent() : figure.getBounds();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册