Class Rectangle2dfx
- java.lang.Object
-
- org.arakhne.afc.math.geometry.d2.dfx.AbstractShape2dfx<Rectangle2dfx>
-
- org.arakhne.afc.math.geometry.d2.dfx.Rectangle2dfx
-
- All Implemented Interfaces:
Serializable
,Cloneable
,OrientedRectangle2afp<Shape2dfx<?>,Rectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>
,Parallelogram2afp<Shape2dfx<?>,Rectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>
,Rectangle2afp<Shape2dfx<?>,Rectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>
,RectangularShape2afp<Shape2dfx<?>,Rectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>
,Shape2afp<Shape2dfx<?>,Rectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>
,Shape2dfx<Rectangle2dfx>
,Shape2D<Shape2dfx<?>,Rectangle2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>
,JsonableObject
public class Rectangle2dfx extends AbstractShape2dfx<Rectangle2dfx> implements Rectangle2afp<Shape2dfx<?>,Rectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>
Rectangle with 2 double precision floating-point FX properties.- Since:
- 13.0
- Version:
- 17.0 2020-01-04 14:41:49
- Author:
- Stéphane GALLAND, Olivier LAMOTTE, Hamza JAFFALI
- See Also:
- Serialized Form
- Maven Group Id:
- org.arakhne.afc.advanced
- Maven Artifact Id:
- mathfx
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.arakhne.afc.math.geometry.d2.afp.OrientedRectangle2afp
OrientedRectangle2afp.AbstractOrientedRectanglePathIterator<T extends PathElement2afp>, OrientedRectangle2afp.OrientedRectanglePathIterator<T extends PathElement2afp>, OrientedRectangle2afp.ProjectionToOrientedRectangleLocalCoordinateSystemPathIterator<T extends PathElement2afp>, OrientedRectangle2afp.TransformedOrientedRectanglePathIterator<T extends PathElement2afp>
-
Nested classes/interfaces inherited from interface org.arakhne.afc.math.geometry.d2.afp.Parallelogram2afp
Parallelogram2afp.AbstractParallelogramPathIterator<T extends PathElement2afp>, Parallelogram2afp.ParallelogramPathIterator<T extends PathElement2afp>, Parallelogram2afp.ProjectionToParallelogramLocalCoordinateSystemPathIterator<T extends PathElement2afp>, Parallelogram2afp.TransformedParallelogramPathIterator<T extends PathElement2afp>
-
Nested classes/interfaces inherited from interface org.arakhne.afc.math.geometry.d2.afp.Rectangle2afp
Rectangle2afp.RectanglePathIterator<T extends PathElement2afp>, Rectangle2afp.TransformedRectanglePathIterator<T extends PathElement2afp>
-
-
Field Summary
-
Fields inherited from class org.arakhne.afc.math.geometry.d2.dfx.AbstractShape2dfx
boundingBox
-
-
Constructor Summary
Constructors Constructor Description Rectangle2dfx()
Construct an empty rectangle.Rectangle2dfx(double x, double y, double width, double height)
Construct a rectangle.Rectangle2dfx(Rectangle2afp<?,?,?,?,?,?> rectangle)
Constructor by copy.Rectangle2dfx(Point2dfx min, Point2dfx max)
Construct a rectangle by setting the given minimum and maximum corners.Rectangle2dfx(Rectangle2dfx rectangle)
Constructor by setting.Rectangle2dfx(Point2D<?,?> min, Point2D<?,?> max)
Construct a rectangle with the given minimum and maximum corners.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javafx.beans.property.ObjectProperty<Rectangle2dfx>
boundingBoxProperty()
Replies the property that contains the bounding box for this shape.Rectangle2dfx
clone()
Clone this shape.double
getHeight()
Replies the height.double
getMaxX()
Replies the max x.double
getMaxY()
Replies the max y.double
getMinX()
Replies the min X.double
getMinY()
Replies the min y.double
getWidth()
Replies the width.int
hashCode()
javafx.beans.property.DoubleProperty
heightProperty()
Replies the property that is the height of the box.javafx.beans.property.DoubleProperty
maxXProperty()
Replies the property that is the maximum x coordinate of the box.javafx.beans.property.DoubleProperty
maxYProperty()
Replies the property that is the maximum y coordinate of the box.javafx.beans.property.DoubleProperty
minXProperty()
Replies the property that is the minimum x coordinate of the box.javafx.beans.property.DoubleProperty
minYProperty()
Replies the property that is the minimum y coordinate of the box.void
setFromCorners(double x1, double y1, double x2, double y2)
Change the frame of the rectangle conserving previous min and max if needed.void
setMaxX(double x)
Set the max X conserving previous max if needed.void
setMaxY(double y)
Set the max Y conserving previous max if needed.void
setMinX(double x)
Set the min X conserving previous min if needed.void
setMinY(double y)
Set the min Y conserving previous min if needed.javafx.beans.property.DoubleProperty
widthProperty()
Replies the property that is the width of the box.-
Methods inherited from class org.arakhne.afc.math.geometry.d2.dfx.AbstractShape2dfx
equals, getGeomFactory, toJson, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.arakhne.afc.vmutil.json.JsonableObject
toJson
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.afp.OrientedRectangle2afp
rotate, set, set
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.afp.Parallelogram2afp
isCCW, set, setCenter, setFirstAxis, setFirstAxis, setFirstAxis, setFromPointCloud, setSecondAxis, setSecondAxis, setSecondAxis
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.afp.Rectangle2afp
add, add, avoidCollisionWith, avoidCollisionWith, clear, contains, contains, createIntersection, createUnion, equalsToShape, getCenter, getCenterX, getCenterY, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getDistanceL1, getDistanceLinf, getDistanceSquared, getDistanceSquared, getFarthestPointTo, getFirstAxis, getFirstAxisExtent, getFirstAxisX, getFirstAxisY, getPathIterator, getSecondAxis, getSecondAxisExtent, getSecondAxisX, getSecondAxisY, intersects, intersects, intersects, intersects, intersects, intersects, intersects, intersects, intersects, intersects, isEmpty, set, set, setCenter, setCenterX, setCenterY, setFirstAxis, setFirstAxisExtent, setFromPointCloud, setIntersection, setSecondAxis, setSecondAxisExtent, setUnion, toBoundingBox, translate
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.afp.RectangularShape2afp
inflate, set, set, setFromCenter, setFromCenter, setFromCorners, setHeight, setWidth
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.afp.Shape2afp
contains, contains, createTransformedShape, getClosestPointTo, getClosestPointTo, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getGeomFactory, intersects, intersects, toBoundingBox, translate
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.Shape2D
equalsToPathIterator, getDistance, getDistance, getPathIterator, operator_add, operator_and, operator_and, operator_minus, operator_multiply, operator_plus, operator_remove, operator_upTo
-
-
-
-
Constructor Detail
-
Rectangle2dfx
public Rectangle2dfx()
Construct an empty rectangle.
-
Rectangle2dfx
public Rectangle2dfx(Point2D<?,?> min, Point2D<?,?> max)
Construct a rectangle with the given minimum and maximum corners.- Parameters:
min
- is the min corner of the rectangle.max
- is the max corner of the rectangle.
-
Rectangle2dfx
public Rectangle2dfx(Point2dfx min, Point2dfx max)
Construct a rectangle by setting the given minimum and maximum corners.- Parameters:
min
- is the min corner of the rectangle.max
- is the max corner of the rectangle.
-
Rectangle2dfx
public Rectangle2dfx(double x, double y, double width, double height)
Construct a rectangle.- Parameters:
x
- x coordinate of the minimum corner.y
- y coordinate of the minimum corner.width
- width of the rectangle.height
- height of the rectangle.
-
Rectangle2dfx
public Rectangle2dfx(Rectangle2afp<?,?,?,?,?,?> rectangle)
Constructor by copy.- Parameters:
rectangle
- the shape to copy.
-
Rectangle2dfx
public Rectangle2dfx(Rectangle2dfx rectangle)
Constructor by setting.- Parameters:
rectangle
- the shape to set.
-
-
Method Detail
-
clone
public Rectangle2dfx clone()
Description copied from interface:Shape2D
Clone this shape.- Specified by:
clone
in interfaceShape2D<Shape2dfx<?>,Rectangle2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>
- Overrides:
clone
in classAbstractShape2dfx<Rectangle2dfx>
- Returns:
- the clone.
-
hashCode
@Pure public int hashCode()
- Specified by:
hashCode
in classAbstractShape2dfx<Rectangle2dfx>
-
setFromCorners
public void setFromCorners(double x1, double y1, double x2, double y2)
Description copied from interface:RectangularShape2afp
Change the frame of the rectangle conserving previous min and max if needed.- Specified by:
setFromCorners
in interfaceRectangularShape2afp<Shape2dfx<?>,Rectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>
- Parameters:
x1
- is the coordinate of the first corner.y1
- is the coordinate of the first corner.x2
- is the coordinate of the second corner.y2
- is the coordinate of the second corner.
-
getMinX
@Pure public double getMinX()
Description copied from interface:RectangularShape2afp
Replies the min X.- Specified by:
getMinX
in interfaceRectangularShape2afp<Shape2dfx<?>,Rectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>
- Returns:
- the min x.
-
setMinX
public void setMinX(double x)
Description copied from interface:RectangularShape2afp
Set the min X conserving previous min if needed.- Specified by:
setMinX
in interfaceRectangularShape2afp<Shape2dfx<?>,Rectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>
- Parameters:
x
- the min x.
-
minXProperty
@Pure public javafx.beans.property.DoubleProperty minXProperty()
Replies the property that is the minimum x coordinate of the box.- Returns:
- the minX property.
-
getMaxX
@Pure public double getMaxX()
Description copied from interface:RectangularShape2afp
Replies the max x.- Specified by:
getMaxX
in interfaceRectangularShape2afp<Shape2dfx<?>,Rectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>
- Returns:
- the max x.
-
setMaxX
public void setMaxX(double x)
Description copied from interface:RectangularShape2afp
Set the max X conserving previous max if needed.- Specified by:
setMaxX
in interfaceRectangularShape2afp<Shape2dfx<?>,Rectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>
- Parameters:
x
- the max x.
-
maxXProperty
@Pure public javafx.beans.property.DoubleProperty maxXProperty()
Replies the property that is the maximum x coordinate of the box.- Returns:
- the maxX property.
-
getMinY
@Pure public double getMinY()
Description copied from interface:RectangularShape2afp
Replies the min y.- Specified by:
getMinY
in interfaceRectangularShape2afp<Shape2dfx<?>,Rectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>
- Returns:
- the min y.
-
setMinY
public void setMinY(double y)
Description copied from interface:RectangularShape2afp
Set the min Y conserving previous min if needed.- Specified by:
setMinY
in interfaceRectangularShape2afp<Shape2dfx<?>,Rectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>
- Parameters:
y
- the min y.
-
minYProperty
@Pure public javafx.beans.property.DoubleProperty minYProperty()
Replies the property that is the minimum y coordinate of the box.- Returns:
- the minY property.
-
getMaxY
@Pure public double getMaxY()
Description copied from interface:RectangularShape2afp
Replies the max y.- Specified by:
getMaxY
in interfaceRectangularShape2afp<Shape2dfx<?>,Rectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>
- Returns:
- the max y.
-
setMaxY
public void setMaxY(double y)
Description copied from interface:RectangularShape2afp
Set the max Y conserving previous max if needed.- Specified by:
setMaxY
in interfaceRectangularShape2afp<Shape2dfx<?>,Rectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>
- Parameters:
y
- the max y.
-
maxYProperty
@Pure public javafx.beans.property.DoubleProperty maxYProperty()
Replies the property that is the maximum y coordinate of the box.- Returns:
- the maxY property.
-
getWidth
public double getWidth()
Description copied from interface:RectangularShape2afp
Replies the width.- Specified by:
getWidth
in interfaceRectangularShape2afp<Shape2dfx<?>,Rectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>
- Returns:
- the width.
-
widthProperty
@Pure public javafx.beans.property.DoubleProperty widthProperty()
Replies the property that is the width of the box.- Returns:
- the width property.
-
getHeight
public double getHeight()
Description copied from interface:RectangularShape2afp
Replies the height.- Specified by:
getHeight
in interfaceRectangularShape2afp<Shape2dfx<?>,Rectangle2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>
- Returns:
- the height.
-
heightProperty
@Pure public javafx.beans.property.DoubleProperty heightProperty()
Replies the property that is the height of the box.- Returns:
- the height property.
-
boundingBoxProperty
public javafx.beans.property.ObjectProperty<Rectangle2dfx> boundingBoxProperty()
Description copied from interface:Shape2dfx
Replies the property that contains the bounding box for this shape.- Specified by:
boundingBoxProperty
in interfaceShape2dfx<Rectangle2dfx>
- Returns:
- the bounding box.
-
-