use of org.jdesktop.swingx.decorator.FontHighlighter in project com.revolsys.open by revolsys.
the class RecordLayerTable method addDeletedRecordHighlighter.
@Override
@SuppressWarnings({ "unchecked", "rawtypes" })
protected void addDeletedRecordHighlighter() {
final RecordLayerTableModel model = getModel();
final HighlightPredicate predicate = (renderer, adapter) -> {
try {
final int rowIndex = adapter.convertRowIndexToModel(adapter.row);
return model.isDeleted(rowIndex);
} catch (final Throwable e) {
}
return false;
};
addHighlighter(new ColorHighlighter(new AndHighlightPredicate(predicate, HighlightPredicate.EVEN), WebColors.newAlpha(WebColors.Pink, 127), WebColors.FireBrick, WebColors.LightCoral, WebColors.FireBrick));
addHighlighter(new ColorHighlighter(new AndHighlightPredicate(predicate, HighlightPredicate.ODD), WebColors.Pink, WebColors.FireBrick, WebColors.Crimson, WebColors.White));
final Font tableFont = getFont();
final Map<TextAttribute, Object> fontAttributes = (Map) tableFont.getAttributes();
fontAttributes.put(TextAttribute.STRIKETHROUGH, TextAttribute.STRIKETHROUGH_ON);
final Font font = new Font(fontAttributes);
final FontHighlighter fontHighlighter = new FontHighlighter(predicate, font);
addHighlighter(fontHighlighter);
}
Aggregations