Refactor listener interfaces.

Refactor listener interfaces into their own package.
Split listener interfaces into smaller interfaces.
Make abstract implementations actually abstract.
Rearrange methods for adding listeners to put executor first.
This commit is contained in:
Ross Nicoll
2015-07-14 23:29:02 +01:00
committed by Andreas Schildbach
parent bd080ac5e4
commit ecbd021167
50 changed files with 862 additions and 359 deletions

View File

@@ -1,7 +1,7 @@
package wallettemplate;
import org.bitcoinj.core.listeners.DownloadProgressTracker;
import org.bitcoinj.core.Coin;
import org.bitcoinj.core.DownloadProgressTracker;
import org.bitcoinj.utils.MonetaryFormat;
import com.subgraph.orchid.TorClient;
import com.subgraph.orchid.TorInitializationListener;

View File

@@ -1,5 +1,7 @@
package wallettemplate.utils;
import org.bitcoinj.core.listeners.AbstractWalletEventListener;
import org.bitcoinj.core.listeners.DownloadProgressTracker;
import org.bitcoinj.core.*;
import javafx.application.Platform;
import javafx.beans.property.ReadOnlyDoubleProperty;
@@ -26,13 +28,15 @@ public class BitcoinUIModel {
}
public void setWallet(Wallet wallet) {
wallet.addEventListener(new AbstractWalletEventListener() {
@Override
public void onWalletChanged(Wallet wallet) {
super.onWalletChanged(wallet);
update(wallet);
wallet.addEventListener(Platform::runLater,
new AbstractWalletEventListener() {
@Override
public void onWalletChanged(Wallet wallet) {
super.onWalletChanged(wallet);
update(wallet);
}
}
}, Platform::runLater);
);
update(wallet);
}