Class NFEFeatureLayer

  • Direct Known Subclasses:
    NFEBasicFeatureLayer

    public abstract class NFEFeatureLayer
    extends java.lang.Object
    This class represents a feature layer in memory. A feature layer is a first level model object which is directly contained in an NFEModel instance and is related with one network instance. A feature layer contains zero to many features and one to many feature class definitions. Any user intersected on receiving notifications about changes in the feature layer or objects contained in the feature layer must be added as a model listener.
    • Field Detail

      • PROP_Z_ORDER

        public static final java.lang.String PROP_Z_ORDER
        Z order property
        See Also:
        Constant Field Values
    • Constructor Detail

      • NFEFeatureLayer

        public NFEFeatureLayer()
    • Method Detail

      • setId

        public abstract void setId​(long id)
        Sets the ID of the feature layer
        Parameters:
        id - the feature layer's ID
      • getId

        public abstract long getId()
        Gets the id of the feature layer
        Returns:
        the feature layer's ID
      • setName

        public abstract void setName​(java.lang.String name)
        Sets the name of the feature layer
        Parameters:
        name - the feature layer's name
      • getName

        public abstract java.lang.String getName()
        Gets the name of the feature layer
        Returns:
        the feature layer's name
      • setNetwork

        public abstract void setNetwork​(NFENetwork network)
        Sets the feature layer's network
        Parameters:
        network - a network instance
      • getNetwork

        public abstract NFENetwork getNetwork()
        Gets the feature layer's network
        Returns:
        a network instance
      • getMetadata

        public abstract NFEFeatureLayerMetadata getMetadata()
        Gets the feature layer's metadata
        Returns:
        the feature layer's metadata
      • setMetadata

        public abstract void setMetadata​(NFEFeatureLayerMetadata metadata)
        Sets the feature layer's metadata
        Parameters:
        metadata - the feature layer's metadata
      • setZOrder

        public abstract void setZOrder​(int zOrder)
        Sets the Z order for the feature layer. The Z order can be used by a renderer to determine the sequence the Feature Layers should be rendered.
        Parameters:
        zOrder - Z order value
      • getZOrder

        public abstract int getZOrder()
        Gets the Z order of the feature layer
        Returns:
        Z order value
      • setEventDispatcher

        public abstract void setEventDispatcher​(NFEEventDispatcher<NFEModelListener> eventDispatcher)
        Sets the event dispatcher.
        Parameters:
        eventDispatcher - event dispatcher
      • getHierarchyLevel

        public abstract int getHierarchyLevel()
        Gets the hierarchy level of the feature layer
        Returns:
        the feature layer's hierarchy level
      • setHierarchyLevel

        public abstract void setHierarchyLevel​(int hierarchyLevel)
        Sets the Hierarchy Level of the feature layer
        Parameters:
        hierarchyLevel - the feature layer's hierarchy level
      • getAttributeDescriptors

        public abstract java.util.Collection<NFEAttributeDescriptor> getAttributeDescriptors()
        Gets all the attribute descriptors of the feature layer
        Returns:
        a collection containing all the feature layer's attribute descriptors
      • getAttributeDescriptor

        public abstract NFEAttributeDescriptor getAttributeDescriptor​(java.lang.String attrName)
        Gets the attribute descriptor for the given attribute's name
        Parameters:
        attrName - a name of a feature layer's attribute
        Returns:
        an attribute descriptor instance
      • addAttributeDescriptor

        public abstract void addAttributeDescriptor​(NFEAttributeDescriptor attrDescriptor)
        Sets an attribute descriptor for the given attribute's name
        Parameters:
        attrDescriptor - an attribute descriptor instance
      • removeAttributeDescriptor

        public abstract NFEAttributeDescriptor removeAttributeDescriptor​(java.lang.String attrName)
        Removes the attribute descriptor with the given attribute's name
        Parameters:
        attrName - a name of a feature layer's attribute
        Returns:
        an instance of an attribute descriptor or null if the feature layer does not contain such attribute
      • getFeatures

        public abstract java.util.Collection<NFEFeature> getFeatures()
        Gets all the features in the feature layer.
        Returns:
        a collection containing features
      • getFeatures

        public abstract java.util.Collection<NFEFeature> getFeatures​(long featureClassId)
        Gets all the features with the given Feature Class in the Feature Layer.
        Parameters:
        featureClassId -
        Returns:
      • addFeature

        public abstract boolean addFeature​(NFEFeature feature)
        Adds a feature to the feature layer.
        Parameters:
        feature - a feature instance
      • containsFeature

        public abstract boolean containsFeature​(NFEFeature feature)
        Tells whether the feature layer contains the given feature
        Parameters:
        feature - a feature instance
        Returns:
        true if the feature layer contains the feature
      • getFeature

        public abstract NFEFeature getFeature​(long featureId)
        Gets a feature identified by the given ID contained in the feature layer
        Parameters:
        featureId - a feature ID
        Returns:
        a feature instance or null if the feature was not found
      • removeFeature

        public abstract NFEFeature removeFeature​(long featureId)
        Removes a feature identified by the given ID from the feature layer
        Parameters:
        featureId - a feature ID
        Returns:
        the removed feature instance or null if the feature could not be removed or was not found
      • getFeatureClasses

        public abstract java.util.Collection<NFEFeatureClass> getFeatureClasses()
        Gets the feature classes defined for this feature layer
        Returns:
        a collection of feature classes
      • getFeatureClass

        public abstract NFEFeatureClass getFeatureClass​(long featureClassId)
        Gets a feature class which belongs on this feature layer.
        Parameters:
        featureClassId - a feature class ID
        Returns:
        a feature class instance or null if the feature class was not found
      • addFeatureClass

        public abstract boolean addFeatureClass​(NFEFeatureClass featureClass)
        Adds a Feature Class instance to the Feature Layer. A Feature Class must only be related to one Feature Layer
        Parameters:
        featureClass - a feature class instance
      • removeFeatureClass

        public abstract NFEFeatureClass removeFeatureClass​(long featureClassId)
        Removes a feature class identified by the given ID from the feature layer
        Parameters:
        featureClassId -
        Returns:
        the removed feature class or null if it could be removed or was not found
      • getFeatureClasses

        public abstract java.util.Collection<NFEFeatureClass> getFeatureClasses​(NFEFeatureShape shape)
        Gets all the feature classes matching the given shape from the feature layer
        Parameters:
        shape - a feature shape type
        Returns:
        a collection of feature class instances
      • addModelListener

        public abstract void addModelListener​(NFEModelListener listener)
      • removeModelListener

        public abstract void removeModelListener​(NFEModelListener listener)
      • notifyPropertyChanged

        protected abstract void notifyPropertyChanged​(java.lang.Object modelObject,
                                                      java.lang.String propertyName,
                                                      java.lang.Object previousValue)
      • notifyModelObjectAdded

        protected abstract void notifyModelObjectAdded​(java.lang.Object modelObject)
      • notifyModelObjectsAdded

        protected abstract <T> void notifyModelObjectsAdded​(java.util.Collection<T> modelObjects,
                                                            java.lang.Class<T> modelObjectsClass)
      • notifyModelObjectRemoved

        protected abstract void notifyModelObjectRemoved​(java.lang.Object modelObject)
      • notifyModelObjectsRemoved

        protected abstract <T> void notifyModelObjectsRemoved​(java.util.Collection<T> modelObjects,
                                                              java.lang.Class<T> modelObjectsClass)
      • createCopy

        public abstract NFEFeatureLayer createCopy()
        Returns object copy.
        Returns:
        object copy