public SubFeatureState( FeatureCollection collection, FeatureCollection sub ){ super( sub ); this.collection = collection; collection.addListener( listener ); }
public void addListener(CollectionListener listener) throws NullPointerException { delegate.addListener( listener ); }
/** * Adds a listener for collection events. * * @param listener The listener to add */ public void addListener(CollectionListener listener) { collection.addListener( listener ); }
public void addListener(CollectionListener listener) throws NullPointerException { delegate.addListener(listener); }
public void addListener(CollectionListener listener) throws NullPointerException { delegate.addListener(listener); }
public void addListener(CollectionListener listener) throws NullPointerException { collection.addListener(listener); }
public void addListener(CollectionListener listener) throws NullPointerException { delegate.addListener( listener ); }
public void addListener(CollectionListener listener) throws NullPointerException { delegate.addListener( listener ); }
/** * Builds a data store wrapper around an empty collection. * * @param collection */ public CollectionDataStore(SimpleFeatureType schema) { this.collection = FeatureCollections.newCollection(); this.featureType = schema; collection.addListener(new FeatureCollectionListener()); }
/** * Constructs a new vector data node for the given feature collection. * * @param name The node name. * @param featureCollection A feature collection. * @param placemarkDescriptor The placemark descriptor * @throws IllegalArgumentException if the given name is not a valid node identifier */ public VectorDataNode(String name, FeatureCollection<SimpleFeatureType, SimpleFeature> featureCollection, PlacemarkDescriptor placemarkDescriptor) { super(name, ""); this.featureType = featureCollection.getSchema(); this.featureCollection = featureCollection; this.featureCollectionListener = new CollectionListener() { @Override public void collectionChanged(CollectionEvent tce) { if (tce.getEventType() == CollectionEvent.FEATURES_ADDED) { fireFeaturesAdded(tce.getFeatures()); } else if (tce.getEventType() == CollectionEvent.FEATURES_REMOVED) { fireFeaturesRemoved(tce.getFeatures()); } else if (tce.getEventType() == CollectionEvent.FEATURES_CHANGED) { fireFeaturesChanged(tce.getFeatures()); } } }; this.featureCollection.addListener(featureCollectionListener); this.defaultStyleCss = String.format(DEFAULT_STYLE_FORMAT, FILL_COLORS[(fillColorIndex++) % FILL_COLORS.length]); this.placemarkDescriptor = placemarkDescriptor; Debug.trace(String.format("VectorDataNode created: name=%s, featureType.typeName=%s, placemarkDescriptor.class=%s", name, featureType.getTypeName(), placemarkDescriptor.getClass())); }
/** * Builds a data store wrapper on top of a feature collection * * @param collection */ public CollectionDataStore(FeatureCollection<SimpleFeatureType,SimpleFeature> collection) { this.collection = collection; if (collection.size() == 0) { this.featureType = FeatureTypes.EMPTY; } else { this.featureType = collection.getSchema(); // Iterator iter = null; // try { // iter = collection.iterator(); // this.featureType = ((SimpleFeature) iter.next()).getFeatureType(); // } finally { // if (iter != null) // collection.close(iter); // } } collection.addListener(new FeatureCollectionListener()); }
/** * Builds a data store wrapper on top of a feature collection * * @param collection */ public CollectionDataStore(FeatureCollection collection) { this.collection = collection; if (collection.size() == 0) { this.featureType = DefaultFeatureType.EMPTY; } else { Iterator iter = null; try { iter = collection.iterator(); this.featureType = ((Feature) iter.next()).getFeatureType(); } finally { if (iter != null) collection.close(iter); } } collection.addListener(new FeatureCollectionListener()); }