Top Description Fields Constructors Methods
com.dlsc.unitfx

public abstract Class QuantityInputControl<Q extends Quantity<Q>>

extends Control
Class Inheritance
Known Direct Subclasses
com.dlsc.unitfx.QuantityInputField
Type Parameters
<Q>
In the JSR specification represents a quantity type in conjunction with a javax.measure.Dimension.
Imports
com.dlsc.unitfx.util.QuantitiesUtil, javafx.beans.InvalidationListener, javafx.beans.property.BooleanProperty, .IntegerProperty, .ObjectProperty, .ReadOnlyObjectProperty, .ReadOnlyObjectWrapper, .SimpleBooleanProperty, .SimpleIntegerProperty, .SimpleObjectProperty, javafx.collections.FXCollections, .ObservableList, javafx.scene.control.Control, javafx.util.StringConverter, javax.measure.Quantity, .Unit

Base class for any quantity input control that allows to enter Unit of Measurement quantity based on a JSR-363 specification. The input field is Double type based, so the value is a double property.
See Also
Quantity, Unit, javax.measure.Dimension, QuantityInputField

Field Summary

Modifier and TypeField and Description
private final ObservableList<Unit<Q>>
private final ObjectProperty<Unit<Q>>
private final IntegerProperty
private final IntegerProperty
private final BooleanProperty
private final ObjectProperty<Unit<Q>>
private final ObjectProperty<StringConverter<Unit<Q>>>
private final ObjectProperty<Double>
private final ReadOnlyObjectWrapper<Quantity<Q>>

Constructor Summary

AccessConstructor and Description
public
QuantityInputControl()

Instances a new input field with no available units, null value and no precision.

Method Summary

Modifier and TypeMethod and Description
public final ObjectProperty<Unit<Q>>

Returns:

The base unit.
baseUnitProperty
()

Represents the system base unit, which is the default one for the control.

private void
public final ObservableList<Unit<Q>>

Returns:

The list of units available in the control.
getAvailableUnits
()

The list of available units supported within the control, this is the list of units the user has available to select from.

public final Unit<Q>
public final int
public final int
public final Unit<Q>
public final StringConverter<Unit<Q>>
public final Double
public final Quantity<Q>
public final boolean
private void
public final IntegerProperty

Returns:

The maximum value.
numberOfDecimalsProperty
()

The maximum digits in the decimal part of the number.

public final IntegerProperty

Returns:

The maximum value.
numberOfIntegersProperty
()

The maximum digits in the integer part of the number.

public final BooleanProperty

Returns:

The boolean property.
readOnlyProperty
()

Boolean property used to restrict the edition in the control.

public final void
setBaseUnit(Unit<Q> baseUnit)

public final void
setNumberOfDecimals(int numberOfDecimals)

public final void
setNumberOfIntegers(int numberOfIntegers)

public final void
setReadOnly(boolean readOnly)

public final void
setUnit(Unit<Q> unit)

public final void
setUnitStringConverter(StringConverter<Unit<Q>> unitStringConverter)

public final void
pack-priv void
setValueQuantity(Quantity<Q> valueQuantity)

public final ObjectProperty<Unit<Q>>

Returns:

A unit object which represent the selected format.
unitProperty
()

The selected type for the quantity value.

public final ObjectProperty<StringConverter<Unit<Q>>>

Returns:

The property storing string converter.
unitStringConverterProperty
()

String converter that allows customization of unit label on the skin.

pack-priv void
updateDefaultUnit(Unit<Q> baseUnit)

pack-priv void
public final ObjectProperty<Double>

Returns:

A double object being the value.
valueProperty
()

Represents the quantitative amount in the specific unit.

public final ReadOnlyObjectProperty<Quantity<Q>>

Returns:

The read only property storing the quantity. null if no value or unit has been set.
valueQuantityProperty
()

Represents the quantity which is the combination of valueProperty() and unitProperty().

Inherited from javafx.scene.control.Control:
computeMaxHeightcomputeMaxWidthcomputeMinHeightcomputeMinWidthcomputePrefHeightcomputePrefWidthcontextMenuPropertycreateDefaultSkinexecuteAccessibleActiongetBaselineOffsetgetClassCssMetaDatagetContextMenugetControlCssMetaDatagetCssMetaDatagetInitialFocusTraversablegetSkingetTooltipisResizablelayoutChildrenqueryAccessibleAttributesetContextMenusetSkinsetTooltipskinPropertytooltipProperty

Field Detail

