Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 11cdef4f7946fcc183a9b3f036ac0478a3ea7384 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*****************************************************************************
 * Copyright (c) 2011 CEA LIST.
 * 
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *  Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
 *****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.properties.databinding;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.gmf.runtime.notation.datatype.GradientData;
import org.eclipse.papyrus.uml.tools.databinding.PapyrusObservableValue;

/**
 * An IObservableValue for a Gradient
 * 
 * @author Camille Letavernier
 * 
 */
public class GradientObservableValue extends PapyrusObservableValue {

	private ObservableGradientData gradientData;

	/**
	 * 
	 * Constructor.
	 * 
	 * @param source
	 *        The EObject owning the gradient data
	 * @param feature
	 *        The Feature in which the gradient data is set
	 * @param domain
	 *        The editing domain on which the commands will be executed
	 */
	public GradientObservableValue(EObject source, EStructuralFeature feature, EditingDomain domain) {
		super(source, feature, domain);
	}

	@Override
	protected Object doGetValue() {
		if(gradientData == null) {
			GradientData data = (GradientData)eObject.eGet(eStructuralFeature);
			gradientData = new ObservableGradientData(this, data);
		}

		return gradientData;
	}

	@Override
	protected void doSetValue(Object value) {
		super.doSetValue(value);
	}
}

Back to the top