Top Description Inners Fields Constructors Methods
javafx.beans.property

public abstract Class FloatPropertyBase

extends FloatProperty
Class Inheritance
Known Direct Subclasses
javafx.beans.property.SimpleFloatProperty
Imports
javafx.beans.InvalidationListener, .Observable, .WeakListener, javafx.beans.binding.FloatBinding, javafx.beans.value.ChangeListener, .ObservableValue, .ObservableFloatValue, .ObservableNumberValue, com.sun.javafx.binding.ExpressionHelper, java.lang.ref.WeakReference

The class FloatPropertyBase is the base class for a property wrapping a float value. It provides all the functionality required for a property except for the getBean() and getName() methods, which must be implemented by extending classes.
Since
JavaFX 2.0
See Also
FloatProperty

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private abstract class

Field Summary

Modifier and TypeField and Description
private ExpressionHelper<Number>
private InvalidationListener
private ObservableFloatValue
private boolean
private float

Constructor Summary

AccessConstructor and Description
public
FloatPropertyBase()

The constructor of the FloatPropertyBase.

public
FloatPropertyBase(float
the initial value of the wrapped value
initialValue
)

The constructor of the FloatPropertyBase.

Method Summary

Modifier and TypeMethod and Description
public void
addListener(InvalidationListener
The listener to register
listener
)

Implements javafx.beans.Observable.addListener.

Adds an InvalidationListener which will be notified whenever the Observable becomes invalid.

public void
addListener(ChangeListener<? super Number>
The listener to register
listener
)

Implements javafx.beans.value.ObservableValue.addListener.

Adds a ChangeListener which will be notified whenever the value of the ObservableValue changes.

public void
bind(final ObservableValue<? extends Number>
The observable this Property should be bound to.
rawObservable
)

Implements javafx.beans.property.Property.bind.

Create a unidirection binding for this Property.

protected void
fireValueChangedEvent()

Sends notifications to all attached InvalidationListeners and ChangeListeners.

public float
protected void
invalidated()

The method invalidated() can be overridden to receive invalidation notifications.

public boolean
isBound()

Implements javafx.beans.property.Property.isBound.

Can be used to check, if a Property is bound.

private void
public void
removeListener(InvalidationListener
The listener to remove
listener
)

Implements javafx.beans.Observable.removeListener.

Removes the given listener from the list of listeners, that are notified whenever the value of the Observable becomes invalid.

public void
removeListener(ChangeListener<? super Number>
The listener to remove
listener
)

Implements javafx.beans.value.ObservableValue.removeListener.

Removes the given listener from the list of listeners that are notified whenever the value of the ObservableValue changes.

public void
set(float
The new value
newValue
)

Implements javafx.beans.value.WritableFloatValue.set.

Set the wrapped value.

public String

Returns:

a string representation of this FloatPropertyBase object.
toString
()

Overrides javafx.beans.property.FloatProperty.toString.

Returns a string representation of this FloatPropertyBase object.

public void
unbind()

Implements javafx.beans.property.Property.unbind.

Remove the unidirectional binding for this Property.

Inherited from javafx.beans.property.FloatProperty:
asObjectbindBidirectionalfloatPropertysetValueunbindBidirectional

Field Detail

helperback to summary
private ExpressionHelper<Number> helper
listenerback to summary
private InvalidationListener listener
observableback to summary
private ObservableFloatValue observable
validback to summary
private boolean valid
valueback to summary
private float value

Constructor Detail

FloatPropertyBaseback to summary
public FloatPropertyBase()

The constructor of the FloatPropertyBase.

FloatPropertyBaseback to summary
public FloatPropertyBase(float initialValue)

The constructor of the FloatPropertyBase.

Parameters
initialValue:float

the initial value of the wrapped value

Method Detail

addListenerback to summary
public void addListener(InvalidationListener listener)

Implements javafx.beans.Observable.addListener.

Doc from javafx.beans.Observable.addListener.

Adds an InvalidationListener which will be notified whenever the Observable becomes invalid. If the same listener is added more than once, then it will be notified more than once. That is, no check is made to ensure uniqueness.

Note that the same actual InvalidationListener instance may be safely registered for different Observables.

The Observable stores a strong reference to the listener which will prevent the listener from being garbage collected and may result in a memory leak. It is recommended to either unregister a listener by calling removeListener after use or to use an instance of WeakInvalidationListener avoid this situation.

Parameters
listener:InvalidationListener

The listener to register

Annotations
@Override
addListenerback to summary
public void addListener(ChangeListener<? super Number> listener)

Implements javafx.beans.value.ObservableValue.addListener.

Doc from javafx.beans.value.ObservableValue.addListener.

Adds a ChangeListener which will be notified whenever the value of the ObservableValue changes. If the same listener is added more than once, then it will be notified more than once. That is, no check is made to ensure uniqueness.

Note that the same actual ChangeListener instance may be safely registered for different ObservableValues.

The ObservableValue stores a strong reference to the listener which will prevent the listener from being garbage collected and may result in a memory leak. It is recommended to either unregister a listener by calling removeListener after use or to use an instance of WeakChangeListener avoid this situation.

Parameters
listener:ChangeListener<? super Number>

The listener to register

Annotations
@Override
bindback to summary
public void bind(final ObservableValue<? extends Number> rawObservable)

Implements javafx.beans.property.Property.bind.

Doc from javafx.beans.property.Property.bind.

Create a unidirection binding for this 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.

Parameters
rawObservable:ObservableValue<? extends Number>

The observable this Property should be bound to.

Annotations
@Override
fireValueChangedEventback to summary
protected void fireValueChangedEvent()

