use of org.knime.base.node.viz.plotter.basic.BasicDrawingPane in project knime-core by knime.
the class HierarchicalClusterNodeView method modelChanged.
/**
* {@inheritDoc}
*/
@Override
public void modelChanged() {
if (getNodeModel() == null || ((DataProvider) getNodeModel()).getDataArray(0) == null || ((DataProvider) getNodeModel()).getDataArray(0).size() == 0) {
return;
}
NodeModel model = getNodeModel();
m_dendroPlotter.reset();
m_distancePlotter.reset();
m_dendroPlotter.setHiLiteHandler(model.getInHiLiteHandler(0));
m_dendroPlotter.setAntialiasing(false);
m_dendroPlotter.setDataProvider((DataProvider) model);
m_distancePlotter.setDataProvider((DataProvider) model);
m_distancePlotter.setHiLiteHandler(model.getInHiLiteHandler(0));
DendrogramNode rootNode = getNodeModel().getRootNode();
DataArray distanceTable = ((DataProvider) getNodeModel()).getDataArray(0);
m_dendroPlotter.setRootNode(rootNode);
m_distancePlotter.createXCoordinate(((DoubleValue) distanceTable.getDataTableSpec().getColumnSpec(0).getDomain().getLowerBound()).getDoubleValue(), ((DoubleValue) distanceTable.getDataTableSpec().getColumnSpec(0).getDomain().getUpperBound()).getDoubleValue());
m_distancePlotter.createYCoordinate(((DoubleValue) distanceTable.getDataTableSpec().getColumnSpec(1).getDomain().getLowerBound()).getDoubleValue(), ((DoubleValue) distanceTable.getDataTableSpec().getColumnSpec(1).getDomain().getUpperBound()).getDoubleValue());
((BasicDrawingPane) m_distancePlotter.getDrawingPane()).clearPlot();
m_distancePlotter.addLine(distanceTable, 0, 1, Color.BLACK, new BasicStroke(m_thickness));
// m_distancePlotter.getXAxis().getCoordinate().setPolicy(
// DescendingNumericTickPolicyStrategy.getInstance());
m_distancePlotter.updatePaintModel();
m_dendroPlotter.updatePaintModel();
}
Aggregations