public final class PointQueryUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static javafx.geometry.Point2D |
atPosition(javafx.geometry.Bounds bounds,
javafx.geometry.Pos position) |
static javafx.geometry.Point2D |
atPositionFactors(javafx.geometry.Bounds bounds,
javafx.geometry.Point2D positionFactors)
Returns the point within the given bounds computed using the given
positionFactors. |
static javafx.geometry.Point2D |
computePositionFactors(javafx.geometry.Pos position)
Computes the width/height factors for the point defined by the given
position. |
public static javafx.geometry.Point2D atPosition(javafx.geometry.Bounds bounds,
javafx.geometry.Pos position)
bounds - the given boundsposition - the position within the boundsposition to computePositionFactors(Pos).public static javafx.geometry.Point2D atPositionFactors(javafx.geometry.Bounds bounds,
javafx.geometry.Point2D positionFactors)
positionFactors.
The x-component of the returned point is computed using:
x = bounds.x + positionFactors.x * bounds.width
and analogously the y-component of the returned point is computed using:
y = bounds.y + positionFactors.y * bounds.height
bounds - the given boundspositionFactors - a Point2D object whose x and y values represent percentages
(0.0 = 0% and 1.0 = 100%). As an example, an x value of 0 will return Bounds.getMinX(),
1.0 will return Bounds.getMaxX(), and 0.5 will return
bounds.getMinX() + (bounds.getWidth() * positionFactors.getX().positionFactors.public static javafx.geometry.Point2D computePositionFactors(javafx.geometry.Pos position)
position.
The width factor is returned in the x component and the height factor in the y component of the point.
That is, Pos.TOP_LEFT has a width and height factor of 0.0, whereas Pos.BOTTOM_RIGHT
has a width and height factor of 1.0.
position - the position to compute width/height factors forPoint2D that can be used as a positionFactor object in
atPositionFactors(Bounds, Point2D).