View Javadoc

1   // %937290090:hoplugins.trainingExperience.ui.renderer%
2   /*
3    * Created on 14-mar-2005
4    *
5    * To change the template for this generated file go to
6    * Window>Preferences>Java>Code Generation>Code and Comments
7    */
8   package hoplugins.trainingExperience.ui.renderer;
9   
10  import hoplugins.trainingExperience.ui.bar.VerticalIndicator;
11  
12  import java.awt.Component;
13  
14  import javax.swing.JTable;
15  import javax.swing.table.DefaultTableCellRenderer;
16  
17  
18  /***
19   * DOCUMENT ME!
20   *
21   * @author Mirtillo To change the template for this generated type comment go to
22   *         Window>Preferences>Java>Code Generation>Code and Comments
23   */
24  public class OutputTableRenderer extends DefaultTableCellRenderer {
25      //~ Methods ------------------------------------------------------------------------------------
26  
27      /* (non-Javadoc)
28       * @see javax.swing.table.TableCellRenderer#getTableCellRendererComponent(javax.swing.JTable, java.lang.Object, boolean, boolean, int, int)
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  
35          if ((column > 2) && (column < 11)) {
36              VerticalIndicator vi = (VerticalIndicator) value;
37  
38              // Set background and make it visible.
39              vi.setBackground(cell.getBackground());
40              vi.setOpaque(true);
41  
42              return vi;
43          }
44  
45          return cell;
46      }
47  }