mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-11-02 05:27:17 +00:00
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:
committed by
Andreas Schildbach
parent
bd080ac5e4
commit
ecbd021167
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user