Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[udig-dev] ProjectRegistryImpl and synch call in Display Thread

Hello everybody,

I'm wondering about the implementation of ProjectRegistryImpl.getProject() since it internally synchronize calls in Display thread.

After creating a Project the following block set the current project (notifies E-Models) and add the project itself to the registry:

PlatformGIS.syncInDisplayThread(new Runnable() {
                public void run() {
                    try {
                        setCurrentProject(newProject);
                        registry.getProjects().add(newProject);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            });

What I expected to get is a simple project object that has been registrated correctly to work on it pragmatically (create a map, etc.) Once all these tasks are finished I'd like to set and open newly created map.

Is there any other reason (EMF, etc.) I'm not aware to call this synchronously in Display Thread?

Thanks a lot
- Frank

Back to the top