Java Code Examples for org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities#RGBToInteger

The following examples show how to use org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities#RGBToInteger . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CustomReceiveTask2EditPart.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
@Override
public Object getPreferredValue(EStructuralFeature feature) {
       Object preferenceStore = getDiagramPreferencesHint().getPreferenceStore();
       if (preferenceStore instanceof IPreferenceStore) {
           if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
               
               return FigureUtilities.RGBToInteger(new RGB(44,109,163));
               
           } else if (feature == NotationPackage.eINSTANCE
               .getFontStyle_FontColor()) {
               
               return FigureUtilities.RGBToInteger(PreferenceConverter
                   .getColor((IPreferenceStore) preferenceStore,
                       IPreferenceConstants.PREF_FONT_COLOR));
               
           } else if (feature == NotationPackage.eINSTANCE
               .getFillStyle_FillColor()) {
               
               return FigureUtilities.RGBToInteger(new RGB(184,185,218));
               
           }
       }

       return getStructuralFeatureValue(feature);
   }
 
Example 2
Source File: CustomTask2EditPart.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
@Override
public Object getPreferredValue(EStructuralFeature feature) {
    final Object preferenceStore = getDiagramPreferencesHint().getPreferenceStore();
    if (preferenceStore instanceof IPreferenceStore) {
        if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
            return FigureUtilities.RGBToInteger(new RGB(44, 109, 163));
        } else if (feature == NotationPackage.eINSTANCE
                .getFontStyle_FontColor()) {
            return FigureUtilities.RGBToInteger(PreferenceConverter
                    .getColor((IPreferenceStore) preferenceStore,
                            IPreferenceConstants.PREF_FONT_COLOR));
        } else if (feature == NotationPackage.eINSTANCE
                .getFillStyle_FillColor()) {
            return FigureUtilities.RGBToInteger(new RGB(184, 185, 218));
        }
    }

    return getStructuralFeatureValue(feature);
}
 
Example 3
Source File: CustomCallActivity2EditPart.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
@Override
public Object getPreferredValue(EStructuralFeature feature) {
    Object preferenceStore = getDiagramPreferencesHint().getPreferenceStore();
    if (preferenceStore instanceof IPreferenceStore) {
        if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {

            return FigureUtilities.RGBToInteger(new RGB(44,109,163));

        } else if (feature == NotationPackage.eINSTANCE
                .getFontStyle_FontColor()) {

            return FigureUtilities.RGBToInteger(PreferenceConverter
                    .getColor((IPreferenceStore) preferenceStore,
                            IPreferenceConstants.PREF_FONT_COLOR));

        } else if (feature == NotationPackage.eINSTANCE
                .getFillStyle_FillColor()) {

            return FigureUtilities.RGBToInteger(new RGB(184,185,218));

        }
    }

    return getStructuralFeatureValue(feature);
}
 
Example 4
Source File: CustomScriptTask2EditPart.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
@Override
public Object getPreferredValue(EStructuralFeature feature) {
       Object preferenceStore = getDiagramPreferencesHint().getPreferenceStore();
       if (preferenceStore instanceof IPreferenceStore) {
           if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
               
               return FigureUtilities.RGBToInteger(new RGB(44,109,163));
               
           } else if (feature == NotationPackage.eINSTANCE
               .getFontStyle_FontColor()) {
               
               return FigureUtilities.RGBToInteger(PreferenceConverter
                   .getColor((IPreferenceStore) preferenceStore,
                       IPreferenceConstants.PREF_FONT_COLOR));
               
           } else if (feature == NotationPackage.eINSTANCE
               .getFillStyle_FillColor()) {
               
               return FigureUtilities.RGBToInteger(new RGB(184,185,218));
               
           }
       }

       return getStructuralFeatureValue(feature);
   }
 
Example 5
Source File: CustomActivity2EditPart.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
@Override
public Object getPreferredValue(EStructuralFeature feature) {
	Object preferenceStore = getDiagramPreferencesHint().getPreferenceStore();
	if (preferenceStore instanceof IPreferenceStore) {
		if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {

			return FigureUtilities.RGBToInteger(new RGB(44,109,163));

		} else if (feature == NotationPackage.eINSTANCE
				.getFontStyle_FontColor()) {

			return FigureUtilities.RGBToInteger(PreferenceConverter
					.getColor((IPreferenceStore) preferenceStore,
							IPreferenceConstants.PREF_FONT_COLOR));

		} else if (feature == NotationPackage.eINSTANCE
				.getFillStyle_FillColor()) {

			return FigureUtilities.RGBToInteger(new RGB(184,185,218));

		}
	}

	return getStructuralFeatureValue(feature);
}
 
Example 6
Source File: CustomServiceTask2EditPart.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
@Override
public Object getPreferredValue(EStructuralFeature feature) {
       Object preferenceStore = getDiagramPreferencesHint().getPreferenceStore();
       if (preferenceStore instanceof IPreferenceStore) {
           if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
               
               return FigureUtilities.RGBToInteger(new RGB(44,109,163));
               
           } else if (feature == NotationPackage.eINSTANCE
               .getFontStyle_FontColor()) {
               
               return FigureUtilities.RGBToInteger(PreferenceConverter
                   .getColor((IPreferenceStore) preferenceStore,
                       IPreferenceConstants.PREF_FONT_COLOR));
               
           } else if (feature == NotationPackage.eINSTANCE
               .getFillStyle_FillColor()) {
               
               return FigureUtilities.RGBToInteger(new RGB(184,185,218));
               
           }
       }

       return getStructuralFeatureValue(feature);
   }
 
