/** * <copyright> * </copyright> * * $Id$ */ package fr.inria.atlanmod.collaboro.notation.impl; import fr.inria.atlanmod.collaboro.notation.Color; import fr.inria.atlanmod.collaboro.notation.GraphicalElement; import fr.inria.atlanmod.collaboro.notation.NotationPackage; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Graphical Element</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link fr.inria.atlanmod.collaboro.notation.impl.GraphicalElementImpl#getX <em>X</em>}</li> * <li>{@link fr.inria.atlanmod.collaboro.notation.impl.GraphicalElementImpl#getY <em>Y</em>}</li> * <li>{@link fr.inria.atlanmod.collaboro.notation.impl.GraphicalElementImpl#getHeight <em>Height</em>}</li> * <li>{@link fr.inria.atlanmod.collaboro.notation.impl.GraphicalElementImpl#getWidth <em>Width</em>}</li> * <li>{@link fr.inria.atlanmod.collaboro.notation.impl.GraphicalElementImpl#getFill <em>Fill</em>}</li> * <li>{@link fr.inria.atlanmod.collaboro.notation.impl.GraphicalElementImpl#getStroke <em>Stroke</em>}</li> * </ul> * </p> * * @generated */ public abstract class GraphicalElementImpl extends NotationElementImpl implements GraphicalElement { /** * 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 #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; /** * 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 #getFill() <em>Fill</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getFill() * @generated * @ordered */ protected static final Color FILL_EDEFAULT = Color.WHITE; /** * The cached value of the '{@link #getFill() <em>Fill</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getFill() * @generated * @ordered */ protected Color fill = FILL_EDEFAULT; /** * The default value of the '{@link #getStroke() <em>Stroke</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getStroke() * @generated * @ordered */ protected static final Color STROKE_EDEFAULT = Color.BLACK; /** * The cached value of the '{@link #getStroke() <em>Stroke</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getStroke() * @generated * @ordered */ protected Color stroke = STROKE_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected GraphicalElementImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return NotationPackage.Literals.GRAPHICAL_ELEMENT; } /** * <!-- 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, NotationPackage.GRAPHICAL_ELEMENT__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, NotationPackage.GRAPHICAL_ELEMENT__Y, oldY, y)); } /** * <!-- 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, NotationPackage.GRAPHICAL_ELEMENT__HEIGHT, oldHeight, height)); } /** * <!-- 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, NotationPackage.GRAPHICAL_ELEMENT__WIDTH, oldWidth, width)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Color getFill() { return fill; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setFill(Color newFill) { Color oldFill = fill; fill = newFill == null ? FILL_EDEFAULT : newFill; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, NotationPackage.GRAPHICAL_ELEMENT__FILL, oldFill, fill)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Color getStroke() { return stroke; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setStroke(Color newStroke) { Color oldStroke = stroke; stroke = newStroke == null ? STROKE_EDEFAULT : newStroke; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, NotationPackage.GRAPHICAL_ELEMENT__STROKE, oldStroke, stroke)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case NotationPackage.GRAPHICAL_ELEMENT__X: return getX(); case NotationPackage.GRAPHICAL_ELEMENT__Y: return getY(); case NotationPackage.GRAPHICAL_ELEMENT__HEIGHT: return getHeight(); case NotationPackage.GRAPHICAL_ELEMENT__WIDTH: return getWidth(); case NotationPackage.GRAPHICAL_ELEMENT__FILL: return getFill(); case NotationPackage.GRAPHICAL_ELEMENT__STROKE: return getStroke(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case NotationPackage.GRAPHICAL_ELEMENT__X: setX((Integer)newValue); return; case NotationPackage.GRAPHICAL_ELEMENT__Y: setY((Integer)newValue); return; case NotationPackage.GRAPHICAL_ELEMENT__HEIGHT: setHeight((Integer)newValue); return; case NotationPackage.GRAPHICAL_ELEMENT__WIDTH: setWidth((Integer)newValue); return; case NotationPackage.GRAPHICAL_ELEMENT__FILL: setFill((Color)newValue); return; case NotationPackage.GRAPHICAL_ELEMENT__STROKE: setStroke((Color)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case NotationPackage.GRAPHICAL_ELEMENT__X: setX(X_EDEFAULT); return; case NotationPackage.GRAPHICAL_ELEMENT__Y: setY(Y_EDEFAULT); return; case NotationPackage.GRAPHICAL_ELEMENT__HEIGHT: setHeight(HEIGHT_EDEFAULT); return; case NotationPackage.GRAPHICAL_ELEMENT__WIDTH: setWidth(WIDTH_EDEFAULT); return; case NotationPackage.GRAPHICAL_ELEMENT__FILL: setFill(FILL_EDEFAULT); return; case NotationPackage.GRAPHICAL_ELEMENT__STROKE: setStroke(STROKE_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case NotationPackage.GRAPHICAL_ELEMENT__X: return x != X_EDEFAULT; case NotationPackage.GRAPHICAL_ELEMENT__Y: return y != Y_EDEFAULT; case NotationPackage.GRAPHICAL_ELEMENT__HEIGHT: return height != HEIGHT_EDEFAULT; case NotationPackage.GRAPHICAL_ELEMENT__WIDTH: return width != WIDTH_EDEFAULT; case NotationPackage.GRAPHICAL_ELEMENT__FILL: return fill != FILL_EDEFAULT; case NotationPackage.GRAPHICAL_ELEMENT__STROKE: return stroke != STROKE_EDEFAULT; } 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(" (x: "); result.append(x); result.append(", y: "); result.append(y); result.append(", height: "); result.append(height); result.append(", width: "); result.append(width); result.append(", fill: "); result.append(fill); result.append(", stroke: "); result.append(stroke); result.append(')'); return result.toString(); } } //GraphicalElementImpl