Search in sources :

Example 1 with FixedHistogramPlotter

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();
    }
}
Also used : DataTableSpec(org.knime.core.data.DataTableSpec) AbstractHistogramVizModel(org.knime.base.node.viz.histogram.datamodel.AbstractHistogramVizModel) FixedHistogramProperties(org.knime.base.node.viz.histogram.impl.fixed.FixedHistogramProperties) FixedHistogramPlotter(org.knime.base.node.viz.histogram.impl.fixed.FixedHistogramPlotter)

Aggregations

AbstractHistogramVizModel (org.knime.base.node.viz.histogram.datamodel.AbstractHistogramVizModel)1 FixedHistogramPlotter (org.knime.base.node.viz.histogram.impl.fixed.FixedHistogramPlotter)1 FixedHistogramProperties (org.knime.base.node.viz.histogram.impl.fixed.FixedHistogramProperties)1 DataTableSpec (org.knime.core.data.DataTableSpec)1