boolean isSelected, boolean hasFocus,
int row, int column) {
Component component = super.getTableCellRendererComponent(
table, value, isSelected, hasFocus, row, column);
if (value instanceof ProgressionValue) {
ProgressionValue progression = (ProgressionValue) value;
int status = progression.getStatus();
if (status < 0) {
if (isSelected) {
component.setBackground(table.getSelectionBackground());
component.setForeground(Color.GREEN);
} else {
component.setBackground(Color.GREEN);
component.setForeground(table.getForeground());
}
} else if (status > 0) {
if (isSelected) {
component.setBackground(table.getSelectionBackground());
component.setForeground(Color.RED);
} else {
component.setBackground(Color.RED);
component.setForeground(table.getForeground());
}
} else {
if (isSelected) {
component.setBackground(table.getSelectionBackground());
if ((progression.getCurrent() != null) && (progression.getGoal() == null)) {
component.setForeground(Color.GRAY);
} else {
component.setForeground(table.getSelectionForeground());
}
} else {
component.setBackground(table.getBackground());
if ((progression.getCurrent() != null) && (progression.getGoal() == null)) {
component.setForeground(Color.GRAY);
} else {
component.setForeground(table.getForeground());
}
}