Package com.moneychanger.core

Examples of com.moneychanger.core.Account


        Helpers.obj = obj;
    }

    // OT Helpers
    public static void reloadOTDetails(String accountID) {
        Account account = new OpenTransactionAccount();
        Object details = account.getAccountDetails(accountID);
        OTDetails otDetails = (OTDetails) details;
        populateOTDetails(otDetails);

        JTable table = MainPage.getAccountTable();
        ((AccountTableModel) table.getModel()).setValueAt(otDetails.getBalance(), table.getSelectedRow(), 1);
View Full Code Here


            clearDetailPage();
        }
    }

    public static void loadAccount(String assetID, String serverID, String nymID) {
        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.clearOTAccountList();
                    }
                    account.loadAccount(assetID, serverID, nymID);
                }
            } catch (Exception e) {
                e.printStackTrace();
            }

        }

        ((AccountTableModel) jTable_AccountTable.getModel()).setValue(account.getOTAccountList(), jTable_AccountTable);

    }
View Full Code Here

        ((AccountTableModel) jTable_AccountTable.getModel()).setValue(account.getOTAccountList(), jTable_AccountTable);

    }

    public static void loadAccount(String assetID, String serverID, String nymID, String selectedID) {
        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.clearOTAccountList();
                    }
                    account.loadAccount(assetID, serverID, nymID);
                }
            } catch (Exception e) {
                e.printStackTrace();
            }

        }

        ((AccountTableModel) jTable_AccountTable.getModel()).setValue(account.getOTAccountList(), jTable_AccountTable);


        for (int i = 0; i < jTable_AccountTable.getModel().getRowCount(); i++) {
            System.out.println("selectedID:" + selectedID + "jTable5.getModel().getValueAt(i, 3" + (String) jTable_AccountTable.getModel().getValueAt(i, 3));
            if (Utility.VerifyStringVal(selectedID) && jTable_AccountTable.getModel().getValueAt(i, 3) != null && selectedID.equals(jTable_AccountTable.getModel().getValueAt(i, 3))) {
View Full Code Here

        }

    }

    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);

    }
View Full Code Here

                                    topLayout.show(jPanel_TopPanel, type + "TopPanel");
                                    bottomlayout.show(jPanel_BottomPanel, type + "BottomPanel");
                                    Class obj = Class.forName("com.moneychanger.core." + type);


                                    Account account = (Account) obj.newInstance();
                                    Object details = account.getAccountDetails(accountID);
                                    if (details == null) {
                                        JOptionPane.showMessageDialog(null, "Error loading details", "Details Error", JOptionPane.ERROR_MESSAGE);
                                        break;
                                    }
                                    if ("OpenTransactionAccount".equalsIgnoreCase(type)) {
                                        OTDetails otDetails = (OTDetails) details;
                                        Helpers.populateOTDetails(otDetails);
                                        ((AccountTableModel) jTable_AccountTable.getModel()).setValueAt(otDetails.getBalance(), jTable_AccountTable.getSelectedRow(), 1);
                                    } else if ("CashPurseAccount".equalsIgnoreCase(type)) {
                                        CashPurseDetails cashDetails = (CashPurseDetails) details;
                                        populateCashPurseDetails(cashDetails, cashDetails.getBalance());
                                    }

                                    break;
                                } catch (InstantiationException ex) {
                                    Logger.getLogger(MainPage.class.getName()).log(Level.SEVERE, null, ex);
                                } catch (IllegalAccessException ex) {
                                    Logger.getLogger(MainPage.class.getName()).log(Level.SEVERE, null, ex);
                                } catch (ClassNotFoundException ex) {
                                    Logger.getLogger(MainPage.class.getName()).log(Level.SEVERE, null, ex);
                                }
                                repaint();
                            }

                        }
                    } catch (Exception ex) {
                        ex.printStackTrace();
                    } finally {
                        setCursor(Cursor.getDefaultCursor());
                    }
                }
            }
        });

        nymMap = new NYM().loadNYM();

        jComboBox_Nyms.addItem(new ComboObject("ALL"));
        jComboBoxServerContracts.addItem(new ComboObject("ALL"));
        jComboBox_AssetContracts.addItem(new ComboObject("ALL"));

        Helpers.populateCombo(nymMap, jComboBox_Nyms);

        Contract contract = new Contract();

        serverMap = contract.loadServerContract();
        Helpers.populateCombo(serverMap, jComboBoxServerContracts);

        assetMap = contract.loadAssetContract();
        Helpers.populateCombo(assetMap, jComboBox_AssetContracts);


        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();
                    try {
                        account.loadAccount("ALL", "ALL", "ALL");
                    } catch (Exception ex) {
                        Logger.getLogger(MainPage.class.getName()).log(Level.SEVERE, null, ex);
                    }

                    Class obj1 = Class.forName("com.moneychanger.ui.panels." + Account.allAccounts[i] + "TopPanel");
