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

The following examples show how to use org.eclipse.gmf.runtime.notation.Routing. 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: SetLabelsOffsetOperation.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
public static boolean isEdgeWithObliqueRoutingStyle(org.eclipse.gef.ConnectionEditPart part) {
	Edge edge = (Edge) part.getModel();
	ConnectorStyle style = (ConnectorStyle) edge.getStyle(NotationPackage.Literals.CONNECTOR_STYLE);
	if (style != null) {
		return Routing.MANUAL_LITERAL == style.getRouting();
	}
	return false;
}
 
Example #2
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public Edge createTextAnnotationAttachment_4003(EObject domainElement, View containerView, int index,
		boolean persisted, PreferencesHint preferencesHint) {
	Connector edge = NotationFactory.eINSTANCE.createConnector();
	edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
	RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
	ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
	points.add(new RelativeBendpoint());
	points.add(new RelativeBendpoint());
	bendpoints.setPoints(points);
	edge.setBendpoints(bendpoints);
	ViewUtil.insertChildView(containerView, edge, index, persisted);
	edge.setType(ProcessVisualIDRegistry.getType(TextAnnotationAttachmentEditPart.VISUAL_ID));
	edge.setElement(domainElement);
	// initializePreferences
	final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

	org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_LINE_COLOR);
	ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
			FigureUtilities.RGBToInteger(lineRGB));
	FontStyle edgeFontStyle = (FontStyle) edge.getStyle(NotationPackage.Literals.FONT_STYLE);
	if (edgeFontStyle != null) {
		FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
		edgeFontStyle.setFontName(fontData.getName());
		edgeFontStyle.setFontHeight(fontData.getHeight());
		edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
		edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
		org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
				IPreferenceConstants.PREF_FONT_COLOR);
		edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
	}
	Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
	if (routing != null) {
		ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
	}
	return edge;
}
 
Example #3
Source File: CrossflowViewProvider.java    From scava with Eclipse Public License 2.0 4 votes vote down vote up
/**
* @generated
*/
public Edge createStreamType_4001(View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Connector edge = NotationFactory.eINSTANCE.createConnector();
	edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
	RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
	ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
	points.add(new RelativeBendpoint());
	points.add(new RelativeBendpoint());
	bendpoints.setPoints(points);
	edge.setBendpoints(bendpoints);
	ViewUtil.insertChildView(containerView, edge, index, persisted);
	edge.setType(CrossflowVisualIDRegistry.getType(StreamTypeEditPart.VISUAL_ID));
	edge.setElement(null);
	// initializePreferences
	final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

	org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_LINE_COLOR);
	ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
			FigureUtilities.RGBToInteger(lineRGB));
	FontStyle edgeFontStyle = (FontStyle) edge.getStyle(NotationPackage.Literals.FONT_STYLE);
	if (edgeFontStyle != null) {
		FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
		edgeFontStyle.setFontName(fontData.getName());
		edgeFontStyle.setFontHeight(fontData.getHeight());
		edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
		edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
		org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
				IPreferenceConstants.PREF_FONT_COLOR);
		edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
	}
	Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
	if (routing != null) {
		ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
	}
	Node label6001 = createLabel(edge, CrossflowVisualIDRegistry.getType(WrappingLabelEditPart.VISUAL_ID));
	label6001.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle());
	label6001.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
	Location location6001 = (Location) label6001.getLayoutConstraint();
	location6001.setX(0);
	location6001.setY(40);
	return edge;
}
 
