use of org.knime.base.node.viz.histogram.datamodel.AbstractHistogramVizModel in project knime-core by knime.
the class AbstractHistogramPlotter method unHiLite.
/**
* {@inheritDoc}
*/
@Override
public void unHiLite(final KeyEvent event) {
final AbstractHistogramVizModel vizModel = getHistogramVizModel();
if (vizModel == null || !vizModel.supportsHiliting()) {
LOGGER.debug("VizModel doesn't support hiliting or was null");
return;
}
final Set<RowKey> hilited = event.keys();
vizModel.updateHiliteInfo(hilited, false);
repaint();
}
use of org.knime.base.node.viz.histogram.datamodel.AbstractHistogramVizModel in project knime-core by knime.
the class AbstractHistogramPlotter method setNumberOfBins.
/**
* @param noOfBins sets the number of bins which is used for binning of
* none nominal attributes
* @return <code>true</code> if the value has changed
*/
protected boolean setNumberOfBins(final int noOfBins) {
final AbstractHistogramVizModel vizModel = getHistogramVizModel();
if (vizModel == null) {
LOGGER.debug("VizModel was null");
throw new IllegalStateException("Exception in setNumberOfBins: " + "Viz model must not be null");
}
if (vizModel.setNoOfBins(noOfBins)) {
setXCoordinates();
setYCoordinates();
if (vizModel.supportsHiliting()) {
// set the current hilited keys in the new bins
vizModel.updateHiliteInfo(delegateGetHiLitKeys(), true);
}
if (HistogramLayout.SIDE_BY_SIDE.equals(vizModel.getHistogramLayout()) && (vizModel.getAggrColumns() != null && vizModel.getAggrColumns().size() > 1)) {
vizModel.setBinWidth(vizModel.getMaxBinWidth());
}
// update the details tab
getHistogramPropertiesPanel().updateHTMLDetailsPanel(vizModel.getHTMLDetailData());
return true;
}
return false;
}
use of org.knime.base.node.viz.histogram.datamodel.AbstractHistogramVizModel in project knime-core by knime.
the class AbstractHistogramPlotter method unHiLiteAll.
/**
* {@inheritDoc}
*/
@Override
public void unHiLiteAll(final KeyEvent event) {
final AbstractHistogramVizModel vizModel = getHistogramVizModel();
if (vizModel == null || !vizModel.supportsHiliting()) {
LOGGER.debug("VizModel doesn't support hiliting or was null");
return;
}
vizModel.unHiliteAll();
repaint();
}
use of org.knime.base.node.viz.histogram.datamodel.AbstractHistogramVizModel in project knime-core by knime.
the class AbstractHistogramPlotter method unHiLiteSelected.
/**
* {@inheritDoc}
*/
@Override
public void unHiLiteSelected() {
final AbstractHistogramVizModel vizModel = getHistogramVizModel();
if (vizModel == null || !vizModel.supportsHiliting()) {
LOGGER.debug("VizModel doesn't support hiliting or was null");
return;
}
final Set<RowKey> selectedKeys = vizModel.getSelectedKeys();
delegateUnHiLite(selectedKeys);
repaint();
}
use of org.knime.base.node.viz.histogram.datamodel.AbstractHistogramVizModel 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