Search in sources :

Example 16 with OpenTransactionAccount

use of com.moneychanger.core.OpenTransactionAccount in project otapij by FellowTraveler.

the class WithdrawVoucherDialog method jButton1ActionPerformed.

// </editor-fold>//GEN-END:initComponents
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    //GEN-FIRST:event_jButton1ActionPerformed
    try {
        setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
        String voucherText = new OpenTransactionAccount().withdrawVoucher(serverID, nymID, accountID, jTextField2.getText(), jTextArea1.getText(), jTextField1.getText());
        /**
             * Reload the inbox and top accounts panel if success
             */
        if (voucherText != null) {
            new OTVoucherOutput(null, true, voucherText, accountID).setVisible(true);
        } else
            JOptionPane.showMessageDialog(this, "Error in voucher withdrawal", "Error", JOptionPane.ERROR_MESSAGE);
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        setCursor(Cursor.getDefaultCursor());
    }
    dispose();
}
Also used : OpenTransactionAccount(com.moneychanger.core.OpenTransactionAccount)

Example 17 with OpenTransactionAccount

use of com.moneychanger.core.OpenTransactionAccount in project otapij by FellowTraveler.

the class OpenTransactionAccountTopPanel method jButton_InActionPerformed.

//GEN-LAST:event_jButton_VerifyFilesActionPerformed
private void jButton_InActionPerformed(java.awt.event.ActionEvent evt) {
    //GEN-FIRST:event_jButton_InActionPerformed
    try {
        OpenTransactionAccount otAccount = new OpenTransactionAccount();
        String basket = otAccount.showBasket(jTextField_ServerID.getText(), jTextField_NymID.getText(), jTextField_AssetID.getText());
        if (basket != null && basket.length() > 0) {
            new ExchangeBasketDialog(null, true, basket, true, jTextField_ServerID.getText(), jTextField_NymID.getText(), jTextField_AccountID.getText(), jTextField_AssetID.getText()).setVisible(true);
        } else {
            JOptionPane.showMessageDialog(null, "Error getting basket curreny list", "Error", JOptionPane.ERROR_MESSAGE);
        }
    } catch (InterruptedException ex) {
        Logger.getLogger(OpenTransactionAccountTopPanel.class.getName()).log(Level.SEVERE, null, ex);
    }
}
Also used : ExchangeBasketDialog(com.moneychanger.ui.dialogs.ExchangeBasketDialog) OpenTransactionAccount(com.moneychanger.core.OpenTransactionAccount)

Example 18 with OpenTransactionAccount

use of com.moneychanger.core.OpenTransactionAccount in project otapij by FellowTraveler.

the class OTWriteCheque method jButton2ActionPerformed.

//GEN-LAST:event_jTextField1ActionPerformed
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
    //GEN-FIRST:event_jButton2ActionPerformed
    try {
        if (invoice.equals("-") && jTextField1.getText().contains("-")) {
            JOptionPane.showMessageDialog(this, "Please enter positive amount for invoice", "Error", JOptionPane.ERROR_MESSAGE);
            return;
        }
        OpenTransactionAccount openTransactionAccount = new OpenTransactionAccount();
        String validFrom = String.valueOf(System.currentTimeMillis() / 1000);
        String validTo = String.valueOf(dateField);
        /*if(dateField.getDate().getTime()<=System.currentTimeMillis()){
            JOptionPane.showMessageDialog(null , "Expiration date should be greater than today","Date error",JOptionPane.ERROR_MESSAGE);
            return;
            }*/
        this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
        String chequeString = openTransactionAccount.writeCheque(serverID, nymID, accountID, validFrom, validTo, jTextArea1.getText(), jTextField3.getText(), invoice + jTextField1.getText());
        System.out.println("chequeString:" + chequeString);
        new OTWriteChequeOutput(null, true, chequeString).setVisible(true);
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        this.setCursor(Cursor.getDefaultCursor());
    }
    this.dispose();
}
Also used : OpenTransactionAccount(com.moneychanger.core.OpenTransactionAccount)

Example 19 with OpenTransactionAccount

use of com.moneychanger.core.OpenTransactionAccount in project otapij by FellowTraveler.

the class MainPage method loadOtherTabAccount.

public static void loadOtherTabAccount(String serverID) {
    Account account = null;
    for (int i = 0; i < Account.allAccounts.length; i++) {
        try {
            if (!"OpenTransactionAccount".equals(Account.allAccounts[i]) && !"CashPurseAccount".equals(Account.allAccounts[i])) {
                Class obj = Class.forName("com.moneychanger.core." + Account.allAccounts[i]);
                account = (Account) obj.newInstance();
                if (i == 0) {
                    account.clearAccountList();
                }
                account.loadAccount("", serverID, "");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    ((OtherTabAccountModel) jTable3.getModel()).setValue(account.getAccountList(), jTable3);
}
Also used : OpenTransactionAccount(com.moneychanger.core.OpenTransactionAccount) RippleAccount(com.moneychanger.core.RippleAccount) Account(com.moneychanger.core.Account) OtherTabAccountModel(com.moneychanger.ui.model.OtherTabAccountModel) Point(java.awt.Point) AWTException(java.awt.AWTException)

Example 20 with OpenTransactionAccount

use of com.moneychanger.core.OpenTransactionAccount in project otapij by FellowTraveler.

the class CashPurseDepositDialog method initValues.

// End of variables declaration//GEN-END:variables
private void initValues() {
    OpenTransactionAccount otAccount = new OpenTransactionAccount();
    accountMap = otAccount.getAccountsForAssetServer(details.getAssetID(), details.getServerID());
    Helpers.populateCombo(accountMap, jComboBox1);
}
Also used : OpenTransactionAccount(com.moneychanger.core.OpenTransactionAccount)

Aggregations

OpenTransactionAccount (com.moneychanger.core.OpenTransactionAccount)22 Account (com.moneychanger.core.Account)5 AWTException (java.awt.AWTException)5 Point (java.awt.Point)5 RippleAccount (com.moneychanger.core.RippleAccount)4 OTDetails (com.moneychanger.core.dataobjects.OTDetails)2 ComboObject (com.moneychanger.core.util.ComboObject)2 ExchangeBasketDialog (com.moneychanger.ui.dialogs.ExchangeBasketDialog)2 AccountTableModel (com.moneychanger.ui.model.AccountTableModel)2 OtherTabAccountModel (com.moneychanger.ui.model.OtherTabAccountModel)2 CardLayout (java.awt.CardLayout)2 JPanel (javax.swing.JPanel)2 ListSelectionEvent (javax.swing.event.ListSelectionEvent)2 ListSelectionListener (javax.swing.event.ListSelectionListener)2 Contract (com.moneychanger.core.Contract)1 NYM (com.moneychanger.core.NYM)1 BitcoinDetails (com.moneychanger.core.dataobjects.BitcoinDetails)1 CashPurseDetails (com.moneychanger.core.dataobjects.CashPurseDetails)1 DepositCashDialog (com.moneychanger.ui.dialogs.DepositCashDialog)1 BlankPanel (com.moneychanger.ui.panels.BlankPanel)1