/** * Creates a default cell renderer for {@link CoordinateTableModel}. */ public CellRenderer() { super(); foreground = super.getForeground(); background = super.getBackground(); }
/** * Construct a new cell renderer. */ public CellRenderer() { foreground = super.getForeground(); background = super.getBackground(); table.getColumnModel().addColumnModelListener(this); }
/** * Creates a default cell renderer for {@link ResultTableModel}. */ ResultCellRenderer() { super(); foreground = super.getForeground(); background = super.getBackground(); ignoreColor = Color.GRAY; failureColor = Color.RED; coverage = new Coverage(); }
setForeground(adaptee.getForeground()); setBackground(adaptee.getBackground()); setBorder(adaptee.getBorder());
@Override public Component getTableCellRendererComponent(final JTable table, final Object obj, final boolean isSelected, final boolean hasFocus, final int row, final int column) { // set the colors, etc. using the standard for that platform adaptee.getTableCellRendererComponent(table, obj, isSelected, hasFocus, row, column); setForeground(adaptee.getForeground()); setBackground(adaptee.getBackground()); setBorder(adaptee.getBorder()); setFont(adaptee.getFont()); setText(adaptee.getText()); // This line was very important to get it working with JDK1.4 final TableColumnModel columnModel = table.getColumnModel(); setSize(columnModel.getColumn(column).getWidth(), 100000); int heightWanted = (int) getPreferredSize().getHeight(); addSize(table, row, column, heightWanted); heightWanted = findTotalMaximumRowSize(table, row); if (heightWanted != table.getRowHeight(row)) { table.setRowHeight(row, heightWanted); } return this; }