-
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package animatefx.animation; | ||
|
||
import javafx.animation.KeyFrame; | ||
import javafx.animation.KeyValue; | ||
import javafx.animation.Timeline; | ||
import javafx.scene.Node; | ||
import javafx.util.Duration; | ||
|
||
|
||
/** | ||
* @author Loïc Sculier aka typhon0 | ||
*/ | ||
public class RollIn { | ||
|
||
/** | ||
* Create new RollIn | ||
* | ||
* @param node The node to affect | ||
*/ | ||
public RollIn(Node node) { | ||
RollIn(node); | ||
} | ||
|
||
private void RollIn(Node node) { | ||
|
||
Timeline t = | ||
new Timeline( | ||
new KeyFrame(Duration.millis(0), | ||
new KeyValue(node.opacityProperty(), 0, AnimateFXInterpolator.EASE), | ||
new KeyValue(node.translateXProperty(), -node.getBoundsInLocal().getWidth(), AnimateFXInterpolator.EASE), | ||
new KeyValue(node.rotateProperty(), -120, AnimateFXInterpolator.EASE) | ||
), | ||
|
||
new KeyFrame(Duration.millis(1000), | ||
|
||
new KeyValue(node.opacityProperty(), 1, AnimateFXInterpolator.EASE), | ||
new KeyValue(node.translateXProperty(), 0, AnimateFXInterpolator.EASE), | ||
new KeyValue(node.rotateProperty(), 0, AnimateFXInterpolator.EASE) | ||
) | ||
); | ||
t.play(); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package animatefx.animation; | ||
|
||
import javafx.animation.KeyFrame; | ||
import javafx.animation.KeyValue; | ||
import javafx.animation.Timeline; | ||
import javafx.scene.Node; | ||
import javafx.util.Duration; | ||
|
||
|
||
/** | ||
* @author Loïc Sculier aka typhon0 | ||
*/ | ||
public class RollOut { | ||
|
||
/** | ||
* Create new RollOut | ||
* | ||
* @param node The node to affect | ||
*/ | ||
public RollOut(Node node) { | ||
RollOut(node); | ||
} | ||
|
||
private void RollOut(Node node) { | ||
|
||
Timeline t = | ||
new Timeline( | ||
new KeyFrame(Duration.millis(0), | ||
new KeyValue(node.opacityProperty(), 1, AnimateFXInterpolator.EASE), | ||
new KeyValue(node.translateXProperty(), 0, AnimateFXInterpolator.EASE), | ||
new KeyValue(node.rotateProperty(), 0, AnimateFXInterpolator.EASE) | ||
), | ||
|
||
new KeyFrame(Duration.millis(1000), | ||
new KeyValue(node.opacityProperty(), 0, AnimateFXInterpolator.EASE), | ||
new KeyValue(node.translateXProperty(), node.getBoundsInLocal().getWidth(), AnimateFXInterpolator.EASE), | ||
new KeyValue(node.rotateProperty(), 120, AnimateFXInterpolator.EASE) | ||
) | ||
); | ||
t.play(); | ||
} | ||
} | ||
|