All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.omg.dd.dc.impl.BoundsImpl Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (c) 2012 - 2024 Data In Motion and others.
 * All rights reserved. 
 * 
 * This program and the accompanying materials are made
 * available under the terms of the Eclipse Public License 2.0
 * which is available at https://www.eclipse.org/legal/epl-2.0/
 * 
 * SPDX-License-Identifier: EPL-2.0
 * 
 * Contributors:
 *      Mark Hoffmann - initial API and implementation
 */
package org.omg.dd.dc.impl;

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.MinimalEObjectImpl;

import org.omg.dd.dc.Bounds;
import org.omg.dd.dc.DcPackage;

/**
 * 
 * An implementation of the model object 'Bounds'.
 * 
 * 

* The following features are implemented: *

*
    *
  • {@link org.omg.dd.dc.impl.BoundsImpl#getHeight Height}
  • *
  • {@link org.omg.dd.dc.impl.BoundsImpl#getWidth Width}
  • *
  • {@link org.omg.dd.dc.impl.BoundsImpl#getX X}
  • *
  • {@link org.omg.dd.dc.impl.BoundsImpl#getY Y}
  • *
* * @generated */ public class BoundsImpl extends MinimalEObjectImpl.Container implements Bounds { /** * The default value of the '{@link #getHeight() Height}' attribute. * * * @see #getHeight() * @generated * @ordered */ protected static final float HEIGHT_EDEFAULT = 0.0F; /** * The cached value of the '{@link #getHeight() Height}' attribute. * * * @see #getHeight() * @generated * @ordered */ protected float height = HEIGHT_EDEFAULT; /** * The default value of the '{@link #getWidth() Width}' attribute. * * * @see #getWidth() * @generated * @ordered */ protected static final float WIDTH_EDEFAULT = 0.0F; /** * The cached value of the '{@link #getWidth() Width}' attribute. * * * @see #getWidth() * @generated * @ordered */ protected float width = WIDTH_EDEFAULT; /** * The default value of the '{@link #getX() X}' attribute. * * * @see #getX() * @generated * @ordered */ protected static final float X_EDEFAULT = 0.0F; /** * The cached value of the '{@link #getX() X}' attribute. * * * @see #getX() * @generated * @ordered */ protected float x = X_EDEFAULT; /** * The default value of the '{@link #getY() Y}' attribute. * * * @see #getY() * @generated * @ordered */ protected static final float Y_EDEFAULT = 0.0F; /** * The cached value of the '{@link #getY() Y}' attribute. * * * @see #getY() * @generated * @ordered */ protected float y = Y_EDEFAULT; /** * * * @generated */ protected BoundsImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return DcPackage.Literals.BOUNDS; } /** * * * @generated */ @Override public float getHeight() { return height; } /** * * * @generated */ @Override public void setHeight(float newHeight) { float oldHeight = height; height = newHeight; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DcPackage.BOUNDS__HEIGHT, oldHeight, height)); } /** * * * @generated */ @Override public float getWidth() { return width; } /** * * * @generated */ @Override public void setWidth(float newWidth) { float oldWidth = width; width = newWidth; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DcPackage.BOUNDS__WIDTH, oldWidth, width)); } /** * * * @generated */ @Override public float getX() { return x; } /** * * * @generated */ @Override public void setX(float newX) { float oldX = x; x = newX; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DcPackage.BOUNDS__X, oldX, x)); } /** * * * @generated */ @Override public float getY() { return y; } /** * * * @generated */ @Override public void setY(float newY) { float oldY = y; y = newY; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DcPackage.BOUNDS__Y, oldY, y)); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case DcPackage.BOUNDS__HEIGHT: return getHeight(); case DcPackage.BOUNDS__WIDTH: return getWidth(); case DcPackage.BOUNDS__X: return getX(); case DcPackage.BOUNDS__Y: return getY(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case DcPackage.BOUNDS__HEIGHT: setHeight((Float)newValue); return; case DcPackage.BOUNDS__WIDTH: setWidth((Float)newValue); return; case DcPackage.BOUNDS__X: setX((Float)newValue); return; case DcPackage.BOUNDS__Y: setY((Float)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case DcPackage.BOUNDS__HEIGHT: setHeight(HEIGHT_EDEFAULT); return; case DcPackage.BOUNDS__WIDTH: setWidth(WIDTH_EDEFAULT); return; case DcPackage.BOUNDS__X: setX(X_EDEFAULT); return; case DcPackage.BOUNDS__Y: setY(Y_EDEFAULT); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case DcPackage.BOUNDS__HEIGHT: return height != HEIGHT_EDEFAULT; case DcPackage.BOUNDS__WIDTH: return width != WIDTH_EDEFAULT; case DcPackage.BOUNDS__X: return x != X_EDEFAULT; case DcPackage.BOUNDS__Y: return y != Y_EDEFAULT; } return super.eIsSet(featureID); } /** * * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuilder result = new StringBuilder(super.toString()); result.append(" (height: "); result.append(height); result.append(", width: "); result.append(width); result.append(", x: "); result.append(x); result.append(", y: "); result.append(y); result.append(')'); return result.toString(); } } //BoundsImpl




© 2015 - 2024 Weber Informatics LLC | Privacy Policy