public abstract class AbstractPainterDataValueRenderer extends JComponent implements DataValueRenderer
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.
JComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategylistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTPROPERTY_PREFERRED_RENDERERABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
AbstractPainterDataValueRenderer()
Creates a default table cell renderer.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetPreferredSizepublic AbstractPainterDataValueRenderer()
public String getDescription()
DataValueRenderergetDescription 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 renderval.public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
getTableCellRendererComponent in interface TableCellRendererpublic 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()
KNIME GmbH, Konstanz, Germany
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.