|
ehsbe CommonsTM Version 1.1.0rc3 |
|||||||||
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
javax.swing.table.DefaultTableCellRenderer
com.ehsbe.commons.gui.util.ObjectTableCellRenderer
public class ObjectTableCellRenderer
A renderer, which allows one to query the table model for its state and rendering an appropriate border or colored text.
CellTableThreshold
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.table.DefaultTableCellRenderer |
---|
DefaultTableCellRenderer.UIResource |
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.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected static CompoundBorder |
ALERT_BORDER
default border to be used for cells in alert state - the outer border has to be a line border and should match the insets of EMPTY_BORDER |
protected static Border |
EMPTY_BORDER
default border to use |
protected static CompoundBorder |
WARN_BORDER
default border to be used for cells in warn state - the outer border has to be a line border and should match the insets of EMPTY_BORDER |
Fields inherited from class javax.swing.table.DefaultTableCellRenderer |
---|
noFocusBorder |
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 | |
---|---|
ObjectTableCellRenderer()
Default Renderer with default borders. |
|
ObjectTableCellRenderer(Border border)
Default Renderer with the given border. |
Method Summary | |
---|---|
Border |
getAlertBorder()
Get the border, which should be used, if the given cell is in alert state. |
Border |
getBorder()
Get the default Border for this renderer, used to draw the cell in normal state. |
Component |
getTableCellRendererComponent(JTable table,
Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column)
|
Border |
getWarnBorder()
Get the border, which should be used, if the given cell is in warning state. |
boolean |
isIgnoreState()
Set whether states of the cell should be ignored. |
void |
setAlertBorder(Border alertBorder)
Set the border, which should be used, if the given cell is in alert state. |
void |
setBorder(Border border)
Set the default Border for this renderer, used to draw the cell in normal state. |
void |
setIgnoreState(boolean ignoreState)
Set whether states of the cell should be obtained and the text or border should be decorated, depending on the state. |
protected void |
setValue(Object value)
|
void |
setWarnBorder(Border warnBorder)
Set the border, which should be used, if the given cell is in warn state. |
Methods inherited from class javax.swing.table.DefaultTableCellRenderer |
---|
firePropertyChange, firePropertyChange, invalidate, isOpaque, repaint, repaint, repaint, revalidate, setBackground, setForeground, updateUI, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final Border EMPTY_BORDER
protected static CompoundBorder WARN_BORDER
protected static CompoundBorder ALERT_BORDER
Constructor Detail |
---|
public ObjectTableCellRenderer()
public ObjectTableCellRenderer(Border border)
border
- border to set. If null
, default borders
will be used for normal, warn and alert states.setIgnoreState(boolean)
Method Detail |
---|
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
getTableCellRendererComponent
in interface TableCellRenderer
getTableCellRendererComponent
in class DefaultTableCellRenderer
protected void setValue(Object value)
setValue
in class DefaultTableCellRenderer
public Border getAlertBorder()
null
if not set.public void setAlertBorder(Border alertBorder)
null
,
the text gets decorated instead of the border.
alertBorder
- alertBorder to set. Might be null
.public Border getWarnBorder()
null
if not set.public void setWarnBorder(Border warnBorder)
null
,
the text gets decorated instead of the border.
warnBorder
- warnBorder to set. Might be null
.public void setBorder(Border border)
setBorder
in class JComponent
border
- border to set.public Border getBorder()
getBorder
in class JComponent
null
if not set.public boolean isIgnoreState()
true
if the state of cells gets ignored.public void setIgnoreState(boolean ignoreState)
ignoreState
- if true
, dont ask and render always as
in the normal state.setBorder(Border)
,
setWarnBorder(Border)
,
setAlertBorder(Border)
|
ehsbe CommonsTM Version 1.1.0rc3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |