CellContext implements Serializable { protected Font getFont() { return getComponent() != null ? getComponent().getFont() : null; }  Object replaceValue(Object value); JComponent getComponent(); Object getValue(); int getRow(); int getColumn(); boolean isSelected(); boolean isFocused(); boolean isExpanded(); boolean isLeaf(); boolean isEditable(); Icon getIcon(); String getCellRendererName();  }
@Test public void testDefaultVisualsUseContextFont() { JXTable table = new JXTable(); final Font font = table.getFont().deriveFont(50f); TableCellContext context = new TableCellContext() { @Override protected Font getFont() { return font; } }; context.installContext(table, -1, -1, -1, false, false, false, false); JLabel label = new JLabel(); new DefaultVisuals<JLabel>().configureVisuals(label, context); assertEquals(font, label.getFont()); }
@Test public void testFontWithoutComponent() { CellContext context = new CellContext(); assertNull(context.getFont()); }
@Test public void testFontWithComponent() { final JLabel label = new JLabel(); CellContext context = new CellContext() { @Override public JComponent getComponent() { return label; } }; assertNotNull("sanity", label.getFont()); assertEquals(label.getFont(), context.getFont()); }