org.eclipse.gmf.runtime.notation.NotationFactory Java Examples
The following examples show how to use
org.eclipse.gmf.runtime.notation.NotationFactory.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GroupStatesIntoCompositeRefactoring.java From statecharts with Eclipse Public License 1.0 | 6 votes |
/** * Iterates through all {@link StateEditPart}s of the current selection and * computes layout constraints for the composite node. * * @param compositeStateNode * node of the composite state */ protected void setCompositeStateLayoutConstraint(Node compositeStateNode) { Rectangle newbounds = null; for (GraphicalEditPart editPart : getContextObjects()) { Rectangle childBounds = editPart.getFigure().getBounds(); if (newbounds == null) newbounds = childBounds.getCopy(); newbounds.union(childBounds); } newbounds.expand(new Insets(PADDING, PADDING, PADDING, PADDING)); Bounds bounds = NotationFactory.eINSTANCE.createBounds(); bounds.setX(newbounds.x); bounds.setY(newbounds.y); bounds.setWidth(newbounds.width); bounds.setHeight(newbounds.height); compositeStateNode.setLayoutConstraint(bounds); }
Example #2
Source File: TransitionViewFactory.java From statecharts with Eclipse Public License 1.0 | 6 votes |
@SuppressWarnings("unchecked") @Override protected void decorateView(View containerView, View view, IAdaptable element, String semanticHint, int index, boolean persisted) { FontStyle fontStyle = NotationFactory.eINSTANCE.createFontStyle(); view.getStyles().add(fontStyle); super.decorateView(containerView, view, element, semanticHint, index, persisted); Node label = FactoryUtils.createLabel(view, SemanticHints.TRANSITION_EXPRESSION); Location location = (Location) label.getLayoutConstraint(); location.setX(0); location.setY(10); }
Example #3
Source File: BonitaModelExporterImpl.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
@Override public Bounds getBounds(Node view) { LayoutConstraint layoutConstraint = view.getLayoutConstraint(); if (layoutConstraint instanceof Bounds) { Bounds bounds = NotationFactory.eINSTANCE.createBounds(); bounds.setHeight(((Bounds) layoutConstraint).getHeight()); bounds.setWidth(((Bounds) layoutConstraint).getWidth()); bounds.setX(((Bounds) layoutConstraint).getX()); bounds.setY(((Bounds) layoutConstraint).getY()); Dimension defaultSize = getDefaultSize(view); if (bounds.getHeight() == -1) { bounds.setHeight(defaultSize.height); } if (bounds.getWidth() == -1) { bounds.setWidth(defaultSize.width); } return bounds; } return null; }
Example #4
Source File: ProcessViewProvider.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ public Node createCatchLinkEvent_2018(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(ProcessVisualIDRegistry.getType(CatchLinkEventEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); stampShortcut(containerView, node); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB)); FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE); if (nodeFontStyle != null) { FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT); nodeFontStyle.setFontName(fontData.getName()); nodeFontStyle.setFontHeight(fontData.getHeight()); nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue()); } org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FILL_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB)); Node label5045 = createLabel(node, ProcessVisualIDRegistry.getType(CatchLinkEventLabelEditPart.VISUAL_ID)); label5045.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location5045 = (Location) label5045.getLayoutConstraint(); location5045.setX(0); location5045.setY(5); return node; }
Example #5
Source File: ProcessViewProvider.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ public Node createCallActivity_2036(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(ProcessVisualIDRegistry.getType(CallActivityEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); stampShortcut(containerView, node); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB)); FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE); if (nodeFontStyle != null) { FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT); nodeFontStyle.setFontName(fontData.getName()); nodeFontStyle.setFontHeight(fontData.getHeight()); nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue()); } org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FILL_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB)); Node label5092 = createLabel(node, ProcessVisualIDRegistry.getType(CallActivityNameEditPart.VISUAL_ID)); return node; }
Example #6
Source File: ProcessViewProvider.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ public Node createEvent_3024(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(ProcessVisualIDRegistry.getType(Event2EditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB)); FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE); if (nodeFontStyle != null) { FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT); nodeFontStyle.setFontName(fontData.getName()); nodeFontStyle.setFontHeight(fontData.getHeight()); nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue()); } org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FILL_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB)); return node; }
Example #7
Source File: ProcessViewProvider.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ public Node createReceiveTask_2025(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(ProcessVisualIDRegistry.getType(ReceiveTaskEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); stampShortcut(containerView, node); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB)); FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE); if (nodeFontStyle != null) { FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT); nodeFontStyle.setFontName(fontData.getName()); nodeFontStyle.setFontHeight(fontData.getHeight()); nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue()); } org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FILL_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB)); Node label5013 = createLabel(node, ProcessVisualIDRegistry.getType(ReceiveTaskLabelEditPart.VISUAL_ID)); return node; }
Example #8
Source File: ProcessViewProvider.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ public Node createIntermediateErrorCatchEvent_3030(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(ProcessVisualIDRegistry.getType(IntermediateErrorCatchEventEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB)); FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE); if (nodeFontStyle != null) { FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT); nodeFontStyle.setFontName(fontData.getName()); nodeFontStyle.setFontHeight(fontData.getHeight()); nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue()); } org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FILL_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB)); Node label5056 = createLabel(node, ProcessVisualIDRegistry.getType(IntermediateErrorCatchEventLabel2EditPart.VISUAL_ID)); label5056.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location5056 = (Location) label5056.getLayoutConstraint(); location5056.setX(0); location5056.setY(5); return node; }
Example #9
Source File: ProcessViewProvider.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ public Node createEndMessageEvent_3011(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(ProcessVisualIDRegistry.getType(EndMessageEvent2EditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB)); FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE); if (nodeFontStyle != null) { FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT); nodeFontStyle.setFontName(fontData.getName()); nodeFontStyle.setFontHeight(fontData.getHeight()); nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue()); } org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FILL_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB)); Node label5028 = createLabel(node, ProcessVisualIDRegistry.getType(EndMessageEventLabel2EditPart.VISUAL_ID)); label5028.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location5028 = (Location) label5028.getLayoutConstraint(); location5028.setX(0); location5028.setY(5); return node; }
Example #10
Source File: ProcessViewProvider.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ public Node createNonInterruptingBoundaryTimerEvent_3065(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(ProcessVisualIDRegistry.getType(NonInterruptingBoundaryTimerEvent2EditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB)); FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE); if (nodeFontStyle != null) { FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT); nodeFontStyle.setFontName(fontData.getName()); nodeFontStyle.setFontHeight(fontData.getHeight()); nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue()); } org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FILL_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB)); Node label5095 = createLabel(node, ProcessVisualIDRegistry.getType(NonInterruptingBoundaryTimerEventName2EditPart.VISUAL_ID)); label5095.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location5095 = (Location) label5095.getLayoutConstraint(); location5095.setX(0); location5095.setY(5); return node; }
Example #11
Source File: ProcessViewProvider.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ public Node createStartTimerEvent_2016(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(ProcessVisualIDRegistry.getType(StartTimerEventEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); stampShortcut(containerView, node); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB)); FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE); if (nodeFontStyle != null) { FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT); nodeFontStyle.setFontName(fontData.getName()); nodeFontStyle.setFontHeight(fontData.getHeight()); nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue()); } org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FILL_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB)); Node label5044 = createLabel(node, ProcessVisualIDRegistry.getType(StartTimerEventLabelEditPart.VISUAL_ID)); label5044.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location5044 = (Location) label5044.getLayoutConstraint(); location5044.setX(0); location5044.setY(5); return node; }
Example #12
Source File: ProcessViewProvider.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ public Node createEndEvent_2003(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(ProcessVisualIDRegistry.getType(EndEventEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); stampShortcut(containerView, node); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB)); FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE); if (nodeFontStyle != null) { FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT); nodeFontStyle.setFontName(fontData.getName()); nodeFontStyle.setFontHeight(fontData.getHeight()); nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue()); } org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FILL_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB)); Node label5022 = createLabel(node, ProcessVisualIDRegistry.getType(EndEventLabelEditPart.VISUAL_ID)); label5022.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location5022 = (Location) label5022.getLayoutConstraint(); location5022.setX(0); location5022.setY(5); return node; }
Example #13
Source File: ProcessViewProvider.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ public Node createIntermediateErrorCatchEvent_3031(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(ProcessVisualIDRegistry.getType(IntermediateErrorCatchEvent3EditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB)); FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE); if (nodeFontStyle != null) { FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT); nodeFontStyle.setFontName(fontData.getName()); nodeFontStyle.setFontHeight(fontData.getHeight()); nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue()); } org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FILL_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB)); Node label5059 = createLabel(node, ProcessVisualIDRegistry.getType(IntermediateErrorCatchEventLabel3EditPart.VISUAL_ID)); label5059.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location5059 = (Location) label5059.getLayoutConstraint(); location5059.setX(0); location5059.setY(5); return node; }
Example #14
Source File: ProcessViewProvider.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ public Node createEndSignalEvent_2023(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(ProcessVisualIDRegistry.getType(EndSignalEventEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); stampShortcut(containerView, node); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB)); FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE); if (nodeFontStyle != null) { FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT); nodeFontStyle.setFontName(fontData.getName()); nodeFontStyle.setFontHeight(fontData.getHeight()); nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue()); } org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FILL_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB)); Node label5050 = createLabel(node, ProcessVisualIDRegistry.getType(EndSignalEventLabelEditPart.VISUAL_ID)); label5050.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location5050 = (Location) label5050.getLayoutConstraint(); location5050.setX(0); location5050.setY(5); return node; }
Example #15
Source File: ProcessViewProvider.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ public Node createIntermediateCatchSignalEvent_3021(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(ProcessVisualIDRegistry.getType(IntermediateCatchSignalEvent2EditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB)); FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE); if (nodeFontStyle != null) { FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT); nodeFontStyle.setFontName(fontData.getName()); nodeFontStyle.setFontHeight(fontData.getHeight()); nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue()); } org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FILL_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB)); Node label5036 = createLabel(node, ProcessVisualIDRegistry.getType(IntermediateCatchSignalEventLabel2EditPart.VISUAL_ID)); label5036.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location5036 = (Location) label5036.getLayoutConstraint(); location5036.setX(0); location5036.setY(5); return node; }
Example #16
Source File: ProcessViewProvider.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ public Node createIntermediateThrowMessageEvent_2014(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(ProcessVisualIDRegistry.getType(IntermediateThrowMessageEventEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); stampShortcut(containerView, node); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB)); FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE); if (nodeFontStyle != null) { FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT); nodeFontStyle.setFontName(fontData.getName()); nodeFontStyle.setFontHeight(fontData.getHeight()); nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue()); } org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FILL_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB)); Node label5042 = createLabel(node, ProcessVisualIDRegistry.getType(IntermediateThrowMessageEventLabelEditPart.VISUAL_ID)); label5042.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location5042 = (Location) label5042.getLayoutConstraint(); location5042.setX(0); location5042.setY(5); return node; }
Example #17
Source File: ProcessViewProvider.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ public Node createIntermediateThrowSignalEvent_2020(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(ProcessVisualIDRegistry.getType(IntermediateThrowSignalEventEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); stampShortcut(containerView, node); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB)); FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE); if (nodeFontStyle != null) { FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT); nodeFontStyle.setFontName(fontData.getName()); nodeFontStyle.setFontHeight(fontData.getHeight()); nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue()); } org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FILL_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB)); Node label5047 = createLabel(node, ProcessVisualIDRegistry.getType(IntermediateThrowSignalEventLabelEditPart.VISUAL_ID)); label5047.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location5047 = (Location) label5047.getLayoutConstraint(); location5047.setX(0); location5047.setY(5); return node; }
Example #18
Source File: ProcessViewProvider.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ public Node createBoundaryTimerEvent_3044(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(ProcessVisualIDRegistry.getType(BoundaryTimerEvent2EditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB)); FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE); if (nodeFontStyle != null) { FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT); nodeFontStyle.setFontName(fontData.getName()); nodeFontStyle.setFontHeight(fontData.getHeight()); nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue()); } org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FILL_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB)); Node label5058 = createLabel(node, ProcessVisualIDRegistry.getType(BoundaryTimerEventLabel2EditPart.VISUAL_ID)); label5058.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location5058 = (Location) label5058.getLayoutConstraint(); location5058.setX(0); location5058.setY(5); return node; }
Example #19
Source File: ProcessViewProvider.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ public Node createSendTask_2026(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(ProcessVisualIDRegistry.getType(SendTaskEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); stampShortcut(containerView, node); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB)); FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE); if (nodeFontStyle != null) { FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT); nodeFontStyle.setFontName(fontData.getName()); nodeFontStyle.setFontHeight(fontData.getHeight()); nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue()); } org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FILL_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB)); Node label5014 = createLabel(node, ProcessVisualIDRegistry.getType(SendTaskLabelEditPart.VISUAL_ID)); return node; }
Example #20
Source File: ProcessViewProvider.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ public Node createIntermediateCatchMessageEvent_3013(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(ProcessVisualIDRegistry.getType(IntermediateCatchMessageEvent2EditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB)); FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE); if (nodeFontStyle != null) { FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT); nodeFontStyle.setFontName(fontData.getName()); nodeFontStyle.setFontHeight(fontData.getHeight()); nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue()); } org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FILL_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB)); Node label5027 = createLabel(node, ProcessVisualIDRegistry.getType(IntermediateCatchMessageEventLabel2EditPart.VISUAL_ID)); label5027.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location5027 = (Location) label5027.getLayoutConstraint(); location5027.setX(0); location5027.setY(5); return node; }
Example #21
Source File: ProcessViewProvider.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ public Node createIntermediateErrorCatchEvent_3033(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(ProcessVisualIDRegistry.getType(IntermediateErrorCatchEvent5EditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB)); FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE); if (nodeFontStyle != null) { FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT); nodeFontStyle.setFontName(fontData.getName()); nodeFontStyle.setFontHeight(fontData.getHeight()); nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue()); } org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FILL_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB)); Node label5065 = createLabel(node, ProcessVisualIDRegistry.getType(IntermediateErrorCatchEventLabel5EditPart.VISUAL_ID)); label5065.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location5065 = (Location) label5065.getLayoutConstraint(); location5065.setX(0); location5065.setY(5); return node; }
Example #22
Source File: ProcessViewProvider.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ public Diagram createDiagram(IAdaptable semanticAdapter, String diagramKind, PreferencesHint preferencesHint) { Diagram diagram = NotationFactory.eINSTANCE.createDiagram(); diagram.getStyles().add(NotationFactory.eINSTANCE.createDiagramStyle()); diagram.setType(MainProcessEditPart.MODEL_ID); diagram.setElement(getSemanticElement(semanticAdapter)); diagram.setMeasurementUnit(MeasurementUnit.PIXEL_LITERAL); return diagram; }
Example #23
Source File: DiagramForElementRunnableTest.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @throws java.lang.Exception */ @Before public void setUp() throws Exception { resource = new ResourceImpl(); element = ProcessFactory.eINSTANCE.createMainProcess(); element.setName("Diagram1"); diagram = NotationFactory.eINSTANCE.createDiagram(); diagram.setElement(element); resource.getContents().add(element); resource.getContents().add(diagram); }
Example #24
Source File: BPMNShapeFactory.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
private void attachEdgeLabel(final DecorationNode decorationNode, final BPMNEdge edge, String labelText, Edge bonitaEdge) { Font font = createFont(bonitaEdge); if (font != null) { final BPMNLabel label = DiFactory.eINSTANCE.createBPMNLabel(); Location relativeLocation = (Location) decorationNode.getLayoutConstraint(); Point offSet = new Point(relativeLocation.getX(), relativeLocation.getY()); org.eclipse.gmf.runtime.notation.Bounds absoluteBounds = NotationFactory.eINSTANCE.createBounds(); PointList pList = new PointList(); edge.getWaypoint().stream().map(wayPoint -> new PrecisionPoint(wayPoint.getX(), wayPoint.getY())) .forEach(pList::addPoint); Point referencePoint = PointListUtilities.calculatePointRelativeToLine(pList, 0, LabelViewConstants.MIDDLE_LOCATION, true); Point location = LabelHelper.calculatePointRelativeToPointOnLine(pList, referencePoint, offSet); //Here we use some default constant values to avoid a dependency on a set Display //The output diemension values are sligthly the same between windows and linux Dimension dimension = new Dimension((int) (labelText.length() * 7.42), (int) (11 * 1.6)); absoluteBounds.setWidth(dimension.width); absoluteBounds.setHeight(dimension.height); location.translate(-1 * dimension.width / 2, -1 * dimension.height / 2); absoluteBounds.setWidth(dimension.width); absoluteBounds.setHeight(dimension.height); absoluteBounds.setX(location.x); absoluteBounds.setY(location.y); final Bounds elementBounds = DcFactory.eINSTANCE.createBounds(); elementBounds.setX(absoluteBounds.getX()); elementBounds.setY(absoluteBounds.getY()); elementBounds.setHeight(absoluteBounds.getHeight()); elementBounds.setWidth(absoluteBounds.getWidth()); edge.setBPMNLabel(label); } }
Example #25
Source File: ProcessViewProvider.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ public Node createIntermediateErrorCatchEvent_3032(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(ProcessVisualIDRegistry.getType(IntermediateErrorCatchEvent4EditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB)); FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE); if (nodeFontStyle != null) { FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT); nodeFontStyle.setFontName(fontData.getName()); nodeFontStyle.setFontHeight(fontData.getHeight()); nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue()); } org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FILL_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB)); Node label5062 = createLabel(node, ProcessVisualIDRegistry.getType(IntermediateErrorCatchEventLabel4EditPart.VISUAL_ID)); label5062.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location5062 = (Location) label5062.getLayoutConstraint(); location5062.setX(0); location5062.setY(5); return node; }
Example #26
Source File: ProcessViewProvider.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ public Node createThrowLinkEvent_3018(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(ProcessVisualIDRegistry.getType(ThrowLinkEvent2EditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB)); FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE); if (nodeFontStyle != null) { FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT); nodeFontStyle.setFontName(fontData.getName()); nodeFontStyle.setFontHeight(fontData.getHeight()); nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue()); } org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FILL_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB)); Node label5033 = createLabel(node, ProcessVisualIDRegistry.getType(ThrowLinkEventLabel2EditPart.VISUAL_ID)); label5033.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location5033 = (Location) label5033.getLayoutConstraint(); location5033.setX(0); location5033.setY(5); return node; }
Example #27
Source File: ProcessViewProvider.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ public Node createNonInterruptingBoundaryTimerEvent_3064(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(ProcessVisualIDRegistry.getType(NonInterruptingBoundaryTimerEventEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB)); FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE); if (nodeFontStyle != null) { FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT); nodeFontStyle.setFontName(fontData.getName()); nodeFontStyle.setFontHeight(fontData.getHeight()); nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue()); } org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FILL_COLOR); ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB)); Node label5094 = createLabel(node, ProcessVisualIDRegistry.getType(NonInterruptingBoundaryTimerEventNameEditPart.VISUAL_ID)); label5094.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location5094 = (Location) label5094.getLayoutConstraint(); location5094.setX(0); location5094.setY(5); return node; }
Example #28
Source File: OffscreenEditPartFactoryTest.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
@Test public void should_run_in_UI_thread() throws Exception { final Diagram diagram = NotationFactory.eINSTANCE.createDiagram(); diagram.setElement(ProcessFactory.eINSTANCE.createMainProcess()); doReturn(false).when(offscreenEditPartFactory).inUIThread(); doReturn(dEp).when(factory).createDiagramEditPart(eq(diagram), notNull(Shell.class)); final DiagramEditPart offscreenDiagramEditPart = offscreenEditPartFactory.createOffscreenDiagramEditPart(diagram); assertThat(offscreenDiagramEditPart).isEqualTo(dEp); verify(offscreenEditPartFactory).runInUI(notNull(Runnable.class)); }
Example #29
Source File: OffscreenEditPartFactoryTest.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
@Test public void should_create_an_Offscreen_Diagram_EditPart() throws Exception { final Diagram diagram = NotationFactory.eINSTANCE.createDiagram(); diagram.setElement(ProcessFactory.eINSTANCE.createMainProcess()); doReturn(dEp).when(factory).createDiagramEditPart(eq(diagram), notNull(Shell.class)); final DiagramEditPart offscreenDiagramEditPart = offscreenEditPartFactory.createOffscreenDiagramEditPart(diagram); assertThat(offscreenDiagramEditPart).isEqualTo(dEp); }
Example #30
Source File: CrossflowViewProvider.java From scava with Eclipse Public License 2.0 | 5 votes |
/** * @generated */ public Diagram createDiagram(IAdaptable semanticAdapter, String diagramKind, PreferencesHint preferencesHint) { Diagram diagram = NotationFactory.eINSTANCE.createDiagram(); diagram.getStyles().add(NotationFactory.eINSTANCE.createDiagramStyle()); diagram.setType(WorkflowEditPart.MODEL_ID); diagram.setElement(getSemanticElement(semanticAdapter)); diagram.setMeasurementUnit(MeasurementUnit.PIXEL_LITERAL); return diagram; }