For the image patterns, I found I had to implement a new renderer as
the built-in class ImageFillPattern seems to require the IconLoader
class to load the images (and I haven't figured out how to change the
path for the image files away from the package location to the plugins
folder so it is accessible to the user). If there was an option in
IconLoader to specify and absolute path for the images then I could
have avoided this.
mhm .. from my point of view if adding a new method or second
constructor to IconLoader will help you, then we/you could do that in
the core. But best way would be you try it and post your changes before
committing
stefan
There are still a couple of problems, however:
1. When the new patterns appear in the Fill Patterns combo of the
ChangeStyles dialog, they get a 0 index number. As far as I can
tell these index numbers are hard coded by the built-in list of
patterns. This does not appear to case further problems.
2. In my PrinterPlugin, the "Quality" rendering option sometimes
fails as shown below. This option uses the
RenderingManager.copyTo() to copy the image to the current
graphics context (to be use for printing). This rendering option
also produces getBounds() (No yet implemented) errors from
PolygonShape(). The "Accurate" option uses the LayerPrinter2()
class that creates a new LayerViewPanel does not have this
problem, also the external renderer is fine.
Geoff
=========================================
java.lang.IllegalArgumentException: Expected a Color instance
at sun.print.PathGraphics.fill(Unknown Source)
at
com.vividsolutions.jump.workbench.ui.renderer.style.StyleUtil.paint(StyleUtil.java:69)
at
com.vividsolutions.jump.workbench.ui.renderer.style.BasicStyle.paint(BasicStyle.java:134)
at
com.vividsolutions.jump.workbench.ui.renderer.SimpleFeatureCollectionRenderer.paint(SimpleFeatureCollectionRenderer.java:44)
at
com.vividsolutions.jump.workbench.ui.renderer.SimpleFeatureCollectionRenderer.paint(SimpleFeatureCollectionRenderer.java:62)
at
com.vividsolutions.jump.workbench.ui.renderer.SimpleRenderer.copyTo(SimpleRenderer.java:72)
at
com.vividsolutions.jump.workbench.ui.renderer.FeatureCollectionRenderer.copyTo(FeatureCollectionRenderer.java:51)
at
com.vividsolutions.jump.workbench.ui.renderer.LayerRenderer.copyTo(LayerRenderer.java:94)
at
com.vividsolutions.jump.workbench.ui.renderer.RenderingManager.copyTo(RenderingManager.java:288)
at com.cadplan.jump.PrinterPanel.paint(PrinterPanel.java:251)
at com.cadplan.jump.PrinterPanel.print(PrinterPanel.java:441)
at sun.print.RasterPrinterJob.printPage(Unknown Source)
at sun.print.RasterPrinterJob.print(Unknown Source)
at sun.print.RasterPrinterJob.print(Unknown Source)
at com.cadplan.jump.PrinterPlugIn.run(PrinterPlugIn.java:219)
at
com.vividsolutions.jump.workbench.ui.task.TaskMonitorManager$TaskWrapper.run(TaskMonitorManager.java:149)
at java.lang.Thread.run(Unknown Source)
==========================================
Sunburned Surveyor wrote:
Very cool Geoff! I like the idea of being able to specify custom
vector fill patterns using WKT. I bet the designers of the spec never
imagined it being used in that way.
Perhaps I will have time to check your plug-in out this weekend.
The Sunburned Surveyor
P.S. - Did you have to implement custom rendering behavior to create
this plug-in?
On 7/6/07, Geoffrey G Roy <[EMAIL PROTECTED]> wrote:
To Open Jump Users (and Federico)
I have just posted a new plugin for OpenJUMP that allows users to to
create their own fill patterns. Fill patterns can be vector based
using
a WKT specification, or image based using GIF, JPG, PNG or SVG image
files. Image files are loaded by the plugin from the FillPatterns
folder within the plugins folder.
The new fill patterns appear in the Fill Pattern combo (added to the
bottom) of the Change Styles dialog.
Details can be found at my web site: http://www.cadplan.com.au
This is still a preliminary version, so comments and feedback are
welcome.
Geoff
--
Dr Geoffrey G Roy
Cadplan
129 Gloster Street, Subiaco WA 6008
Tel: (08) 9381 4870 Fax: (08) 9382 4459
Email: [EMAIL PROTECTED]
http://www.cadplan.com.au
_______________________________________________
jump-users mailing list
[email protected]
http://lists.refractions.net/mailman/listinfo/jump-users
_______________________________________________
jump-users mailing list
[email protected]
http://lists.refractions.net/mailman/listinfo/jump-users
_______________________________________________
jump-users mailing list
[email protected]
http://lists.refractions.net/mailman/listinfo/jump-users