List of usage examples for org.eclipse.jface.preference IPreferenceStore getInt
int getInt(String name);
From source file:edu.toronto.cs.se.mmint.mid.diagram.providers.MIDViewProvider.java
License:Open Source License
/** * @generated//from w w w .jav a 2 s. com */ public Edge createModelEndpoint_4002(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Edge edge = NotationFactory.eINSTANCE.createEdge(); edge.getStyles().add(NotationFactory.eINSTANCE.createRoutingStyle()); 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(MIDVisualIDRegistry.getType(ModelEndpointEditPart.VISUAL_ID)); edge.setElement(domainElement); // initializePreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); 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, MIDVisualIDRegistry.getType(WrappingLabel10EditPart.VISUAL_ID)); label6001.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6001 = (Location) label6001.getLayoutConstraint(); location6001.setX(0); location6001.setY(40); Node label6002 = createLabel(edge, MIDVisualIDRegistry.getType(WrappingLabel11EditPart.VISUAL_ID)); label6002.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6002 = (Location) label6002.getLayoutConstraint(); location6002.setX(0); location6002.setY(60); return edge; }
From source file:edu.toronto.cs.se.mmint.mid.diagram.providers.MIDViewProvider.java
License:Open Source License
/** * @generated//from w w w.ja v a2 s .c om */ public Edge createBinaryModelRel_4003(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Edge edge = NotationFactory.eINSTANCE.createEdge(); edge.getStyles().add(NotationFactory.eINSTANCE.createRoutingStyle()); 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(MIDVisualIDRegistry.getType(BinaryModelRelEditPart.VISUAL_ID)); edge.setElement(domainElement); // initializePreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); 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, MIDVisualIDRegistry.getType(WrappingLabel12EditPart.VISUAL_ID)); label6003.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6003 = (Location) label6003.getLayoutConstraint(); location6003.setX(0); location6003.setY(40); Node label6004 = createLabel(edge, MIDVisualIDRegistry.getType(WrappingLabel13EditPart.VISUAL_ID)); label6004.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6004 = (Location) label6004.getLayoutConstraint(); location6004.setX(0); location6004.setY(60); Node label6005 = createLabel(edge, MIDVisualIDRegistry.getType(WrappingLabel14EditPart.VISUAL_ID)); label6005.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6005 = (Location) label6005.getLayoutConstraint(); location6005.setX(0); location6005.setY(80); Node label6006 = createLabel(edge, MIDVisualIDRegistry.getType(WrappingLabel15EditPart.VISUAL_ID)); label6006.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6006 = (Location) label6006.getLayoutConstraint(); location6006.setX(0); location6006.setY(100); return edge; }
From source file:edu.toronto.cs.se.mmint.mid.diagram.providers.MIDViewProvider.java
License:Open Source License
/** * @generated//from w ww. j a v a2 s.co m */ public Edge createModelEndpoint_4004(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Edge edge = NotationFactory.eINSTANCE.createEdge(); edge.getStyles().add(NotationFactory.eINSTANCE.createRoutingStyle()); 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(MIDVisualIDRegistry.getType(ModelEndpoint2EditPart.VISUAL_ID)); edge.setElement(domainElement); // initializePreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); 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 label6007 = createLabel(edge, MIDVisualIDRegistry.getType(ModelEndpointNameEditPart.VISUAL_ID)); label6007.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6007 = (Location) label6007.getLayoutConstraint(); location6007.setX(0); location6007.setY(40); return edge; }
From source file:edu.toronto.cs.se.mmint.mid.diagram.providers.MIDViewProvider.java
License:Open Source License
/** * @generated//from w w w .j av a2 s . c om */ public Edge createModelEndpoint_4005(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Edge edge = NotationFactory.eINSTANCE.createEdge(); edge.getStyles().add(NotationFactory.eINSTANCE.createRoutingStyle()); 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(MIDVisualIDRegistry.getType(ModelEndpoint3EditPart.VISUAL_ID)); edge.setElement(domainElement); // initializePreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); 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 label6008 = createLabel(edge, MIDVisualIDRegistry.getType(ModelEndpointName2EditPart.VISUAL_ID)); label6008.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6008 = (Location) label6008.getLayoutConstraint(); location6008.setX(0); location6008.setY(40); return edge; }
From source file:edu.toronto.cs.se.mmint.mid.relationship.diagram.providers.MIDViewProvider.java
License:Open Source License
/** * @generated/*w w w. j a v a2 s .c o m*/ */ public Edge createExtendibleElementReferenceSupertypeRef_4001(View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Edge edge = NotationFactory.eINSTANCE.createEdge(); edge.getStyles().add(NotationFactory.eINSTANCE.createRoutingStyle()); 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(MIDVisualIDRegistry.getType(ExtendibleElementReferenceSupertypeRefEditPart.VISUAL_ID)); edge.setElement(null); // initializePreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); 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; }
From source file:edu.toronto.cs.se.mmint.mid.relationship.diagram.providers.MIDViewProvider.java
License:Open Source License
/** * @generated/*from w w w . jav a 2 s. c o m*/ */ public Edge createModelElementEndpointReference_4002(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Edge edge = NotationFactory.eINSTANCE.createEdge(); edge.getStyles().add(NotationFactory.eINSTANCE.createRoutingStyle()); 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(MIDVisualIDRegistry.getType(ModelElementEndpointReferenceEditPart.VISUAL_ID)); edge.setElement(domainElement); // initializePreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); 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, MIDVisualIDRegistry.getType(WrappingLabel15EditPart.VISUAL_ID)); label6001.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6001 = (Location) label6001.getLayoutConstraint(); location6001.setX(0); location6001.setY(40); Node label6002 = createLabel(edge, MIDVisualIDRegistry.getType(WrappingLabel16EditPart.VISUAL_ID)); label6002.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6002 = (Location) label6002.getLayoutConstraint(); location6002.setX(0); location6002.setY(60); return edge; }
From source file:edu.toronto.cs.se.mmint.mid.relationship.diagram.providers.MIDViewProvider.java
License:Open Source License
/** * @generated//from w w w.j ava 2 s. c o m */ public Edge createBinaryMappingReference_4003(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Edge edge = NotationFactory.eINSTANCE.createEdge(); edge.getStyles().add(NotationFactory.eINSTANCE.createRoutingStyle()); 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(MIDVisualIDRegistry.getType(BinaryMappingReferenceEditPart.VISUAL_ID)); edge.setElement(domainElement); // initializePreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); 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, MIDVisualIDRegistry.getType(WrappingLabel17EditPart.VISUAL_ID)); label6003.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6003 = (Location) label6003.getLayoutConstraint(); location6003.setX(0); location6003.setY(40); Node label6004 = createLabel(edge, MIDVisualIDRegistry.getType(WrappingLabel18EditPart.VISUAL_ID)); label6004.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6004 = (Location) label6004.getLayoutConstraint(); location6004.setX(0); location6004.setY(60); Node label6005 = createLabel(edge, MIDVisualIDRegistry.getType(WrappingLabel19EditPart.VISUAL_ID)); label6005.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6005 = (Location) label6005.getLayoutConstraint(); location6005.setX(0); location6005.setY(80); Node label6006 = createLabel(edge, MIDVisualIDRegistry.getType(WrappingLabel20EditPart.VISUAL_ID)); label6006.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6006 = (Location) label6006.getLayoutConstraint(); location6006.setX(0); location6006.setY(100); return edge; }
From source file:edu.toronto.cs.se.mmint.mid.relationship.diagram.providers.MIDViewProvider.java
License:Open Source License
/** * @generated/*from w w w . jav a2 s . com*/ */ public Edge createBinaryMappingReference_4004(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Edge edge = NotationFactory.eINSTANCE.createEdge(); edge.getStyles().add(NotationFactory.eINSTANCE.createRoutingStyle()); 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(MIDVisualIDRegistry.getType(BinaryMappingReference2EditPart.VISUAL_ID)); edge.setElement(domainElement); // initializePreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); 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 label6007 = createLabel(edge, MIDVisualIDRegistry.getType(WrappingLabel21EditPart.VISUAL_ID)); label6007.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6007 = (Location) label6007.getLayoutConstraint(); location6007.setX(0); location6007.setY(40); Node label6008 = createLabel(edge, MIDVisualIDRegistry.getType(WrappingLabel22EditPart.VISUAL_ID)); label6008.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6008 = (Location) label6008.getLayoutConstraint(); location6008.setX(0); location6008.setY(60); Node label6009 = createLabel(edge, MIDVisualIDRegistry.getType(WrappingLabel23EditPart.VISUAL_ID)); label6009.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6009 = (Location) label6009.getLayoutConstraint(); location6009.setX(0); location6009.setY(80); Node label6010 = createLabel(edge, MIDVisualIDRegistry.getType(WrappingLabel24EditPart.VISUAL_ID)); label6010.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6010 = (Location) label6010.getLayoutConstraint(); location6010.setX(0); location6010.setY(100); return edge; }
From source file:edu.toronto.cs.se.mmint.mid.relationship.diagram.providers.MIDViewProvider.java
License:Open Source License
/** * @generated/*from ww w . jav a 2 s . c o m*/ */ public Edge createModelElementEndpointReference_4005(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Edge edge = NotationFactory.eINSTANCE.createEdge(); edge.getStyles().add(NotationFactory.eINSTANCE.createRoutingStyle()); 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(MIDVisualIDRegistry.getType(ModelElementEndpointReference2EditPart.VISUAL_ID)); edge.setElement(domainElement); // initializePreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); 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 label6011 = createLabel(edge, MIDVisualIDRegistry.getType(WrappingLabel25EditPart.VISUAL_ID)); label6011.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6011 = (Location) label6011.getLayoutConstraint(); location6011.setX(0); location6011.setY(40); Node label6012 = createLabel(edge, MIDVisualIDRegistry.getType(WrappingLabel26EditPart.VISUAL_ID)); label6012.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6012 = (Location) label6012.getLayoutConstraint(); location6012.setX(0); location6012.setY(60); return edge; }
From source file:edu.toronto.cs.se.mmint.mid.relationship.diagram.providers.RelationshipDiagramViewProvider.java
License:Open Source License
/** * Customizes label creation.//from w ww .j ava2s.c om */ @SuppressWarnings("unchecked") @Override public Edge createModelElementEndpointReference_4002(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Edge edge = NotationFactory.eINSTANCE.createEdge(); edge.getStyles().add(NotationFactory.eINSTANCE.createRoutingStyle()); 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(MIDVisualIDRegistry.getType(ModelElementEndpointReferenceEditPart.VISUAL_ID)); edge.setElement(domainElement); // initializePreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); 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); } if (!Boolean.parseBoolean(MMINT.getPreference(MMINTConstants.PREFERENCE_MENU_MODELRELENDPOINTS_ENABLED))) { return edge; } Node label6001 = createLabel(edge, MIDVisualIDRegistry.getType(WrappingLabel15EditPart.VISUAL_ID)); label6001.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6001 = (Location) label6001.getLayoutConstraint(); location6001.setX(0); location6001.setY(40); if (Boolean.parseBoolean(MMINT.getPreference(MMINTConstants.PREFERENCE_MENU_ICONS_ENABLED))) { Node label6002 = createLabel(edge, MIDVisualIDRegistry.getType(WrappingLabel16EditPart.VISUAL_ID)); label6002.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6002 = (Location) label6002.getLayoutConstraint(); location6002.setX(0); location6002.setY(60); } return edge; }