Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] Problem with FeatureCollection, FeatureTableControl and CollectionListener

Ingmar Eveslage wrote:
All seams fine, but i notices a few problems:

1) the automatic created column header for the AttributeType point is
"GEOMETRY". but i defined it as "Location". The first thing is a
nullPointerException if the FeatureTableControl wants to display a feature.
When i change the name of my attributetype to "GEOMETRY" all is fine. But i
think this is a bug.
Interesting - that comes down to the data store used behind this method:
- CatalogPlugin.getDefault().getLocalCatalog().createTemporaryResource(stationFeatureType);

In general you should *not* trust the feature type to appear exactly as you asked for; different data store implementations have different abilities. Please grab the featureType from the created data store. One fork of GeoTools made use a of a seperate FeatureDefinition class for this purpose; to make what was going on more clear. That said we are making use of MemoryDataStore as far as I know and it should not force you to use GEOMETRY.
2) if i add features to the layer, no updates in the table will be
displayed.
How are you adding the features: FeatureStore.addFeatures( ... ) - and if so you using a Transaction?
and i do not realy know which listener i should take. i tried the following:
every implementation of the changed method makes a tfc.update.

stationFeatureSource.addFeatureListener(view_i_created);
	--> all updates are listed in the table, but the commit of the station
layer makes no update. so all the FID are still "new*" and not the real one
features.addListener(view_i_created);
That sounds like a bug; note that you should be on a Transaction for this stuff and get a single "stuff changed" event out when the
transaction is committed.
	--> nothing happens. no CollectionEvent fired

i looked in the FeatureTableControl implementation and i think this
implementation uses the CollectionListener interface too. but when no
CollectionEvents are fired, no updates are displayed.
Okay sounds like a raft of bugs to report to the GeoTools project here...
i hope someone can help me with my 2 problem. perhaps this are bugs or do i missunderstand the api?
Your understanding is fine; GeoTools is used a lot by server applications (cough GeoServer) and client applications like uDig are the only people who care about events...
Jody


Back to the top