/** * DOCUMENT ME! * * @return DOCUMENT ME! */ public Bed getSelectedBed() { for (int i = 0; i < this.cgBeds.size(); i++) { if (this.cgBeds.isSelected(i)) { try { return (Bed) this.beds.get(i); } catch (Exception e) { } } } return null; }
this.append(this.txtWorkPhone); this.cgInsuredByGoverment = new ChoiceGroup("Type:", ChoiceGroup.EXCLUSIVE); this.cgInsuredByGoverment.append("Private", null); this.cgInsuredByGoverment.append("Goverment", null); this.cgInsuredByGoverment.setSelectedIndex(0, patient.isInsuredByGoverment()); this.cgInsuredByGoverment.setSelectedIndex(1, !patient.isInsuredByGoverment()); this.append(cgInsuredByGoverment);
private void startComponents() { this.dtEnter = new DateField("Enter date", DateField.DATE); this.dtEnter.setDate(new Date()); this.append(this.dtEnter); this.txtReason = new TextField("Reason", internment.getReason(), 100, TextField.ANY); this.append(this.txtReason); this.cgPatients = new ChoiceGroup("Patient", ChoiceGroup.EXCLUSIVE); this.append(cgPatients); this.cgDoctors = new ChoiceGroup("Doctor", ChoiceGroup.EXCLUSIVE); this.append(cgDoctors); this.cgBeds = new ChoiceGroup("Beds", ChoiceGroup.EXCLUSIVE); this.append(cgBeds); this.cmdOk = new Command("Ok", Command.OK, 0); this.addCommand(this.cmdOk); this.cmdCancel = new Command("Cancel", Command.CANCEL, 1); this.addCommand(this.cmdCancel); this.setCommandListener(this); } }
boolean withCaipirinha = ((ChoiceGroup) barbecueForm.get(2)).isSelected(0); int alchoolLevel = ((Gauge) barbecueForm.get(3)).getValue(); int foodQuantity = ((Gauge) barbecueForm.get(4)).getValue();
/** * DOCUMENT ME! */ public void startFormations() { PersistableManager pm = PersistableManager.getInstance(); try { Class formationClass = Class.forName("net.sourceforge.floggy.persistence.model.Formation"); formations = pm.find(formationClass, null, new Comparator() { public int compare(Persistable arg0, Persistable arg1) { Formation f1 = (Formation) arg0; Formation f2 = (Formation) arg1; return f1.getFormation().compareTo(f2.getFormation()); } }); for (int i = 0; i < formations.size(); i++) { Formation formation = (Formation) formations.get(i); int index = this.cgFormation.append(formation.getFormation(), null); if ((doctor.getFormations() != null) && (this.doctor.getFormations().contains(formation))) { this.cgFormation.setSelectedIndex(index, true); } } } catch (Exception e) { HospitalMIDlet.showException(e); } }
/** * DOCUMENT ME! */ public void startBeds() { PersistableManager pm = PersistableManager.getInstance(); try { Class bedClass = Class.forName("net.sourceforge.floggy.persistence.model.Bed"); beds = pm.find(bedClass, null, new BedComparator()); Bed bed = new Bed(); for (int i = 0; i < beds.size(); i++) { beds.get(i, bed); this.cgBeds.append(String.valueOf(bed.getNumber()), null); } } catch (Exception e) { HospitalMIDlet.showException(e); } }
/** * DOCUMENT ME! */ public void exibirDadosChurrasForm() { Form barbecueForm = new Form("Churras Calculator"); barbecueForm.append(new TextField("# men", "", 3, TextField.NUMERIC)); barbecueForm.append(new TextField("# woman", "", 3, TextField.NUMERIC)); barbecueForm.append(new ChoiceGroup("", Choice.MULTIPLE, new String[] { " With Caipirinha" }, new Image[] { null })); barbecueForm.append(new Gauge("Alchool level", true, 5, 3)); barbecueForm.append(new Gauge("Food level", true, 5, 3)); barbecueForm.addCommand(CommandHandler.CALCULATE_CMD); barbecueForm.addCommand(CommandHandler.BACK_CMD); barbecueForm.setCommandListener(CommandHandler.getInstance()); try { DisplayManager.getInstance().show(barbecueForm, true); } catch (DisplayManagerNotStartedException e) { } }
/** * DOCUMENT ME! * * @param cmd DOCUMENT ME! * @param dsp DOCUMENT ME! */ public void commandAction(Command cmd, Displayable dsp) { if (cmd == this.cmdOk) { PersistableManager pm = PersistableManager.getInstance(); try { this.patient.setName(this.txtName.getString()); this.patient.setPassport(this.txtPassport.getString()); this.patient.setBornDate(this.dtBornDate.getDate()); this.patient.setInsuredByGoverment(this.cgInsuredByGoverment.isSelected( 0)); this.patient.setHomePhone(this.txtHomePhone.getString()); this.patient.setCellPhone(this.txtCellPhone.getString()); this.patient.setWorkPhone(this.txtWorkPhone.getString()); pm.save(this.patient); } catch (FloggyException e) { HospitalMIDlet.showException(e); } } HospitalMIDlet.setCurrent(new PatientList()); }
/** * DOCUMENT ME! */ public void startDoctors() { PersistableManager pm = PersistableManager.getInstance(); try { Class doctorClass = Class.forName("net.sourceforge.floggy.persistence.model.Doctor"); doctors = pm.find(doctorClass, null, new Comparator() { public int compare(Persistable arg0, Persistable arg1) { Doctor p1 = (Doctor) arg0; Doctor p2 = (Doctor) arg1; return p1.getName().compareTo(p2.getName()); } }); Doctor doctor = new Doctor(); for (int i = 0; i < doctors.size(); i++) { doctors.get(i, doctor); this.cgDoctors.append(doctor.getName(), null); } } catch (Exception e) { HospitalMIDlet.showException(e); } }
/** * DOCUMENT ME! * * @return DOCUMENT ME! */ public Patient getSelectedPatient() { for (int i = 0; i < this.cgPatients.size(); i++) { if (this.cgPatients.isSelected(i)) { try { return (Patient) this.patients.get(i); } catch (Exception e) { } } } return null; }
private void startComponents() { this.txtName = new TextField("Name", doctor.getName(), 30, TextField.ANY); this.append(this.txtName); this.txtPassport = new TextField("Passport", doctor.getPassport(), 30, TextField.ANY); this.append(this.txtPassport); this.dtBornDate = new DateField("Born date", DateField.DATE); this.dtBornDate.setDate(doctor.getBornDate()); this.append(this.dtBornDate); this.txtCRM = new TextField("CRM", doctor.getCrm(), 30, TextField.ANY); this.append(this.txtCRM); this.cgFormation = new ChoiceGroup("Formation", ChoiceGroup.MULTIPLE); this.append(cgFormation); this.cmdOk = new Command("Ok", Command.OK, 0); this.addCommand(this.cmdOk); this.cmdCancel = new Command("Cancel", Command.CANCEL, 1); this.addCommand(this.cmdCancel); this.setCommandListener(this); } }
/** * DOCUMENT ME! */ public void startPatients() { PersistableManager pm = PersistableManager.getInstance(); try { Class patientClass = Class.forName("net.sourceforge.floggy.persistence.model.Patient"); patients = pm.find(patientClass, null, new Comparator() { public int compare(Persistable arg0, Persistable arg1) { Patient p1 = (Patient) arg0; Patient p2 = (Patient) arg1; return p1.getName().compareTo(p2.getName()); } }); Patient patient = new Patient(); for (int i = 0; i < patients.size(); i++) { patients.get(i, patient); this.cgPatients.append(patient.getName(), null); } } catch (Exception e) { HospitalMIDlet.showException(e); } }
/** * DOCUMENT ME! * * @return DOCUMENT ME! */ public Doctor getSelectedDoctor() { for (int i = 0; i < this.cgDoctors.size(); i++) { if (this.cgDoctors.isSelected(i)) { try { return (Doctor) this.doctors.get(i); } catch (Exception e) { } } } return null; }
for (int i = 0; i < this.cgFormation.size(); i++) { if (this.cgFormation.isSelected(i)) { this.doctor.getFormations().addElement(this.formations.get(i));