Update on progress. ☺

1.       Updated LayersView to use MapItemLazyLayerProvider. Also added a 
method in ProjectUIPlugin to return the adapter factoies for LayersView since 
the view still uses all the other factories not just the 
ProjectItemAdapterFactory.

2.       Merged LegendView code into our working branch. Updated LegendView to 
use MapItemLazyLegendProvider.

3.       Updated ProjectItemProviderAdapterFactory to use MapItemNoProvider as 
its default map adapter which returns no children.

Things to do:

1.       Test all the changes in ItemProviders if all changes result in 
expected changes.

2.       Integrate functionality to add legend items. Options:

a.       Enable drag/drop from LayersView

b.      Add toolbar button or context menu item to open “wizard” to add legend 
item

c.       Listen to context model’s layers changes and synchronize add/delete to 
legend items list.

3.       Clean up and finalize LegendView functionalities:

a.       Adapt code to LayerLegendItem

b.      Update functions to work with LegendItems (delete, properties?, etc.)

c.       Update sorting functionalities

d.      Check drag/drop functionalities

4.       Review docs and submit pull request

Thanks!

From: [email protected] 
[mailto:[email protected]] On Behalf Of Jody Garnett
Sent: Friday, 16 March 2012 2:23 PM
To: User-friendly Desktop Internet GIS
Subject: [udig-devel] notes on map item provider work (for legend view)

Naz and I have both had a go at sorting out how MapItemProvider is handled.

RFC Page: http://udig.refractions.net/confluence/display/UDIG/Legend+View

History: MapItemProvider is responsible for listing the "children" when 
displaying the map in a tree view (such as in the project view or  layers 
view). This generated implementation has been hacked up to have a custom 
toString(), only list layers (rather than viewport model etc…) and and to load 
the children in a lazy fashion using a background Job.

Jody:
1) Backed up the hacked MapItemProvider as LazyMapLayerProvider
2) Made MapItemProviderDecorator wrap around a normal generated MapItemProvider.

Naz:
1) Backuped up the hacked MapItemProvider and called it MapItemLayerOld
2) Regenerated the MapItemProvider from scratch (yay!)
3) Created a LazyMapLayerItemProvider as a subclass of 
AbstractLazyLoadingItemProvider; has a generated MapItemProvider as a delegate. 
This was wrapped around the germinated MapItemProvider in order to lazily load 
Layers and only list layers as as the children. Hooked this up to LayerView - 
and it all worked!
4) Created a second one MapLegendItemProvider subclass 
AbstractLazyLoadingItemProvider as above but listing LegendItems.

Notes:
- ProjectsView has a custom MapItemProvider that does not list any children.
- The custom getText( element ) will display only the Layer name (rather than 
the default which lists the object type)
- Original hacked MapITemProvider internally had a descriptor for the Viewport 
model - we are ignoring that for now

Plan:
1) We are going to try and put these bits of work together and see where it 
gets us :-)
2) We will use the name LazyMapLayerProvider for LayersView (rather than the 
name MapItemLayerOld) mostly because we still intend for it to be used
3) We will create a MapNoItemProvider that does not return *any* children - to 
be used as the "default" used by the ProjectItemProviderAdaptorFactory for 
things like the Projects view - this will ensure we don't accidentally load the 
layers (unless the developer is explicitly using some of the implementations 
that uses lazy loading)
4) We will merge in LegendView code (update the DnD code to use legend Items) 
and hook it into MapLegendItemProvider allowing it to list legend items. We 
expect some work is needed on the generated LayerLegendItem provider getText() 
and getIcon() methods.
5) Review docs and submit pull request

--
Jody Garnett


________________________________
The contents of this email are confidential and may be subject to legal or 
professional privilege and copyright. No representation is made that this email 
is free of viruses or other defects. If you have received this communication in 
error, you may not copy or distribute any part of it or otherwise disclose its 
contents to anyone. Please advise the sender of your incorrect receipt of this 
correspondence.
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel

Reply via email to