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");*/
}
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);
}
}
}*/
}
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);
}
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());
}
}
});
}
Aggregations