コード例 #1
0
  public void addModel(Model model) {

    models.add(model);
    resizeTable(models.size(), columns);
    rows = models.size();
    data[models.size() - 1][0] = model.getName();
    data[models.size() - 1][1] = model.getType();
    data[models.size() - 1][2] = model.isShouldImport();
    fireTableDataChanged();
  }
コード例 #2
0
  public void updateRow(int row, Model model) {

    data[row][0] = model.getName();
    data[row][1] = model.getType();
    data[row][2] = model.isShouldImport();
    fireTableCellUpdated(row, 0);
    fireTableCellUpdated(row, 1);
    fireTableCellUpdated(row, 2);
    fireTableDataChanged();
  }
コード例 #3
0
  public void removeModel(Model model) {

    models.remove(model);
    data = new Object[models.size()][columns];
    rows = models.size();

    int index = 0;

    for (Model m : models) {

      data[index][0] = m.getName();
      data[index][1] = m.getType();
      data[index][2] = m.isShouldImport();

      index++;
    }

    fireTableDataChanged();
  }
コード例 #4
0
  public void setModels(List<Model> models) {

    log.info("Loading " + models.size() + " models.");

    this.models = models;

    columns = 3;
    data = new Object[models.size()][columns];

    rows = models.size();

    int index = 0;

    for (Model model : models) {
      data[index][0] = model.getName();
      data[index][1] = model.getType();
      data[index][2] = model.isShouldImport();
      index++;
    }

    fireTableDataChanged();
  }