org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities Java Examples

The following examples show how to use org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities. 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: CustomSnapFeedbackPolicy.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @see org.eclipse.draw2d.IFigure#getLocalBackgroundColor()
 */
public Color getLocalBackgroundColor() {
	/* get the correct color */
	Color temp = FigureUtilities.mixColors(super.getLocalBackgroundColor(), getParent().getBackgroundColor(),
			(double) opacity / FRAMES);

	if (temp.equals(localBgColor)) {
		/*
		 * if it's the same than previous, just dispose the just new
		 * created
		 */
		temp.dispose();
	} else {
		/* else dispose the old color... */
		if (localBgColor != null && !localBgColor.isDisposed()) {
			localBgColor.dispose();
		}
		/* and replace it by the new one */
		localBgColor = temp;
	}
	return localBgColor;
}
 
Example #2
Source File: StatechartTextFactory.java    From statecharts with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected void decorateView(View containerView, View view,
		IAdaptable semanticAdapter, String semanticHint, int index,
		boolean persisted) {
	super.decorateView(containerView, view, semanticAdapter, semanticHint,
			index, persisted);

	IAdaptable eObjectAdapter = null;
	EObject eObject = (EObject) semanticAdapter.getAdapter(EObject.class);
	if (eObject != null) {
		eObjectAdapter = new EObjectAdapter(eObject);
	}
	//Create the statechart name label
	FactoryUtils.createLabel(view, STATECHART_NAME);
	//create the expressions compartment
	Node textCompartment = getViewService().createNode(eObjectAdapter,
			view, STATECHART_TEXT_EXPRESSION, ViewUtil.APPEND, true,
			getPreferencesHint());
	Assert.isNotNull(textCompartment);
	ShapeStyle style = (ShapeStyle) view.getStyle(NotationPackage.eINSTANCE
			.getShapeStyle());
	style.setFillColor(FigureUtilities.RGBToInteger(ColorConstants.white
			.getRGB()));
}
 
Example #3
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 #4
Source File: CustomActivity2EditPart.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 #5
Source File: CustomServiceTask2EditPart.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 #6
Source File: CustomSubProcessEvent2EditPart.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 #7
Source File: CustomColorPalettePopup.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Launches the Popup List, waits for an item to be selected and then closes
 * PopupList.
 * 
 * @param rect
 *            the initial size and location of the PopupList; the dialog
 *            will be positioned so that it does not run off the screen and
 *            the largest number of items are visible
 * 
 * @return the text of the selected item or null if no item is selected
 */
public RGB open(Point location) {

	Point listSize = shell.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
	shell.setBounds(location.x, location.y, listSize.x, listSize.y);

	shell.open();
	shell.setFocus();		
	Display display = shell.getDisplay();
	Button prevButton = (Button)buttonMap.get(FigureUtilities.integerToRGB(getPreviousColor()));
	if (prevButton != null){
		shell.setDefaultButton(prevButton);
	}	
	else{
		shell.setDefaultButton(customColorButton);
	}
	while (!shell.isDisposed() && shell.isVisible()) {
		if (!display.readAndDispatch())
			display.sleep();
	}		
	return getSelectedColor();
}
 