View Full Code Here

                        String serverID = (String) jTable4.getModel().getValueAt(jTable4.getSelectedRow(), 2);
                        String type = (String) jTable4.getModel().getValueAt(jTable4.getSelectedRow(), 1);
                        System.out.println("selected serverID:" + serverID + " type:" + type);

                        if ("BitcoinAccount".equals(type)) {
                            Account account = null;
                            setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                            try {
                                try {
                                    account = (Account) (Class.forName("com.moneychanger.core." + type)).newInstance();
                                    account.setServerID(serverID);
                                } catch (InstantiationException ex) {
                                    Logger.getLogger(MainPage.class.getName()).log(Level.SEVERE, null, ex);
                                } catch (IllegalAccessException ex) {
                                    Logger.getLogger(MainPage.class.getName()).log(Level.SEVERE, null, ex);
                                }
                            } catch (ClassNotFoundException ex) {
                                Logger.getLogger(MainPage.class.getName()).log(Level.SEVERE, null, ex);
                            }

                            /*if (type.contains("Bitcoin")) {
                            account = new BitcoinAccount(serverID);
                            }*/
                            try {
                                account.loadAccount("", serverID, "");
                                ((OtherTabAccountModel) jTable3.getModel()).setValue(account.getAccountList(), jTable3);

                            } catch (Exception ex) {
                                System.out.println("In BTC load exception:" + ex);
                                JOptionPane.showMessageDialog(null, "Cannot connect to bitcoin service - Connection refused", "Connection Error", JOptionPane.ERROR_MESSAGE);
                                //jTable4.setRowSelectionInterval(WIDTH, WIDTH);

                            } finally {
                                setCursor(Cursor.getDefaultCursor());
                            }
                        } else if ("RippleAccount".equalsIgnoreCase(type)) {
                            CardLayout topLayout = (CardLayout) (jPanel27.getLayout());
                            CardLayout bottomlayout = (CardLayout) (jPanel28.getLayout());
                            topLayout.show(jPanel27, "BlankTop");
                            bottomlayout.show(jPanel28, "BlankBottom");
                            ((OtherTabAccountModel) jTable3.getModel()).clearValue();
                            String[] details = new RippleAccount().loadServerDetails(serverID);
                            if (details != null) {
                                RippleAccountTopPanel.openBrowser(details[0], details[1], details[2], details[3], details[4]);
                            }
                        }
                    }
                }
            });
            //((OtherTabServerTableModel) jTable4.getModel()).setValue(new NYM().loadNYM(), jTable4);

            jTable3.getSelectionModel().addListSelectionListener(new ListSelectionListener() {

                public void valueChanged(ListSelectionEvent e) {
                    if (e.getValueIsAdjusting()) {
                        return;
                    }
                    System.out.println("valueChanged Action Listener :" + jTable3.getSelectedRow() + "e:" + e.getSource());
                    if (jTable3.getSelectedRow() >= 0) {
                        try {

                            jPanel27.setVisible(true);
                            jPanel28.setVisible(true);

                            CardLayout topLayout = (CardLayout) (jPanel27.getLayout());
                            CardLayout bottomlayout = (CardLayout) (jPanel28.getLayout());

                            String type = null;
                            String accountID = null;

                            type = (String) jTable3.getModel().getValueAt(jTable3.getSelectedRow(), 2);
                            accountID = (String) jTable3.getModel().getValueAt(jTable3.getSelectedRow(), 3);

                            System.out.println("Type:" + type);

                            setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));


                            for (int i = 0; i < Account.allAccounts.length; i++) {

                                if (Account.allAccounts[i].equalsIgnoreCase(type)) {
                                    try {
                                        topLayout.show(jPanel27, type + "TopPanel");
                                        bottomlayout.show(jPanel28, type + "BottomPanel");
                                        Class obj = Class.forName("com.moneychanger.core." + type);

                                        Account account = (Account) obj.newInstance();
                                        account.setServerID((String) jTable4.getModel().getValueAt(jTable4.getSelectedRow(), 2));
                                        Object details = account.getAccountDetails(accountID);
                                        if (details == null) {
                                            JOptionPane.showMessageDialog(null, "Error loading details", "Details Error", JOptionPane.ERROR_MESSAGE);
                                            break;
                                        }
                                        if ("BitcoinAccount".equalsIgnoreCase(type)) {
View Full Code Here

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        try {
            Account account = null;
            Class obj = Class.forName("com.moneychanger.core." + type);
            account = (Account) obj.newInstance();
            boolean status = account.editLabel(accountID, jTextField1.getText());
            if (status) {
                JOptionPane.showMessageDialog(this, "Account edited successfully", "Edit Success", JOptionPane.INFORMATION_MESSAGE);
                MainPage.setOtherTabAccountLabel(jTextField1.getText(),row);
            } else {
                JOptionPane.showMessageDialog(this, "Account could not be edited", "Failure", JOptionPane.ERROR_MESSAGE);
View Full Code Here

        try {
            if("CashPurseAccount".equals(type)){
                JOptionPane.showMessageDialog(this, "Cash Purse Account label cannot not be edited", "Cash Purse label edit", JOptionPane.ERROR_MESSAGE);
                return;
            }
            Account account = null;
            Class obj = Class.forName("com.moneychanger.core." + type);
            account = (Account) obj.newInstance();
            boolean status = account.editLabel(accountID, jTextField_NewLabel.getText());
            if (status) {
                JOptionPane.showMessageDialog(this, "Account edited successfully", "Edit Success", JOptionPane.INFORMATION_MESSAGE);
            } else {
                JOptionPane.showMessageDialog(this, "Account could not be edited", "Failure", JOptionPane.ERROR_MESSAGE);
            }
View Full Code Here

TOP

Related Classes of com.moneychanger.core.Account

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.