1
2 package hoplugins.teamAnalyzer.ui;
3
4 import java.awt.Component;
5
6 import javax.swing.JTable;
7 import javax.swing.table.DefaultTableCellRenderer;
8
9
10 /***
11 * TODO Missing Class Documentation
12 *
13 * @author TODO Author Name
14 */
15 public class ManualFilterTableRenderer extends DefaultTableCellRenderer {
16
17
18 /***
19 * TODO Missing Method Documentation
20 *
21 * @param table TODO Missing Method Parameter Documentation
22 * @param value TODO Missing Method Parameter Documentation
23 * @param isSelected TODO Missing Method Parameter Documentation
24 * @param hasFocus TODO Missing Method Parameter Documentation
25 * @param row TODO Missing Method Parameter Documentation
26 * @param column TODO Missing Method Parameter Documentation
27 *
28 * @return TODO Missing Return Method Documentation
29 */
30 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
31 boolean hasFocus, int row, int column) {
32 Component cell = super.getTableCellRendererComponent(table, value, isSelected, hasFocus,
33 row, column);
34 int type = 0;
35
36 try {
37 type = Integer.parseInt((String) table.getValueAt(row, 7));
38 } catch (NumberFormatException e) {
39 }
40
41 cell.setBackground(UIColors.getColor4Matchtyp(type));
42
43 String available = (String) table.getValueAt(row, 6);
44
45 if (!available.equalsIgnoreCase("true")) {
46 cell.setEnabled(false);
47 } else {
48 cell.setEnabled(true);
49 }
50
51 return cell;
52 }
53 }