/** * DOCUMENT ME! */ protected void startComponents() { this.append("Formations", null); this.append("Beds", null); this.append("Doctors", null); this.append("Patients", null); this.append("-----", null); this.append("Add internment", null); this.append("Leave patient", null); this.append("-----", null); this.append("Free beds report", null); this.cmdExit = new Command("Exit", Command.ITEM, 3); this.addCommand(this.cmdExit); this.setCommandListener(this); } }
private void lateInit() { menuList = new List("Menu", List.IMPLICIT); menuList.addCommand(CMD_BACK); menuList.addCommand(CMD_SELECT); menuList.setCommandListener(menuCommandListener); }
private void startData() { PersistableManager pm = PersistableManager.getInstance(); try { this.deleteAll(); Class formationClass = Class.forName("net.sourceforge.floggy.persistence.model.Formation"); formations = pm.find(formationClass, null, this); for (int i = 0; i < formations.size(); i++) { Formation element = (Formation) formations.get(i); this.append(element.getFormation(), null); } } catch (Exception e) { HospitalMIDlet.showException(e); } } }
public void commandAction(Command c, Displayable d) { if (menuList == null) { lateInit(); } MIDletBridge.getMIDletAccess().getDisplayAccess().setCurrent(previous); if ((c == CMD_SELECT) || c == List.SELECT_COMMAND) { MIDletBridge.getMIDletAccess().getDisplayAccess().commandAction( (Command) menuCommands.elementAt(menuList.getSelectedIndex()), previous); } } };
new List("Saved barbecues", List.EXCLUSIVE | List.IMPLICIT); churrasSalvosList.setFitPolicy(Choice.TEXT_WRAP_OFF); churrasSalvosList.append(savedBarbecues[i].getDescription(), null);
/*************************************************************************** * Returns the javax.microedition.lcdui.List instance to append the result * data to. Will be created if it doesn't exist. * * @return A javax.microedition.lcdui.List object */ protected List getResultsList() { if (aResultsList == null) { aResultsList = new List("J2ME Unit", List.IMPLICIT); // v.s. aResultsList.addCommand(cmd_exit); aResultsList.setCommandListener(this); } return aResultsList; }
private void startData() { PersistableManager pm = PersistableManager.getInstance(); try { this.deleteAll(); Class bedClass = Class.forName("net.sourceforge.floggy.persistence.model.Bed"); beds = pm.find(bedClass, null, new BedComparator()); for (int i = 0; i < beds.size(); i++) { Bed bed = (Bed) beds.get(i); this.append(bed.getNumber() + " - Floor " + bed.getFloor(), null); } } catch (Exception e) { HospitalMIDlet.showException(e); } } }
/** * DOCUMENT ME! * * @param cmd DOCUMENT ME! * @param dsp DOCUMENT ME! */ public void commandAction(Command cmd, Displayable dsp) { if (cmd == this.cmdBack) { MainForm mainForm = new MainForm(); HospitalMIDlet.setCurrent(mainForm); } else if (cmd == this.cmdLeave) { if (this.getSelectedIndex() != -1) { try { Internment internment = (Internment) internments.get(this.getSelectedIndex()); internment.setExitDate(new Date()); PersistableManager.getInstance().save(internment); this.startData(); } catch (FloggyException e) { HospitalMIDlet.showException(e); } } } }
private void startData() { PersistableManager pm = PersistableManager.getInstance(); try { this.deleteAll(); Class doctorClass = Class.forName("net.sourceforge.floggy.persistence.model.Doctor"); doctors = pm.find(doctorClass, null, new Comparator() { public int compare(Persistable arg0, Persistable arg1) { String s1 = (arg0 == null) ? "" : ((Doctor) arg0).getName(); String s2 = (arg1 == null) ? "" : ((Doctor) arg1).getName(); return s1.compareTo(s2); } }); for (int i = 0; i < doctors.size(); i++) { Doctor doctor = (Doctor) doctors.get(i); this.append(doctor.getName() + " - CRM " + doctor.getCrm(), null); } } catch (Exception e) { HospitalMIDlet.showException(e); } } }
HospitalMIDlet.setCurrent(new FormationForm(formation)); } else if (cmd == this.cmdEdit) { if (this.getSelectedIndex() != -1) { Formation formation = null; formation = (Formation) formations.get(this.getSelectedIndex()); HospitalMIDlet.setCurrent(new FormationForm(formation)); } catch (FloggyException e) { if (this.getSelectedIndex() != -1) { try { Formation formation = (Formation) formations.get(this.getSelectedIndex()); PersistableManager.getInstance().delete(formation); this.startData();
/*************************************************************************** * Add a string to the result output. * * @param sText * The text to add */ public void addToResultsList(String sText) { if (bScreenOutput) getResultsList().append(sText, null); if (bTextOutput) aWriter.println(sText); }
private void startData(ObjectSet patients) { try { this.deleteAll();
HospitalMIDlet.setCurrent(new DoctorForm(doctor)); } else if (cmd == this.cmdEdit) { if (this.getSelectedIndex() != -1) { Doctor doctor = null; doctor = (Doctor) doctors.get(this.getSelectedIndex()); HospitalMIDlet.setCurrent(new DoctorForm(doctor)); } catch (FloggyException e) { if (this.getSelectedIndex() != -1) { try { Doctor doctor = (Doctor) doctors.get(this.getSelectedIndex()); PersistableManager.getInstance().delete(doctor); this.startData();
/*************************************************************************** * Add a string to the result output. * * @param t * The text to add */ public void addToResultsList(Throwable t) { if (bScreenOutput) { String sMsg = ((t.getMessage() != null) ? t.getMessage() : t.getClass().getName()); getResultsList().append(sMsg, null); } if (bTextOutput) t.printStackTrace(); }
HospitalMIDlet.setCurrent(new BedForm(bed)); } else if (cmd == this.cmdEdit) { if (this.getSelectedIndex() != -1) { Bed bed = null; bed = (Bed) beds.get(this.getSelectedIndex()); HospitalMIDlet.setCurrent(new BedForm(bed)); } catch (FloggyException e) { if (this.getSelectedIndex() != -1) { try { Bed bed = (Bed) beds.get(this.getSelectedIndex()); PersistableManager.getInstance().delete(bed); this.startData();
HospitalMIDlet.setCurrent(new PatientForm(patient)); } else if (cmd == this.cmdEdit) { if (this.getSelectedIndex() != -1) { Patient patient = null; patient = (Patient) patients.get(this.getSelectedIndex()); HospitalMIDlet.setCurrent(new PatientForm(patient)); } catch (FloggyException e) { if (this.getSelectedIndex() != -1) { try { Patient patient = (Patient) patients.get(this.getSelectedIndex()); PersistableManager.getInstance().delete(patient); this.startData(null);
try { FlowManager.getInstance() .exibirChurrasSalvo(((List) displayable).getSelectedIndex()); } catch (FlowManagerNotStartedException e) { try { FlowManager.getInstance() .apagarChurrasSalvo(((List) displayable).getSelectedIndex()); } catch (FlowManagerNotStartedException e) {