diff options
Diffstat (limited to 'rba.model.view/src/rba/view/impl/SizeImpl.java')
-rw-r--r-- | rba.model.view/src/rba/view/impl/SizeImpl.java | 274 |
1 files changed, 274 insertions, 0 deletions
diff --git a/rba.model.view/src/rba/view/impl/SizeImpl.java b/rba.model.view/src/rba/view/impl/SizeImpl.java new file mode 100644 index 0000000..f320ca4 --- /dev/null +++ b/rba.model.view/src/rba/view/impl/SizeImpl.java @@ -0,0 +1,274 @@ +/** + */ +package rba.view.impl; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import rba.core.impl.PackagableElementImpl; + +import rba.view.RBAViewPackage; +import rba.view.Size; + +/** + * <!-- begin-user-doc --> An implementation of the model object '<em><b>Size</b></em>'. <!-- end-user-doc --> + * <p> + * The following features are implemented: + * </p> + * <ul> + * <li>{@link rba.view.impl.SizeImpl#getWidth <em>Width</em>}</li> + * <li>{@link rba.view.impl.SizeImpl#getHeight <em>Height</em>}</li> + * </ul> + * + * @generated + */ +public class SizeImpl extends PackagableElementImpl implements Size { + /** + * 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; + + /** + * This is true if the Width attribute has been set. + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + * @ordered + */ + protected boolean widthESet; + + /** + * 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; + + /** + * This is true if the Height attribute has been set. + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + * @ordered + */ + protected boolean heightESet; + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + protected SizeImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return RBAViewPackage.Literals.SIZE; + } + + /** + * <!-- 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; + boolean oldWidthESet = widthESet; + widthESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, RBAViewPackage.SIZE__WIDTH, oldWidth, width, + !oldWidthESet)); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + public void unsetWidth() { + int oldWidth = width; + boolean oldWidthESet = widthESet; + width = WIDTH_EDEFAULT; + widthESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, RBAViewPackage.SIZE__WIDTH, oldWidth, + WIDTH_EDEFAULT, oldWidthESet)); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + public boolean isSetWidth() { + return widthESet; + } + + /** + * <!-- 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; + boolean oldHeightESet = heightESet; + heightESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, RBAViewPackage.SIZE__HEIGHT, oldHeight, height, + !oldHeightESet)); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + public void unsetHeight() { + int oldHeight = height; + boolean oldHeightESet = heightESet; + height = HEIGHT_EDEFAULT; + heightESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, RBAViewPackage.SIZE__HEIGHT, oldHeight, + HEIGHT_EDEFAULT, oldHeightESet)); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + public boolean isSetHeight() { + return heightESet; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case RBAViewPackage.SIZE__WIDTH: + return getWidth(); + case RBAViewPackage.SIZE__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 RBAViewPackage.SIZE__WIDTH: + setWidth((Integer) newValue); + return; + case RBAViewPackage.SIZE__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 RBAViewPackage.SIZE__WIDTH: + unsetWidth(); + return; + case RBAViewPackage.SIZE__HEIGHT: + unsetHeight(); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case RBAViewPackage.SIZE__WIDTH: + return isSetWidth(); + case RBAViewPackage.SIZE__HEIGHT: + return isSetHeight(); + } + 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(" (width: "); + if (widthESet) + result.append(width); + else + result.append("<unset>"); + result.append(", height: "); + if (heightESet) + result.append(height); + else + result.append("<unset>"); + result.append(')'); + return result.toString(); + } + +} // SizeImpl |