From a7e6fd96c721435b7b26d00404958c79431fad46 Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Fri, 26 Sep 2014 09:57:17 +0200 Subject: [PATCH] Remove TomP2P dependency in ArbitratorBrowser --- .../gui/components/AddressTextField.java | 2 +- .../gui/components/ConfidenceDisplay.java | 233 ------------------ .../java/io/bitsquare/gui/main/MainModel.java | 2 +- .../browser/ArbitratorBrowserController.java | 34 +-- .../ArbitratorRegistrationController.java | 4 - .../main/orders/pending/PendingTradesPM.java | 2 +- .../orders/pending/PendingTradesViewCB.java | 4 +- .../main/trade/orderbook/OrderBookModel.java | 2 +- .../java/io/bitsquare/msg/MessageFacade.java | 45 +++- .../msg/listeners/ArbitratorListener.java | 11 +- 10 files changed, 57 insertions(+), 282 deletions(-) delete mode 100644 src/main/java/io/bitsquare/gui/components/ConfidenceDisplay.java diff --git a/src/main/java/io/bitsquare/gui/components/AddressTextField.java b/src/main/java/io/bitsquare/gui/components/AddressTextField.java index c3c624edc9..fea6d5ba98 100644 --- a/src/main/java/io/bitsquare/gui/components/AddressTextField.java +++ b/src/main/java/io/bitsquare/gui/components/AddressTextField.java @@ -183,7 +183,7 @@ public class AddressTextField extends AnchorPane { this.paymentLabel.set(paymentLabel); } - // TODO find better solution + // TODO find better solution without OverlayManager dependency public void setOverlayManager(OverlayManager overlayManager) { this.overlayManager = overlayManager; } diff --git a/src/main/java/io/bitsquare/gui/components/ConfidenceDisplay.java b/src/main/java/io/bitsquare/gui/components/ConfidenceDisplay.java deleted file mode 100644 index a9c29d06e8..0000000000 --- a/src/main/java/io/bitsquare/gui/components/ConfidenceDisplay.java +++ /dev/null @@ -1,233 +0,0 @@ -/* - * This file is part of Bitsquare. - * - * Bitsquare is free software: you can redistribute it and/or modify it - * under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or (at - * your option) any later version. - * - * Bitsquare is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public - * License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with Bitsquare. If not, see . - */ - -package io.bitsquare.gui.components; - -import io.bitsquare.gui.components.confidence.ConfidenceProgressIndicator; - -import com.google.bitcoin.core.Coin; -import com.google.bitcoin.core.ECKey; -import com.google.bitcoin.core.Transaction; -import com.google.bitcoin.core.TransactionConfidence; -import com.google.bitcoin.core.Wallet; -import com.google.bitcoin.core.WalletEventListener; -import com.google.bitcoin.script.Script; - -import java.util.List; -import java.util.Set; - -import javafx.scene.control.*; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -// TODO in new design not used anymore -@Deprecated -public class ConfidenceDisplay { - private static final Logger log = LoggerFactory.getLogger(ConfidenceDisplay.class); - - private final WalletEventListener walletEventListener; - private final Wallet wallet; - private final Label confirmationLabel; - private TextField balanceTextField; - private Transaction transaction; - private final ConfidenceProgressIndicator progressIndicator; - - public ConfidenceDisplay(Wallet wallet, Label confirmationLabel, TextField balanceTextField, - ConfidenceProgressIndicator progressIndicator) { - this.wallet = wallet; - this.confirmationLabel = confirmationLabel; - this.balanceTextField = balanceTextField; - this.progressIndicator = progressIndicator; - - balanceTextField.setText(""); - confirmationLabel.setVisible(false); - progressIndicator.setVisible(false); - progressIndicator.setProgress(0); - - updateBalance(wallet.getBalance()); - walletEventListener = new WalletEventListener() { - @Override - public void onCoinsReceived(Wallet wallet, Transaction tx, Coin prevBalance, Coin newBalance) { - updateBalance(newBalance); - // log.debug("onCoinsReceived " + newBalance); - } - - @Override - public void onCoinsSent(Wallet wallet, Transaction tx, Coin prevBalance, Coin newBalance) { - updateBalance(newBalance); - } - - @Override - public void onReorganize(Wallet wallet) { - - } - - @Override - public void onTransactionConfidenceChanged(Wallet wallet, Transaction tx) { - updateConfidence(tx); - // log.debug("onTransactionConfidenceChanged tx " + tx.getHashAsString()); - } - - @Override - public void onWalletChanged(Wallet wallet) { - - } - - @Override - public void onScriptsAdded(Wallet wallet, List