- 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.MapPonctualElement
-
- org.arakhne.afc.gis.mapelement.MapCircle
-
- All Implemented Interfaces:
Serializable,Cloneable,EventListener,AttributeChangeListener,AttributeCollection,AttributeProvider,BoundedGISElement,FlagContainer,GISCloneable<MapElement>,GISContentElement<GISElementContainer<?>>,GISEditable,GISElement,GISFlagContainer,GISPrimitive,BoundedElement2afp<Rectangle2d>,JsonableObject
public class MapCircle extends MapPonctualElement
This class permits to define a circle.- 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.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 MapCircle(double x, double y)Create a new map element.MapCircle(double x, double y, double radius)Create a new map element.MapCircle(UUID id, double x, double y)Create a new map element.MapCircle(UUID id, double x, double y, double radius)Create a new map element.MapCircle(UUID id, AttributeCollection attributeSource, double x, double y)Create a new map element.MapCircle(UUID id, AttributeCollection attributeSource, double x, double y, double radius)Create a new map element.MapCircle(UUID id, AttributeCollection attributeSource, Point2D<?,?> point)Create a new map element.MapCircle(UUID id, AttributeCollection attributeSource, Point2D<?,?> point, double radius)Create a new map element.MapCircle(UUID id, Point2D<?,?> point)Create a new map element.MapCircle(UUID id, Point2D<?,?> point, double radius)Create a new map element.MapCircle(AttributeCollection attributeSource, double x, double y)Create a new map element.MapCircle(AttributeCollection attributeSource, double x, double y, double radius)Create a new map element.MapCircle(AttributeCollection attributeSource, Point2D<?,?> point)Create a new map element.MapCircle(AttributeCollection attributeSource, Point2D<?,?> point, double radius)Create a new map element.MapCircle(Point2D<?,?> point)Create a new map element.MapCircle(Point2D<?,?> point, double radius)Create a new map element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Rectangle2dcalcBounds()Compute the bounds of this element.<OT extends MapPonctualElement>
doubledistance(OT another_point)Replies the distance between this MapPoint and another_point.booleanequals(MapElement element)Replies if the specified objects is the same as this one.doublegetDiameter()Replies the diameter.doublegetDistance(Point2D<?,?> point)Replies the distance between this MapCircle and point.doublegetRadius()Replies the radius.Shape2d<?>getShape()Replies the shape of this this element.inthashCode()booleanintersects(Shape2D<?,?,?,?,?,? extends Rectangle2afp<?,?,?,?,?,?>> rectangle)Replies if this element has an intersection with the specified rectangle.voidsetDiameter(double diameter)Set the diameter.voidsetRadius(double radius)Set the radius.voidtoJson(JsonBuffer buffer)Replies the Json representation of this node.-
Methods inherited from class org.arakhne.afc.gis.mapelement.MapPonctualElement
contains, getGeoLocation, getPoint, getX, getY, setLocation, setLocation
-
Methods inherited from class org.arakhne.afc.gis.mapelement.MapElement
addGISEditableChangeListener, boundsContains, boundsIntersects, clone, 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
-
MapCircle
public MapCircle(Point2D<?,?> point)
Create a new map element.- Parameters:
point- is a location component of the circle in the geo-referenced space.
-
MapCircle
public MapCircle(double x, double y)Create a new map element.- Parameters:
x- is a location component of the circle in the geo-referenced space.y- is a location component of the circle in the geo-referenced space.
-
MapCircle
public MapCircle(Point2D<?,?> point, double radius)
Create a new map element.- Parameters:
point- is a location component of the circle in the geo-referenced space.radius- is the radius
-
MapCircle
public MapCircle(double x, double y, double radius)Create a new map element.- Parameters:
x- is a location component of the circle in the geo-referenced space.y- is a location component of the circle in the geo-referenced space.radius- is the radius
-
MapCircle
public MapCircle(AttributeCollection attributeSource, Point2D<?,?> point)
Create a new map element.- Parameters:
attributeSource- is the provider of the attributes for this element.point- is a location component of the circle in the geo-referenced space.
-
MapCircle
public MapCircle(AttributeCollection attributeSource, double x, double y)
Create a new map element.- Parameters:
attributeSource- is the provider of the attributes for this element.x- is a location component of the circle in the geo-referenced space.y- is a location component of the circle in the geo-referenced space.
-
MapCircle
public MapCircle(AttributeCollection attributeSource, Point2D<?,?> point, double radius)
Create a new map element.- Parameters:
attributeSource- is the provider of the attributes for this element.point- is a location component of the circle in the geo-referenced space.radius- is the radius
-
MapCircle
public MapCircle(AttributeCollection attributeSource, double x, double y, double radius)
Create a new map element.- Parameters:
attributeSource- is the provider of the attributes for this element.x- is a location component of the circle in the geo-referenced space.y- is a location component of the circle in the geo-referenced space.radius- is the radius
-
MapCircle
public MapCircle(UUID id, Point2D<?,?> point)
Create a new map element.- Parameters:
id- is the unique identifier of this element, ornullif unknown.point- is a location component of the circle in the geo-referenced space.- Since:
- 4.0
-
MapCircle
public MapCircle(UUID id, double x, double y)
Create a new map element.- Parameters:
id- is the unique identifier of this element, ornullif unknown.x- is a location component of the circle in the geo-referenced space.y- is a location component of the circle in the geo-referenced space.- Since:
- 4.0
-
MapCircle
public MapCircle(UUID id, Point2D<?,?> point, double radius)
Create a new map element.- Parameters:
id- is the unique identifier of this element, ornullif unknown.point- is a location component of the circle in the geo-referenced space.radius- is the radius- Since:
- 4.0
-
MapCircle
public MapCircle(UUID id, double x, double y, double radius)
Create a new map element.- Parameters:
id- is the unique identifier of this element, ornullif unknown.x- is a location component of the circle in the geo-referenced space.y- is a location component of the circle in the geo-referenced space.radius- is the radius- Since:
- 4.0
-
MapCircle
public MapCircle(UUID id, AttributeCollection attributeSource, Point2D<?,?> point)
Create a new map element.- Parameters:
id- is the unique identifier of this element, ornullif unknown.attributeSource- is the provider of the attributes for this element.point- is a location component of the circle in the geo-referenced space.- Since:
- 4.0
-
MapCircle
public MapCircle(UUID id, AttributeCollection attributeSource, double x, double y)
Create a new map element.- Parameters:
id- is the unique identifier of this element, ornullif unknown.attributeSource- is the provider of the attributes for this element.x- is a location component of the circle in the geo-referenced space.y- is a location component of the circle in the geo-referenced space.- Since:
- 4.0
-
MapCircle
public MapCircle(UUID id, AttributeCollection attributeSource, Point2D<?,?> point, double radius)
Create a new map element.- Parameters:
id- is the unique identifier of this element, ornullif unknown.attributeSource- is the provider of the attributes for this element.point- is a location component of the circle in the geo-referenced space.radius- is the radius- Since:
- 4.0
-
MapCircle
public MapCircle(UUID id, AttributeCollection attributeSource, double x, double y, double radius)
Create a new map element.- Parameters:
id- is the unique identifier of this element, ornullif unknown.attributeSource- is the provider of the attributes for this element.x- is a location component of the circle in the geo-referenced space.y- is a location component of the circle in the geo-referenced space.radius- is the radius- Since:
- 4.0
-
-
Method Detail
-
toJson
@Pure public void toJson(JsonBuffer buffer)
Description copied from interface:JsonableObjectReplies the Json representation of this node.- Specified by:
toJsonin interfaceJsonableObject- Overrides:
toJsonin classMapPonctualElement- Parameters:
buffer- the Json buffer.
-
equals
@Pure public boolean equals(MapElement element)
Replies if the specified objects is the same as this one.- Overrides:
equalsin classMapPonctualElement- Parameters:
element- the element to compare to.- Returns:
trueif the given element is equal to this object, otherwisefalse
-
hashCode
@Pure public int hashCode()
- Overrides:
hashCodein classMapPonctualElement
-
getRadius
@Pure public double getRadius()
Replies the radius.- Returns:
- the radius.
-
getDiameter
@Pure public double getDiameter()
Replies the diameter.- Returns:
- the diameter.
-
setRadius
public void setRadius(double radius)
Set the radius.- Parameters:
radius- the new radius
-
setDiameter
public void setDiameter(double diameter)
Set the diameter.- Parameters:
diameter- the new diameter
-
distance
@Pure public <OT extends MapPonctualElement> double distance(OT another_point)
Replies the distance between this MapPoint and another_point.- Overrides:
distancein classMapPonctualElement- Type Parameters:
OT- is the type of the given point.- Parameters:
another_point- another point.- Returns:
- the distance between the given point and this point.
-
getDistance
@Pure public double getDistance(Point2D<?,?> point)
Replies the distance between this MapCircle and point.- Overrides:
getDistancein classMapPonctualElement- Parameters:
point- the point to compute the distance to.- Returns:
- the distance. Should be negative if the point is inside the circle.
-
intersects
@Pure public boolean intersects(Shape2D<?,?,?,?,?,? extends Rectangle2afp<?,?,?,?,?,?>> rectangle)
Replies if this element has an intersection with the specified rectangle.- Specified by:
intersectsin classMapElement- Parameters:
rectangle- the rectangle- Returns:
trueif this MapElement is intersecting the specified area, otherwisefalse
-
calcBounds
@Pure protected Rectangle2d calcBounds()
Compute the bounds of this element. This function does not update the internal attribute replied byAbstractBoundedGISElement.getBoundingBox()- Specified by:
calcBoundsin classAbstractBoundedGISElement<GISElementContainer<?>,MapElement>- Returns:
- the bounds
-
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.
-
-