Exemplo n.º 1
0
 @Override
 public void actionPerformed(ActionEvent arg0) {
   ContactFormPanel cfPanel = cfPage.getContent();
   ContactListPanel clPanel = clPage.getContent();
   String sAhra = cfPanel.getFieldText(Contact.Fields.AHRA);
   String uname = cfPanel.getFieldText(Contact.Fields.USER_NAME);
   String fname = cfPanel.getFieldText(Contact.Fields.FULL_NAME);
   String group = cfPanel.getFieldText(Contact.Fields.GROUP);
   if (AHRA.validate(sAhra)) {
     AHRA ahra = new AHRA(sAhra);
     Contact c = new Contact(ahra, group, uname, fname);
     cList.addContact(c);
     final ContactWidget widget = clPanel.addContact(c, Fields.AHRA);
     System.out.println("Submit: " + c);
     switchView(clPage);
     ((ContactFormPanel) cfPage.getContent()).reset();
     (new Thread() {
           @Override
           public void run() {
             widget.animateAdd();
           }
         })
         .start();
   }
 }
Exemplo n.º 2
0
 private void genBrute() {
   for (int i = 1; i <= LEN; i++) {
     count += (int) Math.pow(n, i);
   }
   bruteList = new String[count];
   count -= 1;
   genBrute("");
   int group = 0;
   for (String s : bruteList) {
     // System.out.println(s);
     if (AHRA.validate(s)) {
       cList.addContact(new Contact(new AHRA(s), group % 3 + "", s, s));
       group++;
     }
   }
 }