/** @generated */
  public static void initDefaults(IPreferenceStore store) {

    String key = ActivityDiagramEditPart.MODEL_ID + "_OutputPin";
    store.setDefault(
        PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.WIDTH), 16);
    store.setDefault(
        PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.HEIGHT), 16);

    Map<String, Boolean> map = getStaticLabelVisibilityPreferences();

    for (String role : map.keySet()) {
      String preferenceName =
          PreferenceConstantHelper.getLabelElementConstant(
              key, role, PreferenceConstantHelper.LABEL_VISIBILITY);
      store.setDefault(preferenceName, map.get(role));
    }

    // org.eclipse.jface.preference.PreferenceConverter.setDefault(store,
    // org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
    // org.eclipse.jface.preference.PreferenceConverter.setDefault(store,
    // org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));

    // Set the default for the gradient
    // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper.GRADIENT_POLICY),false);
    // org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter
    // gradientPreferenceConverter = new
    // org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
    //		new org.eclipse.swt.graphics.RGB(255, 255, 255),
    //		new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
    // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());

  }
  /** @generated */
  @Override
  public Object getPreferredValue(EStructuralFeature feature) {
    IPreferenceStore preferenceStore =
        (IPreferenceStore) getDiagramPreferencesHint().getPreferenceStore();
    Object result = null;

    if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()
        || feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()
        || feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
      String prefColor = null;
      if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
        prefColor =
            PreferenceConstantHelper.getElementConstant(
                "Metaclass", PreferenceConstantHelper.COLOR_LINE);
      } else if (feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
        prefColor =
            PreferenceConstantHelper.getElementConstant(
                "Metaclass", PreferenceConstantHelper.COLOR_FONT);
      } else if (feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
        prefColor =
            PreferenceConstantHelper.getElementConstant(
                "Metaclass", PreferenceConstantHelper.COLOR_FILL);
      }
      result =
          FigureUtilities.RGBToInteger(
              PreferenceConverter.getColor((IPreferenceStore) preferenceStore, prefColor));
    } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()
        || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
      String prefGradient =
          PreferenceConstantHelper.getElementConstant(
              "Metaclass", PreferenceConstantHelper.COLOR_GRADIENT);
      GradientPreferenceConverter gradientPreferenceConverter =
          new GradientPreferenceConverter(preferenceStore.getString(prefGradient));
      if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency()) {
        result = new Integer(gradientPreferenceConverter.getTransparency());
      } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
        result = gradientPreferenceConverter.getGradientData();
      }
    }

    if (result == null) {
      result = getStructuralFeatureValue(feature);
    }
    return result;
  }
  /** @generated */
  public static void initDefaults(IPreferenceStore store) {

    String key = CompositeStructureDiagramEditPart.MODEL_ID + "_InteractionConstraint";
    store.setDefault(
        PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.WIDTH), 40);
    store.setDefault(
        PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.HEIGHT), 40);

    // org.eclipse.jface.preference.PreferenceConverter.setDefault(store,
    // org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
    // org.eclipse.jface.preference.PreferenceConverter.setDefault(store,
    // org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));

    // Set the default for the gradient
    // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper.GRADIENT_POLICY),false);
    // org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter
    // gradientPreferenceConverter = new
    // org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
    //		new org.eclipse.swt.graphics.RGB(255, 255, 255),
    //		new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
    // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());

  }
 public static String getpreferenceKey(View view, String elementName, int pref) {
   return PreferenceConstantHelper.getElementConstant(
       view.getDiagram().getType() + "_" + elementName, pref); // $NON-NLS-1$
 }