/* * (c) 2011 - 2013 University of Mannheim: Software Engineering Group */ package de.uni_mannheim.informatik.swt.models.plm.diagram.providers; import java.util.ArrayList; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.emf.ecore.EAnnotation; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EcoreFactory; import org.eclipse.emf.transaction.util.TransactionUtil; import org.eclipse.gmf.runtime.common.core.service.AbstractProvider; import org.eclipse.gmf.runtime.common.core.service.IOperation; import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint; import org.eclipse.gmf.runtime.diagram.core.providers.IViewProvider; import org.eclipse.gmf.runtime.diagram.core.services.view.CreateDiagramViewOperation; import org.eclipse.gmf.runtime.diagram.core.services.view.CreateEdgeViewOperation; import org.eclipse.gmf.runtime.diagram.core.services.view.CreateNodeViewOperation; import org.eclipse.gmf.runtime.diagram.core.services.view.CreateViewForKindOperation; import org.eclipse.gmf.runtime.diagram.core.services.view.CreateViewOperation; import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; import org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants; import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities; import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil; import org.eclipse.gmf.runtime.emf.type.core.IElementType; import org.eclipse.gmf.runtime.emf.type.core.IHintedType; import org.eclipse.gmf.runtime.notation.DecorationNode; import org.eclipse.gmf.runtime.notation.Diagram; import org.eclipse.gmf.runtime.notation.Edge; import org.eclipse.gmf.runtime.notation.FontStyle; import org.eclipse.gmf.runtime.notation.Location; import org.eclipse.gmf.runtime.notation.MeasurementUnit; import org.eclipse.gmf.runtime.notation.Node; import org.eclipse.gmf.runtime.notation.NotationFactory; import org.eclipse.gmf.runtime.notation.NotationPackage; import org.eclipse.gmf.runtime.notation.RelativeBendpoints; import org.eclipse.gmf.runtime.notation.Routing; import org.eclipse.gmf.runtime.notation.Shape; import org.eclipse.gmf.runtime.notation.TitleStyle; import org.eclipse.gmf.runtime.notation.View; import org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.preference.PreferenceConverter; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.FontData; /** * @generated */ public class PLMViewProvider extends AbstractProvider implements IViewProvider { /** * @generated */ public final boolean provides(IOperation operation) { if (operation instanceof CreateViewForKindOperation) { return provides((CreateViewForKindOperation) operation); } assert operation instanceof CreateViewOperation; if (operation instanceof CreateDiagramViewOperation) { return provides((CreateDiagramViewOperation) operation); } else if (operation instanceof CreateEdgeViewOperation) { return provides((CreateEdgeViewOperation) operation); } else if (operation instanceof CreateNodeViewOperation) { return provides((CreateNodeViewOperation) operation); } return false; } /** * @generated */ protected boolean provides(CreateViewForKindOperation op) { /* if (op.getViewKind() == Node.class) return getNodeViewClass(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint()) != null; if (op.getViewKind() == Edge.class) return getEdgeViewClass(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint()) != null; */ return true; } /** * @generated */ protected boolean provides(CreateDiagramViewOperation op) { return de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.DomainEditPart.MODEL_ID .equals(op.getSemanticHint()) && de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getDiagramVisualID(getSemanticElement(op .getSemanticAdapter())) != -1; } /** * @generated */ protected boolean provides(CreateNodeViewOperation op) { if (op.getContainerView() == null) { return false; } IElementType elementType = getSemanticElementType(op .getSemanticAdapter()); EObject domainElement = getSemanticElement(op.getSemanticAdapter()); int visualID; if (op.getSemanticHint() == null) { // Semantic hint is not specified. Can be a result of call from CanonicalEditPolicy. // In this situation there should be NO elementType, visualID will be determined // by VisualIDRegistry.getNodeVisualID() for domainElement. if (elementType != null || domainElement == null) { return false; } visualID = de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getNodeVisualID(op.getContainerView(), domainElement); } else { visualID = de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getVisualID(op.getSemanticHint()); if (elementType != null) { if (!de.uni_mannheim.informatik.swt.models.plm.diagram.providers.PLMElementTypes .isKnownElementType(elementType) || (!(elementType instanceof IHintedType))) { return false; // foreign element type } String elementTypeHint = ((IHintedType) elementType) .getSemanticHint(); if (!op.getSemanticHint().equals(elementTypeHint)) { return false; // if semantic hint is specified it should be the same as in element type } if (domainElement != null && visualID != de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getNodeVisualID(op.getContainerView(), domainElement)) { return false; // visual id for node EClass should match visual id from element type } } else { if (!de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.DomainEditPart.MODEL_ID .equals(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getModelID(op.getContainerView()))) { return false; // foreign diagram } switch (visualID) { case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.OntologyEditPart.VISUAL_ID: case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.EnumerationEditPart.VISUAL_ID: case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.ModelEditPart.VISUAL_ID: case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizerEditPart.VISUAL_ID: case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.ConnectionEditPart.VISUAL_ID: case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.AttributeEditPart.VISUAL_ID: case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.MethodEditPart.VISUAL_ID: case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.EntityEditPart.VISUAL_ID: case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.ComplementEditPart.VISUAL_ID: case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.EqualityEditPart.VISUAL_ID: case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.InversionEditPart.VISUAL_ID: case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.GeneralizationEditPart.VISUAL_ID: case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer2EditPart.VISUAL_ID: case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer3EditPart.VISUAL_ID: case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer4EditPart.VISUAL_ID: case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.Attribute2EditPart.VISUAL_ID: case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer5EditPart.VISUAL_ID: case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.Method2EditPart.VISUAL_ID: case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer6EditPart.VISUAL_ID: case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer7EditPart.VISUAL_ID: case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.Connection2EditPart.VISUAL_ID: case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer8EditPart.VISUAL_ID: case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer9EditPart.VISUAL_ID: case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer10EditPart.VISUAL_ID: case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer11EditPart.VISUAL_ID: case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.Entity2EditPart.VISUAL_ID: case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer12EditPart.VISUAL_ID: if (domainElement == null || visualID != de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getNodeVisualID(op.getContainerView(), domainElement)) { return false; // visual id in semantic hint should match visual id for domain element } break; default: return false; } } } return de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.OntologyEditPart.VISUAL_ID == visualID || de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.EnumerationEditPart.VISUAL_ID == visualID || de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.ModelEditPart.VISUAL_ID == visualID || de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizerEditPart.VISUAL_ID == visualID || de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.ConnectionEditPart.VISUAL_ID == visualID || de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.AttributeEditPart.VISUAL_ID == visualID || de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer2EditPart.VISUAL_ID == visualID || de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.MethodEditPart.VISUAL_ID == visualID || de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer3EditPart.VISUAL_ID == visualID || de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer4EditPart.VISUAL_ID == visualID || de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.EntityEditPart.VISUAL_ID == visualID || de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.Attribute2EditPart.VISUAL_ID == visualID || de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer5EditPart.VISUAL_ID == visualID || de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.Method2EditPart.VISUAL_ID == visualID || de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer6EditPart.VISUAL_ID == visualID || de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer7EditPart.VISUAL_ID == visualID || de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.Connection2EditPart.VISUAL_ID == visualID || de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.ComplementEditPart.VISUAL_ID == visualID || de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer8EditPart.VISUAL_ID == visualID || de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.EqualityEditPart.VISUAL_ID == visualID || de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer9EditPart.VISUAL_ID == visualID || de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.InversionEditPart.VISUAL_ID == visualID || de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer10EditPart.VISUAL_ID == visualID || de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.GeneralizationEditPart.VISUAL_ID == visualID || de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer11EditPart.VISUAL_ID == visualID || de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.Entity2EditPart.VISUAL_ID == visualID || de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer12EditPart.VISUAL_ID == visualID; } /** * @generated */ protected boolean provides(CreateEdgeViewOperation op) { IElementType elementType = getSemanticElementType(op .getSemanticAdapter()); if (!de.uni_mannheim.informatik.swt.models.plm.diagram.providers.PLMElementTypes .isKnownElementType(elementType) || (!(elementType instanceof IHintedType))) { return false; // foreign element type } String elementTypeHint = ((IHintedType) elementType).getSemanticHint(); if (elementTypeHint == null || (op.getSemanticHint() != null && !elementTypeHint.equals(op .getSemanticHint()))) { return false; // our hint is visual id and must be specified, and it should be the same as in element type } int visualID = de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getVisualID(elementTypeHint); EObject domainElement = getSemanticElement(op.getSemanticAdapter()); if (domainElement != null && visualID != de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getLinkWithClassVisualID(domainElement)) { return false; // visual id for link EClass should match visual id from element type } return true; } /** * @generated */ public Diagram createDiagram(IAdaptable semanticAdapter, String diagramKind, PreferencesHint preferencesHint) { Diagram diagram = NotationFactory.eINSTANCE.createDiagram(); diagram.getStyles().add(NotationFactory.eINSTANCE.createDiagramStyle()); diagram.setType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.DomainEditPart.MODEL_ID); diagram.setElement(getSemanticElement(semanticAdapter)); diagram.setMeasurementUnit(MeasurementUnit.PIXEL_LITERAL); return diagram; } /** * @generated */ public Node createNode(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) { final EObject domainElement = getSemanticElement(semanticAdapter); final int visualID; if (semanticHint == null) { visualID = de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getNodeVisualID(containerView, domainElement); } else { visualID = de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getVisualID(semanticHint); } switch (visualID) { case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.OntologyEditPart.VISUAL_ID: return createOntology_2003(domainElement, containerView, index, persisted, preferencesHint); case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.EnumerationEditPart.VISUAL_ID: return createEnumeration_3095(domainElement, containerView, index, persisted, preferencesHint); case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.ModelEditPart.VISUAL_ID: return createModel_3059(domainElement, containerView, index, persisted, preferencesHint); case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizerEditPart.VISUAL_ID: return createLMLVisualizer_3073(domainElement, containerView, index, persisted, preferencesHint); case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.ConnectionEditPart.VISUAL_ID: return createConnection_3060(domainElement, containerView, index, persisted, preferencesHint); case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.AttributeEditPart.VISUAL_ID: return createAttribute_3061(domainElement, containerView, index, persisted, preferencesHint); case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer2EditPart.VISUAL_ID: return createLMLVisualizer_3074(domainElement, containerView, index, persisted, preferencesHint); case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.MethodEditPart.VISUAL_ID: return createMethod_3062(domainElement, containerView, index, persisted, preferencesHint); case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer3EditPart.VISUAL_ID: return createLMLVisualizer_3075(domainElement, containerView, index, persisted, preferencesHint); case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer4EditPart.VISUAL_ID: return createLMLVisualizer_3076(domainElement, containerView, index, persisted, preferencesHint); case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.EntityEditPart.VISUAL_ID: return createEntity_3085(domainElement, containerView, index, persisted, preferencesHint); case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.Attribute2EditPart.VISUAL_ID: return createAttribute_3070(domainElement, containerView, index, persisted, preferencesHint); case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer5EditPart.VISUAL_ID: return createLMLVisualizer_3077(domainElement, containerView, index, persisted, preferencesHint); case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.Method2EditPart.VISUAL_ID: return createMethod_3071(domainElement, containerView, index, persisted, preferencesHint); case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer6EditPart.VISUAL_ID: return createLMLVisualizer_3078(domainElement, containerView, index, persisted, preferencesHint); case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer7EditPart.VISUAL_ID: return createLMLVisualizer_3079(domainElement, containerView, index, persisted, preferencesHint); case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.Connection2EditPart.VISUAL_ID: return createConnection_3086(domainElement, containerView, index, persisted, preferencesHint); case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.ComplementEditPart.VISUAL_ID: return createComplement_3063(domainElement, containerView, index, persisted, preferencesHint); case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer8EditPart.VISUAL_ID: return createLMLVisualizer_3080(domainElement, containerView, index, persisted, preferencesHint); case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.EqualityEditPart.VISUAL_ID: return createEquality_3064(domainElement, containerView, index, persisted, preferencesHint); case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer9EditPart.VISUAL_ID: return createLMLVisualizer_3081(domainElement, containerView, index, persisted, preferencesHint); case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.InversionEditPart.VISUAL_ID: return createInversion_3065(domainElement, containerView, index, persisted, preferencesHint); case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer10EditPart.VISUAL_ID: return createLMLVisualizer_3082(domainElement, containerView, index, persisted, preferencesHint); case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.GeneralizationEditPart.VISUAL_ID: return createGeneralization_3072(domainElement, containerView, index, persisted, preferencesHint); case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer11EditPart.VISUAL_ID: return createLMLVisualizer_3083(domainElement, containerView, index, persisted, preferencesHint); case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.Entity2EditPart.VISUAL_ID: return createEntity_3069(domainElement, containerView, index, persisted, preferencesHint); case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer12EditPart.VISUAL_ID: return createLMLVisualizer_3094(domainElement, containerView, index, persisted, preferencesHint); } // can't happen, provided #provides(CreateNodeViewOperation) is correct return null; } /** * @generated */ public Edge createEdge(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) { IElementType elementType = getSemanticElementType(semanticAdapter); String elementTypeHint = ((IHintedType) elementType).getSemanticHint(); switch (de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getVisualID(elementTypeHint)) { case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.ClassificationEditPart.VISUAL_ID: return createClassification_4002( getSemanticElement(semanticAdapter), containerView, index, persisted, preferencesHint); case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.SetRelationshipBaseEditPart.VISUAL_ID: return createSetRelationshipBase_4013(containerView, index, persisted, preferencesHint); case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.EqualityEqualEditPart.VISUAL_ID: return createEqualityEqual_4018(containerView, index, persisted, preferencesHint); case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.InversionInverseEditPart.VISUAL_ID: return createInversionInverse_4015(containerView, index, persisted, preferencesHint); case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.ComplementComplementEditPart.VISUAL_ID: return createComplementComplement_4016(containerView, index, persisted, preferencesHint); case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.GeneralizationSupertypeEditPart.VISUAL_ID: return createGeneralizationSupertype_4022(containerView, index, persisted, preferencesHint); case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.GeneralizationSubtypeEditPart.VISUAL_ID: return createGeneralizationSubtype_4023(containerView, index, persisted, preferencesHint); case de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.ParticipationEditPart.VISUAL_ID: return createParticipation_4025( getSemanticElement(semanticAdapter), containerView, index, persisted, preferencesHint); } // can never happen, provided #provides(CreateEdgeViewOperation) is correct return null; } /** * @generated */ public Node createOntology_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.createFontStyle()); node.getStyles().add(NotationFactory.eINSTANCE.createFillStyle()); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.OntologyEditPart.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 label5246 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.OntologyNameEditPart.VISUAL_ID)); Node label5247 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabelEditPart.VISUAL_ID)); createCompartment( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.OntologyOntologyEnumerationCompartmentEditPart.VISUAL_ID), true, false, true, true); createCompartment( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.OntologyOntologyModelCompartmentEditPart.VISUAL_ID), false, false, true, true); return node; } /** * @generated */ public Node createEnumeration_3095(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.EnumerationEditPart.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 label5244 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.EnumerationNameEditPart.VISUAL_ID)); Node label5245 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.EnumerationLiteralsEditPart.VISUAL_ID)); return node; } /** * @generated */ public Node createModel_3059(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.ModelEditPart.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 label5191 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.ModelNameEditPart.VISUAL_ID)); Node label5192 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel2EditPart.VISUAL_ID)); createCompartment( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.ModelDomainElementsCompartmentEditPart.VISUAL_ID), true, false, false, false); return node; } /** * @generated */ public Node createLMLVisualizer_3073(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizerEditPart.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 label5199 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel3EditPart.VISUAL_ID)); Node label5200 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel4EditPart.VISUAL_ID)); //********************** //Custom Code //********************** //Ontology LMLVisualizers are the only one effected by their direct container if (domainElement.eContainer() != null && domainElement.eContainer() instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Ontology) { if (((de.uni_mannheim.informatik.swt.models.plm.PLM.Context) domainElement .eContainer()).getVisualizersShown().equalsIgnoreCase( "none")) node.setVisible(false); return node; } //Code to determine visibility EObject parent = domainElement.eContainer(); while (parent != null) { parent = parent.eContainer(); //We found a ContextContainer that is not the direct parent. if (parent != domainElement.eContainer() && parent instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Context) break; } if ((parent != null) && parent instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Context) { if (((de.uni_mannheim.informatik.swt.models.plm.PLM.Context) parent) .getVisualizersShown().equalsIgnoreCase("none")) node.setVisible(false); } return node; } /** * @generated */ public Node createConnection_3060(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(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.ConnectionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); // 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 label5162 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel5EditPart.VISUAL_ID)); Node label5163 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.ConnectionNameEditPart.VISUAL_ID)); label5163.setLayoutConstraint(NotationFactory.eINSTANCE .createLocation()); Location location5163 = (Location) label5163.getLayoutConstraint(); location5163.setX(0); location5163.setY(5); Node label5164 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel6EditPart.VISUAL_ID)); Node label5165 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel7EditPart.VISUAL_ID)); Node label5166 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel8EditPart.VISUAL_ID)); Node label5194 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel9EditPart.VISUAL_ID)); createCompartment( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.ConnectionConnectionAttributesCompartmentEditPart.VISUAL_ID), true, false, true, true); createCompartment( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.ConnectionConnectionMethodsCompartmentEditPart.VISUAL_ID), true, false, true, true); createCompartment( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.ConnectionConnectionVisualizersCompartmentEditPart.VISUAL_ID), true, false, true, true); createCompartment( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.ConnectionConnectionContentsCompartmentEditPart.VISUAL_ID), true, false, true, true); return node; } /** * @generated */ public Node createAttribute_3061(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.AttributeEditPart.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 label5153 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.AttributeNameEditPart.VISUAL_ID)); Node label5154 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel10EditPart.VISUAL_ID)); Node label5155 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel11EditPart.VISUAL_ID)); Node label5156 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel12EditPart.VISUAL_ID)); Node label5157 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel13EditPart.VISUAL_ID)); return node; } /** * @generated */ public Node createLMLVisualizer_3074(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer2EditPart.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 label5201 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel14EditPart.VISUAL_ID)); Node label5202 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel15EditPart.VISUAL_ID)); //********************** //Custom Code //********************** //Ontology LMLVisualizers are the only one effected by their direct container if (domainElement.eContainer() != null && domainElement.eContainer() instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Ontology) { if (((de.uni_mannheim.informatik.swt.models.plm.PLM.Context) domainElement .eContainer()).getVisualizersShown().equalsIgnoreCase( "none")) node.setVisible(false); return node; } //Code to determine visibility EObject parent = domainElement.eContainer(); while (parent != null) { parent = parent.eContainer(); //We found a ContextContainer that is not the direct parent. if (parent != domainElement.eContainer() && parent instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Context) break; } if ((parent != null) && parent instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Context) { if (((de.uni_mannheim.informatik.swt.models.plm.PLM.Context) parent) .getVisualizersShown().equalsIgnoreCase("none")) node.setVisible(false); } return node; } /** * @generated */ public Node createMethod_3062(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.MethodEditPart.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 label5158 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.MethodNameEditPart.VISUAL_ID)); Node label5159 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel16EditPart.VISUAL_ID)); Node label5160 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel17EditPart.VISUAL_ID)); Node label5161 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel18EditPart.VISUAL_ID)); return node; } /** * @generated */ public Node createLMLVisualizer_3075(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer3EditPart.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 label5203 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel19EditPart.VISUAL_ID)); Node label5204 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel20EditPart.VISUAL_ID)); //********************** //Custom Code //********************** //Ontology LMLVisualizers are the only one effected by their direct container if (domainElement.eContainer() != null && domainElement.eContainer() instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Ontology) { if (((de.uni_mannheim.informatik.swt.models.plm.PLM.Context) domainElement .eContainer()).getVisualizersShown().equalsIgnoreCase( "none")) node.setVisible(false); return node; } //Code to determine visibility EObject parent = domainElement.eContainer(); while (parent != null) { parent = parent.eContainer(); //We found a ContextContainer that is not the direct parent. if (parent != domainElement.eContainer() && parent instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Context) break; } if ((parent != null) && parent instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Context) { if (((de.uni_mannheim.informatik.swt.models.plm.PLM.Context) parent) .getVisualizersShown().equalsIgnoreCase("none")) node.setVisible(false); } return node; } /** * @generated */ public Node createLMLVisualizer_3076(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer4EditPart.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 label5205 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel21EditPart.VISUAL_ID)); Node label5206 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel22EditPart.VISUAL_ID)); //********************** //Custom Code //********************** //Ontology LMLVisualizers are the only one effected by their direct container if (domainElement.eContainer() != null && domainElement.eContainer() instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Ontology) { if (((de.uni_mannheim.informatik.swt.models.plm.PLM.Context) domainElement .eContainer()).getVisualizersShown().equalsIgnoreCase( "none")) node.setVisible(false); return node; } //Code to determine visibility EObject parent = domainElement.eContainer(); while (parent != null) { parent = parent.eContainer(); //We found a ContextContainer that is not the direct parent. if (parent != domainElement.eContainer() && parent instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Context) break; } if ((parent != null) && parent instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Context) { if (((de.uni_mannheim.informatik.swt.models.plm.PLM.Context) parent) .getVisualizersShown().equalsIgnoreCase("none")) node.setVisible(false); } return node; } /** * @generated */ public Node createEntity_3085(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(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.EntityEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); // 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 label5223 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel23EditPart.VISUAL_ID)); Node label5224 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel24EditPart.VISUAL_ID)); Node label5225 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel25EditPart.VISUAL_ID)); Node label5226 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel26EditPart.VISUAL_ID)); Node label5227 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel27EditPart.VISUAL_ID)); label5227.getStyles().add( NotationFactory.eINSTANCE.createDescriptionStyle()); Node label5228 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.ConnectionNameExternalLabelEditPart.VISUAL_ID)); label5228.getStyles().add( NotationFactory.eINSTANCE.createDescriptionStyle()); label5228.setLayoutConstraint(NotationFactory.eINSTANCE .createLocation()); Location location5228 = (Location) label5228.getLayoutConstraint(); location5228.setX(0); location5228.setY(5); createCompartment( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.EntityEntityAttributesCompartmentEditPart.VISUAL_ID), true, false, true, true); createCompartment( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.EntityEntityMethodsCompartmentEditPart.VISUAL_ID), true, false, true, true); createCompartment( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.EntityEntityContentsCompartmentEditPart.VISUAL_ID), true, false, true, true); return node; } /** * @generated */ public Node createAttribute_3070(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.Attribute2EditPart.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 label5178 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.AttributeName2EditPart.VISUAL_ID)); Node label5179 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel28EditPart.VISUAL_ID)); Node label5180 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel29EditPart.VISUAL_ID)); Node label5181 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel30EditPart.VISUAL_ID)); Node label5182 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel31EditPart.VISUAL_ID)); return node; } /** * @generated */ public Node createLMLVisualizer_3077(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer5EditPart.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 label5207 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel32EditPart.VISUAL_ID)); Node label5208 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel33EditPart.VISUAL_ID)); //********************** //Custom Code //********************** //Ontology LMLVisualizers are the only one effected by their direct container if (domainElement.eContainer() != null && domainElement.eContainer() instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Ontology) { if (((de.uni_mannheim.informatik.swt.models.plm.PLM.Context) domainElement .eContainer()).getVisualizersShown().equalsIgnoreCase( "none")) node.setVisible(false); return node; } //Code to determine visibility EObject parent = domainElement.eContainer(); while (parent != null) { parent = parent.eContainer(); //We found a ContextContainer that is not the direct parent. if (parent != domainElement.eContainer() && parent instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Context) break; } if ((parent != null) && parent instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Context) { if (((de.uni_mannheim.informatik.swt.models.plm.PLM.Context) parent) .getVisualizersShown().equalsIgnoreCase("none")) node.setVisible(false); } return node; } /** * @generated */ public Node createMethod_3071(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.Method2EditPart.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 label5183 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.MethodName2EditPart.VISUAL_ID)); Node label5184 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel34EditPart.VISUAL_ID)); Node label5185 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel35EditPart.VISUAL_ID)); Node label5186 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel36EditPart.VISUAL_ID)); return node; } /** * @generated */ public Node createLMLVisualizer_3078(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer6EditPart.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 label5209 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel37EditPart.VISUAL_ID)); Node label5210 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel38EditPart.VISUAL_ID)); //********************** //Custom Code //********************** //Ontology LMLVisualizers are the only one effected by their direct container if (domainElement.eContainer() != null && domainElement.eContainer() instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Ontology) { if (((de.uni_mannheim.informatik.swt.models.plm.PLM.Context) domainElement .eContainer()).getVisualizersShown().equalsIgnoreCase( "none")) node.setVisible(false); return node; } //Code to determine visibility EObject parent = domainElement.eContainer(); while (parent != null) { parent = parent.eContainer(); //We found a ContextContainer that is not the direct parent. if (parent != domainElement.eContainer() && parent instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Context) break; } if ((parent != null) && parent instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Context) { if (((de.uni_mannheim.informatik.swt.models.plm.PLM.Context) parent) .getVisualizersShown().equalsIgnoreCase("none")) node.setVisible(false); } return node; } /** * @generated */ public Node createLMLVisualizer_3079(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer7EditPart.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 label5211 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel39EditPart.VISUAL_ID)); Node label5212 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel40EditPart.VISUAL_ID)); //********************** //Custom Code //********************** //Ontology LMLVisualizers are the only one effected by their direct container if (domainElement.eContainer() != null && domainElement.eContainer() instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Ontology) { if (((de.uni_mannheim.informatik.swt.models.plm.PLM.Context) domainElement .eContainer()).getVisualizersShown().equalsIgnoreCase( "none")) node.setVisible(false); return node; } //Code to determine visibility EObject parent = domainElement.eContainer(); while (parent != null) { parent = parent.eContainer(); //We found a ContextContainer that is not the direct parent. if (parent != domainElement.eContainer() && parent instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Context) break; } if ((parent != null) && parent instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Context) { if (((de.uni_mannheim.informatik.swt.models.plm.PLM.Context) parent) .getVisualizersShown().equalsIgnoreCase("none")) node.setVisible(false); } return node; } /** * @generated */ public Node createConnection_3086(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(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.Connection2EditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); // 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 label5229 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel41EditPart.VISUAL_ID)); Node label5230 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.ConnectionName2EditPart.VISUAL_ID)); label5230.setLayoutConstraint(NotationFactory.eINSTANCE .createLocation()); Location location5230 = (Location) label5230.getLayoutConstraint(); location5230.setX(0); location5230.setY(5); Node label5231 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel42EditPart.VISUAL_ID)); Node label5232 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel43EditPart.VISUAL_ID)); Node label5233 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel44EditPart.VISUAL_ID)); Node label5234 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel45EditPart.VISUAL_ID)); createCompartment( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.ConnectionConnectionAttributesCompartment2EditPart.VISUAL_ID), true, false, true, true); createCompartment( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.ConnectionConnectionMethodsCompartment2EditPart.VISUAL_ID), true, false, true, true); createCompartment( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.ConnectionConnectionVisualizersCompartment2EditPart.VISUAL_ID), true, false, true, true); createCompartment( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.ConnectionConnectionContentsCompartment2EditPart.VISUAL_ID), true, false, true, true); return node; } /** * @generated */ public Node createComplement_3063(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(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.ComplementEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); // 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 label5167 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel46EditPart.VISUAL_ID)); return node; } /** * @generated */ public Node createLMLVisualizer_3080(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer8EditPart.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 label5213 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel47EditPart.VISUAL_ID)); Node label5214 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel48EditPart.VISUAL_ID)); //********************** //Custom Code //********************** //Ontology LMLVisualizers are the only one effected by their direct container if (domainElement.eContainer() != null && domainElement.eContainer() instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Ontology) { if (((de.uni_mannheim.informatik.swt.models.plm.PLM.Context) domainElement .eContainer()).getVisualizersShown().equalsIgnoreCase( "none")) node.setVisible(false); return node; } //Code to determine visibility EObject parent = domainElement.eContainer(); while (parent != null) { parent = parent.eContainer(); //We found a ContextContainer that is not the direct parent. if (parent != domainElement.eContainer() && parent instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Context) break; } if ((parent != null) && parent instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Context) { if (((de.uni_mannheim.informatik.swt.models.plm.PLM.Context) parent) .getVisualizersShown().equalsIgnoreCase("none")) node.setVisible(false); } return node; } /** * @generated */ public Node createEquality_3064(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(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.EqualityEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); // 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 label5168 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.EqualityNameEditPart.VISUAL_ID)); return node; } /** * @generated */ public Node createLMLVisualizer_3081(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer9EditPart.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 label5215 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel49EditPart.VISUAL_ID)); Node label5216 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel50EditPart.VISUAL_ID)); //********************** //Custom Code //********************** //Ontology LMLVisualizers are the only one effected by their direct container if (domainElement.eContainer() != null && domainElement.eContainer() instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Ontology) { if (((de.uni_mannheim.informatik.swt.models.plm.PLM.Context) domainElement .eContainer()).getVisualizersShown().equalsIgnoreCase( "none")) node.setVisible(false); return node; } //Code to determine visibility EObject parent = domainElement.eContainer(); while (parent != null) { parent = parent.eContainer(); //We found a ContextContainer that is not the direct parent. if (parent != domainElement.eContainer() && parent instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Context) break; } if ((parent != null) && parent instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Context) { if (((de.uni_mannheim.informatik.swt.models.plm.PLM.Context) parent) .getVisualizersShown().equalsIgnoreCase("none")) node.setVisible(false); } return node; } /** * @generated */ public Node createInversion_3065(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(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.InversionEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); // 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 label5169 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel51EditPart.VISUAL_ID)); return node; } /** * @generated */ public Node createLMLVisualizer_3082(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer10EditPart.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 label5217 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel52EditPart.VISUAL_ID)); Node label5218 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel53EditPart.VISUAL_ID)); //********************** //Custom Code //********************** //Ontology LMLVisualizers are the only one effected by their direct container if (domainElement.eContainer() != null && domainElement.eContainer() instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Ontology) { if (((de.uni_mannheim.informatik.swt.models.plm.PLM.Context) domainElement .eContainer()).getVisualizersShown().equalsIgnoreCase( "none")) node.setVisible(false); return node; } //Code to determine visibility EObject parent = domainElement.eContainer(); while (parent != null) { parent = parent.eContainer(); //We found a ContextContainer that is not the direct parent. if (parent != domainElement.eContainer() && parent instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Context) break; } if ((parent != null) && parent instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Context) { if (((de.uni_mannheim.informatik.swt.models.plm.PLM.Context) parent) .getVisualizersShown().equalsIgnoreCase("none")) node.setVisible(false); } return node; } /** * @generated */ public Node createGeneralization_3072(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(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.GeneralizationEditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); // 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 label5196 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.GeneralizationNameEditPart.VISUAL_ID)); Node label5197 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.GeneralizationName2EditPart.VISUAL_ID)); label5197.setLayoutConstraint(NotationFactory.eINSTANCE .createLocation()); Location location5197 = (Location) label5197.getLayoutConstraint(); location5197.setX(0); location5197.setY(5); Node label5198 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel54EditPart.VISUAL_ID)); return node; } /** * @generated */ public Node createLMLVisualizer_3083(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer11EditPart.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 label5219 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel55EditPart.VISUAL_ID)); Node label5220 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel56EditPart.VISUAL_ID)); //********************** //Custom Code //********************** //Ontology LMLVisualizers are the only one effected by their direct container if (domainElement.eContainer() != null && domainElement.eContainer() instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Ontology) { if (((de.uni_mannheim.informatik.swt.models.plm.PLM.Context) domainElement .eContainer()).getVisualizersShown().equalsIgnoreCase( "none")) node.setVisible(false); return node; } //Code to determine visibility EObject parent = domainElement.eContainer(); while (parent != null) { parent = parent.eContainer(); //We found a ContextContainer that is not the direct parent. if (parent != domainElement.eContainer() && parent instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Context) break; } if ((parent != null) && parent instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Context) { if (((de.uni_mannheim.informatik.swt.models.plm.PLM.Context) parent) .getVisualizersShown().equalsIgnoreCase("none")) node.setVisible(false); } return node; } /** * @generated */ public Node createEntity_3069(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(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.Entity2EditPart.VISUAL_ID)); ViewUtil.insertChildView(containerView, node, index, persisted); node.setElement(domainElement); // 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 label5187 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel57EditPart.VISUAL_ID)); Node label5188 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel58EditPart.VISUAL_ID)); Node label5189 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel59EditPart.VISUAL_ID)); Node label5190 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel60EditPart.VISUAL_ID)); Node label5193 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel61EditPart.VISUAL_ID)); label5193.getStyles().add( NotationFactory.eINSTANCE.createDescriptionStyle()); Node label5195 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.ConnectionNameExternalLabel2EditPart.VISUAL_ID)); label5195.getStyles().add( NotationFactory.eINSTANCE.createDescriptionStyle()); label5195.setLayoutConstraint(NotationFactory.eINSTANCE .createLocation()); Location location5195 = (Location) label5195.getLayoutConstraint(); location5195.setX(0); location5195.setY(5); createCompartment( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.EntityEntityAttributesCompartment2EditPart.VISUAL_ID), true, false, true, true); createCompartment( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.EntityEntityMethodsCompartment2EditPart.VISUAL_ID), true, false, true, true); createCompartment( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.EntityEntityContentsCompartment2EditPart.VISUAL_ID), true, false, true, true); return node; } /** * @generated */ public Node createLMLVisualizer_3094(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) { Shape node = NotationFactory.eINSTANCE.createShape(); node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds()); node.setType(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.LMLVisualizer12EditPart.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 label5242 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel62EditPart.VISUAL_ID)); Node label5243 = createLabel( node, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel63EditPart.VISUAL_ID)); //********************** //Custom Code //********************** //Ontology LMLVisualizers are the only one effected by their direct container if (domainElement.eContainer() != null && domainElement.eContainer() instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Ontology) { if (((de.uni_mannheim.informatik.swt.models.plm.PLM.Context) domainElement .eContainer()).getVisualizersShown().equalsIgnoreCase( "none")) node.setVisible(false); return node; } //Code to determine visibility EObject parent = domainElement.eContainer(); while (parent != null) { parent = parent.eContainer(); //We found a ContextContainer that is not the direct parent. if (parent != domainElement.eContainer() && parent instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Context) break; } if ((parent != null) && parent instanceof de.uni_mannheim.informatik.swt.models.plm.PLM.Context) { if (((de.uni_mannheim.informatik.swt.models.plm.PLM.Context) parent) .getVisualizersShown().equalsIgnoreCase("none")) node.setVisible(false); } return node; } /** * @generated */ public Edge createClassification_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(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.ClassificationEditPart.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 label6010 = createLabel( edge, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel64EditPart.VISUAL_ID)); label6010.setLayoutConstraint(NotationFactory.eINSTANCE .createLocation()); Location location6010 = (Location) label6010.getLayoutConstraint(); location6010.setX(10); location6010.setY(10); Node label6011 = createLabel( edge, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel65EditPart.VISUAL_ID)); label6011.setLayoutConstraint(NotationFactory.eINSTANCE .createLocation()); Location location6011 = (Location) label6011.getLayoutConstraint(); location6011.setX(10); location6011.setY(10); //********************** //Custom Code //********************** //Check if proximity indication is used -> hide classification de.uni_mannheim.informatik.swt.models.plm.PLM.Classification i = (de.uni_mannheim.informatik.swt.models.plm.PLM.Classification) domainElement; if (i.getInstance().getVisualizer().size() > 0) { de.uni_mannheim.informatik.swt.models.plm.PLM.LMLVisualizer v = i .getInstance().getVisualizer().get(0); if ("1".equals(v.getValueForKey("ProximityClassification"))) edge.setVisible(false); } return edge; } /** * @generated */ public Edge createSetRelationshipBase_4013(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(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.SetRelationshipBaseEditPart.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); } Node label6006 = createLabel( edge, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel66EditPart.VISUAL_ID)); label6006.setLayoutConstraint(NotationFactory.eINSTANCE .createLocation()); Location location6006 = (Location) label6006.getLayoutConstraint(); location6006.setX(0); location6006.setY(10); return edge; } /** * @generated */ public Edge createEqualityEqual_4018(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(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.EqualityEqualEditPart.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); } Node label6007 = createLabel( edge, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel67EditPart.VISUAL_ID)); label6007.setLayoutConstraint(NotationFactory.eINSTANCE .createLocation()); Location location6007 = (Location) label6007.getLayoutConstraint(); location6007.setX(0); location6007.setY(10); return edge; } /** * @generated */ public Edge createInversionInverse_4015(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(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.InversionInverseEditPart.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); } Node label6008 = createLabel( edge, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel68EditPart.VISUAL_ID)); label6008.setLayoutConstraint(NotationFactory.eINSTANCE .createLocation()); Location location6008 = (Location) label6008.getLayoutConstraint(); location6008.setX(0); location6008.setY(10); return edge; } /** * @generated */ public Edge createComplementComplement_4016(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(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.ComplementComplementEditPart.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); } Node label6009 = createLabel( edge, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel69EditPart.VISUAL_ID)); label6009.setLayoutConstraint(NotationFactory.eINSTANCE .createLocation()); Location location6009 = (Location) label6009.getLayoutConstraint(); location6009.setX(0); location6009.setY(10); return edge; } /** * @generated */ public Edge createGeneralizationSupertype_4022(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(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.GeneralizationSupertypeEditPart.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; } /** * @generated */ public Edge createGeneralizationSubtype_4023(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(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.GeneralizationSubtypeEditPart.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; } /** * @generated */ public Edge createParticipation_4025(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(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.ParticipationEditPart.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 label6014 = createLabel( edge, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel70EditPart.VISUAL_ID)); label6014.setLayoutConstraint(NotationFactory.eINSTANCE .createLocation()); Location location6014 = (Location) label6014.getLayoutConstraint(); location6014.setX(-10); location6014.setY(-10); Node label6015 = createLabel( edge, de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getType(de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.WrappingLabel71EditPart.VISUAL_ID)); label6015.setLayoutConstraint(NotationFactory.eINSTANCE .createLocation()); Location location6015 = (Location) label6015.getLayoutConstraint(); location6015.setX(10); location6015.setY(10); return edge; } /** * @generated */ private void stampShortcut(View containerView, Node target) { if (!de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.DomainEditPart.MODEL_ID .equals(de.uni_mannheim.informatik.swt.models.plm.diagram.part.PLMVisualIDRegistry .getModelID(containerView))) { EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE .createEAnnotation(); shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$ shortcutAnnotation .getDetails() .put("modelID", de.uni_mannheim.informatik.swt.models.plm.diagram.edit.parts.DomainEditPart.MODEL_ID); //$NON-NLS-1$ target.getEAnnotations().add(shortcutAnnotation); } } /** * @generated */ private Node createLabel(View owner, String hint) { DecorationNode rv = NotationFactory.eINSTANCE.createDecorationNode(); rv.setType(hint); ViewUtil.insertChildView(owner, rv, ViewUtil.APPEND, true); return rv; } /** * @generated */ private Node createCompartment(View owner, String hint, boolean canCollapse, boolean hasTitle, boolean canSort, boolean canFilter) { //SemanticListCompartment rv = NotationFactory.eINSTANCE.createSemanticListCompartment(); //rv.setShowTitle(showTitle); //rv.setCollapsed(isCollapsed); Node rv; if (canCollapse) { rv = NotationFactory.eINSTANCE.createBasicCompartment(); } else { rv = NotationFactory.eINSTANCE.createDecorationNode(); } if (hasTitle) { TitleStyle ts = NotationFactory.eINSTANCE.createTitleStyle(); ts.setShowTitle(true); rv.getStyles().add(ts); } if (canSort) { rv.getStyles().add(NotationFactory.eINSTANCE.createSortingStyle()); } if (canFilter) { rv.getStyles() .add(NotationFactory.eINSTANCE.createFilteringStyle()); } rv.setType(hint); ViewUtil.insertChildView(owner, rv, ViewUtil.APPEND, true); return rv; } /** * @generated */ private EObject getSemanticElement(IAdaptable semanticAdapter) { if (semanticAdapter == null) { return null; } EObject eObject = (EObject) semanticAdapter.getAdapter(EObject.class); if (eObject != null) { return EMFCoreUtil.resolve( TransactionUtil.getEditingDomain(eObject), eObject); } return null; } /** * @generated */ private IElementType getSemanticElementType(IAdaptable semanticAdapter) { if (semanticAdapter == null) { return null; } return (IElementType) semanticAdapter.getAdapter(IElementType.class); } }