Example #4
Source File: CrossflowViewProvider.java    From scava with Eclipse Public License 2.0 4 votes vote down vote up
/**
* @generated
*/
public Edge createStreamInputOf_4005(View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Connector edge = NotationFactory.eINSTANCE.createConnector();
	edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
	RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
	ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
	points.add(new RelativeBendpoint());
	points.add(new RelativeBendpoint());
	bendpoints.setPoints(points);
	edge.setBendpoints(bendpoints);
	ViewUtil.insertChildView(containerView, edge, index, persisted);
	edge.setType(CrossflowVisualIDRegistry.getType(StreamInputOfEditPart.VISUAL_ID));
	edge.setElement(null);
	// initializePreferences
	final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

	org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_LINE_COLOR);
	ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
			FigureUtilities.RGBToInteger(lineRGB));
	FontStyle edgeFontStyle = (FontStyle) edge.getStyle(NotationPackage.Literals.FONT_STYLE);
	if (edgeFontStyle != null) {
		FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
		edgeFontStyle.setFontName(fontData.getName());
		edgeFontStyle.setFontHeight(fontData.getHeight());
		edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
		edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
		org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
				IPreferenceConstants.PREF_FONT_COLOR);
		edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
	}
	Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
	if (routing != null) {
		ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
	}
	Node label6005 = createLabel(edge, CrossflowVisualIDRegistry.getType(WrappingLabel2EditPart.VISUAL_ID));
	label6005.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle());
	label6005.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
	Location location6005 = (Location) label6005.getLayoutConstraint();
	location6005.setX(0);
	location6005.setY(40);
	return edge;
}
 
Example #5
Source File: CrossflowViewProvider.java    From scava with Eclipse Public License 2.0 4 votes vote down vote up
/**
* @generated
*/
public Edge createTaskOutput_4003(View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Connector edge = NotationFactory.eINSTANCE.createConnector();
	edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
	RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
	ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
	points.add(new RelativeBendpoint());
	points.add(new RelativeBendpoint());
	bendpoints.setPoints(points);
	edge.setBendpoints(bendpoints);
	ViewUtil.insertChildView(containerView, edge, index, persisted);
	edge.setType(CrossflowVisualIDRegistry.getType(TaskOutputEditPart.VISUAL_ID));
	edge.setElement(null);
	// initializePreferences
	final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

	org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_LINE_COLOR);
	ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
			FigureUtilities.RGBToInteger(lineRGB));
	FontStyle edgeFontStyle = (FontStyle) edge.getStyle(NotationPackage.Literals.FONT_STYLE);
	if (edgeFontStyle != null) {
		FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
		edgeFontStyle.setFontName(fontData.getName());
		edgeFontStyle.setFontHeight(fontData.getHeight());
		edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
		edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
		org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
				IPreferenceConstants.PREF_FONT_COLOR);
		edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
	}
	Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
	if (routing != null) {
		ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
	}
	Node label6003 = createLabel(edge, CrossflowVisualIDRegistry.getType(WrappingLabel3EditPart.VISUAL_ID));
	label6003.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle());
	label6003.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
	Location location6003 = (Location) label6003.getLayoutConstraint();
	location6003.setX(0);
	location6003.setY(40);
	return edge;
}
 
Example #6
Source File: CrossflowViewProvider.java    From scava with Eclipse Public License 2.0 4 votes vote down vote up
/**
* @generated
*/
public Edge createTypeExtending_4004(View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Connector edge = NotationFactory.eINSTANCE.createConnector();
	edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
	RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
	ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
	points.add(new RelativeBendpoint());
	points.add(new RelativeBendpoint());
	bendpoints.setPoints(points);
	edge.setBendpoints(bendpoints);
	ViewUtil.insertChildView(containerView, edge, index, persisted);
	edge.setType(CrossflowVisualIDRegistry.getType(TypeExtendingEditPart.VISUAL_ID));
	edge.setElement(null);
	// initializePreferences
	final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

	org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_LINE_COLOR);
	ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
			FigureUtilities.RGBToInteger(lineRGB));
	FontStyle edgeFontStyle = (FontStyle) edge.getStyle(NotationPackage.Literals.FONT_STYLE);
	if (edgeFontStyle != null) {
		FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
		edgeFontStyle.setFontName(fontData.getName());
		edgeFontStyle.setFontHeight(fontData.getHeight());
		edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
		edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
		org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
				IPreferenceConstants.PREF_FONT_COLOR);
		edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
	}
	Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
	if (routing != null) {
		ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
	}
	Node label6004 = createLabel(edge, CrossflowVisualIDRegistry.getType(WrappingLabel4EditPart.VISUAL_ID));
	label6004.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle());
	label6004.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
	Location location6004 = (Location) label6004.getLayoutConstraint();
	location6004.setX(0);
	location6004.setY(40);
	return edge;
}
 
