Search in sources :

Example 6 with ShapeStyle

use of org.eclipse.gmf.runtime.notation.ShapeStyle in project statecharts by Yakindu.

the class RegionViewFactory method initializeFromPreferences.

@Override
protected void initializeFromPreferences(View view) {
    super.initializeFromPreferences(view);
    IPreferenceStore store = (IPreferenceStore) getPreferencesHint().getPreferenceStore();
    if (store == null) {
        return;
    }
    // Create region default styles
    ShapeStyle style = (ShapeStyle) view.getStyle(NotationPackage.Literals.SHAPE_STYLE);
    RGB fillRGB = PreferenceConverter.getColor(store, StatechartPreferenceConstants.PREF_REGION_BACKGROUND);
    style.setFillColor(FigureUtilities.RGBToInteger(fillRGB));
    RGB lineRGB = PreferenceConverter.getColor(store, StatechartPreferenceConstants.PREF_REGION_LINE);
    style.setLineColor(FigureUtilities.RGBToInteger(lineRGB));
}
Also used : ShapeStyle(org.eclipse.gmf.runtime.notation.ShapeStyle) IPreferenceStore(org.eclipse.jface.preference.IPreferenceStore) RGB(org.eclipse.swt.graphics.RGB)

Aggregations

ShapeStyle (org.eclipse.gmf.runtime.notation.ShapeStyle)6 IAdaptable (org.eclipse.core.runtime.IAdaptable)3 EObject (org.eclipse.emf.ecore.EObject)3 RGB (org.eclipse.swt.graphics.RGB)3 EObjectAdapter (org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter)2 Node (org.eclipse.gmf.runtime.notation.Node)2 IPreferenceStore (org.eclipse.jface.preference.IPreferenceStore)2 ExecutionException (org.eclipse.core.commands.ExecutionException)1 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1 AbstractTransactionalCommand (org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand)1 BooleanValueStyle (org.eclipse.gmf.runtime.notation.BooleanValueStyle)1 ConnectorStyle (org.eclipse.gmf.runtime.notation.ConnectorStyle)1 DecorationNode (org.eclipse.gmf.runtime.notation.DecorationNode)1 Edge (org.eclipse.gmf.runtime.notation.Edge)1 View (org.eclipse.gmf.runtime.notation.View)1 Color (org.eclipse.swt.graphics.Color)1