| /******************************************************************************* |
| * Copyright (c) 2009, 2015 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.ecl.model.impl; |
| |
| import org.eclipse.rcptt.tesla.ecl.model.Recognize; |
| import org.eclipse.rcptt.tesla.ecl.model.TeslaPackage; |
| |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.rcptt.ecl.core.impl.CommandImpl; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Recognize</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.rcptt.tesla.ecl.model.impl.RecognizeImpl#getImage <em>Image</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.ecl.model.impl.RecognizeImpl#getX <em>X</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.ecl.model.impl.RecognizeImpl#getY <em>Y</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.ecl.model.impl.RecognizeImpl#getWidth <em>Width</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.ecl.model.impl.RecognizeImpl#getHeight <em>Height</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class RecognizeImpl extends CommandImpl implements Recognize { |
| /** |
| * The default value of the '{@link #getImage() <em>Image</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getImage() |
| * @generated |
| * @ordered |
| */ |
| protected static final byte[] IMAGE_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getImage() <em>Image</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getImage() |
| * @generated |
| * @ordered |
| */ |
| protected byte[] image = IMAGE_EDEFAULT; |
| |
| /** |
| * 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 #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 RecognizeImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return TeslaPackage.Literals.RECOGNIZE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public byte[] getImage() { |
| return image; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setImage(byte[] newImage) { |
| byte[] oldImage = image; |
| image = newImage; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, TeslaPackage.RECOGNIZE__IMAGE, oldImage, image)); |
| } |
| |
| /** |
| * <!-- 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, TeslaPackage.RECOGNIZE__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, TeslaPackage.RECOGNIZE__Y, oldY, y)); |
| } |
| |
| /** |
| * <!-- 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, TeslaPackage.RECOGNIZE__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, TeslaPackage.RECOGNIZE__HEIGHT, oldHeight, height)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case TeslaPackage.RECOGNIZE__IMAGE: |
| return getImage(); |
| case TeslaPackage.RECOGNIZE__X: |
| return getX(); |
| case TeslaPackage.RECOGNIZE__Y: |
| return getY(); |
| case TeslaPackage.RECOGNIZE__WIDTH: |
| return getWidth(); |
| case TeslaPackage.RECOGNIZE__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 TeslaPackage.RECOGNIZE__IMAGE: |
| setImage((byte[])newValue); |
| return; |
| case TeslaPackage.RECOGNIZE__X: |
| setX((Integer)newValue); |
| return; |
| case TeslaPackage.RECOGNIZE__Y: |
| setY((Integer)newValue); |
| return; |
| case TeslaPackage.RECOGNIZE__WIDTH: |
| setWidth((Integer)newValue); |
| return; |
| case TeslaPackage.RECOGNIZE__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 TeslaPackage.RECOGNIZE__IMAGE: |
| setImage(IMAGE_EDEFAULT); |
| return; |
| case TeslaPackage.RECOGNIZE__X: |
| setX(X_EDEFAULT); |
| return; |
| case TeslaPackage.RECOGNIZE__Y: |
| setY(Y_EDEFAULT); |
| return; |
| case TeslaPackage.RECOGNIZE__WIDTH: |
| setWidth(WIDTH_EDEFAULT); |
| return; |
| case TeslaPackage.RECOGNIZE__HEIGHT: |
| setHeight(HEIGHT_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case TeslaPackage.RECOGNIZE__IMAGE: |
| return IMAGE_EDEFAULT == null ? image != null : !IMAGE_EDEFAULT.equals(image); |
| case TeslaPackage.RECOGNIZE__X: |
| return x != X_EDEFAULT; |
| case TeslaPackage.RECOGNIZE__Y: |
| return y != Y_EDEFAULT; |
| case TeslaPackage.RECOGNIZE__WIDTH: |
| return width != WIDTH_EDEFAULT; |
| case TeslaPackage.RECOGNIZE__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(" (image: "); |
| result.append(image); |
| result.append(", x: "); |
| result.append(x); |
| result.append(", y: "); |
| result.append(y); |
| result.append(", width: "); |
| result.append(width); |
| result.append(", height: "); |
| result.append(height); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //RecognizeImpl |