/*******************************************************************************
* Copyright (c) 2006-2012
* Software Technology Group, Dresden University of Technology
* DevBoost GmbH, Berlin, Amtsgericht Charlottenburg, HRB 140026
*
* 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:
* Software Technology Group - TU Dresden, Germany;
* DevBoost GmbH - Berlin, Germany
* - initial API and implementation
******************************************************************************/
/**
* <copyright>
* </copyright>
*
* $Id$
*/
package org.oasisopen.names.tc.opendocument.xmlns.drawing.impl;
import java.math.BigInteger;
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.oasisopen.names.tc.opendocument.xmlns.drawing.AlignType;
import org.oasisopen.names.tc.opendocument.xmlns.drawing.DrawingPackage;
import org.oasisopen.names.tc.opendocument.xmlns.drawing.GluePointType;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Glue Point Type</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.oasisopen.names.tc.opendocument.xmlns.drawing.impl.GluePointTypeImpl#getAlign <em>Align</em>}</li>
* <li>{@link org.oasisopen.names.tc.opendocument.xmlns.drawing.impl.GluePointTypeImpl#getId <em>Id</em>}</li>
* <li>{@link org.oasisopen.names.tc.opendocument.xmlns.drawing.impl.GluePointTypeImpl#getX <em>X</em>}</li>
* <li>{@link org.oasisopen.names.tc.opendocument.xmlns.drawing.impl.GluePointTypeImpl#getY <em>Y</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class GluePointTypeImpl extends EObjectImpl implements GluePointType {
/**
* The default value of the '{@link #getAlign() <em>Align</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAlign()
* @generated
* @ordered
*/
protected static final AlignType ALIGN_EDEFAULT = AlignType.TOP_LEFT;
/**
* The cached value of the '{@link #getAlign() <em>Align</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAlign()
* @generated
* @ordered
*/
protected AlignType align = ALIGN_EDEFAULT;
/**
* This is true if the Align attribute has been set.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
protected boolean alignESet;
/**
* The default value of the '{@link #getId() <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getId()
* @generated
* @ordered
*/
protected static final BigInteger 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 BigInteger id = ID_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 String X_EDEFAULT = null;
/**
* The cached value of the '{@link #getX() <em>X</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getX()
* @generated
* @ordered
*/
protected String 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 String Y_EDEFAULT = null;
/**
* The cached value of the '{@link #getY() <em>Y</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getY()
* @generated
* @ordered
*/
protected String y = Y_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected GluePointTypeImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return DrawingPackage.eINSTANCE.getGluePointType();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public AlignType getAlign() {
return align;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setAlign(AlignType newAlign) {
AlignType oldAlign = align;
align = newAlign == null ? ALIGN_EDEFAULT : newAlign;
boolean oldAlignESet = alignESet;
alignESet = true;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DrawingPackage.GLUE_POINT_TYPE__ALIGN, oldAlign, align, !oldAlignESet));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void unsetAlign() {
AlignType oldAlign = align;
boolean oldAlignESet = alignESet;
align = ALIGN_EDEFAULT;
alignESet = false;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.UNSET, DrawingPackage.GLUE_POINT_TYPE__ALIGN, oldAlign, ALIGN_EDEFAULT, oldAlignESet));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isSetAlign() {
return alignESet;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public BigInteger getId() {
return id;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setId(BigInteger newId) {
BigInteger oldId = id;
id = newId;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DrawingPackage.GLUE_POINT_TYPE__ID, oldId, id));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getX() {
return x;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setX(String newX) {
String oldX = x;
x = newX;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DrawingPackage.GLUE_POINT_TYPE__X, oldX, x));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getY() {
return y;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setY(String newY) {
String oldY = y;
y = newY;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DrawingPackage.GLUE_POINT_TYPE__Y, oldY, y));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case DrawingPackage.GLUE_POINT_TYPE__ALIGN:
return getAlign();
case DrawingPackage.GLUE_POINT_TYPE__ID:
return getId();
case DrawingPackage.GLUE_POINT_TYPE__X:
return getX();
case DrawingPackage.GLUE_POINT_TYPE__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 DrawingPackage.GLUE_POINT_TYPE__ALIGN:
setAlign((AlignType)newValue);
return;
case DrawingPackage.GLUE_POINT_TYPE__ID:
setId((BigInteger)newValue);
return;
case DrawingPackage.GLUE_POINT_TYPE__X:
setX((String)newValue);
return;
case DrawingPackage.GLUE_POINT_TYPE__Y:
setY((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case DrawingPackage.GLUE_POINT_TYPE__ALIGN:
unsetAlign();
return;
case DrawingPackage.GLUE_POINT_TYPE__ID:
setId(ID_EDEFAULT);
return;
case DrawingPackage.GLUE_POINT_TYPE__X:
setX(X_EDEFAULT);
return;
case DrawingPackage.GLUE_POINT_TYPE__Y:
setY(Y_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case DrawingPackage.GLUE_POINT_TYPE__ALIGN:
return isSetAlign();
case DrawingPackage.GLUE_POINT_TYPE__ID:
return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
case DrawingPackage.GLUE_POINT_TYPE__X:
return X_EDEFAULT == null ? x != null : !X_EDEFAULT.equals(x);
case DrawingPackage.GLUE_POINT_TYPE__Y:
return Y_EDEFAULT == null ? y != null : !Y_EDEFAULT.equals(y);
}
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(" (align: ");
if (alignESet) result.append(align); else result.append("<unset>");
result.append(", id: ");
result.append(id);
result.append(", x: ");
result.append(x);
result.append(", y: ");
result.append(y);
result.append(')');
return result.toString();
}
} //GluePointTypeImpl