Package oracle.spatial.network.nfe.model
Class NFEBasicModel
- java.lang.Object
-
- oracle.spatial.network.nfe.model.NFEBasicModel
-
- All Implemented Interfaces:
java.util.EventListener,NFEModelListener,NFEModel
public class NFEBasicModel extends java.lang.Object implements NFEModel, NFEModelListener
The default implementation of NFEModel
-
-
Field Summary
-
Fields inherited from interface oracle.spatial.network.nfe.model.event.NFEModelListener
METHOD_MODEL_OBJECT_ADDED, METHOD_MODEL_OBJECT_REMOVED, METHOD_MODEL_OBJECTS_ADDED, METHOD_MODEL_OBJECTS_REMOVED, METHOD_PROPERTY_CHANGED
-
-
Constructor Summary
Constructors Constructor Description NFEBasicModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFeatureLayer(NFEFeatureLayer featureLayer)Adds a feature layer to the model.voidaddLoadedArea(java.awt.geom.Area area)Adds an area loaded.voidaddModelListener(NFEModelListener listener)Adds a listener to the model.NFEFeatureLayergetAnalysisLayer()Gets a feature layer containing the paths resulting from analysis (if any)NFEEventDispatcher<NFEModelListener>getDispatcher()Gets the event dispatcher used by the model.NFEEditionManagergetEditionManager()Gets the edition manager used by the current modelNFEEditionModegetEditionMode()Gets the edition mode of the current model.intgetFeatureElementsCount(NFENetworkElement networkElement)Gets the number of feature elements associated to a network elementjava.util.Collection<NFEFeatureElement>getFeatureElementsOnNetworkElement(NFENetworkElement networkElement)Gets all the feature elements associated to a network elementjava.util.Collection<NFEFeatureElement>getFeatureElementsOnNetworkElement(NFENetworkElement networkElement, int hierarchyLevel)Gets all the feature elements with the given hierarchy level associated to a network elementNFEFeatureLayergetFeatureLayer(long featureLayerId)Gets a model's feature layer by its id.NFEFeatureLayergetFeatureLayer(java.lang.String featureLayerName)Gets a model's feature layer by its namejava.util.Collection<NFEFeatureLayer>getFeatureLayers()Gets the feature layers of the current model.java.util.Collection<NFEFeature>getFeaturesOnNetworkElement(NFENetworkElement networkElement)Gets all the features containing feature elements associated to the specified network elementNFEGeometryDescriptorgetGeometryDescriptor()Gets the geometry descriptor of the current model.longgetId()Gets the ID of the model.NFEIdManagergetIdManager()Gets the id manager used by the current modeljava.awt.geom.AreagetLoadedArea()Gets the area currently loaded model's content.NFEManipulatorgetManipulator()Gets the manipulator instance which helps to perform some trivial feature-network operations over the model's contentNFEModelMetadatagetMetadata()Gets the metadata of the current model.NFEModelObjectFactorygetModelObjectFactory()Gets the model object factory instance used by the current model.java.lang.StringgetName()Gets the name of the model.NFENetworkgetNetwork()Gets the current model's networkNFERulesModelgetRulesModel()Gets the rules model associated to the current model.NFEIOServiceProvidergetServiceProvider()Gets the service provider used by the model to perform IO operationsNFESpatialModelgetSpatialModel()Gets the spatial model used by the current model to keep track of the spatial positions of its content (network elements and feature elements)NFEWorkspaceInfogetWorkspaceInfo()Gets the workspace manager related data associated to the current modelvoidmodelObjectAdded(NFEModelObjectEvent event)Invoked when a model object has been addedvoidmodelObjectPropertyChanged(NFEModelObjectPropertyChangedEvent event)Invoked when a model object's property has been changedvoidmodelObjectRemoved(NFEModelObjectEvent event)Invoked when a model object has been removedvoidmodelObjectsAdded(NFEModelObjectsEvent event)Invoked when one or more model objects have been addedvoidmodelObjectsRemoved(NFEModelObjectsEvent event)Invoked when one or more model objects have been removedNFEFeatureLayerremoveFeatureLayer(long featureLayerId)Removes a feature layer with specified from the modelvoidremoveModelListener(NFEModelListener listener)Removes a listener from the model.voidsetAnalysisLayer(NFEFeatureLayer analysisFeatureLayer)Sets a feature layer which contains paths from analysis.voidsetEditionManager(NFEEditionManager em)Sets the edition managaer to be used by the current model to track changes made to the model's content.voidsetEventDispatcher(NFEEventDispatcher<NFEModelListener> eventDispatcher)Sets the event dispatcher used by the model to fire model events.voidsetIdManager(NFEIdManager idManager)Sets the id manager used by the current model to assign ids to newly created objectsvoidsetMetadata(NFEModelMetadata metadata)Sets the metadata of the model.voidsetModelObjectFactory(NFEModelObjectFactory moFactory)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.voidsetNetwork(NFENetwork network)Sets a network to the current model.voidsetServiceProvider(NFEIOServiceProvider serviceProvider)Sets the service provider to the current model.voidsetWorkspaceInfo(NFEWorkspaceInfo workspaceInfo)Sets the workspace manager configuration used by the model for IO operations
-
-
-
Method Detail
-
setMetadata
public void setMetadata(NFEModelMetadata metadata)
Description copied from interface:NFEModelSets the metadata of the model. This is typically set automatically when a model is loaded from the database.- Specified by:
setMetadatain interfaceNFEModel- Parameters:
metadata- The current model's metedata
-
getMetadata
public NFEModelMetadata getMetadata()
Description copied from interface:NFEModelGets the metadata of the current model.- Specified by:
getMetadatain interfaceNFEModel- Returns:
- The current model's metedata
-
getId
public long getId()
Description copied from interface:NFEModelGets the ID of the model. The ID is unique across all the models stored for a user in the database.
-
getName
public java.lang.String getName()
Description copied from interface:NFEModelGets the name of the model.
-
getEditionMode
public NFEEditionMode getEditionMode()
Description copied from interface:NFEModelGets the edition mode of the current model. The mode can be FromScratch edition mode or ExistingNetwork edition mode.- Specified by:
getEditionModein interfaceNFEModel- Returns:
- The current model's edition mode
-
getGeometryDescriptor
public NFEGeometryDescriptor getGeometryDescriptor()
Description copied from interface:NFEModelGets the geometry descriptor of the current model. It contains the SRID used by the model along with dimensions' boundaries.- Specified by:
getGeometryDescriptorin interfaceNFEModel- Returns:
- The current model's geometry descriptor
-
setWorkspaceInfo
public void setWorkspaceInfo(NFEWorkspaceInfo workspaceInfo)
Description copied from interface:NFEModelSets the workspace manager configuration used by the model for IO operations- Specified by:
setWorkspaceInfoin interfaceNFEModel- Parameters:
workspaceInfo- Workspace Manager data
-
getWorkspaceInfo
public NFEWorkspaceInfo getWorkspaceInfo()
Description copied from interface:NFEModelGets the workspace manager related data associated to the current model- Specified by:
getWorkspaceInfoin interfaceNFEModel- Returns:
- Workspace Manager data
-
setModelObjectFactory
public void setModelObjectFactory(NFEModelObjectFactory moFactory)
Description copied from interface:NFEModelSets 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:
setModelObjectFactoryin interfaceNFEModel- Parameters:
moFactory- A model object factory instance
-
getModelObjectFactory
public NFEModelObjectFactory getModelObjectFactory()
Description copied from interface:NFEModelGets the model object factory instance used by the current model.- Specified by:
getModelObjectFactoryin interfaceNFEModel- Returns:
- a model object factory instance
-
setIdManager
public void setIdManager(NFEIdManager idManager)
Description copied from interface:NFEModelSets the id manager used by the current model to assign ids to newly created objects- Specified by:
setIdManagerin interfaceNFEModel- Parameters:
idManager- an id manager instance
-
getIdManager
public NFEIdManager getIdManager()
Description copied from interface:NFEModelGets the id manager used by the current model- Specified by:
getIdManagerin interfaceNFEModel- Returns:
- an id manager instance
-
getServiceProvider
public NFEIOServiceProvider getServiceProvider()
Description copied from interface:NFEModelGets the service provider used by the model to perform IO operations- Specified by:
getServiceProviderin interfaceNFEModel- Returns:
- a service provider instance
-
setServiceProvider
public void setServiceProvider(NFEIOServiceProvider serviceProvider)
Description copied from interface:NFEModelSets the service provider to the current model.- Specified by:
setServiceProviderin interfaceNFEModel- Parameters:
serviceProvider- a service provider instance
-
setNetwork
public void setNetwork(NFENetwork network)
Description copied from interface:NFEModelSets 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:
setNetworkin interfaceNFEModel- Parameters:
network- a network instance
-
getNetwork
public NFENetwork getNetwork()
Description copied from interface:NFEModelGets the current model's network- Specified by:
getNetworkin interfaceNFEModel- Returns:
- a not null, possibly empty, network instance
-
addFeatureLayer
public void addFeatureLayer(NFEFeatureLayer featureLayer)
Description copied from interface:NFEModelAdds 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:
addFeatureLayerin interfaceNFEModel- Parameters:
featureLayer- a not null, possibly empty, feature layer instance
-
getFeatureLayers
public java.util.Collection<NFEFeatureLayer> getFeatureLayers()
Description copied from interface:NFEModelGets 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:
getFeatureLayersin interfaceNFEModel- Returns:
- a collection of feature layers.
-
getFeatureLayer
public NFEFeatureLayer getFeatureLayer(long featureLayerId)
Description copied from interface:NFEModelGets a model's feature layer by its id.- Specified by:
getFeatureLayerin interfaceNFEModel- 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:NFEModelGets a model's feature layer by its name- Specified by:
getFeatureLayerin interfaceNFEModel- Returns:
-
removeFeatureLayer
public NFEFeatureLayer removeFeatureLayer(long featureLayerId)
Description copied from interface:NFEModelRemoves a feature layer with specified from the model- Specified by:
removeFeatureLayerin interfaceNFEModel- 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:NFEModelGets 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:
getLoadedAreain interfaceNFEModel- Returns:
- the area of the currently loaded network elements and features
-
addLoadedArea
public void addLoadedArea(java.awt.geom.Area area)
Description copied from interface:NFEModelAdds an area loaded. Typically it is called by the IOServices when content is loaded.- Specified by:
addLoadedAreain interfaceNFEModel- Parameters:
area- the area of a recently loaded model's content
-
getFeatureElementsOnNetworkElement
public java.util.Collection<NFEFeatureElement> getFeatureElementsOnNetworkElement(NFENetworkElement networkElement)
Description copied from interface:NFEModelGets all the feature elements associated to a network element- Specified by:
getFeatureElementsOnNetworkElementin interfaceNFEModel- 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:NFEModelGets all the feature elements with the given hierarchy level associated to a network element- Specified by:
getFeatureElementsOnNetworkElementin interfaceNFEModel- Parameters:
networkElement- a network element from the model's networkhierarchyLevel- 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:NFEModelGets the number of feature elements associated to a network element- Specified by:
getFeatureElementsCountin interfaceNFEModel- 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:NFEModelGets all the features containing feature elements associated to the specified network element- Specified by:
getFeaturesOnNetworkElementin interfaceNFEModel- 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:NFEModelSets 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:
setEditionManagerin interfaceNFEModel- Parameters:
em- an edition manager instance
-
getEditionManager
public NFEEditionManager getEditionManager()
Description copied from interface:NFEModelGets the edition manager used by the current model- Specified by:
getEditionManagerin interfaceNFEModel- Returns:
- an edition manager instance
-
setEventDispatcher
public void setEventDispatcher(NFEEventDispatcher<NFEModelListener> eventDispatcher)
Description copied from interface:NFEModelSets 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:
setEventDispatcherin interfaceNFEModel- Parameters:
eventDispatcher- an event dispatcher instance
-
getDispatcher
public NFEEventDispatcher<NFEModelListener> getDispatcher()
Description copied from interface:NFEModelGets the event dispatcher used by the model.- Specified by:
getDispatcherin interfaceNFEModel- Returns:
- an even dispatcher instance or null if it was removed.
-
modelObjectAdded
public void modelObjectAdded(NFEModelObjectEvent event)
Description copied from interface:NFEModelListenerInvoked when a model object has been added- Specified by:
modelObjectAddedin interfaceNFEModelListener- Parameters:
event- contains a reference to the model object that has been added
-
modelObjectsAdded
public void modelObjectsAdded(NFEModelObjectsEvent event)
Description copied from interface:NFEModelListenerInvoked when one or more model objects have been added- Specified by:
modelObjectsAddedin interfaceNFEModelListener- Parameters:
event- contains a collection of references to the model objects that have been added
-
modelObjectRemoved
public void modelObjectRemoved(NFEModelObjectEvent event)
Description copied from interface:NFEModelListenerInvoked when a model object has been removed- Specified by:
modelObjectRemovedin interfaceNFEModelListener- Parameters:
event- contains a reference to the model object that has been removed
-
modelObjectsRemoved
public void modelObjectsRemoved(NFEModelObjectsEvent event)
Description copied from interface:NFEModelListenerInvoked when one or more model objects have been removed- Specified by:
modelObjectsRemovedin interfaceNFEModelListener- Parameters:
event- contains a collection of references to the model objects that have been removed
-
modelObjectPropertyChanged
public void modelObjectPropertyChanged(NFEModelObjectPropertyChangedEvent event)
Description copied from interface:NFEModelListenerInvoked when a model object's property has been changed- Specified by:
modelObjectPropertyChangedin interfaceNFEModelListener- Parameters:
event- contains a reference to the model objects which property has been changed and the name and previous value of the changed property
-
getAnalysisLayer
public NFEFeatureLayer getAnalysisLayer()
Description copied from interface:NFEModelGets a feature layer containing the paths resulting from analysis (if any)- Specified by:
getAnalysisLayerin interfaceNFEModel- Returns:
- a feature layer instance
-
setAnalysisLayer
public void setAnalysisLayer(NFEFeatureLayer analysisFeatureLayer)
Description copied from interface:NFEModelSets a feature layer which contains paths from analysis.- Specified by:
setAnalysisLayerin interfaceNFEModel- Parameters:
analysisFeatureLayer- a feature layer instance
-
addModelListener
public void addModelListener(NFEModelListener listener)
Description copied from interface:NFEModelAdds 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:
addModelListenerin interfaceNFEModel- Parameters:
listener- a model listener instance
-
removeModelListener
public void removeModelListener(NFEModelListener listener)
Description copied from interface:NFEModelRemoves a listener from the model. It is also removed from the network and feature layers.- Specified by:
removeModelListenerin interfaceNFEModel- Parameters:
listener- a model listener instance
-
getSpatialModel
public NFESpatialModel getSpatialModel()
Description copied from interface:NFEModelGets 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:
getSpatialModelin interfaceNFEModel- Returns:
- a spatial model instance
-
getManipulator
public NFEManipulator getManipulator()
Description copied from interface:NFEModelGets the manipulator instance which helps to perform some trivial feature-network operations over the model's content- Specified by:
getManipulatorin interfaceNFEModel- Returns:
- a manipulator instance
-
getRulesModel
public NFERulesModel getRulesModel()
Description copied from interface:NFEModelGets 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:
getRulesModelin interfaceNFEModel- Returns:
- a rules model instance
-
-