/** @generated */
 public Edge createViewTableViewedTables_3002(
     View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
   Edge edge = NotationFactory.eINSTANCE.createEdge();
   edge.getStyles().add(NotationFactory.eINSTANCE.createRoutingStyle());
   edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
   RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
   ArrayList points = new ArrayList(2);
   points.add(new RelativeBendpoint());
   points.add(new RelativeBendpoint());
   bendpoints.setPoints(points);
   edge.setBendpoints(bendpoints);
   ViewUtil.insertChildView(containerView, edge, index, persisted);
   edge.setType(SqlmodelVisualIDRegistry.getType(ViewTableViewedTables2EditPart.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_4001(
      EObject domainElement,
      View containerView,
      int index,
      boolean persisted,
      PreferencesHint preferencesHint) {
    Connector edge = NotationFactory.eINSTANCE.createConnector();
    edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
    RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
    ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
    points.add(new RelativeBendpoint());
    points.add(new RelativeBendpoint());
    bendpoints.setPoints(points);
    edge.setBendpoints(bendpoints);
    ViewUtil.insertChildView(containerView, edge, index, persisted);
    edge.setType(
        edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.part
            .NECSIS14_ClassDiagramVisualIDRegistry.getType(
            edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.edit.parts
                .AssociationEditPart.VISUAL_ID));
    edge.setElement(domainElement);
    // initializePreferences
    final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

    org.eclipse.swt.graphics.RGB lineRGB =
        PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR);
    ViewUtil.setStructuralFeatureValue(
        edge,
        NotationPackage.eINSTANCE.getLineStyle_LineColor(),
        FigureUtilities.RGBToInteger(lineRGB));
    FontStyle edgeFontStyle = (FontStyle) edge.getStyle(NotationPackage.Literals.FONT_STYLE);
    if (edgeFontStyle != null) {
      FontData fontData =
          PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
      edgeFontStyle.setFontName(fontData.getName());
      edgeFontStyle.setFontHeight(fontData.getHeight());
      edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
      edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
      org.eclipse.swt.graphics.RGB fontRGB =
          PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR);
      edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
    }
    Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
    if (routing != null) {
      ViewUtil.setStructuralFeatureValue(
          edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
    }
    Node label6001 =
        createLabel(
            edge,
            edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.part
                .NECSIS14_ClassDiagramVisualIDRegistry.getType(
                edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.edit.parts
                    .AssociationNameEditPart.VISUAL_ID));
    label6001.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
    Location location6001 = (Location) label6001.getLayoutConstraint();
    location6001.setX(0);
    location6001.setY(40);
    return edge;
  }
  /**
   * initialize the routing for a graphical element
   *
   * @param view the element to initialize
   * @param store the preference store
   * @param elementName the name to the element
   */
  public static void initRoutingFromPrefs(
      View view, final IPreferenceStore store, String elementName) {
    if (!usePreferenceInitializer(view)) {
      return;
    }

    Routing routing =
        Routing.get(
            store.getInt(
                getpreferenceKey(view, elementName, PreferenceConstantHelper.ROUTING_STYLE)));
    if (routing != null) {
      ViewUtil.setStructuralFeatureValue(
          view, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
    }
    Smoothness smoothness =
        Smoothness.get(
            store.getInt(getpreferenceKey(view, elementName, PreferenceConstantHelper.SMOOTHNESS)));
    if (routing != null) {
      ViewUtil.setStructuralFeatureValue(
          view, NotationPackage.eINSTANCE.getRoutingStyle_Smoothness(), smoothness);
    }
    JumpLinkStatus jumpLinkStatus =
        JumpLinkStatus.get(
            getpreferenceKey(view, elementName, PreferenceConstantHelper.JUMPLINK_STATUS));
    if (routing != null) {
      ViewUtil.setStructuralFeatureValue(
          view, NotationPackage.eINSTANCE.getRoutingStyle_JumpLinkStatus(), jumpLinkStatus);
    }

    JumpLinkType jumpLinkType =
        JumpLinkType.get(
            getpreferenceKey(view, elementName, PreferenceConstantHelper.JUMPLINK_TYPE));
    if (routing != null) {
      ViewUtil.setStructuralFeatureValue(
          view, NotationPackage.eINSTANCE.getRoutingStyle_JumpLinkType(), jumpLinkType);
    }
    boolean jumpLinksReverse =
        store.getBoolean(
            getpreferenceKey(view, elementName, PreferenceConstantHelper.JUMPLINK_REVERSE));
    ViewUtil.setStructuralFeatureValue(
        view, NotationPackage.eINSTANCE.getRoutingStyle_JumpLinksReverse(), jumpLinksReverse);

    boolean routingObstruction =
        store.getBoolean(
            getpreferenceKey(
                view, elementName, PreferenceConstantHelper.ROUTING_POLICY_OBSTRUCTION));
    ViewUtil.setStructuralFeatureValue(
        view, NotationPackage.eINSTANCE.getRoutingStyle_AvoidObstructions(), routingObstruction);

    boolean routingDistance =
        store.getBoolean(
            getpreferenceKey(view, elementName, PreferenceConstantHelper.ROUTING_POLICY_DISTANCE));
    ViewUtil.setStructuralFeatureValue(
        view, NotationPackage.eINSTANCE.getRoutingStyle_ClosestDistance(), routingDistance);
  }