Module MaterialFX
Class SynchronizedLongProperty
java.lang.Object
javafx.beans.binding.NumberExpressionBase
javafx.beans.binding.LongExpression
javafx.beans.property.ReadOnlyLongProperty
javafx.beans.property.LongProperty
javafx.beans.property.LongPropertyBase
javafx.beans.property.SimpleLongProperty
io.github.palexdev.materialfx.beans.properties.synced.SynchronizedLongProperty
- All Implemented Interfaces:
SynchronizedProperty<Number>,NumberExpression,Observable,Property<Number>,ReadOnlyProperty<Number>,ObservableLongValue,ObservableNumberValue,ObservableValue<Number>,WritableLongValue,WritableNumberValue,WritableValue<Number>
public class SynchronizedLongProperty
extends SimpleLongProperty
implements SynchronizedProperty<Number>
Implementation of
SynchronizedProperty for long values.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.palexdev.materialfx.beans.properties.base.SynchronizedProperty
SynchronizedProperty.Helper -
Constructor Summary
ConstructorsConstructorDescriptionSynchronizedLongProperty(long initialValue) SynchronizedLongProperty(Object bean, String name) SynchronizedLongProperty(Object bean, String name, long initialValue) -
Method Summary
Modifier and TypeMethodDescriptionvoidawake()Awakes the property by settingSynchronizedProperty.waiting()to false.voidbind(ObservableValue<? extends Number> source) Creates a unidirectional bindings with the given observable.voidbindBidirectional(Property<Number> other) Creates a bidirectional bindings between this property and the given property.voidDelegate method forBiBindingManager.disposeFor(ObservableValue).protected voidbooleanisBound()Overridden to check theBindingManager.isBound(ObservableValue)andBindingManager.isIgnoreBinding(ObservableValue).booleanvoidsetAndWait(Number value, ObservableValue<?> observable) Sets this property's state to "waiting" then usesExecutionUtils.executeWhen(Observable, Runnable, boolean, Supplier, boolean)to "awake" the property when the given observable changes.voidunbind()Overridden to callBindingManager.unbind(ObservableValue).voidunbindBidirectional(Property<Number> other) Overridden to callBiBindingManager.unbind(ObservableValue, ObservableValue).waiting()Methods inherited from class javafx.beans.property.SimpleLongProperty
getBean, getNameMethods inherited from class javafx.beans.property.LongPropertyBase
addListener, addListener, get, invalidated, removeListener, removeListener, set, toStringMethods inherited from class javafx.beans.property.LongProperty
asObject, longProperty, setValueMethods inherited from class javafx.beans.property.ReadOnlyLongProperty
readOnlyLongPropertyMethods inherited from class javafx.beans.binding.LongExpression
add, add, add, add, divide, divide, divide, divide, doubleValue, floatValue, getValue, intValue, longExpression, longExpression, longValue, multiply, multiply, multiply, multiply, negate, subtract, subtract, subtract, subtractMethods inherited from class javafx.beans.binding.NumberExpressionBase
add, asString, asString, asString, divide, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThanOrEqualTo, greaterThanOrEqualTo, greaterThanOrEqualTo, greaterThanOrEqualTo, greaterThanOrEqualTo, isEqualTo, isEqualTo, isEqualTo, isEqualTo, isEqualTo, isEqualTo, isEqualTo, isEqualTo, isNotEqualTo, isNotEqualTo, isNotEqualTo, isNotEqualTo, isNotEqualTo, isNotEqualTo, isNotEqualTo, isNotEqualTo, lessThan, lessThan, lessThan, lessThan, lessThan, lessThanOrEqualTo, lessThanOrEqualTo, lessThanOrEqualTo, lessThanOrEqualTo, lessThanOrEqualTo, multiply, numberExpression, subtractMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface javafx.beans.Observable
addListener, removeListenerMethods inherited from interface javafx.beans.value.ObservableValue
addListener, getValue, removeListenerMethods inherited from interface javafx.beans.property.ReadOnlyProperty
getBean, getNameMethods inherited from interface javafx.beans.value.WritableValue
getValue
-
Constructor Details
-
SynchronizedLongProperty
public SynchronizedLongProperty() -
SynchronizedLongProperty
public SynchronizedLongProperty(long initialValue) -
SynchronizedLongProperty
-
SynchronizedLongProperty
-
-
Method Details
-
setAndWait
Sets this property's state to "waiting" then usesExecutionUtils.executeWhen(Observable, Runnable, boolean, Supplier, boolean)to "awake" the property when the given observable changes. Just like JavaFX properties if the new value is the same as the current value the method returns and does nothing.- Specified by:
setAndWaitin interfaceSynchronizedProperty<Number>- Parameters:
value- the new value of the propertyobservable- the observable to wait for
-
isWaiting
public boolean isWaiting()- Specified by:
isWaitingin interfaceSynchronizedProperty<Number>- Returns:
- whether this property is in waiting state
-
waiting
- Specified by:
waitingin interfaceSynchronizedProperty<Number>- Returns:
- the waiting state property as a read only property
-
awake
public void awake()Awakes the property by settingSynchronizedProperty.waiting()to false. This method should never be invoked by the user, the awakening is automatically managed by the property. If for some reason the property stays in waiting state you are probably doing something wrong.- Specified by:
awakein interfaceSynchronizedProperty<Number>
-
fireValueChangedEvent
protected void fireValueChangedEvent()Overridden to not fire a change event ifwaiting()is true.- Overrides:
fireValueChangedEventin classLongPropertyBase
-
bind
Creates a unidirectional bindings with the given observable. The binding is created using the newBindingManagermechanism. If the property is already bound it is automatically unbound before bindings to the new observable.- Specified by:
bindin interfaceProperty<Number>- Overrides:
bindin classLongPropertyBase- Throws:
IllegalArgumentException- if the given observable is the property itself- See Also:
-
bindBidirectional
Creates a bidirectional bindings between this property and the given property.The binding is created using the new
If the property is already bound unidirectionally it is automatically unbound.BiBindingManagermechanism.If the property is already bound bidirectionally it won't be automatically unbound, just like JavaFX, this way you can have multiple bidirectional bindings
- Specified by:
bindBidirectionalin interfaceProperty<Number>- Overrides:
bindBidirectionalin classLongProperty- Throws:
IllegalArgumentException- if the given observable is the property itself- See Also:
-
unbind
public void unbind()Overridden to callBindingManager.unbind(ObservableValue).- Specified by:
unbindin interfaceProperty<Number>- Overrides:
unbindin classLongPropertyBase
-
unbindBidirectional
Overridden to callBiBindingManager.unbind(ObservableValue, ObservableValue).- Specified by:
unbindBidirectionalin interfaceProperty<Number>- Overrides:
unbindBidirectionalin classLongProperty
-
clearBidirectional
public void clearBidirectional()Delegate method forBiBindingManager.disposeFor(ObservableValue). -
isBound
public boolean isBound()Overridden to check theBindingManager.isBound(ObservableValue)andBindingManager.isIgnoreBinding(ObservableValue).- Specified by:
isBoundin interfaceProperty<Number>- Overrides:
isBoundin classLongPropertyBase- Returns:
- true only if `BindingManager.isBound()` is true and `isIgnoreBound()` is false
-