|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JLabel
org.jurvis.swing.table.JvDefaultTableCellRenderer
public class JvDefaultTableCellRenderer
Custom cell renderer that honors the table's "enabled" property and makes
non-editable cells the same color as the background. Also uses its own font
rather than the table's font so that each cell may be given its own font.
Note: I had way too many problems extending
DefaultTableCellRenderer. Some of the display optimizations
there make changing the background of a particular cell difficult, if not
impossible. Occasionally cut and paste is the best code reuse technique.
DefaultTableCellRenderer,
Serialized Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JLabel |
|---|
JLabel.AccessibleJLabel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected Format |
formatter
Format object used to product a string from rendered object. |
protected static Border |
noFocusBorder
Border used when the cell doesn't have focus. |
| Fields inherited from class javax.swing.JLabel |
|---|
labelFor |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface javax.swing.SwingConstants |
|---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
JvDefaultTableCellRenderer()
Construct a JvDefaultTableCellRenderer that simply calls
toString on the rendered object. |
|
JvDefaultTableCellRenderer(Format formatter)
Construct a JvDefaultTableCellRenderer with the specified
Format object. |
|
| Method Summary | |
|---|---|
void |
firePropertyChange(String propertyName,
boolean oldValue,
boolean newValue)
Overridden for performance reasons. |
protected void |
firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
Overridden for performance reasons. |
Component |
getTableCellRendererComponent(JTable table,
Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column)
|
void |
repaint(long tm,
int x,
int y,
int width,
int height)
Overridden for performance reasons. |
void |
repaint(Rectangle r)
Overridden for performance reasons. |
void |
revalidate()
Overridden for performance reasons. |
protected void |
setValue(Object value)
Sets the string for the cell being rendered to value. |
void |
validate()
Overridden for performance reasons. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final Border noFocusBorder
protected Format formatter
toString().
| Constructor Detail |
|---|
public JvDefaultTableCellRenderer()
JvDefaultTableCellRenderer that simply calls
toString on the rendered object.
public JvDefaultTableCellRenderer(Format formatter)
JvDefaultTableCellRenderer with the specified
Format object.
formatter - object to string formatter, may be null| Method Detail |
|---|
public Component getTableCellRendererComponent(JTable table,
Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column)
getTableCellRendererComponent in interface TableCellRendererpublic void validate()
validate in class Containerpublic void revalidate()
revalidate in class JComponent
public void repaint(long tm,
int x,
int y,
int width,
int height)
repaint in class JComponentpublic void repaint(Rectangle r)
repaint in class JComponent
protected void firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
firePropertyChange in class Component
public void firePropertyChange(String propertyName,
boolean oldValue,
boolean newValue)
firePropertyChange in class JComponentprotected void setValue(Object value)
value.
value - the string value for this cell; if value is
null it sets the text value to an empty stringJLabel.setText(java.lang.String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||