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

The following examples show how to use org.eclipse.gmf.runtime.notation.NotationPackage. 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: CustomScriptTask2EditPart.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
@Override
public Object getPreferredValue(EStructuralFeature feature) {
       Object preferenceStore = getDiagramPreferencesHint().getPreferenceStore();
       if (preferenceStore instanceof IPreferenceStore) {
           if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
               
               return FigureUtilities.RGBToInteger(new RGB(44,109,163));
               
           } else if (feature == NotationPackage.eINSTANCE
               .getFontStyle_FontColor()) {
               
               return FigureUtilities.RGBToInteger(PreferenceConverter
                   .getColor((IPreferenceStore) preferenceStore,
                       IPreferenceConstants.PREF_FONT_COLOR));
               
           } else if (feature == NotationPackage.eINSTANCE
               .getFillStyle_FillColor()) {
               
               return FigureUtilities.RGBToInteger(new RGB(184,185,218));
               
           }
       }

       return getStructuralFeatureValue(feature);
   }
 
Example #2
Source File: ToggleShowDocumentationCommand.java    From statecharts with Eclipse Public License 1.0 6 votes vote down vote up
public static void toggleDocumentation(List<View> views) {
	CompositeCommand command = new CompositeCommand("toggle documentation");
	for (View view : views) {
		StringValueStyle style = GMFNotationUtil.getStringValueStyle(view, FEATURE_TO_SHOW);
		if (style == null) {
			style = createInitialStyle(view);
		}
		String featureName = style.getStringValue()
				.equals(SGraphPackage.Literals.SPECIFICATION_ELEMENT__SPECIFICATION.getName())
						? BasePackage.Literals.DOCUMENTED_ELEMENT__DOCUMENTATION.getName()
						: SGraphPackage.Literals.SPECIFICATION_ELEMENT__SPECIFICATION.getName();
		command.add(new SetValueCommand(
				new SetRequest(style, NotationPackage.Literals.STRING_VALUE_STYLE__STRING_VALUE, featureName)));
	}
	executeCommand(command);
}
 
Example #3
Source File: DiagramPartitioningUtil.java    From statecharts with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Returns the {@link Diagram} that contains a given semantic element.
 */
public static Diagram getDiagramContaining(EObject element) {
	Assert.isNotNull(element);
	Resource eResource = element.eResource();
	Collection<Diagram> objects = EcoreUtil.getObjectsByType(eResource.getContents(),
			NotationPackage.Literals.DIAGRAM);
	for (Diagram diagram : objects) {
		TreeIterator<EObject> eAllContents = diagram.eAllContents();
		while (eAllContents.hasNext()) {
			EObject next = eAllContents.next();
			if (next instanceof View) {
				if (EcoreUtil.equals(((View) next).getElement(), element)) {
					return ((View) next).getDiagram();
				}
			}
		}
	}
	return null;
}
 
Example #4
Source File: ForkedColorsAndFontsPropertySection.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
/**
    * Update font property
    */
protected void updateFontBold() {

	// Update model in response to user

	List commands = new ArrayList();
	Iterator it = getInputIterator();

	while (it.hasNext()) {
		final IGraphicalEditPart ep = (IGraphicalEditPart) it.next();
		commands.add(createCommand(FONT_COMMAND_NAME,
			((View) ep.getModel()).eResource(), new Runnable() {

				public void run() {
					ep.setStructuralFeatureValue(NotationPackage.eINSTANCE.getFontStyle_Bold(),
						Boolean.valueOf(fontBoldButton.getSelection()));
				}
			}));
	}

	executeAsCompositeCommand(FONT_COMMAND_NAME, commands);

}
 
Example #5
Source File: NoMessageDefinedConstraint.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected IStatus performLiveValidation(final IValidationContext ctx) {
    final EStructuralFeature featureTriggered = ctx.getFeature();
    if (featureTriggered.equals(ProcessPackage.Literals.THROW_MESSAGE_EVENT__EVENTS)) {
        final ThrowMessageEvent message = (ThrowMessageEvent) ctx.getTarget();
        if (message.getEvents().isEmpty()) {
            return ctx.createFailureStatus(new Object[] { message.getName() });
        }
    } else if (featureTriggered.equals(NotationPackage.Literals.VIEW__ELEMENT)) {
        final EObject eobject = (EObject) ctx.getFeatureNewValue();
        if (eobject instanceof ThrowMessageEvent) {
            if (((ThrowMessageEvent) eobject).getEvents().isEmpty()) {
                return ctx.createFailureStatus(new Object[] { ((Element) eobject).getName() });
            }
        }
    }
    return ctx.createSuccessStatus();
}
 
Example #6
Source File: SCTMatchEngineFactory.java    From statecharts with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public Comparison match(IComparisonScope scope, Monitor monitor) {
	Predicate<EObject> predicate = new Predicate<EObject>() {
		@Override
		public boolean apply(EObject eobject) {
			// We only want to diff the SGraph and notation elements,
			// not the transient palceholders for concrete languages
			EPackage ePackage = eobject.eClass().getEPackage();
			return ePackage == SGraphPackage.eINSTANCE || ePackage == NotationPackage.eINSTANCE;
		}
	};
	if (scope instanceof DefaultComparisonScope) {
		DefaultComparisonScope defaultScope = (DefaultComparisonScope) scope;
		defaultScope.setEObjectContentFilter(predicate);
		defaultScope.setResourceContentFilter(predicate);
	}
	return super.match(scope, monitor);
}
 
Example #7
Source File: CustomReceiveTask2EditPart.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
@Override
public Object getPreferredValue(EStructuralFeature feature) {
       Object preferenceStore = getDiagramPreferencesHint().getPreferenceStore();
       if (preferenceStore instanceof IPreferenceStore) {
           if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
               
               return FigureUtilities.RGBToInteger(new RGB(44,109,163));
               
           } else if (feature == NotationPackage.eINSTANCE
               .getFontStyle_FontColor()) {
               
               return FigureUtilities.RGBToInteger(PreferenceConverter
                   .getColor((IPreferenceStore) preferenceStore,
                       IPreferenceConstants.PREF_FONT_COLOR));
               
           } else if (feature == NotationPackage.eINSTANCE
               .getFillStyle_FillColor()) {
               
               return FigureUtilities.RGBToInteger(new RGB(184,185,218));
               
           }
       }

       return getStructuralFeatureValue(feature);
   }
 
Example #8
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 #9
Source File: StartMessageEventLabelEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void refreshFont() {
	FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
	if (style != null) {
		FontData fontData = new FontData(style.getFontName(), style.getFontHeight(),
				(style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
		setFont(fontData);
	}
}
 
Example #10
Source File: TextAnnotationTextEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void refreshFont() {
	FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
	if (style != null) {
		FontData fontData = new FontData(style.getFontName(), style.getFontHeight(),
				(style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
		setFont(fontData);
	}
}
 
Example #11
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @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 #12
Source File: FieldNameTypeEditPart.java    From scava with Eclipse Public License 2.0 5 votes vote down vote up
/**
* @generated
*/
protected void refreshStrikeThrough() {
	FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
	if (style != null && getFigure() instanceof WrappingLabel) {
		((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
	}
}
 
Example #13
Source File: StartSignalEventLabelEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void refreshStrikeThrough() {
	FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
	if (style != null && getFigure() instanceof WrappingLabel) {
		((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
	}
}
 
Example #14
Source File: EndErrorEventLabelEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void refreshFont() {
	FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
	if (style != null) {
		FontData fontData = new FontData(style.getFontName(), style.getFontHeight(),
				(style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
		setFont(fontData);
	}
}
 
Example #15
Source File: XORGatewayLabel2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void handleNotificationEvent(Notification event) {
	Object feature = event.getFeature();
	if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
		Integer c = (Integer) event.getNewValue();
		setFontColor(DiagramColorRegistry.getInstance().getColor(c));
	} else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
		refreshUnderline();
	} else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
		refreshStrikeThrough();
	} else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature)
			|| NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature)
			|| NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
			|| NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
		refreshFont();
	} else {
		if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
			refreshLabel();
		}
		if (getParser() instanceof ISemanticParser) {
			ISemanticParser modelParser = (ISemanticParser) getParser();
			if (modelParser.areSemanticElementsAffected(null, event)) {
				removeSemanticListeners();
				if (resolveSemanticElement() != null) {
					addSemanticListeners();
				}
				refreshLabel();
			}
		}
	}
	//if 'to' link changed
	if (event.getEventType() == Notification.SET && feature.equals(ProcessPackage.Literals.THROW_LINK_EVENT__TO)) {
		refreshLabel();
	}
	super.handleNotificationEvent(event);
}
 
Example #16
Source File: StartMessageEventLabel2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void refreshStrikeThrough() {
	FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
	if (style != null && getFigure() instanceof WrappingLabel) {
		((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
	}
}
 
Example #17
Source File: ANDGatewayLabelEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void refreshStrikeThrough() {
	FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
	if (style != null && getFigure() instanceof WrappingLabel) {
		((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
	}
}
 
Example #18
Source File: InclusiveGatewayLabel2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void refreshUnderline() {
	FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
	if (style != null && getFigure() instanceof WrappingLabel) {
		((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline());
	}
}
 
Example #19
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @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 #20
Source File: CatchLinkEventLabel2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void refreshStrikeThrough() {
	FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
	if (style != null && getFigure() instanceof WrappingLabel) {
		((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
	}
}
 
Example #21
Source File: StartMessageEventLabelEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void refreshStrikeThrough() {
	FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
	if (style != null && getFigure() instanceof WrappingLabel) {
		((WrappingLabel) getFigure()).setTextStrikeThrough(style.isStrikeThrough());
	}
}
 
Example #22
Source File: TaskNameEditPart.java    From scava with Eclipse Public License 2.0 5 votes vote down vote up
/**
* @generated
*/
protected void refreshFont() {
	FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
	if (style != null) {
		FontData fontData = new FontData(style.getFontName(), style.getFontHeight(),
				(style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
		setFont(fontData);
	}
}
 
Example #23
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @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 #24
Source File: SubprocessCollapseHandle.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new Compartment Collapse Handle
 * 
 * @param owner
 */
public SubprocessCollapseHandle(IGraphicalEditPart owner) {

	setOwner(owner);
	zoomManager = ((DiagramRootEditPart) owner.getRoot()).getZoomManager();
	setLocator(new CollapseHandleLocator());
	setCursor(Cursors.HAND);

	plus = FiguresHelper.getDecoratorFigure(FiguresHelper.SUBPROCESS_DECORATOR_EXPAND) ;
	minus = FiguresHelper.getDecoratorFigure(FiguresHelper.SUBPROCESS_DECORATOR_COLLAPSE) ;


	setLayoutManager(new StackLayout());

	zoomManager.addZoomListener(this) ;
	setSize(plus.getSize().scale(zoomManager.getZoom()));

	View view = owner.getNotationView();
	if (view != null) {
		DrawerStyle style = (DrawerStyle) view.getStyle(NotationPackage.eINSTANCE.getDrawerStyle());
		if (style != null) {
			if(style.isCollapsed()){
				add(plus) ;
			}else{
				add(minus) ;
			}
			for(Object child : getChildren()){
				if(child instanceof DecoratorSVGFigure){
					final IGraphicalEditPart parentEditpart = (IGraphicalEditPart)getOwner().getParent();
					((DecoratorSVGFigure) child).setColor(ColorRegistry.getInstance().getColor((Integer) parentEditpart.getStructuralFeatureValue(NotationPackage.eINSTANCE.getLineStyle_LineColor()))
							,ColorRegistry.getInstance().getColor((Integer) parentEditpart.getStructuralFeatureValue(NotationPackage.eINSTANCE.getFillStyle_FillColor())));
				}
			}
			return;
		}
		
	}
}
 
Example #25
Source File: ScriptTaskLabel2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void handleNotificationEvent(Notification event) {
	Object feature = event.getFeature();
	if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
		Integer c = (Integer) event.getNewValue();
		setFontColor(DiagramColorRegistry.getInstance().getColor(c));
	} else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
		refreshUnderline();
	} else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
		refreshStrikeThrough();
	} else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature)
			|| NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature)
			|| NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
			|| NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
		refreshFont();
	} else {
		if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
			refreshLabel();
		}
		if (getParser() instanceof ISemanticParser) {
			ISemanticParser modelParser = (ISemanticParser) getParser();
			if (modelParser.areSemanticElementsAffected(null, event)) {
				removeSemanticListeners();
				if (resolveSemanticElement() != null) {
					addSemanticListeners();
				}
				refreshLabel();
			}
		}
	}
	super.handleNotificationEvent(event);
}
 
Example #26
Source File: IntermediateThrowMessageEventLabelEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void refreshFont() {
	FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
	if (style != null) {
		FontData fontData = new FontData(style.getFontName(), style.getFontHeight(),
				(style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
		setFont(fontData);
	}
}
 
Example #27
Source File: SourceNameEditPart.java    From scava with Eclipse Public License 2.0 5 votes vote down vote up
/**
* @generated
*/
protected void handleNotificationEvent(Notification event) {
	Object feature = event.getFeature();
	if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
		Integer c = (Integer) event.getNewValue();
		setFontColor(DiagramColorRegistry.getInstance().getColor(c));
	} else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
		refreshUnderline();
	} else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
		refreshStrikeThrough();
	} else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature)
			|| NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature)
			|| NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
			|| NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
		refreshFont();
	} else {
		if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
			refreshLabel();
		}
		if (getParser() instanceof ISemanticParser) {
			ISemanticParser modelParser = (ISemanticParser) getParser();
			if (modelParser.areSemanticElementsAffected(null, event)) {
				removeSemanticListeners();
				if (resolveSemanticElement() != null) {
					addSemanticListeners();
				}
				refreshLabel();
			}
		}
	}
	super.handleNotificationEvent(event);
}
 
