use of org.knime.core.node.port.viewproperty.ShapeHandlerPortObject in project knime-core by knime.
the class ShapeManagerNodeModel method execute.
/**
* Is invoked during the node's execution to make the shape settings.
*
* @param data the input data array
* @param exec the execution monitor
* @return the same input data table with assigned shapes to one column
* @throws CanceledExecutionException if user canceled execution
*
* @see NodeModel#execute(BufferedDataTable[],ExecutionContext)
*/
@Override
protected PortObject[] execute(final PortObject[] data, final ExecutionContext exec) throws CanceledExecutionException {
BufferedDataTable inData = (BufferedDataTable) data[INPORT];
ShapeHandler shapeHandler = new ShapeHandler(new ShapeModelNominal(m_map));
final DataTableSpec newSpec = appendShapeHandler(inData.getSpec(), m_column, shapeHandler);
BufferedDataTable changedSpecTable = exec.createSpecReplacerTable(inData, newSpec);
DataTableSpec modelSpec = new DataTableSpec(newSpec.getColumnSpec(m_column));
ShapeHandlerPortObject viewPort = new ShapeHandlerPortObject(modelSpec, shapeHandler.toString() + " based on column \"" + m_column + "\"");
return new PortObject[] { changedSpecTable, viewPort };
}
Aggregations