Package com.moneychanger.core.dataobjects

Examples of com.moneychanger.core.dataobjects.NymOfferDetails


        return marketListMap;
    }

    public static NymOfferDetails getNymOfferDetails(String serverID, String nymID, String transactionID) {

        NymOfferDetails nymOfferDetails = new NymOfferDetails();

        OfferListNym offerListNym = Helpers.getNYMOffer(serverID, nymID);

        if (offerListNym == null) {
            System.out.println("getNymOfferDetails - offerListNym returns null");
            return null;
        }

        for (int j = 0; j < offerListNym.GetOfferDataNymCount(); j++) {

            OfferDataNym offerDataNym = offerListNym.GetOfferDataNym(j);
            if (offerDataNym == null || !Utility.VerifyStringVal(transactionID)) {
                continue;
            }
            if (transactionID.equals(offerDataNym.getTransaction_id())) {
                nymOfferDetails.setPrice(offerDataNym.getPrice_per_scale());
                nymOfferDetails.setMinIncrement(offerDataNym.getMinimum_increment());
                nymOfferDetails.setTotalAssetsOnOffer(offerDataNym.getTotal_assets());
                double assetCount = -1;
                try {
                    assetCount = Double.parseDouble(offerDataNym.getTotal_assets()) - Double.parseDouble(offerDataNym.getFinished_so_far());
                } catch (NumberFormatException nfe) {
                    nfe.printStackTrace();
                }

                nymOfferDetails.setAssetsStillOnOffer(assetCount == -1 ? "" : String.valueOf(assetCount));

                break;
            }

        }
View Full Code Here


            }
            if (nymRegisteredMap != null && nymRegisteredMap.size() > 0 && jComboBox6.getSelectedIndex() > -1) {
                nymID = ((String[]) nymRegisteredMap.get((Integer) jComboBox6.getSelectedIndex()))[1];
            }
            if (!"ALL".equalsIgnoreCase(nymID)) {
                NymOfferDetails nymOfferDetails = Market.getNymOfferDetails(serverID, nymID, (String) jTable14.getModel().getValueAt(jTable14.getSelectedRow(), 0));
                jLabel47.setVisible(true);
                jLabel48.setVisible(true);
                jLabel49.setVisible(true);
                jLabel50.setVisible(true);

                if (null != nymOfferDetails) {
                    jLabel47.setText(nymOfferDetails.getPrice());
                    jLabel48.setText(nymOfferDetails.getMinIncrement());
                    jLabel49.setText(nymOfferDetails.getTotalAssetsOnOffer());
                    jLabel50.setText(nymOfferDetails.getAssetsStillOnOffer());
                }
            }
        } catch (Exception ex) {
            Logger.getLogger(MainPage.class.getName()).log(Level.SEVERE, null, ex);
        }
View Full Code Here

TOP

Related Classes of com.moneychanger.core.dataobjects.NymOfferDetails

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.