Example #7
Source File: PreferenceInitializer.java    From statecharts with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void initializeDefaultPreferences() {
	super.initializeDefaultPreferences();
	// Line colors
	Color lineColor = DiagramColorConstants.darkGray;
	PreferenceConverter.setDefault(getPreferenceStore(), IPreferenceConstants.PREF_LINE_COLOR, lineColor.getRGB());

	getPreferenceStore().setDefault(IPreferenceConstants.PREF_LINE_STYLE, Routing.RECTILINEAR);

	// rulers and grid defaults
	getPreferenceStore().setDefault(IPreferenceConstants.PREF_SNAP_TO_GEOMETRY, true);

	// set default font
	FontData defaultFont = new FontData("Verdana", 9, SWT.NONE);
	PreferenceConverter.setDefault(getPreferenceStore(), IPreferenceConstants.PREF_DEFAULT_FONT, defaultFont);

	// set preferences for tool palette.
	DefaultPaletteViewerPreferences prefs = new DefaultPaletteViewerPreferences();
	prefs.setLayoutSetting(DefaultPaletteViewerPreferences.LAYOUT_LIST);
	prefs.setCurrentUseLargeIcons(true);

	// State line and background color
	PreferenceConverter.setDefault(getPreferenceStore(), StatechartPreferenceConstants.PREF_STATE_BACKGROUND,
			StatechartColorConstants.STATE_BG_COLOR.getRGB());
	PreferenceConverter.setDefault(getPreferenceStore(), StatechartPreferenceConstants.PREF_STATE_LINE,
			StatechartColorConstants.STATE_LINE_COLOR.getRGB());

	// Region fill color
	PreferenceConverter.setDefault(getPreferenceStore(), StatechartPreferenceConstants.PREF_REGION_BACKGROUND,
			StatechartColorConstants.REGION_BG_COLOR.getRGB());
	PreferenceConverter.setDefault(getPreferenceStore(), StatechartPreferenceConstants.PREF_REGION_LINE,
			StatechartColorConstants.REGION_LINE_COLOR.getRGB());

	// Transition Priority Labels
	getPreferenceStore().setDefault(StatechartPreferenceConstants.PREF_PRIORITY_LABELS, true);
	// Live validation
	getPreferenceStore().setDefault(StatechartPreferenceConstants.PREF_LIVE_VALIDATION, true);
	// Syntax coloring
	getPreferenceStore().setDefault(StatechartPreferenceConstants.PREF_SYNTAX_COLORING, true);
	//Font scaling
	getPreferenceStore().setDefault(StatechartPreferenceConstants.PREF_FONT_SCALING, false);

}
 
