use of org.jdesktop.swingx.decorator.ColorHighlighter in project com.revolsys.open by revolsys.
the class MergedNullValuePredicate method add.
public static void add(final RecordRowTable table) {
final MergedRecordsTableModel model = table.getTableModel();
final MergedNullValuePredicate predicate = new MergedNullValuePredicate(model);
table.addHighlighter(new ColorHighlighter(predicate, WebColors.Yellow, WebColors.Black, WebColors.Orange, WebColors.Black));
}
use of org.jdesktop.swingx.decorator.ColorHighlighter in project com.revolsys.open by revolsys.
the class FormAllFieldsModifiedPredicate method add.
public static void add(final LayerRecordForm form, final BaseJTable table) {
final LayerRecordTableModel model = table.getTableModel();
final FormAllFieldsModifiedPredicate predicate = new FormAllFieldsModifiedPredicate(form, model);
table.addHighlighter(new ColorHighlighter(new AndHighlightPredicate(predicate, HighlightPredicate.EVEN), WebColors.newAlpha(WebColors.YellowGreen, 127), WebColors.Black, WebColors.LimeGreen, Color.WHITE));
table.addHighlighter(new ColorHighlighter(new AndHighlightPredicate(predicate, HighlightPredicate.ODD), WebColors.YellowGreen, WebColors.Black, WebColors.Green, Color.WHITE));
}
use of org.jdesktop.swingx.decorator.ColorHighlighter in project com.revolsys.open by revolsys.
the class LabelCountMapTableModel method newTable.
public BaseJTable newTable() {
final BaseJTable table = new BaseJTable(this);
setTable(table);
final TableColumnModel columnModel = table.getColumnModel();
for (int columnIndex = 0; columnIndex < getColumnCount(); columnIndex++) {
final int columnIndex1 = columnIndex;
final TableColumn column = columnModel.getColumn(columnIndex1);
setColumnWidth(columnIndex1, column);
}
table.setAutoCreateColumnsFromModel(false);
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
final RowSorter<? extends TableModel> rowSorter = table.getRowSorter();
final SortKey sortKey = new SortKey(0, SortOrder.ASCENDING);
rowSorter.setSortKeys(Arrays.asList(sortKey));
table.addHighlighter(new ColorHighlighter((final Component renderer, final ComponentAdapter adapter) -> {
final int row = adapter.convertRowIndexToModel(adapter.row);
if (getValueAt(row, 0).equals(LabelCountMapTableModel.this.selectedLabel)) {
return true;
}
return false;
}, WebColors.ForestGreen, WebColors.Yellow, WebColors.DarkGreen, WebColors.Yellow));
table.addHighlighter(new ColorHighlighter((final Component renderer, final ComponentAdapter adapter) -> {
final int column = adapter.convertColumnIndexToModel(adapter.column);
final int row = adapter.convertRowIndexToModel(adapter.row);
if (getValueAt(row, 0).equals(LabelCountMapTableModel.this.selectedLabel)) {
if (getColumnName(column).equals(LabelCountMapTableModel.this.selectedCountName)) {
return true;
}
}
return false;
}, WebColors.Yellow, WebColors.DarkGreen, WebColors.Gold, WebColors.DarkGreen));
return table;
}
use of org.jdesktop.swingx.decorator.ColorHighlighter in project com.revolsys.open by revolsys.
the class FormAllFieldsErrorPredicate method addErrorHighlighters.
public static void addErrorHighlighters(final JXTable table, final HighlightPredicate predicate) {
table.addHighlighter(new ColorHighlighter(new AndHighlightPredicate(predicate, HighlightPredicate.EVEN), WebColors.newAlpha(WebColors.LightCoral, 127), WebColors.Black, WebColors.Red, Color.WHITE));
table.addHighlighter(new ColorHighlighter(new AndHighlightPredicate(predicate, HighlightPredicate.ODD), WebColors.LightCoral, WebColors.Black, WebColors.DarkRed, WebColors.White));
}
use of org.jdesktop.swingx.decorator.ColorHighlighter in project com.revolsys.open by revolsys.
the class MergedValuePredicate method add.
public static void add(final RecordRowTable table) {
final MergedRecordsTableModel model = table.getTableModel();
final MergedValuePredicate predicate = new MergedValuePredicate(model);
table.addHighlighter(new ColorHighlighter(predicate, WebColors.Moccasin, WebColors.DarkOrange, WebColors.DarkOrange, WebColors.Moccasin));
}
Aggregations