Sends notifications to all attached InvalidationListeners and ChangeListeners. This method is called when the value is changed, either manually by calling set(float) or in case of a bound property, if the binding becomes invalid.

getback to summary
public float get()

Implements javafx.beans.value.WritableFloatValue.get, javafx.beans.value.ObservableFloatValue.get.

Doc from javafx.beans.value.WritableFloatValue.get.

Get the wrapped value. Unlike getValue(), this method returns primitive float. Needs to be identical to getValue().

Returns:float

The current value

Annotations
@Override
invalidatedback to summary
protected void invalidated()

The method 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.

isBoundback to summary
public boolean isBound()

Implements javafx.beans.property.Property.isBound.

Doc from javafx.beans.property.Property.isBound.

Can be used to check, if a Property is bound.

Returns:boolean

true if the Property is bound, false otherwise

Annotations
@Override
markInvalidback to summary
private void markInvalid()
removeListenerback to summary
public void removeListener(InvalidationListener listener)

Implements javafx.beans.Observable.removeListener.

Doc from javafx.beans.Observable.removeListener.

Removes the given listener from the list of listeners, that are notified whenever the value of the Observable becomes invalid.

If the given listener has not been previously registered (i.e. it was never added) then this method call is a no-op. If it had been previously added then it will be removed. If it had been added more than once, then only the first occurrence will be removed.

Parameters
listener:InvalidationListener

The listener to remove

Annotations
@Override
removeListenerback to summary
public void removeListener(ChangeListener<? super Number> listener)

Implements javafx.beans.value.ObservableValue.removeListener.

Doc from javafx.beans.value.ObservableValue.removeListener.

Removes the given listener from the list of listeners that are notified whenever the value of the ObservableValue changes.

If the given listener has not been previously registered (i.e. it was never added) then this method call is a no-op. If it had been previously added then it will be removed. If it had been added more than once, then only the first occurrence will be removed.

Parameters
listener:ChangeListener<? super Number>

The listener to remove

Annotations
@Override
setback to summary
public void set(float newValue)

Implements javafx.beans.value.WritableFloatValue.set.

Doc from javafx.beans.value.WritableFloatValue.set.

Set the wrapped value. Unlike setValue(java.lang.Number), this method uses primitive float.

Parameters
newValue:float

The new value

Annotations
@Override
toStringback to summary
public String toString()

Overrides javafx.beans.property.FloatProperty.toString.

Returns a string representation of this FloatPropertyBase object.

Returns:String

a string representation of this FloatPropertyBase object.

Annotations
@Override
unbindback to summary
public void unbind()

Implements javafx.beans.property.Property.unbind.

Doc from javafx.beans.property.Property.unbind.

Remove the unidirectional binding for this Property. If the Property is not bound, calling this method has no effect.

Annotations
@Override
javafx.beans.property back to summary

private Class FloatPropertyBase.Listener

extends Object
implements InvalidationListener, WeakListener
Class Inheritance
All Implemented Interfaces
javafx.beans.WeakListener, javafx.beans.InvalidationListener

Field Summary

Modifier and TypeField and Description
private final WeakReference<FloatPropertyBase>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
invalidated(Observable
The Observable that became invalid
observable
)

Implements javafx.beans.InvalidationListener.invalidated.

This method needs to be provided by an implementation of InvalidationListener.

public boolean
wasGarbageCollected()

Implements javafx.beans.WeakListener.wasGarbageCollected.

Returns true if the linked listener was garbage-collected.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

wrefback to summary
private final WeakReference<FloatPropertyBase> wref

Constructor Detail

Listenerback to summary
public Listener(FloatPropertyBase ref)

Method Detail

invalidatedback to summary
public void invalidated(Observable observable)

Implements javafx.beans.InvalidationListener.invalidated.

Doc from javafx.beans.InvalidationListener.invalidated.

This method needs to be provided by an implementation of InvalidationListener. It is called if an Observable becomes invalid.

In general, it is considered bad practice to modify the observed value in this method.

Parameters
observable:Observable

The Observable that became invalid

Annotations
@Override
wasGarbageCollectedback to summary
public boolean wasGarbageCollected()

Implements javafx.beans.WeakListener.wasGarbageCollected.

Doc from javafx.beans.WeakListener.wasGarbageCollected.

Returns true if the linked listener was garbage-collected. In this case, the listener can be removed from the observable.

Returns:boolean

true if the linked listener was garbage-collected.

Annotations
@Override
javafx.beans.property back to summary

private abstract Class FloatPropertyBase.ValueWrapper

extends FloatBinding
Class Inheritance

Field Summary

Modifier and TypeField and Description
private ObservableValue<? extends Number>

Constructor Summary

AccessConstructor and Description
public
ValueWrapper(ObservableValue<? extends Number> observable)

Method Summary

Modifier and TypeMethod and Description
public void
dispose()

Overrides javafx.beans.binding.FloatBinding.dispose.

Implements javafx.beans.binding.Binding.dispose.

A default implementation of dispose() that is empty.

Inherited from javafx.beans.binding.FloatBinding:
addListeneraddListenerbindcomputeValuegetgetDependenciesinvalidateisValidonInvalidatingremoveListenerremoveListenertoStringunbind

Field Detail

observableback to summary
private ObservableValue<? extends Number> observable

Constructor Detail

ValueWrapperback to summary
public ValueWrapper(ObservableValue<? extends Number> observable)

Method Detail

disposeback to summary
public void dispose()

Overrides javafx.beans.binding.FloatBinding.dispose.

Implements javafx.beans.binding.Binding.dispose.

Doc from javafx.beans.binding.FloatBinding.dispose.

A default implementation of dispose() that is empty.

Annotations
@Override