use of org.knime.core.data.DataColumnProperties in project knime-core by knime.
the class TimeMissingValueHandlingNodeDialogPane method createAsIncompatibleMarkedColumnSpec.
private static DataColumnSpec createAsIncompatibleMarkedColumnSpec(final DataColumnSpec originalSpec) {
DataColumnSpecCreator creator = new DataColumnSpecCreator(originalSpec);
final DataColumnProperties origProps = originalSpec.getProperties();
final Map<String, String> map = createIncompatiblePropertiesMap();
final DataColumnProperties props;
if (origProps != null) {
props = origProps.cloneAndOverwrite(map);
} else {
props = new DataColumnProperties(map);
}
creator.setProperties(props);
final DataColumnSpec invalidSpec = creator.createSpec();
return invalidSpec;
}
use of org.knime.core.data.DataColumnProperties in project knime-core by knime.
the class HistogramColumn method createHistogramColumnSpec.
/**
* @return The {@link DataColumnSpec} for the column to be created.
*/
public DataColumnSpec createHistogramColumnSpec() {
final DataColumnSpecCreator columnSpecCreator = new DataColumnSpecCreator(m_colName, m_format.getDataType());
if (m_format == ImageFormats.SVG) {
final Map<String, String> widthAndHeight = new LinkedHashMap<String, String>();
widthAndHeight.put(SvgValueRenderer.OPTION_KEEP_ASPECT_RATIO, Boolean.toString(true));
widthAndHeight.put(SvgValueRenderer.OPTION_PREFERRED_WIDTH, Integer.toString(m_width));
widthAndHeight.put(SvgValueRenderer.OPTION_PREFERRED_HEIGHT, Integer.toString(m_height));
final DataColumnProperties props = new DataColumnProperties(widthAndHeight);
columnSpecCreator.setProperties(props);
}
DataColumnSpec histogramColumnSpec = columnSpecCreator.createSpec();
return histogramColumnSpec;
}
use of org.knime.core.data.DataColumnProperties in project knime-core by knime.
the class DataColumnSpecListCellRenderer method createInvalidSpec.
/**
* @param originalSpec the original {@link DataColumnSpec} to be marked as invalid
* @return the given {@link DataColumnSpec} with the added invalid flag
* @since 2.8
* @see #INVALID_PROPERTY_NAME
*/
public static final DataColumnSpec createInvalidSpec(final DataColumnSpec originalSpec) {
DataColumnSpecCreator creator = new DataColumnSpecCreator(originalSpec);
final DataColumnProperties origProps = originalSpec.getProperties();
final Map<String, String> map = creaeteInvalidPropertiesMap();
final DataColumnProperties props;
if (origProps != null) {
props = origProps.cloneAndOverwrite(map);
} else {
props = new DataColumnProperties(map);
}
creator.setProperties(props);
final DataColumnSpec invalidSpec = creator.createSpec();
return invalidSpec;
}
use of org.knime.core.data.DataColumnProperties in project knime-core by knime.
the class DataColumnSpecListCellRenderer method createInvalidSpec.
/**
* @param colName the name of the invalid column
* @param type Type of the column
* @return the invalid {@link DataColumnSpec} for the given name and type
* @since 2.9
*/
public static DataColumnSpec createInvalidSpec(final String colName, final DataType type) {
DataColumnSpecCreator creator = new DataColumnSpecCreator(colName, type);
creator.setProperties(new DataColumnProperties(creaeteInvalidPropertiesMap()));
return creator.createSpec();
}
use of org.knime.core.data.DataColumnProperties in project knime-core by knime.
the class SampleDataNodeModel method configure.
/**
* {@inheritDoc}
*/
@Override
protected DataTableSpec[] configure(final DataTableSpec[] inSpecs) {
DataColumnSpec[] colSpecs = new DataColumnSpec[m_minValues.length + 1];
int currentDim = 0;
for (int u = 0; u < m_clusterCount.length; u++) {
int dimCountInUniverse = m_uniSize[u];
Hashtable<String, String> annot = new Hashtable<String, String>();
annot.put("universe_name", "Universe_" + u);
for (int i = 0; i < dimCountInUniverse; i++) {
String n = "Universe_" + u + "_" + i;
DataType t = DoubleCell.TYPE;
DataColumnSpecCreator creator = new DataColumnSpecCreator(n, t);
creator.setProperties(new DataColumnProperties(annot));
colSpecs[currentDim++] = creator.createSpec();
}
}
String n = "Cluster Membership";
DataType t = StringCell.TYPE;
DataColumnSpecCreator creator = new DataColumnSpecCreator(n, t);
colSpecs[currentDim] = creator.createSpec();
DataColumnSpec[] centerColSpec = new DataColumnSpec[colSpecs.length - 1];
System.arraycopy(colSpecs, 0, centerColSpec, 0, centerColSpec.length);
return new DataTableSpec[] { new DataTableSpec(colSpecs), new DataTableSpec(centerColSpec) };
}
Aggregations