- java.lang.Object
-
- org.arakhne.afc.gis.primitive.AbstractGISElement<C,T>
-
- org.arakhne.afc.gis.primitive.AbstractBoundedGISElement<GISElementContainer<?>,MapElement>
-
- org.arakhne.afc.gis.mapelement.MapElement
-
- org.arakhne.afc.gis.mapelement.MapComposedElement
-
- org.arakhne.afc.gis.mapelement.MapPolygon
-
- All Implemented Interfaces:
Serializable
,Cloneable
,EventListener
,AttributeChangeListener
,AttributeCollection
,AttributeProvider
,BoundedGISElement
,FlagContainer
,GISCloneable<MapElement>
,GISContentElement<GISElementContainer<?>>
,GISEditable
,GISElement
,GISFlagContainer
,GISPrimitive
,BoundedElement2afp<Rectangle2d>
,JsonableObject
public class MapPolygon extends MapComposedElement
Class the permits to display a polygon.- 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.mapelement.MapComposedElement
MapComposedElement.PointGroup
-
Nested classes/interfaces inherited from class org.arakhne.afc.gis.mapelement.MapElement
MapElement.VisualizationType
-
-
Field Summary
-
Fields inherited from class org.arakhne.afc.gis.mapelement.MapElement
ATTR_COLOR, ATTR_USE_CONTAINER_COLOR, ATTR_VISUALIZATION_TYPE
-
Fields inherited from interface org.arakhne.afc.gis.primitive.FlagContainer
FLAG_READONLY, FLAG_SELECTED
-
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 MapPolygon()
Create a new map element.MapPolygon(UUID id)
Create a new map element.MapPolygon(UUID id, AttributeCollection attributeSource)
Create a new map element.MapPolygon(AttributeCollection attributeSource)
Create a new map element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
distance(Point2D<?,?> point, double width)
Replies the distance between this figure and the specified point.double
getDistance(Point2D<?,?> point)
Replies the distance between this MapElement and point.Shape2d<?>
getShape()
Replies the shape of this this element.boolean
intersects(Shape2D<?,?,?,?,?,? extends Rectangle2afp<?,?,?,?,?,?>> rectangle)
Replies if this element has an intersection with the specified rectangle.Path2d
toPath2D()
Replies the Path2D that corresponds to this polygon.-
Methods inherited from class org.arakhne.afc.gis.mapelement.MapComposedElement
addGroup, addGroup, addPoint, addPoint, addPoint, addPoint, calcBounds, canonize, clear, clone, contains, containsPoint, containsPoint, equals, getFirstPointIndexInGroup, getGeoLocation, getGroupAt, getGroupCount, getLastPointIndexInGroup, getPointAt, getPointAt, getPointCount, getPointCountInGroup, getPointFusionValidator, getPointIndex, getPointIndex, groupIterator, groups, hashCode, insertPointAt, insertPointAt, invert, invertPointsIn, pointIterator, points, removeGroupAt, removePointAt, setPointAt, setPointAt, setPointAt, setPointAt, setPointAt, setPointAt, setPointAt, setPointAt, toJson
-
Methods inherited from class org.arakhne.afc.gis.mapelement.MapElement
addGISEditableChangeListener, boundsContains, boundsIntersects, contains, equals, finalize, fireElementChanged, fireGraphicalAttributeChanged, fireShapeChanged, getColor, getFlags, getRawColor, getVisualizationType, hasFlag, isContainerColorUsed, isReadOnlyObject, onAttributeChanged, removeGISEditableChangeListener, resetBoundingBox, setColor, setContainerColorUse, setFlag, setReadOnlyObject, setUUID, setVisualizationType, switchFlag, unsetFlag
-
Methods inherited from class org.arakhne.afc.gis.primitive.AbstractBoundedGISElement
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, onAttributeChangeEvent, removeAllAttributes, removeAttribute, removeAttributeChangeListener, renameAttribute, renameAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributes, setAttributes, setAttributeType, setContainer, setEventFirable, setName, toMap, toMap, toString
-
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.GISContentElement
getContainer, getTopContainer, setContainer
-
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.primitive.GISPrimitive
getGeoId, getUUID
-
-
-
-
Constructor Detail
-
MapPolygon
public MapPolygon()
Create a new map element.
-
MapPolygon
public MapPolygon(AttributeCollection attributeSource)
Create a new map element.- Parameters:
attributeSource
- is the source of the attributes for this map element.
-
MapPolygon
public MapPolygon(UUID id)
Create a new map element.- Parameters:
id
- is the unique identifier of this element, ornull
if unknown.- Since:
- 4.0
-
MapPolygon
public MapPolygon(UUID id, AttributeCollection attributeSource)
Create a new map element.- Parameters:
id
- is the unique identifier of this element, ornull
if unknown.attributeSource
- is the source of the attributes for this map element.- Since:
- 4.0
-
-
Method Detail
-
getDistance
@Pure public final double getDistance(Point2D<?,?> point)
Replies the distance between this MapElement and point.- Specified by:
getDistance
in classMapElement
- Parameters:
point
- the point to compute the distance to.- Returns:
- the distance. Should be negative depending of the MapElement type.
-
distance
@Pure public double distance(Point2D<?,?> point, double width)
Replies the distance between this figure and the specified point.- Parameters:
point
- is the x-coordinate of the point.width
- is the width of the polygon.- Returns:
- the computed distance
-
intersects
@Pure public boolean intersects(Shape2D<?,?,?,?,?,? extends Rectangle2afp<?,?,?,?,?,?>> rectangle)
Replies if this element has an intersection with the specified rectangle.- Specified by:
intersects
in classMapElement
- Parameters:
rectangle
- the rectangle- Returns:
true
if this MapElement is intersecting the specified area, otherwisefalse
-
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.
-
toPath2D
@Pure public final Path2d toPath2D()
Replies the Path2D that corresponds to this polygon.- Returns:
true
if this MapElement is intersecting the specified area, otherwisefalse
-
-