- 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 boolean
addMapElement(RoadPolyline segment)
Add a map element inside this container.boolean
addMapElements(Collection<? extends RoadPolyline> segments)
Add map elements inside this container.protected Rectangle2d
calcBounds()
Compute the bounds of this element.RoadNetworkLayer
clone()
Clone this object to obtain a valid copy.protected void
finalize()
Deprecated, for removal: This API element is subject to removal in a future version.Collection<RoadPolyline>
getAllMapElements()
Replies the map elements as an array.Rectangle2d
getBoundingBox()
Replies the bounding box of this element.Class<? extends RoadPolyline>
getElementType()
Replies the class of the elements in this iterable object.RoadPolyline
getMapElementAt(int index)
Replies the map element at the specified index.int
getMapElementCount()
Replies the count of map elements.String
getName()
Replies the name of the element.RoadNetwork
getRoadNetwork()
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.boolean
removeAllMapElements()
Remove all the map elements from this container.boolean
removeMapElement(MapElement segment)
Remove a map element from this container.void
setElementAttributeSourceURL(URL url)
Set the URL from which the attributes of the elements in this container were read.void
setElementGeometrySource(URL url, MapMetricProjection mapProjection)
Set the URL from which the geometry of the elements in this container were read.int
size()
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, ornull
if 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, ornull
if 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:GISElementContainer
Set 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:
setElementGeometrySource
in interfaceGISElementContainer<RoadPolyline>
- Overrides:
setElementGeometrySource
in classMapElementLayer<RoadPolyline>
- Parameters:
url
- is the URL of the source of the geometry of the elements, ornull
if 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:GISElementContainer
Set 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:
setElementAttributeSourceURL
in interfaceGISElementContainer<RoadPolyline>
- Overrides:
setElementAttributeSourceURL
in classMapElementLayer<RoadPolyline>
- Parameters:
url
- is the URL of the source of the attributes of the elements, ornull
if no known source.
-
clone
@Pure public RoadNetworkLayer clone()
Description copied from class:MapLayer
Clone this object to obtain a valid copy.- Specified by:
clone
in interfaceAttributeCollection
- Specified by:
clone
in interfaceAttributeProvider
- Specified by:
clone
in interfaceGISCloneable<MapLayer>
- Specified by:
clone
in interfaceGISElement
- Overrides:
clone
in classMapLayer
- Returns:
- a copy
-
getMapElementAt
@Pure public RoadPolyline getMapElementAt(int index)
Description copied from interface:GISElementContainer
Replies 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:InformedIterable
Replies 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:BoundedElement2afp
Replies the bounding box of this element.- Specified by:
getBoundingBox
in interfaceBoundedElement2afp<Rectangle2d>
- Overrides:
getBoundingBox
in classAbstractBoundedGISElement<GISLayerContainer<?>,MapLayer>
- Returns:
- the bounding box or
null
if not applicable.
-
getShape
public Shape2d<?> getShape()
Description copied from interface:BoundedGISElement
Replies the shape of this this element.The bounding box replied by
BoundedElement2afp.getBoundingBox()
encloses the replied shape.- Returns:
- the shape or
null
if not applicable.
-
calcBounds
@Pure protected Rectangle2d calcBounds()
Description copied from class:AbstractBoundedGISElement
Compute the bounds of this element. This function does not update the internal attribute replied byAbstractBoundedGISElement.getBoundingBox()
- Specified by:
calcBounds
in classAbstractBoundedGISElement<GISLayerContainer<?>,MapLayer>
- Returns:
- the bounds
-
getName
@Pure public String getName()
Description copied from interface:GISElement
Replies the name of the element.- Specified by:
getName
in interfaceGISContainer<RoadPolyline>
- Specified by:
getName
in interfaceGISEditable
- Specified by:
getName
in interfaceGISElement
- Overrides:
getName
in classAbstractGISElement<GISLayerContainer<?>,MapLayer>
- Returns:
- the name
-
size
@Pure public int size()
Description copied from interface:GISContainer
Replies 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:GISElementContainer
Replies the map elements as an array.- Returns:
- all the elements.
-
getMapElementCount
@Pure public int getMapElementCount()
Description copied from interface:GISElementContainer
Replies the count of map elements.- Returns:
- the count of map elements.
-
addMapElements
public boolean addMapElements(Collection<? extends RoadPolyline> segments)
Description copied from interface:GISElementContainer
Add map elements inside this container.- Parameters:
segments
- the new elements.- Returns:
true
if at least one element was added, otherwisefalse
-
addMapElement
public boolean addMapElement(RoadPolyline segment)
Description copied from interface:GISElementContainer
Add a map element inside this container.- Parameters:
segment
- the new element.- Returns:
true
if the element was added successfully, otherwisefalse
-
removeMapElement
public boolean removeMapElement(MapElement segment)
Description copied from interface:GISElementContainer
Remove a map element from this container.- Parameters:
segment
- the element to remove.- Returns:
true
if the element was removed successfully, otherwisefalse
-
removeAllMapElements
public boolean removeAllMapElements()
Description copied from interface:GISElementContainer
Remove all the map elements from this container.- Returns:
true
if container has changed, otherwisefalse
-
iterator
@Pure public Iterator<RoadPolyline> iterator(Rectangle2afp<?,?,?,?,?,?> bounds)
Description copied from interface:GISElementContainer
Iterates 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()
-
-