Class FlatAnimatedLafChange
java.lang.Object
com.formdev.flatlaf.extras.FlatAnimatedLafChange
Animated look and feel changing.
Invoke showSnapshot() before setting look and feel and
hideSnapshotWithAnimation() after updating UI. E.g.
FlatAnimatedLafChange.showSnapshot(); UIManager.setLookAndFeel( lafClassName ); FlatLaf.updateUI(); FlatAnimatedLafChange.hideSnapshotWithAnimation();
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static floatprivate static Animatorstatic intThe duration of the animation in milliseconds.private static booleanprivate static final Map<JLayeredPane, JComponent> private static final Map<JLayeredPane, JComponent> static intThe resolution of the animation in milliseconds. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidprivate static voidhideSnapshot(Map<JLayeredPane, JComponent> map) static voidStarts an animation that shows the snapshot (created byshowSnapshot()) with a decreasing alpha.static voidCreate a snapshot of the old UI and shows it on top of the UI.private static voidshowSnapshot(boolean useAlpha, Map<JLayeredPane, JComponent> map) static voidstop()Stops a running animation (if any) and hides the snapshot.
-
Field Details
-
duration
public static int durationThe duration of the animation in milliseconds. Default is 160 ms. -
resolution
public static int resolutionThe resolution of the animation in milliseconds. Default is 30 ms. -
animator
-
oldUIsnapshots
-
newUIsnapshots
-
alpha
private static float alpha -
inShowSnapshot
private static boolean inShowSnapshot
-
-
Constructor Details
-
FlatAnimatedLafChange
public FlatAnimatedLafChange()
-
-
Method Details
-
showSnapshot
public static void showSnapshot()Create a snapshot of the old UI and shows it on top of the UI. Invoke before setting new look and feel. -
showSnapshot
-
hideSnapshotWithAnimation
public static void hideSnapshotWithAnimation()Starts an animation that shows the snapshot (created byshowSnapshot()) with a decreasing alpha. At the end, the snapshot is removed and the new UI is shown. Invoke after updating UI. -
hideSnapshot
private static void hideSnapshot() -
hideSnapshot
-
stop
public static void stop()Stops a running animation (if any) and hides the snapshot.
-