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

That was my guess as well. Otherwise I found OpenProjectElementCommand that can be executued in DisplayThread  (PlatformGIS.syncInDisplayThread / asyncInDisplayThread). Did I understood you correctly : On startup of uDig if emf maybe restores projects & maps it should open projects and its maps automatically? 

Where is the entry point to look at how projects and maps are restored? Would help to clarify and test the approach calling it without invoking  "setCurrentProject"

- Frank

2015-09-04 2:08 GMT+02:00 Jody Garnett <jody.garnett@xxxxxxxxx>:
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