return CalendarState.DAY_OF_WEEK == ca.getCalendarState() ||
CalendarState.TITLE == ca.getCalendarState();
}
};
Highlighter font = new AbstractHighlighter(boldPredicate) {
@Override
protected Component doHighlight(Component component,
ComponentAdapter adapter) {
component.setFont(getDerivedFont(component.getFont()));
return component;
}
};
highlighter.addHighlighter(font);
HighlightPredicate unselectable = new HighlightPredicate() {
public boolean isHighlighted(Component renderer,
ComponentAdapter adapter) {
if (!(adapter instanceof CalendarAdapter))
return false;
return ((CalendarAdapter) adapter).isUnselectable();
}
};
textCross.setForeground(unselectableDayForeground);
Highlighter painterHL = new PainterHighlighter(unselectable, textCross);
highlighter.addHighlighter(painterHL);
}