- java.lang.Object
-
- org.arakhne.afc.gis.primitive.AbstractGISElement<C,T>
-
- org.arakhne.afc.gis.primitive.AbstractBoundedGISElement<GISLayerContainer<?>,MapLayer>
-
- org.arakhne.afc.gis.maplayer.MapLayer
-
- org.arakhne.afc.gis.maplayer.MapElementLayer<RoadPolyline>
-
- org.arakhne.afc.gis.road.layer.RoadNetworkLayer
-
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<RoadPolyline>,EventListener,AttributeChangeListener,AttributeCollection,AttributeProvider,GISElementContainer<RoadPolyline>,BoundedGISElement,GISBrowsable,GISCloneable<MapLayer>,GISContainer<RoadPolyline>,GISContentElement<GISLayerContainer<?>>,GISEditable,GISElement,GISPrimitive,BoundedElement2afp<Rectangle2d>,InformedIterable<RoadPolyline>,JsonableObject
public class RoadNetworkLayer extends MapElementLayer<RoadPolyline>
This class permits to display a road network.- Since:
- 14.0
- Version:
- 17.0 2020-01-04 14:41:55
- Author:
- Olivier LAMOTTE, Stéphane GALLAND
- See Also:
- Serialized Form
- Maven Group Id:
- org.arakhne.afc.gis
- Maven Artifact Id:
- gisroad
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.arakhne.afc.gis.maplayer.MapLayer
MapLayer.SpecialAttributeValue
-
-
Field Summary
-
Fields inherited from class org.arakhne.afc.gis.maplayer.MapElementLayer
ATTR_ELEMENT_ATTRIBUTES_URL, ATTR_ELEMENT_GEOMETRY_PROJECTION, ATTR_ELEMENT_GEOMETRY_URL
-
Fields inherited from class org.arakhne.afc.gis.maplayer.MapLayer
ATTR_CLICKABLE, ATTR_COLOR, ATTR_REMOVABLE, ATTR_USE_CONTAINER_COLOR, ATTR_VISIBLE, listeners
-
Fields inherited from interface org.arakhne.afc.gis.primitive.GISElement
ATTR_NAME, NAME_COMPARATOR
-
Fields inherited from interface org.arakhne.afc.gis.primitive.GISPrimitive
COMPARATOR
-
-
Constructor Summary
Constructors Constructor Description RoadNetworkLayer(UUID id, AttributeCollection attributeProvider, StandardRoadNetwork network)Create a new layer.RoadNetworkLayer(UUID id, StandardRoadNetwork network)Create a new layer.RoadNetworkLayer(AttributeCollection attributeProvider, StandardRoadNetwork network)Create a new layer.RoadNetworkLayer(StandardRoadNetwork network)Create a new layer.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanaddMapElement(RoadPolyline segment)Add a map element inside this container.booleanaddMapElements(Collection<? extends RoadPolyline> segments)Add map elements inside this container.protected Rectangle2dcalcBounds()Compute the bounds of this element.RoadNetworkLayerclone()Clone this object to obtain a valid copy.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.Collection<RoadPolyline>getAllMapElements()Replies the map elements as an array.Rectangle2dgetBoundingBox()Replies the bounding box of this element.Class<? extends RoadPolyline>getElementType()Replies the class of the elements in this iterable object.RoadPolylinegetMapElementAt(int index)Replies the map element at the specified index.intgetMapElementCount()Replies the count of map elements.StringgetName()Replies the name of the element.RoadNetworkgetRoadNetwork()Replies the road network displayed by this layer.Shape2d<?>getShape()Replies the shape of this this element.Iterator<RoadPolyline>iterator()Iterator<RoadPolyline>iterator(Rectangle2afp<?,?,?,?,?,?> bounds)Iterates on the elements that intersect the specified bounds.booleanremoveAllMapElements()Remove all the map elements from this container.booleanremoveMapElement(MapElement segment)Remove a map element from this container.voidsetElementAttributeSourceURL(URL url)Set the URL from which the attributes of the elements in this container were read.voidsetElementGeometrySource(URL url, MapMetricProjection mapProjection)Set the URL from which the geometry of the elements in this container were read.intsize()Replies the count of map elements inside this container.-
Methods inherited from class org.arakhne.afc.gis.maplayer.MapElementLayer
bindChangeListener, fireElementChanged, fireLayerContentChangedEvent, getElementAttributeSourceURL, getElementGeometrySourceProjection, getElementGeometrySourceURL, onMapElementGraphicalAttributeChanged, toJson
-
Methods inherited from class org.arakhne.afc.gis.maplayer.MapLayer
addGISEditableChangeListener, addLayerListener, contains, contains, fireLayerAttributeChangedEvent, fireLayerAttributeChangedEvent, fireLayerContentChangedEvent, fireLayerHierarchyChangedEvent, getColor, getGeoLocation, getListeners, getParentName, getRawColor, indexInParent, intersects, isClickable, isContainerColorUsed, isReadOnlyObject, isRemovable, isTemporaryLayer, isVisible, onAttributeChangeEvent, removeGISEditableChangeListener, removeLayerListener, repaint, resetBoundingBox, setClickable, setColor, setContainer, setContainerColorUse, setReadOnlyObject, setRemovable, setUUID, setVisible, setVisible
-
Methods inherited from class org.arakhne.afc.gis.primitive.AbstractBoundedGISElement
setBoundingBox
-
Methods inherited from class org.arakhne.afc.gis.primitive.AbstractGISElement
addAttributeChangeListener, addAttributes, addAttributes, attributes, copyAttributes, flush, freeMemory, getAllAttributeNames, getAllAttributes, getAllAttributesByType, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttributeAsBool, getAttributeAsDate, getAttributeAsDouble, getAttributeAsEnumeration, getAttributeAsEnumeration, getAttributeAsFloat, getAttributeAsInetAddress, getAttributeAsInt, getAttributeAsJavaClass, getAttributeAsLong, getAttributeAsString, getAttributeAsURI, getAttributeAsURL, getAttributeAsUUID, getAttributeCollection, getAttributeCount, getAttributeObject, getAttributeProvider, getContainer, getGeoId, getTopContainer, getUUID, hasAttribute, hashKey, isEventFirable, removeAllAttributes, removeAttribute, removeAttributeChangeListener, renameAttribute, renameAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributes, setAttributes, setAttributeType, setEventFirable, setName, toMap, toMap, toString
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.arakhne.afc.attrs.collection.AttributeCollection
addAttributeChangeListener, addAttributes, addAttributes, flush, isEventFirable, removeAllAttributes, removeAttribute, removeAttributeChangeListener, renameAttribute, renameAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributes, setAttributes, setAttributeType, setEventFirable
-
Methods inherited from interface org.arakhne.afc.attrs.collection.AttributeProvider
attributes, freeMemory, getAllAttributeNames, getAllAttributes, getAllAttributesByType, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttributeAsBool, getAttributeAsDate, getAttributeAsDouble, getAttributeAsEnumeration, getAttributeAsEnumeration, getAttributeAsFloat, getAttributeAsInetAddress, getAttributeAsInt, getAttributeAsJavaClass, getAttributeAsLong, getAttributeAsString, getAttributeAsURI, getAttributeAsURL, getAttributeAsUUID, getAttributeCount, getAttributeObject, hasAttribute, toMap, toMap
-
Methods inherited from interface org.arakhne.afc.gis.primitive.GISBrowsable
setName
-
Methods inherited from interface org.arakhne.afc.gis.primitive.GISContainer
getColor, resetBoundingBox
-
Methods inherited from interface org.arakhne.afc.gis.primitive.GISContentElement
getContainer, getTopContainer
-
Methods inherited from interface org.arakhne.afc.gis.primitive.GISEditable
setName
-
Methods inherited from interface org.arakhne.afc.gis.primitive.GISElement
copyAttributes, hashKey, setName
-
Methods inherited from interface org.arakhne.afc.gis.primitive.GISPrimitive
getGeoId, getUUID
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
RoadNetworkLayer
public RoadNetworkLayer(StandardRoadNetwork network)
Create a new layer.- Parameters:
network- is the embedded network
-
RoadNetworkLayer
public RoadNetworkLayer(AttributeCollection attributeProvider, StandardRoadNetwork network)
Create a new layer.- Parameters:
attributeProvider- is the attribute collection associated to this layer.network- is the embedded network
-
RoadNetworkLayer
public RoadNetworkLayer(UUID id, StandardRoadNetwork network)
Create a new layer.- Parameters:
id- is the unique identifier of this element, ornullif unknown.network- is the embedded network- Since:
- 4.0
-
RoadNetworkLayer
public RoadNetworkLayer(UUID id, AttributeCollection attributeProvider, StandardRoadNetwork network)
Create a new layer.- Parameters:
id- is the unique identifier of this element, ornullif unknown.attributeProvider- is the attribute collection associated to this layer.network- is the embedded network- Since:
- 4.0
-
-
Method Detail
-
finalize
@Deprecated(since="17.0", forRemoval=true) protected void finalize() throws Throwable
Deprecated, for removal: This API element is subject to removal in a future version.
-
setElementGeometrySource
public void setElementGeometrySource(URL url, MapMetricProjection mapProjection)
Description copied from interface:GISElementContainerSet the URL from which the geometry of the elements in this container were read.Basically, the URL may be the URL of a ESRI Shape file.
- Specified by:
setElementGeometrySourcein interfaceGISElementContainer<RoadPolyline>- Overrides:
setElementGeometrySourcein classMapElementLayer<RoadPolyline>- Parameters:
url- is the URL of the source of the geometry of the elements, ornullif no known source.mapProjection- is the map projection used to describe the data inside the file with the given URL.
-
setElementAttributeSourceURL
public void setElementAttributeSourceURL(URL url)
Description copied from interface:GISElementContainerSet the URL from which the attributes of the elements in this container were read.Basically, the URL may be the URL of a dBase file.
- Specified by:
setElementAttributeSourceURLin interfaceGISElementContainer<RoadPolyline>- Overrides:
setElementAttributeSourceURLin classMapElementLayer<RoadPolyline>- Parameters:
url- is the URL of the source of the attributes of the elements, ornullif no known source.
-
clone
@Pure public RoadNetworkLayer clone()
Description copied from class:MapLayerClone this object to obtain a valid copy.- Specified by:
clonein interfaceAttributeCollection- Specified by:
clonein interfaceAttributeProvider- Specified by:
clonein interfaceGISCloneable<MapLayer>- Specified by:
clonein interfaceGISElement- Overrides:
clonein classMapLayer- Returns:
- a copy
-
getMapElementAt
@Pure public RoadPolyline getMapElementAt(int index)
Description copied from interface:GISElementContainerReplies the map element at the specified index.- Parameters:
index- the index.- Returns:
- the element at the given index
-
getElementType
@Pure public Class<? extends RoadPolyline> getElementType()
Description copied from interface:InformedIterableReplies the class of the elements in this iterable object.- Returns:
- the type of the elements.
-
getRoadNetwork
@Pure public RoadNetwork getRoadNetwork()
Replies the road network displayed by this layer.- Returns:
- the road network displayed by this layer.
-
getBoundingBox
@Pure public Rectangle2d getBoundingBox()
Description copied from interface:BoundedElement2afpReplies the bounding box of this element.- Specified by:
getBoundingBoxin interfaceBoundedElement2afp<Rectangle2d>- Overrides:
getBoundingBoxin classAbstractBoundedGISElement<GISLayerContainer<?>,MapLayer>- Returns:
- the bounding box or
nullif not applicable.
-
getShape
public Shape2d<?> getShape()
Description copied from interface:BoundedGISElementReplies the shape of this this element.The bounding box replied by
BoundedElement2afp.getBoundingBox()encloses the replied shape.- Returns:
- the shape or
nullif not applicable.
-
calcBounds
@Pure protected Rectangle2d calcBounds()
Description copied from class:AbstractBoundedGISElementCompute the bounds of this element. This function does not update the internal attribute replied byAbstractBoundedGISElement.getBoundingBox()- Specified by:
calcBoundsin classAbstractBoundedGISElement<GISLayerContainer<?>,MapLayer>- Returns:
- the bounds
-
getName
@Pure public String getName()
Description copied from interface:GISElementReplies the name of the element.- Specified by:
getNamein interfaceGISContainer<RoadPolyline>- Specified by:
getNamein interfaceGISEditable- Specified by:
getNamein interfaceGISElement- Overrides:
getNamein classAbstractGISElement<GISLayerContainer<?>,MapLayer>- Returns:
- the name
-
size
@Pure public int size()
Description copied from interface:GISContainerReplies the count of map elements inside this container.- Returns:
- the count of map elements inside this container.
-
getAllMapElements
@Pure public Collection<RoadPolyline> getAllMapElements()
Description copied from interface:GISElementContainerReplies the map elements as an array.- Returns:
- all the elements.
-
getMapElementCount
@Pure public int getMapElementCount()
Description copied from interface:GISElementContainerReplies the count of map elements.- Returns:
- the count of map elements.
-
addMapElements
public boolean addMapElements(Collection<? extends RoadPolyline> segments)
Description copied from interface:GISElementContainerAdd map elements inside this container.- Parameters:
segments- the new elements.- Returns:
trueif at least one element was added, otherwisefalse
-
addMapElement
public boolean addMapElement(RoadPolyline segment)
Description copied from interface:GISElementContainerAdd a map element inside this container.- Parameters:
segment- the new element.- Returns:
trueif the element was added successfully, otherwisefalse
-
removeMapElement
public boolean removeMapElement(MapElement segment)
Description copied from interface:GISElementContainerRemove a map element from this container.- Parameters:
segment- the element to remove.- Returns:
trueif the element was removed successfully, otherwisefalse
-
removeAllMapElements
public boolean removeAllMapElements()
Description copied from interface:GISElementContainerRemove all the map elements from this container.- Returns:
trueif container has changed, otherwisefalse
-
iterator
@Pure public Iterator<RoadPolyline> iterator(Rectangle2afp<?,?,?,?,?,?> bounds)
Description copied from interface:GISElementContainerIterates on the elements that intersect the specified bounds.- Parameters:
bounds- is the rectangle inside which the replied elements must be located- Returns:
- an iterator on the map elements.
-
iterator
@Pure public Iterator<RoadPolyline> iterator()
-
-