|
||||||||||
| 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
org.knime.core.data.renderer.AbstractPainterDataValueRenderer
public abstract class AbstractPainterDataValueRenderer
Abstract implementation of a DataValueRenderer that renders more
complex scenes than just ordinary text. This abstract already supplies
implementations of the getTableCellRendererComponent and
getListCellRenderer methods. Subclasses usually override
setValue(Object): Keep the object to render as fieldJComponent.paintComponent(java.awt.Graphics): Render the object
to a graphics object, if the rendering is implemented in an external panel
implementation, use SwingUtilities.paintComponent(
java.awt.Graphics, Component, java.awt.Container, int, int, int, int)
getDescription(): Return a more meaningful description than
just "Default"
Implementation Note:
This class inherits from JComponent but is not supposed
to be put into a component hierarchy. It should only be used for rendering.
| Nested Class Summary |
|---|
| 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 |
|---|
| 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 org.knime.core.data.renderer.DataValueRenderer |
|---|
PROPERTY_PREFERRED_RENDERER |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
AbstractPainterDataValueRenderer()
Creates a default table cell renderer. |
|
| Method Summary | |
|---|---|
boolean |
accepts(DataColumnSpec spec)
Returns always true. |
String |
getDescription()
Get a description for this renderer implementation. |
Component |
getListCellRendererComponent(JList list,
Object value,
int index,
boolean isSelected,
boolean cellHasFocus)
|
Component |
getRendererComponent(Object val)
Get a component that visualizes a given object. |
Component |
getTableCellRendererComponent(JTable table,
Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column)
|
void |
invalidate()
Overridden for performance reasons. |
boolean |
isOpaque()
Overridden for performance reasons. |
void |
repaint()
Overridden for performance reasons. |
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. |
void |
setBackground(Color c)
Overrides JComponent.setBackground to assign
the unselected-background color to the specified color. |
void |
setForeground(Color c)
Overrides JComponent.setForeground to assign
the unselected-foreground color to the specified color. |
protected abstract void |
setValue(Object value)
Sets the object to be rendered next. |
void |
updateUI()
Notification from the UIManager that the look and feel
[L&F] has changed. |
void |
validate()
Overridden for performance reasons. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.knime.core.data.renderer.DataValueRenderer |
|---|
getPreferredSize |
| Constructor Detail |
|---|
public AbstractPainterDataValueRenderer()
| Method Detail |
|---|
public String getDescription()
DataValueRenderer
getDescription in interface DataValueRendererDataValueRenderer.getDescription()public boolean accepts(DataColumnSpec spec)
true.
accepts in interface DataValueRendererspec - The column spec to check.
true if this renderer can be chosen to render
the content of the column.DataValueRenderer.accepts(DataColumnSpec)protected abstract void setValue(Object value)
getRendererComponent(Object),
getTableCellRendererComponent(
JTable, Object, boolean, boolean, int, int), and
getListCellRendererComponent(
JList, Object, int, boolean, boolean) methods.
value - The value to render. This is most of the time a DataValue
that the derived class is supposed to render. However, it may also
be null, a missing data cell or any other object.public Component getRendererComponent(Object val)
DataCell implementing the underlying
DataValue interface. The implementation, however, needs to
handle other cases as well, such as null arguments,
missing DataCell or generic objects.
getRendererComponent in interface DataValueRendererval - The value to render
val.
public Component getTableCellRendererComponent(JTable table,
Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column)
getTableCellRendererComponent in interface TableCellRenderer
public Component getListCellRendererComponent(JList list,
Object value,
int index,
boolean isSelected,
boolean cellHasFocus)
getListCellRendererComponent in interface ListCellRendererpublic void setForeground(Color c)
JComponent.setForeground to assign
the unselected-foreground color to the specified color.
setForeground in class JComponentc - set the foreground color to this valuepublic void setBackground(Color c)
JComponent.setBackground to assign
the unselected-background color to the specified color.
setBackground in class JComponentc - set the background color to this valuepublic void updateUI()
UIManager that the look and feel
[L&F] has changed.
Replaces the current UI object with the latest version from the
UIManager.
updateUI in class JComponentJComponent.updateUI()public boolean isOpaque()
isOpaque in class JComponentJComponent.isOpaque()public void invalidate()
invalidate in class ContainerContainer.invalidate()public void validate()
validate in class ContainerContainer.validate()public void revalidate()
revalidate in class JComponentJComponent.revalidate()
public void repaint(long tm,
int x,
int y,
int width,
int height)
repaint in class JComponentJComponent.repaint(long, int, int, int, int)public void repaint(Rectangle r)
repaint in class JComponentJComponent.repaint(Rectangle)public void repaint()
repaint in class ComponentComponent.repaint()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||