Transition creates a fade effect animation that spans its
duration. This is done by updating the opacity variable of
the node at regular intervals.
It starts from the fromValue if provided else uses the node's
opacity value.
It stops at the toValue value if provided else it will use start
value plus byValue.
The toValue takes precedence if both toValue and
byValue are specified.
Code Segment Example:
import javafx.scene.shape.*;
import javafx.animation.*;
...
Rectangle rect = new Rectangle (100, 40, 100, 100);
rect.setArcHeight(50);
rect.setArcWidth(50);
rect.setFill(Color.VIOLET);
FadeTransition ft = new FadeTransition(Duration.millis(3000), rect);
ft.setFromValue(1.0);
ft.setToValue(0.3);
ft.setCycleCount(4);
ft.setAutoReverse(true);
ft.play();
...
Transition, Animation
| Modifier and Type | Field and Description |
|---|---|
| private DoubleProperty | byValue
Specifies the incremented stop opacity value, from the start, of this
|
| private Node | |
| private static final double | |
| private static final Duration | |
| private static final double | |
| private static final Node | |
| private static final double | |
| private double | |
| private ObjectProperty | duration
The duration of this |
| private static final double | |
| private DoubleProperty | fromValue
Specifies the start opacity value for this |
| private ObjectProperty | node
The target node of this |
| private double | |
| private DoubleProperty | toValue
Specifies the stop opacity value for this |
| Access | Constructor and Description |
|---|---|
| public | FadeTransition(Duration
The duration of the duration, Node FadeTransitionThe node)node which opacity will be animatedThe constructor of |
| public | FadeTransition(Duration
The duration of the duration)FadeTransitionThe constructor of |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final DoubleProperty | |
| public final ObjectProperty | |
| public final DoubleProperty | |
| public final double | |
| public final Duration | |
| public final double | |
| public final Node | |
| private Node | |
| public final double | |
| protected void | interpolate(double
The relative position frac)Implements abstract javafx. The method |
| public final ObjectProperty | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| pack-priv boolean | |
| pack-priv void | |
| public final DoubleProperty |
| byValue | back to summary |
|---|---|
| private DoubleProperty byValue Specifies the incremented stop opacity value, from the start, of this
It is not possible to change | |
| cachedNode | back to summary |
|---|---|
| private Node cachedNode | |
| DEFAULT_BY_VALUE | back to summary |
|---|---|
| private static final double DEFAULT_BY_VALUE | |
| DEFAULT_DURATION | back to summary |
|---|---|
| private static final Duration DEFAULT_DURATION | |
| DEFAULT_FROM_VALUE | back to summary |
|---|---|
| private static final double DEFAULT_FROM_VALUE | |
| DEFAULT_NODE | back to summary |
|---|---|
| private static final Node DEFAULT_NODE | |
| DEFAULT_TO_VALUE | back to summary |
|---|---|
| private static final double DEFAULT_TO_VALUE | |
| delta | back to summary |
|---|---|
| private double delta | |
| duration | back to summary |
|---|---|
| private ObjectProperty<Duration> duration The duration of this
It is not possible to change the Note While the unit of
| |
| EPSILON | back to summary |
|---|---|
| private static final double EPSILON | |
| fromValue | back to summary |
|---|---|
| private DoubleProperty fromValue Specifies the start opacity value for this
It is not possible to change
| |
| node | back to summary |
|---|---|
| private ObjectProperty<Node> node The target node of this
It is not possible to change the target | |
| start | back to summary |
|---|---|
| private double start | |
| toValue | back to summary |
|---|---|
| private DoubleProperty toValue Specifies the stop opacity value for this
It is not possible to change
| |
| FadeTransition | back to summary |
|---|---|
| public FadeTransition(Duration duration, Node node) The constructor of | |
| FadeTransition | back to summary |
|---|---|
| public FadeTransition(Duration duration) The constructor of
| |
| FadeTransition | back to summary |
|---|---|
| public FadeTransition() The constructor of | |
| byValueProperty | back to summary |
|---|---|
| public final DoubleProperty byValueProperty() | |
| durationProperty | back to summary |
|---|---|
| public final ObjectProperty | |
| fromValueProperty | back to summary |
|---|---|
| public final DoubleProperty fromValueProperty() | |
| getByValue | back to summary |
|---|---|
| public final double getByValue() | |
| getDuration | back to summary |
|---|---|
| public final Duration getDuration() | |
| getFromValue | back to summary |
|---|---|
| public final double getFromValue() | |
| getNode | back to summary |
|---|---|
| public final Node getNode() | |
| getTargetNode | back to summary |
|---|---|
| private Node getTargetNode() | |
| getToValue | back to summary |
|---|---|
| public final double getToValue() | |
| interpolate | back to summary |
|---|---|
| protected void interpolate(double frac) Implements abstract javafx. Doc from javafx. The method
| |
| nodeProperty | back to summary |
|---|---|
| public final ObjectProperty | |
| setByValue | back to summary |
|---|---|
| public final void setByValue(double value) | |
| setDuration | back to summary |
|---|---|
| public final void setDuration(Duration value) | |
| setFromValue | back to summary |
|---|---|
| public final void setFromValue(double value) | |
| setNode | back to summary |
|---|---|
| public final void setNode(Node value) | |
| setToValue | back to summary |
|---|---|
| public final void setToValue(double value) | |
| startable | back to summary |
|---|---|
| pack-priv boolean startable(boolean forceSync) Overrides javafx.
| |
| sync | back to summary |
|---|---|
| pack-priv void sync(boolean forceSync) Overrides javafx.
| |
| toValueProperty | back to summary |
|---|---|
| public final DoubleProperty toValueProperty() | |