Exemple #1
0
  /**
   * Creates a new result item for the given type.
   *
   * @param type The type of the result item to be created.
   */
  public ResultItem(String type) {
    this.type = type;

    setInsets(new Insets(0, 0, 0, 5));

    Column mainColumn = new Column();
    mainColumn.setBorder(new Border(1, Color.BLACK, Border.STYLE_SOLID));

    Row headRow = new Row();
    headRow.setCellSpacing(new Extent(5));
    headRow.setInsets(new Insets(2, 0));
    headRow.setBackground(new Color(200, 200, 200));
    SolidLabel titleLabel = new SolidLabel(type, Font.PLAIN, 9);
    titleLabel.setForeground(Color.WHITE);

    headRow.add(titleLabel);
    contentColumn = new Column();
    contentColumn.setInsets(new Insets(10, 0));

    mainColumn.add(headRow);
    mainColumn.add(contentColumn);

    add(mainColumn);
    add(new HSpace());
  }
  public PanelAdquirirHabilidades() {

    Column col = new Column();
    col.setInsets(new Insets(10, 10, 10, 10));
    col.setCellSpacing(new Extent(10));

    Row row = new Row();
    row.setCellSpacing(new Extent(10));
    row.setAlignment(Alignment.ALIGN_CENTER);

    // ----------------------------------------
    // Carga las Habilidades Disponibles
    // ----------------------------------------

    tableDtaModel = new TestTableModel();
    try {
      tableDtaModel =
          HabilidadesAnillo.obtenerHabilidadesCompra( //
              atrib.getPersonaje(), tableDtaModel);
    } catch (Exception e) {
      e.printStackTrace();
    }

    col.add(PanelConstructor.initTopRow("Habilidades Disponibles"));
    col.add(PanelConstructor.initTable(tableDtaModel, initTableColModel(), true));

    Button btnAtras = new Button("Atrás");
    btnAtras.setStyle(Estilo.getStyleColor(app.getAtributos()));
    btnAtras.setWidth(new Extent(160));
    btnAtras.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent evt) {
            btnAtrasClicked();
          }
        });
    row.add(btnAtras);

    Button btnAdquirirHabilidad = new Button("Adquirir Habilidad");
    btnAdquirirHabilidad.setStyle(Estilo.getStyleColor(app.getAtributos()));
    btnAdquirirHabilidad.setWidth(new Extent(160));
    btnAdquirirHabilidad.setAlignment(Alignment.ALIGN_CENTER);
    btnAdquirirHabilidad.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent evt) {
            btnAdquirirHabilidadClicked();
          }
        });
    row.add(btnAdquirirHabilidad);

    col.add(row);
    add(col);
  }
Exemple #3
0
  private void setContent(String content) {
    this.content = content;

    contentColumn.removeAll();
    Component contentComp;
    if (isPreformated()) {
      contentComp =
          new DirectHtml("<pre style=\"font-size:11px;\">" + HtmlKit.encode(content) + "</pre>");
    } else if (isHtml()) {
      contentComp = new DirectHtml("<span style=\"font-size:11px;\">" + content + "</span>");
    } else {
      Label l = new Label(content);
      l.setFont(new Font(Font.MONOSPACE, Font.PLAIN, new Extent(11)));
      Column c = new Column();
      c.setInsets(new Insets(0, 10));
      c.add(l);
      contentComp = c;
    }
    contentColumn.add(contentComp);
  }
  /**
   * Creates a new word editor form.
   *
   * @param parentWindow The parent window.
   * @param actionListener The action-listener.
   */
  public WordEditorForm(WindowPane parentWindow, ActionListener actionListener) {
    this.parentWindow = parentWindow;
    this.actionListener = actionListener;

    Column borderCol = new Column();
    borderCol.setBorder(new Border(1, Color.BLACK, Border.STYLE_INSET));

    Grid grid = new Grid(1);
    grid.setRowHeight(0, new Extent(parentWindow.getHeight().getValue() - 160));
    grid.setRowHeight(1, new Extent(30));

    column = new Column();
    column.setInsets(new Insets(10, 20, 0, 0));
    column.setCellSpacing(new Extent(10));
    GridLayoutData gridLayout = new GridLayoutData();
    gridLayout.setAlignment(new Alignment(Alignment.LEFT, Alignment.TOP));
    column.setLayoutData(gridLayout);
    grid.add(column);

    explanationRow = new Row();
    column.add(explanationRow);

    Row footerRow = new Row();
    footerRow.setInsets(new Insets(10, 0, 0, 0));
    String l = "* " + LocaleResources.getString("preditor_wordeditor_required");
    footerRow.add(new Label(l, Font.ITALIC, 11));
    grid.add(footerRow);

    buttonBar = new Row();
    buttonBar.setAlignment(new Alignment(Alignment.RIGHT, Alignment.CENTER));
    buttonBar.setInsets(new Insets(10, 10, 10, 10));
    buttonBar.setCellSpacing(new Extent(5));
    grid.add(buttonBar);

    addButton("general_action_ok");
    addButton("general_action_cancel");

    borderCol.add(grid);
    add(borderCol);
  }