Search in sources :

Example 6 with Contract

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

the class IssueAssetContractDialog method jButton1ActionPerformed.

// </editor-fold>//GEN-END:initComponents
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    try {
        setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
        boolean success = new Contract().issueAssetType(jTextField2.getText(), jTextField1.getText(), contractString);
        if (success) {
            JOptionPane.showMessageDialog(this, "Asset issued successfully", "Issue Asset", JOptionPane.INFORMATION_MESSAGE);
            MainPage.loadAccount(assetID, serverID, nymID);
        // refresh
        } else
            JOptionPane.showMessageDialog(this, "Error in Asset issuence", "Asset Issuence Failure", JOptionPane.ERROR_MESSAGE);
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        setCursor(Cursor.getDefaultCursor());
    }
    this.dispose();
}
Also used : Contract(com.moneychanger.core.Contract)

Example 7 with Contract

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

the class MainPage method refreshServerContractList.

private void refreshServerContractList() {
    Contract contract = new Contract();
    ((ServerContractTableModel) jTable_ServerList.getModel()).setValue(contract.loadServerContract(), jTable_ServerList);
    serverMap.clear();
    serverMap = contract.loadServerContract();
    System.out.println("serverv" + serverMap.entrySet());
    Helpers.populateCombo(serverMap, jComboBoxServerContracts);
    Helpers.populateComboWithoutAll(serverMap, jComboBox5);
}
Also used : ServerContractTableModel(com.moneychanger.ui.model.ServerContractTableModel) Contract(com.moneychanger.core.Contract)

Example 8 with Contract

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

the class AssetContractEditDialog method jButton1ActionPerformed.

// </editor-fold>//GEN-END:initComponents
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    //GEN-FIRST:event_jButton1ActionPerformed
    boolean status = new Contract().editLabel(assetID, "Asset", jTextField1.getText());
    if (status) {
        JOptionPane.showMessageDialog(this, "Asset Contract edited successfully", "Edit Success", JOptionPane.INFORMATION_MESSAGE);
        MainPage.setBasketAssetName(jTextField1.getText());
    } else {
        JOptionPane.showMessageDialog(this, "Asset Contract could not be edited", "Failure", JOptionPane.ERROR_MESSAGE);
    }
    this.dispose();
}
Also used : Contract(com.moneychanger.core.Contract)

Example 9 with Contract

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

the class MainPage method jButton_RemoveAccount3ActionPerformed.

//GEN-LAST:event_jButton_EditAccount3ActionPerformed
private void jButton_RemoveAccount3ActionPerformed(java.awt.event.ActionEvent evt) {
    //GEN-FIRST:event_jButton_RemoveAccount3ActionPerformed
    if (jTable_ServerList.getSelectedRow() < 0) {
        JOptionPane.showMessageDialog(this, "Please select Server Contract to delete", "Error", JOptionPane.ERROR_MESSAGE);
        return;
    }
    int userSelection = JOptionPane.showConfirmDialog(this, "Are you sure you want to delete Server Contract", "Server Contract Deletion", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
    System.out.println("userSelection:" + userSelection);
    Contract contract = new Contract();
    if (userSelection == 0) {
        boolean status = contract.deleteServerContract((String) jTable_ServerList.getModel().getValueAt(jTable_ServerList.getSelectedRow(), 1));
        if (status) {
            JOptionPane.showMessageDialog(this, "Server Contract deleted successfully", "Server Contract Deletion", JOptionPane.INFORMATION_MESSAGE);
            refreshServerContractList();
        } else {
            JOptionPane.showMessageDialog(this, "Server Contract cannot be deleted", "Server Contract Deletion", JOptionPane.ERROR_MESSAGE);
        }
    }
}
Also used : Contract(com.moneychanger.core.Contract) Point(java.awt.Point)

Example 10 with Contract

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

the class MainPage method jButton_RemoveAccount2ActionPerformed.

//GEN-LAST:event_jButton_EditAccount2ActionPerformed
private void jButton_RemoveAccount2ActionPerformed(java.awt.event.ActionEvent evt) {
    //GEN-FIRST:event_jButton_RemoveAccount2ActionPerformed
    if (jTable_AssetList.getSelectedRow() < 0) {
        JOptionPane.showMessageDialog(this, "Please select Asset Contract to delete", "Error", JOptionPane.ERROR_MESSAGE);
        return;
    }
    int userSelection = JOptionPane.showConfirmDialog(this, "Are you sure you want to delete Asset Contract", "Asset Contract Deletion", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
    System.out.println("userSelection:" + userSelection);
    Contract contract = new Contract();
    if (userSelection == 0) {
        boolean status = contract.deleteAssetContract((String) jTable_AssetList.getModel().getValueAt(jTable_AssetList.getSelectedRow(), 1));
        if (status) {
            JOptionPane.showMessageDialog(this, "Asset Contract deleted successfully", "Asset Contract Deletion", JOptionPane.INFORMATION_MESSAGE);
            refreshAssetContractList();
        } else {
            JOptionPane.showMessageDialog(this, "Asset Contract cannot be deleted", "Asset Contract Deletion", JOptionPane.ERROR_MESSAGE);
        }
    }
}
Also used : Contract(com.moneychanger.core.Contract) Point(java.awt.Point)

Aggregations

Contract (com.moneychanger.core.Contract)11 NYM (com.moneychanger.core.NYM)3 Point (java.awt.Point)3 AssetContractTableModel (com.moneychanger.ui.model.AssetContractTableModel)2 ServerContractTableModel (com.moneychanger.ui.model.ServerContractTableModel)2 ListSelectionEvent (javax.swing.event.ListSelectionEvent)2 ListSelectionListener (javax.swing.event.ListSelectionListener)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 AWTException (java.awt.AWTException)1 CardLayout (java.awt.CardLayout)1 JPanel (javax.swing.JPanel)1