org.eclipse.gmf.runtime.notation.View Java Examples

The following examples show how to use org.eclipse.gmf.runtime.notation.View. 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: NotationClipboardOperationHelper.java    From statecharts with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Customized Method to find the semantic target which should contain the
 * copied elements.
 * 
 * @param view
 * @param container
 * @return the semantic target.
 */
public static EObject getSemanticPasteTarget(View view, View container) {
	EObject copiedSemanticObject = view.getElement();
	EObject semanticTarget = container.getElement();
	if (copiedSemanticObject instanceof Transition) {
		semanticTarget = copiedSemanticObject.eContainer();
	}
	EList<EReference> eAllReferences = semanticTarget.eClass()
			.getEAllReferences();
	for (EReference eReference : eAllReferences) {
		EClass eReferenceType = eReference.getEReferenceType();
		if (eReference.isContainment()
				&& eReferenceType.isSuperTypeOf(copiedSemanticObject
						.eClass())) {
			return semanticTarget;
		}
	}
	return null;
}
 
Example #2
Source File: CrossflowNavigatorActionProvider.java    From scava with Eclipse Public License 2.0 6 votes vote down vote up
/**
* @generated
*/
public final void selectionChanged(IStructuredSelection selection) {
	myDiagram = null;
	if (selection.size() == 1) {
		Object selectedElement = selection.getFirstElement();
		if (selectedElement instanceof CrossflowNavigatorItem) {
			selectedElement = ((CrossflowNavigatorItem) selectedElement).getView();
		} else if (selectedElement instanceof IAdaptable) {
			selectedElement = ((IAdaptable) selectedElement).getAdapter(View.class);
		}
		if (selectedElement instanceof Diagram) {
			Diagram diagram = (Diagram) selectedElement;
			if (WorkflowEditPart.MODEL_ID.equals(CrossflowVisualIDRegistry.getModelID(diagram))) {
				myDiagram = diagram;
			}
		}
	}
	setEnabled(myDiagram != null);
}
 
Example #3
Source File: CustomProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
@Override
public Node createSubProcessEvent_2031(final EObject domainElement,
        final View containerView, final int index, final boolean persisted,
        final PreferencesHint preferencesHint) {

    final Node node = super.createSubProcessEvent_2031(domainElement, containerView, index,
            persisted, preferencesHint);
    ((FillStyle) node.getStyle(NotationPackage.eINSTANCE.getFillStyle())).setFillColor(new RGB(184, 185, 218).hashCode());
    ((LineStyle) node.getStyle(NotationPackage.eINSTANCE.getLineStyle())).setLineColor(new RGB(44, 109, 163).hashCode());
    for (final Object child : node.getPersistedChildren()) {
        if (child instanceof DrawerStyle) {
            ((DrawerStyle) child).setCollapsed(true);
        }
    }
    return node;
}
 
Example #4
Source File: ValidateAction.java    From scava with Eclipse Public License 2.0 6 votes vote down vote up
/**
* @generated
*/
private static void createMarkers(IFile target, IStatus validationStatus, DiagramEditPart diagramEditPart) {
	if (validationStatus.isOK()) {
		return;
	}
	final IStatus rootStatus = validationStatus;
	List allStatuses = new ArrayList();
	CrossflowDiagramEditorUtil.LazyElement2ViewMap element2ViewMap = new CrossflowDiagramEditorUtil.LazyElement2ViewMap(
			diagramEditPart.getDiagramView(),
			collectTargetElements(rootStatus, new HashSet<EObject>(), allStatuses));
	for (Iterator it = allStatuses.iterator(); it.hasNext();) {
		IConstraintStatus nextStatus = (IConstraintStatus) it.next();
		View view = CrossflowDiagramEditorUtil.findView(diagramEditPart, nextStatus.getTarget(), element2ViewMap);
		addMarker(diagramEditPart.getViewer(), target, view.eResource().getURIFragment(view),
				EMFCoreUtil.getQualifiedName(nextStatus.getTarget(), true), nextStatus.getMessage(),
				nextStatus.getSeverity());
	}
}
 
Example #5
Source File: CrossflowNavigatorLabelProvider.java    From scava with Eclipse Public License 2.0 5 votes vote down vote up
/**
* @generated
*/
private String getParameter_3002Text(View view) {
	IParser parser = CrossflowParserProvider.getParser(CrossflowElementTypes.Parameter_3002,
			view.getElement() != null ? view.getElement() : view,
			CrossflowVisualIDRegistry.getType(ParameterNameValueEditPart.VISUAL_ID));
	if (parser != null) {
		return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view),
				ParserOptions.NONE.intValue());
	} else {
		CrossflowDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5014); //$NON-NLS-1$
		return ""; //$NON-NLS-1$
	}
}
 