Example #8
Source File: CustomProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Edge createMessageFlow_4002(final EObject domainElement,
        final View containerView, final int index, final boolean persisted,
        final PreferencesHint preferencesHint) {
    final Connector edge = NotationFactory.eINSTANCE.createConnector();
    edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
    final RelativeBendpoints bendpoints = NotationFactory.eINSTANCE
            .createRelativeBendpoints();
    final ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(
            2);
    points.add(new RelativeBendpoint());
    points.add(new RelativeBendpoint());
    bendpoints.setPoints(points);
    edge.setBendpoints(bendpoints);
    ViewUtil.insertChildView(containerView, edge, index, persisted);
    edge.setType(ProcessVisualIDRegistry
            .getType(MessageFlowEditPart.VISUAL_ID));
    edge.setElement(domainElement);
    // initializePreferences
    final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint
            .getPreferenceStore();

    final org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(
            prefStore, IPreferenceConstants.PREF_LINE_COLOR);
    ViewUtil.setStructuralFeatureValue(edge,
            NotationPackage.eINSTANCE.getLineStyle_LineColor(),
            FigureUtilities.RGBToInteger(lineRGB));
    final FontStyle edgeFontStyle = (FontStyle) edge
            .getStyle(NotationPackage.Literals.FONT_STYLE);
    if (edgeFontStyle != null) {
        final FontData fontData = PreferenceConverter.getFontData(prefStore,
                IPreferenceConstants.PREF_DEFAULT_FONT);
        edgeFontStyle.setFontName(fontData.getName());
        edgeFontStyle.setFontHeight(fontData.getHeight());
        edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
        edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
        final org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter
                .getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR);
        edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB)
                .intValue());
    }
    final Routing routing = Routing.get(Routing.RECTILINEAR_LITERAL.getName());

    if (routing != null) {
        ViewUtil.setStructuralFeatureValue(edge,
                NotationPackage.eINSTANCE.getRoutingStyle_Routing(),
                routing);
        ViewUtil.setStructuralFeatureValue(edge,
                NotationPackage.eINSTANCE.getRoundedCornersStyle_RoundedBendpointsRadius(),
                10);
    }
    final Node label6003 = createLabel(edge,
            ProcessVisualIDRegistry
                    .getType(MessageFlowLabelEditPart.VISUAL_ID));
    label6003.setLayoutConstraint(NotationFactory.eINSTANCE
            .createLocation());
    final Location location6003 = (Location) label6003.getLayoutConstraint();
    location6003.setX(0);
    location6003.setY(-10);
    return edge;
}
 
Example #9
Source File: CustomProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Edge createSequenceFlow_4001(final EObject domainElement,
        final View containerView, final int index, final boolean persisted,
        final PreferencesHint preferencesHint) {
    final Connector edge = NotationFactory.eINSTANCE.createConnector();
    edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
    final RelativeBendpoints bendpoints = NotationFactory.eINSTANCE
            .createRelativeBendpoints();
    final ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(
            2);
    points.add(new RelativeBendpoint());
    points.add(new RelativeBendpoint());
    bendpoints.setPoints(points);
    edge.setBendpoints(bendpoints);
    ViewUtil.insertChildView(containerView, edge, index, persisted);
    edge.setType(ProcessVisualIDRegistry
            .getType(SequenceFlowEditPart.VISUAL_ID));
    edge.setElement(domainElement);
    // initializePreferences
    final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint
            .getPreferenceStore();

    final org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(
            prefStore, IPreferenceConstants.PREF_LINE_COLOR);
    ViewUtil.setStructuralFeatureValue(edge,
            NotationPackage.eINSTANCE.getLineStyle_LineColor(),
            FigureUtilities.RGBToInteger(lineRGB));
    final FontStyle edgeFontStyle = (FontStyle) edge
            .getStyle(NotationPackage.Literals.FONT_STYLE);
    if (edgeFontStyle != null) {
        final FontData fontData = PreferenceConverter.getFontData(prefStore,
                IPreferenceConstants.PREF_DEFAULT_FONT);
        edgeFontStyle.setFontName(fontData.getName());
        edgeFontStyle.setFontHeight(fontData.getHeight());
        edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
        edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
        final org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter
                .getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR);
        edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB)
                .intValue());
    }
    final Routing routing = Routing.get(Routing.RECTILINEAR_LITERAL.getName());

    if (routing != null) {
        ViewUtil.setStructuralFeatureValue(edge,
                NotationPackage.eINSTANCE.getRoutingStyle_Routing(),
                routing);
        ViewUtil.setStructuralFeatureValue(edge,
                NotationPackage.eINSTANCE.getRoundedCornersStyle_RoundedBendpointsRadius(),
                10);
        ViewUtil.setStructuralFeatureValue(edge,
                NotationPackage.eINSTANCE.getRoutingStyle_ClosestDistance(),
                false);
        ViewUtil.setStructuralFeatureValue(edge,
                NotationPackage.eINSTANCE.getRoutingStyle_AvoidObstructions(),
                false);
    }
    final Node label6001 = createLabel(edge,
            ProcessVisualIDRegistry
                    .getType(SequenceFlowNameEditPart.VISUAL_ID));
    label6001.setLayoutConstraint(NotationFactory.eINSTANCE
            .createLocation());
    label6001.setVisible(true);
    final Location location6001 = (Location) label6001.getLayoutConstraint();
    location6001.setX(0);
    location6001.setY(-10);
    return edge;
}
 
