/** @generated */ public Node createPersistentTable_2003( EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Node node = NotationFactory.eINSTANCE.createNode(); node.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle()); node.getStyles().add(NotationFactory.eINSTANCE.createLineStyle()); node.getStyles().add(NotationFactory.eINSTANCE.createFillStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(SqlmodelVisualIDRegistry.getType(PersistentTable2EditPart.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)); 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; }
/** @generated */ public Edge createAssociation_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( edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.part .NECSIS14_ClassDiagramVisualIDRegistry.getType( edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.edit.parts .AssociationEditPart.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, edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.part .NECSIS14_ClassDiagramVisualIDRegistry.getType( edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.edit.parts .AssociationNameEditPart.VISUAL_ID)); label6001.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location6001 = (Location) label6001.getLayoutConstraint(); location6001.setX(0); location6001.setY(40); return edge; }
/** @generated */ public Node createViewTable_1002( EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Node node = NotationFactory.eINSTANCE.createNode(); node.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle()); node.getStyles().add(NotationFactory.eINSTANCE.createFontStyle()); FillStyle fillStyle = NotationFactory.eINSTANCE.createFillStyle(); Color color = ViewTableEditPart.getDeclaredBackgroundColor(); fillStyle.setFillColor(FigureUtilities.colorToInteger(color)); node.getStyles().add(fillStyle); LineStyle lineStyle = NotationFactory.eINSTANCE.createLineStyle(); lineStyle.setLineColor(FigureUtilities.RGBToInteger(new org.eclipse.swt.graphics.RGB(0, 0, 0))); node.getStyles().add(lineStyle); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(SqlmodelVisualIDRegistry.getType(ViewTableEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); stampShortcut(containerView, node); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE); if (nodeFontStyle != null) { FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT); nodeFontStyle.setFontName(fontData.getName()); nodeFontStyle.setFontHeight(fontData.getHeight()); nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0); nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0); org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR); nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue()); } Node label4002 = createLabel(node, SqlmodelVisualIDRegistry.getType(ViewTableNameEditPart.VISUAL_ID)); createCompartment( node, SqlmodelVisualIDRegistry.getType(ViewTableViewedColumnsEditPart.VISUAL_ID), false, false, true, true); createCompartment( node, SqlmodelVisualIDRegistry.getType(ViewTableViewedTablesEditPart.VISUAL_ID), false, false, true, true); return node; }
/** * initialize label location. * * @param view the element to initialize * @param store the preference store * @param elementName the name to the element */ public static void initLabelLocationFromPrefs( View view, final IPreferenceStore store, String elementName) { assert (view instanceof Node); Node label = (Node) view; Location location = (Location) label.getLayoutConstraint(); String xKey = getpreferenceKey(view, elementName, PreferenceConstantHelper.LOCATION_X); String yKey = getpreferenceKey(view, elementName, PreferenceConstantHelper.LOCATION_Y); location.setX(store.getInt(xKey)); location.setY(store.getInt(yKey)); label.setLayoutConstraint(location); }
/** @generated */ public Node createStakeHolder_2011( EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(RdalVisualIDRegistry.getType(StakeHolderEditPart.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 label5018 = createLabel(node, RdalVisualIDRegistry.getType(StakeHolderNameEditPart.VISUAL_ID)); label5018.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location5018 = (Location) label5018.getLayoutConstraint(); location5018.setX(0); location5018.setY(5); return node; }
/** @generated */ public Node createRequirementsGroup_2007( EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Node node = NotationFactory.eINSTANCE.createNode(); node.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle()); node.getStyles().add(NotationFactory.eINSTANCE.createFontStyle()); node.getStyles().add(NotationFactory.eINSTANCE.createFillStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(RdalVisualIDRegistry.getType(RequirementsGroupEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); stampShortcut(containerView, node); // initializeFromPreferences final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore(); 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, RdalVisualIDRegistry.getType(RequirementsGroupNameEditPart.VISUAL_ID)); createCompartment( node, RdalVisualIDRegistry.getType(RequirementsGroupRequirementsCompartmentEditPart.VISUAL_ID), true, false, false, false); return node; }
/** @generated */ public Edge createForeignKey_3001( 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 points = new ArrayList(2); points.add(new RelativeBendpoint()); points.add(new RelativeBendpoint()); bendpoints.setPoints(points); edge.setBendpoints(bendpoints); ViewUtil.insertChildView(containerView, edge, index, persisted); edge.setType(SqlmodelVisualIDRegistry.getType(ForeignKeyEditPart.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 label4003 = createLabel(edge, SqlmodelVisualIDRegistry.getType(ForeignKeyNameEditPart.VISUAL_ID)); label4003.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation()); Location location4003 = (Location) label4003.getLayoutConstraint(); location4003.setX(1); location4003.setY(-15); return edge; }