Add missing support to deactivate animations

This commit is contained in:
Manfred Karrer 2016-03-11 12:46:40 +01:00
parent d24f0bf270
commit 415530c8ef
4 changed files with 11 additions and 5 deletions

View File

@ -91,7 +91,6 @@ public final class Preferences implements Persistable {
// Persisted fields
private String btcDenomination = MonetaryFormat.CODE_BTC;
private boolean useAnimations = true;
private boolean useEffects = true;
private final ArrayList<FiatCurrency> fiatCurrencies;
private final ArrayList<CryptoCurrency> cryptoCurrencies;
private BlockChainExplorer blockChainExplorerMainNet;

View File

@ -31,7 +31,7 @@
<columns>
<TableColumn text="Date/Time" fx:id="dateColumn" minWidth="180" maxWidth="180"/>
<TableColumn text="Details" fx:id="detailsColumn" minWidth="260"/>
<TableColumn text="Address" fx:id="addressColumn" minWidth="320" maxWidth="320">
<TableColumn text="Address" fx:id="addressColumn" minWidth="320">
<cellValueFactory>
<PropertyValueFactory property="addressString"/>
</cellValueFactory>

View File

@ -32,7 +32,7 @@
<TableColumn text="Select" fx:id="selectColumn" minWidth="60" maxWidth="60" sortable="false"/>
<TableColumn text="Date/Time" fx:id="dateColumn" minWidth="180" maxWidth="180"/>
<TableColumn text="Details" fx:id="detailsColumn" minWidth="160"/>
<TableColumn text="Address" fx:id="addressColumn" minWidth="320" maxWidth="320">
<TableColumn text="Address" fx:id="addressColumn" minWidth="320">
<cellValueFactory>
<PropertyValueFactory property="addressString"/>
</cellValueFactory>

View File

@ -409,7 +409,7 @@ public abstract class Overlay<T extends Overlay> {
protected void animateDisplay() {
gridPane.setOpacity(0);
Interpolator interpolator = Interpolator.SPLINE(0.25, 0.1, 0.25, 1);
double duration = 400;
double duration = getDuration(400);
Timeline timeline = new Timeline();
ObservableList<KeyFrame> keyFrames = timeline.getKeyFrames();
@ -475,7 +475,7 @@ public abstract class Overlay<T extends Overlay> {
protected void animateHide(Runnable onFinishedHandler) {
Interpolator interpolator = Interpolator.SPLINE(0.25, 0.1, 0.25, 1);
double duration = 200;
double duration = getDuration(200);
Timeline timeline = new Timeline();
ObservableList<KeyFrame> keyFrames = timeline.getKeyFrames();
@ -740,6 +740,13 @@ public abstract class Overlay<T extends Overlay> {
truncatedMessage = message;
}
private int getDuration(int duration) {
if (preferences != null)
return preferences.getUseAnimations() ? duration : 1;
else
return duration;
}
@Override
public String toString() {
return "Popup{" +