Hi list!
A few weeks ago I upgraded my application from udig 1.1rc8 to udig 1.1rc12.
It has been necessary for the changeover of eclipse 3.3. The most problems
in case of adapting my application to udig 1.1rc12 and the reverse were solved
for now. But one issue is currently alive:
Actual State:
The mapobject(Map) represents a WMS-Map-Instance from a WMS-Server(which holds
different kinds of maps). On each map I put some own layers, such as layers for
querying or layers to display hits from a resultset. The user doesn't create
maps or save them (thus I've overwritten MapEditor.isDirty() which now always
returns false). For instance a map can be chosen from a list and the programm
handles its creation and opends an editor. By doubleclick on a list item the former
editor is closed without saving and a new one with a new map is beeing opened
programmatically. Here the problem begins.
The Problem:
In case of this workaround I have trouble with the state of the dispose flag of
the RenderManagerImpl class. If the editor is opened for the first time everything's
fine with the rendering. But if I doubleclick the next entry in the list of maps,
which closes the first editor and opened a new one, I bekome this exception in
my logfile:
####################
!ENTRY net.refractions.udig.ui 1 0 2008-01-29 14:37:56.890
!MESSAGE RenderManager is disposed
!STACK 0
java.lang.IllegalStateException: RenderManager is disposed
at net.refractions.udig.project.internal.render.impl.RenderManagerImpl.checkState(RenderManagerImpl.java:458)
at net.refractions.udig.project.ui.internal.RenderManagerDynamic.doInternalRefresh(RenderManagerDynamic.java:103)
at net.refractions.udig.project.ui.internal.RenderManagerDynamic.access$0(RenderManagerDynamic.java:102)
at net.refractions.udig.project.ui.internal.RenderManagerDynamic$1.run(RenderManagerDynamic.java:93)
at net.refractions.udig.ui.PlatformGIS$Runner.run(PlatformGIS.java:204)
at net.refractions.udig.ui.PlatformGIS$Runner.run(PlatformGIS.java:183)
####################
Any ideas what's going wrong? Could it be that the renderers are still rendering
after the map was closed? And when they have finished rendering that they are
unable to send a message to the RenderManager class?
Can anyone help me, fix that issue or tell me how could I avoid this?
FYI: how I...
------------
// create project
Project udigProject = ProjectPlugin.getPlugin().getProjectRegistry().getDefaultProject();
// create map
CreateMapCommand command = new CreateMapCommand("map.Name",new ArrayList(),udigProject);
udigProject.sendSync(command);
Map map = (Map)command.getCreatedMap();
// create layer
IGeoResource resource = CatalogPlugin.getDefault().getLocalCatalog().createTemporaryResource(....);
Layer layer = map.getLayerFactory().createLayer(resource);
map.sendCommandSync(BasicCommandFactory.getInstance().createAddLayer(layer);
// open editor
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
page.openEditor(new MapEditorInput(map), MapEditor.ID);
// close editor
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false);
Thanks for your help
Tony Roth
_______________________________________________