Search in sources :

Example 1 with AbstractPlotter

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();
    }
}
Also used : HiLiteHandler(org.knime.core.node.property.hilite.HiLiteHandler) AbstractPlotter(org.knime.base.node.viz.plotter.AbstractPlotter)

Example 2 with AbstractPlotter

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);
}
Also used : JTabbedPane(javax.swing.JTabbedPane) AbstractPlotter(org.knime.base.node.viz.plotter.AbstractPlotter)

Example 3 with AbstractPlotter

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);
}
Also used : JTabbedPane(javax.swing.JTabbedPane) AbstractPlotter(org.knime.base.node.viz.plotter.AbstractPlotter)

Example 4 with AbstractPlotter

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();
    }
}
Also used : DataProvider(org.knime.base.node.viz.plotter.DataProvider) NodeModel(org.knime.core.node.NodeModel) HiLiteHandler(org.knime.core.node.property.hilite.HiLiteHandler) AbstractPlotter(org.knime.base.node.viz.plotter.AbstractPlotter)

Aggregations

AbstractPlotter (org.knime.base.node.viz.plotter.AbstractPlotter)4 JTabbedPane (javax.swing.JTabbedPane)2 HiLiteHandler (org.knime.core.node.property.hilite.HiLiteHandler)2 DataProvider (org.knime.base.node.viz.plotter.DataProvider)1 NodeModel (org.knime.core.node.NodeModel)1