Ejemplo n.º 1
0
  public void reload(List<TacticReport> list) {
    tableModel =
        new BaseTableModel(
            new Vector<Object>(),
            new Vector<String>(Arrays.asList(new String[] {"COL_A", "COL_B", "COL_C"})));
    table.setModel(tableModel);

    Vector<Object> rowData;
    int row = 0;

    for (Iterator<TacticReport> iter = list.iterator(); iter.hasNext(); ) {
      TacticReport report = iter.next();

      rowData = new Vector<Object>();
      rowData.add(SpielerPosition.getNameForPosition((byte) report.getTacticCode()));
      rowData.add("" + report.getAppearance());
      rowData.add(format(report.getRating()));
      tableModel.addRow(rowData);
      row++;

      if (row == 3) {
        break;
      }
    }

    if (row > 0) {
      this.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.RAISED));

      for (; row < 3; row++) {
        tableModel.addRow(emptyLine());
      }
    } else {
      this.setBorder(null);
    }

    table.getTableHeader().getColumnModel().getColumn(1).setMaxWidth(30);
    table.getTableHeader().getColumnModel().getColumn(2).setMaxWidth(30);
  }
Ejemplo n.º 2
0
  protected final void initLabel(int posid, byte taktik) {

    switch (posid) {
      case ISpielerPosition.setPieces:
        {
          m_jlPosition.setText(HOVerwaltung.instance().getLanguageString("match.setpiecestaker"));
          break;
        }
      case ISpielerPosition.captain:
        {
          m_jlPosition.setText(HOVerwaltung.instance().getLanguageString("Spielfuehrer"));
          break;
        }
      case ISpielerPosition.substDefender:
        {
          m_jlPosition.setText(
              HOVerwaltung.instance().getLanguageString("Reserve")
                  + " "
                  + HOVerwaltung.instance().getLanguageString("defender"));
          break;
        }
      case ISpielerPosition.substForward:
        {
          m_jlPosition.setText(
              HOVerwaltung.instance().getLanguageString("Reserve")
                  + " "
                  + HOVerwaltung.instance().getLanguageString("ls.player.position.forward"));
          break;
        }
      case ISpielerPosition.substWinger:
        {
          m_jlPosition.setText(
              HOVerwaltung.instance().getLanguageString("Reserve")
                  + " "
                  + HOVerwaltung.instance().getLanguageString("ls.player.position.winger"));
          break;
        }
      case ISpielerPosition.substInnerMidfield:
        {
          m_jlPosition.setText(
              HOVerwaltung.instance().getLanguageString("Reserve")
                  + " "
                  + HOVerwaltung.instance()
                      .getLanguageString("ls.player.position.innermidfielder"));
          break;
        }
      case ISpielerPosition.substKeeper:
        {
          m_jlPosition.setText(
              HOVerwaltung.instance().getLanguageString("Reserve")
                  + " "
                  + HOVerwaltung.instance().getLanguageString("ls.player.position.keeper"));
          break;
        }
      default:
        {
          // Special check here for the replaced players, we got a range of at
          // least 3...
          if ((posid >= ISpielerPosition.ausgewechselt)
              && (posid <= ISpielerPosition.ausgewechseltEnd)) {
            m_jlPosition.setText(HOVerwaltung.instance().getLanguageString("Ausgewechselt"));
            break;
          } else {

            m_jlPosition.setText(
                ho.core.model.player.SpielerPosition.getNameForPosition(
                    ho.core.model.player.SpielerPosition.getPosition(posid, taktik)));
          }
        }
    }
  }