use of org.knime.core.node.workflow.Annotation 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;
}
use of org.knime.core.node.workflow.Annotation in project knime-core by knime.
the class AnnotationEditPart method activate.
/**
* {@inheritDoc}
*/
@Override
public void activate() {
super.activate();
IPreferenceStore store = KNIMEUIPlugin.getDefault().getPreferenceStore();
store.addPropertyChangeListener(this);
Annotation anno = getModel();
anno.addUIInformationListener(this);
// update the ui info now
nodeUIInformationChanged(null);
}
use of org.knime.core.node.workflow.Annotation in project knime-core by knime.
the class AnnotationEditManager method initCellEditor.
/**
* Initializes the cell editor.
*
* @see org.eclipse.gef.tools.DirectEditManager#initCellEditor()
*/
@Override
protected void initCellEditor() {
// de-select the underlying annotation to remove the selection handles
final GraphicalEditPart editPart = getEditPart();
editPart.getRoot().getViewer().deselectAll();
editPart.getFigure().setVisible(false);
StyledTextEditor stw = (StyledTextEditor) getCellEditor();
Annotation anno = ((AnnotationEditPart) editPart).getModel();
Font defaultFont;
if (editPart instanceof NodeAnnotationEditPart) {
defaultFont = AnnotationEditPart.getNodeAnnotationDefaultFont();
} else if (anno.getVersion() < AnnotationData.VERSION_20151012) {
defaultFont = FontStore.INSTANCE.getSystemDefaultFont();
} else {
defaultFont = AnnotationEditPart.getWorkflowAnnotationDefaultFont();
}
stw.setDefaultFont(defaultFont);
stw.setValue(anno);
// Hook the cell editor's copy/paste actions to the actionBars so that
// they can
// be invoked via keyboard shortcuts.
m_actionBars = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getEditorSite().getActionBars();
saveCurrentActions(m_actionBars);
m_actionHandler = new CellEditorActionHandler(m_actionBars);
m_actionHandler.addCellEditor(getCellEditor());
m_actionBars.updateActionBars();
}
use of org.knime.core.node.workflow.Annotation 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;
}
Aggregations