org.knime.core.data.renderer
Interface DataValueRendererFamily

All Superinterfaces:
DataValueRenderer, ListCellRenderer, TableCellRenderer
All Known Implementing Classes:
DefaultDataValueRendererFamily, SetOfRendererFamilies

public interface DataValueRendererFamily
extends DataValueRenderer

Container for different DataValueRenderers which can be used to render one particular kind of DataValue. This interface itself extends DataValueRenderer, thus it can be used in lists, tables and such. Among the renderer in this container there is always one active one which will be used to delegate request to.

Classes implementing this interface can instantiate different kind of DataValueRenderer. The number of different renderers is defined by the number of different descriptions returned by the getRendererDescriptions() method. Which renderer is actually used (i.e. active) is defined by the setActiveRenderer(String) method.

There is description assigned to each of the available renderers. This string can be used in menus and so on to give a choice of the different renderer available.

Refer to the package description to see how to couple a DataValueRendererFamily with a DataValue implementation.

Author:
Bernd Wiswedel, University of Konstanz
See Also:
DataValue, DataValueRenderer

Field Summary
 
Fields inherited from interface org.knime.core.data.renderer.DataValueRenderer
PROPERTY_PREFERRED_RENDERER
 
Method Summary
 boolean accepts(String desc, DataColumnSpec spec)
          Is the renderer with the given description able to render the content of spec.
 String[] getRendererDescriptions()
          Get a "unique" description for all renderer that are available in this family.
 void setActiveRenderer(String description)
          Set the currently active renderer.
 
Methods inherited from interface org.knime.core.data.renderer.DataValueRenderer
accepts, getDescription, getPreferredSize, getRendererComponent
 
Methods inherited from interface javax.swing.table.TableCellRenderer
getTableCellRendererComponent
 
Methods inherited from interface javax.swing.ListCellRenderer
getListCellRendererComponent
 

Method Detail

getRendererDescriptions

String[] getRendererDescriptions()
Get a "unique" description for all renderer that are available in this family.

Returns:
The Descriptions of all renderer that can be used here.

setActiveRenderer

void setActiveRenderer(String description)
Set the currently active renderer. The argument must be an element of whatever is returned in getRendererDescription(). If it is not this method won't do anything.

Parameters:
description - The ID of the renderer to be used.

accepts

boolean accepts(String desc,
                DataColumnSpec spec)
Is the renderer with the given description able to render the content of spec.

Parameters:
desc - The description of the renderer.
spec - The column spec to check.
Returns:
If the renderer can render the column with the given spec.
Throws:
IllegalArgumentException - If the description is unknown.
See Also:
DataValueRenderer.accepts(DataColumnSpec)


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
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.