|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.mucommander.ui.main.table.FileTableCellRenderer
public class FileTableCellRenderer
The custom TableCellRenderer class used by FileTable to render all table cells.
Quote from Sun's Javadoc : The table class defines a single cell renderer and uses it as a as a rubber-stamp for rendering all cells in the table; it renders the first cell, changes the contents of that cell renderer, shifts the origin to the new location, re-draws it, and so on.
This TableCellRender is written from scratch instead of overridding DefaultTableCellRender
to provide a more efficient (and more specialized) implementation: each column is rendered using a dedicated
CellLabel which takes into account the column's specificities.
Having a dedicated for each column avoids calling the label's set methods (alignment, border, font...)
each time getTableCellRendererComponent(javax.swing.JTable, Object, boolean, boolean, int, int)}
is invoked, making cell rendering faster.
Contrarily to DefaultTableCellRender, FileTableCellRenderer does not extend JLabel,
instead the dedicated CellLabel class is used to render cells, making the implementation
less confusing IMO.
| Constructor Summary | |
|---|---|
FileTableCellRenderer(FileTable table)
|
|
| Method Summary | |
|---|---|
void |
colorChanged(ColorChangedEvent event)
Receives theme color changes notifications. |
void |
fontChanged(FontChangedEvent event)
Receives theme font changes notifications. |
static java.awt.Font |
getCellFont()
Returns the font used to render all table cells. |
java.awt.Component |
getTableCellRendererComponent(javax.swing.JTable table,
java.lang.Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileTableCellRenderer(FileTable table)
| Method Detail |
|---|
public static java.awt.Font getCellFont()
public java.awt.Component getTableCellRendererComponent(javax.swing.JTable table,
java.lang.Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column)
getTableCellRendererComponent in interface javax.swing.table.TableCellRendererpublic void colorChanged(ColorChangedEvent event)
colorChanged in interface ThemeListenerpublic void fontChanged(FontChangedEvent event)
fontChanged in interface ThemeListener
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard