Search in sources :

Example 1 with WorkflowFigure

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);
}
Also used : WorkflowFigure(org.knime.workbench.editor2.figures.WorkflowFigure) WorkflowRootEditPart(org.knime.workbench.editor2.editparts.WorkflowRootEditPart) AbstractNodeExecutionJobManager(org.knime.core.node.workflow.AbstractNodeExecutionJobManager) Image(org.eclipse.swt.graphics.Image) URL(java.net.URL) AbstractNodeExecutionJobManager(org.knime.core.node.workflow.AbstractNodeExecutionJobManager) NodeExecutionJobManager(org.knime.core.node.workflow.NodeExecutionJobManager)

Example 2 with WorkflowFigure

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();
        }
    }
}
Also used : WorkflowFigure(org.knime.workbench.editor2.figures.WorkflowFigure) WorkflowRootEditPart(org.knime.workbench.editor2.editparts.WorkflowRootEditPart) IEditorPart(org.eclipse.ui.IEditorPart) URI(java.net.URI)

Example 3 with WorkflowFigure

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;
}
Also used : WorkflowLayout(org.knime.workbench.editor2.figures.WorkflowLayout) WorkflowFigure(org.knime.workbench.editor2.figures.WorkflowFigure) LayoutManager(org.eclipse.draw2d.LayoutManager)

Aggregations

WorkflowFigure (org.knime.workbench.editor2.figures.WorkflowFigure)3 WorkflowRootEditPart (org.knime.workbench.editor2.editparts.WorkflowRootEditPart)2 URI (java.net.URI)1 URL (java.net.URL)1 LayoutManager (org.eclipse.draw2d.LayoutManager)1 Image (org.eclipse.swt.graphics.Image)1 IEditorPart (org.eclipse.ui.IEditorPart)1 AbstractNodeExecutionJobManager (org.knime.core.node.workflow.AbstractNodeExecutionJobManager)1 NodeExecutionJobManager (org.knime.core.node.workflow.NodeExecutionJobManager)1 WorkflowLayout (org.knime.workbench.editor2.figures.WorkflowLayout)1