public interface DataValueRenderer extends TableCellRenderer, ListCellRenderer
This interface extends
ListCellRenderer. Thus, it can be easily used in lists and
tables. The preferred way of instantiating an object of a renderer is to use
|Modifier and Type||Field and Description|
The property identifier that is read from, for instance the table view to determine which particular renderer (from the set of available renderers to a column) is to be used.
|Modifier and Type||Method and Description|
Is this renderer instance able to render the content of the column given by
Get a description for this renderer implementation.
Get the dimension which the renderer component will preferably occupy.
Get a component that visualizes a given object.
static final String PROPERTY_PREFERRED_RENDERER
DataColumnSpec's domain informationand should map to the description string of the renderer. A sample code that sets this property on a newly created double column to use the bar renderer is as follows:
DataColumnSpecCreator creator = new DataColumnSpecCreator( newName, DoubleCell.TYPE); creator.setProperties(new DataColumnProperties( Collections.singletonMap( DataValueRenderer.PROPERTY_PREFERRED_RENDERER, DoubleBarRenderer.DESCRIPTION))); creator.setDomain(new DataColumnDomainCreator( new DoubleCell(0.0), new DoubleCell(1.0)).createDomain()); DataColumnSpec spec = creator.createSpec();
Keep in mind that setting the preferred renderer to an instance
that inherently depends on proper domain information to be available
(for instance [0,1]) requires the spec's
to be set appropriately.
DataCellimplementing the underlying
DataValueinterface. The implementation, however, needs to handle other cases as well, such as
DataCellor generic objects.
val- The value to render
boolean accepts(DataColumnSpec spec)
spec. Most implementations will return
truehere but some may require some properties to be set, for instance a molecule renderer needs to have 2D coordinates in the column.
Note: This method is not used to test whether arbitrary types can be renderer by this renderer instance but rather if the specific runtime column spec (containing the type) is appropriate, for instance contains domain information or certain properties are set.
spec- The column spec to check.
trueif this renderer can be chosen to render the content of the column.
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.