Class Utils

java.lang.Object
org.controlsfx.tools.Utils

public class Utils extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    clamp(double min, double value, double max)
    Simple utility function which clamps the given value to be strictly between the min and max values.
    static final String
    Return a letter (just like Excel) associated with the number.
    static javafx.stage.Window
    Will return a Window from an object if any can be found.
    static double
    nearest(double less, double value, double more)
    Utility function which returns either less or more depending on which value is closer to.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Utils

      public Utils()
  • Method Details

    • getWindow

      public static javafx.stage.Window getWindow(Object owner) throws IllegalArgumentException
      Will return a Window from an object if any can be found. null value can be given, the program will then try to find the focused window among those available.
      Parameters:
      owner - the object whose window is to be found.
      Returns:
      the window of the given object.
      Throws:
      IllegalArgumentException
    • getExcelLetterFromNumber

      public static final String getExcelLetterFromNumber(int number)
      Return a letter (just like Excel) associated with the number. When the number is under 26, a simple letter is returned. When the number is superior, concatenated letters are returned. For example: 0 -> A 1 -> B 26 -> AA 32 -> AG 45 -> AT
      Parameters:
      number - the number whose Excel Letter is to be found.
      Returns:
      a letter (like) associated with the number.
    • clamp

      public static double clamp(double min, double value, double max)
      Simple utility function which clamps the given value to be strictly between the min and max values.
    • nearest

      public static double nearest(double less, double value, double more)
      Utility function which returns either less or more depending on which value is closer to. If value is perfectly between them, then either may be returned.