/** * DOCUMENT ME! */ public void showAboutForm() { Form aboutForm = new Form("About"); aboutForm.append(new StringItem("Barbecue Calculator Floggynized", "Calculator of itens to do a barbecue.")); aboutForm.append(new StringItem("Author: ", "Neto Marin")); aboutForm.append(new StringItem("Contatc: ", "netomarin@gmail.com")); aboutForm.append(new StringItem("Floggynizer: ", "Thiago Moreira")); aboutForm.append(new StringItem("Contatc: ", "thiago.moreira@floggy.org")); aboutForm.addCommand(CommandHandler.BACK_CMD); aboutForm.setCommandListener(CommandHandler.getInstance()); try { DisplayManager.getInstance().show(aboutForm, true); } catch (DisplayManagerNotStartedException e) { } }
/** * Do the logging. * * @param level * the level to use for the logging. * @param message * the message to log. * @param t * the exception to log. */ public void doLog(String clientID, String name, long time, Level level, Object message, Throwable t) { if (logOpen && formatter != null) { logForm.append(formatter.format(clientID, name, time, level, message, t)); logSize++; } }
/** * @see net.sf.microlog.core.appender.AbstractAppender#open() */ public synchronized void open() throws IOException { if (logForm == null) { this.logForm = new Form(DEFAULT_LOGFORM_TITLE); } logOpen = true; }
/** * Clear the underlying RecordStore from data. Note if logging is done when * executing this method, these new logging events are not cleared. * * @see net.sf.microlog.core.appender.AbstractAppender#clear() */ public void clear() { if (logForm != null) { synchronized (this.logForm) { logForm.deleteAll(); logSize = 0; } } }
String value = ((TextField) barbecueForm.get(0)).getString(); men = Integer.parseInt(value); value = ((TextField) barbecueForm.get(1)).getString(); women = Integer.parseInt(value); } catch (NumberFormatException nfe) { boolean withCaipirinha = ((ChoiceGroup) barbecueForm.get(2)).isSelected(0); int alchoolLevel = ((Gauge) barbecueForm.get(3)).getValue(); int foodQuantity = ((Gauge) barbecueForm.get(4)).getValue();
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); } }
final Command abtUsCmd = new Command("Next") { public void actionPerformed(ActionEvent evt) { javax.microedition.lcdui.Form frm = new javax.microedition.lcdui.Form("LCDUI Form"); StringItem item = new StringItem("Text", "Sample text"); frm.append(item);
/** * Execute the command. * * @see net.sf.microlog.midp.RecordStoreLogViewer.AbstractCommand#execute() */ public void execute() { logScreen.deleteAll(); loader.clearLog(); } }
/** * DOCUMENT ME! */ public void finalizarPersistenciaChurras() { Form dadosChurras = null; try { dadosChurras = (Form) DisplayManager.getInstance().getCurrent(); } catch (DisplayManagerNotStartedException e) { } barbecue.setDescription(((TextField) dadosChurras.get(0)).getString()); try { PersistableManager.getInstance().save(barbecue); } catch (Exception e) { e.printStackTrace(); } try { DisplayManager.getInstance().backToTheFirst(); DisplayManager.getInstance() .show(new Alert("Success", "Barbecue saved!", null, AlertType.CONFIRMATION)); } catch (DisplayManagerException 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) { } }
private void startComponents() { this.txtBedNumber = new TextField("Bed number", String.valueOf(bed.getNumber()), 3, TextField.NUMERIC); this.append(this.txtBedNumber); this.txtBedFloor = new TextField("Bed floor", String.valueOf(bed.getFloor()), 15, TextField.NUMERIC); this.append(this.txtBedFloor); 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); } }
Form listaChurras = new Form("Show barbecue"); listaChurras.append("\nMens: " + barbecue.getMen()); listaChurras.append("\nWomen: " + barbecue.getWomen());
private void start(final Test aTestSuite) { Form aForm = new Form("TestRunner"); aForm.append("No tests found."); rDisplay.setCurrent(aForm); return; aErrorInfo = new StringItem("Errors:", "0"); aForm.append("Testing..."); aForm.append(aProgressBar); aForm.append(aFailureInfo); aForm.append(aErrorInfo);
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 salvarChurrasco() { Form salvarChurrasForm = new Form("Save barbecue"); salvarChurrasForm.append(new TextField( "Give a name to the barbecue to save: ", "", 30, TextField.ANY)); salvarChurrasForm.addCommand(CommandHandler.SAVE_BARBECUE_CMD); salvarChurrasForm.addCommand(CommandHandler.BACK_CMD); salvarChurrasForm.setCommandListener(CommandHandler.getInstance()); try { DisplayManager.getInstance().show(salvarChurrasForm, true); } catch (DisplayManagerNotStartedException e) { } }
private void startComponents() { this.txtName = new TextField("Name", patient.getName(), 30, TextField.ANY); this.append(this.txtName); this.append(this.txtPassport); this.append(this.dtBornDate); this.append(txtAddress); this.append("Phones"); this.txtHomePhone = new TextField("Home", patient.getHomePhone(), 20, TextField.PHONENUMBER); this.append(this.txtHomePhone); this.txtCellPhone = new TextField("Cell", patient.getCellPhone(), 20, TextField.PHONENUMBER); this.append(this.txtCellPhone); this.txtWorkPhone = new TextField("Work", patient.getCellPhone(), 20, TextField.PHONENUMBER); this.append(this.txtWorkPhone); this.cgInsuredByGoverment.setSelectedIndex(1, !patient.isInsuredByGoverment()); this.append(cgInsuredByGoverment);
/** * Create a RecordStoreLogViewer. */ public RecordStoreLogViewer() { super(); display = Display.getDisplay(this); logScreen = new Form("Log content"); logScreen.addCommand(loadLogCommand); logScreen.addCommand(clearLogCommand); logScreen.addCommand(preferenceCommand); logScreen.addCommand(exitCommand); logScreen.addCommand(switchComparatorCommand); logScreen.setCommandListener(this); preferenceScreen = new Form("Preferences"); nameField = new TextField("RecordStore name ", null, MAX_NAME_LENGTH, TextField.ANY); preferenceScreen.append(nameField); preferenceScreen.addCommand(preferenceOkCommand); preferenceScreen.addCommand(preferenceCancelCommand); preferenceScreen.addCommand(exitCommand); preferenceScreen.setCommandListener(this); }
private void startComponents() { this.txtSearch = new TextField("Name", null, 20, TextField.ANY); this.append(this.txtSearch); 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); } }
private void startComponents() { this.txtFormation = new TextField("Formation", formation.getFormation(), 30, TextField.ANY); this.append(this.txtFormation); 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); } }