Example 7
Source File: CustomSubProcessEvent2EditPart.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
@Override
public Object getPreferredValue(EStructuralFeature feature) {
	Object preferenceStore = getDiagramPreferencesHint().getPreferenceStore();
	if (preferenceStore instanceof IPreferenceStore) {
		if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {

			return FigureUtilities.RGBToInteger(new RGB(44,109,163));

		} else if (feature == NotationPackage.eINSTANCE
				.getFontStyle_FontColor()) {

			return FigureUtilities.RGBToInteger(PreferenceConverter
					.getColor((IPreferenceStore) preferenceStore,
							IPreferenceConstants.PREF_FONT_COLOR));

		} else if (feature == NotationPackage.eINSTANCE
				.getFillStyle_FillColor()) {

			return FigureUtilities.RGBToInteger(new RGB(184,185,218));

		}
	}

	return getStructuralFeatureValue(feature);
}
 
Example 8
Source File: CustomSendTask2EditPart.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
@Override
public Object getPreferredValue(EStructuralFeature feature) {
       Object preferenceStore = getDiagramPreferencesHint().getPreferenceStore();
       if (preferenceStore instanceof IPreferenceStore) {
           if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
               
               return FigureUtilities.RGBToInteger(new RGB(44,109,163));
               
           } else if (feature == NotationPackage.eINSTANCE
               .getFontStyle_FontColor()) {
               
               return FigureUtilities.RGBToInteger(PreferenceConverter
                   .getColor((IPreferenceStore) preferenceStore,
                       IPreferenceConstants.PREF_FONT_COLOR));
               
           } else if (feature == NotationPackage.eINSTANCE
               .getFillStyle_FillColor()) {
               
               return FigureUtilities.RGBToInteger(new RGB(184,185,218));
               
           }
       }

       return getStructuralFeatureValue(feature);
   }
 
Example 9
Source File: StateEditPart.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Returns the default background color for states
 */
@Override
public Object getPreferredValue(EStructuralFeature feature) {
	if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
		return FigureUtilities.RGBToInteger(StatechartColorConstants.STATE_LINE_COLOR.getRGB());
	} else if (feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
		return FigureUtilities.RGBToInteger(StatechartColorConstants.STATE_BG_COLOR.getRGB());
	}
	return super.getPreferredValue(feature);
}
 
Example 10
Source File: EntryEditPart.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public Object getPreferredValue(EStructuralFeature feature) {
	if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
		return FigureUtilities.RGBToInteger(ColorConstants.white.getRGB());
	} else if (feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
		return FigureUtilities.RGBToInteger(ColorConstants.black.getRGB());
	}
	return super.getPreferredValue(feature);
}
 
Example 11
Source File: RegionEditPart.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Returns the default background color for states
 */
@Override
public Object getPreferredValue(EStructuralFeature feature) {
	if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
		return FigureUtilities.RGBToInteger(StatechartColorConstants.REGION_LINE_COLOR.getRGB());
	} else if (feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
		return FigureUtilities.RGBToInteger(StatechartColorConstants.REGION_BG_COLOR.getRGB());
	}
	return super.getPreferredValue(feature);
}
 
Example 12
Source File: ForkedColorsAndFontsPropertySection.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
protected void changeFillColor(SelectionEvent event) {
       // calling the deprectaed method in case a client overrides the deprecated method
	if (fillColor != null){
		previousColor = FigureUtilities.RGBToInteger(fillColor);
	}
	fillColor = changeColor(event, fillColorButton,
		IPreferenceConstants.PREF_FILL_COLOR, Properties.ID_FILLCOLOR,
		FILL_COLOR_COMMAND_NAME, DiagramUIPropertiesImages.DESC_FILL_COLOR);
}
 
Example 13
Source File: ForkedColorsAndFontsPropertySection.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Apply line color change
 * 
 * @param event -
 *            line color button selection event
 */
protected void changeLineColor(SelectionEvent event) {
	if (lineColor != null){
		previousColor = FigureUtilities.RGBToInteger(lineColor);	
	}	
	lineColor = changeColor(event, lineColorButton,
		IPreferenceConstants.PREF_LINE_COLOR, Properties.ID_LINECOLOR,
		LINE_COLOR_COMMAND_NAME, DiagramUIPropertiesImages.DESC_LINE_COLOR);
}
 
Example 14
Source File: ForkedColorsAndFontsPropertySection.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Apply font color change
 * 
 * @param event -
 *            font button selection event
 */
protected void changeFontColor(SelectionEvent event) {
	if (fontColor != null){
		previousColor = FigureUtilities.RGBToInteger(fontColor);
	}
	fontColor = changeColor(event, fontColorButton,
		IPreferenceConstants.PREF_FONT_COLOR, Properties.ID_FONTCOLOR,
		FONT_COLOR_COMMAND_NAME, DiagramUIPropertiesImages.DESC_FONT_COLOR);
}