Top Description Constructors Methods
com.dlsc.unitfx.util

public final Class ControlsUtil

extends Object
Class Inheritance
Imports
javafx.beans.value.ObservableValue, javafx.css.PseudoClass, javafx.geometry.Point2D, javafx.scene.Node

Utility methods for JavaFX controls.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static void
bindBooleanToPseudoclass(Node
The node which the pseudo class will be applied to.
node
,
ObservableValue<Boolean>
The flag to switch on/off.
booleanProperty
,
PseudoClass
The style class to be applied.
pseudoClass
)

Binds a boolean property to a pseudo class.

public static void
bindBooleanToStyleClass(Node
The node which the style class will be applied to.
node
,
ObservableValue<Boolean>
The flag to switch on/off.
booleanProperty
,
String
The style class to be applied.
styleClass
)

Binds a boolean property to a style class in the given node.

public static Point2D

Returns:

The point calculated.
calculatePointOnCircle
(Point2D
The middle of the circle in pixel representation.
middle
,
double
The radius of the circle.
radius
,
double
The angle for which the point is going to be calculated.
angle
)

Calculates the x,y position of the given angle in relation with the circle represented by the middle point and radius.

public static double

Returns:

The distance between the angles.
distance
(double
The initial angle.
alpha
,
double
The final angle.
beta
)

Calculates the distance between two angles in degrees, the result is a number between 0 - 180.

public static double

Returns:

The rotation between the angles.
rotation
(double
The initial angle.
alpha
,
double
The final angle.
beta
)

Calculates the rotation, which means the signed distance between two angles.

private static double
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ControlsUtilback to summary
private ControlsUtil()

Method Detail

bindBooleanToPseudoclassback to summary
public static void bindBooleanToPseudoclass(Node node, ObservableValue<Boolean> booleanProperty, PseudoClass pseudoClass)

Binds a boolean property to a pseudo class. Doing this the pseudo class is switched on/off in the given node.

Parameters
node:Node

The node which the pseudo class will be applied to.

booleanProperty:ObservableValue<Boolean>

The flag to switch on/off.

pseudoClass:PseudoClass

The style class to be applied.

bindBooleanToStyleClassback to summary
public static void bindBooleanToStyleClass(Node node, ObservableValue<Boolean> booleanProperty, String styleClass)

Binds a boolean property to a style class in the given node. Doing this the style class is switched on/off depending on the boolean property.

Parameters
node:Node

The node which the style class will be applied to.

booleanProperty:ObservableValue<Boolean>

The flag to switch on/off.

styleClass:String

The style class to be applied.

calculatePointOnCircleback to summary
public static Point2D calculatePointOnCircle(Point2D middle, double radius, double angle)

Calculates the x,y position of the given angle in relation with the circle represented by the middle point and radius.

Parameters
middle:Point2D

The middle of the circle in pixel representation.

radius:double

The radius of the circle.

angle:double

The angle for which the point is going to be calculated.

Returns:Point2D

The point calculated.

distanceback to summary
public static double distance(double alpha, double beta)

Calculates the distance between two angles in degrees, the result is a number between 0 - 180.

Parameters
alpha:double

The initial angle.

beta:double

The final angle.

Returns:double

The distance between the angles.

rotationback to summary
public static double rotation(double alpha, double beta)

Calculates the rotation, which means the signed distance between two angles.

Parameters
alpha:double

The initial angle.

beta:double

The final angle.

Returns:double

The rotation between the angles.

switchPixelAndCartesianback to summary
private static double switchPixelAndCartesian(double value)