Example #1
0
  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"));
  }
Example #2
0
  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()));
    }
  }
Example #3
0
 public Form transformRepresentation(Representation repr) {
   return defaultFormFactory.getForm(repr);
 }
Example #4
0
  private void updateForm() {

    formFactory.setAnswers(answers);
    redraw();
  }