Skip to main content

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

Thinking about it, In general we try do any heavy lifting out of the display thread (to avoid blocking the UI) and then call event UI event notification in the event thread.

I expected getProject() *may* have to load the project, if it was currently closed

--
Jody Garnett

On 26 August 2015 at 08:01, Frank Gasdorf <fgdrf@xxxxxxxxxxxxxxxxxxxxx> wrote:
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

_______________________________________________
udig-dev mailing list
udig-dev@xxxxxxxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://locationtech.org/mailman/listinfo/udig-dev


Back to the top