public abstract class DoublePropertyBase extends DoubleProperty
DoublePropertyBase
is the base class for a property
wrapping a double
value.
It provides all the functionality required for a property except for the
ReadOnlyProperty.getBean()
and ReadOnlyProperty.getName()
methods, which must be implemented
by extending classes.DoubleProperty
Modifier and Type | Class and Description |
---|---|
private static class |
DoublePropertyBase.Listener |
private class |
DoublePropertyBase.ValueWrapper |
Modifier and Type | Field and Description |
---|---|
private <any> |
helper |
private InvalidationListener |
listener |
private ObservableDoubleValue |
observable |
private boolean |
valid |
private double |
value |
Constructor and Description |
---|
DoublePropertyBase()
The constructor of the
DoublePropertyBase . |
DoublePropertyBase(double initialValue)
The constructor of the
DoublePropertyBase . |
Modifier and Type | Method and Description |
---|---|
void |
addListener(<any> listener) |
void |
addListener(InvalidationListener listener) |
void |
bind(<any> rawObservable)
Create a unidirection binding for this
Property . |
protected void |
fireValueChangedEvent()
Sends notifications to all attached
InvalidationListeners and
ChangeListeners . |
double |
get() |
protected void |
invalidated()
The method
invalidated() can be overridden to receive
invalidation notifications. |
boolean |
isBound()
Can be used to check, if a
Property is bound. |
private void |
markInvalid() |
void |
removeListener(<any> listener) |
void |
removeListener(InvalidationListener listener) |
void |
set(double newValue) |
java.lang.String |
toString()
Returns a string representation of this
DoublePropertyBase object. |
void |
unbind()
Remove the unidirectional binding for this
Property . |
asObject, bindBidirectional, doubleProperty, setValue, unbindBidirectional
readOnlyDoubleProperty
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getBean, getName
private double value
private ObservableDoubleValue observable
private InvalidationListener listener
private boolean valid
private <any> helper
public DoublePropertyBase()
DoublePropertyBase
.public DoublePropertyBase(double initialValue)
DoublePropertyBase
.initialValue
- the initial value of the wrapped valuepublic void addListener(InvalidationListener listener)
public void removeListener(InvalidationListener listener)
public void addListener(<any> listener)
public void removeListener(<any> listener)
protected void fireValueChangedEvent()
InvalidationListeners
and
ChangeListeners
.
This method is called when the value is changed, either manually by
calling set(double)
or in case of a bound property, if the
binding becomes invalid.private void markInvalid()
protected void invalidated()
invalidated()
can be overridden to receive
invalidation notifications. This is the preferred option in
Objects
defining the property, because it requires less memory.
The default implementation is empty.public double get()
public void set(double newValue)
public boolean isBound()
Property
is bound.true
if the Property
is bound, false
otherwise#bind(javafx.beans.value.ObservableValue)
public void bind(<any> rawObservable)
Property
.
Note that JavaFX has all the bind calls implemented through weak listeners. This means the bound property can be garbage collected and stopped from being updated.
rawObservable
- The observable this Property
should be bound to.public void unbind()
Property
.
If the Property
is not bound, calling this method has no effect.#bind(javafx.beans.value.ObservableValue)
public java.lang.String toString()
DoublePropertyBase
object.toString
in class DoubleProperty
DoublePropertyBase
object.