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 a Dimension.
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>> baseUnit
    Represents the system base unit, which is the default one for the control.
    javafx.beans.property.IntegerProperty numberOfDecimals
    The maximum digits in the decimal part of the number.
    javafx.beans.property.IntegerProperty numberOfIntegers
    The maximum digits in the integer part of the number.
    javafx.beans.property.BooleanProperty readOnly
    Boolean property used to restrict the edition in the control.
    javafx.beans.property.ObjectProperty<javax.measure.Unit<Q>> unit
    The selected type for the quantity value.
    javafx.beans.property.ObjectProperty<javafx.util.StringConverter<javax.measure.Unit<Q>>> unitStringConverter
    String converter that allows customization of unit label on the skin.
    javafx.beans.property.ObjectProperty<Double> value
    Represents the quantitative amount in the specific unit.
    javafx.beans.property.ReadOnlyObjectProperty<javax.measure.Quantity<Q>> valueQuantity
    Represents the quantity which is the combination of valueProperty() and unitProperty().

    Properties inherited from class javafx.scene.control.Control

    contextMenu, skin, tooltip

    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, width

    Properties inherited from class javafx.scene.Parent

    needsLayout

    Properties 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

    Fields inherited from class javafx.scene.layout.Region

    USE_COMPUTED_SIZE, USE_PREF_SIZE

    Fields inherited from class javafx.scene.Node

    BASELINE_OFFSET_SAME_AS_HEIGHT
  • 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.
    int getNumberOfDecimals()
    Gets the value of the property numberOfDecimals.
    int getNumberOfIntegers()
    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.
    Double getValue()
    Gets the value of the property value.
    javax.measure.Quantity<Q> getValueQuantity()
    Gets the value of the property valueQuantity.
    boolean isReadOnly()
    Gets the value of the property readOnly.
    javafx.beans.property.IntegerProperty numberOfDecimalsProperty()
    The maximum digits in the decimal part of the number.
    javafx.beans.property.IntegerProperty numberOfIntegersProperty()
    The maximum digits in the integer part of the number.
    javafx.beans.property.BooleanProperty readOnlyProperty()
    Boolean property used to restrict the edition in the control.
    void setBaseUnit​(javax.measure.Unit<Q> baseUnit)
    Sets the value of the property baseUnit.
    void setNumberOfDecimals​(int numberOfDecimals)
    Sets the value of the property numberOfDecimals.
    void setNumberOfIntegers​(int numberOfIntegers)
    Sets the value of the property numberOfIntegers.
    void setReadOnly​(boolean readOnly)
    Sets the value of the property readOnly.
    void setUnit​(javax.measure.Unit<Q> unit)
    Sets the value of the property unit.
    void setUnitStringConverter​(javafx.util.StringConverter<javax.measure.Unit<Q>> unitStringConverter)
    Sets the value of the property unitStringConverter.
    void setValue​(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 of valueProperty() and unitProperty().

    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, tooltipProperty

    Methods 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, widthProperty

    Methods inherited from class javafx.scene.Parent

    getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setNeedsLayout, updateBounds

    Methods 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface javafx.css.Styleable

    getStyleableNode
  • Property Details

    • value

      public final javafx.beans.property.ObjectProperty<Double> valueProperty
      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>>> unitProperty
      The 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>>> 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.
      See Also:
      getValueQuantity()
    • baseUnit

      public final javafx.beans.property.ObjectProperty<javax.measure.Unit<Q extends javax.measure.Quantity<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.
      See Also:
      getBaseUnit(), setBaseUnit(Unit)
    • readOnly

      public final javafx.beans.property.BooleanProperty readOnlyProperty
      Boolean property used to restrict the edition in the control. If this is set to true the 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>>>> unitStringConverterProperty
      String converter that allows customization of unit label on the skin.
      See Also:
      getUnitStringConverter(), setUnitStringConverter(StringConverter)
    • numberOfIntegers

      public final javafx.beans.property.IntegerProperty numberOfIntegersProperty
      The maximum digits in the integer part of the number.
      See Also:
      getNumberOfIntegers(), setNumberOfIntegers(int)
    • numberOfDecimals

      public final javafx.beans.property.IntegerProperty numberOfDecimalsProperty
      The 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

      public final javafx.beans.property.ObjectProperty<Double> valueProperty()
      Represents the quantitative amount in the specific unit. Basically represents the number introduced by the user.
      See Also:
      getValue(), setValue(Double)
    • getValue

      public final 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

      public final void setValue​(Double value)
      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

      public final javafx.beans.property.ObjectProperty<javax.measure.Unit<Q>> unitProperty()
      The selected type for the quantity value.
      See Also:
      getUnit(), setUnit(Unit)
    • getUnit

      public final javax.measure.Unit<Q> getUnit()
      Gets the value of the property unit.
      Property description:
      The selected type for the quantity value.
    • setUnit

      public final void setUnit​(javax.measure.Unit<Q> unit)
      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 of valueProperty() and unitProperty(). This value is calculated automatically by the control. It is refreshed every time the value or the unit change.
      See Also:
      getValueQuantity()
    • getValueQuantity

      public final javax.measure.Quantity<Q> getValueQuantity()
      Gets the value of the property valueQuantity.
      Property description:
      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.
    • getAvailableUnits

      public final 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.
      Returns:
      The list of units available in the control.
    • baseUnitProperty

      public final javafx.beans.property.ObjectProperty<javax.measure.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.
      See Also:
      getBaseUnit(), setBaseUnit(Unit)
    • getBaseUnit

      public final javax.measure.Unit<Q> 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 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.
    • setBaseUnit

      public final void setBaseUnit​(javax.measure.Unit<Q> baseUnit)
      Sets the value of the property baseUnit.
      Property description:
      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.
    • readOnlyProperty

      public final javafx.beans.property.BooleanProperty readOnlyProperty()
      Boolean property used to restrict the edition in the control. If this is set to true the 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 true the 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 true the 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.
      See Also:
      getUnitStringConverter(), setUnitStringConverter(StringConverter)
    • getUnitStringConverter

      public final javafx.util.StringConverter<javax.measure.Unit<Q>> 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.