@Override
public Component getTableCellRendererComponent( final JTable table, final Object value, final boolean isSelected, final boolean hasFocus,
final int row, final int column ) {
xtcrenderer.setBackground( null );
xtcrenderer.getTableCellRendererComponent( table, value, isSelected, hasFocus, row, column );
if ( value != null && !( (String) value ).contains( " class='MONTH' " ) ) {
xtcrenderer.setBorder( BorderFactory.createRaisedSoftBevelBorder() );
if ( !isSelected ) {
final Stats stats = cellStatsMap.get( new Pair<>( table.convertRowIndexToModel( row ), table.convertColumnIndexToModel( column ) ) );
if ( stats == null ) {
xtcrenderer.setBackground( RESTED_COLOR );
} else {
final int colorIdx = (int) ( playerStats == null ? 0 : 2 * stats.totalTimePlayedMs * PCC / MS_IN_DAY );
xtcrenderer.setBackground( PLAYED_COLORS[ Math.max( 0, Math.min( PCC - 1, colorIdx ) ) ] );
}
}
} else if ( !isSelected ) {
xtcrenderer.setBackground( Color.WHITE );
}
return xtcrenderer;
}
} );