Example #8
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @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 #9
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @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 #10
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public Node createServiceTask_2027(EObject domainElement, View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Shape node = NotationFactory.eINSTANCE.createShape();
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(ProcessVisualIDRegistry.getType(ServiceTaskEditPart.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 label5015 = createLabel(node, ProcessVisualIDRegistry.getType(ServiceTaskLabelEditPart.VISUAL_ID));
	return node;
}
 
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 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 #12
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public Node createThrowLinkEvent_2019(EObject domainElement, View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Shape node = NotationFactory.eINSTANCE.createShape();
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(ProcessVisualIDRegistry.getType(ThrowLinkEventEditPart.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 label5046 = createLabel(node, ProcessVisualIDRegistry.getType(ThrowLinkEventLabelEditPart.VISUAL_ID));
	label5046.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
	Location location5046 = (Location) label5046.getLayoutConstraint();
	location5046.setX(0);
	location5046.setY(5);
	return node;
}
 
Example #13
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public Node createEndErrorEvent_3050(EObject domainElement, View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Shape node = NotationFactory.eINSTANCE.createShape();
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(ProcessVisualIDRegistry.getType(EndErrorEvent2EditPart.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 label5052 = createLabel(node, ProcessVisualIDRegistry.getType(EndErrorEventLabel2EditPart.VISUAL_ID));
	label5052.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
	Location location5052 = (Location) label5052.getLayoutConstraint();
	location5052.setX(0);
	location5052.setY(5);
	return node;
}
 
Example #14
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public Node createTask_3005(EObject domainElement, View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Shape node = NotationFactory.eINSTANCE.createShape();
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(ProcessVisualIDRegistry.getType(Task2EditPart.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 label5005 = createLabel(node, ProcessVisualIDRegistry.getType(TaskName2EditPart.VISUAL_ID));
	return node;
}
 
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 createIntermediateCatchTimerEvent_2017(EObject domainElement, View containerView, int index,
		boolean persisted, PreferencesHint preferencesHint) {
	Shape node = NotationFactory.eINSTANCE.createShape();
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(ProcessVisualIDRegistry.getType(IntermediateCatchTimerEventEditPart.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 label5043 = createLabel(node,
			ProcessVisualIDRegistry.getType(IntermediateCatchTimerEventLabelEditPart.VISUAL_ID));
	label5043.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
	Location location5043 = (Location) label5043.getLayoutConstraint();
	location5043.setX(0);
	location5043.setY(5);
	return node;
}
 
Example #16
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public Node createActivity_3006(EObject domainElement, View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Shape node = NotationFactory.eINSTANCE.createShape();
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(ProcessVisualIDRegistry.getType(Activity2EditPart.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 label5006 = createLabel(node, ProcessVisualIDRegistry.getType(ActivityName2EditPart.VISUAL_ID));
	return node;
}
 
Example #17
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public Node createScriptTask_3028(EObject domainElement, View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Shape node = NotationFactory.eINSTANCE.createShape();
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(ProcessVisualIDRegistry.getType(ScriptTask2EditPart.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 label5018 = createLabel(node, ProcessVisualIDRegistry.getType(ScriptTaskLabel2EditPart.VISUAL_ID));
	return node;
}
 
Example #18
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public Node createEvent_2024(EObject domainElement, View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Shape node = NotationFactory.eINSTANCE.createShape();
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(ProcessVisualIDRegistry.getType(EventEditPart.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));
	return node;
}
 
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 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 #20
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @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 #21
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @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 #22
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @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 #23
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public Node createStartEvent_2002(EObject domainElement, View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Shape node = NotationFactory.eINSTANCE.createShape();
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(ProcessVisualIDRegistry.getType(StartEventEditPart.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 label5021 = createLabel(node, ProcessVisualIDRegistry.getType(StartEventLabelEditPart.VISUAL_ID));
	label5021.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
	Location location5021 = (Location) label5021.getLayoutConstraint();
	location5021.setX(0);
	location5021.setY(5);
	return node;
}
 
Example #24
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public Node createANDGateway_2009(EObject domainElement, View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Shape node = NotationFactory.eINSTANCE.createShape();
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(ProcessVisualIDRegistry.getType(ANDGatewayEditPart.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 label5019 = createLabel(node, ProcessVisualIDRegistry.getType(ANDGatewayLabelEditPart.VISUAL_ID));
	label5019.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
	Location location5019 = (Location) label5019.getLayoutConstraint();
	location5019.setX(0);
	location5019.setY(5);
	return node;
}
 
Example #25
Source File: ForkedColorsAndFontsPropertySection.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Apply font color change
 * 
 * @param event -
 *            font button selection event
 */
protected void changeFontColor(SelectionEvent event) {
	if (fontColor != null){
		previousColor = FigureUtilities.RGBToInteger(fontColor);
	}
	fontColor = changeColor(event, fontColorButton,
		IPreferenceConstants.PREF_FONT_COLOR, Properties.ID_FONTCOLOR,
		FONT_COLOR_COMMAND_NAME, DiagramUIPropertiesImages.DESC_FONT_COLOR);
}
 
Example #26
Source File: ForkedColorsAndFontsPropertySection.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Apply line color change
 * 
 * @param event -
 *            line color button selection event
 */
protected void changeLineColor(SelectionEvent event) {
	if (lineColor != null){
		previousColor = FigureUtilities.RGBToInteger(lineColor);	
	}	
	lineColor = changeColor(event, lineColorButton,
		IPreferenceConstants.PREF_LINE_COLOR, Properties.ID_LINECOLOR,
		LINE_COLOR_COMMAND_NAME, DiagramUIPropertiesImages.DESC_LINE_COLOR);
}
 
Example #27
Source File: ForkedColorsAndFontsPropertySection.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
protected void changeFillColor(SelectionEvent event) {
       // calling the deprectaed method in case a client overrides the deprecated method
	if (fillColor != null){
		previousColor = FigureUtilities.RGBToInteger(fillColor);
	}
	fillColor = changeColor(event, fillColorButton,
		IPreferenceConstants.PREF_FILL_COLOR, Properties.ID_FILLCOLOR,
		FILL_COLOR_COMMAND_NAME, DiagramUIPropertiesImages.DESC_FILL_COLOR);
}
 
Example #28
Source File: ColorAndFontPropertySection.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
private void applyFillColor() {
	List commands = new ArrayList();
	Iterator it = getInputIterator();

	RGB colorToReturn = fillColor;
	RGB color = fillColor;
	while (it.hasNext()) {
		final IGraphicalEditPart editPart = (IGraphicalEditPart) it.next();

		color = fillColor;
		// If we are using default colors, we want to return the color of the first selected element to be consistent
		if (colorToReturn == null) {
			colorToReturn = color;
		}

		if (color != null) {
			final RGB finalColor = color; // need a final variable
			commands.add(createCommand("Fill Color", ((View) editPart.getModel())
					.eResource(), new Runnable() {

				public void run() {
					ENamedElement element = PackageUtil
					.getElement(Properties.ID_FILLCOLOR);
					if (element instanceof EStructuralFeature)
						editPart.setStructuralFeatureValue(NotationPackage.eINSTANCE.getFillStyle_FillColor(),
								FigureUtilities.RGBToInteger(finalColor));
				}
			}));
		}
	}
	if (!commands.isEmpty()){
		executeAsCompositeCommand("Fill Color", commands);
		Image overlyedImage = new ColorOverlayImageDescriptor(DiagramUIPropertiesImages.DESC_FILL_COLOR.getImageData(), color).createImage();
		disposeImage(fillColorButton.getImage());
		fillColorButton.setImage(overlyedImage);
	}
}
 
Example #29
Source File: ColorAndFontPropertySection.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
private void applyLineColor() {
	List commands = new ArrayList();
	Iterator it = getInputIterator();

	RGB colorToReturn = lineColor;
	RGB color = lineColor;
	while (it.hasNext()) {
		final IGraphicalEditPart editPart = (IGraphicalEditPart) it.next();

		color = lineColor;
		// If we are using default colors, we want to return the color of the first selected element to be consistent
		if (colorToReturn == null) {
			colorToReturn = color;
		}

		if (color != null) {
			final RGB finalColor = color; // need a final variable
			commands.add(createCommand("Line Color", ((View) editPart.getModel())
					.eResource(), new Runnable() {

				public void run() {
					ENamedElement element = PackageUtil
					.getElement(Properties.ID_LINECOLOR);
					if (element instanceof EStructuralFeature)
						editPart.setStructuralFeatureValue(NotationPackage.eINSTANCE.getLineStyle_LineColor(),
								FigureUtilities.RGBToInteger(finalColor));
				}
			}));
		}
	}
	if (!commands.isEmpty()){
		executeAsCompositeCommand("Line Color", commands);
		Image overlyedImage = new ColorOverlayImageDescriptor(DiagramUIPropertiesImages.DESC_LINE_COLOR.getImageData(), color).createImage();
		disposeImage(lineColorButton.getImage());
		lineColorButton.setImage(overlyedImage);
	}
}
 
Example #30
Source File: ColorAndFontPropertySection.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
private void applyFontColor() {
	List commands = new ArrayList();
	Iterator it = getInputIterator();

	RGB colorToReturn = fontColor;
	RGB color = fontColor;
	while (it.hasNext()) {
		final IGraphicalEditPart editPart = (IGraphicalEditPart) it.next();

		color = fontColor;
		// If we are using default colors, we want to return the color of the first selected element to be consistent
		if (colorToReturn == null) {
			colorToReturn = color;
		}

		if (color != null) {
			final RGB finalColor = color; // need a final variable
			commands.add(createCommand("Font Color", ((View) editPart.getModel())
					.eResource(), new Runnable() {

				public void run() {
					ENamedElement element = PackageUtil
					.getElement(Properties.ID_FONTCOLOR);
					if (element instanceof EStructuralFeature)
						editPart.setStructuralFeatureValue(NotationPackage.eINSTANCE.getFontStyle_FontColor(),
								FigureUtilities.RGBToInteger(finalColor));
				}
			}));
		}
	}
	if (!commands.isEmpty()){
		executeAsCompositeCommand("Font Color", commands);
		Image overlyedImage = new ColorOverlayImageDescriptor(DiagramUIPropertiesImages.DESC_FONT_COLOR.getImageData(), color).createImage();
		disposeImage(fontColorButton.getImage());
		fontColorButton.setImage(overlyedImage);
	}
}