1 32 33 package it.businesslogic.ireport.gui.sheet; 34 35 import it.businesslogic.ireport.chart.MeterInterval; 36 import java.awt.Component ; 37 import javax.swing.JLabel ; 38 import javax.swing.JTable ; 39 import javax.swing.table.DefaultTableCellRenderer ; 40 41 45 public class MeterIntervalTableCellRenderer extends DefaultTableCellRenderer { 46 47 48 public MeterIntervalTableCellRenderer() { 49 super(); 50 } 51 52 public Component getTableCellRendererComponent(JTable table, 53 Object value, 54 boolean isSelected, 55 boolean hasFocus, int row, int column) 56 { 57 super.getTableCellRendererComponent(table, value, isSelected, hasFocus,row, column); 58 59 if (value instanceof MeterInterval && value != null) 60 { 61 setText( ((MeterInterval)value).getLabel() ); 62 63 setIcon( new ColorIcon( ( (MeterInterval)value).getColor() )); 64 65 } 66 67 return this; 68 } 69 } 70 | Popular Tags |