| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static boolean | |
| public static double | calculateBrightness(Color color)
Calculates a perceptual brightness for a color between 0.0 black and 1.0 while |
| public static float | clamp(float min, float value, float max)
Simple utility function which clamps the given value to be strictly between the min and max values. |
| public static int | clamp(int min, int value, int max)
Simple utility function which clamps the given value to be strictly between the min and max values. |
| 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. |
| public static long | clamp(long min, long value, long max)
Simple utility function which clamps the given value to be strictly between the min and max values. |
| public static BigDecimal | clamp(BigDecimal min, BigDecimal value, BigDecimal max)
Simple utility function which clamps the given value to be strictly between the min and max values. |
| public static int | clampMax(int value, int max)
Simple utility function which clamps the given value to be strictly under the max value. |
| public static double | clampMin(double value, double min)
Simple utility function which clamps the given value to be strictly above the min value. |
| public static boolean | |
| public static Color | convertLinearRGBtoSRGB(Color color)
Helper function to convert a color in linear RGB space to SRGB space. |
| public static Color | convertSRGBtoLinearRGB(Color color)
Helper function to convert a color in sRGB space to linear RGB space. |
| public static String | |
| public static Color | deriveColor(Color
The color to derive from c, double The brightness difference for the new color -1.0 being 100% dark which is always black, 0.0 being
no change and 1.0 being 100% lighter which is always white brightness)Derives a lighter or darker of a given color. |
| public static void | |
| private static Bounds | |
| private static HPos | |
| private static double | |
| private static double | |
| private static double | |
| private static double | |
| public static Screen | |
| public static Screen | |
| public static Screen | |
| private static VPos | |
| public static boolean | |
| public static double[] | |
| private static Color | interpolateLinear(double position, Color color1, Color color2)
interpolate at a set |
| public static boolean | |
| public static boolean | |
| public static boolean | |
| public static boolean | |
| private static Color | |
| public static Color | |
| public static synchronized void | |
| public static double | nearest(double less, double value, double more)
Utility function which returns either |
| public static Point2D | pointRelativeTo(Node parent, Node node, HPos hpos, VPos vpos, double dx, double dy, boolean reposition)
|
| public static Point2D | pointRelativeTo(Node parent, double anchorWidth, double anchorHeight, HPos hpos, VPos vpos, double dx, double dy, boolean reposition)
|
| 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. |
| private static double | |
| private static double | |
| public static double[] | |
| public static void | runOnFxThread(Runnable
a runnable)Runnable encapsulating the codeEnsures that a code segment is run on the FX thread. |
| public static String[] | |
| public static String | |
| public static double |
| Utils | back to summary |
|---|---|
| public Utils() | |
| assertionEnabled | back to summary |
|---|---|
public static boolean assertionEnabled()
| |
| calculateBrightness | back to summary |
|---|---|
| public static double calculateBrightness(Color color) Calculates a perceptual brightness for a color between 0.0 black and 1.0 while | |
| clamp | back to summary |
|---|---|
| public static float clamp(float min, float value, float max) Simple utility function which clamps the given value to be strictly between the min and max values. | |
| clamp | back to summary |
|---|---|
| public static int clamp(int min, int value, int max) Simple utility function which clamps the given value to be strictly between the min and max values. | |
| clamp | back to summary |
|---|---|
| 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. | |
| clamp | back to summary |
|---|---|
| public static long clamp(long min, long value, long max) Simple utility function which clamps the given value to be strictly between the min and max values. | |
| clamp | back to summary |
|---|---|
| public static BigDecimal clamp(BigDecimal min, BigDecimal value, BigDecimal max) Simple utility function which clamps the given value to be strictly between the min and max values. | |
| clampMax | back to summary |
|---|---|
| public static int clampMax(int value, int max) Simple utility function which clamps the given value to be strictly under the max value. | |
| clampMin | back to summary |
|---|---|
| public static double clampMin(double value, double min) Simple utility function which clamps the given value to be strictly above the min value. | |
| contains | back to summary |
|---|---|
| public static boolean contains(String src, String s) Because mobile doesn't have string.contains(s) function, this function was written. | |
| convertLinearRGBtoSRGB | back to summary |
|---|---|
| public static Color convertLinearRGBtoSRGB(Color color) Helper function to convert a color in linear RGB space to SRGB space. | |
| convertSRGBtoLinearRGB | back to summary |
|---|---|
| public static Color convertSRGBtoLinearRGB(Color color) Helper function to convert a color in sRGB space to linear RGB space. | |
| convertUnicode | back to summary |
|---|---|
| public static String convertUnicode(String src) * Unicode-related utilities * * | |
| deriveColor | back to summary |
|---|---|
| public static Color deriveColor(Color c, double brightness) Derives a lighter or darker of a given color.
| |
| forceInit | back to summary |
|---|---|
| public static void forceInit(final Class<?> classToInit) To force initialization of a class | |
| getBounds | back to summary |
|---|---|
| private static Bounds getBounds(Object obj) To facilitate multiple types of parent object, we unfortunately must allow for Objects to be passed in. This method handles determining the bounds of the given Object. If the Object type is not supported, a default Bounds will be returned. | |
| getHPosOpposite | back to summary |
|---|---|
| private static HPos getHPosOpposite(HPos hpos, VPos vpos) | |
| getIntersectionLength | back to summary |
|---|---|
| private static double getIntersectionLength(final double a0, final double a1, final double b0, final double b1) | |
| getIntersectionLengthImpl | back to summary |
|---|---|
| private static double getIntersectionLengthImpl(final double v0, final double v1, final double v) | |
| getOuterDistance | back to summary |
|---|---|
| private static double getOuterDistance(final double a0, final double a1, final double b0, final double b1) | |
| getOuterDistance | back to summary |
|---|---|
| private static double getOuterDistance(final double v0, final double v1, final double v) | |
| getScreen | back to summary |
|---|---|
| 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. | |
| getScreenForPoint | back to summary |
|---|---|
| public static Screen getScreenForPoint(final double x, final double y) | |
| getScreenForRectangle | back to summary |
|---|---|
| public static Screen getScreenForRectangle(final Rectangle2D rect) | |
| getVPosOpposite | back to summary |
|---|---|
| private static VPos getVPosOpposite(HPos hpos, VPos vpos) | |
| hasFullScreenStage | back to summary |
|---|---|
| public static boolean hasFullScreenStage(final Screen screen) | |
| HSBtoRGB | back to summary |
|---|---|
| public static double[] HSBtoRGB(double hue, double saturation, double brightness) | |
| interpolateLinear | back to summary |
|---|---|
| private static Color interpolateLinear(double position, Color color1, Color color2) interpolate at a set | |
| isMac | back to summary |
|---|---|
| public static boolean isMac() Returns true if the operating system is a form of Mac OS. | |
| isQVGAScreen | back to summary |
|---|---|
| public static boolean isQVGAScreen() | |
| isUnix | back to summary |
|---|---|
| public static boolean isUnix() Returns true if the operating system is a form of Unix, including Linux. | |
| isWindows | back to summary |
|---|---|
| public static boolean isWindows() Returns true if the operating system is a form of Windows. | |
| ladder | back to summary |
|---|---|
| private static Color ladder(final double position, final Stop[] stops) Get the color at the give | |
| ladder | back to summary |
|---|---|
| public static Color ladder(final Color color, final Stop[] stops) Get the color at the give | |
| loadNativeSwingLibrary | back to summary |
|---|---|
| public static synchronized void loadNativeSwingLibrary() | |
| nearest | back to summary |
|---|---|
| public static double nearest(double less, double value, double more) Utility function which returns either | |
| pointRelativeTo | back to summary |
|---|---|
| public static Point2D pointRelativeTo(Node parent, Node node, HPos hpos, VPos vpos, double dx, double dy, boolean reposition) | |
| pointRelativeTo | back to summary |
|---|---|
| public static Point2D pointRelativeTo(Node parent, double anchorWidth, double anchorHeight, HPos hpos, VPos vpos, double dx, double dy, boolean reposition) | |
| pointRelativeTo | back to summary |
|---|---|
| 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 | |
| positionX | back to summary |
|---|---|
| private static double positionX(Bounds parentBounds, double width, HPos hpos) Utility function that returns the x-axis position that an object should be positioned at, given the parents screen bounds, the width of the object, and the required HPos. | |
| positionY | back to summary |
|---|---|
| private static double positionY(Bounds parentBounds, double height, VPos vpos) Utility function that returns the y-axis position that an object should be positioned at, given the parents screen bounds, the height of the object, and the required VPos. The BASELINE vpos doesn't make sense here, 0 is returned for it. | |
| RGBtoHSB | back to summary |
|---|---|
| public static double[] RGBtoHSB(double r, double g, double b) | |
| runOnFxThread | back to summary |
|---|---|
| public static void runOnFxThread(Runnable runnable) Ensures that a code segment is run on the FX thread.
| |
| split | back to summary |
|---|---|
| public static String[] split(String str, String separator) Because mobile doesn't have string.split(s) function, this function was written. | |
| stripQuotes | back to summary |
|---|---|
| public static String stripQuotes(String str) Helper to remove leading and trailing quotes from a string. Works with single or double quotes. | |
| sum | back to summary |
|---|---|
| public static double sum(double[] values) helper function for calculating the sum of a series of numbers | |