/* license-start * * Copyright (C) 2008 - 2013 Crispico, <http://www.crispico.com/>. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation version 3. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details, at <http://www.gnu.org/licenses/>. * * Contributors: * Crispico - Initial API and implementation * * license-end */ /** * <copyright> * </copyright> * * $Id$ */ package org.flowerplatform.emf_model.notation.impl; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.flowerplatform.emf_model.notation.Location; import org.flowerplatform.emf_model.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: * <ul> * <li>{@link org.flowerplatform.emf_model.notation.impl.LocationImpl#getX <em>X</em>}</li> * <li>{@link org.flowerplatform.emf_model.notation.impl.LocationImpl#getY <em>Y</em>}</li> * </ul> * </p> * * @generated */ public class LocationImpl extends NotationElementImpl 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 cached value of the '{@link #getX() <em>X</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getX() * @generated * @ordered */ protected int x = X_EDEFAULT; /** * 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; /** * The cached value of the '{@link #getY() <em>Y</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getY() * @generated * @ordered */ protected int y = Y_EDEFAULT; /** * <!-- 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 */ public int getX() { return x; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setX(int newX) { int oldX = x; x = newX; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, NotationPackage.LOCATION__X, oldX, x)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public int getY() { return y; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setY(int newY) { int oldY = y; y = newY; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, NotationPackage.LOCATION__Y, oldY, y)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case NotationPackage.LOCATION__X: return getX(); case NotationPackage.LOCATION__Y: return getY(); } return super.eGet(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); return; case NotationPackage.LOCATION__Y: setY((Integer)newValue); return; } super.eSet(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; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case NotationPackage.LOCATION__X: return x != X_EDEFAULT; case NotationPackage.LOCATION__Y: return y != Y_EDEFAULT; } return super.eIsSet(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (x: "); result.append(x); result.append(", y: "); result.append(y); result.append(')'); return result.toString(); } } //LocationImpl