blob: 33819be4e3f73adcc961418cf431e789fd19b1ca [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2009, 2016 Xored Software Inc and others.
* 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:
* Xored Software Inc - initial API and implementation and/or initial documentation
*******************************************************************************/
package org.eclipse.rcptt.tesla.core.protocol.impl;
import org.eclipse.rcptt.tesla.core.protocol.GetRegionText;
import org.eclipse.rcptt.tesla.core.protocol.ProtocolPackage;
import org.eclipse.rcptt.tesla.core.protocol.raw.Element;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Get Region Text</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.rcptt.tesla.core.protocol.impl.GetRegionTextImpl#getId <em>Id</em>}</li>
* <li>{@link org.eclipse.rcptt.tesla.core.protocol.impl.GetRegionTextImpl#getElement <em>Element</em>}</li>
* <li>{@link org.eclipse.rcptt.tesla.core.protocol.impl.GetRegionTextImpl#getX <em>X</em>}</li>
* <li>{@link org.eclipse.rcptt.tesla.core.protocol.impl.GetRegionTextImpl#getY <em>Y</em>}</li>
* <li>{@link org.eclipse.rcptt.tesla.core.protocol.impl.GetRegionTextImpl#getSx <em>Sx</em>}</li>
* <li>{@link org.eclipse.rcptt.tesla.core.protocol.impl.GetRegionTextImpl#getSy <em>Sy</em>}</li>
* <li>{@link org.eclipse.rcptt.tesla.core.protocol.impl.GetRegionTextImpl#getWidth <em>Width</em>}</li>
* <li>{@link org.eclipse.rcptt.tesla.core.protocol.impl.GetRegionTextImpl#getHeight <em>Height</em>}</li>
* </ul>
*
* @generated
*/
public class GetRegionTextImpl extends EObjectImpl implements GetRegionText {
/**
* The default value of the '{@link #getId() <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getId()
* @generated
* @ordered
*/
protected static final int ID_EDEFAULT = 0;
/**
* The cached value of the '{@link #getId() <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getId()
* @generated
* @ordered
*/
protected int id = ID_EDEFAULT;
/**
* The cached value of the '{@link #getElement() <em>Element</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getElement()
* @generated
* @ordered
*/
protected Element element;
/**
* 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;
/**
* The default value of the '{@link #getSx() <em>Sx</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSx()
* @generated
* @ordered
*/
protected static final int SX_EDEFAULT = 0;
/**
* The cached value of the '{@link #getSx() <em>Sx</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSx()
* @generated
* @ordered
*/
protected int sx = SX_EDEFAULT;
/**
* The default value of the '{@link #getSy() <em>Sy</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSy()
* @generated
* @ordered
*/
protected static final int SY_EDEFAULT = 0;
/**
* The cached value of the '{@link #getSy() <em>Sy</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSy()
* @generated
* @ordered
*/
protected int sy = SY_EDEFAULT;
/**
* The default value of the '{@link #getWidth() <em>Width</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getWidth()
* @generated
* @ordered
*/
protected static final int WIDTH_EDEFAULT = 0;
/**
* The cached value of the '{@link #getWidth() <em>Width</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getWidth()
* @generated
* @ordered
*/
protected int width = WIDTH_EDEFAULT;
/**
* The default value of the '{@link #getHeight() <em>Height</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getHeight()
* @generated
* @ordered
*/
protected static final int HEIGHT_EDEFAULT = 0;
/**
* The cached value of the '{@link #getHeight() <em>Height</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getHeight()
* @generated
* @ordered
*/
protected int height = HEIGHT_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected GetRegionTextImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ProtocolPackage.Literals.GET_REGION_TEXT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public int getId() {
return id;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setId(int newId) {
int oldId = id;
id = newId;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ProtocolPackage.GET_REGION_TEXT__ID, oldId, id));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Element getElement() {
return element;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetElement(Element newElement, NotificationChain msgs) {
Element oldElement = element;
element = newElement;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ProtocolPackage.GET_REGION_TEXT__ELEMENT, oldElement, newElement);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setElement(Element newElement) {
if (newElement != element) {
NotificationChain msgs = null;
if (element != null)
msgs = ((InternalEObject)element).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ProtocolPackage.GET_REGION_TEXT__ELEMENT, null, msgs);
if (newElement != null)
msgs = ((InternalEObject)newElement).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ProtocolPackage.GET_REGION_TEXT__ELEMENT, null, msgs);
msgs = basicSetElement(newElement, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ProtocolPackage.GET_REGION_TEXT__ELEMENT, newElement, newElement));
}
/**
* <!-- 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, ProtocolPackage.GET_REGION_TEXT__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, ProtocolPackage.GET_REGION_TEXT__Y, oldY, y));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public int getSx() {
return sx;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setSx(int newSx) {
int oldSx = sx;
sx = newSx;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ProtocolPackage.GET_REGION_TEXT__SX, oldSx, sx));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public int getSy() {
return sy;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setSy(int newSy) {
int oldSy = sy;
sy = newSy;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ProtocolPackage.GET_REGION_TEXT__SY, oldSy, sy));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public int getWidth() {
return width;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setWidth(int newWidth) {
int oldWidth = width;
width = newWidth;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ProtocolPackage.GET_REGION_TEXT__WIDTH, oldWidth, width));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public int getHeight() {
return height;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setHeight(int newHeight) {
int oldHeight = height;
height = newHeight;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ProtocolPackage.GET_REGION_TEXT__HEIGHT, oldHeight, height));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case ProtocolPackage.GET_REGION_TEXT__ELEMENT:
return basicSetElement(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ProtocolPackage.GET_REGION_TEXT__ID:
return getId();
case ProtocolPackage.GET_REGION_TEXT__ELEMENT:
return getElement();
case ProtocolPackage.GET_REGION_TEXT__X:
return getX();
case ProtocolPackage.GET_REGION_TEXT__Y:
return getY();
case ProtocolPackage.GET_REGION_TEXT__SX:
return getSx();
case ProtocolPackage.GET_REGION_TEXT__SY:
return getSy();
case ProtocolPackage.GET_REGION_TEXT__WIDTH:
return getWidth();
case ProtocolPackage.GET_REGION_TEXT__HEIGHT:
return getHeight();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ProtocolPackage.GET_REGION_TEXT__ID:
setId((Integer)newValue);
return;
case ProtocolPackage.GET_REGION_TEXT__ELEMENT:
setElement((Element)newValue);
return;
case ProtocolPackage.GET_REGION_TEXT__X:
setX((Integer)newValue);
return;
case ProtocolPackage.GET_REGION_TEXT__Y:
setY((Integer)newValue);
return;
case ProtocolPackage.GET_REGION_TEXT__SX:
setSx((Integer)newValue);
return;
case ProtocolPackage.GET_REGION_TEXT__SY:
setSy((Integer)newValue);
return;
case ProtocolPackage.GET_REGION_TEXT__WIDTH:
setWidth((Integer)newValue);
return;
case ProtocolPackage.GET_REGION_TEXT__HEIGHT:
setHeight((Integer)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ProtocolPackage.GET_REGION_TEXT__ID:
setId(ID_EDEFAULT);
return;
case ProtocolPackage.GET_REGION_TEXT__ELEMENT:
setElement((Element)null);
return;
case ProtocolPackage.GET_REGION_TEXT__X:
setX(X_EDEFAULT);
return;
case ProtocolPackage.GET_REGION_TEXT__Y:
setY(Y_EDEFAULT);
return;
case ProtocolPackage.GET_REGION_TEXT__SX:
setSx(SX_EDEFAULT);
return;
case ProtocolPackage.GET_REGION_TEXT__SY:
setSy(SY_EDEFAULT);
return;
case ProtocolPackage.GET_REGION_TEXT__WIDTH:
setWidth(WIDTH_EDEFAULT);
return;
case ProtocolPackage.GET_REGION_TEXT__HEIGHT:
setHeight(HEIGHT_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ProtocolPackage.GET_REGION_TEXT__ID:
return id != ID_EDEFAULT;
case ProtocolPackage.GET_REGION_TEXT__ELEMENT:
return element != null;
case ProtocolPackage.GET_REGION_TEXT__X:
return x != X_EDEFAULT;
case ProtocolPackage.GET_REGION_TEXT__Y:
return y != Y_EDEFAULT;
case ProtocolPackage.GET_REGION_TEXT__SX:
return sx != SX_EDEFAULT;
case ProtocolPackage.GET_REGION_TEXT__SY:
return sy != SY_EDEFAULT;
case ProtocolPackage.GET_REGION_TEXT__WIDTH:
return width != WIDTH_EDEFAULT;
case ProtocolPackage.GET_REGION_TEXT__HEIGHT:
return height != HEIGHT_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(" (id: ");
result.append(id);
result.append(", x: ");
result.append(x);
result.append(", y: ");
result.append(y);
result.append(", sx: ");
result.append(sx);
result.append(", sy: ");
result.append(sy);
result.append(", width: ");
result.append(width);
result.append(", height: ");
result.append(height);
result.append(')');
return result.toString();
}
} //GetRegionTextImpl