mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-20 13:54:32 +01:00
Return CompletableFuture once applyData is completed with all
calls.
This commit is contained in:
parent
a00667bbc2
commit
8a4d1cb6db
4 changed files with 190 additions and 120 deletions
|
@ -73,6 +73,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import lombok.Setter;
|
||||
|
@ -226,11 +227,8 @@ public abstract class ChartView<T extends ChartViewModel<? extends ChartDataMode
|
|||
findTimeIntervalToggleByTemporalAdjuster(temporalAdjuster).ifPresent(timeIntervalToggleGroup::selectToggle);
|
||||
|
||||
defineAndAddActiveSeries();
|
||||
applyData(); //todo
|
||||
initBoundsForTimelineNavigation();
|
||||
|
||||
updateChartAfterDataChange(); //todo
|
||||
|
||||
// Apply listeners and handlers
|
||||
root.widthProperty().addListener(widthListener);
|
||||
xAxis.getChildrenUnmodifiable().addListener(nodeListChangeListener);
|
||||
|
@ -554,7 +552,7 @@ public abstract class ChartView<T extends ChartViewModel<? extends ChartDataMode
|
|||
chart.getData().add(series);
|
||||
activeSeries.add(series);
|
||||
legendToggleBySeriesName.get(getSeriesId(series)).setSelected(true);
|
||||
updateChartAfterDataChange();
|
||||
applyDataAndUpdate();
|
||||
}
|
||||
|
||||
|
||||
|
@ -562,7 +560,17 @@ public abstract class ChartView<T extends ChartViewModel<? extends ChartDataMode
|
|||
// Data
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
protected abstract void applyData();
|
||||
protected abstract CompletableFuture<Boolean> applyData();
|
||||
|
||||
private void applyDataAndUpdate() {
|
||||
long ts = System.currentTimeMillis();
|
||||
applyData().whenComplete((r, t) -> {
|
||||
log.debug("applyData took {}", System.currentTimeMillis() - ts);
|
||||
long ts2 = System.currentTimeMillis();
|
||||
updateChartAfterDataChange();
|
||||
log.debug("updateChartAfterDataChange took {}", System.currentTimeMillis() - ts2);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementations define which series will be used for setBoundsForTimelineNavigation
|
||||
|
@ -588,16 +596,14 @@ public abstract class ChartView<T extends ChartViewModel<? extends ChartDataMode
|
|||
TemporalAdjusterModel.Interval interval = (TemporalAdjusterModel.Interval) newValue.getUserData();
|
||||
applyTemporalAdjuster(interval.getAdjuster());
|
||||
model.invalidateCache();
|
||||
applyData();
|
||||
updateChartAfterDataChange();
|
||||
applyDataAndUpdate();
|
||||
}
|
||||
|
||||
private void onTimelineChanged() {
|
||||
updateTimeLinePositions();
|
||||
|
||||
model.invalidateCache();
|
||||
applyData();
|
||||
updateChartAfterDataChange();
|
||||
applyDataAndUpdate();//3
|
||||
}
|
||||
|
||||
private void updateTimeLinePositions() {
|
||||
|
@ -635,8 +641,7 @@ public abstract class ChartView<T extends ChartViewModel<? extends ChartDataMode
|
|||
if (isSelected) {
|
||||
chart.getData().add(series);
|
||||
activeSeries.add(series);
|
||||
//model.invalidateCache();
|
||||
applyData();
|
||||
applyDataAndUpdate();
|
||||
|
||||
if (isRadioButtonBehaviour) {
|
||||
// We support different y-axis formats only if isRadioButtonBehaviour is set, otherwise we would get
|
||||
|
@ -646,9 +651,8 @@ public abstract class ChartView<T extends ChartViewModel<? extends ChartDataMode
|
|||
} else if (!isRadioButtonBehaviour) { // if isRadioButtonBehaviour we have removed it already via the code above
|
||||
chart.getData().remove(series);
|
||||
activeSeries.remove(series);
|
||||
|
||||
updateChartAfterDataChange();
|
||||
}
|
||||
updateChartAfterDataChange();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -785,7 +789,7 @@ public abstract class ChartView<T extends ChartViewModel<? extends ChartDataMode
|
|||
dataApplied = true;
|
||||
UserThread.execute(() -> {
|
||||
applyTimeLineNavigationLabels();
|
||||
onTimelineChanged();
|
||||
updateTimeLinePositions();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,8 @@ import bisq.desktop.components.chart.ChartView;
|
|||
|
||||
import bisq.core.locale.Res;
|
||||
|
||||
import bisq.common.util.CompletableFutureUtils;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import javafx.scene.chart.XYChart;
|
||||
|
@ -29,8 +31,12 @@ import javafx.beans.property.DoubleProperty;
|
|||
import javafx.beans.property.ReadOnlyDoubleProperty;
|
||||
import javafx.beans.property.SimpleDoubleProperty;
|
||||
|
||||
import javafx.collections.ObservableList;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
|
@ -121,64 +127,80 @@ public class PriceChartView extends ChartView<PriceChartViewModel> {
|
|||
onSetYAxisFormatter(seriesBsqUsdPrice);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void activateSeries(XYChart.Series<Number, Number> series) {
|
||||
super.activateSeries(series);
|
||||
String seriesId = getSeriesId(series);
|
||||
if (seriesId.equals(getSeriesId(seriesBsqUsdPrice))) {
|
||||
applyBsqUsdPriceChartDataAsync();
|
||||
} else if (seriesId.equals(getSeriesId(seriesBsqBtcPrice))) {
|
||||
applyBsqBtcPriceChartData();
|
||||
} else if (seriesId.equals(getSeriesId(seriesBtcUsdPrice))) {
|
||||
applyBtcUsdPriceChartData();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Data
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
protected void applyData() {
|
||||
protected CompletableFuture<Boolean> applyData() {
|
||||
List<CompletableFuture<Boolean>> allFutures = new ArrayList<>();
|
||||
|
||||
if (activeSeries.contains(seriesBsqUsdPrice)) {
|
||||
applyBsqUsdPriceChartDataAsync();
|
||||
CompletableFuture<Boolean> task1Done = new CompletableFuture<>();
|
||||
allFutures.add(task1Done);
|
||||
applyBsqUsdPriceChartDataAsync(task1Done);
|
||||
}
|
||||
if (activeSeries.contains(seriesBsqBtcPrice)) {
|
||||
applyBsqBtcPriceChartData();
|
||||
CompletableFuture<Boolean> task2Done = new CompletableFuture<>();
|
||||
allFutures.add(task2Done);
|
||||
applyBsqBtcPriceChartData(task2Done);
|
||||
}
|
||||
if (activeSeries.contains(seriesBtcUsdPrice)) {
|
||||
applyBtcUsdPriceChartData();
|
||||
CompletableFuture<Boolean> task3Done = new CompletableFuture<>();
|
||||
allFutures.add(task3Done);
|
||||
applyBtcUsdPriceChartData(task3Done);
|
||||
}
|
||||
|
||||
CompletableFuture<Boolean> task4Done = new CompletableFuture<>();
|
||||
allFutures.add(task4Done);
|
||||
model.averageBsqBtcPrice()
|
||||
.whenComplete((data, t) ->
|
||||
mapToUserThread(() ->
|
||||
averageBsqBtcPriceProperty.set(data)));
|
||||
mapToUserThread(() -> {
|
||||
averageBsqBtcPriceProperty.set(data);
|
||||
task4Done.complete(true);
|
||||
}));
|
||||
|
||||
CompletableFuture<Boolean> task5Done = new CompletableFuture<>();
|
||||
allFutures.add(task5Done);
|
||||
model.averageBsqUsdPrice()
|
||||
.whenComplete((data, t) ->
|
||||
mapToUserThread(() ->
|
||||
averageBsqUsdPriceProperty.set(data)));
|
||||
mapToUserThread(() -> {
|
||||
averageBsqUsdPriceProperty.set(data);
|
||||
task5Done.complete(true);
|
||||
}));
|
||||
|
||||
return CompletableFutureUtils.allOf(allFutures).thenApply(e -> {
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
private void applyBsqUsdPriceChartDataAsync() {
|
||||
private void applyBsqUsdPriceChartDataAsync(CompletableFuture<Boolean> completeFuture) {
|
||||
model.getBsqUsdPriceChartData()
|
||||
.whenComplete((data, t) ->
|
||||
mapToUserThread(() ->
|
||||
seriesBsqUsdPrice.getData().setAll(data)));
|
||||
mapToUserThread(() -> {
|
||||
ObservableList<XYChart.Data<Number, Number>> data1 = seriesBsqUsdPrice.getData();
|
||||
data1.setAll(data);
|
||||
completeFuture.complete(true);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
private void applyBtcUsdPriceChartData() {
|
||||
private void applyBtcUsdPriceChartData(CompletableFuture<Boolean> completeFuture) {
|
||||
model.getBtcUsdPriceChartData()
|
||||
.whenComplete((data, t) ->
|
||||
mapToUserThread(() ->
|
||||
seriesBtcUsdPrice.getData().setAll(data)));
|
||||
mapToUserThread(() -> {
|
||||
seriesBtcUsdPrice.getData().setAll(data);
|
||||
completeFuture.complete(true);
|
||||
}));
|
||||
}
|
||||
|
||||
private void applyBsqBtcPriceChartData() {
|
||||
private void applyBsqBtcPriceChartData(CompletableFuture<Boolean> completeFuture) {
|
||||
model.getBsqBtcPriceChartData()
|
||||
.whenComplete((data, t) ->
|
||||
mapToUserThread(() ->
|
||||
seriesBsqBtcPrice.getData().setAll(data)));
|
||||
mapToUserThread(() -> {
|
||||
seriesBsqBtcPrice.getData().setAll(data);
|
||||
completeFuture.complete(true);
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,8 @@ import bisq.desktop.components.chart.ChartView;
|
|||
|
||||
import bisq.core.locale.Res;
|
||||
|
||||
import bisq.common.util.CompletableFutureUtils;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import javafx.scene.chart.XYChart;
|
||||
|
@ -29,8 +31,10 @@ import javafx.beans.property.LongProperty;
|
|||
import javafx.beans.property.ReadOnlyLongProperty;
|
||||
import javafx.beans.property.SimpleLongProperty;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
|
@ -117,52 +121,61 @@ public class VolumeChartView extends ChartView<VolumeChartViewModel> {
|
|||
onSetYAxisFormatter(seriesUsdVolume);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void activateSeries(XYChart.Series<Number, Number> series) {
|
||||
super.activateSeries(series);
|
||||
|
||||
if (getSeriesId(series).equals(getSeriesId(seriesUsdVolume))) {
|
||||
applyUsdVolumeChartData();
|
||||
} else if (getSeriesId(series).equals(getSeriesId(seriesBtcVolume))) {
|
||||
applyBtcVolumeChartData();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Data
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
protected void applyData() {
|
||||
protected CompletableFuture<Boolean> applyData() {
|
||||
List<CompletableFuture<Boolean>> allFutures = new ArrayList<>();
|
||||
if (activeSeries.contains(seriesUsdVolume)) {
|
||||
applyUsdVolumeChartData();
|
||||
CompletableFuture<Boolean> task1Done = new CompletableFuture<>();
|
||||
allFutures.add(task1Done);
|
||||
applyUsdVolumeChartData(task1Done);
|
||||
}
|
||||
if (activeSeries.contains(seriesBtcVolume)) {
|
||||
applyBtcVolumeChartData();
|
||||
CompletableFuture<Boolean> task2Done = new CompletableFuture<>();
|
||||
allFutures.add(task2Done);
|
||||
applyBtcVolumeChartData(task2Done);
|
||||
}
|
||||
|
||||
CompletableFuture<Boolean> task3Done = new CompletableFuture<>();
|
||||
allFutures.add(task3Done);
|
||||
model.getUsdVolume()
|
||||
.whenComplete((data, t) ->
|
||||
mapToUserThread(() ->
|
||||
usdVolumeProperty.set(data)));
|
||||
mapToUserThread(() -> {
|
||||
usdVolumeProperty.set(data);
|
||||
task3Done.complete(true);
|
||||
}));
|
||||
|
||||
CompletableFuture<Boolean> task4Done = new CompletableFuture<>();
|
||||
allFutures.add(task4Done);
|
||||
model.getBtcVolume()
|
||||
.whenComplete((data, t) ->
|
||||
mapToUserThread(() ->
|
||||
btcVolumeProperty.set(data)));
|
||||
mapToUserThread(() -> {
|
||||
btcVolumeProperty.set(data);
|
||||
task4Done.complete(true);
|
||||
}));
|
||||
|
||||
return CompletableFutureUtils.allOf(allFutures).thenApply(e -> true);
|
||||
}
|
||||
|
||||
private void applyBtcVolumeChartData() {
|
||||
private void applyBtcVolumeChartData(CompletableFuture<Boolean> completeFuture) {
|
||||
model.getBtcVolumeChartData()
|
||||
.whenComplete((data, t) ->
|
||||
mapToUserThread(() ->
|
||||
seriesBtcVolume.getData().setAll(data)));
|
||||
mapToUserThread(() -> {
|
||||
seriesBtcVolume.getData().setAll(data);
|
||||
completeFuture.complete(true);
|
||||
}));
|
||||
}
|
||||
|
||||
private void applyUsdVolumeChartData() {
|
||||
private void applyUsdVolumeChartData(CompletableFuture<Boolean> completeFuture) {
|
||||
model.getUsdVolumeChartData()
|
||||
.whenComplete((data, t) ->
|
||||
mapToUserThread(() ->
|
||||
seriesUsdVolume.getData().setAll(data)));
|
||||
mapToUserThread(() -> {
|
||||
seriesUsdVolume.getData().setAll(data);
|
||||
completeFuture.complete(true);
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,8 @@ import bisq.desktop.components.chart.ChartView;
|
|||
|
||||
import bisq.core.locale.Res;
|
||||
|
||||
import bisq.common.util.CompletableFutureUtils;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import javafx.scene.chart.XYChart;
|
||||
|
@ -29,8 +31,10 @@ import javafx.beans.property.LongProperty;
|
|||
import javafx.beans.property.ReadOnlyLongProperty;
|
||||
import javafx.beans.property.SimpleLongProperty;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
|
@ -134,108 +138,135 @@ public class DaoChartView extends ChartView<DaoChartViewModel> {
|
|||
activateSeries(seriesTotalBurned);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void activateSeries(XYChart.Series<Number, Number> series) {
|
||||
super.activateSeries(series);
|
||||
|
||||
if (getSeriesId(series).equals(getSeriesId(seriesTotalIssued))) {
|
||||
applyTotalIssued();
|
||||
} else if (getSeriesId(series).equals(getSeriesId(seriesCompensation))) {
|
||||
applyCompensation();
|
||||
} else if (getSeriesId(series).equals(getSeriesId(seriesReimbursement))) {
|
||||
applyReimbursement();
|
||||
} else if (getSeriesId(series).equals(getSeriesId(seriesTotalBurned))) {
|
||||
applyTotalBurned();
|
||||
} else if (getSeriesId(series).equals(getSeriesId(seriesBsqTradeFee))) {
|
||||
applyBsqTradeFee();
|
||||
} else if (getSeriesId(series).equals(getSeriesId(seriesProofOfBurn))) {
|
||||
applyProofOfBurn();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Data
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
protected void applyData() {
|
||||
protected CompletableFuture<Boolean> applyData() {
|
||||
List<CompletableFuture<Boolean>> allFutures = new ArrayList<>();
|
||||
if (activeSeries.contains(seriesTotalIssued)) {
|
||||
applyTotalIssued();
|
||||
CompletableFuture<Boolean> task1Done = new CompletableFuture<>();
|
||||
allFutures.add(task1Done);
|
||||
applyTotalIssued(task1Done);
|
||||
}
|
||||
if (activeSeries.contains(seriesCompensation)) {
|
||||
applyCompensation();
|
||||
CompletableFuture<Boolean> task2Done = new CompletableFuture<>();
|
||||
allFutures.add(task2Done);
|
||||
applyCompensation(task2Done);
|
||||
}
|
||||
if (activeSeries.contains(seriesReimbursement)) {
|
||||
applyReimbursement();
|
||||
CompletableFuture<Boolean> task3Done = new CompletableFuture<>();
|
||||
allFutures.add(task3Done);
|
||||
applyReimbursement(task3Done);
|
||||
}
|
||||
if (activeSeries.contains(seriesTotalBurned)) {
|
||||
applyTotalBurned();
|
||||
CompletableFuture<Boolean> task4Done = new CompletableFuture<>();
|
||||
allFutures.add(task4Done);
|
||||
applyTotalBurned(task4Done);
|
||||
}
|
||||
if (activeSeries.contains(seriesBsqTradeFee)) {
|
||||
applyBsqTradeFee();
|
||||
CompletableFuture<Boolean> task5Done = new CompletableFuture<>();
|
||||
allFutures.add(task5Done);
|
||||
applyBsqTradeFee(task5Done);
|
||||
}
|
||||
if (activeSeries.contains(seriesProofOfBurn)) {
|
||||
applyProofOfBurn();
|
||||
CompletableFuture<Boolean> task6Done = new CompletableFuture<>();
|
||||
allFutures.add(task6Done);
|
||||
applyProofOfBurn(task6Done);
|
||||
}
|
||||
|
||||
CompletableFuture<Boolean> task7Done = new CompletableFuture<>();
|
||||
allFutures.add(task7Done);
|
||||
model.getCompensationAmount()
|
||||
.whenComplete((data, t) ->
|
||||
mapToUserThread(() ->
|
||||
compensationAmountProperty.set(data)));
|
||||
mapToUserThread(() -> {
|
||||
compensationAmountProperty.set(data);
|
||||
task7Done.complete(true);
|
||||
}));
|
||||
|
||||
CompletableFuture<Boolean> task8Done = new CompletableFuture<>();
|
||||
allFutures.add(task8Done);
|
||||
model.getReimbursementAmount()
|
||||
.whenComplete((data, t) ->
|
||||
mapToUserThread(() ->
|
||||
reimbursementAmountProperty.set(data)));
|
||||
mapToUserThread(() -> {
|
||||
reimbursementAmountProperty.set(data);
|
||||
task8Done.complete(true);
|
||||
}));
|
||||
|
||||
CompletableFuture<Boolean> task9Done = new CompletableFuture<>();
|
||||
allFutures.add(task9Done);
|
||||
model.getBsqTradeFeeAmount()
|
||||
.whenComplete((data, t) ->
|
||||
mapToUserThread(() ->
|
||||
bsqTradeFeeAmountProperty.set(data)));
|
||||
mapToUserThread(() -> {
|
||||
bsqTradeFeeAmountProperty.set(data);
|
||||
task9Done.complete(true);
|
||||
}));
|
||||
|
||||
CompletableFuture<Boolean> task10Done = new CompletableFuture<>();
|
||||
allFutures.add(task10Done);
|
||||
model.getProofOfBurnAmount()
|
||||
.whenComplete((data, t) ->
|
||||
mapToUserThread(() ->
|
||||
proofOfBurnAmountProperty.set(data)));
|
||||
mapToUserThread(() -> {
|
||||
proofOfBurnAmountProperty.set(data);
|
||||
task10Done.complete(true);
|
||||
}));
|
||||
|
||||
return CompletableFutureUtils.allOf(allFutures).thenApply(e -> true);
|
||||
}
|
||||
|
||||
private void applyTotalIssued() {
|
||||
private void applyTotalIssued(CompletableFuture<Boolean> completeFuture) {
|
||||
model.getTotalIssuedChartData()
|
||||
.whenComplete((data, t) ->
|
||||
mapToUserThread(() ->
|
||||
seriesTotalIssued.getData().setAll(data)));
|
||||
mapToUserThread(() -> {
|
||||
seriesTotalIssued.getData().setAll(data);
|
||||
completeFuture.complete(true);
|
||||
}));
|
||||
}
|
||||
|
||||
private void applyCompensation() {
|
||||
private void applyCompensation(CompletableFuture<Boolean> completeFuture) {
|
||||
model.getCompensationChartData()
|
||||
.whenComplete((data, t) ->
|
||||
mapToUserThread(() ->
|
||||
seriesCompensation.getData().setAll(data)));
|
||||
mapToUserThread(() -> {
|
||||
seriesCompensation.getData().setAll(data);
|
||||
completeFuture.complete(true);
|
||||
}));
|
||||
}
|
||||
|
||||
private void applyReimbursement() {
|
||||
private void applyReimbursement(CompletableFuture<Boolean> completeFuture) {
|
||||
model.getReimbursementChartData()
|
||||
.whenComplete((data, t) ->
|
||||
mapToUserThread(() ->
|
||||
seriesReimbursement.getData().setAll(data)));
|
||||
mapToUserThread(() -> {
|
||||
seriesReimbursement.getData().setAll(data);
|
||||
completeFuture.complete(true);
|
||||
}));
|
||||
}
|
||||
|
||||
private void applyTotalBurned() {
|
||||
private void applyTotalBurned(CompletableFuture<Boolean> completeFuture) {
|
||||
model.getTotalBurnedChartData()
|
||||
.whenComplete((data, t) ->
|
||||
mapToUserThread(() ->
|
||||
seriesTotalBurned.getData().setAll(data)));
|
||||
mapToUserThread(() -> {
|
||||
seriesTotalBurned.getData().setAll(data);
|
||||
completeFuture.complete(true);
|
||||
}));
|
||||
}
|
||||
|
||||
private void applyBsqTradeFee() {
|
||||
private void applyBsqTradeFee(CompletableFuture<Boolean> completeFuture) {
|
||||
model.getBsqTradeFeeChartData()
|
||||
.whenComplete((data, t) ->
|
||||
mapToUserThread(() ->
|
||||
seriesBsqTradeFee.getData().setAll(data)));
|
||||
mapToUserThread(() -> {
|
||||
seriesBsqTradeFee.getData().setAll(data);
|
||||
completeFuture.complete(true);
|
||||
}));
|
||||
}
|
||||
|
||||
private void applyProofOfBurn() {
|
||||
private void applyProofOfBurn(CompletableFuture<Boolean> completeFuture) {
|
||||
model.getProofOfBurnChartData()
|
||||
.whenComplete((data, t) ->
|
||||
mapToUserThread(() ->
|
||||
seriesProofOfBurn.getData().setAll(data)));
|
||||
mapToUserThread(() -> {
|
||||
seriesProofOfBurn.getData().setAll(data);
|
||||
completeFuture.complete(true);
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue