Module org.arakhne.afc.gis.giscore
Package org.arakhne.afc.gis.maplayer
Class MapElementLayer<E extends MapElement>
- 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<E>
-
- Type Parameters:
E
- is the type of the elements inside this layer.
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<E>
,EventListener
,AttributeChangeListener
,AttributeCollection
,AttributeProvider
,GISElementContainer<E>
,BoundedGISElement
,GISBrowsable
,GISCloneable<MapLayer>
,GISContainer<E>
,GISContentElement<GISLayerContainer<?>>
,GISEditable
,GISElement
,GISPrimitive
,BoundedElement2afp<Rectangle2d>
,InformedIterable<E>
,JsonableObject
- Direct Known Subclasses:
ArrayMapElementLayer
,GridMapElementLayer
,RoadNetworkLayer
,TreeMapElementLayer
public abstract class MapElementLayer<E extends MapElement> extends MapLayer implements GISElementContainer<E>
This class represents a layer that contains map elements.- Since:
- 14.0
- Version:
- 17.0 2020-01-04 14:41:53
- Author:
- Stéphane GALLAND
- See Also:
- Serialized Form
- Maven Group Id:
- org.arakhne.afc.gis
- Maven Artifact Id:
- giscore
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.arakhne.afc.gis.maplayer.MapLayer
MapLayer.SpecialAttributeValue
-
-
Field Summary
Fields Modifier and Type Field Description static String
ATTR_ELEMENT_ATTRIBUTES_URL
Name of the attribute which is containing the URL of the source of the element attributes.static String
ATTR_ELEMENT_GEOMETRY_PROJECTION
Name of the attribute which is containing the type of map projection for the source file of the element geometries.static String
ATTR_ELEMENT_GEOMETRY_URL
Name of the attribute which is containing the URL of the source of the element geometries.-
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 MapElementLayer(UUID id, AttributeCollection attributeSource)
Create a new layer with the specified attribute source.MapElementLayer(UUID id, AttributeCollection attributeSource, boolean isTemp)
Create a new layer with the specified attribute source.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bindChangeListener(ChangeListener listener)
Bind the given listener to this container.void
fireElementChanged()
Fire the event that indicates this object has changed.protected void
fireLayerContentChangedEvent()
Fire the event that indicates the content of this layer was changed.URL
getElementAttributeSourceURL()
Replies the URL from which the attributes of the elements in this container were read.MapMetricProjection
getElementGeometrySourceProjection()
Replies the map projection of the data inside the file for which the URL is replied byGISElementContainer.getElementGeometrySourceURL()
.URL
getElementGeometrySourceURL()
Replies the URL from which the geometry of the elements in this container were read.void
onMapElementGraphicalAttributeChanged()
Invoked when one of the graphical attributes of this element has changed, including those that change the bounding box.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.void
toJson(JsonBuffer buffer)
Replies the Json representation of this node.-
Methods inherited from class org.arakhne.afc.gis.maplayer.MapLayer
addGISEditableChangeListener, addLayerListener, clone, 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
calcBounds, getBoundingBox, 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, getName, 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, finalize, 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.math.geometry.d2.afp.BoundedElement2afp
getBoundingBox
-
Methods inherited from interface org.arakhne.afc.gis.primitive.BoundedGISElement
getShape
-
Methods inherited from interface org.arakhne.afc.gis.primitive.GISBrowsable
setName
-
Methods inherited from interface org.arakhne.afc.gis.primitive.GISContainer
getColor, getName, resetBoundingBox, size
-
Methods inherited from interface org.arakhne.afc.gis.primitive.GISContentElement
getContainer, getTopContainer
-
Methods inherited from interface org.arakhne.afc.gis.primitive.GISEditable
getName, setName
-
Methods inherited from interface org.arakhne.afc.gis.primitive.GISElement
copyAttributes, getName, hashKey, setName
-
Methods inherited from interface org.arakhne.afc.gis.mapelement.GISElementContainer
addMapElement, addMapElements, getAllMapElements, getMapElementAt, getMapElementCount, iterator, removeAllMapElements, removeMapElement
-
Methods inherited from interface org.arakhne.afc.gis.primitive.GISPrimitive
getGeoId, getUUID
-
Methods inherited from interface org.arakhne.afc.util.InformedIterable
getElementType
-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
-
-
-
Field Detail
-
ATTR_ELEMENT_GEOMETRY_URL
public static final String ATTR_ELEMENT_GEOMETRY_URL
Name of the attribute which is containing the URL of the source of the element geometries.- See Also:
- Constant Field Values
-
ATTR_ELEMENT_GEOMETRY_PROJECTION
public static final String ATTR_ELEMENT_GEOMETRY_PROJECTION
Name of the attribute which is containing the type of map projection for the source file of the element geometries.- Since:
- 4.1
- See Also:
- Constant Field Values
-
ATTR_ELEMENT_ATTRIBUTES_URL
public static final String ATTR_ELEMENT_ATTRIBUTES_URL
Name of the attribute which is containing the URL of the source of the element attributes.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MapElementLayer
public MapElementLayer(UUID id, AttributeCollection attributeSource)
Create a new layer with the specified attribute source.- Parameters:
id
- is the unique identifier of this element, ornull
if unknown.attributeSource
- is the provider of the layer's attributes.- Since:
- 4.0
-
MapElementLayer
public MapElementLayer(UUID id, AttributeCollection attributeSource, boolean isTemp)
Create a new layer with the specified attribute source.- Parameters:
id
- is the unique identifier of this element, ornull
if unknown.attributeSource
- is the provider of the layer's attributes.isTemp
- indicates if this layer is temporary.- Since:
- 4.0
-
-
Method Detail
-
bindChangeListener
public void bindChangeListener(ChangeListener listener)
Description copied from interface:GISContainer
Bind the given listener to this container.- Specified by:
bindChangeListener
in interfaceGISContainer<E extends MapElement>
- Parameters:
listener
- the listener.
-
fireElementChanged
public void fireElementChanged()
Description copied from class:MapLayer
Fire the event that indicates this object has changed. Only theGISEditableChangeListener
are notified.- Overrides:
fireElementChanged
in classMapLayer
-
toJson
@Pure public void toJson(JsonBuffer buffer)
Description copied from interface:JsonableObject
Replies the Json representation of this node.- Specified by:
toJson
in interfaceJsonableObject
- Overrides:
toJson
in classAbstractBoundedGISElement<GISLayerContainer<?>,MapLayer>
- Parameters:
buffer
- the Json buffer.
-
fireLayerContentChangedEvent
protected final void fireLayerContentChangedEvent()
Fire the event that indicates the content of this layer was changed.
-
onMapElementGraphicalAttributeChanged
public void onMapElementGraphicalAttributeChanged()
Description copied from interface:GISElementContainer
Invoked when one of the graphical attributes of this element has changed, including those that change the bounding box.- Specified by:
onMapElementGraphicalAttributeChanged
in interfaceGISElementContainer<E extends MapElement>
-
getElementGeometrySourceURL
@Pure public URL getElementGeometrySourceURL()
Description copied from interface:GISElementContainer
Replies the URL from which the geometry of the elements in this container were read.Basically, the replied URL may be the URL of a ESRI Shape file.
- Specified by:
getElementGeometrySourceURL
in interfaceGISElementContainer<E extends MapElement>
- Returns:
- the URL of the source of the geometry of
the elements, or
null
if no known source.
-
getElementGeometrySourceProjection
@Pure public MapMetricProjection getElementGeometrySourceProjection()
Description copied from interface:GISElementContainer
Replies the map projection of the data inside the file for which the URL is replied byGISElementContainer.getElementGeometrySourceURL()
.- Specified by:
getElementGeometrySourceProjection
in interfaceGISElementContainer<E extends MapElement>
- Returns:
- the map projection of the data, or
null
ifGISElementContainer.getElementGeometrySourceURL()
repliesnull
.
-
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<E extends MapElement>
- 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.
-
getElementAttributeSourceURL
@Pure public URL getElementAttributeSourceURL()
Description copied from interface:GISElementContainer
Replies the URL from which the attributes of the elements in this container were read.Basically, the replied URL may be the URL of a dBase file.
- Specified by:
getElementAttributeSourceURL
in interfaceGISElementContainer<E extends MapElement>
- Returns:
- the URL of the source of the attributes of
the elements, or
null
if no known source.
-
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<E extends MapElement>
- Parameters:
url
- is the URL of the source of the attributes of the elements, ornull
if no known source.
-
-