Property wrapping a double value.
The value of a DoubleProperty can be get and set with get(),
getValue(), set(double), and setValue(Number).
A property can be bound and unbound unidirectional with
bind(ObservableValue) and unbind(). Bidirectional bindings
can be created and removed with bindBidirectional(Property) and
unbindBidirectional(Property).
The context of a DoubleProperty can be read with getBean()
and getName().
Note
setting or binding this property to a null value will set the property to "0.0". See setValue(java..
javafx.beans.value.ObservableDoubleValue , javafx.beans.value.WritableDoubleValue , ReadOnlyDoubleProperty, Property
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public ObjectProperty | Returns: the newObjectPropertyOverrides javafx. Creates an |
| public void | bindBidirectional(Property<Number>
the other other)PropertyImplements javafx. Create a bidirectional binding between this |
| public static DoubleProperty | Returns: ADoubleProperty that wraps the
PropertyThe source property)PropertyReturns a |
| public void | setValue(Number
The new value v)Implements javafx. Set the wrapped value. |
| public String | Returns: a string representation of thisDoubleProperty object.Overrides javafx. Returns a string representation of this |
| public void | unbindBidirectional(Property<Number>
the other other)PropertyImplements javafx. Removes a bidirectional binding between this |
| DoubleProperty | back to summary |
|---|---|
| public DoubleProperty() Creates a default | |
| asObject | back to summary |
|---|---|
| public ObjectProperty Overrides javafx. Creates an Can be used for binding an ObjectProperty to DoubleProperty. DoubleProperty doubleProperty = new SimpleDoubleProperty(1.0); ObjectProperty<Double> objectProperty = new SimpleObjectProperty<>(2.0); objectProperty.bind(doubleProperty.asObject());
| |
| bindBidirectional | back to summary |
|---|---|
| public void bindBidirectional(Property<Number> other) Implements javafx. Doc from javafx. Create a bidirectional binding between this It is possible to have multiple bidirectional bindings of one Property. JavaFX bidirectional binding implementation use weak listeners. This means bidirectional binding does not prevent properties from being garbage collected. | |
| doubleProperty | back to summary |
|---|---|
| public static DoubleProperty doubleProperty(final Property<Double> property) Returns a This is very useful when bidirectionally binding an ObjectProperty<Double> and a DoubleProperty. Another approach is to convert the DoubleProperty to ObjectProperty usingDoubleProperty doubleProperty = new SimpleDoubleProperty(1.0); ObjectProperty<Double> objectProperty = new SimpleObjectProperty<>(2.0); // Need to keep the reference as bidirectional binding uses weak references DoubleProperty objectAsDouble = DoubleProperty.doubleProperty(objectProperty); doubleProperty.bindBidirectional(objectAsDouble); asObject() method.Note null values in the source property will be interpreted as 0.0
| |
| setValue | back to summary |
|---|---|
| public void setValue(Number v) Implements javafx. Doc from javafx. Set the wrapped value. Note this method should accept null without throwing an exception, setting "0.0" instead. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides javafx. Returns a string representation of this | |
| unbindBidirectional | back to summary |
|---|---|
| public void unbindBidirectional(Property<Number> other) Implements javafx. Doc from javafx. Removes a bidirectional binding between this
| |