Hello,
i actually programming a plugin for udig and i found a few problem with the
Featurecollection. at first a little summary of my plugin:
i try to do the following:
//create FeatureType
CoordinateReferenceSystem crs = CRS.decode("EPSG:4326");
AttributeType point =
AttributeTypeFactory.newAttributeType("Location",Point.class,true,
null,null,crs );
AttributeType name = AttributeTypeFactory.newAttributeType("Name",
String.class, false, null, "Station", null);
FeatureType stationFeatureType = FeatureTypeBuilder.newFeatureType(new
AttributeType[] { point, name }, "StationFeatureType");
//create IGeoResource
IGeoResource stationGeoResource =
CatalogPlugin.getDefault().getLocalCatalog().createTemporaryResource(stationFeatureType);
//create list of IGeoResource
List <IGeoResource> geoResourceList = new LinkedList<IGeoResource>();
geoResourceList.add(stationGeoResource);
//create new map
ApplicationGIS.createAndOpenMap(geoResourceList, null, true);
//get the new layer
ILayer stationLayer = null;
List <ILayer> layerList = network.getEditorMap().getMapLayers();
for (ILayer layer: layerList) {
if (layer.getName().compareTo("StationFeatureType") == 0)
stationLayer = layer;
}
//get FeatureSource
FeatureSource stationFeatureSource =
stationLayer.getResource(FeatureSource.class, null);
//get FeatureCollection
FeatureCollection features = stationFeatureSource.getFeatures();
//AFTER all this i create i view wich displays a FeatureTableControl
FeatureTableControl ftc = new FeatureTableControl(parent, features);
some of this commands depends on udig, but the main problems seems to be a
part of the used geotools version.
after i get a editable map with the FeatureCollection "behind", i tried to
add a listener to the FeatureCollection.
features.addListener(a_CollectionListener_implementing_class);
but nothing happens. No CollectionEvent are fired. Never. but there are new
features in the collection.
is this a known problem? is there a workaround?
i hope someone could help me and i am sorry that this description is very
udig dependend.
Thanks foward
Ingmar
--
View this message in context:
http://www.nabble.com/Problem-with-FeatureCollection-and-CollectionListener-tp15493580p15493580.html
Sent from the geotools-gt2-users mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users