/** @generated */ public static void initDefaults(IPreferenceStore store) { String key = ActivityDiagramEditPart.MODEL_ID + "_ActivityCN"; store.setDefault( PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.WIDTH), 200); store.setDefault( PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.HEIGHT), 100); for (String name : compartments) { String preferenceName = PreferencesConstantsHelper.getCompartmentElementConstant( key, name, PreferencesConstantsHelper.COMPARTMENT_VISIBILITY); store.setDefault(preferenceName, true); } // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255)); // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0)); // Set the default for the gradient // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.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.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.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 = PreferencesConstantsHelper.getElementConstant( "ShapeNamedElement", PreferencesConstantsHelper.COLOR_LINE); } else if (feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) { prefColor = PreferencesConstantsHelper.getElementConstant( "ShapeNamedElement", PreferencesConstantsHelper.COLOR_FONT); } else if (feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) { prefColor = PreferencesConstantsHelper.getElementConstant( "ShapeNamedElement", PreferencesConstantsHelper.COLOR_FILL); } result = FigureUtilities.RGBToInteger( PreferenceConverter.getColor((IPreferenceStore) preferenceStore, prefColor)); } else if (feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) { String prefGradient = PreferencesConstantsHelper.getElementConstant( "ShapeNamedElement", PreferencesConstantsHelper.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 = UseCaseDiagramEditPart.MODEL_ID + "_PackageImport"; Map<String, Boolean> map = getStaticLabelVisibilityPreferences(); for (String role : map.keySet()) { String preferenceName = PreferencesConstantsHelper.getLabelElementConstant( key, role, PreferencesConstantsHelper.LABEL_VISIBILITY); store.setDefault(preferenceName, map.get(role)); } }
/** @generated */ public static void initDefaults(IPreferenceStore store) { String key = ActivityDiagramEditPart.MODEL_ID + "_StructuredActivityNode"; store.setDefault( PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.WIDTH), 40); store.setDefault( PreferencesConstantsHelper.getElementConstant(key, PreferencesConstantsHelper.HEIGHT), 40); Map<String, Boolean> map = getStaticCompartmentVisibilityPreferences(); for (String name : map.keySet()) { String preferenceName = PreferencesConstantsHelper.getLabelElementConstant( key, name, PreferencesConstantsHelper.COMPARTMENT_VISIBILITY); store.setDefault(preferenceName, map.get(name)); } map = getStaticCompartmentTitleVisibilityPreferences(); for (String name : map.keySet()) { String preferenceName = PreferencesConstantsHelper.getLabelElementConstant( key, name, PreferencesConstantsHelper.COMPARTMENT_NAME_VISIBILITY); store.setDefault(preferenceName, map.get(name)); } // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_FILL), // new org.eclipse.swt.graphics.RGB(255, 255, 255)); // org.eclipse.jface.preference.PreferenceConverter.setDefault(store, // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, // org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_LINE), // new org.eclipse.swt.graphics.RGB(0, 0, 0)); // Set the default for the gradient // store.setDefault(org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.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.common.preferences.PreferencesConstantsHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper.COLOR_GRADIENT), // gradientPreferenceConverter.getPreferenceValue()); }