Example #6
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public Node createServiceTask_3027(EObject domainElement, View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Shape node = NotationFactory.eINSTANCE.createShape();
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(ProcessVisualIDRegistry.getType(ServiceTask2EditPart.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 label5017 = createLabel(node, ProcessVisualIDRegistry.getType(ServiceTaskLabel2EditPart.VISUAL_ID));
	return node;
}
 
Example #7
Source File: ProcessElementLabelProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
private View getView(final Object element) {
	if (element instanceof View) {
		return (View) element;
	}
	if (element instanceof IAdaptable) {
		return (View) ((IAdaptable) element).getAdapter(View.class);
	}
	return null;
}
 
Example #8
Source File: ProcessDiagramUpdater.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @generated
 */
public static List<ProcessLinkDescriptor> getIntermediateErrorCatchEvent_3034OutgoingLinks(View view) {
	IntermediateErrorCatchEvent modelElement = (IntermediateErrorCatchEvent) view.getElement();
	LinkedList<ProcessLinkDescriptor> result = new LinkedList<ProcessLinkDescriptor>();
	result.addAll(getOutgoingTypeModelFacetLinks_SequenceFlow_4001(modelElement));
	return result;
}
 
Example #9
Source File: ProcessNavigatorLabelProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
private String getServiceTask_2027Text(View view) {
	IParser parser = ProcessParserProvider.getParser(ProcessElementTypes.ServiceTask_2027,
			view.getElement() != null ? view.getElement() : view,
			ProcessVisualIDRegistry.getType(ServiceTaskLabelEditPart.VISUAL_ID));
	if (parser != null) {
		return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view),
				ParserOptions.NONE.intValue());
	} else {
		ProcessDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5015); //$NON-NLS-1$
		return ""; //$NON-NLS-1$
	}
}
 
Example #10
Source File: ProcessDiagramUpdater.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @generated
 */
public static List<ProcessLinkDescriptor> getStartEvent_2002ContainedLinks(View view) {
	StartEvent modelElement = (StartEvent) view.getElement();
	LinkedList<ProcessLinkDescriptor> result = new LinkedList<ProcessLinkDescriptor>();
	result.addAll(getContainedTypeModelFacetLinks_TextAnnotationAttachment_4003(modelElement));
	return result;
}
 
Example #11
Source File: ScriptTaskCanonicalEditPolicy.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
@SuppressWarnings("rawtypes")

protected List getSemanticChildrenList() {
	View viewObject = (View) getHost().getModel();
	LinkedList<EObject> result = new LinkedList<EObject>();
	List<ProcessNodeDescriptor> childDescriptors = ProcessDiagramUpdater
			.getScriptTask_2028SemanticChildren(viewObject);
	for (ProcessNodeDescriptor d : childDescriptors) {
		result.add(d.getModelElement());
	}
	return result;
}
 
Example #12
Source File: ProcessDiagramUpdater.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @generated
 */
public static List<ProcessLinkDescriptor> getIntermediateCatchTimerEvent_3017ContainedLinks(View view) {
	IntermediateCatchTimerEvent modelElement = (IntermediateCatchTimerEvent) view.getElement();
	LinkedList<ProcessLinkDescriptor> result = new LinkedList<ProcessLinkDescriptor>();
	result.addAll(getContainedTypeModelFacetLinks_TextAnnotationAttachment_4003(modelElement));
	return result;
}
 
Example #13
Source File: ProcessDiagramUpdater.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @generated
 */
public static List<ProcessLinkDescriptor> getReceiveTask_3026IncomingLinks(View view) {
	ReceiveTask modelElement = (ReceiveTask) view.getElement();
	Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer
			.find(view.eResource().getResourceSet().getResources());
	LinkedList<ProcessLinkDescriptor> result = new LinkedList<ProcessLinkDescriptor>();
	result.addAll(getIncomingTypeModelFacetLinks_SequenceFlow_4001(modelElement, crossReferences));
	result.addAll(getIncomingTypeModelFacetLinks_MessageFlow_4002(modelElement, crossReferences));
	result.addAll(getIncomingTypeModelFacetLinks_TextAnnotationAttachment_4003(modelElement, crossReferences));
	return result;
}
 
Example #14
Source File: AbstractViewRefactoringHandler.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void setContext(AbstractRefactoring<View> refactoring,
		ISelection selection) {
	StateEditPart firstElement = (StateEditPart) getFirstElement(selection);
	if (firstElement == null) {
		refactoring.setContextObjects(Collections.<View>emptyList());
	} else {
		refactoring.setContextObjects(Lists.newArrayList(firstElement
				.getNotationView()));
	}
}
 
