use of org.knime.core.node.workflow.NativeNodeContainer.LoopStatus in project knime-core by knime.
the class NodeContainerFigure method setStateFromNC.
/**
* @param nc new state of underlying node
*/
public void setStateFromNC(final NodeContainerUI nc) {
boolean isInactive = false;
LoopStatus loopStatus = LoopStatus.NONE;
if (nc instanceof SingleNodeContainerUI) {
SingleNodeContainerUI snc = (SingleNodeContainerUI) nc;
isInactive = snc.isInactive();
if (Wrapper.wraps(snc, NativeNodeContainer.class)) {
NativeNodeContainer nnc = Wrapper.unwrap(snc, NativeNodeContainer.class);
loopStatus = nnc.getLoopStatus();
}
}
NodeContainerState state = nc.getNodeContainerState();
if (!isInactive) {
if (state.isIdle()) {
setStatusAmple();
m_statusFigure.setIcon(RED);
} else if (state.isConfigured()) {
setStatusAmple();
m_statusFigure.setIcon(YELLOW);
} else if (state.isExecuted()) {
setStatusAmple();
m_statusFigure.setIcon(GREEN);
} else if (state.isWaitingToBeExecuted()) {
if (LoopStatus.PAUSED.equals(loopStatus)) {
setProgressBar(ProgressMode.PAUSED);
} else {
setProgressBar(ProgressMode.QUEUED);
}
} else if (state.isExecutionInProgress()) {
setProgressBar(ProgressMode.EXECUTING);
} else {
setStatusAmple();
m_statusFigure.setIcon(INACTIVE);
}
} else {
setStatusAmple();
m_statusFigure.setIcon(INACTIVE);
}
setLoopStatus(loopStatus, state.isExecuted());
repaint();
}
Aggregations