use of org.knime.base.node.viz.plotter.AbstractPlotter in project knime-core by knime.
the class BinModelNodeView method modelChanged.
/**
* {@inheritDoc}
*/
@Override
protected void modelChanged() {
CAIMDiscretizationNodeModel model = getNodeModel();
if (model == null) {
return;
}
HiLiteHandler hiliteHandler = model.getInHiLiteHandler(0);
for (AbstractPlotter plotter : m_plotters) {
plotter.reset();
plotter.setHiLiteHandler(hiliteHandler);
((BinModelPlotter) plotter).setDiscretizationModel((model).getDiscretizationModel());
plotter.updatePaintModel();
plotter.getDrawingPane().repaint();
}
}
use of org.knime.base.node.viz.plotter.AbstractPlotter in project knime-core by knime.
the class DefaultVisualizationNodeView method addVisualization.
/**
* Adds another tab with title <code>title</code> containing a plotter.
* @param plotter another visualization
* @param title the title of the tab (if null a standard name is provided)
*/
public void addVisualization(final AbstractPlotter plotter, final String title) {
m_plotterCounter++;
String name = title;
if (name == null) {
name = "Visualization#" + m_plotterCounter;
}
// check if there is already a tab
if (m_tabs == null) {
m_tabs = new JTabbedPane();
AbstractPlotter oldPlotter = m_plotters.get(1);
m_tabs.addTab("Visualization#1", oldPlotter);
m_tabs.addTab(name, plotter);
setComponent(m_tabs);
} else {
m_tabs.addTab(name, plotter);
}
m_plotters.add(plotter);
}
use of org.knime.base.node.viz.plotter.AbstractPlotter in project knime-core by knime.
the class BinModelNodeView method addVisualization.
/**
* Adds another tab containing a plotter.
*
* @param plotter another visualization
* @param title the title of the tab (if null a standard name is provided)
*/
public void addVisualization(final AbstractPlotter plotter, final String title) {
m_plotterCounter++;
String name = title;
if (name == null) {
name = "Visualization#" + m_plotterCounter;
}
// check if there is already a tab
if (m_tabs == null) {
m_tabs = new JTabbedPane();
AbstractPlotter oldPlotter = m_plotters.get(1);
m_tabs.addTab("Visualization#1", oldPlotter);
m_tabs.addTab(name, plotter);
setComponent(m_tabs);
} else {
m_tabs.addTab(name, plotter);
}
m_plotters.add(plotter);
}
use of org.knime.base.node.viz.plotter.AbstractPlotter in project knime-core by knime.
the class DefaultVisualizationNodeView method modelChanged.
/**
* {@inheritDoc}
*/
@Override
protected void modelChanged() {
NodeModel model = getNodeModel();
if (model == null) {
return;
}
if (!(model instanceof DataProvider)) {
throw new IllegalArgumentException("Model must implement the DataProvider " + "interface!");
}
DataProvider provider = (DataProvider) model;
HiLiteHandler hiliteHandler = model.getInHiLiteHandler(0);
// do not care about antialias
for (AbstractPlotter plotter : m_plotters) {
plotter.reset();
plotter.setHiLiteHandler(hiliteHandler);
plotter.setDataProvider(provider);
plotter.updatePaintModel();
}
}
Aggregations