Example #15
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public Node createEndErrorEvent_2029(EObject domainElement, View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Shape node = NotationFactory.eINSTANCE.createShape();
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(ProcessVisualIDRegistry.getType(EndErrorEventEditPart.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 label5051 = createLabel(node, ProcessVisualIDRegistry.getType(EndErrorEventLabelEditPart.VISUAL_ID));
	label5051.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
	Location location5051 = (Location) label5051.getLayoutConstraint();
	location5051.setX(0);
	location5051.setY(5);
	return node;
}
 
Example #16
Source File: CrossflowNavigatorLabelProvider.java    From scava with Eclipse Public License 2.0 5 votes vote down vote up
/**
* @generated
*/
private String getTaskOutput_4003Text(View view) {
	IParser parser = CrossflowParserProvider.getParser(CrossflowElementTypes.TaskOutput_4003,
			view.getElement() != null ? view.getElement() : view, CommonParserHint.DESCRIPTION);
	if (parser != null) {
		return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view),
				ParserOptions.NONE.intValue());
	} else {
		CrossflowDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 6003); //$NON-NLS-1$
		return ""; //$NON-NLS-1$
	}
}
 
Example #17
Source File: ProcessDiagramUpdater.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @generated
 */
public static List<ProcessLinkDescriptor> getInclusiveGateway_2030ContainedLinks(View view) {
	InclusiveGateway modelElement = (InclusiveGateway) view.getElement();
	LinkedList<ProcessLinkDescriptor> result = new LinkedList<ProcessLinkDescriptor>();
	result.addAll(getContainedTypeModelFacetLinks_TextAnnotationAttachment_4003(modelElement));
	return result;
}
 
Example #18
Source File: ProcessNavigatorLabelProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
private String getEndTerminatedEvent_3062Text(View view) {
	IParser parser = ProcessParserProvider.getParser(ProcessElementTypes.EndTerminatedEvent_3062,
			view.getElement() != null ? view.getElement() : view,
			ProcessVisualIDRegistry.getType(EndTerminatedEventLabel2EditPart.VISUAL_ID));
	if (parser != null) {
		return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view),
				ParserOptions.NONE.intValue());
	} else {
		ProcessDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5090); //$NON-NLS-1$
		return ""; //$NON-NLS-1$
	}
}
 
Example #19
Source File: SubProcessEvent2ItemSemanticEditPolicy.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected Command getDestroyElementCommand(DestroyElementRequest req) {
	View view = (View) getHost().getModel();
	CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
	cmd.setTransactionNestingEnabled(false);
	for (Iterator<?> it = view.getTargetEdges().iterator(); it.hasNext();) {
		Edge incomingLink = (Edge) it.next();
		if (ProcessVisualIDRegistry.getVisualID(incomingLink) == TextAnnotationAttachmentEditPart.VISUAL_ID) {
			DestroyElementRequest r = new DestroyElementRequest(incomingLink.getElement(), false);
			cmd.add(new DestroyElementCommand(r));
			cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
			continue;
		}
	}
	EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
	if (annotation == null) {
		// there are indirectly referenced children, need extra commands: false
		addDestroyChildNodesCommand(cmd);
		addDestroyShortcutsCommand(cmd, view);
		// delete host element
		cmd.add(new DestroyElementCommand(req));
	} else {
		cmd.add(new DeleteCommand(getEditingDomain(), view));
	}

	final EObject pool = req.getElementToDestroy();
	if (pool instanceof Pool) {
		for (MessageFlow f : ModelHelper.getMainProcess(pool).getMessageConnections()) {
			if (pool.equals(ModelHelper.getParentProcess(f.getSource()))) {
				cmd.add(new DestroyElementCommand(new DestroyElementRequest(f, false)));
			}
		}
	}

	return getGEFWrapper(cmd.reduce());
}
 
Example #20
Source File: IntermediateErrorCatchEventCreateCommand.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* FIXME: replace with setElementToEdit()
* @generated
*/
protected EObject getElementToEdit() {
	EObject container = ((CreateElementRequest) getRequest()).getContainer();
	if (container instanceof View) {
		container = ((View) container).getElement();
	}
	return container;
}
 
