| /******************************************************************************* |
| * <copyright> |
| * |
| * Copyright (c) 2011, 2011 SAP AG. |
| * 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: |
| * mwenz Bug 352119 - initial API, implementation and documentation contributed by Benjamin Schmeling |
| * |
| * </copyright> |
| * |
| *******************************************************************************/ |
| package org.eclipse.graphiti.mm.algorithms.styles.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.EObjectImpl; |
| import org.eclipse.graphiti.mm.algorithms.styles.PrecisionPoint; |
| import org.eclipse.graphiti.mm.algorithms.styles.StylesPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Precision Point</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.graphiti.mm.algorithms.styles.impl.PrecisionPointImpl#getX <em>X</em>}</li> |
| * <li>{@link org.eclipse.graphiti.mm.algorithms.styles.impl.PrecisionPointImpl#getY <em>Y</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class PrecisionPointImpl extends EObjectImpl implements PrecisionPoint { |
| /** |
| * The default value of the '{@link #getX() <em>X</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getX() |
| * @generated |
| * @ordered |
| */ |
| protected static final double X_EDEFAULT = 0.0; |
| |
| /** |
| * The cached value of the '{@link #getX() <em>X</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getX() |
| * @generated |
| * @ordered |
| */ |
| protected double 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 double Y_EDEFAULT = 0.0; |
| |
| /** |
| * The cached value of the '{@link #getY() <em>Y</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getY() |
| * @generated |
| * @ordered |
| */ |
| protected double y = Y_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected PrecisionPointImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return StylesPackage.Literals.PRECISION_POINT; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public double getX() { |
| return x; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setX(double newX) { |
| double oldX = x; |
| x = newX; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, StylesPackage.PRECISION_POINT__X, oldX, x)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public double getY() { |
| return y; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setY(double newY) { |
| double oldY = y; |
| y = newY; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, StylesPackage.PRECISION_POINT__Y, oldY, y)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case StylesPackage.PRECISION_POINT__X: |
| return getX(); |
| case StylesPackage.PRECISION_POINT__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 StylesPackage.PRECISION_POINT__X: |
| setX((Double)newValue); |
| return; |
| case StylesPackage.PRECISION_POINT__Y: |
| setY((Double)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case StylesPackage.PRECISION_POINT__X: |
| setX(X_EDEFAULT); |
| return; |
| case StylesPackage.PRECISION_POINT__Y: |
| setY(Y_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case StylesPackage.PRECISION_POINT__X: |
| return x != X_EDEFAULT; |
| case StylesPackage.PRECISION_POINT__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(); |
| } |
| |
| } //PrecisionPointImpl |