availableUnitsback to summary
private final ObservableList<Unit<Q>> availableUnits
baseUnitback to summary
private final ObjectProperty<Unit<Q>> baseUnit
numberOfDecimalsback to summary
private final IntegerProperty numberOfDecimals
numberOfIntegersback to summary
private final IntegerProperty numberOfIntegers
readOnlyback to summary
private final BooleanProperty readOnly
unitback to summary
private final ObjectProperty<Unit<Q>> unit
unitStringConverterback to summary
private final ObjectProperty<StringConverter<Unit<Q>>> unitStringConverter
valueback to summary
private final ObjectProperty<Double> value
valueQuantityback to summary
private final ReadOnlyObjectWrapper<Quantity<Q>> valueQuantity

Constructor Detail

QuantityInputControlback to summary
public QuantityInputControl()

Instances a new input field with no available units, null value and no precision.

Method Detail

baseUnitPropertyback to summary
public final ObjectProperty<Unit<Q>> baseUnitProperty()

Represents the system base unit, which is the default one for the control. If the unit selected is different to the base unit, the control will indicate visually (colored) that ambiguity. If no base unit is set, not color effect will be applied in the skin.

Returns:ObjectProperty<Unit<Q>>

The base unit.

bindQuantityValuePropertyback to summary
private void bindQuantityValueProperty()
getAvailableUnitsback to summary
public final ObservableList<Unit<Q>> getAvailableUnits()

The list of available units supported within the control, this is the list of units the user has available to select from.

Returns:ObservableList<Unit<Q>>

The list of units available in the control.

getBaseUnitback to summary
public final Unit<Q> getBaseUnit()
getNumberOfDecimalsback to summary
public final int getNumberOfDecimals()
getNumberOfIntegersback to summary
public final int getNumberOfIntegers()
getUnitback to summary
public final Unit<Q> getUnit()
getUnitStringConverterback to summary
public final StringConverter<Unit<Q>> getUnitStringConverter()
getValueback to summary
public final Double getValue()
getValueQuantityback to summary
public final Quantity<Q> getValueQuantity()
isReadOnlyback to summary
public final boolean isReadOnly()
listenForDefaultUnitback to summary
private void listenForDefaultUnit()
numberOfDecimalsPropertyback to summary
public final IntegerProperty numberOfDecimalsProperty()

The maximum digits in the decimal part of the number.

Returns:IntegerProperty

The maximum value.

numberOfIntegersPropertyback to summary
public final IntegerProperty numberOfIntegersProperty()

The maximum digits in the integer part of the number.

Returns:IntegerProperty

The maximum value.

readOnlyPropertyback to summary
public final BooleanProperty readOnlyProperty()

Boolean property used to restrict the edition in the control. If this is set to true the control will be disabled.

Returns:BooleanProperty

The boolean property.

setBaseUnitback to summary
public final void setBaseUnit(Unit<Q> baseUnit)
setNumberOfDecimalsback to summary
public final void setNumberOfDecimals(int numberOfDecimals)
setNumberOfIntegersback to summary
public final void setNumberOfIntegers(int numberOfIntegers)
setReadOnlyback to summary
public final void setReadOnly(boolean readOnly)
setUnitback to summary
public final void setUnit(Unit<Q> unit)
setUnitStringConverterback to summary
public final void setUnitStringConverter(StringConverter<Unit<Q>> unitStringConverter)
setValueback to summary
public final void setValue(Double value)
setValueQuantityback to summary
pack-priv void setValueQuantity(Quantity<Q> valueQuantity)
unitPropertyback to summary
public final ObjectProperty<Unit<Q>> unitProperty()

The selected type for the quantity value.

Returns:ObjectProperty<Unit<Q>>

A unit object which represent the selected format.

unitStringConverterPropertyback to summary
public final ObjectProperty<StringConverter<Unit<Q>>> unitStringConverterProperty()

String converter that allows customization of unit label on the skin.

Returns:ObjectProperty<StringConverter<Unit<Q>>>

The property storing string converter.

updateDefaultUnitback to summary
pack-priv void updateDefaultUnit(Unit<Q> baseUnit)
updateValueQuantityback to summary
pack-priv void updateValueQuantity()
valuePropertyback to summary
public final ObjectProperty<Double> valueProperty()

Represents the quantitative amount in the specific unit. Basically represents the number introduced by the user.

Returns:ObjectProperty<Double>

A double object being the value.

valueQuantityPropertyback to summary
public final ReadOnlyObjectProperty<Quantity<Q>> valueQuantityProperty()

Represents the quantity which is the combination of valueProperty() and unitProperty(). This value is calculated automatically by the control. It is refreshed every time the value or the unit change.

Returns:ReadOnlyObjectProperty<Quantity<Q>>

The read only property storing the quantity. null if no value or unit has been set.