Binding calculates a value that depends on one or more sources. The
sources are usually called the dependency of a binding. A binding observes
its dependencies for changes and updates its value automatically.
While a dependency of a binding can be anything, it is almost always an
implementation of javafx.. Binding
implements ObservableValue allowing to use it in another binding.
With that one can assemble very complex bindings from simple bindings.
All bindings in the JavaFX runtime are calculated lazily. That means, if a dependency changes, the result of a binding is not immediately recalculated, but it is marked as invalid. Next time the value of an invalid binding is requested, it is recalculated.
It is recommended to use one of the base classes defined in this package
(e.g. DoubleBinding) to define a custom binding, because these
classes already provide most of the needed functionality. See
DoubleBinding for an example.
DoubleBinding
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public ObservableList | Returns: an unmodifiable ObservableList of the dependenciesReturns the dependencies of a binding in an unmodifiable
|
| public void | |
| public boolean |
| dispose | back to summary |
|---|---|
| public void dispose() Signals to the
All bindings in our implementation use instances of
| |
| getDependencies | back to summary |
|---|---|
| public ObservableList Returns the dependencies of a binding in an unmodifiable
Because this method should not be used in production code, it is
recommended to implement this functionality as sparse as possible. For
example if the dependencies do not change, each call can generate a new
| |
| invalidate | back to summary |
|---|---|
| public void invalidate() Mark a binding as invalid. This forces the recalculation of the value of
the | |
| isValid | back to summary |
|---|---|
| public boolean isValid() Checks if a binding is valid.
| |