Example #21
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public Node createStartSignalEvent_3023(EObject domainElement, View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Shape node = NotationFactory.eINSTANCE.createShape();
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(ProcessVisualIDRegistry.getType(StartSignalEvent2EditPart.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 label5038 = createLabel(node, ProcessVisualIDRegistry.getType(StartSignalEventLabel2EditPart.VISUAL_ID));
	label5038.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
	Location location5038 = (Location) label5038.getLayoutConstraint();
	location5038.setX(0);
	location5038.setY(5);
	return node;
}
 
Example #22
Source File: CustomProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Node createSendTask_3025(final EObject domainElement, final View containerView,
        final int index, final boolean persisted, final PreferencesHint preferencesHint) {
    final Node node = super.createSendTask_3025(domainElement, containerView, index,
            persisted, preferencesHint);
    ((FillStyle) node.getStyle(NotationPackage.eINSTANCE.getFillStyle())).setFillColor(new RGB(184, 185, 218).hashCode());
    ((LineStyle) node.getStyle(NotationPackage.eINSTANCE.getLineStyle())).setLineColor(new RGB(44, 109, 163).hashCode());
    return node;
}
 
Example #23
Source File: CrossflowViewProvider.java    From scava with Eclipse Public License 2.0 5 votes vote down vote up
/**
* @generated
*/
public Node createTask_2010(EObject domainElement, View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Shape node = NotationFactory.eINSTANCE.createShape();
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(CrossflowVisualIDRegistry.getType(TaskEditPart.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 label5010 = createLabel(node, CrossflowVisualIDRegistry.getType(TaskNameEditPart.VISUAL_ID));
	return node;
}
 
Example #24
Source File: CustomProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Node createActivity_2006(final EObject domainElement, final View containerView,
        final int index, final boolean persisted, final PreferencesHint preferencesHint) {
    final Node node = super.createActivity_2006(domainElement, containerView, index,
            persisted, preferencesHint);
    ((FillStyle) node.getStyle(NotationPackage.eINSTANCE.getFillStyle())).setFillColor(new RGB(184, 185, 218).hashCode());
    ((LineStyle) node.getStyle(NotationPackage.eINSTANCE.getLineStyle())).setLineColor(new RGB(44, 109, 163).hashCode());
    return node;
}
 
Example #25
Source File: ProcessDiagramUpdater.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @generated
 */
public static List<ProcessLinkDescriptor> getIntermediateErrorCatchEvent_3029ContainedLinks(View view) {
	IntermediateErrorCatchEvent modelElement = (IntermediateErrorCatchEvent) view.getElement();
	LinkedList<ProcessLinkDescriptor> result = new LinkedList<ProcessLinkDescriptor>();
	result.addAll(getContainedTypeModelFacetLinks_TextAnnotationAttachment_4003(modelElement));
	return result;
}
 
Example #26
Source File: ProcessDiagramUpdater.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @generated
 */
public static List<ProcessLinkDescriptor> getEndSignalEvent_3020OutgoingLinks(View view) {
	EndSignalEvent modelElement = (EndSignalEvent) view.getElement();
	LinkedList<ProcessLinkDescriptor> result = new LinkedList<ProcessLinkDescriptor>();
	result.addAll(getOutgoingTypeModelFacetLinks_SequenceFlow_4001(modelElement));
	return result;
}
 
Example #27
Source File: SelectionFeedbackEditPolicy.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void deactivate() {
	super.deactivate();
	zoomManager.removeZoomListener(this) ;
	TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain() ;
	View view = ((IGraphicalEditPart)getHost()).getNotationView() ; 
	DiagramEventBroker.getInstance(editingDomain).removeNotificationListener(view,NotationPackage.eINSTANCE.getLineStyle_LineColor(), styleListener ) ;
	feedbackFigures.clear();
	sourceFigure =null;
	layer = null;
	feedBackFigure = null;
}
 
Example #28
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public Node createEndSignalEvent_3020(EObject domainElement, View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Shape node = NotationFactory.eINSTANCE.createShape();
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(ProcessVisualIDRegistry.getType(EndSignalEvent2EditPart.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 label5035 = createLabel(node, ProcessVisualIDRegistry.getType(EndSignalEventLabel2EditPart.VISUAL_ID));
	label5035.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
	Location location5035 = (Location) label5035.getLayoutConstraint();
	location5035.setX(0);
	location5035.setY(5);
	return node;
}
 
Example #29
Source File: ProcessNavigatorLabelProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
private String getEndEvent_2003Text(View view) {
	IParser parser = ProcessParserProvider.getParser(ProcessElementTypes.EndEvent_2003,
			view.getElement() != null ? view.getElement() : view,
			ProcessVisualIDRegistry.getType(EndEventLabelEditPart.VISUAL_ID));
	if (parser != null) {
		return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view),
				ParserOptions.NONE.intValue());
	} else {
		ProcessDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5022); //$NON-NLS-1$
		return ""; //$NON-NLS-1$
	}
}
 
Example #30
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public Node createLane_3007(EObject domainElement, View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Node node = NotationFactory.eINSTANCE.createNode();
	node.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle());
	node.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
	node.getStyles().add(NotationFactory.eINSTANCE.createLineStyle());
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(ProcessVisualIDRegistry.getType(LaneEditPart.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());
	}
	Node label5007 = createLabel(node, ProcessVisualIDRegistry.getType(LaneNameEditPart.VISUAL_ID));
	createCompartment(node, ProcessVisualIDRegistry.getType(LaneLaneCompartmentEditPart.VISUAL_ID), false, false,
			false, false);
	return node;
}