Package com.sun.javafx.util
Class Utils
java.lang.Object
com.sun.javafx.util.Utils
- Author:
- Bruno Salmon
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Screen
This function attempts to determine the best screen given the parent object from which we are wanting to position another item relative to.static Point2D
pointRelativeTo
(Object parent, double width, double height, double screenX, double screenY, HPos hpos, VPos vpos) This is the fallthrough function that most other functions fall into.static Point2D
pointRelativeTo
(Node parent, double anchorWidth, double anchorHeight, HPos hpos, VPos vpos, double dx, double dy, boolean reposition) static Point2D
pointRelativeTo
(Node parent, Node node, HPos hpos, VPos vpos, double dx, double dy, boolean reposition)
-
Constructor Details
-
Utils
public Utils()
-
-
Method Details
-
pointRelativeTo
-
pointRelativeTo
-
pointRelativeTo
public static Point2D pointRelativeTo(Object parent, double width, double height, double screenX, double screenY, HPos hpos, VPos vpos) This is the fallthrough function that most other functions fall into. It takes care specifically of the repositioning of the item such that it remains onscreen as best it can, given it's unique qualities. As will all other functions, this one returns a Point2D that represents an x,y location that should safely position the item onscreen as best as possible. Note thatwidth
andrefer to the width and height of the node/popup that is needing to be repositioned, not of the parent. Don't use the BASELINE vpos, it doesn't make sense and would produce wrong result. -
getScreen
This function attempts to determine the best screen given the parent object from which we are wanting to position another item relative to. This is particularly important when we want to keep items from going off screen, and for handling multiple monitor support.
-