use of org.gephi.desktop.datalab.tables.columns.ElementDataColumn in project gephi by gephi.
the class AbstractElementsDataTable method refreshModel.
public void refreshModel(T[] elements, Column[] cols, GraphModel graphModel, DataTablesModel dataTablesModel) {
this.graphModel = graphModel;
showingColumns = cols;
Interval timeBounds = graphModel.getTimeBounds();
double min = timeBounds != null ? timeBounds.getLow() : 0;
double max = timeBounds != null ? timeBounds.getHigh() : 0;
refreshCellRenderersConfiguration(graphModel, min, max);
refreshingTable = true;
if (selectedElements == null) {
selectedElements = getElementsFromSelectedRows();
}
ArrayList<ElementDataColumn<T>> columns = new ArrayList<>();
columns.addAll(getFakeDataColumns(graphModel, dataTablesModel));
for (Column c : cols) {
columns.add(new AttributeDataColumn<T>(attributeColumnsController, c));
}
if (model == null) {
model = new ElementsDataTableModel<>(elements, columns.toArray(new ElementDataColumn[0]));
table.setModel(model);
} else {
model.configure(elements, columns.toArray(new ElementDataColumn[0]));
}
//Keep row selection before refreshing.
setElementsSelection(selectedElements);
selectedElements = null;
refreshingTable = false;
}
Aggregations