Issue Type: Bug Bug
Affects Versions: UDIG 1.3.2, UDIG 1.3.3
Assignee: Unassigned
Attachments: fix_mapgraphicresource_getinfo.patch
Components: application, printing
Created: 26/Sep/12 3:25 PM
Description:

When I create a print page for a map, the template tries to add a scalebar layer.

I get the following exception:
java.lang.IllegalStateException: Lookup of getInfo not available from the display thread
at net.refractions.udig.catalog.IGeoResource.getInfo(IGeoResource.java:219)
at net.refractions.udig.project.internal.impl.SetLayerNameInterceptor.run(SetLayerNameInterceptor.java:34)
at net.refractions.udig.project.internal.impl.LayerFactoryImpl.runLayerCreatedInterceptor(LayerFactoryImpl.java:419)
at net.refractions.udig.project.internal.impl.LayerFactoryImpl.createLayer(LayerFactoryImpl.java:398)
at net.refractions.udig.printing.model.impl.MapGraphicBoxPrinter.setMapGraphic(MapGraphicBoxPrinter.java:297)
at net.refractions.udig.printing.ui.internal.template.AbstractPrinterPageTemplate.addScale(AbstractPrinterPageTemplate.java:141)
at net.refractions.udig.printing.ui.internal.template.AbstractPrinterPageTemplate.init(AbstractPrinterPageTemplate.java:130)
at net.refractions.udig.printing.ui.actions.CreatePageAction.createPage(CreatePageAction.java:142)
at net.refractions.udig.printing.ui.actions.CreatePageAction.run(CreatePageAction.java:114)

I thinks that the SetLayerNameInterceptor should always do its business out of a display thread, since the default implementation of IGeoResource.getInfo throws that exception.

Similar thing happens when later I try to add a new graphic element to the page and the MapGraphicResource.getInfo is called directly:
java.lang.IllegalStateException: Lookup of getInfo not available from the display thread
at net.refractions.udig.catalog.IGeoResource.getInfo(IGeoResource.java:219)
at net.refractions.udig.mapgraphic.internal.MapGraphicResource.getInfo(MapGraphicResource.java:93)
at net.refractions.udig.mapgraphic.internal.MapGraphicResource.getInfo(MapGraphicResource.java:1)
at net.refractions.udig.mapgraphic.MapGraphicChooserDialog$1.selectionChanged(MapGraphicChooserDialog.java:149)

Since MapGraphicResourceInfo does not query remote services, I think it's safe to override the getInfo method and call createInfo directly.

I attached a patch that fixes these issues.

Environment: Any
Fix Versions: UDIG 1.3.3
Project: uDIG
Priority: Major Major
Reporter: Panagiotis Skintzos
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel

Reply via email to