use of org.knime.base.node.util.DataArray in project knime-core by knime.
the class ScatterPlotNodeView method modelChanged.
/**
* This is going to be called by the model if the model data has changed.
*
* @see NodeView#modelChanged()
*/
@Override
public synchronized void modelChanged() {
ScatterPlotNodeModel model = (ScatterPlotNodeModel) getNodeModel();
if (model != null) {
// clear the plot
m_plot.clear();
// could be the property handler,
m_plot.setHiLiteHandler(getNodeModel().getInHiLiteHandler(0));
// or the data table.
m_plot.modelDataChanged(model.getRowsContainer());
// update the x/y col selectors, this should trigger
DataArray rows = model.getRowsContainer();
if (rows != null) {
m_properties.setSelectables(rows.getDataTableSpec());
} else {
m_properties.setSelectables(null);
}
}
}
use of org.knime.base.node.util.DataArray in project knime-core by knime.
the class ScatterPlotter method getXmin.
/**
* @return the lower limit of the X scale
*/
public double getXmin() {
if (getXColName() == null) {
return 0.0;
}
DataArray rows = m_rowContainer;
if ((rows == null) || (rows.size() == 0)) {
return 0.0;
}
DataTableSpec tSpec = rows.getDataTableSpec();
int idx = tSpec.findColumnIndex(getXColName());
if (idx < 0) {
return 0.0;
}
// 'getDoubleValue' returns the first valid double value
return getDoubleValue(m_userXmin, tSpec.getColumnSpec(idx).getDomain().getLowerBound(), rows.getMinValue(idx), Double.NaN);
}
use of org.knime.base.node.util.DataArray in project knime-core by knime.
the class ScatterPlotter method getYmax.
/**
* @return the upper limit of the Y scale
*/
public double getYmax() {
if (getYColName() == null) {
return 0.0;
}
DataArray rows = m_rowContainer;
if ((rows == null) || (rows.size() == 0)) {
return 0.0;
}
DataTableSpec tSpec = rows.getDataTableSpec();
int idx = tSpec.findColumnIndex(getYColName());
if (idx < 0) {
return 0.0;
}
// 'getDoubleValue' returns the first valid double value
return getDoubleValue(m_userYmax, tSpec.getColumnSpec(idx).getDomain().getUpperBound(), rows.getMaxValue(idx), Double.NaN);
}
use of org.knime.base.node.util.DataArray in project knime-core by knime.
the class ScatterPlotter method getXmax.
/**
* @return the upper limit of the X scale
*/
public double getXmax() {
if (getXColName() == null) {
return 0.0;
}
DataArray rows = m_rowContainer;
if ((rows == null) || (rows.size() == 0)) {
return 0.0;
}
DataTableSpec tSpec = rows.getDataTableSpec();
int idx = tSpec.findColumnIndex(getXColName());
if (idx < 0) {
return 0.0;
}
// 'getDoubleValue' returns the first valid double value
return getDoubleValue(m_userXmax, tSpec.getColumnSpec(idx).getDomain().getUpperBound(), rows.getMaxValue(idx), Double.NaN);
}
use of org.knime.base.node.util.DataArray in project knime-core by knime.
the class LiftChartNodeView method modelChanged.
/**
* {@inheritDoc}
*/
@Override
protected void modelChanged() {
final NodeModel model = getNodeModel();
m_liftChart.setDataProvider((DataProvider) model);
m_gainChart.setDataProvider(new DataProvider() {
public DataArray getDataArray(final int index) {
return ((LiftChartNodeModel) model).getDataArray(1);
}
});
m_liftChart.updatePaintModel();
m_gainChart.updatePaintModel();
}
Aggregations