protected void beforeMyProfile(Form f) { Myprofile = f; Label l1 = (Label) findByName("propic", f); name = (TextField) findByName("name", Myprofile); index = (TextField) findByName("index", Myprofile); tel = (TextField) findByName("tel", Myprofile); addr = (TextField) findByName("addr", Myprofile); email = (TextField) findByName("email", Myprofile); group = (TextField) findByName("group", Myprofile); try { String userde[] = Splitter.Split(new String(record.getRecord(4)), "-"); name.setText(userde[0]); index.setText(userde[1]); tel.setText(userde[2]); addr.setText(userde[3]); email.setText(userde[4]); group.setText(userde[5]); if (new String(record.getRecord(2)).equals("no")) { l1.setIcon(Image.createImage("/no_user.png").scaledHeight(72)); } else { l1.setIcon(Image.createImage(new String(record.getRecord(2))).scaledHeight(72)); } System.gc(); } catch (Exception e) { } super.beforeMyProfile(f); }
protected void beforeGUI1(Form f) { try { HttpCon con12 = new HttpCon(null, PropertyClass.ServerUrl + "Allfrends"); con12.SetContype(false, true, true); Thread t = new Thread(con12); synchronized (t) { t.start(); t.wait(); } final String bf[] = Splitter.Split(con12.getValue().toString(), "-"); System.out.println(bf); final List l = (List) findByName("studentlist", f); for (int i = 0; i < bf.length - 1; i++) { l.addItem(Splitter.Split(bf[i], "/")[0]); } l.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent ae) { frndid = Splitter.Split(bf[l.getSelectedIndex()], "/")[1]; showForm("Userprofile", null); } }); } catch (Exception e) { System.out.println(e); } super.beforeGUI1(f); }
protected void beforeSurah(Form f) { // If the resource file changes the names of components this call will break notifying you that // you should fix the code super.beforeSurah(f); try { selectSurah = findSurahSelect(f); selectSurah.setVisible(false); } catch (Exception e) { Dialog.show(null, "beforeSurah excepption", "OK", null); } }
protected boolean initListModelListSurah(List cmp) { // If the resource file changes the names of components this call will break notifying you that // you should fix the code super.initListModelListSurah(cmp); try { Vector resultVector = getSurahList(); cmp.setModel(new DefaultListModel(resultVector)); cmp.setRenderer(new SurahListRenderer()); } catch (Exception e) { Dialog.show(null, "initListModelListSurah excepption", "OK", null); } return true; }
protected void beforeWallpaper(Form f) { // If the resource file changes the names of components this call will break notifying you that // you should fix the code super.beforeWallpaper(f); ContainerList containerList = findContainerListWallpaper(f); // List cmp = new List(); // Vector resultVector = parseWallpaperThumbnailJSON(wallpaperUrlResponse, cmp); // cmp.setModel(new DefaultListModel(resultVector)); parseWallpaperThumbnailJSON(containerList); // Container containerWallpaper = findContainerWallpaper(f); // parseWallpaperThumbnailJSON(containerWallpaper); }
protected void exitAaya(Form f) { // If the resource file changes the names of components this call will break notifying you that // you should fix the code super.exitAaya(f); try { List list = findListAaya(f); final DefaultListModel defaultListModel = (DefaultListModel) list.getModel(); defaultListModel.removeAll(); aayaList = null; selectedSurahPartNumber = 1; } catch (Exception e) { Dialog.show(null, "exit Aaya exception", "OK", null); } }
protected void exitSurah(Form f) { // If the resource file changes the names of components this call will break notifying you that // you should fix the code super.exitSurah(f); try { List list = findListSurah(f); final DefaultListModel defaultListModel = (DefaultListModel) list.getModel(); defaultListModel.removeAll(); selectSurah = null; } catch (Exception e) { e.printStackTrace(); Dialog.show(null, "exitSurah Exception", "OK", null); } }
protected boolean initListModelListAaya(List cmp) { // If the resource file changes the names of components this call will break notifying you that // you should fix the code super.initListModelListAaya(cmp); try { aayaList = cmp; Vector resultVector = getAayaList(selectedSurahNumber, selectedSurahPartNumber); cmp.setModel(new DefaultListModel(resultVector)); // cmp.setRenderer(new AayaListRenderer()); } catch (Exception e) { Dialog.show(null, "initListModelListAaya excepption", "OK", null); } return true; }
protected void beforeDepartments(Form f) { department = f; Label l = (Label) findByName("Label2", f); try { HttpCon con12 = new HttpCon( String.valueOf(departmentPerson) + "-p", PropertyClass.ServerUrl + "DepartmentOffiecer"); con12.SetContype(true, true, true); Thread t = new Thread(con12); synchronized (t) { t.start(); t.wait(); } String a[] = Splitter.Split(con12.getValue().toString(), "-"); ((Label) findByName("Label3", f)).setText(a[4]); ((TextArea) findByName("aboutDepartmentt", f)).setText(a[0]); ((Label) findByName("name", f)).setText("Head Dept: " + a[1]); ((Label) findByName("Label7", f)).setText(a[2]); ((Label) findByName("Label8", f)).setText("Tel : " + a[3]); switch (departmentPerson) { case 1: l.setIcon(Image.createImage("/ceo.png").scaledHeight(78)); break; case 2: l.setIcon(Image.createImage("/div1.png").scaledHeight(78)); break; case 3: l.setIcon(Image.createImage("/div2.png").scaledHeight(78)); break; case 4: l.setIcon(Image.createImage("/div3.png").scaledHeight(78)); break; default: l.setIcon(Image.createImage("no_user.png").scaledHeight(78)); break; } departmentPerson = 0; super.beforeDepartments(f); System.gc(); } catch (Exception e) { } }
protected void onSurah_ListSurahAction(Component c, ActionEvent event) { // If the resource file changes the names of components this call will break notifying you that // you should fix the code super.onSurah_ListSurahAction(c, event); try { List l = (List) c; String name = (String) l.getSelectedItem(); selectedSurahNumber = Integer.parseInt(name.substring(0, name.indexOf("."))); if (selectSurah != null) { selectSurah.released(); } else { Dialog.show(null, "selectSurah null", "OK", null); } name = null; } catch (Exception e) { Dialog.show(null, "onSurah_ListSurahAction excepption", "OK", null); } }
protected void beforeLoginGUI(Form f) { Login = f; username = (TextField) findByName("Username", f); password = (TextField) findByName("Password", f); password.setConstraint(TextField.PASSWORD); try { record = RecordStore.openRecordStore("recordpr", true); } catch (Exception e) { } try { record.getRecord(1); } catch (Exception e) { byte[] defaultlogin = "******".getBytes(); byte image[] = "no".getBytes(); byte prio[] = "0-0-0".getBytes(); byte[] userdetail = "n-n-n-n-n-n".getBytes(); try { record.addRecord(defaultlogin, 0, defaultlogin.length); // 1 record.addRecord(image, 0, image.length); // 2 record.addRecord(prio, 0, prio.length); // 3 record.addRecord(userdetail, 0, userdetail.length); defaultlogin = null; image = null; prio = null; userdetail = null; System.gc(); } catch (Exception e1) { System.out.println(e1); } } super.beforeLoginGUI(f); }
protected void beforeUserprofile(Form f) { try { ((Label) findByName("Label2", f)).setIcon(Image.createImage("/no_user.png").scaledHeight(72)); HttpCon con12 = new HttpCon(frndid + "-p", PropertyClass.ServerUrl + "Frends"); con12.SetContype(true, true, true); Thread t = new Thread(con12); synchronized (t) { t.start(); t.wait(); } String frnd[] = Splitter.Split(con12.getValue().toString(), "-"); ((Label) findByName("Label4", f)).setText(frnd[0]); ((Label) findByName("Label6", f)).setText(frnd[1]); ((Label) findByName("tel", f)).setText("Tel " + frnd[2]); ((Label) findByName("Label81", f)).setText("Address " + frnd[3]); ((Label) findByName("Label7", f)).setText("email " + frnd[4]); } catch (Exception ex) { ex.printStackTrace(); } super.beforeUserprofile(f); }
protected void beforePersonalinfo(Form f) { perosnl = f; super.beforePersonalinfo(f); }
protected void beforeHtmlpasrecover(Form f) { HTTPemailsender = f; super.beforeHtmlpasrecover(f); }
protected void beforeTasbih(Form f) { // If the resource file changes the names of components this call will break notifying you that // you should fix the code super.beforeTasbih(f); f.getMenuBar().setVisible(false); String s = "cellid : " + CellInfo.getCellId() + "\nLAC : " + CellInfo.getLAC() + "\nmcc : " + CellInfo.getMCC() + "\nmnc : " + CellInfo.getMNC() + "\nimei : " + CellInfo.getIMEI() + "\nimsi : " + CellInfo.getIMSI(); Dialog.show(null, s, "OK", null); Image bead = null; Container container = null; boolean labelFound = false; // for (int i = 0; i < f.getComponentCount(); i++) { // System.out.println("hi = "+f.getComponentAt(i).getClass().getName()); // if // (f.getComponentAt(i).getClass().getName().equalsIgnoreCase("com.sun.lwuit.Container")) { // Container c = (Container) f.getComponentAt(i); // for (int j = 0; j < c.getComponentCount(); j++) { // System.out.println("hello = // "+c.getComponentAt(j).getClass().getName()); // System.out.println("hello1 = "+c.getComponentAt(j).getName()); // } // } // } // for getting bead image for (int i = 0; i < f.getComponentCount(); i++) { System.out.println("hi = " + f.getComponentAt(i).getClass().getName()); if (f.getComponentAt(i) != null && f.getComponentAt(i).getClass().getName().equalsIgnoreCase("com.sun.lwuit.Container")) { Container c = (Container) f.getComponentAt(i); System.out.println("hello = " + c.getName()); for (int j = 0; j < c.getComponentCount(); j++) { if (!labelFound && c.getComponentAt(j).getClass().getName().equalsIgnoreCase("com.sun.lwuit.Label") && ((Label) c.getComponentAt(j)).getName() != null && ((Label) c.getComponentAt(j)).getName().equalsIgnoreCase("SampleBead")) { bead = ((Label) c.getComponentAt(j)).getIcon(); labelFound = true; } else if (c.getComponentAt(j) .getClass() .getName() .equalsIgnoreCase("com.sun.lwuit.Container") && ((Container) c.getComponentAt(j)).getName() != null && ((Container) c.getComponentAt(j)) .getName() .equalsIgnoreCase("ContainerTasbihBeads")) { container = (Container) c.getComponentAt(j); } } } } }