public FontChooser(FormDialog dialog, Font font) { super(dialog); setTitle("Choose Font"); setLayout(new FormLayout(FormLayout.VERTICAL, FormLayout.CENTER)); ((FormLayout) getLayout()).setResizeConstant(true); fontBox = new JComboBox( GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames()); sizeField = new JTextField(); sizeField.setColumns(2); styleBox = new JComboBox(); styleBox.addItem("Plain"); styleBox.addItem("Bold"); styleBox.addItem("Italic"); setCurrentFont(font); FormFactory factory = new FormFactory(this); this.add(factory.label(fontBox, "Font")); this.add(factory.label(sizeField, "Size")); this.add(factory.label(styleBox, "Style")); }
private void redraw() { clear(); add(formFactory.createTitle(questionnaire.getTitle())); for (GwtQuestionGroup group : questionnaire.getGroups()) { add(formFactory.createGroup(group)); } if (!(questionnaire.getArchivedQuestionGroup() == null || questionnaire.getArchivedQuestionGroup().getQuestions().isEmpty())) { add(formFactory.createGroup(questionnaire.getArchivedQuestionGroup())); } }
public Form transformRepresentation(Representation repr) { return defaultFormFactory.getForm(repr); }
private void updateForm() { formFactory.setAnswers(answers); redraw(); }