use of com.revolsys.swing.table.record.RecordRowTable in project com.revolsys.open by revolsys.
the class MergedRecordsTableModel method newPanel.
public static TablePanel newPanel(final AbstractRecordLayer layer, final Record mergedObject, final Collection<LayerRecord> objects) {
final MergedRecordsTableModel model = new MergedRecordsTableModel(layer, mergedObject, objects);
final RecordRowTable table = new RecordRowTable(model);
table.setVisibleRowCount(objects.size() + 2);
MergedValuePredicate.add(table);
MergedRecordPredicate.add(table);
MergedNullValuePredicate.add(table);
table.setSortable(false);
table.getSelectionModel().addListSelectionListener(model);
return new TablePanel(table);
}
use of com.revolsys.swing.table.record.RecordRowTable in project com.revolsys.open by revolsys.
the class RecordLayerErrorsTableModel method newPanel.
public TablePanel newPanel() {
final RecordRowTable table = new RecordRowTable(this);
table.setVisibleRowCount(this.getRowCount() + 1);
table.setSortable(true);
table.getSelectionModel().addListSelectionListener(this);
table.resizeColumnsToContent();
final HighlightPredicate predicate = (renderer, adapter) -> {
final int columnIndex = adapter.convertColumnIndexToModel(adapter.column);
return columnIndex == 0;
};
table.addHighlighter(new ColorHighlighter(new AndHighlightPredicate(predicate, HighlightPredicate.EVEN), WebColors.newAlpha(WebColors.Pink, 127), WebColors.FireBrick, WebColors.LightCoral, WebColors.FireBrick));
table.addHighlighter(new ColorHighlighter(new AndHighlightPredicate(predicate, HighlightPredicate.ODD), WebColors.Pink, WebColors.FireBrick, WebColors.Crimson, WebColors.White));
return new TablePanel(table);
}
use of com.revolsys.swing.table.record.RecordRowTable in project com.revolsys.open by revolsys.
the class RecordLayerErrorsTableModel method valueChanged.
@Override
public void valueChanged(final ListSelectionEvent event) {
final RecordRowTable table = getTable();
final ListSelectionModel selectionModel = table.getSelectionModel();
final int rowCount = super.getRowCount();
final boolean mergedSelected = selectionModel.isSelectedIndex(rowCount);
for (int rowIndex = 0; rowIndex < rowCount; rowIndex++) {
final Record record = getRecord(rowIndex);
if (record != null) {
if (mergedSelected || selectionModel.isSelectedIndex(rowIndex)) {
this.layer.addHighlightedRecords((LayerRecord) record);
} else {
this.layer.unHighlightRecords((LayerRecord) record);
}
}
}
this.layer.zoomToHighlighted();
}
use of com.revolsys.swing.table.record.RecordRowTable in project com.revolsys.open by revolsys.
the class RecordValidationDialog method newValidRecordsTablePanel.
private TablePanel newValidRecordsTablePanel() {
final RecordDefinition recordDefinition = this.layer.getRecordDefinition();
final List<String> fieldNames = this.layer.getFieldNames();
final RecordListTableModel model = new RecordListTableModel(recordDefinition, this.validRecords, fieldNames);
final RecordRowTable table = new RecordRowTable(model);
table.setVisibleRowCount(Math.min(10, model.getRowCount() + 1));
table.setSortable(true);
table.setEditable(false);
table.resizeColumnsToContent();
final TablePanel tablePanel = new TablePanel(table);
tablePanel.setBorder(BorderFactory.createTitledBorder(table.getRowCount() + " valid records"));
return tablePanel;
}
use of com.revolsys.swing.table.record.RecordRowTable in project com.revolsys.open by revolsys.
the class MergedRecordsTableModel method valueChanged.
@Override
public void valueChanged(final ListSelectionEvent event) {
final RecordRowTable table = getTable();
final ListSelectionModel selectionModel = table.getSelectionModel();
final int rowCount = super.getRowCount();
final boolean mergedSelected = selectionModel.isSelectedIndex(rowCount);
for (int rowIndex = 0; rowIndex < rowCount; rowIndex++) {
final Record record = getRecord(rowIndex);
if (record != null) {
if (mergedSelected || selectionModel.isSelectedIndex(rowIndex)) {
this.layer.addHighlightedRecords((LayerRecord) record);
} else {
this.layer.unHighlightRecords((LayerRecord) record);
}
}
}
this.layer.zoomToHighlighted();
}
Aggregations