Search in sources :

Example 6 with AnnotationData

use of org.knime.core.node.workflow.AnnotationData in project knime-core by knime.

the class WorkflowAnnotationFigure method newContent.

@Override
public void newContent(final Annotation annotation) {
    super.newContent(annotation);
    AnnotationData data = annotation.getData();
    Color bg = AnnotationEditPart.RGBintToColor(data.getBgColor());
    setBackgroundColor(bg);
    m_page.setBackgroundColor(bg);
    // set border with specified annotation color
    if (data.getBorderSize() > 0) {
        Color col = AnnotationEditPart.RGBintToColor(data.getBorderColor());
        m_page.setBorder(new LineBorder(col, data.getBorderSize()));
    } else {
        m_page.setBorder(null);
    }
}
Also used : AnnotationData(org.knime.core.node.workflow.AnnotationData) Color(org.eclipse.swt.graphics.Color) LineBorder(org.eclipse.draw2d.LineBorder)

Aggregations

AnnotationData (org.knime.core.node.workflow.AnnotationData)6 Color (org.eclipse.swt.graphics.Color)3 ArrayList (java.util.ArrayList)2 Point (org.eclipse.draw2d.geometry.Point)2 StyleRange (org.eclipse.swt.custom.StyleRange)2 LineBorder (org.eclipse.draw2d.LineBorder)1 PrecisionPoint (org.eclipse.draw2d.geometry.PrecisionPoint)1 Rectangle (org.eclipse.draw2d.geometry.Rectangle)1 ZoomManager (org.eclipse.gef.editparts.ZoomManager)1 Font (org.eclipse.swt.graphics.Font)1 RGB (org.eclipse.swt.graphics.RGB)1 Composite (org.eclipse.swt.widgets.Composite)1 Annotation (org.knime.core.node.workflow.Annotation)1 TextAlignment (org.knime.core.node.workflow.AnnotationData.TextAlignment)1 WorkflowAnnotation (org.knime.core.node.workflow.WorkflowAnnotation)1 WorkflowManager (org.knime.core.node.workflow.WorkflowManager)1 AnnotationEditPart (org.knime.workbench.editor2.editparts.AnnotationEditPart)1 NodeAnnotationEditPart (org.knime.workbench.editor2.editparts.NodeAnnotationEditPart)1 WorkflowRootEditPart (org.knime.workbench.editor2.editparts.WorkflowRootEditPart)1