java.lang.Object
org.controlsfx.tools.Utils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doubleclamp(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 StringgetExcelLetterFromNumber(int number) Return a letter (just like Excel) associated with the number.static WindowWill return aWindowfrom an object if any can be found.static doublenearest(double less, double value, double more) Utility function which returns eitherlessormoredepending on whichvalueis closer to.
-
Constructor Details
-
Utils
public Utils()
-
-
Method Details
-
getWindow
Will return aWindowfrom an object if any can be found.nullvalue 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
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 eitherlessormoredepending on whichvalueis closer to. Ifvalueis perfectly between them, then either may be returned.
-