use of org.knime.workbench.editor2.figures.WorkflowFigure in project knime-core by knime.
the class WorkflowEditor method updateJobManagerDisplay.
private void updateJobManagerDisplay() {
NodeExecutionJobManager jobManager = m_manager.findJobManager();
URL url;
if (jobManager instanceof AbstractNodeExecutionJobManager) {
url = ((AbstractNodeExecutionJobManager) jobManager).getIconForWorkflow();
} else {
url = null;
}
Image image;
if (url != null) {
image = ImageRepository.getUnscaledImage(url);
} else {
image = null;
}
WorkflowFigure workflowFigure = ((WorkflowRootEditPart) getViewer().getRootEditPart().getContents()).getFigure();
workflowFigure.setJobManagerFigure(image);
}
use of org.knime.workbench.editor2.figures.WorkflowFigure in project knime-core by knime.
the class WorkflowEditor method updateTempRemoteWorkflowMessage.
/**
* Places the message at the top of the editor - above all other contents.
*/
private void updateTempRemoteWorkflowMessage() {
WorkflowFigure workflowFigure = ((WorkflowRootEditPart) getViewer().getRootEditPart().getContents()).getFigure();
if (isTempRemoteWorkflowEditor()) {
URI origRemoteLocation = m_origRemoteLocation;
WorkflowEditor parentEditor = m_parentEditor;
while (origRemoteLocation == null && parentEditor != null) {
origRemoteLocation = parentEditor.m_origRemoteLocation;
parentEditor = parentEditor.m_parentEditor;
}
workflowFigure.setMessage(" This is a temporary copy of \"" + URIUtil.toDecodedString(origRemoteLocation) + "\".\n Use \"Save\" to upload it back to its original location on the server or \"Save As...\" to " + "store it in a different location.");
} else if (!getWorkflowManager().isPresent()) {
workflowFigure.setMessage("This is a remotely opened job workflow. It can neither be stored locally nor edited." + " It also just represents a static snapshot of the job workflow and won't get" + " updated automatically (use context menu to refresh).");
} else {
workflowFigure.setMessage(null);
}
List<IEditorPart> subEditors = getSubEditors();
for (IEditorPart ep : subEditors) {
if (ep instanceof WorkflowEditor) {
((WorkflowEditor) ep).updateTempRemoteWorkflowMessage();
}
}
}
use of org.knime.workbench.editor2.figures.WorkflowFigure in project knime-core by knime.
the class WorkflowRootEditPart method createFigure.
/**
* Creates the root(="background") figure and sets the appropriate lazout
* manager.
*
* {@inheritDoc}
*/
@Override
protected WorkflowFigure createFigure() {
WorkflowFigure backgroundFigure = new WorkflowFigure();
LayoutManager l = new WorkflowLayout();
backgroundFigure.setLayoutManager(l);
return backgroundFigure;
}
Aggregations