Class FXMLAnimationUtil
java.lang.Object
com.serinity.accesscontrol.util.FXMLAnimationUtil
Utility class for handling animations in JavaFX FXML components.
This class provides static helper methods to perform common animations
on JavaFX nodes, such as sliding a WebView in and out of the
viewport. It is designed to simplify UI transitions and make code more
readable and maintainable.
NOTE: All methods in this class are static, and the class cannot be instantiated.
- Since:
- 2026-02-09 FXMLAnimationUtil.java
- Version:
- 1.0
- Author:
- @ZouariOmar (zouariomar20@gmail.com)
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidslideFromTop(javafx.scene.Node node, double distance, int duration, boolean autoHide, int hideDelaySeconds) Animates aNodeby sliding it vertically from top to bottom and optionally hides it after a delay.static voidslideFullScreen(javafx.scene.web.WebView node, double stageWidth, boolean shift) Animates aWebViewby sliding it horizontally across the screen.
-
Method Details
-
slideFullScreen
public static void slideFullScreen(javafx.scene.web.WebView node, double stageWidth, boolean shift) Animates aWebViewby sliding it horizontally across the screen.If
shiftistrue, the WebView will slide to the right edge of the stage. Ifshiftisfalse, it will slide back to its original position (x = 0). This is useful for creating smooth UI transitions when showing or hiding full-screen content.- Parameters:
node- theWebViewto animatestageWidth- the width of the stage, used to calculate the target X positionshift- whether to slide the WebView out (true) or back to its original position (false)- See Also:
-
slideFromTop
public static void slideFromTop(javafx.scene.Node node, double distance, int duration, boolean autoHide, int hideDelaySeconds) Animates aNodeby sliding it vertically from top to bottom and optionally hides it after a delay.Useful for status messages, notifications, or temporary banners in your UI.
- Parameters:
node- theNodeto animate (e.g., Label)distance- how far to slide the node (positive = down)duration- duration of the slide animation in millisecondsautoHide- if true, the node will slide back and be hidden afterhideDelaySecondshideDelaySeconds- seconds to wait before hiding the node// Example usage: FXMLAnimationUtil.slideFromTop(messageStatusLabel, 50, 500, true, 3);
-