use of org.knime.base.node.viz.histogram.impl.interactive.InteractiveHistogramPlotter in project knime-core by knime.
the class HistogramNodeView method modelChanged.
/**
* Whenever the model changes an update for the plotter is triggered and new
* HiLiteHandler are set.
*/
@Override
public void modelChanged() {
final AbstractHistogramNodeModel model = getNodeModel();
if (model == null) {
return;
}
if (m_plotter != null) {
m_plotter.reset();
}
final DataTableSpec tableSpec = model.getTableSpec();
AbstractHistogramVizModel vizModel = model.getHistogramVizModel();
if (vizModel == null) {
return;
}
if (m_plotter == null) {
final InteractiveHistogramProperties props = new InteractiveHistogramProperties(tableSpec, vizModel);
m_plotter = new InteractiveHistogramPlotter(props, model.getInHiLiteHandler(0));
// add the hilite menu to the menu bar of the node view
getJMenuBar().add(m_plotter.getHiLiteMenu());
}
m_plotter.setHiLiteHandler(model.getInHiLiteHandler(0));
m_plotter.setHistogramVizModel(tableSpec, vizModel);
m_plotter.updatePaintModel();
if (m_plotter != null) {
m_plotter.fitToScreen();
}
if (getComponent() != m_plotter) {
setComponent(m_plotter);
}
}
Aggregations