Rename class. Change empty value.

This commit is contained in:
Dmitry Trofimov
2014-11-05 16:16:01 +01:00
parent 9cd3d8bbda
commit 5f3519d74a
2 changed files with 9 additions and 10 deletions
@@ -37,11 +37,10 @@ import java.util.concurrent.*;
/**
* @author traff
*/
public class PagingTableModel extends AbstractTableModel {
public class AsyncArrayTableModel extends AbstractTableModel {
private static final int CHUNK_COL_SIZE = 2; //TODO set to 100
private static final int CHUNK_ROW_SIZE = 2;
private static final int DEFAULT_MAX_CACHED_SIZE = 100;
public static final String EMPTY_CELL_VALUE = "...";
public static final String EMPTY_CELL_VALUE = "";
private final int myRows;
private final int myColumns;
@@ -74,7 +73,7 @@ public class PagingTableModel extends AbstractTableModel {
}
});
public PagingTableModel(int rows, int columns, NumpyArrayTable provider) {
public AsyncArrayTableModel(int rows, int columns, NumpyArrayTable provider) {
myRows = rows;
myColumns = columns;
myProvider = provider;
@@ -52,7 +52,7 @@ public class NumpyArrayTable {
private String myDtypeKind;
private int[] myShape;
private ArrayTableCellRenderer myTableCellRenderer;
private PagingTableModel myPagingModel;
private AsyncArrayTableModel myPagingModel;
private final static int COLUMNS_IN_DEFAULT_SLICE = 40;
private final static int ROWS_IN_DEFAULT_SLICE = 40;
@@ -83,14 +83,14 @@ public class NumpyArrayTable {
return myComponent;
}
private PagingTableModel createTableModel(@NotNull int[] shape) {
private AsyncArrayTableModel createTableModel(@NotNull int[] shape) {
final int columns = Math.min(getMaxColumn(shape), COLUMNS_IN_DEFAULT_VIEW);
int rows = Math.min(getMaxRow(shape), ROWS_IN_DEFAULT_VIEW);
if (columns == 0 || rows == 0) {
showError("Slice with zero axis shape.");
}
return new PagingTableModel(rows, columns, this);
return new AsyncArrayTableModel(rows, columns, this);
}
private void initComponent() {
@@ -439,8 +439,8 @@ public class NumpyArrayTable {
JBTableWithRowHeaders.RowHeaderTable rowTable = ((JBTableWithRowHeaders)myTable).getRowHeaderTable();
rowTable.setRowShift(0);
}
((PagingTableModel)myTable.getModel()).fireTableDataChanged();
((PagingTableModel)myTable.getModel()).fireTableCellUpdated(0, 0);
((AsyncArrayTableModel)myTable.getModel()).fireTableDataChanged();
((AsyncArrayTableModel)myTable.getModel()).fireTableCellUpdated(0, 0);
}
});
}
@@ -514,7 +514,7 @@ public class NumpyArrayTable {
protected void run(@NotNull Result result) throws Throwable {
if (getEditor().getEditor() != null) {
getEditor().getEditor().getDocument().setText(corrected);
((PagingTableModel)myTable.getModel()).forcedChange(row, col, corrected);
((AsyncArrayTableModel)myTable.getModel()).forcedChange(row, col, corrected);
cancelEditing();
}
}