| /** |
| * Copyright (c) 2016 CEA LIST. |
| * |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0 |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * CEA LIST - Initial API and implementation |
| */ |
| package org.eclipse.papyrus.moka.xygraph.model.xygraph.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; |
| |
| import org.eclipse.papyrus.moka.xygraph.model.xygraph.ColorDescriptor; |
| import org.eclipse.papyrus.moka.xygraph.model.xygraph.XYGraphPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Color Descriptor</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.moka.xygraph.model.xygraph.impl.ColorDescriptorImpl#getR <em>R</em>}</li> |
| * <li>{@link org.eclipse.papyrus.moka.xygraph.model.xygraph.impl.ColorDescriptorImpl#getG <em>G</em>}</li> |
| * <li>{@link org.eclipse.papyrus.moka.xygraph.model.xygraph.impl.ColorDescriptorImpl#getB <em>B</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class ColorDescriptorImpl extends MinimalEObjectImpl.Container implements ColorDescriptor { |
| /** |
| * The default value of the '{@link #getR() <em>R</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getR() |
| * @generated |
| * @ordered |
| */ |
| protected static final int R_EDEFAULT = 0; |
| |
| /** |
| * The cached value of the '{@link #getR() <em>R</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getR() |
| * @generated |
| * @ordered |
| */ |
| protected int r = R_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getG() <em>G</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getG() |
| * @generated |
| * @ordered |
| */ |
| protected static final int G_EDEFAULT = 0; |
| |
| /** |
| * The cached value of the '{@link #getG() <em>G</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getG() |
| * @generated |
| * @ordered |
| */ |
| protected int g = G_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getB() <em>B</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getB() |
| * @generated |
| * @ordered |
| */ |
| protected static final int B_EDEFAULT = 0; |
| |
| /** |
| * The cached value of the '{@link #getB() <em>B</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getB() |
| * @generated |
| * @ordered |
| */ |
| protected int b = B_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ColorDescriptorImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return XYGraphPackage.Literals.COLOR_DESCRIPTOR; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public int getR() { |
| return r; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setR(int newR) { |
| int oldR = r; |
| r = newR; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, XYGraphPackage.COLOR_DESCRIPTOR__R, oldR, r)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public int getG() { |
| return g; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setG(int newG) { |
| int oldG = g; |
| g = newG; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, XYGraphPackage.COLOR_DESCRIPTOR__G, oldG, g)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public int getB() { |
| return b; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setB(int newB) { |
| int oldB = b; |
| b = newB; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, XYGraphPackage.COLOR_DESCRIPTOR__B, oldB, b)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case XYGraphPackage.COLOR_DESCRIPTOR__R: |
| return getR(); |
| case XYGraphPackage.COLOR_DESCRIPTOR__G: |
| return getG(); |
| case XYGraphPackage.COLOR_DESCRIPTOR__B: |
| return getB(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case XYGraphPackage.COLOR_DESCRIPTOR__R: |
| setR((Integer)newValue); |
| return; |
| case XYGraphPackage.COLOR_DESCRIPTOR__G: |
| setG((Integer)newValue); |
| return; |
| case XYGraphPackage.COLOR_DESCRIPTOR__B: |
| setB((Integer)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case XYGraphPackage.COLOR_DESCRIPTOR__R: |
| setR(R_EDEFAULT); |
| return; |
| case XYGraphPackage.COLOR_DESCRIPTOR__G: |
| setG(G_EDEFAULT); |
| return; |
| case XYGraphPackage.COLOR_DESCRIPTOR__B: |
| setB(B_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case XYGraphPackage.COLOR_DESCRIPTOR__R: |
| return r != R_EDEFAULT; |
| case XYGraphPackage.COLOR_DESCRIPTOR__G: |
| return g != G_EDEFAULT; |
| case XYGraphPackage.COLOR_DESCRIPTOR__B: |
| return b != B_EDEFAULT; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuilder result = new StringBuilder(super.toString()); |
| result.append(" (r: "); |
| result.append(r); |
| result.append(", g: "); |
| result.append(g); |
| result.append(", b: "); |
| result.append(b); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //ColorDescriptorImpl |