Package net.cis.common.model.base.impl

Source Code of net.cis.common.model.base.impl.AbstractNamedEntityImpl

/**
*/
package net.cis.common.model.base.impl;

import com.jme3.math.Quaternion;
import com.jme3.math.Vector3f;

import net.cis.common.model.base.AbstractNamedEntity;
import net.cis.common.model.base.AbstractVisual;
import net.cis.common.model.base.BasePackage;

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;

/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Abstract Named Entity</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
*   <li>{@link net.cis.common.model.base.impl.AbstractNamedEntityImpl#getName <em>Name</em>}</li>
*   <li>{@link net.cis.common.model.base.impl.AbstractNamedEntityImpl#getLocation <em>Location</em>}</li>
*   <li>{@link net.cis.common.model.base.impl.AbstractNamedEntityImpl#getRotation <em>Rotation</em>}</li>
*   <li>{@link net.cis.common.model.base.impl.AbstractNamedEntityImpl#getLinearVelocity <em>Linear Velocity</em>}</li>
*   <li>{@link net.cis.common.model.base.impl.AbstractNamedEntityImpl#getAngularVelocity <em>Angular Velocity</em>}</li>
*   <li>{@link net.cis.common.model.base.impl.AbstractNamedEntityImpl#getVisual <em>Visual</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public abstract class AbstractNamedEntityImpl extends AbstractEntityImpl implements AbstractNamedEntity {
  /**
   * The default value of the '{@link #getName() <em>Name</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getName()
   * @generated
   * @ordered
   */
  protected static final String NAME_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getName()
   * @generated
   * @ordered
   */
  protected String name = NAME_EDEFAULT;

  /**
   * The default value of the '{@link #getLocation() <em>Location</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getLocation()
   * @generated
   * @ordered
   */
  protected static final Vector3f LOCATION_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getLocation() <em>Location</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getLocation()
   * @generated
   * @ordered
   */
  protected Vector3f location = LOCATION_EDEFAULT;

  /**
   * The default value of the '{@link #getRotation() <em>Rotation</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getRotation()
   * @generated
   * @ordered
   */
  protected static final Quaternion ROTATION_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getRotation() <em>Rotation</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getRotation()
   * @generated
   * @ordered
   */
  protected Quaternion rotation = ROTATION_EDEFAULT;

  /**
   * The default value of the '{@link #getLinearVelocity() <em>Linear Velocity</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getLinearVelocity()
   * @generated
   * @ordered
   */
  protected static final Vector3f LINEAR_VELOCITY_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getLinearVelocity() <em>Linear Velocity</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getLinearVelocity()
   * @generated
   * @ordered
   */
  protected Vector3f linearVelocity = LINEAR_VELOCITY_EDEFAULT;

  /**
   * The default value of the '{@link #getAngularVelocity() <em>Angular Velocity</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getAngularVelocity()
   * @generated
   * @ordered
   */
  protected static final Quaternion ANGULAR_VELOCITY_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getAngularVelocity() <em>Angular Velocity</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getAngularVelocity()
   * @generated
   * @ordered
   */
  protected Quaternion angularVelocity = ANGULAR_VELOCITY_EDEFAULT;

  /**
   * The cached value of the '{@link #getVisual() <em>Visual</em>}' containment reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getVisual()
   * @generated
   * @ordered
   */
  protected AbstractVisual visual;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected AbstractNamedEntityImpl() {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass() {
    return BasePackage.Literals.ABSTRACT_NAMED_ENTITY;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getName() {
    return name;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setName(String newName) {
    String oldName = name;
    name = newName;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, BasePackage.ABSTRACT_NAMED_ENTITY__NAME, oldName, name));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Vector3f getLocation() {
    return location;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setLocation(Vector3f newLocation) {
    Vector3f oldLocation = location;
    location = newLocation;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, BasePackage.ABSTRACT_NAMED_ENTITY__LOCATION, oldLocation, location));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Quaternion getRotation() {
    return rotation;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setRotation(Quaternion newRotation) {
    Quaternion oldRotation = rotation;
    rotation = newRotation;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, BasePackage.ABSTRACT_NAMED_ENTITY__ROTATION, oldRotation, rotation));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Vector3f getLinearVelocity() {
    return linearVelocity;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setLinearVelocity(Vector3f newLinearVelocity) {
    Vector3f oldLinearVelocity = linearVelocity;
    linearVelocity = newLinearVelocity;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, BasePackage.ABSTRACT_NAMED_ENTITY__LINEAR_VELOCITY, oldLinearVelocity, linearVelocity));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Quaternion getAngularVelocity() {
    return angularVelocity;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setAngularVelocity(Quaternion newAngularVelocity) {
    Quaternion oldAngularVelocity = angularVelocity;
    angularVelocity = newAngularVelocity;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, BasePackage.ABSTRACT_NAMED_ENTITY__ANGULAR_VELOCITY, oldAngularVelocity, angularVelocity));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public AbstractVisual getVisual() {
    return visual;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetVisual(AbstractVisual newVisual, NotificationChain msgs) {
    AbstractVisual oldVisual = visual;
    visual = newVisual;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BasePackage.ABSTRACT_NAMED_ENTITY__VISUAL, oldVisual, newVisual);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
    return msgs;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setVisual(AbstractVisual newVisual) {
    if (newVisual != visual) {
      NotificationChain msgs = null;
      if (visual != null)
        msgs = ((InternalEObject)visual).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BasePackage.ABSTRACT_NAMED_ENTITY__VISUAL, null, msgs);
      if (newVisual != null)
        msgs = ((InternalEObject)newVisual).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BasePackage.ABSTRACT_NAMED_ENTITY__VISUAL, null, msgs);
      msgs = basicSetVisual(newVisual, msgs);
      if (msgs != null) msgs.dispatch();
    }
    else if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, BasePackage.ABSTRACT_NAMED_ENTITY__VISUAL, newVisual, newVisual));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
    switch (featureID) {
      case BasePackage.ABSTRACT_NAMED_ENTITY__VISUAL:
        return basicSetVisual(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 BasePackage.ABSTRACT_NAMED_ENTITY__NAME:
        return getName();
      case BasePackage.ABSTRACT_NAMED_ENTITY__LOCATION:
        return getLocation();
      case BasePackage.ABSTRACT_NAMED_ENTITY__ROTATION:
        return getRotation();
      case BasePackage.ABSTRACT_NAMED_ENTITY__LINEAR_VELOCITY:
        return getLinearVelocity();
      case BasePackage.ABSTRACT_NAMED_ENTITY__ANGULAR_VELOCITY:
        return getAngularVelocity();
      case BasePackage.ABSTRACT_NAMED_ENTITY__VISUAL:
        return getVisual();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue) {
    switch (featureID) {
      case BasePackage.ABSTRACT_NAMED_ENTITY__NAME:
        setName((String)newValue);
        return;
      case BasePackage.ABSTRACT_NAMED_ENTITY__LOCATION:
        setLocation((Vector3f)newValue);
        return;
      case BasePackage.ABSTRACT_NAMED_ENTITY__ROTATION:
        setRotation((Quaternion)newValue);
        return;
      case BasePackage.ABSTRACT_NAMED_ENTITY__LINEAR_VELOCITY:
        setLinearVelocity((Vector3f)newValue);
        return;
      case BasePackage.ABSTRACT_NAMED_ENTITY__ANGULAR_VELOCITY:
        setAngularVelocity((Quaternion)newValue);
        return;
      case BasePackage.ABSTRACT_NAMED_ENTITY__VISUAL:
        setVisual((AbstractVisual)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID) {
    switch (featureID) {
      case BasePackage.ABSTRACT_NAMED_ENTITY__NAME:
        setName(NAME_EDEFAULT);
        return;
      case BasePackage.ABSTRACT_NAMED_ENTITY__LOCATION:
        setLocation(LOCATION_EDEFAULT);
        return;
      case BasePackage.ABSTRACT_NAMED_ENTITY__ROTATION:
        setRotation(ROTATION_EDEFAULT);
        return;
      case BasePackage.ABSTRACT_NAMED_ENTITY__LINEAR_VELOCITY:
        setLinearVelocity(LINEAR_VELOCITY_EDEFAULT);
        return;
      case BasePackage.ABSTRACT_NAMED_ENTITY__ANGULAR_VELOCITY:
        setAngularVelocity(ANGULAR_VELOCITY_EDEFAULT);
        return;
      case BasePackage.ABSTRACT_NAMED_ENTITY__VISUAL:
        setVisual((AbstractVisual)null);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID) {
    switch (featureID) {
      case BasePackage.ABSTRACT_NAMED_ENTITY__NAME:
        return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
      case BasePackage.ABSTRACT_NAMED_ENTITY__LOCATION:
        return LOCATION_EDEFAULT == null ? location != null : !LOCATION_EDEFAULT.equals(location);
      case BasePackage.ABSTRACT_NAMED_ENTITY__ROTATION:
        return ROTATION_EDEFAULT == null ? rotation != null : !ROTATION_EDEFAULT.equals(rotation);
      case BasePackage.ABSTRACT_NAMED_ENTITY__LINEAR_VELOCITY:
        return LINEAR_VELOCITY_EDEFAULT == null ? linearVelocity != null : !LINEAR_VELOCITY_EDEFAULT.equals(linearVelocity);
      case BasePackage.ABSTRACT_NAMED_ENTITY__ANGULAR_VELOCITY:
        return ANGULAR_VELOCITY_EDEFAULT == null ? angularVelocity != null : !ANGULAR_VELOCITY_EDEFAULT.equals(angularVelocity);
      case BasePackage.ABSTRACT_NAMED_ENTITY__VISUAL:
        return visual != null;
    }
    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(" (name: ");
    result.append(name);
    result.append(", location: ");
    result.append(location);
    result.append(", rotation: ");
    result.append(rotation);
    result.append(", linearVelocity: ");
    result.append(linearVelocity);
    result.append(", angularVelocity: ");
    result.append(angularVelocity);
    result.append(')');
    return result.toString();
  }

} //AbstractNamedEntityImpl
TOP

Related Classes of net.cis.common.model.base.impl.AbstractNamedEntityImpl

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.