Example #10
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
/**
* @generated
*/
public Edge createSequenceFlow_4001(EObject domainElement, View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Connector edge = NotationFactory.eINSTANCE.createConnector();
	edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
	RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
	ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
	points.add(new RelativeBendpoint());
	points.add(new RelativeBendpoint());
	bendpoints.setPoints(points);
	edge.setBendpoints(bendpoints);
	ViewUtil.insertChildView(containerView, edge, index, persisted);
	edge.setType(ProcessVisualIDRegistry.getType(SequenceFlowEditPart.VISUAL_ID));
	edge.setElement(domainElement);
	// initializePreferences
	final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

	org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_LINE_COLOR);
	ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
			FigureUtilities.RGBToInteger(lineRGB));
	FontStyle edgeFontStyle = (FontStyle) edge.getStyle(NotationPackage.Literals.FONT_STYLE);
	if (edgeFontStyle != null) {
		FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
		edgeFontStyle.setFontName(fontData.getName());
		edgeFontStyle.setFontHeight(fontData.getHeight());
		edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
		edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
		org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
				IPreferenceConstants.PREF_FONT_COLOR);
		edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
	}
	Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
	if (routing != null) {
		ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
	}
	Node label6001 = createLabel(edge, ProcessVisualIDRegistry.getType(SequenceFlowNameEditPart.VISUAL_ID));
	label6001.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
	Location location6001 = (Location) label6001.getLayoutConstraint();
	location6001.setX(0);
	location6001.setY(-10);
	return edge;
}
 
Example #11
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
/**
* @generated
*/
public Edge createMessageFlow_4002(EObject domainElement, View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Connector edge = NotationFactory.eINSTANCE.createConnector();
	edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
	RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
	ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
	points.add(new RelativeBendpoint());
	points.add(new RelativeBendpoint());
	bendpoints.setPoints(points);
	edge.setBendpoints(bendpoints);
	ViewUtil.insertChildView(containerView, edge, index, persisted);
	edge.setType(ProcessVisualIDRegistry.getType(MessageFlowEditPart.VISUAL_ID));
	edge.setElement(domainElement);
	// initializePreferences
	final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

	org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_LINE_COLOR);
	ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
			FigureUtilities.RGBToInteger(lineRGB));
	FontStyle edgeFontStyle = (FontStyle) edge.getStyle(NotationPackage.Literals.FONT_STYLE);
	if (edgeFontStyle != null) {
		FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
		edgeFontStyle.setFontName(fontData.getName());
		edgeFontStyle.setFontHeight(fontData.getHeight());
		edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
		edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
		org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
				IPreferenceConstants.PREF_FONT_COLOR);
		edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
	}
	Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
	if (routing != null) {
		ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
	}
	Node label6003 = createLabel(edge, ProcessVisualIDRegistry.getType(MessageFlowLabelEditPart.VISUAL_ID));
	label6003.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
	Location location6003 = (Location) label6003.getLayoutConstraint();
	location6003.setX(0);
	location6003.setY(-10);
	return edge;
}