[udig-devel] Adding a feature to a layer won't result in an
EventType.EDIT_EVENT
Jesse Eichar
jeichar at refractions.net
Mon Dec 17 08:45:14 PST 2007
I'll spend some time today trying to fix this issue. It is a critical
issue.
Jesse
On 17-Dec-07, at 4:45 AM, tony.roth at GMX.de wrote:
> Hi Jesse,
>
> we tried your solution using
> layer.getResource( FeatureSource.class, monitor).addFeatureListener();
> but it doesn't work. The added listener is never (!) triggered.
> Neither on adding a feature nor on removing. We used also
> FeatureStore.class as Resource and it also didn't work.
> BTW: The added ILayerListener gets only one event: After adding the
> second, third, ... polygon it gets a FILTER event.
>
> Since in RC8 all this stuff worked I think there is a general
> problem that new features aren't committed on doubleclick (adding
> the last vertex).
>
> You mentioned in another mail that perhaps we're creating our map
> incorrectly or that our layers aren't correctly added to the map.
> Could you check the source code I wrote last week if there's
> anything wrong?
>
> thanks again,
> tony roth
> my mail from last wednesday:
>
> ------------------------------
> Hi,
> this is the way I create the map and add some layers:
> // we never save a project or reuse it.
> Project udigProject =
> ProjectPlugin.getPlugin().getProjectRegistry().getDefaultProject();
> Map map = ProjectFactory.eINSTANCE.createMap(udigProject,"myMap",new
> ArrayList<Layer>());
> ..
> // creating temporary resource / layer with:
> CatalogPlugin
> .getDefault
> ().getLocalCatalog().createTemporaryResource(myFeatureType);
> ...
> map
> .sendCommandSync
> (BasicCommandFactory.getInstance().createAddManyLayers(layerList));
> as I wrote: no problems with RC8 but with RC12 exceptions when
> closing mapEditor and when adding features with PolygonTool to a
> polygon layer. Programmatically added features to a LINE or POINT
> layer generate no exceptions.
> If you need some more code, just write me an email.
>
> ------------------------------
>
>
> -----udig-devel-bounces at lists.refractions.net schrieb: -----
>
> Hi Tony.
>
> What you are doing is supposed to work. I will put this on my list
> of things to look at. But until then you can add a listener to the
> FeatureStore:
>
> layer.getResource( FeatureSource.class, monitor).addFeatureListener();
>
> Jesse
>
> On 7-Dec-07, at 12:44 AM, tony.roth at GMX.de wrote:
>
>> Hi list,
>> we want to upgrade our application >from eclipse 3.2 to 3.3 which
>> means that we also have to upgrade udig. We're using 1.1RC8 and
>> know we have to change to RC12.
>> One of our layers is a temporary layer containing polygon features.
>> It's necessary to catch programatically events when the user adds a
>> polygon using the polygon tool.
>> For this we add an ILayerListener to this layer and in
>> refresh(LayerEvent event) we catch the events with
>> EventType.EDIT_EVENT. In RC8 this works fine but in RC12 (and I
>> think I tried it once with RC11) this doesn't work.
>> Is this a known bug?
>> Are there other possibilities to be informed if a new feature has
>> been added without modifying udig classes?
>> Thank you,
>> tony roth
>> _______________________________________________
>> User-friendly Desktop Internet GIS (uDig)
>> http://udig.refractions.net
>> http://lists.refractions.net/mailman/listinfo/udig-devel
>
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel
>
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.refractions.net/pipermail/udig-devel/attachments/20071217/1de9b91d/attachment-0001.html
More information about the udig-devel
mailing list