Java Code Examples for net.bither.bitherj.core.Tx#TxNotificationType

The following examples show how to use net.bither.bitherj.core.Tx#TxNotificationType . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TxNotificationCenter.java    From bither-desktop-java with Apache License 2.0 6 votes vote down vote up
public static void notificatTx(final String address, final Tx tx,
                               final Tx.TxNotificationType txNotificationType, final long deltaBalance) {
    SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
            if (Utils.compareString(address, HDAccount.HDAccountPlaceHolder)) {
                Bither.refreshFrame();
            }
            for (ITxListener txListener : txListenerList) {
                txListener.notificatTx(address, tx, txNotificationType, deltaBalance);
            }
            if (txNotificationType == Tx.TxNotificationType.txReceive) {
                boolean isReceived = deltaBalance > 0;
                long balance = Math.abs(deltaBalance);
                notifyCoins(address, balance, isReceived);
            }
        }
    });


}
 
Example 2
Source File: NotificationAndroidImpl.java    From bither-android with Apache License 2.0 6 votes vote down vote up
@Override
public void notificatTx(String address, Tx tx, Tx.TxNotificationType txNotificationType, long deltaBalance) {
    final Intent broadcast = new Intent(ACTION_ADDRESS_BALANCE);
    broadcast.putExtra(MESSAGE_ADDRESS, address);
    broadcast.putExtra(MESSAGE_DELTA_BALANCE, deltaBalance);
    if (tx != null) {
        broadcast.putExtra(MESSAGE_TX, tx.getTxHash());
    }
    broadcast.putExtra(MESSAGE_TX_NOTIFICATION_TYPE, txNotificationType.getValue());
    BitherApplication.mContext.sendBroadcast(broadcast);
    log.debug("address " + address
            + " balance updated " + deltaBalance
            + (tx != null ? " tx " + Utils.hashToString(tx.getTxHash()) : "")
            + " type:" + txNotificationType.getValue());

}
 
Example 3
Source File: TxNotificationCenter.java    From bither-desktop-java with Apache License 2.0 6 votes vote down vote up
public static void notificatTx(final String address, final Tx tx,
                               final Tx.TxNotificationType txNotificationType, final long deltaBalance) {
    SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
            if (Utils.compareString(address, HDAccount.HDAccountPlaceHolder)) {
                Bither.refreshFrame();
            }
            for (ITxListener txListener : txListenerList) {
                txListener.notificatTx(address, tx, txNotificationType, deltaBalance);
            }
            if (txNotificationType == Tx.TxNotificationType.txReceive) {
                boolean isReceived = deltaBalance > 0;
                long balance = Math.abs(deltaBalance);
                notifyCoins(address, balance, isReceived);
            }
        }
    });


}
 
Example 4
Source File: ShowTransactionsForm.java    From bither-desktop-java with Apache License 2.0 5 votes vote down vote up
@Override
public void notificatTx(String address, Tx tx, Tx.TxNotificationType txNotificationType, long deltaBalance) {
    String actionAddress = "";
    if (Bither.getActionAddress() != null) {
        actionAddress = Bither.getActionAddress().getAddress();
    }
    if (Utils.compareString(address, actionAddress)) {
        displayView(DisplayHint.WALLET_TRANSACTIONS_HAVE_CHANGED);
    }

}
 
Example 5
Source File: ShowTransactionsForm.java    From bither-desktop-java with Apache License 2.0 5 votes vote down vote up
@Override
public void notificatTx(String address, Tx tx, Tx.TxNotificationType txNotificationType, long deltaBalance) {
    String actionAddress = "";
    if (Bither.getActionAddress() != null) {
        actionAddress = Bither.getActionAddress().getAddress();
    }
    if (Utils.compareString(address, actionAddress)) {
        displayView(DisplayHint.WALLET_TRANSACTIONS_HAVE_CHANGED);
    }

}
 
Example 6
Source File: TxNotificationCenter.java    From bither-desktop-java with Apache License 2.0 4 votes vote down vote up
public void notificatTx(String address, Tx tx,
Tx.TxNotificationType txNotificationType, long deltaBalance);
 
Example 7
Source File: NotificationDesktopImpl.java    From bither-desktop-java with Apache License 2.0 4 votes vote down vote up
@Override
public void notificatTx(String address, Tx tx, Tx.TxNotificationType txNotificationType, long deltaBalance) {
    TxNotificationCenter.notificatTx(address, tx, txNotificationType, deltaBalance);

}
 
Example 8
Source File: MenuBar.java    From bither-desktop-java with Apache License 2.0 4 votes vote down vote up
@Override
public void notificatTx(String address, Tx tx, Tx.TxNotificationType txNotificationType, long deltaBalance) {
    updateTickerInfo();
}
 
Example 9
Source File: SingleWalletForm.java    From bither-desktop-java with Apache License 2.0 4 votes vote down vote up
@Override
public void notificatTx(String address, Tx tx, Tx.TxNotificationType txNotificationType, long deltaBalance) {
    updateBalance();
}
 
Example 10
Source File: NotificationService.java    From bitherj with Apache License 2.0 4 votes vote down vote up
void notificatTx(String address, Tx tx, Tx.TxNotificationType txNotificationType,
long deltaBalance);
 
Example 11
Source File: TxNotificationCenter.java    From bither-desktop-java with Apache License 2.0 4 votes vote down vote up
public void notificatTx(String address, Tx tx,
Tx.TxNotificationType txNotificationType, long deltaBalance);
 
Example 12
Source File: NotificationDesktopImpl.java    From bither-desktop-java with Apache License 2.0 4 votes vote down vote up
@Override
public void notificatTx(String address, Tx tx, Tx.TxNotificationType txNotificationType, long deltaBalance) {
    TxNotificationCenter.notificatTx(address, tx, txNotificationType, deltaBalance);

}
 
Example 13
Source File: MenuBar.java    From bither-desktop-java with Apache License 2.0 4 votes vote down vote up
@Override
public void notificatTx(String address, Tx tx, Tx.TxNotificationType txNotificationType, long deltaBalance) {
    updateTickerInfo();
}
 
Example 14
Source File: SingleWalletForm.java    From bither-desktop-java with Apache License 2.0 4 votes vote down vote up
@Override
public void notificatTx(String address, Tx tx, Tx.TxNotificationType txNotificationType, long deltaBalance) {
    updateBalance();
}