Module org.controlsfx.controls
Class CoordinatePositions
- java.lang.Object
-
- impl.org.controlsfx.tools.rectangle.CoordinatePositions
-
public class CoordinatePositions extends Object
Computes coordinate positions relative to a rectangle.
-
-
Constructor Summary
Constructors Constructor Description CoordinatePositions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CoordinatePosition
inRectangle(Rectangle2D rectangle, Point2D point)
Returns the position the specified coordinates have regarding the specified rectangle.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.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).
-
-
-
Method Detail
-
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
public static CoordinatePosition inRectangle(Rectangle2D rectangle, Point2D point)
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_RECTANGLE
orOUT_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
-
-