Example #28
Source File: SourceNameEditPart.java    From scava with Eclipse Public License 2.0 5 votes vote down vote up
/**
* @generated
*/
protected void refreshFont() {
	FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
	if (style != null) {
		FontData fontData = new FontData(style.getFontName(), style.getFontHeight(),
				(style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
		setFont(fontData);
	}
}
 
Example #29
Source File: EndEventLabel2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void handleNotificationEvent(Notification event) {
	Object feature = event.getFeature();
	if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
		Integer c = (Integer) event.getNewValue();
		setFontColor(DiagramColorRegistry.getInstance().getColor(c));
	} else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals(feature)) {
		refreshUnderline();
	} else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough().equals(feature)) {
		refreshStrikeThrough();
	} else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals(feature)
			|| NotationPackage.eINSTANCE.getFontStyle_FontName().equals(feature)
			|| NotationPackage.eINSTANCE.getFontStyle_Bold().equals(feature)
			|| NotationPackage.eINSTANCE.getFontStyle_Italic().equals(feature)) {
		refreshFont();
	} else {
		if (getParser() != null && getParser().isAffectingEvent(event, getParserOptions().intValue())) {
			refreshLabel();
		}
		if (getParser() instanceof ISemanticParser) {
			ISemanticParser modelParser = (ISemanticParser) getParser();
			if (modelParser.areSemanticElementsAffected(null, event)) {
				removeSemanticListeners();
				if (resolveSemanticElement() != null) {
					addSemanticListeners();
				}
				refreshLabel();
			}
		}
	}
	//if 'to' link changed
	if (event.getEventType() == Notification.SET && feature.equals(ProcessPackage.Literals.THROW_LINK_EVENT__TO)) {
		refreshLabel();
	}
	super.handleNotificationEvent(event);
}
 
Example #30
Source File: BoundaryTimerEventLabel2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
protected void refreshFont() {
	FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
	if (style != null) {
		FontData fontData = new FontData(style.getFontName(), style.getFontHeight(),
				(style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
		setFont(fontData);
	}
}