1 18 19 package org.objectweb.jac.aspects.gui.swing; 20 21 import java.awt.Component ; 22 import javax.swing.JLabel ; 23 import javax.swing.table.TableCellRenderer ; 24 import org.apache.log4j.Logger; 25 import org.objectweb.jac.aspects.gui.GuiAC; 26 27 public class ToStringTableCellRenderer extends JLabel implements TableCellRenderer 28 { 29 static Logger logger = Logger.getLogger("gui.table"); 30 31 public ToStringTableCellRenderer() 32 {} 33 34 public Component getTableCellRendererComponent( 35 javax.swing.JTable table, Object value, 36 boolean isSelected, boolean hasFocus, 37 int row, int column) 38 { 39 logger.debug( 40 "ToStringTableCellRenderer.getTableCellRendererComponent("+ 41 row+","+column+","+isSelected+")"); 42 43 setOpaque(true); 45 if (isSelected) { 46 setForeground(table.getSelectionForeground()); 47 setBackground(table.getSelectionBackground()); 48 } else { 49 setForeground(table.getForeground()); 50 setBackground(table.getBackground()); 51 } 52 setFont(null); 53 54 setText(GuiAC.toString(value)); 55 56 return this; 57 } 58 59 } 60 | Popular Tags |