/
rgd045
/
crypt-file
Обзор
Документация
Войти
/
rgd045
/
crypt-file
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/main/java/org/cryptomator/ui/controls/FontAwesome5Spinner.java
44 строки
1 KB
Sebastian Stenzel
fix weird fxml bug with spinner, remove redundant functionality from autoanimator
30 июл 2021, 15:03
Не верифицирован
30 июл 2021, 15:03
fa5248c
Код
Авторство
О чём код?
package org.cryptomator.ui.controls; import org.cryptomator.ui.common.Animations; import org.cryptomator.ui.common.AutoAnimator; import javafx.beans.property.BooleanProperty; import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleBooleanProperty; /** * An animated progress spinner using the {@link FontAwesome5IconView} with the spinner glyph. * <p> * Using the default constructor, the animation is always played if the icon is visible. To animate on other conditions, use the constructor with the "spinning" property. */ public class FontAwesome5Spinner extends FontAwesome5IconView { protected final BooleanProperty spinning = new SimpleBooleanProperty(this, "spinning", true); private AutoAnimator animator; public FontAwesome5Spinner() { setGlyph(FontAwesome5Icon.SPINNER); var animation = Animations.createDiscrete360Rotation(this); this.animator = AutoAnimator.animate(animation) // .afterStop(() -> setRotate(0)) // .onCondition(spinning.and(visibleProperty())) // .build(); } /* Getter/Setter */ public BooleanProperty spinningProperty() { return spinning; } public boolean isSpinning() { return spinning.get(); } public void setSpinning(boolean spinning) { this.spinning.set(spinning); } }