Class Utils

java.lang.Object
com.sun.javafx.util.Utils

public class Utils extends Object
Author:
Bruno Salmon
  • Constructor Details

    • Utils

      public Utils()
  • Method Details

    • pointRelativeTo

      public static Point2D pointRelativeTo(Node parent, Node node, HPos hpos, VPos vpos, double dx, double dy, boolean reposition)
    • pointRelativeTo

      public static Point2D pointRelativeTo(Node parent, double anchorWidth, double anchorHeight, HPos hpos, VPos vpos, double dx, double dy, boolean reposition)
    • 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 that width and refer 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

      public static Screen getScreen(Object obj)
      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.