Package at.bestsolution.efxclipse.formats.fxg.fxg.impl

Source Code of at.bestsolution.efxclipse.formats.fxg.fxg.impl.PlaceObjectImpl

/**
* <copyright>
* </copyright>
*
* $Id$
*/
package at.bestsolution.efxclipse.formats.fxg.fxg.impl;

import at.bestsolution.efxclipse.formats.fxg.fxg.Filter;
import at.bestsolution.efxclipse.formats.fxg.fxg.FxgPackage;
import at.bestsolution.efxclipse.formats.fxg.fxg.Group;
import at.bestsolution.efxclipse.formats.fxg.fxg.PlaceObject;
import at.bestsolution.efxclipse.formats.fxg.fxg.Transform;

import java.util.Collection;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

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;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Place Object</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
*   <li>{@link at.bestsolution.efxclipse.formats.fxg.fxg.impl.PlaceObjectImpl#getId <em>Id</em>}</li>
*   <li>{@link at.bestsolution.efxclipse.formats.fxg.fxg.impl.PlaceObjectImpl#getTransform <em>Transform</em>}</li>
*   <li>{@link at.bestsolution.efxclipse.formats.fxg.fxg.impl.PlaceObjectImpl#getFilters <em>Filters</em>}</li>
*   <li>{@link at.bestsolution.efxclipse.formats.fxg.fxg.impl.PlaceObjectImpl#getMask <em>Mask</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class PlaceObjectImpl extends EObjectImpl implements PlaceObject {
  /**
   * The default value of the '{@link #getId() <em>Id</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getId()
   * @generated
   * @ordered
   */
  protected static final String ID_EDEFAULT = null;

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

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

  /**
   * The cached value of the '{@link #getFilters() <em>Filters</em>}' containment reference list.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getFilters()
   * @generated
   * @ordered
   */
  protected EList<Filter> filters;

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

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

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

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

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setId(String newId) {
    String oldId = id;
    id = newId;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, FxgPackage.PLACE_OBJECT__ID, oldId, id));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Transform getTransform() {
    return transform;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetTransform(Transform newTransform, NotificationChain msgs) {
    Transform oldTransform = transform;
    transform = newTransform;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FxgPackage.PLACE_OBJECT__TRANSFORM, oldTransform, newTransform);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
    return msgs;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setTransform(Transform newTransform) {
    if (newTransform != transform) {
      NotificationChain msgs = null;
      if (transform != null)
        msgs = ((InternalEObject)transform).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FxgPackage.PLACE_OBJECT__TRANSFORM, null, msgs);
      if (newTransform != null)
        msgs = ((InternalEObject)newTransform).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FxgPackage.PLACE_OBJECT__TRANSFORM, null, msgs);
      msgs = basicSetTransform(newTransform, msgs);
      if (msgs != null) msgs.dispatch();
    }
    else if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, FxgPackage.PLACE_OBJECT__TRANSFORM, newTransform, newTransform));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EList<Filter> getFilters() {
    if (filters == null) {
      filters = new EObjectContainmentEList<Filter>(Filter.class, this, FxgPackage.PLACE_OBJECT__FILTERS);
    }
    return filters;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Group getMask() {
    return mask;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetMask(Group newMask, NotificationChain msgs) {
    Group oldMask = mask;
    mask = newMask;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FxgPackage.PLACE_OBJECT__MASK, oldMask, newMask);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
    return msgs;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setMask(Group newMask) {
    if (newMask != mask) {
      NotificationChain msgs = null;
      if (mask != null)
        msgs = ((InternalEObject)mask).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FxgPackage.PLACE_OBJECT__MASK, null, msgs);
      if (newMask != null)
        msgs = ((InternalEObject)newMask).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FxgPackage.PLACE_OBJECT__MASK, null, msgs);
      msgs = basicSetMask(newMask, msgs);
      if (msgs != null) msgs.dispatch();
    }
    else if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, FxgPackage.PLACE_OBJECT__MASK, newMask, newMask));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
    switch (featureID) {
      case FxgPackage.PLACE_OBJECT__TRANSFORM:
        return basicSetTransform(null, msgs);
      case FxgPackage.PLACE_OBJECT__FILTERS:
        return ((InternalEList<?>)getFilters()).basicRemove(otherEnd, msgs);
      case FxgPackage.PLACE_OBJECT__MASK:
        return basicSetMask(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 FxgPackage.PLACE_OBJECT__ID:
        return getId();
      case FxgPackage.PLACE_OBJECT__TRANSFORM:
        return getTransform();
      case FxgPackage.PLACE_OBJECT__FILTERS:
        return getFilters();
      case FxgPackage.PLACE_OBJECT__MASK:
        return getMask();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @SuppressWarnings("unchecked")
  @Override
  public void eSet(int featureID, Object newValue) {
    switch (featureID) {
      case FxgPackage.PLACE_OBJECT__ID:
        setId((String)newValue);
        return;
      case FxgPackage.PLACE_OBJECT__TRANSFORM:
        setTransform((Transform)newValue);
        return;
      case FxgPackage.PLACE_OBJECT__FILTERS:
        getFilters().clear();
        getFilters().addAll((Collection<? extends Filter>)newValue);
        return;
      case FxgPackage.PLACE_OBJECT__MASK:
        setMask((Group)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID) {
    switch (featureID) {
      case FxgPackage.PLACE_OBJECT__ID:
        setId(ID_EDEFAULT);
        return;
      case FxgPackage.PLACE_OBJECT__TRANSFORM:
        setTransform((Transform)null);
        return;
      case FxgPackage.PLACE_OBJECT__FILTERS:
        getFilters().clear();
        return;
      case FxgPackage.PLACE_OBJECT__MASK:
        setMask((Group)null);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID) {
    switch (featureID) {
      case FxgPackage.PLACE_OBJECT__ID:
        return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
      case FxgPackage.PLACE_OBJECT__TRANSFORM:
        return transform != null;
      case FxgPackage.PLACE_OBJECT__FILTERS:
        return filters != null && !filters.isEmpty();
      case FxgPackage.PLACE_OBJECT__MASK:
        return mask != 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(" (id: ");
    result.append(id);
    result.append(')');
    return result.toString();
  }

} //PlaceObjectImpl
TOP

Related Classes of at.bestsolution.efxclipse.formats.fxg.fxg.impl.PlaceObjectImpl

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.