Search in sources :

Example 1 with NodeAnnotationFigure

use of org.knime.workbench.editor2.figures.NodeAnnotationFigure in project knime-core by knime.

the class AnnotationEditPart method performEdit.

/**
 * Opens the editor to directoy edit the annotation in place.
 */
public void performEdit() {
    final EditPart parent = getParent();
    if (parent instanceof WorkflowRootEditPart) {
        WorkflowRootEditPart wkfRootEdit = (WorkflowRootEditPart) parent;
        if (wkfRootEdit.getWorkflowManager().isWriteProtected()) {
            return;
        }
    }
    if (m_directEditManager == null) {
        m_directEditManager = new AnnotationEditManager(this, new StyledTextEditorLocator((NodeAnnotationFigure) getFigure()));
    }
    m_directEditManager.show();
}
Also used : EditPart(org.eclipse.gef.EditPart) AnnotationEditManager(org.knime.workbench.editor2.directannotationedit.AnnotationEditManager) StyledTextEditorLocator(org.knime.workbench.editor2.directannotationedit.StyledTextEditorLocator)

Example 2 with NodeAnnotationFigure

use of org.knime.workbench.editor2.figures.NodeAnnotationFigure in project knime-core by knime.

the class AnnotationEditPart method nodeUIInformationChanged.

/**
 * {@inheritDoc}
 */
@Override
public void nodeUIInformationChanged(final NodeUIInformationEvent evt) {
    Annotation anno = getModel();
    NodeAnnotationFigure annoFig = (NodeAnnotationFigure) getFigure();
    annoFig.newContent(anno);
    WorkflowRootEditPart parent = (WorkflowRootEditPart) getParent();
    parent.setLayoutConstraint(this, getFigure(), new Rectangle(anno.getX(), anno.getY(), anno.getWidth(), anno.getHeight()));
    refreshVisuals();
    parent.refresh();
}
Also used : Rectangle(org.eclipse.draw2d.geometry.Rectangle) NodeAnnotationFigure(org.knime.workbench.editor2.figures.NodeAnnotationFigure) WorkflowAnnotation(org.knime.core.node.workflow.WorkflowAnnotation) NodeAnnotation(org.knime.core.node.workflow.NodeAnnotation) Annotation(org.knime.core.node.workflow.Annotation)

Example 3 with NodeAnnotationFigure

use of org.knime.workbench.editor2.figures.NodeAnnotationFigure in project knime-core by knime.

the class AnnotationEditPart method createFigure.

/**
 * {@inheritDoc}
 */
@Override
protected IFigure createFigure() {
    Annotation anno = getModel();
    NodeAnnotationFigure f = new WorkflowAnnotationFigure(anno);
    if (anno instanceof WorkflowAnnotation) {
        f.setBounds(new Rectangle(anno.getX(), anno.getY(), anno.getWidth(), anno.getHeight()));
    }
    return f;
}
Also used : WorkflowAnnotationFigure(org.knime.workbench.editor2.figures.WorkflowAnnotationFigure) Rectangle(org.eclipse.draw2d.geometry.Rectangle) NodeAnnotationFigure(org.knime.workbench.editor2.figures.NodeAnnotationFigure) WorkflowAnnotation(org.knime.core.node.workflow.WorkflowAnnotation) NodeAnnotation(org.knime.core.node.workflow.NodeAnnotation) Annotation(org.knime.core.node.workflow.Annotation) WorkflowAnnotation(org.knime.core.node.workflow.WorkflowAnnotation)

Example 4 with NodeAnnotationFigure

use of org.knime.workbench.editor2.figures.NodeAnnotationFigure in project knime-core by knime.

the class AnnotationEditPart method propertyChange.

/**
 * {@inheritDoc}
 */
@Override
public void propertyChange(final PropertyChangeEvent p) {
    if (p.getProperty().equals(PreferenceConstants.P_DEFAULT_NODE_LABEL) || p.getProperty().equals(PreferenceConstants.P_ANNOTATION_BORDER_SIZE)) {
        NodeAnnotationFigure fig = (NodeAnnotationFigure) getFigure();
        fig.newContent(getModel());
    }
}
Also used : NodeAnnotationFigure(org.knime.workbench.editor2.figures.NodeAnnotationFigure)

Example 5 with NodeAnnotationFigure

use of org.knime.workbench.editor2.figures.NodeAnnotationFigure in project knime-core by knime.

the class NodeAnnotationEditPart method createFigure.

/**
 * {@inheritDoc}
 */
@Override
protected IFigure createFigure() {
    Annotation anno = getModel();
    NodeAnnotationFigure f = new NodeAnnotationFigure(anno);
    return f;
}
Also used : NodeAnnotationFigure(org.knime.workbench.editor2.figures.NodeAnnotationFigure) Annotation(org.knime.core.node.workflow.Annotation) NodeAnnotation(org.knime.core.node.workflow.NodeAnnotation)

Aggregations

NodeAnnotationFigure (org.knime.workbench.editor2.figures.NodeAnnotationFigure)4 Annotation (org.knime.core.node.workflow.Annotation)3 NodeAnnotation (org.knime.core.node.workflow.NodeAnnotation)3 Rectangle (org.eclipse.draw2d.geometry.Rectangle)2 WorkflowAnnotation (org.knime.core.node.workflow.WorkflowAnnotation)2 EditPart (org.eclipse.gef.EditPart)1 AnnotationEditManager (org.knime.workbench.editor2.directannotationedit.AnnotationEditManager)1 StyledTextEditorLocator (org.knime.workbench.editor2.directannotationedit.StyledTextEditorLocator)1 WorkflowAnnotationFigure (org.knime.workbench.editor2.figures.WorkflowAnnotationFigure)1