@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
JLabel c = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
ItemsTableModel model = (ItemsTableModel) table.getModel();
ItemLine itemLine = model.getItemAtRow(table.convertRowIndexToModel(row));
ItemProperty in = itemsProperties.get(itemLine.getItem().getName());
LocationProperty ln = locationsProperties.get(itemLine.getLocation().getName());
if ((ln != null) && ln.isIgnore()) {
c.setForeground(ignoreColor);
} else if ((in != null) && model.isForSale() && (in.getMaximumForSalePrice() != null) &&
(itemLine.getPrice() <= in.getMaximumForSalePrice())) {
c.setForeground(nicePriceColor);
} else if ((in != null) && !model.isForSale() && (in.getMinimumWantedPrice() != null) &&
itemLine.getPrice() >= in.getMinimumWantedPrice()) {
c.setForeground(nicePriceColor);
} else if (itemLine.getConnectedItemLines().size() != 0) {
c.setForeground(routeColor);
} else {
c.setForeground(UIManager.getColor("Table.foreground"));
}
if (itemLine.getConnectedItemLines().size() > 0) {
c.setToolTipText(PricelistsTools.buildTooltip(itemLine));
}
if (value instanceof Number) {
c.setText(df.format(value));
}