Search in sources :

Example 16 with NYM

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

the class OTWriteCheque method initDateComponent.

private void initDateComponent() {
    dateField = new DateField();
    dateField.setBounds(0, -10, 250, 30);
    jPanel1.add(dateField);
    jPanel1.setBorder(null);
    repaint();
    SwingUtilities.invokeLater(new Runnable() {

        public void run() {
        //calendarpanel = CalendarFactory.createDatePanel();
        }
    });
    jTextArea1.setLineWrap(true);
    nymMap = new NYM().loadNYM();
    Helpers.populateCombo(nymMap, jComboBox1);
/*jPanel1.setLayout(new FlowLayout());
        jPanel1.add(calendarpanel);
        jPanel1.repaint();
        System.out.println("IIIi");*/
}
Also used : NYM(com.moneychanger.core.NYM) DateField(com.moneychanger.ui.custom.DateField)

Example 17 with NYM

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

the class MainPage method paymentClick.

private void paymentClick() throws InterruptedException {
    if (jTable6.getRowCount() < 1)
        return;
    if (jTable6.getSelectedRow() < 0) {
        JOptionPane.showMessageDialog(this, "Please select NYM", "Error", JOptionPane.ERROR_MESSAGE);
        return;
    }
    String nymID = (String) jTable6.getModel().getValueAt(jTable6.getSelectedRow(), 1);
    String serverID = ((String[]) serverMap.get((Integer) jComboSrvPay.getSelectedIndex()))[1];
    boolean isReg = Payments.checkNym(nymID, serverID);
    if (isReg) {
        populatePaymentDetails(serverID, nymID);
    } else {
        int option = JOptionPane.showConfirmDialog(this, "This Nym is not registered on server " + (String) jComboSrvPay.getSelectedItem() + ", Do you want to register?", "Confirn Nym registration", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
        if (option == 0) {
            int status = new NYM().registerNym(serverID, nymID);
            if (status == 0) {
                System.out.println("Nym registered sucessfully on the server");
                populatePaymentDetails(serverID, nymID);
                // Refresh Market NYM list
                MainPage.refreshMarketNym(serverID);
            } else if (status == 1) {
                System.out.println("Nym is already registered on server " + serverID);
                populatePaymentDetails(serverID, nymID);
            } else {
                System.out.println("Cannot register nym on server");
            }
        } else {
            clearPaymentDetails();
        }
    }
/*Map inbox = Payments.getPaymentInboxData(nymID);
        Map outbox = null;
        if (inbox != null) {
            if (inbox.get("Popup") != null) {
                RegisterNYMDialog registerNYM = new RegisterNYMDialog(this, true, nymID);
                registerNYM.setVisible(true);
                String serverID = registerNYM.getPaymentServerID();
                System.out.println("PaymentClick - after reg nym, serverID:" + serverID);
                if (Utility.VerifyStringVal(serverID)) {
                    inbox = Payments.getPaymentInboxRecords(nymID, serverID);
                }
            } else if (inbox.get("serverList") != null) {
                ServerSelectionDialog selectServer = new ServerSelectionDialog(this, true, (Map) inbox.get("serverList"));
                selectServer.setVisible(true);
                String serverID = selectServer.getPaymentServerID();
                System.out.println("PaymentClick - after selecting server, serverID:" + serverID);
                if (Utility.VerifyStringVal(serverID)) {
                    inbox = Payments.getPaymentInboxRecords(nymID, serverID);
                    outbox = Payments.getPaymentOutboxRecords(nymID, serverID);

                    ((PaymentInboxTableModel) jTable20.getModel()).setValue(inbox, jTable20);
                    ((PaymentOutboxTableModel) jTable21.getModel()).setValue(outbox, jTable21);
                    ((PaymentRecordboxTableModel) jTable22.getModel()).setValue(inbox, jTable22);
                }
            }
        }*/
}
Also used : NYM(com.moneychanger.core.NYM) Point(java.awt.Point)

Example 18 with NYM

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

the class MainPage method jButton_DownloadMailActionPerformed.

//GEN-LAST:event_jButton_ComposeActionPerformed
private void jButton_DownloadMailActionPerformed(java.awt.event.ActionEvent evt) {
    //GEN-FIRST:event_jButton_DownloadMailActionPerformed
    if (jTextField_NymID.getText().trim().equals("")) {
        JOptionPane.showMessageDialog(this, "Please select NYM", "Error", JOptionPane.ERROR_MESSAGE);
        return;
    }
    NYM nym = new NYM();
    nymBox = nym.downloadNymBox(jTextField_NymID.getText());
    ((NYMBoxTableModel) jTable8.getModel()).setValue(nymBox, jTable8);
}
Also used : NYM(com.moneychanger.core.NYM) NYMBoxTableModel(com.moneychanger.ui.model.NYMBoxTableModel)

Example 19 with NYM

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

the class MainPage method initPaymentsInitTab.

private void initPaymentsInitTab() {
    PaymentInboxTableModel.removeCols(jTable20);
    PaymentOutboxTableModel.removeCols(jTable21);
    PaymentRecordboxTableModel.removeCols(jTable22);
    setCustomWidthPayments();
    NYMTableModel.removeCols(jTable6);
    Helpers.populateComboWithoutAll(serverMap, jComboSrvPay);
    ((NYMTableModel) jTable6.getModel()).setValue(new NYM().loadNYM(), jTable6);
    jTable6.getSelectionModel().addListSelectionListener(new ListSelectionListener() {

        @Override
        public void valueChanged(ListSelectionEvent e) {
            if (e.getValueIsAdjusting()) {
                return;
            }
            System.out.println("jTable6 valueChanged Payment List Action Listener :" + jTable6.getSelectedRow() + "e:" + e.getSource());
            try {
                setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                paymentClick();
            } catch (InterruptedException ex) {
                Logger.getLogger(MainPage.class.getName()).log(Level.SEVERE, null, ex);
            } finally {
                setCursor(Cursor.getDefaultCursor());
            }
        }
    });
}
Also used : NYMTableModel(com.moneychanger.ui.model.NYMTableModel) NYM(com.moneychanger.core.NYM) ListSelectionEvent(javax.swing.event.ListSelectionEvent) ListSelectionListener(javax.swing.event.ListSelectionListener)

Aggregations

NYM (com.moneychanger.core.NYM)19 Point (java.awt.Point)5 Map (java.util.Map)4 ListSelectionEvent (javax.swing.event.ListSelectionEvent)4 ListSelectionListener (javax.swing.event.ListSelectionListener)4 Contract (com.moneychanger.core.Contract)3 AWTException (java.awt.AWTException)3 NYMBoxTableModel (com.moneychanger.ui.model.NYMBoxTableModel)2 NYMOutboxTableModel (com.moneychanger.ui.model.NYMOutboxTableModel)2 NYMTableModel (com.moneychanger.ui.model.NYMTableModel)2 Account (com.moneychanger.core.Account)1 OpenTransactionAccount (com.moneychanger.core.OpenTransactionAccount)1 RippleAccount (com.moneychanger.core.RippleAccount)1 CashPurseDetails (com.moneychanger.core.dataobjects.CashPurseDetails)1 OTDetails (com.moneychanger.core.dataobjects.OTDetails)1 ComboObject (com.moneychanger.core.util.ComboObject)1 DateField (com.moneychanger.ui.custom.DateField)1 DeleteNYMDialog (com.moneychanger.ui.dialogs.DeleteNYMDialog)1 MarketTableModel (com.moneychanger.ui.model.MarketTableModel)1 MarketTradesTableModel (com.moneychanger.ui.model.MarketTradesTableModel)1