use of org.knime.workbench.editor2.figures.NodeContainerFigure in project knime-core by knime.
the class NodeContainerEditPart method updateJobManagerIcon.
private void updateJobManagerIcon() {
NodeContainerUI nc = getNodeContainer();
NodeExecutionJobManager jobManager = nc.getJobManager();
URL iconURL;
if (jobManager != null) {
iconURL = jobManager.getIcon();
} else {
NodeExecutionJobManager parentJobManager = nc.findJobManager();
if (parentJobManager instanceof AbstractNodeExecutionJobManager) {
if (Wrapper.wraps(nc, NodeContainer.class)) {
iconURL = ((AbstractNodeExecutionJobManager) parentJobManager).getIconForChild(Wrapper.unwrapNC(nc));
} else {
iconURL = null;
}
} else {
iconURL = null;
}
}
Image icon = null;
if (iconURL != null) {
icon = ImageDescriptor.createFromURL(iconURL).createImage();
}
((NodeContainerFigure) getFigure()).setJobExecutorIcon(icon);
}
use of org.knime.workbench.editor2.figures.NodeContainerFigure in project knime-core by knime.
the class NodeContainerEditPart method checkNodeLockIcon.
private void checkNodeLockIcon() {
NodeContainerUI nc = getNodeContainer();
Image i;
StringBuilder toolTip = new StringBuilder();
// node is considered being locked if it is either lock from being reseted, it's not deletable, or the dialog is locked
if (nc.getNodeLocks().hasResetLock() || nc.getNodeLocks().hasDeleteLock() || nc.getNodeLocks().hasConfigureLock()) {
toolTip.append("Node Locked (");
i = NODE_LOCK_ICON;
if (nc.getNodeLocks().hasResetLock()) {
toolTip.append("Reset, ");
}
if (nc.getNodeLocks().hasDeleteLock()) {
toolTip.append("Delete, ");
}
if (nc.getNodeLocks().hasConfigureLock()) {
toolTip.append("Configure, ");
}
toolTip.setLength(toolTip.length() - 2);
toolTip.append(")");
} else {
i = null;
}
NodeContainerFigure fig = (NodeContainerFigure) getFigure();
fig.setNodeLockIcon(i, toolTip.toString());
}
Aggregations