Search in sources :

Example 1 with TxConfidenceIndicator

use of bisq.desktop.components.indicator.TxConfidenceIndicator in project bisq-desktop by bisq-network.

the class BsqTxListItem method setupConfidence.

private void setupConfidence(BsqWalletService bsqWalletService) {
    txConfidenceIndicator = new TxConfidenceIndicator();
    txConfidenceIndicator.setId("funds-confidence");
    Tooltip tooltip = new Tooltip();
    txConfidenceIndicator.setProgress(0);
    txConfidenceIndicator.setPrefSize(24, 24);
    txConfidenceIndicator.setTooltip(tooltip);
    txConfidenceListener = new TxConfidenceListener(txId) {

        @Override
        public void onTransactionConfidenceChanged(TransactionConfidence confidence) {
            updateConfidence(confidence, tooltip);
        }
    };
    bsqWalletService.addTxConfidenceListener(txConfidenceListener);
    updateConfidence(bsqWalletService.getConfidenceForTxId(txId), tooltip);
}
Also used : TxConfidenceListener(bisq.core.btc.listeners.TxConfidenceListener) TxConfidenceIndicator(bisq.desktop.components.indicator.TxConfidenceIndicator) Tooltip(javafx.scene.control.Tooltip) TransactionConfidence(org.bitcoinj.core.TransactionConfidence)

Example 2 with TxConfidenceIndicator

use of bisq.desktop.components.indicator.TxConfidenceIndicator in project bisq-desktop by bisq-network.

the class StaticProgressIndicatorSkin method initialize.

@SuppressWarnings("deprecation")
private void initialize() {
    TxConfidenceIndicator control = getSkinnable();
    boolean isIndeterminate = control.isIndeterminate();
    if (isIndeterminate) {
        // clean up determinateIndicator
        determinateIndicator = null;
        // create spinner
        spinner = new IndeterminateSpinner(control, this, spinEnabled.get(), progressColor.get());
        getChildren().clear();
        getChildren().add(spinner);
    } else {
        // clean up after spinner
        if (spinner != null) {
            spinner = null;
        }
        // create determinateIndicator
        determinateIndicator = new StaticProgressIndicatorSkin.DeterminateIndicator(control, this, progressColor.get());
        getChildren().clear();
        getChildren().add(determinateIndicator);
    }
}
Also used : TxConfidenceIndicator(bisq.desktop.components.indicator.TxConfidenceIndicator)

Aggregations

TxConfidenceIndicator (bisq.desktop.components.indicator.TxConfidenceIndicator)2 TxConfidenceListener (bisq.core.btc.listeners.TxConfidenceListener)1 Tooltip (javafx.scene.control.Tooltip)1 TransactionConfidence (org.bitcoinj.core.TransactionConfidence)1