| /****************************************************************************** |
| * Copyright (c) 2018-2020 IBM Corporation and others. |
| * This program and the accompanying materials are made |
| * available under the terms of the Eclipse Public License 2.0 |
| * which is available at https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * IBM Corporation - initial API and implementation |
| ****************************************************************************/ |
| |
| package org.eclipse.emf.cdo.gmf.notation.impl; |
| |
| import org.eclipse.emf.internal.cdo.CDOObjectImpl; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.gmf.runtime.notation.Location; |
| import org.eclipse.gmf.runtime.notation.NotationPackage; |
| |
| /** |
| * <!-- begin-user-doc --> An implementation of the model object |
| * '<em><b>Location</b></em>'. <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.emf.cdo.gmf.notation.impl.LocationImpl#getX <em>X</em>}</li> |
| * <li>{@link org.eclipse.emf.cdo.gmf.notation.impl.LocationImpl#getY <em>Y</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| /* |
| * @canBeSeenBy %partners |
| */ |
| public class LocationImpl extends CDOObjectImpl implements Location |
| { |
| /** |
| * The default value of the '{@link #getX() <em>X</em>}' attribute. <!-- |
| * begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @see #getX() |
| * @generated |
| * @ordered |
| */ |
| protected static final int X_EDEFAULT = 0; |
| |
| /** |
| * The default value of the '{@link #getY() <em>Y</em>}' attribute. <!-- |
| * begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @see #getY() |
| * @generated |
| * @ordered |
| */ |
| protected static final int Y_EDEFAULT = 0; |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * @generated |
| */ |
| protected LocationImpl() |
| { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() |
| { |
| return NotationPackage.Literals.LOCATION; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected int eStaticFeatureCount() |
| { |
| return 0; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public int getX() |
| { |
| return ((Integer)eDynamicGet(NotationPackage.LOCATION__X, NotationPackage.Literals.LOCATION__X, true, true)).intValue(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setX(int newX) |
| { |
| eDynamicSet(NotationPackage.LOCATION__X, NotationPackage.Literals.LOCATION__X, new Integer(newX)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public int getY() |
| { |
| return ((Integer)eDynamicGet(NotationPackage.LOCATION__Y, NotationPackage.Literals.LOCATION__Y, true, true)).intValue(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setY(int newY) |
| { |
| eDynamicSet(NotationPackage.LOCATION__Y, NotationPackage.Literals.LOCATION__Y, new Integer(newY)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) |
| { |
| switch (featureID) |
| { |
| case NotationPackage.LOCATION__X: |
| return new Integer(getX()); |
| case NotationPackage.LOCATION__Y: |
| return new Integer(getY()); |
| } |
| return eDynamicGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) |
| { |
| switch (featureID) |
| { |
| case NotationPackage.LOCATION__X: |
| setX(((Integer)newValue).intValue()); |
| return; |
| case NotationPackage.LOCATION__Y: |
| setY(((Integer)newValue).intValue()); |
| return; |
| } |
| eDynamicSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) |
| { |
| switch (featureID) |
| { |
| case NotationPackage.LOCATION__X: |
| setX(X_EDEFAULT); |
| return; |
| case NotationPackage.LOCATION__Y: |
| setY(Y_EDEFAULT); |
| return; |
| } |
| eDynamicUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) |
| { |
| switch (featureID) |
| { |
| case NotationPackage.LOCATION__X: |
| return getX() != X_EDEFAULT; |
| case NotationPackage.LOCATION__Y: |
| return getY() != Y_EDEFAULT; |
| } |
| return eDynamicIsSet(featureID); |
| } |
| |
| } // LocationImpl |