use of org.knime.base.node.viz.histogram.impl.fixed.FixedHistogramPlotter in project knime-core by knime.
the class FixedColumnHistogramNodeView method modelChanged.
/**
* Whenever the model changes an update for the plotter is triggered and new
* HiLiteHandler are set.
*/
@Override
public void modelChanged() {
final FixedColumnHistogramNodeModel model = getNodeModel();
if (model == null) {
return;
}
final DataTableSpec tableSpec = model.getTableSpec();
if (m_plotter != null) {
m_plotter.reset();
}
final AbstractHistogramVizModel vizModel = model.getHistogramVizModel();
if (vizModel == null) {
return;
}
if (m_plotter == null) {
final FixedHistogramProperties props = new FixedHistogramProperties(tableSpec, vizModel);
m_plotter = new FixedHistogramPlotter(props, model.getInHiLiteHandler(0));
// hiliting is not supported in the fixed column histogram
}
m_plotter.setHiLiteHandler(model.getInHiLiteHandler(0));
m_plotter.setHistogramVizModel(tableSpec, vizModel);
m_plotter.updatePaintModel();
if (getComponent() != m_plotter) {
setComponent(m_plotter);
}
if (m_plotter != null) {
m_plotter.fitToScreen();
}
}
Aggregations