コード例 #1
0
  /** @generated */
  public static void initDefaults(IPreferenceStore store) {

    String key = DeploymentDiagramEditPart.MODEL_ID + "_Node";
    store.setDefault(
        PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.WIDTH), 150);
    store.setDefault(
        PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.HEIGHT), 150);

    for (String name : compartments) {
      String preferenceName =
          PreferenceConstantHelper.getCompartmentElementConstant(
              key, name, PreferenceConstantHelper.COMPARTMENT_VISIBILITY);
      store.setDefault(preferenceName, true);
    }

    // org.eclipse.jface.preference.PreferenceConverter.setDefault(store,
    // org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
    // org.eclipse.jface.preference.PreferenceConverter.setDefault(store,
    // org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.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.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.GRADIENT_POLICY),false);
    // org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter
    // = new  org.eclipse.papyrus.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.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());

  }
コード例 #2
0
  /** @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(
                "RedefinableTemplateSignature", PreferenceConstantHelper.COLOR_LINE);
      } else if (feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
        prefColor =
            PreferenceConstantHelper.getElementConstant(
                "RedefinableTemplateSignature", PreferenceConstantHelper.COLOR_FONT);
      } else if (feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
        prefColor =
            PreferenceConstantHelper.getElementConstant(
                "RedefinableTemplateSignature", 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(
              "RedefinableTemplateSignature", 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;
  }
コード例 #3
0
  /** @generated */
  public static void initDefaults(IPreferenceStore store) {

    String key = ModelEditPart.MODEL_ID + "_PackageMerge";
    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));
    }
  }
コード例 #4
0
  /**
   * Initialize defaults using a specified {@link IPreferenceStore}
   *
   * @param store the preference store.
   */
  public static void initDefaults(IPreferenceStore store) {
    // Start of user code custom default initializations
    // End of user code

    for (String labelName : labelDefaultVisibilityMap.keySet()) {
      String showLabelKey =
          PreferenceConstantHelper.getCompartmentElementConstant(
              prefKey, labelName, PreferenceConstantHelper.LABEL_VISIBILITY);
      store.setDefault(showLabelKey, labelDefaultVisibilityMap.get(labelName));
    }
  }
コード例 #5
0
  /** @generated */
  public static void initDefaults(IPreferenceStore store) {

    String key = CompositeStructureDiagramEditPart.MODEL_ID + "_PrimitiveType";
    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.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
    // org.eclipse.jface.preference.PreferenceConverter.setDefault(store,
    // org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.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.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.GRADIENT_POLICY),false);
    // org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter
    // = new  org.eclipse.papyrus.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.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());

  }