[Webfunds-commits] java/webfunds/client/sox/gui PaymentFrame.java

Ian Grigg iang@cypherpunks.ai
Sat, 17 Mar 2001 18:06:05 -0400 (AST)


iang        01/03/17 18:06:04

  Modified:    webfunds/client SimplePaymentFrame.java
               webfunds/client/sox/gui PaymentFrame.java
  Log:
  uses Contract methods to create amount display string

Revision  Changes    Path
1.52      +5 -4      java/webfunds/client/SimplePaymentFrame.java

Index: SimplePaymentFrame.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/client/SimplePaymentFrame.java,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- SimplePaymentFrame.java	2001/03/14 19:16:14	1.51
+++ SimplePaymentFrame.java	2001/03/17 22:06:04	1.52
@@ -1,5 +1,5 @@
 /*
- * $Id: SimplePaymentFrame.java,v 1.51 2001/03/14 19:16:14 gelderen Exp $
+ * $Id: SimplePaymentFrame.java,v 1.52 2001/03/17 22:06:04 iang Exp $
  *
  * Copyright (c) Systemics Ltd 1995-1999 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -290,7 +290,8 @@
 
         if (!"".equals(tgtName))
         {
-            byte[] bytes = Hex.hex2data(tgtName);
+            byte[] bytes = Id.getBytesFromIdString(tgtName);
+
             tgt = new AccountInfo(bytes, null, null);
         }
         else if (tgt.isBearer())             // what does tgt return ?
@@ -316,7 +317,7 @@
         //
         if ("Make Payment".equals(command))
         {
-            double am = contract.getUnitsOfAccount(longamount);
+            String amount = contract.getPrintableAmount(longamount);
             String tla = contract.getField("currency", "currency_tla");
             String nam = "";
             if (tla == null)
@@ -328,7 +329,7 @@
                 tla = tla + " ";
 
             String msg = NEWLINE +
-                "This is a payment for " + tla + am + nam + NEWLINE +
+                "This is a payment for " + tla + amount + nam + NEWLINE +
                 "from " + source.getName() +
                 " (" + Hex.data2hex(source.getByteArray()) + ")" + NEWLINE +
                 "to   " + tgtName + NEWLINE +



1.7       +5 -4      java/webfunds/client/sox/gui/PaymentFrame.java

Index: PaymentFrame.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/client/sox/gui/PaymentFrame.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- PaymentFrame.java	2001/02/27 01:28:25	1.6
+++ PaymentFrame.java	2001/03/17 22:06:04	1.7
@@ -1,5 +1,5 @@
 /*
- * $Id: PaymentFrame.java,v 1.6 2001/02/27 01:28:25 iang Exp $
+ * $Id: PaymentFrame.java,v 1.7 2001/03/17 22:06:04 iang Exp $
  *
  * Copyright (c) Systemics Ltd 1995-1999 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -344,7 +344,8 @@
 
         if (!"".equals(tgtName))             // text box is (also?) set, use it
         {
-            byte[] bytes = Hex.hex2data(tgtName);
+            byte[] bytes = Id.getBytesFromIdString(tgtName);
+
             target = new AccountInfo(bytes, null, null);
         }
         else if (target.isBearer())             // what does target return ?
@@ -453,7 +454,7 @@
         //
         if (TEXT_PAY.equals(command))
         {
-            double am = contract.getUnitsOfAccount(longamount);
+            String amount = contract.getPrintableAmount(longamount);
             String tla = contract.getField("currency", "currency_tla");
             String nam = "";
             if (tla == null)
@@ -465,7 +466,7 @@
                 tla = tla + " ";
 
             String msg = "\nThis is a " + typeString +
-                         " payment for " + tla + am + nam +
+                         " payment for " + tla + amount + nam +
                          "\nfrom " + source.getName() +
                              " (" + Hex.data2hex(source.getByteArray()) + ")" +
                          "\nto   " + tgtName +