openjump-gis / fill-patterns

GNU General Public License v2.0
0 stars 0 forks source link

FillPattern needs also Batik bridge #1

Open ma15569 opened 1 year ago

ma15569 commented 1 year ago

I recently tried to use SVG as fill pattern via this plugin (copy a SVG into EXT/FillPattern folder and lunch OpenJUMP. I had this error when I started OpenJUMP meaning that the plugin requires some extra Batik classes not embedded into OpenJUMP. Peppe

java.lang.NoClassDefFoundError: org/apache/batik/bridge/UserAgent at com.cadplan.fill_patterns.jump.SVGRasterizer.setImageWidth(SVGRasterizer.java:111) at com.cadplan.fill_patterns.jump.LoadFillPatterns.loadNames(LoadFillPatterns.java:164) at com.cadplan.fill_patterns.jump.LoadFillPatterns.(LoadFillPatterns.java:72) at com.cadplan.fill_patterns.jump.FillPatternsPlugIn.initialize(FillPatternsPlugIn.java:56) at com.cadplan.fill_patterns.jump.FillPatternsExtension.configure(FillPatternsExtension.java:45) at com.vividsolutions.jump.workbench.plugin.PlugInManager.loadConfigurations(PlugInManager.java:258) at com.vividsolutions.jump.workbench.plugin.PlugInManager.load(PlugInManager.java:237) at com.vividsolutions.jump.workbench.JUMPWorkbench.main(JUMPWorkbench.java:461) at com.vividsolutions.jump.workbench.JUMPWorkbench.main(JUMPWorkbench.java:396)

edeso commented 1 year ago

can you please check if placing https://repo1.maven.org/maven2/org/apache/xmlgraphics/batik-bridge/1.6.1/batik-bridge-1.6.1.jar into lib/ resolves the issue?

looks like there is no real functionality of batik-bridge used, so maybe we can replace the dependency in some clever way

https://github.com/openjump-gis/fill-patterns/blob/a2ecac2380c7fcef068f98954a9ac67fd39fefa8/src/main/java/com/cadplan/fill_patterns/jump/SVGRasterizer.java#L110-L112

ma15569 commented 1 year ago

Hi Ede, I tried with batik bridge having the same errors. (to reproduce this error, copy any SVG into the folder OJ/lib/ext/FillPatterns)

I also discover that the error comes also if I want to use an SVG as vertex symbology via embedded OpenJUMP style plugin (Style-Change Style-Vertex sym. enabled-use bitmap-load bitmap as svg).

The problem should affect also CadPlan vertex symbology. I had no error message back but the plugin dialog seems not todisplay any extenal symbols (to reproduce this error, copy any SVG into the folder OJ/lib/ext/VertexImages)