Module org.controlsfx.controls
Class CoordinatePositions
java.lang.Object
impl.org.controlsfx.tools.rectangle.CoordinatePositions
Computes coordinate positions relative to a rectangle.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CoordinatePositioninRectangle(Rectangle2D rectangle, Point2D point) Returns the position the specified coordinates have regarding the specified rectangle.static CoordinatePositiononEdges(Rectangle2D rectangle, Point2D point, double edgeTolerance) Returns the position the specified coordinates have regarding the specified rectangle's edges using the specified tolerance.static EnumSet<CoordinatePosition>onRectangleAndEdges(Rectangle2D rectangle, Point2D point, double edgeTolerance) Returns all positions the specified point has regarding the specified rectangle and its edges (using the specified tolerance).
-
Constructor Details
-
CoordinatePositions
public CoordinatePositions()
-
-
Method Details
-
onRectangleAndEdges
public static EnumSet<CoordinatePosition> onRectangleAndEdges(Rectangle2D rectangle, Point2D point, double edgeTolerance) Returns all positions the specified point has regarding the specified rectangle and its edges (using the specified tolerance).- Parameters:
rectangle- the rectangle relative to which the point will be checkedpoint- the checked pointedgeTolerance- the tolerance in pixels used to determine whether the coordinates are on some edge- Returns:
- a set of those positions the coordinates have regarding the specified rectangle
-
inRectangle
Returns the position the specified coordinates have regarding the specified rectangle. Edges are not checked.- Parameters:
rectangle- the rectangle relative to which the point will be checkedpoint- the checked point- Returns:
- depending on the point either
IN_RECTANGLEorOUT_OF_RECTANGLE
-
onEdges
public static CoordinatePosition onEdges(Rectangle2D rectangle, Point2D point, double edgeTolerance) Returns the position the specified coordinates have regarding the specified rectangle's edges using the specified tolerance.- Parameters:
rectangle- the rectangle relative to which the point will be checkedpoint- the checked pointedgeTolerance- the tolerance in pixels used to determine whether the coordinates are on some edge- Returns:
- the edge position the coordinates have regarding the specified rectangle; the value will be null if the point is not near any edge
-