use of org.knime.core.node.property.hilite.HiLiteHandler in project knime-core by knime.
the class RegressionTreeLearnerNodeView method recreateHiLite.
private void recreateHiLite() {
HiLiteHandler handler = m_hiLiteHdl;
if (handler == null) {
return;
}
Set<RowKey> hilited = handler.getHiLitKeys();
Set<DecisionTreeNode> toHilite = new HashSet<DecisionTreeNode>();
DecisionTreeNode root = m_graph.getRootNode();
List<DecisionTreeNode> toProcess = new LinkedList<DecisionTreeNode>();
if (null != root) {
toProcess.add(0, root);
}
// Traverse the tree breadth first
while (!toProcess.isEmpty()) {
DecisionTreeNode curr = toProcess.remove(0);
// cover any pattern
if (curr.coveredPattern().isEmpty()) {
continue;
}
if (hilited.containsAll(curr.coveredPattern())) {
// hilite subtree starting from curr
toHilite.addAll(getSubtree(curr));
} else {
for (int i = 0; i < curr.getChildCount(); i++) {
toProcess.add(0, curr.getChildAt(i));
}
}
}
m_graph.hiLite(toHilite);
}
use of org.knime.core.node.property.hilite.HiLiteHandler in project knime-core by knime.
the class RegressionTreeLearnerNodeView method modelChangedInUI.
private void modelChangedInUI() {
assert SwingUtilities.isEventDispatchThread();
final RegressionTreeLearnerNodeModel nodeModel = getNodeModel();
HiLiteHandler hdl = nodeModel.getInHiLiteHandler(0);
String warnMessage = nodeModel.getViewMessage();
if (warnMessage == null) {
m_warningLabel.setText(" ");
m_warningLabel.setVisible(false);
} else {
m_warningLabel.setText(warnMessage);
m_warningLabel.setVisible(true);
}
newHiliteHandler(hdl);
newModel();
}
use of org.knime.core.node.property.hilite.HiLiteHandler in project knime-core by knime.
the class TreeEnsembleLearnerNodeView method recreateHiLite.
private void recreateHiLite() {
HiLiteHandler handler = m_hiLiteHdl;
if (handler == null) {
return;
}
Set<RowKey> hilited = handler.getHiLitKeys();
Set<DecisionTreeNode> toHilite = new HashSet<DecisionTreeNode>();
DecisionTreeNode root = m_graph.getRootNode();
List<DecisionTreeNode> toProcess = new LinkedList<DecisionTreeNode>();
if (null != root) {
toProcess.add(0, root);
}
// Traverse the tree breadth first
while (!toProcess.isEmpty()) {
DecisionTreeNode curr = toProcess.remove(0);
// cover any pattern
if (curr.coveredPattern().isEmpty()) {
continue;
}
if (hilited.containsAll(curr.coveredPattern())) {
// hilite subtree starting from curr
toHilite.addAll(getSubtree(curr));
} else {
for (int i = 0; i < curr.getChildCount(); i++) {
toProcess.add(0, curr.getChildAt(i));
}
}
}
m_graph.hiLite(toHilite);
}
use of org.knime.core.node.property.hilite.HiLiteHandler in project knime-core by knime.
the class TreeEnsembleLearnerNodeView method modelChangedInUI.
private void modelChangedInUI() {
assert SwingUtilities.isEventDispatchThread();
final MODEL nodeModel = getNodeModel();
TreeEnsembleModel ensembleModel = nodeModel.getEnsembleModel();
int nrModels = ensembleModel == null ? 0 : ensembleModel.getNrModels();
m_nrModelLabel.setText(nrModels + " model(s) in total");
int min = nrModels == 0 ? 0 : 1;
m_modelSpinner.setModel(new SpinnerNumberModel(min, min, nrModels, 1));
HiLiteHandler hdl = nodeModel.getInHiLiteHandler(0);
String warnMessage = nodeModel.getViewMessage();
if (warnMessage == null) {
m_warningLabel.setText(" ");
m_warningLabel.setVisible(false);
} else {
m_warningLabel.setText(warnMessage);
m_warningLabel.setVisible(true);
}
newHiliteHandler(hdl);
newModel(min - 1);
}
use of org.knime.core.node.property.hilite.HiLiteHandler in project knime-core by knime.
the class TreeEnsembleLearnerNodeView2 method modelChangedInUI.
private void modelChangedInUI() {
assert SwingUtilities.isEventDispatchThread();
final MODEL nodeModel = getNodeModel();
TreeEnsembleModel ensembleModel = nodeModel.getEnsembleModel();
int nrModels = ensembleModel == null ? 0 : ensembleModel.getNrModels();
m_nrModelLabel.setText(nrModels + " model(s) in total");
int min = nrModels == 0 ? 0 : 1;
m_modelSpinner.setModel(new SpinnerNumberModel(min, min, nrModels, 1));
HiLiteHandler hdl = nodeModel.getInHiLiteHandler(0);
String warnMessage = nodeModel.getViewMessage();
if (warnMessage == null) {
m_warningLabel.setText(" ");
m_warningLabel.setVisible(false);
} else {
m_warningLabel.setText(warnMessage);
m_warningLabel.setVisible(true);
}
newHiliteHandler(hdl);
newModel(min - 1);
}
Aggregations