package org.eclipse.uml2.diagram.component.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.CanonicalStyle;
import org.eclipse.gmf.runtime.notation.Connector;
import org.eclipse.gmf.runtime.notation.DecorationNode;
import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.gmf.runtime.notation.DrawerStyle;
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;
import org.eclipse.uml2.diagram.common.notation.u2tnotation.U2TDiagramCanonicalStyle;
import org.eclipse.uml2.diagram.common.notation.u2tnotation.U2TNotationFactory;
import org.eclipse.uml2.diagram.common.view.ViewProviderUtils;
import org.eclipse.uml2.diagram.component.edit.parts.Artifact2EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.Artifact3EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.ArtifactContents2EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.ArtifactContents3EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.ArtifactContentsEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.ArtifactEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.ArtifactName2EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.ArtifactName3EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.ArtifactNameEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.ArtifactStereo2EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.ArtifactStereo3EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.ArtifactStereoEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.AssemblyConnectorCircleEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.AssemblyConnectorEndRoleEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.AssociationEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.AssociationName2EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.AssociationName3EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.AssociationName4EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.AssociationName5EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.AssociationName6EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.AssociationName7EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.AssociationNameEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.Class2EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.Class3EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.Class4EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.ClassAttributesEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.ClassClassesEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.ClassDiagramNotationClassEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.ClassDiagramNotationClassNameEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.ClassDiagramNotationClassStereotypeEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.ClassDiagramNotationInnerClassEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.ClassDiagramNotationOperationEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.ClassDiagramNotationPropertyEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.ClassEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.ClassName2EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.ClassNameEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.ClassOperationsEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.CommentAnnotatedElementEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.CommentBodyEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.CommentEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.Component2EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.Component3EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.ComponentContents2EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.ComponentContentsEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.ComponentEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.ComponentName2EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.ComponentNameEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.ComponentRequiredEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.ComponentStereo2EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.ComponentStereoEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.ConnectorEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.DependencyEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.DependencyName2EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.DependencyNameEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.ElementImportEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.Interface2EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.Interface3EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.InterfaceAttributesEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.InterfaceClassesEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.InterfaceEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.InterfaceName2EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.InterfaceName3EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.InterfaceNameEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.InterfaceOperationsEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.InterfaceRealizationEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.InterfaceStereotypeEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.OperationEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.Package2EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.Package3EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.Package4EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.PackageClassifiersEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.PackageEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.PackageImportsEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.PackageName2EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.PackageNameEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.PackagePackagesEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.PackageStereo2EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.PortEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.PortName2EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.PortNameEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.PortOnClassEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.PortProvidedEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.PortRequiredEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.Property2EditPart;
import org.eclipse.uml2.diagram.component.edit.parts.PropertyEditPart;
import org.eclipse.uml2.diagram.component.edit.parts.PropertyNameEditPart;
import org.eclipse.uml2.diagram.component.part.UMLVisualIDRegistry;
/**
* @generated
*/
public class UMLViewProvider 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 PackageEditPart.MODEL_ID.equals(op.getSemanticHint()) && UMLVisualIDRegistry.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 = UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement);
} else {
visualID = UMLVisualIDRegistry.getVisualID(op.getSemanticHint());
if (elementType != null) {
if (!UMLElementTypes.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 && !UMLVisualIDRegistry.checkNodeVisualID(op.getContainerView(), domainElement, visualID)) {
return false; // visual id for node EClass should match visual id from element type, or at least be substitutable for it
}
} else {
if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(op.getContainerView()))) {
return false; // foreign diagram
}
switch (visualID) {
case Interface2EditPart.VISUAL_ID: {
if (domainElement == null) {
return false;
}
int suggestedID = UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement);
if (visualID != suggestedID && Interface3EditPart.VISUAL_ID != suggestedID && true) {
return false;
}
break;
}
case Class2EditPart.VISUAL_ID: {
if (domainElement == null) {
return false;
}
int suggestedID = UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement);
if (visualID != suggestedID && ClassDiagramNotationClassEditPart.VISUAL_ID != suggestedID && true) {
return false;
}
break;
}
case ClassDiagramNotationClassEditPart.VISUAL_ID: {
if (domainElement == null) {
return false;
}
int suggestedID = UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement);
if (visualID != suggestedID && Class2EditPart.VISUAL_ID != suggestedID && true) {
return false;
}
break;
}
case Interface3EditPart.VISUAL_ID: {
if (domainElement == null) {
return false;
}
int suggestedID = UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement);
if (visualID != suggestedID && Interface2EditPart.VISUAL_ID != suggestedID && true) {
return false;
}
break;
}
case ComponentEditPart.VISUAL_ID:
case CommentEditPart.VISUAL_ID:
case PortEditPart.VISUAL_ID:
case ArtifactEditPart.VISUAL_ID:
case ClassEditPart.VISUAL_ID:
case InterfaceEditPart.VISUAL_ID:
case PropertyEditPart.VISUAL_ID:
case AssemblyConnectorCircleEditPart.VISUAL_ID:
case ElementImportEditPart.VISUAL_ID:
case ClassDiagramNotationOperationEditPart.VISUAL_ID:
case Artifact2EditPart.VISUAL_ID:
case Package2EditPart.VISUAL_ID:
case Package3EditPart.VISUAL_ID:
case Component2EditPart.VISUAL_ID:
case Artifact3EditPart.VISUAL_ID:
case Package4EditPart.VISUAL_ID:
case Class3EditPart.VISUAL_ID:
case Component3EditPart.VISUAL_ID:
case ClassDiagramNotationPropertyEditPart.VISUAL_ID:
case ClassDiagramNotationInnerClassEditPart.VISUAL_ID:
case PortOnClassEditPart.VISUAL_ID:
case Property2EditPart.VISUAL_ID:
case OperationEditPart.VISUAL_ID:
case Class4EditPart.VISUAL_ID:
if (domainElement == null || visualID != UMLVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement)) {
return false; // visual id in semantic hint should match visual id for domain element
}
break;
default:
return false;
}
}
}
return ComponentEditPart.VISUAL_ID == visualID || Artifact2EditPart.VISUAL_ID == visualID || Interface2EditPart.VISUAL_ID == visualID || Class2EditPart.VISUAL_ID == visualID
|| Package2EditPart.VISUAL_ID == visualID || Package3EditPart.VISUAL_ID == visualID || ClassDiagramNotationClassEditPart.VISUAL_ID == visualID || CommentEditPart.VISUAL_ID == visualID
|| Interface3EditPart.VISUAL_ID == visualID || Component2EditPart.VISUAL_ID == visualID || PortEditPart.VISUAL_ID == visualID || ArtifactEditPart.VISUAL_ID == visualID
|| Artifact3EditPart.VISUAL_ID == visualID || ClassEditPart.VISUAL_ID == visualID || InterfaceEditPart.VISUAL_ID == visualID || PropertyEditPart.VISUAL_ID == visualID
|| AssemblyConnectorCircleEditPart.VISUAL_ID == visualID || ElementImportEditPart.VISUAL_ID == visualID || Package4EditPart.VISUAL_ID == visualID
|| Class3EditPart.VISUAL_ID == visualID || Component3EditPart.VISUAL_ID == visualID || ClassDiagramNotationPropertyEditPart.VISUAL_ID == visualID
|| ClassDiagramNotationOperationEditPart.VISUAL_ID == visualID || ClassDiagramNotationInnerClassEditPart.VISUAL_ID == visualID || PortOnClassEditPart.VISUAL_ID == visualID
|| Property2EditPart.VISUAL_ID == visualID || OperationEditPart.VISUAL_ID == visualID || Class4EditPart.VISUAL_ID == visualID;
}
/**
* @generated
*/
protected boolean provides(CreateEdgeViewOperation op) {
IElementType elementType = getSemanticElementType(op.getSemanticAdapter());
if (!UMLElementTypes.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 = UMLVisualIDRegistry.getVisualID(elementTypeHint);
EObject domainElement = getSemanticElement(op.getSemanticAdapter());
if (domainElement != null && visualID != UMLVisualIDRegistry.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());
U2TDiagramCanonicalStyle canonicalStyle_Package_1000 = U2TNotationFactory.eINSTANCE.createU2TDiagramCanonicalStyle();
canonicalStyle_Package_1000.setCanonical(true);
canonicalStyle_Package_1000.setSyncNodes(true);
canonicalStyle_Package_1000.setSyncLinks(true);
diagram.getStyles().add(canonicalStyle_Package_1000);
diagram.setType(PackageEditPart.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 = UMLVisualIDRegistry.getNodeVisualID(containerView, domainElement);
} else {
visualID = UMLVisualIDRegistry.getVisualID(semanticHint);
}
switch (visualID) {
case ComponentEditPart.VISUAL_ID:
return createComponent_2001(domainElement, containerView, index, persisted, preferencesHint);
case Artifact2EditPart.VISUAL_ID:
return createArtifact_2002(domainElement, containerView, index, persisted, preferencesHint);
case Interface2EditPart.VISUAL_ID:
return createInterface_2003(domainElement, containerView, index, persisted, preferencesHint);
case Class2EditPart.VISUAL_ID:
return createClass_2004(domainElement, containerView, index, persisted, preferencesHint);
case Package2EditPart.VISUAL_ID:
return createPackage_2005(domainElement, containerView, index, persisted, preferencesHint);
case Package3EditPart.VISUAL_ID:
return createPackage_2006(domainElement, containerView, index, persisted, preferencesHint);
case ClassDiagramNotationClassEditPart.VISUAL_ID:
return createClass_2007(domainElement, containerView, index, persisted, preferencesHint);
case CommentEditPart.VISUAL_ID:
return createComment_2008(domainElement, containerView, index, persisted, preferencesHint);
case Interface3EditPart.VISUAL_ID:
return createInterface_2009(domainElement, containerView, index, persisted, preferencesHint);
case Component2EditPart.VISUAL_ID:
return createComponent_3001(domainElement, containerView, index, persisted, preferencesHint);
case PortEditPart.VISUAL_ID:
return createPort_3002(domainElement, containerView, index, persisted, preferencesHint);
case ArtifactEditPart.VISUAL_ID:
return createArtifact_3003(domainElement, containerView, index, persisted, preferencesHint);
case Artifact3EditPart.VISUAL_ID:
return createArtifact_3016(domainElement, containerView, index, persisted, preferencesHint);
case ClassEditPart.VISUAL_ID:
return createClass_3004(domainElement, containerView, index, persisted, preferencesHint);
case InterfaceEditPart.VISUAL_ID:
return createInterface_3005(domainElement, containerView, index, persisted, preferencesHint);
case PropertyEditPart.VISUAL_ID:
return createProperty_3006(domainElement, containerView, index, persisted, preferencesHint);
case AssemblyConnectorCircleEditPart.VISUAL_ID:
return createConnector_3015(domainElement, containerView, index, persisted, preferencesHint);
case ElementImportEditPart.VISUAL_ID:
return createElementImport_3007(domainElement, containerView, index, persisted, preferencesHint);
case Package4EditPart.VISUAL_ID:
return createPackage_3008(domainElement, containerView, index, persisted, preferencesHint);
case Class3EditPart.VISUAL_ID:
return createClass_3009(domainElement, containerView, index, persisted, preferencesHint);
case Component3EditPart.VISUAL_ID:
return createComponent_3010(domainElement, containerView, index, persisted, preferencesHint);
case ClassDiagramNotationPropertyEditPart.VISUAL_ID:
return createProperty_3011(domainElement, containerView, index, persisted, preferencesHint);
case ClassDiagramNotationOperationEditPart.VISUAL_ID:
return createOperation_3012(domainElement, containerView, index, persisted, preferencesHint);
case ClassDiagramNotationInnerClassEditPart.VISUAL_ID:
return createClass_3013(domainElement, containerView, index, persisted, preferencesHint);
case PortOnClassEditPart.VISUAL_ID:
return createPort_3014(domainElement, containerView, index, persisted, preferencesHint);
case Property2EditPart.VISUAL_ID:
return createProperty_3017(domainElement, containerView, index, persisted, preferencesHint);
case OperationEditPart.VISUAL_ID:
return createOperation_3018(domainElement, containerView, index, persisted, preferencesHint);
case Class4EditPart.VISUAL_ID:
return createClass_3020(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 (UMLVisualIDRegistry.getVisualID(elementTypeHint)) {
case InterfaceRealizationEditPart.VISUAL_ID:
return createInterfaceRealization_4001(getSemanticElement(semanticAdapter), containerView, index, persisted, preferencesHint);
case PortProvidedEditPart.VISUAL_ID:
return createPortProvided_4006(containerView, index, persisted, preferencesHint);
case PortRequiredEditPart.VISUAL_ID:
return createPortRequired_4004(containerView, index, persisted, preferencesHint);
case ComponentRequiredEditPart.VISUAL_ID:
return createComponentRequired_4007(containerView, index, persisted, preferencesHint);
case ConnectorEditPart.VISUAL_ID:
return createConnector_4008(getSemanticElement(semanticAdapter), containerView, index, persisted, preferencesHint);
case DependencyEditPart.VISUAL_ID:
return createDependency_4009(getSemanticElement(semanticAdapter), containerView, index, persisted, preferencesHint);
case AssemblyConnectorEndRoleEditPart.VISUAL_ID:
return createConnectorEndRole_4010(containerView, index, persisted, preferencesHint);
case AssociationEditPart.VISUAL_ID:
return createAssociation_4011(getSemanticElement(semanticAdapter), containerView, index, persisted, preferencesHint);
case CommentAnnotatedElementEditPart.VISUAL_ID:
return createCommentAnnotatedElement_4012(containerView, index, persisted, preferencesHint);
}
// can never happen, provided #provides(CreateEdgeViewOperation) is correct
return null;
}
/**
* @generated
*/
public Node createComponent_2001(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Shape node = NotationFactory.eINSTANCE.createShape();
CanonicalStyle canonicalStyle_Component_2001 = NotationFactory.eINSTANCE.createCanonicalStyle();
canonicalStyle_Component_2001.setCanonical(true);
node.getStyles().add(canonicalStyle_Component_2001);
node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
node.setType(UMLVisualIDRegistry.getType(ComponentEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
// initializeFromPreferences
final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR);
ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB));
FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE);
if (nodeFontStyle != null) {
FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
nodeFontStyle.setFontName(fontData.getName());
nodeFontStyle.setFontHeight(fontData.getHeight());
nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR);
nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
}
org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FILL_COLOR);
ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB));
Node label5001 = createLabel(node, UMLVisualIDRegistry.getType(ComponentName2EditPart.VISUAL_ID));
Node label5020 = createLabel(node, UMLVisualIDRegistry.getType(ComponentStereoEditPart.VISUAL_ID));
Node compartment7001 = createCompartment(node, UMLVisualIDRegistry.getType(ComponentContentsEditPart.VISUAL_ID), true, false, false, false);
CanonicalStyle canonicalStyle_ComponentComponentFigure_contents_7001 = NotationFactory.eINSTANCE.createCanonicalStyle();
canonicalStyle_ComponentComponentFigure_contents_7001.setCanonical(true);
compartment7001.getStyles().add(canonicalStyle_ComponentComponentFigure_contents_7001);
return node;
}
/**
* @generated
*/
public Node createArtifact_2002(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Shape node = NotationFactory.eINSTANCE.createShape();
node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
node.setType(UMLVisualIDRegistry.getType(Artifact2EditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
// initializeFromPreferences
final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR);
ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB));
FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE);
if (nodeFontStyle != null) {
FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
nodeFontStyle.setFontName(fontData.getName());
nodeFontStyle.setFontHeight(fontData.getHeight());
nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR);
nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
}
org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FILL_COLOR);
ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB));
Node label5004 = createLabel(node, UMLVisualIDRegistry.getType(ArtifactName2EditPart.VISUAL_ID));
Node label5021 = createLabel(node, UMLVisualIDRegistry.getType(ArtifactStereoEditPart.VISUAL_ID));
Node compartment7011 = createCompartment(node, UMLVisualIDRegistry.getType(ArtifactContents3EditPart.VISUAL_ID), true, false, false, false);
CanonicalStyle canonicalStyle_ArtifactArtifactFigure_contents_7011 = NotationFactory.eINSTANCE.createCanonicalStyle();
canonicalStyle_ArtifactArtifactFigure_contents_7011.setCanonical(true);
compartment7011.getStyles().add(canonicalStyle_ArtifactArtifactFigure_contents_7011);
return node;
}
/**
* @generated
*/
public Node createInterface_2003(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Shape node = NotationFactory.eINSTANCE.createShape();
node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
node.setType(UMLVisualIDRegistry.getType(Interface2EditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
// initializeFromPreferences
final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR);
ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB));
FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE);
if (nodeFontStyle != null) {
FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
nodeFontStyle.setFontName(fontData.getName());
nodeFontStyle.setFontHeight(fontData.getHeight());
nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR);
nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
}
org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FILL_COLOR);
ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB));
Node label5005 = createLabel(node, UMLVisualIDRegistry.getType(InterfaceName2EditPart.VISUAL_ID));
label5005.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
Location location5005 = (Location) label5005.getLayoutConstraint();
location5005.setX(0);
location5005.setY(5);
return node;
}
/**
* @generated
*/
public Node createClass_2004(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Shape node = NotationFactory.eINSTANCE.createShape();
CanonicalStyle canonicalStyle_Class_2004 = NotationFactory.eINSTANCE.createCanonicalStyle();
canonicalStyle_Class_2004.setCanonical(true);
node.getStyles().add(canonicalStyle_Class_2004);
node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
node.setType(UMLVisualIDRegistry.getType(Class2EditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
// initializeFromPreferences
final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR);
ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB));
FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE);
if (nodeFontStyle != null) {
FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
nodeFontStyle.setFontName(fontData.getName());
nodeFontStyle.setFontHeight(fontData.getHeight());
nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR);
nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
}
org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FILL_COLOR);
ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB));
Node label5008 = createLabel(node, UMLVisualIDRegistry.getType(ClassName2EditPart.VISUAL_ID));
return node;
}
/**
* @generated
*/
public Node createPackage_2005(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Shape node = NotationFactory.eINSTANCE.createShape();
node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
node.setType(UMLVisualIDRegistry.getType(Package2EditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
// initializeFromPreferences
final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR);
ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB));
FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE);
if (nodeFontStyle != null) {
FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
nodeFontStyle.setFontName(fontData.getName());
nodeFontStyle.setFontHeight(fontData.getHeight());
nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR);
nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
}
org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FILL_COLOR);
ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB));
Node label5011 = createLabel(node, UMLVisualIDRegistry.getType(PackageNameEditPart.VISUAL_ID));
Node label5023 = createLabel(node, UMLVisualIDRegistry.getType(PackageStereo2EditPart.VISUAL_ID));
Node compartment7003 = createCompartment(node, UMLVisualIDRegistry.getType(PackageImportsEditPart.VISUAL_ID), true, false, true, true);
CanonicalStyle canonicalStyle_PackageImports_7003 = NotationFactory.eINSTANCE.createCanonicalStyle();
canonicalStyle_PackageImports_7003.setCanonical(true);
compartment7003.getStyles().add(canonicalStyle_PackageImports_7003);
DrawerStyle drawerStyle = (DrawerStyle) compartment7003.getStyle(NotationPackage.eINSTANCE.getDrawerStyle());
if (drawerStyle != null) {
//#216573 [SecondaryDiagramElement] Collapse imports compartment after creation
drawerStyle.setCollapsed(true);
}
return node;
}
/**
* @generated
*/
public Node createPackage_2006(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Shape node = NotationFactory.eINSTANCE.createShape();
node.getStyles().add(NotationFactory.eINSTANCE.createHintedDiagramLinkStyle());
node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
node.setType(UMLVisualIDRegistry.getType(Package3EditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
// initializeFromPreferences
final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR);
ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB));
FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE);
if (nodeFontStyle != null) {
FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
nodeFontStyle.setFontName(fontData.getName());
nodeFontStyle.setFontHeight(fontData.getHeight());
nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR);
nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
}
org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FILL_COLOR);
ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB));
Node label5012 = createLabel(node, UMLVisualIDRegistry.getType(PackageName2EditPart.VISUAL_ID));
Node compartment7004 = createCompartment(node, UMLVisualIDRegistry.getType(PackagePackagesEditPart.VISUAL_ID), true, true, true, true);
CanonicalStyle canonicalStyle_PackagePackages_7004 = NotationFactory.eINSTANCE.createCanonicalStyle();
canonicalStyle_PackagePackages_7004.setCanonical(true);
compartment7004.getStyles().add(canonicalStyle_PackagePackages_7004);
Node compartment7005 = createCompartment(node, UMLVisualIDRegistry.getType(PackageClassifiersEditPart.VISUAL_ID), true, true, true, true);
CanonicalStyle canonicalStyle_PackageClassifiers_7005 = NotationFactory.eINSTANCE.createCanonicalStyle();
canonicalStyle_PackageClassifiers_7005.setCanonical(true);
compartment7005.getStyles().add(canonicalStyle_PackageClassifiers_7005);
return node;
}
/**
* @generated
*/
public Node createClass_2007(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Shape node = NotationFactory.eINSTANCE.createShape();
CanonicalStyle canonicalStyle_Class_2007 = NotationFactory.eINSTANCE.createCanonicalStyle();
canonicalStyle_Class_2007.setCanonical(true);
node.getStyles().add(canonicalStyle_Class_2007);
node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
node.setType(UMLVisualIDRegistry.getType(ClassDiagramNotationClassEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
// initializeFromPreferences
final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR);
ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB));
FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE);
if (nodeFontStyle != null) {
FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
nodeFontStyle.setFontName(fontData.getName());
nodeFontStyle.setFontHeight(fontData.getHeight());
nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR);
nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
}
org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FILL_COLOR);
ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB));
Node label5014 = createLabel(node, UMLVisualIDRegistry.getType(ClassDiagramNotationClassNameEditPart.VISUAL_ID));
Node label5015 = createLabel(node, UMLVisualIDRegistry.getType(ClassDiagramNotationClassStereotypeEditPart.VISUAL_ID));
Node compartment7006 = createCompartment(node, UMLVisualIDRegistry.getType(ClassAttributesEditPart.VISUAL_ID), true, true, true, true);
CanonicalStyle canonicalStyle_ClassAttributes_7006 = NotationFactory.eINSTANCE.createCanonicalStyle();
canonicalStyle_ClassAttributes_7006.setCanonical(true);
compartment7006.getStyles().add(canonicalStyle_ClassAttributes_7006);
Node compartment7007 = createCompartment(node, UMLVisualIDRegistry.getType(ClassOperationsEditPart.VISUAL_ID), true, true, true, true);
CanonicalStyle canonicalStyle_ClassOperations_7007 = NotationFactory.eINSTANCE.createCanonicalStyle();
canonicalStyle_ClassOperations_7007.setCanonical(true);
compartment7007.getStyles().add(canonicalStyle_ClassOperations_7007);
Node compartment7008 = createCompartment(node, UMLVisualIDRegistry.getType(ClassClassesEditPart.VISUAL_ID), true, true, true, true);
CanonicalStyle canonicalStyle_ClassClasses_7008 = NotationFactory.eINSTANCE.createCanonicalStyle();
canonicalStyle_ClassClasses_7008.setCanonical(true);
compartment7008.getStyles().add(canonicalStyle_ClassClasses_7008);
return node;
}
/**
* @generated
*/
public Node createComment_2008Gen(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Shape node = NotationFactory.eINSTANCE.createShape();
node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
node.setType(UMLVisualIDRegistry.getType(CommentEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
// initializeFromPreferences
final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR);
ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB));
FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE);
if (nodeFontStyle != null) {
FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
nodeFontStyle.setFontName(fontData.getName());
nodeFontStyle.setFontHeight(fontData.getHeight());
nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR);
nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
}
org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FILL_COLOR);
ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB));
Node label5022 = createLabel(node, UMLVisualIDRegistry.getType(CommentBodyEditPart.VISUAL_ID));
return node;
}
/**
* @generated NOT
*/
public Node createComment_2008(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Node node = createComment_2008Gen(domainElement, containerView, index, persisted, preferencesHint);
ViewProviderUtils.initializeCommentColor(node, preferencesHint);
return node;
}
/**
* @generated
*/
public Node createInterface_2009(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Shape node = NotationFactory.eINSTANCE.createShape();
node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
node.setType(UMLVisualIDRegistry.getType(Interface3EditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
// initializeFromPreferences
final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR);
ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB));
FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE);
if (nodeFontStyle != null) {
FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
nodeFontStyle.setFontName(fontData.getName());
nodeFontStyle.setFontHeight(fontData.getHeight());
nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR);
nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
}
org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FILL_COLOR);
ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB));
Node label5026 = createLabel(node, UMLVisualIDRegistry.getType(InterfaceName3EditPart.VISUAL_ID));
Node label5027 = createLabel(node, UMLVisualIDRegistry.getType(InterfaceStereotypeEditPart.VISUAL_ID));
Node compartment7012 = createCompartment(node, UMLVisualIDRegistry.getType(InterfaceAttributesEditPart.VISUAL_ID), true, true, true, true);
CanonicalStyle canonicalStyle_InterfaceAttributes_7012 = NotationFactory.eINSTANCE.createCanonicalStyle();
canonicalStyle_InterfaceAttributes_7012.setCanonical(true);
compartment7012.getStyles().add(canonicalStyle_InterfaceAttributes_7012);
Node compartment7013 = createCompartment(node, UMLVisualIDRegistry.getType(InterfaceOperationsEditPart.VISUAL_ID), true, true, true, true);
CanonicalStyle canonicalStyle_InterfaceOperations_7013 = NotationFactory.eINSTANCE.createCanonicalStyle();
canonicalStyle_InterfaceOperations_7013.setCanonical(true);
compartment7013.getStyles().add(canonicalStyle_InterfaceOperations_7013);
Node compartment7014 = createCompartment(node, UMLVisualIDRegistry.getType(InterfaceClassesEditPart.VISUAL_ID), true, true, true, true);
CanonicalStyle canonicalStyle_InterfaceClasses_7014 = NotationFactory.eINSTANCE.createCanonicalStyle();
canonicalStyle_InterfaceClasses_7014.setCanonical(true);
compartment7014.getStyles().add(canonicalStyle_InterfaceClasses_7014);
return node;
}
/**
* @generated
*/
public Node createComponent_3001(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Shape node = NotationFactory.eINSTANCE.createShape();
CanonicalStyle canonicalStyle_Component_3001 = NotationFactory.eINSTANCE.createCanonicalStyle();
canonicalStyle_Component_3001.setCanonical(true);
node.getStyles().add(canonicalStyle_Component_3001);
node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
node.setType(UMLVisualIDRegistry.getType(Component2EditPart.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 label5002 = createLabel(node, UMLVisualIDRegistry.getType(ComponentNameEditPart.VISUAL_ID));
Node label5019 = createLabel(node, UMLVisualIDRegistry.getType(ComponentStereo2EditPart.VISUAL_ID));
Node compartment7002 = createCompartment(node, UMLVisualIDRegistry.getType(ComponentContents2EditPart.VISUAL_ID), true, false, false, false);
CanonicalStyle canonicalStyle_ComponentComponentFigure_contents_7002 = NotationFactory.eINSTANCE.createCanonicalStyle();
canonicalStyle_ComponentComponentFigure_contents_7002.setCanonical(true);
compartment7002.getStyles().add(canonicalStyle_ComponentComponentFigure_contents_7002);
return node;
}
/**
* @generated
*/
public Node createPort_3002(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(UMLVisualIDRegistry.getType(PortEditPart.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 label5003 = createLabel(node, UMLVisualIDRegistry.getType(PortNameEditPart.VISUAL_ID));
label5003.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
Location location5003 = (Location) label5003.getLayoutConstraint();
location5003.setX(0);
location5003.setY(5);
return node;
}
/**
* @generated
*/
public Node createArtifact_3003(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Shape node = NotationFactory.eINSTANCE.createShape();
node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
node.setType(UMLVisualIDRegistry.getType(ArtifactEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
// initializeFromPreferences
final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR);
ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB));
FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE);
if (nodeFontStyle != null) {
FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
nodeFontStyle.setFontName(fontData.getName());
nodeFontStyle.setFontHeight(fontData.getHeight());
nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR);
nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
}
org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FILL_COLOR);
ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB));
Node label5006 = createLabel(node, UMLVisualIDRegistry.getType(ArtifactNameEditPart.VISUAL_ID));
Node label5018 = createLabel(node, UMLVisualIDRegistry.getType(ArtifactStereo2EditPart.VISUAL_ID));
Node compartment7009 = createCompartment(node, UMLVisualIDRegistry.getType(ArtifactContentsEditPart.VISUAL_ID), true, false, false, false);
CanonicalStyle canonicalStyle_ArtifactArtifactFigure_contents_7009 = NotationFactory.eINSTANCE.createCanonicalStyle();
canonicalStyle_ArtifactArtifactFigure_contents_7009.setCanonical(true);
compartment7009.getStyles().add(canonicalStyle_ArtifactArtifactFigure_contents_7009);
return node;
}
/**
* @generated
*/
public Node createArtifact_3016(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Shape node = NotationFactory.eINSTANCE.createShape();
node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
node.setType(UMLVisualIDRegistry.getType(Artifact3EditPart.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 label5016 = createLabel(node, UMLVisualIDRegistry.getType(ArtifactName3EditPart.VISUAL_ID));
Node label5017 = createLabel(node, UMLVisualIDRegistry.getType(ArtifactStereo3EditPart.VISUAL_ID));
Node compartment7010 = createCompartment(node, UMLVisualIDRegistry.getType(ArtifactContents2EditPart.VISUAL_ID), true, false, false, false);
CanonicalStyle canonicalStyle_ArtifactArtifactFigure_contents_7010 = NotationFactory.eINSTANCE.createCanonicalStyle();
canonicalStyle_ArtifactArtifactFigure_contents_7010.setCanonical(true);
compartment7010.getStyles().add(canonicalStyle_ArtifactArtifactFigure_contents_7010);
return node;
}
/**
* @generated
*/
public Node createClass_3004(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Shape node = NotationFactory.eINSTANCE.createShape();
CanonicalStyle canonicalStyle_Class_3004 = NotationFactory.eINSTANCE.createCanonicalStyle();
canonicalStyle_Class_3004.setCanonical(true);
node.getStyles().add(canonicalStyle_Class_3004);
node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
node.setType(UMLVisualIDRegistry.getType(ClassEditPart.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 label5007 = createLabel(node, UMLVisualIDRegistry.getType(ClassNameEditPart.VISUAL_ID));
return node;
}
/**
* @generated
*/
public Node createInterface_3005(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Shape node = NotationFactory.eINSTANCE.createShape();
node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
node.setType(UMLVisualIDRegistry.getType(InterfaceEditPart.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 label5009 = createLabel(node, UMLVisualIDRegistry.getType(InterfaceNameEditPart.VISUAL_ID));
label5009.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
Location location5009 = (Location) label5009.getLayoutConstraint();
location5009.setX(0);
location5009.setY(5);
return node;
}
/**
* @generated
*/
public Node createProperty_3006(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Shape node = NotationFactory.eINSTANCE.createShape();
node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
node.setType(UMLVisualIDRegistry.getType(PropertyEditPart.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 label5010 = createLabel(node, UMLVisualIDRegistry.getType(PropertyNameEditPart.VISUAL_ID));
return node;
}
/**
* @generated
*/
public Node createConnector_3015(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(UMLVisualIDRegistry.getType(AssemblyConnectorCircleEditPart.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));
return node;
}
/**
* @generated
*/
public Node createElementImport_3007(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Node node = NotationFactory.eINSTANCE.createNode();
node.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
node.setType(UMLVisualIDRegistry.getType(ElementImportEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
return node;
}
/**
* @generated
*/
public Node createPackage_3008(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Node node = NotationFactory.eINSTANCE.createNode();
node.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
node.setType(UMLVisualIDRegistry.getType(Package4EditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
return node;
}
/**
* @generated
*/
public Node createClass_3009(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Node node = NotationFactory.eINSTANCE.createNode();
node.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
node.setType(UMLVisualIDRegistry.getType(Class3EditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
return node;
}
/**
* @generated
*/
public Node createComponent_3010(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Node node = NotationFactory.eINSTANCE.createNode();
node.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
node.setType(UMLVisualIDRegistry.getType(Component3EditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
return node;
}
/**
* @generated
*/
public Node createProperty_3011(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Node node = NotationFactory.eINSTANCE.createNode();
node.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
node.setType(UMLVisualIDRegistry.getType(ClassDiagramNotationPropertyEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
return node;
}
/**
* @generated
*/
public Node createOperation_3012(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Node node = NotationFactory.eINSTANCE.createNode();
node.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
node.setType(UMLVisualIDRegistry.getType(ClassDiagramNotationOperationEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
return node;
}
/**
* @generated
*/
public Node createClass_3013(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Node node = NotationFactory.eINSTANCE.createNode();
node.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
node.setType(UMLVisualIDRegistry.getType(ClassDiagramNotationInnerClassEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
return node;
}
/**
* @generated
*/
public Node createPort_3014(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(UMLVisualIDRegistry.getType(PortOnClassEditPart.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 label5013 = createLabel(node, UMLVisualIDRegistry.getType(PortName2EditPart.VISUAL_ID));
label5013.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
Location location5013 = (Location) label5013.getLayoutConstraint();
location5013.setX(0);
location5013.setY(5);
return node;
}
/**
* @generated
*/
public Node createProperty_3017(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Node node = NotationFactory.eINSTANCE.createNode();
node.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
node.setType(UMLVisualIDRegistry.getType(Property2EditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
return node;
}
/**
* @generated
*/
public Node createOperation_3018(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Node node = NotationFactory.eINSTANCE.createNode();
node.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
node.setType(UMLVisualIDRegistry.getType(OperationEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
return node;
}
/**
* @generated
*/
public Node createClass_3020(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Node node = NotationFactory.eINSTANCE.createNode();
node.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
node.setType(UMLVisualIDRegistry.getType(Class4EditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
return node;
}
/**
* @generated
*/
public Edge createInterfaceRealization_4001(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Connector edge = NotationFactory.eINSTANCE.createConnector();
edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
points.add(new RelativeBendpoint());
points.add(new RelativeBendpoint());
bendpoints.setPoints(points);
edge.setBendpoints(bendpoints);
ViewUtil.insertChildView(containerView, edge, index, persisted);
edge.setType(UMLVisualIDRegistry.getType(InterfaceRealizationEditPart.VISUAL_ID));
edge.setElement(domainElement);
// initializePreferences
final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR);
ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB));
FontStyle edgeFontStyle = (FontStyle) edge.getStyle(NotationPackage.Literals.FONT_STYLE);
if (edgeFontStyle != null) {
FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
edgeFontStyle.setFontName(fontData.getName());
edgeFontStyle.setFontHeight(fontData.getHeight());
edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR);
edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
}
Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
if (routing != null) {
ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
}
return edge;
}
/**
* @generated
*/
public Edge createPortProvided_4006(View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Connector edge = NotationFactory.eINSTANCE.createConnector();
edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
points.add(new RelativeBendpoint());
points.add(new RelativeBendpoint());
bendpoints.setPoints(points);
edge.setBendpoints(bendpoints);
ViewUtil.insertChildView(containerView, edge, index, persisted);
edge.setType(UMLVisualIDRegistry.getType(PortProvidedEditPart.VISUAL_ID));
edge.setElement(null);
// initializePreferences
final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR);
ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB));
FontStyle edgeFontStyle = (FontStyle) edge.getStyle(NotationPackage.Literals.FONT_STYLE);
if (edgeFontStyle != null) {
FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
edgeFontStyle.setFontName(fontData.getName());
edgeFontStyle.setFontHeight(fontData.getHeight());
edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR);
edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
}
Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
if (routing != null) {
ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
}
return edge;
}
/**
* @generated
*/
public Edge createPortRequired_4004(View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Connector edge = NotationFactory.eINSTANCE.createConnector();
edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
points.add(new RelativeBendpoint());
points.add(new RelativeBendpoint());
bendpoints.setPoints(points);
edge.setBendpoints(bendpoints);
ViewUtil.insertChildView(containerView, edge, index, persisted);
edge.setType(UMLVisualIDRegistry.getType(PortRequiredEditPart.VISUAL_ID));
edge.setElement(null);
// initializePreferences
final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR);
ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB));
FontStyle edgeFontStyle = (FontStyle) edge.getStyle(NotationPackage.Literals.FONT_STYLE);
if (edgeFontStyle != null) {
FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
edgeFontStyle.setFontName(fontData.getName());
edgeFontStyle.setFontHeight(fontData.getHeight());
edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR);
edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
}
Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
if (routing != null) {
ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
}
return edge;
}
/**
* @generated
*/
public Edge createComponentRequired_4007(View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Connector edge = NotationFactory.eINSTANCE.createConnector();
edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
points.add(new RelativeBendpoint());
points.add(new RelativeBendpoint());
bendpoints.setPoints(points);
edge.setBendpoints(bendpoints);
ViewUtil.insertChildView(containerView, edge, index, persisted);
edge.setType(UMLVisualIDRegistry.getType(ComponentRequiredEditPart.VISUAL_ID));
edge.setElement(null);
// initializePreferences
final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR);
ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB));
FontStyle edgeFontStyle = (FontStyle) edge.getStyle(NotationPackage.Literals.FONT_STYLE);
if (edgeFontStyle != null) {
FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
edgeFontStyle.setFontName(fontData.getName());
edgeFontStyle.setFontHeight(fontData.getHeight());
edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR);
edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
}
Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
if (routing != null) {
ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
}
return edge;
}
/**
* @generated
*/
public Edge createConnector_4008(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(UMLVisualIDRegistry.getType(ConnectorEditPart.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);
}
return edge;
}
/**
* @generated
*/
public Edge createDependency_4009(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(UMLVisualIDRegistry.getType(DependencyEditPart.VISUAL_ID));
edge.setElement(domainElement);
// initializePreferences
final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
FontStyle edgeFontStyle = (FontStyle) edge.getStyle(NotationPackage.Literals.FONT_STYLE);
if (edgeFontStyle != null) {
FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
edgeFontStyle.setFontName(fontData.getName());
edgeFontStyle.setFontHeight(fontData.getHeight());
edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR);
edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
}
Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
if (routing != null) {
ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
}
Node label6001 = createLabel(edge, UMLVisualIDRegistry.getType(DependencyNameEditPart.VISUAL_ID));
label6001.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
Location location6001 = (Location) label6001.getLayoutConstraint();
location6001.setX(0);
location6001.setY(40);
Node label6009 = createLabel(edge, UMLVisualIDRegistry.getType(DependencyName2EditPart.VISUAL_ID));
label6009.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
Location location6009 = (Location) label6009.getLayoutConstraint();
location6009.setX(0);
location6009.setY(20);
return edge;
}
/**
* @generated
*/
public Edge createConnectorEndRole_4010(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(UMLVisualIDRegistry.getType(AssemblyConnectorEndRoleEditPart.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 createAssociation_4011(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(UMLVisualIDRegistry.getType(AssociationEditPart.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 label6002 = createLabel(edge, UMLVisualIDRegistry.getType(AssociationNameEditPart.VISUAL_ID));
label6002.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
Location location6002 = (Location) label6002.getLayoutConstraint();
location6002.setX(0);
location6002.setY(20);
Node label6003 = createLabel(edge, UMLVisualIDRegistry.getType(AssociationName2EditPart.VISUAL_ID));
label6003.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
Location location6003 = (Location) label6003.getLayoutConstraint();
location6003.setX(0);
location6003.setY(-15);
Node label6004 = createLabel(edge, UMLVisualIDRegistry.getType(AssociationName3EditPart.VISUAL_ID));
label6004.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
Location location6004 = (Location) label6004.getLayoutConstraint();
location6004.setX(0);
location6004.setY(-15);
Node label6005 = createLabel(edge, UMLVisualIDRegistry.getType(AssociationName4EditPart.VISUAL_ID));
label6005.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
Location location6005 = (Location) label6005.getLayoutConstraint();
location6005.setX(0);
location6005.setY(-30);
Node label6006 = createLabel(edge, UMLVisualIDRegistry.getType(AssociationName5EditPart.VISUAL_ID));
label6006.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
Location location6006 = (Location) label6006.getLayoutConstraint();
location6006.setX(0);
location6006.setY(-30);
Node label6007 = createLabel(edge, UMLVisualIDRegistry.getType(AssociationName6EditPart.VISUAL_ID));
label6007.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
Location location6007 = (Location) label6007.getLayoutConstraint();
location6007.setX(0);
location6007.setY(15);
Node label6008 = createLabel(edge, UMLVisualIDRegistry.getType(AssociationName7EditPart.VISUAL_ID));
label6008.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
Location location6008 = (Location) label6008.getLayoutConstraint();
location6008.setX(0);
location6008.setY(15);
return edge;
}
/**
* @generated
*/
public Edge createCommentAnnotatedElement_4012(View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
Connector edge = NotationFactory.eINSTANCE.createConnector();
edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
points.add(new RelativeBendpoint());
points.add(new RelativeBendpoint());
bendpoints.setPoints(points);
edge.setBendpoints(bendpoints);
ViewUtil.insertChildView(containerView, edge, index, persisted);
edge.setType(UMLVisualIDRegistry.getType(CommentAnnotatedElementEditPart.VISUAL_ID));
edge.setElement(null);
// initializePreferences
final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR);
ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB));
FontStyle edgeFontStyle = (FontStyle) edge.getStyle(NotationPackage.Literals.FONT_STYLE);
if (edgeFontStyle != null) {
FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
edgeFontStyle.setFontName(fontData.getName());
edgeFontStyle.setFontHeight(fontData.getHeight());
edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR);
edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
}
Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
if (routing != null) {
ViewUtil.setStructuralFeatureValue(edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
}
return edge;
}
/**
* @generated
*/
private void stampShortcut(View containerView, Node target) {
if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) {
EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
shortcutAnnotation.getDetails().put("modelID", PackageEditPart.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);
}
}