Module com.dlsc.unitfx
Package com.dlsc.unitfx
Class QuantityInputControl<Q extends javax.measure.Quantity<Q>>
java.lang.Object
javafx.scene.Node
javafx.scene.Parent
javafx.scene.layout.Region
javafx.scene.control.Control
com.dlsc.unitfx.QuantityInputControl<Q>
- Type Parameters:
Q- In the JSR specification represents a quantity type in conjunction with aDimension.
- All Implemented Interfaces:
javafx.css.Styleable,javafx.event.EventTarget,javafx.scene.control.Skinnable
- Direct Known Subclasses:
QuantityInputField
public abstract class QuantityInputControl<Q extends javax.measure.Quantity<Q>>
extends javafx.scene.control.Control
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,Dimension,QuantityInputField
-
Property Summary
Properties Type Property Description javafx.beans.property.ObjectProperty<javax.measure.Unit<Q>>baseUnitRepresents the system base unit, which is the default one for the control.javafx.beans.property.IntegerPropertynumberOfDecimalsThe maximum digits in the decimal part of the number.javafx.beans.property.IntegerPropertynumberOfIntegersThe maximum digits in the integer part of the number.javafx.beans.property.BooleanPropertyreadOnlyBoolean property used to restrict the edition in the control.javafx.beans.property.ObjectProperty<javax.measure.Unit<Q>>unitThe selected type for the quantity value.javafx.beans.property.ObjectProperty<javafx.util.StringConverter<javax.measure.Unit<Q>>>unitStringConverterString converter that allows customization of unit label on the skin.javafx.beans.property.ObjectProperty<Double>valueRepresents the quantitative amount in the specific unit.javafx.beans.property.ReadOnlyObjectProperty<javax.measure.Quantity<Q>>valueQuantityRepresents the quantity which is the combination ofvalueProperty()andunitProperty().Properties inherited from class javafx.scene.layout.Region
background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, widthProperties inherited from class javafx.scene.Node
accessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, viewOrder, visible -
Field Summary
-
Constructor Summary
Constructors Constructor Description QuantityInputControl()Instances a new input field with no available units, null value and no precision. -
Method Summary
Modifier and Type Method Description javafx.beans.property.ObjectProperty<javax.measure.Unit<Q>>baseUnitProperty()Represents the system base unit, which is the default one for the control.javafx.collections.ObservableList<javax.measure.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.javax.measure.Unit<Q>getBaseUnit()Gets the value of the property baseUnit.intgetNumberOfDecimals()Gets the value of the property numberOfDecimals.intgetNumberOfIntegers()Gets the value of the property numberOfIntegers.javax.measure.Unit<Q>getUnit()Gets the value of the property unit.javafx.util.StringConverter<javax.measure.Unit<Q>>getUnitStringConverter()Gets the value of the property unitStringConverter.DoublegetValue()Gets the value of the property value.javax.measure.Quantity<Q>getValueQuantity()Gets the value of the property valueQuantity.booleanisReadOnly()Gets the value of the property readOnly.javafx.beans.property.IntegerPropertynumberOfDecimalsProperty()The maximum digits in the decimal part of the number.javafx.beans.property.IntegerPropertynumberOfIntegersProperty()The maximum digits in the integer part of the number.javafx.beans.property.BooleanPropertyreadOnlyProperty()Boolean property used to restrict the edition in the control.voidsetBaseUnit(javax.measure.Unit<Q> baseUnit)Sets the value of the property baseUnit.voidsetNumberOfDecimals(int numberOfDecimals)Sets the value of the property numberOfDecimals.voidsetNumberOfIntegers(int numberOfIntegers)Sets the value of the property numberOfIntegers.voidsetReadOnly(boolean readOnly)Sets the value of the property readOnly.voidsetUnit(javax.measure.Unit<Q> unit)Sets the value of the property unit.voidsetUnitStringConverter(javafx.util.StringConverter<javax.measure.Unit<Q>> unitStringConverter)Sets the value of the property unitStringConverter.voidsetValue(Double value)Sets the value of the property value.javafx.beans.property.ObjectProperty<javax.measure.Unit<Q>>unitProperty()The selected type for the quantity value.javafx.beans.property.ObjectProperty<javafx.util.StringConverter<javax.measure.Unit<Q>>>unitStringConverterProperty()String converter that allows customization of unit label on the skin.javafx.beans.property.ObjectProperty<Double>valueProperty()Represents the quantitative amount in the specific unit.javafx.beans.property.ReadOnlyObjectProperty<javax.measure.Quantity<Q>>valueQuantityProperty()Represents the quantity which is the combination ofvalueProperty()andunitProperty().Methods inherited from class javafx.scene.control.Control
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, createDefaultSkin, executeAccessibleAction, getBaselineOffset, getClassCssMetaData, getContextMenu, getControlCssMetaData, getCssMetaData, getInitialFocusTraversable, getSkin, getTooltip, isResizable, layoutChildren, queryAccessibleAttribute, setContextMenu, setSkin, setTooltip, skinProperty, tooltipPropertyMethods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthPropertyMethods inherited from class javafx.scene.Parent
getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setNeedsLayout, updateBoundsMethods inherited from class javafx.scene.Node
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visibleProperty
-
Property Details
-
value
Represents the quantitative amount in the specific unit. Basically represents the number introduced by the user.- See Also:
getValue(),setValue(Double)
-
unit
public final javafx.beans.property.ObjectProperty<javax.measure.Unit<Q extends javax.measure.Quantity<Q>>> unitPropertyThe selected type for the quantity value.- See Also:
getUnit(),setUnit(Unit)
-
valueQuantity
public final javafx.beans.property.ReadOnlyObjectProperty<javax.measure.Quantity<Q extends javax.measure.Quantity<Q>>> valueQuantityPropertyRepresents the quantity which is the combination ofvalueProperty()andunitProperty(). This value is calculated automatically by the control. It is refreshed every time the value or the unit change.- See Also:
getValueQuantity()
-
baseUnit
public final javafx.beans.property.ObjectProperty<javax.measure.Unit<Q extends javax.measure.Quantity<Q>>> baseUnitPropertyRepresents the system base unit, which is the default one for the control. If theunitselected 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.- See Also:
getBaseUnit(),setBaseUnit(Unit)
-
readOnly
public final javafx.beans.property.BooleanProperty readOnlyPropertyBoolean property used to restrict the edition in the control. If this is set totruethe control will be disabled.- See Also:
isReadOnly(),setReadOnly(boolean)
-
unitStringConverter
public final javafx.beans.property.ObjectProperty<javafx.util.StringConverter<javax.measure.Unit<Q extends javax.measure.Quantity<Q>>>> unitStringConverterPropertyString converter that allows customization of unit label on the skin. -
numberOfIntegers
public final javafx.beans.property.IntegerProperty numberOfIntegersPropertyThe maximum digits in the integer part of the number.- See Also:
getNumberOfIntegers(),setNumberOfIntegers(int)
-
numberOfDecimals
public final javafx.beans.property.IntegerProperty numberOfDecimalsPropertyThe maximum digits in the decimal part of the number.- See Also:
getNumberOfDecimals(),setNumberOfDecimals(int)
-
-
Constructor Details
-
QuantityInputControl
public QuantityInputControl()Instances a new input field with no available units, null value and no precision.
-
-
Method Details
-
valueProperty
Represents the quantitative amount in the specific unit. Basically represents the number introduced by the user.- See Also:
getValue(),setValue(Double)
-
getValue
Gets the value of the property value.- Property description:
- Represents the quantitative amount in the specific unit. Basically represents the number introduced by the user.
-
setValue
Sets the value of the property value.- Property description:
- Represents the quantitative amount in the specific unit. Basically represents the number introduced by the user.
-
unitProperty
The selected type for the quantity value.- See Also:
getUnit(),setUnit(Unit)
-
getUnit
Gets the value of the property unit.- Property description:
- The selected type for the quantity value.
-
setUnit
Sets the value of the property unit.- Property description:
- The selected type for the quantity value.
-
valueQuantityProperty
public final javafx.beans.property.ReadOnlyObjectProperty<javax.measure.Quantity<Q>> valueQuantityProperty()Represents the quantity which is the combination ofvalueProperty()andunitProperty(). This value is calculated automatically by the control. It is refreshed every time the value or the unit change.- See Also:
getValueQuantity()
-
getValueQuantity
Gets the value of the property valueQuantity.- Property description:
- Represents the quantity which is the combination of
valueProperty()andunitProperty(). This value is calculated automatically by the control. It is refreshed every time the value or the unit change.
-
getAvailableUnits
The list of available units supported within the control, this is the list of units the user has available to select from.- Returns:
- The list of units available in the control.
-
baseUnitProperty
Represents the system base unit, which is the default one for the control. If theunitselected 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.- See Also:
getBaseUnit(),setBaseUnit(Unit)
-
getBaseUnit
Gets the value of the property baseUnit.- Property description:
- Represents the system base unit, which is the default one for the control. If the
unitselected 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.
-
setBaseUnit
Sets the value of the property baseUnit.- Property description:
- Represents the system base unit, which is the default one for the control. If the
unitselected 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.
-
readOnlyProperty
public final javafx.beans.property.BooleanProperty readOnlyProperty()Boolean property used to restrict the edition in the control. If this is set totruethe control will be disabled.- See Also:
isReadOnly(),setReadOnly(boolean)
-
isReadOnly
public final boolean isReadOnly()Gets the value of the property readOnly.- Property description:
- Boolean property used to restrict the edition in the control. If this is set to
truethe control will be disabled.
-
setReadOnly
public final void setReadOnly(boolean readOnly)Sets the value of the property readOnly.- Property description:
- Boolean property used to restrict the edition in the control. If this is set to
truethe control will be disabled.
-
unitStringConverterProperty
public final javafx.beans.property.ObjectProperty<javafx.util.StringConverter<javax.measure.Unit<Q>>> unitStringConverterProperty()String converter that allows customization of unit label on the skin. -
getUnitStringConverter
Gets the value of the property unitStringConverter.- Property description:
- String converter that allows customization of unit label on the skin.
-
setUnitStringConverter
public final void setUnitStringConverter(javafx.util.StringConverter<javax.measure.Unit<Q>> unitStringConverter)Sets the value of the property unitStringConverter.- Property description:
- String converter that allows customization of unit label on the skin.
-
numberOfIntegersProperty
public final javafx.beans.property.IntegerProperty numberOfIntegersProperty()The maximum digits in the integer part of the number.- See Also:
getNumberOfIntegers(),setNumberOfIntegers(int)
-
getNumberOfIntegers
public final int getNumberOfIntegers()Gets the value of the property numberOfIntegers.- Property description:
- The maximum digits in the integer part of the number.
-
setNumberOfIntegers
public final void setNumberOfIntegers(int numberOfIntegers)Sets the value of the property numberOfIntegers.- Property description:
- The maximum digits in the integer part of the number.
-
numberOfDecimalsProperty
public final javafx.beans.property.IntegerProperty numberOfDecimalsProperty()The maximum digits in the decimal part of the number.- See Also:
getNumberOfDecimals(),setNumberOfDecimals(int)
-
getNumberOfDecimals
public final int getNumberOfDecimals()Gets the value of the property numberOfDecimals.- Property description:
- The maximum digits in the decimal part of the number.
-
setNumberOfDecimals
public final void setNumberOfDecimals(int numberOfDecimals)Sets the value of the property numberOfDecimals.- Property description:
- The maximum digits in the decimal part of the number.
-