use of org.knime.base.node.viz.histogram.datamodel.AbstractHistogramVizModel in project knime-core by knime.
the class InteractiveHistogramPlotter method onAggrColChanged.
/**
* Called whenever the user changes the aggregation column.
*/
protected void onAggrColChanged() {
final AbstractHistogramVizModel abstractVizModel = getHistogramVizModel();
if (abstractVizModel == null) {
LOGGER.debug("VizModel was null");
return;
}
final AbstractHistogramProperties abstractHistogramProperties = getHistogramPropertiesPanel();
if (abstractHistogramProperties == null) {
LOGGER.debug("ProeprtiesPanel was null");
return;
}
if (abstractVizModel instanceof InteractiveHistogramVizModel) {
final InteractiveHistogramVizModel vizModel = (InteractiveHistogramVizModel) abstractVizModel;
if (abstractHistogramProperties instanceof InteractiveHistogramProperties) {
final InteractiveHistogramProperties props = (InteractiveHistogramProperties) abstractHistogramProperties;
final List<ColorColumn> aggrCols = props.getSelectedAggrColumns();
if (vizModel.setAggregationColumns(aggrCols)) {
// show the bar outline automatically depending on the
// number of selected aggregation columns
vizModel.setShowBarOutline(aggrCols != null && aggrCols.size() > 1);
setYCoordinates();
// set the current hilited keys in the new bins
vizModel.updateHiliteInfo(delegateGetHiLitKeys(), true);
if (vizModel.containsNotPresentableBin()) {
vizModel.setBinWidth(vizModel.getMaxBinWidth());
}
// update the details tab
getHistogramPropertiesPanel().updateHTMLDetailsPanel(vizModel.getHTMLDetailData());
updatePaintModel();
}
} else {
throw new IllegalStateException(" PropertiesPanel should be of type interactive");
}
} else {
throw new IllegalStateException("VizModel should be of type interactive");
}
}
use of org.knime.base.node.viz.histogram.datamodel.AbstractHistogramVizModel in project knime-core by knime.
the class InteractiveHistogramPlotter method onXColChanged.
/**
* Called whenever user changes the x column selection.
*
* @param xColName the new selected x column
*/
protected void onXColChanged(final String xColName) {
if (xColName == null || xColName.trim().length() < 1) {
return;
}
// if it's the same name we don't need to do anything
if (getXColName() != null && getXColName().equals(xColName)) {
return;
}
final AbstractHistogramVizModel abstractVizModel = getHistogramVizModel();
if (abstractVizModel == null) {
LOGGER.debug("VizModel was null");
return;
}
if (abstractVizModel instanceof InteractiveHistogramVizModel) {
final InteractiveHistogramVizModel vizModel = (InteractiveHistogramVizModel) abstractVizModel;
final DataColumnSpec xColSpec = getDataTableSpec().getColumnSpec(xColName);
if (vizModel.setXColumn(xColSpec)) {
// set the current hilited keys in the new bins
vizModel.updateHiliteInfo(delegateGetHiLitKeys(), true);
// set the new axis
setXCoordinates();
setYCoordinates();
// update the details tab
getHistogramPropertiesPanel().updateHTMLDetailsPanel(vizModel.getHTMLDetailData());
// repaint the plotter
updatePaintModel();
}
} else {
throw new IllegalStateException("VizModel should be of type interactive");
}
// update the slider values and the select boxes
// getHistogramPropertiesPanel().updateHistogramSettings(this);
}
Aggregations