Class NFEBasicModel

    • Constructor Detail

      • NFEBasicModel

        public NFEBasicModel()
    • Method Detail

      • setMetadata

        public void setMetadata​(NFEModelMetadata metadata)
        Description copied from interface: NFEModel
        Sets the metadata of the model. This is typically set automatically when a model is loaded from the database.
        Specified by:
        setMetadata in interface NFEModel
        Parameters:
        metadata - The current model's metedata
      • getMetadata

        public NFEModelMetadata getMetadata()
        Description copied from interface: NFEModel
        Gets the metadata of the current model.
        Specified by:
        getMetadata in interface NFEModel
        Returns:
        The current model's metedata
      • getId

        public long getId()
        Description copied from interface: NFEModel
        Gets the ID of the model. The ID is unique across all the models stored for a user in the database.
        Specified by:
        getId in interface NFEModel
        Returns:
        The current model's ID
      • getName

        public java.lang.String getName()
        Description copied from interface: NFEModel
        Gets the name of the model.
        Specified by:
        getName in interface NFEModel
        Returns:
        The current model's name
      • getEditionMode

        public NFEEditionMode getEditionMode()
        Description copied from interface: NFEModel
        Gets the edition mode of the current model. The mode can be FromScratch edition mode or ExistingNetwork edition mode.
        Specified by:
        getEditionMode in interface NFEModel
        Returns:
        The current model's edition mode
      • getGeometryDescriptor

        public NFEGeometryDescriptor getGeometryDescriptor()
        Description copied from interface: NFEModel
        Gets the geometry descriptor of the current model. It contains the SRID used by the model along with dimensions' boundaries.
        Specified by:
        getGeometryDescriptor in interface NFEModel
        Returns:
        The current model's geometry descriptor
      • setWorkspaceInfo

        public void setWorkspaceInfo​(NFEWorkspaceInfo workspaceInfo)
        Description copied from interface: NFEModel
        Sets the workspace manager configuration used by the model for IO operations
        Specified by:
        setWorkspaceInfo in interface NFEModel
        Parameters:
        workspaceInfo - Workspace Manager data
      • getWorkspaceInfo

        public NFEWorkspaceInfo getWorkspaceInfo()
        Description copied from interface: NFEModel
        Gets the workspace manager related data associated to the current model
        Specified by:
        getWorkspaceInfo in interface NFEModel
        Returns:
        Workspace Manager data
      • setModelObjectFactory

        public void setModelObjectFactory​(NFEModelObjectFactory moFactory)
        Description copied from interface: NFEModel
        Sets the model object factory which will be used by the model to create new instances of model objects such as nodes, links, features and all the elements that are associated to the model. A default instance of model object factory is set automatically when a model is created or loaded.
        Specified by:
        setModelObjectFactory in interface NFEModel
        Parameters:
        moFactory - A model object factory instance
      • getModelObjectFactory

        public NFEModelObjectFactory getModelObjectFactory()
        Description copied from interface: NFEModel
        Gets the model object factory instance used by the current model.
        Specified by:
        getModelObjectFactory in interface NFEModel
        Returns:
        a model object factory instance
      • setIdManager

        public void setIdManager​(NFEIdManager idManager)
        Description copied from interface: NFEModel
        Sets the id manager used by the current model to assign ids to newly created objects
        Specified by:
        setIdManager in interface NFEModel
        Parameters:
        idManager - an id manager instance
      • getIdManager

        public NFEIdManager getIdManager()
        Description copied from interface: NFEModel
        Gets the id manager used by the current model
        Specified by:
        getIdManager in interface NFEModel
        Returns:
        an id manager instance
      • getServiceProvider

        public NFEIOServiceProvider getServiceProvider()
        Description copied from interface: NFEModel
        Gets the service provider used by the model to perform IO operations
        Specified by:
        getServiceProvider in interface NFEModel
        Returns:
        a service provider instance
      • setServiceProvider

        public void setServiceProvider​(NFEIOServiceProvider serviceProvider)
        Description copied from interface: NFEModel
        Sets the service provider to the current model.
        Specified by:
        setServiceProvider in interface NFEModel
        Parameters:
        serviceProvider - a service provider instance
      • setNetwork

        public void setNetwork​(NFENetwork network)
        Description copied from interface: NFEModel
        Sets a network to the current model. Typically a network is automatically set when a model is created or loaded using IOServices through the service provider. The network may not contain nodes or links if the content has not been added or loaded from the database.
        Specified by:
        setNetwork in interface NFEModel
        Parameters:
        network - a network instance
      • getNetwork

        public NFENetwork getNetwork()
        Description copied from interface: NFEModel
        Gets the current model's network
        Specified by:
        getNetwork in interface NFEModel
        Returns:
        a not null, possibly empty, network instance
      • addFeatureLayer

        public void addFeatureLayer​(NFEFeatureLayer featureLayer)
        Description copied from interface: NFEModel
        Adds a feature layer to the model. A feature layer instance usually is added automatically when it is created using IOServices through the service provider
        Specified by:
        addFeatureLayer in interface NFEModel
        Parameters:
        featureLayer - a not null, possibly empty, feature layer instance
      • getFeatureLayers

        public java.util.Collection<NFEFeatureLayer> getFeatureLayers()
        Description copied from interface: NFEModel
        Gets the feature layers of the current model. The feature layers may not contain features if content has not be added or loaded from the database.
        Specified by:
        getFeatureLayers in interface NFEModel
        Returns:
        a collection of feature layers.
      • getFeatureLayer

        public NFEFeatureLayer getFeatureLayer​(long featureLayerId)
        Description copied from interface: NFEModel
        Gets a model's feature layer by its id.
        Specified by:
        getFeatureLayer in interface NFEModel
        Parameters:
        featureLayerId - a feature layer id
        Returns:
        a feature layer instance contained in the model. Null otherwise
      • getFeatureLayer

        public NFEFeatureLayer getFeatureLayer​(java.lang.String featureLayerName)
        Description copied from interface: NFEModel
        Gets a model's feature layer by its name
        Specified by:
        getFeatureLayer in interface NFEModel
        Returns:
      • removeFeatureLayer

        public NFEFeatureLayer removeFeatureLayer​(long featureLayerId)
        Description copied from interface: NFEModel
        Removes a feature layer with specified from the model
        Specified by:
        removeFeatureLayer in interface NFEModel
        Parameters:
        featureLayerId - a feature layer id
        Returns:
        the removed feature layer instance if it was contained in the model. Null otherwise
      • getLoadedArea

        public java.awt.geom.Area getLoadedArea()
        Description copied from interface: NFEModel
        Gets the area currently loaded model's content. Model's content is all the network elements and features loaded into memory. The model should have loaded at least, the content lying into the loaded area. Additionally, a model could have boundary content loaded and other content loaded an analysis
        Specified by:
        getLoadedArea in interface NFEModel
        Returns:
        the area of the currently loaded network elements and features
      • addLoadedArea

        public void addLoadedArea​(java.awt.geom.Area area)
        Description copied from interface: NFEModel
        Adds an area loaded. Typically it is called by the IOServices when content is loaded.
        Specified by:
        addLoadedArea in interface NFEModel
        Parameters:
        area - the area of a recently loaded model's content
      • getFeatureElementsOnNetworkElement

        public java.util.Collection<NFEFeatureElement> getFeatureElementsOnNetworkElement​(NFENetworkElement networkElement)
        Description copied from interface: NFEModel
        Gets all the feature elements associated to a network element
        Specified by:
        getFeatureElementsOnNetworkElement in interface NFEModel
        Parameters:
        networkElement - a network element from the model's network
        Returns:
        a collection of feature elements associated to the network element. Null or empty collection if the network element does not contain feature elements.
      • getFeatureElementsOnNetworkElement

        public java.util.Collection<NFEFeatureElement> getFeatureElementsOnNetworkElement​(NFENetworkElement networkElement,
                                                                                          int hierarchyLevel)
        Description copied from interface: NFEModel
        Gets all the feature elements with the given hierarchy level associated to a network element
        Specified by:
        getFeatureElementsOnNetworkElement in interface NFEModel
        Parameters:
        networkElement - a network element from the model's network
        hierarchyLevel - the hierarchy level of the returned feature elements
        Returns:
        a collection of feature elements associated to the network element. Null or empty collection if the network element does not contain feature elements with the given hierarchy level.
      • getFeatureElementsCount

        public int getFeatureElementsCount​(NFENetworkElement networkElement)
        Description copied from interface: NFEModel
        Gets the number of feature elements associated to a network element
        Specified by:
        getFeatureElementsCount in interface NFEModel
        Parameters:
        networkElement - a network element from the model's network
        Returns:
        the number of feature elements associated to the network element
      • getFeaturesOnNetworkElement

        public java.util.Collection<NFEFeature> getFeaturesOnNetworkElement​(NFENetworkElement networkElement)
        Description copied from interface: NFEModel
        Gets all the features containing feature elements associated to the specified network element
        Specified by:
        getFeaturesOnNetworkElement in interface NFEModel
        Parameters:
        networkElement - a network element from the model's network
        Returns:
        a collection of features. Null or empty collection if the network element does not contain feature elements
      • setEditionManager

        public void setEditionManager​(NFEEditionManager em)
        Description copied from interface: NFEModel
        Sets the edition managaer to be used by the current model to track changes made to the model's content. An instance is set by default when the model is created or loaded through the IOServices.
        Specified by:
        setEditionManager in interface NFEModel
        Parameters:
        em - an edition manager instance
      • getEditionManager

        public NFEEditionManager getEditionManager()
        Description copied from interface: NFEModel
        Gets the edition manager used by the current model
        Specified by:
        getEditionManager in interface NFEModel
        Returns:
        an edition manager instance
      • setEventDispatcher

        public void setEventDispatcher​(NFEEventDispatcher<NFEModelListener> eventDispatcher)
        Description copied from interface: NFEModel
        Sets the event dispatcher used by the model to fire model events. An instance is set by default when the model is created or loaded through the IOServices. If the event dispatcher is set to null, no events will be reported.
        Specified by:
        setEventDispatcher in interface NFEModel
        Parameters:
        eventDispatcher - an event dispatcher instance
      • modelObjectsAdded

        public void modelObjectsAdded​(NFEModelObjectsEvent event)
        Description copied from interface: NFEModelListener
        Invoked when one or more model objects have been added
        Specified by:
        modelObjectsAdded in interface NFEModelListener
        Parameters:
        event - contains a collection of references to the model objects that have been added
      • modelObjectsRemoved

        public void modelObjectsRemoved​(NFEModelObjectsEvent event)
        Description copied from interface: NFEModelListener
        Invoked when one or more model objects have been removed
        Specified by:
        modelObjectsRemoved in interface NFEModelListener
        Parameters:
        event - contains a collection of references to the model objects that have been removed
      • getAnalysisLayer

        public NFEFeatureLayer getAnalysisLayer()
        Description copied from interface: NFEModel
        Gets a feature layer containing the paths resulting from analysis (if any)
        Specified by:
        getAnalysisLayer in interface NFEModel
        Returns:
        a feature layer instance
      • setAnalysisLayer

        public void setAnalysisLayer​(NFEFeatureLayer analysisFeatureLayer)
        Description copied from interface: NFEModel
        Sets a feature layer which contains paths from analysis.
        Specified by:
        setAnalysisLayer in interface NFEModel
        Parameters:
        analysisFeatureLayer - a feature layer instance
      • addModelListener

        public void addModelListener​(NFEModelListener listener)
        Description copied from interface: NFEModel
        Adds a listener to the model. The listener will be notified about every event in the model, network and feature layers contained in the model.
        Specified by:
        addModelListener in interface NFEModel
        Parameters:
        listener - a model listener instance
      • removeModelListener

        public void removeModelListener​(NFEModelListener listener)
        Description copied from interface: NFEModel
        Removes a listener from the model. It is also removed from the network and feature layers.
        Specified by:
        removeModelListener in interface NFEModel
        Parameters:
        listener - a model listener instance
      • getSpatialModel

        public NFESpatialModel getSpatialModel()
        Description copied from interface: NFEModel
        Gets the spatial model used by the current model to keep track of the spatial positions of its content (network elements and feature elements)
        Specified by:
        getSpatialModel in interface NFEModel
        Returns:
        a spatial model instance
      • getManipulator

        public NFEManipulator getManipulator()
        Description copied from interface: NFEModel
        Gets the manipulator instance which helps to perform some trivial feature-network operations over the model's content
        Specified by:
        getManipulator in interface NFEModel
        Returns:
        a manipulator instance
      • getRulesModel

        public NFERulesModel getRulesModel()
        Description copied from interface: NFEModel
        Gets the rules model associated to the current model. The rules model contains information of all the rule definitions and rules instances of the current model.
        Specified by:
        getRulesModel in interface NFEModel
        Returns:
        a rules model instance